From 47da54ed6908b41c71fc31d7f8b1511ba373b620 Mon Sep 17 00:00:00 2001 From: cDanowski Date: Sun, 2 Jul 2023 22:27:48 +0200 Subject: [PATCH 1/8] introduce typescript to the project incl setup with tsconfig file and transpiling to ES 2022 --- app/app.js | 860 +-- app/app.js.map | 1 + app/app.ts | 526 ++ .../admin-app-config.component.js | 360 +- .../admin-app-config.component.js.map | 1 + .../admin-app-config.component.ts | 205 + .../adminAppConfig/admin-app-config.module.js | 2 + .../admin-app-config.module.js.map | 1 + .../adminAppConfig/admin-app-config.module.ts | 1 + .../admin-controls-config.component.js | 344 +- .../admin-controls-config.component.js.map | 1 + .../admin-controls-config.component.ts | 198 + .../admin-controls-config.module.js | 2 + .../admin-controls-config.module.js.map | 1 + .../admin-controls-config.module.ts | 1 + .../admin-keycloak-config.component.js | 342 +- .../admin-keycloak-config.component.js.map | 1 + .../admin-keycloak-config.component.ts | 197 + .../admin-keycloak-config.module.js | 2 + .../admin-keycloak-config.module.js.map | 1 + .../admin-keycloak-config.module.ts | 1 + .../admin-dashboard-management.component.js | 700 +- ...dmin-dashboard-management.component.js.map | 1 + .../admin-dashboard-management.component.ts | 384 + .../admin-dashboard-management.module.js | 2 + .../admin-dashboard-management.module.js.map | 1 + .../admin-dashboard-management.module.ts | 1 + ...admin-georesources-management.component.js | 292 +- ...n-georesources-management.component.js.map | 1 + ...admin-georesources-management.component.ts | 173 + .../admin-georesources-management.module.js | 4 +- ...dmin-georesources-management.module.js.map | 1 + .../admin-georesources-management.module.ts | 1 + .../georesource-add-modal.component.js | 2028 +++-- .../georesource-add-modal.component.js.map | 1 + .../georesource-add-modal.component.ts | 1125 +++ .../georesource-add-modal.module.js | 2 + .../georesource-add-modal.module.js.map | 1 + .../georesource-add-modal.module.ts | 1 + ...eoresource-batch-update-modal.component.js | 347 +- ...source-batch-update-modal.component.js.map | 1 + ...eoresource-batch-update-modal.component.ts | 190 + .../georesource-batch-update-modal.module.js | 27 +- ...oresource-batch-update-modal.module.js.map | 1 + .../georesource-batch-update-modal.module.ts | 21 + .../georesource-delete-modal.component.js | 318 +- .../georesource-delete-modal.component.js.map | 1 + .../georesource-delete-modal.component.ts | 181 + .../georesource-delete-modal.module.js | 2 + .../georesource-delete-modal.module.js.map | 1 + .../georesource-delete-modal.module.ts | 1 + ...oresource-edit-features-modal.component.js | 1813 ++--- ...ource-edit-features-modal.component.js.map | 1 + ...oresource-edit-features-modal.component.ts | 1016 +++ .../georesource-edit-features-modal.module.js | 2 + ...resource-edit-features-modal.module.js.map | 1 + .../georesource-edit-features-modal.module.ts | 1 + ...oresource-edit-metadata-modal.component.js | 1252 ++-- ...ource-edit-metadata-modal.component.js.map | 1 + ...oresource-edit-metadata-modal.component.ts | 692 ++ .../georesource-edit-metadata-modal.module.js | 2 + ...resource-edit-metadata-modal.module.js.map | 1 + .../georesource-edit-metadata-modal.module.ts | 1 + .../admin-indicators-management.component.js | 314 +- ...min-indicators-management.component.js.map | 1 + .../admin-indicators-management.component.ts | 184 + .../admin-indicators-management.module.js | 2 + .../admin-indicators-management.module.js.map | 1 + .../admin-indicators-management.module.ts | 1 + .../indicator-add-modal.component.js | 1895 +++-- .../indicator-add-modal.component.js.map | 1 + .../indicator-add-modal.component.ts | 1042 +++ .../indicator-add-modal.module.js | 4 +- .../indicator-add-modal.module.js.map | 1 + .../indicator-add-modal.module.ts | 2 + .../indicator-batch-update-modal.component.js | 512 +- ...icator-batch-update-modal.component.js.map | 1 + .../indicator-batch-update-modal.component.ts | 279 + .../indicator-batch-update-modal.module.js | 26 +- ...indicator-batch-update-modal.module.js.map | 1 + .../indicator-batch-update-modal.module.ts | 20 + .../indicator-delete-modal.component.js | 770 +- .../indicator-delete-modal.component.js.map | 1 + .../indicator-delete-modal.component.ts | 431 ++ .../indicator-delete-modal.module.js | 2 + .../indicator-delete-modal.module.js.map | 1 + .../indicator-delete-modal.module.ts | 1 + ...indicator-edit-features-modal.component.js | 1267 ++-- ...cator-edit-features-modal.component.js.map | 1 + ...indicator-edit-features-modal.component.ts | 718 ++ .../indicator-edit-features-modal.module.js | 2 + ...ndicator-edit-features-modal.module.js.map | 1 + .../indicator-edit-features-modal.module.ts | 1 + ...ator-spatial-unit-roles-modal.component.js | 220 +- ...-spatial-unit-roles-modal.component.js.map | 1 + ...ator-spatial-unit-roles-modal.component.ts | 129 + ...dicator-spatial-unit-roles-modal.module.js | 2 + ...tor-spatial-unit-roles-modal.module.js.map | 1 + ...dicator-spatial-unit-roles-modal.module.ts | 1 + ...indicator-edit-metadata-modal.component.js | 2060 +++--- ...cator-edit-metadata-modal.component.js.map | 1 + ...indicator-edit-metadata-modal.component.ts | 1133 +++ .../indicator-edit-metadata-modal.module.js | 2 + ...ndicator-edit-metadata-modal.module.js.map | 1 + .../indicator-edit-metadata-modal.module.ts | 1 + .../batch-update-result-modal.component.js | 146 +- ...batch-update-result-modal.component.js.map | 1 + .../batch-update-result-modal.component.ts | 84 + .../batch-update-result-modal.module.js | 4 +- .../batch-update-result-modal.module.js.map | 1 + .../batch-update-result-modal.module.ts | 1 + ...cator-edit-timeseries-mapping.component.js | 286 +- ...r-edit-timeseries-mapping.component.js.map | 1 + ...cator-edit-timeseries-mapping.component.ts | 163 + ...ndicator-edit-timeseries-mapping.module.js | 4 +- ...ator-edit-timeseries-mapping.module.js.map | 1 + ...ndicator-edit-timeseries-mapping.module.ts | 1 + .../admin-role-explanation.component.js | 17 +- .../admin-role-explanation.component.js.map | 1 + .../admin-role-explanation.component.ts | 9 + .../admin-role-explanation.module.js | 2 + .../admin-role-explanation.module.js.map | 1 + .../admin-role-explanation.module.ts | 1 + .../admin-role-management.component.js | 262 +- .../admin-role-management.component.js.map | 1 + .../admin-role-management.component.ts | 147 + .../admin-role-management.module.js | 2 + .../admin-role-management.module.js.map | 1 + .../admin-role-management.module.ts | 1 + .../roleAddModal/role-add-modal.component.js | 232 +- .../role-add-modal.component.js.map | 1 + .../roleAddModal/role-add-modal.component.ts | 129 + .../roleAddModal/role-add-modal.module.js | 2 + .../roleAddModal/role-add-modal.module.js.map | 1 + .../roleAddModal/role-add-modal.module.ts | 1 + .../role-delete-modal.component.js | 380 +- .../role-delete-modal.component.js.map | 1 + .../role-delete-modal.component.ts | 215 + .../role-delete-modal.module.js | 13 +- .../role-delete-modal.module.js.map | 1 + .../role-delete-modal.module.ts | 7 + .../role-edit-metadata-modal.component.js | 235 +- .../role-edit-metadata-modal.component.js.map | 1 + .../role-edit-metadata-modal.component.ts | 134 + .../role-edit-metadata-modal.module.js | 2 + .../role-edit-metadata-modal.module.js.map | 1 + .../role-edit-metadata-modal.module.ts | 1 + .../admin-script-execution.component.js | 232 +- .../admin-script-execution.component.js.map | 1 + .../admin-script-execution.component.ts | 137 + .../admin-script-execution.module.js | 2 + .../admin-script-execution.module.js.map | 1 + .../admin-script-execution.module.ts | 1 + .../admin-script-management.component.js | 267 +- .../admin-script-management.component.js.map | 1 + .../admin-script-management.component.ts | 157 + .../admin-script-management.module.js | 2 + .../admin-script-management.module.js.map | 1 + .../admin-script-management.module.ts | 1 + .../script-add-modal.component.js | 297 +- .../script-add-modal.component.js.map | 1 + .../script-add-modal.component.ts | 166 + .../scriptAddModal/script-add-modal.module.js | 6 +- .../script-add-modal.module.js.map | 1 + .../scriptAddModal/script-add-modal.module.ts | 7 + .../script-change-absolute.component.js | 261 +- .../script-change-absolute.component.js.map | 1 + .../script-change-absolute.component.ts | 149 + .../script-change-absolute.module.js | 2 + .../script-change-absolute.module.js.map | 1 + .../script-change-absolute.module.ts | 1 + ...ript-change-absolute-ref-date.component.js | 243 +- ...-change-absolute-ref-date.component.js.map | 1 + ...ript-change-absolute-ref-date.component.ts | 139 + .../script-change-absolute-ref-date.module.js | 2 + ...ipt-change-absolute-ref-date.module.js.map | 1 + .../script-change-absolute-ref-date.module.ts | 1 + .../script-change-relative.component.js | 261 +- .../script-change-relative.component.js.map | 1 + .../script-change-relative.component.ts | 149 + .../script-change-relative.module.js | 2 + .../script-change-relative.module.js.map | 1 + .../script-change-relative.module.ts | 1 + ...ript-change-relative-ref-date.component.js | 243 +- ...-change-relative-ref-date.component.js.map | 1 + ...ript-change-relative-ref-date.component.ts | 139 + .../script-change-relative-ref-date.module.js | 2 + ...ipt-change-relative-ref-date.module.js.map | 1 + .../script-change-relative-ref-date.module.ts | 1 + .../continuity/script-continuity.component.js | 269 +- .../script-continuity.component.js.map | 1 + .../continuity/script-continuity.component.ts | 153 + .../continuity/script-continuity.module.js | 2 + .../script-continuity.module.js.map | 1 + .../continuity/script-continuity.module.ts | 1 + .../division/script-division.component.js | 249 +- .../division/script-division.component.js.map | 1 + .../division/script-division.component.ts | 141 + .../division/script-division.module.js | 2 + .../division/script-division.module.js.map | 1 + .../division/script-division.module.ts | 1 + .../generic/script-generic.component.js | 325 +- .../generic/script-generic.component.js.map | 1 + .../generic/script-generic.component.ts | 185 + .../generic/script-generic.module.js | 2 + .../generic/script-generic.module.js.map | 1 + .../generic/script-generic.module.ts | 1 + ...script-georesource-statistics.component.js | 342 +- ...pt-georesource-statistics.component.js.map | 1 + ...script-georesource-statistics.component.ts | 188 + .../script-georesource-statistics.module.js | 2 + ...cript-georesource-statistics.module.js.map | 1 + .../script-georesource-statistics.module.ts | 1 + ...ript-georesource-subset-share.component.js | 570 +- ...-georesource-subset-share.component.js.map | 1 + ...ript-georesource-subset-share.component.ts | 304 + .../script-georesource-subset-share.module.js | 4 +- ...ipt-georesource-subset-share.module.js.map | 1 + .../script-georesource-subset-share.module.ts | 2 + .../script-headline-indicator.component.js | 414 +- ...script-headline-indicator.component.js.map | 1 + .../script-headline-indicator.component.ts | 235 + .../script-headline-indicator.module.js | 2 + .../script-headline-indicator.module.js.map | 1 + .../script-headline-indicator.module.ts | 1 + ...cript-line-segment-in-polygon.component.js | 569 +- ...t-line-segment-in-polygon.component.js.map | 1 + ...cript-line-segment-in-polygon.component.ts | 304 + .../script-line-segment-in-polygon.module.js | 2 + ...ript-line-segment-in-polygon.module.js.map | 1 + .../script-line-segment-in-polygon.module.ts | 2 + .../script-multiplication.component.js | 280 +- .../script-multiplication.component.js.map | 1 + .../script-multiplication.component.ts | 159 + .../script-multiplication.module.js | 2 + .../script-multiplication.module.js.map | 1 + .../script-multiplication.module.ts | 1 + .../percentage/script-percentage.component.js | 335 +- .../script-percentage.component.js.map | 1 + .../percentage/script-percentage.component.ts | 190 + .../percentage/script-percentage.module.js | 2 + .../script-percentage.module.js.map | 1 + .../percentage/script-percentage.module.ts | 1 + .../script-points-in-polygon.component.js | 569 +- .../script-points-in-polygon.component.js.map | 1 + .../script-points-in-polygon.component.ts | 304 + .../script-points-in-polygon.module.js | 2 + .../script-points-in-polygon.module.js.map | 1 + .../script-points-in-polygon.module.ts | 2 + .../promille/script-promille.component.js | 335 +- .../promille/script-promille.component.js.map | 1 + .../promille/script-promille.component.ts | 190 + .../promille/script-promille.module.js | 2 + .../promille/script-promille.module.js.map | 1 + .../promille/script-promille.module.ts | 1 + .../share/script-share.component.js | 335 +- .../share/script-share.component.js.map | 1 + .../share/script-share.component.ts | 190 + .../share/script-share.module.js | 2 + .../share/script-share.module.js.map | 1 + .../share/script-share.module.ts | 1 + .../subtract/script-subtract.component.js | 335 +- .../subtract/script-subtract.component.js.map | 1 + .../subtract/script-subtract.component.ts | 190 + .../subtract/script-subtract.module.js | 2 + .../subtract/script-subtract.module.js.map | 1 + .../subtract/script-subtract.module.ts | 1 + .../sum/script-sum.component.js | 280 +- .../sum/script-sum.component.js.map | 1 + .../sum/script-sum.component.ts | 159 + .../scriptDefinition/sum/script-sum.module.js | 2 + .../sum/script-sum.module.js.map | 1 + .../scriptDefinition/sum/script-sum.module.ts | 1 + .../trend/script-trend.component.js | 269 +- .../trend/script-trend.component.js.map | 1 + .../trend/script-trend.component.ts | 153 + .../trend/script-trend.module.js | 2 + .../trend/script-trend.module.js.map | 1 + .../trend/script-trend.module.ts | 1 + .../script-delete-modal.component.js | 214 +- .../script-delete-modal.component.js.map | 1 + .../script-delete-modal.component.ts | 124 + .../script-delete-modal.module.js | 2 + .../script-delete-modal.module.js.map | 1 + .../script-delete-modal.module.ts | 1 + ...dmin-spatial-units-management.component.js | 276 +- ...-spatial-units-management.component.js.map | 1 + ...dmin-spatial-units-management.component.ts | 164 + .../admin-spatial-units-management.module.js | 2 + ...min-spatial-units-management.module.js.map | 1 + .../admin-spatial-units-management.module.ts | 1 + .../spatial-unit-add-modal.component.js | 1548 ++-- .../spatial-unit-add-modal.component.js.map | 1 + .../spatial-unit-add-modal.component.ts | 864 +++ .../spatial-unit-add-modal.module.js | 2 + .../spatial-unit-add-modal.module.js.map | 1 + .../spatial-unit-add-modal.module.ts | 1 + .../spatial-unit-delete-modal.component.js | 232 +- ...spatial-unit-delete-modal.component.js.map | 1 + .../spatial-unit-delete-modal.component.ts | 133 + .../spatial-unit-delete-modal.module.js | 2 + .../spatial-unit-delete-modal.module.js.map | 1 + .../spatial-unit-delete-modal.module.ts | 1 + ...tial-unit-edit-features-modal.component.js | 1315 ++-- ...-unit-edit-features-modal.component.js.map | 1 + ...tial-unit-edit-features-modal.component.ts | 740 ++ ...spatial-unit-edit-features-modal.module.js | 2 + ...ial-unit-edit-features-modal.module.js.map | 1 + ...spatial-unit-edit-features-modal.module.ts | 1 + ...tial-unit-edit-metadata-modal.component.js | 810 +- ...-unit-edit-metadata-modal.component.js.map | 1 + ...tial-unit-edit-metadata-modal.component.ts | 452 ++ ...spatial-unit-edit-metadata-modal.module.js | 2 + ...ial-unit-edit-metadata-modal.module.js.map | 1 + ...spatial-unit-edit-metadata-modal.module.ts | 1 + .../admin-topics-management.component.js | 817 +- .../admin-topics-management.component.js.map | 1 + .../admin-topics-management.component.ts | 459 ++ .../admin-topics-management.module.js | 2 + .../admin-topics-management.module.js.map | 1 + .../admin-topics-management.module.ts | 1 + .../topic-delete-modal.component.js | 179 +- .../topic-delete-modal.component.js.map | 1 + .../topic-delete-modal.component.ts | 105 + .../topic-delete-modal.module.js | 2 + .../topic-delete-modal.module.js.map | 1 + .../topic-delete-modal.module.ts | 1 + .../topic-edit-modal.component.js | 140 +- .../topic-edit-modal.component.js.map | 1 + .../topic-edit-modal.component.ts | 80 + .../topicEditModal/topic-edit-modal.module.js | 2 + .../topic-edit-modal.module.js.map | 1 + .../topicEditModal/topic-edit-modal.module.ts | 1 + .../kommonitor-admin.component.js | 143 +- .../kommonitor-admin.component.js.map | 1 + .../kommonitor-admin.component.ts | 82 + .../kommonitor-admin.module.js | 26 +- .../kommonitor-admin.module.js.map | 1 + .../kommonitor-admin.module.ts | 14 + .../kommonitor-user-interface.component.js | 2063 +++--- ...kommonitor-user-interface.component.js.map | 1 + .../kommonitor-user-interface.component.ts | 1077 +++ .../kommonitor-user-interface.module.js | 8 +- .../kommonitor-user-interface.module.js.map | 1 + .../kommonitor-user-interface.module.ts | 4 + .../feedbackModal/feedback-modal.component.js | 243 +- .../feedback-modal.component.js.map | 1 + .../feedbackModal/feedback-modal.component.ts | 135 + .../feedbackModal/feedback-modal.module.js | 23 +- .../feedback-modal.module.js.map | 1 + .../feedbackModal/feedback-modal.module.ts | 14 + .../indicator-radar.component.js | 1094 ++- .../indicator-radar.component.js.map | 1 + .../indicator-radar.component.ts | 612 ++ .../indicatorRadar/indicator-radar.module.js | 4 +- .../indicator-radar.module.js.map | 1 + .../indicatorRadar/indicator-radar.module.ts | 1 + .../infoModal/info-modal.component.js | 147 +- .../infoModal/info-modal.component.js.map | 1 + .../infoModal/info-modal.component.ts | 81 + .../infoModal/info-modal.module.js | 2 + .../infoModal/info-modal.module.js.map | 1 + .../infoModal/info-modal.module.ts | 1 + .../kommonitor-balance.component.js | 896 +-- .../kommonitor-balance.component.js.map | 1 + .../kommonitor-balance.component.ts | 498 ++ .../kommonitor-balance.module.js | 27 +- .../kommonitor-balance.module.js.map | 1 + .../kommonitor-balance.module.ts | 15 + .../kommonitor-data-import.component.js | 435 +- .../kommonitor-data-import.component.js.map | 1 + .../kommonitor-data-import.component.ts | 245 + .../kommonitor-data-import.module.js | 77 +- .../kommonitor-data-import.module.js.map | 1 + .../kommonitor-data-import.module.ts | 62 + .../kommonitor-data-setup.component.js | 1398 ++-- .../kommonitor-data-setup.component.js.map | 1 + .../kommonitor-data-setup.component.ts | 796 ++ .../kommonitor-data-setup.module.js | 2 + .../kommonitor-data-setup.module.js.map | 1 + .../kommonitor-data-setup.module.ts | 1 + .../kommonitor-diagrams.component.js | 812 +- .../kommonitor-diagrams.component.js.map | 1 + .../kommonitor-diagrams.component.ts | 451 ++ .../kommonitor-diagrams.module.js | 4 +- .../kommonitor-diagrams.module.js.map | 1 + .../kommonitor-diagrams.module.ts | 1 + .../kommonitor-filter.component.js | 1038 ++- .../kommonitor-filter.component.js.map | 1 + .../kommonitor-filter.component.ts | 580 ++ .../kommonitor-filter.module.js | 27 +- .../kommonitor-filter.module.js.map | 1 + .../kommonitor-filter.module.ts | 15 + ...ividual-indicator-computation.component.js | 1432 ++-- ...ual-indicator-computation.component.js.map | 1 + ...ividual-indicator-computation.component.ts | 819 +++ ...individual-indicator-computation.module.js | 27 +- ...vidual-indicator-computation.module.js.map | 1 + ...individual-indicator-computation.module.ts | 15 + .../kommonitor-legend.component.js | 679 +- .../kommonitor-legend.component.js.map | 1 + .../kommonitor-legend.component.ts | 381 + .../kommonitor-legend.module.js | 29 +- .../kommonitor-legend.module.js.map | 1 + .../kommonitor-legend.module.ts | 16 + .../kommonitor-reachability.component.js | 3251 ++++---- .../kommonitor-reachability.component.js.map | 1 + .../kommonitor-reachability.component.ts | 1817 +++++ .../kommonitor-reachability.module.js | 27 +- .../kommonitor-reachability.module.js.map | 1 + .../kommonitor-reachability.module.ts | 15 + .../kommonitorControls/poi/poi.component.js | 1540 ++-- .../poi/poi.component.js.map | 1 + .../kommonitorControls/poi/poi.component.ts | 867 +++ .../kommonitorControls/poi/poi.module.js | 4 +- .../kommonitorControls/poi/poi.module.js.map | 1 + .../kommonitorControls/poi/poi.module.ts | 1 + .../poi/wfsModal/wfs-modal.component.js | 119 +- .../poi/wfsModal/wfs-modal.component.js.map | 1 + .../poi/wfsModal/wfs-modal.component.ts | 67 + .../poi/wfsModal/wfs-modal.module.js | 2 + .../poi/wfsModal/wfs-modal.module.js.map | 1 + .../poi/wfsModal/wfs-modal.module.ts | 1 + .../poi/wmsModal/wms-modal.component.js | 74 +- .../poi/wmsModal/wms-modal.component.js.map | 1 + .../poi/wmsModal/wms-modal.component.ts | 42 + .../poi/wmsModal/wms-modal.module.js | 2 + .../poi/wmsModal/wms-modal.module.js.map | 1 + .../poi/wmsModal/wms-modal.module.ts | 1 + .../regression-diagram.component.js | 1407 ++-- .../regression-diagram.component.js.map | 1 + .../regression-diagram.component.ts | 774 ++ .../regression-diagram.module.js | 4 +- .../regression-diagram.module.js.map | 1 + .../regression-diagram.module.ts | 1 + .../reporting-modal.component.js | 197 +- .../reporting-modal.component.js.map | 1 + .../reporting-modal.component.ts | 108 + .../reportingModal/reporting-modal.module.js | 4 +- .../reporting-modal.module.js.map | 1 + .../reportingModal/reporting-modal.module.ts | 1 + .../reporting-indicator-add.component.js | 6549 ++++++++--------- .../reporting-indicator-add.component.js.map | 1 + .../reporting-indicator-add.component.ts | 3452 +++++++++ .../reporting-indicator-add.module.js | 4 +- .../reporting-indicator-add.module.js.map | 1 + .../reporting-indicator-add.module.ts | 1 + .../reporting-overview.component.js | 3546 +++++---- .../reporting-overview.component.js.map | 1 + .../reporting-overview.component.ts | 1840 +++++ .../reporting-overview.module.js | 4 +- .../reporting-overview.module.js.map | 1 + .../reporting-overview.module.ts | 1 + .../reporting-template-select.component.js | 1733 +++-- ...reporting-template-select.component.js.map | 1 + .../reporting-template-select.component.ts | 918 +++ .../reporting-template-select.module.js | 4 +- .../reporting-template-select.module.js.map | 1 + .../reporting-template-select.module.ts | 1 + .../reporting-workflow-select.component.js | 112 +- ...reporting-workflow-select.component.js.map | 1 + .../reporting-workflow-select.component.ts | 61 + .../reporting-workflow-select.module.js | 4 +- .../reporting-workflow-select.module.js.map | 1 + .../reporting-workflow-select.module.ts | 1 + ...atial-unit-notification-modal.component.js | 102 +- ...l-unit-notification-modal.component.js.map | 1 + ...atial-unit-notification-modal.component.ts | 60 + .../spatial-unit-notification-modal.module.js | 2 + ...tial-unit-notification-modal.module.js.map | 1 + .../spatial-unit-notification-modal.module.ts | 1 + .../versionInfo/version-info.component.js | 23 +- .../versionInfo/version-info.component.js.map | 1 + .../versionInfo/version-info.component.ts | 12 + .../versionInfo/version-info.module.js | 2 + .../versionInfo/version-info.module.js.map | 1 + .../versionInfo/version-info.module.ts | 1 + .../kommonitorMap/kommonitor-map.component.js | 6230 +++++++--------- .../kommonitor-map.component.js.map | 1 + .../kommonitorMap/kommonitor-map.component.ts | 3484 +++++++++ .../kommonitorMap/kommonitor-map.module.js | 891 +-- .../kommonitor-map.module.js.map | 1 + .../kommonitorMap/kommonitor-map.module.ts | 533 ++ app/config/env_backup.js | 1105 ++- app/config/env_backup.js.map | 1 + app/config/env_backup.ts | 576 ++ .../km_georesource_miscStatistics.js | 383 +- .../km_georesource_miscStatistics.js.map | 1 + .../km_georesource_miscStatistics.ts | 322 + .../km_georesource_share_byPropertyValue.js | 454 +- ...m_georesource_share_byPropertyValue.js.map | 1 + .../km_georesource_share_byPropertyValue.ts | 358 + ...m_georessouce_count_pointsWithinPolygon.js | 442 +- ...oressouce_count_pointsWithinPolygon.js.map | 1 + ...m_georessouce_count_pointsWithinPolygon.ts | 353 + ...ssouce_length_lineSegmentsWithinPolygon.js | 485 +- ...ce_length_lineSegmentsWithinPolygon.js.map | 1 + ...ssouce_length_lineSegmentsWithinPolygon.ts | 378 + .../km_headline_indicator.js | 330 +- .../km_headline_indicator.js.map | 1 + .../km_headline_indicator.ts | 331 + .../km_indicator_absChange_nTemporalItems.js | 305 +- ..._indicator_absChange_nTemporalItems.js.map | 1 + .../km_indicator_absChange_nTemporalItems.ts | 297 + .../km_indicator_absChange_refDate.js | 276 +- .../km_indicator_absChange_refDate.js.map | 1 + .../km_indicator_absChange_refDate.ts | 279 + .../km_indicator_continuity_nTemporalItems.js | 308 +- ...indicator_continuity_nTemporalItems.js.map | 1 + .../km_indicator_continuity_nTemporalItems.ts | 296 + .../km_indicator_divide.js | 482 +- .../km_indicator_divide.js.map | 1 + .../km_indicator_divide.ts | 406 + .../km_indicator_multiply.js | 425 +- .../km_indicator_multiply.js.map | 1 + .../km_indicator_multiply.ts | 355 + .../km_indicator_percentage.js | 503 +- .../km_indicator_percentage.js.map | 1 + .../km_indicator_percentage.ts | 410 ++ .../km_indicator_promille.js | 501 +- .../km_indicator_promille.js.map | 1 + .../km_indicator_promille.ts | 410 ++ .../km_indicator_relChange_nTemporalItems.js | 307 +- ..._indicator_relChange_nTemporalItems.js.map | 1 + .../km_indicator_relChange_nTemporalItems.ts | 297 + .../km_indicator_relChange_refDate.js | 276 +- .../km_indicator_relChange_refDate.js.map | 1 + .../km_indicator_relChange_refDate.ts | 279 + .../km_indicator_share.js | 505 +- .../km_indicator_share.js.map | 1 + .../km_indicator_share.ts | 410 ++ .../km_indicator_subtract.js | 482 +- .../km_indicator_subtract.js.map | 1 + .../km_indicator_subtract.ts | 404 + .../km_indicator_sum.js | 425 +- .../km_indicator_sum.js.map | 1 + .../km_indicator_sum.ts | 355 + .../km_indicator_trend_nTemporalItems.js | 306 +- .../km_indicator_trend_nTemporalItems.js.map | 1 + .../km_indicator_trend_nTemporalItems.ts | 296 + .../kommonitor-script-template.js | 278 +- .../kommonitor-script-template.js.map | 1 + .../kommonitor-script-template.ts | 284 + ...itor-batch-update-helper-service.module.js | 2365 +++--- ...-batch-update-helper-service.module.js.map | 1 + ...itor-batch-update-helper-service.module.ts | 1275 ++++ .../kommonitor-cache-helper-service.module.js | 467 +- ...monitor-cache-helper-service.module.js.map | 1 + .../kommonitor-cache-helper-service.module.ts | 275 + ...ommonitor-config-storage-service.module.js | 279 +- ...nitor-config-storage-service.module.js.map | 1 + ...ommonitor-config-storage-service.module.ts | 157 + ...kommonitor-data-exchange-service.module.js | 4299 +++++------ ...onitor-data-exchange-service.module.js.map | 1 + ...kommonitor-data-exchange-service.module.ts | 3088 ++++++++ ...monitor-data-grid-helper-service.module.js | 5502 +++++++------- ...tor-data-grid-helper-service.module.js.map | 1 + ...monitor-data-grid-helper-service.module.ts | 3017 ++++++++ ...ommonitor-diagram-helper-service.module.js | 3666 +++++---- ...nitor-diagram-helper-service.module.js.map | 1 + ...ommonitor-diagram-helper-service.module.ts | 2072 ++++++ ...lement-visibility-helper-service.module.js | 184 +- ...nt-visibility-helper-service.module.js.map | 1 + ...lement-visibility-helper-service.module.ts | 120 + ...kommonitor-filter-helper-service.module.js | 306 +- ...onitor-filter-helper-service.module.js.map | 1 + ...kommonitor-filter-helper-service.module.ts | 181 + ...mmonitor-importer-helper-service.module.js | 1280 ++-- ...itor-importer-helper-service.module.js.map | 1 + ...mmonitor-importer-helper-service.module.ts | 730 ++ ...nitor-info-legend-helper-service.module.js | 14 +- ...r-info-legend-helper-service.module.js.map | 1 + ...nitor-info-legend-helper-service.module.ts | 21 + ...mmonitor-keycloak-helper-service.module.js | 503 +- ...itor-keycloak-helper-service.module.js.map | 1 + ...mmonitor-keycloak-helper-service.module.ts | 283 + ...r-multi-step-form-helper-service.module.js | 285 +- ...lti-step-form-helper-service.module.js.map | 1 + ...r-multi-step-form-helper-service.module.ts | 166 + ...kommonitor-script-helper-service.module.js | 891 ++- ...onitor-script-helper-service.module.js.map | 1 + ...kommonitor-script-helper-service.module.ts | 495 ++ .../kommonitor-share-helper-service.module.js | 234 +- ...monitor-share-helper-service.module.js.map | 1 + .../kommonitor-share-helper-service.module.ts | 139 + ...ingle-feature-map-helper-service.module.js | 765 +- ...e-feature-map-helper-service.module.js.map | 1 + ...ingle-feature-map-helper-service.module.ts | 431 ++ ...itor-visual-style-helper-service.module.js | 1379 ++-- ...-visual-style-helper-service.module.js.map | 1 + ...itor-visual-style-helper-service.module.ts | 794 ++ package-lock.json | 106 +- package.json | 14 +- tsconfig.json | 33 + 594 files changed, 101714 insertions(+), 53666 deletions(-) create mode 100644 app/app.js.map create mode 100644 app/app.ts create mode 100644 app/components/kommonitorAdmin/adminConfig/adminAppConfig/admin-app-config.component.js.map create mode 100644 app/components/kommonitorAdmin/adminConfig/adminAppConfig/admin-app-config.component.ts create mode 100644 app/components/kommonitorAdmin/adminConfig/adminAppConfig/admin-app-config.module.js.map create mode 100644 app/components/kommonitorAdmin/adminConfig/adminAppConfig/admin-app-config.module.ts create mode 100644 app/components/kommonitorAdmin/adminConfig/adminControlsConfig/admin-controls-config.component.js.map create mode 100644 app/components/kommonitorAdmin/adminConfig/adminControlsConfig/admin-controls-config.component.ts create mode 100644 app/components/kommonitorAdmin/adminConfig/adminControlsConfig/admin-controls-config.module.js.map create mode 100644 app/components/kommonitorAdmin/adminConfig/adminControlsConfig/admin-controls-config.module.ts create mode 100644 app/components/kommonitorAdmin/adminConfig/adminKeycloakConfig/admin-keycloak-config.component.js.map create mode 100644 app/components/kommonitorAdmin/adminConfig/adminKeycloakConfig/admin-keycloak-config.component.ts create mode 100644 app/components/kommonitorAdmin/adminConfig/adminKeycloakConfig/admin-keycloak-config.module.js.map create mode 100644 app/components/kommonitorAdmin/adminConfig/adminKeycloakConfig/admin-keycloak-config.module.ts create mode 100644 app/components/kommonitorAdmin/adminDashboardManagement/admin-dashboard-management.component.js.map create mode 100644 app/components/kommonitorAdmin/adminDashboardManagement/admin-dashboard-management.component.ts create mode 100644 app/components/kommonitorAdmin/adminDashboardManagement/admin-dashboard-management.module.js.map create mode 100644 app/components/kommonitorAdmin/adminDashboardManagement/admin-dashboard-management.module.ts create mode 100644 app/components/kommonitorAdmin/adminGeoresourcesManagement/admin-georesources-management.component.js.map create mode 100644 app/components/kommonitorAdmin/adminGeoresourcesManagement/admin-georesources-management.component.ts create mode 100644 app/components/kommonitorAdmin/adminGeoresourcesManagement/admin-georesources-management.module.js.map create mode 100644 app/components/kommonitorAdmin/adminGeoresourcesManagement/admin-georesources-management.module.ts create mode 100644 app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceAddModal/georesource-add-modal.component.js.map create mode 100644 app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceAddModal/georesource-add-modal.component.ts create mode 100644 app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceAddModal/georesource-add-modal.module.js.map create mode 100644 app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceAddModal/georesource-add-modal.module.ts create mode 100644 app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceBatchUpdateModal/georesource-batch-update-modal.component.js.map create mode 100644 app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceBatchUpdateModal/georesource-batch-update-modal.component.ts create mode 100644 app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceBatchUpdateModal/georesource-batch-update-modal.module.js.map create mode 100644 app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceBatchUpdateModal/georesource-batch-update-modal.module.ts create mode 100644 app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceDeleteModal/georesource-delete-modal.component.js.map create mode 100644 app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceDeleteModal/georesource-delete-modal.component.ts create mode 100644 app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceDeleteModal/georesource-delete-modal.module.js.map create mode 100644 app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceDeleteModal/georesource-delete-modal.module.ts create mode 100644 app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditFeaturesModal/georesource-edit-features-modal.component.js.map create mode 100644 app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditFeaturesModal/georesource-edit-features-modal.component.ts create mode 100644 app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditFeaturesModal/georesource-edit-features-modal.module.js.map create mode 100644 app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditFeaturesModal/georesource-edit-features-modal.module.ts create mode 100644 app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditMetadataModal/georesource-edit-metadata-modal.component.js.map create mode 100644 app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditMetadataModal/georesource-edit-metadata-modal.component.ts create mode 100644 app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditMetadataModal/georesource-edit-metadata-modal.module.js.map create mode 100644 app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditMetadataModal/georesource-edit-metadata-modal.module.ts create mode 100644 app/components/kommonitorAdmin/adminIndicatorsManagement/admin-indicators-management.component.js.map create mode 100644 app/components/kommonitorAdmin/adminIndicatorsManagement/admin-indicators-management.component.ts create mode 100644 app/components/kommonitorAdmin/adminIndicatorsManagement/admin-indicators-management.module.js.map create mode 100644 app/components/kommonitorAdmin/adminIndicatorsManagement/admin-indicators-management.module.ts create mode 100644 app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorAddModal/indicator-add-modal.component.js.map create mode 100644 app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorAddModal/indicator-add-modal.component.ts create mode 100644 app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorAddModal/indicator-add-modal.module.js.map create mode 100644 app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorAddModal/indicator-add-modal.module.ts create mode 100644 app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorBatchUpdateModal/indicator-batch-update-modal.component.js.map create mode 100644 app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorBatchUpdateModal/indicator-batch-update-modal.component.ts create mode 100644 app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorBatchUpdateModal/indicator-batch-update-modal.module.js.map create mode 100644 app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorBatchUpdateModal/indicator-batch-update-modal.module.ts create mode 100644 app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorDeleteModal/indicator-delete-modal.component.js.map create mode 100644 app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorDeleteModal/indicator-delete-modal.component.ts create mode 100644 app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorDeleteModal/indicator-delete-modal.module.js.map create mode 100644 app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorDeleteModal/indicator-delete-modal.module.ts create mode 100644 app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditFeaturesModal/indicator-edit-features-modal.component.js.map create mode 100644 app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditFeaturesModal/indicator-edit-features-modal.component.ts create mode 100644 app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditFeaturesModal/indicator-edit-features-modal.module.js.map create mode 100644 app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditFeaturesModal/indicator-edit-features-modal.module.ts create mode 100644 app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditIndicatorSpatialUnitRolesModal/indicator-edit-indicator-spatial-unit-roles-modal.component.js.map create mode 100644 app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditIndicatorSpatialUnitRolesModal/indicator-edit-indicator-spatial-unit-roles-modal.component.ts create mode 100644 app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditIndicatorSpatialUnitRolesModal/indicator-edit-indicator-spatial-unit-roles-modal.module.js.map create mode 100644 app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditIndicatorSpatialUnitRolesModal/indicator-edit-indicator-spatial-unit-roles-modal.module.ts create mode 100644 app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditMetadataModal/indicator-edit-metadata-modal.component.js.map create mode 100644 app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditMetadataModal/indicator-edit-metadata-modal.component.ts create mode 100644 app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditMetadataModal/indicator-edit-metadata-modal.module.js.map create mode 100644 app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditMetadataModal/indicator-edit-metadata-modal.module.ts create mode 100644 app/components/kommonitorAdmin/adminMultiUseComponents/batchUpdateResultModal/batch-update-result-modal.component.js.map create mode 100644 app/components/kommonitorAdmin/adminMultiUseComponents/batchUpdateResultModal/batch-update-result-modal.component.ts create mode 100644 app/components/kommonitorAdmin/adminMultiUseComponents/batchUpdateResultModal/batch-update-result-modal.module.js.map create mode 100644 app/components/kommonitorAdmin/adminMultiUseComponents/batchUpdateResultModal/batch-update-result-modal.module.ts create mode 100644 app/components/kommonitorAdmin/adminMultiUseComponents/indicatorEditTimeseriesMapping/indicator-edit-timeseries-mapping.component.js.map create mode 100644 app/components/kommonitorAdmin/adminMultiUseComponents/indicatorEditTimeseriesMapping/indicator-edit-timeseries-mapping.component.ts create mode 100644 app/components/kommonitorAdmin/adminMultiUseComponents/indicatorEditTimeseriesMapping/indicator-edit-timeseries-mapping.module.js.map create mode 100644 app/components/kommonitorAdmin/adminMultiUseComponents/indicatorEditTimeseriesMapping/indicator-edit-timeseries-mapping.module.ts create mode 100644 app/components/kommonitorAdmin/adminRoleExplanation/admin-role-explanation.component.js.map create mode 100644 app/components/kommonitorAdmin/adminRoleExplanation/admin-role-explanation.component.ts create mode 100644 app/components/kommonitorAdmin/adminRoleExplanation/admin-role-explanation.module.js.map create mode 100644 app/components/kommonitorAdmin/adminRoleExplanation/admin-role-explanation.module.ts create mode 100644 app/components/kommonitorAdmin/adminRoleManagement/admin-role-management.component.js.map create mode 100644 app/components/kommonitorAdmin/adminRoleManagement/admin-role-management.component.ts create mode 100644 app/components/kommonitorAdmin/adminRoleManagement/admin-role-management.module.js.map create mode 100644 app/components/kommonitorAdmin/adminRoleManagement/admin-role-management.module.ts create mode 100644 app/components/kommonitorAdmin/adminRoleManagement/roleAddModal/role-add-modal.component.js.map create mode 100644 app/components/kommonitorAdmin/adminRoleManagement/roleAddModal/role-add-modal.component.ts create mode 100644 app/components/kommonitorAdmin/adminRoleManagement/roleAddModal/role-add-modal.module.js.map create mode 100644 app/components/kommonitorAdmin/adminRoleManagement/roleAddModal/role-add-modal.module.ts create mode 100644 app/components/kommonitorAdmin/adminRoleManagement/roleDeleteModal/role-delete-modal.component.js.map create mode 100644 app/components/kommonitorAdmin/adminRoleManagement/roleDeleteModal/role-delete-modal.component.ts create mode 100644 app/components/kommonitorAdmin/adminRoleManagement/roleDeleteModal/role-delete-modal.module.js.map create mode 100644 app/components/kommonitorAdmin/adminRoleManagement/roleDeleteModal/role-delete-modal.module.ts create mode 100644 app/components/kommonitorAdmin/adminRoleManagement/roleEditMetadataModal/role-edit-metadata-modal.component.js.map create mode 100644 app/components/kommonitorAdmin/adminRoleManagement/roleEditMetadataModal/role-edit-metadata-modal.component.ts create mode 100644 app/components/kommonitorAdmin/adminRoleManagement/roleEditMetadataModal/role-edit-metadata-modal.module.js.map create mode 100644 app/components/kommonitorAdmin/adminRoleManagement/roleEditMetadataModal/role-edit-metadata-modal.module.ts create mode 100644 app/components/kommonitorAdmin/adminScriptExecution/admin-script-execution.component.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptExecution/admin-script-execution.component.ts create mode 100644 app/components/kommonitorAdmin/adminScriptExecution/admin-script-execution.module.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptExecution/admin-script-execution.module.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/admin-script-management.component.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/admin-script-management.component.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/admin-script-management.module.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/admin-script-management.module.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/script-add-modal.component.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/script-add-modal.component.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/script-add-modal.module.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/script-add-modal.module.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsolute/script-change-absolute.component.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsolute/script-change-absolute.component.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsolute/script-change-absolute.module.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsolute/script-change-absolute.module.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsoluteRefDate/script-change-absolute-ref-date.component.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsoluteRefDate/script-change-absolute-ref-date.component.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsoluteRefDate/script-change-absolute-ref-date.module.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsoluteRefDate/script-change-absolute-ref-date.module.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelative/script-change-relative.component.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelative/script-change-relative.component.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelative/script-change-relative.module.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelative/script-change-relative.module.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelativeRefDate/script-change-relative-ref-date.component.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelativeRefDate/script-change-relative-ref-date.component.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelativeRefDate/script-change-relative-ref-date.module.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelativeRefDate/script-change-relative-ref-date.module.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/continuity/script-continuity.component.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/continuity/script-continuity.component.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/continuity/script-continuity.module.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/continuity/script-continuity.module.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/division/script-division.component.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/division/script-division.component.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/division/script-division.module.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/division/script-division.module.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/generic/script-generic.component.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/generic/script-generic.component.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/generic/script-generic.module.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/generic/script-generic.module.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceStatistics/script-georesource-statistics.component.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceStatistics/script-georesource-statistics.component.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceStatistics/script-georesource-statistics.module.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceStatistics/script-georesource-statistics.module.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceSubsetShare/script-georesource-subset-share.component.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceSubsetShare/script-georesource-subset-share.component.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceSubsetShare/script-georesource-subset-share.module.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceSubsetShare/script-georesource-subset-share.module.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/headlineIndicator/script-headline-indicator.component.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/headlineIndicator/script-headline-indicator.component.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/headlineIndicator/script-headline-indicator.module.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/headlineIndicator/script-headline-indicator.module.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/lineSegmentInPolygon/script-line-segment-in-polygon.component.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/lineSegmentInPolygon/script-line-segment-in-polygon.component.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/lineSegmentInPolygon/script-line-segment-in-polygon.module.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/lineSegmentInPolygon/script-line-segment-in-polygon.module.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/multiplication/script-multiplication.component.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/multiplication/script-multiplication.component.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/multiplication/script-multiplication.module.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/multiplication/script-multiplication.module.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/percentage/script-percentage.component.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/percentage/script-percentage.component.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/percentage/script-percentage.module.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/percentage/script-percentage.module.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/pointsInPolygon/script-points-in-polygon.component.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/pointsInPolygon/script-points-in-polygon.component.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/pointsInPolygon/script-points-in-polygon.module.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/pointsInPolygon/script-points-in-polygon.module.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/promille/script-promille.component.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/promille/script-promille.component.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/promille/script-promille.module.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/promille/script-promille.module.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/share/script-share.component.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/share/script-share.component.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/share/script-share.module.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/share/script-share.module.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/subtract/script-subtract.component.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/subtract/script-subtract.component.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/subtract/script-subtract.module.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/subtract/script-subtract.module.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/sum/script-sum.component.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/sum/script-sum.component.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/sum/script-sum.module.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/sum/script-sum.module.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/trend/script-trend.component.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/trend/script-trend.component.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/trend/script-trend.module.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/trend/script-trend.module.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptDeleteModal/script-delete-modal.component.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptDeleteModal/script-delete-modal.component.ts create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptDeleteModal/script-delete-modal.module.js.map create mode 100644 app/components/kommonitorAdmin/adminScriptManagement/scriptDeleteModal/script-delete-modal.module.ts create mode 100644 app/components/kommonitorAdmin/adminSpatialUnitsManagement/admin-spatial-units-management.component.js.map create mode 100644 app/components/kommonitorAdmin/adminSpatialUnitsManagement/admin-spatial-units-management.component.ts create mode 100644 app/components/kommonitorAdmin/adminSpatialUnitsManagement/admin-spatial-units-management.module.js.map create mode 100644 app/components/kommonitorAdmin/adminSpatialUnitsManagement/admin-spatial-units-management.module.ts create mode 100644 app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitAddModal/spatial-unit-add-modal.component.js.map create mode 100644 app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitAddModal/spatial-unit-add-modal.component.ts create mode 100644 app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitAddModal/spatial-unit-add-modal.module.js.map create mode 100644 app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitAddModal/spatial-unit-add-modal.module.ts create mode 100644 app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitDeleteModal/spatial-unit-delete-modal.component.js.map create mode 100644 app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitDeleteModal/spatial-unit-delete-modal.component.ts create mode 100644 app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitDeleteModal/spatial-unit-delete-modal.module.js.map create mode 100644 app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitDeleteModal/spatial-unit-delete-modal.module.ts create mode 100644 app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditFeaturesModal/spatial-unit-edit-features-modal.component.js.map create mode 100644 app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditFeaturesModal/spatial-unit-edit-features-modal.component.ts create mode 100644 app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditFeaturesModal/spatial-unit-edit-features-modal.module.js.map create mode 100644 app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditFeaturesModal/spatial-unit-edit-features-modal.module.ts create mode 100644 app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditMetadataModal/spatial-unit-edit-metadata-modal.component.js.map create mode 100644 app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditMetadataModal/spatial-unit-edit-metadata-modal.component.ts create mode 100644 app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditMetadataModal/spatial-unit-edit-metadata-modal.module.js.map create mode 100644 app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditMetadataModal/spatial-unit-edit-metadata-modal.module.ts create mode 100644 app/components/kommonitorAdmin/adminTopicsManagement/admin-topics-management.component.js.map create mode 100644 app/components/kommonitorAdmin/adminTopicsManagement/admin-topics-management.component.ts create mode 100644 app/components/kommonitorAdmin/adminTopicsManagement/admin-topics-management.module.js.map create mode 100644 app/components/kommonitorAdmin/adminTopicsManagement/admin-topics-management.module.ts create mode 100644 app/components/kommonitorAdmin/adminTopicsManagement/topicDeleteModal/topic-delete-modal.component.js.map create mode 100644 app/components/kommonitorAdmin/adminTopicsManagement/topicDeleteModal/topic-delete-modal.component.ts create mode 100644 app/components/kommonitorAdmin/adminTopicsManagement/topicDeleteModal/topic-delete-modal.module.js.map create mode 100644 app/components/kommonitorAdmin/adminTopicsManagement/topicDeleteModal/topic-delete-modal.module.ts create mode 100644 app/components/kommonitorAdmin/adminTopicsManagement/topicEditModal/topic-edit-modal.component.js.map create mode 100644 app/components/kommonitorAdmin/adminTopicsManagement/topicEditModal/topic-edit-modal.component.ts create mode 100644 app/components/kommonitorAdmin/adminTopicsManagement/topicEditModal/topic-edit-modal.module.js.map create mode 100644 app/components/kommonitorAdmin/adminTopicsManagement/topicEditModal/topic-edit-modal.module.ts create mode 100644 app/components/kommonitorAdmin/kommonitor-admin.component.js.map create mode 100644 app/components/kommonitorAdmin/kommonitor-admin.component.ts create mode 100644 app/components/kommonitorAdmin/kommonitor-admin.module.js.map create mode 100644 app/components/kommonitorAdmin/kommonitor-admin.module.ts create mode 100644 app/components/kommonitorUserInterface/kommonitor-user-interface.component.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitor-user-interface.component.ts create mode 100644 app/components/kommonitorUserInterface/kommonitor-user-interface.module.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitor-user-interface.module.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/feedbackModal/feedback-modal.component.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/feedbackModal/feedback-modal.component.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/feedbackModal/feedback-modal.module.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/feedbackModal/feedback-modal.module.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.component.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.component.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.module.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.module.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.component.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.component.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.module.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.module.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/kommonitorBalance/kommonitor-balance.component.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/kommonitorBalance/kommonitor-balance.component.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/kommonitorBalance/kommonitor-balance.module.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/kommonitorBalance/kommonitor-balance.module.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataImport/kommonitor-data-import.component.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataImport/kommonitor-data-import.component.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataImport/kommonitor-data-import.module.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataImport/kommonitor-data-import.module.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataSetup/kommonitor-data-setup.component.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataSetup/kommonitor-data-setup.component.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataSetup/kommonitor-data-setup.module.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataSetup/kommonitor-data-setup.module.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/kommonitorDiagrams/kommonitor-diagrams.component.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/kommonitorDiagrams/kommonitor-diagrams.component.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/kommonitorDiagrams/kommonitor-diagrams.module.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/kommonitorDiagrams/kommonitor-diagrams.module.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/kommonitorFilter/kommonitor-filter.component.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/kommonitorFilter/kommonitor-filter.component.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/kommonitorFilter/kommonitor-filter.module.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/kommonitorFilter/kommonitor-filter.module.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/kommonitorIndividualIndicatorComputation/kommonitor-individual-indicator-computation.component.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/kommonitorIndividualIndicatorComputation/kommonitor-individual-indicator-computation.component.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/kommonitorIndividualIndicatorComputation/kommonitor-individual-indicator-computation.module.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/kommonitorIndividualIndicatorComputation/kommonitor-individual-indicator-computation.module.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/kommonitorLegend/kommonitor-legend.component.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/kommonitorLegend/kommonitor-legend.component.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/kommonitorLegend/kommonitor-legend.module.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/kommonitorLegend/kommonitor-legend.module.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/kommonitorReachability/kommonitor-reachability.component.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/kommonitorReachability/kommonitor-reachability.component.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/kommonitorReachability/kommonitor-reachability.module.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/kommonitorReachability/kommonitor-reachability.module.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/poi/poi.component.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/poi/poi.component.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/poi/poi.module.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/poi/poi.module.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/poi/wfsModal/wfs-modal.component.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/poi/wfsModal/wfs-modal.component.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/poi/wfsModal/wfs-modal.module.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/poi/wfsModal/wfs-modal.module.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/poi/wmsModal/wms-modal.component.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/poi/wmsModal/wms-modal.component.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/poi/wmsModal/wms-modal.module.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/poi/wmsModal/wms-modal.module.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/regressionDiagram/regression-diagram.component.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/regressionDiagram/regression-diagram.component.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/regressionDiagram/regression-diagram.module.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/regressionDiagram/regression-diagram.module.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reporting-modal.component.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reporting-modal.component.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reporting-modal.module.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reporting-modal.module.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingIndicatorAdd/reporting-indicator-add.component.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingIndicatorAdd/reporting-indicator-add.component.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingIndicatorAdd/reporting-indicator-add.module.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingIndicatorAdd/reporting-indicator-add.module.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingOverview/reporting-overview.component.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingOverview/reporting-overview.component.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingOverview/reporting-overview.module.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingOverview/reporting-overview.module.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingTemplateSelect/reporting-template-select.component.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingTemplateSelect/reporting-template-select.component.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingTemplateSelect/reporting-template-select.module.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingTemplateSelect/reporting-template-select.module.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingWorkflowSelect/reporting-workflow-select.component.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingWorkflowSelect/reporting-workflow-select.component.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingWorkflowSelect/reporting-workflow-select.module.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingWorkflowSelect/reporting-workflow-select.module.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/spatialUnitNotificationModal/spatial-unit-notification-modal.component.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/spatialUnitNotificationModal/spatial-unit-notification-modal.component.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/spatialUnitNotificationModal/spatial-unit-notification-modal.module.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/spatialUnitNotificationModal/spatial-unit-notification-modal.module.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/versionInfo/version-info.component.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/versionInfo/version-info.component.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/versionInfo/version-info.module.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/versionInfo/version-info.module.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorMap/kommonitor-map.component.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorMap/kommonitor-map.component.ts create mode 100644 app/components/kommonitorUserInterface/kommonitorMap/kommonitor-map.module.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorMap/kommonitor-map.module.ts create mode 100644 app/config/env_backup.js.map create mode 100644 app/config/env_backup.ts create mode 100644 app/kommonitor-script-resources/km_georesource_miscStatistics.js.map create mode 100644 app/kommonitor-script-resources/km_georesource_miscStatistics.ts create mode 100644 app/kommonitor-script-resources/km_georesource_share_byPropertyValue.js.map create mode 100644 app/kommonitor-script-resources/km_georesource_share_byPropertyValue.ts create mode 100644 app/kommonitor-script-resources/km_georessouce_count_pointsWithinPolygon.js.map create mode 100644 app/kommonitor-script-resources/km_georessouce_count_pointsWithinPolygon.ts create mode 100644 app/kommonitor-script-resources/km_georessouce_length_lineSegmentsWithinPolygon.js.map create mode 100644 app/kommonitor-script-resources/km_georessouce_length_lineSegmentsWithinPolygon.ts create mode 100644 app/kommonitor-script-resources/km_headline_indicator.js.map create mode 100644 app/kommonitor-script-resources/km_headline_indicator.ts create mode 100644 app/kommonitor-script-resources/km_indicator_absChange_nTemporalItems.js.map create mode 100644 app/kommonitor-script-resources/km_indicator_absChange_nTemporalItems.ts create mode 100644 app/kommonitor-script-resources/km_indicator_absChange_refDate.js.map create mode 100644 app/kommonitor-script-resources/km_indicator_absChange_refDate.ts create mode 100644 app/kommonitor-script-resources/km_indicator_continuity_nTemporalItems.js.map create mode 100644 app/kommonitor-script-resources/km_indicator_continuity_nTemporalItems.ts create mode 100644 app/kommonitor-script-resources/km_indicator_divide.js.map create mode 100644 app/kommonitor-script-resources/km_indicator_divide.ts create mode 100644 app/kommonitor-script-resources/km_indicator_multiply.js.map create mode 100644 app/kommonitor-script-resources/km_indicator_multiply.ts create mode 100644 app/kommonitor-script-resources/km_indicator_percentage.js.map create mode 100644 app/kommonitor-script-resources/km_indicator_percentage.ts create mode 100644 app/kommonitor-script-resources/km_indicator_promille.js.map create mode 100644 app/kommonitor-script-resources/km_indicator_promille.ts create mode 100644 app/kommonitor-script-resources/km_indicator_relChange_nTemporalItems.js.map create mode 100644 app/kommonitor-script-resources/km_indicator_relChange_nTemporalItems.ts create mode 100644 app/kommonitor-script-resources/km_indicator_relChange_refDate.js.map create mode 100644 app/kommonitor-script-resources/km_indicator_relChange_refDate.ts create mode 100644 app/kommonitor-script-resources/km_indicator_share.js.map create mode 100644 app/kommonitor-script-resources/km_indicator_share.ts create mode 100644 app/kommonitor-script-resources/km_indicator_subtract.js.map create mode 100644 app/kommonitor-script-resources/km_indicator_subtract.ts create mode 100644 app/kommonitor-script-resources/km_indicator_sum.js.map create mode 100644 app/kommonitor-script-resources/km_indicator_sum.ts create mode 100644 app/kommonitor-script-resources/km_indicator_trend_nTemporalItems.js.map create mode 100644 app/kommonitor-script-resources/km_indicator_trend_nTemporalItems.ts create mode 100644 app/kommonitor-script-resources/kommonitor-script-template.js.map create mode 100644 app/kommonitor-script-resources/kommonitor-script-template.ts create mode 100644 app/util/genericServices/kommonitorBatchUpdateHelperService/kommonitor-batch-update-helper-service.module.js.map create mode 100644 app/util/genericServices/kommonitorBatchUpdateHelperService/kommonitor-batch-update-helper-service.module.ts create mode 100644 app/util/genericServices/kommonitorCacheHelperService/kommonitor-cache-helper-service.module.js.map create mode 100644 app/util/genericServices/kommonitorCacheHelperService/kommonitor-cache-helper-service.module.ts create mode 100644 app/util/genericServices/kommonitorConfigStorageService/kommonitor-config-storage-service.module.js.map create mode 100644 app/util/genericServices/kommonitorConfigStorageService/kommonitor-config-storage-service.module.ts create mode 100644 app/util/genericServices/kommonitorDataExchangeService/kommonitor-data-exchange-service.module.js.map create mode 100644 app/util/genericServices/kommonitorDataExchangeService/kommonitor-data-exchange-service.module.ts create mode 100644 app/util/genericServices/kommonitorDataGridHelperService/kommonitor-data-grid-helper-service.module.js.map create mode 100644 app/util/genericServices/kommonitorDataGridHelperService/kommonitor-data-grid-helper-service.module.ts create mode 100644 app/util/genericServices/kommonitorDiagramHelperService/kommonitor-diagram-helper-service.module.js.map create mode 100644 app/util/genericServices/kommonitorDiagramHelperService/kommonitor-diagram-helper-service.module.ts create mode 100644 app/util/genericServices/kommonitorElementVisibilityHelperService/kommonitor-element-visibility-helper-service.module.js.map create mode 100644 app/util/genericServices/kommonitorElementVisibilityHelperService/kommonitor-element-visibility-helper-service.module.ts create mode 100644 app/util/genericServices/kommonitorFilterHelperService/kommonitor-filter-helper-service.module.js.map create mode 100644 app/util/genericServices/kommonitorFilterHelperService/kommonitor-filter-helper-service.module.ts create mode 100644 app/util/genericServices/kommonitorImporterHelperService/kommonitor-importer-helper-service.module.js.map create mode 100644 app/util/genericServices/kommonitorImporterHelperService/kommonitor-importer-helper-service.module.ts create mode 100644 app/util/genericServices/kommonitorInfoLegendHelperService/kommonitor-info-legend-helper-service.module.js.map create mode 100644 app/util/genericServices/kommonitorInfoLegendHelperService/kommonitor-info-legend-helper-service.module.ts create mode 100644 app/util/genericServices/kommonitorKeycloakHelperService/kommonitor-keycloak-helper-service.module.js.map create mode 100644 app/util/genericServices/kommonitorKeycloakHelperService/kommonitor-keycloak-helper-service.module.ts create mode 100644 app/util/genericServices/kommonitorMultiStepFormHelperService/kommonitor-multi-step-form-helper-service.module.js.map create mode 100644 app/util/genericServices/kommonitorMultiStepFormHelperService/kommonitor-multi-step-form-helper-service.module.ts create mode 100644 app/util/genericServices/kommonitorScriptHelperService/kommonitor-script-helper-service.module.js.map create mode 100644 app/util/genericServices/kommonitorScriptHelperService/kommonitor-script-helper-service.module.ts create mode 100644 app/util/genericServices/kommonitorShareHelperService/kommonitor-share-helper-service.module.js.map create mode 100644 app/util/genericServices/kommonitorShareHelperService/kommonitor-share-helper-service.module.ts create mode 100644 app/util/genericServices/kommonitorSingleFeatureMapHelperService/kommonitor-single-feature-map-helper-service.module.js.map create mode 100644 app/util/genericServices/kommonitorSingleFeatureMapHelperService/kommonitor-single-feature-map-helper-service.module.ts create mode 100644 app/util/genericServices/kommonitorVisualStyleHelperService/kommonitor-visual-style-helper-service.module.js.map create mode 100644 app/util/genericServices/kommonitorVisualStyleHelperService/kommonitor-visual-style-helper-service.module.ts create mode 100644 tsconfig.json diff --git a/app/app.js b/app/app.js index caf0bf986..596654234 100644 --- a/app/app.js +++ b/app/app.js @@ -1,526 +1,436 @@ +"use strict"; if (/MSIE 9/i.test(navigator.userAgent) || /MSIE 10/i.test(navigator.userAgent) || /rv:11.0/i.test(navigator.userAgent)) { // This is internet explorer 9, 10 or 11 window.alert('Internet Explorer erkannt. Für eine optimale Nutzung von KomMonitor nutzen Sie nach Möglichkeit die Browser Firefox oder Chrome.'); } - - -if (/Edge\/\d./i.test(navigator.userAgent)){ - // This is Microsoft Edge - - window.alert('Microsoft Edge erkannt. Für eine optimale Nutzung von KomMonitor nutzen Sie nach Möglichkeit die Browser Firefox oder Chrome.'); +if (/Edge\/\d./i.test(navigator.userAgent)) { + // This is Microsoft Edge + window.alert('Microsoft Edge erkannt. Für eine optimale Nutzung von KomMonitor nutzen Sie nach Möglichkeit die Browser Firefox oder Chrome.'); } - var env = {}; - // for jspdf insert backwards compatibility according to https://github.com/parallax/jsPDF/releases/tag/v2.0.0 window.jsPDF = window.jspdf.jsPDF; - // Declare app level module which depends on views, and components -var appModule = angular.module('kommonitorClient', [ 'ngRoute', 'kommonitorUserInterface', 'kommonitorAdmin']); - +var appModule = angular.module('kommonitorClient', ['ngRoute', 'kommonitorUserInterface', 'kommonitorAdmin']); var controlsServiceName = 'ControlsConfigService'; var auth = {}; - - /* LOAD CONFIG FILES FROM CONFIG STORAGE SERVER */ function ajaxCall_keycloakConfig(configStorageServerConfig) { - console.log("try to fetch keycloak config file"); - return $.ajax({ - url: configStorageServerConfig.targetUrlToConfigStorageServer_keycloakConfig, - success: function(result){ - console.log("keycloak config file fetched"); - window.__env.keycloakConfig = result; - return; - }, - error: function(XMLHttpRequest, textStatus, errorThrown) { - console.log("Use keycloak.json local backup default values"); - } - }); -} - + console.log("try to fetch keycloak config file"); + return $.ajax({ + url: configStorageServerConfig.targetUrlToConfigStorageServer_keycloakConfig, + success: function (result) { + console.log("keycloak config file fetched"); + window.__env.keycloakConfig = result; + return; + }, + error: function (XMLHttpRequest, textStatus, errorThrown) { + console.log("Use keycloak.json local backup default values"); + } + }); +} function ajaxCall_appConfig(configStorageServerConfig) { - console.log("try to fetch app config file"); - return $.ajax({ - url: configStorageServerConfig.targetUrlToConfigStorageServer_appConfig, - success: function(result){ - console.log("app config file fetched"); - window.__env.appConfig = result; - return; - }, - error: function(XMLHttpRequest, textStatus, errorThrown) { - console.log("Use env.js local backup default values"); - } - }); -} - + console.log("try to fetch app config file"); + return $.ajax({ + url: configStorageServerConfig.targetUrlToConfigStorageServer_appConfig, + success: function (result) { + console.log("app config file fetched"); + window.__env.appConfig = result; + return; + }, + error: function (XMLHttpRequest, textStatus, errorThrown) { + console.log("Use env.js local backup default values"); + } + }); +} function ajaxCall_controlsConfig(configStorageServerConfig) { - console.log("try to fetch controls config file"); - return $.ajax({ - url: configStorageServerConfig.targetUrlToConfigStorageServer_controlsConfig, - success: function(result){ - console.log("controls config file fetched"); - window.__env.controlsConfig = result; - return; - }, - error: function(XMLHttpRequest, textStatus, errorThrown) { - console.log("Use controls-config.json local backup default values that has no widget restrictions."); - } - }); -} - - + console.log("try to fetch controls config file"); + return $.ajax({ + url: configStorageServerConfig.targetUrlToConfigStorageServer_controlsConfig, + success: function (result) { + console.log("controls config file fetched"); + window.__env.controlsConfig = result; + return; + }, + error: function (XMLHttpRequest, textStatus, errorThrown) { + console.log("Use controls-config.json local backup default values that has no widget restrictions."); + } + }); +} /* LOAD CONFIG FILES FROM LOCAL BACKUP FILES */ function ajaxCall_keycloakConfig_localBackup(configStorageServerConfig) { - return $.ajax({ - url: "./config/keycloak_backup.json", - success: function(result){ - console.log("local keycloak config file with default values fetched"); - window.__env.keycloakConfig = result; - return; - }, - error: function(XMLHttpRequest, textStatus, errorThrown) { - console.log("Error parsing local keycloak.json backup file"); - } -}); -} - + return $.ajax({ + url: "./config/keycloak_backup.json", + success: function (result) { + console.log("local keycloak config file with default values fetched"); + window.__env.keycloakConfig = result; + return; + }, + error: function (XMLHttpRequest, textStatus, errorThrown) { + console.log("Error parsing local keycloak.json backup file"); + } + }); +} function ajaxCall_controlsConfig_localBackup(configStorageServerConfig) { - return $.ajax({ - url: "./config/controls-config_backup.json", - success: function(result){ - console.log("local controls-config file with default values fetched"); - window.__env.controlsConfig = result; - return; - }, - error: function(XMLHttpRequest, textStatus, errorThrown) { - console.log("Error parsing local controlsConfig.json backup file"); - } -}); -} - - -function loadAppConfigScriptDynamically(scriptUrl){ - return new Promise(function (res, rej) { - let script = document.createElement('script'); - script.src = scriptUrl; - script.type = 'text/javascript'; - script.onError = rej; - script.async = true; - script.onload = res; - script.addEventListener('error',rej); - script.addEventListener('load',res); - document.head.appendChild(script); - }); + return $.ajax({ + url: "./config/controls-config_backup.json", + success: function (result) { + console.log("local controls-config file with default values fetched"); + window.__env.controlsConfig = result; + return; + }, + error: function (XMLHttpRequest, textStatus, errorThrown) { + console.log("Error parsing local controlsConfig.json backup file"); + } + }); +} +function loadAppConfigScriptDynamically(scriptUrl) { + return new Promise(function (res, rej) { + let script = document.createElement('script'); + script.src = scriptUrl; + script.type = 'text/javascript'; + script.onError = rej; + script.async = true; + script.onload = res; + script.addEventListener('error', rej); + script.addEventListener('load', res); + document.head.appendChild(script); + }); } - function ajaxCall_configServerFile() { - return $.ajax({ - url: "./config/config-storage-server.json", - success: function(result){ - window.__env = window.__env || {}; - window.__env.configStorageServerConfig = result; - - // inject script tag dynamically to DOM to load ENV variables - console.log("dynamically load env.js"); - const event = loadAppConfigScriptDynamically(window.__env.configStorageServerConfig.targetUrlToConfigStorageServer_appConfig) - .then(() => { console.log("loaded"); }) - .catch(() => { - console.log("Error while loading app config from client config storage server. Will use defaults instead"); - alert("Error while loading app config from client config storage server. Will use defaults instead."); - }); - - - return $.when(ajaxCall_keycloakConfig(window.__env.configStorageServerConfig), ajaxCall_controlsConfig(window.__env.configStorageServerConfig), ajaxCall_appConfig(window.__env.configStorageServerConfig)).then(function(ajax1Results,ajax2Results, ajax3Results){ - console.log("all configs have been loaded"); - - initAngularComponents(); - - bootstrapApplication(); - - return; - }, function(){ - // on fail - console.log("all configs have been loaded - at least some from local backup values. See console log for details"); - - initAngularComponents(); - - bootstrapApplication(); - - return; - }); - } - }); -} - -var loadConfigsThenApp = function(){ - - console.log("start loading required config files"); - - $.when(ajaxCall_keycloakConfig_localBackup(window.__env.configStorageServerConfig), ajaxCall_controlsConfig_localBackup(window.__env.configStorageServerConfig)).then(function(ajax1Results,ajax2Results){ - console.log("local backup configs have been loaded in case config server is not reachable."); - - ajaxCall_configServerFile(); - - }, function(){ - // on fail - console.log("all configs have been loaded - at least some from local backup values. See console log for details"); - - ajaxCall_configServerFile(); - }); - + return $.ajax({ + url: "./config/config-storage-server.json", + success: function (result) { + window.__env = window.__env || {}; + window.__env.configStorageServerConfig = result; + // inject script tag dynamically to DOM to load ENV variables + console.log("dynamically load env.js"); + const event = loadAppConfigScriptDynamically(window.__env.configStorageServerConfig.targetUrlToConfigStorageServer_appConfig) + .then(() => { console.log("loaded"); }) + .catch(() => { + console.log("Error while loading app config from client config storage server. Will use defaults instead"); + alert("Error while loading app config from client config storage server. Will use defaults instead."); + }); + return $.when(ajaxCall_keycloakConfig(window.__env.configStorageServerConfig), ajaxCall_controlsConfig(window.__env.configStorageServerConfig), ajaxCall_appConfig(window.__env.configStorageServerConfig)).then(function (ajax1Results, ajax2Results, ajax3Results) { + console.log("all configs have been loaded"); + initAngularComponents(); + bootstrapApplication(); + return; + }, function () { + // on fail + console.log("all configs have been loaded - at least some from local backup values. See console log for details"); + initAngularComponents(); + bootstrapApplication(); + return; + }); + } + }); +} +var loadConfigsThenApp = function () { + console.log("start loading required config files"); + $.when(ajaxCall_keycloakConfig_localBackup(window.__env.configStorageServerConfig), ajaxCall_controlsConfig_localBackup(window.__env.configStorageServerConfig)).then(function (ajax1Results, ajax2Results) { + console.log("local backup configs have been loaded in case config server is not reachable."); + ajaxCall_configServerFile(); + }, function () { + // on fail + console.log("all configs have been loaded - at least some from local backup values. See console log for details"); + ajaxCall_configServerFile(); + }); }; - -function initAngularComponents(){ - console.log("Start to initialize required AngularJS components"); - - // Import variables if present (from env.js) - if(window){ - Object.assign(env, window.__env); - } - - // Register environment in AngularJS as constant - appModule.constant('__env', env); - - // MathJx directive - appModule.directive("mathjaxBind", function () { - return { - restrict: "EA", - controller: [ - "$scope", - "$element", - "$attrs", - function ($scope, $element, $attrs) { - $scope.$watch($attrs.mathjaxBind, function (texExpression) { - $element.html(texExpression); - // only if texExpression contains the special character '$' which is used to mark tex code - // then call MathJax function - if(texExpression && texExpression.includes("$")){ - MathJax.typesetPromise([$element[0]]); - } - }); - }, - ], - }; - }); - - // custom unique filter - appModule.filter('unique', function() { - return function(collection, primaryKey) { //no need for secondary key - var output = [], - keys = []; - var splitKeys = primaryKey.split('.'); //split by period - - - angular.forEach(collection, function(item) { - var key = {}; - angular.copy(item, key); - for(var i=0; i', - resolve: { - controlsServiceName: function(ControlsConfigService){ - return ControlsConfigService.promise; - } - } - }). - when('/administration', { - template: '', - resolve: { - 'auth': function(Auth, $q, $location) { - if(window.__env.enableKeycloakSecurity){ - if (Auth.keycloak.authenticated) { - if(Auth.keycloak.tokenParsed - && Auth.keycloak.tokenParsed.realm_access - && Auth.keycloak.tokenParsed.realm_access.roles - && Auth.keycloak.tokenParsed.realm_access.roles.some(role => role.endsWith("-creator") || role.endsWith("-publisher") || role.endsWith("-editor"))){ - Auth.keycloak.showAdminView = true; - } - if (Auth.keycloak.showAdminView) { - return true; - } else { - return $q.reject('Not Authenticated'); + // custom unique filter + appModule.filter('unique', function () { + return function (collection, primaryKey) { + var output = [], keys = []; + var splitKeys = primaryKey.split('.'); //split by period + angular.forEach(collection, function (item) { + var key = {}; + angular.copy(item, key); + for (var i = 0; i < splitKeys.length; i++) { + key = key[splitKeys[i]]; //the beauty of loosely typed js :) + } + if (keys.indexOf(key) === -1) { + keys.push(key); + output.push(item); + } + }); + return output; + }; + }); + appModule.service(controlsServiceName, ['$http', function ($http) { + window.__env.config = null; + // var resourcePath = window.__env.configStorageServerConfig ? window.__env.configStorageServerConfig.targetUrlToConfigStorageServer_controlsConfig : './config/controls-config_backup.json'; + var resourcePath = './config/controls-config_backup.json'; + var promise = $http.get(resourcePath).then(function (response) { + // window.__env.config = response.data; + window.__env.config = window.__env.controlsConfig; + }); + return { + promise: promise, + setData: function (response) { + window.__env.config = window.__env.controlsConfig; + }, + getControlsConfig: function () { + return window.__env.config; + } + }; + }]); + appModule. + config(['$routeProvider', + function config($routeProvider) { + $routeProvider. + when('/', { + template: '', + resolve: { + controlsServiceName: function (ControlsConfigService) { + return ControlsConfigService.promise; } - } - else { - Auth.keycloak.login({ - redirectUri: $location.absUrl() - }); - } } - else{ - + }). + when('/administration', { + template: '', + resolve: { + 'auth': function (Auth, $q, $location) { + if (window.__env.enableKeycloakSecurity) { + if (Auth.keycloak.authenticated) { + if (Auth.keycloak.tokenParsed + && Auth.keycloak.tokenParsed.realm_access + && Auth.keycloak.tokenParsed.realm_access.roles + && Auth.keycloak.tokenParsed.realm_access.roles.some(role => role.endsWith("-creator") || role.endsWith("-publisher") || role.endsWith("-editor"))) { + Auth.keycloak.showAdminView = true; + } + if (Auth.keycloak.showAdminView) { + return true; + } + else { + return $q.reject('Not Authenticated'); + } + } + else { + Auth.keycloak.login({ + redirectUri: $location.absUrl() + }); + } + } + else { + } + } } - - } - } - }). - otherwise('/'); - } + }). + otherwise('/'); + } ]) - .run( function($rootScope, $location, Auth) { - // register listener to watch route changes - $rootScope.$on( "$routeChangeError", function(event, next, current) { - $location.path( "/" ); - }); + .run(function ($rootScope, $location, Auth) { + // register listener to watch route changes + $rootScope.$on("$routeChangeError", function (event, next, current) { + $location.path("/"); + }); }); - - if (!env.enableDebug) { - if(window){ - window.console.log=function(){}; - } + if (window) { + window.console.log = function () { }; + } } - - if(window.__env.enableKeycloakSecurity){ - appModule.factory('authInterceptor', ['$q', 'Auth', function ($q, Auth) { - return { - request: function (config) { - var deferred = $q.defer(); - if (Auth.keycloak.token && urlRequiresKeycloakAuthHeader(config.url)) { - Auth.keycloak.updateToken(5).then(function () { - config.headers = config.headers || {}; - config.headers.Authorization = 'Bearer ' + Auth.keycloak.token; - deferred.resolve(config); - }).catch(function () { - deferred.reject('Failed to refresh token'); - console.error('Failed to refresh token. Will redirect to Login screen'); - auth.keycloak.login(); - }); - return deferred.promise; - } else { - return config; - } - } - }; - }]); - - appModule.config(['$httpProvider', function ($httpProvider) { - $httpProvider.interceptors.push('authInterceptor'); - }]); + if (window.__env.enableKeycloakSecurity) { + appModule.factory('authInterceptor', ['$q', 'Auth', function ($q, Auth) { + return { + request: function (config) { + var deferred = $q.defer(); + if (Auth.keycloak.token && urlRequiresKeycloakAuthHeader(config.url)) { + Auth.keycloak.updateToken(5).then(function () { + config.headers = config.headers || {}; + config.headers.Authorization = 'Bearer ' + Auth.keycloak.token; + deferred.resolve(config); + }).catch(function () { + deferred.reject('Failed to refresh token'); + console.error('Failed to refresh token. Will redirect to Login screen'); + auth.keycloak.login(); + }); + return deferred.promise; + } + else { + return config; + } + } + }; + }]); + appModule.config(['$httpProvider', function ($httpProvider) { + $httpProvider.interceptors.push('authInterceptor'); + }]); } - - if(env.encryption.enabled){ - appModule.factory('encryptionInterceptor', ['$q', function ($q) { - return { - response: function (response) { - // if encrypted, then will look like: - // {encryptedData: encryptedData} - // using AES-CBC - - if(response.data.encryptedData){ - try { - var encryptedString = response.data.encryptedData; - - var decryptedJson = decryptAesCBC(encryptedString); - - response.data = decryptedJson; - - return response; - } catch (error) { - console.error(error); - return response; - } - } - - return response; - }, - }; - }]); - - appModule.config(['$httpProvider', function ($httpProvider) { - $httpProvider.interceptors.push('encryptionInterceptor'); - }]); + if (env.encryption.enabled) { + appModule.factory('encryptionInterceptor', ['$q', function ($q) { + return { + response: function (response) { + // if encrypted, then will look like: + // {encryptedData: encryptedData} + // using AES-CBC + if (response.data.encryptedData) { + try { + var encryptedString = response.data.encryptedData; + var decryptedJson = decryptAesCBC(encryptedString); + response.data = decryptedJson; + return response; + } + catch (error) { + console.error(error); + return response; + } + } + return response; + }, + }; + }]); + appModule.config(['$httpProvider', function ($httpProvider) { + $httpProvider.interceptors.push('encryptionInterceptor'); + }]); } - } - -function bootstrapApplication(){ - - if(window.__env.enableKeycloakSecurity){ - var keycloakAdapter = new Keycloak(window.__env.configStorageServerConfig.targetUrlToConfigStorageServer_keycloakConfig); - - // https://www.keycloak.org/docs/latest/securing_apps/#session-status-iframe - // https://www.keycloak.org/docs/latest/securing_apps/#_modern_browsers - - keycloakAdapter.init({ - onLoad: 'check-sso', - checkLoginIframe: false, - silentCheckSsoFallback: false - }).then(function (authenticated) { - console.log(authenticated ? 'User is authenticated!' : 'User is not authenticated!'); - auth.keycloak = keycloakAdapter; - appModule.factory('Auth', function () { - return auth; - }); - try { - console.debug('Trying to bootstrap application.'); - angular.bootstrap(document, [appModule.name]); - } - catch (e) { - console.error('Application bootstrapping failed.'); - console.error(e); - } - }).catch(function () { - console.log('Failed to initialize authentication adapter. Will try to bootstrap application without keycloak security'); - alert('Failed to initialize keycloak authentication adapter. Will try to bootstrap application without keycloak security'); - window.__env.enableKeycloakSecurity = false; - bootstrapApplication(); - }); - } - else{ - var keycloakAdapter = new Keycloak(keycloakConfig_forDirectInit); - auth.keycloak = keycloakAdapter; - appModule.factory('Auth', function () { - return auth; - }); - - try { - console.debug('Trying to bootstrap application.'); - angular.bootstrap(document, [appModule.name]); - } - catch (e) { - console.error('Application bootstrapping failed.'); - console.error(e); - } - } - +function bootstrapApplication() { + if (window.__env.enableKeycloakSecurity) { + var keycloakAdapter = new Keycloak(window.__env.configStorageServerConfig.targetUrlToConfigStorageServer_keycloakConfig); + // https://www.keycloak.org/docs/latest/securing_apps/#session-status-iframe + // https://www.keycloak.org/docs/latest/securing_apps/#_modern_browsers + keycloakAdapter.init({ + onLoad: 'check-sso', + checkLoginIframe: false, + silentCheckSsoFallback: false + }).then(function (authenticated) { + console.log(authenticated ? 'User is authenticated!' : 'User is not authenticated!'); + auth.keycloak = keycloakAdapter; + appModule.factory('Auth', function () { + return auth; + }); + try { + console.debug('Trying to bootstrap application.'); + angular.bootstrap(document, [appModule.name]); + } + catch (e) { + console.error('Application bootstrapping failed.'); + console.error(e); + } + }).catch(function () { + console.log('Failed to initialize authentication adapter. Will try to bootstrap application without keycloak security'); + alert('Failed to initialize keycloak authentication adapter. Will try to bootstrap application without keycloak security'); + window.__env.enableKeycloakSecurity = false; + bootstrapApplication(); + }); + } + else { + var keycloakAdapter = new Keycloak(keycloakConfig_forDirectInit); + auth.keycloak = keycloakAdapter; + appModule.factory('Auth', function () { + return auth; + }); + try { + console.debug('Trying to bootstrap application.'); + angular.bootstrap(document, [appModule.name]); + } + catch (e) { + console.error('Application bootstrapping failed.'); + console.error(e); + } + } } - angular.element(document).ready(function ($http) { - - // load configs before doing anything else - loadConfigsThenApp(); + // load configs before doing anything else + loadConfigsThenApp(); }); - -var urlRequiresKeycloakAuthHeader = function(url){ - // /admin/ is used to make admin requests against keycloak - if (url.includes("/admin/")){ - return false; - } - // ORS isochrones and directions requests - if (url.includes("isochrones")){ - return false; - } - if (url.includes("routes")){ - return false; - } - - // for KomMonitor public requests we do not need any authentication - if (url.includes("/public/")){ - return false; - } - - return true; +var urlRequiresKeycloakAuthHeader = function (url) { + // /admin/ is used to make admin requests against keycloak + if (url.includes("/admin/")) { + return false; + } + // ORS isochrones and directions requests + if (url.includes("isochrones")) { + return false; + } + if (url.includes("routes")) { + return false; + } + // for KomMonitor public requests we do not need any authentication + if (url.includes("/public/")) { + return false; + } + return true; }; - - - -var isBase64 = function(str) { - var notBase64 = /[^A-Z0-9+\/=]/i; - const isString = (typeof str === 'string' || str instanceof String); - - if (!isString) { - let invalidType; - if (str === null) { - invalidType = 'null'; - } else { - invalidType = typeof str; - if (invalidType === 'object' && str.constructor && str.constructor.hasOwnProperty('name')) { - invalidType = str.constructor.name; - } else { - invalidType = `a ${invalidType}`; - } +var isBase64 = function (str) { + var notBase64 = /[^A-Z0-9+\/=]/i; + const isString = (typeof str === 'string' || str instanceof String); + if (!isString) { + let invalidType; + if (str === null) { + invalidType = 'null'; + } + else { + invalidType = typeof str; + if (invalidType === 'object' && str.constructor && str.constructor.hasOwnProperty('name')) { + invalidType = str.constructor.name; + } + else { + invalidType = `a ${invalidType}`; + } + } + throw new TypeError(`Expected string but received ${invalidType}.`); + } + const len = str.length; + if (!len || len % 4 !== 0 || notBase64.test(str)) { + return false; } - throw new TypeError(`Expected string but received ${invalidType}.`); - } - - const len = str.length; - if (!len || len % 4 !== 0 || notBase64.test(str)) { - return false; - } - const firstPaddingChar = str.indexOf('='); - return firstPaddingChar === -1 || - firstPaddingChar === len - 1 || - (firstPaddingChar === len - 2 && str[len - 1] === '='); - + const firstPaddingChar = str.indexOf('='); + return firstPaddingChar === -1 || + firstPaddingChar === len - 1 || + (firstPaddingChar === len - 2 && str[len - 1] === '='); }; - -var decryptAesCBC = function(encryptedString){ - - var hashedKey = CryptoJS.SHA256(env.encryption.password); - +var decryptAesCBC = function (encryptedString) { + var hashedKey = CryptoJS.SHA256(env.encryption.password); // from BASE64 encoded encrypted string var encryptedWordArray = CryptoJS.enc.Base64.parse(encryptedString); - // get IV from beginning - var iv = CryptoJS.lib.WordArray.create( - encryptedWordArray.words.slice(0, (env.encryption.ivLength_byte) / 4 ) - ); - - var decrypted = CryptoJS.AES.decrypt( - { - ciphertext: CryptoJS.lib.WordArray.create( - encryptedWordArray.words.slice(env.encryption.ivLength_byte / 4) - ) - }, - hashedKey, - {iv: iv} - ); - + var iv = CryptoJS.lib.WordArray.create(encryptedWordArray.words.slice(0, (env.encryption.ivLength_byte) / 4)); + var decrypted = CryptoJS.AES.decrypt({ + ciphertext: CryptoJS.lib.WordArray.create(encryptedWordArray.words.slice(env.encryption.ivLength_byte / 4)) + }, hashedKey, { iv: iv }); var decryptedString = decrypted.toString(CryptoJS.enc.Utf8); - var decryptedJson = JSON.parse(decryptedString); - // sometimes a response might still be BASE64 encoded in addition // if so, then resolve that - if((typeof decryptedJson === 'string' || decryptedJson instanceof String) && isBase64(decryptedJson)){ - decryptedJson = CryptoJS.enc.Base64.parse(decryptedJson).toString(CryptoJS.enc.Utf8); - decryptedJson = JSON.parse(decryptedJson); + if ((typeof decryptedJson === 'string' || decryptedJson instanceof String) && isBase64(decryptedJson)) { + decryptedJson = CryptoJS.enc.Base64.parse(decryptedJson).toString(CryptoJS.enc.Utf8); + decryptedJson = JSON.parse(decryptedJson); } - - return decryptedJson; + return decryptedJson; }; - - +//# sourceMappingURL=app.js.map \ No newline at end of file diff --git a/app/app.js.map b/app/app.js.map new file mode 100644 index 000000000..ed361f0ab --- /dev/null +++ b/app/app.js.map @@ -0,0 +1 @@ +{"version":3,"file":"app.js","sourceRoot":"","sources":["app.ts"],"names":[],"mappings":";AAAA,IAAI,SAAS,CAAC,IAAI,CA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/app/app.ts @@ -0,0 +1,526 @@ +if (/MSIE 9/i.test(navigator.userAgent) || /MSIE 10/i.test(navigator.userAgent) || /rv:11.0/i.test(navigator.userAgent)) { + // This is internet explorer 9, 10 or 11 + window.alert('Internet Explorer erkannt. Für eine optimale Nutzung von KomMonitor nutzen Sie nach Möglichkeit die Browser Firefox oder Chrome.'); +} + + +if (/Edge\/\d./i.test(navigator.userAgent)){ + // This is Microsoft Edge + + window.alert('Microsoft Edge erkannt. Für eine optimale Nutzung von KomMonitor nutzen Sie nach Möglichkeit die Browser Firefox oder Chrome.'); +} + +var env = {}; + +// for jspdf insert backwards compatibility according to https://github.com/parallax/jsPDF/releases/tag/v2.0.0 +window.jsPDF = window.jspdf.jsPDF; + +// Declare app level module which depends on views, and components +var appModule = angular.module('kommonitorClient', [ 'ngRoute', 'kommonitorUserInterface', 'kommonitorAdmin']); + +var controlsServiceName = 'ControlsConfigService'; +var auth = {}; + + +/* + LOAD CONFIG FILES FROM CONFIG STORAGE SERVER +*/ +function ajaxCall_keycloakConfig(configStorageServerConfig) { + console.log("try to fetch keycloak config file"); + return $.ajax({ + url: configStorageServerConfig.targetUrlToConfigStorageServer_keycloakConfig, + success: function(result){ + console.log("keycloak config file fetched"); + window.__env.keycloakConfig = result; + return; + }, + error: function(XMLHttpRequest, textStatus, errorThrown) { + console.log("Use keycloak.json local backup default values"); + } + }); +} + +function ajaxCall_appConfig(configStorageServerConfig) { + console.log("try to fetch app config file"); + return $.ajax({ + url: configStorageServerConfig.targetUrlToConfigStorageServer_appConfig, + success: function(result){ + console.log("app config file fetched"); + window.__env.appConfig = result; + return; + }, + error: function(XMLHttpRequest, textStatus, errorThrown) { + console.log("Use env.js local backup default values"); + } + }); +} + +function ajaxCall_controlsConfig(configStorageServerConfig) { + console.log("try to fetch controls config file"); + return $.ajax({ + url: configStorageServerConfig.targetUrlToConfigStorageServer_controlsConfig, + success: function(result){ + console.log("controls config file fetched"); + window.__env.controlsConfig = result; + return; + }, + error: function(XMLHttpRequest, textStatus, errorThrown) { + console.log("Use controls-config.json local backup default values that has no widget restrictions."); + } + }); +} + + +/* + LOAD CONFIG FILES FROM LOCAL BACKUP FILES +*/ +function ajaxCall_keycloakConfig_localBackup(configStorageServerConfig) { + return $.ajax({ + url: "./config/keycloak_backup.json", + success: function(result){ + console.log("local keycloak config file with default values fetched"); + window.__env.keycloakConfig = result; + return; + }, + error: function(XMLHttpRequest, textStatus, errorThrown) { + console.log("Error parsing local keycloak.json backup file"); + } +}); +} + +function ajaxCall_controlsConfig_localBackup(configStorageServerConfig) { + return $.ajax({ + url: "./config/controls-config_backup.json", + success: function(result){ + console.log("local controls-config file with default values fetched"); + window.__env.controlsConfig = result; + return; + }, + error: function(XMLHttpRequest, textStatus, errorThrown) { + console.log("Error parsing local controlsConfig.json backup file"); + } +}); +} + + +function loadAppConfigScriptDynamically(scriptUrl){ + return new Promise(function (res, rej) { + let script = document.createElement('script'); + script.src = scriptUrl; + script.type = 'text/javascript'; + script.onError = rej; + script.async = true; + script.onload = res; + script.addEventListener('error',rej); + script.addEventListener('load',res); + document.head.appendChild(script); + }); +} + +function ajaxCall_configServerFile() { + return $.ajax({ + url: "./config/config-storage-server.json", + success: function(result){ + window.__env = window.__env || {}; + window.__env.configStorageServerConfig = result; + + // inject script tag dynamically to DOM to load ENV variables + console.log("dynamically load env.js"); + const event = loadAppConfigScriptDynamically(window.__env.configStorageServerConfig.targetUrlToConfigStorageServer_appConfig) + .then(() => { console.log("loaded"); }) + .catch(() => { + console.log("Error while loading app config from client config storage server. Will use defaults instead"); + alert("Error while loading app config from client config storage server. Will use defaults instead."); + }); + + + return $.when(ajaxCall_keycloakConfig(window.__env.configStorageServerConfig), ajaxCall_controlsConfig(window.__env.configStorageServerConfig), ajaxCall_appConfig(window.__env.configStorageServerConfig)).then(function(ajax1Results,ajax2Results, ajax3Results){ + console.log("all configs have been loaded"); + + initAngularComponents(); + + bootstrapApplication(); + + return; + }, function(){ + // on fail + console.log("all configs have been loaded - at least some from local backup values. See console log for details"); + + initAngularComponents(); + + bootstrapApplication(); + + return; + }); + } + }); +} + +var loadConfigsThenApp = function(){ + + console.log("start loading required config files"); + + $.when(ajaxCall_keycloakConfig_localBackup(window.__env.configStorageServerConfig), ajaxCall_controlsConfig_localBackup(window.__env.configStorageServerConfig)).then(function(ajax1Results,ajax2Results){ + console.log("local backup configs have been loaded in case config server is not reachable."); + + ajaxCall_configServerFile(); + + }, function(){ + // on fail + console.log("all configs have been loaded - at least some from local backup values. See console log for details"); + + ajaxCall_configServerFile(); + }); + +}; + +function initAngularComponents(){ + console.log("Start to initialize required AngularJS components"); + + // Import variables if present (from env.js) + if(window){ + Object.assign(env, window.__env); + } + + // Register environment in AngularJS as constant + appModule.constant('__env', env); + + // MathJx directive + appModule.directive("mathjaxBind", function () { + return { + restrict: "EA", + controller: [ + "$scope", + "$element", + "$attrs", + function ($scope, $element, $attrs) { + $scope.$watch($attrs.mathjaxBind, function (texExpression) { + $element.html(texExpression); + // only if texExpression contains the special character '$' which is used to mark tex code + // then call MathJax function + if(texExpression && texExpression.includes("$")){ + MathJax.typesetPromise([$element[0]]); + } + }); + }, + ], + }; + }); + + // custom unique filter + appModule.filter('unique', function() { + return function(collection, primaryKey) { //no need for secondary key + var output = [], + keys = []; + var splitKeys = primaryKey.split('.'); //split by period + + + angular.forEach(collection, function(item) { + var key = {}; + angular.copy(item, key); + for(var i=0; i', + resolve: { + controlsServiceName: function(ControlsConfigService){ + return ControlsConfigService.promise; + } + } + }). + when('/administration', { + template: '', + resolve: { + 'auth': function(Auth, $q, $location) { + if(window.__env.enableKeycloakSecurity){ + if (Auth.keycloak.authenticated) { + if(Auth.keycloak.tokenParsed + && Auth.keycloak.tokenParsed.realm_access + && Auth.keycloak.tokenParsed.realm_access.roles + && Auth.keycloak.tokenParsed.realm_access.roles.some(role => role.endsWith("-creator") || role.endsWith("-publisher") || role.endsWith("-editor"))){ + Auth.keycloak.showAdminView = true; + } + if (Auth.keycloak.showAdminView) { + return true; + } else { + return $q.reject('Not Authenticated'); + } + } + else { + Auth.keycloak.login({ + redirectUri: $location.absUrl() + }); + } + } + else{ + + } + + } + } + }). + otherwise('/'); + } + ]) + .run( function($rootScope, $location, Auth) { + // register listener to watch route changes + $rootScope.$on( "$routeChangeError", function(event, next, current) { + $location.path( "/" ); + }); + }); + + + if (!env.enableDebug) { + if(window){ + window.console.log=function(){}; + } + } + + if(window.__env.enableKeycloakSecurity){ + appModule.factory('authInterceptor', ['$q', 'Auth', function ($q, Auth) { + return { + request: function (config) { + var deferred = $q.defer(); + if (Auth.keycloak.token && urlRequiresKeycloakAuthHeader(config.url)) { + Auth.keycloak.updateToken(5).then(function () { + config.headers = config.headers || {}; + config.headers.Authorization = 'Bearer ' + Auth.keycloak.token; + deferred.resolve(config); + }).catch(function () { + deferred.reject('Failed to refresh token'); + console.error('Failed to refresh token. Will redirect to Login screen'); + auth.keycloak.login(); + }); + return deferred.promise; + } else { + return config; + } + } + }; + }]); + + appModule.config(['$httpProvider', function ($httpProvider) { + $httpProvider.interceptors.push('authInterceptor'); + }]); + } + + if(env.encryption.enabled){ + appModule.factory('encryptionInterceptor', ['$q', function ($q) { + return { + response: function (response) { + // if encrypted, then will look like: + // {encryptedData: encryptedData} + // using AES-CBC + + if(response.data.encryptedData){ + try { + var encryptedString = response.data.encryptedData; + + var decryptedJson = decryptAesCBC(encryptedString); + + response.data = decryptedJson; + + return response; + } catch (error) { + console.error(error); + return response; + } + } + + return response; + }, + }; + }]); + + appModule.config(['$httpProvider', function ($httpProvider) { + $httpProvider.interceptors.push('encryptionInterceptor'); + }]); + } + +} + +function bootstrapApplication(){ + + if(window.__env.enableKeycloakSecurity){ + var keycloakAdapter = new Keycloak(window.__env.configStorageServerConfig.targetUrlToConfigStorageServer_keycloakConfig); + + // https://www.keycloak.org/docs/latest/securing_apps/#session-status-iframe + // https://www.keycloak.org/docs/latest/securing_apps/#_modern_browsers + + keycloakAdapter.init({ + onLoad: 'check-sso', + checkLoginIframe: false, + silentCheckSsoFallback: false + }).then(function (authenticated) { + console.log(authenticated ? 'User is authenticated!' : 'User is not authenticated!'); + auth.keycloak = keycloakAdapter; + appModule.factory('Auth', function () { + return auth; + }); + try { + console.debug('Trying to bootstrap application.'); + angular.bootstrap(document, [appModule.name]); + } + catch (e) { + console.error('Application bootstrapping failed.'); + console.error(e); + } + }).catch(function () { + console.log('Failed to initialize authentication adapter. Will try to bootstrap application without keycloak security'); + alert('Failed to initialize keycloak authentication adapter. Will try to bootstrap application without keycloak security'); + window.__env.enableKeycloakSecurity = false; + bootstrapApplication(); + }); + } + else{ + var keycloakAdapter = new Keycloak(keycloakConfig_forDirectInit); + auth.keycloak = keycloakAdapter; + appModule.factory('Auth', function () { + return auth; + }); + + try { + console.debug('Trying to bootstrap application.'); + angular.bootstrap(document, [appModule.name]); + } + catch (e) { + console.error('Application bootstrapping failed.'); + console.error(e); + } + } + +} + +angular.element(document).ready(function ($http) { + + // load configs before doing anything else + loadConfigsThenApp(); +}); + +var urlRequiresKeycloakAuthHeader = function(url){ + // /admin/ is used to make admin requests against keycloak + if (url.includes("/admin/")){ + return false; + } + // ORS isochrones and directions requests + if (url.includes("isochrones")){ + return false; + } + if (url.includes("routes")){ + return false; + } + + // for KomMonitor public requests we do not need any authentication + if (url.includes("/public/")){ + return false; + } + + return true; +}; + + + +var isBase64 = function(str) { + var notBase64 = /[^A-Z0-9+\/=]/i; + const isString = (typeof str === 'string' || str instanceof String); + + if (!isString) { + let invalidType; + if (str === null) { + invalidType = 'null'; + } else { + invalidType = typeof str; + if (invalidType === 'object' && str.constructor && str.constructor.hasOwnProperty('name')) { + invalidType = str.constructor.name; + } else { + invalidType = `a ${invalidType}`; + } + } + throw new TypeError(`Expected string but received ${invalidType}.`); + } + + const len = str.length; + if (!len || len % 4 !== 0 || notBase64.test(str)) { + return false; + } + const firstPaddingChar = str.indexOf('='); + return firstPaddingChar === -1 || + firstPaddingChar === len - 1 || + (firstPaddingChar === len - 2 && str[len - 1] === '='); + +}; + +var decryptAesCBC = function(encryptedString){ + + var hashedKey = CryptoJS.SHA256(env.encryption.password); + + // from BASE64 encoded encrypted string + var encryptedWordArray = CryptoJS.enc.Base64.parse(encryptedString); + + // get IV from beginning + var iv = CryptoJS.lib.WordArray.create( + encryptedWordArray.words.slice(0, (env.encryption.ivLength_byte) / 4 ) + ); + + var decrypted = CryptoJS.AES.decrypt( + { + ciphertext: CryptoJS.lib.WordArray.create( + encryptedWordArray.words.slice(env.encryption.ivLength_byte / 4) + ) + }, + hashedKey, + {iv: iv} + ); + + var decryptedString = decrypted.toString(CryptoJS.enc.Utf8); + + var decryptedJson = JSON.parse(decryptedString); + + // sometimes a response might still be BASE64 encoded in addition + // if so, then resolve that + if((typeof decryptedJson === 'string' || decryptedJson instanceof String) && isBase64(decryptedJson)){ + decryptedJson = CryptoJS.enc.Base64.parse(decryptedJson).toString(CryptoJS.enc.Utf8); + decryptedJson = JSON.parse(decryptedJson); + } + + return decryptedJson; +}; + + diff --git a/app/components/kommonitorAdmin/adminConfig/adminAppConfig/admin-app-config.component.js b/app/components/kommonitorAdmin/adminConfig/adminAppConfig/admin-app-config.component.js index a064c5cd0..07ca46ab4 100644 --- a/app/components/kommonitorAdmin/adminConfig/adminAppConfig/admin-app-config.component.js +++ b/app/components/kommonitorAdmin/adminConfig/adminAppConfig/admin-app-config.component.js @@ -1,205 +1,159 @@ +"use strict"; angular.module('adminAppConfig').component('adminAppConfig', { - templateUrl: "components/kommonitorAdmin/adminConfig/adminAppConfig/admin-app-config.template.html", - controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', 'kommonitorConfigStorageService', '$scope', '$rootScope', '__env', '$http', '$timeout', function AppConfigController(kommonitorDataExchangeService, kommonitorScriptHelperService, kommonitorConfigStorageService, $scope, $rootScope, __env, $http, $timeout) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; - this.kommonitorConfigStorageServiceInstance = kommonitorConfigStorageService; - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - $scope.loadingData = true; - $scope.codeMirrorEditor = undefined; - - $scope.missingRequiredParameters = []; - $scope.missingRequiredParameters_string = ""; - - $scope.keywordsInConfig = ["window.__env", "window.__env.appTitle", "window.__env.enableKeycloakSecurity", "window.__env.encryption", - "window.__env.FEATURE_ID_PROPERTY_NAME", "window.__env.FEATURE_NAME_PROPERTY_NAME", - "window.__env.VALID_START_DATE_PROPERTY_NAME", "window.__env.VALID_END_DATE_PROPERTY_NAME", "window.__env.indicatorDatePrefix", - "window.__env.apiUrl", "window.__env.targetUrlToProcessingEngine", "window.__env.targetUrlToReachabilityService_ORS", - "window.__env.targetUrlToImporterService", "window.__env.simplifyGeometriesParameterName", "window.__env.simplifyGeometriesOptions", - "window.__env.simplifyGeometries", "window.__env.numberOfDecimals", "window.__env.initialLatitude", "window.__env.initialLongitude", - "window.__env.initialZoomLevel", "window.__env.minZoomLevel", "window.__env.maxZoomLevel", "window.__env.baseLayers", "window.__env.initialIndicatorId", - "window.__env.initialSpatialUnitName", "window.__env.useTransparencyOnIndicator", "window.__env.useOutlierDetectionOnIndicator", - "window.__env.classifyZeroSeparately", "window.__env.classifyUsingWholeTimeseries", "window.__env.updateIntervalOptions", - "window.__env.indicatorCreationTypeOptions", "window.__env.indicatorUnitOptions", "window.__env.indicatorTypeOptions", - "window.__env.wmsDatasets", "window.__env.wfsDatasets", "window.__env.isAdvancedMode", "window.__env.showAdvancedModeSwitch", - "window.__env.customLogoURL", "window.__env.customLogo_onClickURL", "window.__env.customLogoWidth", "window.__env.customGreetingsContact_name", - "window.__env.customGreetingsContact_organisation", "window.__env.customGreetingsContact_mail"]; - - $scope.appConfigTemplate = undefined; - $scope.appConfigTmp = undefined; - $scope.appConfigCurrent = undefined; - $scope.appConfigNew = undefined; - - $scope.configSettingInvalid = false; - - $scope.init = async function(){ - await $http.get('./config/env_backup.js', {'responseType': 'text'}).then(function (response) { - $scope.appConfigTemplate = response.data; - - kommonitorScriptHelperService.prettifyScriptCodePreview("appConfig_backupTemplate"); - }); - - // set in app.js - $scope.appConfigTmp = __env.appConfig; - $scope.appConfigCurrent = __env.appConfig; - $scope.appConfigNew = __env.appConfig; - kommonitorScriptHelperService.prettifyScriptCodePreview("appConfig_current"); - - $scope.initCodeEditor(); - - $scope.onChangeAppConfig(); - - $scope.$digest(); - }; - - $scope.initCodeEditor = function(){ - $scope.codeMirrorEditor = CodeMirror.fromTextArea(document.getElementById("appConfigEditor"), { - lineNumbers: true, - autoRefresh:true, - mode: "javascript", - gutters: ["CodeMirror-lint-markers"], - lint: { - "getAnnotations": $scope.validateCode, - "async": true - } - }); - - $scope.codeMirrorEditor.setSize(null, 450); - - $scope.codeMirrorEditor.on('change',function(cMirror){ - // get value right from instance - $scope.appConfigTmp = $scope.codeMirrorEditor.getValue(); - }); - - $scope.codeMirrorEditor.setValue($scope.appConfigCurrent); - }; - - $scope.validateCode = function(cm, updateLinting, options){ - // call the built in css linter from addon/lint/css-lint.js - try { - $scope.lintingIssues = CodeMirror.lint.javascript(cm, options); - - updateLinting($scope.lintingIssues); - } catch (error) { - console.error("Error while linting app config script code. Error is: \n" + error); - } - - $scope.onChangeAppConfig(); - - }; - - $scope.resetDefaultConfig = async function(){ - $scope.appConfigCurrent = $scope.appConfigTemplate; - $scope.appConfigNew = $scope.appConfigTemplate; - $scope.appConfigTmp = $scope.appConfigTemplate; - - $scope.onChangeAppConfig(); - - // update config on server - $scope.editAppConfig(); - - $scope.codeMirrorEditor.setValue($scope.appConfigCurrent); - }; - - $scope.isConfigSettingInvalid = function(configString){ - var isInvalid = true; - - isInvalid = ! $scope.keywordsInConfig.every(keyword => configString.includes(keyword)); - $scope.missingRequiredParameters = $scope.keywordsInConfig.filter(keyword => ! configString.includes(keyword)); - $scope.missingRequiredParameters_string = JSON.stringify($scope.missingRequiredParameters); - - if ($scope.lintingIssues && $scope.lintingIssues.length > 0){ - var errors = $scope.lintingIssues.filter(issue => issue.severity === 'error'); - if(errors && errors.length > 0){ - isInvalid = true; - } - } - - return isInvalid; - }; - - $scope.onChangeAppConfig = function(){ - // check by searching for keywords - - var configString = $scope.appConfigTmp; - - $scope.configSettingInvalid = $scope.isConfigSettingInvalid(configString); - - $timeout(function(){ - $scope.appConfigNew = configString; - }); - - $timeout(function(){ - // kommonitorScriptHelperService.prettifyScriptCodePreview("appConfig_new"); - document.getElementById('appConfig_new').innerHTML = - PR.prettyPrintOne($scope.appConfigNew, - 'javascript', true); - }, 250); - - $timeout(function(){ - $scope.$digest(); - }); - }; - - $scope.init(); - - $scope.editAppConfig = async function(){ - $timeout(function () { - $scope.loadingData = true; - }); - - $scope.errorMessagePart = undefined; - - try { - var addConfigResponse = await kommonitorConfigStorageService.postAppConfig($scope.appConfigTmp); - - var newCurrentConfig = await kommonitorConfigStorageService.getAppConfig(); - $timeout(function(){ - $scope.appConfigCurrent = newCurrentConfig; - }); - - $timeout(function(){ - // kommonitorScriptHelperService.prettifyScriptCodePreview("appConfig_new"); - document.getElementById('appConfig_current').innerHTML = - PR.prettyPrintOne($scope.appConfigCurrent, - 'javascript', true); - }, 250); - - $("#appConfigEditSuccessAlert").show(); - $scope.loadingData = false; - - setTimeout(() => { - $scope.$digest(); - }, 250); - } catch (error) { - if (error.data) { - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else { - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - - $("#appConfigEditErrorAlert").show(); - $scope.loadingData = false; - - setTimeout(() => { - $scope.$digest(); - }, 250); - } - - }; - - $scope.hideSuccessAlert = function () { - $("#appConfigEditSuccessAlert").hide(); - }; - - $scope.hideErrorAlert = function () { - $("#appConfigEditErrorAlert").hide(); - }; - - } - ] + templateUrl: "components/kommonitorAdmin/adminConfig/adminAppConfig/admin-app-config.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', 'kommonitorConfigStorageService', '$scope', '$rootScope', '__env', '$http', '$timeout', function AppConfigController(kommonitorDataExchangeService, kommonitorScriptHelperService, kommonitorConfigStorageService, $scope, $rootScope, __env, $http, $timeout) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + this.kommonitorConfigStorageServiceInstance = kommonitorConfigStorageService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + $scope.loadingData = true; + $scope.codeMirrorEditor = undefined; + $scope.missingRequiredParameters = []; + $scope.missingRequiredParameters_string = ""; + $scope.keywordsInConfig = ["window.__env", "window.__env.appTitle", "window.__env.enableKeycloakSecurity", "window.__env.encryption", + "window.__env.FEATURE_ID_PROPERTY_NAME", "window.__env.FEATURE_NAME_PROPERTY_NAME", + "window.__env.VALID_START_DATE_PROPERTY_NAME", "window.__env.VALID_END_DATE_PROPERTY_NAME", "window.__env.indicatorDatePrefix", + "window.__env.apiUrl", "window.__env.targetUrlToProcessingEngine", "window.__env.targetUrlToReachabilityService_ORS", + "window.__env.targetUrlToImporterService", "window.__env.simplifyGeometriesParameterName", "window.__env.simplifyGeometriesOptions", + "window.__env.simplifyGeometries", "window.__env.numberOfDecimals", "window.__env.initialLatitude", "window.__env.initialLongitude", + "window.__env.initialZoomLevel", "window.__env.minZoomLevel", "window.__env.maxZoomLevel", "window.__env.baseLayers", "window.__env.initialIndicatorId", + "window.__env.initialSpatialUnitName", "window.__env.useTransparencyOnIndicator", "window.__env.useOutlierDetectionOnIndicator", + "window.__env.classifyZeroSeparately", "window.__env.classifyUsingWholeTimeseries", "window.__env.updateIntervalOptions", + "window.__env.indicatorCreationTypeOptions", "window.__env.indicatorUnitOptions", "window.__env.indicatorTypeOptions", + "window.__env.wmsDatasets", "window.__env.wfsDatasets", "window.__env.isAdvancedMode", "window.__env.showAdvancedModeSwitch", + "window.__env.customLogoURL", "window.__env.customLogo_onClickURL", "window.__env.customLogoWidth", "window.__env.customGreetingsContact_name", + "window.__env.customGreetingsContact_organisation", "window.__env.customGreetingsContact_mail"]; + $scope.appConfigTemplate = undefined; + $scope.appConfigTmp = undefined; + $scope.appConfigCurrent = undefined; + $scope.appConfigNew = undefined; + $scope.configSettingInvalid = false; + $scope.init = async function () { + await $http.get('./config/env_backup.js', { 'responseType': 'text' }).then(function (response) { + $scope.appConfigTemplate = response.data; + kommonitorScriptHelperService.prettifyScriptCodePreview("appConfig_backupTemplate"); + }); + // set in app.js + $scope.appConfigTmp = __env.appConfig; + $scope.appConfigCurrent = __env.appConfig; + $scope.appConfigNew = __env.appConfig; + kommonitorScriptHelperService.prettifyScriptCodePreview("appConfig_current"); + $scope.initCodeEditor(); + $scope.onChangeAppConfig(); + $scope.$digest(); + }; + $scope.initCodeEditor = function () { + $scope.codeMirrorEditor = CodeMirror.fromTextArea(document.getElementById("appConfigEditor"), { + lineNumbers: true, + autoRefresh: true, + mode: "javascript", + gutters: ["CodeMirror-lint-markers"], + lint: { + "getAnnotations": $scope.validateCode, + "async": true + } + }); + $scope.codeMirrorEditor.setSize(null, 450); + $scope.codeMirrorEditor.on('change', function (cMirror) { + // get value right from instance + $scope.appConfigTmp = $scope.codeMirrorEditor.getValue(); + }); + $scope.codeMirrorEditor.setValue($scope.appConfigCurrent); + }; + $scope.validateCode = function (cm, updateLinting, options) { + // call the built in css linter from addon/lint/css-lint.js + try { + $scope.lintingIssues = CodeMirror.lint.javascript(cm, options); + updateLinting($scope.lintingIssues); + } + catch (error) { + console.error("Error while linting app config script code. Error is: \n" + error); + } + $scope.onChangeAppConfig(); + }; + $scope.resetDefaultConfig = async function () { + $scope.appConfigCurrent = $scope.appConfigTemplate; + $scope.appConfigNew = $scope.appConfigTemplate; + $scope.appConfigTmp = $scope.appConfigTemplate; + $scope.onChangeAppConfig(); + // update config on server + $scope.editAppConfig(); + $scope.codeMirrorEditor.setValue($scope.appConfigCurrent); + }; + $scope.isConfigSettingInvalid = function (configString) { + var isInvalid = true; + isInvalid = !$scope.keywordsInConfig.every(keyword => configString.includes(keyword)); + $scope.missingRequiredParameters = $scope.keywordsInConfig.filter(keyword => !configString.includes(keyword)); + $scope.missingRequiredParameters_string = JSON.stringify($scope.missingRequiredParameters); + if ($scope.lintingIssues && $scope.lintingIssues.length > 0) { + var errors = $scope.lintingIssues.filter(issue => issue.severity === 'error'); + if (errors && errors.length > 0) { + isInvalid = true; + } + } + return isInvalid; + }; + $scope.onChangeAppConfig = function () { + // check by searching for keywords + var configString = $scope.appConfigTmp; + $scope.configSettingInvalid = $scope.isConfigSettingInvalid(configString); + $timeout(function () { + $scope.appConfigNew = configString; + }); + $timeout(function () { + // kommonitorScriptHelperService.prettifyScriptCodePreview("appConfig_new"); + document.getElementById('appConfig_new').innerHTML = + PR.prettyPrintOne($scope.appConfigNew, 'javascript', true); + }, 250); + $timeout(function () { + $scope.$digest(); + }); + }; + $scope.init(); + $scope.editAppConfig = async function () { + $timeout(function () { + $scope.loadingData = true; + }); + $scope.errorMessagePart = undefined; + try { + var addConfigResponse = await kommonitorConfigStorageService.postAppConfig($scope.appConfigTmp); + var newCurrentConfig = await kommonitorConfigStorageService.getAppConfig(); + $timeout(function () { + $scope.appConfigCurrent = newCurrentConfig; + }); + $timeout(function () { + // kommonitorScriptHelperService.prettifyScriptCodePreview("appConfig_new"); + document.getElementById('appConfig_current').innerHTML = + PR.prettyPrintOne($scope.appConfigCurrent, 'javascript', true); + }, 250); + $("#appConfigEditSuccessAlert").show(); + $scope.loadingData = false; + setTimeout(() => { + $scope.$digest(); + }, 250); + } + catch (error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + $("#appConfigEditErrorAlert").show(); + $scope.loadingData = false; + setTimeout(() => { + $scope.$digest(); + }, 250); + } + }; + $scope.hideSuccessAlert = function () { + $("#appConfigEditSuccessAlert").hide(); + }; + $scope.hideErrorAlert = function () { + $("#appConfigEditErrorAlert").hide(); + }; + } + ] }); +//# sourceMappingURL=admin-app-config.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminConfig/adminAppConfig/admin-app-config.component.js.map b/app/components/kommonitorAdmin/adminConfig/adminAppConfig/admin-app-config.component.js.map new file mode 100644 index 000000000..62694404b --- /dev/null +++ b/app/components/kommonitorAdmin/adminConfig/adminAppConfig/admin-app-config.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"admin-app-config.component.js","sourceRoot":"","sources":["admin-app-config.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,SAAS,CAAC,gBAAgB,EAAE;IAC5D,WAAW,EAAE,sFAAsF;IACnG,UAAU,EAAE,CAAC,+BAA+B,EAAE,+BAA+B,EAAE,gCAAgC,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,mBAAmB,CAAC,6BAA6B,EAAE,6BAA6B,EAAE,8BAA8B,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ;YAE3U,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAC3E,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAC3E,IAAI,CAAC,sCAAsC,GAAG,8BAA8B,CAAC;YAC7E,sCAAsC;YACtC,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,CAAC;YAEtB,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC;YAC1B,MAAM,CAAC,gBAAgB,GAAG,SAAS,CAAC;YAEpC,MAAM,CAAC,yBAAyB,GAAG,EAAE,CAAC;YACtC,MAAM,CAAC,gCAAgC,GAAG,EAAE,CAAC;YAE7C,MAAM,CAAC,gBAAgB,GAAG,CAAC,cAAc,EAAE,uBAAuB,EAAE,qCAAqC,EAAE,yBAAyB;gBACnI,uCAAuC,EAAE,yCAAyC;gBAClF,6CAA6C,EAAE,2CAA2C,EAAE,kCAAkC;gBAC9H,qBAAqB,EAAE,0CAA0C,EA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AAC,MAAM,CAAC,gBAAgB,EACzC,YAAY,EAAE,IAAI,CAAC,CAAC;oBACtB,CAAC,EAAE,GAAG,CAAC,CAAC;oBAER,CAAC,CAAC,4BAA4B,CAAC,CAAC,IAAI,EAAE,CAAC;oBACvC,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;oBAE3B,UAAU,CAAC,GAAG,EAAE;wBACf,MAAM,CAAC,OAAO,EAAE,CAAC;oBAClB,CAAC,EAAE,GAAG,CAAC,CAAC;iBACR;gBAAC,OAAO,KAAK,EAAE;oBACf,IAAI,KAAK,CAAC,IAAI,EAAE;wBACf,MAAM,CAAC,gBAAgB,GAAG,6BAA6B,CAAC,mBAAmB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;qBACxF;yBACI;wBACJ,MAAM,CAAC,gBAAgB,GAAG,6BAA6B,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;qBACnF;oBAED,CAAC,CAAC,0BAA0B,CAAC,CAAC,IAAI,EAAE,CAAC;oBACrC,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;oBAE3B,UAAU,CAAC,GAAG,EAAE;wBACf,MAAM,CAAC,OAAO,EAAE,CAAC;oBAClB,CAAC,EAAE,GAAG,CAAC,CAAC;iBACR;YAEF,CAAC,CAAC;YAEF,MAAM,CAAC,gBAAgB,GAAG;gBACzB,CAAC,CAAC,4BAA4B,CAAC,CAAC,IAAI,EAAE,CAAC;YACxC,CAAC,CAAC;YAEF,MAAM,CAAC,cAAc,GAAG;gBACvB,CAAC,CAAC,0BAA0B,CAAC,CAAC,IAAI,EAAE,CAAC;YACtC,CAAC,CAAC;QAEH,CAAC;KACA;CACD,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminConfig/adminAppConfig/admin-app-config.component.ts b/app/components/kommonitorAdmin/adminConfig/adminAppConfig/admin-app-config.component.ts new file mode 100644 index 000000000..a064c5cd0 --- /dev/null +++ b/app/components/kommonitorAdmin/adminConfig/adminAppConfig/admin-app-config.component.ts @@ -0,0 +1,205 @@ +angular.module('adminAppConfig').component('adminAppConfig', { + templateUrl: "components/kommonitorAdmin/adminConfig/adminAppConfig/admin-app-config.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', 'kommonitorConfigStorageService', '$scope', '$rootScope', '__env', '$http', '$timeout', function AppConfigController(kommonitorDataExchangeService, kommonitorScriptHelperService, kommonitorConfigStorageService, $scope, $rootScope, __env, $http, $timeout) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + this.kommonitorConfigStorageServiceInstance = kommonitorConfigStorageService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + $scope.loadingData = true; + $scope.codeMirrorEditor = undefined; + + $scope.missingRequiredParameters = []; + $scope.missingRequiredParameters_string = ""; + + $scope.keywordsInConfig = ["window.__env", "window.__env.appTitle", "window.__env.enableKeycloakSecurity", "window.__env.encryption", + "window.__env.FEATURE_ID_PROPERTY_NAME", "window.__env.FEATURE_NAME_PROPERTY_NAME", + "window.__env.VALID_START_DATE_PROPERTY_NAME", "window.__env.VALID_END_DATE_PROPERTY_NAME", "window.__env.indicatorDatePrefix", + "window.__env.apiUrl", "window.__env.targetUrlToProcessingEngine", "window.__env.targetUrlToReachabilityService_ORS", + "window.__env.targetUrlToImporterService", "window.__env.simplifyGeometriesParameterName", "window.__env.simplifyGeometriesOptions", + "window.__env.simplifyGeometries", "window.__env.numberOfDecimals", "window.__env.initialLatitude", "window.__env.initialLongitude", + "window.__env.initialZoomLevel", "window.__env.minZoomLevel", "window.__env.maxZoomLevel", "window.__env.baseLayers", "window.__env.initialIndicatorId", + "window.__env.initialSpatialUnitName", "window.__env.useTransparencyOnIndicator", "window.__env.useOutlierDetectionOnIndicator", + "window.__env.classifyZeroSeparately", "window.__env.classifyUsingWholeTimeseries", "window.__env.updateIntervalOptions", + "window.__env.indicatorCreationTypeOptions", "window.__env.indicatorUnitOptions", "window.__env.indicatorTypeOptions", + "window.__env.wmsDatasets", "window.__env.wfsDatasets", "window.__env.isAdvancedMode", "window.__env.showAdvancedModeSwitch", + "window.__env.customLogoURL", "window.__env.customLogo_onClickURL", "window.__env.customLogoWidth", "window.__env.customGreetingsContact_name", + "window.__env.customGreetingsContact_organisation", "window.__env.customGreetingsContact_mail"]; + + $scope.appConfigTemplate = undefined; + $scope.appConfigTmp = undefined; + $scope.appConfigCurrent = undefined; + $scope.appConfigNew = undefined; + + $scope.configSettingInvalid = false; + + $scope.init = async function(){ + await $http.get('./config/env_backup.js', {'responseType': 'text'}).then(function (response) { + $scope.appConfigTemplate = response.data; + + kommonitorScriptHelperService.prettifyScriptCodePreview("appConfig_backupTemplate"); + }); + + // set in app.js + $scope.appConfigTmp = __env.appConfig; + $scope.appConfigCurrent = __env.appConfig; + $scope.appConfigNew = __env.appConfig; + kommonitorScriptHelperService.prettifyScriptCodePreview("appConfig_current"); + + $scope.initCodeEditor(); + + $scope.onChangeAppConfig(); + + $scope.$digest(); + }; + + $scope.initCodeEditor = function(){ + $scope.codeMirrorEditor = CodeMirror.fromTextArea(document.getElementById("appConfigEditor"), { + lineNumbers: true, + autoRefresh:true, + mode: "javascript", + gutters: ["CodeMirror-lint-markers"], + lint: { + "getAnnotations": $scope.validateCode, + "async": true + } + }); + + $scope.codeMirrorEditor.setSize(null, 450); + + $scope.codeMirrorEditor.on('change',function(cMirror){ + // get value right from instance + $scope.appConfigTmp = $scope.codeMirrorEditor.getValue(); + }); + + $scope.codeMirrorEditor.setValue($scope.appConfigCurrent); + }; + + $scope.validateCode = function(cm, updateLinting, options){ + // call the built in css linter from addon/lint/css-lint.js + try { + $scope.lintingIssues = CodeMirror.lint.javascript(cm, options); + + updateLinting($scope.lintingIssues); + } catch (error) { + console.error("Error while linting app config script code. Error is: \n" + error); + } + + $scope.onChangeAppConfig(); + + }; + + $scope.resetDefaultConfig = async function(){ + $scope.appConfigCurrent = $scope.appConfigTemplate; + $scope.appConfigNew = $scope.appConfigTemplate; + $scope.appConfigTmp = $scope.appConfigTemplate; + + $scope.onChangeAppConfig(); + + // update config on server + $scope.editAppConfig(); + + $scope.codeMirrorEditor.setValue($scope.appConfigCurrent); + }; + + $scope.isConfigSettingInvalid = function(configString){ + var isInvalid = true; + + isInvalid = ! $scope.keywordsInConfig.every(keyword => configString.includes(keyword)); + $scope.missingRequiredParameters = $scope.keywordsInConfig.filter(keyword => ! configString.includes(keyword)); + $scope.missingRequiredParameters_string = JSON.stringify($scope.missingRequiredParameters); + + if ($scope.lintingIssues && $scope.lintingIssues.length > 0){ + var errors = $scope.lintingIssues.filter(issue => issue.severity === 'error'); + if(errors && errors.length > 0){ + isInvalid = true; + } + } + + return isInvalid; + }; + + $scope.onChangeAppConfig = function(){ + // check by searching for keywords + + var configString = $scope.appConfigTmp; + + $scope.configSettingInvalid = $scope.isConfigSettingInvalid(configString); + + $timeout(function(){ + $scope.appConfigNew = configString; + }); + + $timeout(function(){ + // kommonitorScriptHelperService.prettifyScriptCodePreview("appConfig_new"); + document.getElementById('appConfig_new').innerHTML = + PR.prettyPrintOne($scope.appConfigNew, + 'javascript', true); + }, 250); + + $timeout(function(){ + $scope.$digest(); + }); + }; + + $scope.init(); + + $scope.editAppConfig = async function(){ + $timeout(function () { + $scope.loadingData = true; + }); + + $scope.errorMessagePart = undefined; + + try { + var addConfigResponse = await kommonitorConfigStorageService.postAppConfig($scope.appConfigTmp); + + var newCurrentConfig = await kommonitorConfigStorageService.getAppConfig(); + $timeout(function(){ + $scope.appConfigCurrent = newCurrentConfig; + }); + + $timeout(function(){ + // kommonitorScriptHelperService.prettifyScriptCodePreview("appConfig_new"); + document.getElementById('appConfig_current').innerHTML = + PR.prettyPrintOne($scope.appConfigCurrent, + 'javascript', true); + }, 250); + + $("#appConfigEditSuccessAlert").show(); + $scope.loadingData = false; + + setTimeout(() => { + $scope.$digest(); + }, 250); + } catch (error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + + $("#appConfigEditErrorAlert").show(); + $scope.loadingData = false; + + setTimeout(() => { + $scope.$digest(); + }, 250); + } + + }; + + $scope.hideSuccessAlert = function () { + $("#appConfigEditSuccessAlert").hide(); + }; + + $scope.hideErrorAlert = function () { + $("#appConfigEditErrorAlert").hide(); + }; + + } + ] +}); diff --git a/app/components/kommonitorAdmin/adminConfig/adminAppConfig/admin-app-config.module.js b/app/components/kommonitorAdmin/adminConfig/adminAppConfig/admin-app-config.module.js index df7d43ff4..8836d5f99 100644 --- a/app/components/kommonitorAdmin/adminConfig/adminAppConfig/admin-app-config.module.js +++ b/app/components/kommonitorAdmin/adminConfig/adminAppConfig/admin-app-config.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('adminAppConfig', ['kommonitorDataExchange', 'kommonitorScriptHelper', 'kommonitorConfigStorage']); +//# sourceMappingURL=admin-app-config.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminConfig/adminAppConfig/admin-app-config.module.js.map b/app/components/kommonitorAdmin/adminConfig/adminAppConfig/admin-app-config.module.js.map new file mode 100644 index 000000000..26b1b823d --- /dev/null +++ b/app/components/kommonitorAdmin/adminConfig/adminAppConfig/admin-app-config.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"admin-app-config.module.js","sourceRoot":"","sources":["admin-app-config.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC,wBAAwB,EAAE,wBAAwB,EAAE,yBAAyB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminConfig/adminAppConfig/admin-app-config.module.ts b/app/components/kommonitorAdmin/adminConfig/adminAppConfig/admin-app-config.module.ts new file mode 100644 index 000000000..df7d43ff4 --- /dev/null +++ b/app/components/kommonitorAdmin/adminConfig/adminAppConfig/admin-app-config.module.ts @@ -0,0 +1 @@ +angular.module('adminAppConfig', ['kommonitorDataExchange', 'kommonitorScriptHelper', 'kommonitorConfigStorage']); diff --git a/app/components/kommonitorAdmin/adminConfig/adminControlsConfig/admin-controls-config.component.js b/app/components/kommonitorAdmin/adminConfig/adminControlsConfig/admin-controls-config.component.js index 817cf3693..1e19f3c57 100644 --- a/app/components/kommonitorAdmin/adminConfig/adminControlsConfig/admin-controls-config.component.js +++ b/app/components/kommonitorAdmin/adminConfig/adminControlsConfig/admin-controls-config.component.js @@ -1,198 +1,150 @@ +"use strict"; angular.module('adminControlsConfig').component('adminControlsConfig', { - templateUrl: "components/kommonitorAdmin/adminConfig/adminControlsConfig/admin-controls-config.template.html", - controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', 'kommonitorConfigStorageService', '$scope', '$rootScope', '__env', '$http', '$timeout', function ControlsConfigController(kommonitorDataExchangeService, kommonitorScriptHelperService, kommonitorConfigStorageService, $scope, $rootScope, __env, $http, $timeout) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; - this.kommonitorConfigStorageServiceInstance = kommonitorConfigStorageService; - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - $scope.loadingData = true; - $scope.codeMirrorEditor = undefined; - - $scope.missingRequiredParameters = []; - $scope.missingRequiredParameters_string = ""; - - $scope.keywordsInConfig = ["id", "roles", "indicatorConfig", "poi", "dataImport", "filter", - "measureOfValueClassification", "balance", "diagrams", "radarDiagram", "regressionDiagram", - "reachability", "processing", "indicatorLegendExportButtons", "reportingButton", "diagramExportButtons", - "georesourceExportButtons"]; - - $scope.controlsConfigTemplate = undefined; - $scope.controlsConfigTmp = undefined; - $scope.controlsConfigCurrent = undefined; - $scope.controlsConfigNew = undefined; - - $scope.configSettingInvalid = false; - - $scope.init = async function(){ - await $http.get('./config/controls-config_backup_forAdminViewExplanation.txt', {'responseType': 'text'}).then(function (response) { - $scope.controlsConfigTemplate = response.data; - - kommonitorScriptHelperService.prettifyScriptCodePreview("controlsConfig_backupTemplate"); - }); - - // set in app.js - $scope.controlsConfigTmp = JSON.stringify(__env.controlsConfig, null, " "); - $scope.controlsConfigCurrent = JSON.stringify(__env.controlsConfig, null, " "); - $scope.controlsConfigNew = JSON.stringify(__env.controlsConfig, null, " "); - kommonitorScriptHelperService.prettifyScriptCodePreview("controlsConfig_current"); - - $scope.initCodeEditor(); - - $scope.onChangeControlsConfig(); - - $scope.$digest(); - }; - - $scope.initCodeEditor = function(){ - $scope.codeMirrorEditor = CodeMirror.fromTextArea(document.getElementById("controlsConfigEditor"), { - lineNumbers: true, - autoRefresh:true, - mode: "application/json", - gutters: ["CodeMirror-lint-markers"], - lint: { - "getAnnotations": $scope.validateCode, - "async": true - } - }); - - $scope.codeMirrorEditor.setSize(null, 300); - - $scope.codeMirrorEditor.on('change',function(cMirror){ - // get value right from instance - $scope.controlsConfigTmp = $scope.codeMirrorEditor.getValue(); - }); - - $scope.codeMirrorEditor.setValue($scope.controlsConfigCurrent); - }; - - $scope.validateCode = function(cm, updateLinting, options){ - // call the built in css linter from addon/lint/css-lint.js - try { - $scope.lintingIssues = CodeMirror.lint.json(cm, options); - - updateLinting($scope.lintingIssues); - } catch (error) { - console.error("Error while linting controls config json code. Error is: \n" + error); - } - - $scope.onChangeControlsConfig(); - - }; - - $scope.resetDefaultConfig = async function(){ - $scope.controlsConfigCurrent = $scope.controlsConfigTemplate; - $scope.controlsConfigNew = $scope.controlsConfigTemplate; - $scope.controlsConfigTmp = $scope.controlsConfigTemplate; - - $scope.onChangeControlsConfig(); - - // update config on server - $scope.editControlsConfig(); - - $scope.codeMirrorEditor.setValue($scope.controlsConfigCurrent); - }; - - $scope.isConfigSettingInvalid = function(configString){ - var isInvalid = true; - - isInvalid = ! $scope.keywordsInConfig.every(keyword => configString.includes(keyword)); - $scope.missingRequiredParameters = $scope.keywordsInConfig.filter(keyword => ! configString.includes(keyword)); - $scope.missingRequiredParameters_string = JSON.stringify($scope.missingRequiredParameters); - - if ($scope.lintingIssues && $scope.lintingIssues.length > 0){ - isInvalid = true; - } - - return isInvalid; - - }; - - $scope.onChangeControlsConfig = function(){ - // check by searching for keywords - - var configString = $scope.controlsConfigTmp; - - if(typeof configString === 'object' && configString !== null){ - configString = JSON.stringify(configString, null, " "); - } - - $scope.configSettingInvalid = $scope.isConfigSettingInvalid(configString); - - $timeout(function(){ - $scope.controlsConfigNew = configString; - }); - - $timeout(function(){ - // kommonitorScriptHelperService.prettifyScriptCodePreview("controlsConfig_new"); - document.getElementById('controlsConfig_new').innerHTML = - PR.prettyPrintOne($scope.controlsConfigNew, - 'javascript', true); - }, 250); - - $timeout(function(){ - $scope.$digest(); - }); - }; - - $scope.init(); - - $scope.editControlsConfig = async function(){ - $timeout(function () { - $scope.loadingData = true; - }); - - $scope.errorMessagePart = undefined; - - try { - var addConfigResponse = await kommonitorConfigStorageService.postControlsConfig($scope.controlsConfigTmp); - - var newCurrentConfig = await kommonitorConfigStorageService.getControlsConfig(); - $timeout(function(){ - $scope.controlsConfigCurrent = JSON.stringify(newCurrentConfig, null, " "); - }); - - $timeout(function(){ - // kommonitorScriptHelperService.prettifyScriptCodePreview("controlsConfig_new"); - document.getElementById('controlsConfig_current').innerHTML = - PR.prettyPrintOne($scope.controlsConfigCurrent, - 'javascript', true); - }, 250); - - $("#controlsConfigEditSuccessAlert").show(); - $scope.loadingData = false; - - setTimeout(() => { - $scope.$digest(); - }, 250); - } catch (error) { - if (error.data) { - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else { - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - - $("#controlsConfigEditErrorAlert").show(); - $scope.loadingData = false; - - setTimeout(() => { - $scope.$digest(); - }, 250); - } - - }; - - $scope.hideSuccessAlert = function () { - $("#controlsConfigEditSuccessAlert").hide(); - }; - - $scope.hideErrorAlert = function () { - $("#controlsConfigEditErrorAlert").hide(); - }; - - } - ] + templateUrl: "components/kommonitorAdmin/adminConfig/adminControlsConfig/admin-controls-config.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', 'kommonitorConfigStorageService', '$scope', '$rootScope', '__env', '$http', '$timeout', function ControlsConfigController(kommonitorDataExchangeService, kommonitorScriptHelperService, kommonitorConfigStorageService, $scope, $rootScope, __env, $http, $timeout) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + this.kommonitorConfigStorageServiceInstance = kommonitorConfigStorageService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + $scope.loadingData = true; + $scope.codeMirrorEditor = undefined; + $scope.missingRequiredParameters = []; + $scope.missingRequiredParameters_string = ""; + $scope.keywordsInConfig = ["id", "roles", "indicatorConfig", "poi", "dataImport", "filter", + "measureOfValueClassification", "balance", "diagrams", "radarDiagram", "regressionDiagram", + "reachability", "processing", "indicatorLegendExportButtons", "reportingButton", "diagramExportButtons", + "georesourceExportButtons"]; + $scope.controlsConfigTemplate = undefined; + $scope.controlsConfigTmp = undefined; + $scope.controlsConfigCurrent = undefined; + $scope.controlsConfigNew = undefined; + $scope.configSettingInvalid = false; + $scope.init = async function () { + await $http.get('./config/controls-config_backup_forAdminViewExplanation.txt', { 'responseType': 'text' }).then(function (response) { + $scope.controlsConfigTemplate = response.data; + kommonitorScriptHelperService.prettifyScriptCodePreview("controlsConfig_backupTemplate"); + }); + // set in app.js + $scope.controlsConfigTmp = JSON.stringify(__env.controlsConfig, null, " "); + $scope.controlsConfigCurrent = JSON.stringify(__env.controlsConfig, null, " "); + $scope.controlsConfigNew = JSON.stringify(__env.controlsConfig, null, " "); + kommonitorScriptHelperService.prettifyScriptCodePreview("controlsConfig_current"); + $scope.initCodeEditor(); + $scope.onChangeControlsConfig(); + $scope.$digest(); + }; + $scope.initCodeEditor = function () { + $scope.codeMirrorEditor = CodeMirror.fromTextArea(document.getElementById("controlsConfigEditor"), { + lineNumbers: true, + autoRefresh: true, + mode: "application/json", + gutters: ["CodeMirror-lint-markers"], + lint: { + "getAnnotations": $scope.validateCode, + "async": true + } + }); + $scope.codeMirrorEditor.setSize(null, 300); + $scope.codeMirrorEditor.on('change', function (cMirror) { + // get value right from instance + $scope.controlsConfigTmp = $scope.codeMirrorEditor.getValue(); + }); + $scope.codeMirrorEditor.setValue($scope.controlsConfigCurrent); + }; + $scope.validateCode = function (cm, updateLinting, options) { + // call the built in css linter from addon/lint/css-lint.js + try { + $scope.lintingIssues = CodeMirror.lint.json(cm, options); + updateLinting($scope.lintingIssues); + } + catch (error) { + console.error("Error while linting controls config json code. Error is: \n" + error); + } + $scope.onChangeControlsConfig(); + }; + $scope.resetDefaultConfig = async function () { + $scope.controlsConfigCurrent = $scope.controlsConfigTemplate; + $scope.controlsConfigNew = $scope.controlsConfigTemplate; + $scope.controlsConfigTmp = $scope.controlsConfigTemplate; + $scope.onChangeControlsConfig(); + // update config on server + $scope.editControlsConfig(); + $scope.codeMirrorEditor.setValue($scope.controlsConfigCurrent); + }; + $scope.isConfigSettingInvalid = function (configString) { + var isInvalid = true; + isInvalid = !$scope.keywordsInConfig.every(keyword => configString.includes(keyword)); + $scope.missingRequiredParameters = $scope.keywordsInConfig.filter(keyword => !configString.includes(keyword)); + $scope.missingRequiredParameters_string = JSON.stringify($scope.missingRequiredParameters); + if ($scope.lintingIssues && $scope.lintingIssues.length > 0) { + isInvalid = true; + } + return isInvalid; + }; + $scope.onChangeControlsConfig = function () { + // check by searching for keywords + var configString = $scope.controlsConfigTmp; + if (typeof configString === 'object' && configString !== null) { + configString = JSON.stringify(configString, null, " "); + } + $scope.configSettingInvalid = $scope.isConfigSettingInvalid(configString); + $timeout(function () { + $scope.controlsConfigNew = configString; + }); + $timeout(function () { + // kommonitorScriptHelperService.prettifyScriptCodePreview("controlsConfig_new"); + document.getElementById('controlsConfig_new').innerHTML = + PR.prettyPrintOne($scope.controlsConfigNew, 'javascript', true); + }, 250); + $timeout(function () { + $scope.$digest(); + }); + }; + $scope.init(); + $scope.editControlsConfig = async function () { + $timeout(function () { + $scope.loadingData = true; + }); + $scope.errorMessagePart = undefined; + try { + var addConfigResponse = await kommonitorConfigStorageService.postControlsConfig($scope.controlsConfigTmp); + var newCurrentConfig = await kommonitorConfigStorageService.getControlsConfig(); + $timeout(function () { + $scope.controlsConfigCurrent = JSON.stringify(newCurrentConfig, null, " "); + }); + $timeout(function () { + // kommonitorScriptHelperService.prettifyScriptCodePreview("controlsConfig_new"); + document.getElementById('controlsConfig_current').innerHTML = + PR.prettyPrintOne($scope.controlsConfigCurrent, 'javascript', true); + }, 250); + $("#controlsConfigEditSuccessAlert").show(); + $scope.loadingData = false; + setTimeout(() => { + $scope.$digest(); + }, 250); + } + catch (error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + $("#controlsConfigEditErrorAlert").show(); + $scope.loadingData = false; + setTimeout(() => { + $scope.$digest(); + }, 250); + } + }; + $scope.hideSuccessAlert = function () { + $("#controlsConfigEditSuccessAlert").hide(); + }; + $scope.hideErrorAlert = function () { + $("#controlsConfigEditErrorAlert").hide(); + }; + } + ] }); +//# sourceMappingURL=admin-controls-config.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminConfig/adminControlsConfig/admin-controls-config.component.js.map b/app/components/kommonitorAdmin/adminConfig/adminControlsConfig/admin-controls-config.component.js.map new file mode 100644 index 000000000..aea276983 --- /dev/null +++ b/app/components/kommonitorAdmin/adminConfig/adminControlsConfig/admin-controls-config.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"admin-controls-config.component.js","sourceRoot":"","sources":["admin-controls-config.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,SAAS,CAAC,qBAAqB,EAAE;IACtE,WAAW,EAAE,gGAAgG;IAC7G,UAAU,EAAE,CAAC,+BAA+B,EAAE,+B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,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;oBAE3B,UAAU,CAAC,GAAG,EAAE;wBACf,MAAM,CAAC,OAAO,EAAE,CAAC;oBAClB,CAAC,EAAE,GAAG,CAAC,CAAC;iBACR;YAEF,CAAC,CAAC;YAEF,MAAM,CAAC,gBAAgB,GAAG;gBACzB,CAAC,CAAC,iCAAiC,CAAC,CAAC,IAAI,EAAE,CAAC;YAC7C,CAAC,CAAC;YAEF,MAAM,CAAC,cAAc,GAAG;gBACvB,CAAC,CAAC,+BAA+B,CAAC,CAAC,IAAI,EAAE,CAAC;YAC3C,CAAC,CAAC;QAEH,CAAC;KACA;CACD,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminConfig/adminControlsConfig/admin-controls-config.component.ts b/app/components/kommonitorAdmin/adminConfig/adminControlsConfig/admin-controls-config.component.ts new file mode 100644 index 000000000..817cf3693 --- /dev/null +++ b/app/components/kommonitorAdmin/adminConfig/adminControlsConfig/admin-controls-config.component.ts @@ -0,0 +1,198 @@ +angular.module('adminControlsConfig').component('adminControlsConfig', { + templateUrl: "components/kommonitorAdmin/adminConfig/adminControlsConfig/admin-controls-config.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', 'kommonitorConfigStorageService', '$scope', '$rootScope', '__env', '$http', '$timeout', function ControlsConfigController(kommonitorDataExchangeService, kommonitorScriptHelperService, kommonitorConfigStorageService, $scope, $rootScope, __env, $http, $timeout) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + this.kommonitorConfigStorageServiceInstance = kommonitorConfigStorageService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + $scope.loadingData = true; + $scope.codeMirrorEditor = undefined; + + $scope.missingRequiredParameters = []; + $scope.missingRequiredParameters_string = ""; + + $scope.keywordsInConfig = ["id", "roles", "indicatorConfig", "poi", "dataImport", "filter", + "measureOfValueClassification", "balance", "diagrams", "radarDiagram", "regressionDiagram", + "reachability", "processing", "indicatorLegendExportButtons", "reportingButton", "diagramExportButtons", + "georesourceExportButtons"]; + + $scope.controlsConfigTemplate = undefined; + $scope.controlsConfigTmp = undefined; + $scope.controlsConfigCurrent = undefined; + $scope.controlsConfigNew = undefined; + + $scope.configSettingInvalid = false; + + $scope.init = async function(){ + await $http.get('./config/controls-config_backup_forAdminViewExplanation.txt', {'responseType': 'text'}).then(function (response) { + $scope.controlsConfigTemplate = response.data; + + kommonitorScriptHelperService.prettifyScriptCodePreview("controlsConfig_backupTemplate"); + }); + + // set in app.js + $scope.controlsConfigTmp = JSON.stringify(__env.controlsConfig, null, " "); + $scope.controlsConfigCurrent = JSON.stringify(__env.controlsConfig, null, " "); + $scope.controlsConfigNew = JSON.stringify(__env.controlsConfig, null, " "); + kommonitorScriptHelperService.prettifyScriptCodePreview("controlsConfig_current"); + + $scope.initCodeEditor(); + + $scope.onChangeControlsConfig(); + + $scope.$digest(); + }; + + $scope.initCodeEditor = function(){ + $scope.codeMirrorEditor = CodeMirror.fromTextArea(document.getElementById("controlsConfigEditor"), { + lineNumbers: true, + autoRefresh:true, + mode: "application/json", + gutters: ["CodeMirror-lint-markers"], + lint: { + "getAnnotations": $scope.validateCode, + "async": true + } + }); + + $scope.codeMirrorEditor.setSize(null, 300); + + $scope.codeMirrorEditor.on('change',function(cMirror){ + // get value right from instance + $scope.controlsConfigTmp = $scope.codeMirrorEditor.getValue(); + }); + + $scope.codeMirrorEditor.setValue($scope.controlsConfigCurrent); + }; + + $scope.validateCode = function(cm, updateLinting, options){ + // call the built in css linter from addon/lint/css-lint.js + try { + $scope.lintingIssues = CodeMirror.lint.json(cm, options); + + updateLinting($scope.lintingIssues); + } catch (error) { + console.error("Error while linting controls config json code. Error is: \n" + error); + } + + $scope.onChangeControlsConfig(); + + }; + + $scope.resetDefaultConfig = async function(){ + $scope.controlsConfigCurrent = $scope.controlsConfigTemplate; + $scope.controlsConfigNew = $scope.controlsConfigTemplate; + $scope.controlsConfigTmp = $scope.controlsConfigTemplate; + + $scope.onChangeControlsConfig(); + + // update config on server + $scope.editControlsConfig(); + + $scope.codeMirrorEditor.setValue($scope.controlsConfigCurrent); + }; + + $scope.isConfigSettingInvalid = function(configString){ + var isInvalid = true; + + isInvalid = ! $scope.keywordsInConfig.every(keyword => configString.includes(keyword)); + $scope.missingRequiredParameters = $scope.keywordsInConfig.filter(keyword => ! configString.includes(keyword)); + $scope.missingRequiredParameters_string = JSON.stringify($scope.missingRequiredParameters); + + if ($scope.lintingIssues && $scope.lintingIssues.length > 0){ + isInvalid = true; + } + + return isInvalid; + + }; + + $scope.onChangeControlsConfig = function(){ + // check by searching for keywords + + var configString = $scope.controlsConfigTmp; + + if(typeof configString === 'object' && configString !== null){ + configString = JSON.stringify(configString, null, " "); + } + + $scope.configSettingInvalid = $scope.isConfigSettingInvalid(configString); + + $timeout(function(){ + $scope.controlsConfigNew = configString; + }); + + $timeout(function(){ + // kommonitorScriptHelperService.prettifyScriptCodePreview("controlsConfig_new"); + document.getElementById('controlsConfig_new').innerHTML = + PR.prettyPrintOne($scope.controlsConfigNew, + 'javascript', true); + }, 250); + + $timeout(function(){ + $scope.$digest(); + }); + }; + + $scope.init(); + + $scope.editControlsConfig = async function(){ + $timeout(function () { + $scope.loadingData = true; + }); + + $scope.errorMessagePart = undefined; + + try { + var addConfigResponse = await kommonitorConfigStorageService.postControlsConfig($scope.controlsConfigTmp); + + var newCurrentConfig = await kommonitorConfigStorageService.getControlsConfig(); + $timeout(function(){ + $scope.controlsConfigCurrent = JSON.stringify(newCurrentConfig, null, " "); + }); + + $timeout(function(){ + // kommonitorScriptHelperService.prettifyScriptCodePreview("controlsConfig_new"); + document.getElementById('controlsConfig_current').innerHTML = + PR.prettyPrintOne($scope.controlsConfigCurrent, + 'javascript', true); + }, 250); + + $("#controlsConfigEditSuccessAlert").show(); + $scope.loadingData = false; + + setTimeout(() => { + $scope.$digest(); + }, 250); + } catch (error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + + $("#controlsConfigEditErrorAlert").show(); + $scope.loadingData = false; + + setTimeout(() => { + $scope.$digest(); + }, 250); + } + + }; + + $scope.hideSuccessAlert = function () { + $("#controlsConfigEditSuccessAlert").hide(); + }; + + $scope.hideErrorAlert = function () { + $("#controlsConfigEditErrorAlert").hide(); + }; + + } + ] +}); diff --git a/app/components/kommonitorAdmin/adminConfig/adminControlsConfig/admin-controls-config.module.js b/app/components/kommonitorAdmin/adminConfig/adminControlsConfig/admin-controls-config.module.js index f3eea23ea..e60d7fa81 100644 --- a/app/components/kommonitorAdmin/adminConfig/adminControlsConfig/admin-controls-config.module.js +++ b/app/components/kommonitorAdmin/adminConfig/adminControlsConfig/admin-controls-config.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('adminControlsConfig', ['kommonitorDataExchange', 'kommonitorScriptHelper', 'kommonitorConfigStorage']); +//# sourceMappingURL=admin-controls-config.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminConfig/adminControlsConfig/admin-controls-config.module.js.map b/app/components/kommonitorAdmin/adminConfig/adminControlsConfig/admin-controls-config.module.js.map new file mode 100644 index 000000000..7aa199778 --- /dev/null +++ b/app/components/kommonitorAdmin/adminConfig/adminControlsConfig/admin-controls-config.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"admin-controls-config.module.js","sourceRoot":"","sources":["admin-controls-config.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,qBAAqB,EAAE,CAAC,wBAAwB,EAAE,wBAAwB,EAAE,yBAAyB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminConfig/adminControlsConfig/admin-controls-config.module.ts b/app/components/kommonitorAdmin/adminConfig/adminControlsConfig/admin-controls-config.module.ts new file mode 100644 index 000000000..f3eea23ea --- /dev/null +++ b/app/components/kommonitorAdmin/adminConfig/adminControlsConfig/admin-controls-config.module.ts @@ -0,0 +1 @@ +angular.module('adminControlsConfig', ['kommonitorDataExchange', 'kommonitorScriptHelper', 'kommonitorConfigStorage']); diff --git a/app/components/kommonitorAdmin/adminConfig/adminKeycloakConfig/admin-keycloak-config.component.js b/app/components/kommonitorAdmin/adminConfig/adminKeycloakConfig/admin-keycloak-config.component.js index 04eb90eda..51d0b6b0e 100644 --- a/app/components/kommonitorAdmin/adminConfig/adminKeycloakConfig/admin-keycloak-config.component.js +++ b/app/components/kommonitorAdmin/adminConfig/adminKeycloakConfig/admin-keycloak-config.component.js @@ -1,197 +1,149 @@ +"use strict"; angular.module('adminKeycloakConfig').component('adminKeycloakConfig', { - templateUrl: "components/kommonitorAdmin/adminConfig/adminKeycloakConfig/admin-keycloak-config.template.html", - controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', 'kommonitorConfigStorageService', '$scope', '$rootScope', '__env', '$http', '$timeout', function KeycloakConfigController(kommonitorDataExchangeService, kommonitorScriptHelperService, kommonitorConfigStorageService, $scope, $rootScope, __env, $http, $timeout) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - $scope.loadingData = true; - $scope.codeMirrorEditor = undefined; - - $scope.missingRequiredParameters = []; - $scope.missingRequiredParameters_string = ""; - - $scope.keywordsInConfig = ["realm", "auth-server-url", "http", "/auth", "resource", "ssl-required", "public-client", "confidential-port"]; - - $scope.keycloakConfigTemplate = undefined; - $scope.keycloakConfigTmp = undefined; - $scope.keycloakConfigCurrent = undefined; - $scope.keycloakConfigNew = undefined; - - $scope.configSettingInvalid = false; - - $scope.init = async function(){ - await $http.get('./config/keycloak_backup_withComments.txt', {'responseType': 'text'}).then(function (response) { - // $scope.keycloakConfigTemplate = JSON.stringify(response.data, null, " "); - $scope.keycloakConfigTemplate = response.data; - - kommonitorScriptHelperService.prettifyScriptCodePreview("keycloakConfig_backupTemplate"); - }); - - // set in app.js - $scope.keycloakConfigTmp = JSON.stringify(__env.keycloakConfig, null, " "); - $scope.keycloakConfigCurrent = JSON.stringify(__env.keycloakConfig, null, " "); - $scope.keycloakConfigNew = JSON.stringify(__env.keycloakConfig, null, " "); - kommonitorScriptHelperService.prettifyScriptCodePreview("keycloakConfig_current"); - - $scope.initCodeEditor(); - - $scope.onChangeKeycloakConfig(); - - $scope.$digest(); - }; - - $scope.initCodeEditor = function(){ - $scope.codeMirrorEditor = CodeMirror.fromTextArea(document.getElementById("keycloakConfigEditor"), { - lineNumbers: true, - autoRefresh:true, - mode: "application/json", - gutters: ["CodeMirror-lint-markers"], - lint: { - "getAnnotations": $scope.validateCode, - "async": true - } - }); - - $scope.codeMirrorEditor.setSize(null, 220); - - $scope.codeMirrorEditor.on('change',function(cMirror){ - // get value right from instance - $scope.keycloakConfigTmp = $scope.codeMirrorEditor.getValue(); - }); - - $scope.codeMirrorEditor.setValue($scope.keycloakConfigCurrent); - }; - - $scope.validateCode = function(cm, updateLinting, options){ - // call the built in css linter from addon/lint/css-lint.js - try { - $scope.lintingIssues = CodeMirror.lint.json(cm, options); - - updateLinting($scope.lintingIssues); - } catch (error) { - console.error("Error while linting keycloak config json code. Error is: \n" + error); - } - - $scope.onChangeKeycloakConfig(); - - }; - - $scope.isConfigSettingInvalid = function(configString){ - var isInvalid = true; - - isInvalid = ! $scope.keywordsInConfig.every(keyword => configString.includes(keyword)); - $scope.missingRequiredParameters = $scope.keywordsInConfig.filter(keyword => ! configString.includes(keyword)); - $scope.missingRequiredParameters_string = JSON.stringify($scope.missingRequiredParameters); - - if ($scope.lintingIssues && $scope.lintingIssues.length > 0){ - isInvalid = true; - } - - return isInvalid; - - }; - - $scope.resetDefaultConfig = async function(){ - await $http.get('./config/keycloak_backup.json', {'responseType': 'json'}).then(function (response) { - $scope.keycloakConfigTmp = JSON.stringify(response.data, null, " "); - $scope.keycloakConfigCurrent = JSON.stringify(response.data, null, " "); - $scope.keycloakConfigNew = JSON.stringify(response.data, null, " "); - }); - - $scope.onChangeKeycloakConfig(); - - // update config on server - $scope.editKeycloakConfig(); - - $scope.codeMirrorEditor.setValue($scope.keycloakConfigCurrent); - }; - - $scope.onChangeKeycloakConfig = function(){ - // check by searching for keywords - - var configString = $scope.keycloakConfigTmp; - - if(typeof configString === 'object' && configString !== null){ - configString = JSON.stringify(configString, null, " "); - } - - $scope.configSettingInvalid = $scope.isConfigSettingInvalid(configString); - - $timeout(function(){ - $scope.keycloakConfigNew = configString; - }); - - $timeout(function(){ - // kommonitorScriptHelperService.prettifyScriptCodePreview("keycloakConfig_new"); - document.getElementById('keycloakConfig_new').innerHTML = - PR.prettyPrintOne($scope.keycloakConfigNew, - 'javascript', true); - }, 250); - - $timeout(function(){ - $scope.$digest(); - }); - }; - - $scope.init(); - - $scope.editKeycloakConfig = async function(){ - $timeout(function () { - $scope.loadingData = true; - }); - - $scope.errorMessagePart = undefined; - - try { - var addConfigResponse = await kommonitorConfigStorageService.postKeycloakConfig($scope.keycloakConfigTmp); - - var newCurrentConfig = await kommonitorConfigStorageService.getKeycloakConfig(); - $timeout(function(){ - $scope.keycloakConfigCurrent = JSON.stringify(newCurrentConfig, null, " "); - }); - - $timeout(function(){ - // kommonitorScriptHelperService.prettifyScriptCodePreview("keycloakConfig_new"); - document.getElementById('keycloakConfig_current').innerHTML = - PR.prettyPrintOne($scope.keycloakConfigCurrent, - 'javascript', true); - }, 250); - - $("#keycloakConfigEditSuccessAlert").show(); - $scope.loadingData = false; - - setTimeout(() => { - $scope.$digest(); - }, 250); - } catch (error) { - if (error.data) { - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else { - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - - $("#keycloakConfigEditErrorAlert").show(); - $scope.loadingData = false; - - setTimeout(() => { - $scope.$digest(); - }, 250); - } - - }; - - $scope.hideSuccessAlert = function () { - $("#keycloakConfigEditSuccessAlert").hide(); - }; - - $scope.hideErrorAlert = function () { - $("#keycloakConfigEditErrorAlert").hide(); - }; - - } - ] + templateUrl: "components/kommonitorAdmin/adminConfig/adminKeycloakConfig/admin-keycloak-config.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', 'kommonitorConfigStorageService', '$scope', '$rootScope', '__env', '$http', '$timeout', function KeycloakConfigController(kommonitorDataExchangeService, kommonitorScriptHelperService, kommonitorConfigStorageService, $scope, $rootScope, __env, $http, $timeout) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + $scope.loadingData = true; + $scope.codeMirrorEditor = undefined; + $scope.missingRequiredParameters = []; + $scope.missingRequiredParameters_string = ""; + $scope.keywordsInConfig = ["realm", "auth-server-url", "http", "/auth", "resource", "ssl-required", "public-client", "confidential-port"]; + $scope.keycloakConfigTemplate = undefined; + $scope.keycloakConfigTmp = undefined; + $scope.keycloakConfigCurrent = undefined; + $scope.keycloakConfigNew = undefined; + $scope.configSettingInvalid = false; + $scope.init = async function () { + await $http.get('./config/keycloak_backup_withComments.txt', { 'responseType': 'text' }).then(function (response) { + // $scope.keycloakConfigTemplate = JSON.stringify(response.data, null, " "); + $scope.keycloakConfigTemplate = response.data; + kommonitorScriptHelperService.prettifyScriptCodePreview("keycloakConfig_backupTemplate"); + }); + // set in app.js + $scope.keycloakConfigTmp = JSON.stringify(__env.keycloakConfig, null, " "); + $scope.keycloakConfigCurrent = JSON.stringify(__env.keycloakConfig, null, " "); + $scope.keycloakConfigNew = JSON.stringify(__env.keycloakConfig, null, " "); + kommonitorScriptHelperService.prettifyScriptCodePreview("keycloakConfig_current"); + $scope.initCodeEditor(); + $scope.onChangeKeycloakConfig(); + $scope.$digest(); + }; + $scope.initCodeEditor = function () { + $scope.codeMirrorEditor = CodeMirror.fromTextArea(document.getElementById("keycloakConfigEditor"), { + lineNumbers: true, + autoRefresh: true, + mode: "application/json", + gutters: ["CodeMirror-lint-markers"], + lint: { + "getAnnotations": $scope.validateCode, + "async": true + } + }); + $scope.codeMirrorEditor.setSize(null, 220); + $scope.codeMirrorEditor.on('change', function (cMirror) { + // get value right from instance + $scope.keycloakConfigTmp = $scope.codeMirrorEditor.getValue(); + }); + $scope.codeMirrorEditor.setValue($scope.keycloakConfigCurrent); + }; + $scope.validateCode = function (cm, updateLinting, options) { + // call the built in css linter from addon/lint/css-lint.js + try { + $scope.lintingIssues = CodeMirror.lint.json(cm, options); + updateLinting($scope.lintingIssues); + } + catch (error) { + console.error("Error while linting keycloak config json code. Error is: \n" + error); + } + $scope.onChangeKeycloakConfig(); + }; + $scope.isConfigSettingInvalid = function (configString) { + var isInvalid = true; + isInvalid = !$scope.keywordsInConfig.every(keyword => configString.includes(keyword)); + $scope.missingRequiredParameters = $scope.keywordsInConfig.filter(keyword => !configString.includes(keyword)); + $scope.missingRequiredParameters_string = JSON.stringify($scope.missingRequiredParameters); + if ($scope.lintingIssues && $scope.lintingIssues.length > 0) { + isInvalid = true; + } + return isInvalid; + }; + $scope.resetDefaultConfig = async function () { + await $http.get('./config/keycloak_backup.json', { 'responseType': 'json' }).then(function (response) { + $scope.keycloakConfigTmp = JSON.stringify(response.data, null, " "); + $scope.keycloakConfigCurrent = JSON.stringify(response.data, null, " "); + $scope.keycloakConfigNew = JSON.stringify(response.data, null, " "); + }); + $scope.onChangeKeycloakConfig(); + // update config on server + $scope.editKeycloakConfig(); + $scope.codeMirrorEditor.setValue($scope.keycloakConfigCurrent); + }; + $scope.onChangeKeycloakConfig = function () { + // check by searching for keywords + var configString = $scope.keycloakConfigTmp; + if (typeof configString === 'object' && configString !== null) { + configString = JSON.stringify(configString, null, " "); + } + $scope.configSettingInvalid = $scope.isConfigSettingInvalid(configString); + $timeout(function () { + $scope.keycloakConfigNew = configString; + }); + $timeout(function () { + // kommonitorScriptHelperService.prettifyScriptCodePreview("keycloakConfig_new"); + document.getElementById('keycloakConfig_new').innerHTML = + PR.prettyPrintOne($scope.keycloakConfigNew, 'javascript', true); + }, 250); + $timeout(function () { + $scope.$digest(); + }); + }; + $scope.init(); + $scope.editKeycloakConfig = async function () { + $timeout(function () { + $scope.loadingData = true; + }); + $scope.errorMessagePart = undefined; + try { + var addConfigResponse = await kommonitorConfigStorageService.postKeycloakConfig($scope.keycloakConfigTmp); + var newCurrentConfig = await kommonitorConfigStorageService.getKeycloakConfig(); + $timeout(function () { + $scope.keycloakConfigCurrent = JSON.stringify(newCurrentConfig, null, " "); + }); + $timeout(function () { + // kommonitorScriptHelperService.prettifyScriptCodePreview("keycloakConfig_new"); + document.getElementById('keycloakConfig_current').innerHTML = + PR.prettyPrintOne($scope.keycloakConfigCurrent, 'javascript', true); + }, 250); + $("#keycloakConfigEditSuccessAlert").show(); + $scope.loadingData = false; + setTimeout(() => { + $scope.$digest(); + }, 250); + } + catch (error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + $("#keycloakConfigEditErrorAlert").show(); + $scope.loadingData = false; + setTimeout(() => { + $scope.$digest(); + }, 250); + } + }; + $scope.hideSuccessAlert = function () { + $("#keycloakConfigEditSuccessAlert").hide(); + }; + $scope.hideErrorAlert = function () { + $("#keycloakConfigEditErrorAlert").hide(); + }; + } + ] }); +//# sourceMappingURL=admin-keycloak-config.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminConfig/adminKeycloakConfig/admin-keycloak-config.component.js.map b/app/components/kommonitorAdmin/adminConfig/adminKeycloakConfig/admin-keycloak-config.component.js.map new file mode 100644 index 000000000..68f390ec5 --- /dev/null +++ b/app/components/kommonitorAdmin/adminConfig/adminKeycloakConfig/admin-keycloak-config.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"admin-keycloak-config.component.js","sourceRoot":"","sources":["admin-keyc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AAC,OAAO,KAAK,EAAE;oBACf,IAAI,KAAK,CAAC,IAAI,EAAE;wBACf,MAAM,CAAC,gBAAgB,GAAG,6BAA6B,CAAC,mBAAmB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;qBACxF;yBACI;wBACJ,MAAM,CAAC,gBAAgB,GAAG,6BAA6B,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;qBACnF;oBAED,CAAC,CAAC,+BAA+B,CAAC,CAAC,IAAI,EAAE,CAAC;oBAC1C,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;oBAE3B,UAAU,CAAC,GAAG,EAAE;wBACf,MAAM,CAAC,OAAO,EAAE,CAAC;oBAClB,CAAC,EAAE,GAAG,CAAC,CAAC;iBACR;YAEF,CAAC,CAAC;YAEF,MAAM,CAAC,gBAAgB,GAAG;gBACzB,CAAC,CAAC,iCAAiC,CAAC,CAAC,IAAI,EAAE,CAAC;YAC7C,CAAC,CAAC;YAEF,MAAM,CAAC,cAAc,GAAG;gBACvB,CAAC,CAAC,+BAA+B,CAAC,CAAC,IAAI,EAAE,CAAC;YAC3C,CAAC,CAAC;QAEH,CAAC;KACA;CACD,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminConfig/adminKeycloakConfig/admin-keycloak-config.component.ts b/app/components/kommonitorAdmin/adminConfig/adminKeycloakConfig/admin-keycloak-config.component.ts new file mode 100644 index 000000000..04eb90eda --- /dev/null +++ b/app/components/kommonitorAdmin/adminConfig/adminKeycloakConfig/admin-keycloak-config.component.ts @@ -0,0 +1,197 @@ +angular.module('adminKeycloakConfig').component('adminKeycloakConfig', { + templateUrl: "components/kommonitorAdmin/adminConfig/adminKeycloakConfig/admin-keycloak-config.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', 'kommonitorConfigStorageService', '$scope', '$rootScope', '__env', '$http', '$timeout', function KeycloakConfigController(kommonitorDataExchangeService, kommonitorScriptHelperService, kommonitorConfigStorageService, $scope, $rootScope, __env, $http, $timeout) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + $scope.loadingData = true; + $scope.codeMirrorEditor = undefined; + + $scope.missingRequiredParameters = []; + $scope.missingRequiredParameters_string = ""; + + $scope.keywordsInConfig = ["realm", "auth-server-url", "http", "/auth", "resource", "ssl-required", "public-client", "confidential-port"]; + + $scope.keycloakConfigTemplate = undefined; + $scope.keycloakConfigTmp = undefined; + $scope.keycloakConfigCurrent = undefined; + $scope.keycloakConfigNew = undefined; + + $scope.configSettingInvalid = false; + + $scope.init = async function(){ + await $http.get('./config/keycloak_backup_withComments.txt', {'responseType': 'text'}).then(function (response) { + // $scope.keycloakConfigTemplate = JSON.stringify(response.data, null, " "); + $scope.keycloakConfigTemplate = response.data; + + kommonitorScriptHelperService.prettifyScriptCodePreview("keycloakConfig_backupTemplate"); + }); + + // set in app.js + $scope.keycloakConfigTmp = JSON.stringify(__env.keycloakConfig, null, " "); + $scope.keycloakConfigCurrent = JSON.stringify(__env.keycloakConfig, null, " "); + $scope.keycloakConfigNew = JSON.stringify(__env.keycloakConfig, null, " "); + kommonitorScriptHelperService.prettifyScriptCodePreview("keycloakConfig_current"); + + $scope.initCodeEditor(); + + $scope.onChangeKeycloakConfig(); + + $scope.$digest(); + }; + + $scope.initCodeEditor = function(){ + $scope.codeMirrorEditor = CodeMirror.fromTextArea(document.getElementById("keycloakConfigEditor"), { + lineNumbers: true, + autoRefresh:true, + mode: "application/json", + gutters: ["CodeMirror-lint-markers"], + lint: { + "getAnnotations": $scope.validateCode, + "async": true + } + }); + + $scope.codeMirrorEditor.setSize(null, 220); + + $scope.codeMirrorEditor.on('change',function(cMirror){ + // get value right from instance + $scope.keycloakConfigTmp = $scope.codeMirrorEditor.getValue(); + }); + + $scope.codeMirrorEditor.setValue($scope.keycloakConfigCurrent); + }; + + $scope.validateCode = function(cm, updateLinting, options){ + // call the built in css linter from addon/lint/css-lint.js + try { + $scope.lintingIssues = CodeMirror.lint.json(cm, options); + + updateLinting($scope.lintingIssues); + } catch (error) { + console.error("Error while linting keycloak config json code. Error is: \n" + error); + } + + $scope.onChangeKeycloakConfig(); + + }; + + $scope.isConfigSettingInvalid = function(configString){ + var isInvalid = true; + + isInvalid = ! $scope.keywordsInConfig.every(keyword => configString.includes(keyword)); + $scope.missingRequiredParameters = $scope.keywordsInConfig.filter(keyword => ! configString.includes(keyword)); + $scope.missingRequiredParameters_string = JSON.stringify($scope.missingRequiredParameters); + + if ($scope.lintingIssues && $scope.lintingIssues.length > 0){ + isInvalid = true; + } + + return isInvalid; + + }; + + $scope.resetDefaultConfig = async function(){ + await $http.get('./config/keycloak_backup.json', {'responseType': 'json'}).then(function (response) { + $scope.keycloakConfigTmp = JSON.stringify(response.data, null, " "); + $scope.keycloakConfigCurrent = JSON.stringify(response.data, null, " "); + $scope.keycloakConfigNew = JSON.stringify(response.data, null, " "); + }); + + $scope.onChangeKeycloakConfig(); + + // update config on server + $scope.editKeycloakConfig(); + + $scope.codeMirrorEditor.setValue($scope.keycloakConfigCurrent); + }; + + $scope.onChangeKeycloakConfig = function(){ + // check by searching for keywords + + var configString = $scope.keycloakConfigTmp; + + if(typeof configString === 'object' && configString !== null){ + configString = JSON.stringify(configString, null, " "); + } + + $scope.configSettingInvalid = $scope.isConfigSettingInvalid(configString); + + $timeout(function(){ + $scope.keycloakConfigNew = configString; + }); + + $timeout(function(){ + // kommonitorScriptHelperService.prettifyScriptCodePreview("keycloakConfig_new"); + document.getElementById('keycloakConfig_new').innerHTML = + PR.prettyPrintOne($scope.keycloakConfigNew, + 'javascript', true); + }, 250); + + $timeout(function(){ + $scope.$digest(); + }); + }; + + $scope.init(); + + $scope.editKeycloakConfig = async function(){ + $timeout(function () { + $scope.loadingData = true; + }); + + $scope.errorMessagePart = undefined; + + try { + var addConfigResponse = await kommonitorConfigStorageService.postKeycloakConfig($scope.keycloakConfigTmp); + + var newCurrentConfig = await kommonitorConfigStorageService.getKeycloakConfig(); + $timeout(function(){ + $scope.keycloakConfigCurrent = JSON.stringify(newCurrentConfig, null, " "); + }); + + $timeout(function(){ + // kommonitorScriptHelperService.prettifyScriptCodePreview("keycloakConfig_new"); + document.getElementById('keycloakConfig_current').innerHTML = + PR.prettyPrintOne($scope.keycloakConfigCurrent, + 'javascript', true); + }, 250); + + $("#keycloakConfigEditSuccessAlert").show(); + $scope.loadingData = false; + + setTimeout(() => { + $scope.$digest(); + }, 250); + } catch (error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + + $("#keycloakConfigEditErrorAlert").show(); + $scope.loadingData = false; + + setTimeout(() => { + $scope.$digest(); + }, 250); + } + + }; + + $scope.hideSuccessAlert = function () { + $("#keycloakConfigEditSuccessAlert").hide(); + }; + + $scope.hideErrorAlert = function () { + $("#keycloakConfigEditErrorAlert").hide(); + }; + + } + ] +}); diff --git a/app/components/kommonitorAdmin/adminConfig/adminKeycloakConfig/admin-keycloak-config.module.js b/app/components/kommonitorAdmin/adminConfig/adminKeycloakConfig/admin-keycloak-config.module.js index 7ac2d441a..4d3160ad3 100644 --- a/app/components/kommonitorAdmin/adminConfig/adminKeycloakConfig/admin-keycloak-config.module.js +++ b/app/components/kommonitorAdmin/adminConfig/adminKeycloakConfig/admin-keycloak-config.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('adminKeycloakConfig', ['kommonitorDataExchange', 'kommonitorScriptHelper', 'kommonitorConfigStorage']); +//# sourceMappingURL=admin-keycloak-config.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminConfig/adminKeycloakConfig/admin-keycloak-config.module.js.map b/app/components/kommonitorAdmin/adminConfig/adminKeycloakConfig/admin-keycloak-config.module.js.map new file mode 100644 index 000000000..4c2c77c86 --- /dev/null +++ b/app/components/kommonitorAdmin/adminConfig/adminKeycloakConfig/admin-keycloak-config.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"admin-keycloak-config.module.js","sourceRoot":"","sources":["admin-keycloak-config.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,qBAAqB,EAAE,CAAC,wBAAwB,EAAE,wBAAwB,EAAE,yBAAyB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminConfig/adminKeycloakConfig/admin-keycloak-config.module.ts b/app/components/kommonitorAdmin/adminConfig/adminKeycloakConfig/admin-keycloak-config.module.ts new file mode 100644 index 000000000..7ac2d441a --- /dev/null +++ b/app/components/kommonitorAdmin/adminConfig/adminKeycloakConfig/admin-keycloak-config.module.ts @@ -0,0 +1 @@ +angular.module('adminKeycloakConfig', ['kommonitorDataExchange', 'kommonitorScriptHelper', 'kommonitorConfigStorage']); diff --git a/app/components/kommonitorAdmin/adminDashboardManagement/admin-dashboard-management.component.js b/app/components/kommonitorAdmin/adminDashboardManagement/admin-dashboard-management.component.js index 852489c88..5c72e0a1d 100644 --- a/app/components/kommonitorAdmin/adminDashboardManagement/admin-dashboard-management.component.js +++ b/app/components/kommonitorAdmin/adminDashboardManagement/admin-dashboard-management.component.js @@ -1,384 +1,318 @@ +"use strict"; angular.module('adminDashboardManagement').component('adminDashboardManagement', { - templateUrl : "components/kommonitorAdmin/adminDashboardManagement/admin-dashboard-management.template.html", - controller : ['kommonitorDataExchangeService', '$scope', '$timeout', '$rootScope', '__env', '$http', - function DashboardManagementController(kommonitorDataExchangeService, $scope, $timeout, $rootScope, __env, $http) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - - $scope.loadingData = true; - - $scope.kommonitorDataExchangeService = kommonitorDataExchangeService; - - $scope.numberOfMainTopics = 0; - $scope.numberOfSubTopics = 0; - - $scope.pieChartTooltip = { - trigger: 'item', - confine: 'true', - formatter: "{a}
{b} : {c} ({d}%)", - textStyle: { - fontSize: 12 - } - }; - - $scope.pieChartLabel = { - normal: { - position: 'inside', - fontSize: 12 - } - }; - - $scope.indicatorsPerTopicChart = echarts.init(document.getElementById('indicatorsPerTopicDiagram')); - $scope.indicatorsPerTopicChartOptions; - $scope.indicatorsPerTopicChart.showLoading(); - - $scope.georesourcesPerTypeChart = echarts.init(document.getElementById('georesourcesPerTypeDiagram')); - $scope.georesourcesPerTypeChartOptions; - $scope.georesourcesPerTypeChart.showLoading(); - - $scope.indicatorsPerSpatialUnitChart = echarts.init(document.getElementById('indicatorsPerSpatialUnitDiagram')); - $scope.indicatorsPerSpatialUnitChartOptions; - $scope.indicatorsPerSpatialUnitChart.showLoading(); - - - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - $(window).on('resize', function(){ - - if($scope.indicatorsPerTopicChart != null && $scope.indicatorsPerTopicChart != undefined){ - $scope.indicatorsPerTopicChart.resize(); - } - - if($scope.georesourcesPerTypeChart != null && $scope.georesourcesPerTypeChart != undefined){ - $scope.georesourcesPerTypeChart.resize(); - } - - if($scope.indicatorsPerSpatialUnitChart != null && $scope.indicatorsPerSpatialUnitChart != undefined){ - $scope.indicatorsPerSpatialUnitChart.resize(); - } - }); - - $scope.$on("refreshAdminDashboardDiagrams", function (event) { - - console.log("refresh admin charts"); - - $scope.refreshAdminDashboardDiagrams(); - - }); - - $scope.$on("initialMetadataLoadingFailed", function (event, errorArray) { - - $scope.loadingData = false; - - }); - - $scope.$on("initialMetadataLoadingCompleted", function (event) { - - console.log("refresh admin overview"); - - $timeout(function(){ - - $scope.refreshAdminDashboardDiagrams(); - }, 250); - - }); - - $scope.refreshAdminDashboardDiagrams = function(){ - var mainTopics = []; - var subTopics = []; - - kommonitorDataExchangeService.availableTopics.forEach(function(topic){ - if(topic.topicType === 'main'){ - mainTopics.push(topic); - } - }); - - subTopics = $scope.addSubTopics(mainTopics, subTopics); - - $scope.numberOfMainTopics = mainTopics.length; - $scope.numberOfSubTopics = subTopics.length - - $scope.updateCharts(); - - $scope.loadingData = false; - }; - - $scope.addSubTopics = function(mainTopics, subTopics){ - for (const mainTopic of mainTopics) { - if(mainTopic.subTopics && mainTopic.subTopics.length > 0){ - for (const subTopic of mainTopic.subTopics) { - subTopics.push(subTopic); - if(subTopic.subTopics && subTopic.subTopics.length > 0){ - subTopics = $scope.addSubTopics(subTopic.subTopics, subTopics); - } - } - } - } - - return subTopics; - }; - - $scope.updateCharts = function(){ - - $scope.updateIndicatorsPerTopicChart(); - - $scope.updateGeoresourcesPerTypeChart(); - - $scope.updateIndicatorsPerSpatialUnitChart(); - }; - - // INDICATORS PER TOPIC - - $scope.updateIndicatorsPerTopicChart = function(){ - - $scope.indicatorsPerTopicChart.showLoading(); - - var indicatorsPerTopicSeriesData = []; - - //sorted alphabetically - kommonitorDataExchangeService.topicIndicatorHierarchy.forEach(function(mainTopic){ - if(mainTopic.indicatorCount > 0){ - indicatorsPerTopicSeriesData.push({ - name: mainTopic.topicName, - value: mainTopic.indicatorCount - }); - } - }); - - $scope.indicatorsPerTopicChartOptions = { - // grid get rid of whitespace around chart - // grid: { - // left: '7%', - // top: 32, - // right: '5%', - // bottom: 55 - // }, - title: { - text: 'Indikatoren \npro Themenbereich', - left: 'center', - show: true, - top: 15, - fontSize: 12 - }, - tooltip: $scope.pieChartTooltip, - series : [ - { - name: 'Indikatoren pro Themenbereich', - type: 'pie', - //roseType: 'radius', - radius : '90%', - center: ['50%', '50%'], - data: indicatorsPerTopicSeriesData, - itemStyle: { - normal: { - color: '#00a65b', - shadowBlur: 20, - shadowColor: 'rgba(0, 0, 0, 0.5)' - }, - emphasis: { - shadowBlur: 10, - shadowOffsetX: 0, - shadowColor: 'rgba(0, 0, 0, 0.5)' - } - }, - label: $scope.pieChartLabel - } - ] - }; - // end of chart options - - $scope.indicatorsPerTopicChart.setOption($scope.indicatorsPerTopicChartOptions); - $scope.indicatorsPerTopicChart.hideLoading(); - }; - - // GEORESOURCES PER TOPIC - - $scope.updateGeoresourcesPerTypeChart = function(){ - - $scope.georesourcesPerTypeChart.showLoading(); - - var georesourcesPerTypeMap = new Map(); - - kommonitorDataExchangeService.availableGeoresources.forEach(function(georesource){ - var georesourceType = "POI"; - if(georesource.isLOI){ - georesourceType = "LOI"; - } - else if(georesource.isAOI){ - georesourceType = "AOI"; - } - - if(georesourcesPerTypeMap.has(georesourceType)){ - // increment by 1 - georesourcesPerTypeMap.set(georesourceType, georesourcesPerTypeMap.get(georesourceType) + 1); - } - else{ - georesourcesPerTypeMap.set(georesourceType, 1); - } - }); - - var georesourcesPerTypeSeriesData = []; - - if(georesourcesPerTypeMap.has("POI")){ - georesourcesPerTypeSeriesData.push({ - name: "Points of Interest", - value: georesourcesPerTypeMap.get("POI") - }); - } - if(georesourcesPerTypeMap.has("LOI")){ - georesourcesPerTypeSeriesData.push({ - name: "Lines of Interest", - value: georesourcesPerTypeMap.get("LOI") - }); - } - if(georesourcesPerTypeMap.has("AOI")){ - georesourcesPerTypeSeriesData.push({ - name: "Areas of Interest", - value: georesourcesPerTypeMap.get("AOI") - }); - } - - $scope.georesourcesPerTypeChartOptions = { - // grid get rid of whitespace around chart - // grid: { - // left: '7%', - // top: 32, - // right: '5%', - // bottom: 55 - // }, - title: { - text: 'Georessourcen \npro Typ', - left: 'center', - show: true, - top: 15, - fontSize: 12 - }, - tooltip: $scope.pieChartTooltip, - series : [ - { - name: 'Georessourcen pro Typ', - type: 'pie', - //roseType: 'radius', - radius : '90%', - center: ['50%', '50%'], - data: georesourcesPerTypeSeriesData, - itemStyle: { - normal: { - color: '#ff851b', - shadowBlur: 20, - shadowColor: 'rgba(0, 0, 0, 0.5)' - }, - emphasis: { - shadowBlur: 10, - shadowOffsetX: 0, - shadowColor: 'rgba(0, 0, 0, 0.5)' - } - }, - label: $scope.pieChartLabel - } - ] - }; - // end of chart options - - $scope.georesourcesPerTypeChart.setOption($scope.georesourcesPerTypeChartOptions); - $scope.georesourcesPerTypeChart.hideLoading(); - }; - - // INDICATORS PER SPATIAL UNIT - - $scope.updateIndicatorsPerSpatialUnitChart = function(){ - - $scope.indicatorsPerSpatialUnitChart.showLoading(); - - var indicatorsPerSpatialUnitMap = new Map(); - - kommonitorDataExchangeService.availableIndicators.forEach(function(indicator){ - indicator.applicableSpatialUnits.forEach(function(applicableSpatialUnit){ - - var spatialUnitName = applicableSpatialUnit.spatialUnitName; - - if(indicatorsPerSpatialUnitMap.has(spatialUnitName)){ - // increment by 1 - indicatorsPerSpatialUnitMap.set(spatialUnitName, indicatorsPerSpatialUnitMap.get(spatialUnitName) + 1); - } - else{ - indicatorsPerSpatialUnitMap.set(spatialUnitName, 1); - } - }); - }); - - var indicatorsPerSpatialUnitSeriesData = []; - - //sorted by spatial unit size - kommonitorDataExchangeService.availableSpatialUnits.forEach(function(spatialUnit){ - if(indicatorsPerSpatialUnitMap.has(spatialUnit.spatialUnitLevel)){ - indicatorsPerSpatialUnitSeriesData.push({ - name: spatialUnit.spatialUnitLevel, - value: indicatorsPerSpatialUnitMap.get(spatialUnit.spatialUnitLevel) - }); - } - }); - - $scope.indicatorsPerSpatialUnitChartOptions = { - // grid get rid of whitespace around chart - // grid: { - // left: '7%', - // top: 32, - // right: '5%', - // bottom: 55 - // }, - title: { - text: 'Indikatoren \npro Raumeinheit', - left: 'center', - show: true, - top: 15, - fontSize: 12 - }, - tooltip: $scope.pieChartTooltip, - series : [ - { - name: 'Indikatoren pro Raumeinheit', - type: 'pie', - //roseType: 'radius', - radius : '90%', - center: ['50%', '50%'], - data: indicatorsPerSpatialUnitSeriesData, - itemStyle: { - normal: { - color: '#00a65b', - shadowBlur: 20, - shadowColor: 'rgba(0, 0, 0, 0.5)' - }, - emphasis: { - shadowBlur: 10, - shadowOffsetX: 0, - shadowColor: 'rgba(0, 0, 0, 0.5)' - } - }, - label: $scope.pieChartLabel - } - ] - }; - // end of chart options - - $scope.indicatorsPerSpatialUnitChart.setOption($scope.indicatorsPerSpatialUnitChartOptions); - $scope.indicatorsPerSpatialUnitChart.hideLoading(); - }; - - // when ready check if required metadat was already fetched - // $( document ).ready(function() { - // if (kommonitorDataExchangeService.availableRoles.length > 0){ - // // we already have required data. hide loading icon - // $scope.updateCharts(); - // $scope.loadingData = false; - // } - // else{ - // // we wait for required data. show loading icon - // console.log("fetching all required metadata"); - // $scope.loadingData = true; - // } - // }); - - } -]}); + templateUrl: "components/kommonitorAdmin/adminDashboardManagement/admin-dashboard-management.template.html", + controller: ['kommonitorDataExchangeService', '$scope', '$timeout', '$rootScope', '__env', '$http', + function DashboardManagementController(kommonitorDataExchangeService, $scope, $timeout, $rootScope, __env, $http) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + $scope.loadingData = true; + $scope.kommonitorDataExchangeService = kommonitorDataExchangeService; + $scope.numberOfMainTopics = 0; + $scope.numberOfSubTopics = 0; + $scope.pieChartTooltip = { + trigger: 'item', + confine: 'true', + formatter: "{a}
{b} : {c} ({d}%)", + textStyle: { + fontSize: 12 + } + }; + $scope.pieChartLabel = { + normal: { + position: 'inside', + fontSize: 12 + } + }; + $scope.indicatorsPerTopicChart = echarts.init(document.getElementById('indicatorsPerTopicDiagram')); + $scope.indicatorsPerTopicChartOptions; + $scope.indicatorsPerTopicChart.showLoading(); + $scope.georesourcesPerTypeChart = echarts.init(document.getElementById('georesourcesPerTypeDiagram')); + $scope.georesourcesPerTypeChartOptions; + $scope.georesourcesPerTypeChart.showLoading(); + $scope.indicatorsPerSpatialUnitChart = echarts.init(document.getElementById('indicatorsPerSpatialUnitDiagram')); + $scope.indicatorsPerSpatialUnitChartOptions; + $scope.indicatorsPerSpatialUnitChart.showLoading(); + // initialize any adminLTE box widgets + $('.box').boxWidget(); + $(window).on('resize', function () { + if ($scope.indicatorsPerTopicChart != null && $scope.indicatorsPerTopicChart != undefined) { + $scope.indicatorsPerTopicChart.resize(); + } + if ($scope.georesourcesPerTypeChart != null && $scope.georesourcesPerTypeChart != undefined) { + $scope.georesourcesPerTypeChart.resize(); + } + if ($scope.indicatorsPerSpatialUnitChart != null && $scope.indicatorsPerSpatialUnitChart != undefined) { + $scope.indicatorsPerSpatialUnitChart.resize(); + } + }); + $scope.$on("refreshAdminDashboardDiagrams", function (event) { + console.log("refresh admin charts"); + $scope.refreshAdminDashboardDiagrams(); + }); + $scope.$on("initialMetadataLoadingFailed", function (event, errorArray) { + $scope.loadingData = false; + }); + $scope.$on("initialMetadataLoadingCompleted", function (event) { + console.log("refresh admin overview"); + $timeout(function () { + $scope.refreshAdminDashboardDiagrams(); + }, 250); + }); + $scope.refreshAdminDashboardDiagrams = function () { + var mainTopics = []; + var subTopics = []; + kommonitorDataExchangeService.availableTopics.forEach(function (topic) { + if (topic.topicType === 'main') { + mainTopics.push(topic); + } + }); + subTopics = $scope.addSubTopics(mainTopics, subTopics); + $scope.numberOfMainTopics = mainTopics.length; + $scope.numberOfSubTopics = subTopics.length; + $scope.updateCharts(); + $scope.loadingData = false; + }; + $scope.addSubTopics = function (mainTopics, subTopics) { + for (const mainTopic of mainTopics) { + if (mainTopic.subTopics && mainTopic.subTopics.length > 0) { + for (const subTopic of mainTopic.subTopics) { + subTopics.push(subTopic); + if (subTopic.subTopics && subTopic.subTopics.length > 0) { + subTopics = $scope.addSubTopics(subTopic.subTopics, subTopics); + } + } + } + } + return subTopics; + }; + $scope.updateCharts = function () { + $scope.updateIndicatorsPerTopicChart(); + $scope.updateGeoresourcesPerTypeChart(); + $scope.updateIndicatorsPerSpatialUnitChart(); + }; + // INDICATORS PER TOPIC + $scope.updateIndicatorsPerTopicChart = function () { + $scope.indicatorsPerTopicChart.showLoading(); + var indicatorsPerTopicSeriesData = []; + //sorted alphabetically + kommonitorDataExchangeService.topicIndicatorHierarchy.forEach(function (mainTopic) { + if (mainTopic.indicatorCount > 0) { + indicatorsPerTopicSeriesData.push({ + name: mainTopic.topicName, + value: mainTopic.indicatorCount + }); + } + }); + $scope.indicatorsPerTopicChartOptions = { + // grid get rid of whitespace around chart + // grid: { + // left: '7%', + // top: 32, + // right: '5%', + // bottom: 55 + // }, + title: { + text: 'Indikatoren \npro Themenbereich', + left: 'center', + show: true, + top: 15, + fontSize: 12 + }, + tooltip: $scope.pieChartTooltip, + series: [ + { + name: 'Indikatoren pro Themenbereich', + type: 'pie', + //roseType: 'radius', + radius: '90%', + center: ['50%', '50%'], + data: indicatorsPerTopicSeriesData, + itemStyle: { + normal: { + color: '#00a65b', + shadowBlur: 20, + shadowColor: 'rgba(0, 0, 0, 0.5)' + }, + emphasis: { + shadowBlur: 10, + shadowOffsetX: 0, + shadowColor: 'rgba(0, 0, 0, 0.5)' + } + }, + label: $scope.pieChartLabel + } + ] + }; + // end of chart options + $scope.indicatorsPerTopicChart.setOption($scope.indicatorsPerTopicChartOptions); + $scope.indicatorsPerTopicChart.hideLoading(); + }; + // GEORESOURCES PER TOPIC + $scope.updateGeoresourcesPerTypeChart = function () { + $scope.georesourcesPerTypeChart.showLoading(); + var georesourcesPerTypeMap = new Map(); + kommonitorDataExchangeService.availableGeoresources.forEach(function (georesource) { + var georesourceType = "POI"; + if (georesource.isLOI) { + georesourceType = "LOI"; + } + else if (georesource.isAOI) { + georesourceType = "AOI"; + } + if (georesourcesPerTypeMap.has(georesourceType)) { + // increment by 1 + georesourcesPerTypeMap.set(georesourceType, georesourcesPerTypeMap.get(georesourceType) + 1); + } + else { + georesourcesPerTypeMap.set(georesourceType, 1); + } + }); + var georesourcesPerTypeSeriesData = []; + if (georesourcesPerTypeMap.has("POI")) { + georesourcesPerTypeSeriesData.push({ + name: "Points of Interest", + value: georesourcesPerTypeMap.get("POI") + }); + } + if (georesourcesPerTypeMap.has("LOI")) { + georesourcesPerTypeSeriesData.push({ + name: "Lines of Interest", + value: georesourcesPerTypeMap.get("LOI") + }); + } + if (georesourcesPerTypeMap.has("AOI")) { + georesourcesPerTypeSeriesData.push({ + name: "Areas of Interest", + value: georesourcesPerTypeMap.get("AOI") + }); + } + $scope.georesourcesPerTypeChartOptions = { + // grid get rid of whitespace around chart + // grid: { + // left: '7%', + // top: 32, + // right: '5%', + // bottom: 55 + // }, + title: { + text: 'Georessourcen \npro Typ', + left: 'center', + show: true, + top: 15, + fontSize: 12 + }, + tooltip: $scope.pieChartTooltip, + series: [ + { + name: 'Georessourcen pro Typ', + type: 'pie', + //roseType: 'radius', + radius: '90%', + center: ['50%', '50%'], + data: georesourcesPerTypeSeriesData, + itemStyle: { + normal: { + color: '#ff851b', + shadowBlur: 20, + shadowColor: 'rgba(0, 0, 0, 0.5)' + }, + emphasis: { + shadowBlur: 10, + shadowOffsetX: 0, + shadowColor: 'rgba(0, 0, 0, 0.5)' + } + }, + label: $scope.pieChartLabel + } + ] + }; + // end of chart options + $scope.georesourcesPerTypeChart.setOption($scope.georesourcesPerTypeChartOptions); + $scope.georesourcesPerTypeChart.hideLoading(); + }; + // INDICATORS PER SPATIAL UNIT + $scope.updateIndicatorsPerSpatialUnitChart = function () { + $scope.indicatorsPerSpatialUnitChart.showLoading(); + var indicatorsPerSpatialUnitMap = new Map(); + kommonitorDataExchangeService.availableIndicators.forEach(function (indicator) { + indicator.applicableSpatialUnits.forEach(function (applicableSpatialUnit) { + var spatialUnitName = applicableSpatialUnit.spatialUnitName; + if (indicatorsPerSpatialUnitMap.has(spatialUnitName)) { + // increment by 1 + indicatorsPerSpatialUnitMap.set(spatialUnitName, indicatorsPerSpatialUnitMap.get(spatialUnitName) + 1); + } + else { + indicatorsPerSpatialUnitMap.set(spatialUnitName, 1); + } + }); + }); + var indicatorsPerSpatialUnitSeriesData = []; + //sorted by spatial unit size + kommonitorDataExchangeService.availableSpatialUnits.forEach(function (spatialUnit) { + if (indicatorsPerSpatialUnitMap.has(spatialUnit.spatialUnitLevel)) { + indicatorsPerSpatialUnitSeriesData.push({ + name: spatialUnit.spatialUnitLevel, + value: indicatorsPerSpatialUnitMap.get(spatialUnit.spatialUnitLevel) + }); + } + }); + $scope.indicatorsPerSpatialUnitChartOptions = { + // grid get rid of whitespace around chart + // grid: { + // left: '7%', + // top: 32, + // right: '5%', + // bottom: 55 + // }, + title: { + text: 'Indikatoren \npro Raumeinheit', + left: 'center', + show: true, + top: 15, + fontSize: 12 + }, + tooltip: $scope.pieChartTooltip, + series: [ + { + name: 'Indikatoren pro Raumeinheit', + type: 'pie', + //roseType: 'radius', + radius: '90%', + center: ['50%', '50%'], + data: indicatorsPerSpatialUnitSeriesData, + itemStyle: { + normal: { + color: '#00a65b', + shadowBlur: 20, + shadowColor: 'rgba(0, 0, 0, 0.5)' + }, + emphasis: { + shadowBlur: 10, + shadowOffsetX: 0, + shadowColor: 'rgba(0, 0, 0, 0.5)' + } + }, + label: $scope.pieChartLabel + } + ] + }; + // end of chart options + $scope.indicatorsPerSpatialUnitChart.setOption($scope.indicatorsPerSpatialUnitChartOptions); + $scope.indicatorsPerSpatialUnitChart.hideLoading(); + }; + // when ready check if required metadat was already fetched + // $( document ).ready(function() { + // if (kommonitorDataExchangeService.availableRoles.length > 0){ + // // we already have required data. hide loading icon + // $scope.updateCharts(); + // $scope.loadingData = false; + // } + // else{ + // // we wait for required data. show loading icon + // console.log("fetching all required metadata"); + // $scope.loadingData = true; + // } + // }); + } + ] +}); +//# sourceMappingURL=admin-dashboard-management.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminDashboardManagement/admin-dashboard-management.component.js.map b/app/components/kommonitorAdmin/adminDashboardManagement/admin-dashboard-management.component.js.map new file mode 100644 index 000000000..a5a6b1b74 --- /dev/null +++ b/app/components/kommonitorAdmin/adminDashboardManagement/admin-dashboard-management.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"admin-dashboard-management.component.js","sourceRoot":"","sources":["admin-dashboard-management.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC,SAAS,CAAC,0BAA0B,EAAE;IAChF,WAAW,EAAG,8FAA8F;IAC5G,UAAU,EAAG,CAAC,+BAA+B,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO;QACnG,SAAS,6BAA6B,CAAC,6BAA6B,EAAE,MAAM,EAAE,QA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AAC,eAAe;oBAC/B,MAAM,EAAG;wBACH;4BACI,IAAI,EAAE,6BAA6B;4BACnC,IAAI,EAAE,KAAK;4BACjB,qBAAqB;4BACf,MAAM,EAAG,KAAK;4BACd,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;4BACtB,IAAI,EAAE,kCAAkC;4BACxC,SAAS,EAAE;gCACf,MAAM,EAAE;oCACN,KAAK,EAAE,SAAS;oCAChB,UAAU,EAAE,EAAE;oCACd,WAAW,EAAE,oBAAoB;iCAClC;gCACO,QAAQ,EAAE;oCACN,UAAU,EAAE,EAAE;oCACd,aAAa,EAAE,CAAC;oCAChB,WAAW,EAAE,oBAAoB;iCACpC;6BACJ;4BACP,KAAK,EAAE,MAAM,CAAC,aAAa;yBACxB;qBACJ;iBACJ,CAAC;gBACF,uBAAuB;gBAEvB,MAAM,CAAC,6BAA6B,CAAC,SAAS,CAAC,MAAM,CAAC,oCAAoC,CAAC,CAAC;gBAC5F,MAAM,CAAC,6BAA6B,CAAC,WAAW,EAAE,CAAC;YACpD,CAAC,CAAC;YAEF,2DAA2D;YAC3D,mCAAmC;YACnC,kEAAkE;YAClE,wDAAwD;YACxD,2BAA2B;YAC3B,gCAAgC;YAChC,KAAK;YACL,SAAS;YACT,qDAAqD;YACrD,mDAAmD;YACnD,+BAA+B;YAC/B,KAAK;YACL,MAAM;QAEP,CAAC;KACD;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminDashboardManagement/admin-dashboard-management.component.ts b/app/components/kommonitorAdmin/adminDashboardManagement/admin-dashboard-management.component.ts new file mode 100644 index 000000000..852489c88 --- /dev/null +++ b/app/components/kommonitorAdmin/adminDashboardManagement/admin-dashboard-management.component.ts @@ -0,0 +1,384 @@ +angular.module('adminDashboardManagement').component('adminDashboardManagement', { + templateUrl : "components/kommonitorAdmin/adminDashboardManagement/admin-dashboard-management.template.html", + controller : ['kommonitorDataExchangeService', '$scope', '$timeout', '$rootScope', '__env', '$http', + function DashboardManagementController(kommonitorDataExchangeService, $scope, $timeout, $rootScope, __env, $http) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + + $scope.loadingData = true; + + $scope.kommonitorDataExchangeService = kommonitorDataExchangeService; + + $scope.numberOfMainTopics = 0; + $scope.numberOfSubTopics = 0; + + $scope.pieChartTooltip = { + trigger: 'item', + confine: 'true', + formatter: "{a}
{b} : {c} ({d}%)", + textStyle: { + fontSize: 12 + } + }; + + $scope.pieChartLabel = { + normal: { + position: 'inside', + fontSize: 12 + } + }; + + $scope.indicatorsPerTopicChart = echarts.init(document.getElementById('indicatorsPerTopicDiagram')); + $scope.indicatorsPerTopicChartOptions; + $scope.indicatorsPerTopicChart.showLoading(); + + $scope.georesourcesPerTypeChart = echarts.init(document.getElementById('georesourcesPerTypeDiagram')); + $scope.georesourcesPerTypeChartOptions; + $scope.georesourcesPerTypeChart.showLoading(); + + $scope.indicatorsPerSpatialUnitChart = echarts.init(document.getElementById('indicatorsPerSpatialUnitDiagram')); + $scope.indicatorsPerSpatialUnitChartOptions; + $scope.indicatorsPerSpatialUnitChart.showLoading(); + + + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + $(window).on('resize', function(){ + + if($scope.indicatorsPerTopicChart != null && $scope.indicatorsPerTopicChart != undefined){ + $scope.indicatorsPerTopicChart.resize(); + } + + if($scope.georesourcesPerTypeChart != null && $scope.georesourcesPerTypeChart != undefined){ + $scope.georesourcesPerTypeChart.resize(); + } + + if($scope.indicatorsPerSpatialUnitChart != null && $scope.indicatorsPerSpatialUnitChart != undefined){ + $scope.indicatorsPerSpatialUnitChart.resize(); + } + }); + + $scope.$on("refreshAdminDashboardDiagrams", function (event) { + + console.log("refresh admin charts"); + + $scope.refreshAdminDashboardDiagrams(); + + }); + + $scope.$on("initialMetadataLoadingFailed", function (event, errorArray) { + + $scope.loadingData = false; + + }); + + $scope.$on("initialMetadataLoadingCompleted", function (event) { + + console.log("refresh admin overview"); + + $timeout(function(){ + + $scope.refreshAdminDashboardDiagrams(); + }, 250); + + }); + + $scope.refreshAdminDashboardDiagrams = function(){ + var mainTopics = []; + var subTopics = []; + + kommonitorDataExchangeService.availableTopics.forEach(function(topic){ + if(topic.topicType === 'main'){ + mainTopics.push(topic); + } + }); + + subTopics = $scope.addSubTopics(mainTopics, subTopics); + + $scope.numberOfMainTopics = mainTopics.length; + $scope.numberOfSubTopics = subTopics.length + + $scope.updateCharts(); + + $scope.loadingData = false; + }; + + $scope.addSubTopics = function(mainTopics, subTopics){ + for (const mainTopic of mainTopics) { + if(mainTopic.subTopics && mainTopic.subTopics.length > 0){ + for (const subTopic of mainTopic.subTopics) { + subTopics.push(subTopic); + if(subTopic.subTopics && subTopic.subTopics.length > 0){ + subTopics = $scope.addSubTopics(subTopic.subTopics, subTopics); + } + } + } + } + + return subTopics; + }; + + $scope.updateCharts = function(){ + + $scope.updateIndicatorsPerTopicChart(); + + $scope.updateGeoresourcesPerTypeChart(); + + $scope.updateIndicatorsPerSpatialUnitChart(); + }; + + // INDICATORS PER TOPIC + + $scope.updateIndicatorsPerTopicChart = function(){ + + $scope.indicatorsPerTopicChart.showLoading(); + + var indicatorsPerTopicSeriesData = []; + + //sorted alphabetically + kommonitorDataExchangeService.topicIndicatorHierarchy.forEach(function(mainTopic){ + if(mainTopic.indicatorCount > 0){ + indicatorsPerTopicSeriesData.push({ + name: mainTopic.topicName, + value: mainTopic.indicatorCount + }); + } + }); + + $scope.indicatorsPerTopicChartOptions = { + // grid get rid of whitespace around chart + // grid: { + // left: '7%', + // top: 32, + // right: '5%', + // bottom: 55 + // }, + title: { + text: 'Indikatoren \npro Themenbereich', + left: 'center', + show: true, + top: 15, + fontSize: 12 + }, + tooltip: $scope.pieChartTooltip, + series : [ + { + name: 'Indikatoren pro Themenbereich', + type: 'pie', + //roseType: 'radius', + radius : '90%', + center: ['50%', '50%'], + data: indicatorsPerTopicSeriesData, + itemStyle: { + normal: { + color: '#00a65b', + shadowBlur: 20, + shadowColor: 'rgba(0, 0, 0, 0.5)' + }, + emphasis: { + shadowBlur: 10, + shadowOffsetX: 0, + shadowColor: 'rgba(0, 0, 0, 0.5)' + } + }, + label: $scope.pieChartLabel + } + ] + }; + // end of chart options + + $scope.indicatorsPerTopicChart.setOption($scope.indicatorsPerTopicChartOptions); + $scope.indicatorsPerTopicChart.hideLoading(); + }; + + // GEORESOURCES PER TOPIC + + $scope.updateGeoresourcesPerTypeChart = function(){ + + $scope.georesourcesPerTypeChart.showLoading(); + + var georesourcesPerTypeMap = new Map(); + + kommonitorDataExchangeService.availableGeoresources.forEach(function(georesource){ + var georesourceType = "POI"; + if(georesource.isLOI){ + georesourceType = "LOI"; + } + else if(georesource.isAOI){ + georesourceType = "AOI"; + } + + if(georesourcesPerTypeMap.has(georesourceType)){ + // increment by 1 + georesourcesPerTypeMap.set(georesourceType, georesourcesPerTypeMap.get(georesourceType) + 1); + } + else{ + georesourcesPerTypeMap.set(georesourceType, 1); + } + }); + + var georesourcesPerTypeSeriesData = []; + + if(georesourcesPerTypeMap.has("POI")){ + georesourcesPerTypeSeriesData.push({ + name: "Points of Interest", + value: georesourcesPerTypeMap.get("POI") + }); + } + if(georesourcesPerTypeMap.has("LOI")){ + georesourcesPerTypeSeriesData.push({ + name: "Lines of Interest", + value: georesourcesPerTypeMap.get("LOI") + }); + } + if(georesourcesPerTypeMap.has("AOI")){ + georesourcesPerTypeSeriesData.push({ + name: "Areas of Interest", + value: georesourcesPerTypeMap.get("AOI") + }); + } + + $scope.georesourcesPerTypeChartOptions = { + // grid get rid of whitespace around chart + // grid: { + // left: '7%', + // top: 32, + // right: '5%', + // bottom: 55 + // }, + title: { + text: 'Georessourcen \npro Typ', + left: 'center', + show: true, + top: 15, + fontSize: 12 + }, + tooltip: $scope.pieChartTooltip, + series : [ + { + name: 'Georessourcen pro Typ', + type: 'pie', + //roseType: 'radius', + radius : '90%', + center: ['50%', '50%'], + data: georesourcesPerTypeSeriesData, + itemStyle: { + normal: { + color: '#ff851b', + shadowBlur: 20, + shadowColor: 'rgba(0, 0, 0, 0.5)' + }, + emphasis: { + shadowBlur: 10, + shadowOffsetX: 0, + shadowColor: 'rgba(0, 0, 0, 0.5)' + } + }, + label: $scope.pieChartLabel + } + ] + }; + // end of chart options + + $scope.georesourcesPerTypeChart.setOption($scope.georesourcesPerTypeChartOptions); + $scope.georesourcesPerTypeChart.hideLoading(); + }; + + // INDICATORS PER SPATIAL UNIT + + $scope.updateIndicatorsPerSpatialUnitChart = function(){ + + $scope.indicatorsPerSpatialUnitChart.showLoading(); + + var indicatorsPerSpatialUnitMap = new Map(); + + kommonitorDataExchangeService.availableIndicators.forEach(function(indicator){ + indicator.applicableSpatialUnits.forEach(function(applicableSpatialUnit){ + + var spatialUnitName = applicableSpatialUnit.spatialUnitName; + + if(indicatorsPerSpatialUnitMap.has(spatialUnitName)){ + // increment by 1 + indicatorsPerSpatialUnitMap.set(spatialUnitName, indicatorsPerSpatialUnitMap.get(spatialUnitName) + 1); + } + else{ + indicatorsPerSpatialUnitMap.set(spatialUnitName, 1); + } + }); + }); + + var indicatorsPerSpatialUnitSeriesData = []; + + //sorted by spatial unit size + kommonitorDataExchangeService.availableSpatialUnits.forEach(function(spatialUnit){ + if(indicatorsPerSpatialUnitMap.has(spatialUnit.spatialUnitLevel)){ + indicatorsPerSpatialUnitSeriesData.push({ + name: spatialUnit.spatialUnitLevel, + value: indicatorsPerSpatialUnitMap.get(spatialUnit.spatialUnitLevel) + }); + } + }); + + $scope.indicatorsPerSpatialUnitChartOptions = { + // grid get rid of whitespace around chart + // grid: { + // left: '7%', + // top: 32, + // right: '5%', + // bottom: 55 + // }, + title: { + text: 'Indikatoren \npro Raumeinheit', + left: 'center', + show: true, + top: 15, + fontSize: 12 + }, + tooltip: $scope.pieChartTooltip, + series : [ + { + name: 'Indikatoren pro Raumeinheit', + type: 'pie', + //roseType: 'radius', + radius : '90%', + center: ['50%', '50%'], + data: indicatorsPerSpatialUnitSeriesData, + itemStyle: { + normal: { + color: '#00a65b', + shadowBlur: 20, + shadowColor: 'rgba(0, 0, 0, 0.5)' + }, + emphasis: { + shadowBlur: 10, + shadowOffsetX: 0, + shadowColor: 'rgba(0, 0, 0, 0.5)' + } + }, + label: $scope.pieChartLabel + } + ] + }; + // end of chart options + + $scope.indicatorsPerSpatialUnitChart.setOption($scope.indicatorsPerSpatialUnitChartOptions); + $scope.indicatorsPerSpatialUnitChart.hideLoading(); + }; + + // when ready check if required metadat was already fetched + // $( document ).ready(function() { + // if (kommonitorDataExchangeService.availableRoles.length > 0){ + // // we already have required data. hide loading icon + // $scope.updateCharts(); + // $scope.loadingData = false; + // } + // else{ + // // we wait for required data. show loading icon + // console.log("fetching all required metadata"); + // $scope.loadingData = true; + // } + // }); + + } +]}); diff --git a/app/components/kommonitorAdmin/adminDashboardManagement/admin-dashboard-management.module.js b/app/components/kommonitorAdmin/adminDashboardManagement/admin-dashboard-management.module.js index 3a3562262..c4f26d4e5 100644 --- a/app/components/kommonitorAdmin/adminDashboardManagement/admin-dashboard-management.module.js +++ b/app/components/kommonitorAdmin/adminDashboardManagement/admin-dashboard-management.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('adminDashboardManagement', ['kommonitorDataExchange']); +//# sourceMappingURL=admin-dashboard-management.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminDashboardManagement/admin-dashboard-management.module.js.map b/app/components/kommonitorAdmin/adminDashboardManagement/admin-dashboard-management.module.js.map new file mode 100644 index 000000000..a69cf89a0 --- /dev/null +++ b/app/components/kommonitorAdmin/adminDashboardManagement/admin-dashboard-management.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"admin-dashboard-management.module.js","sourceRoot":"","sources":["admin-dashboard-management.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,0BAA0B,EAAE,CAAC,wBAAwB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminDashboardManagement/admin-dashboard-management.module.ts b/app/components/kommonitorAdmin/adminDashboardManagement/admin-dashboard-management.module.ts new file mode 100644 index 000000000..3a3562262 --- /dev/null +++ b/app/components/kommonitorAdmin/adminDashboardManagement/admin-dashboard-management.module.ts @@ -0,0 +1 @@ +angular.module('adminDashboardManagement', ['kommonitorDataExchange']); diff --git a/app/components/kommonitorAdmin/adminGeoresourcesManagement/admin-georesources-management.component.js b/app/components/kommonitorAdmin/adminGeoresourcesManagement/admin-georesources-management.component.js index cc6888e4d..1cf23395e 100644 --- a/app/components/kommonitorAdmin/adminGeoresourcesManagement/admin-georesources-management.component.js +++ b/app/components/kommonitorAdmin/adminGeoresourcesManagement/admin-georesources-management.component.js @@ -1,173 +1,121 @@ +"use strict"; angular.module('adminGeoresourcesManagement').component('adminGeoresourcesManagement', { - templateUrl : "components/kommonitorAdmin/adminGeoresourcesManagement/admin-georesources-management.template.html", - controller : ['kommonitorDataExchangeService', 'kommonitorCacheHelperService', 'kommonitorDataGridHelperService', '$scope', '$timeout', '$rootScope', '__env', '$http', - function GeoresourcesManagementController(kommonitorDataExchangeService, kommonitorCacheHelperService, kommonitorDataGridHelperService, $scope, $timeout, $rootScope, __env, $http) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - $scope.loadingData = true; - - $scope.$on("initialMetadataLoadingCompleted", function (event) { - - $timeout(function(){ - - $scope.initializeOrRefreshOverviewTable(); - }, 250); - - - }); - - $scope.$on("initialMetadataLoadingFailed", function (event, errorArray) { - - $timeout(function(){ - - $scope.loadingData = false; - }); - - }); - - $scope.initializeOrRefreshOverviewTable = function(){ - $scope.loadingData = true; - - kommonitorDataGridHelperService.buildDataGrid_georesources(kommonitorDataExchangeService.availableGeoresources); - - $timeout(function(){ - - $scope.loadingData = false; - }); - }; - - $scope.$on("refreshGeoresourceOverviewTable", function (event, crudType, targetGeoresourceId) { - $scope.loadingData = true; - $scope.refreshGeoresourceOverviewTable(crudType, targetGeoresourceId); - }); - - - $scope.refreshGeoresourceOverviewTable = function(crudType, targetGeoresourceId){ - - if(! crudType || !targetGeoresourceId){ - // refetch all metadata from spatial units to update table - kommonitorDataExchangeService.fetchGeoresourcesMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(response) { - - $scope.initializeOrRefreshOverviewTable(); - $rootScope.$broadcast("refreshGeoresourceOverviewTableCompleted"); - - $timeout(function(){ - - $scope.loadingData = false; - }); - - }, function errorCallback(response) { - - $timeout(function(){ - - $scope.loadingData = false; - }); - $rootScope.$broadcast("refreshGeoresourceOverviewTableCompleted"); - }); - } - else if(crudType && targetGeoresourceId){ - if(crudType == "add"){ - kommonitorCacheHelperService.fetchSingleGeoresourceMetadata(targetGeoresourceId, kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(data) { - - kommonitorDataExchangeService.addSingleGeoresourceMetadata(data); - - $scope.initializeOrRefreshOverviewTable(); - $rootScope.$broadcast("refreshGeoresourceOverviewTableCompleted"); - - $timeout(function(){ - - $scope.loadingData = false; - }); - - }, function errorCallback(response) { - - $timeout(function(){ - - $scope.loadingData = false; - }); - $rootScope.$broadcast("refreshGeoresourceOverviewTableCompleted"); - }); - } - else if(crudType == "edit"){ - kommonitorCacheHelperService.fetchSingleGeoresourceMetadata(targetGeoresourceId, kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(data) { - - kommonitorDataExchangeService.replaceSingleGeoresourceMetadata(data); - - $scope.initializeOrRefreshOverviewTable(); - $rootScope.$broadcast("refreshGeoresourceOverviewTableCompleted"); - - $timeout(function(){ - - $scope.loadingData = false; - }); - - }, function errorCallback(response) { - - $timeout(function(){ - - $scope.loadingData = false; - }); - $rootScope.$broadcast("refreshGeoresourceOverviewTableCompleted"); - }); - } - else if(crudType == "delete"){ - // targetGeoresourceId might be array in this case - if(targetGeoresourceId && typeof targetGeoresourceId == "string"){ - kommonitorDataExchangeService.deleteSingleGeoresourceMetadata(targetGeoresourceId); - - $scope.initializeOrRefreshOverviewTable(); - $rootScope.$broadcast("refreshGeoresourceOverviewTableCompleted"); - - $timeout(function(){ - - $scope.loadingData = false; - }); - } - - else if (targetGeoresourceId && Array.isArray(targetGeoresourceId)){ - for (const id of targetGeoresourceId) { - kommonitorDataExchangeService.deleteSingleGeoresourceMetadata(id); - } - $scope.initializeOrRefreshOverviewTable(); - $rootScope.$broadcast("refreshGeoresourceOverviewTableCompleted"); - - $timeout(function(){ - - $scope.loadingData = false; - }); - } - - } - } - - }; - - $scope.onClickDeleteDatasets = function(){ - $scope.loadingData = true; - - var markedEntriesForDeletion = kommonitorDataGridHelperService.getSelectedGeoresourcesMetadata(); - - // submit selected spatial units to modal controller - $rootScope.$broadcast("onDeleteGeoresources", markedEntriesForDeletion); - - $timeout(function(){ - - $scope.loadingData = false; - }); - }; - - $scope.onClickEditMetadata = function(georesourceDataset){ - // submit selected spatial unit to modal controller - $rootScope.$broadcast("onEditGeoresourceMetadata", georesourceDataset); - }; - - $scope.onClickEditFeatures = function(georesourceDataset){ - // submit selected spatial unit to modal controller - $rootScope.$broadcast("onEditGeoresourceFeatures", georesourceDataset); - }; - - } -]}); + templateUrl: "components/kommonitorAdmin/adminGeoresourcesManagement/admin-georesources-management.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorCacheHelperService', 'kommonitorDataGridHelperService', '$scope', '$timeout', '$rootScope', '__env', '$http', + function GeoresourcesManagementController(kommonitorDataExchangeService, kommonitorCacheHelperService, kommonitorDataGridHelperService, $scope, $timeout, $rootScope, __env, $http) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + $scope.loadingData = true; + $scope.$on("initialMetadataLoadingCompleted", function (event) { + $timeout(function () { + $scope.initializeOrRefreshOverviewTable(); + }, 250); + }); + $scope.$on("initialMetadataLoadingFailed", function (event, errorArray) { + $timeout(function () { + $scope.loadingData = false; + }); + }); + $scope.initializeOrRefreshOverviewTable = function () { + $scope.loadingData = true; + kommonitorDataGridHelperService.buildDataGrid_georesources(kommonitorDataExchangeService.availableGeoresources); + $timeout(function () { + $scope.loadingData = false; + }); + }; + $scope.$on("refreshGeoresourceOverviewTable", function (event, crudType, targetGeoresourceId) { + $scope.loadingData = true; + $scope.refreshGeoresourceOverviewTable(crudType, targetGeoresourceId); + }); + $scope.refreshGeoresourceOverviewTable = function (crudType, targetGeoresourceId) { + if (!crudType || !targetGeoresourceId) { + // refetch all metadata from spatial units to update table + kommonitorDataExchangeService.fetchGeoresourcesMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(response) { + $scope.initializeOrRefreshOverviewTable(); + $rootScope.$broadcast("refreshGeoresourceOverviewTableCompleted"); + $timeout(function () { + $scope.loadingData = false; + }); + }, function errorCallback(response) { + $timeout(function () { + $scope.loadingData = false; + }); + $rootScope.$broadcast("refreshGeoresourceOverviewTableCompleted"); + }); + } + else if (crudType && targetGeoresourceId) { + if (crudType == "add") { + kommonitorCacheHelperService.fetchSingleGeoresourceMetadata(targetGeoresourceId, kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(data) { + kommonitorDataExchangeService.addSingleGeoresourceMetadata(data); + $scope.initializeOrRefreshOverviewTable(); + $rootScope.$broadcast("refreshGeoresourceOverviewTableCompleted"); + $timeout(function () { + $scope.loadingData = false; + }); + }, function errorCallback(response) { + $timeout(function () { + $scope.loadingData = false; + }); + $rootScope.$broadcast("refreshGeoresourceOverviewTableCompleted"); + }); + } + else if (crudType == "edit") { + kommonitorCacheHelperService.fetchSingleGeoresourceMetadata(targetGeoresourceId, kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(data) { + kommonitorDataExchangeService.replaceSingleGeoresourceMetadata(data); + $scope.initializeOrRefreshOverviewTable(); + $rootScope.$broadcast("refreshGeoresourceOverviewTableCompleted"); + $timeout(function () { + $scope.loadingData = false; + }); + }, function errorCallback(response) { + $timeout(function () { + $scope.loadingData = false; + }); + $rootScope.$broadcast("refreshGeoresourceOverviewTableCompleted"); + }); + } + else if (crudType == "delete") { + // targetGeoresourceId might be array in this case + if (targetGeoresourceId && typeof targetGeoresourceId == "string") { + kommonitorDataExchangeService.deleteSingleGeoresourceMetadata(targetGeoresourceId); + $scope.initializeOrRefreshOverviewTable(); + $rootScope.$broadcast("refreshGeoresourceOverviewTableCompleted"); + $timeout(function () { + $scope.loadingData = false; + }); + } + else if (targetGeoresourceId && Array.isArray(targetGeoresourceId)) { + for (const id of targetGeoresourceId) { + kommonitorDataExchangeService.deleteSingleGeoresourceMetadata(id); + } + $scope.initializeOrRefreshOverviewTable(); + $rootScope.$broadcast("refreshGeoresourceOverviewTableCompleted"); + $timeout(function () { + $scope.loadingData = false; + }); + } + } + } + }; + $scope.onClickDeleteDatasets = function () { + $scope.loadingData = true; + var markedEntriesForDeletion = kommonitorDataGridHelperService.getSelectedGeoresourcesMetadata(); + // submit selected spatial units to modal controller + $rootScope.$broadcast("onDeleteGeoresources", markedEntriesForDeletion); + $timeout(function () { + $scope.loadingData = false; + }); + }; + $scope.onClickEditMetadata = function (georesourceDataset) { + // submit selected spatial unit to modal controller + $rootScope.$broadcast("onEditGeoresourceMetadata", georesourceDataset); + }; + $scope.onClickEditFeatures = function (georesourceDataset) { + // submit selected spatial unit to modal controller + $rootScope.$broadcast("onEditGeoresourceFeatures", georesourceDataset); + }; + } + ] +}); +//# sourceMappingURL=admin-georesources-management.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminGeoresourcesManagement/admin-georesources-management.component.js.map b/app/components/kommonitorAdmin/adminGeoresourcesManagement/admin-georesources-management.component.js.map new file mode 100644 index 000000000..a98fd44a6 --- /dev/null +++ b/app/components/kommonitorAdmin/adminGeoresourcesManagement/admin-georesources-management.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"admin-georesources-management.component.js","sourceRoot":"","sources":["admin-georesources-management.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,CAAC,SAAS,CAAC,6BAA6B,EAAE;IAC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C,EAAE,CAAC,CAAC;6BAClE;4BACD,MAAM,CAAC,gCAAgC,EAAE,CAAC;4BAC1C,UAAU,CAAC,UAAU,CAAC,0CAA0C,CAAC,CAAC;4BAElE,QAAQ,CAAC;gCAER,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;4BAC5B,CAAC,CAAC,CAAC;yBACH;qBAED;iBACD;YAEF,CAAC,CAAC;YAEF,MAAM,CAAC,qBAAqB,GAAG;gBAC9B,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC;gBAE1B,IAAI,wBAAwB,GAAG,+BAA+B,CAAC,+BAA+B,EAAE,CAAC;gBAEjG,oDAAoD;gBACpD,UAAU,CAAC,UAAU,CAAC,sBAAsB,EAAE,wBAAwB,CAAC,CAAC;gBAExE,QAAQ,CAAC;oBAER,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;gBAC5B,CAAC,CAAC,CAAC;YACJ,CAAC,CAAC;YAEF,MAAM,CAAC,mBAAmB,GAAG,UAAS,kBAAkB;gBACvD,mDAAmD;gBACnD,UAAU,CAAC,UAAU,CAAC,2BAA2B,EAAE,kBAAkB,CAAC,CAAC;YACxE,CAAC,CAAC;YAEF,MAAM,CAAC,mBAAmB,GAAG,UAAS,kBAAkB;gBACvD,mDAAmD;gBACnD,UAAU,CAAC,UAAU,CAAC,2BAA2B,EAAE,kBAAkB,CAAC,CAAC;YACxE,CAAC,CAAC;QAEH,CAAC;KACD;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminGeoresourcesManagement/admin-georesources-management.component.ts b/app/components/kommonitorAdmin/adminGeoresourcesManagement/admin-georesources-management.component.ts new file mode 100644 index 000000000..cc6888e4d --- /dev/null +++ b/app/components/kommonitorAdmin/adminGeoresourcesManagement/admin-georesources-management.component.ts @@ -0,0 +1,173 @@ +angular.module('adminGeoresourcesManagement').component('adminGeoresourcesManagement', { + templateUrl : "components/kommonitorAdmin/adminGeoresourcesManagement/admin-georesources-management.template.html", + controller : ['kommonitorDataExchangeService', 'kommonitorCacheHelperService', 'kommonitorDataGridHelperService', '$scope', '$timeout', '$rootScope', '__env', '$http', + function GeoresourcesManagementController(kommonitorDataExchangeService, kommonitorCacheHelperService, kommonitorDataGridHelperService, $scope, $timeout, $rootScope, __env, $http) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + $scope.loadingData = true; + + $scope.$on("initialMetadataLoadingCompleted", function (event) { + + $timeout(function(){ + + $scope.initializeOrRefreshOverviewTable(); + }, 250); + + + }); + + $scope.$on("initialMetadataLoadingFailed", function (event, errorArray) { + + $timeout(function(){ + + $scope.loadingData = false; + }); + + }); + + $scope.initializeOrRefreshOverviewTable = function(){ + $scope.loadingData = true; + + kommonitorDataGridHelperService.buildDataGrid_georesources(kommonitorDataExchangeService.availableGeoresources); + + $timeout(function(){ + + $scope.loadingData = false; + }); + }; + + $scope.$on("refreshGeoresourceOverviewTable", function (event, crudType, targetGeoresourceId) { + $scope.loadingData = true; + $scope.refreshGeoresourceOverviewTable(crudType, targetGeoresourceId); + }); + + + $scope.refreshGeoresourceOverviewTable = function(crudType, targetGeoresourceId){ + + if(! crudType || !targetGeoresourceId){ + // refetch all metadata from spatial units to update table + kommonitorDataExchangeService.fetchGeoresourcesMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(response) { + + $scope.initializeOrRefreshOverviewTable(); + $rootScope.$broadcast("refreshGeoresourceOverviewTableCompleted"); + + $timeout(function(){ + + $scope.loadingData = false; + }); + + }, function errorCallback(response) { + + $timeout(function(){ + + $scope.loadingData = false; + }); + $rootScope.$broadcast("refreshGeoresourceOverviewTableCompleted"); + }); + } + else if(crudType && targetGeoresourceId){ + if(crudType == "add"){ + kommonitorCacheHelperService.fetchSingleGeoresourceMetadata(targetGeoresourceId, kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(data) { + + kommonitorDataExchangeService.addSingleGeoresourceMetadata(data); + + $scope.initializeOrRefreshOverviewTable(); + $rootScope.$broadcast("refreshGeoresourceOverviewTableCompleted"); + + $timeout(function(){ + + $scope.loadingData = false; + }); + + }, function errorCallback(response) { + + $timeout(function(){ + + $scope.loadingData = false; + }); + $rootScope.$broadcast("refreshGeoresourceOverviewTableCompleted"); + }); + } + else if(crudType == "edit"){ + kommonitorCacheHelperService.fetchSingleGeoresourceMetadata(targetGeoresourceId, kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(data) { + + kommonitorDataExchangeService.replaceSingleGeoresourceMetadata(data); + + $scope.initializeOrRefreshOverviewTable(); + $rootScope.$broadcast("refreshGeoresourceOverviewTableCompleted"); + + $timeout(function(){ + + $scope.loadingData = false; + }); + + }, function errorCallback(response) { + + $timeout(function(){ + + $scope.loadingData = false; + }); + $rootScope.$broadcast("refreshGeoresourceOverviewTableCompleted"); + }); + } + else if(crudType == "delete"){ + // targetGeoresourceId might be array in this case + if(targetGeoresourceId && typeof targetGeoresourceId == "string"){ + kommonitorDataExchangeService.deleteSingleGeoresourceMetadata(targetGeoresourceId); + + $scope.initializeOrRefreshOverviewTable(); + $rootScope.$broadcast("refreshGeoresourceOverviewTableCompleted"); + + $timeout(function(){ + + $scope.loadingData = false; + }); + } + + else if (targetGeoresourceId && Array.isArray(targetGeoresourceId)){ + for (const id of targetGeoresourceId) { + kommonitorDataExchangeService.deleteSingleGeoresourceMetadata(id); + } + $scope.initializeOrRefreshOverviewTable(); + $rootScope.$broadcast("refreshGeoresourceOverviewTableCompleted"); + + $timeout(function(){ + + $scope.loadingData = false; + }); + } + + } + } + + }; + + $scope.onClickDeleteDatasets = function(){ + $scope.loadingData = true; + + var markedEntriesForDeletion = kommonitorDataGridHelperService.getSelectedGeoresourcesMetadata(); + + // submit selected spatial units to modal controller + $rootScope.$broadcast("onDeleteGeoresources", markedEntriesForDeletion); + + $timeout(function(){ + + $scope.loadingData = false; + }); + }; + + $scope.onClickEditMetadata = function(georesourceDataset){ + // submit selected spatial unit to modal controller + $rootScope.$broadcast("onEditGeoresourceMetadata", georesourceDataset); + }; + + $scope.onClickEditFeatures = function(georesourceDataset){ + // submit selected spatial unit to modal controller + $rootScope.$broadcast("onEditGeoresourceFeatures", georesourceDataset); + }; + + } +]}); diff --git a/app/components/kommonitorAdmin/adminGeoresourcesManagement/admin-georesources-management.module.js b/app/components/kommonitorAdmin/adminGeoresourcesManagement/admin-georesources-management.module.js index 7dfd2df34..8df3032bd 100644 --- a/app/components/kommonitorAdmin/adminGeoresourcesManagement/admin-georesources-management.module.js +++ b/app/components/kommonitorAdmin/adminGeoresourcesManagement/admin-georesources-management.module.js @@ -1 +1,3 @@ -angular.module('adminGeoresourcesManagement', ['kommonitorDataExchange', 'kommonitorCacheHelper','kommonitorDataGridHelper']); +"use strict"; +angular.module('adminGeoresourcesManagement', ['kommonitorDataExchange', 'kommonitorCacheHelper', 'kommonitorDataGridHelper']); +//# sourceMappingURL=admin-georesources-management.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminGeoresourcesManagement/admin-georesources-management.module.js.map b/app/components/kommonitorAdmin/adminGeoresourcesManagement/admin-georesources-management.module.js.map new file mode 100644 index 000000000..128d7d5b9 --- /dev/null +++ b/app/components/kommonitorAdmin/adminGeoresourcesManagement/admin-georesources-management.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"admin-georesources-management.module.js","sourceRoot":"","sources":["admin-georesources-management.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,6BAA6B,EAAE,CAAC,wBAAwB,EAAE,uBAAuB,EAAC,0BAA0B,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminGeoresourcesManagement/admin-georesources-management.module.ts b/app/components/kommonitorAdmin/adminGeoresourcesManagement/admin-georesources-management.module.ts new file mode 100644 index 000000000..7dfd2df34 --- /dev/null +++ b/app/components/kommonitorAdmin/adminGeoresourcesManagement/admin-georesources-management.module.ts @@ -0,0 +1 @@ +angular.module('adminGeoresourcesManagement', ['kommonitorDataExchange', 'kommonitorCacheHelper','kommonitorDataGridHelper']); diff --git a/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceAddModal/georesource-add-modal.component.js b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceAddModal/georesource-add-modal.component.js index 2fbe041b2..10a752e58 100644 --- a/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceAddModal/georesource-add-modal.component.js +++ b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceAddModal/georesource-add-modal.component.js @@ -1,1125 +1,905 @@ +"use strict"; angular.module('georesourceAddModal').component('georesourceAddModal', { - templateUrl : "components/kommonitorAdmin/adminGeoresourcesManagement/georesourceAddModal/georesource-add-modal.template.html", - controller : ['kommonitorDataExchangeService', 'kommonitorImporterHelperService', '$scope', '$rootScope', '$http', '$timeout', - '__env', 'kommonitorMultiStepFormHelperService', 'kommonitorDataGridHelperService', - function GeoresourceAddModalAddModalController(kommonitorDataExchangeService, kommonitorImporterHelperService, $scope, $rootScope, - $http, $timeout, __env, kommonitorMultiStepFormHelperService, kommonitorDataGridHelperService) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorImporterHelperServiceInstance = kommonitorImporterHelperService; - - /* POST BODY - { - "isLOI": false, - "metadata": { - "note": "note", - "literature": "literature", - "updateInterval": "ARBITRARY", - "sridEPSG": 0.8008281904610115, - "datasource": "datasource", - "contact": "contact", - "lastUpdate": "2000-01-23", - "description": "description", - "databasis": "databasis" - }, - "allowedRoles": [ - "allowedRoles", - "allowedRoles" - ], - "datasetName": "datasetName", - "poiSymbolBootstrap3Name": "poiSymbolBootstrap3Name", - "poiSymbolColor": "white", - "isAOI": false, - "loiDashArrayString": "loiDashArrayString", - "geoJsonString": "geoJsonString", - "topicReference": "topicReference", - "poiMarkerColor": "white", - "jsonSchema": "jsonSchema", - "periodOfValidity": { - "endDate": "2000-01-23", - "startDate": "2000-01-23" - }, - "isPOI": false, - "loiColor": "loiColor", - "loiWidth": "loiWidth", - "aoiColor": "aoiColor" - } - */ - - //Date picker - $('#georesourceAddDatepickerStart').datepicker(kommonitorDataExchangeService.datePickerOptions); - $('#georesourceAddDatepickerEnd').datepicker(kommonitorDataExchangeService.datePickerOptions); - $('#georesourceAddLastUpdateDatepicker').datepicker(kommonitorDataExchangeService.datePickerOptions); - - $scope.georesourceMetadataStructure = { - "metadata": { - "note": "an optional note", - "literature": "optional text about literature", - "updateInterval": "YEARLY|HALF_YEARLY|QUARTERLY|MONTHLY|ARBITRARY", - "sridEPSG": 4326, - "datasource": "text about data source", - "contact": "text about contact details", - "lastUpdate": "YYYY-MM-DD", - "description": "description about spatial unit dataset", - "databasis": "text about data basis", - }, - "allowedRoles": ['roleId'], - "datasetName": "Name of georesource dataset", - "isPOI": "boolean parameter for point of interest dataset - only one of isPOI, isLOI, isAOI can be true", - "isLOI": "boolean parameter for lines of interest dataset - only one of isPOI, isLOI, isAOI can be true", - "isAOI": "boolean parameter for area of interest dataset - only one of isPOI, isLOI, isAOI can be true", - "poiSymbolBootstrap3Name": "glyphicon name of bootstrap 3 symbol to use for a POI resource", - "poiSymbolColor": "'white'|'red'|'orange'|'beige'|'green'|'blue'|'purple'|'pink'|'gray'|'black'", - "loiDashArrayString": "dash array string value - e.g. 20 20", - "poiMarkerColor": "'white'|'red'|'orange'|'beige'|'green'|'blue'|'purple'|'pink'|'gray'|'black'", - "loiColor": "color for lines of interest dataset", - "loiWidth": "width for lines of interest dataset", - "aoiColor": "color for area of interest dataset" - }; - - $scope.georesourceMetadataStructure_pretty = kommonitorDataExchangeService.syntaxHighlightJSON($scope.georesourceMetadataStructure); - $scope.georesourceMappingConfigStructure_pretty = kommonitorDataExchangeService.syntaxHighlightJSON(kommonitorImporterHelperService.mappingConfigStructure); - - - $scope.metadataImportSettings; - $scope.georesourceMetadataImportError; - $scope.georesourceMetadataImportErrorAlert; - $scope.georesourceMappingConfigImportError; - - $scope.datasetName = undefined; - $scope.datasetNameInvalid = false; - - $scope.metadata = {}; - $scope.metadata.note = undefined; - $scope.metadata.literature = undefined; - $scope.metadata.updateInterval = undefined; - $scope.metadata.sridEPSG = undefined; - $scope.metadata.datasource = undefined; - $scope.metadata.databasis = undefined; - $scope.metadata.contact = undefined; - $scope.metadata.lastUpdate = undefined; - $scope.metadata.description = undefined; - - $scope.roleManagementTableOptions = undefined; - - $scope.$on("availableRolesUpdate", function (event) { - refreshRoles(); - }); - - // make sure that initial fetching of availableRoles has happened - $scope.$on("initialMetadataLoadingCompleted", function (event) { - refreshRoles(); - }); - - function refreshRoles() { - $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('georesourceAddRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, kommonitorDataExchangeService.getCurrentKomMonitorLoginRoleIds()); - } - - $scope.georesourceTopic_mainTopic = undefined; - $scope.georesourceTopic_subTopic = undefined; - $scope.georesourceTopic_subsubTopic = undefined; - $scope.georesourceTopic_subsubsubTopic = undefined; - - $scope.georesourceType = "poi"; - $scope.isPOI = true; - $scope.isLOI = false; - $scope.isAOI = false; - $scope.selectedPoiMarkerColor = kommonitorDataExchangeService.availablePoiMarkerColors[0]; - $scope.selectedPoiSymbolColor = kommonitorDataExchangeService.availablePoiMarkerColors[1]; - $scope.selectedLoiDashArrayObject = kommonitorDataExchangeService.availableLoiDashArrayObjects[0]; - $scope.loiColor = "#bf3d2c"; - $scope.loiWidth = 3; - $scope.aoiColor = "#bf3d2c"; - $scope.selectedPoiIconName = "home"; - - $scope.periodOfValidity = {}; - $scope.periodOfValidity.startDate = undefined; - $scope.periodOfValidity.endDate = undefined; - $scope.periodOfValidityInvalid = false; - - $scope.geoJsonString = undefined; - $scope.georesource_asGeoJson = undefined; - - $scope.georesourceDataSourceInputInvalidReason = undefined; - $scope.georesourceDataSourceInputInvalid = false; - - $scope.georesourceDataSourceIdProperty = undefined; - $scope.georesourceDataSourceNameProperty = undefined; - - $scope.converter = undefined; - $scope.schema = undefined; - $scope.mimeType = undefined; - $scope.datasourceType = undefined; - $scope.georesourceDataSourceIdProperty = undefined; - $scope.georesourceDataSourceNameProperty = undefined; - - $scope.converterDefinition = undefined; - $scope.datasourceTypeDefinition = undefined; - $scope.propertyMappingDefinition = undefined; - $scope.postBody_georesources = undefined; - - $scope.validityEndDate_perFeature = undefined; - $scope.validityStartDate_perFeature = undefined; - - $scope.attributeMapping_sourceAttributeName = undefined; - $scope.attributeMapping_destinationAttributeName = undefined; - $scope.attributeMapping_data = undefined; - $scope.attributeMapping_attributeType = kommonitorImporterHelperService.attributeMapping_attributeTypes[0]; - $scope.attributeMappings_adminView = []; - $scope.keepAttributes = true; - $scope.keepMissingValues = true; - - $scope.successMessagePart = undefined; - $scope.errorMessagePart = undefined; - $scope.importerErrors = undefined; - - $scope.iconPickerOptions = { - align: 'center', // Only in div tag - arrowClass: 'btn-default', - arrowPrevIconClass: 'fas fa-angle-left', - arrowNextIconClass: 'fas fa-angle-right', - cols: 10, - footer: true, - header: true, - icon: 'glyphicon-' + $scope.selectedPoiIconName, - iconset: 'glyphicon', - labelHeader: '{0} von {1} Seiten', - labelFooter: '{0} - {1} von {2} Icons', - placement: 'bottom', // Only in button tag - rows: 6, - search: true, - searchText: 'Stichwortsuche (Bootstrap Glyphicons)', - selectedClass: 'btn-success', - unselectedClass: '' - }; - - $('#poiSymbolPicker').iconpicker($scope.iconPickerOptions); - - $('#poiSymbolPicker').on('change', function(e) { - console.log(e.icon); - // split up due to current data management request structure where we expect only the last name of Bootstrap 3.3.7 glyphicon name - // i.e. "home" for "glyphicon-home" - $scope.selectedPoiIconName = e.icon.substring(e.icon.indexOf('-')+1); - console.log($scope.selectedPoiIconName); - }); - - $scope.loadingData = false; - - // initialize loiDashArray dropdown - setTimeout(function(){ - for(var i=0; i { - $scope.$digest(); - }, 250); - }; - - $scope.onChangeConverter = function(){ - $scope.schema = $scope.converter.schemas ? $scope.converter.schemas[0] : undefined; - $scope.mimeType = $scope.converter.mimeTypes[0]; - }; - - $scope.onChangeMimeType = function(mimeType){ - $scope.mimeType = mimeType; - }; - - $scope.onChangeGeoresourceType = function(){ - - switch ($scope.georesourceType) { - case "poi": - $scope.isPOI = true; - $scope.isLOI = false; - $scope.isAOI = false; - break; - case "loi": - $scope.isPOI = false; - $scope.isLOI = true; - $scope.isAOI = false; - break; - case "aoi": - $scope.isPOI = false; - $scope.isLOI = false; - $scope.isAOI = true; - break; - default: - $scope.isPOI = true; - $scope.isLOI = false; - $scope.isAOI = false; - break; - } - }; - - $scope.checkDatasetName = function(){ - $scope.datasetNameInvalid = false; - kommonitorDataExchangeService.availableGeoresources.forEach(function(georesource){ - if (georesource.datasetName === $scope.datasetName){ - $scope.datasetNameInvalid = true; - return; - } - }); - }; - - $scope.checkPeriodOfValidity = function(){ - $scope.periodOfValidityInvalid = false; - if ($scope.periodOfValidity.startDate && $scope.periodOfValidity.endDate){ - var startDate = new Date($scope.periodOfValidity.startDate); - var endDate = new Date($scope.periodOfValidity.endDate); - - if ((startDate === endDate) || startDate > endDate){ - // failure - $scope.periodOfValidityInvalid = true; - } - } - }; - - $scope.onAddOrUpdateAttributeMapping = function(){ - var tmpAttributeMapping_adminView = { - "sourceName": $scope.attributeMapping_sourceAttributeName, - "destinationName": $scope.attributeMapping_destinationAttributeName, - "dataType": $scope.attributeMapping_attributeType - }; - - var processed = false; - - for (let index = 0; index < $scope.attributeMappings_adminView.length; index++) { - var attributeMappingEntry_adminView = $scope.attributeMappings_adminView[index]; - - if (attributeMappingEntry_adminView.sourceName === tmpAttributeMapping_adminView.sourceName){ - // replace object - $scope.attributeMappings_adminView[index] = tmpAttributeMapping_adminView; - processed = true; - break; - } - } - - if(! processed){ - // new entry - $scope.attributeMappings_adminView.push(tmpAttributeMapping_adminView); - } - - $scope.attributeMapping_sourceAttributeName = undefined; - $scope.attributeMapping_destinationAttributeName = undefined; - $scope.attributeMapping_attributeType = kommonitorImporterHelperService.attributeMapping_attributeTypes[0]; - - setTimeout(() => { - $scope.$digest(); - }, 250); - }; - - $scope.onClickEditAttributeMapping = function(attributeMappingEntry){ - $scope.attributeMapping_sourceAttributeName = attributeMappingEntry.sourceName; - $scope.attributeMapping_destinationAttributeName = attributeMappingEntry.destinationName; - $scope.attributeMapping_attributeType = attributeMappingEntry.dataType; - - setTimeout(() => { - $scope.$digest(); - }, 250); - }; - - $scope.onClickDeleteAttributeMapping = function(attributeMappingEntry){ - for (let index = 0; index < $scope.attributeMappings_adminView.length; index++) { - - if ($scope.attributeMappings_adminView[index].sourceName === attributeMappingEntry.sourceName){ - // remove object - $scope.attributeMappings_adminView.splice(index, 1); - break; - } - } - - setTimeout(() => { - $scope.$digest(); - }, 250); - }; - - $scope.buildImporterObjects = async function(){ - $scope.converterDefinition = $scope.buildConverterDefinition(); - $scope.datasourceTypeDefinition = await $scope.buildDatasourceTypeDefinition(); - $scope.propertyMappingDefinition = $scope.buildPropertyMappingDefinition(); - $scope.postBody_georesources = $scope.buildPostBody_georesources(); - - if(!$scope.converterDefinition || !$scope.datasourceTypeDefinition || !$scope.propertyMappingDefinition || !$scope.postBody_georesources){ - return false; - } - - return true; - }; - - $scope.buildConverterDefinition = function(){ - - return kommonitorImporterHelperService.buildConverterDefinition($scope.converter, "converterParameter_georesourceAdd_", $scope.schema, $scope.mimeType); - }; - - $scope.buildDatasourceTypeDefinition = async function(){ - try { - return await kommonitorImporterHelperService.buildDatasourceTypeDefinition($scope.datasourceType, 'datasourceTypeParameter_georesourceAdd_', 'georesourceDataSourceInput_add'); - } catch (error) { - if(error.data){ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else{ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - - $("#georesourceAddErrorAlert").show(); - $scope.loadingData = false; - return null; - } - }; - - $scope.buildPropertyMappingDefinition = function(){ - // arsion from is undefined currently - return kommonitorImporterHelperService.buildPropertyMapping_spatialResource($scope.georesourceDataSourceNameProperty, $scope.georesourceDataSourceIdProperty, $scope.validityStartDate_perFeature, $scope.validityEndDate_perFeature, undefined, $scope.keepAttributes, $scope.keepMissingValues, $scope.attributeMappings_adminView); - }; - - $scope.buildPostBody_georesources = function(){ - var postBody = - { - "geoJsonString": $scope.geoJsonString, - "allowedRoles": [], - "metadata": { - "note": $scope.metadata.note, - "literature": $scope.metadata.literature, - "updateInterval": $scope.metadata.updateInterval.apiName, - "sridEPSG": $scope.metadata.sridEPSG || 4326, - "datasource": $scope.metadata.datasource, - "contact": $scope.metadata.contact, - "lastUpdate": $scope.metadata.lastUpdate, - "description": $scope.metadata.description, - "databasis": $scope.metadata.databasis - }, - "jsonSchema": null, - "datasetName": $scope.datasetName, - "periodOfValidity": { - "endDate": $scope.periodOfValidity.endDate, - "startDate": $scope.periodOfValidity.startDate - }, - "isAOI": $scope.isAOI, - "isLOI": $scope.isLOI, - "isPOI": $scope.isPOI, - "topicReference": null - }; - - let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); - for (const roleId of roleIds) { - postBody.allowedRoles.push(roleId); - } - - if($scope.isPOI){ - postBody["poiSymbolBootstrap3Name"] = $scope.selectedPoiIconName; - postBody["poiSymbolColor"] = $scope.selectedPoiSymbolColor.colorName; - postBody["poiMarkerColor"] = $scope.selectedPoiMarkerColor.colorName; - - postBody["loiDashArrayString"] = null; - postBody["loiColor"] = null; - postBody["loiWidth"] = 3; - - postBody["aoiColor"] = null; - } - else if($scope.isLOI){ - postBody["poiSymbolBootstrap3Name"] = null; - postBody["poiSymbolColor"] = null; - postBody["poiMarkerColor"] = null; - - postBody["loiDashArrayString"] = $scope.selectedLoiDashArrayObject.dashArrayValue; - postBody["loiColor"] = $scope.loiColor; - postBody["loiWidth"] = $scope.loiWidth; - - postBody["aoiColor"] = null; - } - else if($scope.isAOI){ - postBody["poiSymbolBootstrap3Name"] = null; - postBody["poiSymbolColor"] = null; - postBody["poiMarkerColor"] = null; - - postBody["loiDashArrayString"] = null; - postBody["loiColor"] = null; - postBody["loiWidth"] = 3; - - postBody["aoiColor"] = $scope.aoiColor; - } - - // TOPIC REFERENCE - if($scope.georesourceTopic_subsubsubTopic){ - postBody.topicReference = $scope.georesourceTopic_subsubsubTopic.topicId; - } - else if($scope.georesourceTopic_subsubTopic){ - postBody.topicReference = $scope.georesourceTopic_subsubTopic.topicId; - } - else if($scope.georesourceTopic_subTopic){ - postBody.topicReference = $scope.georesourceTopic_subTopic.topicId; - } - else if($scope.georesourceTopic_mainTopic){ - postBody.topicReference = $scope.georesourceTopic_mainTopic.topicId; - } - else { - postBody.topicReference = ""; - } - - return postBody; - }; - - $scope.addGeoresource = async function(){ - - $timeout(function(){ - $scope.loadingData = true; - }); - - $scope.importerErrors = undefined; - $scope.successMessagePart = undefined; - $scope.errorMessagePart = undefined; - - /* - now collect data and build request for importer - */ - - /* - if any required importer data is missing --> cancel request and highlight required errors - */ - var allDataSpecified = await $scope.buildImporterObjects(); - - if (!allDataSpecified) { - - $("#georesourceAddForm").validator("update"); - $("#georesourceAddForm").validator("validate"); - return; - } - else { - - - // TODO verify input - - // TODO Create and perform POST Request with loading screen - - var newGeoresourceResponse_dryRun = undefined; - try { - newGeoresourceResponse_dryRun = await kommonitorImporterHelperService.registerNewGeoresource($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.postBody_georesources, true); - - - if(! kommonitorImporterHelperService.importerResponseContainsErrors(newGeoresourceResponse_dryRun)){ - // all good, really execute the request to import data against data management API - var newGeoresourceResponse = await kommonitorImporterHelperService.registerNewGeoresource($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.postBody_georesources, false); - - $rootScope.$broadcast("refreshGeoresourceOverviewTable", "add", kommonitorImporterHelperService.getIdFromImporterResponse(newGeoresourceResponse)); - - // refresh all admin dashboard diagrams due to modified metadata - $timeout(function(){ - $rootScope.$broadcast("refreshAdminDashboardDiagrams"); - }, 500); - - - $scope.successMessagePart = $scope.postBody_georesources.datasetName; - $scope.importedFeatures = kommonitorImporterHelperService.getImportedFeaturesFromImporterResponse(newGeoresourceResponse); - - $("#georesourceAddSuccessAlert").show(); - - $scope.loadingData = false; - } - else{ - // errors ocurred - // show them - $scope.errorMessagePart = "Einige der zu importierenden Features des Datensatzes weisen kritische Fehler auf"; - $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(newGeoresourceResponse_dryRun); - - $("#georesourceAddErrorAlert").show(); - $scope.loadingData = false; - - setTimeout(() => { - $scope.$digest(); - }, 250); - - } - } catch (error) { - if(error.data){ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else{ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - - if(newGeoresourceResponse_dryRun){ - $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(newGeoresourceResponse_dryRun); - } - - $("#georesourceAddErrorAlert").show(); - $scope.loadingData = false; - - setTimeout(() => { - $scope.$digest(); - }, 250); - } - } - - }; - - $scope.onImportGeoresourceAddMetadata = function(){ - - $scope.georesourceMetadataImportError = ""; - - $("#georesourceMetadataImportFile").files = []; - - // trigger file chooser - $("#georesourceMetadataImportFile").click(); - - }; - - $(document).on("change", "#georesourceMetadataImportFile" ,function(){ - - console.log("Importing Georesource metadata for Add Georesource Form"); - - // get the file - var file = document.getElementById('georesourceMetadataImportFile').files[0]; - $scope.parseMetadataFromFile(file); - }); - - $scope.parseMetadataFromFile = function(file){ - var fileReader = new FileReader(); - - fileReader.onload = function(event) { - - try{ - $scope.parseFromMetadataFile(event); - } - catch(error){ - console.error(error); - console.error("Uploaded Metadata File cannot be parsed."); - $scope.georesourceMetadataImportError = "Uploaded Metadata File cannot be parsed correctly"; - document.getElementById("georesourcesAddMetadataPre").innerHTML = $scope.georesourceMetadataStructure_pretty; - $("#georesourceMetadataImportErrorAlert").show(); - - $scope.$digest(); - } - - }; - - // Read in the image file as a data URL. - fileReader.readAsText(file); - }; - - $scope.parseFromMetadataFile = function(event){ - // $scope.geoJsonString = event.target.result; - $scope.metadataImportSettings = JSON.parse(event.target.result); - - if(! $scope.metadataImportSettings.metadata){ - console.error("uploaded Metadata File cannot be parsed - wrong structure."); - $scope.georesourceMetadataImportError = "Struktur der Datei stimmt nicht mit erwartetem Muster überein."; - document.getElementById("georesourcesAddMetadataPre").innerHTML = $scope.georesourceMetadataStructure_pretty; - $("#georesourceMetadataImportErrorAlert").show(); - - $scope.$digest(); - } - - $scope.metadata = {}; - $scope.metadata.note = $scope.metadataImportSettings.metadata.note; - $scope.metadata.literature = $scope.metadataImportSettings.metadata.literature; - kommonitorDataExchangeService.updateIntervalOptions.forEach(function(option){ - if(option.apiName === $scope.metadataImportSettings.metadata.updateInterval){ - $scope.metadata.updateInterval = option; - } - }); - $scope.metadata.sridEPSG = $scope.metadataImportSettings.metadata.sridEPSG; - $scope.metadata.datasource = $scope.metadataImportSettings.metadata.datasource; - $scope.metadata.contact = $scope.metadataImportSettings.metadata.contact; - $scope.metadata.lastUpdate = $scope.metadataImportSettings.metadata.lastUpdate; - // initialize date - $('#georesourceAddLastUpdateDatepicker').datepicker('setDate', $scope.metadata.lastUpdate); - - $scope.metadata.description = $scope.metadataImportSettings.metadata.description; - $scope.metadata.databasis = $scope.metadataImportSettings.metadata.databasis; - - $scope.datasetName = $scope.metadataImportSettings.datasetName; - - $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('georesourceAddRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, $scope.metadataImportSettings.allowedRoles); - - // georesource specific properties - - $scope.isPOI = $scope.metadataImportSettings.isPOI; - $scope.isLOI = $scope.metadataImportSettings.isLOI; - $scope.isAOI = $scope.metadataImportSettings.isAOI; - if($scope.metadataImportSettings.isPOI){ - $scope.georesourceType = "poi"; - } - else if($scope.metadataImportSettings.isLOI){ - $scope.georesourceType = "loi"; - } - else{ - $scope.georesourceType = "aoi"; - } - kommonitorDataExchangeService.availablePoiMarkerColors.forEach(function(option){ - if(option.colorName === $scope.metadataImportSettings.poiMarkerColor){ - $scope.selectedPoiMarkerColor = option; - } - if(option.colorName === $scope.metadataImportSettings.poiSymbolColor){ - $scope.selectedPoiSymbolColor = option; - } - }); - kommonitorDataExchangeService.availableLoiDashArrayObjects.forEach(function(option){ - if(option.dashArrayValue === $scope.metadataImportSettings.loiDashArrayString){ - $scope.selectedLoiDashArrayObject = option; - $scope.onChangeLoiDashArray($scope.selectedLoiDashArrayObject); - } - }); - $scope.loiColor = $scope.metadataImportSettings.loiColor; - $scope.loiWidth = $scope.metadataImportSettings.loiWidth; - $scope.aoiColor = $scope.metadataImportSettings.aoiColor; - $scope.selectedPoiIconName = $scope.metadataImportSettings.poiSymbolBootstrap3Name; - - var topicHierarchy = kommonitorDataExchangeService.getTopicHierarchyForTopicId($scope.metadataImportSettings.topicReference); - - if(topicHierarchy && topicHierarchy[0]){ - $scope.georesourceTopic_mainTopic = topicHierarchy[0]; - } - if(topicHierarchy && topicHierarchy[1]){ - $scope.georesourceTopic_subTopic = topicHierarchy[1]; - } - if(topicHierarchy && topicHierarchy[2]){ - $scope.georesourceTopic_subsubTopic = topicHierarchy[2]; - } - if(topicHierarchy && topicHierarchy[3]){ - $scope.georesourceTopic_subsubsubTopic = topicHierarchy[3]; - } - - setTimeout(function(){ - $("#poiSymbolPicker").val("").iconpicker('setIcon', 'glyphicon-' + $scope.metadataImportSettings.poiSymbolBootstrap3Name); - // $("#poiSymbolPicker i").css('glyphicon glyphicon-' + $scope.metadataImportSettings.poiSymbolBootstrap3Name); - // $("#poiSymbolPicker input").css('glyphicon-' + $scope.metadataImportSettings.poiSymbolBootstrap3Name); - }, 200); - - $scope.$digest(); - } - - $scope.onExportGeoresourceAddMetadataTemplate = function(){ - - var metadataJSON = JSON.stringify($scope.georesourceMetadataStructure); - - var fileName = "Georessource_Metadaten_Vorlage_Export.json"; - - var blob = new Blob([metadataJSON], {type: "application/json"}); - var data = URL.createObjectURL(blob); - - var a = document.createElement('a'); - a.download = fileName; - a.href = data; - a.textContent = "JSON"; - a.target = "_blank"; - a.rel = "noopener noreferrer"; - a.click(); - - a.remove(); - }; - - $scope.onExportGeoresourceAddMetadata = function(){ - var metadataExport = $scope.georesourceMetadataStructure; - - metadataExport.metadata.note = $scope.metadata.note || ""; - metadataExport.metadata.literature = $scope.metadata.literature || ""; - metadataExport.metadata.sridEPSG = $scope.metadata.sridEPSG || ""; - metadataExport.metadata.datasource = $scope.metadata.datasource || ""; - metadataExport.metadata.contact = $scope.metadata.contact || ""; - metadataExport.metadata.lastUpdate = $scope.metadata.lastUpdate || ""; - metadataExport.metadata.description = $scope.metadata.description || ""; - metadataExport.metadata.databasis = $scope.metadata.databasis || ""; - metadataExport.datasetName = $scope.datasetName || ""; - - metadataExport.allowedRoles = []; - - let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); - for (const roleId of roleIds) { - metadataExport.allowedRoles.push(roleId); - } - - if($scope.metadata.updateInterval){ - metadataExport.metadata.updateInterval = $scope.metadata.updateInterval.apiName; - } - - var name = $scope.datasetName; - - // georesource specific properties - metadataExport.isPOI = $scope.isPOI; - metadataExport.isLOI = $scope.isLOI; - metadataExport.isAOI = $scope.isAOI; - - if($scope.isPOI){ - metadataExport["poiSymbolBootstrap3Name"] = $scope.selectedPoiIconName; - metadataExport["poiSymbolColor"] = $scope.selectedPoiSymbolColor.colorName; - metadataExport["poiMarkerColor"] = $scope.selectedPoiMarkerColor.colorName; - - metadataExport["loiDashArrayString"] = ""; - metadataExport["loiColor"] = ""; - metadataExport["loiWidth"] = ""; - - metadataExport["aoiColor"] = ""; - } - else if($scope.isLOI){ - metadataExport["poiSymbolBootstrap3Name"] = ""; - metadataExport["poiSymbolColor"] = ""; - metadataExport["poiMarkerColor"] = ""; - - metadataExport["loiDashArrayString"] = $scope.selectedLoiDashArrayObject.dashArrayValue; - metadataExport["loiColor"] = $scope.loiColor; - metadataExport["loiWidth"] = $scope.loiWidth; - - - metadataExport["aoiColor"] = ""; - } - else if($scope.isAOI){ - metadataExport["poiSymbolBootstrap3Name"] = ""; - metadataExport["poiSymbolColor"] = ""; - metadataExport["poiMarkerColor"] = ""; - - metadataExport["loiDashArrayString"] = ""; - metadataExport["loiColor"] = ""; - metadataExport["loiWidth"] = ""; - - metadataExport["aoiColor"] = $scope.aoiColor; - } - - if($scope.georesourceTopic_subsubsubTopic){ - metadataExport.topicReference = $scope.georesourceTopic_subsubsubTopic.topicId; - } - else if($scope.georesourceTopic_subsubTopic){ - metadataExport.topicReference = $scope.georesourceTopic_subsubTopic.topicId; - } - else if($scope.georesourceTopic_subTopic){ - metadataExport.topicReference = $scope.georesourceTopic_subTopic.topicId; - } - else if($scope.georesourceTopic_mainTopic){ - metadataExport.topicReference = $scope.georesourceTopic_mainTopic.topicId; - } - else { - metadataExport.topicReference = ""; - } - - - var metadataJSON = JSON.stringify(metadataExport); - - var fileName = "Georessource_Metadaten_Export"; - - if (name){ - fileName += "-" + name; - } - - fileName += ".json"; - - var blob = new Blob([metadataJSON], {type: "application/json"}); - var data = URL.createObjectURL(blob); - - var a = document.createElement('a'); - a.download = fileName; - a.href = data; - a.textContent = "JSON"; - a.target = "_blank"; - a.rel = "noopener noreferrer"; - a.click(); - - a.remove(); - }; - - $scope.onChangeMarkerColor = function(markerColor){ - $scope.selectedPoiMarkerColor = markerColor; - }; - - $scope.onChangeSymbolColor = function(symbolColor){ - $scope.selectedPoiSymbolColor = symbolColor; - }; - - $scope.onChangeLoiDashArray = function(loiDashArrayObject){ - $scope.selectedLoiDashArrayObject = loiDashArrayObject; - - $("#loiDashArrayDropdownButton_addGeoresource").html(loiDashArrayObject.svgString); - }; - - $scope.onImportGeoresourceAddMappingConfig = function(){ - - $scope.georesourceMappingConfigImportError = ""; - - $("#georesourceMappingConfigAddImportFile").files = []; - - // trigger file chooser - $("#georesourceMappingConfigAddImportFile").click(); - - }; - - $(document).on("change", "#georesourceMappingConfigAddImportFile" ,function(){ - - console.log("Importing Importer Mapping Config for Add Georesource Form"); - - // get the file - var file = document.getElementById('georesourceMappingConfigAddImportFile').files[0]; - $scope.parseMappingConfigFromFile(file); - }); - - $scope.parseMappingConfigFromFile = function(file){ - var fileReader = new FileReader(); - - fileReader.onload = function(event) { - - try{ - $scope.parseFromMappingConfigFile(event); - } - catch(error){ - console.error(error); - console.error("Uploaded MappingConfig File cannot be parsed."); - $scope.georesourceMappingConfigImportError = "Uploaded MappingConfig File cannot be parsed correctly"; - document.getElementById("georesourcesAddMappingConfigPre").innerHTML = $scope.georesourceMappingConfigStructure_pretty; - $("#georesourceMappingConfigImportErrorAlert").show(); - - $scope.$digest(); - } - - }; - - // Read in the image file as a data URL. - fileReader.readAsText(file); - }; - - $scope.parseFromMappingConfigFile = function(event){ - $scope.mappingConfigImportSettings = JSON.parse(event.target.result); - - if(! $scope.mappingConfigImportSettings.converter || ! $scope.mappingConfigImportSettings.dataSource || ! $scope.mappingConfigImportSettings.propertyMapping){ - console.error("uploaded MappingConfig File cannot be parsed - wrong structure."); - $scope.georesourceMetadataImportError = "Struktur der Datei stimmt nicht mit erwartetem Muster überein."; - document.getElementById("georesourcesAddMappingConfigPre").innerHTML = $scope.georesourceMappingConfigStructure_pretty; - $("#georesourceMappingConfigImportErrorAlert").show(); - - $scope.$digest(); - } - - $scope.converter = undefined; - for(var converter of kommonitorImporterHelperService.availableConverters){ - if (converter.name === $scope.mappingConfigImportSettings.converter.name){ - $scope.converter = converter; - break; - } - } - - $scope.schema = undefined; - if ($scope.converter && $scope.converter.schemas && $scope.mappingConfigImportSettings.converter.schema){ - for (var schema of $scope.converter.schemas) { - if (schema === $scope.mappingConfigImportSettings.converter.schema){ - $scope.schema = schema; - } - } - } - - $scope.mimeType = undefined; - if ($scope.converter && $scope.converter.mimeTypes && $scope.mappingConfigImportSettings.converter.mimeType){ - for (var mimeType of $scope.converter.mimeTypes) { - if (mimeType === $scope.mappingConfigImportSettings.converter.mimeType){ - $scope.mimeType = mimeType; - } - } - } - - $scope.datasourceType = undefined; - for(var datasourceType of kommonitorImporterHelperService.availableDatasourceTypes){ - if (datasourceType.type === $scope.mappingConfigImportSettings.dataSource.type){ - $scope.datasourceType = datasourceType; - break; - } - } - - $scope.$digest(); - - // converter parameters - if ($scope.converter){ - for (var convParameter of $scope.mappingConfigImportSettings.converter.parameters) { - $("#converterParameter_georesourceAdd_" + convParameter.name).val(convParameter.value); - } - } - - // datasourceTypes parameters - if ($scope.datasourceType){ - for (var dsParameter of $scope.mappingConfigImportSettings.dataSource.parameters) { - $("#datasourceTypeParameter_georesourceAdd_" + dsParameter.name).val(dsParameter.value); - } - } - - // property Mapping - $scope.georesourceDataSourceNameProperty = $scope.mappingConfigImportSettings.propertyMapping.nameProperty; - $scope.georesourceDataSourceIdProperty = $scope.mappingConfigImportSettings.propertyMapping.identifierProperty; - $scope.validityStartDate_perFeature = $scope.mappingConfigImportSettings.propertyMapping.validStartDateProperty; - $scope.validityEndDate_perFeature = $scope.mappingConfigImportSettings.propertyMapping.validEndDateProperty; - $scope.keepAttributes = $scope.mappingConfigImportSettings.propertyMapping.keepAttributes; - $scope.keepMissingValues = $scope.mappingConfigImportSettings.propertyMapping.keepMissingOrNullValueAttributes; - $scope.attributeMappings_adminView = []; - - for (var attributeMapping of $scope.mappingConfigImportSettings.propertyMapping.attributes) { - var tmpEntry = { - "sourceName": attributeMapping.name, - "destinationName": attributeMapping.mappingName - }; - - for (const dataType of kommonitorImporterHelperService.attributeMapping_attributeTypes) { - if (dataType.apiName === attributeMapping.type){ - tmpEntry.dataType = dataType; - } - } - - $scope.attributeMappings_adminView.push(tmpEntry); - } - - if ($scope.mappingConfigImportSettings.periodOfValidity){ - $scope.periodOfValidity = {}; - $scope.periodOfValidity.startDate = $scope.mappingConfigImportSettings.periodOfValidity.startDate; - $scope.periodOfValidity.endDate = $scope.mappingConfigImportSettings.periodOfValidity.endDate; - $scope.periodOfValidityInvalid = false; - - // update datePickers - if ($scope.periodOfValidity.startDate){ - $("#georesourceAddDatepickerStart").datepicker('setDate', $scope.periodOfValidity.startDate); - } - if ($scope.periodOfValidity.endDate){ - $("#georesourceAddDatepickerEnd").datepicker('setDate', $scope.periodOfValidity.endDate); - } - } - - $scope.$digest(); - }; - - $scope.onExportGeoresourceAddMappingConfig = async function(){ - var converterDefinition = $scope.buildConverterDefinition(); - var datasourceTypeDefinition = await $scope.buildDatasourceTypeDefinition(); - var propertyMappingDefinition = $scope.buildPropertyMappingDefinition(); - - var mappingConfigExport = { - "converter": converterDefinition, - "dataSource": datasourceTypeDefinition, - "propertyMapping": propertyMappingDefinition, - }; - - mappingConfigExport.periodOfValidity = $scope.periodOfValidity; - - var name = $scope.datasetName; - - var metadataJSON = JSON.stringify(mappingConfigExport); - - var fileName = "KomMonitor-Import-Mapping-Konfiguration_Export"; - - if (name){ - fileName += "-" + name; - } - - fileName += ".json"; - - var blob = new Blob([metadataJSON], {type: "application/json"}); - var data = URL.createObjectURL(blob); - - var a = document.createElement('a'); - a.download = fileName; - a.href = data; - a.textContent = "JSON"; - a.target = "_blank"; - a.rel = "noopener noreferrer"; - a.click(); - - a.remove(); - }; - - - - $scope.hideSuccessAlert = function(){ - $("#georesourceAddSuccessAlert").hide(); - }; - - $scope.hideErrorAlert = function(){ - $("#georesourceAddErrorAlert").hide(); - }; - - $scope.hideMetadataErrorAlert = function(){ - $("#georesourceMetadataImportErrorAlert").hide(); - }; - - $scope.hideMappingConfigErrorAlert = function(){ - $("#georesourceMappingConfigImportErrorAlert").hide(); - }; - - kommonitorMultiStepFormHelperService.registerClickHandler(); - - } -]}); + templateUrl: "components/kommonitorAdmin/adminGeoresourcesManagement/georesourceAddModal/georesource-add-modal.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorImporterHelperService', '$scope', '$rootScope', '$http', '$timeout', + '__env', 'kommonitorMultiStepFormHelperService', 'kommonitorDataGridHelperService', + function GeoresourceAddModalAddModalController(kommonitorDataExchangeService, kommonitorImporterHelperService, $scope, $rootScope, $http, $timeout, __env, kommonitorMultiStepFormHelperService, kommonitorDataGridHelperService) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorImporterHelperServiceInstance = kommonitorImporterHelperService; + /* POST BODY + { + "isLOI": false, + "metadata": { + "note": "note", + "literature": "literature", + "updateInterval": "ARBITRARY", + "sridEPSG": 0.8008281904610115, + "datasource": "datasource", + "contact": "contact", + "lastUpdate": "2000-01-23", + "description": "description", + "databasis": "databasis" + }, + "allowedRoles": [ + "allowedRoles", + "allowedRoles" + ], + "datasetName": "datasetName", + "poiSymbolBootstrap3Name": "poiSymbolBootstrap3Name", + "poiSymbolColor": "white", + "isAOI": false, + "loiDashArrayString": "loiDashArrayString", + "geoJsonString": "geoJsonString", + "topicReference": "topicReference", + "poiMarkerColor": "white", + "jsonSchema": "jsonSchema", + "periodOfValidity": { + "endDate": "2000-01-23", + "startDate": "2000-01-23" + }, + "isPOI": false, + "loiColor": "loiColor", + "loiWidth": "loiWidth", + "aoiColor": "aoiColor" + } + */ + //Date picker + $('#georesourceAddDatepickerStart').datepicker(kommonitorDataExchangeService.datePickerOptions); + $('#georesourceAddDatepickerEnd').datepicker(kommonitorDataExchangeService.datePickerOptions); + $('#georesourceAddLastUpdateDatepicker').datepicker(kommonitorDataExchangeService.datePickerOptions); + $scope.georesourceMetadataStructure = { + "metadata": { + "note": "an optional note", + "literature": "optional text about literature", + "updateInterval": "YEARLY|HALF_YEARLY|QUARTERLY|MONTHLY|ARBITRARY", + "sridEPSG": 4326, + "datasource": "text about data source", + "contact": "text about contact details", + "lastUpdate": "YYYY-MM-DD", + "description": "description about spatial unit dataset", + "databasis": "text about data basis", + }, + "allowedRoles": ['roleId'], + "datasetName": "Name of georesource dataset", + "isPOI": "boolean parameter for point of interest dataset - only one of isPOI, isLOI, isAOI can be true", + "isLOI": "boolean parameter for lines of interest dataset - only one of isPOI, isLOI, isAOI can be true", + "isAOI": "boolean parameter for area of interest dataset - only one of isPOI, isLOI, isAOI can be true", + "poiSymbolBootstrap3Name": "glyphicon name of bootstrap 3 symbol to use for a POI resource", + "poiSymbolColor": "'white'|'red'|'orange'|'beige'|'green'|'blue'|'purple'|'pink'|'gray'|'black'", + "loiDashArrayString": "dash array string value - e.g. 20 20", + "poiMarkerColor": "'white'|'red'|'orange'|'beige'|'green'|'blue'|'purple'|'pink'|'gray'|'black'", + "loiColor": "color for lines of interest dataset", + "loiWidth": "width for lines of interest dataset", + "aoiColor": "color for area of interest dataset" + }; + $scope.georesourceMetadataStructure_pretty = kommonitorDataExchangeService.syntaxHighlightJSON($scope.georesourceMetadataStructure); + $scope.georesourceMappingConfigStructure_pretty = kommonitorDataExchangeService.syntaxHighlightJSON(kommonitorImporterHelperService.mappingConfigStructure); + $scope.metadataImportSettings; + $scope.georesourceMetadataImportError; + $scope.georesourceMetadataImportErrorAlert; + $scope.georesourceMappingConfigImportError; + $scope.datasetName = undefined; + $scope.datasetNameInvalid = false; + $scope.metadata = {}; + $scope.metadata.note = undefined; + $scope.metadata.literature = undefined; + $scope.metadata.updateInterval = undefined; + $scope.metadata.sridEPSG = undefined; + $scope.metadata.datasource = undefined; + $scope.metadata.databasis = undefined; + $scope.metadata.contact = undefined; + $scope.metadata.lastUpdate = undefined; + $scope.metadata.description = undefined; + $scope.roleManagementTableOptions = undefined; + $scope.$on("availableRolesUpdate", function (event) { + refreshRoles(); + }); + // make sure that initial fetching of availableRoles has happened + $scope.$on("initialMetadataLoadingCompleted", function (event) { + refreshRoles(); + }); + function refreshRoles() { + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('georesourceAddRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, kommonitorDataExchangeService.getCurrentKomMonitorLoginRoleIds()); + } + $scope.georesourceTopic_mainTopic = undefined; + $scope.georesourceTopic_subTopic = undefined; + $scope.georesourceTopic_subsubTopic = undefined; + $scope.georesourceTopic_subsubsubTopic = undefined; + $scope.georesourceType = "poi"; + $scope.isPOI = true; + $scope.isLOI = false; + $scope.isAOI = false; + $scope.selectedPoiMarkerColor = kommonitorDataExchangeService.availablePoiMarkerColors[0]; + $scope.selectedPoiSymbolColor = kommonitorDataExchangeService.availablePoiMarkerColors[1]; + $scope.selectedLoiDashArrayObject = kommonitorDataExchangeService.availableLoiDashArrayObjects[0]; + $scope.loiColor = "#bf3d2c"; + $scope.loiWidth = 3; + $scope.aoiColor = "#bf3d2c"; + $scope.selectedPoiIconName = "home"; + $scope.periodOfValidity = {}; + $scope.periodOfValidity.startDate = undefined; + $scope.periodOfValidity.endDate = undefined; + $scope.periodOfValidityInvalid = false; + $scope.geoJsonString = undefined; + $scope.georesource_asGeoJson = undefined; + $scope.georesourceDataSourceInputInvalidReason = undefined; + $scope.georesourceDataSourceInputInvalid = false; + $scope.georesourceDataSourceIdProperty = undefined; + $scope.georesourceDataSourceNameProperty = undefined; + $scope.converter = undefined; + $scope.schema = undefined; + $scope.mimeType = undefined; + $scope.datasourceType = undefined; + $scope.georesourceDataSourceIdProperty = undefined; + $scope.georesourceDataSourceNameProperty = undefined; + $scope.converterDefinition = undefined; + $scope.datasourceTypeDefinition = undefined; + $scope.propertyMappingDefinition = undefined; + $scope.postBody_georesources = undefined; + $scope.validityEndDate_perFeature = undefined; + $scope.validityStartDate_perFeature = undefined; + $scope.attributeMapping_sourceAttributeName = undefined; + $scope.attributeMapping_destinationAttributeName = undefined; + $scope.attributeMapping_data = undefined; + $scope.attributeMapping_attributeType = kommonitorImporterHelperService.attributeMapping_attributeTypes[0]; + $scope.attributeMappings_adminView = []; + $scope.keepAttributes = true; + $scope.keepMissingValues = true; + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + $scope.importerErrors = undefined; + $scope.iconPickerOptions = { + align: 'center', + arrowClass: 'btn-default', + arrowPrevIconClass: 'fas fa-angle-left', + arrowNextIconClass: 'fas fa-angle-right', + cols: 10, + footer: true, + header: true, + icon: 'glyphicon-' + $scope.selectedPoiIconName, + iconset: 'glyphicon', + labelHeader: '{0} von {1} Seiten', + labelFooter: '{0} - {1} von {2} Icons', + placement: 'bottom', + rows: 6, + search: true, + searchText: 'Stichwortsuche (Bootstrap Glyphicons)', + selectedClass: 'btn-success', + unselectedClass: '' + }; + $('#poiSymbolPicker').iconpicker($scope.iconPickerOptions); + $('#poiSymbolPicker').on('change', function (e) { + console.log(e.icon); + // split up due to current data management request structure where we expect only the last name of Bootstrap 3.3.7 glyphicon name + // i.e. "home" for "glyphicon-home" + $scope.selectedPoiIconName = e.icon.substring(e.icon.indexOf('-') + 1); + console.log($scope.selectedPoiIconName); + }); + $scope.loadingData = false; + // initialize loiDashArray dropdown + setTimeout(function () { + for (var i = 0; i < kommonitorDataExchangeService.availableLoiDashArrayObjects.length; i++) { + $("#loiDashArrayDropdownItem-" + i).html(kommonitorDataExchangeService.availableLoiDashArrayObjects[i].svgString); + } + $("#loiDashArrayDropdownButton_addGeoresource").html($scope.selectedLoiDashArrayObject.svgString); + }, 1000); + // initialize colorPickers + $('#loiColorPicker').colorpicker(); + $('#aoiColorPicker').colorpicker(); + $scope.resetGeoresourceAddForm = function () { + $scope.importerErrors = undefined; + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + $scope.datasetName = undefined; + $scope.datasetNameInvalid = false; + $scope.metadata = {}; + $scope.metadata.note = undefined; + $scope.metadata.literature = undefined; + $scope.metadata.updateInterval = undefined; + $scope.metadata.sridEPSG = undefined; + $scope.metadata.datasource = undefined; + $scope.metadata.databasis = undefined; + $scope.metadata.contact = undefined; + $scope.metadata.lastUpdate = undefined; + $scope.metadata.description = undefined; + console.log("resetGeoresourceAddForm"); + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('georesourceAddRoleManagementTable', null, kommonitorDataExchangeService.accessControl, null); + $scope.georesourceTopic_mainTopic = undefined; + $scope.georesourceTopic_subTopic = undefined; + $scope.georesourceTopic_subsubTopic = undefined; + $scope.georesourceTopic_subsubsubTopic = undefined; + $scope.georesourceType = "poi"; + $scope.isPOI = true; + $scope.isLOI = false; + $scope.isAOI = false; + $scope.selectedPoiMarkerColor = kommonitorDataExchangeService.availablePoiMarkerColors[0]; + $scope.selectedPoiSymbolColor = kommonitorDataExchangeService.availablePoiMarkerColors[1]; + $scope.selectedLoiDashArrayObject = kommonitorDataExchangeService.availableLoiDashArrayObjects[0]; + $scope.loiColor = "#bf3d2c"; + $scope.loiWidth = 3; + $scope.aoiColor = "#bf3d2c"; + $scope.selectedPoiIconName = "home"; + $("#poiSymbolPicker").val("").iconpicker('setIcon', 'glyphicon-' + $scope.selectedPoiIconName); + $scope.periodOfValidity = {}; + $scope.periodOfValidity.startDate = undefined; + $scope.periodOfValidity.endDate = undefined; + $scope.periodOfValidityInvalid = false; + $scope.georesourceDataSourceInputInvalidReason = undefined; + $scope.georesourceDataSourceInputInvalid = false; + $scope.converter = undefined; + $scope.schema = undefined; + $scope.mimeType = undefined; + $scope.datasourceType = undefined; + $scope.georesourceDataSourceIdProperty = undefined; + $scope.georesourceDataSourceNameProperty = undefined; + $scope.converterDefinition = undefined; + $scope.datasourceTypeDefinition = undefined; + $scope.propertyMappingDefinition = undefined; + $scope.postBody_georesources = undefined; + $scope.validityEndDate_perFeature = undefined; + $scope.validityStartDate_perFeature = undefined; + $scope.georesourceDataSourceIdProperty = undefined; + $scope.georesourceDataSourceNameProperty = undefined; + $scope.attributeMapping_sourceAttributeName = undefined; + $scope.attributeMapping_destinationAttributeName = undefined; + $scope.attributeMapping_data = undefined; + $scope.attributeMapping_attributeType = kommonitorImporterHelperService.attributeMapping_attributeTypes[0]; + $scope.attributeMappings_adminView = []; + $scope.keepAttributes = true; + $scope.keepMissingValues = true; + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.onChangeConverter = function () { + $scope.schema = $scope.converter.schemas ? $scope.converter.schemas[0] : undefined; + $scope.mimeType = $scope.converter.mimeTypes[0]; + }; + $scope.onChangeMimeType = function (mimeType) { + $scope.mimeType = mimeType; + }; + $scope.onChangeGeoresourceType = function () { + switch ($scope.georesourceType) { + case "poi": + $scope.isPOI = true; + $scope.isLOI = false; + $scope.isAOI = false; + break; + case "loi": + $scope.isPOI = false; + $scope.isLOI = true; + $scope.isAOI = false; + break; + case "aoi": + $scope.isPOI = false; + $scope.isLOI = false; + $scope.isAOI = true; + break; + default: + $scope.isPOI = true; + $scope.isLOI = false; + $scope.isAOI = false; + break; + } + }; + $scope.checkDatasetName = function () { + $scope.datasetNameInvalid = false; + kommonitorDataExchangeService.availableGeoresources.forEach(function (georesource) { + if (georesource.datasetName === $scope.datasetName) { + $scope.datasetNameInvalid = true; + return; + } + }); + }; + $scope.checkPeriodOfValidity = function () { + $scope.periodOfValidityInvalid = false; + if ($scope.periodOfValidity.startDate && $scope.periodOfValidity.endDate) { + var startDate = new Date($scope.periodOfValidity.startDate); + var endDate = new Date($scope.periodOfValidity.endDate); + if ((startDate === endDate) || startDate > endDate) { + // failure + $scope.periodOfValidityInvalid = true; + } + } + }; + $scope.onAddOrUpdateAttributeMapping = function () { + var tmpAttributeMapping_adminView = { + "sourceName": $scope.attributeMapping_sourceAttributeName, + "destinationName": $scope.attributeMapping_destinationAttributeName, + "dataType": $scope.attributeMapping_attributeType + }; + var processed = false; + for (let index = 0; index < $scope.attributeMappings_adminView.length; index++) { + var attributeMappingEntry_adminView = $scope.attributeMappings_adminView[index]; + if (attributeMappingEntry_adminView.sourceName === tmpAttributeMapping_adminView.sourceName) { + // replace object + $scope.attributeMappings_adminView[index] = tmpAttributeMapping_adminView; + processed = true; + break; + } + } + if (!processed) { + // new entry + $scope.attributeMappings_adminView.push(tmpAttributeMapping_adminView); + } + $scope.attributeMapping_sourceAttributeName = undefined; + $scope.attributeMapping_destinationAttributeName = undefined; + $scope.attributeMapping_attributeType = kommonitorImporterHelperService.attributeMapping_attributeTypes[0]; + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.onClickEditAttributeMapping = function (attributeMappingEntry) { + $scope.attributeMapping_sourceAttributeName = attributeMappingEntry.sourceName; + $scope.attributeMapping_destinationAttributeName = attributeMappingEntry.destinationName; + $scope.attributeMapping_attributeType = attributeMappingEntry.dataType; + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.onClickDeleteAttributeMapping = function (attributeMappingEntry) { + for (let index = 0; index < $scope.attributeMappings_adminView.length; index++) { + if ($scope.attributeMappings_adminView[index].sourceName === attributeMappingEntry.sourceName) { + // remove object + $scope.attributeMappings_adminView.splice(index, 1); + break; + } + } + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.buildImporterObjects = async function () { + $scope.converterDefinition = $scope.buildConverterDefinition(); + $scope.datasourceTypeDefinition = await $scope.buildDatasourceTypeDefinition(); + $scope.propertyMappingDefinition = $scope.buildPropertyMappingDefinition(); + $scope.postBody_georesources = $scope.buildPostBody_georesources(); + if (!$scope.converterDefinition || !$scope.datasourceTypeDefinition || !$scope.propertyMappingDefinition || !$scope.postBody_georesources) { + return false; + } + return true; + }; + $scope.buildConverterDefinition = function () { + return kommonitorImporterHelperService.buildConverterDefinition($scope.converter, "converterParameter_georesourceAdd_", $scope.schema, $scope.mimeType); + }; + $scope.buildDatasourceTypeDefinition = async function () { + try { + return await kommonitorImporterHelperService.buildDatasourceTypeDefinition($scope.datasourceType, 'datasourceTypeParameter_georesourceAdd_', 'georesourceDataSourceInput_add'); + } + catch (error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + $("#georesourceAddErrorAlert").show(); + $scope.loadingData = false; + return null; + } + }; + $scope.buildPropertyMappingDefinition = function () { + // arsion from is undefined currently + return kommonitorImporterHelperService.buildPropertyMapping_spatialResource($scope.georesourceDataSourceNameProperty, $scope.georesourceDataSourceIdProperty, $scope.validityStartDate_perFeature, $scope.validityEndDate_perFeature, undefined, $scope.keepAttributes, $scope.keepMissingValues, $scope.attributeMappings_adminView); + }; + $scope.buildPostBody_georesources = function () { + var postBody = { + "geoJsonString": $scope.geoJsonString, + "allowedRoles": [], + "metadata": { + "note": $scope.metadata.note, + "literature": $scope.metadata.literature, + "updateInterval": $scope.metadata.updateInterval.apiName, + "sridEPSG": $scope.metadata.sridEPSG || 4326, + "datasource": $scope.metadata.datasource, + "contact": $scope.metadata.contact, + "lastUpdate": $scope.metadata.lastUpdate, + "description": $scope.metadata.description, + "databasis": $scope.metadata.databasis + }, + "jsonSchema": null, + "datasetName": $scope.datasetName, + "periodOfValidity": { + "endDate": $scope.periodOfValidity.endDate, + "startDate": $scope.periodOfValidity.startDate + }, + "isAOI": $scope.isAOI, + "isLOI": $scope.isLOI, + "isPOI": $scope.isPOI, + "topicReference": null + }; + let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); + for (const roleId of roleIds) { + postBody.allowedRoles.push(roleId); + } + if ($scope.isPOI) { + postBody["poiSymbolBootstrap3Name"] = $scope.selectedPoiIconName; + postBody["poiSymbolColor"] = $scope.selectedPoiSymbolColor.colorName; + postBody["poiMarkerColor"] = $scope.selectedPoiMarkerColor.colorName; + postBody["loiDashArrayString"] = null; + postBody["loiColor"] = null; + postBody["loiWidth"] = 3; + postBody["aoiColor"] = null; + } + else if ($scope.isLOI) { + postBody["poiSymbolBootstrap3Name"] = null; + postBody["poiSymbolColor"] = null; + postBody["poiMarkerColor"] = null; + postBody["loiDashArrayString"] = $scope.selectedLoiDashArrayObject.dashArrayValue; + postBody["loiColor"] = $scope.loiColor; + postBody["loiWidth"] = $scope.loiWidth; + postBody["aoiColor"] = null; + } + else if ($scope.isAOI) { + postBody["poiSymbolBootstrap3Name"] = null; + postBody["poiSymbolColor"] = null; + postBody["poiMarkerColor"] = null; + postBody["loiDashArrayString"] = null; + postBody["loiColor"] = null; + postBody["loiWidth"] = 3; + postBody["aoiColor"] = $scope.aoiColor; + } + // TOPIC REFERENCE + if ($scope.georesourceTopic_subsubsubTopic) { + postBody.topicReference = $scope.georesourceTopic_subsubsubTopic.topicId; + } + else if ($scope.georesourceTopic_subsubTopic) { + postBody.topicReference = $scope.georesourceTopic_subsubTopic.topicId; + } + else if ($scope.georesourceTopic_subTopic) { + postBody.topicReference = $scope.georesourceTopic_subTopic.topicId; + } + else if ($scope.georesourceTopic_mainTopic) { + postBody.topicReference = $scope.georesourceTopic_mainTopic.topicId; + } + else { + postBody.topicReference = ""; + } + return postBody; + }; + $scope.addGeoresource = async function () { + $timeout(function () { + $scope.loadingData = true; + }); + $scope.importerErrors = undefined; + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + /* + now collect data and build request for importer + */ + /* + if any required importer data is missing --> cancel request and highlight required errors + */ + var allDataSpecified = await $scope.buildImporterObjects(); + if (!allDataSpecified) { + $("#georesourceAddForm").validator("update"); + $("#georesourceAddForm").validator("validate"); + return; + } + else { + // TODO verify input + // TODO Create and perform POST Request with loading screen + var newGeoresourceResponse_dryRun = undefined; + try { + newGeoresourceResponse_dryRun = await kommonitorImporterHelperService.registerNewGeoresource($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.postBody_georesources, true); + if (!kommonitorImporterHelperService.importerResponseContainsErrors(newGeoresourceResponse_dryRun)) { + // all good, really execute the request to import data against data management API + var newGeoresourceResponse = await kommonitorImporterHelperService.registerNewGeoresource($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.postBody_georesources, false); + $rootScope.$broadcast("refreshGeoresourceOverviewTable", "add", kommonitorImporterHelperService.getIdFromImporterResponse(newGeoresourceResponse)); + // refresh all admin dashboard diagrams due to modified metadata + $timeout(function () { + $rootScope.$broadcast("refreshAdminDashboardDiagrams"); + }, 500); + $scope.successMessagePart = $scope.postBody_georesources.datasetName; + $scope.importedFeatures = kommonitorImporterHelperService.getImportedFeaturesFromImporterResponse(newGeoresourceResponse); + $("#georesourceAddSuccessAlert").show(); + $scope.loadingData = false; + } + else { + // errors ocurred + // show them + $scope.errorMessagePart = "Einige der zu importierenden Features des Datensatzes weisen kritische Fehler auf"; + $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(newGeoresourceResponse_dryRun); + $("#georesourceAddErrorAlert").show(); + $scope.loadingData = false; + setTimeout(() => { + $scope.$digest(); + }, 250); + } + } + catch (error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + if (newGeoresourceResponse_dryRun) { + $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(newGeoresourceResponse_dryRun); + } + $("#georesourceAddErrorAlert").show(); + $scope.loadingData = false; + setTimeout(() => { + $scope.$digest(); + }, 250); + } + } + }; + $scope.onImportGeoresourceAddMetadata = function () { + $scope.georesourceMetadataImportError = ""; + $("#georesourceMetadataImportFile").files = []; + // trigger file chooser + $("#georesourceMetadataImportFile").click(); + }; + $(document).on("change", "#georesourceMetadataImportFile", function () { + console.log("Importing Georesource metadata for Add Georesource Form"); + // get the file + var file = document.getElementById('georesourceMetadataImportFile').files[0]; + $scope.parseMetadataFromFile(file); + }); + $scope.parseMetadataFromFile = function (file) { + var fileReader = new FileReader(); + fileReader.onload = function (event) { + try { + $scope.parseFromMetadataFile(event); + } + catch (error) { + console.error(error); + console.error("Uploaded Metadata File cannot be parsed."); + $scope.georesourceMetadataImportError = "Uploaded Metadata File cannot be parsed correctly"; + document.getElementById("georesourcesAddMetadataPre").innerHTML = $scope.georesourceMetadataStructure_pretty; + $("#georesourceMetadataImportErrorAlert").show(); + $scope.$digest(); + } + }; + // Read in the image file as a data URL. + fileReader.readAsText(file); + }; + $scope.parseFromMetadataFile = function (event) { + // $scope.geoJsonString = event.target.result; + $scope.metadataImportSettings = JSON.parse(event.target.result); + if (!$scope.metadataImportSettings.metadata) { + console.error("uploaded Metadata File cannot be parsed - wrong structure."); + $scope.georesourceMetadataImportError = "Struktur der Datei stimmt nicht mit erwartetem Muster überein."; + document.getElementById("georesourcesAddMetadataPre").innerHTML = $scope.georesourceMetadataStructure_pretty; + $("#georesourceMetadataImportErrorAlert").show(); + $scope.$digest(); + } + $scope.metadata = {}; + $scope.metadata.note = $scope.metadataImportSettings.metadata.note; + $scope.metadata.literature = $scope.metadataImportSettings.metadata.literature; + kommonitorDataExchangeService.updateIntervalOptions.forEach(function (option) { + if (option.apiName === $scope.metadataImportSettings.metadata.updateInterval) { + $scope.metadata.updateInterval = option; + } + }); + $scope.metadata.sridEPSG = $scope.metadataImportSettings.metadata.sridEPSG; + $scope.metadata.datasource = $scope.metadataImportSettings.metadata.datasource; + $scope.metadata.contact = $scope.metadataImportSettings.metadata.contact; + $scope.metadata.lastUpdate = $scope.metadataImportSettings.metadata.lastUpdate; + // initialize date + $('#georesourceAddLastUpdateDatepicker').datepicker('setDate', $scope.metadata.lastUpdate); + $scope.metadata.description = $scope.metadataImportSettings.metadata.description; + $scope.metadata.databasis = $scope.metadataImportSettings.metadata.databasis; + $scope.datasetName = $scope.metadataImportSettings.datasetName; + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('georesourceAddRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, $scope.metadataImportSettings.allowedRoles); + // georesource specific properties + $scope.isPOI = $scope.metadataImportSettings.isPOI; + $scope.isLOI = $scope.metadataImportSettings.isLOI; + $scope.isAOI = $scope.metadataImportSettings.isAOI; + if ($scope.metadataImportSettings.isPOI) { + $scope.georesourceType = "poi"; + } + else if ($scope.metadataImportSettings.isLOI) { + $scope.georesourceType = "loi"; + } + else { + $scope.georesourceType = "aoi"; + } + kommonitorDataExchangeService.availablePoiMarkerColors.forEach(function (option) { + if (option.colorName === $scope.metadataImportSettings.poiMarkerColor) { + $scope.selectedPoiMarkerColor = option; + } + if (option.colorName === $scope.metadataImportSettings.poiSymbolColor) { + $scope.selectedPoiSymbolColor = option; + } + }); + kommonitorDataExchangeService.availableLoiDashArrayObjects.forEach(function (option) { + if (option.dashArrayValue === $scope.metadataImportSettings.loiDashArrayString) { + $scope.selectedLoiDashArrayObject = option; + $scope.onChangeLoiDashArray($scope.selectedLoiDashArrayObject); + } + }); + $scope.loiColor = $scope.metadataImportSettings.loiColor; + $scope.loiWidth = $scope.metadataImportSettings.loiWidth; + $scope.aoiColor = $scope.metadataImportSettings.aoiColor; + $scope.selectedPoiIconName = $scope.metadataImportSettings.poiSymbolBootstrap3Name; + var topicHierarchy = kommonitorDataExchangeService.getTopicHierarchyForTopicId($scope.metadataImportSettings.topicReference); + if (topicHierarchy && topicHierarchy[0]) { + $scope.georesourceTopic_mainTopic = topicHierarchy[0]; + } + if (topicHierarchy && topicHierarchy[1]) { + $scope.georesourceTopic_subTopic = topicHierarchy[1]; + } + if (topicHierarchy && topicHierarchy[2]) { + $scope.georesourceTopic_subsubTopic = topicHierarchy[2]; + } + if (topicHierarchy && topicHierarchy[3]) { + $scope.georesourceTopic_subsubsubTopic = topicHierarchy[3]; + } + setTimeout(function () { + $("#poiSymbolPicker").val("").iconpicker('setIcon', 'glyphicon-' + $scope.metadataImportSettings.poiSymbolBootstrap3Name); + // $("#poiSymbolPicker i").css('glyphicon glyphicon-' + $scope.metadataImportSettings.poiSymbolBootstrap3Name); + // $("#poiSymbolPicker input").css('glyphicon-' + $scope.metadataImportSettings.poiSymbolBootstrap3Name); + }, 200); + $scope.$digest(); + }; + $scope.onExportGeoresourceAddMetadataTemplate = function () { + var metadataJSON = JSON.stringify($scope.georesourceMetadataStructure); + var fileName = "Georessource_Metadaten_Vorlage_Export.json"; + var blob = new Blob([metadataJSON], { type: "application/json" }); + var data = URL.createObjectURL(blob); + var a = document.createElement('a'); + a.download = fileName; + a.href = data; + a.textContent = "JSON"; + a.target = "_blank"; + a.rel = "noopener noreferrer"; + a.click(); + a.remove(); + }; + $scope.onExportGeoresourceAddMetadata = function () { + var metadataExport = $scope.georesourceMetadataStructure; + metadataExport.metadata.note = $scope.metadata.note || ""; + metadataExport.metadata.literature = $scope.metadata.literature || ""; + metadataExport.metadata.sridEPSG = $scope.metadata.sridEPSG || ""; + metadataExport.metadata.datasource = $scope.metadata.datasource || ""; + metadataExport.metadata.contact = $scope.metadata.contact || ""; + metadataExport.metadata.lastUpdate = $scope.metadata.lastUpdate || ""; + metadataExport.metadata.description = $scope.metadata.description || ""; + metadataExport.metadata.databasis = $scope.metadata.databasis || ""; + metadataExport.datasetName = $scope.datasetName || ""; + metadataExport.allowedRoles = []; + let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); + for (const roleId of roleIds) { + metadataExport.allowedRoles.push(roleId); + } + if ($scope.metadata.updateInterval) { + metadataExport.metadata.updateInterval = $scope.metadata.updateInterval.apiName; + } + var name = $scope.datasetName; + // georesource specific properties + metadataExport.isPOI = $scope.isPOI; + metadataExport.isLOI = $scope.isLOI; + metadataExport.isAOI = $scope.isAOI; + if ($scope.isPOI) { + metadataExport["poiSymbolBootstrap3Name"] = $scope.selectedPoiIconName; + metadataExport["poiSymbolColor"] = $scope.selectedPoiSymbolColor.colorName; + metadataExport["poiMarkerColor"] = $scope.selectedPoiMarkerColor.colorName; + metadataExport["loiDashArrayString"] = ""; + metadataExport["loiColor"] = ""; + metadataExport["loiWidth"] = ""; + metadataExport["aoiColor"] = ""; + } + else if ($scope.isLOI) { + metadataExport["poiSymbolBootstrap3Name"] = ""; + metadataExport["poiSymbolColor"] = ""; + metadataExport["poiMarkerColor"] = ""; + metadataExport["loiDashArrayString"] = $scope.selectedLoiDashArrayObject.dashArrayValue; + metadataExport["loiColor"] = $scope.loiColor; + metadataExport["loiWidth"] = $scope.loiWidth; + metadataExport["aoiColor"] = ""; + } + else if ($scope.isAOI) { + metadataExport["poiSymbolBootstrap3Name"] = ""; + metadataExport["poiSymbolColor"] = ""; + metadataExport["poiMarkerColor"] = ""; + metadataExport["loiDashArrayString"] = ""; + metadataExport["loiColor"] = ""; + metadataExport["loiWidth"] = ""; + metadataExport["aoiColor"] = $scope.aoiColor; + } + if ($scope.georesourceTopic_subsubsubTopic) { + metadataExport.topicReference = $scope.georesourceTopic_subsubsubTopic.topicId; + } + else if ($scope.georesourceTopic_subsubTopic) { + metadataExport.topicReference = $scope.georesourceTopic_subsubTopic.topicId; + } + else if ($scope.georesourceTopic_subTopic) { + metadataExport.topicReference = $scope.georesourceTopic_subTopic.topicId; + } + else if ($scope.georesourceTopic_mainTopic) { + metadataExport.topicReference = $scope.georesourceTopic_mainTopic.topicId; + } + else { + metadataExport.topicReference = ""; + } + var metadataJSON = JSON.stringify(metadataExport); + var fileName = "Georessource_Metadaten_Export"; + if (name) { + fileName += "-" + name; + } + fileName += ".json"; + var blob = new Blob([metadataJSON], { type: "application/json" }); + var data = URL.createObjectURL(blob); + var a = document.createElement('a'); + a.download = fileName; + a.href = data; + a.textContent = "JSON"; + a.target = "_blank"; + a.rel = "noopener noreferrer"; + a.click(); + a.remove(); + }; + $scope.onChangeMarkerColor = function (markerColor) { + $scope.selectedPoiMarkerColor = markerColor; + }; + $scope.onChangeSymbolColor = function (symbolColor) { + $scope.selectedPoiSymbolColor = symbolColor; + }; + $scope.onChangeLoiDashArray = function (loiDashArrayObject) { + $scope.selectedLoiDashArrayObject = loiDashArrayObject; + $("#loiDashArrayDropdownButton_addGeoresource").html(loiDashArrayObject.svgString); + }; + $scope.onImportGeoresourceAddMappingConfig = function () { + $scope.georesourceMappingConfigImportError = ""; + $("#georesourceMappingConfigAddImportFile").files = []; + // trigger file chooser + $("#georesourceMappingConfigAddImportFile").click(); + }; + $(document).on("change", "#georesourceMappingConfigAddImportFile", function () { + console.log("Importing Importer Mapping Config for Add Georesource Form"); + // get the file + var file = document.getElementById('georesourceMappingConfigAddImportFile').files[0]; + $scope.parseMappingConfigFromFile(file); + }); + $scope.parseMappingConfigFromFile = function (file) { + var fileReader = new FileReader(); + fileReader.onload = function (event) { + try { + $scope.parseFromMappingConfigFile(event); + } + catch (error) { + console.error(error); + console.error("Uploaded MappingConfig File cannot be parsed."); + $scope.georesourceMappingConfigImportError = "Uploaded MappingConfig File cannot be parsed correctly"; + document.getElementById("georesourcesAddMappingConfigPre").innerHTML = $scope.georesourceMappingConfigStructure_pretty; + $("#georesourceMappingConfigImportErrorAlert").show(); + $scope.$digest(); + } + }; + // Read in the image file as a data URL. + fileReader.readAsText(file); + }; + $scope.parseFromMappingConfigFile = function (event) { + $scope.mappingConfigImportSettings = JSON.parse(event.target.result); + if (!$scope.mappingConfigImportSettings.converter || !$scope.mappingConfigImportSettings.dataSource || !$scope.mappingConfigImportSettings.propertyMapping) { + console.error("uploaded MappingConfig File cannot be parsed - wrong structure."); + $scope.georesourceMetadataImportError = "Struktur der Datei stimmt nicht mit erwartetem Muster überein."; + document.getElementById("georesourcesAddMappingConfigPre").innerHTML = $scope.georesourceMappingConfigStructure_pretty; + $("#georesourceMappingConfigImportErrorAlert").show(); + $scope.$digest(); + } + $scope.converter = undefined; + for (var converter of kommonitorImporterHelperService.availableConverters) { + if (converter.name === $scope.mappingConfigImportSettings.converter.name) { + $scope.converter = converter; + break; + } + } + $scope.schema = undefined; + if ($scope.converter && $scope.converter.schemas && $scope.mappingConfigImportSettings.converter.schema) { + for (var schema of $scope.converter.schemas) { + if (schema === $scope.mappingConfigImportSettings.converter.schema) { + $scope.schema = schema; + } + } + } + $scope.mimeType = undefined; + if ($scope.converter && $scope.converter.mimeTypes && $scope.mappingConfigImportSettings.converter.mimeType) { + for (var mimeType of $scope.converter.mimeTypes) { + if (mimeType === $scope.mappingConfigImportSettings.converter.mimeType) { + $scope.mimeType = mimeType; + } + } + } + $scope.datasourceType = undefined; + for (var datasourceType of kommonitorImporterHelperService.availableDatasourceTypes) { + if (datasourceType.type === $scope.mappingConfigImportSettings.dataSource.type) { + $scope.datasourceType = datasourceType; + break; + } + } + $scope.$digest(); + // converter parameters + if ($scope.converter) { + for (var convParameter of $scope.mappingConfigImportSettings.converter.parameters) { + $("#converterParameter_georesourceAdd_" + convParameter.name).val(convParameter.value); + } + } + // datasourceTypes parameters + if ($scope.datasourceType) { + for (var dsParameter of $scope.mappingConfigImportSettings.dataSource.parameters) { + $("#datasourceTypeParameter_georesourceAdd_" + dsParameter.name).val(dsParameter.value); + } + } + // property Mapping + $scope.georesourceDataSourceNameProperty = $scope.mappingConfigImportSettings.propertyMapping.nameProperty; + $scope.georesourceDataSourceIdProperty = $scope.mappingConfigImportSettings.propertyMapping.identifierProperty; + $scope.validityStartDate_perFeature = $scope.mappingConfigImportSettings.propertyMapping.validStartDateProperty; + $scope.validityEndDate_perFeature = $scope.mappingConfigImportSettings.propertyMapping.validEndDateProperty; + $scope.keepAttributes = $scope.mappingConfigImportSettings.propertyMapping.keepAttributes; + $scope.keepMissingValues = $scope.mappingConfigImportSettings.propertyMapping.keepMissingOrNullValueAttributes; + $scope.attributeMappings_adminView = []; + for (var attributeMapping of $scope.mappingConfigImportSettings.propertyMapping.attributes) { + var tmpEntry = { + "sourceName": attributeMapping.name, + "destinationName": attributeMapping.mappingName + }; + for (const dataType of kommonitorImporterHelperService.attributeMapping_attributeTypes) { + if (dataType.apiName === attributeMapping.type) { + tmpEntry.dataType = dataType; + } + } + $scope.attributeMappings_adminView.push(tmpEntry); + } + if ($scope.mappingConfigImportSettings.periodOfValidity) { + $scope.periodOfValidity = {}; + $scope.periodOfValidity.startDate = $scope.mappingConfigImportSettings.periodOfValidity.startDate; + $scope.periodOfValidity.endDate = $scope.mappingConfigImportSettings.periodOfValidity.endDate; + $scope.periodOfValidityInvalid = false; + // update datePickers + if ($scope.periodOfValidity.startDate) { + $("#georesourceAddDatepickerStart").datepicker('setDate', $scope.periodOfValidity.startDate); + } + if ($scope.periodOfValidity.endDate) { + $("#georesourceAddDatepickerEnd").datepicker('setDate', $scope.periodOfValidity.endDate); + } + } + $scope.$digest(); + }; + $scope.onExportGeoresourceAddMappingConfig = async function () { + var converterDefinition = $scope.buildConverterDefinition(); + var datasourceTypeDefinition = await $scope.buildDatasourceTypeDefinition(); + var propertyMappingDefinition = $scope.buildPropertyMappingDefinition(); + var mappingConfigExport = { + "converter": converterDefinition, + "dataSource": datasourceTypeDefinition, + "propertyMapping": propertyMappingDefinition, + }; + mappingConfigExport.periodOfValidity = $scope.periodOfValidity; + var name = $scope.datasetName; + var metadataJSON = JSON.stringify(mappingConfigExport); + var fileName = "KomMonitor-Import-Mapping-Konfiguration_Export"; + if (name) { + fileName += "-" + name; + } + fileName += ".json"; + var blob = new Blob([metadataJSON], { type: "application/json" }); + var data = URL.createObjectURL(blob); + var a = document.createElement('a'); + a.download = fileName; + a.href = data; + a.textContent = "JSON"; + a.target = "_blank"; + a.rel = "noopener noreferrer"; + a.click(); + a.remove(); + }; + $scope.hideSuccessAlert = function () { + $("#georesourceAddSuccessAlert").hide(); + }; + $scope.hideErrorAlert = function () { + $("#georesourceAddErrorAlert").hide(); + }; + $scope.hideMetadataErrorAlert = function () { + $("#georesourceMetadataImportErrorAlert").hide(); + }; + $scope.hideMappingConfigErrorAlert = function () { + $("#georesourceMappingConfigImportErrorAlert").hide(); + }; + kommonitorMultiStepFormHelperService.registerClickHandler(); + } + ] +}); +//# sourceMappingURL=georesource-add-modal.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceAddModal/georesource-add-modal.component.js.map b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceAddModal/georesource-add-modal.component.js.map new file mode 100644 index 000000000..ba1f82176 --- /dev/null +++ b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceAddModal/georesource-add-modal.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"georesource-add-modal.component.js","sourceRoot":"","sources":["georesource-add-modal.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,SAAS,CAAC,qBAAqB,EAAE;IACtE,WAAW,EAAG,gHAAgH;IAC9H,UAAU,EAAG,CAAC,+BAA+B,EAAE,iCAAiC,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO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C,eAAe,CAAC,IAAI,CAAC,CAAC;gBAEtC,IAAI,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;gBACpC,CAAC,CAAC,QAAQ,GAAM,QAAQ,CAAC;gBACzB,CAAC,CAAC,IAAI,GAAU,IAAI,CAAC;gBACrB,CAAC,CAAC,WAAW,GAAG,MAAM,CAAC;gBACvB,CAAC,CAAC,MAAM,GAAG,QAAQ,CAAC;gBACpB,CAAC,CAAC,GAAG,GAAG,qBAAqB,CAAC;gBAC9B,CAAC,CAAC,KAAK,EAAE,CAAC;gBAEV,CAAC,CAAC,MAAM,EAAE,CAAC;YACZ,CAAC,CAAC;YAID,MAAM,CAAC,gBAAgB,GAAG;gBACzB,CAAC,CAAC,6BAA6B,CAAC,CAAC,IAAI,EAAE,CAAC;YACzC,CAAC,CAAC;YAEF,MAAM,CAAC,cAAc,GAAG;gBACvB,CAAC,CAAC,2BAA2B,CAAC,CAAC,IAAI,EAAE,CAAC;YACvC,CAAC,CAAC;YAEF,MAAM,CAAC,sBAAsB,GAAG;gBAC/B,CAAC,CAAC,sCAAsC,CAAC,CAAC,IAAI,EAAE,CAAC;YAClD,CAAC,CAAC;YAEF,MAAM,CAAC,2BAA2B,GAAG;gBACpC,CAAC,CAAC,2CAA2C,CAAC,CAAC,IAAI,EAAE,CAAC;YACvD,CAAC,CAAC;YAEF,oCAAoC,CAAC,oBAAoB,EAAE,CAAC;QAE9D,CAAC;KACD;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceAddModal/georesource-add-modal.component.ts b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceAddModal/georesource-add-modal.component.ts new file mode 100644 index 000000000..2fbe041b2 --- /dev/null +++ b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceAddModal/georesource-add-modal.component.ts @@ -0,0 +1,1125 @@ +angular.module('georesourceAddModal').component('georesourceAddModal', { + templateUrl : "components/kommonitorAdmin/adminGeoresourcesManagement/georesourceAddModal/georesource-add-modal.template.html", + controller : ['kommonitorDataExchangeService', 'kommonitorImporterHelperService', '$scope', '$rootScope', '$http', '$timeout', + '__env', 'kommonitorMultiStepFormHelperService', 'kommonitorDataGridHelperService', + function GeoresourceAddModalAddModalController(kommonitorDataExchangeService, kommonitorImporterHelperService, $scope, $rootScope, + $http, $timeout, __env, kommonitorMultiStepFormHelperService, kommonitorDataGridHelperService) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorImporterHelperServiceInstance = kommonitorImporterHelperService; + + /* POST BODY + { + "isLOI": false, + "metadata": { + "note": "note", + "literature": "literature", + "updateInterval": "ARBITRARY", + "sridEPSG": 0.8008281904610115, + "datasource": "datasource", + "contact": "contact", + "lastUpdate": "2000-01-23", + "description": "description", + "databasis": "databasis" + }, + "allowedRoles": [ + "allowedRoles", + "allowedRoles" + ], + "datasetName": "datasetName", + "poiSymbolBootstrap3Name": "poiSymbolBootstrap3Name", + "poiSymbolColor": "white", + "isAOI": false, + "loiDashArrayString": "loiDashArrayString", + "geoJsonString": "geoJsonString", + "topicReference": "topicReference", + "poiMarkerColor": "white", + "jsonSchema": "jsonSchema", + "periodOfValidity": { + "endDate": "2000-01-23", + "startDate": "2000-01-23" + }, + "isPOI": false, + "loiColor": "loiColor", + "loiWidth": "loiWidth", + "aoiColor": "aoiColor" + } + */ + + //Date picker + $('#georesourceAddDatepickerStart').datepicker(kommonitorDataExchangeService.datePickerOptions); + $('#georesourceAddDatepickerEnd').datepicker(kommonitorDataExchangeService.datePickerOptions); + $('#georesourceAddLastUpdateDatepicker').datepicker(kommonitorDataExchangeService.datePickerOptions); + + $scope.georesourceMetadataStructure = { + "metadata": { + "note": "an optional note", + "literature": "optional text about literature", + "updateInterval": "YEARLY|HALF_YEARLY|QUARTERLY|MONTHLY|ARBITRARY", + "sridEPSG": 4326, + "datasource": "text about data source", + "contact": "text about contact details", + "lastUpdate": "YYYY-MM-DD", + "description": "description about spatial unit dataset", + "databasis": "text about data basis", + }, + "allowedRoles": ['roleId'], + "datasetName": "Name of georesource dataset", + "isPOI": "boolean parameter for point of interest dataset - only one of isPOI, isLOI, isAOI can be true", + "isLOI": "boolean parameter for lines of interest dataset - only one of isPOI, isLOI, isAOI can be true", + "isAOI": "boolean parameter for area of interest dataset - only one of isPOI, isLOI, isAOI can be true", + "poiSymbolBootstrap3Name": "glyphicon name of bootstrap 3 symbol to use for a POI resource", + "poiSymbolColor": "'white'|'red'|'orange'|'beige'|'green'|'blue'|'purple'|'pink'|'gray'|'black'", + "loiDashArrayString": "dash array string value - e.g. 20 20", + "poiMarkerColor": "'white'|'red'|'orange'|'beige'|'green'|'blue'|'purple'|'pink'|'gray'|'black'", + "loiColor": "color for lines of interest dataset", + "loiWidth": "width for lines of interest dataset", + "aoiColor": "color for area of interest dataset" + }; + + $scope.georesourceMetadataStructure_pretty = kommonitorDataExchangeService.syntaxHighlightJSON($scope.georesourceMetadataStructure); + $scope.georesourceMappingConfigStructure_pretty = kommonitorDataExchangeService.syntaxHighlightJSON(kommonitorImporterHelperService.mappingConfigStructure); + + + $scope.metadataImportSettings; + $scope.georesourceMetadataImportError; + $scope.georesourceMetadataImportErrorAlert; + $scope.georesourceMappingConfigImportError; + + $scope.datasetName = undefined; + $scope.datasetNameInvalid = false; + + $scope.metadata = {}; + $scope.metadata.note = undefined; + $scope.metadata.literature = undefined; + $scope.metadata.updateInterval = undefined; + $scope.metadata.sridEPSG = undefined; + $scope.metadata.datasource = undefined; + $scope.metadata.databasis = undefined; + $scope.metadata.contact = undefined; + $scope.metadata.lastUpdate = undefined; + $scope.metadata.description = undefined; + + $scope.roleManagementTableOptions = undefined; + + $scope.$on("availableRolesUpdate", function (event) { + refreshRoles(); + }); + + // make sure that initial fetching of availableRoles has happened + $scope.$on("initialMetadataLoadingCompleted", function (event) { + refreshRoles(); + }); + + function refreshRoles() { + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('georesourceAddRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, kommonitorDataExchangeService.getCurrentKomMonitorLoginRoleIds()); + } + + $scope.georesourceTopic_mainTopic = undefined; + $scope.georesourceTopic_subTopic = undefined; + $scope.georesourceTopic_subsubTopic = undefined; + $scope.georesourceTopic_subsubsubTopic = undefined; + + $scope.georesourceType = "poi"; + $scope.isPOI = true; + $scope.isLOI = false; + $scope.isAOI = false; + $scope.selectedPoiMarkerColor = kommonitorDataExchangeService.availablePoiMarkerColors[0]; + $scope.selectedPoiSymbolColor = kommonitorDataExchangeService.availablePoiMarkerColors[1]; + $scope.selectedLoiDashArrayObject = kommonitorDataExchangeService.availableLoiDashArrayObjects[0]; + $scope.loiColor = "#bf3d2c"; + $scope.loiWidth = 3; + $scope.aoiColor = "#bf3d2c"; + $scope.selectedPoiIconName = "home"; + + $scope.periodOfValidity = {}; + $scope.periodOfValidity.startDate = undefined; + $scope.periodOfValidity.endDate = undefined; + $scope.periodOfValidityInvalid = false; + + $scope.geoJsonString = undefined; + $scope.georesource_asGeoJson = undefined; + + $scope.georesourceDataSourceInputInvalidReason = undefined; + $scope.georesourceDataSourceInputInvalid = false; + + $scope.georesourceDataSourceIdProperty = undefined; + $scope.georesourceDataSourceNameProperty = undefined; + + $scope.converter = undefined; + $scope.schema = undefined; + $scope.mimeType = undefined; + $scope.datasourceType = undefined; + $scope.georesourceDataSourceIdProperty = undefined; + $scope.georesourceDataSourceNameProperty = undefined; + + $scope.converterDefinition = undefined; + $scope.datasourceTypeDefinition = undefined; + $scope.propertyMappingDefinition = undefined; + $scope.postBody_georesources = undefined; + + $scope.validityEndDate_perFeature = undefined; + $scope.validityStartDate_perFeature = undefined; + + $scope.attributeMapping_sourceAttributeName = undefined; + $scope.attributeMapping_destinationAttributeName = undefined; + $scope.attributeMapping_data = undefined; + $scope.attributeMapping_attributeType = kommonitorImporterHelperService.attributeMapping_attributeTypes[0]; + $scope.attributeMappings_adminView = []; + $scope.keepAttributes = true; + $scope.keepMissingValues = true; + + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + $scope.importerErrors = undefined; + + $scope.iconPickerOptions = { + align: 'center', // Only in div tag + arrowClass: 'btn-default', + arrowPrevIconClass: 'fas fa-angle-left', + arrowNextIconClass: 'fas fa-angle-right', + cols: 10, + footer: true, + header: true, + icon: 'glyphicon-' + $scope.selectedPoiIconName, + iconset: 'glyphicon', + labelHeader: '{0} von {1} Seiten', + labelFooter: '{0} - {1} von {2} Icons', + placement: 'bottom', // Only in button tag + rows: 6, + search: true, + searchText: 'Stichwortsuche (Bootstrap Glyphicons)', + selectedClass: 'btn-success', + unselectedClass: '' + }; + + $('#poiSymbolPicker').iconpicker($scope.iconPickerOptions); + + $('#poiSymbolPicker').on('change', function(e) { + console.log(e.icon); + // split up due to current data management request structure where we expect only the last name of Bootstrap 3.3.7 glyphicon name + // i.e. "home" for "glyphicon-home" + $scope.selectedPoiIconName = e.icon.substring(e.icon.indexOf('-')+1); + console.log($scope.selectedPoiIconName); + }); + + $scope.loadingData = false; + + // initialize loiDashArray dropdown + setTimeout(function(){ + for(var i=0; i { + $scope.$digest(); + }, 250); + }; + + $scope.onChangeConverter = function(){ + $scope.schema = $scope.converter.schemas ? $scope.converter.schemas[0] : undefined; + $scope.mimeType = $scope.converter.mimeTypes[0]; + }; + + $scope.onChangeMimeType = function(mimeType){ + $scope.mimeType = mimeType; + }; + + $scope.onChangeGeoresourceType = function(){ + + switch ($scope.georesourceType) { + case "poi": + $scope.isPOI = true; + $scope.isLOI = false; + $scope.isAOI = false; + break; + case "loi": + $scope.isPOI = false; + $scope.isLOI = true; + $scope.isAOI = false; + break; + case "aoi": + $scope.isPOI = false; + $scope.isLOI = false; + $scope.isAOI = true; + break; + default: + $scope.isPOI = true; + $scope.isLOI = false; + $scope.isAOI = false; + break; + } + }; + + $scope.checkDatasetName = function(){ + $scope.datasetNameInvalid = false; + kommonitorDataExchangeService.availableGeoresources.forEach(function(georesource){ + if (georesource.datasetName === $scope.datasetName){ + $scope.datasetNameInvalid = true; + return; + } + }); + }; + + $scope.checkPeriodOfValidity = function(){ + $scope.periodOfValidityInvalid = false; + if ($scope.periodOfValidity.startDate && $scope.periodOfValidity.endDate){ + var startDate = new Date($scope.periodOfValidity.startDate); + var endDate = new Date($scope.periodOfValidity.endDate); + + if ((startDate === endDate) || startDate > endDate){ + // failure + $scope.periodOfValidityInvalid = true; + } + } + }; + + $scope.onAddOrUpdateAttributeMapping = function(){ + var tmpAttributeMapping_adminView = { + "sourceName": $scope.attributeMapping_sourceAttributeName, + "destinationName": $scope.attributeMapping_destinationAttributeName, + "dataType": $scope.attributeMapping_attributeType + }; + + var processed = false; + + for (let index = 0; index < $scope.attributeMappings_adminView.length; index++) { + var attributeMappingEntry_adminView = $scope.attributeMappings_adminView[index]; + + if (attributeMappingEntry_adminView.sourceName === tmpAttributeMapping_adminView.sourceName){ + // replace object + $scope.attributeMappings_adminView[index] = tmpAttributeMapping_adminView; + processed = true; + break; + } + } + + if(! processed){ + // new entry + $scope.attributeMappings_adminView.push(tmpAttributeMapping_adminView); + } + + $scope.attributeMapping_sourceAttributeName = undefined; + $scope.attributeMapping_destinationAttributeName = undefined; + $scope.attributeMapping_attributeType = kommonitorImporterHelperService.attributeMapping_attributeTypes[0]; + + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + + $scope.onClickEditAttributeMapping = function(attributeMappingEntry){ + $scope.attributeMapping_sourceAttributeName = attributeMappingEntry.sourceName; + $scope.attributeMapping_destinationAttributeName = attributeMappingEntry.destinationName; + $scope.attributeMapping_attributeType = attributeMappingEntry.dataType; + + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + + $scope.onClickDeleteAttributeMapping = function(attributeMappingEntry){ + for (let index = 0; index < $scope.attributeMappings_adminView.length; index++) { + + if ($scope.attributeMappings_adminView[index].sourceName === attributeMappingEntry.sourceName){ + // remove object + $scope.attributeMappings_adminView.splice(index, 1); + break; + } + } + + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + + $scope.buildImporterObjects = async function(){ + $scope.converterDefinition = $scope.buildConverterDefinition(); + $scope.datasourceTypeDefinition = await $scope.buildDatasourceTypeDefinition(); + $scope.propertyMappingDefinition = $scope.buildPropertyMappingDefinition(); + $scope.postBody_georesources = $scope.buildPostBody_georesources(); + + if(!$scope.converterDefinition || !$scope.datasourceTypeDefinition || !$scope.propertyMappingDefinition || !$scope.postBody_georesources){ + return false; + } + + return true; + }; + + $scope.buildConverterDefinition = function(){ + + return kommonitorImporterHelperService.buildConverterDefinition($scope.converter, "converterParameter_georesourceAdd_", $scope.schema, $scope.mimeType); + }; + + $scope.buildDatasourceTypeDefinition = async function(){ + try { + return await kommonitorImporterHelperService.buildDatasourceTypeDefinition($scope.datasourceType, 'datasourceTypeParameter_georesourceAdd_', 'georesourceDataSourceInput_add'); + } catch (error) { + if(error.data){ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else{ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + + $("#georesourceAddErrorAlert").show(); + $scope.loadingData = false; + return null; + } + }; + + $scope.buildPropertyMappingDefinition = function(){ + // arsion from is undefined currently + return kommonitorImporterHelperService.buildPropertyMapping_spatialResource($scope.georesourceDataSourceNameProperty, $scope.georesourceDataSourceIdProperty, $scope.validityStartDate_perFeature, $scope.validityEndDate_perFeature, undefined, $scope.keepAttributes, $scope.keepMissingValues, $scope.attributeMappings_adminView); + }; + + $scope.buildPostBody_georesources = function(){ + var postBody = + { + "geoJsonString": $scope.geoJsonString, + "allowedRoles": [], + "metadata": { + "note": $scope.metadata.note, + "literature": $scope.metadata.literature, + "updateInterval": $scope.metadata.updateInterval.apiName, + "sridEPSG": $scope.metadata.sridEPSG || 4326, + "datasource": $scope.metadata.datasource, + "contact": $scope.metadata.contact, + "lastUpdate": $scope.metadata.lastUpdate, + "description": $scope.metadata.description, + "databasis": $scope.metadata.databasis + }, + "jsonSchema": null, + "datasetName": $scope.datasetName, + "periodOfValidity": { + "endDate": $scope.periodOfValidity.endDate, + "startDate": $scope.periodOfValidity.startDate + }, + "isAOI": $scope.isAOI, + "isLOI": $scope.isLOI, + "isPOI": $scope.isPOI, + "topicReference": null + }; + + let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); + for (const roleId of roleIds) { + postBody.allowedRoles.push(roleId); + } + + if($scope.isPOI){ + postBody["poiSymbolBootstrap3Name"] = $scope.selectedPoiIconName; + postBody["poiSymbolColor"] = $scope.selectedPoiSymbolColor.colorName; + postBody["poiMarkerColor"] = $scope.selectedPoiMarkerColor.colorName; + + postBody["loiDashArrayString"] = null; + postBody["loiColor"] = null; + postBody["loiWidth"] = 3; + + postBody["aoiColor"] = null; + } + else if($scope.isLOI){ + postBody["poiSymbolBootstrap3Name"] = null; + postBody["poiSymbolColor"] = null; + postBody["poiMarkerColor"] = null; + + postBody["loiDashArrayString"] = $scope.selectedLoiDashArrayObject.dashArrayValue; + postBody["loiColor"] = $scope.loiColor; + postBody["loiWidth"] = $scope.loiWidth; + + postBody["aoiColor"] = null; + } + else if($scope.isAOI){ + postBody["poiSymbolBootstrap3Name"] = null; + postBody["poiSymbolColor"] = null; + postBody["poiMarkerColor"] = null; + + postBody["loiDashArrayString"] = null; + postBody["loiColor"] = null; + postBody["loiWidth"] = 3; + + postBody["aoiColor"] = $scope.aoiColor; + } + + // TOPIC REFERENCE + if($scope.georesourceTopic_subsubsubTopic){ + postBody.topicReference = $scope.georesourceTopic_subsubsubTopic.topicId; + } + else if($scope.georesourceTopic_subsubTopic){ + postBody.topicReference = $scope.georesourceTopic_subsubTopic.topicId; + } + else if($scope.georesourceTopic_subTopic){ + postBody.topicReference = $scope.georesourceTopic_subTopic.topicId; + } + else if($scope.georesourceTopic_mainTopic){ + postBody.topicReference = $scope.georesourceTopic_mainTopic.topicId; + } + else { + postBody.topicReference = ""; + } + + return postBody; + }; + + $scope.addGeoresource = async function(){ + + $timeout(function(){ + $scope.loadingData = true; + }); + + $scope.importerErrors = undefined; + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + + /* + now collect data and build request for importer + */ + + /* + if any required importer data is missing --> cancel request and highlight required errors + */ + var allDataSpecified = await $scope.buildImporterObjects(); + + if (!allDataSpecified) { + + $("#georesourceAddForm").validator("update"); + $("#georesourceAddForm").validator("validate"); + return; + } + else { + + + // TODO verify input + + // TODO Create and perform POST Request with loading screen + + var newGeoresourceResponse_dryRun = undefined; + try { + newGeoresourceResponse_dryRun = await kommonitorImporterHelperService.registerNewGeoresource($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.postBody_georesources, true); + + + if(! kommonitorImporterHelperService.importerResponseContainsErrors(newGeoresourceResponse_dryRun)){ + // all good, really execute the request to import data against data management API + var newGeoresourceResponse = await kommonitorImporterHelperService.registerNewGeoresource($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.postBody_georesources, false); + + $rootScope.$broadcast("refreshGeoresourceOverviewTable", "add", kommonitorImporterHelperService.getIdFromImporterResponse(newGeoresourceResponse)); + + // refresh all admin dashboard diagrams due to modified metadata + $timeout(function(){ + $rootScope.$broadcast("refreshAdminDashboardDiagrams"); + }, 500); + + + $scope.successMessagePart = $scope.postBody_georesources.datasetName; + $scope.importedFeatures = kommonitorImporterHelperService.getImportedFeaturesFromImporterResponse(newGeoresourceResponse); + + $("#georesourceAddSuccessAlert").show(); + + $scope.loadingData = false; + } + else{ + // errors ocurred + // show them + $scope.errorMessagePart = "Einige der zu importierenden Features des Datensatzes weisen kritische Fehler auf"; + $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(newGeoresourceResponse_dryRun); + + $("#georesourceAddErrorAlert").show(); + $scope.loadingData = false; + + setTimeout(() => { + $scope.$digest(); + }, 250); + + } + } catch (error) { + if(error.data){ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else{ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + + if(newGeoresourceResponse_dryRun){ + $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(newGeoresourceResponse_dryRun); + } + + $("#georesourceAddErrorAlert").show(); + $scope.loadingData = false; + + setTimeout(() => { + $scope.$digest(); + }, 250); + } + } + + }; + + $scope.onImportGeoresourceAddMetadata = function(){ + + $scope.georesourceMetadataImportError = ""; + + $("#georesourceMetadataImportFile").files = []; + + // trigger file chooser + $("#georesourceMetadataImportFile").click(); + + }; + + $(document).on("change", "#georesourceMetadataImportFile" ,function(){ + + console.log("Importing Georesource metadata for Add Georesource Form"); + + // get the file + var file = document.getElementById('georesourceMetadataImportFile').files[0]; + $scope.parseMetadataFromFile(file); + }); + + $scope.parseMetadataFromFile = function(file){ + var fileReader = new FileReader(); + + fileReader.onload = function(event) { + + try{ + $scope.parseFromMetadataFile(event); + } + catch(error){ + console.error(error); + console.error("Uploaded Metadata File cannot be parsed."); + $scope.georesourceMetadataImportError = "Uploaded Metadata File cannot be parsed correctly"; + document.getElementById("georesourcesAddMetadataPre").innerHTML = $scope.georesourceMetadataStructure_pretty; + $("#georesourceMetadataImportErrorAlert").show(); + + $scope.$digest(); + } + + }; + + // Read in the image file as a data URL. + fileReader.readAsText(file); + }; + + $scope.parseFromMetadataFile = function(event){ + // $scope.geoJsonString = event.target.result; + $scope.metadataImportSettings = JSON.parse(event.target.result); + + if(! $scope.metadataImportSettings.metadata){ + console.error("uploaded Metadata File cannot be parsed - wrong structure."); + $scope.georesourceMetadataImportError = "Struktur der Datei stimmt nicht mit erwartetem Muster überein."; + document.getElementById("georesourcesAddMetadataPre").innerHTML = $scope.georesourceMetadataStructure_pretty; + $("#georesourceMetadataImportErrorAlert").show(); + + $scope.$digest(); + } + + $scope.metadata = {}; + $scope.metadata.note = $scope.metadataImportSettings.metadata.note; + $scope.metadata.literature = $scope.metadataImportSettings.metadata.literature; + kommonitorDataExchangeService.updateIntervalOptions.forEach(function(option){ + if(option.apiName === $scope.metadataImportSettings.metadata.updateInterval){ + $scope.metadata.updateInterval = option; + } + }); + $scope.metadata.sridEPSG = $scope.metadataImportSettings.metadata.sridEPSG; + $scope.metadata.datasource = $scope.metadataImportSettings.metadata.datasource; + $scope.metadata.contact = $scope.metadataImportSettings.metadata.contact; + $scope.metadata.lastUpdate = $scope.metadataImportSettings.metadata.lastUpdate; + // initialize date + $('#georesourceAddLastUpdateDatepicker').datepicker('setDate', $scope.metadata.lastUpdate); + + $scope.metadata.description = $scope.metadataImportSettings.metadata.description; + $scope.metadata.databasis = $scope.metadataImportSettings.metadata.databasis; + + $scope.datasetName = $scope.metadataImportSettings.datasetName; + + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('georesourceAddRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, $scope.metadataImportSettings.allowedRoles); + + // georesource specific properties + + $scope.isPOI = $scope.metadataImportSettings.isPOI; + $scope.isLOI = $scope.metadataImportSettings.isLOI; + $scope.isAOI = $scope.metadataImportSettings.isAOI; + if($scope.metadataImportSettings.isPOI){ + $scope.georesourceType = "poi"; + } + else if($scope.metadataImportSettings.isLOI){ + $scope.georesourceType = "loi"; + } + else{ + $scope.georesourceType = "aoi"; + } + kommonitorDataExchangeService.availablePoiMarkerColors.forEach(function(option){ + if(option.colorName === $scope.metadataImportSettings.poiMarkerColor){ + $scope.selectedPoiMarkerColor = option; + } + if(option.colorName === $scope.metadataImportSettings.poiSymbolColor){ + $scope.selectedPoiSymbolColor = option; + } + }); + kommonitorDataExchangeService.availableLoiDashArrayObjects.forEach(function(option){ + if(option.dashArrayValue === $scope.metadataImportSettings.loiDashArrayString){ + $scope.selectedLoiDashArrayObject = option; + $scope.onChangeLoiDashArray($scope.selectedLoiDashArrayObject); + } + }); + $scope.loiColor = $scope.metadataImportSettings.loiColor; + $scope.loiWidth = $scope.metadataImportSettings.loiWidth; + $scope.aoiColor = $scope.metadataImportSettings.aoiColor; + $scope.selectedPoiIconName = $scope.metadataImportSettings.poiSymbolBootstrap3Name; + + var topicHierarchy = kommonitorDataExchangeService.getTopicHierarchyForTopicId($scope.metadataImportSettings.topicReference); + + if(topicHierarchy && topicHierarchy[0]){ + $scope.georesourceTopic_mainTopic = topicHierarchy[0]; + } + if(topicHierarchy && topicHierarchy[1]){ + $scope.georesourceTopic_subTopic = topicHierarchy[1]; + } + if(topicHierarchy && topicHierarchy[2]){ + $scope.georesourceTopic_subsubTopic = topicHierarchy[2]; + } + if(topicHierarchy && topicHierarchy[3]){ + $scope.georesourceTopic_subsubsubTopic = topicHierarchy[3]; + } + + setTimeout(function(){ + $("#poiSymbolPicker").val("").iconpicker('setIcon', 'glyphicon-' + $scope.metadataImportSettings.poiSymbolBootstrap3Name); + // $("#poiSymbolPicker i").css('glyphicon glyphicon-' + $scope.metadataImportSettings.poiSymbolBootstrap3Name); + // $("#poiSymbolPicker input").css('glyphicon-' + $scope.metadataImportSettings.poiSymbolBootstrap3Name); + }, 200); + + $scope.$digest(); + } + + $scope.onExportGeoresourceAddMetadataTemplate = function(){ + + var metadataJSON = JSON.stringify($scope.georesourceMetadataStructure); + + var fileName = "Georessource_Metadaten_Vorlage_Export.json"; + + var blob = new Blob([metadataJSON], {type: "application/json"}); + var data = URL.createObjectURL(blob); + + var a = document.createElement('a'); + a.download = fileName; + a.href = data; + a.textContent = "JSON"; + a.target = "_blank"; + a.rel = "noopener noreferrer"; + a.click(); + + a.remove(); + }; + + $scope.onExportGeoresourceAddMetadata = function(){ + var metadataExport = $scope.georesourceMetadataStructure; + + metadataExport.metadata.note = $scope.metadata.note || ""; + metadataExport.metadata.literature = $scope.metadata.literature || ""; + metadataExport.metadata.sridEPSG = $scope.metadata.sridEPSG || ""; + metadataExport.metadata.datasource = $scope.metadata.datasource || ""; + metadataExport.metadata.contact = $scope.metadata.contact || ""; + metadataExport.metadata.lastUpdate = $scope.metadata.lastUpdate || ""; + metadataExport.metadata.description = $scope.metadata.description || ""; + metadataExport.metadata.databasis = $scope.metadata.databasis || ""; + metadataExport.datasetName = $scope.datasetName || ""; + + metadataExport.allowedRoles = []; + + let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); + for (const roleId of roleIds) { + metadataExport.allowedRoles.push(roleId); + } + + if($scope.metadata.updateInterval){ + metadataExport.metadata.updateInterval = $scope.metadata.updateInterval.apiName; + } + + var name = $scope.datasetName; + + // georesource specific properties + metadataExport.isPOI = $scope.isPOI; + metadataExport.isLOI = $scope.isLOI; + metadataExport.isAOI = $scope.isAOI; + + if($scope.isPOI){ + metadataExport["poiSymbolBootstrap3Name"] = $scope.selectedPoiIconName; + metadataExport["poiSymbolColor"] = $scope.selectedPoiSymbolColor.colorName; + metadataExport["poiMarkerColor"] = $scope.selectedPoiMarkerColor.colorName; + + metadataExport["loiDashArrayString"] = ""; + metadataExport["loiColor"] = ""; + metadataExport["loiWidth"] = ""; + + metadataExport["aoiColor"] = ""; + } + else if($scope.isLOI){ + metadataExport["poiSymbolBootstrap3Name"] = ""; + metadataExport["poiSymbolColor"] = ""; + metadataExport["poiMarkerColor"] = ""; + + metadataExport["loiDashArrayString"] = $scope.selectedLoiDashArrayObject.dashArrayValue; + metadataExport["loiColor"] = $scope.loiColor; + metadataExport["loiWidth"] = $scope.loiWidth; + + + metadataExport["aoiColor"] = ""; + } + else if($scope.isAOI){ + metadataExport["poiSymbolBootstrap3Name"] = ""; + metadataExport["poiSymbolColor"] = ""; + metadataExport["poiMarkerColor"] = ""; + + metadataExport["loiDashArrayString"] = ""; + metadataExport["loiColor"] = ""; + metadataExport["loiWidth"] = ""; + + metadataExport["aoiColor"] = $scope.aoiColor; + } + + if($scope.georesourceTopic_subsubsubTopic){ + metadataExport.topicReference = $scope.georesourceTopic_subsubsubTopic.topicId; + } + else if($scope.georesourceTopic_subsubTopic){ + metadataExport.topicReference = $scope.georesourceTopic_subsubTopic.topicId; + } + else if($scope.georesourceTopic_subTopic){ + metadataExport.topicReference = $scope.georesourceTopic_subTopic.topicId; + } + else if($scope.georesourceTopic_mainTopic){ + metadataExport.topicReference = $scope.georesourceTopic_mainTopic.topicId; + } + else { + metadataExport.topicReference = ""; + } + + + var metadataJSON = JSON.stringify(metadataExport); + + var fileName = "Georessource_Metadaten_Export"; + + if (name){ + fileName += "-" + name; + } + + fileName += ".json"; + + var blob = new Blob([metadataJSON], {type: "application/json"}); + var data = URL.createObjectURL(blob); + + var a = document.createElement('a'); + a.download = fileName; + a.href = data; + a.textContent = "JSON"; + a.target = "_blank"; + a.rel = "noopener noreferrer"; + a.click(); + + a.remove(); + }; + + $scope.onChangeMarkerColor = function(markerColor){ + $scope.selectedPoiMarkerColor = markerColor; + }; + + $scope.onChangeSymbolColor = function(symbolColor){ + $scope.selectedPoiSymbolColor = symbolColor; + }; + + $scope.onChangeLoiDashArray = function(loiDashArrayObject){ + $scope.selectedLoiDashArrayObject = loiDashArrayObject; + + $("#loiDashArrayDropdownButton_addGeoresource").html(loiDashArrayObject.svgString); + }; + + $scope.onImportGeoresourceAddMappingConfig = function(){ + + $scope.georesourceMappingConfigImportError = ""; + + $("#georesourceMappingConfigAddImportFile").files = []; + + // trigger file chooser + $("#georesourceMappingConfigAddImportFile").click(); + + }; + + $(document).on("change", "#georesourceMappingConfigAddImportFile" ,function(){ + + console.log("Importing Importer Mapping Config for Add Georesource Form"); + + // get the file + var file = document.getElementById('georesourceMappingConfigAddImportFile').files[0]; + $scope.parseMappingConfigFromFile(file); + }); + + $scope.parseMappingConfigFromFile = function(file){ + var fileReader = new FileReader(); + + fileReader.onload = function(event) { + + try{ + $scope.parseFromMappingConfigFile(event); + } + catch(error){ + console.error(error); + console.error("Uploaded MappingConfig File cannot be parsed."); + $scope.georesourceMappingConfigImportError = "Uploaded MappingConfig File cannot be parsed correctly"; + document.getElementById("georesourcesAddMappingConfigPre").innerHTML = $scope.georesourceMappingConfigStructure_pretty; + $("#georesourceMappingConfigImportErrorAlert").show(); + + $scope.$digest(); + } + + }; + + // Read in the image file as a data URL. + fileReader.readAsText(file); + }; + + $scope.parseFromMappingConfigFile = function(event){ + $scope.mappingConfigImportSettings = JSON.parse(event.target.result); + + if(! $scope.mappingConfigImportSettings.converter || ! $scope.mappingConfigImportSettings.dataSource || ! $scope.mappingConfigImportSettings.propertyMapping){ + console.error("uploaded MappingConfig File cannot be parsed - wrong structure."); + $scope.georesourceMetadataImportError = "Struktur der Datei stimmt nicht mit erwartetem Muster überein."; + document.getElementById("georesourcesAddMappingConfigPre").innerHTML = $scope.georesourceMappingConfigStructure_pretty; + $("#georesourceMappingConfigImportErrorAlert").show(); + + $scope.$digest(); + } + + $scope.converter = undefined; + for(var converter of kommonitorImporterHelperService.availableConverters){ + if (converter.name === $scope.mappingConfigImportSettings.converter.name){ + $scope.converter = converter; + break; + } + } + + $scope.schema = undefined; + if ($scope.converter && $scope.converter.schemas && $scope.mappingConfigImportSettings.converter.schema){ + for (var schema of $scope.converter.schemas) { + if (schema === $scope.mappingConfigImportSettings.converter.schema){ + $scope.schema = schema; + } + } + } + + $scope.mimeType = undefined; + if ($scope.converter && $scope.converter.mimeTypes && $scope.mappingConfigImportSettings.converter.mimeType){ + for (var mimeType of $scope.converter.mimeTypes) { + if (mimeType === $scope.mappingConfigImportSettings.converter.mimeType){ + $scope.mimeType = mimeType; + } + } + } + + $scope.datasourceType = undefined; + for(var datasourceType of kommonitorImporterHelperService.availableDatasourceTypes){ + if (datasourceType.type === $scope.mappingConfigImportSettings.dataSource.type){ + $scope.datasourceType = datasourceType; + break; + } + } + + $scope.$digest(); + + // converter parameters + if ($scope.converter){ + for (var convParameter of $scope.mappingConfigImportSettings.converter.parameters) { + $("#converterParameter_georesourceAdd_" + convParameter.name).val(convParameter.value); + } + } + + // datasourceTypes parameters + if ($scope.datasourceType){ + for (var dsParameter of $scope.mappingConfigImportSettings.dataSource.parameters) { + $("#datasourceTypeParameter_georesourceAdd_" + dsParameter.name).val(dsParameter.value); + } + } + + // property Mapping + $scope.georesourceDataSourceNameProperty = $scope.mappingConfigImportSettings.propertyMapping.nameProperty; + $scope.georesourceDataSourceIdProperty = $scope.mappingConfigImportSettings.propertyMapping.identifierProperty; + $scope.validityStartDate_perFeature = $scope.mappingConfigImportSettings.propertyMapping.validStartDateProperty; + $scope.validityEndDate_perFeature = $scope.mappingConfigImportSettings.propertyMapping.validEndDateProperty; + $scope.keepAttributes = $scope.mappingConfigImportSettings.propertyMapping.keepAttributes; + $scope.keepMissingValues = $scope.mappingConfigImportSettings.propertyMapping.keepMissingOrNullValueAttributes; + $scope.attributeMappings_adminView = []; + + for (var attributeMapping of $scope.mappingConfigImportSettings.propertyMapping.attributes) { + var tmpEntry = { + "sourceName": attributeMapping.name, + "destinationName": attributeMapping.mappingName + }; + + for (const dataType of kommonitorImporterHelperService.attributeMapping_attributeTypes) { + if (dataType.apiName === attributeMapping.type){ + tmpEntry.dataType = dataType; + } + } + + $scope.attributeMappings_adminView.push(tmpEntry); + } + + if ($scope.mappingConfigImportSettings.periodOfValidity){ + $scope.periodOfValidity = {}; + $scope.periodOfValidity.startDate = $scope.mappingConfigImportSettings.periodOfValidity.startDate; + $scope.periodOfValidity.endDate = $scope.mappingConfigImportSettings.periodOfValidity.endDate; + $scope.periodOfValidityInvalid = false; + + // update datePickers + if ($scope.periodOfValidity.startDate){ + $("#georesourceAddDatepickerStart").datepicker('setDate', $scope.periodOfValidity.startDate); + } + if ($scope.periodOfValidity.endDate){ + $("#georesourceAddDatepickerEnd").datepicker('setDate', $scope.periodOfValidity.endDate); + } + } + + $scope.$digest(); + }; + + $scope.onExportGeoresourceAddMappingConfig = async function(){ + var converterDefinition = $scope.buildConverterDefinition(); + var datasourceTypeDefinition = await $scope.buildDatasourceTypeDefinition(); + var propertyMappingDefinition = $scope.buildPropertyMappingDefinition(); + + var mappingConfigExport = { + "converter": converterDefinition, + "dataSource": datasourceTypeDefinition, + "propertyMapping": propertyMappingDefinition, + }; + + mappingConfigExport.periodOfValidity = $scope.periodOfValidity; + + var name = $scope.datasetName; + + var metadataJSON = JSON.stringify(mappingConfigExport); + + var fileName = "KomMonitor-Import-Mapping-Konfiguration_Export"; + + if (name){ + fileName += "-" + name; + } + + fileName += ".json"; + + var blob = new Blob([metadataJSON], {type: "application/json"}); + var data = URL.createObjectURL(blob); + + var a = document.createElement('a'); + a.download = fileName; + a.href = data; + a.textContent = "JSON"; + a.target = "_blank"; + a.rel = "noopener noreferrer"; + a.click(); + + a.remove(); + }; + + + + $scope.hideSuccessAlert = function(){ + $("#georesourceAddSuccessAlert").hide(); + }; + + $scope.hideErrorAlert = function(){ + $("#georesourceAddErrorAlert").hide(); + }; + + $scope.hideMetadataErrorAlert = function(){ + $("#georesourceMetadataImportErrorAlert").hide(); + }; + + $scope.hideMappingConfigErrorAlert = function(){ + $("#georesourceMappingConfigImportErrorAlert").hide(); + }; + + kommonitorMultiStepFormHelperService.registerClickHandler(); + + } +]}); diff --git a/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceAddModal/georesource-add-modal.module.js b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceAddModal/georesource-add-modal.module.js index d5b8b40f3..666bdef08 100644 --- a/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceAddModal/georesource-add-modal.module.js +++ b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceAddModal/georesource-add-modal.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('georesourceAddModal', ['kommonitorImporterHelper', 'excaliburDualList', 'kommonitorMultiStepFormHelper', 'kommonitorDataGridHelper']); +//# sourceMappingURL=georesource-add-modal.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceAddModal/georesource-add-modal.module.js.map b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceAddModal/georesource-add-modal.module.js.map new file mode 100644 index 000000000..d49763a81 --- /dev/null +++ b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceAddModal/georesource-add-modal.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"georesource-add-modal.module.js","sourceRoot":"","sources":["georesource-add-modal.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,qBAAqB,EAAE,CAAC,0BAA0B,EAAE,mBAAmB,EAAE,+BAA+B,EAAE,0BAA0B,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceAddModal/georesource-add-modal.module.ts b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceAddModal/georesource-add-modal.module.ts new file mode 100644 index 000000000..d5b8b40f3 --- /dev/null +++ b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceAddModal/georesource-add-modal.module.ts @@ -0,0 +1 @@ +angular.module('georesourceAddModal', ['kommonitorImporterHelper', 'excaliburDualList', 'kommonitorMultiStepFormHelper', 'kommonitorDataGridHelper']); diff --git a/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceBatchUpdateModal/georesource-batch-update-modal.component.js b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceBatchUpdateModal/georesource-batch-update-modal.component.js index 14e5bce1b..e52bde1d2 100644 --- a/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceBatchUpdateModal/georesource-batch-update-modal.component.js +++ b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceBatchUpdateModal/georesource-batch-update-modal.component.js @@ -1,190 +1,159 @@ +"use strict"; angular.module('georesourceBatchUpdateModal').component('georesourceBatchUpdateModal', { - templateUrl : "components/kommonitorAdmin/adminGeoresourcesManagement/georesourceBatchUpdateModal/georesource-batch-update-modal.template.html", - controller : ['kommonitorDataExchangeService', 'kommonitorImporterHelperService', 'kommonitorBatchUpdateHelperService', '$scope', '$rootScope', '$http', '$timeout', '__env', - function GeoresourceBatchUpdateModalController(kommonitorDataExchangeService, kommonitorImporterHelperService, kommonitorBatchUpdateHelperService, $scope, $rootScope, $http, $timeout, __env) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorImporterHelperServiceInstance = kommonitorImporterHelperService; - this.kommonitorBatchUpdateHelperServiceInstance = kommonitorBatchUpdateHelperService; - - $scope.isFirstStart = true; - $scope.lastUpdateResponseObj; - $scope.keepMissingValues = true; - - /* - { - "converter": { - "encoding": "string", - "mimeType": "string", - "name": "string", - "parameters": [{ - "name": "string", - "value": "string" - }], - "schema": "string" - }, - "dataSource": { - "parameters": [{ - "name": "string", - "value": "string" - }], - "type": "FILE" // FILE|HTTP|INLINE - }, - "propertyMapping": { - "arisenFromProperty": "string", - "attributes": [{ - "mappingName": "string", // target name - "name": "string", // source name - "type": "string" // dataType, [string|integer|float|date] - }], - "identifierProperty": "string", - "keepAttributes": true, // if true, then mapping under attributes is ignored and all attributes are imported with the same attribute name - "nameProperty": "string", - "validEndDateProperty": "string", - "validStartDateProperty": "string" - }, - "periodOfValidity": { - "startDate": "yyyy-mm-tt", - "endDate": "yyyy-mm-tt" - } - } - */ - $scope.batchList = []; - - - // on modal opened - $('#modal-batch-update-georesources').on('show.bs.modal', function () { - // this check is necessary to avoid running the initialize method on opening datepicker modals - if(event) { - if(event.target.id === "button-batch-update-georesources") { - $scope.initialize(); - } - } - }); - - // initializes the modal - $scope.initialize = function() { - - if($scope.isFirstStart) { - kommonitorBatchUpdateHelperService.addNewRowToBatchList("georesource", $scope.batchList) - $scope.isFirstStart = false; - } - - $('#georesourceDefaultColumnDatePickerStart').datepicker(kommonitorDataExchangeService.datePickerOptions); - $('#georesourceDefaultColumnDatePickerEnd').datepicker(kommonitorDataExchangeService.datePickerOptions); - - $(document).on("change", ".georesourceMappingTableInputField", function(){ - // get index of changed field - var index = kommonitorBatchUpdateHelperService.getIndexFromId(this.id); - - // get file - var file = this.files[0]; - - // read content - var reader = new FileReader(); - reader.addEventListener('load', function(event) { - kommonitorBatchUpdateHelperService.onMappingTableSelected("georesource", event, index, file, $scope.batchList); - }); - reader.readAsText(file) - }); - - $(document).on("change", ".georesourceDataSourceFileInputField", function(){ - // get index of changed field - var index = kommonitorBatchUpdateHelperService.getIndexFromId(this.id); - - // get file - var file = this.files[0]; - - // read content - var reader = new FileReader(); - reader.addEventListener('load', function() { - kommonitorBatchUpdateHelperService.onDataSourceFileSelected(file, index, $scope.batchList); - }); - reader.readAsText(file) - }); - - $scope.$digest(); - }; - - $scope.loadGeoresourcesBatchList = function() { - $("#georesourcesBatchListFile").files = []; - - // trigger file chooser - $("#georesourcesBatchListFile").trigger("click"); - }; - - $(document).on("change", "#georesourcesBatchListFile" ,function(){ - - // get the file - var file = document.getElementById('georesourcesBatchListFile').files[0]; - kommonitorBatchUpdateHelperService.parseBatchListFromFile("georesource", file, $scope.batchList) - }); - - $scope.$on('georesourceBatchListParsed', function(event, data) { - $timeout(function() { - - var newBatchList = data.newValue; - - // remove all rows - for (var i = 0; i < $scope.batchList.length; i++) - $scope.batchList[i].isSelected = true; - kommonitorBatchUpdateHelperService.deleteSelectedRowsFromBatchList($scope.batchList, $scope.allRowsSelected); - - - for(let i=0;i 0){ - // error handling - $("#georesourcesDeleteErrorAlert").show(); - // if ($scope.successfullyDeletedDatasets.length > 0){ - // $("#georesourcesDeleteSuccessAlert").show(); - // } - - $timeout(function(){ - - $scope.loadingData = false; - }); - } - if($scope.successfullyDeletedDatasets.length > 0){ - $("#georesourcesDeleteSuccessAlert").show(); - - // refresh spatial unit overview table - $rootScope.$broadcast("refreshGeoresourceOverviewTable", "delete", $scope.successfullyDeletedDatasets.map(dataset => {return dataset.georesourceId;})); - - // refresh all admin dashboard diagrams due to modified metadata - $timeout(function(){ - $rootScope.$broadcast("refreshAdminDashboardDiagrams"); - }, 500); - - - $timeout(function(){ - - $scope.loadingData = false; - }); - } - }, function errorCallback(errorArray) { - - $("#georesourcesDeleteErrorAlert").show(); - // if ($scope.successfullyDeletedDatasets.length > 0){ - // $("#georesourcesDeleteSuccessAlert").show(); - // } - - $rootScope.$broadcast("refreshGeoresourceOverviewTable"); - $scope.loadingData = false; - }); - - }; - - $scope.getDeleteDatasetPromise = function(dataset){ - return $http({ - url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/georesources/" + dataset.georesourceId, - method: "DELETE" - }).then(function successCallback(response) { - $scope.successfullyDeletedDatasets.push(dataset); - - // remove entry from array - var index = -1; - - for(var i=0; i< kommonitorDataExchangeService.availableGeoresources.length; i++){ - if(kommonitorDataExchangeService.availableGeoresources[i].georesourceId === dataset.georesourceId){ - index = i; - break; - } - } - - if (index > -1) { - kommonitorDataExchangeService.availableGeoresources.splice(index, 1); - } - - }, function errorCallback(error) { - if(error.data){ - $scope.failedDatasetsAndErrors.push([dataset, kommonitorDataExchangeService.syntaxHighlightJSON(error.data)]); - } - else{ - $scope.failedDatasetsAndErrors.push([dataset, kommonitorDataExchangeService.syntaxHighlightJSON(error)]); - } - }); - }; - - $scope.hideSuccessAlert = function(){ - $("#georesourcesDeleteSuccessAlert").hide(); - }; - - $scope.hideErrorAlert = function(){ - $("#georesourcesDeleteErrorAlert").hide(); - }; - - } -]}); + templateUrl: "components/kommonitorAdmin/adminGeoresourcesManagement/georesourceDeleteModal/georesource-delete-modal.template.html", + controller: ['kommonitorDataExchangeService', '$scope', '$rootScope', '$http', '__env', '$q', '$timeout', function GeoresourceDeleteModalController(kommonitorDataExchangeService, $scope, $rootScope, $http, __env, $q, $timeout) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + $scope.datasetsToDelete = []; + $scope.loadingData = false; + $scope.successfullyDeletedDatasets = []; + $scope.failedDatasetsAndErrors = []; + $scope.affectedScripts = []; + $scope.affectedIndicatorReferences = []; + $scope.$on("onDeleteGeoresources", function (event, datasets) { + $scope.loadingData = true; + $scope.datasetsToDelete = datasets; + $scope.resetGeoresourcesDeleteForm(); + $timeout(function () { + $scope.loadingData = false; + }); + }); + $scope.resetGeoresourcesDeleteForm = function () { + $scope.successfullyDeletedDatasets = []; + $scope.failedDatasetsAndErrors = []; + $scope.affectedScripts = $scope.gatherAffectedScripts(); + $scope.affectedIndicatorReferences = $scope.gatherAffectedIndicatorReferences(); + $("#georesourcesDeleteSuccessAlert").hide(); + $("#georesourcesDeleteErrorAlert").hide(); + }; + $scope.gatherAffectedScripts = function () { + $scope.affectedScripts = []; + kommonitorDataExchangeService.availableProcessScripts.forEach(function (script) { + var requiredGeoresourceIds = script.requiredGeoresourceIds; + for (var i = 0; i < requiredGeoresourceIds.length; i++) { + var georesourceId = requiredGeoresourceIds[i]; + for (var k = 0; k < $scope.datasetsToDelete.length; k++) { + var datasetToDelete = $scope.datasetsToDelete[k]; + if (georesourceId === datasetToDelete.georesourceId) { + $scope.affectedScripts.push(script); + break; + } + } + } + }); + return $scope.affectedScripts; + }; + $scope.gatherAffectedIndicatorReferences = function () { + $scope.affectedIndicatorReferences = []; + kommonitorDataExchangeService.availableIndicators.forEach(function (indicator) { + var georesourceReferences = indicator.referencedGeoresources; + for (var i = 0; i < georesourceReferences.length; i++) { + var georesourceReference = georesourceReferences[i]; + for (var k = 0; k < $scope.datasetsToDelete.length; k++) { + var datasetToDelete = $scope.datasetsToDelete[k]; + if (georesourceReference.referencedGeoresourceId === datasetToDelete.georesourceId) { + $scope.affectedIndicatorReferences.push({ + "indicatorMetadata": indicator, + "georesourceReference": georesourceReference + }); + break; + } + } + } + }); + return $scope.affectedIndicatorReferences; + }; + $scope.deleteGeoresources = function () { + $scope.loadingData = true; + var deletePromises = []; + $scope.datasetsToDelete.forEach(function (dataset) { + deletePromises.push($scope.getDeleteDatasetPromise(dataset)); + }); + $q.all(deletePromises).then(async function successCallback(successArray) { + // + if ($scope.failedDatasetsAndErrors.length > 0) { + // error handling + $("#georesourcesDeleteErrorAlert").show(); + // if ($scope.successfullyDeletedDatasets.length > 0){ + // $("#georesourcesDeleteSuccessAlert").show(); + // } + $timeout(function () { + $scope.loadingData = false; + }); + } + if ($scope.successfullyDeletedDatasets.length > 0) { + $("#georesourcesDeleteSuccessAlert").show(); + // refresh spatial unit overview table + $rootScope.$broadcast("refreshGeoresourceOverviewTable", "delete", $scope.successfullyDeletedDatasets.map(dataset => { return dataset.georesourceId; })); + // refresh all admin dashboard diagrams due to modified metadata + $timeout(function () { + $rootScope.$broadcast("refreshAdminDashboardDiagrams"); + }, 500); + $timeout(function () { + $scope.loadingData = false; + }); + } + }, function errorCallback(errorArray) { + $("#georesourcesDeleteErrorAlert").show(); + // if ($scope.successfullyDeletedDatasets.length > 0){ + // $("#georesourcesDeleteSuccessAlert").show(); + // } + $rootScope.$broadcast("refreshGeoresourceOverviewTable"); + $scope.loadingData = false; + }); + }; + $scope.getDeleteDatasetPromise = function (dataset) { + return $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/georesources/" + dataset.georesourceId, + method: "DELETE" + }).then(function successCallback(response) { + $scope.successfullyDeletedDatasets.push(dataset); + // remove entry from array + var index = -1; + for (var i = 0; i < kommonitorDataExchangeService.availableGeoresources.length; i++) { + if (kommonitorDataExchangeService.availableGeoresources[i].georesourceId === dataset.georesourceId) { + index = i; + break; + } + } + if (index > -1) { + kommonitorDataExchangeService.availableGeoresources.splice(index, 1); + } + }, function errorCallback(error) { + if (error.data) { + $scope.failedDatasetsAndErrors.push([dataset, kommonitorDataExchangeService.syntaxHighlightJSON(error.data)]); + } + else { + $scope.failedDatasetsAndErrors.push([dataset, kommonitorDataExchangeService.syntaxHighlightJSON(error)]); + } + }); + }; + $scope.hideSuccessAlert = function () { + $("#georesourcesDeleteSuccessAlert").hide(); + }; + $scope.hideErrorAlert = function () { + $("#georesourcesDeleteErrorAlert").hide(); + }; + } + ] +}); +//# sourceMappingURL=georesource-delete-modal.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceDeleteModal/georesource-delete-modal.component.js.map b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceDeleteModal/georesource-delete-modal.component.js.map new file mode 100644 index 000000000..eb252ada7 --- /dev/null +++ b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceDeleteModal/georesource-delete-modal.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"georesource-delete-modal.component.js","sourceRoot":"","sources":["georesource-delete-modal.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC,SAAS,CAAC,wBAAwB,EAAE;IAC5E,WAAW,EAAG,sHAAsH;IACpI,UAAU,EAAG,CAAC,+BAA+B,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,gCAAgC,CAAC,6BAA6B,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ;YAEjO,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAE3E,MAAM,CAAC,gBAAgB,GAAG,EAAE,CAAC;YAE7B,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;YAE3B,MAAM,CAAC,2BAA2B,GAAG,EAAE,CAAC;YACxC,MAAM,CAAC,uBAAuB,GAAG,EAAE,CAAC;YAEpC,MAAM,CAAC,eAAe,GAAG,EAAE,CAAC;YAC5B,MAAM,CAAC,2BAA2B,GAAG,EAAE,CAAC;YAExC,MAAM,CAAC,GAAG,CAAC,sBAAsB,EAAE,UAAU,KAAK,EAAE,QAAQ;gBAC3D,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC;gBAE1B,MAAM,CAAC,gBAAgB,GAAG,QAAQ,CAAC;gBAEnC,MAAM,CAAC,2BAA2B,EAAE,CAAC;gBAErC,QAAQ,CAAC;oBAER,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;gBAC5B,CAAC,CAAC,CAAC;YACJ,CAAC,CAAC,CAAC;YAGH,MAAM,CAAC,2BAA2B,GAAG;gBAEpC,MAAM,CAAC,2BAA2B,GAAG,EAAE,CAAC;gBACxC,MAAM,CAAC,uBAAuB,GAAG,EAAE,CAAC;gBACpC,MAAM,CAAC,eAAe,GAAG,MAAM,CAAC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,CAAC,GAAC,CAAC,EAAE,CAAC,GAAE,6BAA6B,CAAC,qBAAqB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAC;wBAC/E,IAAG,6BAA6B,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,aAAa,KAAK,OAAO,CAAC,aAAa,EAAC;4BACjG,KAAK,GAAG,CAAC,CAAC;4BACV,MAAM;yBACN;qBACD;oBAED,IAAI,KAAK,GAAG,CAAC,CAAC,EAAE;wBACd,6BAA6B,CAAC,qBAAqB,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;qBACtE;gBAEH,CAAC,EAAE,SAAS,aAAa,CAAC,KAAK;oBAC9B,IAAG,KAAK,CAAC,IAAI,EAAC;wBACb,MAAM,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,6BAA6B,CAAC,mBAAmB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;qBAC9G;yBACG;wBACH,MAAM,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,6BAA6B,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;qBACzG;gBACH,CAAC,CAAC,CAAC;YACJ,CAAC,CAAC;YAEF,MAAM,CAAC,gBAAgB,GAAG;gBACzB,CAAC,CAAC,iCAAiC,CAAC,CAAC,IAAI,EAAE,CAAC;YAC7C,CAAC,CAAC;YAEF,MAAM,CAAC,cAAc,GAAG;gBACvB,CAAC,CAAC,+BAA+B,CAAC,CAAC,IAAI,EAAE,CAAC;YAC3C,CAAC,CAAC;QAEJ,CAAC;KACD;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceDeleteModal/georesource-delete-modal.component.ts b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceDeleteModal/georesource-delete-modal.component.ts new file mode 100644 index 000000000..d26a22af2 --- /dev/null +++ b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceDeleteModal/georesource-delete-modal.component.ts @@ -0,0 +1,181 @@ +angular.module('georesourceDeleteModal').component('georesourceDeleteModal', { + templateUrl : "components/kommonitorAdmin/adminGeoresourcesManagement/georesourceDeleteModal/georesource-delete-modal.template.html", + controller : ['kommonitorDataExchangeService', '$scope', '$rootScope', '$http', '__env', '$q', '$timeout', function GeoresourceDeleteModalController(kommonitorDataExchangeService, $scope, $rootScope, $http, __env, $q, $timeout) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + + $scope.datasetsToDelete = []; + + $scope.loadingData = false; + + $scope.successfullyDeletedDatasets = []; + $scope.failedDatasetsAndErrors = []; + + $scope.affectedScripts = []; + $scope.affectedIndicatorReferences = []; + + $scope.$on("onDeleteGeoresources", function (event, datasets) { + $scope.loadingData = true; + + $scope.datasetsToDelete = datasets; + + $scope.resetGeoresourcesDeleteForm(); + + $timeout(function(){ + + $scope.loadingData = false; + }); + }); + + + $scope.resetGeoresourcesDeleteForm = function(){ + + $scope.successfullyDeletedDatasets = []; + $scope.failedDatasetsAndErrors = []; + $scope.affectedScripts = $scope.gatherAffectedScripts(); + $scope.affectedIndicatorReferences = $scope.gatherAffectedIndicatorReferences(); + $("#georesourcesDeleteSuccessAlert").hide(); + $("#georesourcesDeleteErrorAlert").hide(); + }; + + $scope.gatherAffectedScripts = function(){ + $scope.affectedScripts = []; + + kommonitorDataExchangeService.availableProcessScripts.forEach(function(script){ + var requiredGeoresourceIds = script.requiredGeoresourceIds; + + for(var i=0; i 0){ + // error handling + $("#georesourcesDeleteErrorAlert").show(); + // if ($scope.successfullyDeletedDatasets.length > 0){ + // $("#georesourcesDeleteSuccessAlert").show(); + // } + + $timeout(function(){ + + $scope.loadingData = false; + }); + } + if($scope.successfullyDeletedDatasets.length > 0){ + $("#georesourcesDeleteSuccessAlert").show(); + + // refresh spatial unit overview table + $rootScope.$broadcast("refreshGeoresourceOverviewTable", "delete", $scope.successfullyDeletedDatasets.map(dataset => {return dataset.georesourceId;})); + + // refresh all admin dashboard diagrams due to modified metadata + $timeout(function(){ + $rootScope.$broadcast("refreshAdminDashboardDiagrams"); + }, 500); + + + $timeout(function(){ + + $scope.loadingData = false; + }); + } + }, function errorCallback(errorArray) { + + $("#georesourcesDeleteErrorAlert").show(); + // if ($scope.successfullyDeletedDatasets.length > 0){ + // $("#georesourcesDeleteSuccessAlert").show(); + // } + + $rootScope.$broadcast("refreshGeoresourceOverviewTable"); + $scope.loadingData = false; + }); + + }; + + $scope.getDeleteDatasetPromise = function(dataset){ + return $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/georesources/" + dataset.georesourceId, + method: "DELETE" + }).then(function successCallback(response) { + $scope.successfullyDeletedDatasets.push(dataset); + + // remove entry from array + var index = -1; + + for(var i=0; i< kommonitorDataExchangeService.availableGeoresources.length; i++){ + if(kommonitorDataExchangeService.availableGeoresources[i].georesourceId === dataset.georesourceId){ + index = i; + break; + } + } + + if (index > -1) { + kommonitorDataExchangeService.availableGeoresources.splice(index, 1); + } + + }, function errorCallback(error) { + if(error.data){ + $scope.failedDatasetsAndErrors.push([dataset, kommonitorDataExchangeService.syntaxHighlightJSON(error.data)]); + } + else{ + $scope.failedDatasetsAndErrors.push([dataset, kommonitorDataExchangeService.syntaxHighlightJSON(error)]); + } + }); + }; + + $scope.hideSuccessAlert = function(){ + $("#georesourcesDeleteSuccessAlert").hide(); + }; + + $scope.hideErrorAlert = function(){ + $("#georesourcesDeleteErrorAlert").hide(); + }; + + } +]}); diff --git a/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceDeleteModal/georesource-delete-modal.module.js b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceDeleteModal/georesource-delete-modal.module.js index daf6f631a..fa6c7db61 100644 --- a/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceDeleteModal/georesource-delete-modal.module.js +++ b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceDeleteModal/georesource-delete-modal.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('georesourceDeleteModal', []); +//# sourceMappingURL=georesource-delete-modal.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceDeleteModal/georesource-delete-modal.module.js.map b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceDeleteModal/georesource-delete-modal.module.js.map new file mode 100644 index 000000000..b2c367726 --- /dev/null +++ b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceDeleteModal/georesource-delete-modal.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"georesource-delete-modal.module.js","sourceRoot":"","sources":["georesource-delete-modal.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,wBAAwB,EAAE,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceDeleteModal/georesource-delete-modal.module.ts b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceDeleteModal/georesource-delete-modal.module.ts new file mode 100644 index 000000000..daf6f631a --- /dev/null +++ b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceDeleteModal/georesource-delete-modal.module.ts @@ -0,0 +1 @@ +angular.module('georesourceDeleteModal', []); diff --git a/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditFeaturesModal/georesource-edit-features-modal.component.js b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditFeaturesModal/georesource-edit-features-modal.component.js index 61e0450c0..487dcb6e5 100644 --- a/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditFeaturesModal/georesource-edit-features-modal.component.js +++ b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditFeaturesModal/georesource-edit-features-modal.component.js @@ -1,1016 +1,799 @@ +"use strict"; angular.module('georesourceEditFeaturesModal').component('georesourceEditFeaturesModal', { - templateUrl : "components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditFeaturesModal/georesource-edit-features-modal.template.html", - controller : ['kommonitorDataExchangeService', 'kommonitorDataGridHelperService', 'kommonitorSingleFeatureMapHelperService', - 'kommonitorImporterHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', 'kommonitorMultiStepFormHelperService', - function GeoresourcesEditFeaturesModalController(kommonitorDataExchangeService, kommonitorDataGridHelperService, kommonitorSingleFeatureMapHelperService, - kommonitorImporterHelperService, $scope, $rootScope, $http, __env, $timeout, kommonitorMultiStepFormHelperService) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorImporterHelperServiceInstance = kommonitorImporterHelperService; - this.kommonitorDataGridHelperServiceInstance = kommonitorDataGridHelperService; - this.kommonitorSingleFeatureMapHelperServiceInstance = kommonitorSingleFeatureMapHelperService; - - /* PUT BODY - { - "geoJsonString": "geoJsonString", - "periodOfValidity": { - "endDate": "2000-01-23", - "startDate": "2000-01-23" - } - } - */ - - //Date picker - $('#georesourceEditFeaturesDatepickerStart').datepicker(kommonitorDataExchangeService.datePickerOptions); - $('#georesourceEditFeaturesDatepickerEnd').datepicker(kommonitorDataExchangeService.datePickerOptions); - $('#georesourceSingleFeatureDatepickerEnd').datepicker(kommonitorDataExchangeService.datePickerOptions); - $('#georesourceSingleFeatureDatepickerStart').datepicker(kommonitorDataExchangeService.datePickerOptions); - - $scope.georesourceFeaturesGeoJSON; - $scope.currentGeoresourceDataset; - $scope.remainingFeatureHeaders; - - $scope.georesourceMappingConfigStructure_pretty = kommonitorDataExchangeService.syntaxHighlightJSON(kommonitorImporterHelperService.mappingConfigStructure); - $scope.georesourceMappingConfigImportError; - - $scope.loadingData = false; - - // variables for single feature import - $scope.featureIdValue = 0; - $scope.featureIdExampleString = undefined; - $scope.featureIdIsValid = false; - $scope.featureNameValue = undefined; - $scope.featureGeometryValue = undefined; - $scope.featureStartDateValue = undefined; - $scope.featureEndDateValue = undefined; - // [{property: name, value: value}] - $scope.featureSchemaProperties = []; - $scope.schemaObject; - - $scope.isPartialUpdate = false; - - // variables for multiple feature import - - $scope.periodOfValidity = {}; - $scope.periodOfValidity.startDate = undefined; - $scope.periodOfValidity.endDate = undefined; - $scope.periodOfValidityInvalid = false; - - $scope.georesourceEditFeaturesDataSourceInputInvalidReason = undefined; - $scope.georesourceEditFeaturesDataSourceInputInvalid = false; - $scope.georesourceDataSourceIdProperty = undefined; - $scope.georesourceDataSourceNameProperty = undefined; - - $scope.converter = undefined; - $scope.schema = undefined; - $scope.featureInfoText_singleFeatureAddMenu = undefined; - $scope.mimeType = undefined; - $scope.datasourceType = undefined; - $scope.georesourceDataSourceIdProperty = undefined; - $scope.georesourceDataSourceNameProperty = undefined; - - $scope.converterDefinition = undefined; - $scope.datasourceTypeDefinition = undefined; - $scope.propertyMappingDefinition = undefined; - $scope.putBody_georesources = undefined; - - $scope.validityEndDate_perFeature = undefined; - $scope.validityStartDate_perFeature = undefined; - - $scope.attributeMapping_sourceAttributeName = undefined; - $scope.attributeMapping_destinationAttributeName = undefined; - $scope.attributeMapping_data = undefined; - $scope.attributeMapping_attributeType = kommonitorImporterHelperService.attributeMapping_attributeTypes[0]; - $scope.attributeMappings_adminView = []; - $scope.keepAttributes = true; - $scope.keepMissingValues = true; - - $scope.successMessagePart = undefined; - $scope.errorMessagePart = undefined; - $scope.importerErrors = undefined; - - $scope.$on("onEditGeoresourceFeatures", function (event, georesourceDataset) { - kommonitorMultiStepFormHelperService.registerClickHandler(); - if($scope.currentGeoresourceDataset && $scope.currentGeoresourceDataset.datasetName === georesourceDataset.datasetName){ - return; - } - else{ - $scope.currentGeoresourceDataset = georesourceDataset; - - // $scope.refreshGeoresourceEditFeaturesOverviewTable(); - - $scope.resetGeoresourceEditFeaturesForm(); - - kommonitorDataGridHelperService.buildDataGrid_featureTable_spatialResource("georesourceFeatureTable", [], []); - - } - - }); - - $scope.initSingleFeatureAddMenu = async function(){ - // init geomap for single feature import, handling geocoding and feature geometry - let domId = "singleFeatureGeoMap"; - let resourceType = kommonitorSingleFeatureMapHelperService.resourceType_point; - if($scope.currentGeoresourceDataset.isLOI){ - resourceType = kommonitorSingleFeatureMapHelperService.resourceType_line; - } - else if($scope.currentGeoresourceDataset.isAOI){ - resourceType = kommonitorSingleFeatureMapHelperService.resourceType_polygon; - } - kommonitorSingleFeatureMapHelperService.initSingleFeatureGeoMap(domId, resourceType); - - // init featureSchema for single feature import - await $scope.initFeatureSchema(); - - // add data layer to singleFeatureMap - $http({ - url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + $scope.currentGeoresourceDataset.georesourceId + "/allFeatures", - method: "GET", - // headers: { - // 'Content-Type': undefined - // } - }).then(function successCallback(response) { - - $scope.georesourceFeaturesGeoJSON = response.data; - kommonitorSingleFeatureMapHelperService.addDataLayertoSingleFeatureGeoMap($scope.georesourceFeaturesGeoJSON); - - $scope.featureInfoText_singleFeatureAddMenu = "" + $scope.georesourceFeaturesGeoJSON.features.length + " weitere Features im Datensatz vorhanden"; - - //once the dataset features are fetched we may make a proposal for the ID of a new Feature - $scope.featureIdValue = $scope.generateIdProposalFromExistingFeatures(); - $scope.addExampleValuesToSchemaProperties(); - - }, function errorCallback(error) { - $scope.featureInfoText_singleFeatureAddMenu = "Keine weiteren Features im Datensatz vorhanden oder Fehler bei Abruf"; - }).finally(function (){ - $scope.validateSingleFeatureId(); - // $timeout(function(){ - - // $scope.$digest(); - // }, 250); - }); - } - - $scope.generateIdProposalFromExistingFeatures = function(){ - if (! $scope.georesourceFeaturesGeoJSON){ - return 0; - } - // String or Integer - let idDataType = $scope.schemaObject[__env.FEATURE_ID_PROPERTY_NAME]; - - // array of id values - let existingFeatureIds = $scope.georesourceFeaturesGeoJSON.features.map(feature => { - if(feature.properties[__env.FEATURE_ID_PROPERTY_NAME]){ - return feature.properties[__env.FEATURE_ID_PROPERTY_NAME]; - } - else{ - return 0; - } - }); - - let length = existingFeatureIds.length; - $scope.featureIdExampleString = "" + existingFeatureIds[0] + "; " + existingFeatureIds[Math.round(length/2) ] + "; " + existingFeatureIds[length - 1]; - - if(idDataType == "Integer" || idDataType == "Double"){ - return $scope.generateIdProposalFromExistingFeatures_numeric(existingFeatureIds); - } - else{ - // generate UUID - return $scope.generateIdProposalFromExistingFeatures_uuid(existingFeatureIds); - } - }; - - $scope.generateIdProposalFromExistingFeatures_numeric = function(existingFeatureIds){ - - // determine max value - let maxValue = Math.max(...existingFeatureIds); - - // return increment - return maxValue + 1; - }; - - $scope.generateIdProposalFromExistingFeatures_uuid = function(existingFeatureIds){ - // return UUID using UUID library - return uuidv4(); - }; - - $scope.validateSingleFeatureId = function(){ - $scope.featureIdIsValid = true; - if($scope.georesourceFeaturesGeoJSON && $scope.featureIdValue){ - let filteredFeatures = $scope.georesourceFeaturesGeoJSON.features.filter(feature => feature.properties[__env.FEATURE_ID_PROPERTY_NAME] == $scope.featureIdValue); - - if(filteredFeatures.length == 0){ - $scope.featureIdIsValid = true; - } - else{ - $scope.featureIdIsValid = false; - } - return $scope.featureIdIsValid; - } - else{ - // no other data available in dataset - if ($scope.featureIdValue == undefined || $scope.featureIdValue == null){ - $scope.featureIdIsValid = false; - } - else{ - $scope.featureIdIsValid = true; - } - } - - return $scope.featureIdIsValid; - }; - - $scope.initFeatureSchema = async function(){ - $scope.featureSchemaProperties = []; - - return await $http({ - url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + $scope.currentGeoresourceDataset.georesourceId + "/schema", - method: "GET", - // headers: { - // 'Content-Type': undefined - // } - }).then(function successCallback(response) { - - $scope.schemaObject = response.data; - - for (var property in $scope.schemaObject){ - if (property != __env.FEATURE_ID_PROPERTY_NAME && property != __env.FEATURE_NAME_PROPERTY_NAME && property != __env.VALID_START_DATE_PROPERTY_NAME && property != __env.VALID_END_DATE_PROPERTY_NAME){ - $scope.featureSchemaProperties.push( - {property: property, - value: undefined} - ); - } - } - - return $scope.schemaObject; - - }, function errorCallback(error) { - - }); - }; - - $scope.addExampleValuesToSchemaProperties = function(){ - if ($scope.georesourceFeaturesGeoJSON && $scope.featureSchemaProperties && $scope.georesourceFeaturesGeoJSON.features && $scope.georesourceFeaturesGeoJSON.features[0]){ - let exampleFeature = $scope.georesourceFeaturesGeoJSON.features[0]; - for (const element of $scope.featureSchemaProperties) { - element.exampleValue = exampleFeature.properties[element.property]; - } - } - }; - - $scope.addSingleGeoresourceFeature = async function(){ - - $timeout(function(){ - $scope.loadingData = true; - }); - - $scope.importerErrors = undefined; - $scope.successMessagePart = undefined; - $scope.errorMessagePart = undefined; - - /* - now collect data and build request for importer - */ - - var allDataSpecified = await $scope.buildImporterObjects_singleFeatureImport(); - - // TODO Create and perform POST Request with loading screen - - var updateGeoresourceResponse_dryRun = undefined; - try { - updateGeoresourceResponse_dryRun = await kommonitorImporterHelperService.updateGeoresource($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.currentGeoresourceDataset.georesourceId, $scope.putBody_georesources, true); - - // this callback will be called asynchronously - // when the response is available - - - - - if(! kommonitorImporterHelperService.importerResponseContainsErrors(updateGeoresourceResponse_dryRun)){ - // all good, really execute the request to import data against data management API - var updateGeoresourceResponse = await kommonitorImporterHelperService.updateGeoresource($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.currentGeoresourceDataset.georesourceId, $scope.putBody_georesources, false); - - $rootScope.$broadcast("refreshGeoresourceOverviewTable", "edit", $scope.currentGeoresourceDataset.georesourceId); - - $scope.refreshGeoresourceEditFeaturesOverviewTable(); - $scope.initSingleFeatureAddMenu(); - - $scope.successMessagePart = $scope.currentGeoresourceDataset.datasetName; - $scope.importedFeatures = kommonitorImporterHelperService.getImportedFeaturesFromImporterResponse(updateGeoresourceResponse); - - // as the update was successfull we must prevent the user from importing the same object again - $scope.featureIdIsValid = false; - // add the new feature to current dataset! - if($scope.georesourceFeaturesGeoJSON){ - $scope.georesourceFeaturesGeoJSON.features.push($scope.featureGeometryValue.features[0]); - } - else{ - $scope.georesourceFeaturesGeoJSON = turf.featureCollection([ - $scope.featureGeometryValue.features[0] - ]); - } - - - $("#georesourceEditFeaturesSuccessAlert").show(); - $scope.loadingData = false; - } - else{ - // errors ocurred - // show them - $scope.errorMessagePart = "Das zu importierende Feature des Datensatzes weist kritische Fehler auf"; - $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(updateGeoresourceResponse_dryRun); - - $("#georesourceEditFeaturesErrorAlert").show(); - $scope.loadingData = false; - - setTimeout(() => { - $scope.$digest(); - }, 250); - - } - } catch (error) { - console.error(error); - if(error.data){ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else{ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - if(updateGeoresourceResponse_dryRun){ - $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(updateGeoresourceResponse_dryRun); - } - - $("#georesourceEditFeaturesErrorAlert").show(); - $scope.loadingData = false; - - setTimeout(() => { - $scope.$digest(); - }, 250); - } - }; - - $scope.$on("onUpdateSingleFeatureGeometry", function(event, geoJSON){ - $scope.featureGeometryValue = geoJSON; - $scope.$digest(); - }); - - $scope.refreshGeoresourceEditFeaturesOverviewTable = function(){ - - $scope.loadingData = true; - // fetch all georesource features - $http({ - url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + $scope.currentGeoresourceDataset.georesourceId + "/allFeatures", - method: "GET", - // headers: { - // 'Content-Type': undefined - // } - }).then(function successCallback(response) { - - $scope.georesourceFeaturesGeoJSON = response.data; - - var tmpRemainingHeaders = []; - - for (var property in $scope.georesourceFeaturesGeoJSON.features[0].properties){ - if (property != __env.FEATURE_ID_PROPERTY_NAME && property != __env.FEATURE_NAME_PROPERTY_NAME && property != __env.VALID_START_DATE_PROPERTY_NAME && property != __env.VALID_END_DATE_PROPERTY_NAME){ - tmpRemainingHeaders.push(property); - } - } - - $scope.remainingFeatureHeaders = tmpRemainingHeaders; - - // as we require the information about the dataset ID within each feature to enable feature record updates from within the datatable - // we must include the dataset ID within each feature - - kommonitorDataGridHelperService.buildDataGrid_featureTable_spatialResource("georesourceFeatureTable", tmpRemainingHeaders, $scope.georesourceFeaturesGeoJSON.features, $scope.currentGeoresourceDataset.georesourceId, kommonitorDataGridHelperService.resourceType_georesource, $scope.enableDeleteFeatures); - - - $scope.loadingData = false; - - }, function errorCallback(error) { - if(error.data){ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else{ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - - $("#georesourceEditFeaturesErrorAlert").show(); - $scope.loadingData = false; - }); - }; - - $scope.clearAllGeoresourceFeatures = function(){ - $scope.loadingData = true; - // delete all georesource features - $http({ - url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/georesources/" + $scope.currentGeoresourceDataset.georesourceId + "/allFeatures", - method: "DELETE", - // headers: { - // 'Content-Type': undefined - // } - }).then(function successCallback(response) { - - $scope.georesourceFeaturesGeoJSON = undefined; - $scope.remainingFeatureHeaders = undefined; - - $rootScope.$broadcast("refreshGeoresourceOverviewTable", "edit", $scope.currentGeoresourceDataset.georesourceId); - // empty data grid as all data has been deleted - kommonitorDataGridHelperService.buildDataGrid_featureTable_spatialResource("georesourceFeatureTable", [], []); - // reset whole form - $scope.resetGeoresourceEditFeaturesForm(); - - $scope.successMessagePart = $scope.currentGeoresourceDataset.datasetName; - - $("#georesourceEditFeaturesSuccessAlert").show(); - $scope.loadingData = false; - - }, function errorCallback(error) { - if(error.data){ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else{ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - - $("#georesourceEditFeaturesErrorAlert").show(); - $scope.loadingData = false; - }); - }; - - $scope.resetGeoresourceEditFeaturesForm = function(){ - - // reset edit banners - kommonitorDataGridHelperService.featureTable_georesource_lastUpdate_timestamp_success = undefined; - kommonitorDataGridHelperService.featureTable_georesource_lastUpdate_timestamp_failure = undefined; - - // variables for single feature import - $scope.featureIdValue = 0; - $scope.featureIdExampleString = undefined; - $scope.featureIdIsValid = false; - $scope.featureNameValue = undefined; - $scope.featureGeometryValue = undefined; - $scope.featureStartDateValue = undefined; - $scope.featureEndDateValue = undefined; - // [{property: name, value: value}] - $scope.featureSchemaProperties = []; - - // reinit single feature add menu - $scope.initSingleFeatureAddMenu(); - - //variables for multiple feature import - - $scope.georesourceFeaturesGeoJSON = undefined; - $scope.remainingFeatureHeaders = undefined; - - $scope.periodOfValidity = {}; - $scope.periodOfValidity.startDate = undefined; - $scope.periodOfValidity.endDate = undefined; - $scope.periodOfValidityInvalid = false; - - $scope.georesourceEditFeaturesDataSourceInputInvalidReason = undefined; - $scope.georesourceEditFeaturesDataSourceInputInvalid = false; - $scope.georesourceDataSourceIdProperty = undefined; - $scope.georesourceDataSourceNameProperty = undefined; - - $scope.converter = undefined; - $scope.schema = undefined; - $scope.mimeType = undefined; - $scope.featureInfoText_singleFeatureAddMenu = undefined; - $scope.datasourceType = undefined; - $scope.georesourceDataSourceIdProperty = undefined; - $scope.georesourceDataSourceNameProperty = undefined; - - $scope.converterDefinition = undefined; - $scope.datasourceTypeDefinition = undefined; - $scope.propertyMappingDefinition = undefined; - $scope.putBody_georesources = undefined; - - $scope.validityEndDate_perFeature = undefined; - $scope.validityStartDate_perFeature = undefined; - - $scope.attributeMapping_sourceAttributeName = undefined; - $scope.attributeMapping_destinationAttributeName = undefined; - $scope.attributeMapping_data = undefined; - $scope.attributeMapping_attributeType = kommonitorImporterHelperService.attributeMapping_attributeTypes[0]; - $scope.attributeMappings_adminView = []; - $scope.keepAttributes = true; - $scope.keepMissingValues = true; - - $scope.successMessagePart = undefined; - $scope.errorMessagePart = undefined; - $scope.importerErrors = undefined; - - $("#georesourceEditFeaturesSuccessAlert").hide(); - $("#georesourceEditFeaturesErrorAlert").hide(); - - setTimeout(() => { - $scope.$digest(); - }, 250); - }; - - $scope.onChangeConverter = function(){ - $scope.schema = $scope.converter.schemas ? $scope.converter.schemas[0] : undefined; - $scope.mimeType = $scope.converter.mimeTypes[0]; - }; - - $scope.onChangeMimeType = function(mimeType){ - $scope.mimeType = mimeType; - }; - - $scope.filterByKomMonitorProperties = function() { - return function( item ) { - - try{ - if (item === __env.FEATURE_ID_PROPERTY_NAME || item === __env.FEATURE_NAME_PROPERTY_NAME || item === "validStartDate" || item === "validEndDate"){ - return false; - } - return true; - } - catch(error){ - return false; - } - }; - }; - - $scope.getFeatureId = function(geojsonFeature){ - return geojsonFeature.properties[__env.FEATURE_ID_PROPERTY_NAME]; - }; - - $scope.getFeatureName = function(geojsonFeature){ - return geojsonFeature.properties[__env.FEATURE_NAME_PROPERTY_NAME]; - }; - - $scope.checkPeriodOfValidity = function(){ - $scope.periodOfValidityInvalid = false; - if ($scope.periodOfValidity.startDate && $scope.periodOfValidity.endDate){ - var startDate = new Date($scope.periodOfValidity.startDate); - var endDate = new Date($scope.periodOfValidity.endDate); - - if ((startDate === endDate) || startDate > endDate){ - // failure - $scope.periodOfValidityInvalid = true; - } - } - }; - - $scope.onAddOrUpdateAttributeMapping = function(){ - var tmpAttributeMapping_adminView = { - "sourceName": $scope.attributeMapping_sourceAttributeName, - "destinationName": $scope.attributeMapping_destinationAttributeName, - "dataType": $scope.attributeMapping_attributeType - }; - - var processed = false; - - for (let index = 0; index < $scope.attributeMappings_adminView.length; index++) { - var attributeMappingEntry_adminView = $scope.attributeMappings_adminView[index]; - - if (attributeMappingEntry_adminView.sourceName === tmpAttributeMapping_adminView.sourceName){ - // replace object - $scope.attributeMappings_adminView[index] = tmpAttributeMapping_adminView; - processed = true; - break; - } - } - - if(! processed){ - // new entry - $scope.attributeMappings_adminView.push(tmpAttributeMapping_adminView); - } - - $scope.attributeMapping_sourceAttributeName = undefined; - $scope.attributeMapping_destinationAttributeName = undefined; - $scope.attributeMapping_attributeType = kommonitorImporterHelperService.attributeMapping_attributeTypes[0]; - - setTimeout(() => { - $scope.$digest(); - }, 250); - }; - - $scope.onClickEditAttributeMapping = function(attributeMappingEntry){ - $scope.attributeMapping_sourceAttributeName = attributeMappingEntry.sourceName; - $scope.attributeMapping_destinationAttributeName = attributeMappingEntry.destinationName; - $scope.attributeMapping_attributeType = attributeMappingEntry.dataType; - - setTimeout(() => { - $scope.$digest(); - }, 250); - }; - - $scope.onClickDeleteAttributeMapping = function(attributeMappingEntry){ - for (let index = 0; index < $scope.attributeMappings_adminView.length; index++) { - - if ($scope.attributeMappings_adminView[index].sourceName === attributeMappingEntry.sourceName){ - // remove object - $scope.attributeMappings_adminView.splice(index, 1); - break; - } - } - - setTimeout(() => { - $scope.$digest(); - }, 250); - }; - - $scope.buildImporterObjects_singleFeatureImport = async function(){ - $scope.converterDefinition = kommonitorImporterHelperService.converterDefinition_singleFeatureImport; - $scope.datasourceTypeDefinition = kommonitorImporterHelperService.datasourceDefinition_singleFeatureImport; - $scope.propertyMappingDefinition = kommonitorImporterHelperService.propertyMappingDefinition_singleFeatureImport; - - // make geoJSON FeatureCollection and fill feature properties from single feature menu - $scope.featureGeometryValue.features[0].properties[__env.FEATURE_ID_PROPERTY_NAME] = $scope.featureIdValue; - $scope.featureGeometryValue.features[0].properties[__env.FEATURE_NAME_PROPERTY_NAME] = $scope.featureNameValue; - $scope.featureGeometryValue.features[0].properties[__env.VALID_START_DATE_PROPERTY_NAME] = $scope.featureStartDateValue; - $scope.featureGeometryValue.features[0].properties[__env.VALID_END_DATE_PROPERTY_NAME] = $scope.featureEndDateValue; - - for (const element of $scope.featureSchemaProperties) { - $scope.featureGeometryValue.features[0].properties[element.property] = element.value; - } - - $scope.datasourceTypeDefinition.parameters[0].value = JSON.stringify($scope.featureGeometryValue); - - var scopeProperties = { - "periodOfValidity": { - "endDate": $scope.featureEndDateValue, - "startDate": $scope.featureStartDateValue - }, - "isPartialUpdate": true - }; - $scope.putBody_georesources = kommonitorImporterHelperService.buildPutBody_georesources(scopeProperties); - - if(!$scope.converterDefinition || !$scope.datasourceTypeDefinition || !$scope.propertyMappingDefinition || !$scope.putBody_georesources){ - return false; - } - - return true; - }; - - $scope.buildImporterObjects = async function(){ - $scope.converterDefinition = $scope.buildConverterDefinition(); - $scope.datasourceTypeDefinition = await $scope.buildDatasourceTypeDefinition(); - $scope.propertyMappingDefinition = $scope.buildPropertyMappingDefinition(); - - var scopeProperties = { - "periodOfValidity": { - "endDate": $scope.periodOfValidity.endDate, - "startDate": $scope.periodOfValidity.startDate - }, - "isPartialUpdate": $scope.isPartialUpdate - } - $scope.putBody_georesources = kommonitorImporterHelperService.buildPutBody_georesources(scopeProperties); - - if(!$scope.converterDefinition || !$scope.datasourceTypeDefinition || !$scope.propertyMappingDefinition || !$scope.putBody_georesources){ - return false; - } - - return true; - }; - - $scope.buildConverterDefinition = function(){ - - return kommonitorImporterHelperService.buildConverterDefinition($scope.converter, "converterParameter_georesourceEditFeatures_", $scope.schema, $scope.mimeType); - }; - - $scope.buildDatasourceTypeDefinition = async function(){ - try { - return await kommonitorImporterHelperService.buildDatasourceTypeDefinition($scope.datasourceType, 'datasourceTypeParameter_georesourceEditFeatures_', 'georesourceDataSourceInput_editFeatures'); - } catch (error) { - if(error.data){ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else{ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - - $("#georesourceEditFeaturesErrorAlert").show(); - $scope.loadingData = false; - return null; - } - }; - - $scope.buildPropertyMappingDefinition = function(){ - // arsion from is undefined currently - return kommonitorImporterHelperService.buildPropertyMapping_spatialResource($scope.georesourceDataSourceNameProperty, $scope.georesourceDataSourceIdProperty, $scope.validityStartDate_perFeature, $scope.validityEndDate_perFeature, undefined, $scope.keepAttributes, $scope.keepMissingValues, $scope.attributeMappings_adminView); - }; - - $scope.editGeoresourceFeatures = async function(){ - - $timeout(function(){ - $scope.loadingData = true; - }); - - $scope.importerErrors = undefined; - $scope.successMessagePart = undefined; - $scope.errorMessagePart = undefined; - - /* - now collect data and build request for importer - */ - - /* - if any required importer data is missing --> cancel request and highlight required errors - */ - var allDataSpecified = await $scope.buildImporterObjects(); - - if (!allDataSpecified) { - - $("#georesourceEditFeaturesForm").validator("update"); - $("#georesourceEditFeaturesForm").validator("validate"); - return; - } - else { - - - // TODO verify input - - // TODO Create and perform POST Request with loading screen - - var updateGeoresourceResponse_dryRun = undefined; - try { - updateGeoresourceResponse_dryRun = await kommonitorImporterHelperService.updateGeoresource($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.currentGeoresourceDataset.georesourceId, $scope.putBody_georesources, true); - - // this callback will be called asynchronously - // when the response is available - - - - - if(! kommonitorImporterHelperService.importerResponseContainsErrors(updateGeoresourceResponse_dryRun)){ - // all good, really execute the request to import data against data management API - var updateGeoresourceResponse = await kommonitorImporterHelperService.updateGeoresource($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.currentGeoresourceDataset.georesourceId, $scope.putBody_georesources, false); - - $rootScope.$broadcast("refreshGeoresourceOverviewTable", "edit", $scope.currentGeoresourceDataset.georesourceId); - $scope.refreshGeoresourceEditFeaturesOverviewTable(); - $scope.initSingleFeatureAddMenu(); - - $scope.successMessagePart = $scope.currentGeoresourceDataset.datasetName; - $scope.importedFeatures = kommonitorImporterHelperService.getImportedFeaturesFromImporterResponse(updateGeoresourceResponse); - - $("#georesourceEditFeaturesSuccessAlert").show(); - $scope.loadingData = false; - } - else{ - // errors ocurred - // show them - $scope.errorMessagePart = "Einige der zu importierenden Features des Datensatzes weisen kritische Fehler auf"; - $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(updateGeoresourceResponse_dryRun); - - $("#georesourceEditFeaturesErrorAlert").show(); - $scope.loadingData = false; - - setTimeout(() => { - $scope.$digest(); - }, 250); - - } - } catch (error) { - if(error.data){ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else{ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - if(updateGeoresourceResponse_dryRun){ - $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(updateGeoresourceResponse_dryRun); - } - - $("#georesourceEditFeaturesErrorAlert").show(); - $scope.loadingData = false; - - setTimeout(() => { - $scope.$digest(); - }, 250); - } - } - }; - - $scope.onImportGeoresourceEditFeaturesMappingConfig = function(){ - - $scope.georesourceMappingConfigImportError = ""; - - $("#georesourceMappingConfigEditFeaturesImportFile").files = []; - - // trigger file chooser - $("#georesourceMappingConfigEditFeaturesImportFile").click(); - - }; - - $(document).on("change", "#georesourceMappingConfigEditFeaturesImportFile" ,function(){ - - console.log("Importing Importer Mapping Config for EditFeatures Georesource Form"); - - // get the file - var file = document.getElementById('georesourceMappingConfigEditFeaturesImportFile').files[0]; - $scope.parseMappingConfigFromFile(file); - }); - - $scope.parseMappingConfigFromFile = function(file){ - var fileReader = new FileReader(); - - fileReader.onload = function(event) { - - try{ - $scope.parseFromMappingConfigFile(event); - } - catch(error){ - console.error(error); - console.error("Uploaded MappingConfig File cannot be parsed."); - $scope.georesourceMappingConfigImportError = "Uploaded MappingConfig File cannot be parsed correctly"; - document.getElementById("georesourcesEditFeaturesMappingConfigPre").innerHTML = $scope.georesourceMappingConfigStructure_pretty; - $("#georesourceEditFeaturesMappingConfigImportErrorAlert").show(); - - $scope.$digest(); - } - - }; - - // Read in the image file as a data URL. - fileReader.readAsText(file); - }; - - $scope.parseFromMappingConfigFile = function(event){ - $scope.mappingConfigImportSettings = JSON.parse(event.target.result); - - if(! $scope.mappingConfigImportSettings.converter || ! $scope.mappingConfigImportSettings.dataSource || ! $scope.mappingConfigImportSettings.propertyMapping){ - console.error("uploaded MappingConfig File cannot be parsed - wrong structure."); - $scope.georesourceMetadataImportError = "Struktur der Datei stimmt nicht mit erwartetem Muster überein."; - document.getElementById("georesourcesEditFeaturesMappingConfigPre").innerHTML = $scope.georesourceMappingConfigStructure_pretty; - $("#georesourceEditFeaturesMappingConfigImportErrorAlert").show(); - - $scope.$digest(); - } - - $scope.converter = undefined; - for(var converter of kommonitorImporterHelperService.availableConverters){ - if (converter.name === $scope.mappingConfigImportSettings.converter.name){ - $scope.converter = converter; - break; - } - } - - $scope.schema = undefined; - if ($scope.converter && $scope.converter.schemas && $scope.mappingConfigImportSettings.converter.schema){ - for (var schema of $scope.converter.schemas) { - if (schema === $scope.mappingConfigImportSettings.converter.schema){ - $scope.schema = schema; - } - } - } - - $scope.mimeType = undefined; - if ($scope.converter && $scope.converter.mimeTypes && $scope.mappingConfigImportSettings.converter.mimeType){ - for (var mimeType of $scope.converter.mimeTypes) { - if (mimeType === $scope.mappingConfigImportSettings.converter.mimeType){ - $scope.mimeType = mimeType; - } - } - } - - $scope.datasourceType = undefined; - for(var datasourceType of kommonitorImporterHelperService.availableDatasourceTypes){ - if (datasourceType.type === $scope.mappingConfigImportSettings.dataSource.type){ - $scope.datasourceType = datasourceType; - break; - } - } - - $scope.$digest(); - - // converter parameters - if ($scope.converter){ - for (var convParameter of $scope.mappingConfigImportSettings.converter.parameters) { - $("#converterParameter_georesourceEditFeatures_" + convParameter.name).val(convParameter.value); - } - } - - // datasourceTypes parameters - if ($scope.datasourceType){ - for (var dsParameter of $scope.mappingConfigImportSettings.dataSource.parameters) { - $("#datasourceTypeParameter_georesourceEditFeatures_" + dsParameter.name).val(dsParameter.value); - } - } - - // property Mapping - $scope.georesourceDataSourceNameProperty = $scope.mappingConfigImportSettings.propertyMapping.nameProperty; - $scope.georesourceDataSourceIdProperty = $scope.mappingConfigImportSettings.propertyMapping.identifierProperty; - $scope.validityStartDate_perFeature = $scope.mappingConfigImportSettings.propertyMapping.validStartDateProperty; - $scope.validityEndDate_perFeature = $scope.mappingConfigImportSettings.propertyMapping.validEndDateProperty; - $scope.keepAttributes = $scope.mappingConfigImportSettings.propertyMapping.keepAttributes; - $scope.keepMissingValues = $scope.mappingConfigImportSettings.propertyMapping.keepMissingOrNullValueAttributes; - $scope.attributeMappings_adminView = []; - - for (var attributeMapping of $scope.mappingConfigImportSettings.propertyMapping.attributes) { - var tmpEntry = { - "sourceName": attributeMapping.name, - "destinationName": attributeMapping.mappingName - }; - - for (const dataType of kommonitorImporterHelperService.attributeMapping_attributeTypes) { - if (dataType.apiName === attributeMapping.type){ - tmpEntry.dataType = dataType; - } - } - - $scope.attributeMappings_adminView.push(tmpEntry); - } - - if ($scope.mappingConfigImportSettings.periodOfValidity){ - $scope.periodOfValidity = {}; - $scope.periodOfValidity.startDate = $scope.mappingConfigImportSettings.periodOfValidity.startDate; - $scope.periodOfValidity.endDate = $scope.mappingConfigImportSettings.periodOfValidity.endDate; - $scope.periodOfValidityInvalid = false; - - // update datePickers - if ($scope.periodOfValidity.startDate){ - $("#georesourceEditFeaturesDatepickerStart").datepicker('setDate', $scope.periodOfValidity.startDate); - } - if ($scope.periodOfValidity.endDate){ - $("#georesourceEditFeaturesDatepickerEnd").datepicker('setDate', $scope.periodOfValidity.endDate); - } - } - - $scope.$digest(); - }; - - $scope.onExportGeoresourceEditFeaturesMappingConfig = async function(){ - var converterDefinition = $scope.buildConverterDefinition(); - var datasourceTypeDefinition = await $scope.buildDatasourceTypeDefinition(); - var propertyMappingDefinition = $scope.buildPropertyMappingDefinition(); - - var mappingConfigExport = { - "converter": converterDefinition, - "dataSource": datasourceTypeDefinition, - "propertyMapping": propertyMappingDefinition, - }; - - mappingConfigExport.periodOfValidity = $scope.periodOfValidity; - - var name = $scope.datasetName; - - var metadataJSON = JSON.stringify(mappingConfigExport); - - var fileName = "KomMonitor-Import-Mapping-Konfiguration_Export"; - - if (name){ - fileName += "-" + name; - } - - fileName += ".json"; - - var blob = new Blob([metadataJSON], {type: "application/json"}); - var data = URL.createObjectURL(blob); - - var a = document.createElement('a'); - a.download = fileName; - a.href = data; - a.textContent = "JSON"; - a.target = "_blank"; - a.rel = "noopener noreferrer"; - a.click(); - - a.remove(); - }; - - - $scope.hideSuccessAlert = function(){ - $("#georesourceEditFeaturesSuccessAlert").hide(); - }; - - $scope.hideErrorAlert = function(){ - $("#georesourceEditFeaturesErrorAlert").hide(); - }; - - $scope.hideMappingConfigErrorAlert = function(){ - $("#georesourceEditFeaturesMappingConfigImportErrorAlert").hide(); - }; - - $rootScope.$on("showLoadingIcon_" + kommonitorDataGridHelperService.resourceType_georesource, function(event){ - $timeout(function(){ - - $scope.loadingData = true; - }); - }); - - $rootScope.$on("hideLoadingIcon_" + kommonitorDataGridHelperService.resourceType_georesource, function(event){ - $timeout(function(){ - - $scope.loadingData = false; - }); - }); - - $rootScope.$on("onDeleteFeatureEntry_" + kommonitorDataGridHelperService.resourceType_georesource, function(event){ - $rootScope.$broadcast("refreshGeoresourceOverviewTable", "edit", $scope.currentGeoresourceDataset.georesourceId); - $scope.refreshGeoresourceEditFeaturesOverviewTable(); - }); - - $scope.onChangeEnableDeleteFeatures = function(){ - if($scope.enableDeleteFeatures){ - $(".georesourceDeleteFeatureRecordBtn").attr("disabled", false); - } - else{ - $(".georesourceDeleteFeatureRecordBtn").attr("disabled", true); - } - } - - } -]}); + templateUrl: "components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditFeaturesModal/georesource-edit-features-modal.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorDataGridHelperService', 'kommonitorSingleFeatureMapHelperService', + 'kommonitorImporterHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', 'kommonitorMultiStepFormHelperService', + function GeoresourcesEditFeaturesModalController(kommonitorDataExchangeService, kommonitorDataGridHelperService, kommonitorSingleFeatureMapHelperService, kommonitorImporterHelperService, $scope, $rootScope, $http, __env, $timeout, kommonitorMultiStepFormHelperService) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorImporterHelperServiceInstance = kommonitorImporterHelperService; + this.kommonitorDataGridHelperServiceInstance = kommonitorDataGridHelperService; + this.kommonitorSingleFeatureMapHelperServiceInstance = kommonitorSingleFeatureMapHelperService; + /* PUT BODY + { + "geoJsonString": "geoJsonString", + "periodOfValidity": { + "endDate": "2000-01-23", + "startDate": "2000-01-23" + } + } + */ + //Date picker + $('#georesourceEditFeaturesDatepickerStart').datepicker(kommonitorDataExchangeService.datePickerOptions); + $('#georesourceEditFeaturesDatepickerEnd').datepicker(kommonitorDataExchangeService.datePickerOptions); + $('#georesourceSingleFeatureDatepickerEnd').datepicker(kommonitorDataExchangeService.datePickerOptions); + $('#georesourceSingleFeatureDatepickerStart').datepicker(kommonitorDataExchangeService.datePickerOptions); + $scope.georesourceFeaturesGeoJSON; + $scope.currentGeoresourceDataset; + $scope.remainingFeatureHeaders; + $scope.georesourceMappingConfigStructure_pretty = kommonitorDataExchangeService.syntaxHighlightJSON(kommonitorImporterHelperService.mappingConfigStructure); + $scope.georesourceMappingConfigImportError; + $scope.loadingData = false; + // variables for single feature import + $scope.featureIdValue = 0; + $scope.featureIdExampleString = undefined; + $scope.featureIdIsValid = false; + $scope.featureNameValue = undefined; + $scope.featureGeometryValue = undefined; + $scope.featureStartDateValue = undefined; + $scope.featureEndDateValue = undefined; + // [{property: name, value: value}] + $scope.featureSchemaProperties = []; + $scope.schemaObject; + $scope.isPartialUpdate = false; + // variables for multiple feature import + $scope.periodOfValidity = {}; + $scope.periodOfValidity.startDate = undefined; + $scope.periodOfValidity.endDate = undefined; + $scope.periodOfValidityInvalid = false; + $scope.georesourceEditFeaturesDataSourceInputInvalidReason = undefined; + $scope.georesourceEditFeaturesDataSourceInputInvalid = false; + $scope.georesourceDataSourceIdProperty = undefined; + $scope.georesourceDataSourceNameProperty = undefined; + $scope.converter = undefined; + $scope.schema = undefined; + $scope.featureInfoText_singleFeatureAddMenu = undefined; + $scope.mimeType = undefined; + $scope.datasourceType = undefined; + $scope.georesourceDataSourceIdProperty = undefined; + $scope.georesourceDataSourceNameProperty = undefined; + $scope.converterDefinition = undefined; + $scope.datasourceTypeDefinition = undefined; + $scope.propertyMappingDefinition = undefined; + $scope.putBody_georesources = undefined; + $scope.validityEndDate_perFeature = undefined; + $scope.validityStartDate_perFeature = undefined; + $scope.attributeMapping_sourceAttributeName = undefined; + $scope.attributeMapping_destinationAttributeName = undefined; + $scope.attributeMapping_data = undefined; + $scope.attributeMapping_attributeType = kommonitorImporterHelperService.attributeMapping_attributeTypes[0]; + $scope.attributeMappings_adminView = []; + $scope.keepAttributes = true; + $scope.keepMissingValues = true; + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + $scope.importerErrors = undefined; + $scope.$on("onEditGeoresourceFeatures", function (event, georesourceDataset) { + kommonitorMultiStepFormHelperService.registerClickHandler(); + if ($scope.currentGeoresourceDataset && $scope.currentGeoresourceDataset.datasetName === georesourceDataset.datasetName) { + return; + } + else { + $scope.currentGeoresourceDataset = georesourceDataset; + // $scope.refreshGeoresourceEditFeaturesOverviewTable(); + $scope.resetGeoresourceEditFeaturesForm(); + kommonitorDataGridHelperService.buildDataGrid_featureTable_spatialResource("georesourceFeatureTable", [], []); + } + }); + $scope.initSingleFeatureAddMenu = async function () { + // init geomap for single feature import, handling geocoding and feature geometry + let domId = "singleFeatureGeoMap"; + let resourceType = kommonitorSingleFeatureMapHelperService.resourceType_point; + if ($scope.currentGeoresourceDataset.isLOI) { + resourceType = kommonitorSingleFeatureMapHelperService.resourceType_line; + } + else if ($scope.currentGeoresourceDataset.isAOI) { + resourceType = kommonitorSingleFeatureMapHelperService.resourceType_polygon; + } + kommonitorSingleFeatureMapHelperService.initSingleFeatureGeoMap(domId, resourceType); + // init featureSchema for single feature import + await $scope.initFeatureSchema(); + // add data layer to singleFeatureMap + $http({ + url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + $scope.currentGeoresourceDataset.georesourceId + "/allFeatures", + method: "GET", + // headers: { + // 'Content-Type': undefined + // } + }).then(function successCallback(response) { + $scope.georesourceFeaturesGeoJSON = response.data; + kommonitorSingleFeatureMapHelperService.addDataLayertoSingleFeatureGeoMap($scope.georesourceFeaturesGeoJSON); + $scope.featureInfoText_singleFeatureAddMenu = "" + $scope.georesourceFeaturesGeoJSON.features.length + " weitere Features im Datensatz vorhanden"; + //once the dataset features are fetched we may make a proposal for the ID of a new Feature + $scope.featureIdValue = $scope.generateIdProposalFromExistingFeatures(); + $scope.addExampleValuesToSchemaProperties(); + }, function errorCallback(error) { + $scope.featureInfoText_singleFeatureAddMenu = "Keine weiteren Features im Datensatz vorhanden oder Fehler bei Abruf"; + }).finally(function () { + $scope.validateSingleFeatureId(); + // $timeout(function(){ + // $scope.$digest(); + // }, 250); + }); + }; + $scope.generateIdProposalFromExistingFeatures = function () { + if (!$scope.georesourceFeaturesGeoJSON) { + return 0; + } + // String or Integer + let idDataType = $scope.schemaObject[__env.FEATURE_ID_PROPERTY_NAME]; + // array of id values + let existingFeatureIds = $scope.georesourceFeaturesGeoJSON.features.map(feature => { + if (feature.properties[__env.FEATURE_ID_PROPERTY_NAME]) { + return feature.properties[__env.FEATURE_ID_PROPERTY_NAME]; + } + else { + return 0; + } + }); + let length = existingFeatureIds.length; + $scope.featureIdExampleString = "" + existingFeatureIds[0] + "; " + existingFeatureIds[Math.round(length / 2)] + "; " + existingFeatureIds[length - 1]; + if (idDataType == "Integer" || idDataType == "Double") { + return $scope.generateIdProposalFromExistingFeatures_numeric(existingFeatureIds); + } + else { + // generate UUID + return $scope.generateIdProposalFromExistingFeatures_uuid(existingFeatureIds); + } + }; + $scope.generateIdProposalFromExistingFeatures_numeric = function (existingFeatureIds) { + // determine max value + let maxValue = Math.max(...existingFeatureIds); + // return increment + return maxValue + 1; + }; + $scope.generateIdProposalFromExistingFeatures_uuid = function (existingFeatureIds) { + // return UUID using UUID library + return uuidv4(); + }; + $scope.validateSingleFeatureId = function () { + $scope.featureIdIsValid = true; + if ($scope.georesourceFeaturesGeoJSON && $scope.featureIdValue) { + let filteredFeatures = $scope.georesourceFeaturesGeoJSON.features.filter(feature => feature.properties[__env.FEATURE_ID_PROPERTY_NAME] == $scope.featureIdValue); + if (filteredFeatures.length == 0) { + $scope.featureIdIsValid = true; + } + else { + $scope.featureIdIsValid = false; + } + return $scope.featureIdIsValid; + } + else { + // no other data available in dataset + if ($scope.featureIdValue == undefined || $scope.featureIdValue == null) { + $scope.featureIdIsValid = false; + } + else { + $scope.featureIdIsValid = true; + } + } + return $scope.featureIdIsValid; + }; + $scope.initFeatureSchema = async function () { + $scope.featureSchemaProperties = []; + return await $http({ + url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + $scope.currentGeoresourceDataset.georesourceId + "/schema", + method: "GET", + // headers: { + // 'Content-Type': undefined + // } + }).then(function successCallback(response) { + $scope.schemaObject = response.data; + for (var property in $scope.schemaObject) { + if (property != __env.FEATURE_ID_PROPERTY_NAME && property != __env.FEATURE_NAME_PROPERTY_NAME && property != __env.VALID_START_DATE_PROPERTY_NAME && property != __env.VALID_END_DATE_PROPERTY_NAME) { + $scope.featureSchemaProperties.push({ property: property, + value: undefined }); + } + } + return $scope.schemaObject; + }, function errorCallback(error) { + }); + }; + $scope.addExampleValuesToSchemaProperties = function () { + if ($scope.georesourceFeaturesGeoJSON && $scope.featureSchemaProperties && $scope.georesourceFeaturesGeoJSON.features && $scope.georesourceFeaturesGeoJSON.features[0]) { + let exampleFeature = $scope.georesourceFeaturesGeoJSON.features[0]; + for (const element of $scope.featureSchemaProperties) { + element.exampleValue = exampleFeature.properties[element.property]; + } + } + }; + $scope.addSingleGeoresourceFeature = async function () { + $timeout(function () { + $scope.loadingData = true; + }); + $scope.importerErrors = undefined; + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + /* + now collect data and build request for importer + */ + var allDataSpecified = await $scope.buildImporterObjects_singleFeatureImport(); + // TODO Create and perform POST Request with loading screen + var updateGeoresourceResponse_dryRun = undefined; + try { + updateGeoresourceResponse_dryRun = await kommonitorImporterHelperService.updateGeoresource($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.currentGeoresourceDataset.georesourceId, $scope.putBody_georesources, true); + // this callback will be called asynchronously + // when the response is available + if (!kommonitorImporterHelperService.importerResponseContainsErrors(updateGeoresourceResponse_dryRun)) { + // all good, really execute the request to import data against data management API + var updateGeoresourceResponse = await kommonitorImporterHelperService.updateGeoresource($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.currentGeoresourceDataset.georesourceId, $scope.putBody_georesources, false); + $rootScope.$broadcast("refreshGeoresourceOverviewTable", "edit", $scope.currentGeoresourceDataset.georesourceId); + $scope.refreshGeoresourceEditFeaturesOverviewTable(); + $scope.initSingleFeatureAddMenu(); + $scope.successMessagePart = $scope.currentGeoresourceDataset.datasetName; + $scope.importedFeatures = kommonitorImporterHelperService.getImportedFeaturesFromImporterResponse(updateGeoresourceResponse); + // as the update was successfull we must prevent the user from importing the same object again + $scope.featureIdIsValid = false; + // add the new feature to current dataset! + if ($scope.georesourceFeaturesGeoJSON) { + $scope.georesourceFeaturesGeoJSON.features.push($scope.featureGeometryValue.features[0]); + } + else { + $scope.georesourceFeaturesGeoJSON = turf.featureCollection([ + $scope.featureGeometryValue.features[0] + ]); + } + $("#georesourceEditFeaturesSuccessAlert").show(); + $scope.loadingData = false; + } + else { + // errors ocurred + // show them + $scope.errorMessagePart = "Das zu importierende Feature des Datensatzes weist kritische Fehler auf"; + $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(updateGeoresourceResponse_dryRun); + $("#georesourceEditFeaturesErrorAlert").show(); + $scope.loadingData = false; + setTimeout(() => { + $scope.$digest(); + }, 250); + } + } + catch (error) { + console.error(error); + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + if (updateGeoresourceResponse_dryRun) { + $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(updateGeoresourceResponse_dryRun); + } + $("#georesourceEditFeaturesErrorAlert").show(); + $scope.loadingData = false; + setTimeout(() => { + $scope.$digest(); + }, 250); + } + }; + $scope.$on("onUpdateSingleFeatureGeometry", function (event, geoJSON) { + $scope.featureGeometryValue = geoJSON; + $scope.$digest(); + }); + $scope.refreshGeoresourceEditFeaturesOverviewTable = function () { + $scope.loadingData = true; + // fetch all georesource features + $http({ + url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + $scope.currentGeoresourceDataset.georesourceId + "/allFeatures", + method: "GET", + // headers: { + // 'Content-Type': undefined + // } + }).then(function successCallback(response) { + $scope.georesourceFeaturesGeoJSON = response.data; + var tmpRemainingHeaders = []; + for (var property in $scope.georesourceFeaturesGeoJSON.features[0].properties) { + if (property != __env.FEATURE_ID_PROPERTY_NAME && property != __env.FEATURE_NAME_PROPERTY_NAME && property != __env.VALID_START_DATE_PROPERTY_NAME && property != __env.VALID_END_DATE_PROPERTY_NAME) { + tmpRemainingHeaders.push(property); + } + } + $scope.remainingFeatureHeaders = tmpRemainingHeaders; + // as we require the information about the dataset ID within each feature to enable feature record updates from within the datatable + // we must include the dataset ID within each feature + kommonitorDataGridHelperService.buildDataGrid_featureTable_spatialResource("georesourceFeatureTable", tmpRemainingHeaders, $scope.georesourceFeaturesGeoJSON.features, $scope.currentGeoresourceDataset.georesourceId, kommonitorDataGridHelperService.resourceType_georesource, $scope.enableDeleteFeatures); + $scope.loadingData = false; + }, function errorCallback(error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + $("#georesourceEditFeaturesErrorAlert").show(); + $scope.loadingData = false; + }); + }; + $scope.clearAllGeoresourceFeatures = function () { + $scope.loadingData = true; + // delete all georesource features + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/georesources/" + $scope.currentGeoresourceDataset.georesourceId + "/allFeatures", + method: "DELETE", + // headers: { + // 'Content-Type': undefined + // } + }).then(function successCallback(response) { + $scope.georesourceFeaturesGeoJSON = undefined; + $scope.remainingFeatureHeaders = undefined; + $rootScope.$broadcast("refreshGeoresourceOverviewTable", "edit", $scope.currentGeoresourceDataset.georesourceId); + // empty data grid as all data has been deleted + kommonitorDataGridHelperService.buildDataGrid_featureTable_spatialResource("georesourceFeatureTable", [], []); + // reset whole form + $scope.resetGeoresourceEditFeaturesForm(); + $scope.successMessagePart = $scope.currentGeoresourceDataset.datasetName; + $("#georesourceEditFeaturesSuccessAlert").show(); + $scope.loadingData = false; + }, function errorCallback(error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + $("#georesourceEditFeaturesErrorAlert").show(); + $scope.loadingData = false; + }); + }; + $scope.resetGeoresourceEditFeaturesForm = function () { + // reset edit banners + kommonitorDataGridHelperService.featureTable_georesource_lastUpdate_timestamp_success = undefined; + kommonitorDataGridHelperService.featureTable_georesource_lastUpdate_timestamp_failure = undefined; + // variables for single feature import + $scope.featureIdValue = 0; + $scope.featureIdExampleString = undefined; + $scope.featureIdIsValid = false; + $scope.featureNameValue = undefined; + $scope.featureGeometryValue = undefined; + $scope.featureStartDateValue = undefined; + $scope.featureEndDateValue = undefined; + // [{property: name, value: value}] + $scope.featureSchemaProperties = []; + // reinit single feature add menu + $scope.initSingleFeatureAddMenu(); + //variables for multiple feature import + $scope.georesourceFeaturesGeoJSON = undefined; + $scope.remainingFeatureHeaders = undefined; + $scope.periodOfValidity = {}; + $scope.periodOfValidity.startDate = undefined; + $scope.periodOfValidity.endDate = undefined; + $scope.periodOfValidityInvalid = false; + $scope.georesourceEditFeaturesDataSourceInputInvalidReason = undefined; + $scope.georesourceEditFeaturesDataSourceInputInvalid = false; + $scope.georesourceDataSourceIdProperty = undefined; + $scope.georesourceDataSourceNameProperty = undefined; + $scope.converter = undefined; + $scope.schema = undefined; + $scope.mimeType = undefined; + $scope.featureInfoText_singleFeatureAddMenu = undefined; + $scope.datasourceType = undefined; + $scope.georesourceDataSourceIdProperty = undefined; + $scope.georesourceDataSourceNameProperty = undefined; + $scope.converterDefinition = undefined; + $scope.datasourceTypeDefinition = undefined; + $scope.propertyMappingDefinition = undefined; + $scope.putBody_georesources = undefined; + $scope.validityEndDate_perFeature = undefined; + $scope.validityStartDate_perFeature = undefined; + $scope.attributeMapping_sourceAttributeName = undefined; + $scope.attributeMapping_destinationAttributeName = undefined; + $scope.attributeMapping_data = undefined; + $scope.attributeMapping_attributeType = kommonitorImporterHelperService.attributeMapping_attributeTypes[0]; + $scope.attributeMappings_adminView = []; + $scope.keepAttributes = true; + $scope.keepMissingValues = true; + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + $scope.importerErrors = undefined; + $("#georesourceEditFeaturesSuccessAlert").hide(); + $("#georesourceEditFeaturesErrorAlert").hide(); + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.onChangeConverter = function () { + $scope.schema = $scope.converter.schemas ? $scope.converter.schemas[0] : undefined; + $scope.mimeType = $scope.converter.mimeTypes[0]; + }; + $scope.onChangeMimeType = function (mimeType) { + $scope.mimeType = mimeType; + }; + $scope.filterByKomMonitorProperties = function () { + return function (item) { + try { + if (item === __env.FEATURE_ID_PROPERTY_NAME || item === __env.FEATURE_NAME_PROPERTY_NAME || item === "validStartDate" || item === "validEndDate") { + return false; + } + return true; + } + catch (error) { + return false; + } + }; + }; + $scope.getFeatureId = function (geojsonFeature) { + return geojsonFeature.properties[__env.FEATURE_ID_PROPERTY_NAME]; + }; + $scope.getFeatureName = function (geojsonFeature) { + return geojsonFeature.properties[__env.FEATURE_NAME_PROPERTY_NAME]; + }; + $scope.checkPeriodOfValidity = function () { + $scope.periodOfValidityInvalid = false; + if ($scope.periodOfValidity.startDate && $scope.periodOfValidity.endDate) { + var startDate = new Date($scope.periodOfValidity.startDate); + var endDate = new Date($scope.periodOfValidity.endDate); + if ((startDate === endDate) || startDate > endDate) { + // failure + $scope.periodOfValidityInvalid = true; + } + } + }; + $scope.onAddOrUpdateAttributeMapping = function () { + var tmpAttributeMapping_adminView = { + "sourceName": $scope.attributeMapping_sourceAttributeName, + "destinationName": $scope.attributeMapping_destinationAttributeName, + "dataType": $scope.attributeMapping_attributeType + }; + var processed = false; + for (let index = 0; index < $scope.attributeMappings_adminView.length; index++) { + var attributeMappingEntry_adminView = $scope.attributeMappings_adminView[index]; + if (attributeMappingEntry_adminView.sourceName === tmpAttributeMapping_adminView.sourceName) { + // replace object + $scope.attributeMappings_adminView[index] = tmpAttributeMapping_adminView; + processed = true; + break; + } + } + if (!processed) { + // new entry + $scope.attributeMappings_adminView.push(tmpAttributeMapping_adminView); + } + $scope.attributeMapping_sourceAttributeName = undefined; + $scope.attributeMapping_destinationAttributeName = undefined; + $scope.attributeMapping_attributeType = kommonitorImporterHelperService.attributeMapping_attributeTypes[0]; + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.onClickEditAttributeMapping = function (attributeMappingEntry) { + $scope.attributeMapping_sourceAttributeName = attributeMappingEntry.sourceName; + $scope.attributeMapping_destinationAttributeName = attributeMappingEntry.destinationName; + $scope.attributeMapping_attributeType = attributeMappingEntry.dataType; + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.onClickDeleteAttributeMapping = function (attributeMappingEntry) { + for (let index = 0; index < $scope.attributeMappings_adminView.length; index++) { + if ($scope.attributeMappings_adminView[index].sourceName === attributeMappingEntry.sourceName) { + // remove object + $scope.attributeMappings_adminView.splice(index, 1); + break; + } + } + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.buildImporterObjects_singleFeatureImport = async function () { + $scope.converterDefinition = kommonitorImporterHelperService.converterDefinition_singleFeatureImport; + $scope.datasourceTypeDefinition = kommonitorImporterHelperService.datasourceDefinition_singleFeatureImport; + $scope.propertyMappingDefinition = kommonitorImporterHelperService.propertyMappingDefinition_singleFeatureImport; + // make geoJSON FeatureCollection and fill feature properties from single feature menu + $scope.featureGeometryValue.features[0].properties[__env.FEATURE_ID_PROPERTY_NAME] = $scope.featureIdValue; + $scope.featureGeometryValue.features[0].properties[__env.FEATURE_NAME_PROPERTY_NAME] = $scope.featureNameValue; + $scope.featureGeometryValue.features[0].properties[__env.VALID_START_DATE_PROPERTY_NAME] = $scope.featureStartDateValue; + $scope.featureGeometryValue.features[0].properties[__env.VALID_END_DATE_PROPERTY_NAME] = $scope.featureEndDateValue; + for (const element of $scope.featureSchemaProperties) { + $scope.featureGeometryValue.features[0].properties[element.property] = element.value; + } + $scope.datasourceTypeDefinition.parameters[0].value = JSON.stringify($scope.featureGeometryValue); + var scopeProperties = { + "periodOfValidity": { + "endDate": $scope.featureEndDateValue, + "startDate": $scope.featureStartDateValue + }, + "isPartialUpdate": true + }; + $scope.putBody_georesources = kommonitorImporterHelperService.buildPutBody_georesources(scopeProperties); + if (!$scope.converterDefinition || !$scope.datasourceTypeDefinition || !$scope.propertyMappingDefinition || !$scope.putBody_georesources) { + return false; + } + return true; + }; + $scope.buildImporterObjects = async function () { + $scope.converterDefinition = $scope.buildConverterDefinition(); + $scope.datasourceTypeDefinition = await $scope.buildDatasourceTypeDefinition(); + $scope.propertyMappingDefinition = $scope.buildPropertyMappingDefinition(); + var scopeProperties = { + "periodOfValidity": { + "endDate": $scope.periodOfValidity.endDate, + "startDate": $scope.periodOfValidity.startDate + }, + "isPartialUpdate": $scope.isPartialUpdate + }; + $scope.putBody_georesources = kommonitorImporterHelperService.buildPutBody_georesources(scopeProperties); + if (!$scope.converterDefinition || !$scope.datasourceTypeDefinition || !$scope.propertyMappingDefinition || !$scope.putBody_georesources) { + return false; + } + return true; + }; + $scope.buildConverterDefinition = function () { + return kommonitorImporterHelperService.buildConverterDefinition($scope.converter, "converterParameter_georesourceEditFeatures_", $scope.schema, $scope.mimeType); + }; + $scope.buildDatasourceTypeDefinition = async function () { + try { + return await kommonitorImporterHelperService.buildDatasourceTypeDefinition($scope.datasourceType, 'datasourceTypeParameter_georesourceEditFeatures_', 'georesourceDataSourceInput_editFeatures'); + } + catch (error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + $("#georesourceEditFeaturesErrorAlert").show(); + $scope.loadingData = false; + return null; + } + }; + $scope.buildPropertyMappingDefinition = function () { + // arsion from is undefined currently + return kommonitorImporterHelperService.buildPropertyMapping_spatialResource($scope.georesourceDataSourceNameProperty, $scope.georesourceDataSourceIdProperty, $scope.validityStartDate_perFeature, $scope.validityEndDate_perFeature, undefined, $scope.keepAttributes, $scope.keepMissingValues, $scope.attributeMappings_adminView); + }; + $scope.editGeoresourceFeatures = async function () { + $timeout(function () { + $scope.loadingData = true; + }); + $scope.importerErrors = undefined; + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + /* + now collect data and build request for importer + */ + /* + if any required importer data is missing --> cancel request and highlight required errors + */ + var allDataSpecified = await $scope.buildImporterObjects(); + if (!allDataSpecified) { + $("#georesourceEditFeaturesForm").validator("update"); + $("#georesourceEditFeaturesForm").validator("validate"); + return; + } + else { + // TODO verify input + // TODO Create and perform POST Request with loading screen + var updateGeoresourceResponse_dryRun = undefined; + try { + updateGeoresourceResponse_dryRun = await kommonitorImporterHelperService.updateGeoresource($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.currentGeoresourceDataset.georesourceId, $scope.putBody_georesources, true); + // this callback will be called asynchronously + // when the response is available + if (!kommonitorImporterHelperService.importerResponseContainsErrors(updateGeoresourceResponse_dryRun)) { + // all good, really execute the request to import data against data management API + var updateGeoresourceResponse = await kommonitorImporterHelperService.updateGeoresource($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.currentGeoresourceDataset.georesourceId, $scope.putBody_georesources, false); + $rootScope.$broadcast("refreshGeoresourceOverviewTable", "edit", $scope.currentGeoresourceDataset.georesourceId); + $scope.refreshGeoresourceEditFeaturesOverviewTable(); + $scope.initSingleFeatureAddMenu(); + $scope.successMessagePart = $scope.currentGeoresourceDataset.datasetName; + $scope.importedFeatures = kommonitorImporterHelperService.getImportedFeaturesFromImporterResponse(updateGeoresourceResponse); + $("#georesourceEditFeaturesSuccessAlert").show(); + $scope.loadingData = false; + } + else { + // errors ocurred + // show them + $scope.errorMessagePart = "Einige der zu importierenden Features des Datensatzes weisen kritische Fehler auf"; + $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(updateGeoresourceResponse_dryRun); + $("#georesourceEditFeaturesErrorAlert").show(); + $scope.loadingData = false; + setTimeout(() => { + $scope.$digest(); + }, 250); + } + } + catch (error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + if (updateGeoresourceResponse_dryRun) { + $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(updateGeoresourceResponse_dryRun); + } + $("#georesourceEditFeaturesErrorAlert").show(); + $scope.loadingData = false; + setTimeout(() => { + $scope.$digest(); + }, 250); + } + } + }; + $scope.onImportGeoresourceEditFeaturesMappingConfig = function () { + $scope.georesourceMappingConfigImportError = ""; + $("#georesourceMappingConfigEditFeaturesImportFile").files = []; + // trigger file chooser + $("#georesourceMappingConfigEditFeaturesImportFile").click(); + }; + $(document).on("change", "#georesourceMappingConfigEditFeaturesImportFile", function () { + console.log("Importing Importer Mapping Config for EditFeatures Georesource Form"); + // get the file + var file = document.getElementById('georesourceMappingConfigEditFeaturesImportFile').files[0]; + $scope.parseMappingConfigFromFile(file); + }); + $scope.parseMappingConfigFromFile = function (file) { + var fileReader = new FileReader(); + fileReader.onload = function (event) { + try { + $scope.parseFromMappingConfigFile(event); + } + catch (error) { + console.error(error); + console.error("Uploaded MappingConfig File cannot be parsed."); + $scope.georesourceMappingConfigImportError = "Uploaded MappingConfig File cannot be parsed correctly"; + document.getElementById("georesourcesEditFeaturesMappingConfigPre").innerHTML = $scope.georesourceMappingConfigStructure_pretty; + $("#georesourceEditFeaturesMappingConfigImportErrorAlert").show(); + $scope.$digest(); + } + }; + // Read in the image file as a data URL. + fileReader.readAsText(file); + }; + $scope.parseFromMappingConfigFile = function (event) { + $scope.mappingConfigImportSettings = JSON.parse(event.target.result); + if (!$scope.mappingConfigImportSettings.converter || !$scope.mappingConfigImportSettings.dataSource || !$scope.mappingConfigImportSettings.propertyMapping) { + console.error("uploaded MappingConfig File cannot be parsed - wrong structure."); + $scope.georesourceMetadataImportError = "Struktur der Datei stimmt nicht mit erwartetem Muster überein."; + document.getElementById("georesourcesEditFeaturesMappingConfigPre").innerHTML = $scope.georesourceMappingConfigStructure_pretty; + $("#georesourceEditFeaturesMappingConfigImportErrorAlert").show(); + $scope.$digest(); + } + $scope.converter = undefined; + for (var converter of kommonitorImporterHelperService.availableConverters) { + if (converter.name === $scope.mappingConfigImportSettings.converter.name) { + $scope.converter = converter; + break; + } + } + $scope.schema = undefined; + if ($scope.converter && $scope.converter.schemas && $scope.mappingConfigImportSettings.converter.schema) { + for (var schema of $scope.converter.schemas) { + if (schema === $scope.mappingConfigImportSettings.converter.schema) { + $scope.schema = schema; + } + } + } + $scope.mimeType = undefined; + if ($scope.converter && $scope.converter.mimeTypes && $scope.mappingConfigImportSettings.converter.mimeType) { + for (var mimeType of $scope.converter.mimeTypes) { + if (mimeType === $scope.mappingConfigImportSettings.converter.mimeType) { + $scope.mimeType = mimeType; + } + } + } + $scope.datasourceType = undefined; + for (var datasourceType of kommonitorImporterHelperService.availableDatasourceTypes) { + if (datasourceType.type === $scope.mappingConfigImportSettings.dataSource.type) { + $scope.datasourceType = datasourceType; + break; + } + } + $scope.$digest(); + // converter parameters + if ($scope.converter) { + for (var convParameter of $scope.mappingConfigImportSettings.converter.parameters) { + $("#converterParameter_georesourceEditFeatures_" + convParameter.name).val(convParameter.value); + } + } + // datasourceTypes parameters + if ($scope.datasourceType) { + for (var dsParameter of $scope.mappingConfigImportSettings.dataSource.parameters) { + $("#datasourceTypeParameter_georesourceEditFeatures_" + dsParameter.name).val(dsParameter.value); + } + } + // property Mapping + $scope.georesourceDataSourceNameProperty = $scope.mappingConfigImportSettings.propertyMapping.nameProperty; + $scope.georesourceDataSourceIdProperty = $scope.mappingConfigImportSettings.propertyMapping.identifierProperty; + $scope.validityStartDate_perFeature = $scope.mappingConfigImportSettings.propertyMapping.validStartDateProperty; + $scope.validityEndDate_perFeature = $scope.mappingConfigImportSettings.propertyMapping.validEndDateProperty; + $scope.keepAttributes = $scope.mappingConfigImportSettings.propertyMapping.keepAttributes; + $scope.keepMissingValues = $scope.mappingConfigImportSettings.propertyMapping.keepMissingOrNullValueAttributes; + $scope.attributeMappings_adminView = []; + for (var attributeMapping of $scope.mappingConfigImportSettings.propertyMapping.attributes) { + var tmpEntry = { + "sourceName": attributeMapping.name, + "destinationName": attributeMapping.mappingName + }; + for (const dataType of kommonitorImporterHelperService.attributeMapping_attributeTypes) { + if (dataType.apiName === attributeMapping.type) { + tmpEntry.dataType = dataType; + } + } + $scope.attributeMappings_adminView.push(tmpEntry); + } + if ($scope.mappingConfigImportSettings.periodOfValidity) { + $scope.periodOfValidity = {}; + $scope.periodOfValidity.startDate = $scope.mappingConfigImportSettings.periodOfValidity.startDate; + $scope.periodOfValidity.endDate = $scope.mappingConfigImportSettings.periodOfValidity.endDate; + $scope.periodOfValidityInvalid = false; + // update datePickers + if ($scope.periodOfValidity.startDate) { + $("#georesourceEditFeaturesDatepickerStart").datepicker('setDate', $scope.periodOfValidity.startDate); + } + if ($scope.periodOfValidity.endDate) { + $("#georesourceEditFeaturesDatepickerEnd").datepicker('setDate', $scope.periodOfValidity.endDate); + } + } + $scope.$digest(); + }; + $scope.onExportGeoresourceEditFeaturesMappingConfig = async function () { + var converterDefinition = $scope.buildConverterDefinition(); + var datasourceTypeDefinition = await $scope.buildDatasourceTypeDefinition(); + var propertyMappingDefinition = $scope.buildPropertyMappingDefinition(); + var mappingConfigExport = { + "converter": converterDefinition, + "dataSource": datasourceTypeDefinition, + "propertyMapping": propertyMappingDefinition, + }; + mappingConfigExport.periodOfValidity = $scope.periodOfValidity; + var name = $scope.datasetName; + var metadataJSON = JSON.stringify(mappingConfigExport); + var fileName = "KomMonitor-Import-Mapping-Konfiguration_Export"; + if (name) { + fileName += "-" + name; + } + fileName += ".json"; + var blob = new Blob([metadataJSON], { type: "application/json" }); + var data = URL.createObjectURL(blob); + var a = document.createElement('a'); + a.download = fileName; + a.href = data; + a.textContent = "JSON"; + a.target = "_blank"; + a.rel = "noopener noreferrer"; + a.click(); + a.remove(); + }; + $scope.hideSuccessAlert = function () { + $("#georesourceEditFeaturesSuccessAlert").hide(); + }; + $scope.hideErrorAlert = function () { + $("#georesourceEditFeaturesErrorAlert").hide(); + }; + $scope.hideMappingConfigErrorAlert = function () { + $("#georesourceEditFeaturesMappingConfigImportErrorAlert").hide(); + }; + $rootScope.$on("showLoadingIcon_" + kommonitorDataGridHelperService.resourceType_georesource, function (event) { + $timeout(function () { + $scope.loadingData = true; + }); + }); + $rootScope.$on("hideLoadingIcon_" + kommonitorDataGridHelperService.resourceType_georesource, function (event) { + $timeout(function () { + $scope.loadingData = false; + }); + }); + $rootScope.$on("onDeleteFeatureEntry_" + kommonitorDataGridHelperService.resourceType_georesource, function (event) { + $rootScope.$broadcast("refreshGeoresourceOverviewTable", "edit", $scope.currentGeoresourceDataset.georesourceId); + $scope.refreshGeoresourceEditFeaturesOverviewTable(); + }); + $scope.onChangeEnableDeleteFeatures = function () { + if ($scope.enableDeleteFeatures) { + $(".georesourceDeleteFeatureRecordBtn").attr("disabled", false); + } + else { + $(".georesourceDeleteFeatureRecordBtn").attr("disabled", true); + } + }; + } + ] +}); +//# sourceMappingURL=georesource-edit-features-modal.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditFeaturesModal/georesource-edit-features-modal.component.js.map b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditFeaturesModal/georesource-edit-features-modal.component.js.map new file mode 100644 index 000000000..956962768 --- /dev/null +++ b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditFeaturesModal/georesource-edit-features-modal.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"georesource-edit-features-modal.component.js","sourceRoot":"","sources":["georesource-edit-features-modal.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,8BAA8B,CAAC,CAAC,SAAS,CAAC,8BAA8B,EAAE;IACxF,WAAW,EAAG,mIAAmI;IACjJ,UAAU,EAAG,CAAC,+BAA+B,EAAE,iCAAiC,EAAE,yCAAyC;QAC1H,iCAAiC,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,sCAAsC;QAC/H,SAAS,uCAAuC,CAAC,6BAA6B,EAAE,+BAA+B,EAAE,uCAAuC,EACvJ,+BAA+B,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,oCAAoC;YAElH,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAC3E,IAAI,CAAC,uCAAuC,GAAG,+BAA+B,CAAC;YAC/E,IAAI,CAAC,uCAAuC,GAAG,+BAA+B,CAAC;YAC/E,IAAI,CAAC,+CAA+C,GAAG,uCAAuC,CAAC;YAE/F;;;;;;;;cAQE;YAEF,aAAa;YACX,CAAC,CAAC,yCAAyC,CAAC,CAAC,UAAU,CAAC,6BAA6B,CAAC,iBAAiB,CAAC,CAAC;YAC3G,CAAC,CAAC,uCAAuC,CAAC,CAAC,UAAU,CAAC,6BAA6B,CAAC,iBAAiB,CAAC,CAAC;YACvG,CAAC,CAAC,wCAAwC,CAAC,CAAC,UAAU,CAAC,6BAA6B,CAAC,iBAAiB,CAAC,CAAC;YACxG,CAAC,CAAC,0CAA0C,CAAC,CAAC,UAAU,CAAC,6BAA6B,CAAC,iBAAiB,CAAC,CAAC;YAE1G,MAAM,C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CAAC;iBAC/D;YACF,CAAC,CAAA;QAEH,CAAC;KACD;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditFeaturesModal/georesource-edit-features-modal.component.ts b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditFeaturesModal/georesource-edit-features-modal.component.ts new file mode 100644 index 000000000..61e0450c0 --- /dev/null +++ b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditFeaturesModal/georesource-edit-features-modal.component.ts @@ -0,0 +1,1016 @@ +angular.module('georesourceEditFeaturesModal').component('georesourceEditFeaturesModal', { + templateUrl : "components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditFeaturesModal/georesource-edit-features-modal.template.html", + controller : ['kommonitorDataExchangeService', 'kommonitorDataGridHelperService', 'kommonitorSingleFeatureMapHelperService', + 'kommonitorImporterHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', 'kommonitorMultiStepFormHelperService', + function GeoresourcesEditFeaturesModalController(kommonitorDataExchangeService, kommonitorDataGridHelperService, kommonitorSingleFeatureMapHelperService, + kommonitorImporterHelperService, $scope, $rootScope, $http, __env, $timeout, kommonitorMultiStepFormHelperService) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorImporterHelperServiceInstance = kommonitorImporterHelperService; + this.kommonitorDataGridHelperServiceInstance = kommonitorDataGridHelperService; + this.kommonitorSingleFeatureMapHelperServiceInstance = kommonitorSingleFeatureMapHelperService; + + /* PUT BODY + { + "geoJsonString": "geoJsonString", + "periodOfValidity": { + "endDate": "2000-01-23", + "startDate": "2000-01-23" + } + } + */ + + //Date picker + $('#georesourceEditFeaturesDatepickerStart').datepicker(kommonitorDataExchangeService.datePickerOptions); + $('#georesourceEditFeaturesDatepickerEnd').datepicker(kommonitorDataExchangeService.datePickerOptions); + $('#georesourceSingleFeatureDatepickerEnd').datepicker(kommonitorDataExchangeService.datePickerOptions); + $('#georesourceSingleFeatureDatepickerStart').datepicker(kommonitorDataExchangeService.datePickerOptions); + + $scope.georesourceFeaturesGeoJSON; + $scope.currentGeoresourceDataset; + $scope.remainingFeatureHeaders; + + $scope.georesourceMappingConfigStructure_pretty = kommonitorDataExchangeService.syntaxHighlightJSON(kommonitorImporterHelperService.mappingConfigStructure); + $scope.georesourceMappingConfigImportError; + + $scope.loadingData = false; + + // variables for single feature import + $scope.featureIdValue = 0; + $scope.featureIdExampleString = undefined; + $scope.featureIdIsValid = false; + $scope.featureNameValue = undefined; + $scope.featureGeometryValue = undefined; + $scope.featureStartDateValue = undefined; + $scope.featureEndDateValue = undefined; + // [{property: name, value: value}] + $scope.featureSchemaProperties = []; + $scope.schemaObject; + + $scope.isPartialUpdate = false; + + // variables for multiple feature import + + $scope.periodOfValidity = {}; + $scope.periodOfValidity.startDate = undefined; + $scope.periodOfValidity.endDate = undefined; + $scope.periodOfValidityInvalid = false; + + $scope.georesourceEditFeaturesDataSourceInputInvalidReason = undefined; + $scope.georesourceEditFeaturesDataSourceInputInvalid = false; + $scope.georesourceDataSourceIdProperty = undefined; + $scope.georesourceDataSourceNameProperty = undefined; + + $scope.converter = undefined; + $scope.schema = undefined; + $scope.featureInfoText_singleFeatureAddMenu = undefined; + $scope.mimeType = undefined; + $scope.datasourceType = undefined; + $scope.georesourceDataSourceIdProperty = undefined; + $scope.georesourceDataSourceNameProperty = undefined; + + $scope.converterDefinition = undefined; + $scope.datasourceTypeDefinition = undefined; + $scope.propertyMappingDefinition = undefined; + $scope.putBody_georesources = undefined; + + $scope.validityEndDate_perFeature = undefined; + $scope.validityStartDate_perFeature = undefined; + + $scope.attributeMapping_sourceAttributeName = undefined; + $scope.attributeMapping_destinationAttributeName = undefined; + $scope.attributeMapping_data = undefined; + $scope.attributeMapping_attributeType = kommonitorImporterHelperService.attributeMapping_attributeTypes[0]; + $scope.attributeMappings_adminView = []; + $scope.keepAttributes = true; + $scope.keepMissingValues = true; + + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + $scope.importerErrors = undefined; + + $scope.$on("onEditGeoresourceFeatures", function (event, georesourceDataset) { + kommonitorMultiStepFormHelperService.registerClickHandler(); + if($scope.currentGeoresourceDataset && $scope.currentGeoresourceDataset.datasetName === georesourceDataset.datasetName){ + return; + } + else{ + $scope.currentGeoresourceDataset = georesourceDataset; + + // $scope.refreshGeoresourceEditFeaturesOverviewTable(); + + $scope.resetGeoresourceEditFeaturesForm(); + + kommonitorDataGridHelperService.buildDataGrid_featureTable_spatialResource("georesourceFeatureTable", [], []); + + } + + }); + + $scope.initSingleFeatureAddMenu = async function(){ + // init geomap for single feature import, handling geocoding and feature geometry + let domId = "singleFeatureGeoMap"; + let resourceType = kommonitorSingleFeatureMapHelperService.resourceType_point; + if($scope.currentGeoresourceDataset.isLOI){ + resourceType = kommonitorSingleFeatureMapHelperService.resourceType_line; + } + else if($scope.currentGeoresourceDataset.isAOI){ + resourceType = kommonitorSingleFeatureMapHelperService.resourceType_polygon; + } + kommonitorSingleFeatureMapHelperService.initSingleFeatureGeoMap(domId, resourceType); + + // init featureSchema for single feature import + await $scope.initFeatureSchema(); + + // add data layer to singleFeatureMap + $http({ + url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + $scope.currentGeoresourceDataset.georesourceId + "/allFeatures", + method: "GET", + // headers: { + // 'Content-Type': undefined + // } + }).then(function successCallback(response) { + + $scope.georesourceFeaturesGeoJSON = response.data; + kommonitorSingleFeatureMapHelperService.addDataLayertoSingleFeatureGeoMap($scope.georesourceFeaturesGeoJSON); + + $scope.featureInfoText_singleFeatureAddMenu = "" + $scope.georesourceFeaturesGeoJSON.features.length + " weitere Features im Datensatz vorhanden"; + + //once the dataset features are fetched we may make a proposal for the ID of a new Feature + $scope.featureIdValue = $scope.generateIdProposalFromExistingFeatures(); + $scope.addExampleValuesToSchemaProperties(); + + }, function errorCallback(error) { + $scope.featureInfoText_singleFeatureAddMenu = "Keine weiteren Features im Datensatz vorhanden oder Fehler bei Abruf"; + }).finally(function (){ + $scope.validateSingleFeatureId(); + // $timeout(function(){ + + // $scope.$digest(); + // }, 250); + }); + } + + $scope.generateIdProposalFromExistingFeatures = function(){ + if (! $scope.georesourceFeaturesGeoJSON){ + return 0; + } + // String or Integer + let idDataType = $scope.schemaObject[__env.FEATURE_ID_PROPERTY_NAME]; + + // array of id values + let existingFeatureIds = $scope.georesourceFeaturesGeoJSON.features.map(feature => { + if(feature.properties[__env.FEATURE_ID_PROPERTY_NAME]){ + return feature.properties[__env.FEATURE_ID_PROPERTY_NAME]; + } + else{ + return 0; + } + }); + + let length = existingFeatureIds.length; + $scope.featureIdExampleString = "" + existingFeatureIds[0] + "; " + existingFeatureIds[Math.round(length/2) ] + "; " + existingFeatureIds[length - 1]; + + if(idDataType == "Integer" || idDataType == "Double"){ + return $scope.generateIdProposalFromExistingFeatures_numeric(existingFeatureIds); + } + else{ + // generate UUID + return $scope.generateIdProposalFromExistingFeatures_uuid(existingFeatureIds); + } + }; + + $scope.generateIdProposalFromExistingFeatures_numeric = function(existingFeatureIds){ + + // determine max value + let maxValue = Math.max(...existingFeatureIds); + + // return increment + return maxValue + 1; + }; + + $scope.generateIdProposalFromExistingFeatures_uuid = function(existingFeatureIds){ + // return UUID using UUID library + return uuidv4(); + }; + + $scope.validateSingleFeatureId = function(){ + $scope.featureIdIsValid = true; + if($scope.georesourceFeaturesGeoJSON && $scope.featureIdValue){ + let filteredFeatures = $scope.georesourceFeaturesGeoJSON.features.filter(feature => feature.properties[__env.FEATURE_ID_PROPERTY_NAME] == $scope.featureIdValue); + + if(filteredFeatures.length == 0){ + $scope.featureIdIsValid = true; + } + else{ + $scope.featureIdIsValid = false; + } + return $scope.featureIdIsValid; + } + else{ + // no other data available in dataset + if ($scope.featureIdValue == undefined || $scope.featureIdValue == null){ + $scope.featureIdIsValid = false; + } + else{ + $scope.featureIdIsValid = true; + } + } + + return $scope.featureIdIsValid; + }; + + $scope.initFeatureSchema = async function(){ + $scope.featureSchemaProperties = []; + + return await $http({ + url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + $scope.currentGeoresourceDataset.georesourceId + "/schema", + method: "GET", + // headers: { + // 'Content-Type': undefined + // } + }).then(function successCallback(response) { + + $scope.schemaObject = response.data; + + for (var property in $scope.schemaObject){ + if (property != __env.FEATURE_ID_PROPERTY_NAME && property != __env.FEATURE_NAME_PROPERTY_NAME && property != __env.VALID_START_DATE_PROPERTY_NAME && property != __env.VALID_END_DATE_PROPERTY_NAME){ + $scope.featureSchemaProperties.push( + {property: property, + value: undefined} + ); + } + } + + return $scope.schemaObject; + + }, function errorCallback(error) { + + }); + }; + + $scope.addExampleValuesToSchemaProperties = function(){ + if ($scope.georesourceFeaturesGeoJSON && $scope.featureSchemaProperties && $scope.georesourceFeaturesGeoJSON.features && $scope.georesourceFeaturesGeoJSON.features[0]){ + let exampleFeature = $scope.georesourceFeaturesGeoJSON.features[0]; + for (const element of $scope.featureSchemaProperties) { + element.exampleValue = exampleFeature.properties[element.property]; + } + } + }; + + $scope.addSingleGeoresourceFeature = async function(){ + + $timeout(function(){ + $scope.loadingData = true; + }); + + $scope.importerErrors = undefined; + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + + /* + now collect data and build request for importer + */ + + var allDataSpecified = await $scope.buildImporterObjects_singleFeatureImport(); + + // TODO Create and perform POST Request with loading screen + + var updateGeoresourceResponse_dryRun = undefined; + try { + updateGeoresourceResponse_dryRun = await kommonitorImporterHelperService.updateGeoresource($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.currentGeoresourceDataset.georesourceId, $scope.putBody_georesources, true); + + // this callback will be called asynchronously + // when the response is available + + + + + if(! kommonitorImporterHelperService.importerResponseContainsErrors(updateGeoresourceResponse_dryRun)){ + // all good, really execute the request to import data against data management API + var updateGeoresourceResponse = await kommonitorImporterHelperService.updateGeoresource($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.currentGeoresourceDataset.georesourceId, $scope.putBody_georesources, false); + + $rootScope.$broadcast("refreshGeoresourceOverviewTable", "edit", $scope.currentGeoresourceDataset.georesourceId); + + $scope.refreshGeoresourceEditFeaturesOverviewTable(); + $scope.initSingleFeatureAddMenu(); + + $scope.successMessagePart = $scope.currentGeoresourceDataset.datasetName; + $scope.importedFeatures = kommonitorImporterHelperService.getImportedFeaturesFromImporterResponse(updateGeoresourceResponse); + + // as the update was successfull we must prevent the user from importing the same object again + $scope.featureIdIsValid = false; + // add the new feature to current dataset! + if($scope.georesourceFeaturesGeoJSON){ + $scope.georesourceFeaturesGeoJSON.features.push($scope.featureGeometryValue.features[0]); + } + else{ + $scope.georesourceFeaturesGeoJSON = turf.featureCollection([ + $scope.featureGeometryValue.features[0] + ]); + } + + + $("#georesourceEditFeaturesSuccessAlert").show(); + $scope.loadingData = false; + } + else{ + // errors ocurred + // show them + $scope.errorMessagePart = "Das zu importierende Feature des Datensatzes weist kritische Fehler auf"; + $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(updateGeoresourceResponse_dryRun); + + $("#georesourceEditFeaturesErrorAlert").show(); + $scope.loadingData = false; + + setTimeout(() => { + $scope.$digest(); + }, 250); + + } + } catch (error) { + console.error(error); + if(error.data){ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else{ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + if(updateGeoresourceResponse_dryRun){ + $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(updateGeoresourceResponse_dryRun); + } + + $("#georesourceEditFeaturesErrorAlert").show(); + $scope.loadingData = false; + + setTimeout(() => { + $scope.$digest(); + }, 250); + } + }; + + $scope.$on("onUpdateSingleFeatureGeometry", function(event, geoJSON){ + $scope.featureGeometryValue = geoJSON; + $scope.$digest(); + }); + + $scope.refreshGeoresourceEditFeaturesOverviewTable = function(){ + + $scope.loadingData = true; + // fetch all georesource features + $http({ + url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + $scope.currentGeoresourceDataset.georesourceId + "/allFeatures", + method: "GET", + // headers: { + // 'Content-Type': undefined + // } + }).then(function successCallback(response) { + + $scope.georesourceFeaturesGeoJSON = response.data; + + var tmpRemainingHeaders = []; + + for (var property in $scope.georesourceFeaturesGeoJSON.features[0].properties){ + if (property != __env.FEATURE_ID_PROPERTY_NAME && property != __env.FEATURE_NAME_PROPERTY_NAME && property != __env.VALID_START_DATE_PROPERTY_NAME && property != __env.VALID_END_DATE_PROPERTY_NAME){ + tmpRemainingHeaders.push(property); + } + } + + $scope.remainingFeatureHeaders = tmpRemainingHeaders; + + // as we require the information about the dataset ID within each feature to enable feature record updates from within the datatable + // we must include the dataset ID within each feature + + kommonitorDataGridHelperService.buildDataGrid_featureTable_spatialResource("georesourceFeatureTable", tmpRemainingHeaders, $scope.georesourceFeaturesGeoJSON.features, $scope.currentGeoresourceDataset.georesourceId, kommonitorDataGridHelperService.resourceType_georesource, $scope.enableDeleteFeatures); + + + $scope.loadingData = false; + + }, function errorCallback(error) { + if(error.data){ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else{ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + + $("#georesourceEditFeaturesErrorAlert").show(); + $scope.loadingData = false; + }); + }; + + $scope.clearAllGeoresourceFeatures = function(){ + $scope.loadingData = true; + // delete all georesource features + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/georesources/" + $scope.currentGeoresourceDataset.georesourceId + "/allFeatures", + method: "DELETE", + // headers: { + // 'Content-Type': undefined + // } + }).then(function successCallback(response) { + + $scope.georesourceFeaturesGeoJSON = undefined; + $scope.remainingFeatureHeaders = undefined; + + $rootScope.$broadcast("refreshGeoresourceOverviewTable", "edit", $scope.currentGeoresourceDataset.georesourceId); + // empty data grid as all data has been deleted + kommonitorDataGridHelperService.buildDataGrid_featureTable_spatialResource("georesourceFeatureTable", [], []); + // reset whole form + $scope.resetGeoresourceEditFeaturesForm(); + + $scope.successMessagePart = $scope.currentGeoresourceDataset.datasetName; + + $("#georesourceEditFeaturesSuccessAlert").show(); + $scope.loadingData = false; + + }, function errorCallback(error) { + if(error.data){ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else{ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + + $("#georesourceEditFeaturesErrorAlert").show(); + $scope.loadingData = false; + }); + }; + + $scope.resetGeoresourceEditFeaturesForm = function(){ + + // reset edit banners + kommonitorDataGridHelperService.featureTable_georesource_lastUpdate_timestamp_success = undefined; + kommonitorDataGridHelperService.featureTable_georesource_lastUpdate_timestamp_failure = undefined; + + // variables for single feature import + $scope.featureIdValue = 0; + $scope.featureIdExampleString = undefined; + $scope.featureIdIsValid = false; + $scope.featureNameValue = undefined; + $scope.featureGeometryValue = undefined; + $scope.featureStartDateValue = undefined; + $scope.featureEndDateValue = undefined; + // [{property: name, value: value}] + $scope.featureSchemaProperties = []; + + // reinit single feature add menu + $scope.initSingleFeatureAddMenu(); + + //variables for multiple feature import + + $scope.georesourceFeaturesGeoJSON = undefined; + $scope.remainingFeatureHeaders = undefined; + + $scope.periodOfValidity = {}; + $scope.periodOfValidity.startDate = undefined; + $scope.periodOfValidity.endDate = undefined; + $scope.periodOfValidityInvalid = false; + + $scope.georesourceEditFeaturesDataSourceInputInvalidReason = undefined; + $scope.georesourceEditFeaturesDataSourceInputInvalid = false; + $scope.georesourceDataSourceIdProperty = undefined; + $scope.georesourceDataSourceNameProperty = undefined; + + $scope.converter = undefined; + $scope.schema = undefined; + $scope.mimeType = undefined; + $scope.featureInfoText_singleFeatureAddMenu = undefined; + $scope.datasourceType = undefined; + $scope.georesourceDataSourceIdProperty = undefined; + $scope.georesourceDataSourceNameProperty = undefined; + + $scope.converterDefinition = undefined; + $scope.datasourceTypeDefinition = undefined; + $scope.propertyMappingDefinition = undefined; + $scope.putBody_georesources = undefined; + + $scope.validityEndDate_perFeature = undefined; + $scope.validityStartDate_perFeature = undefined; + + $scope.attributeMapping_sourceAttributeName = undefined; + $scope.attributeMapping_destinationAttributeName = undefined; + $scope.attributeMapping_data = undefined; + $scope.attributeMapping_attributeType = kommonitorImporterHelperService.attributeMapping_attributeTypes[0]; + $scope.attributeMappings_adminView = []; + $scope.keepAttributes = true; + $scope.keepMissingValues = true; + + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + $scope.importerErrors = undefined; + + $("#georesourceEditFeaturesSuccessAlert").hide(); + $("#georesourceEditFeaturesErrorAlert").hide(); + + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + + $scope.onChangeConverter = function(){ + $scope.schema = $scope.converter.schemas ? $scope.converter.schemas[0] : undefined; + $scope.mimeType = $scope.converter.mimeTypes[0]; + }; + + $scope.onChangeMimeType = function(mimeType){ + $scope.mimeType = mimeType; + }; + + $scope.filterByKomMonitorProperties = function() { + return function( item ) { + + try{ + if (item === __env.FEATURE_ID_PROPERTY_NAME || item === __env.FEATURE_NAME_PROPERTY_NAME || item === "validStartDate" || item === "validEndDate"){ + return false; + } + return true; + } + catch(error){ + return false; + } + }; + }; + + $scope.getFeatureId = function(geojsonFeature){ + return geojsonFeature.properties[__env.FEATURE_ID_PROPERTY_NAME]; + }; + + $scope.getFeatureName = function(geojsonFeature){ + return geojsonFeature.properties[__env.FEATURE_NAME_PROPERTY_NAME]; + }; + + $scope.checkPeriodOfValidity = function(){ + $scope.periodOfValidityInvalid = false; + if ($scope.periodOfValidity.startDate && $scope.periodOfValidity.endDate){ + var startDate = new Date($scope.periodOfValidity.startDate); + var endDate = new Date($scope.periodOfValidity.endDate); + + if ((startDate === endDate) || startDate > endDate){ + // failure + $scope.periodOfValidityInvalid = true; + } + } + }; + + $scope.onAddOrUpdateAttributeMapping = function(){ + var tmpAttributeMapping_adminView = { + "sourceName": $scope.attributeMapping_sourceAttributeName, + "destinationName": $scope.attributeMapping_destinationAttributeName, + "dataType": $scope.attributeMapping_attributeType + }; + + var processed = false; + + for (let index = 0; index < $scope.attributeMappings_adminView.length; index++) { + var attributeMappingEntry_adminView = $scope.attributeMappings_adminView[index]; + + if (attributeMappingEntry_adminView.sourceName === tmpAttributeMapping_adminView.sourceName){ + // replace object + $scope.attributeMappings_adminView[index] = tmpAttributeMapping_adminView; + processed = true; + break; + } + } + + if(! processed){ + // new entry + $scope.attributeMappings_adminView.push(tmpAttributeMapping_adminView); + } + + $scope.attributeMapping_sourceAttributeName = undefined; + $scope.attributeMapping_destinationAttributeName = undefined; + $scope.attributeMapping_attributeType = kommonitorImporterHelperService.attributeMapping_attributeTypes[0]; + + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + + $scope.onClickEditAttributeMapping = function(attributeMappingEntry){ + $scope.attributeMapping_sourceAttributeName = attributeMappingEntry.sourceName; + $scope.attributeMapping_destinationAttributeName = attributeMappingEntry.destinationName; + $scope.attributeMapping_attributeType = attributeMappingEntry.dataType; + + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + + $scope.onClickDeleteAttributeMapping = function(attributeMappingEntry){ + for (let index = 0; index < $scope.attributeMappings_adminView.length; index++) { + + if ($scope.attributeMappings_adminView[index].sourceName === attributeMappingEntry.sourceName){ + // remove object + $scope.attributeMappings_adminView.splice(index, 1); + break; + } + } + + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + + $scope.buildImporterObjects_singleFeatureImport = async function(){ + $scope.converterDefinition = kommonitorImporterHelperService.converterDefinition_singleFeatureImport; + $scope.datasourceTypeDefinition = kommonitorImporterHelperService.datasourceDefinition_singleFeatureImport; + $scope.propertyMappingDefinition = kommonitorImporterHelperService.propertyMappingDefinition_singleFeatureImport; + + // make geoJSON FeatureCollection and fill feature properties from single feature menu + $scope.featureGeometryValue.features[0].properties[__env.FEATURE_ID_PROPERTY_NAME] = $scope.featureIdValue; + $scope.featureGeometryValue.features[0].properties[__env.FEATURE_NAME_PROPERTY_NAME] = $scope.featureNameValue; + $scope.featureGeometryValue.features[0].properties[__env.VALID_START_DATE_PROPERTY_NAME] = $scope.featureStartDateValue; + $scope.featureGeometryValue.features[0].properties[__env.VALID_END_DATE_PROPERTY_NAME] = $scope.featureEndDateValue; + + for (const element of $scope.featureSchemaProperties) { + $scope.featureGeometryValue.features[0].properties[element.property] = element.value; + } + + $scope.datasourceTypeDefinition.parameters[0].value = JSON.stringify($scope.featureGeometryValue); + + var scopeProperties = { + "periodOfValidity": { + "endDate": $scope.featureEndDateValue, + "startDate": $scope.featureStartDateValue + }, + "isPartialUpdate": true + }; + $scope.putBody_georesources = kommonitorImporterHelperService.buildPutBody_georesources(scopeProperties); + + if(!$scope.converterDefinition || !$scope.datasourceTypeDefinition || !$scope.propertyMappingDefinition || !$scope.putBody_georesources){ + return false; + } + + return true; + }; + + $scope.buildImporterObjects = async function(){ + $scope.converterDefinition = $scope.buildConverterDefinition(); + $scope.datasourceTypeDefinition = await $scope.buildDatasourceTypeDefinition(); + $scope.propertyMappingDefinition = $scope.buildPropertyMappingDefinition(); + + var scopeProperties = { + "periodOfValidity": { + "endDate": $scope.periodOfValidity.endDate, + "startDate": $scope.periodOfValidity.startDate + }, + "isPartialUpdate": $scope.isPartialUpdate + } + $scope.putBody_georesources = kommonitorImporterHelperService.buildPutBody_georesources(scopeProperties); + + if(!$scope.converterDefinition || !$scope.datasourceTypeDefinition || !$scope.propertyMappingDefinition || !$scope.putBody_georesources){ + return false; + } + + return true; + }; + + $scope.buildConverterDefinition = function(){ + + return kommonitorImporterHelperService.buildConverterDefinition($scope.converter, "converterParameter_georesourceEditFeatures_", $scope.schema, $scope.mimeType); + }; + + $scope.buildDatasourceTypeDefinition = async function(){ + try { + return await kommonitorImporterHelperService.buildDatasourceTypeDefinition($scope.datasourceType, 'datasourceTypeParameter_georesourceEditFeatures_', 'georesourceDataSourceInput_editFeatures'); + } catch (error) { + if(error.data){ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else{ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + + $("#georesourceEditFeaturesErrorAlert").show(); + $scope.loadingData = false; + return null; + } + }; + + $scope.buildPropertyMappingDefinition = function(){ + // arsion from is undefined currently + return kommonitorImporterHelperService.buildPropertyMapping_spatialResource($scope.georesourceDataSourceNameProperty, $scope.georesourceDataSourceIdProperty, $scope.validityStartDate_perFeature, $scope.validityEndDate_perFeature, undefined, $scope.keepAttributes, $scope.keepMissingValues, $scope.attributeMappings_adminView); + }; + + $scope.editGeoresourceFeatures = async function(){ + + $timeout(function(){ + $scope.loadingData = true; + }); + + $scope.importerErrors = undefined; + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + + /* + now collect data and build request for importer + */ + + /* + if any required importer data is missing --> cancel request and highlight required errors + */ + var allDataSpecified = await $scope.buildImporterObjects(); + + if (!allDataSpecified) { + + $("#georesourceEditFeaturesForm").validator("update"); + $("#georesourceEditFeaturesForm").validator("validate"); + return; + } + else { + + + // TODO verify input + + // TODO Create and perform POST Request with loading screen + + var updateGeoresourceResponse_dryRun = undefined; + try { + updateGeoresourceResponse_dryRun = await kommonitorImporterHelperService.updateGeoresource($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.currentGeoresourceDataset.georesourceId, $scope.putBody_georesources, true); + + // this callback will be called asynchronously + // when the response is available + + + + + if(! kommonitorImporterHelperService.importerResponseContainsErrors(updateGeoresourceResponse_dryRun)){ + // all good, really execute the request to import data against data management API + var updateGeoresourceResponse = await kommonitorImporterHelperService.updateGeoresource($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.currentGeoresourceDataset.georesourceId, $scope.putBody_georesources, false); + + $rootScope.$broadcast("refreshGeoresourceOverviewTable", "edit", $scope.currentGeoresourceDataset.georesourceId); + $scope.refreshGeoresourceEditFeaturesOverviewTable(); + $scope.initSingleFeatureAddMenu(); + + $scope.successMessagePart = $scope.currentGeoresourceDataset.datasetName; + $scope.importedFeatures = kommonitorImporterHelperService.getImportedFeaturesFromImporterResponse(updateGeoresourceResponse); + + $("#georesourceEditFeaturesSuccessAlert").show(); + $scope.loadingData = false; + } + else{ + // errors ocurred + // show them + $scope.errorMessagePart = "Einige der zu importierenden Features des Datensatzes weisen kritische Fehler auf"; + $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(updateGeoresourceResponse_dryRun); + + $("#georesourceEditFeaturesErrorAlert").show(); + $scope.loadingData = false; + + setTimeout(() => { + $scope.$digest(); + }, 250); + + } + } catch (error) { + if(error.data){ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else{ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + if(updateGeoresourceResponse_dryRun){ + $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(updateGeoresourceResponse_dryRun); + } + + $("#georesourceEditFeaturesErrorAlert").show(); + $scope.loadingData = false; + + setTimeout(() => { + $scope.$digest(); + }, 250); + } + } + }; + + $scope.onImportGeoresourceEditFeaturesMappingConfig = function(){ + + $scope.georesourceMappingConfigImportError = ""; + + $("#georesourceMappingConfigEditFeaturesImportFile").files = []; + + // trigger file chooser + $("#georesourceMappingConfigEditFeaturesImportFile").click(); + + }; + + $(document).on("change", "#georesourceMappingConfigEditFeaturesImportFile" ,function(){ + + console.log("Importing Importer Mapping Config for EditFeatures Georesource Form"); + + // get the file + var file = document.getElementById('georesourceMappingConfigEditFeaturesImportFile').files[0]; + $scope.parseMappingConfigFromFile(file); + }); + + $scope.parseMappingConfigFromFile = function(file){ + var fileReader = new FileReader(); + + fileReader.onload = function(event) { + + try{ + $scope.parseFromMappingConfigFile(event); + } + catch(error){ + console.error(error); + console.error("Uploaded MappingConfig File cannot be parsed."); + $scope.georesourceMappingConfigImportError = "Uploaded MappingConfig File cannot be parsed correctly"; + document.getElementById("georesourcesEditFeaturesMappingConfigPre").innerHTML = $scope.georesourceMappingConfigStructure_pretty; + $("#georesourceEditFeaturesMappingConfigImportErrorAlert").show(); + + $scope.$digest(); + } + + }; + + // Read in the image file as a data URL. + fileReader.readAsText(file); + }; + + $scope.parseFromMappingConfigFile = function(event){ + $scope.mappingConfigImportSettings = JSON.parse(event.target.result); + + if(! $scope.mappingConfigImportSettings.converter || ! $scope.mappingConfigImportSettings.dataSource || ! $scope.mappingConfigImportSettings.propertyMapping){ + console.error("uploaded MappingConfig File cannot be parsed - wrong structure."); + $scope.georesourceMetadataImportError = "Struktur der Datei stimmt nicht mit erwartetem Muster überein."; + document.getElementById("georesourcesEditFeaturesMappingConfigPre").innerHTML = $scope.georesourceMappingConfigStructure_pretty; + $("#georesourceEditFeaturesMappingConfigImportErrorAlert").show(); + + $scope.$digest(); + } + + $scope.converter = undefined; + for(var converter of kommonitorImporterHelperService.availableConverters){ + if (converter.name === $scope.mappingConfigImportSettings.converter.name){ + $scope.converter = converter; + break; + } + } + + $scope.schema = undefined; + if ($scope.converter && $scope.converter.schemas && $scope.mappingConfigImportSettings.converter.schema){ + for (var schema of $scope.converter.schemas) { + if (schema === $scope.mappingConfigImportSettings.converter.schema){ + $scope.schema = schema; + } + } + } + + $scope.mimeType = undefined; + if ($scope.converter && $scope.converter.mimeTypes && $scope.mappingConfigImportSettings.converter.mimeType){ + for (var mimeType of $scope.converter.mimeTypes) { + if (mimeType === $scope.mappingConfigImportSettings.converter.mimeType){ + $scope.mimeType = mimeType; + } + } + } + + $scope.datasourceType = undefined; + for(var datasourceType of kommonitorImporterHelperService.availableDatasourceTypes){ + if (datasourceType.type === $scope.mappingConfigImportSettings.dataSource.type){ + $scope.datasourceType = datasourceType; + break; + } + } + + $scope.$digest(); + + // converter parameters + if ($scope.converter){ + for (var convParameter of $scope.mappingConfigImportSettings.converter.parameters) { + $("#converterParameter_georesourceEditFeatures_" + convParameter.name).val(convParameter.value); + } + } + + // datasourceTypes parameters + if ($scope.datasourceType){ + for (var dsParameter of $scope.mappingConfigImportSettings.dataSource.parameters) { + $("#datasourceTypeParameter_georesourceEditFeatures_" + dsParameter.name).val(dsParameter.value); + } + } + + // property Mapping + $scope.georesourceDataSourceNameProperty = $scope.mappingConfigImportSettings.propertyMapping.nameProperty; + $scope.georesourceDataSourceIdProperty = $scope.mappingConfigImportSettings.propertyMapping.identifierProperty; + $scope.validityStartDate_perFeature = $scope.mappingConfigImportSettings.propertyMapping.validStartDateProperty; + $scope.validityEndDate_perFeature = $scope.mappingConfigImportSettings.propertyMapping.validEndDateProperty; + $scope.keepAttributes = $scope.mappingConfigImportSettings.propertyMapping.keepAttributes; + $scope.keepMissingValues = $scope.mappingConfigImportSettings.propertyMapping.keepMissingOrNullValueAttributes; + $scope.attributeMappings_adminView = []; + + for (var attributeMapping of $scope.mappingConfigImportSettings.propertyMapping.attributes) { + var tmpEntry = { + "sourceName": attributeMapping.name, + "destinationName": attributeMapping.mappingName + }; + + for (const dataType of kommonitorImporterHelperService.attributeMapping_attributeTypes) { + if (dataType.apiName === attributeMapping.type){ + tmpEntry.dataType = dataType; + } + } + + $scope.attributeMappings_adminView.push(tmpEntry); + } + + if ($scope.mappingConfigImportSettings.periodOfValidity){ + $scope.periodOfValidity = {}; + $scope.periodOfValidity.startDate = $scope.mappingConfigImportSettings.periodOfValidity.startDate; + $scope.periodOfValidity.endDate = $scope.mappingConfigImportSettings.periodOfValidity.endDate; + $scope.periodOfValidityInvalid = false; + + // update datePickers + if ($scope.periodOfValidity.startDate){ + $("#georesourceEditFeaturesDatepickerStart").datepicker('setDate', $scope.periodOfValidity.startDate); + } + if ($scope.periodOfValidity.endDate){ + $("#georesourceEditFeaturesDatepickerEnd").datepicker('setDate', $scope.periodOfValidity.endDate); + } + } + + $scope.$digest(); + }; + + $scope.onExportGeoresourceEditFeaturesMappingConfig = async function(){ + var converterDefinition = $scope.buildConverterDefinition(); + var datasourceTypeDefinition = await $scope.buildDatasourceTypeDefinition(); + var propertyMappingDefinition = $scope.buildPropertyMappingDefinition(); + + var mappingConfigExport = { + "converter": converterDefinition, + "dataSource": datasourceTypeDefinition, + "propertyMapping": propertyMappingDefinition, + }; + + mappingConfigExport.periodOfValidity = $scope.periodOfValidity; + + var name = $scope.datasetName; + + var metadataJSON = JSON.stringify(mappingConfigExport); + + var fileName = "KomMonitor-Import-Mapping-Konfiguration_Export"; + + if (name){ + fileName += "-" + name; + } + + fileName += ".json"; + + var blob = new Blob([metadataJSON], {type: "application/json"}); + var data = URL.createObjectURL(blob); + + var a = document.createElement('a'); + a.download = fileName; + a.href = data; + a.textContent = "JSON"; + a.target = "_blank"; + a.rel = "noopener noreferrer"; + a.click(); + + a.remove(); + }; + + + $scope.hideSuccessAlert = function(){ + $("#georesourceEditFeaturesSuccessAlert").hide(); + }; + + $scope.hideErrorAlert = function(){ + $("#georesourceEditFeaturesErrorAlert").hide(); + }; + + $scope.hideMappingConfigErrorAlert = function(){ + $("#georesourceEditFeaturesMappingConfigImportErrorAlert").hide(); + }; + + $rootScope.$on("showLoadingIcon_" + kommonitorDataGridHelperService.resourceType_georesource, function(event){ + $timeout(function(){ + + $scope.loadingData = true; + }); + }); + + $rootScope.$on("hideLoadingIcon_" + kommonitorDataGridHelperService.resourceType_georesource, function(event){ + $timeout(function(){ + + $scope.loadingData = false; + }); + }); + + $rootScope.$on("onDeleteFeatureEntry_" + kommonitorDataGridHelperService.resourceType_georesource, function(event){ + $rootScope.$broadcast("refreshGeoresourceOverviewTable", "edit", $scope.currentGeoresourceDataset.georesourceId); + $scope.refreshGeoresourceEditFeaturesOverviewTable(); + }); + + $scope.onChangeEnableDeleteFeatures = function(){ + if($scope.enableDeleteFeatures){ + $(".georesourceDeleteFeatureRecordBtn").attr("disabled", false); + } + else{ + $(".georesourceDeleteFeatureRecordBtn").attr("disabled", true); + } + } + + } +]}); diff --git a/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditFeaturesModal/georesource-edit-features-modal.module.js b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditFeaturesModal/georesource-edit-features-modal.module.js index bba9244db..6eaef3d53 100644 --- a/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditFeaturesModal/georesource-edit-features-modal.module.js +++ b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditFeaturesModal/georesource-edit-features-modal.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('georesourceEditFeaturesModal', ['kommonitorDataGridHelper', 'kommonitorImporterHelper', 'kommonitorSingleFeatureMapHelper', 'kommonitorMultiStepFormHelper']); +//# sourceMappingURL=georesource-edit-features-modal.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditFeaturesModal/georesource-edit-features-modal.module.js.map b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditFeaturesModal/georesource-edit-features-modal.module.js.map new file mode 100644 index 000000000..d0e89d51d --- /dev/null +++ b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditFeaturesModal/georesource-edit-features-modal.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"georesource-edit-features-modal.module.js","sourceRoot":"","sources":["georesource-edit-features-modal.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,8BAA8B,EAAE,CAAC,0BAA0B,EAAE,0BAA0B,EAAE,kCAAkC,EAAE,+BAA+B,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditFeaturesModal/georesource-edit-features-modal.module.ts b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditFeaturesModal/georesource-edit-features-modal.module.ts new file mode 100644 index 000000000..bba9244db --- /dev/null +++ b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditFeaturesModal/georesource-edit-features-modal.module.ts @@ -0,0 +1 @@ +angular.module('georesourceEditFeaturesModal', ['kommonitorDataGridHelper', 'kommonitorImporterHelper', 'kommonitorSingleFeatureMapHelper', 'kommonitorMultiStepFormHelper']); diff --git a/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditMetadataModal/georesource-edit-metadata-modal.component.js b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditMetadataModal/georesource-edit-metadata-modal.component.js index c56e79237..a96d875ba 100644 --- a/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditMetadataModal/georesource-edit-metadata-modal.component.js +++ b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditMetadataModal/georesource-edit-metadata-modal.component.js @@ -1,692 +1,562 @@ +"use strict"; angular.module('georesourceEditMetadataModal').component('georesourceEditMetadataModal', { - templateUrl : "components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditMetadataModal/georesource-edit-metadata-modal.template.html", - controller : ['kommonitorDataExchangeService', '$scope', '$rootScope', '$http', '__env', '$timeout', 'kommonitorMultiStepFormHelperService', - 'kommonitorDataGridHelperService', - function GeoresourceEditMetadataModalController(kommonitorDataExchangeService, $scope, $rootScope, $http, __env, $timeout, - kommonitorMultiStepFormHelperService, kommonitorDataGridHelperService) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - - $scope.currentGeoresourceDataset; - - /* POST BODY - { - "isLOI": false, - "metadata": { - "note": "note", - "literature": "literature", - "updateInterval": "ARBITRARY", - "sridEPSG": 0.8008281904610115, - "datasource": "datasource", - "contact": "contact", - "lastUpdate": "2000-01-23", - "description": "description", - "databasis": "databasis" - }, - "allowedRoles": [ - "allowedRoles", - "allowedRoles" - ], - "datasetName": "datasetName", - "poiSymbolBootstrap3Name": "poiSymbolBootstrap3Name", - "poiSymbolColor": "white", - "isAOI": false, - "loiDashArrayString": "loiDashArrayString", - "topicReference": "topicReference", - "poiMarkerColor": "white", - "isPOI": false, - "loiColor": "loiColor", - "loiWidth": "loiWidth", - "aoiColor": "aoiColor" - } - */ - - //Date picker - $('#georesourceEditLastUpdateDatepicker').datepicker(kommonitorDataExchangeService.datePickerOptions); - - $scope.loadingData = false; - - $scope.georesourceMetadataStructure = { - "metadata": { - "note": "an optional note", - "literature": "optional text about literature", - "updateInterval": "YEARLY|HALF_YEARLY|QUARTERLY|MONTHLY|ARBITRARY", - "sridEPSG": 4326, - "datasource": "text about data source", - "contact": "text about contact details", - "lastUpdate": "YYYY-MM-DD", - "description": "description about spatial unit dataset", - "databasis": "text about data basis", - }, - "allowedRoles": ['roleId'], - "datasetName": "Name of georesource dataset", - "isPOI": "boolean parameter for point of interest dataset - only one of isPOI, isLOI, isAOI can be true", - "isLOI": "boolean parameter for lines of interest dataset - only one of isPOI, isLOI, isAOI can be true", - "isAOI": "boolean parameter for area of interest dataset - only one of isPOI, isLOI, isAOI can be true", - "poiSymbolBootstrap3Name": "glyphicon name of bootstrap 3 symbol to use for a POI resource", - "poiSymbolColor": "'white'|'red'|'orange'|'beige'|'green'|'blue'|'purple'|'pink'|'gray'|'black'", - "loiDashArrayString": "dash array string value - e.g. 20 20", - "poiMarkerColor": "'white'|'red'|'orange'|'beige'|'green'|'blue'|'purple'|'pink'|'gray'|'black'", - "loiColor": "color for lines of interest dataset", - "loiWidth": "width for lines of interest dataset", - "aoiColor": "color for area of interest dataset" - }; - - $scope.georesourceMetadataStructure_pretty = kommonitorDataExchangeService.syntaxHighlightJSON($scope.georesourceMetadataStructure); - - $scope.metadataImportSettings; - $scope.georesourceMetadataImportError; - $scope.georesourceMetadataImportErrorAlert; - - $scope.datasetName = undefined; - $scope.datasetNameInvalid = false; - - $scope.metadata = {}; - $scope.metadata.note = undefined; - $scope.metadata.literature = undefined; - $scope.metadata.updateInterval = undefined; - $scope.metadata.sridEPSG = undefined; - $scope.metadata.datasource = undefined; - $scope.metadata.databasis = undefined; - $scope.metadata.contact = undefined; - $scope.metadata.lastUpdate = undefined; - $scope.metadata.description = undefined; - - $scope.roleManagementTableOptions = undefined; - - $scope.georesourceTopic_mainTopic = undefined; - $scope.georesourceTopic_subTopic = undefined; - $scope.georesourceTopic_subsubTopic = undefined; - $scope.georesourceTopic_subsubsubTopic = undefined; - - $scope.georesourceType = "poi"; - $scope.isPOI = true; - $scope.isLOI = false; - $scope.isAOI = false; - $scope.selectedPoiMarkerColor = kommonitorDataExchangeService.availablePoiMarkerColors[0]; - $scope.selectedPoiSymbolColor = kommonitorDataExchangeService.availablePoiMarkerColors[1]; - $scope.selectedLoiDashArrayObject = kommonitorDataExchangeService.availableLoiDashArrayObjects[0]; - $scope.loiColor = "#bf3d2c"; - $scope.loiWidth = 3; - $scope.aoiColor = "#bf3d2c"; - $scope.selectedPoiIconName = "home"; - - $scope.iconPickerOptions = { - align: 'center', // Only in div tag - arrowClass: 'btn-default', - arrowPrevIconClass: 'fas fa-angle-left', - arrowNextIconClass: 'fas fa-angle-right', - cols: 10, - footer: true, - header: true, - icon: 'glyphicon-' + $scope.selectedPoiIconName, - iconset: 'glyphicon', - labelHeader: '{0} von {1} Seiten', - labelFooter: '{0} - {1} von {2} Icons', - placement: 'bottom', // Only in button tag - rows: 6, - search: true, - searchText: 'Stichwortsuche (Bootstrap Glyphicons)', - selectedClass: 'btn-success', - unselectedClass: '' - }; - - $scope.$on("availableRolesUpdate", function (event) { - refreshRoles(); - }); - - function refreshRoles() { - let allowedRoles = $scope.currentGeoresourceDataset ? $scope.currentGeoresourceDataset.allowedRoles : []; - $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('georesourceEditRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, allowedRoles); - } - - $('#poiSymbolEditPicker').iconpicker($scope.iconPickerOptions); - - $('#poiSymbolEditPicker').on('change', function(e) { - // split up due to current data management request structure where we expect only the last name of Bootstrap 3.3.7 glyphicon name - // i.e. "home" for "glyphicon-home" - $scope.selectedPoiIconName = e.icon.substring(e.icon.indexOf('-')+1); - }); - - $scope.loadingData = false; - - // initialize loiDashArray dropdown - setTimeout(function(){ - for(var i=0; i { - $scope.$digest(); - }, 250); - }; - - $scope.checkDatasetName = function(){ - $scope.datasetNameInvalid = false; - kommonitorDataExchangeService.availableGeoresources.forEach(function(georesource){ - if (georesource.datasetName === $scope.datasetName){ - $scope.datasetNameInvalid = true; - return; - } - }); - }; - - $scope.editGeoresourceMetadata = function(){ - - var patchBody = - { - "metadata": { - "note": $scope.metadata.note, - "literature": $scope.metadata.literature, - "updateInterval": $scope.metadata.updateInterval.apiName, - "sridEPSG": $scope.metadata.sridEPSG, - "datasource": $scope.metadata.datasource, - "contact": $scope.metadata.contact, - "lastUpdate": $scope.metadata.lastUpdate, - "description": $scope.metadata.description, - "databasis": $scope.metadata.databasis, - "sridEPSG": 4326 - }, - "allowedRoles": [], - "datasetName": $scope.datasetName, - "isAOI": $scope.isAOI, - "isLOI": $scope.isLOI, - "isPOI": $scope.isPOI, - "topicReference": null - }; - - let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); - for (const roleId of roleIds) { - patchBody.allowedRoles.push(roleId); - } - - if($scope.isPOI){ - patchBody["poiSymbolBootstrap3Name"] = $scope.selectedPoiIconName; - patchBody["poiSymbolColor"] = $scope.selectedPoiSymbolColor.colorName; - patchBody["poiMarkerColor"] = $scope.selectedPoiMarkerColor.colorName; - - patchBody["loiDashArrayString"] = null; - patchBody["loiColor"] = null; - patchBody["loiWidth"] = null; - - patchBody["aoiColor"] = null; - } - else if($scope.isLOI){ - patchBody["poiSymbolBootstrap3Name"] = null; - patchBody["poiSymbolColor"] = null; - patchBody["poiMarkerColor"] = null; - - patchBody["loiDashArrayString"] = $scope.selectedLoiDashArrayObject.dashArrayValue; - patchBody["loiColor"] = $scope.loiColor; - patchBody["loiWidth"] = $scope.loiWidth; - - patchBody["aoiColor"] = null; - } - else if($scope.isAOI){ - patchBody["poiSymbolBootstrap3Name"] = null; - patchBody["poiSymbolColor"] = null; - patchBody["poiMarkerColor"] = null; - - patchBody["loiDashArrayString"] = null; - patchBody["loiColor"] = null; - patchBody["loiWidth"] = null; - - patchBody["aoiColor"] = $scope.aoiColor; - } - - // TOPIC REFERENCE - if($scope.georesourceTopic_subsubsubTopic){ - patchBody.topicReference = $scope.georesourceTopic_subsubsubTopic.topicId; - } - else if($scope.georesourceTopic_subsubTopic){ - patchBody.topicReference = $scope.georesourceTopic_subsubTopic.topicId; - } - else if($scope.georesourceTopic_subTopic){ - patchBody.topicReference = $scope.georesourceTopic_subTopic.topicId; - } - else if($scope.georesourceTopic_mainTopic){ - patchBody.topicReference = $scope.georesourceTopic_mainTopic.topicId; - } - else { - patchBody.topicReference = ""; - } - - // TODO verify input - - // TODO Create and perform POST Request with loading screen - - $scope.loadingData = true; - - $http({ - url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/georesources/" + $scope.currentGeoresourceDataset.georesourceId, - method: "PATCH", - data: patchBody - // headers: { - // 'Content-Type': undefined - // } - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - $scope.successMessagePart = $scope.datasetName; - - $rootScope.$broadcast("refreshGeoresourceOverviewTable", "edit", $scope.currentGeoresourceDataset.georesourceId); - $("#georesourceEditMetadataSuccessAlert").show(); - $scope.loadingData = false; - - }, function errorCallback(error) { - if(error.data){ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else{ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - - $("#georesourceEditMetadataErrorAlert").show(); - $scope.loadingData = false; - - // setTimeout(function() { - // $("#georesourceEditMetadataSuccessAlert").hide(); - // }, 3000); - }); - }; - - $scope.onImportGeoresourceEditMetadata = function(){ - - $scope.georesourceMetadataImportError = ""; - - $("#georesourceEditMetadataImportFile").files = []; - - // trigger file chooser - $("#georesourceEditMetadataImportFile").click(); - - }; - - $(document).on("change", "#georesourceEditMetadataImportFile" ,function(){ - - console.log("Importing Georesource metadata for Edit Georesource Form"); - - // get the file - var file = document.getElementById('georesourceEditMetadataImportFile').files[0]; - $scope.parseMetadataFromFile(file); - }); - - $scope.parseMetadataFromFile = function(file){ - var fileReader = new FileReader(); - - fileReader.onload = function(event) { - - try{ - $scope.parseFromMetadataFile(event); - } - catch(error){ - console.error("Uploaded Metadata File cannot be parsed."); - $scope.georesourceMetadataImportError = "Uploaded Metadata File cannot be parsed correctly"; - document.getElementById("georesourcesEditMetadataPre").innerHTML = $scope.georesourceMetadataStructure_pretty; - $("#georesourceEditMetadataImportErrorAlert").show(); - - $scope.$digest(); - } - - }; - - // Read in the image file as a data URL. - fileReader.readAsText(file); - }; - - $scope.parseFromMetadataFile = function(event){ - // $scope.geoJsonString = event.target.result; - $scope.metadataImportSettings = JSON.parse(event.target.result); - - if(! $scope.metadataImportSettings.metadata){ - console.error("uploaded Metadata File cannot be parsed - wrong structure."); - $scope.georesourceMetadataImportError = "Struktur der Datei stimmt nicht mit erwartetem Muster überein."; - document.getElementById("georesourcesEditMetadataPre").innerHTML = $scope.georesourceMetadataStructure_pretty; - $("#georesourceEditMetadataImportErrorAlert").show(); - - $scope.$digest(); - } - - $scope.metadata = {}; - $scope.metadata.note = $scope.metadataImportSettings.metadata.note; - $scope.metadata.literature = $scope.metadataImportSettings.metadata.literature; - kommonitorDataExchangeService.updateIntervalOptions.forEach(function(option){ - if(option.apiName === $scope.metadataImportSettings.metadata.updateInterval){ - $scope.metadata.updateInterval = option; - } - }); - $scope.metadata.sridEPSG = $scope.metadataImportSettings.metadata.sridEPSG; - $scope.metadata.datasource = $scope.metadataImportSettings.metadata.datasource; - $scope.metadata.contact = $scope.metadataImportSettings.metadata.contact; - $scope.metadata.lastUpdate = $scope.metadataImportSettings.metadata.lastUpdate; - // initialize date - $('#georesourceEditLastUpdateDatepicker').datepicker('setDate', $scope.metadata.lastUpdate); - - $scope.metadata.description = $scope.metadataImportSettings.metadata.description; - $scope.metadata.databasis = $scope.metadataImportSettings.metadata.databasis; - - $scope.datasetName = $scope.metadataImportSettings.datasetName; - - $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('georesourceEditRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, $scope.metadataImportSettings.allowedRoles); - - // georesource specific properties - - $scope.isPOI = $scope.metadataImportSettings.isPOI; - $scope.isLOI = $scope.metadataImportSettings.isLOI; - $scope.isAOI = $scope.metadataImportSettings.isAOI; - if($scope.metadataImportSettings.isPOI){ - $scope.georesourceType = "poi"; - } - else if($scope.metadataImportSettings.isLOI){ - $scope.georesourceType = "loi"; - } - else{ - $scope.georesourceType = "aoi"; - } - kommonitorDataExchangeService.availablePoiMarkerColors.forEach(function(option){ - if(option.colorName === $scope.metadataImportSettings.poiMarkerColor){ - $scope.selectedPoiMarkerColor = option; - } - if(option.colorName === $scope.metadataImportSettings.poiSymbolColor){ - $scope.selectedPoiSymbolColor = option; - } - }); - kommonitorDataExchangeService.availableLoiDashArrayObjects.forEach(function(option){ - if(option.dashArrayValue === $scope.metadataImportSettings.loiDashArrayString){ - $scope.selectedLoiDashArrayObject = option; - $scope.onChangeLoiDashArray($scope.selectedLoiDashArrayObject); - } - }); - $scope.loiColor = $scope.metadataImportSettings.loiColor; - $scope.loiWidth = $scope.metadataImportSettings.loiWidth; - $scope.aoiColor = $scope.metadataImportSettings.aoiColor; - - $('#loiColorEditPicker').colorpicker('setValue', $scope.loiColor); - $('#aoiColorEditPicker').colorpicker('setValue', $scope.aoiColor); - - $scope.selectedPoiIconName = $scope.metadataImportSettings.poiSymbolBootstrap3Name; - - var topicHierarchy = kommonitorDataExchangeService.getTopicHierarchyForTopicId($scope.metadataImportSettings.topicReference); - - if(topicHierarchy && topicHierarchy[0]){ - $scope.georesourceTopic_mainTopic = topicHierarchy[0]; - } - if(topicHierarchy && topicHierarchy[1]){ - $scope.georesourceTopic_subTopic = topicHierarchy[1]; - } - if(topicHierarchy && topicHierarchy[2]){ - $scope.georesourceTopic_subsubTopic = topicHierarchy[2]; - } - if(topicHierarchy && topicHierarchy[3]){ - $scope.georesourceTopic_subsubsubTopic = topicHierarchy[3]; - } - - setTimeout(function(){ - $("#poiSymbolEditPicker").val("").iconpicker('setIcon', 'glyphicon-' + $scope.metadataImportSettings.poiSymbolBootstrap3Name); - // $("#poiSymbolPicker i").css('glyphicon glyphicon-' + $scope.metadataImportSettings.poiSymbolBootstrap3Name); - // $("#poiSymbolPicker input").css('glyphicon-' + $scope.metadataImportSettings.poiSymbolBootstrap3Name); - }, 200); - - $scope.$digest(); - } - - $scope.onExportGeoresourceEditMetadataTemplate = function(){ - - var metadataJSON = JSON.stringify($scope.georesourceMetadataStructure); - - var fileName = "Georessource_Metadaten_Vorlage_Export.json"; - - var blob = new Blob([metadataJSON], {type: "application/json"}); - var data = URL.createObjectURL(blob); - - var a = document.createElement('a'); - a.download = fileName; - a.href = data; - a.textContent = "JSON"; - a.target = "_blank"; - a.rel = "noopener noreferrer"; - a.click(); - - a.remove(); - }; - - $scope.onExportGeoresourceEditMetadata = function(){ - var metadataExport = $scope.georesourceMetadataStructure; - - metadataExport.metadata.note = $scope.metadata.note || ""; - metadataExport.metadata.literature = $scope.metadata.literature || ""; - metadataExport.metadata.sridEPSG = $scope.metadata.sridEPSG || ""; - metadataExport.metadata.datasource = $scope.metadata.datasource || ""; - metadataExport.metadata.contact = $scope.metadata.contact || ""; - metadataExport.metadata.lastUpdate = $scope.metadata.lastUpdate || ""; - metadataExport.metadata.description = $scope.metadata.description || ""; - metadataExport.metadata.databasis = $scope.metadata.databasis || ""; - metadataExport.datasetName = $scope.datasetName || ""; - - metadataExport.allowedRoles = []; - - let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); - for (const roleId of roleIds) { - metadataExport.allowedRoles.push(roleId); - } - - if($scope.metadata.updateInterval){ - metadataExport.metadata.updateInterval = $scope.metadata.updateInterval.apiName; - } - - var name = $scope.datasetName; - - // georesource specific properties - metadataExport.isPOI = $scope.isPOI; - metadataExport.isLOI = $scope.isLOI; - metadataExport.isAOI = $scope.isAOI; - - if($scope.isPOI){ - metadataExport["poiSymbolBootstrap3Name"] = $scope.selectedPoiIconName; - metadataExport["poiSymbolColor"] = $scope.selectedPoiSymbolColor.colorName; - metadataExport["poiMarkerColor"] = $scope.selectedPoiMarkerColor.colorName; - - metadataExport["loiDashArrayString"] = ""; - metadataExport["loiColor"] = ""; - metadataExport["loiWidth"] = ""; - - metadataExport["aoiColor"] = ""; - } - else if($scope.isLOI){ - metadataExport["poiSymbolBootstrap3Name"] = ""; - metadataExport["poiSymbolColor"] = ""; - metadataExport["poiMarkerColor"] = ""; - - metadataExport["loiDashArrayString"] = $scope.selectedLoiDashArrayObject.dashArrayValue; - metadataExport["loiColor"] = $scope.loiColor; - metadataExport["loiWidth"] = $scope.loiWidth; - - metadataExport["aoiColor"] = ""; - } - else if($scope.isAOI){ - metadataExport["poiSymbolBootstrap3Name"] = ""; - metadataExport["poiSymbolColor"] = ""; - metadataExport["poiMarkerColor"] = ""; - - metadataExport["loiDashArrayString"] = ""; - metadataExport["loiColor"] = ""; - metadataExport["loiWidth"] = ""; - - metadataExport["aoiColor"] = $scope.aoiColor; - } - - if($scope.georesourceTopic_subsubsubTopic){ - metadataExport.topicReference = $scope.georesourceTopic_subsubsubTopic.topicId; - } - else if($scope.georesourceTopic_subsubTopic){ - metadataExport.topicReference = $scope.georesourceTopic_subsubTopic.topicId; - } - else if($scope.georesourceTopic_subTopic){ - metadataExport.topicReference = $scope.georesourceTopic_subTopic.topicId; - } - else if($scope.georesourceTopic_mainTopic){ - metadataExport.topicReference = $scope.georesourceTopic_mainTopic.topicId; - } - else { - metadataExport.topicReference = ""; - } - - - var metadataJSON = JSON.stringify(metadataExport); - - var fileName = "Georessource_Metadaten_Export"; - - if (name){ - fileName += "-" + name; - } - - fileName += ".json"; - - var blob = new Blob([metadataJSON], {type: "application/json"}); - var data = URL.createObjectURL(blob); - - var a = document.createElement('a'); - a.download = fileName; - a.href = data; - a.textContent = "JSON"; - a.target = "_blank"; - a.rel = "noopener noreferrer"; - a.click(); - - a.remove(); - }; - - $scope.onChangeMarkerColor = function(markerColor){ - $scope.selectedPoiMarkerColor = markerColor; - }; - - $scope.onChangeSymbolColor = function(symbolColor){ - $scope.selectedPoiSymbolColor = symbolColor; - }; - - $scope.onChangeLoiDashArray = function(loiDashArrayObject){ - $scope.selectedLoiDashArrayObject = loiDashArrayObject; - $("#loiDashArrayEditDropdownButton").html(loiDashArrayObject.svgString); - }; - - $scope.hideSuccessAlert = function(){ - $("#georesourceEditMetadataSuccessAlert").hide(); - }; - - $scope.hideErrorAlert = function(){ - $("#georesourceEditMetadataErrorAlert").hide(); - }; - - } -]}); + templateUrl: "components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditMetadataModal/georesource-edit-metadata-modal.template.html", + controller: ['kommonitorDataExchangeService', '$scope', '$rootScope', '$http', '__env', '$timeout', 'kommonitorMultiStepFormHelperService', + 'kommonitorDataGridHelperService', + function GeoresourceEditMetadataModalController(kommonitorDataExchangeService, $scope, $rootScope, $http, __env, $timeout, kommonitorMultiStepFormHelperService, kommonitorDataGridHelperService) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + $scope.currentGeoresourceDataset; + /* POST BODY + { + "isLOI": false, + "metadata": { + "note": "note", + "literature": "literature", + "updateInterval": "ARBITRARY", + "sridEPSG": 0.8008281904610115, + "datasource": "datasource", + "contact": "contact", + "lastUpdate": "2000-01-23", + "description": "description", + "databasis": "databasis" + }, + "allowedRoles": [ + "allowedRoles", + "allowedRoles" + ], + "datasetName": "datasetName", + "poiSymbolBootstrap3Name": "poiSymbolBootstrap3Name", + "poiSymbolColor": "white", + "isAOI": false, + "loiDashArrayString": "loiDashArrayString", + "topicReference": "topicReference", + "poiMarkerColor": "white", + "isPOI": false, + "loiColor": "loiColor", + "loiWidth": "loiWidth", + "aoiColor": "aoiColor" + } + */ + //Date picker + $('#georesourceEditLastUpdateDatepicker').datepicker(kommonitorDataExchangeService.datePickerOptions); + $scope.loadingData = false; + $scope.georesourceMetadataStructure = { + "metadata": { + "note": "an optional note", + "literature": "optional text about literature", + "updateInterval": "YEARLY|HALF_YEARLY|QUARTERLY|MONTHLY|ARBITRARY", + "sridEPSG": 4326, + "datasource": "text about data source", + "contact": "text about contact details", + "lastUpdate": "YYYY-MM-DD", + "description": "description about spatial unit dataset", + "databasis": "text about data basis", + }, + "allowedRoles": ['roleId'], + "datasetName": "Name of georesource dataset", + "isPOI": "boolean parameter for point of interest dataset - only one of isPOI, isLOI, isAOI can be true", + "isLOI": "boolean parameter for lines of interest dataset - only one of isPOI, isLOI, isAOI can be true", + "isAOI": "boolean parameter for area of interest dataset - only one of isPOI, isLOI, isAOI can be true", + "poiSymbolBootstrap3Name": "glyphicon name of bootstrap 3 symbol to use for a POI resource", + "poiSymbolColor": "'white'|'red'|'orange'|'beige'|'green'|'blue'|'purple'|'pink'|'gray'|'black'", + "loiDashArrayString": "dash array string value - e.g. 20 20", + "poiMarkerColor": "'white'|'red'|'orange'|'beige'|'green'|'blue'|'purple'|'pink'|'gray'|'black'", + "loiColor": "color for lines of interest dataset", + "loiWidth": "width for lines of interest dataset", + "aoiColor": "color for area of interest dataset" + }; + $scope.georesourceMetadataStructure_pretty = kommonitorDataExchangeService.syntaxHighlightJSON($scope.georesourceMetadataStructure); + $scope.metadataImportSettings; + $scope.georesourceMetadataImportError; + $scope.georesourceMetadataImportErrorAlert; + $scope.datasetName = undefined; + $scope.datasetNameInvalid = false; + $scope.metadata = {}; + $scope.metadata.note = undefined; + $scope.metadata.literature = undefined; + $scope.metadata.updateInterval = undefined; + $scope.metadata.sridEPSG = undefined; + $scope.metadata.datasource = undefined; + $scope.metadata.databasis = undefined; + $scope.metadata.contact = undefined; + $scope.metadata.lastUpdate = undefined; + $scope.metadata.description = undefined; + $scope.roleManagementTableOptions = undefined; + $scope.georesourceTopic_mainTopic = undefined; + $scope.georesourceTopic_subTopic = undefined; + $scope.georesourceTopic_subsubTopic = undefined; + $scope.georesourceTopic_subsubsubTopic = undefined; + $scope.georesourceType = "poi"; + $scope.isPOI = true; + $scope.isLOI = false; + $scope.isAOI = false; + $scope.selectedPoiMarkerColor = kommonitorDataExchangeService.availablePoiMarkerColors[0]; + $scope.selectedPoiSymbolColor = kommonitorDataExchangeService.availablePoiMarkerColors[1]; + $scope.selectedLoiDashArrayObject = kommonitorDataExchangeService.availableLoiDashArrayObjects[0]; + $scope.loiColor = "#bf3d2c"; + $scope.loiWidth = 3; + $scope.aoiColor = "#bf3d2c"; + $scope.selectedPoiIconName = "home"; + $scope.iconPickerOptions = { + align: 'center', + arrowClass: 'btn-default', + arrowPrevIconClass: 'fas fa-angle-left', + arrowNextIconClass: 'fas fa-angle-right', + cols: 10, + footer: true, + header: true, + icon: 'glyphicon-' + $scope.selectedPoiIconName, + iconset: 'glyphicon', + labelHeader: '{0} von {1} Seiten', + labelFooter: '{0} - {1} von {2} Icons', + placement: 'bottom', + rows: 6, + search: true, + searchText: 'Stichwortsuche (Bootstrap Glyphicons)', + selectedClass: 'btn-success', + unselectedClass: '' + }; + $scope.$on("availableRolesUpdate", function (event) { + refreshRoles(); + }); + function refreshRoles() { + let allowedRoles = $scope.currentGeoresourceDataset ? $scope.currentGeoresourceDataset.allowedRoles : []; + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('georesourceEditRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, allowedRoles); + } + $('#poiSymbolEditPicker').iconpicker($scope.iconPickerOptions); + $('#poiSymbolEditPicker').on('change', function (e) { + // split up due to current data management request structure where we expect only the last name of Bootstrap 3.3.7 glyphicon name + // i.e. "home" for "glyphicon-home" + $scope.selectedPoiIconName = e.icon.substring(e.icon.indexOf('-') + 1); + }); + $scope.loadingData = false; + // initialize loiDashArray dropdown + setTimeout(function () { + for (var i = 0; i < kommonitorDataExchangeService.availableLoiDashArrayObjects.length; i++) { + $("#loiDashArrayEditDropdownItem-" + i).html(kommonitorDataExchangeService.availableLoiDashArrayObjects[i].svgString); + } + $("#loiDashArrayEditDropdownButton").html($scope.selectedLoiDashArrayObject.svgString); + }, 1000); + // initialize colorPickers + $('#loiColorEditPicker').colorpicker(); + $('#aoiColorEditPicker').colorpicker(); + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + $scope.$on("onEditGeoresourceMetadata", function (event, georesourceDataset) { + $scope.currentGeoresourceDataset = georesourceDataset; + $scope.resetGeoresourceEditMetadataForm(); + kommonitorMultiStepFormHelperService.registerClickHandler(); + }); + $scope.resetGeoresourceEditMetadataForm = function () { + $scope.datasetName = $scope.currentGeoresourceDataset.datasetName; + $scope.datasetNameInvalid = false; + $scope.metadata = {}; + $scope.metadata.note = $scope.currentGeoresourceDataset.metadata.note; + $scope.metadata.literature = $scope.currentGeoresourceDataset.metadata.literature; + $scope.metadata.sridEPSG = 4326; + $scope.metadata.datasource = $scope.currentGeoresourceDataset.metadata.datasource; + $scope.metadata.databasis = $scope.currentGeoresourceDataset.metadata.databasis; + $scope.metadata.contact = $scope.currentGeoresourceDataset.metadata.contact; + $scope.metadata.description = $scope.currentGeoresourceDataset.metadata.description; + $scope.metadata.lastUpdate = $scope.currentGeoresourceDataset.metadata.lastUpdate; + // $('#georesourceEditLastUpdateDatepicker').data({date: $scope.currentGeoresourceDataset.metadata.lastUpdate}); + $('#georesourceEditLastUpdateDatepicker').datepicker('setDate', $scope.currentGeoresourceDataset.metadata.lastUpdate); + kommonitorDataExchangeService.updateIntervalOptions.forEach(function (option) { + if (option.apiName === $scope.currentGeoresourceDataset.metadata.updateInterval) { + $scope.metadata.updateInterval = option; + } + }); + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('georesourceEditRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, $scope.currentGeoresourceDataset.allowedRoles); + $scope.isPOI = $scope.currentGeoresourceDataset.isPOI; + $scope.isLOI = $scope.currentGeoresourceDataset.isLOI; + $scope.isAOI = $scope.currentGeoresourceDataset.isAOI; + if ($scope.isPOI) { + $scope.georesourceType = "poi"; + } + else if ($scope.isLOI) { + $scope.georesourceType = "loi"; + } + else { + $scope.georesourceType = "aoi"; + } + kommonitorDataExchangeService.availablePoiMarkerColors.forEach(function (option) { + if (option.colorName === $scope.currentGeoresourceDataset.poiMarkerColor) { + $scope.selectedPoiMarkerColor = option; + } + if (option.colorName === $scope.currentGeoresourceDataset.poiSymbolColor) { + $scope.selectedPoiSymbolColor = option; + } + }); + kommonitorDataExchangeService.availableLoiDashArrayObjects.forEach(function (option) { + if (option.dashArrayValue === $scope.currentGeoresourceDataset.loiDashArrayString) { + $scope.selectedLoiDashArrayObject = option; + $scope.onChangeLoiDashArray($scope.selectedLoiDashArrayObject); + } + }); + $scope.loiColor = $scope.currentGeoresourceDataset.loiColor; + $scope.loiWidth = $scope.currentGeoresourceDataset.loiWidth || 3; + $scope.aoiColor = $scope.currentGeoresourceDataset.aoiColor; + $('#loiColorEditPicker').colorpicker('setValue', $scope.loiColor); + $('#aoiColorEditPicker').colorpicker('setValue', $scope.aoiColor); + $scope.selectedPoiIconName = $scope.currentGeoresourceDataset.poiSymbolBootstrap3Name; + var topicHierarchy = kommonitorDataExchangeService.getTopicHierarchyForTopicId($scope.currentGeoresourceDataset.topicReference); + if (topicHierarchy && topicHierarchy[0]) { + $scope.georesourceTopic_mainTopic = topicHierarchy[0]; + } + if (topicHierarchy && topicHierarchy[1]) { + $scope.georesourceTopic_subTopic = topicHierarchy[1]; + } + if (topicHierarchy && topicHierarchy[2]) { + $scope.georesourceTopic_subsubTopic = topicHierarchy[2]; + } + if (topicHierarchy && topicHierarchy[3]) { + $scope.georesourceTopic_subsubsubTopic = topicHierarchy[3]; + } + setTimeout(function () { + $("#poiSymbolEditPicker").val("").iconpicker('setIcon', 'glyphicon-' + $scope.currentGeoresourceDataset.poiSymbolBootstrap3Name); + // $("#poiSymbolPicker i").css('glyphicon glyphicon-' + $scope.metadataImportSettings.poiSymbolBootstrap3Name); + // $("#poiSymbolPicker input").css('glyphicon-' + $scope.metadataImportSettings.poiSymbolBootstrap3Name); + }, 200); + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + $("#georesourceEditMetadataSuccessAlert").hide(); + $("#georesourceEditMetadataErrorAlert").hide(); + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.checkDatasetName = function () { + $scope.datasetNameInvalid = false; + kommonitorDataExchangeService.availableGeoresources.forEach(function (georesource) { + if (georesource.datasetName === $scope.datasetName) { + $scope.datasetNameInvalid = true; + return; + } + }); + }; + $scope.editGeoresourceMetadata = function () { + var patchBody = { + "metadata": { + "note": $scope.metadata.note, + "literature": $scope.metadata.literature, + "updateInterval": $scope.metadata.updateInterval.apiName, + "sridEPSG": $scope.metadata.sridEPSG, + "datasource": $scope.metadata.datasource, + "contact": $scope.metadata.contact, + "lastUpdate": $scope.metadata.lastUpdate, + "description": $scope.metadata.description, + "databasis": $scope.metadata.databasis, + "sridEPSG": 4326 + }, + "allowedRoles": [], + "datasetName": $scope.datasetName, + "isAOI": $scope.isAOI, + "isLOI": $scope.isLOI, + "isPOI": $scope.isPOI, + "topicReference": null + }; + let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); + for (const roleId of roleIds) { + patchBody.allowedRoles.push(roleId); + } + if ($scope.isPOI) { + patchBody["poiSymbolBootstrap3Name"] = $scope.selectedPoiIconName; + patchBody["poiSymbolColor"] = $scope.selectedPoiSymbolColor.colorName; + patchBody["poiMarkerColor"] = $scope.selectedPoiMarkerColor.colorName; + patchBody["loiDashArrayString"] = null; + patchBody["loiColor"] = null; + patchBody["loiWidth"] = null; + patchBody["aoiColor"] = null; + } + else if ($scope.isLOI) { + patchBody["poiSymbolBootstrap3Name"] = null; + patchBody["poiSymbolColor"] = null; + patchBody["poiMarkerColor"] = null; + patchBody["loiDashArrayString"] = $scope.selectedLoiDashArrayObject.dashArrayValue; + patchBody["loiColor"] = $scope.loiColor; + patchBody["loiWidth"] = $scope.loiWidth; + patchBody["aoiColor"] = null; + } + else if ($scope.isAOI) { + patchBody["poiSymbolBootstrap3Name"] = null; + patchBody["poiSymbolColor"] = null; + patchBody["poiMarkerColor"] = null; + patchBody["loiDashArrayString"] = null; + patchBody["loiColor"] = null; + patchBody["loiWidth"] = null; + patchBody["aoiColor"] = $scope.aoiColor; + } + // TOPIC REFERENCE + if ($scope.georesourceTopic_subsubsubTopic) { + patchBody.topicReference = $scope.georesourceTopic_subsubsubTopic.topicId; + } + else if ($scope.georesourceTopic_subsubTopic) { + patchBody.topicReference = $scope.georesourceTopic_subsubTopic.topicId; + } + else if ($scope.georesourceTopic_subTopic) { + patchBody.topicReference = $scope.georesourceTopic_subTopic.topicId; + } + else if ($scope.georesourceTopic_mainTopic) { + patchBody.topicReference = $scope.georesourceTopic_mainTopic.topicId; + } + else { + patchBody.topicReference = ""; + } + // TODO verify input + // TODO Create and perform POST Request with loading screen + $scope.loadingData = true; + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/georesources/" + $scope.currentGeoresourceDataset.georesourceId, + method: "PATCH", + data: patchBody + // headers: { + // 'Content-Type': undefined + // } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + $scope.successMessagePart = $scope.datasetName; + $rootScope.$broadcast("refreshGeoresourceOverviewTable", "edit", $scope.currentGeoresourceDataset.georesourceId); + $("#georesourceEditMetadataSuccessAlert").show(); + $scope.loadingData = false; + }, function errorCallback(error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + $("#georesourceEditMetadataErrorAlert").show(); + $scope.loadingData = false; + // setTimeout(function() { + // $("#georesourceEditMetadataSuccessAlert").hide(); + // }, 3000); + }); + }; + $scope.onImportGeoresourceEditMetadata = function () { + $scope.georesourceMetadataImportError = ""; + $("#georesourceEditMetadataImportFile").files = []; + // trigger file chooser + $("#georesourceEditMetadataImportFile").click(); + }; + $(document).on("change", "#georesourceEditMetadataImportFile", function () { + console.log("Importing Georesource metadata for Edit Georesource Form"); + // get the file + var file = document.getElementById('georesourceEditMetadataImportFile').files[0]; + $scope.parseMetadataFromFile(file); + }); + $scope.parseMetadataFromFile = function (file) { + var fileReader = new FileReader(); + fileReader.onload = function (event) { + try { + $scope.parseFromMetadataFile(event); + } + catch (error) { + console.error("Uploaded Metadata File cannot be parsed."); + $scope.georesourceMetadataImportError = "Uploaded Metadata File cannot be parsed correctly"; + document.getElementById("georesourcesEditMetadataPre").innerHTML = $scope.georesourceMetadataStructure_pretty; + $("#georesourceEditMetadataImportErrorAlert").show(); + $scope.$digest(); + } + }; + // Read in the image file as a data URL. + fileReader.readAsText(file); + }; + $scope.parseFromMetadataFile = function (event) { + // $scope.geoJsonString = event.target.result; + $scope.metadataImportSettings = JSON.parse(event.target.result); + if (!$scope.metadataImportSettings.metadata) { + console.error("uploaded Metadata File cannot be parsed - wrong structure."); + $scope.georesourceMetadataImportError = "Struktur der Datei stimmt nicht mit erwartetem Muster überein."; + document.getElementById("georesourcesEditMetadataPre").innerHTML = $scope.georesourceMetadataStructure_pretty; + $("#georesourceEditMetadataImportErrorAlert").show(); + $scope.$digest(); + } + $scope.metadata = {}; + $scope.metadata.note = $scope.metadataImportSettings.metadata.note; + $scope.metadata.literature = $scope.metadataImportSettings.metadata.literature; + kommonitorDataExchangeService.updateIntervalOptions.forEach(function (option) { + if (option.apiName === $scope.metadataImportSettings.metadata.updateInterval) { + $scope.metadata.updateInterval = option; + } + }); + $scope.metadata.sridEPSG = $scope.metadataImportSettings.metadata.sridEPSG; + $scope.metadata.datasource = $scope.metadataImportSettings.metadata.datasource; + $scope.metadata.contact = $scope.metadataImportSettings.metadata.contact; + $scope.metadata.lastUpdate = $scope.metadataImportSettings.metadata.lastUpdate; + // initialize date + $('#georesourceEditLastUpdateDatepicker').datepicker('setDate', $scope.metadata.lastUpdate); + $scope.metadata.description = $scope.metadataImportSettings.metadata.description; + $scope.metadata.databasis = $scope.metadataImportSettings.metadata.databasis; + $scope.datasetName = $scope.metadataImportSettings.datasetName; + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('georesourceEditRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, $scope.metadataImportSettings.allowedRoles); + // georesource specific properties + $scope.isPOI = $scope.metadataImportSettings.isPOI; + $scope.isLOI = $scope.metadataImportSettings.isLOI; + $scope.isAOI = $scope.metadataImportSettings.isAOI; + if ($scope.metadataImportSettings.isPOI) { + $scope.georesourceType = "poi"; + } + else if ($scope.metadataImportSettings.isLOI) { + $scope.georesourceType = "loi"; + } + else { + $scope.georesourceType = "aoi"; + } + kommonitorDataExchangeService.availablePoiMarkerColors.forEach(function (option) { + if (option.colorName === $scope.metadataImportSettings.poiMarkerColor) { + $scope.selectedPoiMarkerColor = option; + } + if (option.colorName === $scope.metadataImportSettings.poiSymbolColor) { + $scope.selectedPoiSymbolColor = option; + } + }); + kommonitorDataExchangeService.availableLoiDashArrayObjects.forEach(function (option) { + if (option.dashArrayValue === $scope.metadataImportSettings.loiDashArrayString) { + $scope.selectedLoiDashArrayObject = option; + $scope.onChangeLoiDashArray($scope.selectedLoiDashArrayObject); + } + }); + $scope.loiColor = $scope.metadataImportSettings.loiColor; + $scope.loiWidth = $scope.metadataImportSettings.loiWidth; + $scope.aoiColor = $scope.metadataImportSettings.aoiColor; + $('#loiColorEditPicker').colorpicker('setValue', $scope.loiColor); + $('#aoiColorEditPicker').colorpicker('setValue', $scope.aoiColor); + $scope.selectedPoiIconName = $scope.metadataImportSettings.poiSymbolBootstrap3Name; + var topicHierarchy = kommonitorDataExchangeService.getTopicHierarchyForTopicId($scope.metadataImportSettings.topicReference); + if (topicHierarchy && topicHierarchy[0]) { + $scope.georesourceTopic_mainTopic = topicHierarchy[0]; + } + if (topicHierarchy && topicHierarchy[1]) { + $scope.georesourceTopic_subTopic = topicHierarchy[1]; + } + if (topicHierarchy && topicHierarchy[2]) { + $scope.georesourceTopic_subsubTopic = topicHierarchy[2]; + } + if (topicHierarchy && topicHierarchy[3]) { + $scope.georesourceTopic_subsubsubTopic = topicHierarchy[3]; + } + setTimeout(function () { + $("#poiSymbolEditPicker").val("").iconpicker('setIcon', 'glyphicon-' + $scope.metadataImportSettings.poiSymbolBootstrap3Name); + // $("#poiSymbolPicker i").css('glyphicon glyphicon-' + $scope.metadataImportSettings.poiSymbolBootstrap3Name); + // $("#poiSymbolPicker input").css('glyphicon-' + $scope.metadataImportSettings.poiSymbolBootstrap3Name); + }, 200); + $scope.$digest(); + }; + $scope.onExportGeoresourceEditMetadataTemplate = function () { + var metadataJSON = JSON.stringify($scope.georesourceMetadataStructure); + var fileName = "Georessource_Metadaten_Vorlage_Export.json"; + var blob = new Blob([metadataJSON], { type: "application/json" }); + var data = URL.createObjectURL(blob); + var a = document.createElement('a'); + a.download = fileName; + a.href = data; + a.textContent = "JSON"; + a.target = "_blank"; + a.rel = "noopener noreferrer"; + a.click(); + a.remove(); + }; + $scope.onExportGeoresourceEditMetadata = function () { + var metadataExport = $scope.georesourceMetadataStructure; + metadataExport.metadata.note = $scope.metadata.note || ""; + metadataExport.metadata.literature = $scope.metadata.literature || ""; + metadataExport.metadata.sridEPSG = $scope.metadata.sridEPSG || ""; + metadataExport.metadata.datasource = $scope.metadata.datasource || ""; + metadataExport.metadata.contact = $scope.metadata.contact || ""; + metadataExport.metadata.lastUpdate = $scope.metadata.lastUpdate || ""; + metadataExport.metadata.description = $scope.metadata.description || ""; + metadataExport.metadata.databasis = $scope.metadata.databasis || ""; + metadataExport.datasetName = $scope.datasetName || ""; + metadataExport.allowedRoles = []; + let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); + for (const roleId of roleIds) { + metadataExport.allowedRoles.push(roleId); + } + if ($scope.metadata.updateInterval) { + metadataExport.metadata.updateInterval = $scope.metadata.updateInterval.apiName; + } + var name = $scope.datasetName; + // georesource specific properties + metadataExport.isPOI = $scope.isPOI; + metadataExport.isLOI = $scope.isLOI; + metadataExport.isAOI = $scope.isAOI; + if ($scope.isPOI) { + metadataExport["poiSymbolBootstrap3Name"] = $scope.selectedPoiIconName; + metadataExport["poiSymbolColor"] = $scope.selectedPoiSymbolColor.colorName; + metadataExport["poiMarkerColor"] = $scope.selectedPoiMarkerColor.colorName; + metadataExport["loiDashArrayString"] = ""; + metadataExport["loiColor"] = ""; + metadataExport["loiWidth"] = ""; + metadataExport["aoiColor"] = ""; + } + else if ($scope.isLOI) { + metadataExport["poiSymbolBootstrap3Name"] = ""; + metadataExport["poiSymbolColor"] = ""; + metadataExport["poiMarkerColor"] = ""; + metadataExport["loiDashArrayString"] = $scope.selectedLoiDashArrayObject.dashArrayValue; + metadataExport["loiColor"] = $scope.loiColor; + metadataExport["loiWidth"] = $scope.loiWidth; + metadataExport["aoiColor"] = ""; + } + else if ($scope.isAOI) { + metadataExport["poiSymbolBootstrap3Name"] = ""; + metadataExport["poiSymbolColor"] = ""; + metadataExport["poiMarkerColor"] = ""; + metadataExport["loiDashArrayString"] = ""; + metadataExport["loiColor"] = ""; + metadataExport["loiWidth"] = ""; + metadataExport["aoiColor"] = $scope.aoiColor; + } + if ($scope.georesourceTopic_subsubsubTopic) { + metadataExport.topicReference = $scope.georesourceTopic_subsubsubTopic.topicId; + } + else if ($scope.georesourceTopic_subsubTopic) { + metadataExport.topicReference = $scope.georesourceTopic_subsubTopic.topicId; + } + else if ($scope.georesourceTopic_subTopic) { + metadataExport.topicReference = $scope.georesourceTopic_subTopic.topicId; + } + else if ($scope.georesourceTopic_mainTopic) { + metadataExport.topicReference = $scope.georesourceTopic_mainTopic.topicId; + } + else { + metadataExport.topicReference = ""; + } + var metadataJSON = JSON.stringify(metadataExport); + var fileName = "Georessource_Metadaten_Export"; + if (name) { + fileName += "-" + name; + } + fileName += ".json"; + var blob = new Blob([metadataJSON], { type: "application/json" }); + var data = URL.createObjectURL(blob); + var a = document.createElement('a'); + a.download = fileName; + a.href = data; + a.textContent = "JSON"; + a.target = "_blank"; + a.rel = "noopener noreferrer"; + a.click(); + a.remove(); + }; + $scope.onChangeMarkerColor = function (markerColor) { + $scope.selectedPoiMarkerColor = markerColor; + }; + $scope.onChangeSymbolColor = function (symbolColor) { + $scope.selectedPoiSymbolColor = symbolColor; + }; + $scope.onChangeLoiDashArray = function (loiDashArrayObject) { + $scope.selectedLoiDashArrayObject = loiDashArrayObject; + $("#loiDashArrayEditDropdownButton").html(loiDashArrayObject.svgString); + }; + $scope.hideSuccessAlert = function () { + $("#georesourceEditMetadataSuccessAlert").hide(); + }; + $scope.hideErrorAlert = function () { + $("#georesourceEditMetadataErrorAlert").hide(); + }; + } + ] +}); +//# sourceMappingURL=georesource-edit-metadata-modal.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditMetadataModal/georesource-edit-metadata-modal.component.js.map b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditMetadataModal/georesource-edit-metadata-modal.component.js.map new file mode 100644 index 000000000..c8c02627c --- /dev/null +++ b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditMetadataModal/georesource-edit-metadata-modal.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"georesource-edit-metadata-modal.component.js","sourceRoot":"","sources":["georesource-edit-metadata-modal.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,8BAA8B,CAAC,CAAC,SAAS,CAAC,8BAA8B,EAAE;IACxF,WAAW,EAAG,mIAAmI;IACjJ,UAAU,EAAG,CAAC,+BAA+B,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,sCAAsC;QAC1I,iCAAiC;QACjC,SAAS,sCAAsC,CAAC,6BAA6B,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EACxH,oCAAoC,EAAE,+BAA+B;YAEtE,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAE3E,MAAM,CAAC,yBAAyB,CAAC;YAEjC;;;;;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;gBACpC,CAAC,CAAC,QAAQ,GAAM,QAAQ,CAAC;gBACzB,CAAC,CAAC,IAAI,GAAU,IAAI,CAAC;gBACrB,CAAC,CAAC,WAAW,GAAG,MAAM,CAAC;gBACvB,CAAC,CAAC,MAAM,GAAG,QAAQ,CAAC;gBACpB,CAAC,CAAC,GAAG,GAAG,qBAAqB,CAAC;gBAC9B,CAAC,CAAC,KAAK,EAAE,CAAC;gBAEV,CAAC,CAAC,MAAM,EAAE,CAAC;YACZ,CAAC,CAAC;YAEF,MAAM,CAAC,mBAAmB,GAAG,UAAS,WAAW;gBAChD,MAAM,CAAC,sBAAsB,GAAG,WAAW,CAAC;YAC7C,CAAC,CAAC;YAEF,MAAM,CAAC,mBAAmB,GAAG,UAAS,WAAW;gBAChD,MAAM,CAAC,sBAAsB,GAAG,WAAW,CAAC;YAC7C,CAAC,CAAC;YAEF,MAAM,CAAC,oBAAoB,GAAG,UAAS,kBAAkB;gBACxD,MAAM,CAAC,0BAA0B,GAAG,kBAAkB,CAAC;gBACvD,CAAC,CAAC,iCAAiC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;YACzE,CAAC,CAAC;YAED,MAAM,CAAC,gBAAgB,GAAG;gBACzB,CAAC,CAAC,sCAAsC,CAAC,CAAC,IAAI,EAAE,CAAC;YAClD,CAAC,CAAC;YAEF,MAAM,CAAC,cAAc,GAAG;gBACvB,CAAC,CAAC,oCAAoC,CAAC,CAAC,IAAI,EAAE,CAAC;YAChD,CAAC,CAAC;QAEJ,CAAC;KACD;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditMetadataModal/georesource-edit-metadata-modal.component.ts b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditMetadataModal/georesource-edit-metadata-modal.component.ts new file mode 100644 index 000000000..c56e79237 --- /dev/null +++ b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditMetadataModal/georesource-edit-metadata-modal.component.ts @@ -0,0 +1,692 @@ +angular.module('georesourceEditMetadataModal').component('georesourceEditMetadataModal', { + templateUrl : "components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditMetadataModal/georesource-edit-metadata-modal.template.html", + controller : ['kommonitorDataExchangeService', '$scope', '$rootScope', '$http', '__env', '$timeout', 'kommonitorMultiStepFormHelperService', + 'kommonitorDataGridHelperService', + function GeoresourceEditMetadataModalController(kommonitorDataExchangeService, $scope, $rootScope, $http, __env, $timeout, + kommonitorMultiStepFormHelperService, kommonitorDataGridHelperService) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + + $scope.currentGeoresourceDataset; + + /* POST BODY + { + "isLOI": false, + "metadata": { + "note": "note", + "literature": "literature", + "updateInterval": "ARBITRARY", + "sridEPSG": 0.8008281904610115, + "datasource": "datasource", + "contact": "contact", + "lastUpdate": "2000-01-23", + "description": "description", + "databasis": "databasis" + }, + "allowedRoles": [ + "allowedRoles", + "allowedRoles" + ], + "datasetName": "datasetName", + "poiSymbolBootstrap3Name": "poiSymbolBootstrap3Name", + "poiSymbolColor": "white", + "isAOI": false, + "loiDashArrayString": "loiDashArrayString", + "topicReference": "topicReference", + "poiMarkerColor": "white", + "isPOI": false, + "loiColor": "loiColor", + "loiWidth": "loiWidth", + "aoiColor": "aoiColor" + } + */ + + //Date picker + $('#georesourceEditLastUpdateDatepicker').datepicker(kommonitorDataExchangeService.datePickerOptions); + + $scope.loadingData = false; + + $scope.georesourceMetadataStructure = { + "metadata": { + "note": "an optional note", + "literature": "optional text about literature", + "updateInterval": "YEARLY|HALF_YEARLY|QUARTERLY|MONTHLY|ARBITRARY", + "sridEPSG": 4326, + "datasource": "text about data source", + "contact": "text about contact details", + "lastUpdate": "YYYY-MM-DD", + "description": "description about spatial unit dataset", + "databasis": "text about data basis", + }, + "allowedRoles": ['roleId'], + "datasetName": "Name of georesource dataset", + "isPOI": "boolean parameter for point of interest dataset - only one of isPOI, isLOI, isAOI can be true", + "isLOI": "boolean parameter for lines of interest dataset - only one of isPOI, isLOI, isAOI can be true", + "isAOI": "boolean parameter for area of interest dataset - only one of isPOI, isLOI, isAOI can be true", + "poiSymbolBootstrap3Name": "glyphicon name of bootstrap 3 symbol to use for a POI resource", + "poiSymbolColor": "'white'|'red'|'orange'|'beige'|'green'|'blue'|'purple'|'pink'|'gray'|'black'", + "loiDashArrayString": "dash array string value - e.g. 20 20", + "poiMarkerColor": "'white'|'red'|'orange'|'beige'|'green'|'blue'|'purple'|'pink'|'gray'|'black'", + "loiColor": "color for lines of interest dataset", + "loiWidth": "width for lines of interest dataset", + "aoiColor": "color for area of interest dataset" + }; + + $scope.georesourceMetadataStructure_pretty = kommonitorDataExchangeService.syntaxHighlightJSON($scope.georesourceMetadataStructure); + + $scope.metadataImportSettings; + $scope.georesourceMetadataImportError; + $scope.georesourceMetadataImportErrorAlert; + + $scope.datasetName = undefined; + $scope.datasetNameInvalid = false; + + $scope.metadata = {}; + $scope.metadata.note = undefined; + $scope.metadata.literature = undefined; + $scope.metadata.updateInterval = undefined; + $scope.metadata.sridEPSG = undefined; + $scope.metadata.datasource = undefined; + $scope.metadata.databasis = undefined; + $scope.metadata.contact = undefined; + $scope.metadata.lastUpdate = undefined; + $scope.metadata.description = undefined; + + $scope.roleManagementTableOptions = undefined; + + $scope.georesourceTopic_mainTopic = undefined; + $scope.georesourceTopic_subTopic = undefined; + $scope.georesourceTopic_subsubTopic = undefined; + $scope.georesourceTopic_subsubsubTopic = undefined; + + $scope.georesourceType = "poi"; + $scope.isPOI = true; + $scope.isLOI = false; + $scope.isAOI = false; + $scope.selectedPoiMarkerColor = kommonitorDataExchangeService.availablePoiMarkerColors[0]; + $scope.selectedPoiSymbolColor = kommonitorDataExchangeService.availablePoiMarkerColors[1]; + $scope.selectedLoiDashArrayObject = kommonitorDataExchangeService.availableLoiDashArrayObjects[0]; + $scope.loiColor = "#bf3d2c"; + $scope.loiWidth = 3; + $scope.aoiColor = "#bf3d2c"; + $scope.selectedPoiIconName = "home"; + + $scope.iconPickerOptions = { + align: 'center', // Only in div tag + arrowClass: 'btn-default', + arrowPrevIconClass: 'fas fa-angle-left', + arrowNextIconClass: 'fas fa-angle-right', + cols: 10, + footer: true, + header: true, + icon: 'glyphicon-' + $scope.selectedPoiIconName, + iconset: 'glyphicon', + labelHeader: '{0} von {1} Seiten', + labelFooter: '{0} - {1} von {2} Icons', + placement: 'bottom', // Only in button tag + rows: 6, + search: true, + searchText: 'Stichwortsuche (Bootstrap Glyphicons)', + selectedClass: 'btn-success', + unselectedClass: '' + }; + + $scope.$on("availableRolesUpdate", function (event) { + refreshRoles(); + }); + + function refreshRoles() { + let allowedRoles = $scope.currentGeoresourceDataset ? $scope.currentGeoresourceDataset.allowedRoles : []; + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('georesourceEditRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, allowedRoles); + } + + $('#poiSymbolEditPicker').iconpicker($scope.iconPickerOptions); + + $('#poiSymbolEditPicker').on('change', function(e) { + // split up due to current data management request structure where we expect only the last name of Bootstrap 3.3.7 glyphicon name + // i.e. "home" for "glyphicon-home" + $scope.selectedPoiIconName = e.icon.substring(e.icon.indexOf('-')+1); + }); + + $scope.loadingData = false; + + // initialize loiDashArray dropdown + setTimeout(function(){ + for(var i=0; i { + $scope.$digest(); + }, 250); + }; + + $scope.checkDatasetName = function(){ + $scope.datasetNameInvalid = false; + kommonitorDataExchangeService.availableGeoresources.forEach(function(georesource){ + if (georesource.datasetName === $scope.datasetName){ + $scope.datasetNameInvalid = true; + return; + } + }); + }; + + $scope.editGeoresourceMetadata = function(){ + + var patchBody = + { + "metadata": { + "note": $scope.metadata.note, + "literature": $scope.metadata.literature, + "updateInterval": $scope.metadata.updateInterval.apiName, + "sridEPSG": $scope.metadata.sridEPSG, + "datasource": $scope.metadata.datasource, + "contact": $scope.metadata.contact, + "lastUpdate": $scope.metadata.lastUpdate, + "description": $scope.metadata.description, + "databasis": $scope.metadata.databasis, + "sridEPSG": 4326 + }, + "allowedRoles": [], + "datasetName": $scope.datasetName, + "isAOI": $scope.isAOI, + "isLOI": $scope.isLOI, + "isPOI": $scope.isPOI, + "topicReference": null + }; + + let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); + for (const roleId of roleIds) { + patchBody.allowedRoles.push(roleId); + } + + if($scope.isPOI){ + patchBody["poiSymbolBootstrap3Name"] = $scope.selectedPoiIconName; + patchBody["poiSymbolColor"] = $scope.selectedPoiSymbolColor.colorName; + patchBody["poiMarkerColor"] = $scope.selectedPoiMarkerColor.colorName; + + patchBody["loiDashArrayString"] = null; + patchBody["loiColor"] = null; + patchBody["loiWidth"] = null; + + patchBody["aoiColor"] = null; + } + else if($scope.isLOI){ + patchBody["poiSymbolBootstrap3Name"] = null; + patchBody["poiSymbolColor"] = null; + patchBody["poiMarkerColor"] = null; + + patchBody["loiDashArrayString"] = $scope.selectedLoiDashArrayObject.dashArrayValue; + patchBody["loiColor"] = $scope.loiColor; + patchBody["loiWidth"] = $scope.loiWidth; + + patchBody["aoiColor"] = null; + } + else if($scope.isAOI){ + patchBody["poiSymbolBootstrap3Name"] = null; + patchBody["poiSymbolColor"] = null; + patchBody["poiMarkerColor"] = null; + + patchBody["loiDashArrayString"] = null; + patchBody["loiColor"] = null; + patchBody["loiWidth"] = null; + + patchBody["aoiColor"] = $scope.aoiColor; + } + + // TOPIC REFERENCE + if($scope.georesourceTopic_subsubsubTopic){ + patchBody.topicReference = $scope.georesourceTopic_subsubsubTopic.topicId; + } + else if($scope.georesourceTopic_subsubTopic){ + patchBody.topicReference = $scope.georesourceTopic_subsubTopic.topicId; + } + else if($scope.georesourceTopic_subTopic){ + patchBody.topicReference = $scope.georesourceTopic_subTopic.topicId; + } + else if($scope.georesourceTopic_mainTopic){ + patchBody.topicReference = $scope.georesourceTopic_mainTopic.topicId; + } + else { + patchBody.topicReference = ""; + } + + // TODO verify input + + // TODO Create and perform POST Request with loading screen + + $scope.loadingData = true; + + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/georesources/" + $scope.currentGeoresourceDataset.georesourceId, + method: "PATCH", + data: patchBody + // headers: { + // 'Content-Type': undefined + // } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + $scope.successMessagePart = $scope.datasetName; + + $rootScope.$broadcast("refreshGeoresourceOverviewTable", "edit", $scope.currentGeoresourceDataset.georesourceId); + $("#georesourceEditMetadataSuccessAlert").show(); + $scope.loadingData = false; + + }, function errorCallback(error) { + if(error.data){ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else{ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + + $("#georesourceEditMetadataErrorAlert").show(); + $scope.loadingData = false; + + // setTimeout(function() { + // $("#georesourceEditMetadataSuccessAlert").hide(); + // }, 3000); + }); + }; + + $scope.onImportGeoresourceEditMetadata = function(){ + + $scope.georesourceMetadataImportError = ""; + + $("#georesourceEditMetadataImportFile").files = []; + + // trigger file chooser + $("#georesourceEditMetadataImportFile").click(); + + }; + + $(document).on("change", "#georesourceEditMetadataImportFile" ,function(){ + + console.log("Importing Georesource metadata for Edit Georesource Form"); + + // get the file + var file = document.getElementById('georesourceEditMetadataImportFile').files[0]; + $scope.parseMetadataFromFile(file); + }); + + $scope.parseMetadataFromFile = function(file){ + var fileReader = new FileReader(); + + fileReader.onload = function(event) { + + try{ + $scope.parseFromMetadataFile(event); + } + catch(error){ + console.error("Uploaded Metadata File cannot be parsed."); + $scope.georesourceMetadataImportError = "Uploaded Metadata File cannot be parsed correctly"; + document.getElementById("georesourcesEditMetadataPre").innerHTML = $scope.georesourceMetadataStructure_pretty; + $("#georesourceEditMetadataImportErrorAlert").show(); + + $scope.$digest(); + } + + }; + + // Read in the image file as a data URL. + fileReader.readAsText(file); + }; + + $scope.parseFromMetadataFile = function(event){ + // $scope.geoJsonString = event.target.result; + $scope.metadataImportSettings = JSON.parse(event.target.result); + + if(! $scope.metadataImportSettings.metadata){ + console.error("uploaded Metadata File cannot be parsed - wrong structure."); + $scope.georesourceMetadataImportError = "Struktur der Datei stimmt nicht mit erwartetem Muster überein."; + document.getElementById("georesourcesEditMetadataPre").innerHTML = $scope.georesourceMetadataStructure_pretty; + $("#georesourceEditMetadataImportErrorAlert").show(); + + $scope.$digest(); + } + + $scope.metadata = {}; + $scope.metadata.note = $scope.metadataImportSettings.metadata.note; + $scope.metadata.literature = $scope.metadataImportSettings.metadata.literature; + kommonitorDataExchangeService.updateIntervalOptions.forEach(function(option){ + if(option.apiName === $scope.metadataImportSettings.metadata.updateInterval){ + $scope.metadata.updateInterval = option; + } + }); + $scope.metadata.sridEPSG = $scope.metadataImportSettings.metadata.sridEPSG; + $scope.metadata.datasource = $scope.metadataImportSettings.metadata.datasource; + $scope.metadata.contact = $scope.metadataImportSettings.metadata.contact; + $scope.metadata.lastUpdate = $scope.metadataImportSettings.metadata.lastUpdate; + // initialize date + $('#georesourceEditLastUpdateDatepicker').datepicker('setDate', $scope.metadata.lastUpdate); + + $scope.metadata.description = $scope.metadataImportSettings.metadata.description; + $scope.metadata.databasis = $scope.metadataImportSettings.metadata.databasis; + + $scope.datasetName = $scope.metadataImportSettings.datasetName; + + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('georesourceEditRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, $scope.metadataImportSettings.allowedRoles); + + // georesource specific properties + + $scope.isPOI = $scope.metadataImportSettings.isPOI; + $scope.isLOI = $scope.metadataImportSettings.isLOI; + $scope.isAOI = $scope.metadataImportSettings.isAOI; + if($scope.metadataImportSettings.isPOI){ + $scope.georesourceType = "poi"; + } + else if($scope.metadataImportSettings.isLOI){ + $scope.georesourceType = "loi"; + } + else{ + $scope.georesourceType = "aoi"; + } + kommonitorDataExchangeService.availablePoiMarkerColors.forEach(function(option){ + if(option.colorName === $scope.metadataImportSettings.poiMarkerColor){ + $scope.selectedPoiMarkerColor = option; + } + if(option.colorName === $scope.metadataImportSettings.poiSymbolColor){ + $scope.selectedPoiSymbolColor = option; + } + }); + kommonitorDataExchangeService.availableLoiDashArrayObjects.forEach(function(option){ + if(option.dashArrayValue === $scope.metadataImportSettings.loiDashArrayString){ + $scope.selectedLoiDashArrayObject = option; + $scope.onChangeLoiDashArray($scope.selectedLoiDashArrayObject); + } + }); + $scope.loiColor = $scope.metadataImportSettings.loiColor; + $scope.loiWidth = $scope.metadataImportSettings.loiWidth; + $scope.aoiColor = $scope.metadataImportSettings.aoiColor; + + $('#loiColorEditPicker').colorpicker('setValue', $scope.loiColor); + $('#aoiColorEditPicker').colorpicker('setValue', $scope.aoiColor); + + $scope.selectedPoiIconName = $scope.metadataImportSettings.poiSymbolBootstrap3Name; + + var topicHierarchy = kommonitorDataExchangeService.getTopicHierarchyForTopicId($scope.metadataImportSettings.topicReference); + + if(topicHierarchy && topicHierarchy[0]){ + $scope.georesourceTopic_mainTopic = topicHierarchy[0]; + } + if(topicHierarchy && topicHierarchy[1]){ + $scope.georesourceTopic_subTopic = topicHierarchy[1]; + } + if(topicHierarchy && topicHierarchy[2]){ + $scope.georesourceTopic_subsubTopic = topicHierarchy[2]; + } + if(topicHierarchy && topicHierarchy[3]){ + $scope.georesourceTopic_subsubsubTopic = topicHierarchy[3]; + } + + setTimeout(function(){ + $("#poiSymbolEditPicker").val("").iconpicker('setIcon', 'glyphicon-' + $scope.metadataImportSettings.poiSymbolBootstrap3Name); + // $("#poiSymbolPicker i").css('glyphicon glyphicon-' + $scope.metadataImportSettings.poiSymbolBootstrap3Name); + // $("#poiSymbolPicker input").css('glyphicon-' + $scope.metadataImportSettings.poiSymbolBootstrap3Name); + }, 200); + + $scope.$digest(); + } + + $scope.onExportGeoresourceEditMetadataTemplate = function(){ + + var metadataJSON = JSON.stringify($scope.georesourceMetadataStructure); + + var fileName = "Georessource_Metadaten_Vorlage_Export.json"; + + var blob = new Blob([metadataJSON], {type: "application/json"}); + var data = URL.createObjectURL(blob); + + var a = document.createElement('a'); + a.download = fileName; + a.href = data; + a.textContent = "JSON"; + a.target = "_blank"; + a.rel = "noopener noreferrer"; + a.click(); + + a.remove(); + }; + + $scope.onExportGeoresourceEditMetadata = function(){ + var metadataExport = $scope.georesourceMetadataStructure; + + metadataExport.metadata.note = $scope.metadata.note || ""; + metadataExport.metadata.literature = $scope.metadata.literature || ""; + metadataExport.metadata.sridEPSG = $scope.metadata.sridEPSG || ""; + metadataExport.metadata.datasource = $scope.metadata.datasource || ""; + metadataExport.metadata.contact = $scope.metadata.contact || ""; + metadataExport.metadata.lastUpdate = $scope.metadata.lastUpdate || ""; + metadataExport.metadata.description = $scope.metadata.description || ""; + metadataExport.metadata.databasis = $scope.metadata.databasis || ""; + metadataExport.datasetName = $scope.datasetName || ""; + + metadataExport.allowedRoles = []; + + let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); + for (const roleId of roleIds) { + metadataExport.allowedRoles.push(roleId); + } + + if($scope.metadata.updateInterval){ + metadataExport.metadata.updateInterval = $scope.metadata.updateInterval.apiName; + } + + var name = $scope.datasetName; + + // georesource specific properties + metadataExport.isPOI = $scope.isPOI; + metadataExport.isLOI = $scope.isLOI; + metadataExport.isAOI = $scope.isAOI; + + if($scope.isPOI){ + metadataExport["poiSymbolBootstrap3Name"] = $scope.selectedPoiIconName; + metadataExport["poiSymbolColor"] = $scope.selectedPoiSymbolColor.colorName; + metadataExport["poiMarkerColor"] = $scope.selectedPoiMarkerColor.colorName; + + metadataExport["loiDashArrayString"] = ""; + metadataExport["loiColor"] = ""; + metadataExport["loiWidth"] = ""; + + metadataExport["aoiColor"] = ""; + } + else if($scope.isLOI){ + metadataExport["poiSymbolBootstrap3Name"] = ""; + metadataExport["poiSymbolColor"] = ""; + metadataExport["poiMarkerColor"] = ""; + + metadataExport["loiDashArrayString"] = $scope.selectedLoiDashArrayObject.dashArrayValue; + metadataExport["loiColor"] = $scope.loiColor; + metadataExport["loiWidth"] = $scope.loiWidth; + + metadataExport["aoiColor"] = ""; + } + else if($scope.isAOI){ + metadataExport["poiSymbolBootstrap3Name"] = ""; + metadataExport["poiSymbolColor"] = ""; + metadataExport["poiMarkerColor"] = ""; + + metadataExport["loiDashArrayString"] = ""; + metadataExport["loiColor"] = ""; + metadataExport["loiWidth"] = ""; + + metadataExport["aoiColor"] = $scope.aoiColor; + } + + if($scope.georesourceTopic_subsubsubTopic){ + metadataExport.topicReference = $scope.georesourceTopic_subsubsubTopic.topicId; + } + else if($scope.georesourceTopic_subsubTopic){ + metadataExport.topicReference = $scope.georesourceTopic_subsubTopic.topicId; + } + else if($scope.georesourceTopic_subTopic){ + metadataExport.topicReference = $scope.georesourceTopic_subTopic.topicId; + } + else if($scope.georesourceTopic_mainTopic){ + metadataExport.topicReference = $scope.georesourceTopic_mainTopic.topicId; + } + else { + metadataExport.topicReference = ""; + } + + + var metadataJSON = JSON.stringify(metadataExport); + + var fileName = "Georessource_Metadaten_Export"; + + if (name){ + fileName += "-" + name; + } + + fileName += ".json"; + + var blob = new Blob([metadataJSON], {type: "application/json"}); + var data = URL.createObjectURL(blob); + + var a = document.createElement('a'); + a.download = fileName; + a.href = data; + a.textContent = "JSON"; + a.target = "_blank"; + a.rel = "noopener noreferrer"; + a.click(); + + a.remove(); + }; + + $scope.onChangeMarkerColor = function(markerColor){ + $scope.selectedPoiMarkerColor = markerColor; + }; + + $scope.onChangeSymbolColor = function(symbolColor){ + $scope.selectedPoiSymbolColor = symbolColor; + }; + + $scope.onChangeLoiDashArray = function(loiDashArrayObject){ + $scope.selectedLoiDashArrayObject = loiDashArrayObject; + $("#loiDashArrayEditDropdownButton").html(loiDashArrayObject.svgString); + }; + + $scope.hideSuccessAlert = function(){ + $("#georesourceEditMetadataSuccessAlert").hide(); + }; + + $scope.hideErrorAlert = function(){ + $("#georesourceEditMetadataErrorAlert").hide(); + }; + + } +]}); diff --git a/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditMetadataModal/georesource-edit-metadata-modal.module.js b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditMetadataModal/georesource-edit-metadata-modal.module.js index fec182dd4..4d420482e 100644 --- a/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditMetadataModal/georesource-edit-metadata-modal.module.js +++ b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditMetadataModal/georesource-edit-metadata-modal.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('georesourceEditMetadataModal', ['excaliburDualList', 'kommonitorMultiStepFormHelper', 'kommonitorDataGridHelper']); +//# sourceMappingURL=georesource-edit-metadata-modal.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditMetadataModal/georesource-edit-metadata-modal.module.js.map b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditMetadataModal/georesource-edit-metadata-modal.module.js.map new file mode 100644 index 000000000..3773c3808 --- /dev/null +++ b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditMetadataModal/georesource-edit-metadata-modal.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"georesource-edit-metadata-modal.module.js","sourceRoot":"","sources":["georesource-edit-metadata-modal.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,8BAA8B,EAAE,CAAC,mBAAmB,EAAE,+BAA+B,EAAE,0BAA0B,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditMetadataModal/georesource-edit-metadata-modal.module.ts b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditMetadataModal/georesource-edit-metadata-modal.module.ts new file mode 100644 index 000000000..fec182dd4 --- /dev/null +++ b/app/components/kommonitorAdmin/adminGeoresourcesManagement/georesourceEditMetadataModal/georesource-edit-metadata-modal.module.ts @@ -0,0 +1 @@ +angular.module('georesourceEditMetadataModal', ['excaliburDualList', 'kommonitorMultiStepFormHelper', 'kommonitorDataGridHelper']); diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/admin-indicators-management.component.js b/app/components/kommonitorAdmin/adminIndicatorsManagement/admin-indicators-management.component.js index c2146c792..b887faad4 100644 --- a/app/components/kommonitorAdmin/adminIndicatorsManagement/admin-indicators-management.component.js +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/admin-indicators-management.component.js @@ -1,184 +1,132 @@ +"use strict"; angular.module('adminIndicatorsManagement').component('adminIndicatorsManagement', { - templateUrl : "components/kommonitorAdmin/adminIndicatorsManagement/admin-indicators-management.template.html", - controller : ['kommonitorDataExchangeService', 'kommonitorCacheHelperService', 'kommonitorDataGridHelperService', '$scope', '$timeout', '$rootScope', '__env', '$http', - function IndicatorsManagementController(kommonitorDataExchangeService, kommonitorCacheHelperService, kommonitorDataGridHelperService, $scope, $timeout, $rootScope, __env, $http) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorDataGridHelperServiceInstance = kommonitorDataGridHelperService; - - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - $scope.loadingData = true; - - $scope.selectIndicatorEntriesInput = false; - - $scope.dataGrid; - - $scope.sortableConfig = { - onEnd: function (/**Event*/evt) { - var updatedIndicatorMetadataEntries = evt.models; - - // for those models send API request to persist new sort order - - var patchBody = []; - for (let index = 0; index < updatedIndicatorMetadataEntries.length; index++) { - const indicatorMetadata = updatedIndicatorMetadataEntries[index]; - - patchBody.push({ - "indicatorId": indicatorMetadata.indicatorId, - "displayOrder": index - }); - } - - $http({ - url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/indicators/display-order", - method: "PATCH", - data: patchBody - // headers: { - // 'Content-Type': undefined - // } - }).then(function successCallback(response) { - - - }, function errorCallback(error) { - // if(error.data){ - // $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - // } - // else{ - // $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - // } - - // $("#georesourceEditMetadataErrorAlert").show(); - - kommonitorDataExchangeService.displayMapApplicationError(error); - }); - - } - }; - - $scope.$on("initialMetadataLoadingCompleted", function (event) { - - - $timeout(function(){ - - $scope.initializeOrRefreshOverviewTable(); - }, 250); - - }); - - $scope.$on("initialMetadataLoadingFailed", function (event, errorArray) { - - $scope.loadingData = false; - - }); - - $scope.initializeOrRefreshOverviewTable = function(){ - $scope.loadingData = true; - - kommonitorDataGridHelperService.buildDataGrid_indicators(kommonitorDataExchangeService.availableIndicators); - - $scope.loadingData = false; - }; - - $scope.$on("refreshIndicatorOverviewTable", function (event, crudType, targetIndicatorId) { - $scope.loadingData = true; - $scope.refreshIndicatorOverviewTable(crudType, targetIndicatorId); - }); - - $scope.onChangeSelectIndicatorEntries = function(){ - if ($scope.selectIndicatorEntriesInput){ - $scope.availableIndicatorDatasets.forEach(function(dataset){ - dataset.isSelected = true; - - }); - } - else{ - $scope.availableIndicatorDatasets.forEach(function(dataset){ - dataset.isSelected = false; - }); - } - }; - - $scope.refreshIndicatorOverviewTable = function(crudType, targetIndicatorId){ - - if(! crudType || !targetIndicatorId){ - // refetch all metadata from spatial units to update table - kommonitorDataExchangeService.fetchIndicatorsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(response) { - - $scope.initializeOrRefreshOverviewTable(); - $rootScope.$broadcast("refreshIndicatorOverviewTableCompleted"); - - $scope.loadingData = false; - - }, function errorCallback(response) { - - $scope.loadingData = false; - $rootScope.$broadcast("refreshIndicatorOverviewTableCompleted"); - }); - } - else if(crudType && targetIndicatorId){ - if(crudType == "add"){ - kommonitorCacheHelperService.fetchSingleIndicatorMetadata(targetIndicatorId, kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(data) { - - kommonitorDataExchangeService.addSingleIndicatorMetadata(data); - - $scope.initializeOrRefreshOverviewTable(); - $rootScope.$broadcast("refreshIndicatorOverviewTableCompleted"); - - $scope.loadingData = false; - - }, function errorCallback(response) { - - $scope.loadingData = false; - $rootScope.$broadcast("refreshIndicatorOverviewTableCompleted"); - }); - } - else if(crudType == "edit"){ - kommonitorCacheHelperService.fetchSingleIndicatorMetadata(targetIndicatorId, kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(data) { - - kommonitorDataExchangeService.replaceSingleIndicatorMetadata(data); - - $scope.initializeOrRefreshOverviewTable(); - $rootScope.$broadcast("refreshIndicatorOverviewTableCompleted"); - - $scope.loadingData = false; - - }, function errorCallback(response) { - - $scope.loadingData = false; - $rootScope.$broadcast("refreshIndicatorOverviewTableCompleted"); - }); - } - else if(crudType == "delete"){ - kommonitorDataExchangeService.deleteSingleIndicatorMetadata(targetIndicatorId); - - $scope.initializeOrRefreshOverviewTable(); - $rootScope.$broadcast("refreshIndicatorOverviewTableCompleted"); - - $scope.loadingData = false; - } - } - - - - }; - - // $scope.onClickDeleteDatasets = function(){ - // $scope.loadingData = true; - - // var markedEntriesForDeletion = []; - // $scope.availableIndicatorDatasets.forEach(function(dataset){ - // if(dataset.isSelected){ - // markedEntriesForDeletion.push(dataset); - // } - // }); - - // // submit selected spatial units to modal controller - // $rootScope.$broadcast("onDeleteIndicators", markedEntriesForDeletion); - - // $scope.loadingData = false; - // }; - - } -]}); + templateUrl: "components/kommonitorAdmin/adminIndicatorsManagement/admin-indicators-management.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorCacheHelperService', 'kommonitorDataGridHelperService', '$scope', '$timeout', '$rootScope', '__env', '$http', + function IndicatorsManagementController(kommonitorDataExchangeService, kommonitorCacheHelperService, kommonitorDataGridHelperService, $scope, $timeout, $rootScope, __env, $http) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorDataGridHelperServiceInstance = kommonitorDataGridHelperService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + $scope.loadingData = true; + $scope.selectIndicatorEntriesInput = false; + $scope.dataGrid; + $scope.sortableConfig = { + onEnd: function (/**Event*/ evt) { + var updatedIndicatorMetadataEntries = evt.models; + // for those models send API request to persist new sort order + var patchBody = []; + for (let index = 0; index < updatedIndicatorMetadataEntries.length; index++) { + const indicatorMetadata = updatedIndicatorMetadataEntries[index]; + patchBody.push({ + "indicatorId": indicatorMetadata.indicatorId, + "displayOrder": index + }); + } + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/indicators/display-order", + method: "PATCH", + data: patchBody + // headers: { + // 'Content-Type': undefined + // } + }).then(function successCallback(response) { + }, function errorCallback(error) { + // if(error.data){ + // $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + // } + // else{ + // $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + // } + // $("#georesourceEditMetadataErrorAlert").show(); + kommonitorDataExchangeService.displayMapApplicationError(error); + }); + } + }; + $scope.$on("initialMetadataLoadingCompleted", function (event) { + $timeout(function () { + $scope.initializeOrRefreshOverviewTable(); + }, 250); + }); + $scope.$on("initialMetadataLoadingFailed", function (event, errorArray) { + $scope.loadingData = false; + }); + $scope.initializeOrRefreshOverviewTable = function () { + $scope.loadingData = true; + kommonitorDataGridHelperService.buildDataGrid_indicators(kommonitorDataExchangeService.availableIndicators); + $scope.loadingData = false; + }; + $scope.$on("refreshIndicatorOverviewTable", function (event, crudType, targetIndicatorId) { + $scope.loadingData = true; + $scope.refreshIndicatorOverviewTable(crudType, targetIndicatorId); + }); + $scope.onChangeSelectIndicatorEntries = function () { + if ($scope.selectIndicatorEntriesInput) { + $scope.availableIndicatorDatasets.forEach(function (dataset) { + dataset.isSelected = true; + }); + } + else { + $scope.availableIndicatorDatasets.forEach(function (dataset) { + dataset.isSelected = false; + }); + } + }; + $scope.refreshIndicatorOverviewTable = function (crudType, targetIndicatorId) { + if (!crudType || !targetIndicatorId) { + // refetch all metadata from spatial units to update table + kommonitorDataExchangeService.fetchIndicatorsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(response) { + $scope.initializeOrRefreshOverviewTable(); + $rootScope.$broadcast("refreshIndicatorOverviewTableCompleted"); + $scope.loadingData = false; + }, function errorCallback(response) { + $scope.loadingData = false; + $rootScope.$broadcast("refreshIndicatorOverviewTableCompleted"); + }); + } + else if (crudType && targetIndicatorId) { + if (crudType == "add") { + kommonitorCacheHelperService.fetchSingleIndicatorMetadata(targetIndicatorId, kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(data) { + kommonitorDataExchangeService.addSingleIndicatorMetadata(data); + $scope.initializeOrRefreshOverviewTable(); + $rootScope.$broadcast("refreshIndicatorOverviewTableCompleted"); + $scope.loadingData = false; + }, function errorCallback(response) { + $scope.loadingData = false; + $rootScope.$broadcast("refreshIndicatorOverviewTableCompleted"); + }); + } + else if (crudType == "edit") { + kommonitorCacheHelperService.fetchSingleIndicatorMetadata(targetIndicatorId, kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(data) { + kommonitorDataExchangeService.replaceSingleIndicatorMetadata(data); + $scope.initializeOrRefreshOverviewTable(); + $rootScope.$broadcast("refreshIndicatorOverviewTableCompleted"); + $scope.loadingData = false; + }, function errorCallback(response) { + $scope.loadingData = false; + $rootScope.$broadcast("refreshIndicatorOverviewTableCompleted"); + }); + } + else if (crudType == "delete") { + kommonitorDataExchangeService.deleteSingleIndicatorMetadata(targetIndicatorId); + $scope.initializeOrRefreshOverviewTable(); + $rootScope.$broadcast("refreshIndicatorOverviewTableCompleted"); + $scope.loadingData = false; + } + } + }; + // $scope.onClickDeleteDatasets = function(){ + // $scope.loadingData = true; + // var markedEntriesForDeletion = []; + // $scope.availableIndicatorDatasets.forEach(function(dataset){ + // if(dataset.isSelected){ + // markedEntriesForDeletion.push(dataset); + // } + // }); + // // submit selected spatial units to modal controller + // $rootScope.$broadcast("onDeleteIndicators", markedEntriesForDeletion); + // $scope.loadingData = false; + // }; + } + ] +}); +//# sourceMappingURL=admin-indicators-management.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/admin-indicators-management.component.js.map b/app/components/kommonitorAdmin/adminIndicatorsManagement/admin-indicators-management.component.js.map new file mode 100644 index 000000000..56b59cc64 --- /dev/null +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/admin-indicators-management.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"admin-indicators-management.component.js","sourceRoot":"","sources":["admin-indicators-management.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,2BAA2B,CAAC,CAAC,SAAS,CAAC,2BAA2B,EAAE;IAClF,WAAW,EAAG,gGAAgG;IAC9G,UAAU,EAAG,CAAC,+BAA+B,EAAE,8BAA8B,EAAE,iCAAiC,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO;QACtK,SAAS,8BAA8B,CAAC,6BAA6B,EAAE,4BAA4B,EAAE,+BAA+B,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK;YAE/K,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAC3E,IAAI,CAAC,uCAAuC,GAAG,+BAA+B,CAAC;YAE/E,sCAAsC;YACrC,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,CAAC;YAEvB,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC;YAE1B,MAAM,CAAC,2BAA2B,GAAG,KAAK,CAAC;YAE3C,MAAM,CAAC,QAAQ,CAAC;YAEhB,MAAM,CAAC,cAAc,GAAG;gBACvB,KAAK,EAAE,UAAU,UAAU,CAAA,GAAG;oBAC7B,IAAI,+BAA+B,GAAG,GAAG,CAAC,MAAM,CAAC;oBAEjD,8DAA8D;oBAE9D,IAAI,SAAS,GAAG,EAAE,CAAC;oBACnB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,+BAA+B,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;wBAC5E,MAAM,iBAAiB,GAAG,+BAA+B,CA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,gEAAgE;YAChE,4BAA4B;YAC5B,6CAA6C;YAC7C,MAAM;YACN,OAAO;YAEP,wDAAwD;YACxD,0EAA0E;YAE1E,+BAA+B;YAC/B,KAAK;QAEN,CAAC;KACD;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/admin-indicators-management.component.ts b/app/components/kommonitorAdmin/adminIndicatorsManagement/admin-indicators-management.component.ts new file mode 100644 index 000000000..c2146c792 --- /dev/null +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/admin-indicators-management.component.ts @@ -0,0 +1,184 @@ +angular.module('adminIndicatorsManagement').component('adminIndicatorsManagement', { + templateUrl : "components/kommonitorAdmin/adminIndicatorsManagement/admin-indicators-management.template.html", + controller : ['kommonitorDataExchangeService', 'kommonitorCacheHelperService', 'kommonitorDataGridHelperService', '$scope', '$timeout', '$rootScope', '__env', '$http', + function IndicatorsManagementController(kommonitorDataExchangeService, kommonitorCacheHelperService, kommonitorDataGridHelperService, $scope, $timeout, $rootScope, __env, $http) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorDataGridHelperServiceInstance = kommonitorDataGridHelperService; + + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + $scope.loadingData = true; + + $scope.selectIndicatorEntriesInput = false; + + $scope.dataGrid; + + $scope.sortableConfig = { + onEnd: function (/**Event*/evt) { + var updatedIndicatorMetadataEntries = evt.models; + + // for those models send API request to persist new sort order + + var patchBody = []; + for (let index = 0; index < updatedIndicatorMetadataEntries.length; index++) { + const indicatorMetadata = updatedIndicatorMetadataEntries[index]; + + patchBody.push({ + "indicatorId": indicatorMetadata.indicatorId, + "displayOrder": index + }); + } + + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/indicators/display-order", + method: "PATCH", + data: patchBody + // headers: { + // 'Content-Type': undefined + // } + }).then(function successCallback(response) { + + + }, function errorCallback(error) { + // if(error.data){ + // $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + // } + // else{ + // $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + // } + + // $("#georesourceEditMetadataErrorAlert").show(); + + kommonitorDataExchangeService.displayMapApplicationError(error); + }); + + } + }; + + $scope.$on("initialMetadataLoadingCompleted", function (event) { + + + $timeout(function(){ + + $scope.initializeOrRefreshOverviewTable(); + }, 250); + + }); + + $scope.$on("initialMetadataLoadingFailed", function (event, errorArray) { + + $scope.loadingData = false; + + }); + + $scope.initializeOrRefreshOverviewTable = function(){ + $scope.loadingData = true; + + kommonitorDataGridHelperService.buildDataGrid_indicators(kommonitorDataExchangeService.availableIndicators); + + $scope.loadingData = false; + }; + + $scope.$on("refreshIndicatorOverviewTable", function (event, crudType, targetIndicatorId) { + $scope.loadingData = true; + $scope.refreshIndicatorOverviewTable(crudType, targetIndicatorId); + }); + + $scope.onChangeSelectIndicatorEntries = function(){ + if ($scope.selectIndicatorEntriesInput){ + $scope.availableIndicatorDatasets.forEach(function(dataset){ + dataset.isSelected = true; + + }); + } + else{ + $scope.availableIndicatorDatasets.forEach(function(dataset){ + dataset.isSelected = false; + }); + } + }; + + $scope.refreshIndicatorOverviewTable = function(crudType, targetIndicatorId){ + + if(! crudType || !targetIndicatorId){ + // refetch all metadata from spatial units to update table + kommonitorDataExchangeService.fetchIndicatorsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(response) { + + $scope.initializeOrRefreshOverviewTable(); + $rootScope.$broadcast("refreshIndicatorOverviewTableCompleted"); + + $scope.loadingData = false; + + }, function errorCallback(response) { + + $scope.loadingData = false; + $rootScope.$broadcast("refreshIndicatorOverviewTableCompleted"); + }); + } + else if(crudType && targetIndicatorId){ + if(crudType == "add"){ + kommonitorCacheHelperService.fetchSingleIndicatorMetadata(targetIndicatorId, kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(data) { + + kommonitorDataExchangeService.addSingleIndicatorMetadata(data); + + $scope.initializeOrRefreshOverviewTable(); + $rootScope.$broadcast("refreshIndicatorOverviewTableCompleted"); + + $scope.loadingData = false; + + }, function errorCallback(response) { + + $scope.loadingData = false; + $rootScope.$broadcast("refreshIndicatorOverviewTableCompleted"); + }); + } + else if(crudType == "edit"){ + kommonitorCacheHelperService.fetchSingleIndicatorMetadata(targetIndicatorId, kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(data) { + + kommonitorDataExchangeService.replaceSingleIndicatorMetadata(data); + + $scope.initializeOrRefreshOverviewTable(); + $rootScope.$broadcast("refreshIndicatorOverviewTableCompleted"); + + $scope.loadingData = false; + + }, function errorCallback(response) { + + $scope.loadingData = false; + $rootScope.$broadcast("refreshIndicatorOverviewTableCompleted"); + }); + } + else if(crudType == "delete"){ + kommonitorDataExchangeService.deleteSingleIndicatorMetadata(targetIndicatorId); + + $scope.initializeOrRefreshOverviewTable(); + $rootScope.$broadcast("refreshIndicatorOverviewTableCompleted"); + + $scope.loadingData = false; + } + } + + + + }; + + // $scope.onClickDeleteDatasets = function(){ + // $scope.loadingData = true; + + // var markedEntriesForDeletion = []; + // $scope.availableIndicatorDatasets.forEach(function(dataset){ + // if(dataset.isSelected){ + // markedEntriesForDeletion.push(dataset); + // } + // }); + + // // submit selected spatial units to modal controller + // $rootScope.$broadcast("onDeleteIndicators", markedEntriesForDeletion); + + // $scope.loadingData = false; + // }; + + } +]}); diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/admin-indicators-management.module.js b/app/components/kommonitorAdmin/adminIndicatorsManagement/admin-indicators-management.module.js index 962cd033f..3194702ea 100644 --- a/app/components/kommonitorAdmin/adminIndicatorsManagement/admin-indicators-management.module.js +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/admin-indicators-management.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('adminIndicatorsManagement', ['kommonitorDataExchange', 'kommonitorCacheHelper', 'kommonitorDataGridHelper', 'ng-sortable']); +//# sourceMappingURL=admin-indicators-management.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/admin-indicators-management.module.js.map b/app/components/kommonitorAdmin/adminIndicatorsManagement/admin-indicators-management.module.js.map new file mode 100644 index 000000000..7178cc5f5 --- /dev/null +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/admin-indicators-management.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"admin-indicators-management.module.js","sourceRoot":"","sources":["admin-indicators-management.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,2BAA2B,EAAE,CAAC,wBAAwB,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,aAAa,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/admin-indicators-management.module.ts b/app/components/kommonitorAdmin/adminIndicatorsManagement/admin-indicators-management.module.ts new file mode 100644 index 000000000..962cd033f --- /dev/null +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/admin-indicators-management.module.ts @@ -0,0 +1 @@ +angular.module('adminIndicatorsManagement', ['kommonitorDataExchange', 'kommonitorCacheHelper', 'kommonitorDataGridHelper', 'ng-sortable']); diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorAddModal/indicator-add-modal.component.js b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorAddModal/indicator-add-modal.component.js index 75b08e2fe..a643aa2f5 100644 --- a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorAddModal/indicator-add-modal.component.js +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorAddModal/indicator-add-modal.component.js @@ -1,1042 +1,855 @@ +"use strict"; angular.module('indicatorAddModal').component('indicatorAddModal', { - templateUrl : "components/kommonitorAdmin/adminIndicatorsManagement/indicatorAddModal/indicator-add-modal.template.html", - controller : ['kommonitorDataExchangeService', 'kommonitorImporterHelperService', '$scope', '$rootScope', '$http', '$timeout', - '__env', 'kommonitorMultiStepFormHelperService', 'kommonitorDataGridHelperService', - function IndicatorAddModalAddModalController(kommonitorDataExchangeService, kommonitorImporterHelperService, $scope, $rootScope, $http, $timeout, - __env, kommonitorMultiStepFormHelperService, kommonitorDataGridHelperService) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorImporterHelperServiceInstance = kommonitorImporterHelperService; - - /* POST BODY - { - "refrencesToOtherIndicators": [ - { - "referenceDescription": "referenceDescription", - "indicatorId": "indicatorId" - }, - { - "referenceDescription": "referenceDescription", - "indicatorId": "indicatorId" - } - ], - "metadata": { - "note": "note", - "literature": "literature", - "updateInterval": "ARBITRARY", - "sridEPSG": 0.8008281904610115, - "datasource": "datasource", - "contact": "contact", - "lastUpdate": "2000-01-23", - "description": "description", - "databasis": "databasis" - }, - "allowedRoles": [ - "allowedRoles", - "allowedRoles" - ], - "datasetName": "datasetName", - "abbreviation": "abbreviation", - "characteristicValue": "characteristicValue", - "tags": [ - "tags", - "tags" - ], - "creationType": "INSERTION", - "unit": "unit", - "topicReference": "topicReference", - "referencDateNote": "note", - "displayOrder": 0, - "refrencesToGeoresources": [ - { - "referenceDescription": "referenceDescription", - "georesourceId": "georesourceId" - }, - { - "referenceDescription": "referenceDescription", - "georesourceId": "georesourceId" - } - ], - "indicatorType": "STATUS_ABSOLUTE", - "interpretation": "interpretation", - "isHeadlineIndicator": false, - "processDescription": "processDescription", - "lowestSpatialUnitForComputation": "lowestSpatialUnitForComputation", - "defaultClassificationMapping": { - "colorBrewerSchemeName": "colorBrewerSchemeName", - "items": [ - { - "defaultCustomRating": "defaultCustomRating", - "defaultColorAsHex": "defaultColorAsHex" - }, - { - "defaultCustomRating": "defaultCustomRating", - "defaultColorAsHex": "defaultColorAsHex" - } - ] - } - } - */ - - //Date picker - $('#indicatorAddLastUpdateDatepicker').datepicker(kommonitorDataExchangeService.datePickerOptions); - - $scope.indicatorMetadataStructure = { - "metadata": { - "note": "an optional note", - "literature": "optional text about literature", - "updateInterval": "YEARLY|HALF_YEARLY|QUARTERLY|MONTHLY|ARBITRARY", - "sridEPSG": 4326, - "datasource": "text about data source", - "contact": "text about contact details", - "lastUpdate": "YYYY-MM-DD", - "description": "description about spatial unit dataset", - "databasis": "text about data basis", - }, - "allowedRoles": ['roleId'], - "refrencesToOtherIndicators": [ - { - "referenceDescription": "description about the reference", - "indicatorId": "ID of referenced indicator dataset" - } - ], - "refrencesToGeoresources": [ - { - "referenceDescription": "description about the reference", - "georesourceId": "ID of referenced georesource dataset" - } - ], - "datasetName": "Name of indicator dataset", - "abbreviation": "optional abbreviation of the indicator dataset", - "characteristicValue": "if the same datasetName is used for different indicators, the optional characteristicValue parameter may serve to distinguish between them (i.e. Habitants - male, Habitants - female, Habitants - diverse)", - "tags": [ - "optinal list of tags; each tag is a free text tag" - ], - "creationType": "INSERTION|COMPUTATION <-- enum parameter controls whether each timestamp must be updated manually (INSERTION) or if KomMonitor shall compute the indicator values for respective timestamps based on script file (COMPUTATION)", - "unit": "unit of the indicator", - "topicReference": "ID of the respective main/sub topic instance", - "indicatorType": "STATUS_ABSOLUTE|STATUS_RELATIVE|DYNAMIC_ABSOLUTE|DYNAMIC_RELATIVE|STATUS_STANDARDIZED|DYNAMIC_STANDARDIZED", - "interpretation": "interpretation hints for the user to better understand the indicator values", - "isHeadlineIndicator": "boolean parameter to indicate if indicator is a headline indicator", - "processDescription": "detailed description about the computation/creation of the indicator", - "referenceDateNote": "optional note for indicator reference date", - "displayOrder": 0, - "lowestSpatialUnitForComputation": "the name of the lowest possible spatial unit for which an indicator of creationType=COMPUTATION may be computed. All other superior spatial units will be aggregated automatically", - "defaultClassificationMapping": { - "colorBrewerSchemeName": "schema name of colorBrewer colorPalette to use for classification", - "items": [ - { - "defaultCustomRating": "a string to rate indicator values of this class", - "defaultColorAsHex": "color as hexadecimal value" - } - ] - } - }; - - $scope.indicatorMetadataStructure_pretty = kommonitorDataExchangeService.syntaxHighlightJSON($scope.indicatorMetadataStructure); - $scope.indicatorMappingConfigStructure_pretty = kommonitorDataExchangeService.syntaxHighlightJSON(kommonitorImporterHelperService.mappingConfigStructure_indicator); - - - $scope.metadataImportSettings; - $scope.indicatorMetadataImportError; - $scope.indicatorAddMetadataImportErrorAlert; - - $scope.datasetName = undefined; - $scope.datasetNameInvalid = false; - - $scope.metadata = {}; - $scope.metadata.note = undefined; - $scope.metadata.literature = undefined; - $scope.metadata.updateInterval = undefined; - $scope.metadata.sridEPSG = undefined; - $scope.metadata.datasource = undefined; - $scope.metadata.databasis = undefined; - $scope.metadata.contact = undefined; - $scope.metadata.lastUpdate = undefined; - $scope.metadata.description = undefined; - - $scope.roleManagementTableOptions = undefined; - - $scope.$on("availableRolesUpdate", function (event) { - refreshRoles(); - }); - - // make sure that initial fetching of availableRoles has happened - $scope.$on("initialMetadataLoadingCompleted", function (event) { - refreshRoles(); - }); - - function refreshRoles() { - $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorAddRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, kommonitorDataExchangeService.getCurrentKomMonitorLoginRoleIds()); - } - - $scope.datasetName = undefined; - $scope.indicatorAbbreviation = undefined; - $scope.indicatorType = undefined; - $scope.indicatorCharacteristicValue = undefined; - $scope.isHeadlineIndicator = false; - $scope.indicatorUnit = undefined; - $scope.enableFreeTextUnit = false; - $scope.indicatorProcessDescription = undefined; - $scope.indicatorTagsString_withCommas = undefined; - $scope.indicatorInterpretation = undefined; - $scope.indicatorCreationType = undefined; - $scope.indicatorLowestSpatialUnitMetadataObjectForComputation = kommonitorDataExchangeService.availableSpatialUnits[0]; - $scope.enableLowestSpatialUnitSelect = false; - - $scope.indicatorReferenceDateNote = undefined; - $scope.displayOrder = 0; - - $scope.indicatorTopic_mainTopic = undefined; - $scope.indicatorTopic_subTopic = undefined; - $scope.indicatorTopic_subsubTopic = undefined; - $scope.indicatorTopic_subsubsubTopic = undefined; - - $scope.indicatorNameFilter = undefined; - $scope.tmpIndicatorReference_selectedIndicatorMetadata = undefined; - $scope.tmpIndicatorReference_referenceDescription = undefined; - // tmp array to display indicatorReferences - $scope.indicatorReferences_adminView = []; - // array for API request (has less information per item) - $scope.indicatorReferences_apiRequest = []; - - $scope.georesourceNameFilter = undefined; - $scope.tmpGeoresourceReference_selectedGeoresourceMetadata = undefined; - $scope.tmpGeoresourceReference_referenceDescription = undefined; - // tmp array to display georesourceReferences - $scope.georesourceReferences_adminView = []; - // array for API request (has less information per item) - $scope.georesourceReferences_apiRequest = []; - - $scope.numClassesArray = [3,4,5,6,7,8]; - $scope.numClasses = $scope.numClassesArray[2]; - $scope.selectedColorBrewerPaletteEntry = undefined; - - $scope.postBody_indicators = undefined; - - $scope.successMessagePart = undefined; - $scope.errorMessagePart = undefined; - - $scope.loadingData = false; - - $scope.colorbrewerSchemes = colorbrewer; - $scope.colorbreweSchemeName_dynamicIncrease = __env.defaultColorBrewerPaletteForBalanceIncreasingValues; - $scope.colorbreweSchemeName_dynamicDecrease = __env.defaultColorBrewerPaletteForBalanceDecreasingValues; - $scope.colorbrewerPalettes = []; - - - $scope.instantiateColorBrewerPalettes = function(){ - for (const key in colorbrewer) { - if (colorbrewer.hasOwnProperty(key)) { - const colorPalettes = colorbrewer[key]; - - var paletteEntry = { - "paletteName": key, - "paletteArrayObject": colorPalettes - }; - - $scope.colorbrewerPalettes.push(paletteEntry); - } - } - - // instantiate with palette 'Blues' - $scope.selectedColorBrewerPaletteEntry = $scope.colorbrewerPalettes[13]; - - }; - - $scope.instantiateColorBrewerPalettes(); - - $scope.resetIndicatorAddForm = function(){ - - $scope.successMessagePart = undefined; - $scope.errorMessagePart = undefined; - - $scope.datasetName = undefined; - $scope.datasetNameInvalid = false; - - $scope.metadata = {}; - $scope.metadata.note = undefined; - $scope.metadata.literature = undefined; - $scope.metadata.updateInterval = undefined; - $scope.metadata.sridEPSG = undefined; - $scope.metadata.datasource = undefined; - $scope.metadata.databasis = undefined; - $scope.metadata.contact = undefined; - $scope.metadata.lastUpdate = undefined; - $scope.metadata.description = undefined; - - $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorAddRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, kommonitorDataExchangeService.getCurrentKomMonitorLoginRoleIds()); - - $scope.datasetName = undefined; - $scope.indicatorAbbreviation = undefined; - $scope.indicatorType = kommonitorDataExchangeService.indicatorTypeOptions[0]; - $scope.indicatorCharacteristicValue = undefined; - $scope.isHeadlineIndicator = false; - $scope.indicatorUnit = undefined; - $scope.enableFreeTextUnit = false; - $scope.indicatorProcessDescription = undefined; - $scope.indicatorTagsString_withCommas = undefined; - $scope.indicatorInterpretation = undefined; - $scope.indicatorCreationType = kommonitorDataExchangeService.indicatorCreationTypeOptions[0]; - $scope.indicatorLowestSpatialUnitMetadataObjectForComputation = kommonitorDataExchangeService.availableSpatialUnits[0]; - $scope.enableLowestSpatialUnitSelect = false; - - $scope.indicatorReferenceDateNote = undefined; - $scope.displayOrder = 0; - - $scope.indicatorTopic_mainTopic = undefined; - $scope.indicatorTopic_subTopic = undefined; - $scope.indicatorTopic_subsubTopic = undefined; - $scope.indicatorTopic_subsubsubTopic = undefined; - - $scope.indicatorNameFilter = undefined; - $scope.tmpIndicatorReference_selectedIndicatorMetadata = undefined; - $scope.tmpIndicatorReference_referenceDescription = undefined; - // tmp array to display indicatorReferences - $scope.indicatorReferences_adminView = []; - // array for API request (has less information per item) - $scope.indicatorReferences_apiRequest = []; - - $scope.georesourceNameFilter = undefined; - $scope.tmpGeoresourceReference_selectedGeoresourceMetadata = undefined; - $scope.tmpGeoresourceReference_referenceDescription = undefined; - // tmp array to display georesourceReferences - $scope.georesourceReferences_adminView = []; - // array for API request (has less information per item) - $scope.georesourceReferences_apiRequest = []; - - $scope.numClassesArray = [3,4,5,6,7,8]; - $scope.numClasses = $scope.numClassesArray[2]; - $scope.selectedColorBrewerPaletteEntry = $scope.colorbrewerPalettes[13]; - - $scope.postBody_indicators = undefined; - - setTimeout(() => { - $scope.$digest(); - }, 250); - }; - - $scope.onClickColorBrewerEntry = function(colorPaletteEntry){ - $scope.selectedColorBrewerPaletteEntry = colorPaletteEntry; - - setTimeout(() => { - $scope.$digest(); - }, 250); - }; - - $scope.onAddOrUpdateIndicatorReference = function(){ - var tmpIndicatorReference_adminView = { - "referencedIndicatorName": $scope.tmpIndicatorReference_selectedIndicatorMetadata.indicatorName, - "referencedIndicatorId": $scope.tmpIndicatorReference_selectedIndicatorMetadata.indicatorId, - "referencedIndicatorAbbreviation": $scope.tmpIndicatorReference_selectedIndicatorMetadata.abbreviation, - "referencedIndicatorDescription": $scope.tmpIndicatorReference_referenceDescription - }; - - var processed = false; - - for (let index = 0; index < $scope.indicatorReferences_adminView.length; index++) { - var indicatorReference_adminView = $scope.indicatorReferences_adminView[index]; - - if (indicatorReference_adminView.referencedIndicatorId === tmpIndicatorReference_adminView.referencedIndicatorId){ - // replace object - $scope.indicatorReferences_adminView[index] = tmpIndicatorReference_adminView; - processed = true; - break; - } - } - - if(! processed){ - // new entry - $scope.indicatorReferences_adminView.push(tmpIndicatorReference_adminView); - } - - $scope.tmpIndicatorReference_selectedIndicatorMetadata = undefined; - $scope.tmpIndicatorReference_referenceDescription = undefined; - - setTimeout(() => { - $scope.$digest(); - }, 250); - }; - - $scope.onClickEditIndicatorReference = function(indicatorReference_adminView){ - - $scope.tmpIndicatorReference_selectedIndicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(indicatorReference_adminView.referencedIndicatorId); - $scope.tmpIndicatorReference_referenceDescription = indicatorReference_adminView.referencedIndicatorDescription; - - setTimeout(() => { - $scope.$digest(); - }, 250); - }; - - $scope.onClickDeleteIndicatorReference = function(indicatorReference_adminView){ - - for (let index = 0; index < $scope.indicatorReferences_adminView.length; index++) { - - if ($scope.indicatorReferences_adminView[index].referencedIndicatorId === indicatorReference_adminView.referencedIndicatorId){ - // remove object - $scope.indicatorReferences_adminView.splice(index, 1); - break; - } - } - - setTimeout(() => { - $scope.$digest(); - }, 250); - }; - - $scope.onAddOrUpdateGeoresourceReference = function(){ - var tmpGeoresourceReference_adminView = { - "referencedGeoresourceName": $scope.tmpGeoresourceReference_selectedGeoresourceMetadata.datasetName, - "referencedGeoresourceId": $scope.tmpGeoresourceReference_selectedGeoresourceMetadata.georesourceId, - "referencedGeoresourceDescription": $scope.tmpGeoresourceReference_referenceDescription - }; - - var processed = false; - - for (let index = 0; index < $scope.georesourceReferences_adminView.length; index++) { - var georesourceReference_adminView = $scope.georesourceReferences_adminView[index]; - - if (georesourceReference_adminView.referencedGeoresourceId === tmpGeoresourceReference_adminView.referencedGeoresourceId){ - // replace object - $scope.georesourceReferences_adminView[index] = tmpGeoresourceReference_adminView; - processed = true; - break; - } - } - - if(! processed){ - // new entry - $scope.georesourceReferences_adminView.push(tmpGeoresourceReference_adminView); - } - - $scope.tmpGeoresourceReference_selectedGeoresourceMetadata = undefined; - $scope.tmpGeoresourceReference_referenceDescription = undefined; - - setTimeout(() => { - $scope.$digest(); - }, 250); - }; - - $scope.onClickEditGeoresourceReference = function(georesourceReference_adminView){ - - $scope.tmpGeoresourceReference_selectedGeoresourceMetadata = kommonitorDataExchangeService.getGeoresourceMetadataById(georesourceReference_adminView.referencedGeoresourceId); - $scope.tmpGeoresourceReference_referenceDescription = georesourceReference_adminView.referencedGeoresourceDescription; - - setTimeout(() => { - $scope.$digest(); - }, 250); - }; - - $scope.onClickDeleteGeoresourceReference = function(georesourceReference_adminView){ - - for (let index = 0; index < $scope.georesourceReferences_adminView.length; index++) { - - if ($scope.georesourceReferences_adminView[index].referencedGeoresourceId === georesourceReference_adminView.referencedGeoresourceId){ - // remove object - $scope.georesourceReferences_adminView.splice(index, 1); - break; - } - } - - setTimeout(() => { - $scope.$digest(); - }, 250); - }; - - $scope.onChangeCreationType = function(){ - if($scope.indicatorCreationType.apiName === "COMPUTATION"){ - $scope.enableLowestSpatialUnitSelect = true; - } - else{ - $scope.enableLowestSpatialUnitSelect = false; - } - - }; - - $scope.onChangeIndicatorUnit = function(){ - if ($scope.indicatorUnit.includes("Freitext")){ - $scope.enableFreeTextUnit = true; - } - else{ - $scope.enableFreeTextUnit = false; - } - }; - - $scope.checkDatasetName = function(){ - $scope.datasetNameInvalid = false; - kommonitorDataExchangeService.availableIndicators.forEach(function(indicator){ - if (indicator.indicatorName === $scope.datasetName){ - $scope.datasetNameInvalid = true; - return; - } - }); - }; - - $scope.buildPostBody_indicators = function(){ - var postBody = - { - "metadata": { - "note": $scope.metadata.note || null, - "literature": $scope.metadata.literature || null, - "updateInterval": $scope.metadata.updateInterval.apiName, - "sridEPSG": $scope.metadata.sridEPSG || 4326, - "datasource": $scope.metadata.datasource, - "contact": $scope.metadata.contact, - "lastUpdate": $scope.metadata.lastUpdate, - "description": $scope.metadata.description || null, - "databasis": $scope.metadata.databasis || null - }, - "refrencesToOtherIndicators": [], // filled directly after - "allowedRoles": [], - "datasetName": $scope.datasetName, - "abbreviation": $scope.indicatorAbbreviation || null, - "characteristicValue": $scope.indicatorCharacteristicValue || null, - "tags": [], // filled directly after - "creationType": $scope.indicatorCreationType.apiName, - "unit": $scope.indicatorUnit, - "topicReference": "", // filled directly after - "refrencesToGeoresources": [], // filled directly after - "indicatorType": $scope.indicatorType.apiName, - "interpretation": $scope.indicatorInterpretation || "", - "isHeadlineIndicator": $scope.isHeadlineIndicator || false, - "processDescription": $scope.indicatorProcessDescription || "", - "referenceDateNote": $scope.indicatorReferenceDateNote || "", - "displayOrder": $scope.displayOrder, - "lowestSpatialUnitForComputation": $scope.indicatorLowestSpatialUnitMetadataObjectForComputation? $scope.indicatorLowestSpatialUnitMetadataObjectForComputation.spatialUnitLevel : null, - "defaultClassificationMapping": { - "colorBrewerSchemeName": $scope.selectedColorBrewerPaletteEntry.paletteName, - "items": [ - { - "defaultColorAsHex": "#edf8e9", - "defaultCustomRating": "sehr niedrig" - }, - { - "defaultColorAsHex": "#bae4b3", - "defaultCustomRating": "niedrig" - }, - { - "defaultColorAsHex": "#74c476", - "defaultCustomRating": "mittel" - }, - { - "defaultColorAsHex": "#31a354", - "defaultCustomRating": "hoch" - }, - { - "defaultColorAsHex": "#006d2c", - "defaultCustomRating": "sehr hoch" - } - ] - } - }; - - let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); - for (const roleId of roleIds) { - postBody.allowedRoles.push(roleId); - } - - // TAGS - if($scope.indicatorTagsString_withCommas){ - var tags_splitted = $scope.indicatorTagsString_withCommas.split(","); - for (const tagString of tags_splitted) { - postBody.tags.push(tagString.trim()); - } - } - - // TOPIC REFERENCE - if($scope.indicatorTopic_subsubsubTopic){ - postBody.topicReference = $scope.indicatorTopic_subsubsubTopic.topicId; - } - else if($scope.indicatorTopic_subsubTopic){ - postBody.topicReference = $scope.indicatorTopic_subsubTopic.topicId; - } - else if($scope.indicatorTopic_subTopic){ - postBody.topicReference = $scope.indicatorTopic_subTopic.topicId; - } - else if($scope.indicatorTopic_mainTopic){ - postBody.topicReference = $scope.indicatorTopic_mainTopic.topicId; - } - else { - postBody.topicReference = ""; - } - - - // REFERENCES - if($scope.indicatorReferences_adminView && $scope.indicatorReferences_adminView.length > 0){ - postBody.refrencesToOtherIndicators = []; - - for (const indicRef of $scope.indicatorReferences_adminView) { - postBody.refrencesToOtherIndicators.push({ - "indicatorId": indicRef.referencedIndicatorId, - "referenceDescription": indicRef.referencedIndicatorDescription - }); - } - } - - if($scope.georesourceReferences_adminView && $scope.georesourceReferences_adminView.length > 0){ - postBody.refrencesToGeoresources = []; - - for (const geoRef of $scope.georesourceReferences_adminView) { - postBody.refrencesToGeoresources.push({ - "georesourceId": geoRef.referencedGeoresourceId, - "referenceDescription": geoRef.referencedGeoresourceDescription - }); - } - } - - - return postBody; - }; - - $scope.addIndicator = async function(){ - - $timeout(function(){ - $scope.loadingData = true; - }); - - var postBody = $scope.buildPostBody_indicators(); - - return await $http({ - url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/indicators", - method: "POST", - data: postBody, - headers: { - 'Content-Type': "application/json" - } - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - $rootScope.$broadcast("refreshIndicatorOverviewTable", "add", response.data.indicatorId); - - // refresh all admin dashboard diagrams due to modified metadata - $timeout(function(){ - $rootScope.$broadcast("refreshAdminDashboardDiagrams"); - }, 500); - - $scope.successMessagePart = $scope.datasetName; - $scope.importedFeatures = []; - - $("#indicatorAddSuccessAlert").show(); - - $scope.loadingData = false; - - }, function errorCallback(error) { - console.error("Error while adding computable indicatorMetadata service."); - if(error.data){ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else{ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - - $("#indicatorAddErrorAlert").show(); - $scope.loadingData = false; - - setTimeout(() => { - $scope.$digest(); - }, 250); - }); - - }; - - $scope.onImportIndicatorAddMetadata = function(){ - - $scope.indicatorMetadataImportError = ""; - - $("#indicatorMetadataImportFile").files = []; - - // trigger file chooser - $("#indicatorMetadataImportFile").click(); - - }; - - $(document).on("change", "#indicatorMetadataImportFile" ,function(){ - - console.log("Importing Indicator metadata for Add Indicator Form"); - - // get the file - var file = document.getElementById('indicatorMetadataImportFile').files[0]; - $scope.parseMetadataFromFile(file); - }); - - $scope.parseMetadataFromFile = function(file){ - var fileReader = new FileReader(); - - fileReader.onload = function(event) { - - try{ - $scope.parseFromMetadataFile(event); - } - catch(error){ - console.error(error); - console.error("Uploaded Metadata File cannot be parsed."); - $scope.indicatorMetadataImportError = "Uploaded Metadata File cannot be parsed correctly"; - document.getElementById("indicatorsAddMetadataPre").innerHTML = $scope.indicatorMetadataStructure_pretty; - $("#indicatorAddMetadataImportErrorAlert").show(); - - $scope.$digest(); - } - - }; - - // Read in the image file as a data URL. - fileReader.readAsText(file); - }; - - $scope.parseFromMetadataFile = function(event){ - // $scope.geoJsonString = event.target.result; - $scope.metadataImportSettings = JSON.parse(event.target.result); - - if(! $scope.metadataImportSettings.metadata){ - console.error("uploaded Metadata File cannot be parsed - wrong structure."); - $scope.indicatorMetadataImportError = "Struktur der Datei stimmt nicht mit erwartetem Muster überein."; - document.getElementById("indicatorsAddMetadataPre").innerHTML = $scope.indicatorMetadataStructure_pretty; - $("#indicatorAddMetadataImportErrorAlert").show(); - - $scope.$digest(); - } - - $scope.metadata = {}; - $scope.metadata.note = $scope.metadataImportSettings.metadata.note; - $scope.metadata.literature = $scope.metadataImportSettings.metadata.literature; - kommonitorDataExchangeService.updateIntervalOptions.forEach(function(option){ - if(option.apiName === $scope.metadataImportSettings.metadata.updateInterval){ - $scope.metadata.updateInterval = option; - } - }); - $scope.metadata.sridEPSG = $scope.metadataImportSettings.metadata.sridEPSG; - $scope.metadata.datasource = $scope.metadataImportSettings.metadata.datasource; - $scope.metadata.contact = $scope.metadataImportSettings.metadata.contact; - $scope.metadata.lastUpdate = $scope.metadataImportSettings.metadata.lastUpdate; - // initialize date - $('#indicatorAddLastUpdateDatepicker').datepicker('setDate', $scope.metadata.lastUpdate); - - $scope.metadata.description = $scope.metadataImportSettings.metadata.description; - $scope.metadata.databasis = $scope.metadataImportSettings.metadata.databasis; - - $scope.indicatorReferenceDateNote = $scope.metadataImportSettings.referenceDateNote; - $scope.displayOrder = $scope.metadataImportSettings.displayOrder || 0; - - $scope.datasetName = $scope.metadataImportSettings.datasetName; - - $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorAddRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, $scope.metadataImportSettings.allowedRoles); - - - // indicator specific properties - - - $scope.indicatorAbbreviation = $scope.metadataImportSettings.abbreviation; - - for (const indicatorTypeOption of kommonitorDataExchangeService.indicatorTypeOptions) { - if(indicatorTypeOption.apiName === $scope.metadataImportSettings.indicatorType){ - $scope.indicatorType = indicatorTypeOption; - break; - } - } - - for (const indicatorCreationTypeOption of kommonitorDataExchangeService.indicatorCreationTypeOptions) { - if(indicatorCreationTypeOption.apiName === $scope.metadataImportSettings.creationType){ - $scope.indicatorCreationType = indicatorCreationTypeOption; - - if(indicatorCreationTypeOption.apiName === "COMPUTATION"){ - $scope.enableLowestSpatialUnitSelect = true; - } - else{ - $scope.enableLowestSpatialUnitSelect = false; - } - break; - } - } - - $scope.indicatorCharacteristicValue = $scope.metadataImportSettings.characteristicValue; - $scope.isHeadlineIndicator = $scope.metadataImportSettings.isHeadlineIndicator; - $scope.indicatorUnit = $scope.metadataImportSettings.unit; - if(kommonitorDataExchangeService.indicatorUnitOptions.includes($scope.metadataImportSettings.unit)){ - $scope.enableFreeTextUnit = false; - } - else{ - $scope.enableFreeTextUnit = true; - } - - $scope.indicatorProcessDescription = $scope.metadataImportSettings.processDescription; - - $scope.indicatorTagsString_withCommas = undefined; - if($scope.metadataImportSettings.tags && $scope.metadataImportSettings.tags.length > 0){ - $scope.indicatorTagsString_withCommas = ""; - for (let index = 0; index < $scope.metadataImportSettings.tags.length; index++) { - $scope.indicatorTagsString_withCommas += $scope.metadataImportSettings.tags[index]; - - if(index < $scope.metadataImportSettings.tags.length - 1){ - $scope.indicatorTagsString_withCommas += ","; - } - } - } - - $scope.indicatorInterpretation = $scope.metadataImportSettings.interpretation; - $scope.indicatorLowestSpatialUnitMetadataObjectForComputation = kommonitorDataExchangeService.availableSpatialUnits[0]; - - for (let i = 0; i < kommonitorDataExchangeService.availableSpatialUnits.length; i++) { - const spatialUnitMetadata = kommonitorDataExchangeService.availableSpatialUnits[i]; - - if(spatialUnitMetadata.spatialUnitLevel === $scope.metadataImportSettings.lowestSpatialUnitForComputation){ - $scope.indicatorLowestSpatialUnitMetadataObjectForComputation = spatialUnitMetadata; - break; - } - } - - var topicHierarchy = kommonitorDataExchangeService.getTopicHierarchyForTopicId($scope.metadataImportSettings.topicReference); - - if(topicHierarchy && topicHierarchy[0]){ - $scope.indicatorTopic_mainTopic = topicHierarchy[0]; - } - if(topicHierarchy && topicHierarchy[1]){ - $scope.indicatorTopic_subTopic = topicHierarchy[1]; - } - if(topicHierarchy && topicHierarchy[2]){ - $scope.indicatorTopic_subsubTopic = topicHierarchy[2]; - } - if(topicHierarchy && topicHierarchy[3]){ - $scope.indicatorTopic_subsubsubTopic = topicHierarchy[3]; - } - - $scope.indicatorNameFilter = undefined; - $scope.tmpIndicatorReference_selectedIndicatorMetadata = undefined; - $scope.tmpIndicatorReference_referenceDescription = undefined; - - // tmp array to display indicatorReferences - $scope.indicatorReferences_adminView = []; - // array for API request (has less information per item) - $scope.indicatorReferences_apiRequest = []; - if($scope.metadataImportSettings.refrencesToOtherIndicators && $scope.metadataImportSettings.refrencesToOtherIndicators.length > 0){ - for (const indicatorReference of $scope.metadataImportSettings.refrencesToOtherIndicators) { - var indicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(indicatorReference.indicatorId); - var referenceEntry = { - "referencedIndicatorName": indicatorMetadata.indicatorName, - "referencedIndicatorId": indicatorMetadata.indicatorId, - "referencedIndicatorAbbreviation": indicatorMetadata.abbreviation, - "referencedIndicatorDescription": indicatorReference.referenceDescription - }; - $scope.indicatorReferences_adminView.push(referenceEntry); - } - - } - - $scope.georesourceNameFilter = undefined; - $scope.tmpGeoresourceReference_selectedGeoresourceMetadata = undefined; - $scope.tmpGeoresourceReference_referenceDescription = undefined; - // tmp array to display georesourceReferences - $scope.georesourceReferences_adminView = []; - // array for API request (has less information per item) - $scope.georesourceReferences_apiRequest = []; - - if($scope.metadataImportSettings.refrencesToGeoresources && $scope.metadataImportSettings.refrencesToGeoresources.length > 0){ - for (const georesourceReference of $scope.metadataImportSettings.refrencesToGeoresources) { - var georesourceMetadata = kommonitorDataExchangeService.getGeoresourceMetadataById(georesourceReference.georesourceId); - var geo_referenceEntry = { - "referencedGeoresourceName": georesourceMetadata.datasetName, - "referencedGeoresourceId": georesourceMetadata.georesourceId, - "referencedGeoresourceDescription": georesourceReference.referenceDescription - }; - $scope.georesourceReferences_adminView.push(geo_referenceEntry); - } - - } - - $scope.numClassesArray = [3,4,5,6,7,8]; - $scope.numClasses = $scope.numClassesArray[2]; - // instantiate with palette 'Blues' - $scope.selectedColorBrewerPaletteEntry = $scope.colorbrewerPalettes[13]; - - for (const colorbrewerPalette of $scope.colorbrewerPalettes) { - if (colorbrewerPalette.paletteName === $scope.metadataImportSettings.defaultClassificationMapping.colorBrewerSchemeName){ - $scope.selectedColorBrewerPaletteEntry = colorbrewerPalette; - break; - } - } - - $scope.$digest(); - }; - - $scope.onExportIndicatorAddMetadataTemplate = function(){ - - var metadataJSON = JSON.stringify($scope.indicatorMetadataStructure); - - var fileName = "Indikator_Metadaten_Vorlage_Export.json"; - - var blob = new Blob([metadataJSON], {type: "application/json"}); - var data = URL.createObjectURL(blob); - - var a = document.createElement('a'); - a.download = fileName; - a.href = data; - a.textContent = "JSON"; - a.target = "_blank"; - a.rel = "noopener noreferrer"; - a.click(); - - a.remove(); - }; - - $scope.onExportIndicatorAddMetadata = function(){ - var metadataExport = $scope.indicatorMetadataStructure; - - metadataExport.metadata.note = $scope.metadata.note || ""; - metadataExport.metadata.literature = $scope.metadata.literature || ""; - metadataExport.metadata.sridEPSG = $scope.metadata.sridEPSG || ""; - metadataExport.metadata.datasource = $scope.metadata.datasource || ""; - metadataExport.metadata.contact = $scope.metadata.contact || ""; - metadataExport.metadata.lastUpdate = $scope.metadata.lastUpdate || ""; - metadataExport.metadata.description = $scope.metadata.description || ""; - metadataExport.metadata.databasis = $scope.metadata.databasis || ""; - metadataExport.datasetName = $scope.datasetName || ""; - - metadataExport.referenceDateNote = $scope.indicatorReferenceDateNote || ""; - metadataExport.displayOrder = $scope.displayOrder || 0; - - metadataExport.allowedRoles = []; - - let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); - for (const roleId of roleIds) { - metadataExport.allowedRoles.push(roleId); - } - - if($scope.metadata.updateInterval){ - metadataExport.metadata.updateInterval = $scope.metadata.updateInterval.apiName; - } - - var name = $scope.datasetName; - - // indicator specific properties - - metadataExport.abbreviation = $scope.indicatorAbbreviation || ""; - metadataExport.indicatorType = $scope.indicatorType ? $scope.indicatorType.apiName : ""; - metadataExport.creationType = $scope.indicatorCreationType ? $scope.indicatorCreationType.apiName : ""; - - metadataExport.characteristicValue = $scope.indicatorCharacteristicValue || ""; - metadataExport.isHeadlineIndicator = $scope.isHeadlineIndicator || false; - metadataExport.unit = $scope.indicatorUnit || ""; - metadataExport.processDescription = $scope.indicatorProcessDescription || ""; - metadataExport.tags = []; - - if($scope.indicatorTagsString_withCommas){ - var tags_splitted = $scope.indicatorTagsString_withCommas.split(","); - for (const tagString of tags_splitted) { - metadataExport.tags.push(tagString.trim()); - } - } - - metadataExport.interpretation = $scope.indicatorInterpretation || ""; - metadataExport.lowestSpatialUnitForComputation = $scope.indicatorLowestSpatialUnitMetadataObjectForComputation? $scope.indicatorLowestSpatialUnitMetadataObjectForComputation.spatialUnitLevel : ""; - - if($scope.indicatorTopic_subsubsubTopic){ - metadataExport.topicReference = $scope.indicatorTopic_subsubsubTopic.topicId; - } - else if($scope.indicatorTopic_subsubTopic){ - metadataExport.topicReference = $scope.indicatorTopic_subsubTopic.topicId; - } - else if($scope.indicatorTopic_subTopic){ - metadataExport.topicReference = $scope.indicatorTopic_subTopic.topicId; - } - else if($scope.indicatorTopic_mainTopic){ - metadataExport.topicReference = $scope.indicatorTopic_mainTopic.topicId; - } - else { - metadataExport.topicReference = ""; - } - - metadataExport.refrencesToOtherIndicators = []; - - if($scope.indicatorReferences_adminView && $scope.indicatorReferences_adminView.length > 0){ - metadataExport.refrencesToOtherIndicators = []; - - for (const indicRef of $scope.indicatorReferences_adminView) { - metadataExport.refrencesToOtherIndicators.push({ - "indicatorId": indicRef.referencedIndicatorId, - "referenceDescription": indicRef.referencedIndicatorDescription - }); - } - } - - metadataExport.refrencesToGeoresources = []; - - if($scope.georesourceReferences_adminView && $scope.georesourceReferences_adminView.length > 0){ - metadataExport.refrencesToGeoresources = []; - - for (const geoRef of $scope.georesourceReferences_adminView) { - metadataExport.refrencesToGeoresources.push({ - "georesourceId": geoRef.referencedGeoresourceId, - "referenceDescription": geoRef.referencedGeoresourceDescription - }); - } - } - - var defaultClassificationMapping = { - "colorBrewerSchemeName" : $scope.selectedColorBrewerPaletteEntry ? $scope.selectedColorBrewerPaletteEntry.paletteName : "Blues", - "items": [ - { - "defaultColorAsHex": "#edf8e9", - "defaultCustomRating": "sehr niedrig" - }, - { - "defaultColorAsHex": "#bae4b3", - "defaultCustomRating": "niedrig" - }, - { - "defaultColorAsHex": "#74c476", - "defaultCustomRating": "mittel" - }, - { - "defaultColorAsHex": "#31a354", - "defaultCustomRating": "hoch" - }, - { - "defaultColorAsHex": "#006d2c", - "defaultCustomRating": "sehr hoch" - } - ] - }; - - metadataExport.defaultClassificationMapping = defaultClassificationMapping; - - - var metadataJSON = JSON.stringify(metadataExport); - - var fileName = "Indikatoren_Metadaten_Export"; - - if (name){ - fileName += "-" + name; - } - - fileName += ".json"; - - var blob = new Blob([metadataJSON], {type: "application/json"}); - var data = URL.createObjectURL(blob); - - var a = document.createElement('a'); - a.download = fileName; - a.href = data; - a.textContent = "JSON"; - a.target = "_blank"; - a.rel = "noopener noreferrer"; - a.click(); - - a.remove(); - }; - - $scope.hideSuccessAlert = function(){ - $("#indicatorAddSuccessAlert").hide(); - }; - - $scope.hideErrorAlert = function(){ - $("#indicatorAddErrorAlert").hide(); - }; - - $scope.hideMetadataErrorAlert = function(){ - $("#indicatorAddMetadataImportErrorAlert").hide(); - }; - - kommonitorMultiStepFormHelperService.registerClickHandler(); - - } -]}); + templateUrl: "components/kommonitorAdmin/adminIndicatorsManagement/indicatorAddModal/indicator-add-modal.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorImporterHelperService', '$scope', '$rootScope', '$http', '$timeout', + '__env', 'kommonitorMultiStepFormHelperService', 'kommonitorDataGridHelperService', + function IndicatorAddModalAddModalController(kommonitorDataExchangeService, kommonitorImporterHelperService, $scope, $rootScope, $http, $timeout, __env, kommonitorMultiStepFormHelperService, kommonitorDataGridHelperService) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorImporterHelperServiceInstance = kommonitorImporterHelperService; + /* POST BODY + { + "refrencesToOtherIndicators": [ + { + "referenceDescription": "referenceDescription", + "indicatorId": "indicatorId" + }, + { + "referenceDescription": "referenceDescription", + "indicatorId": "indicatorId" + } + ], + "metadata": { + "note": "note", + "literature": "literature", + "updateInterval": "ARBITRARY", + "sridEPSG": 0.8008281904610115, + "datasource": "datasource", + "contact": "contact", + "lastUpdate": "2000-01-23", + "description": "description", + "databasis": "databasis" + }, + "allowedRoles": [ + "allowedRoles", + "allowedRoles" + ], + "datasetName": "datasetName", + "abbreviation": "abbreviation", + "characteristicValue": "characteristicValue", + "tags": [ + "tags", + "tags" + ], + "creationType": "INSERTION", + "unit": "unit", + "topicReference": "topicReference", + "referencDateNote": "note", + "displayOrder": 0, + "refrencesToGeoresources": [ + { + "referenceDescription": "referenceDescription", + "georesourceId": "georesourceId" + }, + { + "referenceDescription": "referenceDescription", + "georesourceId": "georesourceId" + } + ], + "indicatorType": "STATUS_ABSOLUTE", + "interpretation": "interpretation", + "isHeadlineIndicator": false, + "processDescription": "processDescription", + "lowestSpatialUnitForComputation": "lowestSpatialUnitForComputation", + "defaultClassificationMapping": { + "colorBrewerSchemeName": "colorBrewerSchemeName", + "items": [ + { + "defaultCustomRating": "defaultCustomRating", + "defaultColorAsHex": "defaultColorAsHex" + }, + { + "defaultCustomRating": "defaultCustomRating", + "defaultColorAsHex": "defaultColorAsHex" + } + ] + } + } + */ + //Date picker + $('#indicatorAddLastUpdateDatepicker').datepicker(kommonitorDataExchangeService.datePickerOptions); + $scope.indicatorMetadataStructure = { + "metadata": { + "note": "an optional note", + "literature": "optional text about literature", + "updateInterval": "YEARLY|HALF_YEARLY|QUARTERLY|MONTHLY|ARBITRARY", + "sridEPSG": 4326, + "datasource": "text about data source", + "contact": "text about contact details", + "lastUpdate": "YYYY-MM-DD", + "description": "description about spatial unit dataset", + "databasis": "text about data basis", + }, + "allowedRoles": ['roleId'], + "refrencesToOtherIndicators": [ + { + "referenceDescription": "description about the reference", + "indicatorId": "ID of referenced indicator dataset" + } + ], + "refrencesToGeoresources": [ + { + "referenceDescription": "description about the reference", + "georesourceId": "ID of referenced georesource dataset" + } + ], + "datasetName": "Name of indicator dataset", + "abbreviation": "optional abbreviation of the indicator dataset", + "characteristicValue": "if the same datasetName is used for different indicators, the optional characteristicValue parameter may serve to distinguish between them (i.e. Habitants - male, Habitants - female, Habitants - diverse)", + "tags": [ + "optinal list of tags; each tag is a free text tag" + ], + "creationType": "INSERTION|COMPUTATION <-- enum parameter controls whether each timestamp must be updated manually (INSERTION) or if KomMonitor shall compute the indicator values for respective timestamps based on script file (COMPUTATION)", + "unit": "unit of the indicator", + "topicReference": "ID of the respective main/sub topic instance", + "indicatorType": "STATUS_ABSOLUTE|STATUS_RELATIVE|DYNAMIC_ABSOLUTE|DYNAMIC_RELATIVE|STATUS_STANDARDIZED|DYNAMIC_STANDARDIZED", + "interpretation": "interpretation hints for the user to better understand the indicator values", + "isHeadlineIndicator": "boolean parameter to indicate if indicator is a headline indicator", + "processDescription": "detailed description about the computation/creation of the indicator", + "referenceDateNote": "optional note for indicator reference date", + "displayOrder": 0, + "lowestSpatialUnitForComputation": "the name of the lowest possible spatial unit for which an indicator of creationType=COMPUTATION may be computed. All other superior spatial units will be aggregated automatically", + "defaultClassificationMapping": { + "colorBrewerSchemeName": "schema name of colorBrewer colorPalette to use for classification", + "items": [ + { + "defaultCustomRating": "a string to rate indicator values of this class", + "defaultColorAsHex": "color as hexadecimal value" + } + ] + } + }; + $scope.indicatorMetadataStructure_pretty = kommonitorDataExchangeService.syntaxHighlightJSON($scope.indicatorMetadataStructure); + $scope.indicatorMappingConfigStructure_pretty = kommonitorDataExchangeService.syntaxHighlightJSON(kommonitorImporterHelperService.mappingConfigStructure_indicator); + $scope.metadataImportSettings; + $scope.indicatorMetadataImportError; + $scope.indicatorAddMetadataImportErrorAlert; + $scope.datasetName = undefined; + $scope.datasetNameInvalid = false; + $scope.metadata = {}; + $scope.metadata.note = undefined; + $scope.metadata.literature = undefined; + $scope.metadata.updateInterval = undefined; + $scope.metadata.sridEPSG = undefined; + $scope.metadata.datasource = undefined; + $scope.metadata.databasis = undefined; + $scope.metadata.contact = undefined; + $scope.metadata.lastUpdate = undefined; + $scope.metadata.description = undefined; + $scope.roleManagementTableOptions = undefined; + $scope.$on("availableRolesUpdate", function (event) { + refreshRoles(); + }); + // make sure that initial fetching of availableRoles has happened + $scope.$on("initialMetadataLoadingCompleted", function (event) { + refreshRoles(); + }); + function refreshRoles() { + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorAddRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, kommonitorDataExchangeService.getCurrentKomMonitorLoginRoleIds()); + } + $scope.datasetName = undefined; + $scope.indicatorAbbreviation = undefined; + $scope.indicatorType = undefined; + $scope.indicatorCharacteristicValue = undefined; + $scope.isHeadlineIndicator = false; + $scope.indicatorUnit = undefined; + $scope.enableFreeTextUnit = false; + $scope.indicatorProcessDescription = undefined; + $scope.indicatorTagsString_withCommas = undefined; + $scope.indicatorInterpretation = undefined; + $scope.indicatorCreationType = undefined; + $scope.indicatorLowestSpatialUnitMetadataObjectForComputation = kommonitorDataExchangeService.availableSpatialUnits[0]; + $scope.enableLowestSpatialUnitSelect = false; + $scope.indicatorReferenceDateNote = undefined; + $scope.displayOrder = 0; + $scope.indicatorTopic_mainTopic = undefined; + $scope.indicatorTopic_subTopic = undefined; + $scope.indicatorTopic_subsubTopic = undefined; + $scope.indicatorTopic_subsubsubTopic = undefined; + $scope.indicatorNameFilter = undefined; + $scope.tmpIndicatorReference_selectedIndicatorMetadata = undefined; + $scope.tmpIndicatorReference_referenceDescription = undefined; + // tmp array to display indicatorReferences + $scope.indicatorReferences_adminView = []; + // array for API request (has less information per item) + $scope.indicatorReferences_apiRequest = []; + $scope.georesourceNameFilter = undefined; + $scope.tmpGeoresourceReference_selectedGeoresourceMetadata = undefined; + $scope.tmpGeoresourceReference_referenceDescription = undefined; + // tmp array to display georesourceReferences + $scope.georesourceReferences_adminView = []; + // array for API request (has less information per item) + $scope.georesourceReferences_apiRequest = []; + $scope.numClassesArray = [3, 4, 5, 6, 7, 8]; + $scope.numClasses = $scope.numClassesArray[2]; + $scope.selectedColorBrewerPaletteEntry = undefined; + $scope.postBody_indicators = undefined; + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + $scope.loadingData = false; + $scope.colorbrewerSchemes = colorbrewer; + $scope.colorbreweSchemeName_dynamicIncrease = __env.defaultColorBrewerPaletteForBalanceIncreasingValues; + $scope.colorbreweSchemeName_dynamicDecrease = __env.defaultColorBrewerPaletteForBalanceDecreasingValues; + $scope.colorbrewerPalettes = []; + $scope.instantiateColorBrewerPalettes = function () { + for (const key in colorbrewer) { + if (colorbrewer.hasOwnProperty(key)) { + const colorPalettes = colorbrewer[key]; + var paletteEntry = { + "paletteName": key, + "paletteArrayObject": colorPalettes + }; + $scope.colorbrewerPalettes.push(paletteEntry); + } + } + // instantiate with palette 'Blues' + $scope.selectedColorBrewerPaletteEntry = $scope.colorbrewerPalettes[13]; + }; + $scope.instantiateColorBrewerPalettes(); + $scope.resetIndicatorAddForm = function () { + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + $scope.datasetName = undefined; + $scope.datasetNameInvalid = false; + $scope.metadata = {}; + $scope.metadata.note = undefined; + $scope.metadata.literature = undefined; + $scope.metadata.updateInterval = undefined; + $scope.metadata.sridEPSG = undefined; + $scope.metadata.datasource = undefined; + $scope.metadata.databasis = undefined; + $scope.metadata.contact = undefined; + $scope.metadata.lastUpdate = undefined; + $scope.metadata.description = undefined; + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorAddRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, kommonitorDataExchangeService.getCurrentKomMonitorLoginRoleIds()); + $scope.datasetName = undefined; + $scope.indicatorAbbreviation = undefined; + $scope.indicatorType = kommonitorDataExchangeService.indicatorTypeOptions[0]; + $scope.indicatorCharacteristicValue = undefined; + $scope.isHeadlineIndicator = false; + $scope.indicatorUnit = undefined; + $scope.enableFreeTextUnit = false; + $scope.indicatorProcessDescription = undefined; + $scope.indicatorTagsString_withCommas = undefined; + $scope.indicatorInterpretation = undefined; + $scope.indicatorCreationType = kommonitorDataExchangeService.indicatorCreationTypeOptions[0]; + $scope.indicatorLowestSpatialUnitMetadataObjectForComputation = kommonitorDataExchangeService.availableSpatialUnits[0]; + $scope.enableLowestSpatialUnitSelect = false; + $scope.indicatorReferenceDateNote = undefined; + $scope.displayOrder = 0; + $scope.indicatorTopic_mainTopic = undefined; + $scope.indicatorTopic_subTopic = undefined; + $scope.indicatorTopic_subsubTopic = undefined; + $scope.indicatorTopic_subsubsubTopic = undefined; + $scope.indicatorNameFilter = undefined; + $scope.tmpIndicatorReference_selectedIndicatorMetadata = undefined; + $scope.tmpIndicatorReference_referenceDescription = undefined; + // tmp array to display indicatorReferences + $scope.indicatorReferences_adminView = []; + // array for API request (has less information per item) + $scope.indicatorReferences_apiRequest = []; + $scope.georesourceNameFilter = undefined; + $scope.tmpGeoresourceReference_selectedGeoresourceMetadata = undefined; + $scope.tmpGeoresourceReference_referenceDescription = undefined; + // tmp array to display georesourceReferences + $scope.georesourceReferences_adminView = []; + // array for API request (has less information per item) + $scope.georesourceReferences_apiRequest = []; + $scope.numClassesArray = [3, 4, 5, 6, 7, 8]; + $scope.numClasses = $scope.numClassesArray[2]; + $scope.selectedColorBrewerPaletteEntry = $scope.colorbrewerPalettes[13]; + $scope.postBody_indicators = undefined; + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.onClickColorBrewerEntry = function (colorPaletteEntry) { + $scope.selectedColorBrewerPaletteEntry = colorPaletteEntry; + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.onAddOrUpdateIndicatorReference = function () { + var tmpIndicatorReference_adminView = { + "referencedIndicatorName": $scope.tmpIndicatorReference_selectedIndicatorMetadata.indicatorName, + "referencedIndicatorId": $scope.tmpIndicatorReference_selectedIndicatorMetadata.indicatorId, + "referencedIndicatorAbbreviation": $scope.tmpIndicatorReference_selectedIndicatorMetadata.abbreviation, + "referencedIndicatorDescription": $scope.tmpIndicatorReference_referenceDescription + }; + var processed = false; + for (let index = 0; index < $scope.indicatorReferences_adminView.length; index++) { + var indicatorReference_adminView = $scope.indicatorReferences_adminView[index]; + if (indicatorReference_adminView.referencedIndicatorId === tmpIndicatorReference_adminView.referencedIndicatorId) { + // replace object + $scope.indicatorReferences_adminView[index] = tmpIndicatorReference_adminView; + processed = true; + break; + } + } + if (!processed) { + // new entry + $scope.indicatorReferences_adminView.push(tmpIndicatorReference_adminView); + } + $scope.tmpIndicatorReference_selectedIndicatorMetadata = undefined; + $scope.tmpIndicatorReference_referenceDescription = undefined; + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.onClickEditIndicatorReference = function (indicatorReference_adminView) { + $scope.tmpIndicatorReference_selectedIndicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(indicatorReference_adminView.referencedIndicatorId); + $scope.tmpIndicatorReference_referenceDescription = indicatorReference_adminView.referencedIndicatorDescription; + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.onClickDeleteIndicatorReference = function (indicatorReference_adminView) { + for (let index = 0; index < $scope.indicatorReferences_adminView.length; index++) { + if ($scope.indicatorReferences_adminView[index].referencedIndicatorId === indicatorReference_adminView.referencedIndicatorId) { + // remove object + $scope.indicatorReferences_adminView.splice(index, 1); + break; + } + } + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.onAddOrUpdateGeoresourceReference = function () { + var tmpGeoresourceReference_adminView = { + "referencedGeoresourceName": $scope.tmpGeoresourceReference_selectedGeoresourceMetadata.datasetName, + "referencedGeoresourceId": $scope.tmpGeoresourceReference_selectedGeoresourceMetadata.georesourceId, + "referencedGeoresourceDescription": $scope.tmpGeoresourceReference_referenceDescription + }; + var processed = false; + for (let index = 0; index < $scope.georesourceReferences_adminView.length; index++) { + var georesourceReference_adminView = $scope.georesourceReferences_adminView[index]; + if (georesourceReference_adminView.referencedGeoresourceId === tmpGeoresourceReference_adminView.referencedGeoresourceId) { + // replace object + $scope.georesourceReferences_adminView[index] = tmpGeoresourceReference_adminView; + processed = true; + break; + } + } + if (!processed) { + // new entry + $scope.georesourceReferences_adminView.push(tmpGeoresourceReference_adminView); + } + $scope.tmpGeoresourceReference_selectedGeoresourceMetadata = undefined; + $scope.tmpGeoresourceReference_referenceDescription = undefined; + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.onClickEditGeoresourceReference = function (georesourceReference_adminView) { + $scope.tmpGeoresourceReference_selectedGeoresourceMetadata = kommonitorDataExchangeService.getGeoresourceMetadataById(georesourceReference_adminView.referencedGeoresourceId); + $scope.tmpGeoresourceReference_referenceDescription = georesourceReference_adminView.referencedGeoresourceDescription; + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.onClickDeleteGeoresourceReference = function (georesourceReference_adminView) { + for (let index = 0; index < $scope.georesourceReferences_adminView.length; index++) { + if ($scope.georesourceReferences_adminView[index].referencedGeoresourceId === georesourceReference_adminView.referencedGeoresourceId) { + // remove object + $scope.georesourceReferences_adminView.splice(index, 1); + break; + } + } + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.onChangeCreationType = function () { + if ($scope.indicatorCreationType.apiName === "COMPUTATION") { + $scope.enableLowestSpatialUnitSelect = true; + } + else { + $scope.enableLowestSpatialUnitSelect = false; + } + }; + $scope.onChangeIndicatorUnit = function () { + if ($scope.indicatorUnit.includes("Freitext")) { + $scope.enableFreeTextUnit = true; + } + else { + $scope.enableFreeTextUnit = false; + } + }; + $scope.checkDatasetName = function () { + $scope.datasetNameInvalid = false; + kommonitorDataExchangeService.availableIndicators.forEach(function (indicator) { + if (indicator.indicatorName === $scope.datasetName) { + $scope.datasetNameInvalid = true; + return; + } + }); + }; + $scope.buildPostBody_indicators = function () { + var postBody = { + "metadata": { + "note": $scope.metadata.note || null, + "literature": $scope.metadata.literature || null, + "updateInterval": $scope.metadata.updateInterval.apiName, + "sridEPSG": $scope.metadata.sridEPSG || 4326, + "datasource": $scope.metadata.datasource, + "contact": $scope.metadata.contact, + "lastUpdate": $scope.metadata.lastUpdate, + "description": $scope.metadata.description || null, + "databasis": $scope.metadata.databasis || null + }, + "refrencesToOtherIndicators": [], + "allowedRoles": [], + "datasetName": $scope.datasetName, + "abbreviation": $scope.indicatorAbbreviation || null, + "characteristicValue": $scope.indicatorCharacteristicValue || null, + "tags": [], + "creationType": $scope.indicatorCreationType.apiName, + "unit": $scope.indicatorUnit, + "topicReference": "", + "refrencesToGeoresources": [], + "indicatorType": $scope.indicatorType.apiName, + "interpretation": $scope.indicatorInterpretation || "", + "isHeadlineIndicator": $scope.isHeadlineIndicator || false, + "processDescription": $scope.indicatorProcessDescription || "", + "referenceDateNote": $scope.indicatorReferenceDateNote || "", + "displayOrder": $scope.displayOrder, + "lowestSpatialUnitForComputation": $scope.indicatorLowestSpatialUnitMetadataObjectForComputation ? $scope.indicatorLowestSpatialUnitMetadataObjectForComputation.spatialUnitLevel : null, + "defaultClassificationMapping": { + "colorBrewerSchemeName": $scope.selectedColorBrewerPaletteEntry.paletteName, + "items": [ + { + "defaultColorAsHex": "#edf8e9", + "defaultCustomRating": "sehr niedrig" + }, + { + "defaultColorAsHex": "#bae4b3", + "defaultCustomRating": "niedrig" + }, + { + "defaultColorAsHex": "#74c476", + "defaultCustomRating": "mittel" + }, + { + "defaultColorAsHex": "#31a354", + "defaultCustomRating": "hoch" + }, + { + "defaultColorAsHex": "#006d2c", + "defaultCustomRating": "sehr hoch" + } + ] + } + }; + let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); + for (const roleId of roleIds) { + postBody.allowedRoles.push(roleId); + } + // TAGS + if ($scope.indicatorTagsString_withCommas) { + var tags_splitted = $scope.indicatorTagsString_withCommas.split(","); + for (const tagString of tags_splitted) { + postBody.tags.push(tagString.trim()); + } + } + // TOPIC REFERENCE + if ($scope.indicatorTopic_subsubsubTopic) { + postBody.topicReference = $scope.indicatorTopic_subsubsubTopic.topicId; + } + else if ($scope.indicatorTopic_subsubTopic) { + postBody.topicReference = $scope.indicatorTopic_subsubTopic.topicId; + } + else if ($scope.indicatorTopic_subTopic) { + postBody.topicReference = $scope.indicatorTopic_subTopic.topicId; + } + else if ($scope.indicatorTopic_mainTopic) { + postBody.topicReference = $scope.indicatorTopic_mainTopic.topicId; + } + else { + postBody.topicReference = ""; + } + // REFERENCES + if ($scope.indicatorReferences_adminView && $scope.indicatorReferences_adminView.length > 0) { + postBody.refrencesToOtherIndicators = []; + for (const indicRef of $scope.indicatorReferences_adminView) { + postBody.refrencesToOtherIndicators.push({ + "indicatorId": indicRef.referencedIndicatorId, + "referenceDescription": indicRef.referencedIndicatorDescription + }); + } + } + if ($scope.georesourceReferences_adminView && $scope.georesourceReferences_adminView.length > 0) { + postBody.refrencesToGeoresources = []; + for (const geoRef of $scope.georesourceReferences_adminView) { + postBody.refrencesToGeoresources.push({ + "georesourceId": geoRef.referencedGeoresourceId, + "referenceDescription": geoRef.referencedGeoresourceDescription + }); + } + } + return postBody; + }; + $scope.addIndicator = async function () { + $timeout(function () { + $scope.loadingData = true; + }); + var postBody = $scope.buildPostBody_indicators(); + return await $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/indicators", + method: "POST", + data: postBody, + headers: { + 'Content-Type': "application/json" + } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + $rootScope.$broadcast("refreshIndicatorOverviewTable", "add", response.data.indicatorId); + // refresh all admin dashboard diagrams due to modified metadata + $timeout(function () { + $rootScope.$broadcast("refreshAdminDashboardDiagrams"); + }, 500); + $scope.successMessagePart = $scope.datasetName; + $scope.importedFeatures = []; + $("#indicatorAddSuccessAlert").show(); + $scope.loadingData = false; + }, function errorCallback(error) { + console.error("Error while adding computable indicatorMetadata service."); + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + $("#indicatorAddErrorAlert").show(); + $scope.loadingData = false; + setTimeout(() => { + $scope.$digest(); + }, 250); + }); + }; + $scope.onImportIndicatorAddMetadata = function () { + $scope.indicatorMetadataImportError = ""; + $("#indicatorMetadataImportFile").files = []; + // trigger file chooser + $("#indicatorMetadataImportFile").click(); + }; + $(document).on("change", "#indicatorMetadataImportFile", function () { + console.log("Importing Indicator metadata for Add Indicator Form"); + // get the file + var file = document.getElementById('indicatorMetadataImportFile').files[0]; + $scope.parseMetadataFromFile(file); + }); + $scope.parseMetadataFromFile = function (file) { + var fileReader = new FileReader(); + fileReader.onload = function (event) { + try { + $scope.parseFromMetadataFile(event); + } + catch (error) { + console.error(error); + console.error("Uploaded Metadata File cannot be parsed."); + $scope.indicatorMetadataImportError = "Uploaded Metadata File cannot be parsed correctly"; + document.getElementById("indicatorsAddMetadataPre").innerHTML = $scope.indicatorMetadataStructure_pretty; + $("#indicatorAddMetadataImportErrorAlert").show(); + $scope.$digest(); + } + }; + // Read in the image file as a data URL. + fileReader.readAsText(file); + }; + $scope.parseFromMetadataFile = function (event) { + // $scope.geoJsonString = event.target.result; + $scope.metadataImportSettings = JSON.parse(event.target.result); + if (!$scope.metadataImportSettings.metadata) { + console.error("uploaded Metadata File cannot be parsed - wrong structure."); + $scope.indicatorMetadataImportError = "Struktur der Datei stimmt nicht mit erwartetem Muster überein."; + document.getElementById("indicatorsAddMetadataPre").innerHTML = $scope.indicatorMetadataStructure_pretty; + $("#indicatorAddMetadataImportErrorAlert").show(); + $scope.$digest(); + } + $scope.metadata = {}; + $scope.metadata.note = $scope.metadataImportSettings.metadata.note; + $scope.metadata.literature = $scope.metadataImportSettings.metadata.literature; + kommonitorDataExchangeService.updateIntervalOptions.forEach(function (option) { + if (option.apiName === $scope.metadataImportSettings.metadata.updateInterval) { + $scope.metadata.updateInterval = option; + } + }); + $scope.metadata.sridEPSG = $scope.metadataImportSettings.metadata.sridEPSG; + $scope.metadata.datasource = $scope.metadataImportSettings.metadata.datasource; + $scope.metadata.contact = $scope.metadataImportSettings.metadata.contact; + $scope.metadata.lastUpdate = $scope.metadataImportSettings.metadata.lastUpdate; + // initialize date + $('#indicatorAddLastUpdateDatepicker').datepicker('setDate', $scope.metadata.lastUpdate); + $scope.metadata.description = $scope.metadataImportSettings.metadata.description; + $scope.metadata.databasis = $scope.metadataImportSettings.metadata.databasis; + $scope.indicatorReferenceDateNote = $scope.metadataImportSettings.referenceDateNote; + $scope.displayOrder = $scope.metadataImportSettings.displayOrder || 0; + $scope.datasetName = $scope.metadataImportSettings.datasetName; + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorAddRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, $scope.metadataImportSettings.allowedRoles); + // indicator specific properties + $scope.indicatorAbbreviation = $scope.metadataImportSettings.abbreviation; + for (const indicatorTypeOption of kommonitorDataExchangeService.indicatorTypeOptions) { + if (indicatorTypeOption.apiName === $scope.metadataImportSettings.indicatorType) { + $scope.indicatorType = indicatorTypeOption; + break; + } + } + for (const indicatorCreationTypeOption of kommonitorDataExchangeService.indicatorCreationTypeOptions) { + if (indicatorCreationTypeOption.apiName === $scope.metadataImportSettings.creationType) { + $scope.indicatorCreationType = indicatorCreationTypeOption; + if (indicatorCreationTypeOption.apiName === "COMPUTATION") { + $scope.enableLowestSpatialUnitSelect = true; + } + else { + $scope.enableLowestSpatialUnitSelect = false; + } + break; + } + } + $scope.indicatorCharacteristicValue = $scope.metadataImportSettings.characteristicValue; + $scope.isHeadlineIndicator = $scope.metadataImportSettings.isHeadlineIndicator; + $scope.indicatorUnit = $scope.metadataImportSettings.unit; + if (kommonitorDataExchangeService.indicatorUnitOptions.includes($scope.metadataImportSettings.unit)) { + $scope.enableFreeTextUnit = false; + } + else { + $scope.enableFreeTextUnit = true; + } + $scope.indicatorProcessDescription = $scope.metadataImportSettings.processDescription; + $scope.indicatorTagsString_withCommas = undefined; + if ($scope.metadataImportSettings.tags && $scope.metadataImportSettings.tags.length > 0) { + $scope.indicatorTagsString_withCommas = ""; + for (let index = 0; index < $scope.metadataImportSettings.tags.length; index++) { + $scope.indicatorTagsString_withCommas += $scope.metadataImportSettings.tags[index]; + if (index < $scope.metadataImportSettings.tags.length - 1) { + $scope.indicatorTagsString_withCommas += ","; + } + } + } + $scope.indicatorInterpretation = $scope.metadataImportSettings.interpretation; + $scope.indicatorLowestSpatialUnitMetadataObjectForComputation = kommonitorDataExchangeService.availableSpatialUnits[0]; + for (let i = 0; i < kommonitorDataExchangeService.availableSpatialUnits.length; i++) { + const spatialUnitMetadata = kommonitorDataExchangeService.availableSpatialUnits[i]; + if (spatialUnitMetadata.spatialUnitLevel === $scope.metadataImportSettings.lowestSpatialUnitForComputation) { + $scope.indicatorLowestSpatialUnitMetadataObjectForComputation = spatialUnitMetadata; + break; + } + } + var topicHierarchy = kommonitorDataExchangeService.getTopicHierarchyForTopicId($scope.metadataImportSettings.topicReference); + if (topicHierarchy && topicHierarchy[0]) { + $scope.indicatorTopic_mainTopic = topicHierarchy[0]; + } + if (topicHierarchy && topicHierarchy[1]) { + $scope.indicatorTopic_subTopic = topicHierarchy[1]; + } + if (topicHierarchy && topicHierarchy[2]) { + $scope.indicatorTopic_subsubTopic = topicHierarchy[2]; + } + if (topicHierarchy && topicHierarchy[3]) { + $scope.indicatorTopic_subsubsubTopic = topicHierarchy[3]; + } + $scope.indicatorNameFilter = undefined; + $scope.tmpIndicatorReference_selectedIndicatorMetadata = undefined; + $scope.tmpIndicatorReference_referenceDescription = undefined; + // tmp array to display indicatorReferences + $scope.indicatorReferences_adminView = []; + // array for API request (has less information per item) + $scope.indicatorReferences_apiRequest = []; + if ($scope.metadataImportSettings.refrencesToOtherIndicators && $scope.metadataImportSettings.refrencesToOtherIndicators.length > 0) { + for (const indicatorReference of $scope.metadataImportSettings.refrencesToOtherIndicators) { + var indicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(indicatorReference.indicatorId); + var referenceEntry = { + "referencedIndicatorName": indicatorMetadata.indicatorName, + "referencedIndicatorId": indicatorMetadata.indicatorId, + "referencedIndicatorAbbreviation": indicatorMetadata.abbreviation, + "referencedIndicatorDescription": indicatorReference.referenceDescription + }; + $scope.indicatorReferences_adminView.push(referenceEntry); + } + } + $scope.georesourceNameFilter = undefined; + $scope.tmpGeoresourceReference_selectedGeoresourceMetadata = undefined; + $scope.tmpGeoresourceReference_referenceDescription = undefined; + // tmp array to display georesourceReferences + $scope.georesourceReferences_adminView = []; + // array for API request (has less information per item) + $scope.georesourceReferences_apiRequest = []; + if ($scope.metadataImportSettings.refrencesToGeoresources && $scope.metadataImportSettings.refrencesToGeoresources.length > 0) { + for (const georesourceReference of $scope.metadataImportSettings.refrencesToGeoresources) { + var georesourceMetadata = kommonitorDataExchangeService.getGeoresourceMetadataById(georesourceReference.georesourceId); + var geo_referenceEntry = { + "referencedGeoresourceName": georesourceMetadata.datasetName, + "referencedGeoresourceId": georesourceMetadata.georesourceId, + "referencedGeoresourceDescription": georesourceReference.referenceDescription + }; + $scope.georesourceReferences_adminView.push(geo_referenceEntry); + } + } + $scope.numClassesArray = [3, 4, 5, 6, 7, 8]; + $scope.numClasses = $scope.numClassesArray[2]; + // instantiate with palette 'Blues' + $scope.selectedColorBrewerPaletteEntry = $scope.colorbrewerPalettes[13]; + for (const colorbrewerPalette of $scope.colorbrewerPalettes) { + if (colorbrewerPalette.paletteName === $scope.metadataImportSettings.defaultClassificationMapping.colorBrewerSchemeName) { + $scope.selectedColorBrewerPaletteEntry = colorbrewerPalette; + break; + } + } + $scope.$digest(); + }; + $scope.onExportIndicatorAddMetadataTemplate = function () { + var metadataJSON = JSON.stringify($scope.indicatorMetadataStructure); + var fileName = "Indikator_Metadaten_Vorlage_Export.json"; + var blob = new Blob([metadataJSON], { type: "application/json" }); + var data = URL.createObjectURL(blob); + var a = document.createElement('a'); + a.download = fileName; + a.href = data; + a.textContent = "JSON"; + a.target = "_blank"; + a.rel = "noopener noreferrer"; + a.click(); + a.remove(); + }; + $scope.onExportIndicatorAddMetadata = function () { + var metadataExport = $scope.indicatorMetadataStructure; + metadataExport.metadata.note = $scope.metadata.note || ""; + metadataExport.metadata.literature = $scope.metadata.literature || ""; + metadataExport.metadata.sridEPSG = $scope.metadata.sridEPSG || ""; + metadataExport.metadata.datasource = $scope.metadata.datasource || ""; + metadataExport.metadata.contact = $scope.metadata.contact || ""; + metadataExport.metadata.lastUpdate = $scope.metadata.lastUpdate || ""; + metadataExport.metadata.description = $scope.metadata.description || ""; + metadataExport.metadata.databasis = $scope.metadata.databasis || ""; + metadataExport.datasetName = $scope.datasetName || ""; + metadataExport.referenceDateNote = $scope.indicatorReferenceDateNote || ""; + metadataExport.displayOrder = $scope.displayOrder || 0; + metadataExport.allowedRoles = []; + let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); + for (const roleId of roleIds) { + metadataExport.allowedRoles.push(roleId); + } + if ($scope.metadata.updateInterval) { + metadataExport.metadata.updateInterval = $scope.metadata.updateInterval.apiName; + } + var name = $scope.datasetName; + // indicator specific properties + metadataExport.abbreviation = $scope.indicatorAbbreviation || ""; + metadataExport.indicatorType = $scope.indicatorType ? $scope.indicatorType.apiName : ""; + metadataExport.creationType = $scope.indicatorCreationType ? $scope.indicatorCreationType.apiName : ""; + metadataExport.characteristicValue = $scope.indicatorCharacteristicValue || ""; + metadataExport.isHeadlineIndicator = $scope.isHeadlineIndicator || false; + metadataExport.unit = $scope.indicatorUnit || ""; + metadataExport.processDescription = $scope.indicatorProcessDescription || ""; + metadataExport.tags = []; + if ($scope.indicatorTagsString_withCommas) { + var tags_splitted = $scope.indicatorTagsString_withCommas.split(","); + for (const tagString of tags_splitted) { + metadataExport.tags.push(tagString.trim()); + } + } + metadataExport.interpretation = $scope.indicatorInterpretation || ""; + metadataExport.lowestSpatialUnitForComputation = $scope.indicatorLowestSpatialUnitMetadataObjectForComputation ? $scope.indicatorLowestSpatialUnitMetadataObjectForComputation.spatialUnitLevel : ""; + if ($scope.indicatorTopic_subsubsubTopic) { + metadataExport.topicReference = $scope.indicatorTopic_subsubsubTopic.topicId; + } + else if ($scope.indicatorTopic_subsubTopic) { + metadataExport.topicReference = $scope.indicatorTopic_subsubTopic.topicId; + } + else if ($scope.indicatorTopic_subTopic) { + metadataExport.topicReference = $scope.indicatorTopic_subTopic.topicId; + } + else if ($scope.indicatorTopic_mainTopic) { + metadataExport.topicReference = $scope.indicatorTopic_mainTopic.topicId; + } + else { + metadataExport.topicReference = ""; + } + metadataExport.refrencesToOtherIndicators = []; + if ($scope.indicatorReferences_adminView && $scope.indicatorReferences_adminView.length > 0) { + metadataExport.refrencesToOtherIndicators = []; + for (const indicRef of $scope.indicatorReferences_adminView) { + metadataExport.refrencesToOtherIndicators.push({ + "indicatorId": indicRef.referencedIndicatorId, + "referenceDescription": indicRef.referencedIndicatorDescription + }); + } + } + metadataExport.refrencesToGeoresources = []; + if ($scope.georesourceReferences_adminView && $scope.georesourceReferences_adminView.length > 0) { + metadataExport.refrencesToGeoresources = []; + for (const geoRef of $scope.georesourceReferences_adminView) { + metadataExport.refrencesToGeoresources.push({ + "georesourceId": geoRef.referencedGeoresourceId, + "referenceDescription": geoRef.referencedGeoresourceDescription + }); + } + } + var defaultClassificationMapping = { + "colorBrewerSchemeName": $scope.selectedColorBrewerPaletteEntry ? $scope.selectedColorBrewerPaletteEntry.paletteName : "Blues", + "items": [ + { + "defaultColorAsHex": "#edf8e9", + "defaultCustomRating": "sehr niedrig" + }, + { + "defaultColorAsHex": "#bae4b3", + "defaultCustomRating": "niedrig" + }, + { + "defaultColorAsHex": "#74c476", + "defaultCustomRating": "mittel" + }, + { + "defaultColorAsHex": "#31a354", + "defaultCustomRating": "hoch" + }, + { + "defaultColorAsHex": "#006d2c", + "defaultCustomRating": "sehr hoch" + } + ] + }; + metadataExport.defaultClassificationMapping = defaultClassificationMapping; + var metadataJSON = JSON.stringify(metadataExport); + var fileName = "Indikatoren_Metadaten_Export"; + if (name) { + fileName += "-" + name; + } + fileName += ".json"; + var blob = new Blob([metadataJSON], { type: "application/json" }); + var data = URL.createObjectURL(blob); + var a = document.createElement('a'); + a.download = fileName; + a.href = data; + a.textContent = "JSON"; + a.target = "_blank"; + a.rel = "noopener noreferrer"; + a.click(); + a.remove(); + }; + $scope.hideSuccessAlert = function () { + $("#indicatorAddSuccessAlert").hide(); + }; + $scope.hideErrorAlert = function () { + $("#indicatorAddErrorAlert").hide(); + }; + $scope.hideMetadataErrorAlert = function () { + $("#indicatorAddMetadataImportErrorAlert").hide(); + }; + kommonitorMultiStepFormHelperService.registerClickHandler(); + } + ] +}); +//# sourceMappingURL=indicator-add-modal.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorAddModal/indicator-add-modal.component.js.map b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorAddModal/indicator-add-modal.component.js.map new file mode 100644 index 000000000..d597fdb14 --- /dev/null +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorAddModal/indicator-add-modal.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"indicator-add-modal.component.js","sourceRoot":"","sources":["indicator-add-modal.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,SAAS,CAAC,mBAAmB,EAAE;IAClE,WAAW,EAAG,0GAA0G;IACxH,UAAU,EAAG,CAAC,+BAA+B,EAAE,iCAAiC,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU;QAC5H,OAAO,EAAE,sCAAsC,EAAE,iCAAiC;QAClF,SAAS,mCAAmC,CAAC,6BAA6B,EAAE,+BAA+B,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,Q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AAI,IAAI,CAAC,CAAC,YAAY,CAAC,EAAE,EAAC,IAAI,EAAE,kBAAkB,EAAC,CAAC,CAAC;gBAChE,IAAI,IAAI,GAAI,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;gBAEtC,IAAI,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;gBACpC,CAAC,CAAC,QAAQ,GAAM,QAAQ,CAAC;gBACzB,CAAC,CAAC,IAAI,GAAU,IAAI,CAAC;gBACrB,CAAC,CAAC,WAAW,GAAG,MAAM,CAAC;gBACvB,CAAC,CAAC,MAAM,GAAG,QAAQ,CAAC;gBACpB,CAAC,CAAC,GAAG,GAAG,qBAAqB,CAAC;gBAC9B,CAAC,CAAC,KAAK,EAAE,CAAC;gBAEV,CAAC,CAAC,MAAM,EAAE,CAAC;YACZ,CAAC,CAAC;YAED,MAAM,CAAC,gBAAgB,GAAG;gBACzB,CAAC,CAAC,2BAA2B,CAAC,CAAC,IAAI,EAAE,CAAC;YACvC,CAAC,CAAC;YAEF,MAAM,CAAC,cAAc,GAAG;gBACvB,CAAC,CAAC,yBAAyB,CAAC,CAAC,IAAI,EAAE,CAAC;YACrC,CAAC,CAAC;YAEF,MAAM,CAAC,sBAAsB,GAAG;gBAC/B,CAAC,CAAC,uCAAuC,CAAC,CAAC,IAAI,EAAE,CAAC;YACnD,CAAC,CAAC;YAEF,oCAAoC,CAAC,oBAAoB,EAAE,CAAC;QAE9D,CAAC;KACD;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorAddModal/indicator-add-modal.component.ts b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorAddModal/indicator-add-modal.component.ts new file mode 100644 index 000000000..75b08e2fe --- /dev/null +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorAddModal/indicator-add-modal.component.ts @@ -0,0 +1,1042 @@ +angular.module('indicatorAddModal').component('indicatorAddModal', { + templateUrl : "components/kommonitorAdmin/adminIndicatorsManagement/indicatorAddModal/indicator-add-modal.template.html", + controller : ['kommonitorDataExchangeService', 'kommonitorImporterHelperService', '$scope', '$rootScope', '$http', '$timeout', + '__env', 'kommonitorMultiStepFormHelperService', 'kommonitorDataGridHelperService', + function IndicatorAddModalAddModalController(kommonitorDataExchangeService, kommonitorImporterHelperService, $scope, $rootScope, $http, $timeout, + __env, kommonitorMultiStepFormHelperService, kommonitorDataGridHelperService) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorImporterHelperServiceInstance = kommonitorImporterHelperService; + + /* POST BODY + { + "refrencesToOtherIndicators": [ + { + "referenceDescription": "referenceDescription", + "indicatorId": "indicatorId" + }, + { + "referenceDescription": "referenceDescription", + "indicatorId": "indicatorId" + } + ], + "metadata": { + "note": "note", + "literature": "literature", + "updateInterval": "ARBITRARY", + "sridEPSG": 0.8008281904610115, + "datasource": "datasource", + "contact": "contact", + "lastUpdate": "2000-01-23", + "description": "description", + "databasis": "databasis" + }, + "allowedRoles": [ + "allowedRoles", + "allowedRoles" + ], + "datasetName": "datasetName", + "abbreviation": "abbreviation", + "characteristicValue": "characteristicValue", + "tags": [ + "tags", + "tags" + ], + "creationType": "INSERTION", + "unit": "unit", + "topicReference": "topicReference", + "referencDateNote": "note", + "displayOrder": 0, + "refrencesToGeoresources": [ + { + "referenceDescription": "referenceDescription", + "georesourceId": "georesourceId" + }, + { + "referenceDescription": "referenceDescription", + "georesourceId": "georesourceId" + } + ], + "indicatorType": "STATUS_ABSOLUTE", + "interpretation": "interpretation", + "isHeadlineIndicator": false, + "processDescription": "processDescription", + "lowestSpatialUnitForComputation": "lowestSpatialUnitForComputation", + "defaultClassificationMapping": { + "colorBrewerSchemeName": "colorBrewerSchemeName", + "items": [ + { + "defaultCustomRating": "defaultCustomRating", + "defaultColorAsHex": "defaultColorAsHex" + }, + { + "defaultCustomRating": "defaultCustomRating", + "defaultColorAsHex": "defaultColorAsHex" + } + ] + } + } + */ + + //Date picker + $('#indicatorAddLastUpdateDatepicker').datepicker(kommonitorDataExchangeService.datePickerOptions); + + $scope.indicatorMetadataStructure = { + "metadata": { + "note": "an optional note", + "literature": "optional text about literature", + "updateInterval": "YEARLY|HALF_YEARLY|QUARTERLY|MONTHLY|ARBITRARY", + "sridEPSG": 4326, + "datasource": "text about data source", + "contact": "text about contact details", + "lastUpdate": "YYYY-MM-DD", + "description": "description about spatial unit dataset", + "databasis": "text about data basis", + }, + "allowedRoles": ['roleId'], + "refrencesToOtherIndicators": [ + { + "referenceDescription": "description about the reference", + "indicatorId": "ID of referenced indicator dataset" + } + ], + "refrencesToGeoresources": [ + { + "referenceDescription": "description about the reference", + "georesourceId": "ID of referenced georesource dataset" + } + ], + "datasetName": "Name of indicator dataset", + "abbreviation": "optional abbreviation of the indicator dataset", + "characteristicValue": "if the same datasetName is used for different indicators, the optional characteristicValue parameter may serve to distinguish between them (i.e. Habitants - male, Habitants - female, Habitants - diverse)", + "tags": [ + "optinal list of tags; each tag is a free text tag" + ], + "creationType": "INSERTION|COMPUTATION <-- enum parameter controls whether each timestamp must be updated manually (INSERTION) or if KomMonitor shall compute the indicator values for respective timestamps based on script file (COMPUTATION)", + "unit": "unit of the indicator", + "topicReference": "ID of the respective main/sub topic instance", + "indicatorType": "STATUS_ABSOLUTE|STATUS_RELATIVE|DYNAMIC_ABSOLUTE|DYNAMIC_RELATIVE|STATUS_STANDARDIZED|DYNAMIC_STANDARDIZED", + "interpretation": "interpretation hints for the user to better understand the indicator values", + "isHeadlineIndicator": "boolean parameter to indicate if indicator is a headline indicator", + "processDescription": "detailed description about the computation/creation of the indicator", + "referenceDateNote": "optional note for indicator reference date", + "displayOrder": 0, + "lowestSpatialUnitForComputation": "the name of the lowest possible spatial unit for which an indicator of creationType=COMPUTATION may be computed. All other superior spatial units will be aggregated automatically", + "defaultClassificationMapping": { + "colorBrewerSchemeName": "schema name of colorBrewer colorPalette to use for classification", + "items": [ + { + "defaultCustomRating": "a string to rate indicator values of this class", + "defaultColorAsHex": "color as hexadecimal value" + } + ] + } + }; + + $scope.indicatorMetadataStructure_pretty = kommonitorDataExchangeService.syntaxHighlightJSON($scope.indicatorMetadataStructure); + $scope.indicatorMappingConfigStructure_pretty = kommonitorDataExchangeService.syntaxHighlightJSON(kommonitorImporterHelperService.mappingConfigStructure_indicator); + + + $scope.metadataImportSettings; + $scope.indicatorMetadataImportError; + $scope.indicatorAddMetadataImportErrorAlert; + + $scope.datasetName = undefined; + $scope.datasetNameInvalid = false; + + $scope.metadata = {}; + $scope.metadata.note = undefined; + $scope.metadata.literature = undefined; + $scope.metadata.updateInterval = undefined; + $scope.metadata.sridEPSG = undefined; + $scope.metadata.datasource = undefined; + $scope.metadata.databasis = undefined; + $scope.metadata.contact = undefined; + $scope.metadata.lastUpdate = undefined; + $scope.metadata.description = undefined; + + $scope.roleManagementTableOptions = undefined; + + $scope.$on("availableRolesUpdate", function (event) { + refreshRoles(); + }); + + // make sure that initial fetching of availableRoles has happened + $scope.$on("initialMetadataLoadingCompleted", function (event) { + refreshRoles(); + }); + + function refreshRoles() { + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorAddRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, kommonitorDataExchangeService.getCurrentKomMonitorLoginRoleIds()); + } + + $scope.datasetName = undefined; + $scope.indicatorAbbreviation = undefined; + $scope.indicatorType = undefined; + $scope.indicatorCharacteristicValue = undefined; + $scope.isHeadlineIndicator = false; + $scope.indicatorUnit = undefined; + $scope.enableFreeTextUnit = false; + $scope.indicatorProcessDescription = undefined; + $scope.indicatorTagsString_withCommas = undefined; + $scope.indicatorInterpretation = undefined; + $scope.indicatorCreationType = undefined; + $scope.indicatorLowestSpatialUnitMetadataObjectForComputation = kommonitorDataExchangeService.availableSpatialUnits[0]; + $scope.enableLowestSpatialUnitSelect = false; + + $scope.indicatorReferenceDateNote = undefined; + $scope.displayOrder = 0; + + $scope.indicatorTopic_mainTopic = undefined; + $scope.indicatorTopic_subTopic = undefined; + $scope.indicatorTopic_subsubTopic = undefined; + $scope.indicatorTopic_subsubsubTopic = undefined; + + $scope.indicatorNameFilter = undefined; + $scope.tmpIndicatorReference_selectedIndicatorMetadata = undefined; + $scope.tmpIndicatorReference_referenceDescription = undefined; + // tmp array to display indicatorReferences + $scope.indicatorReferences_adminView = []; + // array for API request (has less information per item) + $scope.indicatorReferences_apiRequest = []; + + $scope.georesourceNameFilter = undefined; + $scope.tmpGeoresourceReference_selectedGeoresourceMetadata = undefined; + $scope.tmpGeoresourceReference_referenceDescription = undefined; + // tmp array to display georesourceReferences + $scope.georesourceReferences_adminView = []; + // array for API request (has less information per item) + $scope.georesourceReferences_apiRequest = []; + + $scope.numClassesArray = [3,4,5,6,7,8]; + $scope.numClasses = $scope.numClassesArray[2]; + $scope.selectedColorBrewerPaletteEntry = undefined; + + $scope.postBody_indicators = undefined; + + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + + $scope.loadingData = false; + + $scope.colorbrewerSchemes = colorbrewer; + $scope.colorbreweSchemeName_dynamicIncrease = __env.defaultColorBrewerPaletteForBalanceIncreasingValues; + $scope.colorbreweSchemeName_dynamicDecrease = __env.defaultColorBrewerPaletteForBalanceDecreasingValues; + $scope.colorbrewerPalettes = []; + + + $scope.instantiateColorBrewerPalettes = function(){ + for (const key in colorbrewer) { + if (colorbrewer.hasOwnProperty(key)) { + const colorPalettes = colorbrewer[key]; + + var paletteEntry = { + "paletteName": key, + "paletteArrayObject": colorPalettes + }; + + $scope.colorbrewerPalettes.push(paletteEntry); + } + } + + // instantiate with palette 'Blues' + $scope.selectedColorBrewerPaletteEntry = $scope.colorbrewerPalettes[13]; + + }; + + $scope.instantiateColorBrewerPalettes(); + + $scope.resetIndicatorAddForm = function(){ + + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + + $scope.datasetName = undefined; + $scope.datasetNameInvalid = false; + + $scope.metadata = {}; + $scope.metadata.note = undefined; + $scope.metadata.literature = undefined; + $scope.metadata.updateInterval = undefined; + $scope.metadata.sridEPSG = undefined; + $scope.metadata.datasource = undefined; + $scope.metadata.databasis = undefined; + $scope.metadata.contact = undefined; + $scope.metadata.lastUpdate = undefined; + $scope.metadata.description = undefined; + + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorAddRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, kommonitorDataExchangeService.getCurrentKomMonitorLoginRoleIds()); + + $scope.datasetName = undefined; + $scope.indicatorAbbreviation = undefined; + $scope.indicatorType = kommonitorDataExchangeService.indicatorTypeOptions[0]; + $scope.indicatorCharacteristicValue = undefined; + $scope.isHeadlineIndicator = false; + $scope.indicatorUnit = undefined; + $scope.enableFreeTextUnit = false; + $scope.indicatorProcessDescription = undefined; + $scope.indicatorTagsString_withCommas = undefined; + $scope.indicatorInterpretation = undefined; + $scope.indicatorCreationType = kommonitorDataExchangeService.indicatorCreationTypeOptions[0]; + $scope.indicatorLowestSpatialUnitMetadataObjectForComputation = kommonitorDataExchangeService.availableSpatialUnits[0]; + $scope.enableLowestSpatialUnitSelect = false; + + $scope.indicatorReferenceDateNote = undefined; + $scope.displayOrder = 0; + + $scope.indicatorTopic_mainTopic = undefined; + $scope.indicatorTopic_subTopic = undefined; + $scope.indicatorTopic_subsubTopic = undefined; + $scope.indicatorTopic_subsubsubTopic = undefined; + + $scope.indicatorNameFilter = undefined; + $scope.tmpIndicatorReference_selectedIndicatorMetadata = undefined; + $scope.tmpIndicatorReference_referenceDescription = undefined; + // tmp array to display indicatorReferences + $scope.indicatorReferences_adminView = []; + // array for API request (has less information per item) + $scope.indicatorReferences_apiRequest = []; + + $scope.georesourceNameFilter = undefined; + $scope.tmpGeoresourceReference_selectedGeoresourceMetadata = undefined; + $scope.tmpGeoresourceReference_referenceDescription = undefined; + // tmp array to display georesourceReferences + $scope.georesourceReferences_adminView = []; + // array for API request (has less information per item) + $scope.georesourceReferences_apiRequest = []; + + $scope.numClassesArray = [3,4,5,6,7,8]; + $scope.numClasses = $scope.numClassesArray[2]; + $scope.selectedColorBrewerPaletteEntry = $scope.colorbrewerPalettes[13]; + + $scope.postBody_indicators = undefined; + + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + + $scope.onClickColorBrewerEntry = function(colorPaletteEntry){ + $scope.selectedColorBrewerPaletteEntry = colorPaletteEntry; + + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + + $scope.onAddOrUpdateIndicatorReference = function(){ + var tmpIndicatorReference_adminView = { + "referencedIndicatorName": $scope.tmpIndicatorReference_selectedIndicatorMetadata.indicatorName, + "referencedIndicatorId": $scope.tmpIndicatorReference_selectedIndicatorMetadata.indicatorId, + "referencedIndicatorAbbreviation": $scope.tmpIndicatorReference_selectedIndicatorMetadata.abbreviation, + "referencedIndicatorDescription": $scope.tmpIndicatorReference_referenceDescription + }; + + var processed = false; + + for (let index = 0; index < $scope.indicatorReferences_adminView.length; index++) { + var indicatorReference_adminView = $scope.indicatorReferences_adminView[index]; + + if (indicatorReference_adminView.referencedIndicatorId === tmpIndicatorReference_adminView.referencedIndicatorId){ + // replace object + $scope.indicatorReferences_adminView[index] = tmpIndicatorReference_adminView; + processed = true; + break; + } + } + + if(! processed){ + // new entry + $scope.indicatorReferences_adminView.push(tmpIndicatorReference_adminView); + } + + $scope.tmpIndicatorReference_selectedIndicatorMetadata = undefined; + $scope.tmpIndicatorReference_referenceDescription = undefined; + + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + + $scope.onClickEditIndicatorReference = function(indicatorReference_adminView){ + + $scope.tmpIndicatorReference_selectedIndicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(indicatorReference_adminView.referencedIndicatorId); + $scope.tmpIndicatorReference_referenceDescription = indicatorReference_adminView.referencedIndicatorDescription; + + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + + $scope.onClickDeleteIndicatorReference = function(indicatorReference_adminView){ + + for (let index = 0; index < $scope.indicatorReferences_adminView.length; index++) { + + if ($scope.indicatorReferences_adminView[index].referencedIndicatorId === indicatorReference_adminView.referencedIndicatorId){ + // remove object + $scope.indicatorReferences_adminView.splice(index, 1); + break; + } + } + + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + + $scope.onAddOrUpdateGeoresourceReference = function(){ + var tmpGeoresourceReference_adminView = { + "referencedGeoresourceName": $scope.tmpGeoresourceReference_selectedGeoresourceMetadata.datasetName, + "referencedGeoresourceId": $scope.tmpGeoresourceReference_selectedGeoresourceMetadata.georesourceId, + "referencedGeoresourceDescription": $scope.tmpGeoresourceReference_referenceDescription + }; + + var processed = false; + + for (let index = 0; index < $scope.georesourceReferences_adminView.length; index++) { + var georesourceReference_adminView = $scope.georesourceReferences_adminView[index]; + + if (georesourceReference_adminView.referencedGeoresourceId === tmpGeoresourceReference_adminView.referencedGeoresourceId){ + // replace object + $scope.georesourceReferences_adminView[index] = tmpGeoresourceReference_adminView; + processed = true; + break; + } + } + + if(! processed){ + // new entry + $scope.georesourceReferences_adminView.push(tmpGeoresourceReference_adminView); + } + + $scope.tmpGeoresourceReference_selectedGeoresourceMetadata = undefined; + $scope.tmpGeoresourceReference_referenceDescription = undefined; + + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + + $scope.onClickEditGeoresourceReference = function(georesourceReference_adminView){ + + $scope.tmpGeoresourceReference_selectedGeoresourceMetadata = kommonitorDataExchangeService.getGeoresourceMetadataById(georesourceReference_adminView.referencedGeoresourceId); + $scope.tmpGeoresourceReference_referenceDescription = georesourceReference_adminView.referencedGeoresourceDescription; + + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + + $scope.onClickDeleteGeoresourceReference = function(georesourceReference_adminView){ + + for (let index = 0; index < $scope.georesourceReferences_adminView.length; index++) { + + if ($scope.georesourceReferences_adminView[index].referencedGeoresourceId === georesourceReference_adminView.referencedGeoresourceId){ + // remove object + $scope.georesourceReferences_adminView.splice(index, 1); + break; + } + } + + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + + $scope.onChangeCreationType = function(){ + if($scope.indicatorCreationType.apiName === "COMPUTATION"){ + $scope.enableLowestSpatialUnitSelect = true; + } + else{ + $scope.enableLowestSpatialUnitSelect = false; + } + + }; + + $scope.onChangeIndicatorUnit = function(){ + if ($scope.indicatorUnit.includes("Freitext")){ + $scope.enableFreeTextUnit = true; + } + else{ + $scope.enableFreeTextUnit = false; + } + }; + + $scope.checkDatasetName = function(){ + $scope.datasetNameInvalid = false; + kommonitorDataExchangeService.availableIndicators.forEach(function(indicator){ + if (indicator.indicatorName === $scope.datasetName){ + $scope.datasetNameInvalid = true; + return; + } + }); + }; + + $scope.buildPostBody_indicators = function(){ + var postBody = + { + "metadata": { + "note": $scope.metadata.note || null, + "literature": $scope.metadata.literature || null, + "updateInterval": $scope.metadata.updateInterval.apiName, + "sridEPSG": $scope.metadata.sridEPSG || 4326, + "datasource": $scope.metadata.datasource, + "contact": $scope.metadata.contact, + "lastUpdate": $scope.metadata.lastUpdate, + "description": $scope.metadata.description || null, + "databasis": $scope.metadata.databasis || null + }, + "refrencesToOtherIndicators": [], // filled directly after + "allowedRoles": [], + "datasetName": $scope.datasetName, + "abbreviation": $scope.indicatorAbbreviation || null, + "characteristicValue": $scope.indicatorCharacteristicValue || null, + "tags": [], // filled directly after + "creationType": $scope.indicatorCreationType.apiName, + "unit": $scope.indicatorUnit, + "topicReference": "", // filled directly after + "refrencesToGeoresources": [], // filled directly after + "indicatorType": $scope.indicatorType.apiName, + "interpretation": $scope.indicatorInterpretation || "", + "isHeadlineIndicator": $scope.isHeadlineIndicator || false, + "processDescription": $scope.indicatorProcessDescription || "", + "referenceDateNote": $scope.indicatorReferenceDateNote || "", + "displayOrder": $scope.displayOrder, + "lowestSpatialUnitForComputation": $scope.indicatorLowestSpatialUnitMetadataObjectForComputation? $scope.indicatorLowestSpatialUnitMetadataObjectForComputation.spatialUnitLevel : null, + "defaultClassificationMapping": { + "colorBrewerSchemeName": $scope.selectedColorBrewerPaletteEntry.paletteName, + "items": [ + { + "defaultColorAsHex": "#edf8e9", + "defaultCustomRating": "sehr niedrig" + }, + { + "defaultColorAsHex": "#bae4b3", + "defaultCustomRating": "niedrig" + }, + { + "defaultColorAsHex": "#74c476", + "defaultCustomRating": "mittel" + }, + { + "defaultColorAsHex": "#31a354", + "defaultCustomRating": "hoch" + }, + { + "defaultColorAsHex": "#006d2c", + "defaultCustomRating": "sehr hoch" + } + ] + } + }; + + let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); + for (const roleId of roleIds) { + postBody.allowedRoles.push(roleId); + } + + // TAGS + if($scope.indicatorTagsString_withCommas){ + var tags_splitted = $scope.indicatorTagsString_withCommas.split(","); + for (const tagString of tags_splitted) { + postBody.tags.push(tagString.trim()); + } + } + + // TOPIC REFERENCE + if($scope.indicatorTopic_subsubsubTopic){ + postBody.topicReference = $scope.indicatorTopic_subsubsubTopic.topicId; + } + else if($scope.indicatorTopic_subsubTopic){ + postBody.topicReference = $scope.indicatorTopic_subsubTopic.topicId; + } + else if($scope.indicatorTopic_subTopic){ + postBody.topicReference = $scope.indicatorTopic_subTopic.topicId; + } + else if($scope.indicatorTopic_mainTopic){ + postBody.topicReference = $scope.indicatorTopic_mainTopic.topicId; + } + else { + postBody.topicReference = ""; + } + + + // REFERENCES + if($scope.indicatorReferences_adminView && $scope.indicatorReferences_adminView.length > 0){ + postBody.refrencesToOtherIndicators = []; + + for (const indicRef of $scope.indicatorReferences_adminView) { + postBody.refrencesToOtherIndicators.push({ + "indicatorId": indicRef.referencedIndicatorId, + "referenceDescription": indicRef.referencedIndicatorDescription + }); + } + } + + if($scope.georesourceReferences_adminView && $scope.georesourceReferences_adminView.length > 0){ + postBody.refrencesToGeoresources = []; + + for (const geoRef of $scope.georesourceReferences_adminView) { + postBody.refrencesToGeoresources.push({ + "georesourceId": geoRef.referencedGeoresourceId, + "referenceDescription": geoRef.referencedGeoresourceDescription + }); + } + } + + + return postBody; + }; + + $scope.addIndicator = async function(){ + + $timeout(function(){ + $scope.loadingData = true; + }); + + var postBody = $scope.buildPostBody_indicators(); + + return await $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/indicators", + method: "POST", + data: postBody, + headers: { + 'Content-Type': "application/json" + } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + $rootScope.$broadcast("refreshIndicatorOverviewTable", "add", response.data.indicatorId); + + // refresh all admin dashboard diagrams due to modified metadata + $timeout(function(){ + $rootScope.$broadcast("refreshAdminDashboardDiagrams"); + }, 500); + + $scope.successMessagePart = $scope.datasetName; + $scope.importedFeatures = []; + + $("#indicatorAddSuccessAlert").show(); + + $scope.loadingData = false; + + }, function errorCallback(error) { + console.error("Error while adding computable indicatorMetadata service."); + if(error.data){ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else{ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + + $("#indicatorAddErrorAlert").show(); + $scope.loadingData = false; + + setTimeout(() => { + $scope.$digest(); + }, 250); + }); + + }; + + $scope.onImportIndicatorAddMetadata = function(){ + + $scope.indicatorMetadataImportError = ""; + + $("#indicatorMetadataImportFile").files = []; + + // trigger file chooser + $("#indicatorMetadataImportFile").click(); + + }; + + $(document).on("change", "#indicatorMetadataImportFile" ,function(){ + + console.log("Importing Indicator metadata for Add Indicator Form"); + + // get the file + var file = document.getElementById('indicatorMetadataImportFile').files[0]; + $scope.parseMetadataFromFile(file); + }); + + $scope.parseMetadataFromFile = function(file){ + var fileReader = new FileReader(); + + fileReader.onload = function(event) { + + try{ + $scope.parseFromMetadataFile(event); + } + catch(error){ + console.error(error); + console.error("Uploaded Metadata File cannot be parsed."); + $scope.indicatorMetadataImportError = "Uploaded Metadata File cannot be parsed correctly"; + document.getElementById("indicatorsAddMetadataPre").innerHTML = $scope.indicatorMetadataStructure_pretty; + $("#indicatorAddMetadataImportErrorAlert").show(); + + $scope.$digest(); + } + + }; + + // Read in the image file as a data URL. + fileReader.readAsText(file); + }; + + $scope.parseFromMetadataFile = function(event){ + // $scope.geoJsonString = event.target.result; + $scope.metadataImportSettings = JSON.parse(event.target.result); + + if(! $scope.metadataImportSettings.metadata){ + console.error("uploaded Metadata File cannot be parsed - wrong structure."); + $scope.indicatorMetadataImportError = "Struktur der Datei stimmt nicht mit erwartetem Muster überein."; + document.getElementById("indicatorsAddMetadataPre").innerHTML = $scope.indicatorMetadataStructure_pretty; + $("#indicatorAddMetadataImportErrorAlert").show(); + + $scope.$digest(); + } + + $scope.metadata = {}; + $scope.metadata.note = $scope.metadataImportSettings.metadata.note; + $scope.metadata.literature = $scope.metadataImportSettings.metadata.literature; + kommonitorDataExchangeService.updateIntervalOptions.forEach(function(option){ + if(option.apiName === $scope.metadataImportSettings.metadata.updateInterval){ + $scope.metadata.updateInterval = option; + } + }); + $scope.metadata.sridEPSG = $scope.metadataImportSettings.metadata.sridEPSG; + $scope.metadata.datasource = $scope.metadataImportSettings.metadata.datasource; + $scope.metadata.contact = $scope.metadataImportSettings.metadata.contact; + $scope.metadata.lastUpdate = $scope.metadataImportSettings.metadata.lastUpdate; + // initialize date + $('#indicatorAddLastUpdateDatepicker').datepicker('setDate', $scope.metadata.lastUpdate); + + $scope.metadata.description = $scope.metadataImportSettings.metadata.description; + $scope.metadata.databasis = $scope.metadataImportSettings.metadata.databasis; + + $scope.indicatorReferenceDateNote = $scope.metadataImportSettings.referenceDateNote; + $scope.displayOrder = $scope.metadataImportSettings.displayOrder || 0; + + $scope.datasetName = $scope.metadataImportSettings.datasetName; + + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorAddRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, $scope.metadataImportSettings.allowedRoles); + + + // indicator specific properties + + + $scope.indicatorAbbreviation = $scope.metadataImportSettings.abbreviation; + + for (const indicatorTypeOption of kommonitorDataExchangeService.indicatorTypeOptions) { + if(indicatorTypeOption.apiName === $scope.metadataImportSettings.indicatorType){ + $scope.indicatorType = indicatorTypeOption; + break; + } + } + + for (const indicatorCreationTypeOption of kommonitorDataExchangeService.indicatorCreationTypeOptions) { + if(indicatorCreationTypeOption.apiName === $scope.metadataImportSettings.creationType){ + $scope.indicatorCreationType = indicatorCreationTypeOption; + + if(indicatorCreationTypeOption.apiName === "COMPUTATION"){ + $scope.enableLowestSpatialUnitSelect = true; + } + else{ + $scope.enableLowestSpatialUnitSelect = false; + } + break; + } + } + + $scope.indicatorCharacteristicValue = $scope.metadataImportSettings.characteristicValue; + $scope.isHeadlineIndicator = $scope.metadataImportSettings.isHeadlineIndicator; + $scope.indicatorUnit = $scope.metadataImportSettings.unit; + if(kommonitorDataExchangeService.indicatorUnitOptions.includes($scope.metadataImportSettings.unit)){ + $scope.enableFreeTextUnit = false; + } + else{ + $scope.enableFreeTextUnit = true; + } + + $scope.indicatorProcessDescription = $scope.metadataImportSettings.processDescription; + + $scope.indicatorTagsString_withCommas = undefined; + if($scope.metadataImportSettings.tags && $scope.metadataImportSettings.tags.length > 0){ + $scope.indicatorTagsString_withCommas = ""; + for (let index = 0; index < $scope.metadataImportSettings.tags.length; index++) { + $scope.indicatorTagsString_withCommas += $scope.metadataImportSettings.tags[index]; + + if(index < $scope.metadataImportSettings.tags.length - 1){ + $scope.indicatorTagsString_withCommas += ","; + } + } + } + + $scope.indicatorInterpretation = $scope.metadataImportSettings.interpretation; + $scope.indicatorLowestSpatialUnitMetadataObjectForComputation = kommonitorDataExchangeService.availableSpatialUnits[0]; + + for (let i = 0; i < kommonitorDataExchangeService.availableSpatialUnits.length; i++) { + const spatialUnitMetadata = kommonitorDataExchangeService.availableSpatialUnits[i]; + + if(spatialUnitMetadata.spatialUnitLevel === $scope.metadataImportSettings.lowestSpatialUnitForComputation){ + $scope.indicatorLowestSpatialUnitMetadataObjectForComputation = spatialUnitMetadata; + break; + } + } + + var topicHierarchy = kommonitorDataExchangeService.getTopicHierarchyForTopicId($scope.metadataImportSettings.topicReference); + + if(topicHierarchy && topicHierarchy[0]){ + $scope.indicatorTopic_mainTopic = topicHierarchy[0]; + } + if(topicHierarchy && topicHierarchy[1]){ + $scope.indicatorTopic_subTopic = topicHierarchy[1]; + } + if(topicHierarchy && topicHierarchy[2]){ + $scope.indicatorTopic_subsubTopic = topicHierarchy[2]; + } + if(topicHierarchy && topicHierarchy[3]){ + $scope.indicatorTopic_subsubsubTopic = topicHierarchy[3]; + } + + $scope.indicatorNameFilter = undefined; + $scope.tmpIndicatorReference_selectedIndicatorMetadata = undefined; + $scope.tmpIndicatorReference_referenceDescription = undefined; + + // tmp array to display indicatorReferences + $scope.indicatorReferences_adminView = []; + // array for API request (has less information per item) + $scope.indicatorReferences_apiRequest = []; + if($scope.metadataImportSettings.refrencesToOtherIndicators && $scope.metadataImportSettings.refrencesToOtherIndicators.length > 0){ + for (const indicatorReference of $scope.metadataImportSettings.refrencesToOtherIndicators) { + var indicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(indicatorReference.indicatorId); + var referenceEntry = { + "referencedIndicatorName": indicatorMetadata.indicatorName, + "referencedIndicatorId": indicatorMetadata.indicatorId, + "referencedIndicatorAbbreviation": indicatorMetadata.abbreviation, + "referencedIndicatorDescription": indicatorReference.referenceDescription + }; + $scope.indicatorReferences_adminView.push(referenceEntry); + } + + } + + $scope.georesourceNameFilter = undefined; + $scope.tmpGeoresourceReference_selectedGeoresourceMetadata = undefined; + $scope.tmpGeoresourceReference_referenceDescription = undefined; + // tmp array to display georesourceReferences + $scope.georesourceReferences_adminView = []; + // array for API request (has less information per item) + $scope.georesourceReferences_apiRequest = []; + + if($scope.metadataImportSettings.refrencesToGeoresources && $scope.metadataImportSettings.refrencesToGeoresources.length > 0){ + for (const georesourceReference of $scope.metadataImportSettings.refrencesToGeoresources) { + var georesourceMetadata = kommonitorDataExchangeService.getGeoresourceMetadataById(georesourceReference.georesourceId); + var geo_referenceEntry = { + "referencedGeoresourceName": georesourceMetadata.datasetName, + "referencedGeoresourceId": georesourceMetadata.georesourceId, + "referencedGeoresourceDescription": georesourceReference.referenceDescription + }; + $scope.georesourceReferences_adminView.push(geo_referenceEntry); + } + + } + + $scope.numClassesArray = [3,4,5,6,7,8]; + $scope.numClasses = $scope.numClassesArray[2]; + // instantiate with palette 'Blues' + $scope.selectedColorBrewerPaletteEntry = $scope.colorbrewerPalettes[13]; + + for (const colorbrewerPalette of $scope.colorbrewerPalettes) { + if (colorbrewerPalette.paletteName === $scope.metadataImportSettings.defaultClassificationMapping.colorBrewerSchemeName){ + $scope.selectedColorBrewerPaletteEntry = colorbrewerPalette; + break; + } + } + + $scope.$digest(); + }; + + $scope.onExportIndicatorAddMetadataTemplate = function(){ + + var metadataJSON = JSON.stringify($scope.indicatorMetadataStructure); + + var fileName = "Indikator_Metadaten_Vorlage_Export.json"; + + var blob = new Blob([metadataJSON], {type: "application/json"}); + var data = URL.createObjectURL(blob); + + var a = document.createElement('a'); + a.download = fileName; + a.href = data; + a.textContent = "JSON"; + a.target = "_blank"; + a.rel = "noopener noreferrer"; + a.click(); + + a.remove(); + }; + + $scope.onExportIndicatorAddMetadata = function(){ + var metadataExport = $scope.indicatorMetadataStructure; + + metadataExport.metadata.note = $scope.metadata.note || ""; + metadataExport.metadata.literature = $scope.metadata.literature || ""; + metadataExport.metadata.sridEPSG = $scope.metadata.sridEPSG || ""; + metadataExport.metadata.datasource = $scope.metadata.datasource || ""; + metadataExport.metadata.contact = $scope.metadata.contact || ""; + metadataExport.metadata.lastUpdate = $scope.metadata.lastUpdate || ""; + metadataExport.metadata.description = $scope.metadata.description || ""; + metadataExport.metadata.databasis = $scope.metadata.databasis || ""; + metadataExport.datasetName = $scope.datasetName || ""; + + metadataExport.referenceDateNote = $scope.indicatorReferenceDateNote || ""; + metadataExport.displayOrder = $scope.displayOrder || 0; + + metadataExport.allowedRoles = []; + + let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); + for (const roleId of roleIds) { + metadataExport.allowedRoles.push(roleId); + } + + if($scope.metadata.updateInterval){ + metadataExport.metadata.updateInterval = $scope.metadata.updateInterval.apiName; + } + + var name = $scope.datasetName; + + // indicator specific properties + + metadataExport.abbreviation = $scope.indicatorAbbreviation || ""; + metadataExport.indicatorType = $scope.indicatorType ? $scope.indicatorType.apiName : ""; + metadataExport.creationType = $scope.indicatorCreationType ? $scope.indicatorCreationType.apiName : ""; + + metadataExport.characteristicValue = $scope.indicatorCharacteristicValue || ""; + metadataExport.isHeadlineIndicator = $scope.isHeadlineIndicator || false; + metadataExport.unit = $scope.indicatorUnit || ""; + metadataExport.processDescription = $scope.indicatorProcessDescription || ""; + metadataExport.tags = []; + + if($scope.indicatorTagsString_withCommas){ + var tags_splitted = $scope.indicatorTagsString_withCommas.split(","); + for (const tagString of tags_splitted) { + metadataExport.tags.push(tagString.trim()); + } + } + + metadataExport.interpretation = $scope.indicatorInterpretation || ""; + metadataExport.lowestSpatialUnitForComputation = $scope.indicatorLowestSpatialUnitMetadataObjectForComputation? $scope.indicatorLowestSpatialUnitMetadataObjectForComputation.spatialUnitLevel : ""; + + if($scope.indicatorTopic_subsubsubTopic){ + metadataExport.topicReference = $scope.indicatorTopic_subsubsubTopic.topicId; + } + else if($scope.indicatorTopic_subsubTopic){ + metadataExport.topicReference = $scope.indicatorTopic_subsubTopic.topicId; + } + else if($scope.indicatorTopic_subTopic){ + metadataExport.topicReference = $scope.indicatorTopic_subTopic.topicId; + } + else if($scope.indicatorTopic_mainTopic){ + metadataExport.topicReference = $scope.indicatorTopic_mainTopic.topicId; + } + else { + metadataExport.topicReference = ""; + } + + metadataExport.refrencesToOtherIndicators = []; + + if($scope.indicatorReferences_adminView && $scope.indicatorReferences_adminView.length > 0){ + metadataExport.refrencesToOtherIndicators = []; + + for (const indicRef of $scope.indicatorReferences_adminView) { + metadataExport.refrencesToOtherIndicators.push({ + "indicatorId": indicRef.referencedIndicatorId, + "referenceDescription": indicRef.referencedIndicatorDescription + }); + } + } + + metadataExport.refrencesToGeoresources = []; + + if($scope.georesourceReferences_adminView && $scope.georesourceReferences_adminView.length > 0){ + metadataExport.refrencesToGeoresources = []; + + for (const geoRef of $scope.georesourceReferences_adminView) { + metadataExport.refrencesToGeoresources.push({ + "georesourceId": geoRef.referencedGeoresourceId, + "referenceDescription": geoRef.referencedGeoresourceDescription + }); + } + } + + var defaultClassificationMapping = { + "colorBrewerSchemeName" : $scope.selectedColorBrewerPaletteEntry ? $scope.selectedColorBrewerPaletteEntry.paletteName : "Blues", + "items": [ + { + "defaultColorAsHex": "#edf8e9", + "defaultCustomRating": "sehr niedrig" + }, + { + "defaultColorAsHex": "#bae4b3", + "defaultCustomRating": "niedrig" + }, + { + "defaultColorAsHex": "#74c476", + "defaultCustomRating": "mittel" + }, + { + "defaultColorAsHex": "#31a354", + "defaultCustomRating": "hoch" + }, + { + "defaultColorAsHex": "#006d2c", + "defaultCustomRating": "sehr hoch" + } + ] + }; + + metadataExport.defaultClassificationMapping = defaultClassificationMapping; + + + var metadataJSON = JSON.stringify(metadataExport); + + var fileName = "Indikatoren_Metadaten_Export"; + + if (name){ + fileName += "-" + name; + } + + fileName += ".json"; + + var blob = new Blob([metadataJSON], {type: "application/json"}); + var data = URL.createObjectURL(blob); + + var a = document.createElement('a'); + a.download = fileName; + a.href = data; + a.textContent = "JSON"; + a.target = "_blank"; + a.rel = "noopener noreferrer"; + a.click(); + + a.remove(); + }; + + $scope.hideSuccessAlert = function(){ + $("#indicatorAddSuccessAlert").hide(); + }; + + $scope.hideErrorAlert = function(){ + $("#indicatorAddErrorAlert").hide(); + }; + + $scope.hideMetadataErrorAlert = function(){ + $("#indicatorAddMetadataImportErrorAlert").hide(); + }; + + kommonitorMultiStepFormHelperService.registerClickHandler(); + + } +]}); diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorAddModal/indicator-add-modal.module.js b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorAddModal/indicator-add-modal.module.js index 57ae8faf1..b835b6385 100644 --- a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorAddModal/indicator-add-modal.module.js +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorAddModal/indicator-add-modal.module.js @@ -1,2 +1,4 @@ -angular.module('indicatorAddModal', ['kommonitorDataExchange', 'kommonitorImporterHelper', 'adminTopicsManagement', +"use strict"; +angular.module('indicatorAddModal', ['kommonitorDataExchange', 'kommonitorImporterHelper', 'adminTopicsManagement', 'excaliburDualList', 'kommonitorMultiStepFormHelper', 'kommonitorDataGridHelper']); +//# sourceMappingURL=indicator-add-modal.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorAddModal/indicator-add-modal.module.js.map b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorAddModal/indicator-add-modal.module.js.map new file mode 100644 index 000000000..273fd498c --- /dev/null +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorAddModal/indicator-add-modal.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"indicator-add-modal.module.js","sourceRoot":"","sources":["indicator-add-modal.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,mBAAmB,EAAE,CAAC,wBAAwB,EAAE,0BAA0B,EAAE,uBAAuB;IAC9G,mBAAmB,EAAE,+BAA+B,EAAE,0BAA0B,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorAddModal/indicator-add-modal.module.ts b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorAddModal/indicator-add-modal.module.ts new file mode 100644 index 000000000..57ae8faf1 --- /dev/null +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorAddModal/indicator-add-modal.module.ts @@ -0,0 +1,2 @@ +angular.module('indicatorAddModal', ['kommonitorDataExchange', 'kommonitorImporterHelper', 'adminTopicsManagement', + 'excaliburDualList', 'kommonitorMultiStepFormHelper', 'kommonitorDataGridHelper']); diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorBatchUpdateModal/indicator-batch-update-modal.component.js b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorBatchUpdateModal/indicator-batch-update-modal.component.js index 3b44ecc25..28be64b56 100644 --- a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorBatchUpdateModal/indicator-batch-update-modal.component.js +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorBatchUpdateModal/indicator-batch-update-modal.component.js @@ -1,279 +1,235 @@ +"use strict"; angular.module('indicatorBatchUpdateModal').component('indicatorBatchUpdateModal', { - templateUrl : "components/kommonitorAdmin/adminIndicatorsManagement/indicatorBatchUpdateModal/indicator-batch-update-modal.template.html", - controller : ['kommonitorDataExchangeService', 'kommonitorImporterHelperService', 'kommonitorBatchUpdateHelperService', '$scope', '$rootScope', '$http', '$timeout', '__env', - function IndicatorBatchUpdateModalController(kommonitorDataExchangeService, kommonitorImporterHelperService, kommonitorBatchUpdateHelperService, $scope, $rootScope, $http, $timeout, __env) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorImporterHelperServiceInstance = kommonitorImporterHelperService; - this.kommonitorBatchUpdateHelperServiceInstance = kommonitorBatchUpdateHelperService; - - $scope.isFirstStart = true; - $scope.lastUpdateResponseObj; - $scope.timeseriesMappingReference; // gets updated by a broadcast whenever $scope.timeseries mapping in indicatorEditTimeseriesMapping component changes - $scope.selected = { value: kommonitorDataExchangeService.availableIndicators[0] }; - $scope.keepMissingValues = true; - - /* - { - "converter": { - "encoding": "string", - "mimeType": "string", - "name": "string", - "parameters": [{ - "name": "string", - "value": "string" - }], - "schema": "string" - }, - "dataSource": { - "parameters": [{ - "name": "string", - "value": "string" - }], - "type": "FILE" // FILE|HTTP|INLINE - }, - "propertyMapping": { - timeseriesMappings: [ - { - "indicatorValueProperty": "string", - "timestamp": "date" // direct timestamp - }, { - "indicatorValueProperty": "string", - "timestampProperty": "string" // attribute column that contains timestamp(s) - }], - spatialReferenceKeyProperty: "", - keepMissingOrNullValueIndicator: true, - }, - targetSpatialUnitName: "" - } - */ - $scope.batchList = []; - $scope.timeseriesMappingModalOpenForIndex; // temporarily stores for which index of the batch list the timeseries mapping modal is open - $scope.defaultTimeseriesMappingSave = []; - - // on modal opened - $('#modal-batch-update-indicators').on('show.bs.modal', function () { - // this check is necessary to avoid running the initialize method on opening datepicker modals - if(event) { - if(event.target.id === "button-batch-update-indicators") { - $scope.initialize(); - } - } - }); - - - // initializes the modal - $scope.initialize = function() { - - if($scope.isFirstStart) { - kommonitorBatchUpdateHelperService.addNewRowToBatchList("indicator", $scope.batchList) - $scope.isFirstStart = false; - } - - $(document).on("change", ".indicatorMappingTableInputField", function(){ - // get index of changed field - var index = kommonitorBatchUpdateHelperService.getIndexFromId(this.id); - - // get file - var file = this.files[0]; - - // read content - var reader = new FileReader(); - reader.addEventListener('load', function(event) { - kommonitorBatchUpdateHelperService.onMappingTableSelected("indicator", event, index, file, $scope.batchList); - }); - reader.readAsText(file) - }); - - $(document).on("change", ".indicatorDataSourceFileInputField", function(){ - // get index of changed field - var index = kommonitorBatchUpdateHelperService.getIndexFromId(this.id); - - // get file - var file = this.files[0]; - - // read content - var reader = new FileReader(); - reader.addEventListener('load', function() { - kommonitorBatchUpdateHelperService.onDataSourceFileSelected(file, index, $scope.batchList); - }); - reader.readAsText(file) - }); - - $scope.$digest(); - }; - - $scope.loadIndicatorsBatchList = function() { - $("#indicatorsBatchListFile").files = []; - - // trigger file chooser - $("#indicatorsBatchListFile").trigger("click"); - }; - - $(document).on("change", "#indicatorsBatchListFile" ,function(){ - - // get the file - var file = document.getElementById('indicatorsBatchListFile').files[0]; - kommonitorBatchUpdateHelperService.parseBatchListFromFile("indicator", file, $scope.batchList) - }); - - $scope.$on('indicatorBatchListParsed', function(event, data) { - $timeout(function() { - - var newBatchList = data.newValue; - - // remove all rows - for (var i = 0; i < $scope.batchList.length; i++) - $scope.batchList[i].isSelected = true; - kommonitorBatchUpdateHelperService.deleteSelectedRowsFromBatchList($scope.batchList, $scope.allRowsSelected); - - for(let i=0; i 0) - $scope.$broadcast('loadTimeseriesMapping', { mapping: timeseriesMappingProp}); - else - $scope.$broadcast('resetTimeseriesMapping'); - } - - }); - - $('#indicator-edit-default-time-series-mapping-modal').on('show.bs.modal', function (event) { - if(event.target.id === "indicator-edit-default-time-series-mapping-modal") { - if($scope.defaultTimeseriesMappingSave.length >= 1) - $scope.$broadcast('loadTimeseriesMapping', { mapping: $scope.defaultTimeseriesMappingSave }); - else - $scope.$broadcast('resetTimeseriesMapping'); - } - }); - - // on timeseries mapping modal closed - $('#indicator-edit-time-series-mapping-modal').on('hidden.bs.modal', function (event) { - if(event.target.id === "indicator-edit-time-series-mapping-modal") { - // store timeseries mapping to mappingObj - let index = $scope.timeseriesMappingModalOpenForIndex; - // converting to json and back gets rid of the $$hashkey property - $scope.batchList[index].mappingObj.propertyMapping.timeseriesMappings = angular.fromJson(angular.toJson($scope.timeseriesMappingReference)); - $scope.timeseriesMappingModalOpenForIndex = undefined; - // then reset the modal - //$scope.$broadcast('resetTimeseriesMapping') - } - }); - - // on default timeseries mapping modal closed - $('#indicator-edit-default-time-series-mapping-modal').on('hidden.bs.modal', function (event) { - if(event.target.id === "indicator-edit-default-time-series-mapping-modal") { - // store timeseries mapping to mappingObj - $scope.defaultTimeseriesMappingSave = $scope.timeseriesMappingReference; - // then reset the modal - //$scope.$broadcast('resetTimeseriesMapping') - } - }); - - - $scope.$on("batchUpdateCompleted", function(event, data) { - if(data.resourceType === "indicator") { - $scope.lastUpdateResponseObj = data; - } - }); - - - $scope.reopenResultModal = function() { - if (typeof $scope.lastUpdateResponseObj !== 'undefined') { - $rootScope.$broadcast("reopenBatchUpdateResultModal", $scope.lastUpdateResponseObj); - } - } - - $rootScope.$on("timeseriesMappingChanged", function(event, data) { - $scope.timeseriesMappingReference = data.mapping; - }); - - - } -]}); \ No newline at end of file + templateUrl: "components/kommonitorAdmin/adminIndicatorsManagement/indicatorBatchUpdateModal/indicator-batch-update-modal.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorImporterHelperService', 'kommonitorBatchUpdateHelperService', '$scope', '$rootScope', '$http', '$timeout', '__env', + function IndicatorBatchUpdateModalController(kommonitorDataExchangeService, kommonitorImporterHelperService, kommonitorBatchUpdateHelperService, $scope, $rootScope, $http, $timeout, __env) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorImporterHelperServiceInstance = kommonitorImporterHelperService; + this.kommonitorBatchUpdateHelperServiceInstance = kommonitorBatchUpdateHelperService; + $scope.isFirstStart = true; + $scope.lastUpdateResponseObj; + $scope.timeseriesMappingReference; // gets updated by a broadcast whenever $scope.timeseries mapping in indicatorEditTimeseriesMapping component changes + $scope.selected = { value: kommonitorDataExchangeService.availableIndicators[0] }; + $scope.keepMissingValues = true; + /* + { + "converter": { + "encoding": "string", + "mimeType": "string", + "name": "string", + "parameters": [{ + "name": "string", + "value": "string" + }], + "schema": "string" + }, + "dataSource": { + "parameters": [{ + "name": "string", + "value": "string" + }], + "type": "FILE" // FILE|HTTP|INLINE + }, + "propertyMapping": { + timeseriesMappings: [ + { + "indicatorValueProperty": "string", + "timestamp": "date" // direct timestamp + }, { + "indicatorValueProperty": "string", + "timestampProperty": "string" // attribute column that contains timestamp(s) + }], + spatialReferenceKeyProperty: "", + keepMissingOrNullValueIndicator: true, + }, + targetSpatialUnitName: "" + } + */ + $scope.batchList = []; + $scope.timeseriesMappingModalOpenForIndex; // temporarily stores for which index of the batch list the timeseries mapping modal is open + $scope.defaultTimeseriesMappingSave = []; + // on modal opened + $('#modal-batch-update-indicators').on('show.bs.modal', function () { + // this check is necessary to avoid running the initialize method on opening datepicker modals + if (event) { + if (event.target.id === "button-batch-update-indicators") { + $scope.initialize(); + } + } + }); + // initializes the modal + $scope.initialize = function () { + if ($scope.isFirstStart) { + kommonitorBatchUpdateHelperService.addNewRowToBatchList("indicator", $scope.batchList); + $scope.isFirstStart = false; + } + $(document).on("change", ".indicatorMappingTableInputField", function () { + // get index of changed field + var index = kommonitorBatchUpdateHelperService.getIndexFromId(this.id); + // get file + var file = this.files[0]; + // read content + var reader = new FileReader(); + reader.addEventListener('load', function (event) { + kommonitorBatchUpdateHelperService.onMappingTableSelected("indicator", event, index, file, $scope.batchList); + }); + reader.readAsText(file); + }); + $(document).on("change", ".indicatorDataSourceFileInputField", function () { + // get index of changed field + var index = kommonitorBatchUpdateHelperService.getIndexFromId(this.id); + // get file + var file = this.files[0]; + // read content + var reader = new FileReader(); + reader.addEventListener('load', function () { + kommonitorBatchUpdateHelperService.onDataSourceFileSelected(file, index, $scope.batchList); + }); + reader.readAsText(file); + }); + $scope.$digest(); + }; + $scope.loadIndicatorsBatchList = function () { + $("#indicatorsBatchListFile").files = []; + // trigger file chooser + $("#indicatorsBatchListFile").trigger("click"); + }; + $(document).on("change", "#indicatorsBatchListFile", function () { + // get the file + var file = document.getElementById('indicatorsBatchListFile').files[0]; + kommonitorBatchUpdateHelperService.parseBatchListFromFile("indicator", file, $scope.batchList); + }); + $scope.$on('indicatorBatchListParsed', function (event, data) { + $timeout(function () { + var newBatchList = data.newValue; + // remove all rows + for (var i = 0; i < $scope.batchList.length; i++) + $scope.batchList[i].isSelected = true; + kommonitorBatchUpdateHelperService.deleteSelectedRowsFromBatchList($scope.batchList, $scope.allRowsSelected); + for (let i = 0; i < newBatchList.length; i++) { + kommonitorBatchUpdateHelperService.addNewRowToBatchList("indicator", $scope.batchList); + var row = $scope.batchList[i]; + // isSelected + row.isSelected = newBatchList[i].isSelected; + // name + // The exported batchList does not contain all of the metadata. + // We have to use the indicatorId to select the corresponding select option in the "name" column. + var indicatorId = newBatchList[i].name; + var indicatorObj = kommonitorDataExchangeService.getIndicatorMetadataById(indicatorId); + row.name = indicatorObj; + // mappingTableName + row.mappingTableName = newBatchList[i].mappingTableName; + // mappingObj + row.mappingObj = newBatchList[i].mappingObj; + // converter parameters to properties + if (row.mappingObj.converter) + row.mappingObj.converter = kommonitorBatchUpdateHelperService.converterParametersArrayToProperties(row.mappingObj.converter); + // dataSource parameters to properties + if (row.mappingObj.dataSource) + row.mappingObj.dataSource = kommonitorBatchUpdateHelperService.dataSourceParametersArrayToProperty(row.mappingObj.dataSource); + // set selectedConverter + if (newBatchList[i].mappingObj.converter.hasOwnProperty("name")) + row.selectedConverter = kommonitorBatchUpdateHelperService.getConverterObjectByName(newBatchList[i].mappingObj.converter.name); + // set selectedDatasourceType + if (newBatchList[i].mappingObj.dataSource.hasOwnProperty("type")) + row.selectedDatasourceType = kommonitorBatchUpdateHelperService.getDatasourceTypeObjectByType(newBatchList[i].mappingObj.dataSource.type); + // set selectedTargetSpatialUnit + if (newBatchList[i].mappingObj.hasOwnProperty("targetSpatialUnitName")) + row.selectedTargetSpatialUnit = kommonitorBatchUpdateHelperService.getSpatialUnitObjectByName(newBatchList[i].mappingObj.targetSpatialUnitName); + } + }); + kommonitorBatchUpdateHelperService.resizeNameColumnDropdowns(null); + }); + /* + // can be used to show only applicable spatial units for current indicator. + $scope.filterApplicableSpatialUnits = function(batchIndex) { + // avSpatialUnits is the list of available spatial units from the kommonitorDataExchangeService + return function (avSpatialUnit) { + // get spatial units for current indicator + let isValidSpatialUnit = false; + if($scope.batchList[batchIndex].name) { + let applicableSpatialUnits = $scope.batchList[batchIndex].name.applicableSpatialUnits; + for(let applicableSpatialUnit of applicableSpatialUnits) { + if(avSpatialUnit.spatialUnitLevel === applicableSpatialUnit.spatialUnitName) { + isValidSpatialUnit = true; + break; + } + } + } else { + return true // don't filter anything if no indicator has been selected yet + } + if(isValidSpatialUnit) + return true; + else + return false; + }; + }; + */ + $rootScope.$on("refreshIndicatorOverviewTableCompleted", function () { + kommonitorBatchUpdateHelperService.refreshNameColumn("indicator", $scope.batchList); + }); + $scope.onTimeseriesMappingBtnClicked = function ($event) { + $("#indicator-edit-time-series-mapping-modal").modal("show", $event.currentTarget); + }; + $scope.onDefaultTimeseriesMappingBtnClicked = function ($event) { + $("#indicator-edit-default-time-series-mapping-modal").modal("show", $event.currentTarget); + }; + $('#indicator-edit-time-series-mapping-modal').on('show.bs.modal', function (event) { + // get indicator for which timeseries mapping was opended + // use it to check the corresponding element in the batch list + if (event.target.id === "indicator-edit-time-series-mapping-modal") { + let index = kommonitorBatchUpdateHelperService.getIndexFromId(event.relatedTarget.id); + $scope.timeseriesMappingModalOpenForIndex = index; + let timeseriesMappingProp = $scope.batchList[index].mappingObj.propertyMapping.timeseriesMappings; + if (timeseriesMappingProp && timeseriesMappingProp.length > 0) + $scope.$broadcast('loadTimeseriesMapping', { mapping: timeseriesMappingProp }); + else + $scope.$broadcast('resetTimeseriesMapping'); + } + }); + $('#indicator-edit-default-time-series-mapping-modal').on('show.bs.modal', function (event) { + if (event.target.id === "indicator-edit-default-time-series-mapping-modal") { + if ($scope.defaultTimeseriesMappingSave.length >= 1) + $scope.$broadcast('loadTimeseriesMapping', { mapping: $scope.defaultTimeseriesMappingSave }); + else + $scope.$broadcast('resetTimeseriesMapping'); + } + }); + // on timeseries mapping modal closed + $('#indicator-edit-time-series-mapping-modal').on('hidden.bs.modal', function (event) { + if (event.target.id === "indicator-edit-time-series-mapping-modal") { + // store timeseries mapping to mappingObj + let index = $scope.timeseriesMappingModalOpenForIndex; + // converting to json and back gets rid of the $$hashkey property + $scope.batchList[index].mappingObj.propertyMapping.timeseriesMappings = angular.fromJson(angular.toJson($scope.timeseriesMappingReference)); + $scope.timeseriesMappingModalOpenForIndex = undefined; + // then reset the modal + //$scope.$broadcast('resetTimeseriesMapping') + } + }); + // on default timeseries mapping modal closed + $('#indicator-edit-default-time-series-mapping-modal').on('hidden.bs.modal', function (event) { + if (event.target.id === "indicator-edit-default-time-series-mapping-modal") { + // store timeseries mapping to mappingObj + $scope.defaultTimeseriesMappingSave = $scope.timeseriesMappingReference; + // then reset the modal + //$scope.$broadcast('resetTimeseriesMapping') + } + }); + $scope.$on("batchUpdateCompleted", function (event, data) { + if (data.resourceType === "indicator") { + $scope.lastUpdateResponseObj = data; + } + }); + $scope.reopenResultModal = function () { + if (typeof $scope.lastUpdateResponseObj !== 'undefined') { + $rootScope.$broadcast("reopenBatchUpdateResultModal", $scope.lastUpdateResponseObj); + } + }; + $rootScope.$on("timeseriesMappingChanged", function (event, data) { + $scope.timeseriesMappingReference = data.mapping; + }); + } + ] +}); +//# sourceMappingURL=indicator-batch-update-modal.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorBatchUpdateModal/indicator-batch-update-modal.component.js.map b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorBatchUpdateModal/indicator-batch-update-modal.component.js.map new file mode 100644 index 000000000..d3a580d15 --- /dev/null +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorBatchUpdateModal/indicator-batch-update-modal.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"indicator-batch-update-modal.component.js","sourceRoot":"","sources":["indicator-batch-update-modal.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,2BAA2B,CAAC,CAAC,SAAS,CAAC,2BAA2B,EAAE;IAClF,WAAW,EAAG,2HAA2H;IACzI,UAAU,EAAG,CAAC,+BAA+B,EAAE,iCAAiC,EAAE,oCAAoC,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO;QAC3K,SAAS,mCAAmC,CAAC,6BAA6B,EAAE,+BAA+B,EAAE,kCAAkC,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK;YAE1L,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAC3E,IAAI,CAAC,uCAAuC,GAAG,+BAA+B,CAAC;YAC/E,IAAI,CAAC,0CAA0C,GAAG,kCAAkC,CAAC;YAErF,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC;YAC3B,MAAM,CAAC,qBAAqB,CAAC;YAC7B,MAAM,CAAC,0BAA0B,CAAC,CAAC,qHAAqH;YACxJ,M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C,CAAC,CAAC;YAGH,MAAM,CAAC,iBAAiB,GAAG;gBAC1B,IAAI,OAAO,MAAM,CAAC,qBAAqB,KAAK,WAAW,EAAE;oBACxD,UAAU,CAAC,UAAU,CAAC,8BAA8B,EAAE,MAAM,CAAC,qBAAqB,CAAC,CAAC;iBACpF;YACF,CAAC,CAAA;YAED,UAAU,CAAC,GAAG,CAAC,0BAA0B,EAAE,UAAS,KAAK,EAAE,IAAI;gBAC9D,MAAM,CAAC,0BAA0B,GAAG,IAAI,CAAC,OAAO,CAAC;YAClD,CAAC,CAAC,CAAC;QAGJ,CAAC;KACF;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorBatchUpdateModal/indicator-batch-update-modal.component.ts b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorBatchUpdateModal/indicator-batch-update-modal.component.ts new file mode 100644 index 000000000..3b44ecc25 --- /dev/null +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorBatchUpdateModal/indicator-batch-update-modal.component.ts @@ -0,0 +1,279 @@ +angular.module('indicatorBatchUpdateModal').component('indicatorBatchUpdateModal', { + templateUrl : "components/kommonitorAdmin/adminIndicatorsManagement/indicatorBatchUpdateModal/indicator-batch-update-modal.template.html", + controller : ['kommonitorDataExchangeService', 'kommonitorImporterHelperService', 'kommonitorBatchUpdateHelperService', '$scope', '$rootScope', '$http', '$timeout', '__env', + function IndicatorBatchUpdateModalController(kommonitorDataExchangeService, kommonitorImporterHelperService, kommonitorBatchUpdateHelperService, $scope, $rootScope, $http, $timeout, __env) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorImporterHelperServiceInstance = kommonitorImporterHelperService; + this.kommonitorBatchUpdateHelperServiceInstance = kommonitorBatchUpdateHelperService; + + $scope.isFirstStart = true; + $scope.lastUpdateResponseObj; + $scope.timeseriesMappingReference; // gets updated by a broadcast whenever $scope.timeseries mapping in indicatorEditTimeseriesMapping component changes + $scope.selected = { value: kommonitorDataExchangeService.availableIndicators[0] }; + $scope.keepMissingValues = true; + + /* + { + "converter": { + "encoding": "string", + "mimeType": "string", + "name": "string", + "parameters": [{ + "name": "string", + "value": "string" + }], + "schema": "string" + }, + "dataSource": { + "parameters": [{ + "name": "string", + "value": "string" + }], + "type": "FILE" // FILE|HTTP|INLINE + }, + "propertyMapping": { + timeseriesMappings: [ + { + "indicatorValueProperty": "string", + "timestamp": "date" // direct timestamp + }, { + "indicatorValueProperty": "string", + "timestampProperty": "string" // attribute column that contains timestamp(s) + }], + spatialReferenceKeyProperty: "", + keepMissingOrNullValueIndicator: true, + }, + targetSpatialUnitName: "" + } + */ + $scope.batchList = []; + $scope.timeseriesMappingModalOpenForIndex; // temporarily stores for which index of the batch list the timeseries mapping modal is open + $scope.defaultTimeseriesMappingSave = []; + + // on modal opened + $('#modal-batch-update-indicators').on('show.bs.modal', function () { + // this check is necessary to avoid running the initialize method on opening datepicker modals + if(event) { + if(event.target.id === "button-batch-update-indicators") { + $scope.initialize(); + } + } + }); + + + // initializes the modal + $scope.initialize = function() { + + if($scope.isFirstStart) { + kommonitorBatchUpdateHelperService.addNewRowToBatchList("indicator", $scope.batchList) + $scope.isFirstStart = false; + } + + $(document).on("change", ".indicatorMappingTableInputField", function(){ + // get index of changed field + var index = kommonitorBatchUpdateHelperService.getIndexFromId(this.id); + + // get file + var file = this.files[0]; + + // read content + var reader = new FileReader(); + reader.addEventListener('load', function(event) { + kommonitorBatchUpdateHelperService.onMappingTableSelected("indicator", event, index, file, $scope.batchList); + }); + reader.readAsText(file) + }); + + $(document).on("change", ".indicatorDataSourceFileInputField", function(){ + // get index of changed field + var index = kommonitorBatchUpdateHelperService.getIndexFromId(this.id); + + // get file + var file = this.files[0]; + + // read content + var reader = new FileReader(); + reader.addEventListener('load', function() { + kommonitorBatchUpdateHelperService.onDataSourceFileSelected(file, index, $scope.batchList); + }); + reader.readAsText(file) + }); + + $scope.$digest(); + }; + + $scope.loadIndicatorsBatchList = function() { + $("#indicatorsBatchListFile").files = []; + + // trigger file chooser + $("#indicatorsBatchListFile").trigger("click"); + }; + + $(document).on("change", "#indicatorsBatchListFile" ,function(){ + + // get the file + var file = document.getElementById('indicatorsBatchListFile').files[0]; + kommonitorBatchUpdateHelperService.parseBatchListFromFile("indicator", file, $scope.batchList) + }); + + $scope.$on('indicatorBatchListParsed', function(event, data) { + $timeout(function() { + + var newBatchList = data.newValue; + + // remove all rows + for (var i = 0; i < $scope.batchList.length; i++) + $scope.batchList[i].isSelected = true; + kommonitorBatchUpdateHelperService.deleteSelectedRowsFromBatchList($scope.batchList, $scope.allRowsSelected); + + for(let i=0; i 0) + $scope.$broadcast('loadTimeseriesMapping', { mapping: timeseriesMappingProp}); + else + $scope.$broadcast('resetTimeseriesMapping'); + } + + }); + + $('#indicator-edit-default-time-series-mapping-modal').on('show.bs.modal', function (event) { + if(event.target.id === "indicator-edit-default-time-series-mapping-modal") { + if($scope.defaultTimeseriesMappingSave.length >= 1) + $scope.$broadcast('loadTimeseriesMapping', { mapping: $scope.defaultTimeseriesMappingSave }); + else + $scope.$broadcast('resetTimeseriesMapping'); + } + }); + + // on timeseries mapping modal closed + $('#indicator-edit-time-series-mapping-modal').on('hidden.bs.modal', function (event) { + if(event.target.id === "indicator-edit-time-series-mapping-modal") { + // store timeseries mapping to mappingObj + let index = $scope.timeseriesMappingModalOpenForIndex; + // converting to json and back gets rid of the $$hashkey property + $scope.batchList[index].mappingObj.propertyMapping.timeseriesMappings = angular.fromJson(angular.toJson($scope.timeseriesMappingReference)); + $scope.timeseriesMappingModalOpenForIndex = undefined; + // then reset the modal + //$scope.$broadcast('resetTimeseriesMapping') + } + }); + + // on default timeseries mapping modal closed + $('#indicator-edit-default-time-series-mapping-modal').on('hidden.bs.modal', function (event) { + if(event.target.id === "indicator-edit-default-time-series-mapping-modal") { + // store timeseries mapping to mappingObj + $scope.defaultTimeseriesMappingSave = $scope.timeseriesMappingReference; + // then reset the modal + //$scope.$broadcast('resetTimeseriesMapping') + } + }); + + + $scope.$on("batchUpdateCompleted", function(event, data) { + if(data.resourceType === "indicator") { + $scope.lastUpdateResponseObj = data; + } + }); + + + $scope.reopenResultModal = function() { + if (typeof $scope.lastUpdateResponseObj !== 'undefined') { + $rootScope.$broadcast("reopenBatchUpdateResultModal", $scope.lastUpdateResponseObj); + } + } + + $rootScope.$on("timeseriesMappingChanged", function(event, data) { + $scope.timeseriesMappingReference = data.mapping; + }); + + + } +]}); \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorBatchUpdateModal/indicator-batch-update-modal.module.js b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorBatchUpdateModal/indicator-batch-update-modal.module.js index 32101fd36..bdbe46f54 100644 --- a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorBatchUpdateModal/indicator-batch-update-modal.module.js +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorBatchUpdateModal/indicator-batch-update-modal.module.js @@ -1,20 +1,20 @@ +"use strict"; angular.module('indicatorBatchUpdateModal', ['kommonitorImporterHelper', 'kommonitorBatchUpdateHelper', 'ngSanitize', 'ui.select']); - -angular.module('indicatorBatchUpdateModal').filter('filterIndicators', function() { - return function(indicators, props) { +angular.module('indicatorBatchUpdateModal').filter('filterIndicators', function () { + return function (indicators, props) { // props is an object // properties can be defined when calling the filter, e. g. { indicatorName } - var result = [] + var result = []; var searchTermLower; if (props.hasOwnProperty("indicatorName")) - searchTermLower = props.indicatorName.toLowerCase() + searchTermLower = props.indicatorName.toLowerCase(); else - console.error("Given prarameter 'props' does not have a property named 'indicatorName'.") - - angular.forEach(indicators, function(indicator) { - if(indicator.indicatorName.toLowerCase().includes( searchTermLower ) && indicator.userPermissions.includes("editor")) - result.push(indicator) - }) + console.error("Given prarameter 'props' does not have a property named 'indicatorName'."); + angular.forEach(indicators, function (indicator) { + if (indicator.indicatorName.toLowerCase().includes(searchTermLower) && indicator.userPermissions.includes("editor")) + result.push(indicator); + }); return result; - } -}) \ No newline at end of file + }; +}); +//# sourceMappingURL=indicator-batch-update-modal.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorBatchUpdateModal/indicator-batch-update-modal.module.js.map b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorBatchUpdateModal/indicator-batch-update-modal.module.js.map new file mode 100644 index 000000000..8d1a7b219 --- /dev/null +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorBatchUpdateModal/indicator-batch-update-modal.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"indicator-batch-update-modal.module.js","sourceRoot":"","sources":["indicator-batch-update-modal.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,2BAA2B,EAAE,CAAC,0BAA0B,EAAE,6BAA6B,EAAE,YAAY,EAAE,WAAW,CAAC,CAAC,CAAC;AAEpI,OAAO,CAAC,MAAM,CAAC,2BAA2B,CAAC,CAAC,MAAM,CAAC,kBAAkB,EAAE;IACnE,OAAO,UAAS,UAAU,EAAE,KAAK;QAC7B,qBAAqB;QACrB,6EAA6E;QAC7E,IAAI,MAAM,GAAG,EAAE,CAAA;QACf,IAAI,eAAe,CAAC;QACpB,IAAI,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;YACrC,eAAe,GAAG,KAAK,CAAC,aAAa,CAAC,WAAW,EAAE,CAAA;;YAEnD,OAAO,CAAC,KAAK,CAAC,0EAA0E,CAAC,CAAA;QAE7F,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,UAAS,SAAS;YAC1C,IAAG,SAAS,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAE,eAAe,CAAE,IAAI,SAAS,CAAC,eAAe,CAAC,QAAQ,CAAC,QAAQ,CAAC;gBAChH,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;QAC9B,CAAC,CAAC,CAAA;QACF,OAAO,MAAM,CAAC;IAClB,CAAC,CAAA;AACL,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorBatchUpdateModal/indicator-batch-update-modal.module.ts b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorBatchUpdateModal/indicator-batch-update-modal.module.ts new file mode 100644 index 000000000..32101fd36 --- /dev/null +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorBatchUpdateModal/indicator-batch-update-modal.module.ts @@ -0,0 +1,20 @@ +angular.module('indicatorBatchUpdateModal', ['kommonitorImporterHelper', 'kommonitorBatchUpdateHelper', 'ngSanitize', 'ui.select']); + +angular.module('indicatorBatchUpdateModal').filter('filterIndicators', function() { + return function(indicators, props) { + // props is an object + // properties can be defined when calling the filter, e. g. { indicatorName } + var result = [] + var searchTermLower; + if (props.hasOwnProperty("indicatorName")) + searchTermLower = props.indicatorName.toLowerCase() + else + console.error("Given prarameter 'props' does not have a property named 'indicatorName'.") + + angular.forEach(indicators, function(indicator) { + if(indicator.indicatorName.toLowerCase().includes( searchTermLower ) && indicator.userPermissions.includes("editor")) + result.push(indicator) + }) + return result; + } +}) \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorDeleteModal/indicator-delete-modal.component.js b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorDeleteModal/indicator-delete-modal.component.js index 4c5a862c1..b6a85cad7 100644 --- a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorDeleteModal/indicator-delete-modal.component.js +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorDeleteModal/indicator-delete-modal.component.js @@ -1,431 +1,341 @@ +"use strict"; angular.module('indicatorDeleteModal').component('indicatorDeleteModal', { - templateUrl : "components/kommonitorAdmin/adminIndicatorsManagement/indicatorDeleteModal/indicator-delete-modal.template.html", - controller : ['kommonitorDataExchangeService', '$scope', '$rootScope', '$http', '__env', '$q', '$timeout', function IndicatorDeleteModalController(kommonitorDataExchangeService, $scope, $rootScope, $http, __env, $q, $timeout) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - - $scope.indicatorDeleteTypes = [{ - "displayName": "Gesamter Datensatz", - "apiName": "indicatorDataset" - }, - { - "displayName": "Einzelne Zeitschnitte", - "apiName": "indicatorTimestamp" - }, - { - "displayName": "Einzelne Raumebenen", - "apiName": "indicatorSpatialUnit" - }]; - $scope.indicatorDeleteType = $scope.indicatorDeleteTypes[0]; - $scope.selectedIndicatorDataset = undefined; - $scope.currentApplicableDates = []; - $scope.selectIndicatorTimestampsInput = false; - $scope.currentApplicableSpatialUnits = []; - $scope.selectIndicatorSpatialUnitsInput = false; - - $scope.loadingData = false; - - $scope.successfullyDeletedDatasets = []; - $scope.successfullyDeletedTimestamps = []; - $scope.successfullyDeletedSpatialUnits = []; - $scope.failedDatasetsAndErrors = []; - $scope.failedTimestampsAndErrors = []; - $scope.failedSpatialUnitsAndErrors = []; - - $scope.affectedScripts = []; - $scope.affectedIndicatorReferences = []; - $scope.affectedGeoresourceReferences = []; - - $scope.onChangeSelectIndicatorTimestampEntries = function(){ - - if(!$scope.selectIndicatorTimestampsInput){ - $scope.selectIndicatorTimestampsInput = true; - } - else{ - $scope.selectIndicatorTimestampsInput = false; - } - - if ($scope.selectIndicatorTimestampsInput){ - $scope.currentApplicableDates.forEach(function(applicableDate){ - applicableDate.isSelected = true; - - }); - } - else{ - $scope.currentApplicableDates.forEach(function(applicableDate){ - applicableDate.isSelected = false; - }); - } - }; - - $scope.onChangeSelectIndicatorSpatialUnitsEntries = function(){ - - if(!$scope.selectIndicatorSpatialUnitsInput){ - $scope.selectIndicatorSpatialUnitsInput = true; - } - else{ - $scope.selectIndicatorSpatialUnitsInput = false; - } - - if ($scope.selectIndicatorSpatialUnitsInput){ - $scope.currentApplicableSpatialUnits.forEach(function(applicableSpatialUnit){ - applicableSpatialUnit.isSelected = true; - - }); - } - else{ - $scope.currentApplicableSpatialUnits.forEach(function(applicableSpatialUnit){ - applicableSpatialUnit.isSelected = false; - }); - } - }; - - $scope.onChangeSelectedIndicator = function(){ - if ($scope.selectedIndicatorDataset){ - - $scope.currentIndicatorId = $scope.selectedIndicatorDataset.indicatorId; - - $scope.successfullyDeletedDatasets = []; - $scope.successfullyDeletedTimestamps = []; - $scope.successfullyDeletedSpatialUnits = []; - $scope.failedDatasetsAndErrors = []; - $scope.failedTimestampsAndErrors = []; - $scope.failedSpatialUnitsAndErrors = []; - - $scope.currentApplicableDates = []; - for (const timestamp of $scope.selectedIndicatorDataset.applicableDates) { - $scope.currentApplicableDates.push({ - "timestamp": timestamp, - "isSelected": false - - }); - } - - $scope.currentApplicableSpatialUnits = []; - for (const spatialUnitMetadata of kommonitorDataExchangeService.availableSpatialUnits) { - if($scope.selectedIndicatorDataset.applicableSpatialUnits && $scope.selectedIndicatorDataset.applicableSpatialUnits.some(o => o.spatialUnitName === spatialUnitMetadata.spatialUnitLevel)) - - $scope.currentApplicableSpatialUnits.push({ - "spatialUnitMetadata": spatialUnitMetadata, - "isSelected": false - - }); - } - - $scope.affectedScripts = $scope.gatherAffectedScripts(); - $scope.affectedIndicatorReferences = $scope.gatherAffectedIndicatorReferences(); - $scope.affectedGeoresourceReferences = $scope.gatherAffectedGeoresourceReferences(); - - setTimeout(() => { - // initialize any adminLTE box widgets - $('.box').boxWidget(); - }, 500); - } - }; - - $scope.resetIndicatorsDeleteForm = function(){ - - $scope.selectedIndicatorDataset = undefined; - $scope.currentApplicableDates = []; - $scope.selectIndicatorTimestampsInput = false; - $scope.currentApplicableSpatialUnits = []; - $scope.selectIndicatorSpatialUnitsInput = false; - $scope.indicatorDeleteType = $scope.indicatorDeleteTypes[0]; - - $scope.successfullyDeletedDatasets = []; - $scope.successfullyDeletedTimestamps = []; - $scope.successfullyDeletedSpatialUnits = []; - $scope.failedDatasetsAndErrors = []; - $scope.failedTimestampsAndErrors = []; - $scope.failedSpatialUnitsAndErrors = []; - $scope.affectedScripts = []; - $scope.affectedIndicatorReferences = []; - $scope.affectedGeoresourceReferences = []; - $("#georesourcesDeleteSuccessAlert").hide(); - $("#georesourcesDeleteErrorAlert").hide(); - - - }; - - $scope.gatherAffectedScripts = function(){ - $scope.affectedScripts = []; - - kommonitorDataExchangeService.availableProcessScripts.forEach(function(script){ - var requiredIndicatorIds = script.requiredIndicatorIds; - - for(var i=0; i 0){ - // error handling - $("#indicatorsDeleteErrorAlert").show(); - // if ($scope.successfullyDeletedDatasets.length > 0){ - // $("#indicatorsDeleteSuccessAlert").show(); - // } - - $scope.loadingData = false; - } - if($scope.successfullyDeletedTimestamps.length > 0){ - $("#indicatorsDeleteSuccessAlert").show(); - - // refresh overview table - $rootScope.$broadcast("refreshIndicatorOverviewTable", "edit", $scope.currentIndicatorId); - - // refresh all admin dashboard diagrams due to modified metadata - $timeout(function(){ - $rootScope.$broadcast("refreshAdminDashboardDiagrams"); - }, 500); - - $scope.loadingData = false; - - // $scope.resetIndicatorsDeleteForm(); - } - - }; - - $scope.deleteSelectedIndicatorSpatialUnits = async function(){ - - // iterate over all appicableSpatialUnits - for (const applicableSpatialUnit of $scope.currentApplicableSpatialUnits) { - if(applicableSpatialUnit.isSelected){ - await $scope.getDeleteSpatialUnitPromise(applicableSpatialUnit); - } - } - - if($scope.failedSpatialUnitsAndErrors.length > 0){ - // error handling - $("#indicatorsDeleteErrorAlert").show(); - // if ($scope.successfullyDeletedDatasets.length > 0){ - // $("#indicatorsDeleteSuccessAlert").show(); - // } - - $scope.loadingData = false; - } - if($scope.successfullyDeletedSpatialUnits.length > 0){ - $("#indicatorsDeleteSuccessAlert").show(); - - // fetch indicatorMetada again as a georesource was deleted - await kommonitorDataExchangeService.fetchIndicatorsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles); - // refresh overview table - $rootScope.$broadcast("refreshIndicatorOverviewTable", "edit", $scope.currentIndicatorId); - - // refresh all admin dashboard diagrams due to modified metadata - $timeout(function(){ - $rootScope.$broadcast("refreshAdminDashboardDiagrams"); - }, 500); - - $scope.loadingData = false; - - // $scope.resetIndicatorsDeleteForm(); - } - }; - - $scope.getDeleteTimestampPromise = function(applicableDate, spatialUnitId){ - - // timestamp looks like 2020-12-31 - var timestamp = applicableDate.timestamp; - - // [yyyy, mm, tt] - var timestampComps = timestamp.split("-"); - - return $http({ - url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/indicators/" + $scope.selectedIndicatorDataset.indicatorId + "/" + spatialUnitId + "/" + timestampComps[0] + "/" + timestampComps[1] + "/" + timestampComps[2], - method: "DELETE" - }).then(function successCallback(response) { - if(! $scope.successfullyDeletedTimestamps.includes(applicableDate)){ - $scope.successfullyDeletedTimestamps.push(applicableDate); - } - - }, function errorCallback(error) { - if(error.data){ - $scope.failedTimestampsAndErrors.push([applicableDate, kommonitorDataExchangeService.syntaxHighlightJSON(error.data)]); - } - else{ - $scope.failedTimestampsAndErrors.push([applicableDate, kommonitorDataExchangeService.syntaxHighlightJSON(error)]); - } - }); - }; - - $scope.getDeleteSpatialUnitPromise = function(applicableSpatialUnit){ - - return $http({ - url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/indicators/" + $scope.selectedIndicatorDataset.indicatorId + "/" + applicableSpatialUnit.spatialUnitMetadata.spatialUnitId, - method: "DELETE" - }).then(function successCallback(response) { - if(! $scope.successfullyDeletedSpatialUnits.includes(applicableSpatialUnit)){ - $scope.successfullyDeletedSpatialUnits.push(applicableSpatialUnit); - } - - }, function errorCallback(error) { - if(error.data){ - $scope.failedSpatialUnitsAndErrors.push([applicableSpatialUnit, kommonitorDataExchangeService.syntaxHighlightJSON(error.data)]); - } - else{ - $scope.failedSpatialUnitsAndErrors.push([applicableSpatialUnit, kommonitorDataExchangeService.syntaxHighlightJSON(error)]); - } - }); - }; - - $scope.hideSuccessAlert = function(){ - $("#indicatorsDeleteSuccessAlert").hide(); - }; - - $scope.hideErrorAlert = function(){ - $("#indicatorsDeleteErrorAlert").hide(); - }; - - $scope.getIndicatorsWithPermission = function(){ - let indicators = kommonitorDataExchangeService.availableIndicators.filter(indicator => indicator.userPermissions.includes("creator")); - return indicators; - }; - - } -]}); + templateUrl: "components/kommonitorAdmin/adminIndicatorsManagement/indicatorDeleteModal/indicator-delete-modal.template.html", + controller: ['kommonitorDataExchangeService', '$scope', '$rootScope', '$http', '__env', '$q', '$timeout', function IndicatorDeleteModalController(kommonitorDataExchangeService, $scope, $rootScope, $http, __env, $q, $timeout) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + $scope.indicatorDeleteTypes = [{ + "displayName": "Gesamter Datensatz", + "apiName": "indicatorDataset" + }, + { + "displayName": "Einzelne Zeitschnitte", + "apiName": "indicatorTimestamp" + }, + { + "displayName": "Einzelne Raumebenen", + "apiName": "indicatorSpatialUnit" + }]; + $scope.indicatorDeleteType = $scope.indicatorDeleteTypes[0]; + $scope.selectedIndicatorDataset = undefined; + $scope.currentApplicableDates = []; + $scope.selectIndicatorTimestampsInput = false; + $scope.currentApplicableSpatialUnits = []; + $scope.selectIndicatorSpatialUnitsInput = false; + $scope.loadingData = false; + $scope.successfullyDeletedDatasets = []; + $scope.successfullyDeletedTimestamps = []; + $scope.successfullyDeletedSpatialUnits = []; + $scope.failedDatasetsAndErrors = []; + $scope.failedTimestampsAndErrors = []; + $scope.failedSpatialUnitsAndErrors = []; + $scope.affectedScripts = []; + $scope.affectedIndicatorReferences = []; + $scope.affectedGeoresourceReferences = []; + $scope.onChangeSelectIndicatorTimestampEntries = function () { + if (!$scope.selectIndicatorTimestampsInput) { + $scope.selectIndicatorTimestampsInput = true; + } + else { + $scope.selectIndicatorTimestampsInput = false; + } + if ($scope.selectIndicatorTimestampsInput) { + $scope.currentApplicableDates.forEach(function (applicableDate) { + applicableDate.isSelected = true; + }); + } + else { + $scope.currentApplicableDates.forEach(function (applicableDate) { + applicableDate.isSelected = false; + }); + } + }; + $scope.onChangeSelectIndicatorSpatialUnitsEntries = function () { + if (!$scope.selectIndicatorSpatialUnitsInput) { + $scope.selectIndicatorSpatialUnitsInput = true; + } + else { + $scope.selectIndicatorSpatialUnitsInput = false; + } + if ($scope.selectIndicatorSpatialUnitsInput) { + $scope.currentApplicableSpatialUnits.forEach(function (applicableSpatialUnit) { + applicableSpatialUnit.isSelected = true; + }); + } + else { + $scope.currentApplicableSpatialUnits.forEach(function (applicableSpatialUnit) { + applicableSpatialUnit.isSelected = false; + }); + } + }; + $scope.onChangeSelectedIndicator = function () { + if ($scope.selectedIndicatorDataset) { + $scope.currentIndicatorId = $scope.selectedIndicatorDataset.indicatorId; + $scope.successfullyDeletedDatasets = []; + $scope.successfullyDeletedTimestamps = []; + $scope.successfullyDeletedSpatialUnits = []; + $scope.failedDatasetsAndErrors = []; + $scope.failedTimestampsAndErrors = []; + $scope.failedSpatialUnitsAndErrors = []; + $scope.currentApplicableDates = []; + for (const timestamp of $scope.selectedIndicatorDataset.applicableDates) { + $scope.currentApplicableDates.push({ + "timestamp": timestamp, + "isSelected": false + }); + } + $scope.currentApplicableSpatialUnits = []; + for (const spatialUnitMetadata of kommonitorDataExchangeService.availableSpatialUnits) { + if ($scope.selectedIndicatorDataset.applicableSpatialUnits && $scope.selectedIndicatorDataset.applicableSpatialUnits.some(o => o.spatialUnitName === spatialUnitMetadata.spatialUnitLevel)) + $scope.currentApplicableSpatialUnits.push({ + "spatialUnitMetadata": spatialUnitMetadata, + "isSelected": false + }); + } + $scope.affectedScripts = $scope.gatherAffectedScripts(); + $scope.affectedIndicatorReferences = $scope.gatherAffectedIndicatorReferences(); + $scope.affectedGeoresourceReferences = $scope.gatherAffectedGeoresourceReferences(); + setTimeout(() => { + // initialize any adminLTE box widgets + $('.box').boxWidget(); + }, 500); + } + }; + $scope.resetIndicatorsDeleteForm = function () { + $scope.selectedIndicatorDataset = undefined; + $scope.currentApplicableDates = []; + $scope.selectIndicatorTimestampsInput = false; + $scope.currentApplicableSpatialUnits = []; + $scope.selectIndicatorSpatialUnitsInput = false; + $scope.indicatorDeleteType = $scope.indicatorDeleteTypes[0]; + $scope.successfullyDeletedDatasets = []; + $scope.successfullyDeletedTimestamps = []; + $scope.successfullyDeletedSpatialUnits = []; + $scope.failedDatasetsAndErrors = []; + $scope.failedTimestampsAndErrors = []; + $scope.failedSpatialUnitsAndErrors = []; + $scope.affectedScripts = []; + $scope.affectedIndicatorReferences = []; + $scope.affectedGeoresourceReferences = []; + $("#georesourcesDeleteSuccessAlert").hide(); + $("#georesourcesDeleteErrorAlert").hide(); + }; + $scope.gatherAffectedScripts = function () { + $scope.affectedScripts = []; + kommonitorDataExchangeService.availableProcessScripts.forEach(function (script) { + var requiredIndicatorIds = script.requiredIndicatorIds; + for (var i = 0; i < requiredIndicatorIds.length; i++) { + var indicatorId = requiredIndicatorIds[i]; + if (indicatorId === $scope.selectedIndicatorDataset.indicatorId) { + $scope.affectedScripts.push(script); + break; + } + } + }); + return $scope.affectedScripts; + }; + $scope.gatherAffectedGeoresourceReferences = function () { + $scope.affectedGeoresourceReferences = []; + var georesourceReferences = $scope.selectedIndicatorDataset.referencedGeoresources; + for (var i = 0; i < georesourceReferences.length; i++) { + var georesourceReference = georesourceReferences[i]; + $scope.affectedGeoresourceReferences.push({ + "indicatorMetadata": $scope.selectedIndicatorDataset, + "georesourceReference": georesourceReference + }); + } + return $scope.affectedGeoresourceReferences; + }; + $scope.gatherAffectedIndicatorReferences = function () { + $scope.affectedIndicatorReferences = []; + // first add all direct references from selected indicator + var indicatorReferences_selectedIndicator = $scope.selectedIndicatorDataset.referencedIndicators; + for (var i = 0; i < indicatorReferences_selectedIndicator.length; i++) { + var indicatorReference_selectedIndicator = indicatorReferences_selectedIndicator[i]; + $scope.affectedIndicatorReferences.push({ + "indicatorMetadata": $scope.selectedIndicatorDataset, + "indicatorReference": indicatorReference_selectedIndicator + }); + } + // then add all references, where selected indicator is the referencedIndicator + kommonitorDataExchangeService.availableIndicators.forEach(function (indicator) { + var indicatorReferences = indicator.referencedIndicators; + for (var i = 0; i < indicatorReferences.length; i++) { + var indicatorReference = indicatorReferences[i]; + if (indicatorReference.referencedIndicatorId === $scope.selectedIndicatorDataset.indicatorId) { + $scope.affectedIndicatorReferences.push({ + "indicatorMetadata": $scope.selectedIndicatorDataset, + "indicatorReference": indicatorReference + }); + } + } + }); + return $scope.affectedIndicatorReferences; + }; + $scope.deleteIndicatorData = function () { + $scope.loadingData = true; + $scope.successfullyDeletedDatasets = []; + $scope.successfullyDeletedTimestamps = []; + $scope.successfullyDeletedSpatialUnits = []; + $scope.failedDatasetsAndErrors = []; + $scope.failedTimestampsAndErrors = []; + $scope.failedSpatialUnitsAndErrors = []; + // depending on deleteType we must execute different DELETE requests + if ($scope.indicatorDeleteType.apiName === "indicatorDataset") { + // delete complete dataset + $scope.deleteWholeIndicatorDataset(); + } + else if ($scope.indicatorDeleteType.apiName === "indicatorTimestamp") { + // delete all selected timestamps from indicator + $scope.deleteSelectedIndicatorTimestamps(); + } + else if ($scope.indicatorDeleteType.apiName === "indicatorSpatialUnit") { + // delete all selected spatial units from indicator + $scope.deleteSelectedIndicatorSpatialUnits(); + } + }; + $scope.deleteWholeIndicatorDataset = function () { + $scope.loadingData = true; + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/indicators/" + $scope.selectedIndicatorDataset.indicatorId, + method: "DELETE" + // headers: { + // 'Content-Type': undefined + // } + }).then(async function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + $scope.successfullyDeletedDatasets.push($scope.selectedIndicatorDataset); + // fetch indicatorMetada again as a indicator was deleted + $rootScope.$broadcast("refreshIndicatorOverviewTable", "delete", $scope.currentIndicatorId); + $timeout(function () { + $rootScope.$broadcast("refreshAdminDashboardDiagrams"); + }, 500); + $("#indicatorsDeleteSuccessAlert").show(); + $timeout(function () { + $scope.loadingData = false; + }); + // $scope.resetIndicatorsDeleteForm(); + }, function errorCallback(error) { + if (error.data) { + $scope.failedDatasetsAndErrors.push([$scope.selectedIndicatorDataset, kommonitorDataExchangeService.syntaxHighlightJSON(error.data)]); + } + else { + $scope.failedDatasetsAndErrors.push([$scope.selectedIndicatorDataset, kommonitorDataExchangeService.syntaxHighlightJSON(error)]); + } + $("#indicatorsDeleteErrorAlert").show(); + $scope.loadingData = false; + // setTimeout(function() { + // $("#indicatorEditMetadataSuccessAlert").hide(); + // }, 3000); + }); + }; + $scope.deleteSelectedIndicatorTimestamps = async function () { + // iterate over all appicableSpatialUnits and selected applicableDates + for (const applicableDate of $scope.currentApplicableDates) { + if (applicableDate.isSelected) { + for (const applicableSpatialUnit of $scope.currentApplicableSpatialUnits) { + await $scope.getDeleteTimestampPromise(applicableDate, applicableSpatialUnit.spatialUnitMetadata.spatialUnitId); + } + } + } + if ($scope.failedTimestampsAndErrors.length > 0) { + // error handling + $("#indicatorsDeleteErrorAlert").show(); + // if ($scope.successfullyDeletedDatasets.length > 0){ + // $("#indicatorsDeleteSuccessAlert").show(); + // } + $scope.loadingData = false; + } + if ($scope.successfullyDeletedTimestamps.length > 0) { + $("#indicatorsDeleteSuccessAlert").show(); + // refresh overview table + $rootScope.$broadcast("refreshIndicatorOverviewTable", "edit", $scope.currentIndicatorId); + // refresh all admin dashboard diagrams due to modified metadata + $timeout(function () { + $rootScope.$broadcast("refreshAdminDashboardDiagrams"); + }, 500); + $scope.loadingData = false; + // $scope.resetIndicatorsDeleteForm(); + } + }; + $scope.deleteSelectedIndicatorSpatialUnits = async function () { + // iterate over all appicableSpatialUnits + for (const applicableSpatialUnit of $scope.currentApplicableSpatialUnits) { + if (applicableSpatialUnit.isSelected) { + await $scope.getDeleteSpatialUnitPromise(applicableSpatialUnit); + } + } + if ($scope.failedSpatialUnitsAndErrors.length > 0) { + // error handling + $("#indicatorsDeleteErrorAlert").show(); + // if ($scope.successfullyDeletedDatasets.length > 0){ + // $("#indicatorsDeleteSuccessAlert").show(); + // } + $scope.loadingData = false; + } + if ($scope.successfullyDeletedSpatialUnits.length > 0) { + $("#indicatorsDeleteSuccessAlert").show(); + // fetch indicatorMetada again as a georesource was deleted + await kommonitorDataExchangeService.fetchIndicatorsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles); + // refresh overview table + $rootScope.$broadcast("refreshIndicatorOverviewTable", "edit", $scope.currentIndicatorId); + // refresh all admin dashboard diagrams due to modified metadata + $timeout(function () { + $rootScope.$broadcast("refreshAdminDashboardDiagrams"); + }, 500); + $scope.loadingData = false; + // $scope.resetIndicatorsDeleteForm(); + } + }; + $scope.getDeleteTimestampPromise = function (applicableDate, spatialUnitId) { + // timestamp looks like 2020-12-31 + var timestamp = applicableDate.timestamp; + // [yyyy, mm, tt] + var timestampComps = timestamp.split("-"); + return $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/indicators/" + $scope.selectedIndicatorDataset.indicatorId + "/" + spatialUnitId + "/" + timestampComps[0] + "/" + timestampComps[1] + "/" + timestampComps[2], + method: "DELETE" + }).then(function successCallback(response) { + if (!$scope.successfullyDeletedTimestamps.includes(applicableDate)) { + $scope.successfullyDeletedTimestamps.push(applicableDate); + } + }, function errorCallback(error) { + if (error.data) { + $scope.failedTimestampsAndErrors.push([applicableDate, kommonitorDataExchangeService.syntaxHighlightJSON(error.data)]); + } + else { + $scope.failedTimestampsAndErrors.push([applicableDate, kommonitorDataExchangeService.syntaxHighlightJSON(error)]); + } + }); + }; + $scope.getDeleteSpatialUnitPromise = function (applicableSpatialUnit) { + return $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/indicators/" + $scope.selectedIndicatorDataset.indicatorId + "/" + applicableSpatialUnit.spatialUnitMetadata.spatialUnitId, + method: "DELETE" + }).then(function successCallback(response) { + if (!$scope.successfullyDeletedSpatialUnits.includes(applicableSpatialUnit)) { + $scope.successfullyDeletedSpatialUnits.push(applicableSpatialUnit); + } + }, function errorCallback(error) { + if (error.data) { + $scope.failedSpatialUnitsAndErrors.push([applicableSpatialUnit, kommonitorDataExchangeService.syntaxHighlightJSON(error.data)]); + } + else { + $scope.failedSpatialUnitsAndErrors.push([applicableSpatialUnit, kommonitorDataExchangeService.syntaxHighlightJSON(error)]); + } + }); + }; + $scope.hideSuccessAlert = function () { + $("#indicatorsDeleteSuccessAlert").hide(); + }; + $scope.hideErrorAlert = function () { + $("#indicatorsDeleteErrorAlert").hide(); + }; + $scope.getIndicatorsWithPermission = function () { + let indicators = kommonitorDataExchangeService.availableIndicators.filter(indicator => indicator.userPermissions.includes("creator")); + return indicators; + }; + } + ] +}); +//# sourceMappingURL=indicator-delete-modal.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorDeleteModal/indicator-delete-modal.component.js.map b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorDeleteModal/indicator-delete-modal.component.js.map new file mode 100644 index 000000000..829d45a94 --- /dev/null +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorDeleteModal/indicator-delete-modal.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"indicator-delete-modal.component.js","sourceRoot":"","sources":["indicator-delete-modal.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC,SAAS,CAAC,sBAAsB,EAAE;IACxE,WAAW,EAAG,gHAAgH;IAC9H,UAAU,EAAG,CAAC,+BAA+B,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,8BAA8B,CAAC,6BAA6B,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ;YAE/N,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAE3E,MAAM,CAAC,oBAAoB,GAAG,CAAC;oBAC9B,aAAa,EAAE,oBAAoB;oBACnC,SAAS,EAAE,kBAAkB;iBAC7B;gBACD;oBACC,aAAa,EAAE,uBAAuB;oBACtC,SAAS,EAAE,oBAAoB;iBAC/B;gBACD;oBACC,aAAa,EAAE,qBAAqB;oBACpC,SAAS,EAAE,sBAAsB;iBACjC,CAAC,CAAC;YACH,MAAM,CAAC,mBAAmB,G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6B,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;qBAC3H;gBACH,CAAC,CAAC,CAAC;YACJ,CAAC,CAAC;YAEF,MAAM,CAAC,gBAAgB,GAAG;gBACzB,CAAC,CAAC,+BAA+B,CAAC,CAAC,IAAI,EAAE,CAAC;YAC3C,CAAC,CAAC;YAEF,MAAM,CAAC,cAAc,GAAG;gBACvB,CAAC,CAAC,6BAA6B,CAAC,CAAC,IAAI,EAAE,CAAC;YACzC,CAAC,CAAC;YAEF,MAAM,CAAC,2BAA2B,GAAG;gBACpC,IAAI,UAAU,GAAI,6BAA6B,CAAC,mBAAmB,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,eAAe,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;gBACvI,OAAO,UAAU,CAAC;YACnB,CAAC,CAAC;QAEJ,CAAC;KACD;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorDeleteModal/indicator-delete-modal.component.ts b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorDeleteModal/indicator-delete-modal.component.ts new file mode 100644 index 000000000..4c5a862c1 --- /dev/null +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorDeleteModal/indicator-delete-modal.component.ts @@ -0,0 +1,431 @@ +angular.module('indicatorDeleteModal').component('indicatorDeleteModal', { + templateUrl : "components/kommonitorAdmin/adminIndicatorsManagement/indicatorDeleteModal/indicator-delete-modal.template.html", + controller : ['kommonitorDataExchangeService', '$scope', '$rootScope', '$http', '__env', '$q', '$timeout', function IndicatorDeleteModalController(kommonitorDataExchangeService, $scope, $rootScope, $http, __env, $q, $timeout) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + + $scope.indicatorDeleteTypes = [{ + "displayName": "Gesamter Datensatz", + "apiName": "indicatorDataset" + }, + { + "displayName": "Einzelne Zeitschnitte", + "apiName": "indicatorTimestamp" + }, + { + "displayName": "Einzelne Raumebenen", + "apiName": "indicatorSpatialUnit" + }]; + $scope.indicatorDeleteType = $scope.indicatorDeleteTypes[0]; + $scope.selectedIndicatorDataset = undefined; + $scope.currentApplicableDates = []; + $scope.selectIndicatorTimestampsInput = false; + $scope.currentApplicableSpatialUnits = []; + $scope.selectIndicatorSpatialUnitsInput = false; + + $scope.loadingData = false; + + $scope.successfullyDeletedDatasets = []; + $scope.successfullyDeletedTimestamps = []; + $scope.successfullyDeletedSpatialUnits = []; + $scope.failedDatasetsAndErrors = []; + $scope.failedTimestampsAndErrors = []; + $scope.failedSpatialUnitsAndErrors = []; + + $scope.affectedScripts = []; + $scope.affectedIndicatorReferences = []; + $scope.affectedGeoresourceReferences = []; + + $scope.onChangeSelectIndicatorTimestampEntries = function(){ + + if(!$scope.selectIndicatorTimestampsInput){ + $scope.selectIndicatorTimestampsInput = true; + } + else{ + $scope.selectIndicatorTimestampsInput = false; + } + + if ($scope.selectIndicatorTimestampsInput){ + $scope.currentApplicableDates.forEach(function(applicableDate){ + applicableDate.isSelected = true; + + }); + } + else{ + $scope.currentApplicableDates.forEach(function(applicableDate){ + applicableDate.isSelected = false; + }); + } + }; + + $scope.onChangeSelectIndicatorSpatialUnitsEntries = function(){ + + if(!$scope.selectIndicatorSpatialUnitsInput){ + $scope.selectIndicatorSpatialUnitsInput = true; + } + else{ + $scope.selectIndicatorSpatialUnitsInput = false; + } + + if ($scope.selectIndicatorSpatialUnitsInput){ + $scope.currentApplicableSpatialUnits.forEach(function(applicableSpatialUnit){ + applicableSpatialUnit.isSelected = true; + + }); + } + else{ + $scope.currentApplicableSpatialUnits.forEach(function(applicableSpatialUnit){ + applicableSpatialUnit.isSelected = false; + }); + } + }; + + $scope.onChangeSelectedIndicator = function(){ + if ($scope.selectedIndicatorDataset){ + + $scope.currentIndicatorId = $scope.selectedIndicatorDataset.indicatorId; + + $scope.successfullyDeletedDatasets = []; + $scope.successfullyDeletedTimestamps = []; + $scope.successfullyDeletedSpatialUnits = []; + $scope.failedDatasetsAndErrors = []; + $scope.failedTimestampsAndErrors = []; + $scope.failedSpatialUnitsAndErrors = []; + + $scope.currentApplicableDates = []; + for (const timestamp of $scope.selectedIndicatorDataset.applicableDates) { + $scope.currentApplicableDates.push({ + "timestamp": timestamp, + "isSelected": false + + }); + } + + $scope.currentApplicableSpatialUnits = []; + for (const spatialUnitMetadata of kommonitorDataExchangeService.availableSpatialUnits) { + if($scope.selectedIndicatorDataset.applicableSpatialUnits && $scope.selectedIndicatorDataset.applicableSpatialUnits.some(o => o.spatialUnitName === spatialUnitMetadata.spatialUnitLevel)) + + $scope.currentApplicableSpatialUnits.push({ + "spatialUnitMetadata": spatialUnitMetadata, + "isSelected": false + + }); + } + + $scope.affectedScripts = $scope.gatherAffectedScripts(); + $scope.affectedIndicatorReferences = $scope.gatherAffectedIndicatorReferences(); + $scope.affectedGeoresourceReferences = $scope.gatherAffectedGeoresourceReferences(); + + setTimeout(() => { + // initialize any adminLTE box widgets + $('.box').boxWidget(); + }, 500); + } + }; + + $scope.resetIndicatorsDeleteForm = function(){ + + $scope.selectedIndicatorDataset = undefined; + $scope.currentApplicableDates = []; + $scope.selectIndicatorTimestampsInput = false; + $scope.currentApplicableSpatialUnits = []; + $scope.selectIndicatorSpatialUnitsInput = false; + $scope.indicatorDeleteType = $scope.indicatorDeleteTypes[0]; + + $scope.successfullyDeletedDatasets = []; + $scope.successfullyDeletedTimestamps = []; + $scope.successfullyDeletedSpatialUnits = []; + $scope.failedDatasetsAndErrors = []; + $scope.failedTimestampsAndErrors = []; + $scope.failedSpatialUnitsAndErrors = []; + $scope.affectedScripts = []; + $scope.affectedIndicatorReferences = []; + $scope.affectedGeoresourceReferences = []; + $("#georesourcesDeleteSuccessAlert").hide(); + $("#georesourcesDeleteErrorAlert").hide(); + + + }; + + $scope.gatherAffectedScripts = function(){ + $scope.affectedScripts = []; + + kommonitorDataExchangeService.availableProcessScripts.forEach(function(script){ + var requiredIndicatorIds = script.requiredIndicatorIds; + + for(var i=0; i 0){ + // error handling + $("#indicatorsDeleteErrorAlert").show(); + // if ($scope.successfullyDeletedDatasets.length > 0){ + // $("#indicatorsDeleteSuccessAlert").show(); + // } + + $scope.loadingData = false; + } + if($scope.successfullyDeletedTimestamps.length > 0){ + $("#indicatorsDeleteSuccessAlert").show(); + + // refresh overview table + $rootScope.$broadcast("refreshIndicatorOverviewTable", "edit", $scope.currentIndicatorId); + + // refresh all admin dashboard diagrams due to modified metadata + $timeout(function(){ + $rootScope.$broadcast("refreshAdminDashboardDiagrams"); + }, 500); + + $scope.loadingData = false; + + // $scope.resetIndicatorsDeleteForm(); + } + + }; + + $scope.deleteSelectedIndicatorSpatialUnits = async function(){ + + // iterate over all appicableSpatialUnits + for (const applicableSpatialUnit of $scope.currentApplicableSpatialUnits) { + if(applicableSpatialUnit.isSelected){ + await $scope.getDeleteSpatialUnitPromise(applicableSpatialUnit); + } + } + + if($scope.failedSpatialUnitsAndErrors.length > 0){ + // error handling + $("#indicatorsDeleteErrorAlert").show(); + // if ($scope.successfullyDeletedDatasets.length > 0){ + // $("#indicatorsDeleteSuccessAlert").show(); + // } + + $scope.loadingData = false; + } + if($scope.successfullyDeletedSpatialUnits.length > 0){ + $("#indicatorsDeleteSuccessAlert").show(); + + // fetch indicatorMetada again as a georesource was deleted + await kommonitorDataExchangeService.fetchIndicatorsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles); + // refresh overview table + $rootScope.$broadcast("refreshIndicatorOverviewTable", "edit", $scope.currentIndicatorId); + + // refresh all admin dashboard diagrams due to modified metadata + $timeout(function(){ + $rootScope.$broadcast("refreshAdminDashboardDiagrams"); + }, 500); + + $scope.loadingData = false; + + // $scope.resetIndicatorsDeleteForm(); + } + }; + + $scope.getDeleteTimestampPromise = function(applicableDate, spatialUnitId){ + + // timestamp looks like 2020-12-31 + var timestamp = applicableDate.timestamp; + + // [yyyy, mm, tt] + var timestampComps = timestamp.split("-"); + + return $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/indicators/" + $scope.selectedIndicatorDataset.indicatorId + "/" + spatialUnitId + "/" + timestampComps[0] + "/" + timestampComps[1] + "/" + timestampComps[2], + method: "DELETE" + }).then(function successCallback(response) { + if(! $scope.successfullyDeletedTimestamps.includes(applicableDate)){ + $scope.successfullyDeletedTimestamps.push(applicableDate); + } + + }, function errorCallback(error) { + if(error.data){ + $scope.failedTimestampsAndErrors.push([applicableDate, kommonitorDataExchangeService.syntaxHighlightJSON(error.data)]); + } + else{ + $scope.failedTimestampsAndErrors.push([applicableDate, kommonitorDataExchangeService.syntaxHighlightJSON(error)]); + } + }); + }; + + $scope.getDeleteSpatialUnitPromise = function(applicableSpatialUnit){ + + return $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/indicators/" + $scope.selectedIndicatorDataset.indicatorId + "/" + applicableSpatialUnit.spatialUnitMetadata.spatialUnitId, + method: "DELETE" + }).then(function successCallback(response) { + if(! $scope.successfullyDeletedSpatialUnits.includes(applicableSpatialUnit)){ + $scope.successfullyDeletedSpatialUnits.push(applicableSpatialUnit); + } + + }, function errorCallback(error) { + if(error.data){ + $scope.failedSpatialUnitsAndErrors.push([applicableSpatialUnit, kommonitorDataExchangeService.syntaxHighlightJSON(error.data)]); + } + else{ + $scope.failedSpatialUnitsAndErrors.push([applicableSpatialUnit, kommonitorDataExchangeService.syntaxHighlightJSON(error)]); + } + }); + }; + + $scope.hideSuccessAlert = function(){ + $("#indicatorsDeleteSuccessAlert").hide(); + }; + + $scope.hideErrorAlert = function(){ + $("#indicatorsDeleteErrorAlert").hide(); + }; + + $scope.getIndicatorsWithPermission = function(){ + let indicators = kommonitorDataExchangeService.availableIndicators.filter(indicator => indicator.userPermissions.includes("creator")); + return indicators; + }; + + } +]}); diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorDeleteModal/indicator-delete-modal.module.js b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorDeleteModal/indicator-delete-modal.module.js index f88d6d4ed..eee06ea97 100644 --- a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorDeleteModal/indicator-delete-modal.module.js +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorDeleteModal/indicator-delete-modal.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('indicatorDeleteModal', []); +//# sourceMappingURL=indicator-delete-modal.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorDeleteModal/indicator-delete-modal.module.js.map b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorDeleteModal/indicator-delete-modal.module.js.map new file mode 100644 index 000000000..c66a2dd2a --- /dev/null +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorDeleteModal/indicator-delete-modal.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"indicator-delete-modal.module.js","sourceRoot":"","sources":["indicator-delete-modal.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,sBAAsB,EAAE,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorDeleteModal/indicator-delete-modal.module.ts b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorDeleteModal/indicator-delete-modal.module.ts new file mode 100644 index 000000000..f88d6d4ed --- /dev/null +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorDeleteModal/indicator-delete-modal.module.ts @@ -0,0 +1 @@ +angular.module('indicatorDeleteModal', []); diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditFeaturesModal/indicator-edit-features-modal.component.js b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditFeaturesModal/indicator-edit-features-modal.component.js index 14c69d353..51f0c3abc 100644 --- a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditFeaturesModal/indicator-edit-features-modal.component.js +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditFeaturesModal/indicator-edit-features-modal.component.js @@ -1,718 +1,551 @@ +"use strict"; angular.module('indicatorEditFeaturesModal').component('indicatorEditFeaturesModal', { - templateUrl : "components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditFeaturesModal/indicator-edit-features-modal.template.html", - controller : ['kommonitorDataExchangeService', 'kommonitorDataGridHelperService', 'kommonitorImporterHelperService', - '$scope', '$rootScope', '$http', '__env', '$timeout', 'kommonitorMultiStepFormHelperService', - function IndicatorEditFeaturesModalController(kommonitorDataExchangeService, kommonitorDataGridHelperService, - kommonitorImporterHelperService, $scope, $rootScope, $http, __env, $timeout, kommonitorMultiStepFormHelperService) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorImporterHelperServiceInstance = kommonitorImporterHelperService; - this.kommonitorDataGridHelperServiceInstance = kommonitorDataGridHelperService; - - /* PUT BODY - { - "indicatorValues": [ - { - "spatialReferenceKey": "spatialReferenceKey", - "valueMapping": [ - { - "indicatorValue": 0.8008282, - "timestamp": "2000-01-23" - }, - { - "indicatorValue": 0.8008282, - "timestamp": "2000-01-23" - } - ] - }, - { - "spatialReferenceKey": "spatialReferenceKey", - "valueMapping": [ - { - "indicatorValue": 0.8008282, - "timestamp": "2000-01-23" - }, - { - "indicatorValue": 0.8008282, - "timestamp": "2000-01-23" - } - ] - } - ], - "applicableSpatialUnit": "applicableSpatialUnit", - "allowedRoles": [ - - ] - "defaultClassificationMapping": { - "colorBrewerSchemeName": "colorBrewerSchemeName", - "items": [ - { - "defaultCustomRating": "defaultCustomRating", - "defaultColorAsHex": "defaultColorAsHex" - }, - { - "defaultCustomRating": "defaultCustomRating", - "defaultColorAsHex": "defaultColorAsHex" - } - ] - } - } - */ - - - - $scope.roleManagementTableOptions = undefined; - - $scope.$on("availableRolesUpdate", function (event) { - refreshRoles(); - }); - - // make sure that initial fetching of availableRoles has happened - $scope.$on("initialMetadataLoadingCompleted", function (event) { - refreshRoles(); - }); - - function refreshRoles() { - let allowedRoles = $scope.targetApplicableSpatialUnit ? $scope.targetApplicableSpatialUnit.allowedRoles : []; - $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditFeaturesRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, allowedRoles); - } - - $scope.indicatorFeaturesJSON; - $scope.currentIndicatorDataset; - $scope.targetApplicableSpatialUnit; - $scope.remainingFeatureHeaders; - - $scope.indicatorMappingConfigImportError; - $scope.indicatorsEditFeaturesMappingConfigPre = kommonitorDataExchangeService.syntaxHighlightJSON(kommonitorImporterHelperService.mappingConfigStructure_indicator); - - - $scope.overviewTableTargetSpatialUnitMetadata = undefined; - - $scope.spatialUnitRefKeyProperty = undefined; - $scope.targetSpatialUnitMetadata = undefined; - - - $scope.converter = undefined; - $scope.schema = undefined; - $scope.mimeType = undefined; - $scope.datasourceType = undefined; - $scope.indicatorDataSourceIdProperty = undefined; - $scope.indicatorDataSourceNameProperty = undefined; - - $scope.converterDefinition = undefined; - $scope.datasourceTypeDefinition = undefined; - $scope.propertyMappingDefinition = undefined; - $scope.putBody_indicators = undefined; - - $scope.keepMissingValues = true; - - $scope.validityEndDate_perFeature = undefined; - $scope.validityStartDate_perFeature = undefined; - - $scope.successMessagePart = undefined; - $scope.errorMessagePart = undefined; - $scope.importerErrors = undefined; - - $scope.loadingData = false; - - $scope.timeseriesMappingReference; // gets updated by a broadcast whenever $scope.timeseries mapping in indicatorEditTimeseriesMapping component changes - - $scope.$on("onEditIndicatorFeatures", function (event, indicatorDataset) { - kommonitorMultiStepFormHelperService.registerClickHandler(); - if($scope.currentIndicatorDataset && $scope.currentIndicatorDataset.indicatorId === indicatorDataset.indicatorId){ - return; - } - else{ - $scope.currentIndicatorDataset = indicatorDataset; - - // $scope.refreshIndicatorEditFeaturesOverviewTable(); - - $scope.resetIndicatorEditFeaturesForm(); - - kommonitorDataGridHelperService.buildDataGrid_featureTable_indicatorResource("indicatorFeatureTable", [], []); - - } - - }); - - // called if indicator was edited - then we must make sure that the view is refreshed - // i.e. if a new spatial unit was setup the first time via edit menu, then we must ensure that this new spatial unit is actually - // visible within features overview table dropdown - $rootScope.$on("refreshIndicatorOverviewTableCompleted", function() { - if($scope.currentIndicatorDataset){ - $scope.currentIndicatorDataset = kommonitorDataExchangeService.getIndicatorMetadataById($scope.currentIndicatorDataset.indicatorId); - - $scope.$digest(); - } - - }); - - $scope.filterOverviewTargetSpatialUnits = function(){ - return function( spatialUnitMetadata ) { - if($scope.currentIndicatorDataset){ - var isIncluded = $scope.currentIndicatorDataset.applicableSpatialUnits.some(o => o.spatialUnitName === spatialUnitMetadata.spatialUnitLevel); - return isIncluded; - } - }; - }; - - $scope.refreshIndicatorEditFeaturesOverviewTable = function(){ - - $scope.loadingData = true; - // fetch all indicator features - $http({ - url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/indicators/" + $scope.currentIndicatorDataset.indicatorId + "/" + $scope.overviewTableTargetSpatialUnitMetadata.spatialUnitId + "/without-geometry", - method: "GET", - // headers: { - // 'Content-Type': undefined - // } - }).then(function successCallback(response) { - - $scope.indicatorFeaturesJSON = response.data; - - var tmpRemainingHeaders = []; - - for (var property in $scope.indicatorFeaturesJSON[0]){ - // only show indicator date columns as editable fields - // since we fetch the database view (with joined spatial unit), any additional information from the spatial unit must be filtered out - if (property.includes(__env.indicatorDatePrefix)){ - tmpRemainingHeaders.push(property); - } - } - - //sort date headers - tmpRemainingHeaders.sort((a, b) => a.localeCompare(b)); - - $scope.remainingFeatureHeaders = tmpRemainingHeaders; - kommonitorDataGridHelperService.buildDataGrid_featureTable_indicatorResource("indicatorFeatureTable", tmpRemainingHeaders, $scope.indicatorFeaturesJSON, $scope.currentIndicatorDataset.indicatorId, kommonitorDataGridHelperService.resourceType_indicator, $scope.enableDeleteFeatures, $scope.overviewTableTargetSpatialUnitMetadata.spatialUnitId); - - - $scope.loadingData = false; - - }, function errorCallback(error) { - if(error.data){ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else{ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - - $("#indicatorEditFeaturesErrorAlert").show(); - $scope.loadingData = false; - }); - }; - - $scope.clearAllIndicatorFeatures = function(){ - $scope.loadingData = true; - // delete all indicator features for target spatial unit - $http({ - url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/indicators/" + $scope.currentIndicatorDataset.indicatorId + "/" + $scope.overviewTableTargetSpatialUnitMetadata.spatialUnitId, - method: "DELETE", - // headers: { - // 'Content-Type': undefined - // } - }).then(function successCallback(response) { - - $scope.indicatorFeaturesJSON = undefined; - $scope.remainingFeatureHeaders = undefined; - - $rootScope.$broadcast("refreshIndicatorOverviewTable", "edit", $scope.currentIndicatorDataset.indicatorId); - // $scope.refreshIndicatorEditFeaturesOverviewTable(); - // force empty feature overview table on successful deletion of entries - kommonitorDataGridHelperService.buildDataGrid_featureTable_indicatorResource("indicatorFeatureTable", [], []); - - $scope.successMessagePart = $scope.currentIndicatorDataset.indicatorName; - - $("#indicatorEditFeaturesSuccessAlert").show(); - $scope.loadingData = false; - - }, function errorCallback(error) { - if(error.data){ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else{ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - - $("#indicatorEditFeaturesErrorAlert").show(); - $scope.loadingData = false; - }); - }; - - $scope.resetIndicatorEditFeaturesForm = function(){ - - // reset edit banners - kommonitorDataGridHelperService.featureTable_indicator_lastUpdate_timestamp_success = undefined; - kommonitorDataGridHelperService.featureTable_indicator_lastUpdate_timestamp_failure = undefined; - - $scope.indicatorFeaturesJSON = undefined; - $scope.remainingFeatureHeaders = undefined; - - $scope.overviewTableTargetSpatialUnitMetadata = undefined; - for (const spatialUnitMetadataEntry of kommonitorDataExchangeService.availableSpatialUnits) { - if($scope.currentIndicatorDataset.applicableSpatialUnits.some(o => o.spatialUnitName === spatialUnitMetadataEntry.spatialUnitLevel)){ - $scope.overviewTableTargetSpatialUnitMetadata = spatialUnitMetadataEntry; - break; - } - } - - $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditFeaturesRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, kommonitorDataExchangeService.getCurrentKomMonitorLoginRoleIds()); - - $scope.spatialUnitRefKeyProperty = undefined; - $scope.targetSpatialUnitMetadata = undefined; - $scope.targetApplicableSpatialUnit = undefined; - - - $scope.converter = undefined; - $scope.schema = undefined; - $scope.mimeType = undefined; - $scope.datasourceType = undefined; - $scope.indicatorDataSourceIdProperty = undefined; - $scope.indicatorDataSourceNameProperty = undefined; - - $scope.converterDefinition = undefined; - $scope.datasourceTypeDefinition = undefined; - $scope.propertyMappingDefinition = undefined; - $scope.putBody_indicators = undefined; - - $scope.keepMissingValues = true; - - $scope.validityEndDate_perFeature = undefined; - $scope.validityStartDate_perFeature = undefined; - - $scope.indicatorDataSourceIdProperty = undefined; - $scope.indicatorDataSourceNameProperty = undefined; - - $scope.successMessagePart = undefined; - $scope.errorMessagePart = undefined; - $scope.importerErrors = undefined; - - $rootScope.$broadcast('resetTimeseriesMapping') - - $("#indicatorEditFeaturesSuccessAlert").hide(); - $("#indicatorEditFeaturesErrorAlert").hide(); - - setTimeout(() => { - $scope.$digest(); - }, 250); - - }; - - $scope.onChangeSelectedSpatialUnit = function(targetSpatialUnitMetadata){ - - var applicableSpatialUnits = $scope.currentIndicatorDataset.applicableSpatialUnits; - - for (const applicableSpatialUnit of applicableSpatialUnits) { - if (applicableSpatialUnit.spatialUnitId === targetSpatialUnitMetadata.spatialUnitId){ - $scope.targetApplicableSpatialUnit = applicableSpatialUnit; - break; - } - } - - $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditFeaturesRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, $scope.targetApplicableSpatialUnit.allowedRoles); - - }; - - $scope.onChangeConverter = function(){ - $scope.schema = $scope.converter.schemas ? $scope.converter.schemas[0] : undefined; - $scope.mimeType = $scope.converter.mimeTypes[0]; - }; - - $scope.onChangeMimeType = function(mimeType){ - $scope.mimeType = mimeType; - }; - - $scope.filterByKomMonitorProperties = function() { - return function( item ) { - - try{ - if (item === __env.FEATURE_ID_PROPERTY_NAME || item === __env.FEATURE_NAME_PROPERTY_NAME || item === "validStartDate" || item === "validEndDate"){ - return false; - } - return true; - } - catch(error){ - return false; - } - }; - }; - - - - - $scope.getFeatureId = function(jsonFeature){ - return jsonFeature[__env.FEATURE_ID_PROPERTY_NAME]; - }; - - $scope.getFeatureName = function(jsonFeature){ - return jsonFeature[__env.FEATURE_NAME_PROPERTY_NAME]; - }; - - - $scope.buildImporterObjects = async function(){ - $scope.converterDefinition = $scope.buildConverterDefinition(); - $scope.datasourceTypeDefinition = await $scope.buildDatasourceTypeDefinition(); - $scope.propertyMappingDefinition = $scope.buildPropertyMappingDefinition(); - - let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); - - var scopeProperties = { - "targetSpatialUnitMetadata": { - "spatialUnitLevel": $scope.targetSpatialUnitMetadata.spatialUnitLevel, - }, - "currentIndicatorDataset": { - "defaultClassificationMapping": $scope.currentIndicatorDataset.defaultClassificationMapping - }, - "allowedRoles": roleIds - } - $scope.putBody_indicators = kommonitorImporterHelperService.buildPutBody_indicators(scopeProperties); - - if(!$scope.converterDefinition || !$scope.datasourceTypeDefinition || !$scope.propertyMappingDefinition || !$scope.putBody_indicators){ - return false; - } - - return true; - }; - - $scope.buildConverterDefinition = function(){ - - return kommonitorImporterHelperService.buildConverterDefinition($scope.converter, "converterParameter_indicatorEditFeatures_", $scope.schema, $scope.mimeType); - }; - - $scope.buildDatasourceTypeDefinition = async function(){ - try { - return await kommonitorImporterHelperService.buildDatasourceTypeDefinition($scope.datasourceType, 'datasourceTypeParameter_indicatorEditFeatures_', 'indicatorDataSourceInput_editFeatures'); - } catch (error) { - if(error.data){ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else{ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - - $("#indicatorEditFeaturesErrorAlert").show(); - $scope.loadingData = false; - return null; - } - }; - - $scope.buildPropertyMappingDefinition = function(){ - // arsion from is undefined currently - let timeseriesMappingForImporter = []; - timeseriesMappingForImporter = $scope.timeseriesMappingReference; - console.log("timeseriesMappingForImporter: ", timeseriesMappingForImporter); - return kommonitorImporterHelperService.buildPropertyMapping_indicatorResource($scope.spatialUnitRefKeyProperty, timeseriesMappingForImporter, $scope.keepMissingValues); - }; - - - - - $scope.editIndicatorFeatures = async function(){ - - $timeout(function(){ - $scope.loadingData = true; - }); - - $scope.importerErrors = undefined; - $scope.successMessagePart = undefined; - $scope.errorMessagePart = undefined; - - /* - now collect data and build request for importer - */ - - /* - if any required importer data is missing --> cancel request and highlight required errors - */ - var allDataSpecified = await $scope.buildImporterObjects(); - - if (!allDataSpecified) { - - $("#spatialUnitEditFeaturesForm").validator("update"); - $("#spatialUnitEditFeaturesForm").validator("validate"); - return; - } - else { - - - // TODO verify input - - // TODO Create and perform POST Request with loading screen - - var updateIndicatorResponse_dryRun = undefined; - try { - updateIndicatorResponse_dryRun = await kommonitorImporterHelperService.updateIndicator($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.currentIndicatorDataset.indicatorId, $scope.putBody_indicators, true); - - // this callback will be called asynchronously - // when the response is available - - if(! kommonitorImporterHelperService.importerResponseContainsErrors(updateIndicatorResponse_dryRun)){ - // all good, really execute the request to import data against data management API - var updateIndicatorResponse = await kommonitorImporterHelperService.updateIndicator($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.currentIndicatorDataset.indicatorId, $scope.putBody_indicators, false); - - $rootScope.$broadcast("refreshIndicatorOverviewTable", "edit", $scope.currentIndicatorDataset.indicatorId); - // $scope.refreshIndicatorEditFeaturesOverviewTable(); - - $scope.successMessagePart = $scope.currentIndicatorDataset.indicatorName; - $scope.importedFeatures = kommonitorImporterHelperService.getImportedFeaturesFromImporterResponse(updateIndicatorResponse); - - $("#indicatorEditFeaturesSuccessAlert").show(); - $scope.loadingData = false; - } - else{ - // errors ocurred - // show them - $scope.errorMessagePart = "Einige der zu importierenden Features des Datensatzes weisen kritische Fehler auf"; - $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(updateIndicatorResponse_dryRun); - - $("#indicatorEditFeaturesErrorAlert").show(); - $scope.loadingData = false; - - setTimeout(() => { - $scope.$digest(); - }, 250); - - } - } catch (error) { - if(error.data){ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else{ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - if(updateIndicatorResponse_dryRun){ - $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(updateIndicatorResponse_dryRun); - } - - $("#indicatorEditFeaturesErrorAlert").show(); - $scope.loadingData = false; - - setTimeout(() => { - $scope.$digest(); - }, 250); - } - } - }; - - $scope.onImportIndicatorEditFeaturesMappingConfig = function(){ - - $scope.indicatorMappingConfigImportError = ""; - - $("#indicatorMappingConfigEditFeaturesImportFile").files = []; - - // trigger file chooser - $("#indicatorMappingConfigEditFeaturesImportFile").click(); - - }; - - $(document).on("change", "#indicatorMappingConfigEditFeaturesImportFile" ,function(){ - - console.log("Importing Importer Mapping Config for EditFeatures Indicator Form"); - - // get the file - var file = document.getElementById('indicatorMappingConfigEditFeaturesImportFile').files[0]; - $scope.parseMappingConfigFromFile(file); - }); - - $scope.parseMappingConfigFromFile = function(file){ - var fileReader = new FileReader(); - - fileReader.onload = function(event) { - - try{ - $scope.parseFromMappingConfigFile(event); - } - catch(error){ - console.error(error); - console.error("Uploaded MappingConfig File cannot be parsed."); - $scope.indicatorMappingConfigImportError = "Uploaded MappingConfig File cannot be parsed correctly"; - document.getElementById("indicatorsEditFeaturesMappingConfigPre").innerHTML = $scope.indicatorMappingConfigStructure_pretty; - $("#indicatorEditFeaturesMappingConfigImportErrorAlert").show(); - - $scope.$digest(); - } - - }; - - // Read in the image file as a data URL. - fileReader.readAsText(file); - }; - - $scope.parseFromMappingConfigFile = function(event){ - $scope.mappingConfigImportSettings = JSON.parse(event.target.result); - - if(! $scope.mappingConfigImportSettings.converter || ! $scope.mappingConfigImportSettings.dataSource || ! $scope.mappingConfigImportSettings.propertyMapping){ - console.error("uploaded MappingConfig File cannot be parsed - wrong structure."); - $scope.indicatorMetadataImportError = "Struktur der Datei stimmt nicht mit erwartetem Muster überein."; - document.getElementById("indicatorsEditFeaturesMappingConfigPre").innerHTML = $scope.indicatorMappingConfigStructure_pretty; - $("#indicatorEditFeaturesMappingConfigImportErrorAlert").show(); - - $scope.$digest(); - } - - $scope.converter = undefined; - for(var converter of kommonitorImporterHelperService.availableConverters){ - if (converter.name === $scope.mappingConfigImportSettings.converter.name){ - $scope.converter = converter; - break; - } - } - - $scope.schema = undefined; - if ($scope.converter && $scope.converter.schemas && $scope.mappingConfigImportSettings.converter.schema){ - for (var schema of $scope.converter.schemas) { - if (schema === $scope.mappingConfigImportSettings.converter.schema){ - $scope.schema = schema; - } - } - } - - $scope.mimeType = undefined; - if ($scope.converter && $scope.converter.mimeTypes && $scope.mappingConfigImportSettings.converter.mimeType){ - for (var mimeType of $scope.converter.mimeTypes) { - if (mimeType === $scope.mappingConfigImportSettings.converter.mimeType){ - $scope.mimeType = mimeType; - } - } - } - - $scope.datasourceType = undefined; - for(var datasourceType of kommonitorImporterHelperService.availableDatasourceTypes){ - if (datasourceType.type === $scope.mappingConfigImportSettings.dataSource.type){ - $scope.datasourceType = datasourceType; - break; - } - } - - $scope.$digest(); - - // converter parameters - if ($scope.converter){ - for (var convParameter of $scope.mappingConfigImportSettings.converter.parameters) { - $("#converterParameter_indicatorEditFeatures_" + convParameter.name).val(convParameter.value); - } - } - - // datasourceTypes parameters - if ($scope.datasourceType){ - for (var dsParameter of $scope.mappingConfigImportSettings.dataSource.parameters) { - $("#datasourceTypeParameter_indicatorEditFeatures_" + dsParameter.name).val(dsParameter.value); - } - } - - // property Mapping - $scope.spatialUnitRefKeyProperty = $scope.mappingConfigImportSettings.propertyMapping.spatialReferenceKeyProperty; - - $scope.$broadcast('loadTimeseriesMapping', { mapping: $scope.mappingConfigImportSettings.propertyMapping.timeseriesMappings } ); - - if($scope.mappingConfigImportSettings.targetSpatialUnitName){ - for (const spatialUnitMetadata of kommonitorDataExchangeService.availableSpatialUnits) { - if(spatialUnitMetadata.spatialUnitLevel === $scope.mappingConfigImportSettings.targetSpatialUnitName){ - $scope.targetSpatialUnitMetadata = spatialUnitMetadata; - } - - } - } - - $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditFeaturesRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, $scope.mappingConfigImportSettings.allowedRoles); - - $scope.keepMissingValues = $scope.mappingConfigImportSettings.propertyMapping.keepMissingOrNullValueIndicator; - - $scope.$digest(); - }; - - $scope.onExportIndicatorEditFeaturesMappingConfig = async function(){ - var converterDefinition = $scope.buildConverterDefinition(); - var datasourceTypeDefinition = await $scope.buildDatasourceTypeDefinition(); - var propertyMappingDefinition = $scope.buildPropertyMappingDefinition(); - - var mappingConfigExport = { - "converter": converterDefinition, - "dataSource": datasourceTypeDefinition, - "propertyMapping": propertyMappingDefinition, - "targetSpatialUnitName": $scope.targetSpatialUnitMetadata.spatialUnitLevel, - "allowedRoles": [] - }; - - mappingConfigExport.allowedRoles = []; - - let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); - for (const roleId of roleIds) { - mappingConfigExport.allowedRoles.push(roleId); - } - - mappingConfigExport.periodOfValidity = $scope.periodOfValidity; - - var name = $scope.datasetName; - - var metadataJSON = JSON.stringify(mappingConfigExport); - - var fileName = "KomMonitor-Import-Mapping-Konfiguration_Export"; - - if (name){ - fileName += "-" + name; - } - - fileName += ".json"; - - var blob = new Blob([metadataJSON], {type: "application/json"}); - var data = URL.createObjectURL(blob); - - var a = document.createElement('a'); - a.download = fileName; - a.href = data; - a.textContent = "JSON"; - a.target = "_blank"; - a.rel = "noopener noreferrer"; - a.click(); - - a.remove(); - }; - - - $scope.hideSuccessAlert = function(){ - $("#indicatorEditFeaturesSuccessAlert").hide(); - }; - - $scope.hideErrorAlert = function(){ - $("#indicatorEditFeaturesErrorAlert").hide(); - }; - - $scope.hideMappingConfigErrorAlert = function(){ - $("#indicatorEditFeaturesMappingConfigImportErrorAlert").hide(); - }; - - $rootScope.$on("showLoadingIcon_" + kommonitorDataGridHelperService.resourceType_indicator, function(event){ - $timeout(function(){ - - $scope.loadingData = true; - }); - }); - - $rootScope.$on("hideLoadingIcon_" + kommonitorDataGridHelperService.resourceType_indicator, function(event){ - $timeout(function(){ - - $scope.loadingData = false; - }); - }); - - $rootScope.$on("onDeleteFeatureEntry_" + kommonitorDataGridHelperService.resourceType_indicator, function(event){ - $rootScope.$broadcast("refreshIndicatorOverviewTable", "edit", $scope.currentIndicatorDataset.indicatorId); - $scope.refreshIndicatorEditFeaturesOverviewTable(); - }); - - $scope.onChangeEnableDeleteFeatures = function(){ - if($scope.enableDeleteFeatures){ - $(".indicatorDeleteFeatureRecordBtn").attr("disabled", false); - } - else{ - $(".indicatorDeleteFeatureRecordBtn").attr("disabled", true); - } - } - - $rootScope.$on("timeseriesMappingChanged", function(event, data) { - $scope.timeseriesMappingReference = data.mapping; - }); - - } -]}); + templateUrl: "components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditFeaturesModal/indicator-edit-features-modal.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorDataGridHelperService', 'kommonitorImporterHelperService', + '$scope', '$rootScope', '$http', '__env', '$timeout', 'kommonitorMultiStepFormHelperService', + function IndicatorEditFeaturesModalController(kommonitorDataExchangeService, kommonitorDataGridHelperService, kommonitorImporterHelperService, $scope, $rootScope, $http, __env, $timeout, kommonitorMultiStepFormHelperService) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorImporterHelperServiceInstance = kommonitorImporterHelperService; + this.kommonitorDataGridHelperServiceInstance = kommonitorDataGridHelperService; + /* PUT BODY + { + "indicatorValues": [ + { + "spatialReferenceKey": "spatialReferenceKey", + "valueMapping": [ + { + "indicatorValue": 0.8008282, + "timestamp": "2000-01-23" + }, + { + "indicatorValue": 0.8008282, + "timestamp": "2000-01-23" + } + ] + }, + { + "spatialReferenceKey": "spatialReferenceKey", + "valueMapping": [ + { + "indicatorValue": 0.8008282, + "timestamp": "2000-01-23" + }, + { + "indicatorValue": 0.8008282, + "timestamp": "2000-01-23" + } + ] + } + ], + "applicableSpatialUnit": "applicableSpatialUnit", + "allowedRoles": [ + + ] + "defaultClassificationMapping": { + "colorBrewerSchemeName": "colorBrewerSchemeName", + "items": [ + { + "defaultCustomRating": "defaultCustomRating", + "defaultColorAsHex": "defaultColorAsHex" + }, + { + "defaultCustomRating": "defaultCustomRating", + "defaultColorAsHex": "defaultColorAsHex" + } + ] + } + } + */ + $scope.roleManagementTableOptions = undefined; + $scope.$on("availableRolesUpdate", function (event) { + refreshRoles(); + }); + // make sure that initial fetching of availableRoles has happened + $scope.$on("initialMetadataLoadingCompleted", function (event) { + refreshRoles(); + }); + function refreshRoles() { + let allowedRoles = $scope.targetApplicableSpatialUnit ? $scope.targetApplicableSpatialUnit.allowedRoles : []; + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditFeaturesRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, allowedRoles); + } + $scope.indicatorFeaturesJSON; + $scope.currentIndicatorDataset; + $scope.targetApplicableSpatialUnit; + $scope.remainingFeatureHeaders; + $scope.indicatorMappingConfigImportError; + $scope.indicatorsEditFeaturesMappingConfigPre = kommonitorDataExchangeService.syntaxHighlightJSON(kommonitorImporterHelperService.mappingConfigStructure_indicator); + $scope.overviewTableTargetSpatialUnitMetadata = undefined; + $scope.spatialUnitRefKeyProperty = undefined; + $scope.targetSpatialUnitMetadata = undefined; + $scope.converter = undefined; + $scope.schema = undefined; + $scope.mimeType = undefined; + $scope.datasourceType = undefined; + $scope.indicatorDataSourceIdProperty = undefined; + $scope.indicatorDataSourceNameProperty = undefined; + $scope.converterDefinition = undefined; + $scope.datasourceTypeDefinition = undefined; + $scope.propertyMappingDefinition = undefined; + $scope.putBody_indicators = undefined; + $scope.keepMissingValues = true; + $scope.validityEndDate_perFeature = undefined; + $scope.validityStartDate_perFeature = undefined; + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + $scope.importerErrors = undefined; + $scope.loadingData = false; + $scope.timeseriesMappingReference; // gets updated by a broadcast whenever $scope.timeseries mapping in indicatorEditTimeseriesMapping component changes + $scope.$on("onEditIndicatorFeatures", function (event, indicatorDataset) { + kommonitorMultiStepFormHelperService.registerClickHandler(); + if ($scope.currentIndicatorDataset && $scope.currentIndicatorDataset.indicatorId === indicatorDataset.indicatorId) { + return; + } + else { + $scope.currentIndicatorDataset = indicatorDataset; + // $scope.refreshIndicatorEditFeaturesOverviewTable(); + $scope.resetIndicatorEditFeaturesForm(); + kommonitorDataGridHelperService.buildDataGrid_featureTable_indicatorResource("indicatorFeatureTable", [], []); + } + }); + // called if indicator was edited - then we must make sure that the view is refreshed + // i.e. if a new spatial unit was setup the first time via edit menu, then we must ensure that this new spatial unit is actually + // visible within features overview table dropdown + $rootScope.$on("refreshIndicatorOverviewTableCompleted", function () { + if ($scope.currentIndicatorDataset) { + $scope.currentIndicatorDataset = kommonitorDataExchangeService.getIndicatorMetadataById($scope.currentIndicatorDataset.indicatorId); + $scope.$digest(); + } + }); + $scope.filterOverviewTargetSpatialUnits = function () { + return function (spatialUnitMetadata) { + if ($scope.currentIndicatorDataset) { + var isIncluded = $scope.currentIndicatorDataset.applicableSpatialUnits.some(o => o.spatialUnitName === spatialUnitMetadata.spatialUnitLevel); + return isIncluded; + } + }; + }; + $scope.refreshIndicatorEditFeaturesOverviewTable = function () { + $scope.loadingData = true; + // fetch all indicator features + $http({ + url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/indicators/" + $scope.currentIndicatorDataset.indicatorId + "/" + $scope.overviewTableTargetSpatialUnitMetadata.spatialUnitId + "/without-geometry", + method: "GET", + // headers: { + // 'Content-Type': undefined + // } + }).then(function successCallback(response) { + $scope.indicatorFeaturesJSON = response.data; + var tmpRemainingHeaders = []; + for (var property in $scope.indicatorFeaturesJSON[0]) { + // only show indicator date columns as editable fields + // since we fetch the database view (with joined spatial unit), any additional information from the spatial unit must be filtered out + if (property.includes(__env.indicatorDatePrefix)) { + tmpRemainingHeaders.push(property); + } + } + //sort date headers + tmpRemainingHeaders.sort((a, b) => a.localeCompare(b)); + $scope.remainingFeatureHeaders = tmpRemainingHeaders; + kommonitorDataGridHelperService.buildDataGrid_featureTable_indicatorResource("indicatorFeatureTable", tmpRemainingHeaders, $scope.indicatorFeaturesJSON, $scope.currentIndicatorDataset.indicatorId, kommonitorDataGridHelperService.resourceType_indicator, $scope.enableDeleteFeatures, $scope.overviewTableTargetSpatialUnitMetadata.spatialUnitId); + $scope.loadingData = false; + }, function errorCallback(error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + $("#indicatorEditFeaturesErrorAlert").show(); + $scope.loadingData = false; + }); + }; + $scope.clearAllIndicatorFeatures = function () { + $scope.loadingData = true; + // delete all indicator features for target spatial unit + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/indicators/" + $scope.currentIndicatorDataset.indicatorId + "/" + $scope.overviewTableTargetSpatialUnitMetadata.spatialUnitId, + method: "DELETE", + // headers: { + // 'Content-Type': undefined + // } + }).then(function successCallback(response) { + $scope.indicatorFeaturesJSON = undefined; + $scope.remainingFeatureHeaders = undefined; + $rootScope.$broadcast("refreshIndicatorOverviewTable", "edit", $scope.currentIndicatorDataset.indicatorId); + // $scope.refreshIndicatorEditFeaturesOverviewTable(); + // force empty feature overview table on successful deletion of entries + kommonitorDataGridHelperService.buildDataGrid_featureTable_indicatorResource("indicatorFeatureTable", [], []); + $scope.successMessagePart = $scope.currentIndicatorDataset.indicatorName; + $("#indicatorEditFeaturesSuccessAlert").show(); + $scope.loadingData = false; + }, function errorCallback(error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + $("#indicatorEditFeaturesErrorAlert").show(); + $scope.loadingData = false; + }); + }; + $scope.resetIndicatorEditFeaturesForm = function () { + // reset edit banners + kommonitorDataGridHelperService.featureTable_indicator_lastUpdate_timestamp_success = undefined; + kommonitorDataGridHelperService.featureTable_indicator_lastUpdate_timestamp_failure = undefined; + $scope.indicatorFeaturesJSON = undefined; + $scope.remainingFeatureHeaders = undefined; + $scope.overviewTableTargetSpatialUnitMetadata = undefined; + for (const spatialUnitMetadataEntry of kommonitorDataExchangeService.availableSpatialUnits) { + if ($scope.currentIndicatorDataset.applicableSpatialUnits.some(o => o.spatialUnitName === spatialUnitMetadataEntry.spatialUnitLevel)) { + $scope.overviewTableTargetSpatialUnitMetadata = spatialUnitMetadataEntry; + break; + } + } + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditFeaturesRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, kommonitorDataExchangeService.getCurrentKomMonitorLoginRoleIds()); + $scope.spatialUnitRefKeyProperty = undefined; + $scope.targetSpatialUnitMetadata = undefined; + $scope.targetApplicableSpatialUnit = undefined; + $scope.converter = undefined; + $scope.schema = undefined; + $scope.mimeType = undefined; + $scope.datasourceType = undefined; + $scope.indicatorDataSourceIdProperty = undefined; + $scope.indicatorDataSourceNameProperty = undefined; + $scope.converterDefinition = undefined; + $scope.datasourceTypeDefinition = undefined; + $scope.propertyMappingDefinition = undefined; + $scope.putBody_indicators = undefined; + $scope.keepMissingValues = true; + $scope.validityEndDate_perFeature = undefined; + $scope.validityStartDate_perFeature = undefined; + $scope.indicatorDataSourceIdProperty = undefined; + $scope.indicatorDataSourceNameProperty = undefined; + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + $scope.importerErrors = undefined; + $rootScope.$broadcast('resetTimeseriesMapping'); + $("#indicatorEditFeaturesSuccessAlert").hide(); + $("#indicatorEditFeaturesErrorAlert").hide(); + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.onChangeSelectedSpatialUnit = function (targetSpatialUnitMetadata) { + var applicableSpatialUnits = $scope.currentIndicatorDataset.applicableSpatialUnits; + for (const applicableSpatialUnit of applicableSpatialUnits) { + if (applicableSpatialUnit.spatialUnitId === targetSpatialUnitMetadata.spatialUnitId) { + $scope.targetApplicableSpatialUnit = applicableSpatialUnit; + break; + } + } + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditFeaturesRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, $scope.targetApplicableSpatialUnit.allowedRoles); + }; + $scope.onChangeConverter = function () { + $scope.schema = $scope.converter.schemas ? $scope.converter.schemas[0] : undefined; + $scope.mimeType = $scope.converter.mimeTypes[0]; + }; + $scope.onChangeMimeType = function (mimeType) { + $scope.mimeType = mimeType; + }; + $scope.filterByKomMonitorProperties = function () { + return function (item) { + try { + if (item === __env.FEATURE_ID_PROPERTY_NAME || item === __env.FEATURE_NAME_PROPERTY_NAME || item === "validStartDate" || item === "validEndDate") { + return false; + } + return true; + } + catch (error) { + return false; + } + }; + }; + $scope.getFeatureId = function (jsonFeature) { + return jsonFeature[__env.FEATURE_ID_PROPERTY_NAME]; + }; + $scope.getFeatureName = function (jsonFeature) { + return jsonFeature[__env.FEATURE_NAME_PROPERTY_NAME]; + }; + $scope.buildImporterObjects = async function () { + $scope.converterDefinition = $scope.buildConverterDefinition(); + $scope.datasourceTypeDefinition = await $scope.buildDatasourceTypeDefinition(); + $scope.propertyMappingDefinition = $scope.buildPropertyMappingDefinition(); + let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); + var scopeProperties = { + "targetSpatialUnitMetadata": { + "spatialUnitLevel": $scope.targetSpatialUnitMetadata.spatialUnitLevel, + }, + "currentIndicatorDataset": { + "defaultClassificationMapping": $scope.currentIndicatorDataset.defaultClassificationMapping + }, + "allowedRoles": roleIds + }; + $scope.putBody_indicators = kommonitorImporterHelperService.buildPutBody_indicators(scopeProperties); + if (!$scope.converterDefinition || !$scope.datasourceTypeDefinition || !$scope.propertyMappingDefinition || !$scope.putBody_indicators) { + return false; + } + return true; + }; + $scope.buildConverterDefinition = function () { + return kommonitorImporterHelperService.buildConverterDefinition($scope.converter, "converterParameter_indicatorEditFeatures_", $scope.schema, $scope.mimeType); + }; + $scope.buildDatasourceTypeDefinition = async function () { + try { + return await kommonitorImporterHelperService.buildDatasourceTypeDefinition($scope.datasourceType, 'datasourceTypeParameter_indicatorEditFeatures_', 'indicatorDataSourceInput_editFeatures'); + } + catch (error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + $("#indicatorEditFeaturesErrorAlert").show(); + $scope.loadingData = false; + return null; + } + }; + $scope.buildPropertyMappingDefinition = function () { + // arsion from is undefined currently + let timeseriesMappingForImporter = []; + timeseriesMappingForImporter = $scope.timeseriesMappingReference; + console.log("timeseriesMappingForImporter: ", timeseriesMappingForImporter); + return kommonitorImporterHelperService.buildPropertyMapping_indicatorResource($scope.spatialUnitRefKeyProperty, timeseriesMappingForImporter, $scope.keepMissingValues); + }; + $scope.editIndicatorFeatures = async function () { + $timeout(function () { + $scope.loadingData = true; + }); + $scope.importerErrors = undefined; + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + /* + now collect data and build request for importer + */ + /* + if any required importer data is missing --> cancel request and highlight required errors + */ + var allDataSpecified = await $scope.buildImporterObjects(); + if (!allDataSpecified) { + $("#spatialUnitEditFeaturesForm").validator("update"); + $("#spatialUnitEditFeaturesForm").validator("validate"); + return; + } + else { + // TODO verify input + // TODO Create and perform POST Request with loading screen + var updateIndicatorResponse_dryRun = undefined; + try { + updateIndicatorResponse_dryRun = await kommonitorImporterHelperService.updateIndicator($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.currentIndicatorDataset.indicatorId, $scope.putBody_indicators, true); + // this callback will be called asynchronously + // when the response is available + if (!kommonitorImporterHelperService.importerResponseContainsErrors(updateIndicatorResponse_dryRun)) { + // all good, really execute the request to import data against data management API + var updateIndicatorResponse = await kommonitorImporterHelperService.updateIndicator($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.currentIndicatorDataset.indicatorId, $scope.putBody_indicators, false); + $rootScope.$broadcast("refreshIndicatorOverviewTable", "edit", $scope.currentIndicatorDataset.indicatorId); + // $scope.refreshIndicatorEditFeaturesOverviewTable(); + $scope.successMessagePart = $scope.currentIndicatorDataset.indicatorName; + $scope.importedFeatures = kommonitorImporterHelperService.getImportedFeaturesFromImporterResponse(updateIndicatorResponse); + $("#indicatorEditFeaturesSuccessAlert").show(); + $scope.loadingData = false; + } + else { + // errors ocurred + // show them + $scope.errorMessagePart = "Einige der zu importierenden Features des Datensatzes weisen kritische Fehler auf"; + $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(updateIndicatorResponse_dryRun); + $("#indicatorEditFeaturesErrorAlert").show(); + $scope.loadingData = false; + setTimeout(() => { + $scope.$digest(); + }, 250); + } + } + catch (error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + if (updateIndicatorResponse_dryRun) { + $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(updateIndicatorResponse_dryRun); + } + $("#indicatorEditFeaturesErrorAlert").show(); + $scope.loadingData = false; + setTimeout(() => { + $scope.$digest(); + }, 250); + } + } + }; + $scope.onImportIndicatorEditFeaturesMappingConfig = function () { + $scope.indicatorMappingConfigImportError = ""; + $("#indicatorMappingConfigEditFeaturesImportFile").files = []; + // trigger file chooser + $("#indicatorMappingConfigEditFeaturesImportFile").click(); + }; + $(document).on("change", "#indicatorMappingConfigEditFeaturesImportFile", function () { + console.log("Importing Importer Mapping Config for EditFeatures Indicator Form"); + // get the file + var file = document.getElementById('indicatorMappingConfigEditFeaturesImportFile').files[0]; + $scope.parseMappingConfigFromFile(file); + }); + $scope.parseMappingConfigFromFile = function (file) { + var fileReader = new FileReader(); + fileReader.onload = function (event) { + try { + $scope.parseFromMappingConfigFile(event); + } + catch (error) { + console.error(error); + console.error("Uploaded MappingConfig File cannot be parsed."); + $scope.indicatorMappingConfigImportError = "Uploaded MappingConfig File cannot be parsed correctly"; + document.getElementById("indicatorsEditFeaturesMappingConfigPre").innerHTML = $scope.indicatorMappingConfigStructure_pretty; + $("#indicatorEditFeaturesMappingConfigImportErrorAlert").show(); + $scope.$digest(); + } + }; + // Read in the image file as a data URL. + fileReader.readAsText(file); + }; + $scope.parseFromMappingConfigFile = function (event) { + $scope.mappingConfigImportSettings = JSON.parse(event.target.result); + if (!$scope.mappingConfigImportSettings.converter || !$scope.mappingConfigImportSettings.dataSource || !$scope.mappingConfigImportSettings.propertyMapping) { + console.error("uploaded MappingConfig File cannot be parsed - wrong structure."); + $scope.indicatorMetadataImportError = "Struktur der Datei stimmt nicht mit erwartetem Muster überein."; + document.getElementById("indicatorsEditFeaturesMappingConfigPre").innerHTML = $scope.indicatorMappingConfigStructure_pretty; + $("#indicatorEditFeaturesMappingConfigImportErrorAlert").show(); + $scope.$digest(); + } + $scope.converter = undefined; + for (var converter of kommonitorImporterHelperService.availableConverters) { + if (converter.name === $scope.mappingConfigImportSettings.converter.name) { + $scope.converter = converter; + break; + } + } + $scope.schema = undefined; + if ($scope.converter && $scope.converter.schemas && $scope.mappingConfigImportSettings.converter.schema) { + for (var schema of $scope.converter.schemas) { + if (schema === $scope.mappingConfigImportSettings.converter.schema) { + $scope.schema = schema; + } + } + } + $scope.mimeType = undefined; + if ($scope.converter && $scope.converter.mimeTypes && $scope.mappingConfigImportSettings.converter.mimeType) { + for (var mimeType of $scope.converter.mimeTypes) { + if (mimeType === $scope.mappingConfigImportSettings.converter.mimeType) { + $scope.mimeType = mimeType; + } + } + } + $scope.datasourceType = undefined; + for (var datasourceType of kommonitorImporterHelperService.availableDatasourceTypes) { + if (datasourceType.type === $scope.mappingConfigImportSettings.dataSource.type) { + $scope.datasourceType = datasourceType; + break; + } + } + $scope.$digest(); + // converter parameters + if ($scope.converter) { + for (var convParameter of $scope.mappingConfigImportSettings.converter.parameters) { + $("#converterParameter_indicatorEditFeatures_" + convParameter.name).val(convParameter.value); + } + } + // datasourceTypes parameters + if ($scope.datasourceType) { + for (var dsParameter of $scope.mappingConfigImportSettings.dataSource.parameters) { + $("#datasourceTypeParameter_indicatorEditFeatures_" + dsParameter.name).val(dsParameter.value); + } + } + // property Mapping + $scope.spatialUnitRefKeyProperty = $scope.mappingConfigImportSettings.propertyMapping.spatialReferenceKeyProperty; + $scope.$broadcast('loadTimeseriesMapping', { mapping: $scope.mappingConfigImportSettings.propertyMapping.timeseriesMappings }); + if ($scope.mappingConfigImportSettings.targetSpatialUnitName) { + for (const spatialUnitMetadata of kommonitorDataExchangeService.availableSpatialUnits) { + if (spatialUnitMetadata.spatialUnitLevel === $scope.mappingConfigImportSettings.targetSpatialUnitName) { + $scope.targetSpatialUnitMetadata = spatialUnitMetadata; + } + } + } + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditFeaturesRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, $scope.mappingConfigImportSettings.allowedRoles); + $scope.keepMissingValues = $scope.mappingConfigImportSettings.propertyMapping.keepMissingOrNullValueIndicator; + $scope.$digest(); + }; + $scope.onExportIndicatorEditFeaturesMappingConfig = async function () { + var converterDefinition = $scope.buildConverterDefinition(); + var datasourceTypeDefinition = await $scope.buildDatasourceTypeDefinition(); + var propertyMappingDefinition = $scope.buildPropertyMappingDefinition(); + var mappingConfigExport = { + "converter": converterDefinition, + "dataSource": datasourceTypeDefinition, + "propertyMapping": propertyMappingDefinition, + "targetSpatialUnitName": $scope.targetSpatialUnitMetadata.spatialUnitLevel, + "allowedRoles": [] + }; + mappingConfigExport.allowedRoles = []; + let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); + for (const roleId of roleIds) { + mappingConfigExport.allowedRoles.push(roleId); + } + mappingConfigExport.periodOfValidity = $scope.periodOfValidity; + var name = $scope.datasetName; + var metadataJSON = JSON.stringify(mappingConfigExport); + var fileName = "KomMonitor-Import-Mapping-Konfiguration_Export"; + if (name) { + fileName += "-" + name; + } + fileName += ".json"; + var blob = new Blob([metadataJSON], { type: "application/json" }); + var data = URL.createObjectURL(blob); + var a = document.createElement('a'); + a.download = fileName; + a.href = data; + a.textContent = "JSON"; + a.target = "_blank"; + a.rel = "noopener noreferrer"; + a.click(); + a.remove(); + }; + $scope.hideSuccessAlert = function () { + $("#indicatorEditFeaturesSuccessAlert").hide(); + }; + $scope.hideErrorAlert = function () { + $("#indicatorEditFeaturesErrorAlert").hide(); + }; + $scope.hideMappingConfigErrorAlert = function () { + $("#indicatorEditFeaturesMappingConfigImportErrorAlert").hide(); + }; + $rootScope.$on("showLoadingIcon_" + kommonitorDataGridHelperService.resourceType_indicator, function (event) { + $timeout(function () { + $scope.loadingData = true; + }); + }); + $rootScope.$on("hideLoadingIcon_" + kommonitorDataGridHelperService.resourceType_indicator, function (event) { + $timeout(function () { + $scope.loadingData = false; + }); + }); + $rootScope.$on("onDeleteFeatureEntry_" + kommonitorDataGridHelperService.resourceType_indicator, function (event) { + $rootScope.$broadcast("refreshIndicatorOverviewTable", "edit", $scope.currentIndicatorDataset.indicatorId); + $scope.refreshIndicatorEditFeaturesOverviewTable(); + }); + $scope.onChangeEnableDeleteFeatures = function () { + if ($scope.enableDeleteFeatures) { + $(".indicatorDeleteFeatureRecordBtn").attr("disabled", false); + } + else { + $(".indicatorDeleteFeatureRecordBtn").attr("disabled", true); + } + }; + $rootScope.$on("timeseriesMappingChanged", function (event, data) { + $scope.timeseriesMappingReference = data.mapping; + }); + } + ] +}); +//# sourceMappingURL=indicator-edit-features-modal.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditFeaturesModal/indicator-edit-features-modal.component.js.map b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditFeaturesModal/indicator-edit-features-modal.component.js.map new file mode 100644 index 000000000..8a9110bae --- /dev/null +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditFeaturesModal/indicator-edit-features-modal.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"indicator-edit-features-modal.component.js","sourceRoot":"","sources":["indicator-edit-features-modal.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,4BAA4B,CAAC,CAAC,SAAS,CAAC,4BAA4B,EAAE;IACpF,WAAW,EAAG,6HAA6H;IAC3I,UAAU,EAAG,CAAC,+BAA+B,EAAE,iCAAiC,EAAE,iCAAiC;QAClH,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,sCAAsC;QAC5F,SAAS,oCAAoC,CAAC,6BAA6B,EAAE,+BAA+B,EAC3G,+BAA+B,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,oCAAoC;YAEjH,IAAI,CAAC,qCAAqC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,+BAA+B,EAAE,MAAM,EAAE,MAAM,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC;gBAC3G,MAAM,CAAC,yCAAyC,EAAE,CAAC;YACpD,CAAC,CAAC,CAAC;YAEH,MAAM,CAAC,4BAA4B,GAAG;gBACrC,IAAG,MAAM,CAAC,oBAAoB,EAAC;oBAC9B,CAAC,CAAC,kCAAkC,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;iBAC9D;qBACG;oBACH,CAAC,CAAC,kCAAkC,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;iBAC7D;YACF,CAAC,CAAA;YAED,UAAU,CAAC,GAAG,CAAC,0BAA0B,EAAE,UAAS,KAAK,EAAE,IAAI;gBAC9D,MAAM,CAAC,0BAA0B,GAAG,IAAI,CAAC,OAAO,CAAC;YAClD,CAAC,CAAC,CAAC;QAEN,CAAC;KACD;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditFeaturesModal/indicator-edit-features-modal.component.ts b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditFeaturesModal/indicator-edit-features-modal.component.ts new file mode 100644 index 000000000..14c69d353 --- /dev/null +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditFeaturesModal/indicator-edit-features-modal.component.ts @@ -0,0 +1,718 @@ +angular.module('indicatorEditFeaturesModal').component('indicatorEditFeaturesModal', { + templateUrl : "components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditFeaturesModal/indicator-edit-features-modal.template.html", + controller : ['kommonitorDataExchangeService', 'kommonitorDataGridHelperService', 'kommonitorImporterHelperService', + '$scope', '$rootScope', '$http', '__env', '$timeout', 'kommonitorMultiStepFormHelperService', + function IndicatorEditFeaturesModalController(kommonitorDataExchangeService, kommonitorDataGridHelperService, + kommonitorImporterHelperService, $scope, $rootScope, $http, __env, $timeout, kommonitorMultiStepFormHelperService) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorImporterHelperServiceInstance = kommonitorImporterHelperService; + this.kommonitorDataGridHelperServiceInstance = kommonitorDataGridHelperService; + + /* PUT BODY + { + "indicatorValues": [ + { + "spatialReferenceKey": "spatialReferenceKey", + "valueMapping": [ + { + "indicatorValue": 0.8008282, + "timestamp": "2000-01-23" + }, + { + "indicatorValue": 0.8008282, + "timestamp": "2000-01-23" + } + ] + }, + { + "spatialReferenceKey": "spatialReferenceKey", + "valueMapping": [ + { + "indicatorValue": 0.8008282, + "timestamp": "2000-01-23" + }, + { + "indicatorValue": 0.8008282, + "timestamp": "2000-01-23" + } + ] + } + ], + "applicableSpatialUnit": "applicableSpatialUnit", + "allowedRoles": [ + + ] + "defaultClassificationMapping": { + "colorBrewerSchemeName": "colorBrewerSchemeName", + "items": [ + { + "defaultCustomRating": "defaultCustomRating", + "defaultColorAsHex": "defaultColorAsHex" + }, + { + "defaultCustomRating": "defaultCustomRating", + "defaultColorAsHex": "defaultColorAsHex" + } + ] + } + } + */ + + + + $scope.roleManagementTableOptions = undefined; + + $scope.$on("availableRolesUpdate", function (event) { + refreshRoles(); + }); + + // make sure that initial fetching of availableRoles has happened + $scope.$on("initialMetadataLoadingCompleted", function (event) { + refreshRoles(); + }); + + function refreshRoles() { + let allowedRoles = $scope.targetApplicableSpatialUnit ? $scope.targetApplicableSpatialUnit.allowedRoles : []; + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditFeaturesRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, allowedRoles); + } + + $scope.indicatorFeaturesJSON; + $scope.currentIndicatorDataset; + $scope.targetApplicableSpatialUnit; + $scope.remainingFeatureHeaders; + + $scope.indicatorMappingConfigImportError; + $scope.indicatorsEditFeaturesMappingConfigPre = kommonitorDataExchangeService.syntaxHighlightJSON(kommonitorImporterHelperService.mappingConfigStructure_indicator); + + + $scope.overviewTableTargetSpatialUnitMetadata = undefined; + + $scope.spatialUnitRefKeyProperty = undefined; + $scope.targetSpatialUnitMetadata = undefined; + + + $scope.converter = undefined; + $scope.schema = undefined; + $scope.mimeType = undefined; + $scope.datasourceType = undefined; + $scope.indicatorDataSourceIdProperty = undefined; + $scope.indicatorDataSourceNameProperty = undefined; + + $scope.converterDefinition = undefined; + $scope.datasourceTypeDefinition = undefined; + $scope.propertyMappingDefinition = undefined; + $scope.putBody_indicators = undefined; + + $scope.keepMissingValues = true; + + $scope.validityEndDate_perFeature = undefined; + $scope.validityStartDate_perFeature = undefined; + + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + $scope.importerErrors = undefined; + + $scope.loadingData = false; + + $scope.timeseriesMappingReference; // gets updated by a broadcast whenever $scope.timeseries mapping in indicatorEditTimeseriesMapping component changes + + $scope.$on("onEditIndicatorFeatures", function (event, indicatorDataset) { + kommonitorMultiStepFormHelperService.registerClickHandler(); + if($scope.currentIndicatorDataset && $scope.currentIndicatorDataset.indicatorId === indicatorDataset.indicatorId){ + return; + } + else{ + $scope.currentIndicatorDataset = indicatorDataset; + + // $scope.refreshIndicatorEditFeaturesOverviewTable(); + + $scope.resetIndicatorEditFeaturesForm(); + + kommonitorDataGridHelperService.buildDataGrid_featureTable_indicatorResource("indicatorFeatureTable", [], []); + + } + + }); + + // called if indicator was edited - then we must make sure that the view is refreshed + // i.e. if a new spatial unit was setup the first time via edit menu, then we must ensure that this new spatial unit is actually + // visible within features overview table dropdown + $rootScope.$on("refreshIndicatorOverviewTableCompleted", function() { + if($scope.currentIndicatorDataset){ + $scope.currentIndicatorDataset = kommonitorDataExchangeService.getIndicatorMetadataById($scope.currentIndicatorDataset.indicatorId); + + $scope.$digest(); + } + + }); + + $scope.filterOverviewTargetSpatialUnits = function(){ + return function( spatialUnitMetadata ) { + if($scope.currentIndicatorDataset){ + var isIncluded = $scope.currentIndicatorDataset.applicableSpatialUnits.some(o => o.spatialUnitName === spatialUnitMetadata.spatialUnitLevel); + return isIncluded; + } + }; + }; + + $scope.refreshIndicatorEditFeaturesOverviewTable = function(){ + + $scope.loadingData = true; + // fetch all indicator features + $http({ + url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/indicators/" + $scope.currentIndicatorDataset.indicatorId + "/" + $scope.overviewTableTargetSpatialUnitMetadata.spatialUnitId + "/without-geometry", + method: "GET", + // headers: { + // 'Content-Type': undefined + // } + }).then(function successCallback(response) { + + $scope.indicatorFeaturesJSON = response.data; + + var tmpRemainingHeaders = []; + + for (var property in $scope.indicatorFeaturesJSON[0]){ + // only show indicator date columns as editable fields + // since we fetch the database view (with joined spatial unit), any additional information from the spatial unit must be filtered out + if (property.includes(__env.indicatorDatePrefix)){ + tmpRemainingHeaders.push(property); + } + } + + //sort date headers + tmpRemainingHeaders.sort((a, b) => a.localeCompare(b)); + + $scope.remainingFeatureHeaders = tmpRemainingHeaders; + kommonitorDataGridHelperService.buildDataGrid_featureTable_indicatorResource("indicatorFeatureTable", tmpRemainingHeaders, $scope.indicatorFeaturesJSON, $scope.currentIndicatorDataset.indicatorId, kommonitorDataGridHelperService.resourceType_indicator, $scope.enableDeleteFeatures, $scope.overviewTableTargetSpatialUnitMetadata.spatialUnitId); + + + $scope.loadingData = false; + + }, function errorCallback(error) { + if(error.data){ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else{ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + + $("#indicatorEditFeaturesErrorAlert").show(); + $scope.loadingData = false; + }); + }; + + $scope.clearAllIndicatorFeatures = function(){ + $scope.loadingData = true; + // delete all indicator features for target spatial unit + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/indicators/" + $scope.currentIndicatorDataset.indicatorId + "/" + $scope.overviewTableTargetSpatialUnitMetadata.spatialUnitId, + method: "DELETE", + // headers: { + // 'Content-Type': undefined + // } + }).then(function successCallback(response) { + + $scope.indicatorFeaturesJSON = undefined; + $scope.remainingFeatureHeaders = undefined; + + $rootScope.$broadcast("refreshIndicatorOverviewTable", "edit", $scope.currentIndicatorDataset.indicatorId); + // $scope.refreshIndicatorEditFeaturesOverviewTable(); + // force empty feature overview table on successful deletion of entries + kommonitorDataGridHelperService.buildDataGrid_featureTable_indicatorResource("indicatorFeatureTable", [], []); + + $scope.successMessagePart = $scope.currentIndicatorDataset.indicatorName; + + $("#indicatorEditFeaturesSuccessAlert").show(); + $scope.loadingData = false; + + }, function errorCallback(error) { + if(error.data){ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else{ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + + $("#indicatorEditFeaturesErrorAlert").show(); + $scope.loadingData = false; + }); + }; + + $scope.resetIndicatorEditFeaturesForm = function(){ + + // reset edit banners + kommonitorDataGridHelperService.featureTable_indicator_lastUpdate_timestamp_success = undefined; + kommonitorDataGridHelperService.featureTable_indicator_lastUpdate_timestamp_failure = undefined; + + $scope.indicatorFeaturesJSON = undefined; + $scope.remainingFeatureHeaders = undefined; + + $scope.overviewTableTargetSpatialUnitMetadata = undefined; + for (const spatialUnitMetadataEntry of kommonitorDataExchangeService.availableSpatialUnits) { + if($scope.currentIndicatorDataset.applicableSpatialUnits.some(o => o.spatialUnitName === spatialUnitMetadataEntry.spatialUnitLevel)){ + $scope.overviewTableTargetSpatialUnitMetadata = spatialUnitMetadataEntry; + break; + } + } + + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditFeaturesRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, kommonitorDataExchangeService.getCurrentKomMonitorLoginRoleIds()); + + $scope.spatialUnitRefKeyProperty = undefined; + $scope.targetSpatialUnitMetadata = undefined; + $scope.targetApplicableSpatialUnit = undefined; + + + $scope.converter = undefined; + $scope.schema = undefined; + $scope.mimeType = undefined; + $scope.datasourceType = undefined; + $scope.indicatorDataSourceIdProperty = undefined; + $scope.indicatorDataSourceNameProperty = undefined; + + $scope.converterDefinition = undefined; + $scope.datasourceTypeDefinition = undefined; + $scope.propertyMappingDefinition = undefined; + $scope.putBody_indicators = undefined; + + $scope.keepMissingValues = true; + + $scope.validityEndDate_perFeature = undefined; + $scope.validityStartDate_perFeature = undefined; + + $scope.indicatorDataSourceIdProperty = undefined; + $scope.indicatorDataSourceNameProperty = undefined; + + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + $scope.importerErrors = undefined; + + $rootScope.$broadcast('resetTimeseriesMapping') + + $("#indicatorEditFeaturesSuccessAlert").hide(); + $("#indicatorEditFeaturesErrorAlert").hide(); + + setTimeout(() => { + $scope.$digest(); + }, 250); + + }; + + $scope.onChangeSelectedSpatialUnit = function(targetSpatialUnitMetadata){ + + var applicableSpatialUnits = $scope.currentIndicatorDataset.applicableSpatialUnits; + + for (const applicableSpatialUnit of applicableSpatialUnits) { + if (applicableSpatialUnit.spatialUnitId === targetSpatialUnitMetadata.spatialUnitId){ + $scope.targetApplicableSpatialUnit = applicableSpatialUnit; + break; + } + } + + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditFeaturesRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, $scope.targetApplicableSpatialUnit.allowedRoles); + + }; + + $scope.onChangeConverter = function(){ + $scope.schema = $scope.converter.schemas ? $scope.converter.schemas[0] : undefined; + $scope.mimeType = $scope.converter.mimeTypes[0]; + }; + + $scope.onChangeMimeType = function(mimeType){ + $scope.mimeType = mimeType; + }; + + $scope.filterByKomMonitorProperties = function() { + return function( item ) { + + try{ + if (item === __env.FEATURE_ID_PROPERTY_NAME || item === __env.FEATURE_NAME_PROPERTY_NAME || item === "validStartDate" || item === "validEndDate"){ + return false; + } + return true; + } + catch(error){ + return false; + } + }; + }; + + + + + $scope.getFeatureId = function(jsonFeature){ + return jsonFeature[__env.FEATURE_ID_PROPERTY_NAME]; + }; + + $scope.getFeatureName = function(jsonFeature){ + return jsonFeature[__env.FEATURE_NAME_PROPERTY_NAME]; + }; + + + $scope.buildImporterObjects = async function(){ + $scope.converterDefinition = $scope.buildConverterDefinition(); + $scope.datasourceTypeDefinition = await $scope.buildDatasourceTypeDefinition(); + $scope.propertyMappingDefinition = $scope.buildPropertyMappingDefinition(); + + let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); + + var scopeProperties = { + "targetSpatialUnitMetadata": { + "spatialUnitLevel": $scope.targetSpatialUnitMetadata.spatialUnitLevel, + }, + "currentIndicatorDataset": { + "defaultClassificationMapping": $scope.currentIndicatorDataset.defaultClassificationMapping + }, + "allowedRoles": roleIds + } + $scope.putBody_indicators = kommonitorImporterHelperService.buildPutBody_indicators(scopeProperties); + + if(!$scope.converterDefinition || !$scope.datasourceTypeDefinition || !$scope.propertyMappingDefinition || !$scope.putBody_indicators){ + return false; + } + + return true; + }; + + $scope.buildConverterDefinition = function(){ + + return kommonitorImporterHelperService.buildConverterDefinition($scope.converter, "converterParameter_indicatorEditFeatures_", $scope.schema, $scope.mimeType); + }; + + $scope.buildDatasourceTypeDefinition = async function(){ + try { + return await kommonitorImporterHelperService.buildDatasourceTypeDefinition($scope.datasourceType, 'datasourceTypeParameter_indicatorEditFeatures_', 'indicatorDataSourceInput_editFeatures'); + } catch (error) { + if(error.data){ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else{ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + + $("#indicatorEditFeaturesErrorAlert").show(); + $scope.loadingData = false; + return null; + } + }; + + $scope.buildPropertyMappingDefinition = function(){ + // arsion from is undefined currently + let timeseriesMappingForImporter = []; + timeseriesMappingForImporter = $scope.timeseriesMappingReference; + console.log("timeseriesMappingForImporter: ", timeseriesMappingForImporter); + return kommonitorImporterHelperService.buildPropertyMapping_indicatorResource($scope.spatialUnitRefKeyProperty, timeseriesMappingForImporter, $scope.keepMissingValues); + }; + + + + + $scope.editIndicatorFeatures = async function(){ + + $timeout(function(){ + $scope.loadingData = true; + }); + + $scope.importerErrors = undefined; + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + + /* + now collect data and build request for importer + */ + + /* + if any required importer data is missing --> cancel request and highlight required errors + */ + var allDataSpecified = await $scope.buildImporterObjects(); + + if (!allDataSpecified) { + + $("#spatialUnitEditFeaturesForm").validator("update"); + $("#spatialUnitEditFeaturesForm").validator("validate"); + return; + } + else { + + + // TODO verify input + + // TODO Create and perform POST Request with loading screen + + var updateIndicatorResponse_dryRun = undefined; + try { + updateIndicatorResponse_dryRun = await kommonitorImporterHelperService.updateIndicator($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.currentIndicatorDataset.indicatorId, $scope.putBody_indicators, true); + + // this callback will be called asynchronously + // when the response is available + + if(! kommonitorImporterHelperService.importerResponseContainsErrors(updateIndicatorResponse_dryRun)){ + // all good, really execute the request to import data against data management API + var updateIndicatorResponse = await kommonitorImporterHelperService.updateIndicator($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.currentIndicatorDataset.indicatorId, $scope.putBody_indicators, false); + + $rootScope.$broadcast("refreshIndicatorOverviewTable", "edit", $scope.currentIndicatorDataset.indicatorId); + // $scope.refreshIndicatorEditFeaturesOverviewTable(); + + $scope.successMessagePart = $scope.currentIndicatorDataset.indicatorName; + $scope.importedFeatures = kommonitorImporterHelperService.getImportedFeaturesFromImporterResponse(updateIndicatorResponse); + + $("#indicatorEditFeaturesSuccessAlert").show(); + $scope.loadingData = false; + } + else{ + // errors ocurred + // show them + $scope.errorMessagePart = "Einige der zu importierenden Features des Datensatzes weisen kritische Fehler auf"; + $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(updateIndicatorResponse_dryRun); + + $("#indicatorEditFeaturesErrorAlert").show(); + $scope.loadingData = false; + + setTimeout(() => { + $scope.$digest(); + }, 250); + + } + } catch (error) { + if(error.data){ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else{ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + if(updateIndicatorResponse_dryRun){ + $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(updateIndicatorResponse_dryRun); + } + + $("#indicatorEditFeaturesErrorAlert").show(); + $scope.loadingData = false; + + setTimeout(() => { + $scope.$digest(); + }, 250); + } + } + }; + + $scope.onImportIndicatorEditFeaturesMappingConfig = function(){ + + $scope.indicatorMappingConfigImportError = ""; + + $("#indicatorMappingConfigEditFeaturesImportFile").files = []; + + // trigger file chooser + $("#indicatorMappingConfigEditFeaturesImportFile").click(); + + }; + + $(document).on("change", "#indicatorMappingConfigEditFeaturesImportFile" ,function(){ + + console.log("Importing Importer Mapping Config for EditFeatures Indicator Form"); + + // get the file + var file = document.getElementById('indicatorMappingConfigEditFeaturesImportFile').files[0]; + $scope.parseMappingConfigFromFile(file); + }); + + $scope.parseMappingConfigFromFile = function(file){ + var fileReader = new FileReader(); + + fileReader.onload = function(event) { + + try{ + $scope.parseFromMappingConfigFile(event); + } + catch(error){ + console.error(error); + console.error("Uploaded MappingConfig File cannot be parsed."); + $scope.indicatorMappingConfigImportError = "Uploaded MappingConfig File cannot be parsed correctly"; + document.getElementById("indicatorsEditFeaturesMappingConfigPre").innerHTML = $scope.indicatorMappingConfigStructure_pretty; + $("#indicatorEditFeaturesMappingConfigImportErrorAlert").show(); + + $scope.$digest(); + } + + }; + + // Read in the image file as a data URL. + fileReader.readAsText(file); + }; + + $scope.parseFromMappingConfigFile = function(event){ + $scope.mappingConfigImportSettings = JSON.parse(event.target.result); + + if(! $scope.mappingConfigImportSettings.converter || ! $scope.mappingConfigImportSettings.dataSource || ! $scope.mappingConfigImportSettings.propertyMapping){ + console.error("uploaded MappingConfig File cannot be parsed - wrong structure."); + $scope.indicatorMetadataImportError = "Struktur der Datei stimmt nicht mit erwartetem Muster überein."; + document.getElementById("indicatorsEditFeaturesMappingConfigPre").innerHTML = $scope.indicatorMappingConfigStructure_pretty; + $("#indicatorEditFeaturesMappingConfigImportErrorAlert").show(); + + $scope.$digest(); + } + + $scope.converter = undefined; + for(var converter of kommonitorImporterHelperService.availableConverters){ + if (converter.name === $scope.mappingConfigImportSettings.converter.name){ + $scope.converter = converter; + break; + } + } + + $scope.schema = undefined; + if ($scope.converter && $scope.converter.schemas && $scope.mappingConfigImportSettings.converter.schema){ + for (var schema of $scope.converter.schemas) { + if (schema === $scope.mappingConfigImportSettings.converter.schema){ + $scope.schema = schema; + } + } + } + + $scope.mimeType = undefined; + if ($scope.converter && $scope.converter.mimeTypes && $scope.mappingConfigImportSettings.converter.mimeType){ + for (var mimeType of $scope.converter.mimeTypes) { + if (mimeType === $scope.mappingConfigImportSettings.converter.mimeType){ + $scope.mimeType = mimeType; + } + } + } + + $scope.datasourceType = undefined; + for(var datasourceType of kommonitorImporterHelperService.availableDatasourceTypes){ + if (datasourceType.type === $scope.mappingConfigImportSettings.dataSource.type){ + $scope.datasourceType = datasourceType; + break; + } + } + + $scope.$digest(); + + // converter parameters + if ($scope.converter){ + for (var convParameter of $scope.mappingConfigImportSettings.converter.parameters) { + $("#converterParameter_indicatorEditFeatures_" + convParameter.name).val(convParameter.value); + } + } + + // datasourceTypes parameters + if ($scope.datasourceType){ + for (var dsParameter of $scope.mappingConfigImportSettings.dataSource.parameters) { + $("#datasourceTypeParameter_indicatorEditFeatures_" + dsParameter.name).val(dsParameter.value); + } + } + + // property Mapping + $scope.spatialUnitRefKeyProperty = $scope.mappingConfigImportSettings.propertyMapping.spatialReferenceKeyProperty; + + $scope.$broadcast('loadTimeseriesMapping', { mapping: $scope.mappingConfigImportSettings.propertyMapping.timeseriesMappings } ); + + if($scope.mappingConfigImportSettings.targetSpatialUnitName){ + for (const spatialUnitMetadata of kommonitorDataExchangeService.availableSpatialUnits) { + if(spatialUnitMetadata.spatialUnitLevel === $scope.mappingConfigImportSettings.targetSpatialUnitName){ + $scope.targetSpatialUnitMetadata = spatialUnitMetadata; + } + + } + } + + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditFeaturesRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, $scope.mappingConfigImportSettings.allowedRoles); + + $scope.keepMissingValues = $scope.mappingConfigImportSettings.propertyMapping.keepMissingOrNullValueIndicator; + + $scope.$digest(); + }; + + $scope.onExportIndicatorEditFeaturesMappingConfig = async function(){ + var converterDefinition = $scope.buildConverterDefinition(); + var datasourceTypeDefinition = await $scope.buildDatasourceTypeDefinition(); + var propertyMappingDefinition = $scope.buildPropertyMappingDefinition(); + + var mappingConfigExport = { + "converter": converterDefinition, + "dataSource": datasourceTypeDefinition, + "propertyMapping": propertyMappingDefinition, + "targetSpatialUnitName": $scope.targetSpatialUnitMetadata.spatialUnitLevel, + "allowedRoles": [] + }; + + mappingConfigExport.allowedRoles = []; + + let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); + for (const roleId of roleIds) { + mappingConfigExport.allowedRoles.push(roleId); + } + + mappingConfigExport.periodOfValidity = $scope.periodOfValidity; + + var name = $scope.datasetName; + + var metadataJSON = JSON.stringify(mappingConfigExport); + + var fileName = "KomMonitor-Import-Mapping-Konfiguration_Export"; + + if (name){ + fileName += "-" + name; + } + + fileName += ".json"; + + var blob = new Blob([metadataJSON], {type: "application/json"}); + var data = URL.createObjectURL(blob); + + var a = document.createElement('a'); + a.download = fileName; + a.href = data; + a.textContent = "JSON"; + a.target = "_blank"; + a.rel = "noopener noreferrer"; + a.click(); + + a.remove(); + }; + + + $scope.hideSuccessAlert = function(){ + $("#indicatorEditFeaturesSuccessAlert").hide(); + }; + + $scope.hideErrorAlert = function(){ + $("#indicatorEditFeaturesErrorAlert").hide(); + }; + + $scope.hideMappingConfigErrorAlert = function(){ + $("#indicatorEditFeaturesMappingConfigImportErrorAlert").hide(); + }; + + $rootScope.$on("showLoadingIcon_" + kommonitorDataGridHelperService.resourceType_indicator, function(event){ + $timeout(function(){ + + $scope.loadingData = true; + }); + }); + + $rootScope.$on("hideLoadingIcon_" + kommonitorDataGridHelperService.resourceType_indicator, function(event){ + $timeout(function(){ + + $scope.loadingData = false; + }); + }); + + $rootScope.$on("onDeleteFeatureEntry_" + kommonitorDataGridHelperService.resourceType_indicator, function(event){ + $rootScope.$broadcast("refreshIndicatorOverviewTable", "edit", $scope.currentIndicatorDataset.indicatorId); + $scope.refreshIndicatorEditFeaturesOverviewTable(); + }); + + $scope.onChangeEnableDeleteFeatures = function(){ + if($scope.enableDeleteFeatures){ + $(".indicatorDeleteFeatureRecordBtn").attr("disabled", false); + } + else{ + $(".indicatorDeleteFeatureRecordBtn").attr("disabled", true); + } + } + + $rootScope.$on("timeseriesMappingChanged", function(event, data) { + $scope.timeseriesMappingReference = data.mapping; + }); + + } +]}); diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditFeaturesModal/indicator-edit-features-modal.module.js b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditFeaturesModal/indicator-edit-features-modal.module.js index ce358b463..3cf1b85fb 100644 --- a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditFeaturesModal/indicator-edit-features-modal.module.js +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditFeaturesModal/indicator-edit-features-modal.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('indicatorEditFeaturesModal', ['kommonitorDataGridHelper', 'kommonitorImporterHelper', 'kommonitorMultiStepFormHelper']); +//# sourceMappingURL=indicator-edit-features-modal.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditFeaturesModal/indicator-edit-features-modal.module.js.map b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditFeaturesModal/indicator-edit-features-modal.module.js.map new file mode 100644 index 000000000..ef0a3f0cf --- /dev/null +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditFeaturesModal/indicator-edit-features-modal.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"indicator-edit-features-modal.module.js","sourceRoot":"","sources":["indicator-edit-features-modal.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,4BAA4B,EAAE,CAAC,0BAA0B,EAAE,0BAA0B,EAAE,+BAA+B,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditFeaturesModal/indicator-edit-features-modal.module.ts b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditFeaturesModal/indicator-edit-features-modal.module.ts new file mode 100644 index 000000000..ce358b463 --- /dev/null +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditFeaturesModal/indicator-edit-features-modal.module.ts @@ -0,0 +1 @@ +angular.module('indicatorEditFeaturesModal', ['kommonitorDataGridHelper', 'kommonitorImporterHelper', 'kommonitorMultiStepFormHelper']); diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditIndicatorSpatialUnitRolesModal/indicator-edit-indicator-spatial-unit-roles-modal.component.js b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditIndicatorSpatialUnitRolesModal/indicator-edit-indicator-spatial-unit-roles-modal.component.js index b1fbe6c8d..0d6f477c0 100644 --- a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditIndicatorSpatialUnitRolesModal/indicator-edit-indicator-spatial-unit-roles-modal.component.js +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditIndicatorSpatialUnitRolesModal/indicator-edit-indicator-spatial-unit-roles-modal.component.js @@ -1,129 +1,95 @@ +"use strict"; angular.module('indicatorEditIndicatorSpatialUnitRolesModal').component('indicatorEditIndicatorSpatialUnitRolesModal', { - templateUrl: "components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditIndicatorSpatialUnitRolesModal/indicator-edit-indicator-spatial-unit-roles-modal.template.html", - controller: ['kommonitorDataExchangeService', '$scope', '$rootScope', '$http', '__env', 'kommonitorMultiStepFormHelperService', 'kommonitorDataGridHelperService', - function IndicatorEditIndicatorSpatialUnitRolesModalController(kommonitorDataExchangeService, $scope, $rootScope, - $http, __env, kommonitorMultiStepFormHelperService, kommonitorDataGridHelperService) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - - $scope.currentIndicatorDataset; - - $scope.roleManagementTableOptions = undefined; - - $scope.successMessagePart = undefined; - $scope.errorMessagePart = undefined; - - - $scope.$on("onEditIndicatorSpatialUnitRoles", function (event, indicatorDataset) { - - $scope.currentIndicatorDataset = indicatorDataset; - - $scope.resetIndicatorEditIndicatorSpatialUnitRolesForm(); - kommonitorMultiStepFormHelperService.registerClickHandler(); - - }); - - $scope.$on("availableRolesUpdate", function (event) { - let allowedRoles = $scope.targetApplicableSpatialUnit ? $scope.targetApplicableSpatialUnit.allowedRoles : []; - $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditIndicatorSpatialUnitsRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, allowedRoles); - }); - - $scope.resetIndicatorEditIndicatorSpatialUnitRolesForm = function () { - - $scope.targetApplicableSpatialUnit = $scope.currentIndicatorDataset.applicableSpatialUnits[0]; - - if ($scope.targetApplicableSpatialUnit && $scope.targetApplicableSpatialUnit.allowedRoles) { - $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditIndicatorSpatialUnitsRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, $scope.targetApplicableSpatialUnit.allowedRoles); - } - else { - $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditIndicatorSpatialUnitsRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, kommonitorDataExchangeService.getCurrentKomMonitorLoginRoleIds()); - } - - $scope.successMessagePart = undefined; - $scope.errorMessagePart = undefined; - $("#indicatorEditIndicatorSpatialUnitRolesSuccessAlert").hide(); - $("#indicatorEditIndicatorSpatialUnitRolesErrorAlert").hide(); - - setTimeout(() => { - $scope.$digest(); - }, 250); - }; - - $scope.buildPatchBody_indicatorSpatialUnitRoles = function () { - var patchBody = - { - "allowedRoles": [] - } - - let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); - for (const roleId of roleIds) { - patchBody.allowedRoles.push(roleId); - } - - return patchBody; - }; - - $scope.editIndicatorSpatialUnitRoles = function () { - - var patchBody = $scope.buildPatchBody_indicatorSpatialUnitRoles(); - - // TODO verify input - - // TODO Create and perform POST Request with loading screen - - $scope.loadingData = true; - - $http({ - url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/indicators/" + $scope.currentIndicatorDataset.indicatorId + "/" + $scope.targetApplicableSpatialUnit.spatialUnitId, - method: "PATCH", - data: patchBody - // headers: { - // 'Content-Type': undefined - // } - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - $rootScope.$broadcast("refreshIndicatorOverviewTable", "edit", $scope.currentIndicatorDataset.indicatorId); - $("#indicatorEditIndicatorSpatialUnitRolesSuccessAlert").show(); - $scope.loadingData = false; - - }, function errorCallback(error) { - if (error.data) { - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else { - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - - $("#indicatorEditIndicatorSpatialUnitRolesErrorAlert").show(); - $scope.loadingData = false; - - // setTimeout(function() { - // $("#indicatorEditMetadataSuccessAlert").hide(); - // }, 3000); - }); - }; - - $scope.onChangeSelectedSpatialUnit = function (targetApplicableSpatialUnit) { - - if ($scope.targetApplicableSpatialUnit && $scope.targetApplicableSpatialUnit.allowedRoles) { - $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditIndicatorSpatialUnitsRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, $scope.targetApplicableSpatialUnit.allowedRoles); - } - else { - $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditIndicatorSpatialUnitsRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, kommonitorDataExchangeService.getCurrentKomMonitorLoginRoleIds()); - } - - }; - - $scope.hideSuccessAlert = function () { - $("#indicatorEditIndicatorSpatialUnitRolesSuccessAlert").hide(); - }; - - $scope.hideErrorAlert = function () { - $("#indicatorEditIndicatorSpatialUnitRolesErrorAlert").hide(); - }; - - } - ] + templateUrl: "components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditIndicatorSpatialUnitRolesModal/indicator-edit-indicator-spatial-unit-roles-modal.template.html", + controller: ['kommonitorDataExchangeService', '$scope', '$rootScope', '$http', '__env', 'kommonitorMultiStepFormHelperService', 'kommonitorDataGridHelperService', + function IndicatorEditIndicatorSpatialUnitRolesModalController(kommonitorDataExchangeService, $scope, $rootScope, $http, __env, kommonitorMultiStepFormHelperService, kommonitorDataGridHelperService) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + $scope.currentIndicatorDataset; + $scope.roleManagementTableOptions = undefined; + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + $scope.$on("onEditIndicatorSpatialUnitRoles", function (event, indicatorDataset) { + $scope.currentIndicatorDataset = indicatorDataset; + $scope.resetIndicatorEditIndicatorSpatialUnitRolesForm(); + kommonitorMultiStepFormHelperService.registerClickHandler(); + }); + $scope.$on("availableRolesUpdate", function (event) { + let allowedRoles = $scope.targetApplicableSpatialUnit ? $scope.targetApplicableSpatialUnit.allowedRoles : []; + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditIndicatorSpatialUnitsRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, allowedRoles); + }); + $scope.resetIndicatorEditIndicatorSpatialUnitRolesForm = function () { + $scope.targetApplicableSpatialUnit = $scope.currentIndicatorDataset.applicableSpatialUnits[0]; + if ($scope.targetApplicableSpatialUnit && $scope.targetApplicableSpatialUnit.allowedRoles) { + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditIndicatorSpatialUnitsRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, $scope.targetApplicableSpatialUnit.allowedRoles); + } + else { + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditIndicatorSpatialUnitsRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, kommonitorDataExchangeService.getCurrentKomMonitorLoginRoleIds()); + } + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + $("#indicatorEditIndicatorSpatialUnitRolesSuccessAlert").hide(); + $("#indicatorEditIndicatorSpatialUnitRolesErrorAlert").hide(); + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.buildPatchBody_indicatorSpatialUnitRoles = function () { + var patchBody = { + "allowedRoles": [] + }; + let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); + for (const roleId of roleIds) { + patchBody.allowedRoles.push(roleId); + } + return patchBody; + }; + $scope.editIndicatorSpatialUnitRoles = function () { + var patchBody = $scope.buildPatchBody_indicatorSpatialUnitRoles(); + // TODO verify input + // TODO Create and perform POST Request with loading screen + $scope.loadingData = true; + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/indicators/" + $scope.currentIndicatorDataset.indicatorId + "/" + $scope.targetApplicableSpatialUnit.spatialUnitId, + method: "PATCH", + data: patchBody + // headers: { + // 'Content-Type': undefined + // } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + $rootScope.$broadcast("refreshIndicatorOverviewTable", "edit", $scope.currentIndicatorDataset.indicatorId); + $("#indicatorEditIndicatorSpatialUnitRolesSuccessAlert").show(); + $scope.loadingData = false; + }, function errorCallback(error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + $("#indicatorEditIndicatorSpatialUnitRolesErrorAlert").show(); + $scope.loadingData = false; + // setTimeout(function() { + // $("#indicatorEditMetadataSuccessAlert").hide(); + // }, 3000); + }); + }; + $scope.onChangeSelectedSpatialUnit = function (targetApplicableSpatialUnit) { + if ($scope.targetApplicableSpatialUnit && $scope.targetApplicableSpatialUnit.allowedRoles) { + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditIndicatorSpatialUnitsRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, $scope.targetApplicableSpatialUnit.allowedRoles); + } + else { + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditIndicatorSpatialUnitsRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, kommonitorDataExchangeService.getCurrentKomMonitorLoginRoleIds()); + } + }; + $scope.hideSuccessAlert = function () { + $("#indicatorEditIndicatorSpatialUnitRolesSuccessAlert").hide(); + }; + $scope.hideErrorAlert = function () { + $("#indicatorEditIndicatorSpatialUnitRolesErrorAlert").hide(); + }; + } + ] }); +//# sourceMappingURL=indicator-edit-indicator-spatial-unit-roles-modal.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditIndicatorSpatialUnitRolesModal/indicator-edit-indicator-spatial-unit-roles-modal.component.js.map b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditIndicatorSpatialUnitRolesModal/indicator-edit-indicator-spatial-unit-roles-modal.component.js.map new file mode 100644 index 000000000..7f577e837 --- /dev/null +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditIndicatorSpatialUnitRolesModal/indicator-edit-indicator-spatial-unit-roles-modal.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"indicator-edit-indicator-spatial-unit-roles-modal.component.js","sourceRoot":"","sources":["indicator-edit-indicator-spatial-unit-roles-modal.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,6CAA6C,CAAC,CAAC,SAAS,CAAC,6CAA6C,EAAE;IACtH,WAAW,EAAE,kKAAkK;IAC/K,UAAU,EAAE,CAAC,+BAA+B,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,sCAAsC,EAAE,iCAAiC;QAChK,SAAS,qDAAqD,CAAC,6BAA6B,EAAE,MAAM,EAAE,UAAU,EAC9G,KAAK,EAAE,KAAK,EAAE,oCAAoC,EAAE,+BAA+B;YAErF,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAE3E,MAAM,CAAC,uBAAuB,CAAC;YAE/B,MAAM,CAAC,0BAA0B,GAAG,SAAS,CAAC;YAE9C,MAAM,CAAC,kBAAkB,GAAG,SAAS,CAAC;YACtC,MAAM,CAAC,gBAAgB,GAAG,SAAS,CAAC;YAGpC,MAAM,CAAC,GAAG,CAAC,iCAAiC,EAAE,UAAU,KAAK,EAAE,gBAAgB;gBAE9E,MAAM,CAAC,uBAAuB,GAAG,gBAAgB,CAAC;gBAElD,MAAM,CAAC,+CAA+C,EAAE,CAAC;gBACzD,oCAAoC,CAAC,oBAAoB,EAAE,CAAC;YAE7D,CAAC,CAAC,CAAC;YAEH,MAAM,CAAC,GAAG,CAAC,sBAAsB,EAAE,UAAU,KAAK;gBACjD,IAAI,YAAY,GAAG,MAAM,CAAC,2BAA2B,CAAC,CAAC,CAAC,MAAM,CAAC,2BAA2B,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC7G,MAAM,CAAC,0BAA0B,GAAG,+BAA+B,CAAC,uBAAuB,CAAC,uDAAuD,EAAE,MAAM,CAAC,0BAA0B,EAAE,6BAA6B,CAAC,aAAa,E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AEF,MAAM,CAAC,2BAA2B,GAAG,UAAU,2BAA2B;gBAEzE,IAAI,MAAM,CAAC,2BAA2B,IAAI,MAAM,CAAC,2BAA2B,CAAC,YAAY,EAAE;oBAC1F,MAAM,CAAC,0BAA0B,GAAG,+BAA+B,CAAC,uBAAuB,CAAC,uDAAuD,EAAE,MAAM,CAAC,0BAA0B,EAAE,6BAA6B,CAAC,aAAa,EAAE,MAAM,CAAC,2BAA2B,CAAC,YAAY,CAAC,CAAC;iBACtR;qBACI;oBACJ,MAAM,CAAC,0BAA0B,GAAG,+BAA+B,CAAC,uBAAuB,CAAC,uDAAuD,EAAE,MAAM,CAAC,0BAA0B,EAAE,6BAA6B,CAAC,aAAa,EAAE,6BAA6B,CAAC,gCAAgC,EAAE,CAAC,CAAC;iBACvS;YAEF,CAAC,CAAC;YAEF,MAAM,CAAC,gBAAgB,GAAG;gBACzB,CAAC,CAAC,qDAAqD,CAAC,CAAC,IAAI,EAAE,CAAC;YACjE,CAAC,CAAC;YAEF,MAAM,CAAC,cAAc,GAAG;gBACvB,CAAC,CAAC,mDAAmD,CAAC,CAAC,IAAI,EAAE,CAAC;YAC/D,CAAC,CAAC;QAEH,CAAC;KACA;CACD,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditIndicatorSpatialUnitRolesModal/indicator-edit-indicator-spatial-unit-roles-modal.component.ts b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditIndicatorSpatialUnitRolesModal/indicator-edit-indicator-spatial-unit-roles-modal.component.ts new file mode 100644 index 000000000..b1fbe6c8d --- /dev/null +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditIndicatorSpatialUnitRolesModal/indicator-edit-indicator-spatial-unit-roles-modal.component.ts @@ -0,0 +1,129 @@ +angular.module('indicatorEditIndicatorSpatialUnitRolesModal').component('indicatorEditIndicatorSpatialUnitRolesModal', { + templateUrl: "components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditIndicatorSpatialUnitRolesModal/indicator-edit-indicator-spatial-unit-roles-modal.template.html", + controller: ['kommonitorDataExchangeService', '$scope', '$rootScope', '$http', '__env', 'kommonitorMultiStepFormHelperService', 'kommonitorDataGridHelperService', + function IndicatorEditIndicatorSpatialUnitRolesModalController(kommonitorDataExchangeService, $scope, $rootScope, + $http, __env, kommonitorMultiStepFormHelperService, kommonitorDataGridHelperService) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + + $scope.currentIndicatorDataset; + + $scope.roleManagementTableOptions = undefined; + + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + + + $scope.$on("onEditIndicatorSpatialUnitRoles", function (event, indicatorDataset) { + + $scope.currentIndicatorDataset = indicatorDataset; + + $scope.resetIndicatorEditIndicatorSpatialUnitRolesForm(); + kommonitorMultiStepFormHelperService.registerClickHandler(); + + }); + + $scope.$on("availableRolesUpdate", function (event) { + let allowedRoles = $scope.targetApplicableSpatialUnit ? $scope.targetApplicableSpatialUnit.allowedRoles : []; + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditIndicatorSpatialUnitsRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, allowedRoles); + }); + + $scope.resetIndicatorEditIndicatorSpatialUnitRolesForm = function () { + + $scope.targetApplicableSpatialUnit = $scope.currentIndicatorDataset.applicableSpatialUnits[0]; + + if ($scope.targetApplicableSpatialUnit && $scope.targetApplicableSpatialUnit.allowedRoles) { + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditIndicatorSpatialUnitsRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, $scope.targetApplicableSpatialUnit.allowedRoles); + } + else { + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditIndicatorSpatialUnitsRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, kommonitorDataExchangeService.getCurrentKomMonitorLoginRoleIds()); + } + + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + $("#indicatorEditIndicatorSpatialUnitRolesSuccessAlert").hide(); + $("#indicatorEditIndicatorSpatialUnitRolesErrorAlert").hide(); + + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + + $scope.buildPatchBody_indicatorSpatialUnitRoles = function () { + var patchBody = + { + "allowedRoles": [] + } + + let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); + for (const roleId of roleIds) { + patchBody.allowedRoles.push(roleId); + } + + return patchBody; + }; + + $scope.editIndicatorSpatialUnitRoles = function () { + + var patchBody = $scope.buildPatchBody_indicatorSpatialUnitRoles(); + + // TODO verify input + + // TODO Create and perform POST Request with loading screen + + $scope.loadingData = true; + + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/indicators/" + $scope.currentIndicatorDataset.indicatorId + "/" + $scope.targetApplicableSpatialUnit.spatialUnitId, + method: "PATCH", + data: patchBody + // headers: { + // 'Content-Type': undefined + // } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + $rootScope.$broadcast("refreshIndicatorOverviewTable", "edit", $scope.currentIndicatorDataset.indicatorId); + $("#indicatorEditIndicatorSpatialUnitRolesSuccessAlert").show(); + $scope.loadingData = false; + + }, function errorCallback(error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + + $("#indicatorEditIndicatorSpatialUnitRolesErrorAlert").show(); + $scope.loadingData = false; + + // setTimeout(function() { + // $("#indicatorEditMetadataSuccessAlert").hide(); + // }, 3000); + }); + }; + + $scope.onChangeSelectedSpatialUnit = function (targetApplicableSpatialUnit) { + + if ($scope.targetApplicableSpatialUnit && $scope.targetApplicableSpatialUnit.allowedRoles) { + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditIndicatorSpatialUnitsRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, $scope.targetApplicableSpatialUnit.allowedRoles); + } + else { + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditIndicatorSpatialUnitsRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, kommonitorDataExchangeService.getCurrentKomMonitorLoginRoleIds()); + } + + }; + + $scope.hideSuccessAlert = function () { + $("#indicatorEditIndicatorSpatialUnitRolesSuccessAlert").hide(); + }; + + $scope.hideErrorAlert = function () { + $("#indicatorEditIndicatorSpatialUnitRolesErrorAlert").hide(); + }; + + } + ] +}); diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditIndicatorSpatialUnitRolesModal/indicator-edit-indicator-spatial-unit-roles-modal.module.js b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditIndicatorSpatialUnitRolesModal/indicator-edit-indicator-spatial-unit-roles-modal.module.js index 952c9bd93..b165678dd 100644 --- a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditIndicatorSpatialUnitRolesModal/indicator-edit-indicator-spatial-unit-roles-modal.module.js +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditIndicatorSpatialUnitRolesModal/indicator-edit-indicator-spatial-unit-roles-modal.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('indicatorEditIndicatorSpatialUnitRolesModal', ['kommonitorDataExchange', 'excaliburDualList', 'kommonitorMultiStepFormHelper', 'kommonitorDataGridHelper']); +//# sourceMappingURL=indicator-edit-indicator-spatial-unit-roles-modal.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditIndicatorSpatialUnitRolesModal/indicator-edit-indicator-spatial-unit-roles-modal.module.js.map b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditIndicatorSpatialUnitRolesModal/indicator-edit-indicator-spatial-unit-roles-modal.module.js.map new file mode 100644 index 000000000..a26157923 --- /dev/null +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditIndicatorSpatialUnitRolesModal/indicator-edit-indicator-spatial-unit-roles-modal.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"indicator-edit-indicator-spatial-unit-roles-modal.module.js","sourceRoot":"","sources":["indicator-edit-indicator-spatial-unit-roles-modal.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,6CAA6C,EAAE,CAAC,wBAAwB,EAAE,mBAAmB,EAAE,+BAA+B,EAAE,0BAA0B,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditIndicatorSpatialUnitRolesModal/indicator-edit-indicator-spatial-unit-roles-modal.module.ts b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditIndicatorSpatialUnitRolesModal/indicator-edit-indicator-spatial-unit-roles-modal.module.ts new file mode 100644 index 000000000..952c9bd93 --- /dev/null +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditIndicatorSpatialUnitRolesModal/indicator-edit-indicator-spatial-unit-roles-modal.module.ts @@ -0,0 +1 @@ +angular.module('indicatorEditIndicatorSpatialUnitRolesModal', ['kommonitorDataExchange', 'excaliburDualList', 'kommonitorMultiStepFormHelper', 'kommonitorDataGridHelper']); diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditMetadataModal/indicator-edit-metadata-modal.component.js b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditMetadataModal/indicator-edit-metadata-modal.component.js index 3ee53c046..2c3cad41d 100644 --- a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditMetadataModal/indicator-edit-metadata-modal.component.js +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditMetadataModal/indicator-edit-metadata-modal.component.js @@ -1,1133 +1,929 @@ +"use strict"; angular.module('indicatorEditMetadataModal').component('indicatorEditMetadataModal', { - templateUrl : "components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditMetadataModal/indicator-edit-metadata-modal.template.html", - controller : ['kommonitorDataExchangeService', '$scope', '$rootScope', '$http', '__env', '$timeout', 'kommonitorMultiStepFormHelperService', - 'kommonitorDataGridHelperService', - function IndicatorEditMetadataModalController(kommonitorDataExchangeService, $scope, $rootScope, $http, __env, $timeout, - kommonitorMultiStepFormHelperService, kommonitorDataGridHelperService) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - - $scope.currentIndicatorDataset; - - /* POST BODY - { - - "refrencesToOtherIndicators": [ - { - "referenceDescription": "referenceDescription", - "indicatorId": "indicatorId" - }, - { - "referenceDescription": "referenceDescription", - "indicatorId": "indicatorId" - } - ], - "metadata": { - "note": "note", - "literature": "literature", - "updateInterval": "ARBITRARY", - "sridEPSG": 0.8008281904610115, - "datasource": "datasource", - "contact": "contact", - "lastUpdate": "2000-01-23", - "description": "description", - "databasis": "databasis" - }, - "allowedRoles": [ - "allowedRoles", - "allowedRoles" - ], - "datasetName": "datasetName", - "applicableSpatialUnit": "applicableSpatialUnit", - "abbreviation": "abbreviation", - "characteristicValue": "characteristicValue", - "tags": [ - "tags", - "tags" - ], - "creationType": "INSERTION", - "unit": "unit", - "topicReference": "topicReference", - "referenceDateNote": "optional note for indicator reference date", - "displayOrder": 0, - "refrencesToGeoresources": [ - { - "referenceDescription": "referenceDescription", - "georesourceId": "georesourceId" - }, - { - "referenceDescription": "referenceDescription", - "georesourceId": "georesourceId" - } - ], - "indicatorType": "STATUS_ABSOLUTE", - "interpretation": "interpretation", - "isHeadlineIndicator": false, - "processDescription": "processDescription", - "lowestSpatialUnitForComputation": "lowestSpatialUnitForComputation", - "defaultClassificationMapping": { - "colorBrewerSchemeName": "colorBrewerSchemeName", - "items": [ - { - "defaultCustomRating": "defaultCustomRating", - "defaultColorAsHex": "defaultColorAsHex" - }, - { - "defaultCustomRating": "defaultCustomRating", - "defaultColorAsHex": "defaultColorAsHex" - } - ] - } - } - */ - - //Date picker - $('#indicatorEditLastUpdateDatepicker').datepicker(kommonitorDataExchangeService.datePickerOptions); - - $scope.indicatorMetadataStructure = { - "metadata": { - "note": "an optional note", - "literature": "optional text about literature", - "updateInterval": "YEARLY|HALF_YEARLY|QUARTERLY|MONTHLY|ARBITRARY", - "sridEPSG": 4326, - "datasource": "text about data source", - "contact": "text about contact details", - "lastUpdate": "YYYY-MM-DD", - "description": "description about spatial unit dataset", - "databasis": "text about data basis", - }, - "allowedRoles": ['roleId'], - "refrencesToOtherIndicators": [ - { - "referenceDescription": "description about the reference", - "indicatorId": "ID of referenced indicator dataset" - } - ], - "refrencesToGeoresources": [ - { - "referenceDescription": "description about the reference", - "georesourceId": "ID of referenced georesource dataset" - } - ], - "datasetName": "Name of indicator dataset", - "abbreviation": "optional abbreviation of the indicator dataset", - "characteristicValue": "if the same datasetName is used for different indicators, the optional characteristicValue parameter may serve to distinguish between them (i.e. Habitants - male, Habitants - female, Habitants - diverse)", - "tags": [ - "optinal list of tags; each tag is a free text tag" - ], - "creationType": "INSERTION|COMPUTATION <-- enum parameter controls whether each timestamp must be updated manually (INSERTION) or if KomMonitor shall compute the indicator values for respective timestamps based on script file (COMPUTATION)", - "unit": "unit of the indicator", - "topicReference": "ID of the respective main/sub topic instance", - "indicatorType": "STATUS_ABSOLUTE|STATUS_RELATIVE|DYNAMIC_ABSOLUTE|DYNAMIC_RELATIVE|STATUS_STANDARDIZED|DYNAMIC_STANDARDIZED", - "interpretation": "interpretation hints for the user to better understand the indicator values", - "isHeadlineIndicator": "boolean parameter to indicate if indicator is a headline indicator", - "processDescription": "detailed description about the computation/creation of the indicator", - "lowestSpatialUnitForComputation": "the name of the lowest possible spatial unit for which an indicator of creationType=COMPUTATION may be computed. All other superior spatial units will be aggregated automatically", - "referenceDateNote": "optional note for indicator reference date", - "displayOrder": 0, - "defaultClassificationMapping": { - "colorBrewerSchemeName": "schema name of colorBrewer colorPalette to use for classification", - "items": [ - { - "defaultCustomRating": "a string to rate indicator values of this class", - "defaultColorAsHex": "color as hexadecimal value" - } - ] - } - }; - - $scope.indicatorMetadataStructure_pretty = kommonitorDataExchangeService.syntaxHighlightJSON($scope.indicatorMetadataStructure); - - $scope.metadataImportSettings; - $scope.indicatorMetadataImportError; - $scope.indicatorAddMetadataImportErrorAlert; - - $scope.datasetName = undefined; - $scope.datasetNameInvalid = false; - - $scope.metadata = {}; - $scope.metadata.note = undefined; - $scope.metadata.literature = undefined; - $scope.metadata.updateInterval = undefined; - $scope.metadata.sridEPSG = undefined; - $scope.metadata.datasource = undefined; - $scope.metadata.databasis = undefined; - $scope.metadata.contact = undefined; - $scope.metadata.lastUpdate = undefined; - $scope.metadata.description = undefined; - - $scope.roleManagementTableOptions = undefined; - - - $scope.datasetName = undefined; - $scope.indicatorAbbreviation = undefined; - $scope.indicatorType = undefined; - $scope.indicatorCharacteristicValue = undefined; - $scope.isHeadlineIndicator = false; - $scope.indicatorUnit = undefined; - $scope.enableFreeTextUnit = false; - $scope.indicatorProcessDescription = undefined; - $scope.indicatorTagsString_withCommas = undefined; - $scope.indicatorInterpretation = undefined; - $scope.indicatorCreationType = undefined; - $scope.indicatorLowestSpatialUnitMetadataObjectForComputation = undefined; - $scope.enableLowestSpatialUnitSelect = false; - - $scope.indicatorReferenceDateNote = undefined; - $scope.displayOrder = 0; - - $scope.indicatorTopic_mainTopic = undefined; - $scope.indicatorTopic_subTopic = undefined; - $scope.indicatorTopic_subsubTopic = undefined; - $scope.indicatorTopic_subsubsubTopic = undefined; - - $scope.indicatorNameFilter = undefined; - $scope.tmpIndicatorReference_selectedIndicatorMetadata = undefined; - $scope.tmpIndicatorReference_referenceDescription = undefined; - // tmp array to display indicatorReferences - $scope.indicatorReferences_adminView = []; - // array for API request (has less information per item) - $scope.indicatorReferences_apiRequest = []; - - $scope.georesourceNameFilter = undefined; - $scope.tmpGeoresourceReference_selectedGeoresourceMetadata = undefined; - $scope.tmpGeoresourceReference_referenceDescription = undefined; - // tmp array to display georesourceReferences - $scope.georesourceReferences_adminView = []; - // array for API request (has less information per item) - $scope.georesourceReferences_apiRequest = []; - - $scope.numClassesArray = [3,4,5,6,7,8]; - $scope.numClasses = $scope.numClassesArray[2]; - $scope.selectedColorBrewerPaletteEntry = undefined; - - $scope.successMessagePart = undefined; - $scope.errorMessagePart = undefined; - - $scope.colorbrewerSchemes = colorbrewer; - $scope.colorbreweSchemeName_dynamicIncrease = __env.defaultColorBrewerPaletteForBalanceIncreasingValues; - $scope.colorbreweSchemeName_dynamicDecrease = __env.defaultColorBrewerPaletteForBalanceDecreasingValues; - $scope.colorbrewerPalettes = []; - - - $scope.instantiateColorBrewerPalettes = function(){ - for (const key in colorbrewer) { - if (colorbrewer.hasOwnProperty(key)) { - const colorPalettes = colorbrewer[key]; - - var paletteEntry = { - "paletteName": key, - "paletteArrayObject": colorPalettes - }; - - $scope.colorbrewerPalettes.push(paletteEntry); - } - } - - // instantiate with palette 'Blues' - $scope.selectedColorBrewerPaletteEntry = $scope.colorbrewerPalettes[13]; - - }; - - $scope.instantiateColorBrewerPalettes(); - - $scope.$on("onEditIndicatorMetadata", function (event, indicatorDataset) { - - $scope.currentIndicatorDataset = indicatorDataset; - - $scope.resetIndicatorEditMetadataForm(); - kommonitorMultiStepFormHelperService.registerClickHandler(); - - }); - - $scope.$on("availableRolesUpdate", function (event) { - let allowedRoles = $scope.currentIndicatorDataset ? $scope.currentIndicatorDataset.allowedRoles : []; - $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, allowedRoles); - }); - - $scope.resetIndicatorEditMetadataForm = function(){ - - $scope.successMessagePart = undefined; - $scope.errorMessagePart = undefined; - - $scope.datasetName = $scope.currentIndicatorDataset.indicatorName; - $scope.datasetNameInvalid = false; - - $scope.indicatorReferenceDateNote = $scope.currentIndicatorDataset.referenceDateNote; - $scope.displayOrder = $scope.currentIndicatorDataset.displayOrder; - - $scope.metadata = {}; - $scope.metadata.note = $scope.currentIndicatorDataset.metadata.note; - $scope.metadata.literature = $scope.currentIndicatorDataset.metadata.literature; - $scope.metadata.sridEPSG = 4326; - $scope.metadata.datasource = $scope.currentIndicatorDataset.metadata.datasource; - $scope.metadata.databasis = $scope.currentIndicatorDataset.metadata.databasis; - $scope.metadata.contact = $scope.currentIndicatorDataset.metadata.contact; - $scope.metadata.description = $scope.currentIndicatorDataset.metadata.description; - - $scope.metadata.lastUpdate = $scope.currentIndicatorDataset.metadata.lastUpdate; - // $('#indicatorEditLastUpdateDatepicker').data({date: $scope.currentIndicatorDataset.metadata.lastUpdate}); - $('#indicatorEditLastUpdateDatepicker').datepicker('setDate', $scope.currentIndicatorDataset.metadata.lastUpdate); - - kommonitorDataExchangeService.updateIntervalOptions.forEach(function(option){ - if(option.apiName === $scope.currentIndicatorDataset.metadata.updateInterval){ - $scope.metadata.updateInterval = option; - } - }); - - let allowedRoles = $scope.currentIndicatorDataset ? $scope.currentIndicatorDataset.allowedRoles : []; - $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, allowedRoles); - - $scope.indicatorAbbreviation = $scope.currentIndicatorDataset.abbreviation; - - kommonitorDataExchangeService.indicatorTypeOptions.forEach(function(option){ - if(option.apiName === $scope.currentIndicatorDataset.indicatorType){ - $scope.indicatorType = option; - } - }); - - $scope.indicatorCharacteristicValue = $scope.currentIndicatorDataset.characteristicValue; - $scope.isHeadlineIndicator = $scope.currentIndicatorDataset.isHeadlineIndicator; - $scope.indicatorUnit = $scope.currentIndicatorDataset.unit; - - $scope.enableFreeTextUnit = true; - kommonitorDataExchangeService.indicatorUnitOptions.forEach(function(option){ - if(option === $scope.currentIndicatorDataset.unit){ - // if the unit is in list of known units then disable freeText - $scope.enableFreeTextUnit = false; - } - }); - - $scope.indicatorProcessDescription = $scope.currentIndicatorDataset.processDescription; - $scope.indicatorTagsString_withCommas = ""; - - for (let index = 0; index < $scope.currentIndicatorDataset.tags.length; index++) { - $scope.indicatorTagsString_withCommas += $scope.currentIndicatorDataset.tags[index]; - - if(index < $scope.currentIndicatorDataset.tags.length - 1){ - $scope.indicatorTagsString_withCommas += ","; - } - } - - if (! $scope.currentIndicatorDataset.tags || $scope.currentIndicatorDataset.tags.length === 0){ - $scope.indicatorTagsString_withCommas = undefined; - } - - $scope.indicatorInterpretation = $scope.currentIndicatorDataset.interpretation; - - kommonitorDataExchangeService.indicatorCreationTypeOptions.forEach(function(option){ - if(option.apiName === $scope.currentIndicatorDataset.creationType){ - $scope.indicatorCreationType = option; - } - }); - - $scope.indicatorLowestSpatialUnitMetadataObjectForComputation = undefined; - - for (let i = 0; i < kommonitorDataExchangeService.availableSpatialUnits.length; i++) { - const spatialUnitMetadata = kommonitorDataExchangeService.availableSpatialUnits[i]; - - if(spatialUnitMetadata.spatialUnitLevel === $scope.currentIndicatorDataset.lowestSpatialUnitForComputation){ - $scope.indicatorLowestSpatialUnitMetadataObjectForComputation = spatialUnitMetadata; - break; - } - } - - if($scope.indicatorCreationType.apiName === "COMPUTATION"){ - $scope.enableLowestSpatialUnitSelect = true; - } - else{ - $scope.enableLowestSpatialUnitSelect = false; - } - - var topicHierarchy = kommonitorDataExchangeService.getTopicHierarchyForTopicId($scope.currentIndicatorDataset.topicReference); - - if(topicHierarchy && topicHierarchy[0]){ - $scope.indicatorTopic_mainTopic = topicHierarchy[0]; - } - if(topicHierarchy && topicHierarchy[1]){ - $scope.indicatorTopic_subTopic = topicHierarchy[1]; - } - if(topicHierarchy && topicHierarchy[2]){ - $scope.indicatorTopic_subsubTopic = topicHierarchy[2]; - } - if(topicHierarchy && topicHierarchy[3]){ - $scope.indicatorTopic_subsubsubTopic = topicHierarchy[3]; - } - - $scope.indicatorNameFilter = undefined; - $scope.tmpIndicatorReference_selectedIndicatorMetadata = undefined; - $scope.tmpIndicatorReference_referenceDescription = undefined; - - // tmp array to display indicatorReferences - $scope.indicatorReferences_adminView = []; - // array for API request (has less information per item) - $scope.indicatorReferences_apiRequest = []; - if($scope.currentIndicatorDataset.referencedIndicators && $scope.currentIndicatorDataset.referencedIndicators.length > 0){ - for (const indicatorReference of $scope.currentIndicatorDataset.referencedIndicators) { - var indicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(indicatorReference.referencedIndicatorId); - var referenceEntry = { - "referencedIndicatorName": indicatorMetadata.indicatorName, - "referencedIndicatorId": indicatorMetadata.indicatorId, - "referencedIndicatorAbbreviation": indicatorMetadata.abbreviation, - "referencedIndicatorDescription": indicatorReference.referencedIndicatorDescription - }; - $scope.indicatorReferences_adminView.push(referenceEntry); - } - - } - - $scope.georesourceNameFilter = undefined; - $scope.tmpGeoresourceReference_selectedGeoresourceMetadata = undefined; - $scope.tmpGeoresourceReference_referenceDescription = undefined; - // tmp array to display georesourceReferences - $scope.georesourceReferences_adminView = []; - // array for API request (has less information per item) - $scope.georesourceReferences_apiRequest = []; - - if($scope.currentIndicatorDataset.referencedGeoresources && $scope.currentIndicatorDataset.referencedGeoresources.length > 0){ - for (const georesourceReference of $scope.currentIndicatorDataset.referencedGeoresources) { - var georesourceMetadata = kommonitorDataExchangeService.getGeoresourceMetadataById(georesourceReference.referencedGeoresourceId); - var geo_referenceEntry = { - "referencedGeoresourceName": georesourceMetadata.datasetName, - "referencedGeoresourceId": georesourceMetadata.georesourceId, - "referencedGeoresourceDescription": georesourceReference.referencedGeoresourceDescription - }; - $scope.georesourceReferences_adminView.push(geo_referenceEntry); - } - - } - - $scope.numClassesArray = [3,4,5,6,7,8]; - $scope.numClasses = $scope.numClassesArray[2]; - - // instantiate with palette 'Blues' - $scope.selectedColorBrewerPaletteEntry = $scope.colorbrewerPalettes[13]; - - for (const colorbrewerPalette of $scope.colorbrewerPalettes) { - if (colorbrewerPalette.paletteName === $scope.currentIndicatorDataset.defaultClassificationMapping.colorBrewerSchemeName){ - $scope.selectedColorBrewerPaletteEntry = colorbrewerPalette; - break; - } - } - - $scope.successMessagePart = undefined; - $scope.errorMessagePart = undefined; - $("#indicatorEditMetadataSuccessAlert").hide(); - $("#indicatorEditMetadataErrorAlert").hide(); - - setTimeout(() => { - $scope.$digest(); - }, 250); - }; - - $scope.onClickColorBrewerEntry = function(colorPaletteEntry){ - $scope.selectedColorBrewerPaletteEntry = colorPaletteEntry; - - setTimeout(() => { - $scope.$digest(); - }, 250); - }; - - $scope.onAddOrUpdateIndicatorReference = function(){ - var tmpIndicatorReference_adminView = { - "referencedIndicatorName": $scope.tmpIndicatorReference_selectedIndicatorMetadata.indicatorName, - "referencedIndicatorId": $scope.tmpIndicatorReference_selectedIndicatorMetadata.indicatorId, - "referencedIndicatorAbbreviation": $scope.tmpIndicatorReference_selectedIndicatorMetadata.abbreviation, - "referencedIndicatorDescription": $scope.tmpIndicatorReference_referenceDescription - }; - - var processed = false; - - for (let index = 0; index < $scope.indicatorReferences_adminView.length; index++) { - var indicatorReference_adminView = $scope.indicatorReferences_adminView[index]; - - if (indicatorReference_adminView.referencedIndicatorId === tmpIndicatorReference_adminView.referencedIndicatorId){ - // replace object - $scope.indicatorReferences_adminView[index] = tmpIndicatorReference_adminView; - processed = true; - break; - } - } - - if(! processed){ - // new entry - $scope.indicatorReferences_adminView.push(tmpIndicatorReference_adminView); - } - - $scope.tmpIndicatorReference_selectedIndicatorMetadata = undefined; - $scope.tmpIndicatorReference_referenceDescription = undefined; - - setTimeout(() => { - $scope.$digest(); - }, 250); - }; - - $scope.onClickEditIndicatorReference = function(indicatorReference_adminView){ - - $scope.tmpIndicatorReference_selectedIndicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(indicatorReference_adminView.referencedIndicatorId); - $scope.tmpIndicatorReference_referenceDescription = indicatorReference_adminView.referencedIndicatorDescription; - - setTimeout(() => { - $scope.$digest(); - }, 250); - }; - - $scope.onClickDeleteIndicatorReference = function(indicatorReference_adminView){ - - for (let index = 0; index < $scope.indicatorReferences_adminView.length; index++) { - - if ($scope.indicatorReferences_adminView[index].referencedIndicatorId === indicatorReference_adminView.referencedIndicatorId){ - // remove object - $scope.indicatorReferences_adminView.splice(index, 1); - break; - } - } - - setTimeout(() => { - $scope.$digest(); - }, 250); - }; - - $scope.onAddOrUpdateGeoresourceReference = function(){ - var tmpGeoresourceReference_adminView = { - "referencedGeoresourceName": $scope.tmpGeoresourceReference_selectedGeoresourceMetadata.datasetName, - "referencedGeoresourceId": $scope.tmpGeoresourceReference_selectedGeoresourceMetadata.georesourceId, - "referencedGeoresourceDescription": $scope.tmpGeoresourceReference_referenceDescription - }; - - var processed = false; - - for (let index = 0; index < $scope.georesourceReferences_adminView.length; index++) { - var georesourceReference_adminView = $scope.georesourceReferences_adminView[index]; - - if (georesourceReference_adminView.referencedGeoresourceId === tmpGeoresourceReference_adminView.referencedGeoresourceId){ - // replace object - $scope.georesourceReferences_adminView[index] = tmpGeoresourceReference_adminView; - processed = true; - break; - } - } - - if(! processed){ - // new entry - $scope.georesourceReferences_adminView.push(tmpGeoresourceReference_adminView); - } - - $scope.tmpGeoresourceReference_selectedGeoresourceMetadata = undefined; - $scope.tmpGeoresourceReference_referenceDescription = undefined; - - setTimeout(() => { - $scope.$digest(); - }, 250); - }; - - $scope.onClickEditGeoresourceReference = function(georesourceReference_adminView){ - - $scope.tmpGeoresourceReference_selectedGeoresourceMetadata = kommonitorDataExchangeService.getGeoresourceMetadataById(georesourceReference_adminView.referencedGeoresourceId); - $scope.tmpGeoresourceReference_referenceDescription = georesourceReference_adminView.referencedGeoresourceDescription; - - setTimeout(() => { - $scope.$digest(); - }, 250); - }; - - $scope.onClickDeleteGeoresourceReference = function(georesourceReference_adminView){ - - for (let index = 0; index < $scope.georesourceReferences_adminView.length; index++) { - - if ($scope.georesourceReferences_adminView[index].referencedGeoresourceId === georesourceReference_adminView.referencedGeoresourceId){ - // remove object - $scope.georesourceReferences_adminView.splice(index, 1); - break; - } - } - - setTimeout(() => { - $scope.$digest(); - }, 250); - }; - - $scope.onChangeCreationType = function(){ - if($scope.indicatorCreationType.apiName === "COMPUTATION"){ - $scope.enableLowestSpatialUnitSelect = true; - } - else{ - $scope.enableLowestSpatialUnitSelect = false; - } - - }; - - $scope.onChangeIndicatorUnit = function(){ - if ($scope.indicatorUnit.includes("Freitext")){ - $scope.enableFreeTextUnit = true; - } - else{ - $scope.enableFreeTextUnit = false; - } - }; - - $scope.checkDatasetName = function(){ - $scope.datasetNameInvalid = false; - kommonitorDataExchangeService.availableIndicators.forEach(function(indicator){ - if (indicator.indicatorName === $scope.datasetName){ - $scope.datasetNameInvalid = true; - return; - } - }); - }; - - $scope.buildPatchBody_indicators = function(){ - var patchBody = - { - "metadata": { - "note": $scope.metadata.note || null, - "literature": $scope.metadata.literature || null, - "updateInterval": $scope.metadata.updateInterval.apiName, - "sridEPSG": $scope.metadata.sridEPSG || 4326, - "datasource": $scope.metadata.datasource, - "contact": $scope.metadata.contact, - "lastUpdate": $scope.metadata.lastUpdate, - "description": $scope.metadata.description || null, - "databasis": $scope.metadata.databasis || null - }, - "refrencesToOtherIndicators": [], // filled directly after - "allowedRoles": [], - "datasetName": $scope.datasetName, - "abbreviation": $scope.indicatorAbbreviation || null, - "characteristicValue": $scope.indicatorCharacteristicValue || null, - "tags": [], // filled directly after - "creationType": $scope.indicatorCreationType.apiName, - "unit": $scope.indicatorUnit, - "topicReference": "", // filled directly after - "refrencesToGeoresources": [], // filled directly after - "indicatorType": $scope.indicatorType.apiName, - "interpretation": $scope.indicatorInterpretation || "", - "isHeadlineIndicator": $scope.isHeadlineIndicator || false, - "processDescription": $scope.indicatorProcessDescription || "", - "referenceDateNote": $scope.indicatorReferenceDateNote || "", - "displayOrder": $scope.displayOrder, - "lowestSpatialUnitForComputation": $scope.indicatorLowestSpatialUnitMetadataObjectForComputation? $scope.indicatorLowestSpatialUnitMetadataObjectForComputation.spatialUnitLevel : null, - "defaultClassificationMapping": { - "colorBrewerSchemeName": $scope.selectedColorBrewerPaletteEntry.paletteName, - "items": [ - { - "defaultColorAsHex": "#edf8e9", - "defaultCustomRating": "sehr niedrig" - }, - { - "defaultColorAsHex": "#bae4b3", - "defaultCustomRating": "niedrig" - }, - { - "defaultColorAsHex": "#74c476", - "defaultCustomRating": "mittel" - }, - { - "defaultColorAsHex": "#31a354", - "defaultCustomRating": "hoch" - }, - { - "defaultColorAsHex": "#006d2c", - "defaultCustomRating": "sehr hoch" - } - ] - } - }; - - let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); - for (const roleId of roleIds) { - patchBody.allowedRoles.push(roleId); - } - - // TAGS - if($scope.indicatorTagsString_withCommas){ - var tags_splitted = $scope.indicatorTagsString_withCommas.split(","); - for (const tagString of tags_splitted) { - patchBody.tags.push(tagString.trim()); - } - } - - // TOPIC REFERENCE - if($scope.indicatorTopic_subsubsubTopic){ - patchBody.topicReference = $scope.indicatorTopic_subsubsubTopic.topicId; - } - else if($scope.indicatorTopic_subsubTopic){ - patchBody.topicReference = $scope.indicatorTopic_subsubTopic.topicId; - } - else if($scope.indicatorTopic_subTopic){ - patchBody.topicReference = $scope.indicatorTopic_subTopic.topicId; - } - else if($scope.indicatorTopic_mainTopic){ - patchBody.topicReference = $scope.indicatorTopic_mainTopic.topicId; - } - else { - patchBody.topicReference = ""; - } - - - // REFERENCES - if($scope.indicatorReferences_adminView && $scope.indicatorReferences_adminView.length > 0){ - patchBody.refrencesToOtherIndicators = []; - - for (const indicRef of $scope.indicatorReferences_adminView) { - patchBody.refrencesToOtherIndicators.push({ - "indicatorId": indicRef.referencedIndicatorId, - "referenceDescription": indicRef.referencedIndicatorDescription - }); - } - } - - if($scope.georesourceReferences_adminView && $scope.georesourceReferences_adminView.length > 0){ - patchBody.refrencesToGeoresources = []; - - for (const geoRef of $scope.georesourceReferences_adminView) { - patchBody.refrencesToGeoresources.push({ - "georesourceId": geoRef.referencedGeoresourceId, - "referenceDescription": geoRef.referencedGeoresourceDescription - }); - } - } - - - return patchBody; - }; - - $scope.editIndicatorMetadata = function(){ - - var patchBody = $scope.buildPatchBody_indicators(); - - // TODO verify input - - // TODO Create and perform POST Request with loading screen - - $scope.loadingData = true; - - $http({ - url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/indicators/" + $scope.currentIndicatorDataset.indicatorId, - method: "PATCH", - data: patchBody - // headers: { - // 'Content-Type': undefined - // } - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - $scope.successMessagePart = $scope.datasetName; - - $rootScope.$broadcast("refreshIndicatorOverviewTable", "edit", $scope.currentIndicatorDataset.indicatorId); - $("#indicatorEditMetadataSuccessAlert").show(); - $scope.loadingData = false; - - }, function errorCallback(error) { - if(error.data){ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else{ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - - $("#indicatorEditMetadataErrorAlert").show(); - $scope.loadingData = false; - - // setTimeout(function() { - // $("#indicatorEditMetadataSuccessAlert").hide(); - // }, 3000); - }); - }; - - $scope.onImportIndicatorEditMetadata = function(){ - - $scope.indicatorMetadataImportError = ""; - - $("#indicatorEditMetadataImportFile").files = []; - - // trigger file chooser - $("#indicatorEditMetadataImportFile").click(); - - }; - - $(document).on("change", "#indicatorEditMetadataImportFile" ,function(){ - - console.log("Importing Indicator metadata for Edit Indicator Form"); - - // get the file - var file = document.getElementById('indicatorEditMetadataImportFile').files[0]; - $scope.parseMetadataFromFile(file); - }); - - $scope.parseMetadataFromFile = function(file){ - var fileReader = new FileReader(); - - fileReader.onload = function(event) { - - try{ - $scope.parseFromMetadataFile(event); - } - catch(error){ - console.error("Uploaded Metadata File cannot be parsed."); - $scope.indicatorMetadataImportError = "Uploaded Metadata File cannot be parsed correctly"; - document.getElementById("indicatorsEditMetadataPre").innerHTML = $scope.indicatorMetadataStructure_pretty; - $("#indicatorEditMetadataImportErrorAlert").show(); - - $scope.$digest(); - } - - }; - - // Read in the image file as a data URL. - fileReader.readAsText(file); - }; - - $scope.parseFromMetadataFile = function(event){ - // $scope.geoJsonString = event.target.result; - $scope.metadataImportSettings = JSON.parse(event.target.result); - - if(! $scope.metadataImportSettings.metadata){ - console.error("uploaded Metadata File cannot be parsed - wrong structure."); - $scope.indicatorMetadataImportError = "Struktur der Datei stimmt nicht mit erwartetem Muster überein."; - document.getElementById("indicatorsAddMetadataPre").innerHTML = $scope.indicatorMetadataStructure_pretty; - $("#indicatorAddMetadataImportErrorAlert").show(); - - $scope.$digest(); - } - - $scope.metadata = {}; - $scope.metadata.note = $scope.metadataImportSettings.metadata.note; - $scope.metadata.literature = $scope.metadataImportSettings.metadata.literature; - kommonitorDataExchangeService.updateIntervalOptions.forEach(function(option){ - if(option.apiName === $scope.metadataImportSettings.metadata.updateInterval){ - $scope.metadata.updateInterval = option; - } - }); - $scope.metadata.sridEPSG = $scope.metadataImportSettings.metadata.sridEPSG; - $scope.metadata.datasource = $scope.metadataImportSettings.metadata.datasource; - $scope.metadata.contact = $scope.metadataImportSettings.metadata.contact; - $scope.metadata.lastUpdate = $scope.metadataImportSettings.metadata.lastUpdate; - // initialize date - $('#indicatorAddLastUpdateDatepicker').datepicker('setDate', $scope.metadata.lastUpdate); - - $scope.metadata.description = $scope.metadataImportSettings.metadata.description; - $scope.metadata.databasis = $scope.metadataImportSettings.metadata.databasis; - - $scope.datasetName = $scope.metadataImportSettings.datasetName; - - $scope.indicatorReferenceDateNote = $scope.metadataImportSettings.referenceDateNote; - $scope.displayOrder = $scope.metadataImportSettings.displayOrder; - - $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, $scope.metadataImportSettings.allowedRoles); - - // indicator specific properties - - $scope.indicatorAbbreviation = $scope.metadataImportSettings.abbreviation; - - for (const indicatorTypeOption of kommonitorDataExchangeService.indicatorTypeOptions) { - if(indicatorTypeOption.apiName === $scope.metadataImportSettings.indicatorType){ - $scope.indicatorType = indicatorTypeOption; - break; - } - } - - for (const indicatorCreationTypeOption of kommonitorDataExchangeService.indicatorCreationTypeOptions) { - if(indicatorCreationTypeOption.apiName === $scope.metadataImportSettings.creationType){ - $scope.indicatorCreationType = indicatorCreationTypeOption; - - if(indicatorCreationTypeOption.apiName === "COMPUTATION"){ - $scope.enableLowestSpatialUnitSelect = true; - } - else{ - $scope.enableLowestSpatialUnitSelect = false; - } - break; - } - } - - $scope.indicatorCharacteristicValue = $scope.metadataImportSettings.characteristicValue; - $scope.isHeadlineIndicator = $scope.metadataImportSettings.isHeadlineIndicator; - $scope.indicatorUnit = $scope.metadataImportSettings.unit; - if(kommonitorDataExchangeService.indicatorUnitOptions.includes($scope.metadataImportSettings.unit)){ - $scope.enableFreeTextUnit = false; - } - else{ - $scope.enableFreeTextUnit = true; - } - - $scope.indicatorProcessDescription = $scope.metadataImportSettings.processDescription; - - $scope.indicatorTagsString_withCommas = undefined; - if($scope.metadataImportSettings.tags && $scope.metadataImportSettings.tags.length > 0){ - $scope.indicatorTagsString_withCommas = ""; - for (let index = 0; index < $scope.metadataImportSettings.tags.length; index++) { - $scope.indicatorTagsString_withCommas += $scope.metadataImportSettings.tags[index]; - - if(index < $scope.metadataImportSettings.tags.length - 1){ - $scope.indicatorTagsString_withCommas += ","; - } - } - } - - $scope.indicatorInterpretation = $scope.metadataImportSettings.interpretation; - $scope.indicatorLowestSpatialUnitMetadataObjectForComputation = undefined; - - for (let i = 0; i < kommonitorDataExchangeService.availableSpatialUnits.length; i++) { - const spatialUnitMetadata = kommonitorDataExchangeService.availableSpatialUnits[i]; - - if(spatialUnitMetadata.spatialUnitLevel === $scope.metadataImportSettings.lowestSpatialUnitForComputation){ - $scope.indicatorLowestSpatialUnitMetadataObjectForComputation = spatialUnitMetadata; - break; - } - } - - var topicHierarchy = kommonitorDataExchangeService.getTopicHierarchyForTopicId($scope.metadataImportSettings.topicReference); - - if(topicHierarchy && topicHierarchy[0]){ - $scope.indicatorTopic_mainTopic = topicHierarchy[0]; - } - if(topicHierarchy && topicHierarchy[1]){ - $scope.indicatorTopic_subTopic = topicHierarchy[1]; - } - if(topicHierarchy && topicHierarchy[2]){ - $scope.indicatorTopic_subsubTopic = topicHierarchy[2]; - } - if(topicHierarchy && topicHierarchy[3]){ - $scope.indicatorTopic_subsubsubTopic = topicHierarchy[3]; - } - - $scope.indicatorNameFilter = undefined; - $scope.tmpIndicatorReference_selectedIndicatorMetadata = undefined; - $scope.tmpIndicatorReference_referenceDescription = undefined; - - // tmp array to display indicatorReferences - $scope.indicatorReferences_adminView = []; - // array for API request (has less information per item) - $scope.indicatorReferences_apiRequest = []; - if($scope.metadataImportSettings.refrencesToOtherIndicators && $scope.metadataImportSettings.refrencesToOtherIndicators.length > 0){ - for (const indicatorReference of $scope.metadataImportSettings.refrencesToOtherIndicators) { - var indicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(indicatorReference.indicatorId); - var referenceEntry = { - "referencedIndicatorName": indicatorMetadata.indicatorName, - "referencedIndicatorId": indicatorMetadata.indicatorId, - "referencedIndicatorAbbreviation": indicatorMetadata.abbreviation, - "referencedIndicatorDescription": indicatorReference.referenceDescription - }; - $scope.indicatorReferences_adminView.push(referenceEntry); - } - - } - - $scope.georesourceNameFilter = undefined; - $scope.tmpGeoresourceReference_selectedGeoresourceMetadata = undefined; - $scope.tmpGeoresourceReference_referenceDescription = undefined; - // tmp array to display georesourceReferences - $scope.georesourceReferences_adminView = []; - // array for API request (has less information per item) - $scope.georesourceReferences_apiRequest = []; - - if($scope.metadataImportSettings.refrencesToGeoresources && $scope.metadataImportSettings.refrencesToGeoresources.length > 0){ - for (const georesourceReference of $scope.metadataImportSettings.refrencesToGeoresources) { - var georesourceMetadata = kommonitorDataExchangeService.getGeoresourceMetadataById(georesourceReference.georesourceId); - var geo_referenceEntry = { - "referencedGeoresourceName": georesourceMetadata.datasetName, - "referencedGeoresourceId": georesourceMetadata.georesourceId, - "referencedGeoresourceDescription": georesourceReference.referenceDescription - }; - $scope.georesourceReferences_adminView.push(geo_referenceEntry); - } - - } - - $scope.numClassesArray = [3,4,5,6,7,8]; - $scope.numClasses = $scope.numClassesArray[2]; - $scope.selectedColorBrewerPaletteEntry = undefined; - - for (const colorbrewerPalette of $scope.colorbrewerPalettes) { - if (colorbrewerPalette.paletteName === $scope.metadataImportSettings.defaultClassificationMapping.colorBrewerSchemeName){ - $scope.selectedColorBrewerPaletteEntry = colorbrewerPalette; - break; - } - } - - $scope.spatialUnitRefKeyProperty = undefined; - $scope.targetSpatialUnitMetadata = undefined; - $scope.$digest(); - }; - - $scope.onExportIndicatorEditMetadataTemplate = function(){ - - var metadataJSON = JSON.stringify($scope.indicatorMetadataStructure); - - var fileName = "Indikator_Metadaten_Vorlage_Export.json"; - - var blob = new Blob([metadataJSON], {type: "application/json"}); - var data = URL.createObjectURL(blob); - - var a = document.createElement('a'); - a.download = fileName; - a.href = data; - a.textContent = "JSON"; - a.target = "_blank"; - a.rel = "noopener noreferrer"; - a.click(); - - a.remove(); - }; - - $scope.onExportIndicatorEditMetadata = function(){ - var metadataExport = $scope.indicatorMetadataStructure; - - metadataExport.metadata.note = $scope.metadata.note || ""; - metadataExport.metadata.literature = $scope.metadata.literature || ""; - metadataExport.metadata.sridEPSG = $scope.metadata.sridEPSG || ""; - metadataExport.metadata.datasource = $scope.metadata.datasource || ""; - metadataExport.metadata.contact = $scope.metadata.contact || ""; - metadataExport.metadata.lastUpdate = $scope.metadata.lastUpdate || ""; - metadataExport.metadata.description = $scope.metadata.description || ""; - metadataExport.metadata.databasis = $scope.metadata.databasis || ""; - metadataExport.datasetName = $scope.datasetName || ""; - - metadataExport.referenceDateNote = $scope.indicatorReferenceDateNote; - metadataExport.displayOrder = $scope.displayOrder; - - metadataExport.allowedRoles = []; - let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); - for (const roleId of roleIds) { - metadataExport.allowedRoles.push(roleId); - } - - if($scope.metadata.updateInterval){ - metadataExport.metadata.updateInterval = $scope.metadata.updateInterval.apiName; - } - - var name = $scope.datasetName; - - // indicator specific properties - - metadataExport.abbreviation = $scope.indicatorAbbreviation || ""; - metadataExport.indicatorType = $scope.indicatorType ? $scope.indicatorType.apiName : ""; - metadataExport.creationType = $scope.indicatorCreationType ? $scope.indicatorCreationType.apiName : ""; - - metadataExport.characteristicValue = $scope.indicatorCharacteristicValue || ""; - metadataExport.isHeadlineIndicator = $scope.isHeadlineIndicator || false; - metadataExport.unit = $scope.indicatorUnit || ""; - metadataExport.processDescription = $scope.indicatorProcessDescription || ""; - metadataExport.tags = []; - - if($scope.indicatorTagsString_withCommas){ - var tags_splitted = $scope.indicatorTagsString_withCommas.split(","); - for (const tagString of tags_splitted) { - metadataExport.tags.push(tagString.trim()); - } - } - - metadataExport.interpretation = $scope.indicatorInterpretation || ""; - metadataExport.lowestSpatialUnitForComputation = $scope.indicatorLowestSpatialUnitMetadataObjectForComputation? $scope.indicatorLowestSpatialUnitMetadataObjectForComputation.spatialUnitLevel : ""; - - if($scope.indicatorTopic_subsubsubTopic){ - metadataExport.topicReference = $scope.indicatorTopic_subsubsubTopic.topicId; - } - else if($scope.indicatorTopic_subsubTopic){ - metadataExport.topicReference = $scope.indicatorTopic_subsubTopic.topicId; - } - else if($scope.indicatorTopic_subTopic){ - metadataExport.topicReference = $scope.indicatorTopic_subTopic.topicId; - } - else if($scope.indicatorTopic_mainTopic){ - metadataExport.topicReference = $scope.indicatorTopic_mainTopic.topicId; - } - else { - metadataExport.topicReference = ""; - } - - metadataExport.refrencesToOtherIndicators = []; - - if($scope.indicatorReferences_adminView && $scope.indicatorReferences_adminView.length > 0){ - metadataExport.refrencesToOtherIndicators = []; - - for (const indicRef of $scope.indicatorReferences_adminView) { - metadataExport.refrencesToOtherIndicators.push({ - "indicatorId": indicRef.referencedIndicatorId, - "referenceDescription": indicRef.referencedIndicatorDescription - }); - } - } - - metadataExport.refrencesToGeoresources = []; - - if($scope.georesourceReferences_adminView && $scope.georesourceReferences_adminView.length > 0){ - metadataExport.refrencesToGeoresources = []; - - for (const geoRef of $scope.georesourceReferences_adminView) { - metadataExport.refrencesToGeoresources.push({ - "georesourceId": geoRef.referencedGeoresourceId, - "referenceDescription": geoRef.referencedGeoresourceDescription - }); - } - } - - var defaultClassificationMapping = { - "colorBrewerSchemeName" : $scope.selectedColorBrewerPaletteEntry ? $scope.selectedColorBrewerPaletteEntry.paletteName : "Blues", - "items": [ - { - "defaultColorAsHex": "#edf8e9", - "defaultCustomRating": "sehr niedrig" - }, - { - "defaultColorAsHex": "#bae4b3", - "defaultCustomRating": "niedrig" - }, - { - "defaultColorAsHex": "#74c476", - "defaultCustomRating": "mittel" - }, - { - "defaultColorAsHex": "#31a354", - "defaultCustomRating": "hoch" - }, - { - "defaultColorAsHex": "#006d2c", - "defaultCustomRating": "sehr hoch" - } - ] - }; - - metadataExport.defaultClassificationMapping = defaultClassificationMapping; - - - var metadataJSON = JSON.stringify(metadataExport); - - var fileName = "Indikatoren_Metadaten_Export"; - - if (name){ - fileName += "-" + name; - } - - fileName += ".json"; - - var blob = new Blob([metadataJSON], {type: "application/json"}); - var data = URL.createObjectURL(blob); - - var a = document.createElement('a'); - a.download = fileName; - a.href = data; - a.textContent = "JSON"; - a.target = "_blank"; - a.rel = "noopener noreferrer"; - a.click(); - - a.remove(); - }; - - $scope.hideSuccessAlert = function(){ - $("#indicatorEditMetadataSuccessAlert").hide(); - }; - - $scope.hideErrorAlert = function(){ - $("#indicatorEditMetadataErrorAlert").hide(); - }; - - $scope.hideMetadataErrorAlert = function(){ - $("#indicatorEditMetadataImportErrorAlert").hide(); - }; - - } -]}); + templateUrl: "components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditMetadataModal/indicator-edit-metadata-modal.template.html", + controller: ['kommonitorDataExchangeService', '$scope', '$rootScope', '$http', '__env', '$timeout', 'kommonitorMultiStepFormHelperService', + 'kommonitorDataGridHelperService', + function IndicatorEditMetadataModalController(kommonitorDataExchangeService, $scope, $rootScope, $http, __env, $timeout, kommonitorMultiStepFormHelperService, kommonitorDataGridHelperService) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + $scope.currentIndicatorDataset; + /* POST BODY + { + + "refrencesToOtherIndicators": [ + { + "referenceDescription": "referenceDescription", + "indicatorId": "indicatorId" + }, + { + "referenceDescription": "referenceDescription", + "indicatorId": "indicatorId" + } + ], + "metadata": { + "note": "note", + "literature": "literature", + "updateInterval": "ARBITRARY", + "sridEPSG": 0.8008281904610115, + "datasource": "datasource", + "contact": "contact", + "lastUpdate": "2000-01-23", + "description": "description", + "databasis": "databasis" + }, + "allowedRoles": [ + "allowedRoles", + "allowedRoles" + ], + "datasetName": "datasetName", + "applicableSpatialUnit": "applicableSpatialUnit", + "abbreviation": "abbreviation", + "characteristicValue": "characteristicValue", + "tags": [ + "tags", + "tags" + ], + "creationType": "INSERTION", + "unit": "unit", + "topicReference": "topicReference", + "referenceDateNote": "optional note for indicator reference date", + "displayOrder": 0, + "refrencesToGeoresources": [ + { + "referenceDescription": "referenceDescription", + "georesourceId": "georesourceId" + }, + { + "referenceDescription": "referenceDescription", + "georesourceId": "georesourceId" + } + ], + "indicatorType": "STATUS_ABSOLUTE", + "interpretation": "interpretation", + "isHeadlineIndicator": false, + "processDescription": "processDescription", + "lowestSpatialUnitForComputation": "lowestSpatialUnitForComputation", + "defaultClassificationMapping": { + "colorBrewerSchemeName": "colorBrewerSchemeName", + "items": [ + { + "defaultCustomRating": "defaultCustomRating", + "defaultColorAsHex": "defaultColorAsHex" + }, + { + "defaultCustomRating": "defaultCustomRating", + "defaultColorAsHex": "defaultColorAsHex" + } + ] + } + } + */ + //Date picker + $('#indicatorEditLastUpdateDatepicker').datepicker(kommonitorDataExchangeService.datePickerOptions); + $scope.indicatorMetadataStructure = { + "metadata": { + "note": "an optional note", + "literature": "optional text about literature", + "updateInterval": "YEARLY|HALF_YEARLY|QUARTERLY|MONTHLY|ARBITRARY", + "sridEPSG": 4326, + "datasource": "text about data source", + "contact": "text about contact details", + "lastUpdate": "YYYY-MM-DD", + "description": "description about spatial unit dataset", + "databasis": "text about data basis", + }, + "allowedRoles": ['roleId'], + "refrencesToOtherIndicators": [ + { + "referenceDescription": "description about the reference", + "indicatorId": "ID of referenced indicator dataset" + } + ], + "refrencesToGeoresources": [ + { + "referenceDescription": "description about the reference", + "georesourceId": "ID of referenced georesource dataset" + } + ], + "datasetName": "Name of indicator dataset", + "abbreviation": "optional abbreviation of the indicator dataset", + "characteristicValue": "if the same datasetName is used for different indicators, the optional characteristicValue parameter may serve to distinguish between them (i.e. Habitants - male, Habitants - female, Habitants - diverse)", + "tags": [ + "optinal list of tags; each tag is a free text tag" + ], + "creationType": "INSERTION|COMPUTATION <-- enum parameter controls whether each timestamp must be updated manually (INSERTION) or if KomMonitor shall compute the indicator values for respective timestamps based on script file (COMPUTATION)", + "unit": "unit of the indicator", + "topicReference": "ID of the respective main/sub topic instance", + "indicatorType": "STATUS_ABSOLUTE|STATUS_RELATIVE|DYNAMIC_ABSOLUTE|DYNAMIC_RELATIVE|STATUS_STANDARDIZED|DYNAMIC_STANDARDIZED", + "interpretation": "interpretation hints for the user to better understand the indicator values", + "isHeadlineIndicator": "boolean parameter to indicate if indicator is a headline indicator", + "processDescription": "detailed description about the computation/creation of the indicator", + "lowestSpatialUnitForComputation": "the name of the lowest possible spatial unit for which an indicator of creationType=COMPUTATION may be computed. All other superior spatial units will be aggregated automatically", + "referenceDateNote": "optional note for indicator reference date", + "displayOrder": 0, + "defaultClassificationMapping": { + "colorBrewerSchemeName": "schema name of colorBrewer colorPalette to use for classification", + "items": [ + { + "defaultCustomRating": "a string to rate indicator values of this class", + "defaultColorAsHex": "color as hexadecimal value" + } + ] + } + }; + $scope.indicatorMetadataStructure_pretty = kommonitorDataExchangeService.syntaxHighlightJSON($scope.indicatorMetadataStructure); + $scope.metadataImportSettings; + $scope.indicatorMetadataImportError; + $scope.indicatorAddMetadataImportErrorAlert; + $scope.datasetName = undefined; + $scope.datasetNameInvalid = false; + $scope.metadata = {}; + $scope.metadata.note = undefined; + $scope.metadata.literature = undefined; + $scope.metadata.updateInterval = undefined; + $scope.metadata.sridEPSG = undefined; + $scope.metadata.datasource = undefined; + $scope.metadata.databasis = undefined; + $scope.metadata.contact = undefined; + $scope.metadata.lastUpdate = undefined; + $scope.metadata.description = undefined; + $scope.roleManagementTableOptions = undefined; + $scope.datasetName = undefined; + $scope.indicatorAbbreviation = undefined; + $scope.indicatorType = undefined; + $scope.indicatorCharacteristicValue = undefined; + $scope.isHeadlineIndicator = false; + $scope.indicatorUnit = undefined; + $scope.enableFreeTextUnit = false; + $scope.indicatorProcessDescription = undefined; + $scope.indicatorTagsString_withCommas = undefined; + $scope.indicatorInterpretation = undefined; + $scope.indicatorCreationType = undefined; + $scope.indicatorLowestSpatialUnitMetadataObjectForComputation = undefined; + $scope.enableLowestSpatialUnitSelect = false; + $scope.indicatorReferenceDateNote = undefined; + $scope.displayOrder = 0; + $scope.indicatorTopic_mainTopic = undefined; + $scope.indicatorTopic_subTopic = undefined; + $scope.indicatorTopic_subsubTopic = undefined; + $scope.indicatorTopic_subsubsubTopic = undefined; + $scope.indicatorNameFilter = undefined; + $scope.tmpIndicatorReference_selectedIndicatorMetadata = undefined; + $scope.tmpIndicatorReference_referenceDescription = undefined; + // tmp array to display indicatorReferences + $scope.indicatorReferences_adminView = []; + // array for API request (has less information per item) + $scope.indicatorReferences_apiRequest = []; + $scope.georesourceNameFilter = undefined; + $scope.tmpGeoresourceReference_selectedGeoresourceMetadata = undefined; + $scope.tmpGeoresourceReference_referenceDescription = undefined; + // tmp array to display georesourceReferences + $scope.georesourceReferences_adminView = []; + // array for API request (has less information per item) + $scope.georesourceReferences_apiRequest = []; + $scope.numClassesArray = [3, 4, 5, 6, 7, 8]; + $scope.numClasses = $scope.numClassesArray[2]; + $scope.selectedColorBrewerPaletteEntry = undefined; + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + $scope.colorbrewerSchemes = colorbrewer; + $scope.colorbreweSchemeName_dynamicIncrease = __env.defaultColorBrewerPaletteForBalanceIncreasingValues; + $scope.colorbreweSchemeName_dynamicDecrease = __env.defaultColorBrewerPaletteForBalanceDecreasingValues; + $scope.colorbrewerPalettes = []; + $scope.instantiateColorBrewerPalettes = function () { + for (const key in colorbrewer) { + if (colorbrewer.hasOwnProperty(key)) { + const colorPalettes = colorbrewer[key]; + var paletteEntry = { + "paletteName": key, + "paletteArrayObject": colorPalettes + }; + $scope.colorbrewerPalettes.push(paletteEntry); + } + } + // instantiate with palette 'Blues' + $scope.selectedColorBrewerPaletteEntry = $scope.colorbrewerPalettes[13]; + }; + $scope.instantiateColorBrewerPalettes(); + $scope.$on("onEditIndicatorMetadata", function (event, indicatorDataset) { + $scope.currentIndicatorDataset = indicatorDataset; + $scope.resetIndicatorEditMetadataForm(); + kommonitorMultiStepFormHelperService.registerClickHandler(); + }); + $scope.$on("availableRolesUpdate", function (event) { + let allowedRoles = $scope.currentIndicatorDataset ? $scope.currentIndicatorDataset.allowedRoles : []; + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, allowedRoles); + }); + $scope.resetIndicatorEditMetadataForm = function () { + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + $scope.datasetName = $scope.currentIndicatorDataset.indicatorName; + $scope.datasetNameInvalid = false; + $scope.indicatorReferenceDateNote = $scope.currentIndicatorDataset.referenceDateNote; + $scope.displayOrder = $scope.currentIndicatorDataset.displayOrder; + $scope.metadata = {}; + $scope.metadata.note = $scope.currentIndicatorDataset.metadata.note; + $scope.metadata.literature = $scope.currentIndicatorDataset.metadata.literature; + $scope.metadata.sridEPSG = 4326; + $scope.metadata.datasource = $scope.currentIndicatorDataset.metadata.datasource; + $scope.metadata.databasis = $scope.currentIndicatorDataset.metadata.databasis; + $scope.metadata.contact = $scope.currentIndicatorDataset.metadata.contact; + $scope.metadata.description = $scope.currentIndicatorDataset.metadata.description; + $scope.metadata.lastUpdate = $scope.currentIndicatorDataset.metadata.lastUpdate; + // $('#indicatorEditLastUpdateDatepicker').data({date: $scope.currentIndicatorDataset.metadata.lastUpdate}); + $('#indicatorEditLastUpdateDatepicker').datepicker('setDate', $scope.currentIndicatorDataset.metadata.lastUpdate); + kommonitorDataExchangeService.updateIntervalOptions.forEach(function (option) { + if (option.apiName === $scope.currentIndicatorDataset.metadata.updateInterval) { + $scope.metadata.updateInterval = option; + } + }); + let allowedRoles = $scope.currentIndicatorDataset ? $scope.currentIndicatorDataset.allowedRoles : []; + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, allowedRoles); + $scope.indicatorAbbreviation = $scope.currentIndicatorDataset.abbreviation; + kommonitorDataExchangeService.indicatorTypeOptions.forEach(function (option) { + if (option.apiName === $scope.currentIndicatorDataset.indicatorType) { + $scope.indicatorType = option; + } + }); + $scope.indicatorCharacteristicValue = $scope.currentIndicatorDataset.characteristicValue; + $scope.isHeadlineIndicator = $scope.currentIndicatorDataset.isHeadlineIndicator; + $scope.indicatorUnit = $scope.currentIndicatorDataset.unit; + $scope.enableFreeTextUnit = true; + kommonitorDataExchangeService.indicatorUnitOptions.forEach(function (option) { + if (option === $scope.currentIndicatorDataset.unit) { + // if the unit is in list of known units then disable freeText + $scope.enableFreeTextUnit = false; + } + }); + $scope.indicatorProcessDescription = $scope.currentIndicatorDataset.processDescription; + $scope.indicatorTagsString_withCommas = ""; + for (let index = 0; index < $scope.currentIndicatorDataset.tags.length; index++) { + $scope.indicatorTagsString_withCommas += $scope.currentIndicatorDataset.tags[index]; + if (index < $scope.currentIndicatorDataset.tags.length - 1) { + $scope.indicatorTagsString_withCommas += ","; + } + } + if (!$scope.currentIndicatorDataset.tags || $scope.currentIndicatorDataset.tags.length === 0) { + $scope.indicatorTagsString_withCommas = undefined; + } + $scope.indicatorInterpretation = $scope.currentIndicatorDataset.interpretation; + kommonitorDataExchangeService.indicatorCreationTypeOptions.forEach(function (option) { + if (option.apiName === $scope.currentIndicatorDataset.creationType) { + $scope.indicatorCreationType = option; + } + }); + $scope.indicatorLowestSpatialUnitMetadataObjectForComputation = undefined; + for (let i = 0; i < kommonitorDataExchangeService.availableSpatialUnits.length; i++) { + const spatialUnitMetadata = kommonitorDataExchangeService.availableSpatialUnits[i]; + if (spatialUnitMetadata.spatialUnitLevel === $scope.currentIndicatorDataset.lowestSpatialUnitForComputation) { + $scope.indicatorLowestSpatialUnitMetadataObjectForComputation = spatialUnitMetadata; + break; + } + } + if ($scope.indicatorCreationType.apiName === "COMPUTATION") { + $scope.enableLowestSpatialUnitSelect = true; + } + else { + $scope.enableLowestSpatialUnitSelect = false; + } + var topicHierarchy = kommonitorDataExchangeService.getTopicHierarchyForTopicId($scope.currentIndicatorDataset.topicReference); + if (topicHierarchy && topicHierarchy[0]) { + $scope.indicatorTopic_mainTopic = topicHierarchy[0]; + } + if (topicHierarchy && topicHierarchy[1]) { + $scope.indicatorTopic_subTopic = topicHierarchy[1]; + } + if (topicHierarchy && topicHierarchy[2]) { + $scope.indicatorTopic_subsubTopic = topicHierarchy[2]; + } + if (topicHierarchy && topicHierarchy[3]) { + $scope.indicatorTopic_subsubsubTopic = topicHierarchy[3]; + } + $scope.indicatorNameFilter = undefined; + $scope.tmpIndicatorReference_selectedIndicatorMetadata = undefined; + $scope.tmpIndicatorReference_referenceDescription = undefined; + // tmp array to display indicatorReferences + $scope.indicatorReferences_adminView = []; + // array for API request (has less information per item) + $scope.indicatorReferences_apiRequest = []; + if ($scope.currentIndicatorDataset.referencedIndicators && $scope.currentIndicatorDataset.referencedIndicators.length > 0) { + for (const indicatorReference of $scope.currentIndicatorDataset.referencedIndicators) { + var indicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(indicatorReference.referencedIndicatorId); + var referenceEntry = { + "referencedIndicatorName": indicatorMetadata.indicatorName, + "referencedIndicatorId": indicatorMetadata.indicatorId, + "referencedIndicatorAbbreviation": indicatorMetadata.abbreviation, + "referencedIndicatorDescription": indicatorReference.referencedIndicatorDescription + }; + $scope.indicatorReferences_adminView.push(referenceEntry); + } + } + $scope.georesourceNameFilter = undefined; + $scope.tmpGeoresourceReference_selectedGeoresourceMetadata = undefined; + $scope.tmpGeoresourceReference_referenceDescription = undefined; + // tmp array to display georesourceReferences + $scope.georesourceReferences_adminView = []; + // array for API request (has less information per item) + $scope.georesourceReferences_apiRequest = []; + if ($scope.currentIndicatorDataset.referencedGeoresources && $scope.currentIndicatorDataset.referencedGeoresources.length > 0) { + for (const georesourceReference of $scope.currentIndicatorDataset.referencedGeoresources) { + var georesourceMetadata = kommonitorDataExchangeService.getGeoresourceMetadataById(georesourceReference.referencedGeoresourceId); + var geo_referenceEntry = { + "referencedGeoresourceName": georesourceMetadata.datasetName, + "referencedGeoresourceId": georesourceMetadata.georesourceId, + "referencedGeoresourceDescription": georesourceReference.referencedGeoresourceDescription + }; + $scope.georesourceReferences_adminView.push(geo_referenceEntry); + } + } + $scope.numClassesArray = [3, 4, 5, 6, 7, 8]; + $scope.numClasses = $scope.numClassesArray[2]; + // instantiate with palette 'Blues' + $scope.selectedColorBrewerPaletteEntry = $scope.colorbrewerPalettes[13]; + for (const colorbrewerPalette of $scope.colorbrewerPalettes) { + if (colorbrewerPalette.paletteName === $scope.currentIndicatorDataset.defaultClassificationMapping.colorBrewerSchemeName) { + $scope.selectedColorBrewerPaletteEntry = colorbrewerPalette; + break; + } + } + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + $("#indicatorEditMetadataSuccessAlert").hide(); + $("#indicatorEditMetadataErrorAlert").hide(); + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.onClickColorBrewerEntry = function (colorPaletteEntry) { + $scope.selectedColorBrewerPaletteEntry = colorPaletteEntry; + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.onAddOrUpdateIndicatorReference = function () { + var tmpIndicatorReference_adminView = { + "referencedIndicatorName": $scope.tmpIndicatorReference_selectedIndicatorMetadata.indicatorName, + "referencedIndicatorId": $scope.tmpIndicatorReference_selectedIndicatorMetadata.indicatorId, + "referencedIndicatorAbbreviation": $scope.tmpIndicatorReference_selectedIndicatorMetadata.abbreviation, + "referencedIndicatorDescription": $scope.tmpIndicatorReference_referenceDescription + }; + var processed = false; + for (let index = 0; index < $scope.indicatorReferences_adminView.length; index++) { + var indicatorReference_adminView = $scope.indicatorReferences_adminView[index]; + if (indicatorReference_adminView.referencedIndicatorId === tmpIndicatorReference_adminView.referencedIndicatorId) { + // replace object + $scope.indicatorReferences_adminView[index] = tmpIndicatorReference_adminView; + processed = true; + break; + } + } + if (!processed) { + // new entry + $scope.indicatorReferences_adminView.push(tmpIndicatorReference_adminView); + } + $scope.tmpIndicatorReference_selectedIndicatorMetadata = undefined; + $scope.tmpIndicatorReference_referenceDescription = undefined; + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.onClickEditIndicatorReference = function (indicatorReference_adminView) { + $scope.tmpIndicatorReference_selectedIndicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(indicatorReference_adminView.referencedIndicatorId); + $scope.tmpIndicatorReference_referenceDescription = indicatorReference_adminView.referencedIndicatorDescription; + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.onClickDeleteIndicatorReference = function (indicatorReference_adminView) { + for (let index = 0; index < $scope.indicatorReferences_adminView.length; index++) { + if ($scope.indicatorReferences_adminView[index].referencedIndicatorId === indicatorReference_adminView.referencedIndicatorId) { + // remove object + $scope.indicatorReferences_adminView.splice(index, 1); + break; + } + } + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.onAddOrUpdateGeoresourceReference = function () { + var tmpGeoresourceReference_adminView = { + "referencedGeoresourceName": $scope.tmpGeoresourceReference_selectedGeoresourceMetadata.datasetName, + "referencedGeoresourceId": $scope.tmpGeoresourceReference_selectedGeoresourceMetadata.georesourceId, + "referencedGeoresourceDescription": $scope.tmpGeoresourceReference_referenceDescription + }; + var processed = false; + for (let index = 0; index < $scope.georesourceReferences_adminView.length; index++) { + var georesourceReference_adminView = $scope.georesourceReferences_adminView[index]; + if (georesourceReference_adminView.referencedGeoresourceId === tmpGeoresourceReference_adminView.referencedGeoresourceId) { + // replace object + $scope.georesourceReferences_adminView[index] = tmpGeoresourceReference_adminView; + processed = true; + break; + } + } + if (!processed) { + // new entry + $scope.georesourceReferences_adminView.push(tmpGeoresourceReference_adminView); + } + $scope.tmpGeoresourceReference_selectedGeoresourceMetadata = undefined; + $scope.tmpGeoresourceReference_referenceDescription = undefined; + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.onClickEditGeoresourceReference = function (georesourceReference_adminView) { + $scope.tmpGeoresourceReference_selectedGeoresourceMetadata = kommonitorDataExchangeService.getGeoresourceMetadataById(georesourceReference_adminView.referencedGeoresourceId); + $scope.tmpGeoresourceReference_referenceDescription = georesourceReference_adminView.referencedGeoresourceDescription; + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.onClickDeleteGeoresourceReference = function (georesourceReference_adminView) { + for (let index = 0; index < $scope.georesourceReferences_adminView.length; index++) { + if ($scope.georesourceReferences_adminView[index].referencedGeoresourceId === georesourceReference_adminView.referencedGeoresourceId) { + // remove object + $scope.georesourceReferences_adminView.splice(index, 1); + break; + } + } + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.onChangeCreationType = function () { + if ($scope.indicatorCreationType.apiName === "COMPUTATION") { + $scope.enableLowestSpatialUnitSelect = true; + } + else { + $scope.enableLowestSpatialUnitSelect = false; + } + }; + $scope.onChangeIndicatorUnit = function () { + if ($scope.indicatorUnit.includes("Freitext")) { + $scope.enableFreeTextUnit = true; + } + else { + $scope.enableFreeTextUnit = false; + } + }; + $scope.checkDatasetName = function () { + $scope.datasetNameInvalid = false; + kommonitorDataExchangeService.availableIndicators.forEach(function (indicator) { + if (indicator.indicatorName === $scope.datasetName) { + $scope.datasetNameInvalid = true; + return; + } + }); + }; + $scope.buildPatchBody_indicators = function () { + var patchBody = { + "metadata": { + "note": $scope.metadata.note || null, + "literature": $scope.metadata.literature || null, + "updateInterval": $scope.metadata.updateInterval.apiName, + "sridEPSG": $scope.metadata.sridEPSG || 4326, + "datasource": $scope.metadata.datasource, + "contact": $scope.metadata.contact, + "lastUpdate": $scope.metadata.lastUpdate, + "description": $scope.metadata.description || null, + "databasis": $scope.metadata.databasis || null + }, + "refrencesToOtherIndicators": [], + "allowedRoles": [], + "datasetName": $scope.datasetName, + "abbreviation": $scope.indicatorAbbreviation || null, + "characteristicValue": $scope.indicatorCharacteristicValue || null, + "tags": [], + "creationType": $scope.indicatorCreationType.apiName, + "unit": $scope.indicatorUnit, + "topicReference": "", + "refrencesToGeoresources": [], + "indicatorType": $scope.indicatorType.apiName, + "interpretation": $scope.indicatorInterpretation || "", + "isHeadlineIndicator": $scope.isHeadlineIndicator || false, + "processDescription": $scope.indicatorProcessDescription || "", + "referenceDateNote": $scope.indicatorReferenceDateNote || "", + "displayOrder": $scope.displayOrder, + "lowestSpatialUnitForComputation": $scope.indicatorLowestSpatialUnitMetadataObjectForComputation ? $scope.indicatorLowestSpatialUnitMetadataObjectForComputation.spatialUnitLevel : null, + "defaultClassificationMapping": { + "colorBrewerSchemeName": $scope.selectedColorBrewerPaletteEntry.paletteName, + "items": [ + { + "defaultColorAsHex": "#edf8e9", + "defaultCustomRating": "sehr niedrig" + }, + { + "defaultColorAsHex": "#bae4b3", + "defaultCustomRating": "niedrig" + }, + { + "defaultColorAsHex": "#74c476", + "defaultCustomRating": "mittel" + }, + { + "defaultColorAsHex": "#31a354", + "defaultCustomRating": "hoch" + }, + { + "defaultColorAsHex": "#006d2c", + "defaultCustomRating": "sehr hoch" + } + ] + } + }; + let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); + for (const roleId of roleIds) { + patchBody.allowedRoles.push(roleId); + } + // TAGS + if ($scope.indicatorTagsString_withCommas) { + var tags_splitted = $scope.indicatorTagsString_withCommas.split(","); + for (const tagString of tags_splitted) { + patchBody.tags.push(tagString.trim()); + } + } + // TOPIC REFERENCE + if ($scope.indicatorTopic_subsubsubTopic) { + patchBody.topicReference = $scope.indicatorTopic_subsubsubTopic.topicId; + } + else if ($scope.indicatorTopic_subsubTopic) { + patchBody.topicReference = $scope.indicatorTopic_subsubTopic.topicId; + } + else if ($scope.indicatorTopic_subTopic) { + patchBody.topicReference = $scope.indicatorTopic_subTopic.topicId; + } + else if ($scope.indicatorTopic_mainTopic) { + patchBody.topicReference = $scope.indicatorTopic_mainTopic.topicId; + } + else { + patchBody.topicReference = ""; + } + // REFERENCES + if ($scope.indicatorReferences_adminView && $scope.indicatorReferences_adminView.length > 0) { + patchBody.refrencesToOtherIndicators = []; + for (const indicRef of $scope.indicatorReferences_adminView) { + patchBody.refrencesToOtherIndicators.push({ + "indicatorId": indicRef.referencedIndicatorId, + "referenceDescription": indicRef.referencedIndicatorDescription + }); + } + } + if ($scope.georesourceReferences_adminView && $scope.georesourceReferences_adminView.length > 0) { + patchBody.refrencesToGeoresources = []; + for (const geoRef of $scope.georesourceReferences_adminView) { + patchBody.refrencesToGeoresources.push({ + "georesourceId": geoRef.referencedGeoresourceId, + "referenceDescription": geoRef.referencedGeoresourceDescription + }); + } + } + return patchBody; + }; + $scope.editIndicatorMetadata = function () { + var patchBody = $scope.buildPatchBody_indicators(); + // TODO verify input + // TODO Create and perform POST Request with loading screen + $scope.loadingData = true; + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/indicators/" + $scope.currentIndicatorDataset.indicatorId, + method: "PATCH", + data: patchBody + // headers: { + // 'Content-Type': undefined + // } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + $scope.successMessagePart = $scope.datasetName; + $rootScope.$broadcast("refreshIndicatorOverviewTable", "edit", $scope.currentIndicatorDataset.indicatorId); + $("#indicatorEditMetadataSuccessAlert").show(); + $scope.loadingData = false; + }, function errorCallback(error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + $("#indicatorEditMetadataErrorAlert").show(); + $scope.loadingData = false; + // setTimeout(function() { + // $("#indicatorEditMetadataSuccessAlert").hide(); + // }, 3000); + }); + }; + $scope.onImportIndicatorEditMetadata = function () { + $scope.indicatorMetadataImportError = ""; + $("#indicatorEditMetadataImportFile").files = []; + // trigger file chooser + $("#indicatorEditMetadataImportFile").click(); + }; + $(document).on("change", "#indicatorEditMetadataImportFile", function () { + console.log("Importing Indicator metadata for Edit Indicator Form"); + // get the file + var file = document.getElementById('indicatorEditMetadataImportFile').files[0]; + $scope.parseMetadataFromFile(file); + }); + $scope.parseMetadataFromFile = function (file) { + var fileReader = new FileReader(); + fileReader.onload = function (event) { + try { + $scope.parseFromMetadataFile(event); + } + catch (error) { + console.error("Uploaded Metadata File cannot be parsed."); + $scope.indicatorMetadataImportError = "Uploaded Metadata File cannot be parsed correctly"; + document.getElementById("indicatorsEditMetadataPre").innerHTML = $scope.indicatorMetadataStructure_pretty; + $("#indicatorEditMetadataImportErrorAlert").show(); + $scope.$digest(); + } + }; + // Read in the image file as a data URL. + fileReader.readAsText(file); + }; + $scope.parseFromMetadataFile = function (event) { + // $scope.geoJsonString = event.target.result; + $scope.metadataImportSettings = JSON.parse(event.target.result); + if (!$scope.metadataImportSettings.metadata) { + console.error("uploaded Metadata File cannot be parsed - wrong structure."); + $scope.indicatorMetadataImportError = "Struktur der Datei stimmt nicht mit erwartetem Muster überein."; + document.getElementById("indicatorsAddMetadataPre").innerHTML = $scope.indicatorMetadataStructure_pretty; + $("#indicatorAddMetadataImportErrorAlert").show(); + $scope.$digest(); + } + $scope.metadata = {}; + $scope.metadata.note = $scope.metadataImportSettings.metadata.note; + $scope.metadata.literature = $scope.metadataImportSettings.metadata.literature; + kommonitorDataExchangeService.updateIntervalOptions.forEach(function (option) { + if (option.apiName === $scope.metadataImportSettings.metadata.updateInterval) { + $scope.metadata.updateInterval = option; + } + }); + $scope.metadata.sridEPSG = $scope.metadataImportSettings.metadata.sridEPSG; + $scope.metadata.datasource = $scope.metadataImportSettings.metadata.datasource; + $scope.metadata.contact = $scope.metadataImportSettings.metadata.contact; + $scope.metadata.lastUpdate = $scope.metadataImportSettings.metadata.lastUpdate; + // initialize date + $('#indicatorAddLastUpdateDatepicker').datepicker('setDate', $scope.metadata.lastUpdate); + $scope.metadata.description = $scope.metadataImportSettings.metadata.description; + $scope.metadata.databasis = $scope.metadataImportSettings.metadata.databasis; + $scope.datasetName = $scope.metadataImportSettings.datasetName; + $scope.indicatorReferenceDateNote = $scope.metadataImportSettings.referenceDateNote; + $scope.displayOrder = $scope.metadataImportSettings.displayOrder; + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, $scope.metadataImportSettings.allowedRoles); + // indicator specific properties + $scope.indicatorAbbreviation = $scope.metadataImportSettings.abbreviation; + for (const indicatorTypeOption of kommonitorDataExchangeService.indicatorTypeOptions) { + if (indicatorTypeOption.apiName === $scope.metadataImportSettings.indicatorType) { + $scope.indicatorType = indicatorTypeOption; + break; + } + } + for (const indicatorCreationTypeOption of kommonitorDataExchangeService.indicatorCreationTypeOptions) { + if (indicatorCreationTypeOption.apiName === $scope.metadataImportSettings.creationType) { + $scope.indicatorCreationType = indicatorCreationTypeOption; + if (indicatorCreationTypeOption.apiName === "COMPUTATION") { + $scope.enableLowestSpatialUnitSelect = true; + } + else { + $scope.enableLowestSpatialUnitSelect = false; + } + break; + } + } + $scope.indicatorCharacteristicValue = $scope.metadataImportSettings.characteristicValue; + $scope.isHeadlineIndicator = $scope.metadataImportSettings.isHeadlineIndicator; + $scope.indicatorUnit = $scope.metadataImportSettings.unit; + if (kommonitorDataExchangeService.indicatorUnitOptions.includes($scope.metadataImportSettings.unit)) { + $scope.enableFreeTextUnit = false; + } + else { + $scope.enableFreeTextUnit = true; + } + $scope.indicatorProcessDescription = $scope.metadataImportSettings.processDescription; + $scope.indicatorTagsString_withCommas = undefined; + if ($scope.metadataImportSettings.tags && $scope.metadataImportSettings.tags.length > 0) { + $scope.indicatorTagsString_withCommas = ""; + for (let index = 0; index < $scope.metadataImportSettings.tags.length; index++) { + $scope.indicatorTagsString_withCommas += $scope.metadataImportSettings.tags[index]; + if (index < $scope.metadataImportSettings.tags.length - 1) { + $scope.indicatorTagsString_withCommas += ","; + } + } + } + $scope.indicatorInterpretation = $scope.metadataImportSettings.interpretation; + $scope.indicatorLowestSpatialUnitMetadataObjectForComputation = undefined; + for (let i = 0; i < kommonitorDataExchangeService.availableSpatialUnits.length; i++) { + const spatialUnitMetadata = kommonitorDataExchangeService.availableSpatialUnits[i]; + if (spatialUnitMetadata.spatialUnitLevel === $scope.metadataImportSettings.lowestSpatialUnitForComputation) { + $scope.indicatorLowestSpatialUnitMetadataObjectForComputation = spatialUnitMetadata; + break; + } + } + var topicHierarchy = kommonitorDataExchangeService.getTopicHierarchyForTopicId($scope.metadataImportSettings.topicReference); + if (topicHierarchy && topicHierarchy[0]) { + $scope.indicatorTopic_mainTopic = topicHierarchy[0]; + } + if (topicHierarchy && topicHierarchy[1]) { + $scope.indicatorTopic_subTopic = topicHierarchy[1]; + } + if (topicHierarchy && topicHierarchy[2]) { + $scope.indicatorTopic_subsubTopic = topicHierarchy[2]; + } + if (topicHierarchy && topicHierarchy[3]) { + $scope.indicatorTopic_subsubsubTopic = topicHierarchy[3]; + } + $scope.indicatorNameFilter = undefined; + $scope.tmpIndicatorReference_selectedIndicatorMetadata = undefined; + $scope.tmpIndicatorReference_referenceDescription = undefined; + // tmp array to display indicatorReferences + $scope.indicatorReferences_adminView = []; + // array for API request (has less information per item) + $scope.indicatorReferences_apiRequest = []; + if ($scope.metadataImportSettings.refrencesToOtherIndicators && $scope.metadataImportSettings.refrencesToOtherIndicators.length > 0) { + for (const indicatorReference of $scope.metadataImportSettings.refrencesToOtherIndicators) { + var indicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(indicatorReference.indicatorId); + var referenceEntry = { + "referencedIndicatorName": indicatorMetadata.indicatorName, + "referencedIndicatorId": indicatorMetadata.indicatorId, + "referencedIndicatorAbbreviation": indicatorMetadata.abbreviation, + "referencedIndicatorDescription": indicatorReference.referenceDescription + }; + $scope.indicatorReferences_adminView.push(referenceEntry); + } + } + $scope.georesourceNameFilter = undefined; + $scope.tmpGeoresourceReference_selectedGeoresourceMetadata = undefined; + $scope.tmpGeoresourceReference_referenceDescription = undefined; + // tmp array to display georesourceReferences + $scope.georesourceReferences_adminView = []; + // array for API request (has less information per item) + $scope.georesourceReferences_apiRequest = []; + if ($scope.metadataImportSettings.refrencesToGeoresources && $scope.metadataImportSettings.refrencesToGeoresources.length > 0) { + for (const georesourceReference of $scope.metadataImportSettings.refrencesToGeoresources) { + var georesourceMetadata = kommonitorDataExchangeService.getGeoresourceMetadataById(georesourceReference.georesourceId); + var geo_referenceEntry = { + "referencedGeoresourceName": georesourceMetadata.datasetName, + "referencedGeoresourceId": georesourceMetadata.georesourceId, + "referencedGeoresourceDescription": georesourceReference.referenceDescription + }; + $scope.georesourceReferences_adminView.push(geo_referenceEntry); + } + } + $scope.numClassesArray = [3, 4, 5, 6, 7, 8]; + $scope.numClasses = $scope.numClassesArray[2]; + $scope.selectedColorBrewerPaletteEntry = undefined; + for (const colorbrewerPalette of $scope.colorbrewerPalettes) { + if (colorbrewerPalette.paletteName === $scope.metadataImportSettings.defaultClassificationMapping.colorBrewerSchemeName) { + $scope.selectedColorBrewerPaletteEntry = colorbrewerPalette; + break; + } + } + $scope.spatialUnitRefKeyProperty = undefined; + $scope.targetSpatialUnitMetadata = undefined; + $scope.$digest(); + }; + $scope.onExportIndicatorEditMetadataTemplate = function () { + var metadataJSON = JSON.stringify($scope.indicatorMetadataStructure); + var fileName = "Indikator_Metadaten_Vorlage_Export.json"; + var blob = new Blob([metadataJSON], { type: "application/json" }); + var data = URL.createObjectURL(blob); + var a = document.createElement('a'); + a.download = fileName; + a.href = data; + a.textContent = "JSON"; + a.target = "_blank"; + a.rel = "noopener noreferrer"; + a.click(); + a.remove(); + }; + $scope.onExportIndicatorEditMetadata = function () { + var metadataExport = $scope.indicatorMetadataStructure; + metadataExport.metadata.note = $scope.metadata.note || ""; + metadataExport.metadata.literature = $scope.metadata.literature || ""; + metadataExport.metadata.sridEPSG = $scope.metadata.sridEPSG || ""; + metadataExport.metadata.datasource = $scope.metadata.datasource || ""; + metadataExport.metadata.contact = $scope.metadata.contact || ""; + metadataExport.metadata.lastUpdate = $scope.metadata.lastUpdate || ""; + metadataExport.metadata.description = $scope.metadata.description || ""; + metadataExport.metadata.databasis = $scope.metadata.databasis || ""; + metadataExport.datasetName = $scope.datasetName || ""; + metadataExport.referenceDateNote = $scope.indicatorReferenceDateNote; + metadataExport.displayOrder = $scope.displayOrder; + metadataExport.allowedRoles = []; + let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); + for (const roleId of roleIds) { + metadataExport.allowedRoles.push(roleId); + } + if ($scope.metadata.updateInterval) { + metadataExport.metadata.updateInterval = $scope.metadata.updateInterval.apiName; + } + var name = $scope.datasetName; + // indicator specific properties + metadataExport.abbreviation = $scope.indicatorAbbreviation || ""; + metadataExport.indicatorType = $scope.indicatorType ? $scope.indicatorType.apiName : ""; + metadataExport.creationType = $scope.indicatorCreationType ? $scope.indicatorCreationType.apiName : ""; + metadataExport.characteristicValue = $scope.indicatorCharacteristicValue || ""; + metadataExport.isHeadlineIndicator = $scope.isHeadlineIndicator || false; + metadataExport.unit = $scope.indicatorUnit || ""; + metadataExport.processDescription = $scope.indicatorProcessDescription || ""; + metadataExport.tags = []; + if ($scope.indicatorTagsString_withCommas) { + var tags_splitted = $scope.indicatorTagsString_withCommas.split(","); + for (const tagString of tags_splitted) { + metadataExport.tags.push(tagString.trim()); + } + } + metadataExport.interpretation = $scope.indicatorInterpretation || ""; + metadataExport.lowestSpatialUnitForComputation = $scope.indicatorLowestSpatialUnitMetadataObjectForComputation ? $scope.indicatorLowestSpatialUnitMetadataObjectForComputation.spatialUnitLevel : ""; + if ($scope.indicatorTopic_subsubsubTopic) { + metadataExport.topicReference = $scope.indicatorTopic_subsubsubTopic.topicId; + } + else if ($scope.indicatorTopic_subsubTopic) { + metadataExport.topicReference = $scope.indicatorTopic_subsubTopic.topicId; + } + else if ($scope.indicatorTopic_subTopic) { + metadataExport.topicReference = $scope.indicatorTopic_subTopic.topicId; + } + else if ($scope.indicatorTopic_mainTopic) { + metadataExport.topicReference = $scope.indicatorTopic_mainTopic.topicId; + } + else { + metadataExport.topicReference = ""; + } + metadataExport.refrencesToOtherIndicators = []; + if ($scope.indicatorReferences_adminView && $scope.indicatorReferences_adminView.length > 0) { + metadataExport.refrencesToOtherIndicators = []; + for (const indicRef of $scope.indicatorReferences_adminView) { + metadataExport.refrencesToOtherIndicators.push({ + "indicatorId": indicRef.referencedIndicatorId, + "referenceDescription": indicRef.referencedIndicatorDescription + }); + } + } + metadataExport.refrencesToGeoresources = []; + if ($scope.georesourceReferences_adminView && $scope.georesourceReferences_adminView.length > 0) { + metadataExport.refrencesToGeoresources = []; + for (const geoRef of $scope.georesourceReferences_adminView) { + metadataExport.refrencesToGeoresources.push({ + "georesourceId": geoRef.referencedGeoresourceId, + "referenceDescription": geoRef.referencedGeoresourceDescription + }); + } + } + var defaultClassificationMapping = { + "colorBrewerSchemeName": $scope.selectedColorBrewerPaletteEntry ? $scope.selectedColorBrewerPaletteEntry.paletteName : "Blues", + "items": [ + { + "defaultColorAsHex": "#edf8e9", + "defaultCustomRating": "sehr niedrig" + }, + { + "defaultColorAsHex": "#bae4b3", + "defaultCustomRating": "niedrig" + }, + { + "defaultColorAsHex": "#74c476", + "defaultCustomRating": "mittel" + }, + { + "defaultColorAsHex": "#31a354", + "defaultCustomRating": "hoch" + }, + { + "defaultColorAsHex": "#006d2c", + "defaultCustomRating": "sehr hoch" + } + ] + }; + metadataExport.defaultClassificationMapping = defaultClassificationMapping; + var metadataJSON = JSON.stringify(metadataExport); + var fileName = "Indikatoren_Metadaten_Export"; + if (name) { + fileName += "-" + name; + } + fileName += ".json"; + var blob = new Blob([metadataJSON], { type: "application/json" }); + var data = URL.createObjectURL(blob); + var a = document.createElement('a'); + a.download = fileName; + a.href = data; + a.textContent = "JSON"; + a.target = "_blank"; + a.rel = "noopener noreferrer"; + a.click(); + a.remove(); + }; + $scope.hideSuccessAlert = function () { + $("#indicatorEditMetadataSuccessAlert").hide(); + }; + $scope.hideErrorAlert = function () { + $("#indicatorEditMetadataErrorAlert").hide(); + }; + $scope.hideMetadataErrorAlert = function () { + $("#indicatorEditMetadataImportErrorAlert").hide(); + }; + } + ] +}); +//# sourceMappingURL=indicator-edit-metadata-modal.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditMetadataModal/indicator-edit-metadata-modal.component.js.map b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditMetadataModal/indicator-edit-metadata-modal.component.js.map new file mode 100644 index 000000000..377773cad --- /dev/null +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditMetadataModal/indicator-edit-metadata-modal.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"indicator-edit-metadata-modal.component.js","sourceRoot":"","sources":["indicator-edit-metadata-modal.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,4BAA4B,CAAC,CAAC,SAAS,CAAC,4BAA4B,EAAE;IACpF,WAAW,EAAG,6HAA6H;IAC3I,UAAU,EAAG,CAAC,+BAA+B,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,sCAAsC;QAC1I,iCAAiC;QACjC,SAAS,oCAAoC,CAAC,6BAA6B,EAAE,M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,CAAC,CAAC;gBAElD,IAAI,QAAQ,GAAG,8BAA8B,CAAC;gBAE9C,IAAI,IAAI,EAAC;oBACR,QAAQ,IAAI,GAAG,GAAG,IAAI,CAAC;iBACvB;gBAED,QAAQ,IAAI,OAAO,CAAC;gBAEpB,IAAI,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,YAAY,CAAC,EAAE,EAAC,IAAI,EAAE,kBAAkB,EAAC,CAAC,CAAC;gBAChE,IAAI,IAAI,GAAI,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;gBAEtC,IAAI,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;gBACpC,CAAC,CAAC,QAAQ,GAAM,QAAQ,CAAC;gBACzB,CAAC,CAAC,IAAI,GAAU,IAAI,CAAC;gBACrB,CAAC,CAAC,WAAW,GAAG,MAAM,CAAC;gBACvB,CAAC,CAAC,MAAM,GAAG,QAAQ,CAAC;gBACpB,CAAC,CAAC,GAAG,GAAG,qBAAqB,CAAC;gBAC9B,CAAC,CAAC,KAAK,EAAE,CAAC;gBAEV,CAAC,CAAC,MAAM,EAAE,CAAC;YACZ,CAAC,CAAC;YAED,MAAM,CAAC,gBAAgB,GAAG;gBACzB,CAAC,CAAC,oCAAoC,CAAC,CAAC,IAAI,EAAE,CAAC;YAChD,CAAC,CAAC;YAEF,MAAM,CAAC,cAAc,GAAG;gBACvB,CAAC,CAAC,kCAAkC,CAAC,CAAC,IAAI,EAAE,CAAC;YAC9C,CAAC,CAAC;YAEF,MAAM,CAAC,sBAAsB,GAAG;gBAC/B,CAAC,CAAC,wCAAwC,CAAC,CAAC,IAAI,EAAE,CAAC;YACpD,CAAC,CAAC;QAEJ,CAAC;KACD;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditMetadataModal/indicator-edit-metadata-modal.component.ts b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditMetadataModal/indicator-edit-metadata-modal.component.ts new file mode 100644 index 000000000..3ee53c046 --- /dev/null +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditMetadataModal/indicator-edit-metadata-modal.component.ts @@ -0,0 +1,1133 @@ +angular.module('indicatorEditMetadataModal').component('indicatorEditMetadataModal', { + templateUrl : "components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditMetadataModal/indicator-edit-metadata-modal.template.html", + controller : ['kommonitorDataExchangeService', '$scope', '$rootScope', '$http', '__env', '$timeout', 'kommonitorMultiStepFormHelperService', + 'kommonitorDataGridHelperService', + function IndicatorEditMetadataModalController(kommonitorDataExchangeService, $scope, $rootScope, $http, __env, $timeout, + kommonitorMultiStepFormHelperService, kommonitorDataGridHelperService) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + + $scope.currentIndicatorDataset; + + /* POST BODY + { + + "refrencesToOtherIndicators": [ + { + "referenceDescription": "referenceDescription", + "indicatorId": "indicatorId" + }, + { + "referenceDescription": "referenceDescription", + "indicatorId": "indicatorId" + } + ], + "metadata": { + "note": "note", + "literature": "literature", + "updateInterval": "ARBITRARY", + "sridEPSG": 0.8008281904610115, + "datasource": "datasource", + "contact": "contact", + "lastUpdate": "2000-01-23", + "description": "description", + "databasis": "databasis" + }, + "allowedRoles": [ + "allowedRoles", + "allowedRoles" + ], + "datasetName": "datasetName", + "applicableSpatialUnit": "applicableSpatialUnit", + "abbreviation": "abbreviation", + "characteristicValue": "characteristicValue", + "tags": [ + "tags", + "tags" + ], + "creationType": "INSERTION", + "unit": "unit", + "topicReference": "topicReference", + "referenceDateNote": "optional note for indicator reference date", + "displayOrder": 0, + "refrencesToGeoresources": [ + { + "referenceDescription": "referenceDescription", + "georesourceId": "georesourceId" + }, + { + "referenceDescription": "referenceDescription", + "georesourceId": "georesourceId" + } + ], + "indicatorType": "STATUS_ABSOLUTE", + "interpretation": "interpretation", + "isHeadlineIndicator": false, + "processDescription": "processDescription", + "lowestSpatialUnitForComputation": "lowestSpatialUnitForComputation", + "defaultClassificationMapping": { + "colorBrewerSchemeName": "colorBrewerSchemeName", + "items": [ + { + "defaultCustomRating": "defaultCustomRating", + "defaultColorAsHex": "defaultColorAsHex" + }, + { + "defaultCustomRating": "defaultCustomRating", + "defaultColorAsHex": "defaultColorAsHex" + } + ] + } + } + */ + + //Date picker + $('#indicatorEditLastUpdateDatepicker').datepicker(kommonitorDataExchangeService.datePickerOptions); + + $scope.indicatorMetadataStructure = { + "metadata": { + "note": "an optional note", + "literature": "optional text about literature", + "updateInterval": "YEARLY|HALF_YEARLY|QUARTERLY|MONTHLY|ARBITRARY", + "sridEPSG": 4326, + "datasource": "text about data source", + "contact": "text about contact details", + "lastUpdate": "YYYY-MM-DD", + "description": "description about spatial unit dataset", + "databasis": "text about data basis", + }, + "allowedRoles": ['roleId'], + "refrencesToOtherIndicators": [ + { + "referenceDescription": "description about the reference", + "indicatorId": "ID of referenced indicator dataset" + } + ], + "refrencesToGeoresources": [ + { + "referenceDescription": "description about the reference", + "georesourceId": "ID of referenced georesource dataset" + } + ], + "datasetName": "Name of indicator dataset", + "abbreviation": "optional abbreviation of the indicator dataset", + "characteristicValue": "if the same datasetName is used for different indicators, the optional characteristicValue parameter may serve to distinguish between them (i.e. Habitants - male, Habitants - female, Habitants - diverse)", + "tags": [ + "optinal list of tags; each tag is a free text tag" + ], + "creationType": "INSERTION|COMPUTATION <-- enum parameter controls whether each timestamp must be updated manually (INSERTION) or if KomMonitor shall compute the indicator values for respective timestamps based on script file (COMPUTATION)", + "unit": "unit of the indicator", + "topicReference": "ID of the respective main/sub topic instance", + "indicatorType": "STATUS_ABSOLUTE|STATUS_RELATIVE|DYNAMIC_ABSOLUTE|DYNAMIC_RELATIVE|STATUS_STANDARDIZED|DYNAMIC_STANDARDIZED", + "interpretation": "interpretation hints for the user to better understand the indicator values", + "isHeadlineIndicator": "boolean parameter to indicate if indicator is a headline indicator", + "processDescription": "detailed description about the computation/creation of the indicator", + "lowestSpatialUnitForComputation": "the name of the lowest possible spatial unit for which an indicator of creationType=COMPUTATION may be computed. All other superior spatial units will be aggregated automatically", + "referenceDateNote": "optional note for indicator reference date", + "displayOrder": 0, + "defaultClassificationMapping": { + "colorBrewerSchemeName": "schema name of colorBrewer colorPalette to use for classification", + "items": [ + { + "defaultCustomRating": "a string to rate indicator values of this class", + "defaultColorAsHex": "color as hexadecimal value" + } + ] + } + }; + + $scope.indicatorMetadataStructure_pretty = kommonitorDataExchangeService.syntaxHighlightJSON($scope.indicatorMetadataStructure); + + $scope.metadataImportSettings; + $scope.indicatorMetadataImportError; + $scope.indicatorAddMetadataImportErrorAlert; + + $scope.datasetName = undefined; + $scope.datasetNameInvalid = false; + + $scope.metadata = {}; + $scope.metadata.note = undefined; + $scope.metadata.literature = undefined; + $scope.metadata.updateInterval = undefined; + $scope.metadata.sridEPSG = undefined; + $scope.metadata.datasource = undefined; + $scope.metadata.databasis = undefined; + $scope.metadata.contact = undefined; + $scope.metadata.lastUpdate = undefined; + $scope.metadata.description = undefined; + + $scope.roleManagementTableOptions = undefined; + + + $scope.datasetName = undefined; + $scope.indicatorAbbreviation = undefined; + $scope.indicatorType = undefined; + $scope.indicatorCharacteristicValue = undefined; + $scope.isHeadlineIndicator = false; + $scope.indicatorUnit = undefined; + $scope.enableFreeTextUnit = false; + $scope.indicatorProcessDescription = undefined; + $scope.indicatorTagsString_withCommas = undefined; + $scope.indicatorInterpretation = undefined; + $scope.indicatorCreationType = undefined; + $scope.indicatorLowestSpatialUnitMetadataObjectForComputation = undefined; + $scope.enableLowestSpatialUnitSelect = false; + + $scope.indicatorReferenceDateNote = undefined; + $scope.displayOrder = 0; + + $scope.indicatorTopic_mainTopic = undefined; + $scope.indicatorTopic_subTopic = undefined; + $scope.indicatorTopic_subsubTopic = undefined; + $scope.indicatorTopic_subsubsubTopic = undefined; + + $scope.indicatorNameFilter = undefined; + $scope.tmpIndicatorReference_selectedIndicatorMetadata = undefined; + $scope.tmpIndicatorReference_referenceDescription = undefined; + // tmp array to display indicatorReferences + $scope.indicatorReferences_adminView = []; + // array for API request (has less information per item) + $scope.indicatorReferences_apiRequest = []; + + $scope.georesourceNameFilter = undefined; + $scope.tmpGeoresourceReference_selectedGeoresourceMetadata = undefined; + $scope.tmpGeoresourceReference_referenceDescription = undefined; + // tmp array to display georesourceReferences + $scope.georesourceReferences_adminView = []; + // array for API request (has less information per item) + $scope.georesourceReferences_apiRequest = []; + + $scope.numClassesArray = [3,4,5,6,7,8]; + $scope.numClasses = $scope.numClassesArray[2]; + $scope.selectedColorBrewerPaletteEntry = undefined; + + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + + $scope.colorbrewerSchemes = colorbrewer; + $scope.colorbreweSchemeName_dynamicIncrease = __env.defaultColorBrewerPaletteForBalanceIncreasingValues; + $scope.colorbreweSchemeName_dynamicDecrease = __env.defaultColorBrewerPaletteForBalanceDecreasingValues; + $scope.colorbrewerPalettes = []; + + + $scope.instantiateColorBrewerPalettes = function(){ + for (const key in colorbrewer) { + if (colorbrewer.hasOwnProperty(key)) { + const colorPalettes = colorbrewer[key]; + + var paletteEntry = { + "paletteName": key, + "paletteArrayObject": colorPalettes + }; + + $scope.colorbrewerPalettes.push(paletteEntry); + } + } + + // instantiate with palette 'Blues' + $scope.selectedColorBrewerPaletteEntry = $scope.colorbrewerPalettes[13]; + + }; + + $scope.instantiateColorBrewerPalettes(); + + $scope.$on("onEditIndicatorMetadata", function (event, indicatorDataset) { + + $scope.currentIndicatorDataset = indicatorDataset; + + $scope.resetIndicatorEditMetadataForm(); + kommonitorMultiStepFormHelperService.registerClickHandler(); + + }); + + $scope.$on("availableRolesUpdate", function (event) { + let allowedRoles = $scope.currentIndicatorDataset ? $scope.currentIndicatorDataset.allowedRoles : []; + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, allowedRoles); + }); + + $scope.resetIndicatorEditMetadataForm = function(){ + + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + + $scope.datasetName = $scope.currentIndicatorDataset.indicatorName; + $scope.datasetNameInvalid = false; + + $scope.indicatorReferenceDateNote = $scope.currentIndicatorDataset.referenceDateNote; + $scope.displayOrder = $scope.currentIndicatorDataset.displayOrder; + + $scope.metadata = {}; + $scope.metadata.note = $scope.currentIndicatorDataset.metadata.note; + $scope.metadata.literature = $scope.currentIndicatorDataset.metadata.literature; + $scope.metadata.sridEPSG = 4326; + $scope.metadata.datasource = $scope.currentIndicatorDataset.metadata.datasource; + $scope.metadata.databasis = $scope.currentIndicatorDataset.metadata.databasis; + $scope.metadata.contact = $scope.currentIndicatorDataset.metadata.contact; + $scope.metadata.description = $scope.currentIndicatorDataset.metadata.description; + + $scope.metadata.lastUpdate = $scope.currentIndicatorDataset.metadata.lastUpdate; + // $('#indicatorEditLastUpdateDatepicker').data({date: $scope.currentIndicatorDataset.metadata.lastUpdate}); + $('#indicatorEditLastUpdateDatepicker').datepicker('setDate', $scope.currentIndicatorDataset.metadata.lastUpdate); + + kommonitorDataExchangeService.updateIntervalOptions.forEach(function(option){ + if(option.apiName === $scope.currentIndicatorDataset.metadata.updateInterval){ + $scope.metadata.updateInterval = option; + } + }); + + let allowedRoles = $scope.currentIndicatorDataset ? $scope.currentIndicatorDataset.allowedRoles : []; + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, allowedRoles); + + $scope.indicatorAbbreviation = $scope.currentIndicatorDataset.abbreviation; + + kommonitorDataExchangeService.indicatorTypeOptions.forEach(function(option){ + if(option.apiName === $scope.currentIndicatorDataset.indicatorType){ + $scope.indicatorType = option; + } + }); + + $scope.indicatorCharacteristicValue = $scope.currentIndicatorDataset.characteristicValue; + $scope.isHeadlineIndicator = $scope.currentIndicatorDataset.isHeadlineIndicator; + $scope.indicatorUnit = $scope.currentIndicatorDataset.unit; + + $scope.enableFreeTextUnit = true; + kommonitorDataExchangeService.indicatorUnitOptions.forEach(function(option){ + if(option === $scope.currentIndicatorDataset.unit){ + // if the unit is in list of known units then disable freeText + $scope.enableFreeTextUnit = false; + } + }); + + $scope.indicatorProcessDescription = $scope.currentIndicatorDataset.processDescription; + $scope.indicatorTagsString_withCommas = ""; + + for (let index = 0; index < $scope.currentIndicatorDataset.tags.length; index++) { + $scope.indicatorTagsString_withCommas += $scope.currentIndicatorDataset.tags[index]; + + if(index < $scope.currentIndicatorDataset.tags.length - 1){ + $scope.indicatorTagsString_withCommas += ","; + } + } + + if (! $scope.currentIndicatorDataset.tags || $scope.currentIndicatorDataset.tags.length === 0){ + $scope.indicatorTagsString_withCommas = undefined; + } + + $scope.indicatorInterpretation = $scope.currentIndicatorDataset.interpretation; + + kommonitorDataExchangeService.indicatorCreationTypeOptions.forEach(function(option){ + if(option.apiName === $scope.currentIndicatorDataset.creationType){ + $scope.indicatorCreationType = option; + } + }); + + $scope.indicatorLowestSpatialUnitMetadataObjectForComputation = undefined; + + for (let i = 0; i < kommonitorDataExchangeService.availableSpatialUnits.length; i++) { + const spatialUnitMetadata = kommonitorDataExchangeService.availableSpatialUnits[i]; + + if(spatialUnitMetadata.spatialUnitLevel === $scope.currentIndicatorDataset.lowestSpatialUnitForComputation){ + $scope.indicatorLowestSpatialUnitMetadataObjectForComputation = spatialUnitMetadata; + break; + } + } + + if($scope.indicatorCreationType.apiName === "COMPUTATION"){ + $scope.enableLowestSpatialUnitSelect = true; + } + else{ + $scope.enableLowestSpatialUnitSelect = false; + } + + var topicHierarchy = kommonitorDataExchangeService.getTopicHierarchyForTopicId($scope.currentIndicatorDataset.topicReference); + + if(topicHierarchy && topicHierarchy[0]){ + $scope.indicatorTopic_mainTopic = topicHierarchy[0]; + } + if(topicHierarchy && topicHierarchy[1]){ + $scope.indicatorTopic_subTopic = topicHierarchy[1]; + } + if(topicHierarchy && topicHierarchy[2]){ + $scope.indicatorTopic_subsubTopic = topicHierarchy[2]; + } + if(topicHierarchy && topicHierarchy[3]){ + $scope.indicatorTopic_subsubsubTopic = topicHierarchy[3]; + } + + $scope.indicatorNameFilter = undefined; + $scope.tmpIndicatorReference_selectedIndicatorMetadata = undefined; + $scope.tmpIndicatorReference_referenceDescription = undefined; + + // tmp array to display indicatorReferences + $scope.indicatorReferences_adminView = []; + // array for API request (has less information per item) + $scope.indicatorReferences_apiRequest = []; + if($scope.currentIndicatorDataset.referencedIndicators && $scope.currentIndicatorDataset.referencedIndicators.length > 0){ + for (const indicatorReference of $scope.currentIndicatorDataset.referencedIndicators) { + var indicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(indicatorReference.referencedIndicatorId); + var referenceEntry = { + "referencedIndicatorName": indicatorMetadata.indicatorName, + "referencedIndicatorId": indicatorMetadata.indicatorId, + "referencedIndicatorAbbreviation": indicatorMetadata.abbreviation, + "referencedIndicatorDescription": indicatorReference.referencedIndicatorDescription + }; + $scope.indicatorReferences_adminView.push(referenceEntry); + } + + } + + $scope.georesourceNameFilter = undefined; + $scope.tmpGeoresourceReference_selectedGeoresourceMetadata = undefined; + $scope.tmpGeoresourceReference_referenceDescription = undefined; + // tmp array to display georesourceReferences + $scope.georesourceReferences_adminView = []; + // array for API request (has less information per item) + $scope.georesourceReferences_apiRequest = []; + + if($scope.currentIndicatorDataset.referencedGeoresources && $scope.currentIndicatorDataset.referencedGeoresources.length > 0){ + for (const georesourceReference of $scope.currentIndicatorDataset.referencedGeoresources) { + var georesourceMetadata = kommonitorDataExchangeService.getGeoresourceMetadataById(georesourceReference.referencedGeoresourceId); + var geo_referenceEntry = { + "referencedGeoresourceName": georesourceMetadata.datasetName, + "referencedGeoresourceId": georesourceMetadata.georesourceId, + "referencedGeoresourceDescription": georesourceReference.referencedGeoresourceDescription + }; + $scope.georesourceReferences_adminView.push(geo_referenceEntry); + } + + } + + $scope.numClassesArray = [3,4,5,6,7,8]; + $scope.numClasses = $scope.numClassesArray[2]; + + // instantiate with palette 'Blues' + $scope.selectedColorBrewerPaletteEntry = $scope.colorbrewerPalettes[13]; + + for (const colorbrewerPalette of $scope.colorbrewerPalettes) { + if (colorbrewerPalette.paletteName === $scope.currentIndicatorDataset.defaultClassificationMapping.colorBrewerSchemeName){ + $scope.selectedColorBrewerPaletteEntry = colorbrewerPalette; + break; + } + } + + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + $("#indicatorEditMetadataSuccessAlert").hide(); + $("#indicatorEditMetadataErrorAlert").hide(); + + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + + $scope.onClickColorBrewerEntry = function(colorPaletteEntry){ + $scope.selectedColorBrewerPaletteEntry = colorPaletteEntry; + + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + + $scope.onAddOrUpdateIndicatorReference = function(){ + var tmpIndicatorReference_adminView = { + "referencedIndicatorName": $scope.tmpIndicatorReference_selectedIndicatorMetadata.indicatorName, + "referencedIndicatorId": $scope.tmpIndicatorReference_selectedIndicatorMetadata.indicatorId, + "referencedIndicatorAbbreviation": $scope.tmpIndicatorReference_selectedIndicatorMetadata.abbreviation, + "referencedIndicatorDescription": $scope.tmpIndicatorReference_referenceDescription + }; + + var processed = false; + + for (let index = 0; index < $scope.indicatorReferences_adminView.length; index++) { + var indicatorReference_adminView = $scope.indicatorReferences_adminView[index]; + + if (indicatorReference_adminView.referencedIndicatorId === tmpIndicatorReference_adminView.referencedIndicatorId){ + // replace object + $scope.indicatorReferences_adminView[index] = tmpIndicatorReference_adminView; + processed = true; + break; + } + } + + if(! processed){ + // new entry + $scope.indicatorReferences_adminView.push(tmpIndicatorReference_adminView); + } + + $scope.tmpIndicatorReference_selectedIndicatorMetadata = undefined; + $scope.tmpIndicatorReference_referenceDescription = undefined; + + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + + $scope.onClickEditIndicatorReference = function(indicatorReference_adminView){ + + $scope.tmpIndicatorReference_selectedIndicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(indicatorReference_adminView.referencedIndicatorId); + $scope.tmpIndicatorReference_referenceDescription = indicatorReference_adminView.referencedIndicatorDescription; + + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + + $scope.onClickDeleteIndicatorReference = function(indicatorReference_adminView){ + + for (let index = 0; index < $scope.indicatorReferences_adminView.length; index++) { + + if ($scope.indicatorReferences_adminView[index].referencedIndicatorId === indicatorReference_adminView.referencedIndicatorId){ + // remove object + $scope.indicatorReferences_adminView.splice(index, 1); + break; + } + } + + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + + $scope.onAddOrUpdateGeoresourceReference = function(){ + var tmpGeoresourceReference_adminView = { + "referencedGeoresourceName": $scope.tmpGeoresourceReference_selectedGeoresourceMetadata.datasetName, + "referencedGeoresourceId": $scope.tmpGeoresourceReference_selectedGeoresourceMetadata.georesourceId, + "referencedGeoresourceDescription": $scope.tmpGeoresourceReference_referenceDescription + }; + + var processed = false; + + for (let index = 0; index < $scope.georesourceReferences_adminView.length; index++) { + var georesourceReference_adminView = $scope.georesourceReferences_adminView[index]; + + if (georesourceReference_adminView.referencedGeoresourceId === tmpGeoresourceReference_adminView.referencedGeoresourceId){ + // replace object + $scope.georesourceReferences_adminView[index] = tmpGeoresourceReference_adminView; + processed = true; + break; + } + } + + if(! processed){ + // new entry + $scope.georesourceReferences_adminView.push(tmpGeoresourceReference_adminView); + } + + $scope.tmpGeoresourceReference_selectedGeoresourceMetadata = undefined; + $scope.tmpGeoresourceReference_referenceDescription = undefined; + + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + + $scope.onClickEditGeoresourceReference = function(georesourceReference_adminView){ + + $scope.tmpGeoresourceReference_selectedGeoresourceMetadata = kommonitorDataExchangeService.getGeoresourceMetadataById(georesourceReference_adminView.referencedGeoresourceId); + $scope.tmpGeoresourceReference_referenceDescription = georesourceReference_adminView.referencedGeoresourceDescription; + + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + + $scope.onClickDeleteGeoresourceReference = function(georesourceReference_adminView){ + + for (let index = 0; index < $scope.georesourceReferences_adminView.length; index++) { + + if ($scope.georesourceReferences_adminView[index].referencedGeoresourceId === georesourceReference_adminView.referencedGeoresourceId){ + // remove object + $scope.georesourceReferences_adminView.splice(index, 1); + break; + } + } + + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + + $scope.onChangeCreationType = function(){ + if($scope.indicatorCreationType.apiName === "COMPUTATION"){ + $scope.enableLowestSpatialUnitSelect = true; + } + else{ + $scope.enableLowestSpatialUnitSelect = false; + } + + }; + + $scope.onChangeIndicatorUnit = function(){ + if ($scope.indicatorUnit.includes("Freitext")){ + $scope.enableFreeTextUnit = true; + } + else{ + $scope.enableFreeTextUnit = false; + } + }; + + $scope.checkDatasetName = function(){ + $scope.datasetNameInvalid = false; + kommonitorDataExchangeService.availableIndicators.forEach(function(indicator){ + if (indicator.indicatorName === $scope.datasetName){ + $scope.datasetNameInvalid = true; + return; + } + }); + }; + + $scope.buildPatchBody_indicators = function(){ + var patchBody = + { + "metadata": { + "note": $scope.metadata.note || null, + "literature": $scope.metadata.literature || null, + "updateInterval": $scope.metadata.updateInterval.apiName, + "sridEPSG": $scope.metadata.sridEPSG || 4326, + "datasource": $scope.metadata.datasource, + "contact": $scope.metadata.contact, + "lastUpdate": $scope.metadata.lastUpdate, + "description": $scope.metadata.description || null, + "databasis": $scope.metadata.databasis || null + }, + "refrencesToOtherIndicators": [], // filled directly after + "allowedRoles": [], + "datasetName": $scope.datasetName, + "abbreviation": $scope.indicatorAbbreviation || null, + "characteristicValue": $scope.indicatorCharacteristicValue || null, + "tags": [], // filled directly after + "creationType": $scope.indicatorCreationType.apiName, + "unit": $scope.indicatorUnit, + "topicReference": "", // filled directly after + "refrencesToGeoresources": [], // filled directly after + "indicatorType": $scope.indicatorType.apiName, + "interpretation": $scope.indicatorInterpretation || "", + "isHeadlineIndicator": $scope.isHeadlineIndicator || false, + "processDescription": $scope.indicatorProcessDescription || "", + "referenceDateNote": $scope.indicatorReferenceDateNote || "", + "displayOrder": $scope.displayOrder, + "lowestSpatialUnitForComputation": $scope.indicatorLowestSpatialUnitMetadataObjectForComputation? $scope.indicatorLowestSpatialUnitMetadataObjectForComputation.spatialUnitLevel : null, + "defaultClassificationMapping": { + "colorBrewerSchemeName": $scope.selectedColorBrewerPaletteEntry.paletteName, + "items": [ + { + "defaultColorAsHex": "#edf8e9", + "defaultCustomRating": "sehr niedrig" + }, + { + "defaultColorAsHex": "#bae4b3", + "defaultCustomRating": "niedrig" + }, + { + "defaultColorAsHex": "#74c476", + "defaultCustomRating": "mittel" + }, + { + "defaultColorAsHex": "#31a354", + "defaultCustomRating": "hoch" + }, + { + "defaultColorAsHex": "#006d2c", + "defaultCustomRating": "sehr hoch" + } + ] + } + }; + + let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); + for (const roleId of roleIds) { + patchBody.allowedRoles.push(roleId); + } + + // TAGS + if($scope.indicatorTagsString_withCommas){ + var tags_splitted = $scope.indicatorTagsString_withCommas.split(","); + for (const tagString of tags_splitted) { + patchBody.tags.push(tagString.trim()); + } + } + + // TOPIC REFERENCE + if($scope.indicatorTopic_subsubsubTopic){ + patchBody.topicReference = $scope.indicatorTopic_subsubsubTopic.topicId; + } + else if($scope.indicatorTopic_subsubTopic){ + patchBody.topicReference = $scope.indicatorTopic_subsubTopic.topicId; + } + else if($scope.indicatorTopic_subTopic){ + patchBody.topicReference = $scope.indicatorTopic_subTopic.topicId; + } + else if($scope.indicatorTopic_mainTopic){ + patchBody.topicReference = $scope.indicatorTopic_mainTopic.topicId; + } + else { + patchBody.topicReference = ""; + } + + + // REFERENCES + if($scope.indicatorReferences_adminView && $scope.indicatorReferences_adminView.length > 0){ + patchBody.refrencesToOtherIndicators = []; + + for (const indicRef of $scope.indicatorReferences_adminView) { + patchBody.refrencesToOtherIndicators.push({ + "indicatorId": indicRef.referencedIndicatorId, + "referenceDescription": indicRef.referencedIndicatorDescription + }); + } + } + + if($scope.georesourceReferences_adminView && $scope.georesourceReferences_adminView.length > 0){ + patchBody.refrencesToGeoresources = []; + + for (const geoRef of $scope.georesourceReferences_adminView) { + patchBody.refrencesToGeoresources.push({ + "georesourceId": geoRef.referencedGeoresourceId, + "referenceDescription": geoRef.referencedGeoresourceDescription + }); + } + } + + + return patchBody; + }; + + $scope.editIndicatorMetadata = function(){ + + var patchBody = $scope.buildPatchBody_indicators(); + + // TODO verify input + + // TODO Create and perform POST Request with loading screen + + $scope.loadingData = true; + + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/indicators/" + $scope.currentIndicatorDataset.indicatorId, + method: "PATCH", + data: patchBody + // headers: { + // 'Content-Type': undefined + // } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + $scope.successMessagePart = $scope.datasetName; + + $rootScope.$broadcast("refreshIndicatorOverviewTable", "edit", $scope.currentIndicatorDataset.indicatorId); + $("#indicatorEditMetadataSuccessAlert").show(); + $scope.loadingData = false; + + }, function errorCallback(error) { + if(error.data){ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else{ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + + $("#indicatorEditMetadataErrorAlert").show(); + $scope.loadingData = false; + + // setTimeout(function() { + // $("#indicatorEditMetadataSuccessAlert").hide(); + // }, 3000); + }); + }; + + $scope.onImportIndicatorEditMetadata = function(){ + + $scope.indicatorMetadataImportError = ""; + + $("#indicatorEditMetadataImportFile").files = []; + + // trigger file chooser + $("#indicatorEditMetadataImportFile").click(); + + }; + + $(document).on("change", "#indicatorEditMetadataImportFile" ,function(){ + + console.log("Importing Indicator metadata for Edit Indicator Form"); + + // get the file + var file = document.getElementById('indicatorEditMetadataImportFile').files[0]; + $scope.parseMetadataFromFile(file); + }); + + $scope.parseMetadataFromFile = function(file){ + var fileReader = new FileReader(); + + fileReader.onload = function(event) { + + try{ + $scope.parseFromMetadataFile(event); + } + catch(error){ + console.error("Uploaded Metadata File cannot be parsed."); + $scope.indicatorMetadataImportError = "Uploaded Metadata File cannot be parsed correctly"; + document.getElementById("indicatorsEditMetadataPre").innerHTML = $scope.indicatorMetadataStructure_pretty; + $("#indicatorEditMetadataImportErrorAlert").show(); + + $scope.$digest(); + } + + }; + + // Read in the image file as a data URL. + fileReader.readAsText(file); + }; + + $scope.parseFromMetadataFile = function(event){ + // $scope.geoJsonString = event.target.result; + $scope.metadataImportSettings = JSON.parse(event.target.result); + + if(! $scope.metadataImportSettings.metadata){ + console.error("uploaded Metadata File cannot be parsed - wrong structure."); + $scope.indicatorMetadataImportError = "Struktur der Datei stimmt nicht mit erwartetem Muster überein."; + document.getElementById("indicatorsAddMetadataPre").innerHTML = $scope.indicatorMetadataStructure_pretty; + $("#indicatorAddMetadataImportErrorAlert").show(); + + $scope.$digest(); + } + + $scope.metadata = {}; + $scope.metadata.note = $scope.metadataImportSettings.metadata.note; + $scope.metadata.literature = $scope.metadataImportSettings.metadata.literature; + kommonitorDataExchangeService.updateIntervalOptions.forEach(function(option){ + if(option.apiName === $scope.metadataImportSettings.metadata.updateInterval){ + $scope.metadata.updateInterval = option; + } + }); + $scope.metadata.sridEPSG = $scope.metadataImportSettings.metadata.sridEPSG; + $scope.metadata.datasource = $scope.metadataImportSettings.metadata.datasource; + $scope.metadata.contact = $scope.metadataImportSettings.metadata.contact; + $scope.metadata.lastUpdate = $scope.metadataImportSettings.metadata.lastUpdate; + // initialize date + $('#indicatorAddLastUpdateDatepicker').datepicker('setDate', $scope.metadata.lastUpdate); + + $scope.metadata.description = $scope.metadataImportSettings.metadata.description; + $scope.metadata.databasis = $scope.metadataImportSettings.metadata.databasis; + + $scope.datasetName = $scope.metadataImportSettings.datasetName; + + $scope.indicatorReferenceDateNote = $scope.metadataImportSettings.referenceDateNote; + $scope.displayOrder = $scope.metadataImportSettings.displayOrder; + + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('indicatorEditRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, $scope.metadataImportSettings.allowedRoles); + + // indicator specific properties + + $scope.indicatorAbbreviation = $scope.metadataImportSettings.abbreviation; + + for (const indicatorTypeOption of kommonitorDataExchangeService.indicatorTypeOptions) { + if(indicatorTypeOption.apiName === $scope.metadataImportSettings.indicatorType){ + $scope.indicatorType = indicatorTypeOption; + break; + } + } + + for (const indicatorCreationTypeOption of kommonitorDataExchangeService.indicatorCreationTypeOptions) { + if(indicatorCreationTypeOption.apiName === $scope.metadataImportSettings.creationType){ + $scope.indicatorCreationType = indicatorCreationTypeOption; + + if(indicatorCreationTypeOption.apiName === "COMPUTATION"){ + $scope.enableLowestSpatialUnitSelect = true; + } + else{ + $scope.enableLowestSpatialUnitSelect = false; + } + break; + } + } + + $scope.indicatorCharacteristicValue = $scope.metadataImportSettings.characteristicValue; + $scope.isHeadlineIndicator = $scope.metadataImportSettings.isHeadlineIndicator; + $scope.indicatorUnit = $scope.metadataImportSettings.unit; + if(kommonitorDataExchangeService.indicatorUnitOptions.includes($scope.metadataImportSettings.unit)){ + $scope.enableFreeTextUnit = false; + } + else{ + $scope.enableFreeTextUnit = true; + } + + $scope.indicatorProcessDescription = $scope.metadataImportSettings.processDescription; + + $scope.indicatorTagsString_withCommas = undefined; + if($scope.metadataImportSettings.tags && $scope.metadataImportSettings.tags.length > 0){ + $scope.indicatorTagsString_withCommas = ""; + for (let index = 0; index < $scope.metadataImportSettings.tags.length; index++) { + $scope.indicatorTagsString_withCommas += $scope.metadataImportSettings.tags[index]; + + if(index < $scope.metadataImportSettings.tags.length - 1){ + $scope.indicatorTagsString_withCommas += ","; + } + } + } + + $scope.indicatorInterpretation = $scope.metadataImportSettings.interpretation; + $scope.indicatorLowestSpatialUnitMetadataObjectForComputation = undefined; + + for (let i = 0; i < kommonitorDataExchangeService.availableSpatialUnits.length; i++) { + const spatialUnitMetadata = kommonitorDataExchangeService.availableSpatialUnits[i]; + + if(spatialUnitMetadata.spatialUnitLevel === $scope.metadataImportSettings.lowestSpatialUnitForComputation){ + $scope.indicatorLowestSpatialUnitMetadataObjectForComputation = spatialUnitMetadata; + break; + } + } + + var topicHierarchy = kommonitorDataExchangeService.getTopicHierarchyForTopicId($scope.metadataImportSettings.topicReference); + + if(topicHierarchy && topicHierarchy[0]){ + $scope.indicatorTopic_mainTopic = topicHierarchy[0]; + } + if(topicHierarchy && topicHierarchy[1]){ + $scope.indicatorTopic_subTopic = topicHierarchy[1]; + } + if(topicHierarchy && topicHierarchy[2]){ + $scope.indicatorTopic_subsubTopic = topicHierarchy[2]; + } + if(topicHierarchy && topicHierarchy[3]){ + $scope.indicatorTopic_subsubsubTopic = topicHierarchy[3]; + } + + $scope.indicatorNameFilter = undefined; + $scope.tmpIndicatorReference_selectedIndicatorMetadata = undefined; + $scope.tmpIndicatorReference_referenceDescription = undefined; + + // tmp array to display indicatorReferences + $scope.indicatorReferences_adminView = []; + // array for API request (has less information per item) + $scope.indicatorReferences_apiRequest = []; + if($scope.metadataImportSettings.refrencesToOtherIndicators && $scope.metadataImportSettings.refrencesToOtherIndicators.length > 0){ + for (const indicatorReference of $scope.metadataImportSettings.refrencesToOtherIndicators) { + var indicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(indicatorReference.indicatorId); + var referenceEntry = { + "referencedIndicatorName": indicatorMetadata.indicatorName, + "referencedIndicatorId": indicatorMetadata.indicatorId, + "referencedIndicatorAbbreviation": indicatorMetadata.abbreviation, + "referencedIndicatorDescription": indicatorReference.referenceDescription + }; + $scope.indicatorReferences_adminView.push(referenceEntry); + } + + } + + $scope.georesourceNameFilter = undefined; + $scope.tmpGeoresourceReference_selectedGeoresourceMetadata = undefined; + $scope.tmpGeoresourceReference_referenceDescription = undefined; + // tmp array to display georesourceReferences + $scope.georesourceReferences_adminView = []; + // array for API request (has less information per item) + $scope.georesourceReferences_apiRequest = []; + + if($scope.metadataImportSettings.refrencesToGeoresources && $scope.metadataImportSettings.refrencesToGeoresources.length > 0){ + for (const georesourceReference of $scope.metadataImportSettings.refrencesToGeoresources) { + var georesourceMetadata = kommonitorDataExchangeService.getGeoresourceMetadataById(georesourceReference.georesourceId); + var geo_referenceEntry = { + "referencedGeoresourceName": georesourceMetadata.datasetName, + "referencedGeoresourceId": georesourceMetadata.georesourceId, + "referencedGeoresourceDescription": georesourceReference.referenceDescription + }; + $scope.georesourceReferences_adminView.push(geo_referenceEntry); + } + + } + + $scope.numClassesArray = [3,4,5,6,7,8]; + $scope.numClasses = $scope.numClassesArray[2]; + $scope.selectedColorBrewerPaletteEntry = undefined; + + for (const colorbrewerPalette of $scope.colorbrewerPalettes) { + if (colorbrewerPalette.paletteName === $scope.metadataImportSettings.defaultClassificationMapping.colorBrewerSchemeName){ + $scope.selectedColorBrewerPaletteEntry = colorbrewerPalette; + break; + } + } + + $scope.spatialUnitRefKeyProperty = undefined; + $scope.targetSpatialUnitMetadata = undefined; + $scope.$digest(); + }; + + $scope.onExportIndicatorEditMetadataTemplate = function(){ + + var metadataJSON = JSON.stringify($scope.indicatorMetadataStructure); + + var fileName = "Indikator_Metadaten_Vorlage_Export.json"; + + var blob = new Blob([metadataJSON], {type: "application/json"}); + var data = URL.createObjectURL(blob); + + var a = document.createElement('a'); + a.download = fileName; + a.href = data; + a.textContent = "JSON"; + a.target = "_blank"; + a.rel = "noopener noreferrer"; + a.click(); + + a.remove(); + }; + + $scope.onExportIndicatorEditMetadata = function(){ + var metadataExport = $scope.indicatorMetadataStructure; + + metadataExport.metadata.note = $scope.metadata.note || ""; + metadataExport.metadata.literature = $scope.metadata.literature || ""; + metadataExport.metadata.sridEPSG = $scope.metadata.sridEPSG || ""; + metadataExport.metadata.datasource = $scope.metadata.datasource || ""; + metadataExport.metadata.contact = $scope.metadata.contact || ""; + metadataExport.metadata.lastUpdate = $scope.metadata.lastUpdate || ""; + metadataExport.metadata.description = $scope.metadata.description || ""; + metadataExport.metadata.databasis = $scope.metadata.databasis || ""; + metadataExport.datasetName = $scope.datasetName || ""; + + metadataExport.referenceDateNote = $scope.indicatorReferenceDateNote; + metadataExport.displayOrder = $scope.displayOrder; + + metadataExport.allowedRoles = []; + let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); + for (const roleId of roleIds) { + metadataExport.allowedRoles.push(roleId); + } + + if($scope.metadata.updateInterval){ + metadataExport.metadata.updateInterval = $scope.metadata.updateInterval.apiName; + } + + var name = $scope.datasetName; + + // indicator specific properties + + metadataExport.abbreviation = $scope.indicatorAbbreviation || ""; + metadataExport.indicatorType = $scope.indicatorType ? $scope.indicatorType.apiName : ""; + metadataExport.creationType = $scope.indicatorCreationType ? $scope.indicatorCreationType.apiName : ""; + + metadataExport.characteristicValue = $scope.indicatorCharacteristicValue || ""; + metadataExport.isHeadlineIndicator = $scope.isHeadlineIndicator || false; + metadataExport.unit = $scope.indicatorUnit || ""; + metadataExport.processDescription = $scope.indicatorProcessDescription || ""; + metadataExport.tags = []; + + if($scope.indicatorTagsString_withCommas){ + var tags_splitted = $scope.indicatorTagsString_withCommas.split(","); + for (const tagString of tags_splitted) { + metadataExport.tags.push(tagString.trim()); + } + } + + metadataExport.interpretation = $scope.indicatorInterpretation || ""; + metadataExport.lowestSpatialUnitForComputation = $scope.indicatorLowestSpatialUnitMetadataObjectForComputation? $scope.indicatorLowestSpatialUnitMetadataObjectForComputation.spatialUnitLevel : ""; + + if($scope.indicatorTopic_subsubsubTopic){ + metadataExport.topicReference = $scope.indicatorTopic_subsubsubTopic.topicId; + } + else if($scope.indicatorTopic_subsubTopic){ + metadataExport.topicReference = $scope.indicatorTopic_subsubTopic.topicId; + } + else if($scope.indicatorTopic_subTopic){ + metadataExport.topicReference = $scope.indicatorTopic_subTopic.topicId; + } + else if($scope.indicatorTopic_mainTopic){ + metadataExport.topicReference = $scope.indicatorTopic_mainTopic.topicId; + } + else { + metadataExport.topicReference = ""; + } + + metadataExport.refrencesToOtherIndicators = []; + + if($scope.indicatorReferences_adminView && $scope.indicatorReferences_adminView.length > 0){ + metadataExport.refrencesToOtherIndicators = []; + + for (const indicRef of $scope.indicatorReferences_adminView) { + metadataExport.refrencesToOtherIndicators.push({ + "indicatorId": indicRef.referencedIndicatorId, + "referenceDescription": indicRef.referencedIndicatorDescription + }); + } + } + + metadataExport.refrencesToGeoresources = []; + + if($scope.georesourceReferences_adminView && $scope.georesourceReferences_adminView.length > 0){ + metadataExport.refrencesToGeoresources = []; + + for (const geoRef of $scope.georesourceReferences_adminView) { + metadataExport.refrencesToGeoresources.push({ + "georesourceId": geoRef.referencedGeoresourceId, + "referenceDescription": geoRef.referencedGeoresourceDescription + }); + } + } + + var defaultClassificationMapping = { + "colorBrewerSchemeName" : $scope.selectedColorBrewerPaletteEntry ? $scope.selectedColorBrewerPaletteEntry.paletteName : "Blues", + "items": [ + { + "defaultColorAsHex": "#edf8e9", + "defaultCustomRating": "sehr niedrig" + }, + { + "defaultColorAsHex": "#bae4b3", + "defaultCustomRating": "niedrig" + }, + { + "defaultColorAsHex": "#74c476", + "defaultCustomRating": "mittel" + }, + { + "defaultColorAsHex": "#31a354", + "defaultCustomRating": "hoch" + }, + { + "defaultColorAsHex": "#006d2c", + "defaultCustomRating": "sehr hoch" + } + ] + }; + + metadataExport.defaultClassificationMapping = defaultClassificationMapping; + + + var metadataJSON = JSON.stringify(metadataExport); + + var fileName = "Indikatoren_Metadaten_Export"; + + if (name){ + fileName += "-" + name; + } + + fileName += ".json"; + + var blob = new Blob([metadataJSON], {type: "application/json"}); + var data = URL.createObjectURL(blob); + + var a = document.createElement('a'); + a.download = fileName; + a.href = data; + a.textContent = "JSON"; + a.target = "_blank"; + a.rel = "noopener noreferrer"; + a.click(); + + a.remove(); + }; + + $scope.hideSuccessAlert = function(){ + $("#indicatorEditMetadataSuccessAlert").hide(); + }; + + $scope.hideErrorAlert = function(){ + $("#indicatorEditMetadataErrorAlert").hide(); + }; + + $scope.hideMetadataErrorAlert = function(){ + $("#indicatorEditMetadataImportErrorAlert").hide(); + }; + + } +]}); diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditMetadataModal/indicator-edit-metadata-modal.module.js b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditMetadataModal/indicator-edit-metadata-modal.module.js index 512161bba..dd2260205 100644 --- a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditMetadataModal/indicator-edit-metadata-modal.module.js +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditMetadataModal/indicator-edit-metadata-modal.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('indicatorEditMetadataModal', ['kommonitorDataExchange', 'excaliburDualList', 'kommonitorMultiStepFormHelper', 'kommonitorDataGridHelper']); +//# sourceMappingURL=indicator-edit-metadata-modal.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditMetadataModal/indicator-edit-metadata-modal.module.js.map b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditMetadataModal/indicator-edit-metadata-modal.module.js.map new file mode 100644 index 000000000..2de7b6631 --- /dev/null +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditMetadataModal/indicator-edit-metadata-modal.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"indicator-edit-metadata-modal.module.js","sourceRoot":"","sources":["indicator-edit-metadata-modal.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,4BAA4B,EAAE,CAAC,wBAAwB,EAAE,mBAAmB,EAAE,+BAA+B,EAAE,0BAA0B,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditMetadataModal/indicator-edit-metadata-modal.module.ts b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditMetadataModal/indicator-edit-metadata-modal.module.ts new file mode 100644 index 000000000..512161bba --- /dev/null +++ b/app/components/kommonitorAdmin/adminIndicatorsManagement/indicatorEditMetadataModal/indicator-edit-metadata-modal.module.ts @@ -0,0 +1 @@ +angular.module('indicatorEditMetadataModal', ['kommonitorDataExchange', 'excaliburDualList', 'kommonitorMultiStepFormHelper', 'kommonitorDataGridHelper']); diff --git a/app/components/kommonitorAdmin/adminMultiUseComponents/batchUpdateResultModal/batch-update-result-modal.component.js b/app/components/kommonitorAdmin/adminMultiUseComponents/batchUpdateResultModal/batch-update-result-modal.component.js index 2914aa53b..6778481d1 100644 --- a/app/components/kommonitorAdmin/adminMultiUseComponents/batchUpdateResultModal/batch-update-result-modal.component.js +++ b/app/components/kommonitorAdmin/adminMultiUseComponents/batchUpdateResultModal/batch-update-result-modal.component.js @@ -1,84 +1,68 @@ +"use strict"; angular.module('batchUpdateResultModal').component('batchUpdateResultModal', { - templateUrl : "components/kommonitorAdmin/adminMultiUseComponents/batchUpdateResultModal/batch-update-result-modal.template.html", - controller : ['$scope', '$rootScope', '__env', - function BatchUpdateResultModalController($scope, $rootScope, __env) { - - $scope.$on("batchUpdateCompleted", function(event, data) { - $scope.initializeResultModal(data) - $("#modal-batch-update-result").modal("show"); - }); - - - $scope.$on("reopenBatchUpdateResultModal", function() { - $("#modal-batch-update-result").modal("show"); - }); - - $scope.initializeResultModal = function(data) { - let responses = data.value; - let resourceType = data.resourceType - - let resourceTypeTableHeading = $("#batch-update-result-table-resource-type") - if (resourceType === "georesource") - resourceTypeTableHeading.html("Georessource") - if (resourceType === "indicator") - resourceTypeTableHeading.html("Indikator") - - - // populate table - for(var i=0;i { - $scope.$digest(); - }, timeout); - } - - - + templateUrl: "components/kommonitorAdmin/adminMultiUseComponents/indicatorEditTimeseriesMapping/indicator-edit-timeseries-mapping.template.html", + controller: ['kommonitorDataExchangeService', '$scope', '$rootScope', '__env', + function IndicatorEditTimeseriesMappingController(kommonitorDataExchangeService, $scope, $rootScope, __env) { + /* + [ + { + indicatorValueProperty: "DATE_2008-01-01" + timestamp: "2021-04-01" + timestampProperty: undefined + }, + { + indicatorValueProperty: "DATE_2009-01-01" + timestamp: undefined + timestampProperty: "2009-01-01" + } + ] + */ + //$scope.timeseriesMapping = [] + $scope.useTimeseriesAsProperty = false; + $scope.userInputIndicatorValueProperty = undefined; + $scope.userInputTimestamp = undefined; + $scope.userInputTimestampProperty = undefined; + //Date picker + $('.indicatorTimeseriesMappingTimestampDatepicker').datepicker(kommonitorDataExchangeService.datePickerOptions); + $scope.onChangeUseTimeseriesAsProperty = function () { + if ($scope.useTimeseriesAsProperty) { + $scope.userInputTimestamp = undefined; + } + else { + $scope.userInputTimestampProperty = undefined; + } + }; + $scope.onClickUpdateTimeseriesMapping = function () { + var tmpIndicatorTimeseriesMapping = { + "indicatorValueProperty": $scope.userInputIndicatorValueProperty, + "timestampProperty": $scope.userInputTimestampProperty, + "timestamp": $scope.userInputTimestamp + }; + var entryExists = false; + for (let index = 0; index < $scope.timeseriesMapping.length; index++) { + var timeseriesMappingEntry = $scope.timeseriesMapping[index]; + if (timeseriesMappingEntry.indicatorValueProperty === tmpIndicatorTimeseriesMapping.indicatorValueProperty) { + // replace object + $scope.timeseriesMapping[index] = tmpIndicatorTimeseriesMapping; + entryExists = true; + break; + } + } + if (!entryExists) { + // new entry + $scope.timeseriesMapping.push(tmpIndicatorTimeseriesMapping); + } + $scope.userInputIndicatorValueProperty = undefined; + $scope.userInputTimestampProperty = undefined; + $scope.userInputTimestamp = undefined; + $scope.digestAfterTimeout(250); + $rootScope.$broadcast("timeseriesMappingChanged", { mapping: $scope.timeseriesMapping }); + }; + $scope.onClickEditTimeseriesMappingEntry = function (timeseriesMappingEntry) { + $scope.userInputIndicatorValueProperty = timeseriesMappingEntry.indicatorValueProperty; + $scope.userInputTimestampProperty = timeseriesMappingEntry.timestampProperty; + $scope.userInputTimestamp = timeseriesMappingEntry.timestamp; + if ($scope.userInputTimestamp) { + $('.indicatorTimeseriesMappingTimestampDatepicker').datepicker('setDate', $scope.userInputTimestamp); + $scope.useTimeseriesAsProperty = false; + } + else { + $scope.useTimeseriesAsProperty = true; + } + $scope.digestAfterTimeout(250); + }; + $scope.onClickDeleteTimeseriesMappingEntry = function (timeseriesMappingEntry) { + for (let index = 0; index < $scope.timeseriesMapping.length; index++) { + if ($scope.timeseriesMapping[index].indicatorValueProperty === timeseriesMappingEntry.indicatorValueProperty) { + // remove object + $scope.timeseriesMapping.splice(index, 1); + break; + } + } + $scope.digestAfterTimeout(250); + $rootScope.$broadcast("timeseriesMappingChanged", { mapping: $scope.timeseriesMapping }); + }; + $scope.$on('loadTimeseriesMapping', function (event, args) { + if (typeof args.mapping !== "undefined") { + $scope.loadTimeseriesMapping(args.mapping); + } + else { + throw "Can't load timeseries mapping because args has no property 'mapping'."; + } + }); + $scope.loadTimeseriesMapping = function (mapping) { + let isValid = true; + if (mapping) { + for (const entry of mapping) { + if (!(entry.hasOwnProperty("indicatorValueProperty") && + (entry.hasOwnProperty("timestamp") || entry.hasOwnProperty("timestampProperty")))) + isValid = false; + } + } + if (isValid) + $scope.timeseriesMapping = mapping; + else + throw "Can't load timeseries mapping because mapping has incorrect properties.\ + Expected: indicatorValueProperty and either timestamp or timestampProperty."; + $scope.digestAfterTimeout(250); + $rootScope.$broadcast("timeseriesMappingChanged", { mapping: $scope.timeseriesMapping }); + }; + $scope.$on('resetTimeseriesMapping', function () { + $scope.resetTimeseriesMapping(); + }); + $scope.resetTimeseriesMapping = function () { + $scope.timeseriesMapping = []; + $scope.useTimeseriesAsProperty = false; + $scope.userInputIndicatorValueProperty = undefined; + $scope.userInputTimestamp = undefined; + $scope.userInputTimestampProperty = undefined; + $rootScope.$broadcast("timeseriesMappingChanged", { mapping: $scope.timeseriesMapping }); + }; + $scope.digestAfterTimeout = function (timeout) { + setTimeout(() => { + $scope.$digest(); + }, timeout); + }; } ] -}); \ No newline at end of file +}); +//# sourceMappingURL=indicator-edit-timeseries-mapping.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminMultiUseComponents/indicatorEditTimeseriesMapping/indicator-edit-timeseries-mapping.component.js.map b/app/components/kommonitorAdmin/adminMultiUseComponents/indicatorEditTimeseriesMapping/indicator-edit-timeseries-mapping.component.js.map new file mode 100644 index 000000000..eb31a36c6 --- /dev/null +++ b/app/components/kommonitorAdmin/adminMultiUseComponents/indicatorEditTimeseriesMapping/indicator-edit-timeseries-mapping.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"indicator-edit-timeseries-mapping.component.js","sourceRoot":"","sources":["indicator-edit-timeseries-mapping.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,gCAAgC,CAAC,CAAC,SAAS,CAAC,gCAAgC,EAAE;IAC5F,WAAW,EAAG,mIAAmI;IACjJ,UAAU,EAAG,CAAC,+BAA+B,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO;QAC7E,SAAS,wCAAwC,CAAC,6BAA6B,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK;YAEzG;;;;;;;;;;;;;cAaE;YACF,+BAA+B;YAC/B,MAAM,CAAC,uBAAuB,GAAG,KAAK,CAAC;YAEvC,MAAM,CAAC,+BAA+B,GAAG,SAAS,CAAC;YACnD,MAAM,CAAC,kBAAkB,GAAG,SAAS,CAAC;YACtC,MAAM,CAAC,0BAA0B,GAAG,SAAS,CAAC;YAE9C,aAAa;YACb,CAAC,CAAC,gDAAgD,CAAC,CAAC,UAAU,CAAC,6BAA6B,CAAC,iBAAiB,CAAC,CAAC;YAIvG,MAAM,CAAC,+BAA+B,GAAG;gBACjD,IAAG,MAAM,CAAC,uBAAuB,EAAC;oBACjC,MAAM,CAAC,kBAAkB,GAAG,SAAS,CAAC;iBACtC;qBACG;oBACH,MAAM,CAAC,0BAA0B,GAAG,SAAS,CAAC;iBAC9C;YACF,CAAC,CAAC;YAGF,MAAM,CAAC,8BAA8B,GAAG;gBACvC,IAAI,6BAA6B,GAAG;oBACnC,wBAAwB,EAAE,MAAM,CAAC,+BAA+B;oBAChE,mBAAmB,EAAE,MAAM,CAAC,0BAA0B;oBACtD,WAAW,EAAE,MAAM,CAAC,kBAAkB;iBACtC,CAAC;gBAEF,IAAI,WAAW,GAAG,KAAK,CAAC;gBAExB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CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC,CAAC;4BACjF,OAAO,GAAG,KAAK,CAAA;qBAChB;iBACD;gBAED,IAAG,OAAO;oBACT,MAAM,CAAC,iBAAiB,GAAG,OAAO,CAAC;;oBAEnC,MAAM;kFACuE,CAAA;gBAE9E,MAAM,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;gBAC/B,UAAU,CAAC,UAAU,CAAC,0BAA0B,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,iBAAiB,EAAE,CAAE,CAAC;YAC3F,CAAC,CAAC;YAIF,MAAM,CAAC,GAAG,CAAC,wBAAwB,EAAE;gBACpC,MAAM,CAAC,sBAAsB,EAAE,CAAA;YAChC,CAAC,CAAC,CAAC;YAEH,MAAM,CAAC,sBAAsB,GAAG;gBAC/B,MAAM,CAAC,iBAAiB,GAAG,EAAE,CAAC;gBAC9B,MAAM,CAAC,uBAAuB,GAAG,KAAK,CAAC;gBACvC,MAAM,CAAC,+BAA+B,GAAG,SAAS,CAAC;gBACnD,MAAM,CAAC,kBAAkB,GAAG,SAAS,CAAC;gBACtC,MAAM,CAAC,0BAA0B,GAAG,SAAS,CAAC;gBAC9C,UAAU,CAAC,UAAU,CAAC,0BAA0B,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,iBAAiB,EAAE,CAAE,CAAC;YAC3F,CAAC,CAAC;YAGF,MAAM,CAAC,kBAAkB,GAAG,UAAS,OAAO;gBAC3C,UAAU,CAAC,GAAG,EAAE;oBACf,MAAM,CAAC,OAAO,EAAE,CAAC;gBAClB,CAAC,EAAE,OAAO,CAAC,CAAC;YACb,CAAC,CAAA;QAII,CAAC;KACJ;CACJ,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminMultiUseComponents/indicatorEditTimeseriesMapping/indicator-edit-timeseries-mapping.component.ts b/app/components/kommonitorAdmin/adminMultiUseComponents/indicatorEditTimeseriesMapping/indicator-edit-timeseries-mapping.component.ts new file mode 100644 index 000000000..227e54726 --- /dev/null +++ b/app/components/kommonitorAdmin/adminMultiUseComponents/indicatorEditTimeseriesMapping/indicator-edit-timeseries-mapping.component.ts @@ -0,0 +1,163 @@ +angular.module('indicatorEditTimeseriesMapping').component('indicatorEditTimeseriesMapping', { + templateUrl : "components/kommonitorAdmin/adminMultiUseComponents/indicatorEditTimeseriesMapping/indicator-edit-timeseries-mapping.template.html", + controller : ['kommonitorDataExchangeService', '$scope', '$rootScope', '__env', + function IndicatorEditTimeseriesMappingController(kommonitorDataExchangeService, $scope, $rootScope, __env) { + + /* + [ + { + indicatorValueProperty: "DATE_2008-01-01" + timestamp: "2021-04-01" + timestampProperty: undefined + }, + { + indicatorValueProperty: "DATE_2009-01-01" + timestamp: undefined + timestampProperty: "2009-01-01" + } + ] + */ + //$scope.timeseriesMapping = [] + $scope.useTimeseriesAsProperty = false; + + $scope.userInputIndicatorValueProperty = undefined; + $scope.userInputTimestamp = undefined; + $scope.userInputTimestampProperty = undefined; + + //Date picker + $('.indicatorTimeseriesMappingTimestampDatepicker').datepicker(kommonitorDataExchangeService.datePickerOptions); + + + + $scope.onChangeUseTimeseriesAsProperty = function(){ + if($scope.useTimeseriesAsProperty){ + $scope.userInputTimestamp = undefined; + } + else{ + $scope.userInputTimestampProperty = undefined; + } + }; + + + $scope.onClickUpdateTimeseriesMapping = function(){ + var tmpIndicatorTimeseriesMapping = { + "indicatorValueProperty": $scope.userInputIndicatorValueProperty, + "timestampProperty": $scope.userInputTimestampProperty, + "timestamp": $scope.userInputTimestamp + }; + + var entryExists = false; + + for (let index = 0; index < $scope.timeseriesMapping.length; index++) { + var timeseriesMappingEntry = $scope.timeseriesMapping[index]; + + if (timeseriesMappingEntry.indicatorValueProperty === tmpIndicatorTimeseriesMapping.indicatorValueProperty){ + // replace object + $scope.timeseriesMapping[index] = tmpIndicatorTimeseriesMapping; + entryExists = true; + break; + } + } + + if(! entryExists){ + // new entry + $scope.timeseriesMapping.push(tmpIndicatorTimeseriesMapping); + } + + $scope.userInputIndicatorValueProperty = undefined; + $scope.userInputTimestampProperty = undefined; + $scope.userInputTimestamp = undefined; + + $scope.digestAfterTimeout(250); + $rootScope.$broadcast("timeseriesMappingChanged", { mapping: $scope.timeseriesMapping } ); + }; + + + $scope.onClickEditTimeseriesMappingEntry = function(timeseriesMappingEntry){ + + $scope.userInputIndicatorValueProperty = timeseriesMappingEntry.indicatorValueProperty; + $scope.userInputTimestampProperty = timeseriesMappingEntry.timestampProperty; + $scope.userInputTimestamp = timeseriesMappingEntry.timestamp; + + if($scope.userInputTimestamp){ + $('.indicatorTimeseriesMappingTimestampDatepicker').datepicker('setDate', $scope.userInputTimestamp); + $scope.useTimeseriesAsProperty = false; + } + else{ + $scope.useTimeseriesAsProperty = true; + } + + $scope.digestAfterTimeout(250); + }; + + + $scope.onClickDeleteTimeseriesMappingEntry = function(timeseriesMappingEntry){ + for (let index = 0; index < $scope.timeseriesMapping.length; index++) { + + if ($scope.timeseriesMapping[index].indicatorValueProperty === timeseriesMappingEntry.indicatorValueProperty){ + // remove object + $scope.timeseriesMapping.splice(index, 1); + break; + } + } + + $scope.digestAfterTimeout(250); + $rootScope.$broadcast("timeseriesMappingChanged", { mapping: $scope.timeseriesMapping } ); + }; + + $scope.$on('loadTimeseriesMapping', function(event, args) { + if(typeof args.mapping !== "undefined") { + $scope.loadTimeseriesMapping(args.mapping); + } else { + throw "Can't load timeseries mapping because args has no property 'mapping'." + } + }); + + + $scope.loadTimeseriesMapping = function(mapping) { + let isValid = true; + if(mapping) { + for(const entry of mapping) { + if( !(entry.hasOwnProperty("indicatorValueProperty") && + (entry.hasOwnProperty("timestamp") || entry.hasOwnProperty("timestampProperty")))) + isValid = false + } + } + + if(isValid) + $scope.timeseriesMapping = mapping; + else + throw "Can't load timeseries mapping because mapping has incorrect properties.\ + Expected: indicatorValueProperty and either timestamp or timestampProperty." + + $scope.digestAfterTimeout(250); + $rootScope.$broadcast("timeseriesMappingChanged", { mapping: $scope.timeseriesMapping } ); + }; + + + + $scope.$on('resetTimeseriesMapping', function() { + $scope.resetTimeseriesMapping() + }); + + $scope.resetTimeseriesMapping = function() { + $scope.timeseriesMapping = []; + $scope.useTimeseriesAsProperty = false; + $scope.userInputIndicatorValueProperty = undefined; + $scope.userInputTimestamp = undefined; + $scope.userInputTimestampProperty = undefined; + $rootScope.$broadcast("timeseriesMappingChanged", { mapping: $scope.timeseriesMapping } ); + }; + + + $scope.digestAfterTimeout = function(timeout) { + setTimeout(() => { + $scope.$digest(); + }, timeout); + } + + + + } + ] +}); \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminMultiUseComponents/indicatorEditTimeseriesMapping/indicator-edit-timeseries-mapping.module.js b/app/components/kommonitorAdmin/adminMultiUseComponents/indicatorEditTimeseriesMapping/indicator-edit-timeseries-mapping.module.js index b94097add..16c9ebaba 100644 --- a/app/components/kommonitorAdmin/adminMultiUseComponents/indicatorEditTimeseriesMapping/indicator-edit-timeseries-mapping.module.js +++ b/app/components/kommonitorAdmin/adminMultiUseComponents/indicatorEditTimeseriesMapping/indicator-edit-timeseries-mapping.module.js @@ -1 +1,3 @@ -angular.module('indicatorEditTimeseriesMapping', ['kommonitorBatchUpdateHelper']); \ No newline at end of file +"use strict"; +angular.module('indicatorEditTimeseriesMapping', ['kommonitorBatchUpdateHelper']); +//# sourceMappingURL=indicator-edit-timeseries-mapping.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminMultiUseComponents/indicatorEditTimeseriesMapping/indicator-edit-timeseries-mapping.module.js.map b/app/components/kommonitorAdmin/adminMultiUseComponents/indicatorEditTimeseriesMapping/indicator-edit-timeseries-mapping.module.js.map new file mode 100644 index 000000000..ab482a050 --- /dev/null +++ b/app/components/kommonitorAdmin/adminMultiUseComponents/indicatorEditTimeseriesMapping/indicator-edit-timeseries-mapping.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"indicator-edit-timeseries-mapping.module.js","sourceRoot":"","sources":["indicator-edit-timeseries-mapping.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,gCAAgC,EAAE,CAAC,6BAA6B,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminMultiUseComponents/indicatorEditTimeseriesMapping/indicator-edit-timeseries-mapping.module.ts b/app/components/kommonitorAdmin/adminMultiUseComponents/indicatorEditTimeseriesMapping/indicator-edit-timeseries-mapping.module.ts new file mode 100644 index 000000000..b94097add --- /dev/null +++ b/app/components/kommonitorAdmin/adminMultiUseComponents/indicatorEditTimeseriesMapping/indicator-edit-timeseries-mapping.module.ts @@ -0,0 +1 @@ +angular.module('indicatorEditTimeseriesMapping', ['kommonitorBatchUpdateHelper']); \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminRoleExplanation/admin-role-explanation.component.js b/app/components/kommonitorAdmin/adminRoleExplanation/admin-role-explanation.component.js index 0fee59c36..076b49b7e 100644 --- a/app/components/kommonitorAdmin/adminRoleExplanation/admin-role-explanation.component.js +++ b/app/components/kommonitorAdmin/adminRoleExplanation/admin-role-explanation.component.js @@ -1,9 +1,10 @@ +"use strict"; angular.module('adminRoleExplanation').component('adminRoleExplanation', { - templateUrl : "components/kommonitorAdmin/adminRoleExplanation/admin-role-explanation.template.html", - controller : ['kommonitorDataExchangeService', '$scope', '$timeout', '$rootScope', '__env', '$http', - function RoleManagementController(kommonitorDataExchangeService, $scope, $timeout, $rootScope, __env, $http) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - - } -]}); + templateUrl: "components/kommonitorAdmin/adminRoleExplanation/admin-role-explanation.template.html", + controller: ['kommonitorDataExchangeService', '$scope', '$timeout', '$rootScope', '__env', '$http', + function RoleManagementController(kommonitorDataExchangeService, $scope, $timeout, $rootScope, __env, $http) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + } + ] +}); +//# sourceMappingURL=admin-role-explanation.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminRoleExplanation/admin-role-explanation.component.js.map b/app/components/kommonitorAdmin/adminRoleExplanation/admin-role-explanation.component.js.map new file mode 100644 index 000000000..786f18175 --- /dev/null +++ b/app/components/kommonitorAdmin/adminRoleExplanation/admin-role-explanation.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"admin-role-explanation.component.js","sourceRoot":"","sources":["admin-role-explanation.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC,SAAS,CAAC,sBAAsB,EAAE;IACxE,WAAW,EAAG,sFAAsF;IACpG,UAAU,EAAG,CAAC,+BAA+B,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO;QACnG,SAAS,wBAAwB,CAAC,6BAA6B,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK;YAE1G,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;QAE5E,CAAC;KACD;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminRoleExplanation/admin-role-explanation.component.ts b/app/components/kommonitorAdmin/adminRoleExplanation/admin-role-explanation.component.ts new file mode 100644 index 000000000..0fee59c36 --- /dev/null +++ b/app/components/kommonitorAdmin/adminRoleExplanation/admin-role-explanation.component.ts @@ -0,0 +1,9 @@ +angular.module('adminRoleExplanation').component('adminRoleExplanation', { + templateUrl : "components/kommonitorAdmin/adminRoleExplanation/admin-role-explanation.template.html", + controller : ['kommonitorDataExchangeService', '$scope', '$timeout', '$rootScope', '__env', '$http', + function RoleManagementController(kommonitorDataExchangeService, $scope, $timeout, $rootScope, __env, $http) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + + } +]}); diff --git a/app/components/kommonitorAdmin/adminRoleExplanation/admin-role-explanation.module.js b/app/components/kommonitorAdmin/adminRoleExplanation/admin-role-explanation.module.js index 94edf3728..cc573d772 100644 --- a/app/components/kommonitorAdmin/adminRoleExplanation/admin-role-explanation.module.js +++ b/app/components/kommonitorAdmin/adminRoleExplanation/admin-role-explanation.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('adminRoleExplanation', ['kommonitorDataExchange']); +//# sourceMappingURL=admin-role-explanation.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminRoleExplanation/admin-role-explanation.module.js.map b/app/components/kommonitorAdmin/adminRoleExplanation/admin-role-explanation.module.js.map new file mode 100644 index 000000000..3f25a5983 --- /dev/null +++ b/app/components/kommonitorAdmin/adminRoleExplanation/admin-role-explanation.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"admin-role-explanation.module.js","sourceRoot":"","sources":["admin-role-explanation.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,sBAAsB,EAAE,CAAC,wBAAwB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminRoleExplanation/admin-role-explanation.module.ts b/app/components/kommonitorAdmin/adminRoleExplanation/admin-role-explanation.module.ts new file mode 100644 index 000000000..94edf3728 --- /dev/null +++ b/app/components/kommonitorAdmin/adminRoleExplanation/admin-role-explanation.module.ts @@ -0,0 +1 @@ +angular.module('adminRoleExplanation', ['kommonitorDataExchange']); diff --git a/app/components/kommonitorAdmin/adminRoleManagement/admin-role-management.component.js b/app/components/kommonitorAdmin/adminRoleManagement/admin-role-management.component.js index 378f9407a..ab8eda474 100644 --- a/app/components/kommonitorAdmin/adminRoleManagement/admin-role-management.component.js +++ b/app/components/kommonitorAdmin/adminRoleManagement/admin-role-management.component.js @@ -1,147 +1,115 @@ -angular.module('adminRoleManagement').component('adminRoleManagement', { - templateUrl: "components/kommonitorAdmin/adminRoleManagement/admin-role-management.template.html", - controller: ['kommonitorDataExchangeService', 'kommonitorCacheHelperService', 'kommonitorDataGridHelperService', 'kommonitorKeycloakHelperService', - '$scope', '$rootScope', '__env', '$http', '$timeout', - function RoleManagementController(kommonitorDataExchangeService, kommonitorCacheHelperService, kommonitorDataGridHelperService, - kommonitorKeycloakHelperService, $scope, $rootScope, __env, $http, $timeout) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorKeycloakHelperServiceInstance = kommonitorKeycloakHelperService; - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - $scope.loadingData = true; - - $scope.availableRoleDatasets; - $scope.selectAllEntriesInput = false; - - $scope.$on("initialMetadataLoadingCompleted", function (event) { - $timeout(function () { - $scope.initializeOrRefreshOverviewTable(); - }, 250); - }); - - $scope.$on("initialMetadataLoadingFailed", function (event, errorArray) { - $scope.loadingData = false; - }); - - $scope.initializeOrRefreshOverviewTable = function () { - $scope.loadingData = true; - $scope.accessControl = JSON.parse(JSON.stringify(kommonitorDataExchangeService.accessControl)); - - kommonitorDataGridHelperService.buildDataGrid_accessControl($scope.accessControl); - - $scope.loadingData = false; - }; - - $scope.$on("refreshAccessControlTable", function (event, crudType, targetRoleId) { - $scope.loadingData = true; - $scope.refreshAccessControlTable(crudType, targetRoleId); - }); - - $scope.onChangeSelectAllEntries = function () { - if ($scope.selectAllEntriesInput) { - $scope.availableRoleDatasets.forEach(function (dataset) { - dataset.isSelected = true; - }); - } - else { - $scope.availableRoleDatasets.forEach(function (dataset) { - dataset.isSelected = false; - }); - } - }; - - $scope.onChangeSelectAllEntries = function () { - if ($scope.selectAllEntriesInput) { - $scope.availableRoleDatasets.forEach(function (dataset) { - dataset.isSelected = true; - }); - } - else { - $scope.availableRoleDatasets.forEach(function (dataset) { - dataset.isSelected = false; - }); - } - }; - - $scope.refreshAccessControlTable = function (crudType, targetId) { - - if(! crudType || !targetId){ - // refetch all metadata from spatial units to update table - kommonitorDataExchangeService.fetchAccessControlMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(response) { - $scope.initializeOrRefreshOverviewTable(); - $scope.loadingData = false; - - }, function errorCallback(response) { - $scope.loadingData = false; - }); - } - else if(crudType && targetId){ - if(crudType == "add"){ - kommonitorCacheHelperService.fetchSingleAccessControlMetadata(targetId, kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(data) { - - $scope.initializeOrRefreshOverviewTable(); - - $scope.loadingData = false; - - }, function errorCallback(response) { - - $scope.loadingData = false; - }); - } - else if(crudType == "edit"){ - kommonitorCacheHelperService.fetchSingleAccessControlMetadata(targetId, kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(data) { - - $scope.initializeOrRefreshOverviewTable(); - $scope.loadingData = false; - - }, function errorCallback(response) { - - $scope.loadingData = false; - }); - } - else if(crudType == "delete"){ - // targetRoleId might be array in this case - if(targetId && typeof targetId == "string"){ - kommonitorDataExchangeService.deleteSingleAccessControlMetadata(targetId); - - $scope.initializeOrRefreshOverviewTable(); - - $scope.loadingData = false; - } - - else if (targetId && Array.isArray(targetId)){ - for (const id of targetId) { - kommonitorDataExchangeService.deleteSingleAccessControlMetadata(id); - } - $scope.initializeOrRefreshOverviewTable(); - - $scope.loadingData = false; - } - - } - } - - }; - - $scope.onClickDeleteDatasets = function () { - $scope.loadingData = true; - - var markedEntriesForDeletion = kommonitorDataGridHelperService.getSelectedAccessControlMetadata(); - - // submit selected spatial units to modal controller - $rootScope.$broadcast("onDeleteOrganizationalUnit", markedEntriesForDeletion); - - $scope.loadingData = false; - }; - - $scope.onClickEditMetadata = function (roleDataset) { - // submit selected spatial unit to modal controller - console.dir(roleDataset); - $rootScope.$broadcast("onEditRoleMetadata", roleDataset); - }; - - } - ] -}); +"use strict"; +angular.module('adminRoleManagement').component('adminRoleManagement', { + templateUrl: "components/kommonitorAdmin/adminRoleManagement/admin-role-management.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorCacheHelperService', 'kommonitorDataGridHelperService', 'kommonitorKeycloakHelperService', + '$scope', '$rootScope', '__env', '$http', '$timeout', + function RoleManagementController(kommonitorDataExchangeService, kommonitorCacheHelperService, kommonitorDataGridHelperService, kommonitorKeycloakHelperService, $scope, $rootScope, __env, $http, $timeout) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorKeycloakHelperServiceInstance = kommonitorKeycloakHelperService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + $scope.loadingData = true; + $scope.availableRoleDatasets; + $scope.selectAllEntriesInput = false; + $scope.$on("initialMetadataLoadingCompleted", function (event) { + $timeout(function () { + $scope.initializeOrRefreshOverviewTable(); + }, 250); + }); + $scope.$on("initialMetadataLoadingFailed", function (event, errorArray) { + $scope.loadingData = false; + }); + $scope.initializeOrRefreshOverviewTable = function () { + $scope.loadingData = true; + $scope.accessControl = JSON.parse(JSON.stringify(kommonitorDataExchangeService.accessControl)); + kommonitorDataGridHelperService.buildDataGrid_accessControl($scope.accessControl); + $scope.loadingData = false; + }; + $scope.$on("refreshAccessControlTable", function (event, crudType, targetRoleId) { + $scope.loadingData = true; + $scope.refreshAccessControlTable(crudType, targetRoleId); + }); + $scope.onChangeSelectAllEntries = function () { + if ($scope.selectAllEntriesInput) { + $scope.availableRoleDatasets.forEach(function (dataset) { + dataset.isSelected = true; + }); + } + else { + $scope.availableRoleDatasets.forEach(function (dataset) { + dataset.isSelected = false; + }); + } + }; + $scope.onChangeSelectAllEntries = function () { + if ($scope.selectAllEntriesInput) { + $scope.availableRoleDatasets.forEach(function (dataset) { + dataset.isSelected = true; + }); + } + else { + $scope.availableRoleDatasets.forEach(function (dataset) { + dataset.isSelected = false; + }); + } + }; + $scope.refreshAccessControlTable = function (crudType, targetId) { + if (!crudType || !targetId) { + // refetch all metadata from spatial units to update table + kommonitorDataExchangeService.fetchAccessControlMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(response) { + $scope.initializeOrRefreshOverviewTable(); + $scope.loadingData = false; + }, function errorCallback(response) { + $scope.loadingData = false; + }); + } + else if (crudType && targetId) { + if (crudType == "add") { + kommonitorCacheHelperService.fetchSingleAccessControlMetadata(targetId, kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(data) { + $scope.initializeOrRefreshOverviewTable(); + $scope.loadingData = false; + }, function errorCallback(response) { + $scope.loadingData = false; + }); + } + else if (crudType == "edit") { + kommonitorCacheHelperService.fetchSingleAccessControlMetadata(targetId, kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(data) { + $scope.initializeOrRefreshOverviewTable(); + $scope.loadingData = false; + }, function errorCallback(response) { + $scope.loadingData = false; + }); + } + else if (crudType == "delete") { + // targetRoleId might be array in this case + if (targetId && typeof targetId == "string") { + kommonitorDataExchangeService.deleteSingleAccessControlMetadata(targetId); + $scope.initializeOrRefreshOverviewTable(); + $scope.loadingData = false; + } + else if (targetId && Array.isArray(targetId)) { + for (const id of targetId) { + kommonitorDataExchangeService.deleteSingleAccessControlMetadata(id); + } + $scope.initializeOrRefreshOverviewTable(); + $scope.loadingData = false; + } + } + } + }; + $scope.onClickDeleteDatasets = function () { + $scope.loadingData = true; + var markedEntriesForDeletion = kommonitorDataGridHelperService.getSelectedAccessControlMetadata(); + // submit selected spatial units to modal controller + $rootScope.$broadcast("onDeleteOrganizationalUnit", markedEntriesForDeletion); + $scope.loadingData = false; + }; + $scope.onClickEditMetadata = function (roleDataset) { + // submit selected spatial unit to modal controller + console.dir(roleDataset); + $rootScope.$broadcast("onEditRoleMetadata", roleDataset); + }; + } + ] +}); +//# sourceMappingURL=admin-role-management.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminRoleManagement/admin-role-management.component.js.map b/app/components/kommonitorAdmin/adminRoleManagement/admin-role-management.component.js.map new file mode 100644 index 000000000..a0e54cd0c --- /dev/null +++ b/app/components/kommonitorAdmin/adminRoleManagement/admin-role-management.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"admin-role-management.component.js","sourceRoot":"","sources":["admin-role-management.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,SAAS,CAAC,qBAAqB,EAAE;IACtE,WAAW,EAAE,oFAAoF;IACjG,UAAU,EAAE,CAAC,+BAA+B,EAAE,8BAA8B,EAAE,iCAAiC,E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AA6B,CAAC,iCAAiC,CAAC,EAAE,CAAC,CAAC;6BACpE;4BACD,MAAM,CAAC,gCAAgC,EAAE,CAAC;4BAE1C,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;yBAC3B;qBAED;iBACD;YAEF,CAAC,CAAC;YAEF,MAAM,CAAC,qBAAqB,GAAG;gBAC9B,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC;gBAE1B,IAAI,wBAAwB,GAAG,+BAA+B,CAAC,gCAAgC,EAAE,CAAC;gBAElG,oDAAoD;gBACpD,UAAU,CAAC,UAAU,CAAC,4BAA4B,EAAE,wBAAwB,CAAC,CAAC;gBAE9E,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;YAC5B,CAAC,CAAC;YAEF,MAAM,CAAC,mBAAmB,GAAG,UAAU,WAAW;gBACjD,mDAAmD;gBACnD,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;gBACzB,UAAU,CAAC,UAAU,CAAC,oBAAoB,EAAE,WAAW,CAAC,CAAC;YAC1D,CAAC,CAAC;QAEH,CAAC;KACA;CACD,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminRoleManagement/admin-role-management.component.ts b/app/components/kommonitorAdmin/adminRoleManagement/admin-role-management.component.ts new file mode 100644 index 000000000..df4344bee --- /dev/null +++ b/app/components/kommonitorAdmin/adminRoleManagement/admin-role-management.component.ts @@ -0,0 +1,147 @@ +angular.module('adminRoleManagement').component('adminRoleManagement', { + templateUrl: "components/kommonitorAdmin/adminRoleManagement/admin-role-management.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorCacheHelperService', 'kommonitorDataGridHelperService', 'kommonitorKeycloakHelperService', + '$scope', '$rootScope', '__env', '$http', '$timeout', + function RoleManagementController(kommonitorDataExchangeService, kommonitorCacheHelperService, kommonitorDataGridHelperService, + kommonitorKeycloakHelperService, $scope, $rootScope, __env, $http, $timeout) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorKeycloakHelperServiceInstance = kommonitorKeycloakHelperService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + $scope.loadingData = true; + + $scope.availableRoleDatasets; + $scope.selectAllEntriesInput = false; + + $scope.$on("initialMetadataLoadingCompleted", function (event) { + $timeout(function () { + $scope.initializeOrRefreshOverviewTable(); + }, 250); + }); + + $scope.$on("initialMetadataLoadingFailed", function (event, errorArray) { + $scope.loadingData = false; + }); + + $scope.initializeOrRefreshOverviewTable = function () { + $scope.loadingData = true; + $scope.accessControl = JSON.parse(JSON.stringify(kommonitorDataExchangeService.accessControl)); + + kommonitorDataGridHelperService.buildDataGrid_accessControl($scope.accessControl); + + $scope.loadingData = false; + }; + + $scope.$on("refreshAccessControlTable", function (event, crudType, targetRoleId) { + $scope.loadingData = true; + $scope.refreshAccessControlTable(crudType, targetRoleId); + }); + + $scope.onChangeSelectAllEntries = function () { + if ($scope.selectAllEntriesInput) { + $scope.availableRoleDatasets.forEach(function (dataset) { + dataset.isSelected = true; + }); + } + else { + $scope.availableRoleDatasets.forEach(function (dataset) { + dataset.isSelected = false; + }); + } + }; + + $scope.onChangeSelectAllEntries = function () { + if ($scope.selectAllEntriesInput) { + $scope.availableRoleDatasets.forEach(function (dataset) { + dataset.isSelected = true; + }); + } + else { + $scope.availableRoleDatasets.forEach(function (dataset) { + dataset.isSelected = false; + }); + } + }; + + $scope.refreshAccessControlTable = function (crudType, targetId) { + + if(! crudType || !targetId){ + // refetch all metadata from spatial units to update table + kommonitorDataExchangeService.fetchAccessControlMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(response) { + $scope.initializeOrRefreshOverviewTable(); + $scope.loadingData = false; + + }, function errorCallback(response) { + $scope.loadingData = false; + }); + } + else if(crudType && targetId){ + if(crudType == "add"){ + kommonitorCacheHelperService.fetchSingleAccessControlMetadata(targetId, kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(data) { + + $scope.initializeOrRefreshOverviewTable(); + + $scope.loadingData = false; + + }, function errorCallback(response) { + + $scope.loadingData = false; + }); + } + else if(crudType == "edit"){ + kommonitorCacheHelperService.fetchSingleAccessControlMetadata(targetId, kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(data) { + + $scope.initializeOrRefreshOverviewTable(); + $scope.loadingData = false; + + }, function errorCallback(response) { + + $scope.loadingData = false; + }); + } + else if(crudType == "delete"){ + // targetRoleId might be array in this case + if(targetId && typeof targetId == "string"){ + kommonitorDataExchangeService.deleteSingleAccessControlMetadata(targetId); + + $scope.initializeOrRefreshOverviewTable(); + + $scope.loadingData = false; + } + + else if (targetId && Array.isArray(targetId)){ + for (const id of targetId) { + kommonitorDataExchangeService.deleteSingleAccessControlMetadata(id); + } + $scope.initializeOrRefreshOverviewTable(); + + $scope.loadingData = false; + } + + } + } + + }; + + $scope.onClickDeleteDatasets = function () { + $scope.loadingData = true; + + var markedEntriesForDeletion = kommonitorDataGridHelperService.getSelectedAccessControlMetadata(); + + // submit selected spatial units to modal controller + $rootScope.$broadcast("onDeleteOrganizationalUnit", markedEntriesForDeletion); + + $scope.loadingData = false; + }; + + $scope.onClickEditMetadata = function (roleDataset) { + // submit selected spatial unit to modal controller + console.dir(roleDataset); + $rootScope.$broadcast("onEditRoleMetadata", roleDataset); + }; + + } + ] +}); diff --git a/app/components/kommonitorAdmin/adminRoleManagement/admin-role-management.module.js b/app/components/kommonitorAdmin/adminRoleManagement/admin-role-management.module.js index f93117994..cefa8a683 100644 --- a/app/components/kommonitorAdmin/adminRoleManagement/admin-role-management.module.js +++ b/app/components/kommonitorAdmin/adminRoleManagement/admin-role-management.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('adminRoleManagement', ['kommonitorDataExchange', 'kommonitorCacheHelper', 'kommonitorKeycloakHelper', 'kommonitorDataGridHelper']); +//# sourceMappingURL=admin-role-management.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminRoleManagement/admin-role-management.module.js.map b/app/components/kommonitorAdmin/adminRoleManagement/admin-role-management.module.js.map new file mode 100644 index 000000000..06c75cba8 --- /dev/null +++ b/app/components/kommonitorAdmin/adminRoleManagement/admin-role-management.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"admin-role-management.module.js","sourceRoot":"","sources":["admin-role-management.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,qBAAqB,EAAE,CAAC,wBAAwB,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,0BAA0B,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminRoleManagement/admin-role-management.module.ts b/app/components/kommonitorAdmin/adminRoleManagement/admin-role-management.module.ts new file mode 100644 index 000000000..f93117994 --- /dev/null +++ b/app/components/kommonitorAdmin/adminRoleManagement/admin-role-management.module.ts @@ -0,0 +1 @@ +angular.module('adminRoleManagement', ['kommonitorDataExchange', 'kommonitorCacheHelper', 'kommonitorKeycloakHelper', 'kommonitorDataGridHelper']); diff --git a/app/components/kommonitorAdmin/adminRoleManagement/roleAddModal/role-add-modal.component.js b/app/components/kommonitorAdmin/adminRoleManagement/roleAddModal/role-add-modal.component.js index c7ef4ee79..ccadbf41e 100644 --- a/app/components/kommonitorAdmin/adminRoleManagement/roleAddModal/role-add-modal.component.js +++ b/app/components/kommonitorAdmin/adminRoleManagement/roleAddModal/role-add-modal.component.js @@ -1,129 +1,107 @@ +"use strict"; angular.module('roleAddModal').component('roleAddModal', { - templateUrl: "components/kommonitorAdmin/adminRoleManagement/roleAddModal/role-add-modal.template.html", - controller: ['kommonitorDataExchangeService', 'kommonitorImporterHelperService', 'kommonitorKeycloakHelperService', '$scope', '$rootScope', '$timeout', '$http', '__env', - function SpatialUnitAddModalController(kommonitorDataExchangeService, kommonitorImporterHelperService, kommonitorKeycloakHelperService, $scope, $rootScope, $timeout, $http, __env) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorImporterHelperServiceInstance = kommonitorImporterHelperService; - this.kommonitorKeycloakHelperServiceInstance = kommonitorKeycloakHelperService; - - $scope.loadingData = false; - $scope.newOrganizationalUnit = {}; - - $scope.nameInvalid = false; - $scope.errorMessagePart = undefined; - $scope.keycloakErrorMessagePart = undefined; - - $scope.checkRoleName = function () { - $scope.nameInvalid = kommonitorDataExchangeService.accessControl.some(ou => ou.name === $scope.newOrganizationalUnit.name); - }; - - - $scope.resetRoleAddForm = function () { - $scope.newOrganizationalUnit = {}; - - $scope.errorMessagePart = undefined; - $scope.keycloakErrorMessagePart = undefined; - $scope.checkRoleName(); - - setTimeout(() => { - $scope.$digest(); - }, 250); - }; - - $scope.addRole = async function () { - $scope.errorMessagePart = undefined; - $scope.keycloakErrorMessagePart = undefined; - - let roleId = ""; - try { - var postBody = - { - "name": $scope.newOrganizationalUnit.name, - "description": $scope.newOrganizationalUnit.description, - "contact": $scope.newOrganizationalUnit.contact, - }; - - $scope.loadingData = true; - - $http({ - url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/organizationalUnits", - method: "POST", - data: postBody - // headers: { - // 'Content-Type': 'application/json' - // } - }).then(async function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - $("#roleAddSuccessAlert").show(); - try { - // The fetch API does not expose the Location Header for XSS protection - // So we refetch all metadata - await kommonitorDataExchangeService.fetchAccessControlMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles); - kommonitorDataExchangeService.accessControl.forEach(function (entry) { - if (entry.name === $scope.newOrganizationalUnit.name) { - $scope.newOrganizationalUnit = JSON.parse(JSON.stringify(entry)) - } - }); - - await kommonitorKeycloakHelperService.postNewRoles($scope.newOrganizationalUnit.name); - await kommonitorKeycloakHelperService.fetchAndSetKeycloakRoles(); - $("#keycloakRoleAddSuccessAlert").show(); - } catch (error) { - if (error.data) { - $scope.keycloakErrorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else { - $scope.keycloakErrorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - - $timeout(function () { - - $("#keycloakRoleAddErrorAlert").show(); - $scope.loadingData = false; - }); - } - - $rootScope.$broadcast("refreshAccessControlTable", "add", $scope.newOrganizationalUnit.organizationalUnitId); - $scope.checkRoleName(); - $timeout(function () { - $scope.loadingData = false; - }); - - }, function errorCallback(error) { - - }); - } catch (error) { - if (error.data) { - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else { - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - - $("#roleAddErrorAlert").show(); - $scope.loadingData = false; - } - }; - - $scope.hideSuccessAlert = function () { - $("#roleAddSuccessAlert").hide(); - }; - - $scope.hideKeycloakSuccessAlert = function () { - $("#keycloakRoleAddSuccessAlert").hide(); - }; - - $scope.hideErrorAlert = function () { - $("#roleAddErrorAlert").hide(); - }; - - $scope.hideKeycloakErrorAlert = function () { - $("#keycloakRoleAddErrorAlert").hide(); - }; - - } - ] + templateUrl: "components/kommonitorAdmin/adminRoleManagement/roleAddModal/role-add-modal.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorImporterHelperService', 'kommonitorKeycloakHelperService', '$scope', '$rootScope', '$timeout', '$http', '__env', + function SpatialUnitAddModalController(kommonitorDataExchangeService, kommonitorImporterHelperService, kommonitorKeycloakHelperService, $scope, $rootScope, $timeout, $http, __env) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorImporterHelperServiceInstance = kommonitorImporterHelperService; + this.kommonitorKeycloakHelperServiceInstance = kommonitorKeycloakHelperService; + $scope.loadingData = false; + $scope.newOrganizationalUnit = {}; + $scope.nameInvalid = false; + $scope.errorMessagePart = undefined; + $scope.keycloakErrorMessagePart = undefined; + $scope.checkRoleName = function () { + $scope.nameInvalid = kommonitorDataExchangeService.accessControl.some(ou => ou.name === $scope.newOrganizationalUnit.name); + }; + $scope.resetRoleAddForm = function () { + $scope.newOrganizationalUnit = {}; + $scope.errorMessagePart = undefined; + $scope.keycloakErrorMessagePart = undefined; + $scope.checkRoleName(); + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.addRole = async function () { + $scope.errorMessagePart = undefined; + $scope.keycloakErrorMessagePart = undefined; + let roleId = ""; + try { + var postBody = { + "name": $scope.newOrganizationalUnit.name, + "description": $scope.newOrganizationalUnit.description, + "contact": $scope.newOrganizationalUnit.contact, + }; + $scope.loadingData = true; + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/organizationalUnits", + method: "POST", + data: postBody + // headers: { + // 'Content-Type': 'application/json' + // } + }).then(async function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + $("#roleAddSuccessAlert").show(); + try { + // The fetch API does not expose the Location Header for XSS protection + // So we refetch all metadata + await kommonitorDataExchangeService.fetchAccessControlMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles); + kommonitorDataExchangeService.accessControl.forEach(function (entry) { + if (entry.name === $scope.newOrganizationalUnit.name) { + $scope.newOrganizationalUnit = JSON.parse(JSON.stringify(entry)); + } + }); + await kommonitorKeycloakHelperService.postNewRoles($scope.newOrganizationalUnit.name); + await kommonitorKeycloakHelperService.fetchAndSetKeycloakRoles(); + $("#keycloakRoleAddSuccessAlert").show(); + } + catch (error) { + if (error.data) { + $scope.keycloakErrorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.keycloakErrorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + $timeout(function () { + $("#keycloakRoleAddErrorAlert").show(); + $scope.loadingData = false; + }); + } + $rootScope.$broadcast("refreshAccessControlTable", "add", $scope.newOrganizationalUnit.organizationalUnitId); + $scope.checkRoleName(); + $timeout(function () { + $scope.loadingData = false; + }); + }, function errorCallback(error) { + }); + } + catch (error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + $("#roleAddErrorAlert").show(); + $scope.loadingData = false; + } + }; + $scope.hideSuccessAlert = function () { + $("#roleAddSuccessAlert").hide(); + }; + $scope.hideKeycloakSuccessAlert = function () { + $("#keycloakRoleAddSuccessAlert").hide(); + }; + $scope.hideErrorAlert = function () { + $("#roleAddErrorAlert").hide(); + }; + $scope.hideKeycloakErrorAlert = function () { + $("#keycloakRoleAddErrorAlert").hide(); + }; + } + ] }); +//# sourceMappingURL=role-add-modal.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminRoleManagement/roleAddModal/role-add-modal.component.js.map b/app/components/kommonitorAdmin/adminRoleManagement/roleAddModal/role-add-modal.component.js.map new file mode 100644 index 000000000..1004e6e1d --- /dev/null +++ b/app/components/kommonitorAdmin/adminRoleManagement/roleAddModal/role-add-modal.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"role-add-modal.component.js","sourceRoot":"","sources":["role-add-modal.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,cAAc,EAAE;IACxD,WAAW,EAAE,0FAA0F;IACvG,UAAU,EAAE,CAAC,+BAA+B,EAAE,iCAAiC,EAAE,iCAAiC,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO;QACvK,SAAS,6BAA6B,CAAC,6BAA6B,EAAE,+BAA+B,EAAE,+BAA+B,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK;YAEjL,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAC3E,IAAI,CAAC,uCAAuC,GAAG,+BAA+B,CAAC;YAC/E,IAAI,CAAC,uCAAuC,GAAG,+BAA+B,CAAC;YAE/E,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;YAC3B,MAAM,CAAC,qBAAqB,GAAG,EAAE,CAAC;YAElC,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;YAC3B,MAAM,CAAC,gBAAgB,GAAG,SAAS,CAAC;YACpC,MAAM,CAAC,wBAA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ACR,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;wBAC5B,CAAC,CAAC,CAAC;oBAEJ,CAAC,EAAE,SAAS,aAAa,CAAC,KAAK;oBAE/B,CAAC,CAAC,CAAC;iBACH;gBAAC,OAAO,KAAK,EAAE;oBACf,IAAI,KAAK,CAAC,IAAI,EAAE;wBACf,MAAM,CAAC,gBAAgB,GAAG,6BAA6B,CAAC,mBAAmB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;qBACxF;yBACI;wBACJ,MAAM,CAAC,gBAAgB,GAAG,6BAA6B,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;qBACnF;oBAED,CAAC,CAAC,oBAAoB,CAAC,CAAC,IAAI,EAAE,CAAC;oBAC/B,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;iBAC3B;YACF,CAAC,CAAC;YAEF,MAAM,CAAC,gBAAgB,GAAG;gBACzB,CAAC,CAAC,sBAAsB,CAAC,CAAC,IAAI,EAAE,CAAC;YAClC,CAAC,CAAC;YAEF,MAAM,CAAC,wBAAwB,GAAG;gBACjC,CAAC,CAAC,8BAA8B,CAAC,CAAC,IAAI,EAAE,CAAC;YAC1C,CAAC,CAAC;YAEF,MAAM,CAAC,cAAc,GAAG;gBACvB,CAAC,CAAC,oBAAoB,CAAC,CAAC,IAAI,EAAE,CAAC;YAChC,CAAC,CAAC;YAEF,MAAM,CAAC,sBAAsB,GAAG;gBAC/B,CAAC,CAAC,4BAA4B,CAAC,CAAC,IAAI,EAAE,CAAC;YACxC,CAAC,CAAC;QAEH,CAAC;KACD;CACD,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminRoleManagement/roleAddModal/role-add-modal.component.ts b/app/components/kommonitorAdmin/adminRoleManagement/roleAddModal/role-add-modal.component.ts new file mode 100644 index 000000000..c7ef4ee79 --- /dev/null +++ b/app/components/kommonitorAdmin/adminRoleManagement/roleAddModal/role-add-modal.component.ts @@ -0,0 +1,129 @@ +angular.module('roleAddModal').component('roleAddModal', { + templateUrl: "components/kommonitorAdmin/adminRoleManagement/roleAddModal/role-add-modal.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorImporterHelperService', 'kommonitorKeycloakHelperService', '$scope', '$rootScope', '$timeout', '$http', '__env', + function SpatialUnitAddModalController(kommonitorDataExchangeService, kommonitorImporterHelperService, kommonitorKeycloakHelperService, $scope, $rootScope, $timeout, $http, __env) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorImporterHelperServiceInstance = kommonitorImporterHelperService; + this.kommonitorKeycloakHelperServiceInstance = kommonitorKeycloakHelperService; + + $scope.loadingData = false; + $scope.newOrganizationalUnit = {}; + + $scope.nameInvalid = false; + $scope.errorMessagePart = undefined; + $scope.keycloakErrorMessagePart = undefined; + + $scope.checkRoleName = function () { + $scope.nameInvalid = kommonitorDataExchangeService.accessControl.some(ou => ou.name === $scope.newOrganizationalUnit.name); + }; + + + $scope.resetRoleAddForm = function () { + $scope.newOrganizationalUnit = {}; + + $scope.errorMessagePart = undefined; + $scope.keycloakErrorMessagePart = undefined; + $scope.checkRoleName(); + + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + + $scope.addRole = async function () { + $scope.errorMessagePart = undefined; + $scope.keycloakErrorMessagePart = undefined; + + let roleId = ""; + try { + var postBody = + { + "name": $scope.newOrganizationalUnit.name, + "description": $scope.newOrganizationalUnit.description, + "contact": $scope.newOrganizationalUnit.contact, + }; + + $scope.loadingData = true; + + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/organizationalUnits", + method: "POST", + data: postBody + // headers: { + // 'Content-Type': 'application/json' + // } + }).then(async function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + $("#roleAddSuccessAlert").show(); + try { + // The fetch API does not expose the Location Header for XSS protection + // So we refetch all metadata + await kommonitorDataExchangeService.fetchAccessControlMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles); + kommonitorDataExchangeService.accessControl.forEach(function (entry) { + if (entry.name === $scope.newOrganizationalUnit.name) { + $scope.newOrganizationalUnit = JSON.parse(JSON.stringify(entry)) + } + }); + + await kommonitorKeycloakHelperService.postNewRoles($scope.newOrganizationalUnit.name); + await kommonitorKeycloakHelperService.fetchAndSetKeycloakRoles(); + $("#keycloakRoleAddSuccessAlert").show(); + } catch (error) { + if (error.data) { + $scope.keycloakErrorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.keycloakErrorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + + $timeout(function () { + + $("#keycloakRoleAddErrorAlert").show(); + $scope.loadingData = false; + }); + } + + $rootScope.$broadcast("refreshAccessControlTable", "add", $scope.newOrganizationalUnit.organizationalUnitId); + $scope.checkRoleName(); + $timeout(function () { + $scope.loadingData = false; + }); + + }, function errorCallback(error) { + + }); + } catch (error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + + $("#roleAddErrorAlert").show(); + $scope.loadingData = false; + } + }; + + $scope.hideSuccessAlert = function () { + $("#roleAddSuccessAlert").hide(); + }; + + $scope.hideKeycloakSuccessAlert = function () { + $("#keycloakRoleAddSuccessAlert").hide(); + }; + + $scope.hideErrorAlert = function () { + $("#roleAddErrorAlert").hide(); + }; + + $scope.hideKeycloakErrorAlert = function () { + $("#keycloakRoleAddErrorAlert").hide(); + }; + + } + ] +}); diff --git a/app/components/kommonitorAdmin/adminRoleManagement/roleAddModal/role-add-modal.module.js b/app/components/kommonitorAdmin/adminRoleManagement/roleAddModal/role-add-modal.module.js index c8f28576b..7c3e0fdd7 100644 --- a/app/components/kommonitorAdmin/adminRoleManagement/roleAddModal/role-add-modal.module.js +++ b/app/components/kommonitorAdmin/adminRoleManagement/roleAddModal/role-add-modal.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('roleAddModal', ['kommonitorImporterHelper', 'kommonitorKeycloakHelper']); +//# sourceMappingURL=role-add-modal.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminRoleManagement/roleAddModal/role-add-modal.module.js.map b/app/components/kommonitorAdmin/adminRoleManagement/roleAddModal/role-add-modal.module.js.map new file mode 100644 index 000000000..1051a6199 --- /dev/null +++ b/app/components/kommonitorAdmin/adminRoleManagement/roleAddModal/role-add-modal.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"role-add-modal.module.js","sourceRoot":"","sources":["role-add-modal.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC,0BAA0B,EAAE,0BAA0B,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminRoleManagement/roleAddModal/role-add-modal.module.ts b/app/components/kommonitorAdmin/adminRoleManagement/roleAddModal/role-add-modal.module.ts new file mode 100644 index 000000000..c8f28576b --- /dev/null +++ b/app/components/kommonitorAdmin/adminRoleManagement/roleAddModal/role-add-modal.module.ts @@ -0,0 +1 @@ +angular.module('roleAddModal', ['kommonitorImporterHelper', 'kommonitorKeycloakHelper']); diff --git a/app/components/kommonitorAdmin/adminRoleManagement/roleDeleteModal/role-delete-modal.component.js b/app/components/kommonitorAdmin/adminRoleManagement/roleDeleteModal/role-delete-modal.component.js index 0aef96685..5f2012859 100644 --- a/app/components/kommonitorAdmin/adminRoleManagement/roleDeleteModal/role-delete-modal.component.js +++ b/app/components/kommonitorAdmin/adminRoleManagement/roleDeleteModal/role-delete-modal.component.js @@ -1,215 +1,169 @@ +"use strict"; angular.module('roleDeleteModal').component('roleDeleteModal', { - templateUrl: "components/kommonitorAdmin/adminRoleManagement/roleDeleteModal/role-delete-modal.template.html", - controller: ['kommonitorDataExchangeService', 'kommonitorKeycloakHelperService', '$scope', '$rootScope', '$http', '__env', '$q', '$timeout', function RoleDeleteModalController(kommonitorDataExchangeService, kommonitorKeycloakHelperService, $scope, $rootScope, $http, __env, $q, $timeout) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorKeycloakHelperServiceInstance = kommonitorKeycloakHelperService; - - $scope.elementsToDelete = []; - - $scope.loadingData = false; - - $scope.successfullyDeletedDatasets = []; - $scope.failedDatasetsAndErrors = []; - - $scope.deleteCorrespondingKeycloakRole = false; - - $scope.affectedSpatialUnits = []; - $scope.affectedGeoresources = []; - $scope.affectedIndicators = []; - - $scope.$on("onDeleteOrganizationalUnit", function (event, datasets) { - $scope.resetRolesDeleteForm(); - const original_size = datasets.length; - datasets = datasets.filter(org => org.name != "public" && org.name != "kommonitor") - if (datasets.length < original_size) { - $scope.failedDatasetsAndErrors.push([{"name": "public / kommonitor"}, "System Organisationseinheiten können nicht gelöscht werden! Die betroffene Einheit wurde aus der Liste entfernt."]); - $("#rolesDeleteErrorAlert").show(); - } - $scope.elementsToDelete = datasets; - }); - - - $scope.resetRolesDeleteForm = function () { - - $scope.successfullyDeletedDatasets = []; - $scope.failedDatasetsAndErrors = []; - $scope.affectedSpatialUnits = $scope.gatherAffectedSpatialUnits(); - $scope.affectedGeoresources = $scope.gatherAffectedGeoresources(); - $scope.affectedIndicators = $scope.gatherAffectedIndicators(); - $("#rolesDeleteSuccessAlert").hide(); - $("#rolesDeleteErrorAlert").hide(); - }; - - $scope.gatherAffectedSpatialUnits = function () { - $scope.affectedSpatialUnits = []; - - kommonitorDataExchangeService.availableSpatialUnits.forEach(function (spatialUnit) { - var allowedRoles = spatialUnit.allowedRoles; - - for (const datasetToDelete of $scope.elementsToDelete) { - if (allowedRoles.includes(datasetToDelete.organizationalUnitId)) { - $scope.affectedSpatialUnits.push(spatialUnit); - break; - } - } - }); - - return $scope.affectedSpatialUnits; - }; - - $scope.gatherAffectedGeoresources = function () { - $scope.affectedGeoresources = []; - - kommonitorDataExchangeService.availableGeoresources.forEach(function (georesource) { - var allowedRoles = georesource.allowedRoles; - - for (const datasetToDelete of $scope.elementsToDelete) { - if (allowedRoles.includes(datasetToDelete.organizationalUnitId)) { - $scope.affectedGeoresources.push(georesource); - break; - } - } - }); - - return $scope.affectedGeoresources; - }; - - $scope.gatherAffectedIndicators = function () { - $scope.affectedIndicators = []; - - kommonitorDataExchangeService.availableIndicators.forEach(function (indicator) { - var allowedRoles_metadata = indicator.allowedRoles; - - for (const datasetToDelete of $scope.elementsToDelete) { - if (allowedRoles_metadata.includes(datasetToDelete.organizationalUnitId)) { - $scope.affectedIndicators.push(indicator); - break; - } - - var applicableSpatialUnits = indicator.applicableSpatialUnits; - for (const applicableSpatialUnit of applicableSpatialUnits) { - if (applicableSpatialUnit.allowedRoles.includes(datasetToDelete.organizationalUnitId)) { - $scope.affectedIndicators.push(indicator); - break; - } - } - } - }); - - return $scope.affectedIndicators; - }; - - $scope.deleteRoles = function () { - - $scope.loadingData = true; - - var deletePromises = []; - - $scope.elementsToDelete.forEach(function (dataset) { - deletePromises.push($scope.getDeleteDatasetPromise(dataset)); - }); - - $q.all(deletePromises).then(async function successCallback(successArray) { - // - - if ($scope.failedDatasetsAndErrors.length > 0) { - // error handling - $("#rolesDeleteErrorAlert").show(); - - $timeout(function(){ - - $scope.loadingData = false; - }); - } - if ($scope.successfullyDeletedDatasets.length > 0) { - $("#rolesDeleteSuccessAlert").show(); - - // fetch mMetada again as roles were deleted - - await kommonitorDataExchangeService.fetchAccessControlMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles); - // refresh role overview table - $rootScope.$broadcast("refreshAccessControlTable", "delete", $scope.successfullyDeletedDatasets.map(dataset => dataset.organizationalUnitId)); - - // refresh all admin dashboard diagrams due to modified metadata - $rootScope.$broadcast("refreshAdminDashboardDiagrams"); - - $timeout(function(){ - - $scope.loadingData = false; - }); - } - }, function errorCallback(errorArray) { - - $("#rolesDeleteErrorAlert").show(); - // if ($scope.successfullyDeletedDatasets.length > 0){ - // $("#georesourcesDeleteSuccessAlert").show(); - // } - - $rootScope.$broadcast("refreshAccessControlTable"); - $scope.loadingData = false; - }); - - }; - - $scope.getDeleteDatasetPromise = function (dataset) { - return $http({ - url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/organizationalUnits/" + dataset.organizationalUnitId, - method: "DELETE" - }).then(function successCallback(response) { - $scope.successfullyDeletedDatasets.push(dataset); - - // remove entry from array - var index = -1; - - for (var i = 0; i < kommonitorDataExchangeService.availableRoles.length; i++) { - if (kommonitorDataExchangeService.availableRoles[i].organizationalUnitId === dataset.organizationalUnitId) { - index = i; - break; - } - } - - if (index > -1) { - kommonitorDataExchangeService.availableRoles.splice(index, 1); - } - - // delete role in keycloak - if($scope.deleteCorrespondingKeycloakRole){ - $scope.tryDeleteKeycloakRole(dataset); - } - - }, function errorCallback(error) { - if (error.data) { - $scope.failedDatasetsAndErrors.push([dataset, kommonitorDataExchangeService.syntaxHighlightJSON(error.data)]); - } - else { - $scope.failedDatasetsAndErrors.push([dataset, kommonitorDataExchangeService.syntaxHighlightJSON(error)]); - } - }); - }; - - $scope.tryDeleteKeycloakRole = async function(roleMetadata){ - try { - kommonitorKeycloakHelperService.deleteRoles(roleMetadata.name); - await kommonitorKeycloakHelperService.fetchAndSetKeycloakRoles(); - } catch (error) { - if (error.data) { - $scope.failedDatasetsAndErrors.push([dataset, kommonitorDataExchangeService.syntaxHighlightJSON(error.data)]); - } - else { - $scope.failedDatasetsAndErrors.push([dataset, kommonitorDataExchangeService.syntaxHighlightJSON(error)]); - } - } - }; - - $scope.hideSuccessAlert = function () { - $("#rolesDeleteSuccessAlert").hide(); - }; - - $scope.hideErrorAlert = function () { - $("#rolesDeleteErrorAlert").hide(); - }; - - } - ] + templateUrl: "components/kommonitorAdmin/adminRoleManagement/roleDeleteModal/role-delete-modal.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorKeycloakHelperService', '$scope', '$rootScope', '$http', '__env', '$q', '$timeout', function RoleDeleteModalController(kommonitorDataExchangeService, kommonitorKeycloakHelperService, $scope, $rootScope, $http, __env, $q, $timeout) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorKeycloakHelperServiceInstance = kommonitorKeycloakHelperService; + $scope.elementsToDelete = []; + $scope.loadingData = false; + $scope.successfullyDeletedDatasets = []; + $scope.failedDatasetsAndErrors = []; + $scope.deleteCorrespondingKeycloakRole = false; + $scope.affectedSpatialUnits = []; + $scope.affectedGeoresources = []; + $scope.affectedIndicators = []; + $scope.$on("onDeleteOrganizationalUnit", function (event, datasets) { + $scope.resetRolesDeleteForm(); + const original_size = datasets.length; + datasets = datasets.filter(org => org.name != "public" && org.name != "kommonitor"); + if (datasets.length < original_size) { + $scope.failedDatasetsAndErrors.push([{ "name": "public / kommonitor" }, "System Organisationseinheiten können nicht gelöscht werden! Die betroffene Einheit wurde aus der Liste entfernt."]); + $("#rolesDeleteErrorAlert").show(); + } + $scope.elementsToDelete = datasets; + }); + $scope.resetRolesDeleteForm = function () { + $scope.successfullyDeletedDatasets = []; + $scope.failedDatasetsAndErrors = []; + $scope.affectedSpatialUnits = $scope.gatherAffectedSpatialUnits(); + $scope.affectedGeoresources = $scope.gatherAffectedGeoresources(); + $scope.affectedIndicators = $scope.gatherAffectedIndicators(); + $("#rolesDeleteSuccessAlert").hide(); + $("#rolesDeleteErrorAlert").hide(); + }; + $scope.gatherAffectedSpatialUnits = function () { + $scope.affectedSpatialUnits = []; + kommonitorDataExchangeService.availableSpatialUnits.forEach(function (spatialUnit) { + var allowedRoles = spatialUnit.allowedRoles; + for (const datasetToDelete of $scope.elementsToDelete) { + if (allowedRoles.includes(datasetToDelete.organizationalUnitId)) { + $scope.affectedSpatialUnits.push(spatialUnit); + break; + } + } + }); + return $scope.affectedSpatialUnits; + }; + $scope.gatherAffectedGeoresources = function () { + $scope.affectedGeoresources = []; + kommonitorDataExchangeService.availableGeoresources.forEach(function (georesource) { + var allowedRoles = georesource.allowedRoles; + for (const datasetToDelete of $scope.elementsToDelete) { + if (allowedRoles.includes(datasetToDelete.organizationalUnitId)) { + $scope.affectedGeoresources.push(georesource); + break; + } + } + }); + return $scope.affectedGeoresources; + }; + $scope.gatherAffectedIndicators = function () { + $scope.affectedIndicators = []; + kommonitorDataExchangeService.availableIndicators.forEach(function (indicator) { + var allowedRoles_metadata = indicator.allowedRoles; + for (const datasetToDelete of $scope.elementsToDelete) { + if (allowedRoles_metadata.includes(datasetToDelete.organizationalUnitId)) { + $scope.affectedIndicators.push(indicator); + break; + } + var applicableSpatialUnits = indicator.applicableSpatialUnits; + for (const applicableSpatialUnit of applicableSpatialUnits) { + if (applicableSpatialUnit.allowedRoles.includes(datasetToDelete.organizationalUnitId)) { + $scope.affectedIndicators.push(indicator); + break; + } + } + } + }); + return $scope.affectedIndicators; + }; + $scope.deleteRoles = function () { + $scope.loadingData = true; + var deletePromises = []; + $scope.elementsToDelete.forEach(function (dataset) { + deletePromises.push($scope.getDeleteDatasetPromise(dataset)); + }); + $q.all(deletePromises).then(async function successCallback(successArray) { + // + if ($scope.failedDatasetsAndErrors.length > 0) { + // error handling + $("#rolesDeleteErrorAlert").show(); + $timeout(function () { + $scope.loadingData = false; + }); + } + if ($scope.successfullyDeletedDatasets.length > 0) { + $("#rolesDeleteSuccessAlert").show(); + // fetch mMetada again as roles were deleted + await kommonitorDataExchangeService.fetchAccessControlMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles); + // refresh role overview table + $rootScope.$broadcast("refreshAccessControlTable", "delete", $scope.successfullyDeletedDatasets.map(dataset => dataset.organizationalUnitId)); + // refresh all admin dashboard diagrams due to modified metadata + $rootScope.$broadcast("refreshAdminDashboardDiagrams"); + $timeout(function () { + $scope.loadingData = false; + }); + } + }, function errorCallback(errorArray) { + $("#rolesDeleteErrorAlert").show(); + // if ($scope.successfullyDeletedDatasets.length > 0){ + // $("#georesourcesDeleteSuccessAlert").show(); + // } + $rootScope.$broadcast("refreshAccessControlTable"); + $scope.loadingData = false; + }); + }; + $scope.getDeleteDatasetPromise = function (dataset) { + return $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/organizationalUnits/" + dataset.organizationalUnitId, + method: "DELETE" + }).then(function successCallback(response) { + $scope.successfullyDeletedDatasets.push(dataset); + // remove entry from array + var index = -1; + for (var i = 0; i < kommonitorDataExchangeService.availableRoles.length; i++) { + if (kommonitorDataExchangeService.availableRoles[i].organizationalUnitId === dataset.organizationalUnitId) { + index = i; + break; + } + } + if (index > -1) { + kommonitorDataExchangeService.availableRoles.splice(index, 1); + } + // delete role in keycloak + if ($scope.deleteCorrespondingKeycloakRole) { + $scope.tryDeleteKeycloakRole(dataset); + } + }, function errorCallback(error) { + if (error.data) { + $scope.failedDatasetsAndErrors.push([dataset, kommonitorDataExchangeService.syntaxHighlightJSON(error.data)]); + } + else { + $scope.failedDatasetsAndErrors.push([dataset, kommonitorDataExchangeService.syntaxHighlightJSON(error)]); + } + }); + }; + $scope.tryDeleteKeycloakRole = async function (roleMetadata) { + try { + kommonitorKeycloakHelperService.deleteRoles(roleMetadata.name); + await kommonitorKeycloakHelperService.fetchAndSetKeycloakRoles(); + } + catch (error) { + if (error.data) { + $scope.failedDatasetsAndErrors.push([dataset, kommonitorDataExchangeService.syntaxHighlightJSON(error.data)]); + } + else { + $scope.failedDatasetsAndErrors.push([dataset, kommonitorDataExchangeService.syntaxHighlightJSON(error)]); + } + } + }; + $scope.hideSuccessAlert = function () { + $("#rolesDeleteSuccessAlert").hide(); + }; + $scope.hideErrorAlert = function () { + $("#rolesDeleteErrorAlert").hide(); + }; + } + ] }); +//# sourceMappingURL=role-delete-modal.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminRoleManagement/roleDeleteModal/role-delete-modal.component.js.map b/app/components/kommonitorAdmin/adminRoleManagement/roleDeleteModal/role-delete-modal.component.js.map new file mode 100644 index 000000000..82ae0734d --- /dev/null +++ b/app/components/kommonitorAdmin/adminRoleManagement/roleDeleteModal/role-delete-modal.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"role-delete-modal.component.js","sourceRoot":"","sources":["role-delete-modal.component.ts"],"names":[],"mappings":";AAAA,OAAO,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AC,CAAC;qBAC9G;yBACI;wBACJ,MAAM,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,6BAA6B,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;qBACzG;gBACF,CAAC,CAAC,CAAC;YACJ,CAAC,CAAC;YAEF,MAAM,CAAC,qBAAqB,GAAG,KAAK,WAAU,YAAY;gBACzD,IAAI;oBACH,+BAA+B,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;oBAC/D,MAAM,+BAA+B,CAAC,wBAAwB,EAAE,CAAC;iBACjE;gBAAC,OAAO,KAAK,EAAE;oBACf,IAAI,KAAK,CAAC,IAAI,EAAE;wBACf,MAAM,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,6BAA6B,CAAC,mBAAmB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;qBAC9G;yBACI;wBACJ,MAAM,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,6BAA6B,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;qBACzG;iBACD;YACF,CAAC,CAAC;YAEF,MAAM,CAAC,gBAAgB,GAAG;gBACzB,CAAC,CAAC,0BAA0B,CAAC,CAAC,IAAI,EAAE,CAAC;YACtC,CAAC,CAAC;YAEF,MAAM,CAAC,cAAc,GAAG;gBACvB,CAAC,CAAC,wBAAwB,CAAC,CAAC,IAAI,EAAE,CAAC;YACpC,CAAC,CAAC;QAEH,CAAC;KACA;CACD,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminRoleManagement/roleDeleteModal/role-delete-modal.component.ts b/app/components/kommonitorAdmin/adminRoleManagement/roleDeleteModal/role-delete-modal.component.ts new file mode 100644 index 000000000..0aef96685 --- /dev/null +++ b/app/components/kommonitorAdmin/adminRoleManagement/roleDeleteModal/role-delete-modal.component.ts @@ -0,0 +1,215 @@ +angular.module('roleDeleteModal').component('roleDeleteModal', { + templateUrl: "components/kommonitorAdmin/adminRoleManagement/roleDeleteModal/role-delete-modal.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorKeycloakHelperService', '$scope', '$rootScope', '$http', '__env', '$q', '$timeout', function RoleDeleteModalController(kommonitorDataExchangeService, kommonitorKeycloakHelperService, $scope, $rootScope, $http, __env, $q, $timeout) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorKeycloakHelperServiceInstance = kommonitorKeycloakHelperService; + + $scope.elementsToDelete = []; + + $scope.loadingData = false; + + $scope.successfullyDeletedDatasets = []; + $scope.failedDatasetsAndErrors = []; + + $scope.deleteCorrespondingKeycloakRole = false; + + $scope.affectedSpatialUnits = []; + $scope.affectedGeoresources = []; + $scope.affectedIndicators = []; + + $scope.$on("onDeleteOrganizationalUnit", function (event, datasets) { + $scope.resetRolesDeleteForm(); + const original_size = datasets.length; + datasets = datasets.filter(org => org.name != "public" && org.name != "kommonitor") + if (datasets.length < original_size) { + $scope.failedDatasetsAndErrors.push([{"name": "public / kommonitor"}, "System Organisationseinheiten können nicht gelöscht werden! Die betroffene Einheit wurde aus der Liste entfernt."]); + $("#rolesDeleteErrorAlert").show(); + } + $scope.elementsToDelete = datasets; + }); + + + $scope.resetRolesDeleteForm = function () { + + $scope.successfullyDeletedDatasets = []; + $scope.failedDatasetsAndErrors = []; + $scope.affectedSpatialUnits = $scope.gatherAffectedSpatialUnits(); + $scope.affectedGeoresources = $scope.gatherAffectedGeoresources(); + $scope.affectedIndicators = $scope.gatherAffectedIndicators(); + $("#rolesDeleteSuccessAlert").hide(); + $("#rolesDeleteErrorAlert").hide(); + }; + + $scope.gatherAffectedSpatialUnits = function () { + $scope.affectedSpatialUnits = []; + + kommonitorDataExchangeService.availableSpatialUnits.forEach(function (spatialUnit) { + var allowedRoles = spatialUnit.allowedRoles; + + for (const datasetToDelete of $scope.elementsToDelete) { + if (allowedRoles.includes(datasetToDelete.organizationalUnitId)) { + $scope.affectedSpatialUnits.push(spatialUnit); + break; + } + } + }); + + return $scope.affectedSpatialUnits; + }; + + $scope.gatherAffectedGeoresources = function () { + $scope.affectedGeoresources = []; + + kommonitorDataExchangeService.availableGeoresources.forEach(function (georesource) { + var allowedRoles = georesource.allowedRoles; + + for (const datasetToDelete of $scope.elementsToDelete) { + if (allowedRoles.includes(datasetToDelete.organizationalUnitId)) { + $scope.affectedGeoresources.push(georesource); + break; + } + } + }); + + return $scope.affectedGeoresources; + }; + + $scope.gatherAffectedIndicators = function () { + $scope.affectedIndicators = []; + + kommonitorDataExchangeService.availableIndicators.forEach(function (indicator) { + var allowedRoles_metadata = indicator.allowedRoles; + + for (const datasetToDelete of $scope.elementsToDelete) { + if (allowedRoles_metadata.includes(datasetToDelete.organizationalUnitId)) { + $scope.affectedIndicators.push(indicator); + break; + } + + var applicableSpatialUnits = indicator.applicableSpatialUnits; + for (const applicableSpatialUnit of applicableSpatialUnits) { + if (applicableSpatialUnit.allowedRoles.includes(datasetToDelete.organizationalUnitId)) { + $scope.affectedIndicators.push(indicator); + break; + } + } + } + }); + + return $scope.affectedIndicators; + }; + + $scope.deleteRoles = function () { + + $scope.loadingData = true; + + var deletePromises = []; + + $scope.elementsToDelete.forEach(function (dataset) { + deletePromises.push($scope.getDeleteDatasetPromise(dataset)); + }); + + $q.all(deletePromises).then(async function successCallback(successArray) { + // + + if ($scope.failedDatasetsAndErrors.length > 0) { + // error handling + $("#rolesDeleteErrorAlert").show(); + + $timeout(function(){ + + $scope.loadingData = false; + }); + } + if ($scope.successfullyDeletedDatasets.length > 0) { + $("#rolesDeleteSuccessAlert").show(); + + // fetch mMetada again as roles were deleted + + await kommonitorDataExchangeService.fetchAccessControlMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles); + // refresh role overview table + $rootScope.$broadcast("refreshAccessControlTable", "delete", $scope.successfullyDeletedDatasets.map(dataset => dataset.organizationalUnitId)); + + // refresh all admin dashboard diagrams due to modified metadata + $rootScope.$broadcast("refreshAdminDashboardDiagrams"); + + $timeout(function(){ + + $scope.loadingData = false; + }); + } + }, function errorCallback(errorArray) { + + $("#rolesDeleteErrorAlert").show(); + // if ($scope.successfullyDeletedDatasets.length > 0){ + // $("#georesourcesDeleteSuccessAlert").show(); + // } + + $rootScope.$broadcast("refreshAccessControlTable"); + $scope.loadingData = false; + }); + + }; + + $scope.getDeleteDatasetPromise = function (dataset) { + return $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/organizationalUnits/" + dataset.organizationalUnitId, + method: "DELETE" + }).then(function successCallback(response) { + $scope.successfullyDeletedDatasets.push(dataset); + + // remove entry from array + var index = -1; + + for (var i = 0; i < kommonitorDataExchangeService.availableRoles.length; i++) { + if (kommonitorDataExchangeService.availableRoles[i].organizationalUnitId === dataset.organizationalUnitId) { + index = i; + break; + } + } + + if (index > -1) { + kommonitorDataExchangeService.availableRoles.splice(index, 1); + } + + // delete role in keycloak + if($scope.deleteCorrespondingKeycloakRole){ + $scope.tryDeleteKeycloakRole(dataset); + } + + }, function errorCallback(error) { + if (error.data) { + $scope.failedDatasetsAndErrors.push([dataset, kommonitorDataExchangeService.syntaxHighlightJSON(error.data)]); + } + else { + $scope.failedDatasetsAndErrors.push([dataset, kommonitorDataExchangeService.syntaxHighlightJSON(error)]); + } + }); + }; + + $scope.tryDeleteKeycloakRole = async function(roleMetadata){ + try { + kommonitorKeycloakHelperService.deleteRoles(roleMetadata.name); + await kommonitorKeycloakHelperService.fetchAndSetKeycloakRoles(); + } catch (error) { + if (error.data) { + $scope.failedDatasetsAndErrors.push([dataset, kommonitorDataExchangeService.syntaxHighlightJSON(error.data)]); + } + else { + $scope.failedDatasetsAndErrors.push([dataset, kommonitorDataExchangeService.syntaxHighlightJSON(error)]); + } + } + }; + + $scope.hideSuccessAlert = function () { + $("#rolesDeleteSuccessAlert").hide(); + }; + + $scope.hideErrorAlert = function () { + $("#rolesDeleteErrorAlert").hide(); + }; + + } + ] +}); diff --git a/app/components/kommonitorAdmin/adminRoleManagement/roleDeleteModal/role-delete-modal.module.js b/app/components/kommonitorAdmin/adminRoleManagement/roleDeleteModal/role-delete-modal.module.js index 392448e6f..5551e3055 100644 --- a/app/components/kommonitorAdmin/adminRoleManagement/roleDeleteModal/role-delete-modal.module.js +++ b/app/components/kommonitorAdmin/adminRoleManagement/roleDeleteModal/role-delete-modal.module.js @@ -1,7 +1,8 @@ +"use strict"; angular.module('roleDeleteModal', ['kommonitorDataExchange', 'kommonitorKeycloakHelper']); - -angular.module('roleDeleteModal').filter('formatJson', ['kommonitorDataExchangeService', function(kommonitorDataExchangeService){ - return function(json){ - return kommonitorDataExchangeService.syntaxHighlightJSON(json); - }; -}]); +angular.module('roleDeleteModal').filter('formatJson', ['kommonitorDataExchangeService', function (kommonitorDataExchangeService) { + return function (json) { + return kommonitorDataExchangeService.syntaxHighlightJSON(json); + }; + }]); +//# sourceMappingURL=role-delete-modal.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminRoleManagement/roleDeleteModal/role-delete-modal.module.js.map b/app/components/kommonitorAdmin/adminRoleManagement/roleDeleteModal/role-delete-modal.module.js.map new file mode 100644 index 000000000..f5ee6d6aa --- /dev/null +++ b/app/components/kommonitorAdmin/adminRoleManagement/roleDeleteModal/role-delete-modal.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"role-delete-modal.module.js","sourceRoot":"","sources":["role-delete-modal.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC,wBAAwB,EAAE,0BAA0B,CAAC,CAAC,CAAC;AAE1F,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,+BAA+B,EAAE,UAAS,6BAA6B;QAC3H,OAAO,UAAS,IAAI;YAChB,OAAO,6BAA6B,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;QACnE,CAAC,CAAC;IACN,CAAC,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminRoleManagement/roleDeleteModal/role-delete-modal.module.ts b/app/components/kommonitorAdmin/adminRoleManagement/roleDeleteModal/role-delete-modal.module.ts new file mode 100644 index 000000000..392448e6f --- /dev/null +++ b/app/components/kommonitorAdmin/adminRoleManagement/roleDeleteModal/role-delete-modal.module.ts @@ -0,0 +1,7 @@ +angular.module('roleDeleteModal', ['kommonitorDataExchange', 'kommonitorKeycloakHelper']); + +angular.module('roleDeleteModal').filter('formatJson', ['kommonitorDataExchangeService', function(kommonitorDataExchangeService){ + return function(json){ + return kommonitorDataExchangeService.syntaxHighlightJSON(json); + }; +}]); diff --git a/app/components/kommonitorAdmin/adminRoleManagement/roleEditMetadataModal/role-edit-metadata-modal.component.js b/app/components/kommonitorAdmin/adminRoleManagement/roleEditMetadataModal/role-edit-metadata-modal.component.js index 6e575d7dc..c90b5485d 100644 --- a/app/components/kommonitorAdmin/adminRoleManagement/roleEditMetadataModal/role-edit-metadata-modal.component.js +++ b/app/components/kommonitorAdmin/adminRoleManagement/roleEditMetadataModal/role-edit-metadata-modal.component.js @@ -1,134 +1,105 @@ +"use strict"; angular.module('roleEditMetadataModal').component('roleEditMetadataModal', { - templateUrl: "components/kommonitorAdmin/adminRoleManagement/roleEditMetadataModal/role-edit-metadata-modal.template.html", - controller: ['kommonitorDataExchangeService', 'kommonitorKeycloakHelperService', '$scope', '$rootScope', '$timeout', '$http', '__env', function RoleEditMetadataModalController(kommonitorDataExchangeService, kommonitorKeycloakHelperService, $scope, $rootScope, $timeout, $http, __env) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorKeycloakHelperServiceInstance = kommonitorKeycloakHelperService; - - $scope.current = {}; - $scope.old = {}; - $scope.old.name = undefined; - $scope.nameInvalid = false; - - $scope.loadingData = false; - - $scope.successMessagePart = undefined; - $scope.errorMessagePart = undefined; - - $scope.$on("onEditRoleMetadata", function (event, organizationalUnit) { - - $scope.current = organizationalUnit; - $scope.old.name = organizationalUnit.name; - - $scope.resetRoleEditMetadataForm(); - }); - - // Checks for duplicate names - // Disallowed to prevent confusion - $scope.checkRoleName = function(){ - $scope.nameInvalid = false; - kommonitorDataExchangeService.accessControl.forEach(function(ou){ - if (ou.name === $scope.current.name && ou.organizationalUnitId != $scope.current.organizationalUnitId){ - $scope.nameInvalid = true; - return; - } - }); - }; - - - $scope.resetRoleEditMetadataForm = function () { - - $scope.successMessagePart = undefined; - $scope.errorMessagePart = undefined; - - $("#editMetadataSuccessAlert").hide(); - $("#editMetadataErrorAlert").hide(); - - setTimeout(() => { - $scope.$digest(); - }, 250); - }; - - $scope.editRoleMetadata = function () { - - var putBody = - { - "name": $scope.current.name, - "description": $scope.current.description, - "contact": $scope.current.contact - }; - - $scope.loadingData = true; - $http({ - url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/organizationalUnits/" + $scope.current.organizationalUnitId, - method: "PUT", - data: putBody - }).then(async function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - $scope.successMessagePart = $scope.current.name; - - $("#editMetadataSuccessAlert").show(); - $timeout(function(){ - - $scope.loadingData = false; - }); - - try { - await kommonitorKeycloakHelperService.renameExistingRoles($scope.old.name, $scope.current.name); - // on successful update within keycloak explicitly set old name to current name - // otherwise subsequent edit requests will be erronous - $scope.old.name = $scope.current.name; - await kommonitorKeycloakHelperService.fetchAndSetKeycloakRoles(); - $("#keycloakRoleEditSuccessAlert").show(); - } catch (error) { - if (error.data) { - $scope.keycloakErrorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else { - $scope.keycloakErrorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - - $timeout(function(){ - $("#keycloakRoleEditErrorAlert").show(); - $scope.loadingData = false; - }); - } - - $rootScope.$broadcast("refreshAccessControlTable", "edit", $scope.current.organizationalUnitId); - - }, function errorCallback(error) { - if (error.data) { - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else { - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - - $("#editMetadataErrorAlert").show(); - $scope.loadingData = false; - }); - }; - - - $scope.hideSuccessAlert = function () { - $("#editMetadataSuccessAlert").hide(); - }; - - $scope.hideErrorAlert = function () { - $("#editMetadataErrorAlert").hide(); - }; - - $scope.hideKeycloakSuccessAlert = function () { - $("#keycloakRoleEditSuccessAlert").hide(); - }; - - $scope.hideKeycloakErrorAlert = function () { - $("#keycloakRoleEditErrorAlert").hide(); - }; - - - } - ] + templateUrl: "components/kommonitorAdmin/adminRoleManagement/roleEditMetadataModal/role-edit-metadata-modal.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorKeycloakHelperService', '$scope', '$rootScope', '$timeout', '$http', '__env', function RoleEditMetadataModalController(kommonitorDataExchangeService, kommonitorKeycloakHelperService, $scope, $rootScope, $timeout, $http, __env) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorKeycloakHelperServiceInstance = kommonitorKeycloakHelperService; + $scope.current = {}; + $scope.old = {}; + $scope.old.name = undefined; + $scope.nameInvalid = false; + $scope.loadingData = false; + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + $scope.$on("onEditRoleMetadata", function (event, organizationalUnit) { + $scope.current = organizationalUnit; + $scope.old.name = organizationalUnit.name; + $scope.resetRoleEditMetadataForm(); + }); + // Checks for duplicate names + // Disallowed to prevent confusion + $scope.checkRoleName = function () { + $scope.nameInvalid = false; + kommonitorDataExchangeService.accessControl.forEach(function (ou) { + if (ou.name === $scope.current.name && ou.organizationalUnitId != $scope.current.organizationalUnitId) { + $scope.nameInvalid = true; + return; + } + }); + }; + $scope.resetRoleEditMetadataForm = function () { + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + $("#editMetadataSuccessAlert").hide(); + $("#editMetadataErrorAlert").hide(); + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.editRoleMetadata = function () { + var putBody = { + "name": $scope.current.name, + "description": $scope.current.description, + "contact": $scope.current.contact + }; + $scope.loadingData = true; + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/organizationalUnits/" + $scope.current.organizationalUnitId, + method: "PUT", + data: putBody + }).then(async function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + $scope.successMessagePart = $scope.current.name; + $("#editMetadataSuccessAlert").show(); + $timeout(function () { + $scope.loadingData = false; + }); + try { + await kommonitorKeycloakHelperService.renameExistingRoles($scope.old.name, $scope.current.name); + // on successful update within keycloak explicitly set old name to current name + // otherwise subsequent edit requests will be erronous + $scope.old.name = $scope.current.name; + await kommonitorKeycloakHelperService.fetchAndSetKeycloakRoles(); + $("#keycloakRoleEditSuccessAlert").show(); + } + catch (error) { + if (error.data) { + $scope.keycloakErrorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.keycloakErrorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + $timeout(function () { + $("#keycloakRoleEditErrorAlert").show(); + $scope.loadingData = false; + }); + } + $rootScope.$broadcast("refreshAccessControlTable", "edit", $scope.current.organizationalUnitId); + }, function errorCallback(error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + $("#editMetadataErrorAlert").show(); + $scope.loadingData = false; + }); + }; + $scope.hideSuccessAlert = function () { + $("#editMetadataSuccessAlert").hide(); + }; + $scope.hideErrorAlert = function () { + $("#editMetadataErrorAlert").hide(); + }; + $scope.hideKeycloakSuccessAlert = function () { + $("#keycloakRoleEditSuccessAlert").hide(); + }; + $scope.hideKeycloakErrorAlert = function () { + $("#keycloakRoleEditErrorAlert").hide(); + }; + } + ] }); +//# sourceMappingURL=role-edit-metadata-modal.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminRoleManagement/roleEditMetadataModal/role-edit-metadata-modal.component.js.map b/app/components/kommonitorAdmin/adminRoleManagement/roleEditMetadataModal/role-edit-metadata-modal.component.js.map new file mode 100644 index 000000000..ecb5e67c8 --- /dev/null +++ b/app/components/kommonitorAdmin/adminRoleManagement/roleEditMetadataModal/role-edit-metadata-modal.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"role-edit-metadata-modal.component.js","sourceRoot":"","sources":["role-edit-metadata-modal.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,SAAS,CAAC,uBAAuB,EAAE;IAC1E,WAAW,EAAE,6GAA6G;IAC1H,UAAU,EAAE,CAAC,+BAA+B,EAAE,iCAAiC,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,+BAA+B,CAAC,6BAA6B,EAAE,+BAA+B,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK;YAEzR,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAC3E,IAAI,CAAC,uCAAuC,GAAG,+BAA+B,CAAC;YAE/E,MAAM,CAAC,OAAO,GAAG,EAAE,CAAC;YACpB,MAAM,CAAC,GAAG,GAAG,EAAE,CAAC;YAChB,MAAM,CAAC,GAAG,CAAC,IAAI,GAAG,SAAS,CAAC;YAC5B,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;YAE3B,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;YAE3B,MAAM,CAAC,kBAAkB,GAAG,SAAS,CAAC;YACtC,MAAM,CAAC,gBAAgB,GAAG,SAAS,CAAC;YAEpC,MAAM,CAAC,GAAG,CAAC,oBAAoB,EAAE,UAAU,KAAK,EAAE,kBAAkB;gBAEnE,MAAM,CAAC,OAAO,GAAG,kBAAkB,CAAC;gBACpC,MAAM,CAAC,GAAG,CAAC,IAAI,GAAG,kBAAkB,CAAC,IAAI,CAAC;gBAE1C,MAAM,CAAC,yBAAyB,EAAE,CAAC;Y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K,CAAC,IAAI,EAAE;wBACf,MAAM,CAAC,gBAAgB,GAAG,6BAA6B,CAAC,mBAAmB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;qBACxF;yBACI;wBACJ,MAAM,CAAC,gBAAgB,GAAG,6BAA6B,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;qBACnF;oBAED,CAAC,CAAC,yBAAyB,CAAC,CAAC,IAAI,EAAE,CAAC;oBACpC,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;gBAC5B,CAAC,CAAC,CAAC;YACJ,CAAC,CAAC;YAGF,MAAM,CAAC,gBAAgB,GAAG;gBACzB,CAAC,CAAC,2BAA2B,CAAC,CAAC,IAAI,EAAE,CAAC;YACvC,CAAC,CAAC;YAEF,MAAM,CAAC,cAAc,GAAG;gBACvB,CAAC,CAAC,yBAAyB,CAAC,CAAC,IAAI,EAAE,CAAC;YACrC,CAAC,CAAC;YAEF,MAAM,CAAC,wBAAwB,GAAG;gBACjC,CAAC,CAAC,+BAA+B,CAAC,CAAC,IAAI,EAAE,CAAC;YAC3C,CAAC,CAAC;YAEF,MAAM,CAAC,sBAAsB,GAAG;gBAC/B,CAAC,CAAC,6BAA6B,CAAC,CAAC,IAAI,EAAE,CAAC;YACzC,CAAC,CAAC;QAGH,CAAC;KACA;CACD,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminRoleManagement/roleEditMetadataModal/role-edit-metadata-modal.component.ts b/app/components/kommonitorAdmin/adminRoleManagement/roleEditMetadataModal/role-edit-metadata-modal.component.ts new file mode 100644 index 000000000..6e575d7dc --- /dev/null +++ b/app/components/kommonitorAdmin/adminRoleManagement/roleEditMetadataModal/role-edit-metadata-modal.component.ts @@ -0,0 +1,134 @@ +angular.module('roleEditMetadataModal').component('roleEditMetadataModal', { + templateUrl: "components/kommonitorAdmin/adminRoleManagement/roleEditMetadataModal/role-edit-metadata-modal.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorKeycloakHelperService', '$scope', '$rootScope', '$timeout', '$http', '__env', function RoleEditMetadataModalController(kommonitorDataExchangeService, kommonitorKeycloakHelperService, $scope, $rootScope, $timeout, $http, __env) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorKeycloakHelperServiceInstance = kommonitorKeycloakHelperService; + + $scope.current = {}; + $scope.old = {}; + $scope.old.name = undefined; + $scope.nameInvalid = false; + + $scope.loadingData = false; + + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + + $scope.$on("onEditRoleMetadata", function (event, organizationalUnit) { + + $scope.current = organizationalUnit; + $scope.old.name = organizationalUnit.name; + + $scope.resetRoleEditMetadataForm(); + }); + + // Checks for duplicate names + // Disallowed to prevent confusion + $scope.checkRoleName = function(){ + $scope.nameInvalid = false; + kommonitorDataExchangeService.accessControl.forEach(function(ou){ + if (ou.name === $scope.current.name && ou.organizationalUnitId != $scope.current.organizationalUnitId){ + $scope.nameInvalid = true; + return; + } + }); + }; + + + $scope.resetRoleEditMetadataForm = function () { + + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + + $("#editMetadataSuccessAlert").hide(); + $("#editMetadataErrorAlert").hide(); + + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + + $scope.editRoleMetadata = function () { + + var putBody = + { + "name": $scope.current.name, + "description": $scope.current.description, + "contact": $scope.current.contact + }; + + $scope.loadingData = true; + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/organizationalUnits/" + $scope.current.organizationalUnitId, + method: "PUT", + data: putBody + }).then(async function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + $scope.successMessagePart = $scope.current.name; + + $("#editMetadataSuccessAlert").show(); + $timeout(function(){ + + $scope.loadingData = false; + }); + + try { + await kommonitorKeycloakHelperService.renameExistingRoles($scope.old.name, $scope.current.name); + // on successful update within keycloak explicitly set old name to current name + // otherwise subsequent edit requests will be erronous + $scope.old.name = $scope.current.name; + await kommonitorKeycloakHelperService.fetchAndSetKeycloakRoles(); + $("#keycloakRoleEditSuccessAlert").show(); + } catch (error) { + if (error.data) { + $scope.keycloakErrorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.keycloakErrorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + + $timeout(function(){ + $("#keycloakRoleEditErrorAlert").show(); + $scope.loadingData = false; + }); + } + + $rootScope.$broadcast("refreshAccessControlTable", "edit", $scope.current.organizationalUnitId); + + }, function errorCallback(error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + + $("#editMetadataErrorAlert").show(); + $scope.loadingData = false; + }); + }; + + + $scope.hideSuccessAlert = function () { + $("#editMetadataSuccessAlert").hide(); + }; + + $scope.hideErrorAlert = function () { + $("#editMetadataErrorAlert").hide(); + }; + + $scope.hideKeycloakSuccessAlert = function () { + $("#keycloakRoleEditSuccessAlert").hide(); + }; + + $scope.hideKeycloakErrorAlert = function () { + $("#keycloakRoleEditErrorAlert").hide(); + }; + + + } + ] +}); diff --git a/app/components/kommonitorAdmin/adminRoleManagement/roleEditMetadataModal/role-edit-metadata-modal.module.js b/app/components/kommonitorAdmin/adminRoleManagement/roleEditMetadataModal/role-edit-metadata-modal.module.js index 03ba32437..1b6feefc9 100644 --- a/app/components/kommonitorAdmin/adminRoleManagement/roleEditMetadataModal/role-edit-metadata-modal.module.js +++ b/app/components/kommonitorAdmin/adminRoleManagement/roleEditMetadataModal/role-edit-metadata-modal.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('roleEditMetadataModal', ['kommonitorKeycloakHelper']); +//# sourceMappingURL=role-edit-metadata-modal.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminRoleManagement/roleEditMetadataModal/role-edit-metadata-modal.module.js.map b/app/components/kommonitorAdmin/adminRoleManagement/roleEditMetadataModal/role-edit-metadata-modal.module.js.map new file mode 100644 index 000000000..144fd9cec --- /dev/null +++ b/app/components/kommonitorAdmin/adminRoleManagement/roleEditMetadataModal/role-edit-metadata-modal.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"role-edit-metadata-modal.module.js","sourceRoot":"","sources":["role-edit-metadata-modal.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,uBAAuB,EAAE,CAAC,0BAA0B,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminRoleManagement/roleEditMetadataModal/role-edit-metadata-modal.module.ts b/app/components/kommonitorAdmin/adminRoleManagement/roleEditMetadataModal/role-edit-metadata-modal.module.ts new file mode 100644 index 000000000..03ba32437 --- /dev/null +++ b/app/components/kommonitorAdmin/adminRoleManagement/roleEditMetadataModal/role-edit-metadata-modal.module.ts @@ -0,0 +1 @@ +angular.module('roleEditMetadataModal', ['kommonitorKeycloakHelper']); diff --git a/app/components/kommonitorAdmin/adminScriptExecution/admin-script-execution.component.js b/app/components/kommonitorAdmin/adminScriptExecution/admin-script-execution.component.js index 5941eb621..5423ed45a 100644 --- a/app/components/kommonitorAdmin/adminScriptExecution/admin-script-execution.component.js +++ b/app/components/kommonitorAdmin/adminScriptExecution/admin-script-execution.component.js @@ -1,137 +1,99 @@ +"use strict"; angular.module('adminScriptExecution').component('adminScriptExecution', { - templateUrl: "components/kommonitorAdmin/adminScriptExecution/admin-script-execution.template.html", - controller: ['kommonitorDataExchangeService', 'kommonitorDataGridHelperService', '$scope', '$rootScope', '__env', '$timeout', '$http', - function JobExecutionController(kommonitorDataExchangeService, kommonitorDataGridHelperService, $scope, $rootScope, __env, $timeout, $http) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - $scope.loadingData = true; - - $scope.availableDefaultComputationJobDatasets; - $scope.availableCustomizedComputationJobDatasets; - $scope.defaultComputationJobHealth; - $scope.customizedComputationJobHealth; - $scope.selectAllEntriesInput = false; - - $scope.fetchDefaultIndicatorJobs = function(){ - return $http({ - url: __env.targetUrlToProcessingEngine + "script-engine/defaultIndicatorComputation", - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - $scope.availableDefaultComputationJobDatasets = response.data; - - }); - }; - - $scope.fetchCustomizedIndicatorJobs = function(){ - return $http({ - url: __env.targetUrlToProcessingEngine + "script-engine/customizableIndicatorComputation", - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - $scope.availableCustomizedComputationJobDatasets = response.data; - - }); - }; - - $scope.fetchDefaultIndicatorJobHealth = function(){ - return $http({ - url: __env.targetUrlToProcessingEngine + "script-engine/defaultIndicatorComputation/health", - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - $scope.defaultComputationJobHealth = response.data; - - }); - }; - - $scope.fetchCustomizedIndicatorJobHealth = function(){ - return $http({ - url: __env.targetUrlToProcessingEngine + "script-engine/customizableIndicatorComputation/health", - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - $scope.customizedComputationJobHealth = response.data; - - }); - }; - - $scope.$on("initialMetadataLoadingCompleted", function (event) { - - - $timeout(async function () { - - await $scope.fetchDefaultIndicatorJobHealth(); - await $scope.fetchCustomizedIndicatorJobHealth(); - - await $scope.fetchDefaultIndicatorJobs(); - await $scope.fetchCustomizedIndicatorJobs(); - - $scope.initializeOrRefreshOverviewTable(); - }, 250); - - }); - - $scope.$on("initialMetadataLoadingFailed", function (event, errorArray) { - - $scope.loadingData = false; - - }); - - $scope.initializeOrRefreshOverviewTable = function () { - $scope.loadingData = true; - - kommonitorDataGridHelperService.buildDataGrid_defaultJobs($scope.availableDefaultComputationJobDatasets); - kommonitorDataGridHelperService.buildDataGrid_customizedJobs($scope.availableCustomizedComputationJobDatasets); - - $scope.loadingData = false; - }; - - $scope.$on("refreshJobOverviewTable", function (event) { - $scope.loadingData = true; - $scope.refreshJobOverviewTable(); - }); - - $scope.refreshJobOverviewTable = async function () { - - // refetch all metadata from spatial units to update table - await $scope.fetchDefaultIndicatorJobs(); - await $scope.fetchCustomizedIndicatorJobs(); - await $scope.fetchCustomizedIndicatorJobHealth(); - await $scope.fetchDefaultIndicatorJobHealth(); - - $scope.initializeOrRefreshOverviewTable(); - - $scope.loadingData = false; - - }; - - $scope.onClickDeleteDatasets = function () { - $scope.loadingData = true; - - let markedEntriesForDeletion = kommonitorDataGridHelperService.getSelectedDefaultJobsMetadata(); - - // submit selected spatial units to modal controller - $rootScope.$broadcast("onDeleteJobs", markedEntriesForDeletion); - - $scope.loadingData = false; - }; - - $scope.syntaxHighlightJSON = function(json){ - return kommonitorDataExchangeService.syntaxHighlightJSON(json); - }; - - } - ] + templateUrl: "components/kommonitorAdmin/adminScriptExecution/admin-script-execution.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorDataGridHelperService', '$scope', '$rootScope', '__env', '$timeout', '$http', + function JobExecutionController(kommonitorDataExchangeService, kommonitorDataGridHelperService, $scope, $rootScope, __env, $timeout, $http) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + $scope.loadingData = true; + $scope.availableDefaultComputationJobDatasets; + $scope.availableCustomizedComputationJobDatasets; + $scope.defaultComputationJobHealth; + $scope.customizedComputationJobHealth; + $scope.selectAllEntriesInput = false; + $scope.fetchDefaultIndicatorJobs = function () { + return $http({ + url: __env.targetUrlToProcessingEngine + "script-engine/defaultIndicatorComputation", + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + $scope.availableDefaultComputationJobDatasets = response.data; + }); + }; + $scope.fetchCustomizedIndicatorJobs = function () { + return $http({ + url: __env.targetUrlToProcessingEngine + "script-engine/customizableIndicatorComputation", + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + $scope.availableCustomizedComputationJobDatasets = response.data; + }); + }; + $scope.fetchDefaultIndicatorJobHealth = function () { + return $http({ + url: __env.targetUrlToProcessingEngine + "script-engine/defaultIndicatorComputation/health", + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + $scope.defaultComputationJobHealth = response.data; + }); + }; + $scope.fetchCustomizedIndicatorJobHealth = function () { + return $http({ + url: __env.targetUrlToProcessingEngine + "script-engine/customizableIndicatorComputation/health", + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + $scope.customizedComputationJobHealth = response.data; + }); + }; + $scope.$on("initialMetadataLoadingCompleted", function (event) { + $timeout(async function () { + await $scope.fetchDefaultIndicatorJobHealth(); + await $scope.fetchCustomizedIndicatorJobHealth(); + await $scope.fetchDefaultIndicatorJobs(); + await $scope.fetchCustomizedIndicatorJobs(); + $scope.initializeOrRefreshOverviewTable(); + }, 250); + }); + $scope.$on("initialMetadataLoadingFailed", function (event, errorArray) { + $scope.loadingData = false; + }); + $scope.initializeOrRefreshOverviewTable = function () { + $scope.loadingData = true; + kommonitorDataGridHelperService.buildDataGrid_defaultJobs($scope.availableDefaultComputationJobDatasets); + kommonitorDataGridHelperService.buildDataGrid_customizedJobs($scope.availableCustomizedComputationJobDatasets); + $scope.loadingData = false; + }; + $scope.$on("refreshJobOverviewTable", function (event) { + $scope.loadingData = true; + $scope.refreshJobOverviewTable(); + }); + $scope.refreshJobOverviewTable = async function () { + // refetch all metadata from spatial units to update table + await $scope.fetchDefaultIndicatorJobs(); + await $scope.fetchCustomizedIndicatorJobs(); + await $scope.fetchCustomizedIndicatorJobHealth(); + await $scope.fetchDefaultIndicatorJobHealth(); + $scope.initializeOrRefreshOverviewTable(); + $scope.loadingData = false; + }; + $scope.onClickDeleteDatasets = function () { + $scope.loadingData = true; + let markedEntriesForDeletion = kommonitorDataGridHelperService.getSelectedDefaultJobsMetadata(); + // submit selected spatial units to modal controller + $rootScope.$broadcast("onDeleteJobs", markedEntriesForDeletion); + $scope.loadingData = false; + }; + $scope.syntaxHighlightJSON = function (json) { + return kommonitorDataExchangeService.syntaxHighlightJSON(json); + }; + } + ] }); +//# sourceMappingURL=admin-script-execution.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptExecution/admin-script-execution.component.js.map b/app/components/kommonitorAdmin/adminScriptExecution/admin-script-execution.component.js.map new file mode 100644 index 000000000..d997aed4b --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptExecution/admin-script-execution.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"admin-script-execution.component.js","sourceRoot":"","sources":["admin-script-execution.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC,SAAS,CAAC,sBAAsB,EAAE;IACxE,WAAW,EAAE,sFAAsF;IACnG,UAAU,EAAE,CAAC,+BAA+B,EAAE,iCAAiC,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO;QACpI,SAAS,sBAAsB,CAAC,6BAA6B,EAAE,+BAA+B,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK;YAE1I,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAC3E,sCAAsC;YACtC,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,CAAC;YAEtB,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC;YAE1B,MAAM,CAAC,sCAAsC,CAAC;YAC9C,MAAM,CAAC,yCAAyC,CAAC;YACjD,MAAM,CAAC,2BAA2B,CAAC;YACnC,MAAM,CAAC,8BAA8B,CAAC;YACtC,MAAM,CAAC,qBAAqB,GAAG,KAAK,CAAC;YAErC,MAAM,CAAC,yBAAyB,GAAG;gBACzB,OAAO,KAAK,CAAC;oBACX,GAAG,EAAE,KAAK,CAAC,2BAA2B,GAAG,2CAA2C;oBACpF,MAAM,EAAE,KAAK;iBACd,CAAC,CAAC,IAAI,CAAC,SAAS,eAAe,CAAC,QAAQ;oBACrC,8CAA8C;oBAC9C,iCAAiC;oBAEjC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AAI,wBAAwB,GAAG,+BAA+B,CAAC,8BAA8B,EAAE,CAAC;gBAEhG,oDAAoD;gBACpD,UAAU,CAAC,UAAU,CAAC,cAAc,EAAE,wBAAwB,CAAC,CAAC;gBAEhE,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;YAC5B,CAAC,CAAC;YAEF,MAAM,CAAC,mBAAmB,GAAG,UAAS,IAAI;gBACzC,OAAO,6BAA6B,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;YAChE,CAAC,CAAC;QAEH,CAAC;KACA;CACD,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptExecution/admin-script-execution.component.ts b/app/components/kommonitorAdmin/adminScriptExecution/admin-script-execution.component.ts new file mode 100644 index 000000000..5941eb621 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptExecution/admin-script-execution.component.ts @@ -0,0 +1,137 @@ +angular.module('adminScriptExecution').component('adminScriptExecution', { + templateUrl: "components/kommonitorAdmin/adminScriptExecution/admin-script-execution.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorDataGridHelperService', '$scope', '$rootScope', '__env', '$timeout', '$http', + function JobExecutionController(kommonitorDataExchangeService, kommonitorDataGridHelperService, $scope, $rootScope, __env, $timeout, $http) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + $scope.loadingData = true; + + $scope.availableDefaultComputationJobDatasets; + $scope.availableCustomizedComputationJobDatasets; + $scope.defaultComputationJobHealth; + $scope.customizedComputationJobHealth; + $scope.selectAllEntriesInput = false; + + $scope.fetchDefaultIndicatorJobs = function(){ + return $http({ + url: __env.targetUrlToProcessingEngine + "script-engine/defaultIndicatorComputation", + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + $scope.availableDefaultComputationJobDatasets = response.data; + + }); + }; + + $scope.fetchCustomizedIndicatorJobs = function(){ + return $http({ + url: __env.targetUrlToProcessingEngine + "script-engine/customizableIndicatorComputation", + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + $scope.availableCustomizedComputationJobDatasets = response.data; + + }); + }; + + $scope.fetchDefaultIndicatorJobHealth = function(){ + return $http({ + url: __env.targetUrlToProcessingEngine + "script-engine/defaultIndicatorComputation/health", + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + $scope.defaultComputationJobHealth = response.data; + + }); + }; + + $scope.fetchCustomizedIndicatorJobHealth = function(){ + return $http({ + url: __env.targetUrlToProcessingEngine + "script-engine/customizableIndicatorComputation/health", + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + $scope.customizedComputationJobHealth = response.data; + + }); + }; + + $scope.$on("initialMetadataLoadingCompleted", function (event) { + + + $timeout(async function () { + + await $scope.fetchDefaultIndicatorJobHealth(); + await $scope.fetchCustomizedIndicatorJobHealth(); + + await $scope.fetchDefaultIndicatorJobs(); + await $scope.fetchCustomizedIndicatorJobs(); + + $scope.initializeOrRefreshOverviewTable(); + }, 250); + + }); + + $scope.$on("initialMetadataLoadingFailed", function (event, errorArray) { + + $scope.loadingData = false; + + }); + + $scope.initializeOrRefreshOverviewTable = function () { + $scope.loadingData = true; + + kommonitorDataGridHelperService.buildDataGrid_defaultJobs($scope.availableDefaultComputationJobDatasets); + kommonitorDataGridHelperService.buildDataGrid_customizedJobs($scope.availableCustomizedComputationJobDatasets); + + $scope.loadingData = false; + }; + + $scope.$on("refreshJobOverviewTable", function (event) { + $scope.loadingData = true; + $scope.refreshJobOverviewTable(); + }); + + $scope.refreshJobOverviewTable = async function () { + + // refetch all metadata from spatial units to update table + await $scope.fetchDefaultIndicatorJobs(); + await $scope.fetchCustomizedIndicatorJobs(); + await $scope.fetchCustomizedIndicatorJobHealth(); + await $scope.fetchDefaultIndicatorJobHealth(); + + $scope.initializeOrRefreshOverviewTable(); + + $scope.loadingData = false; + + }; + + $scope.onClickDeleteDatasets = function () { + $scope.loadingData = true; + + let markedEntriesForDeletion = kommonitorDataGridHelperService.getSelectedDefaultJobsMetadata(); + + // submit selected spatial units to modal controller + $rootScope.$broadcast("onDeleteJobs", markedEntriesForDeletion); + + $scope.loadingData = false; + }; + + $scope.syntaxHighlightJSON = function(json){ + return kommonitorDataExchangeService.syntaxHighlightJSON(json); + }; + + } + ] +}); diff --git a/app/components/kommonitorAdmin/adminScriptExecution/admin-script-execution.module.js b/app/components/kommonitorAdmin/adminScriptExecution/admin-script-execution.module.js index eb8ea9a19..e04145a45 100644 --- a/app/components/kommonitorAdmin/adminScriptExecution/admin-script-execution.module.js +++ b/app/components/kommonitorAdmin/adminScriptExecution/admin-script-execution.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('adminScriptExecution', ['kommonitorDataExchange', 'kommonitorDataGridHelper']); +//# sourceMappingURL=admin-script-execution.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptExecution/admin-script-execution.module.js.map b/app/components/kommonitorAdmin/adminScriptExecution/admin-script-execution.module.js.map new file mode 100644 index 000000000..5a110d3c1 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptExecution/admin-script-execution.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"admin-script-execution.module.js","sourceRoot":"","sources":["admin-script-execution.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,sBAAsB,EAAE,CAAC,wBAAwB,EAAE,0BAA0B,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptExecution/admin-script-execution.module.ts b/app/components/kommonitorAdmin/adminScriptExecution/admin-script-execution.module.ts new file mode 100644 index 000000000..eb8ea9a19 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptExecution/admin-script-execution.module.ts @@ -0,0 +1 @@ +angular.module('adminScriptExecution', ['kommonitorDataExchange', 'kommonitorDataGridHelper']); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/admin-script-management.component.js b/app/components/kommonitorAdmin/adminScriptManagement/admin-script-management.component.js index 12b8759b4..ca00b7a40 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/admin-script-management.component.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/admin-script-management.component.js @@ -1,157 +1,114 @@ +"use strict"; angular.module('adminScriptManagement').component('adminScriptManagement', { - templateUrl: "components/kommonitorAdmin/adminScriptManagement/admin-script-management.template.html", - controller: ['kommonitorDataExchangeService', 'kommonitorCacheHelperService', 'kommonitorDataGridHelperService', '$scope', '$rootScope', '__env', '$timeout', '$http', - function ScriptManagementController(kommonitorDataExchangeService, kommonitorCacheHelperService, kommonitorDataGridHelperService, $scope, $rootScope, __env, $timeout, $http) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - $scope.loadingData = true; - - $scope.availableScriptDatasets; - $scope.selectAllEntriesInput = false; - - $scope.$on("initialMetadataLoadingCompleted", function (event) { - - - $timeout(function () { - - $scope.initializeOrRefreshOverviewTable(); - }, 250); - - }); - - $scope.$on("initialMetadataLoadingFailed", function (event, errorArray) { - - $scope.loadingData = false; - - }); - - $scope.initializeOrRefreshOverviewTable = function () { - $scope.loadingData = true; - $scope.availableScriptDatasets = JSON.parse(JSON.stringify(kommonitorDataExchangeService.availableProcessScripts)); - - kommonitorDataGridHelperService.buildDataGrid_scripts($scope.availableScriptDatasets); - - $scope.loadingData = false; - }; - - $scope.$on("refreshScriptOverviewTable", function (event, crudType, scriptId) { - $scope.loadingData = true; - $scope.refreshScriptOverviewTable(crudType, scriptId); - }); - - $scope.onChangeSelectAllEntries = function () { - if ($scope.selectAllEntriesInput) { - $scope.availableScriptDatasets.forEach(function (dataset) { - dataset.isSelected = true; - }); - } - else { - $scope.availableScriptDatasets.forEach(function (dataset) { - dataset.isSelected = false; - }); - } - }; - - $scope.onChangeSelectAllEntries = function () { - if ($scope.selectAllEntriesInput) { - $scope.availableScriptDatasets.forEach(function (dataset) { - dataset.isSelected = true; - }); - } - else { - $scope.availableScriptDatasets.forEach(function (dataset) { - dataset.isSelected = false; - }); - } - }; - - $scope.refreshScriptOverviewTable = function (crudType, targetScriptId) { - - if(! crudType || !targetScriptId){ - // refetch all metadata from spatial units to update table - kommonitorDataExchangeService.fetchIndicatorScriptsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(response) { - - $scope.initializeOrRefreshOverviewTable(); - - $scope.loadingData = false; - - }, function errorCallback(response) { - - $scope.loadingData = false; - }); - } - else if(crudType && targetScriptId){ - if(crudType == "add"){ - kommonitorCacheHelperService.fetchSingleIndicatorScriptMetadata(targetScriptId, kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(data) { - - kommonitorDataExchangeService.addSingleProcessScriptMetadata(data); - - $scope.initializeOrRefreshOverviewTable(); - - $scope.loadingData = false; - - }, function errorCallback(response) { - - $scope.loadingData = false; - }); - } - else if(crudType == "edit"){ - kommonitorCacheHelperService.fetchSingleIndicatorScriptMetadata(targetScriptId, kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(data) { - - kommonitorDataExchangeService.replaceSingleProcessScriptMetadata(data); - - $scope.initializeOrRefreshOverviewTable(); - - $scope.loadingData = false; - - }, function errorCallback(response) { - - $scope.loadingData = false; - }); - } - else if(crudType == "delete"){ - // targetScriptId might be array in this case - if(targetScriptId && typeof targetScriptId == "string"){ - kommonitorDataExchangeService.deleteSingleProcessScriptMetadata(targetScriptId); - - $scope.initializeOrRefreshOverviewTable(); - - $scope.loadingData = false; - } - - else if (targetScriptId && Array.isArray(targetScriptId)){ - for (const id of targetScriptId) { - kommonitorDataExchangeService.deleteSingleProcessScriptMetadata(id); - } - $scope.initializeOrRefreshOverviewTable(); - - $scope.loadingData = false; - } - - } - } - - }; - - $scope.onClickDeleteDatasets = function () { - $scope.loadingData = true; - - var markedEntriesForDeletion = kommonitorDataGridHelperService.getSelectedScriptsMetadata(); - - // submit selected spatial units to modal controller - $rootScope.$broadcast("onDeleteScripts", markedEntriesForDeletion); - - $scope.loadingData = false; - }; - - $scope.onClickEditScript = function (scriptDataset) { - // submit selected spatial unit to modal controller - $rootScope.$broadcast("onEditScriptMetadata", scriptDataset); - }; - - } - ] + templateUrl: "components/kommonitorAdmin/adminScriptManagement/admin-script-management.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorCacheHelperService', 'kommonitorDataGridHelperService', '$scope', '$rootScope', '__env', '$timeout', '$http', + function ScriptManagementController(kommonitorDataExchangeService, kommonitorCacheHelperService, kommonitorDataGridHelperService, $scope, $rootScope, __env, $timeout, $http) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + $scope.loadingData = true; + $scope.availableScriptDatasets; + $scope.selectAllEntriesInput = false; + $scope.$on("initialMetadataLoadingCompleted", function (event) { + $timeout(function () { + $scope.initializeOrRefreshOverviewTable(); + }, 250); + }); + $scope.$on("initialMetadataLoadingFailed", function (event, errorArray) { + $scope.loadingData = false; + }); + $scope.initializeOrRefreshOverviewTable = function () { + $scope.loadingData = true; + $scope.availableScriptDatasets = JSON.parse(JSON.stringify(kommonitorDataExchangeService.availableProcessScripts)); + kommonitorDataGridHelperService.buildDataGrid_scripts($scope.availableScriptDatasets); + $scope.loadingData = false; + }; + $scope.$on("refreshScriptOverviewTable", function (event, crudType, scriptId) { + $scope.loadingData = true; + $scope.refreshScriptOverviewTable(crudType, scriptId); + }); + $scope.onChangeSelectAllEntries = function () { + if ($scope.selectAllEntriesInput) { + $scope.availableScriptDatasets.forEach(function (dataset) { + dataset.isSelected = true; + }); + } + else { + $scope.availableScriptDatasets.forEach(function (dataset) { + dataset.isSelected = false; + }); + } + }; + $scope.onChangeSelectAllEntries = function () { + if ($scope.selectAllEntriesInput) { + $scope.availableScriptDatasets.forEach(function (dataset) { + dataset.isSelected = true; + }); + } + else { + $scope.availableScriptDatasets.forEach(function (dataset) { + dataset.isSelected = false; + }); + } + }; + $scope.refreshScriptOverviewTable = function (crudType, targetScriptId) { + if (!crudType || !targetScriptId) { + // refetch all metadata from spatial units to update table + kommonitorDataExchangeService.fetchIndicatorScriptsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(response) { + $scope.initializeOrRefreshOverviewTable(); + $scope.loadingData = false; + }, function errorCallback(response) { + $scope.loadingData = false; + }); + } + else if (crudType && targetScriptId) { + if (crudType == "add") { + kommonitorCacheHelperService.fetchSingleIndicatorScriptMetadata(targetScriptId, kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(data) { + kommonitorDataExchangeService.addSingleProcessScriptMetadata(data); + $scope.initializeOrRefreshOverviewTable(); + $scope.loadingData = false; + }, function errorCallback(response) { + $scope.loadingData = false; + }); + } + else if (crudType == "edit") { + kommonitorCacheHelperService.fetchSingleIndicatorScriptMetadata(targetScriptId, kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(data) { + kommonitorDataExchangeService.replaceSingleProcessScriptMetadata(data); + $scope.initializeOrRefreshOverviewTable(); + $scope.loadingData = false; + }, function errorCallback(response) { + $scope.loadingData = false; + }); + } + else if (crudType == "delete") { + // targetScriptId might be array in this case + if (targetScriptId && typeof targetScriptId == "string") { + kommonitorDataExchangeService.deleteSingleProcessScriptMetadata(targetScriptId); + $scope.initializeOrRefreshOverviewTable(); + $scope.loadingData = false; + } + else if (targetScriptId && Array.isArray(targetScriptId)) { + for (const id of targetScriptId) { + kommonitorDataExchangeService.deleteSingleProcessScriptMetadata(id); + } + $scope.initializeOrRefreshOverviewTable(); + $scope.loadingData = false; + } + } + } + }; + $scope.onClickDeleteDatasets = function () { + $scope.loadingData = true; + var markedEntriesForDeletion = kommonitorDataGridHelperService.getSelectedScriptsMetadata(); + // submit selected spatial units to modal controller + $rootScope.$broadcast("onDeleteScripts", markedEntriesForDeletion); + $scope.loadingData = false; + }; + $scope.onClickEditScript = function (scriptDataset) { + // submit selected spatial unit to modal controller + $rootScope.$broadcast("onEditScriptMetadata", scriptDataset); + }; + } + ] }); +//# sourceMappingURL=admin-script-management.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/admin-script-management.component.js.map b/app/components/kommonitorAdmin/adminScriptManagement/admin-script-management.component.js.map new file mode 100644 index 000000000..3fa7567c9 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/admin-script-management.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"admin-script-management.component.js","sourceRoot":"","sources":["admin-script-management.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,SAAS,CAAC,uBAAuB,EAAE;IAC1E,WAAW,EAAE,wFAAwF;IACrG,UAAU,EAAE,CAAC,+BAA+B,EAAE,8BAA8B,EAAE,iCAAiC,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO;QACrK,SAAS,0BAA0B,CAAC,6BAA6B,EAAE,4BAA4B,EAAE,+BAA+B,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK;YAE3K,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAC3E,sCAAsC;YACtC,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,CAAC;YAEtB,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC;YAE1B,MAAM,CAAC,uBAAuB,CAAC;YAC/B,MAAM,CAAC,qBAAqB,GAAG,KAAK,CAAC;YAErC,MAAM,CAAC,GAAG,CAAC,iCAAiC,EAAE,UAAU,KAAK;gBAG5D,QAAQ,CAAC;oBAER,MAAM,CAAC,gCAAgC,EAAE,CAAC;gBAC3C,CAAC,EAAE,GAAG,CAAC,CAAC;YAET,CAAC,CAAC,CAAC;YAEH,MAAM,CAAC,GAAG,CAAC,8BAA8B,EAAE,UAAU,KAAK,EAAE,UAAU;gBAErE,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;YAE5B,CAAC,CAAC,CAAC;YAEH,MAAM,C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AE3B,CAAC,EAAE,SAAS,aAAa,CAAC,QAAQ;4BAEjC,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;wBAC7B,CAAC,CAAC,CAAC;qBACH;yBACI,IAAG,QAAQ,IAAI,QAAQ,EAAC;wBAC5B,6CAA6C;wBAC7C,IAAG,cAAc,IAAI,OAAO,cAAc,IAAI,QAAQ,EAAC;4BACtD,6BAA6B,CAAC,iCAAiC,CAAC,cAAc,CAAC,CAAC;4BAEhF,MAAM,CAAC,gCAAgC,EAAE,CAAC;4BAE1C,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;yBAC3B;6BAEI,IAAI,cAAc,IAAI,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,EAAC;4BACxD,KAAK,MAAM,EAAE,IAAI,cAAc,EAAE;gCAChC,6BAA6B,CAAC,iCAAiC,CAAC,EAAE,CAAC,CAAC;6BACpE;4BACD,MAAM,CAAC,gCAAgC,EAAE,CAAC;4BAE1C,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;yBAC3B;qBAED;iBACD;YAEF,CAAC,CAAC;YAEF,MAAM,CAAC,qBAAqB,GAAG;gBAC9B,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC;gBAE1B,IAAI,wBAAwB,GAAG,+BAA+B,CAAC,0BAA0B,EAAE,CAAC;gBAE5F,oDAAoD;gBACpD,UAAU,CAAC,UAAU,CAAC,iBAAiB,EAAE,wBAAwB,CAAC,CAAC;gBAEnE,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;YAC5B,CAAC,CAAC;YAEF,MAAM,CAAC,iBAAiB,GAAG,UAAU,aAAa;gBACjD,mDAAmD;gBACnD,UAAU,CAAC,UAAU,CAAC,sBAAsB,EAAE,aAAa,CAAC,CAAC;YAC9D,CAAC,CAAC;QAEH,CAAC;KACA;CACD,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/admin-script-management.component.ts b/app/components/kommonitorAdmin/adminScriptManagement/admin-script-management.component.ts new file mode 100644 index 000000000..12b8759b4 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/admin-script-management.component.ts @@ -0,0 +1,157 @@ +angular.module('adminScriptManagement').component('adminScriptManagement', { + templateUrl: "components/kommonitorAdmin/adminScriptManagement/admin-script-management.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorCacheHelperService', 'kommonitorDataGridHelperService', '$scope', '$rootScope', '__env', '$timeout', '$http', + function ScriptManagementController(kommonitorDataExchangeService, kommonitorCacheHelperService, kommonitorDataGridHelperService, $scope, $rootScope, __env, $timeout, $http) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + $scope.loadingData = true; + + $scope.availableScriptDatasets; + $scope.selectAllEntriesInput = false; + + $scope.$on("initialMetadataLoadingCompleted", function (event) { + + + $timeout(function () { + + $scope.initializeOrRefreshOverviewTable(); + }, 250); + + }); + + $scope.$on("initialMetadataLoadingFailed", function (event, errorArray) { + + $scope.loadingData = false; + + }); + + $scope.initializeOrRefreshOverviewTable = function () { + $scope.loadingData = true; + $scope.availableScriptDatasets = JSON.parse(JSON.stringify(kommonitorDataExchangeService.availableProcessScripts)); + + kommonitorDataGridHelperService.buildDataGrid_scripts($scope.availableScriptDatasets); + + $scope.loadingData = false; + }; + + $scope.$on("refreshScriptOverviewTable", function (event, crudType, scriptId) { + $scope.loadingData = true; + $scope.refreshScriptOverviewTable(crudType, scriptId); + }); + + $scope.onChangeSelectAllEntries = function () { + if ($scope.selectAllEntriesInput) { + $scope.availableScriptDatasets.forEach(function (dataset) { + dataset.isSelected = true; + }); + } + else { + $scope.availableScriptDatasets.forEach(function (dataset) { + dataset.isSelected = false; + }); + } + }; + + $scope.onChangeSelectAllEntries = function () { + if ($scope.selectAllEntriesInput) { + $scope.availableScriptDatasets.forEach(function (dataset) { + dataset.isSelected = true; + }); + } + else { + $scope.availableScriptDatasets.forEach(function (dataset) { + dataset.isSelected = false; + }); + } + }; + + $scope.refreshScriptOverviewTable = function (crudType, targetScriptId) { + + if(! crudType || !targetScriptId){ + // refetch all metadata from spatial units to update table + kommonitorDataExchangeService.fetchIndicatorScriptsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(response) { + + $scope.initializeOrRefreshOverviewTable(); + + $scope.loadingData = false; + + }, function errorCallback(response) { + + $scope.loadingData = false; + }); + } + else if(crudType && targetScriptId){ + if(crudType == "add"){ + kommonitorCacheHelperService.fetchSingleIndicatorScriptMetadata(targetScriptId, kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(data) { + + kommonitorDataExchangeService.addSingleProcessScriptMetadata(data); + + $scope.initializeOrRefreshOverviewTable(); + + $scope.loadingData = false; + + }, function errorCallback(response) { + + $scope.loadingData = false; + }); + } + else if(crudType == "edit"){ + kommonitorCacheHelperService.fetchSingleIndicatorScriptMetadata(targetScriptId, kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(data) { + + kommonitorDataExchangeService.replaceSingleProcessScriptMetadata(data); + + $scope.initializeOrRefreshOverviewTable(); + + $scope.loadingData = false; + + }, function errorCallback(response) { + + $scope.loadingData = false; + }); + } + else if(crudType == "delete"){ + // targetScriptId might be array in this case + if(targetScriptId && typeof targetScriptId == "string"){ + kommonitorDataExchangeService.deleteSingleProcessScriptMetadata(targetScriptId); + + $scope.initializeOrRefreshOverviewTable(); + + $scope.loadingData = false; + } + + else if (targetScriptId && Array.isArray(targetScriptId)){ + for (const id of targetScriptId) { + kommonitorDataExchangeService.deleteSingleProcessScriptMetadata(id); + } + $scope.initializeOrRefreshOverviewTable(); + + $scope.loadingData = false; + } + + } + } + + }; + + $scope.onClickDeleteDatasets = function () { + $scope.loadingData = true; + + var markedEntriesForDeletion = kommonitorDataGridHelperService.getSelectedScriptsMetadata(); + + // submit selected spatial units to modal controller + $rootScope.$broadcast("onDeleteScripts", markedEntriesForDeletion); + + $scope.loadingData = false; + }; + + $scope.onClickEditScript = function (scriptDataset) { + // submit selected spatial unit to modal controller + $rootScope.$broadcast("onEditScriptMetadata", scriptDataset); + }; + + } + ] +}); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/admin-script-management.module.js b/app/components/kommonitorAdmin/adminScriptManagement/admin-script-management.module.js index 27d7b1638..38e648a9d 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/admin-script-management.module.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/admin-script-management.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('adminScriptManagement', ['kommonitorDataExchange', 'kommonitorCacheHelper', 'kommonitorDataGridHelper']); +//# sourceMappingURL=admin-script-management.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/admin-script-management.module.js.map b/app/components/kommonitorAdmin/adminScriptManagement/admin-script-management.module.js.map new file mode 100644 index 000000000..04bec87c9 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/admin-script-management.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"admin-script-management.module.js","sourceRoot":"","sources":["admin-script-management.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,uBAAuB,EAAE,CAAC,wBAAwB,EAAE,uBAAuB,EAAE,0BAA0B,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/admin-script-management.module.ts b/app/components/kommonitorAdmin/adminScriptManagement/admin-script-management.module.ts new file mode 100644 index 000000000..27d7b1638 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/admin-script-management.module.ts @@ -0,0 +1 @@ +angular.module('adminScriptManagement', ['kommonitorDataExchange', 'kommonitorCacheHelper', 'kommonitorDataGridHelper']); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/script-add-modal.component.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/script-add-modal.component.js index 0a123a8db..a908cd313 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/script-add-modal.component.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/script-add-modal.component.js @@ -1,166 +1,135 @@ +"use strict"; angular.module('scriptAddModal').component('scriptAddModal', { - templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/script-add-modal.template.html", - controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', - '__env', '$timeout','kommonitorMultiStepFormHelperService', - function ScriptAddModalAddModalController(kommonitorDataExchangeService, kommonitorScriptHelperService, - $scope, $rootScope, $http, __env, $timeout, kommonitorMultiStepFormHelperService) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; - - /* POST BODY - { - "scriptCodeBase64": "scriptCodeBase64", - "requiredIndicatorIds": [ - "requiredIndicatorIds", - "requiredIndicatorIds" - ], - "variableProcessParameters": [ - { - "minParameterValueForNumericInputs": 6.027456183070403, - "maxParameterValueForNumericInputs": 0.8008281904610115, - "defaultValue": "defaultValue", - "dataType": "string", - "name": "name", - "description": "description" - }, - { - "minParameterValueForNumericInputs": 6.027456183070403, - "maxParameterValueForNumericInputs": 0.8008281904610115, - "defaultValue": "defaultValue", - "dataType": "string", - "name": "name", - "description": "description" - } - ], - "associatedIndicatorId": "associatedIndicatorId", - "name": "name", - "description": "description", - "requiredGeoresourceIds": [ - "requiredGeoresourceIds", - "requiredGeoresourceIds" - ] - } - */ - - $scope.datasetName = undefined; - $scope.description = undefined; - kommonitorScriptHelperService.targetIndicator = undefined; - - $scope.successMessagePart = undefined; - $scope.errorMessagePart = undefined; - $scope.errorMessagePart_indicatorMetadata = undefined; - - $scope.loadingData = false; - - $scope.resetScriptAddForm = function () { - - $scope.successMessagePart = undefined; - $scope.errorMessagePart = undefined; - $scope.errorMessagePart_indicatorMetadata = undefined; - - $scope.datasetName = undefined; - $scope.description = undefined; - kommonitorScriptHelperService.targetIndicator = undefined; - - kommonitorScriptHelperService.reset(); - - setTimeout(() => { - $scope.$digest(); - }, 1000); - }; - - $scope.addScript = async function () { - - $timeout(function () { - $scope.loadingData = true; - }); - - $scope.successMessagePart = undefined; - $scope.errorMessagePart = undefined; - $scope.errorMessagePart_indicatorMetadata = undefined; - - - // TODO Create and perform POST Request with loading screen - - try { - var addScriptResponse = await kommonitorScriptHelperService.postNewScript($scope.datasetName, $scope.description, kommonitorScriptHelperService.targetIndicator); - - let scriptId = addScriptResponse.scriptId; - $rootScope.$broadcast("refreshScriptOverviewTable", "add", scriptId); - if(kommonitorScriptHelperService.scriptFormulaHTML_overwriteTargetIndicatorMethod){ - try { - await kommonitorScriptHelperService.replaceMethodMetadataForTargetIndicator(kommonitorScriptHelperService.targetIndicator); - kommonitorScriptHelperService.scriptFormulaHTML_successToastDisplay = kommonitorScriptHelperService.scriptFormulaHTML; - $("#indicatorMetadataEditSuccessAlert").show(); - } catch (error) { - if (error.data) { - $scope.errorMessagePart_indicatorMetadata = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else { - $scope.errorMessagePart_indicatorMetadata = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - - $("#indicatorMetadataEditErrorAlert").show(); - $scope.loadingData = false; - - setTimeout(() => { - $scope.loadingData = false; - $scope.$digest(); - }, 1000); - } - - } - - // refresh all admin dashboard diagrams due to modified metadata - $rootScope.$broadcast("refreshAdminDashboardDiagrams"); - - $("#scriptAddSuccessAlert").show(); - $scope.loadingData = false; - - setTimeout(() => { - $scope.loadingData = false; - $scope.$digest(); - }, 1000); - } catch (error) { - if (error.data) { - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else { - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - - $("#scriptAddErrorAlert").show(); - $scope.loadingData = false; - - setTimeout(() => { - $scope.loadingData = false; - $scope.$digest(); - }, 1000); - } - - }; - - - - $scope.hideSuccessAlert = function () { - $("#scriptAddSuccessAlert").hide(); - }; - - $scope.hideErrorAlert = function () { - $("#scriptAddErrorAlert").hide(); - }; - - $scope.hideSuccessAlert_indicatorMetadata = function () { - $("#indicatorMetadataEditSuccessAlert").hide(); - }; - - $scope.hideErrorAlert_indicatorMetadata = function () { - $("#indicatorMetadataEditErrorAlert").hide(); - }; - - kommonitorMultiStepFormHelperService.registerClickHandler(); - - } - ] + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/script-add-modal.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', + '__env', '$timeout', 'kommonitorMultiStepFormHelperService', + function ScriptAddModalAddModalController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout, kommonitorMultiStepFormHelperService) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + /* POST BODY + { + "scriptCodeBase64": "scriptCodeBase64", + "requiredIndicatorIds": [ + "requiredIndicatorIds", + "requiredIndicatorIds" + ], + "variableProcessParameters": [ + { + "minParameterValueForNumericInputs": 6.027456183070403, + "maxParameterValueForNumericInputs": 0.8008281904610115, + "defaultValue": "defaultValue", + "dataType": "string", + "name": "name", + "description": "description" + }, + { + "minParameterValueForNumericInputs": 6.027456183070403, + "maxParameterValueForNumericInputs": 0.8008281904610115, + "defaultValue": "defaultValue", + "dataType": "string", + "name": "name", + "description": "description" + } + ], + "associatedIndicatorId": "associatedIndicatorId", + "name": "name", + "description": "description", + "requiredGeoresourceIds": [ + "requiredGeoresourceIds", + "requiredGeoresourceIds" + ] + } + */ + $scope.datasetName = undefined; + $scope.description = undefined; + kommonitorScriptHelperService.targetIndicator = undefined; + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + $scope.errorMessagePart_indicatorMetadata = undefined; + $scope.loadingData = false; + $scope.resetScriptAddForm = function () { + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + $scope.errorMessagePart_indicatorMetadata = undefined; + $scope.datasetName = undefined; + $scope.description = undefined; + kommonitorScriptHelperService.targetIndicator = undefined; + kommonitorScriptHelperService.reset(); + setTimeout(() => { + $scope.$digest(); + }, 1000); + }; + $scope.addScript = async function () { + $timeout(function () { + $scope.loadingData = true; + }); + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + $scope.errorMessagePart_indicatorMetadata = undefined; + // TODO Create and perform POST Request with loading screen + try { + var addScriptResponse = await kommonitorScriptHelperService.postNewScript($scope.datasetName, $scope.description, kommonitorScriptHelperService.targetIndicator); + let scriptId = addScriptResponse.scriptId; + $rootScope.$broadcast("refreshScriptOverviewTable", "add", scriptId); + if (kommonitorScriptHelperService.scriptFormulaHTML_overwriteTargetIndicatorMethod) { + try { + await kommonitorScriptHelperService.replaceMethodMetadataForTargetIndicator(kommonitorScriptHelperService.targetIndicator); + kommonitorScriptHelperService.scriptFormulaHTML_successToastDisplay = kommonitorScriptHelperService.scriptFormulaHTML; + $("#indicatorMetadataEditSuccessAlert").show(); + } + catch (error) { + if (error.data) { + $scope.errorMessagePart_indicatorMetadata = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart_indicatorMetadata = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + $("#indicatorMetadataEditErrorAlert").show(); + $scope.loadingData = false; + setTimeout(() => { + $scope.loadingData = false; + $scope.$digest(); + }, 1000); + } + } + // refresh all admin dashboard diagrams due to modified metadata + $rootScope.$broadcast("refreshAdminDashboardDiagrams"); + $("#scriptAddSuccessAlert").show(); + $scope.loadingData = false; + setTimeout(() => { + $scope.loadingData = false; + $scope.$digest(); + }, 1000); + } + catch (error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + $("#scriptAddErrorAlert").show(); + $scope.loadingData = false; + setTimeout(() => { + $scope.loadingData = false; + $scope.$digest(); + }, 1000); + } + }; + $scope.hideSuccessAlert = function () { + $("#scriptAddSuccessAlert").hide(); + }; + $scope.hideErrorAlert = function () { + $("#scriptAddErrorAlert").hide(); + }; + $scope.hideSuccessAlert_indicatorMetadata = function () { + $("#indicatorMetadataEditSuccessAlert").hide(); + }; + $scope.hideErrorAlert_indicatorMetadata = function () { + $("#indicatorMetadataEditErrorAlert").hide(); + }; + kommonitorMultiStepFormHelperService.registerClickHandler(); + } + ] }); +//# sourceMappingURL=script-add-modal.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/script-add-modal.component.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/script-add-modal.component.js.map new file mode 100644 index 000000000..2faed4523 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/script-add-modal.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-add-modal.component.js","sourceRoot":"","sources":["script-add-modal.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,SAAS,CAAC,gBAAgB,EAAE;IAC5D,WAAW,EAAE,gGAAgG;IAC7G,UAAU,EAAE,CAAC,+BAA+B,EAAE,+BAA+B,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO;QAC7G,OAAO,EAAE,UAAU,EAAC,sCAAsC;QAC1D,SAAS,gCAAgC,CAAC,6BAA6B,EAAE,6BAA6B,EACrG,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,oCAAoC;YAEhF,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAC3E,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAE3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiCE;YAEF,MAAM,CAAC,WAAW,GAAG,SAAS,CAAC;YAC/B,MAAM,CAAC,WAAW,GAAG,SAAS,CAAC;YAC/B,6BAA6B,CAAC,eAAe,GAAG,SAA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,IAAI,CAAC,CAAC;qBACxF;yBACI;wBACJ,MAAM,CAAC,gBAAgB,GAAG,6BAA6B,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;qBACnF;oBAED,CAAC,CAAC,sBAAsB,CAAC,CAAC,IAAI,EAAE,CAAC;oBACjC,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;oBAE3B,UAAU,CAAC,GAAG,EAAE;wBACf,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;wBAC3B,MAAM,CAAC,OAAO,EAAE,CAAC;oBAClB,CAAC,EAAE,IAAI,CAAC,CAAC;iBACT;YAEF,CAAC,CAAC;YAIF,MAAM,CAAC,gBAAgB,GAAG;gBACzB,CAAC,CAAC,wBAAwB,CAAC,CAAC,IAAI,EAAE,CAAC;YACpC,CAAC,CAAC;YAEF,MAAM,CAAC,cAAc,GAAG;gBACvB,CAAC,CAAC,sBAAsB,CAAC,CAAC,IAAI,EAAE,CAAC;YAClC,CAAC,CAAC;YAEF,MAAM,CAAC,kCAAkC,GAAG;gBAC3C,CAAC,CAAC,oCAAoC,CAAC,CAAC,IAAI,EAAE,CAAC;YAChD,CAAC,CAAC;YAEF,MAAM,CAAC,gCAAgC,GAAG;gBACzC,CAAC,CAAC,kCAAkC,CAAC,CAAC,IAAI,EAAE,CAAC;YAC9C,CAAC,CAAC;YAEF,oCAAoC,CAAC,oBAAoB,EAAE,CAAC;QAE7D,CAAC;KACD;CACD,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/script-add-modal.component.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/script-add-modal.component.ts new file mode 100644 index 000000000..0a123a8db --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/script-add-modal.component.ts @@ -0,0 +1,166 @@ +angular.module('scriptAddModal').component('scriptAddModal', { + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/script-add-modal.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', + '__env', '$timeout','kommonitorMultiStepFormHelperService', + function ScriptAddModalAddModalController(kommonitorDataExchangeService, kommonitorScriptHelperService, + $scope, $rootScope, $http, __env, $timeout, kommonitorMultiStepFormHelperService) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + + /* POST BODY + { + "scriptCodeBase64": "scriptCodeBase64", + "requiredIndicatorIds": [ + "requiredIndicatorIds", + "requiredIndicatorIds" + ], + "variableProcessParameters": [ + { + "minParameterValueForNumericInputs": 6.027456183070403, + "maxParameterValueForNumericInputs": 0.8008281904610115, + "defaultValue": "defaultValue", + "dataType": "string", + "name": "name", + "description": "description" + }, + { + "minParameterValueForNumericInputs": 6.027456183070403, + "maxParameterValueForNumericInputs": 0.8008281904610115, + "defaultValue": "defaultValue", + "dataType": "string", + "name": "name", + "description": "description" + } + ], + "associatedIndicatorId": "associatedIndicatorId", + "name": "name", + "description": "description", + "requiredGeoresourceIds": [ + "requiredGeoresourceIds", + "requiredGeoresourceIds" + ] + } + */ + + $scope.datasetName = undefined; + $scope.description = undefined; + kommonitorScriptHelperService.targetIndicator = undefined; + + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + $scope.errorMessagePart_indicatorMetadata = undefined; + + $scope.loadingData = false; + + $scope.resetScriptAddForm = function () { + + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + $scope.errorMessagePart_indicatorMetadata = undefined; + + $scope.datasetName = undefined; + $scope.description = undefined; + kommonitorScriptHelperService.targetIndicator = undefined; + + kommonitorScriptHelperService.reset(); + + setTimeout(() => { + $scope.$digest(); + }, 1000); + }; + + $scope.addScript = async function () { + + $timeout(function () { + $scope.loadingData = true; + }); + + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + $scope.errorMessagePart_indicatorMetadata = undefined; + + + // TODO Create and perform POST Request with loading screen + + try { + var addScriptResponse = await kommonitorScriptHelperService.postNewScript($scope.datasetName, $scope.description, kommonitorScriptHelperService.targetIndicator); + + let scriptId = addScriptResponse.scriptId; + $rootScope.$broadcast("refreshScriptOverviewTable", "add", scriptId); + if(kommonitorScriptHelperService.scriptFormulaHTML_overwriteTargetIndicatorMethod){ + try { + await kommonitorScriptHelperService.replaceMethodMetadataForTargetIndicator(kommonitorScriptHelperService.targetIndicator); + kommonitorScriptHelperService.scriptFormulaHTML_successToastDisplay = kommonitorScriptHelperService.scriptFormulaHTML; + $("#indicatorMetadataEditSuccessAlert").show(); + } catch (error) { + if (error.data) { + $scope.errorMessagePart_indicatorMetadata = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart_indicatorMetadata = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + + $("#indicatorMetadataEditErrorAlert").show(); + $scope.loadingData = false; + + setTimeout(() => { + $scope.loadingData = false; + $scope.$digest(); + }, 1000); + } + + } + + // refresh all admin dashboard diagrams due to modified metadata + $rootScope.$broadcast("refreshAdminDashboardDiagrams"); + + $("#scriptAddSuccessAlert").show(); + $scope.loadingData = false; + + setTimeout(() => { + $scope.loadingData = false; + $scope.$digest(); + }, 1000); + } catch (error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + + $("#scriptAddErrorAlert").show(); + $scope.loadingData = false; + + setTimeout(() => { + $scope.loadingData = false; + $scope.$digest(); + }, 1000); + } + + }; + + + + $scope.hideSuccessAlert = function () { + $("#scriptAddSuccessAlert").hide(); + }; + + $scope.hideErrorAlert = function () { + $("#scriptAddErrorAlert").hide(); + }; + + $scope.hideSuccessAlert_indicatorMetadata = function () { + $("#indicatorMetadataEditSuccessAlert").hide(); + }; + + $scope.hideErrorAlert_indicatorMetadata = function () { + $("#indicatorMetadataEditErrorAlert").hide(); + }; + + kommonitorMultiStepFormHelperService.registerClickHandler(); + + } + ] +}); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/script-add-modal.module.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/script-add-modal.module.js index 56c0d7dc8..bbd8c97f1 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/script-add-modal.module.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/script-add-modal.module.js @@ -1,7 +1,9 @@ -angular.module('scriptAddModal', ['kommonitorDataExchange', 'kommonitorScriptHelper', +"use strict"; +angular.module('scriptAddModal', ['kommonitorDataExchange', 'kommonitorScriptHelper', 'scriptGeneric', 'scriptSum', 'scriptSubtract', 'scriptPercentage', 'scriptShare', 'scriptDivision', 'scriptMultiplication', 'scriptPointsInPolygon', "scriptHeadlineIndicator", "scriptPromille", "scriptChangeAbsolute", "scriptChangeRelative", "scriptChangeAbsoluteRefDate", "scriptChangeRelativeRefDate", - "scriptTrend", "scriptContinuity", "scriptGeoresourceStatistics", "scriptGeoresourceSubsetShare", + "scriptTrend", "scriptContinuity", "scriptGeoresourceStatistics", "scriptGeoresourceSubsetShare", "scriptLineSegmentInPolygon", 'kommonitorMultiStepFormHelper' ]); +//# sourceMappingURL=script-add-modal.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/script-add-modal.module.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/script-add-modal.module.js.map new file mode 100644 index 000000000..d4173590a --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/script-add-modal.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-add-modal.module.js","sourceRoot":"","sources":["script-add-modal.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC,wBAAwB,EAAE,wBAAwB;IAChF,eAAe,EAAE,WAAW,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,aAAa,EAAE,gBAAgB;IACnG,sBAAsB,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,gBAAgB;IAC5F,sBAAsB,EAAE,sBAAsB,EAAE,6BAA6B,EAAE,6BAA6B;IAC5G,aAAa,EAAE,kBAAkB,EAAE,6BAA6B,EAAE,8BAA8B;IAChG,4BAA4B,EAAE,+BAA+B;CAChE,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/script-add-modal.module.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/script-add-modal.module.ts new file mode 100644 index 000000000..56c0d7dc8 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/script-add-modal.module.ts @@ -0,0 +1,7 @@ +angular.module('scriptAddModal', ['kommonitorDataExchange', 'kommonitorScriptHelper', + 'scriptGeneric', 'scriptSum', 'scriptSubtract', 'scriptPercentage', 'scriptShare', 'scriptDivision', + 'scriptMultiplication', 'scriptPointsInPolygon', "scriptHeadlineIndicator", "scriptPromille", + "scriptChangeAbsolute", "scriptChangeRelative", "scriptChangeAbsoluteRefDate", "scriptChangeRelativeRefDate", + "scriptTrend", "scriptContinuity", "scriptGeoresourceStatistics", "scriptGeoresourceSubsetShare", + "scriptLineSegmentInPolygon", 'kommonitorMultiStepFormHelper' +]); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsolute/script-change-absolute.component.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsolute/script-change-absolute.component.js index fc62ff4dd..e5e04df26 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsolute/script-change-absolute.component.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsolute/script-change-absolute.component.js @@ -1,149 +1,116 @@ +"use strict"; angular.module('scriptChangeAbsolute').component('scriptChangeAbsolute', { - templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsolute/script-change-absolute.template.html", - controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', - function ScriptChangeAbsoluteController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; - - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_absChange_nTemporalItems.js"; - - $scope.tmpIndicatorSelection = undefined; - - $scope.compIndicatorSelection = undefined; - $scope.compIndicatorSelection_old = undefined; - - $scope.parameterName_computationIndicator = "COMPUTATION_ID"; - $scope.parameterDescription_computationIndicator = "Indikatoren-ID des Basisindikators."; - $scope.parameterDefaultValue_computationIndicator = undefined; - $scope.parameterNumericMinValue_computationIndicator = 0; - $scope.parameterNumericMaxValue_computationIndicator = 1; - - $scope.temporalOption = kommonitorScriptHelperService.temporalOptions[0]; - - $scope.numberOfTemporalItems = 1; - - $scope.parameterName_temporalOption = "TEMPORAL_TYPE"; - $scope.parameterDescription_temporalOption = "Angabe des Zeitbezug-Typs. Standard ist 'Jahre'."; - $scope.parameterDefaultValue_temporalOption = "YEARS"; - $scope.parameterNumericMinValue_temporalOption = 0; - $scope.parameterNumericMaxValue_temporalOption = 1; - - $scope.parameterName_numTemporalItems = "NUMBER_OF_TEMPORAL_ITEMS"; - $scope.parameterDescription_numTemporalItems = "Anzahl der Zeiteinheiten. Standard ist '1'."; - $scope.parameterDefaultValue_numTemporalItems = 1; - $scope.parameterNumericMinValue_numTemporalItems = 1; - $scope.parameterNumericMaxValue_numTemporalItems = 100000; - $scope.parameterDataType_numTemporalItems = kommonitorScriptHelperService.availableScriptDataTypes[3]; - - /* - availableScriptDataTypes = [ - { - "displayName": "Textuell (String)", - "apiName": "string" - }, - { - "displayName": "Wahrheitswert (Boolean)", - "apiName": "boolean" - }, - { - "displayName": "Ganzzahl (Integer)", - "apiName": "integer" - }, - { - "displayName": "Gleitkommazahl (Double)", - "apiName": "double" - } - ]; - */ - $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; - - $scope.scriptCode_readableString_forPreview = undefined; - $scope.scriptCodeDomElementId = "#scriptCodePreview"; - - $scope.scriptFormulaHTML = undefined; - - /* - * reset relevant things due to change of script type - */ - $scope.init = function(){ - kommonitorScriptHelperService.reset(); - - $scope.initFixedScriptCode(); - }; - - $scope.initFixedScriptCode = function(){ - $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { - $scope.scriptCode_readableString_forPreview = response.data; - kommonitorScriptHelperService.scriptCode_readableString = response.data; - $scope.scriptCode_readableString_forPreview = response.data; - - kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); - }); - }; - - $scope.init(); - - $scope.onChangeComputationIndicator = function(compIndicatorSelection){ - // remove previous refIndicator from requiredIndicators and add new one - if($scope.compIndicatorSelection_old){ - kommonitorScriptHelperService.removeBaseIndicator($scope.compIndicatorSelection_old); - } - kommonitorScriptHelperService.addBaseIndicator(compIndicatorSelection); - - $scope.compIndicatorSelection_old = compIndicatorSelection; - - $scope.resetScriptParameter(); - $scope.resetComputationFormulaAndLegend(); - - }; - - $scope.onChangeNumTemporalItems = function(){ - $scope.numberOfTemporalItems = Math.round($scope.numberOfTemporalItems); - $scope.resetScriptParameter(); - $scope.resetComputationFormulaAndLegend(); - }; - - $scope.onChangeTemporalOption = function(){ - $scope.resetScriptParameter(); - $scope.resetComputationFormulaAndLegend(); - }; - - $scope.resetScriptParameter = function(){ - kommonitorScriptHelperService.requiredScriptParameters_tmp = []; - - $scope.parameterDefaultValue_computationIndicator = undefined; - - if($scope.compIndicatorSelection && $scope.compIndicatorSelection.indicatorId){ - $scope.parameterDefaultValue_computationIndicator = $scope.compIndicatorSelection.indicatorId; - } - - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationIndicator, $scope.parameterDescription_computationIndicator, $scope.parameterDataType, $scope.parameterDefaultValue_computationIndicator, $scope.parameterNumericMinValue_computationIndicator, $scope.parameterNumericMaxValue_computationIndicator); - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_numTemporalItems, $scope.parameterDescription_numTemporalItems, $scope.parameterDataType_numTemporalItems, $scope.numberOfTemporalItems, $scope.parameterNumericMinValue_numTemporalItems, $scope.parameterNumericMaxValue_numTemporalItems); - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_temporalOption, $scope.parameterDescription_temporalOption, $scope.parameterDataType, $scope.temporalOption.apiName, $scope.parameterNumericMinValue_temporalOption, $scope.parameterNumericMaxValue_temporalOption); - }; - - $scope.resetComputationFormulaAndLegend = function(){ - kommonitorScriptHelperService.scriptFormulaHTML = ""; - - if (! $scope.compIndicatorSelection){ - return; - } - - var formulaHTML = "Berechnung gemäß Formel
$ A_{N} - A_{M} $"; - var legendItemsHTML = "Legende zur Formel"; - - legendItemsHTML+="
$A$: " + $scope.compIndicatorSelection.indicatorName + " [" + $scope.compIndicatorSelection.unit + "]"; - legendItemsHTML+="
$N$: Ziel-Zeitpunkt"; - legendItemsHTML+="
$M$: Ziel-Zeitpunkt minus " + $scope.numberOfTemporalItems + " " + $scope.temporalOption.displayName ; - - kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; - - }; - - } - ] + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsolute/script-change-absolute.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + function ScriptChangeAbsoluteController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_absChange_nTemporalItems.js"; + $scope.tmpIndicatorSelection = undefined; + $scope.compIndicatorSelection = undefined; + $scope.compIndicatorSelection_old = undefined; + $scope.parameterName_computationIndicator = "COMPUTATION_ID"; + $scope.parameterDescription_computationIndicator = "Indikatoren-ID des Basisindikators."; + $scope.parameterDefaultValue_computationIndicator = undefined; + $scope.parameterNumericMinValue_computationIndicator = 0; + $scope.parameterNumericMaxValue_computationIndicator = 1; + $scope.temporalOption = kommonitorScriptHelperService.temporalOptions[0]; + $scope.numberOfTemporalItems = 1; + $scope.parameterName_temporalOption = "TEMPORAL_TYPE"; + $scope.parameterDescription_temporalOption = "Angabe des Zeitbezug-Typs. Standard ist 'Jahre'."; + $scope.parameterDefaultValue_temporalOption = "YEARS"; + $scope.parameterNumericMinValue_temporalOption = 0; + $scope.parameterNumericMaxValue_temporalOption = 1; + $scope.parameterName_numTemporalItems = "NUMBER_OF_TEMPORAL_ITEMS"; + $scope.parameterDescription_numTemporalItems = "Anzahl der Zeiteinheiten. Standard ist '1'."; + $scope.parameterDefaultValue_numTemporalItems = 1; + $scope.parameterNumericMinValue_numTemporalItems = 1; + $scope.parameterNumericMaxValue_numTemporalItems = 100000; + $scope.parameterDataType_numTemporalItems = kommonitorScriptHelperService.availableScriptDataTypes[3]; + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + $scope.scriptFormulaHTML = undefined; + /* + * reset relevant things due to change of script type + */ + $scope.init = function () { + kommonitorScriptHelperService.reset(); + $scope.initFixedScriptCode(); + }; + $scope.initFixedScriptCode = function () { + $http.get($scope.pathToScriptResource, { 'responseType': 'text' }).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + $scope.init(); + $scope.onChangeComputationIndicator = function (compIndicatorSelection) { + // remove previous refIndicator from requiredIndicators and add new one + if ($scope.compIndicatorSelection_old) { + kommonitorScriptHelperService.removeBaseIndicator($scope.compIndicatorSelection_old); + } + kommonitorScriptHelperService.addBaseIndicator(compIndicatorSelection); + $scope.compIndicatorSelection_old = compIndicatorSelection; + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.onChangeNumTemporalItems = function () { + $scope.numberOfTemporalItems = Math.round($scope.numberOfTemporalItems); + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.onChangeTemporalOption = function () { + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.resetScriptParameter = function () { + kommonitorScriptHelperService.requiredScriptParameters_tmp = []; + $scope.parameterDefaultValue_computationIndicator = undefined; + if ($scope.compIndicatorSelection && $scope.compIndicatorSelection.indicatorId) { + $scope.parameterDefaultValue_computationIndicator = $scope.compIndicatorSelection.indicatorId; + } + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationIndicator, $scope.parameterDescription_computationIndicator, $scope.parameterDataType, $scope.parameterDefaultValue_computationIndicator, $scope.parameterNumericMinValue_computationIndicator, $scope.parameterNumericMaxValue_computationIndicator); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_numTemporalItems, $scope.parameterDescription_numTemporalItems, $scope.parameterDataType_numTemporalItems, $scope.numberOfTemporalItems, $scope.parameterNumericMinValue_numTemporalItems, $scope.parameterNumericMaxValue_numTemporalItems); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_temporalOption, $scope.parameterDescription_temporalOption, $scope.parameterDataType, $scope.temporalOption.apiName, $scope.parameterNumericMinValue_temporalOption, $scope.parameterNumericMaxValue_temporalOption); + }; + $scope.resetComputationFormulaAndLegend = function () { + kommonitorScriptHelperService.scriptFormulaHTML = ""; + if (!$scope.compIndicatorSelection) { + return; + } + var formulaHTML = "Berechnung gemäß Formel
$ A_{N} - A_{M} $"; + var legendItemsHTML = "Legende zur Formel"; + legendItemsHTML += "
$A$: " + $scope.compIndicatorSelection.indicatorName + " [" + $scope.compIndicatorSelection.unit + "]"; + legendItemsHTML += "
$N$: Ziel-Zeitpunkt"; + legendItemsHTML += "
$M$: Ziel-Zeitpunkt minus " + $scope.numberOfTemporalItems + " " + $scope.temporalOption.displayName; + kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; + }; + } + ] }); +//# sourceMappingURL=script-change-absolute.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsolute/script-change-absolute.component.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsolute/script-change-absolute.component.js.map new file mode 100644 index 000000000..90f85e7c1 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsolute/script-change-absolute.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-change-absolute.component.js","sourceRoot":"","sources":["script-change-absolute.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC,SAAS,CAAC,sBAAsB,EAAE;IACxE,WAAW,EAAE,sIAAsI;IACnJ,UAAU,EAAE,CAAC,+BAA+B,EAAE,+BAA+B,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU;QAClI,SAAS,8BAA8B,CAAC,6BAA6B,EAAE,6BAA6B,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,QAA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O,EAAE,MAAM,CAAC,uCAAuC,EAAE,MAAM,CAAC,uCAAuC,CAAC,CAAC;YAC5R,CAAC,CAAC;YAEF,MAAM,CAAC,gCAAgC,GAAG;gBACzC,6BAA6B,CAAC,iBAAiB,GAAG,EAAE,CAAC;gBAErD,IAAI,CAAE,MAAM,CAAC,sBAAsB,EAAC;oBACnC,OAAO;iBACP;gBAEA,IAAI,WAAW,GAAG,8DAA8D,CAAC;gBACjF,IAAI,eAAe,GAAG,2BAA2B,CAAC;gBAElD,eAAe,IAAE,aAAa,GAAG,MAAM,CAAC,sBAAsB,CAAC,aAAa,GAAG,IAAI,GAAG,MAAM,CAAC,sBAAsB,CAAC,IAAI,GAAI,GAAG,CAAC;gBAChI,eAAe,IAAE,2BAA2B,CAAC;gBAC7C,eAAe,IAAE,kCAAkC,GAAG,MAAM,CAAC,qBAAqB,GAAG,GAAG,GAAG,MAAM,CAAC,cAAc,CAAC,WAAW,CAAE;gBAE9H,6BAA6B,CAAC,iBAAiB,GAAG,WAAW,GAAG,YAAY,GAAG,eAAe,CAAC;YAEjG,CAAC,CAAC;QAEH,CAAC;KACD;CACD,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsolute/script-change-absolute.component.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsolute/script-change-absolute.component.ts new file mode 100644 index 000000000..fc62ff4dd --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsolute/script-change-absolute.component.ts @@ -0,0 +1,149 @@ +angular.module('scriptChangeAbsolute').component('scriptChangeAbsolute', { + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsolute/script-change-absolute.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + function ScriptChangeAbsoluteController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_absChange_nTemporalItems.js"; + + $scope.tmpIndicatorSelection = undefined; + + $scope.compIndicatorSelection = undefined; + $scope.compIndicatorSelection_old = undefined; + + $scope.parameterName_computationIndicator = "COMPUTATION_ID"; + $scope.parameterDescription_computationIndicator = "Indikatoren-ID des Basisindikators."; + $scope.parameterDefaultValue_computationIndicator = undefined; + $scope.parameterNumericMinValue_computationIndicator = 0; + $scope.parameterNumericMaxValue_computationIndicator = 1; + + $scope.temporalOption = kommonitorScriptHelperService.temporalOptions[0]; + + $scope.numberOfTemporalItems = 1; + + $scope.parameterName_temporalOption = "TEMPORAL_TYPE"; + $scope.parameterDescription_temporalOption = "Angabe des Zeitbezug-Typs. Standard ist 'Jahre'."; + $scope.parameterDefaultValue_temporalOption = "YEARS"; + $scope.parameterNumericMinValue_temporalOption = 0; + $scope.parameterNumericMaxValue_temporalOption = 1; + + $scope.parameterName_numTemporalItems = "NUMBER_OF_TEMPORAL_ITEMS"; + $scope.parameterDescription_numTemporalItems = "Anzahl der Zeiteinheiten. Standard ist '1'."; + $scope.parameterDefaultValue_numTemporalItems = 1; + $scope.parameterNumericMinValue_numTemporalItems = 1; + $scope.parameterNumericMaxValue_numTemporalItems = 100000; + $scope.parameterDataType_numTemporalItems = kommonitorScriptHelperService.availableScriptDataTypes[3]; + + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + + $scope.scriptFormulaHTML = undefined; + + /* + * reset relevant things due to change of script type + */ + $scope.init = function(){ + kommonitorScriptHelperService.reset(); + + $scope.initFixedScriptCode(); + }; + + $scope.initFixedScriptCode = function(){ + $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + + $scope.init(); + + $scope.onChangeComputationIndicator = function(compIndicatorSelection){ + // remove previous refIndicator from requiredIndicators and add new one + if($scope.compIndicatorSelection_old){ + kommonitorScriptHelperService.removeBaseIndicator($scope.compIndicatorSelection_old); + } + kommonitorScriptHelperService.addBaseIndicator(compIndicatorSelection); + + $scope.compIndicatorSelection_old = compIndicatorSelection; + + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + + }; + + $scope.onChangeNumTemporalItems = function(){ + $scope.numberOfTemporalItems = Math.round($scope.numberOfTemporalItems); + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + + $scope.onChangeTemporalOption = function(){ + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + + $scope.resetScriptParameter = function(){ + kommonitorScriptHelperService.requiredScriptParameters_tmp = []; + + $scope.parameterDefaultValue_computationIndicator = undefined; + + if($scope.compIndicatorSelection && $scope.compIndicatorSelection.indicatorId){ + $scope.parameterDefaultValue_computationIndicator = $scope.compIndicatorSelection.indicatorId; + } + + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationIndicator, $scope.parameterDescription_computationIndicator, $scope.parameterDataType, $scope.parameterDefaultValue_computationIndicator, $scope.parameterNumericMinValue_computationIndicator, $scope.parameterNumericMaxValue_computationIndicator); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_numTemporalItems, $scope.parameterDescription_numTemporalItems, $scope.parameterDataType_numTemporalItems, $scope.numberOfTemporalItems, $scope.parameterNumericMinValue_numTemporalItems, $scope.parameterNumericMaxValue_numTemporalItems); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_temporalOption, $scope.parameterDescription_temporalOption, $scope.parameterDataType, $scope.temporalOption.apiName, $scope.parameterNumericMinValue_temporalOption, $scope.parameterNumericMaxValue_temporalOption); + }; + + $scope.resetComputationFormulaAndLegend = function(){ + kommonitorScriptHelperService.scriptFormulaHTML = ""; + + if (! $scope.compIndicatorSelection){ + return; + } + + var formulaHTML = "Berechnung gemäß Formel
$ A_{N} - A_{M} $"; + var legendItemsHTML = "Legende zur Formel"; + + legendItemsHTML+="
$A$: " + $scope.compIndicatorSelection.indicatorName + " [" + $scope.compIndicatorSelection.unit + "]"; + legendItemsHTML+="
$N$: Ziel-Zeitpunkt"; + legendItemsHTML+="
$M$: Ziel-Zeitpunkt minus " + $scope.numberOfTemporalItems + " " + $scope.temporalOption.displayName ; + + kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; + + }; + + } + ] +}); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsolute/script-change-absolute.module.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsolute/script-change-absolute.module.js index 3faaf5ece..c563ae409 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsolute/script-change-absolute.module.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsolute/script-change-absolute.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('scriptChangeAbsolute', ['kommonitorDataExchange', 'kommonitorScriptHelper']); +//# sourceMappingURL=script-change-absolute.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsolute/script-change-absolute.module.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsolute/script-change-absolute.module.js.map new file mode 100644 index 000000000..7794ca3b4 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsolute/script-change-absolute.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-change-absolute.module.js","sourceRoot":"","sources":["script-change-absolute.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,sBAAsB,EAAE,CAAC,wBAAwB,EAAE,wBAAwB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsolute/script-change-absolute.module.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsolute/script-change-absolute.module.ts new file mode 100644 index 000000000..3faaf5ece --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsolute/script-change-absolute.module.ts @@ -0,0 +1 @@ +angular.module('scriptChangeAbsolute', ['kommonitorDataExchange', 'kommonitorScriptHelper']); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsoluteRefDate/script-change-absolute-ref-date.component.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsoluteRefDate/script-change-absolute-ref-date.component.js index d5bbccb6c..8ea016307 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsoluteRefDate/script-change-absolute-ref-date.component.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsoluteRefDate/script-change-absolute-ref-date.component.js @@ -1,139 +1,108 @@ +"use strict"; angular.module('scriptChangeAbsoluteRefDate').component('scriptChangeAbsoluteRefDate', { - templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsoluteRefDate/script-change-absolute-ref-date.template.html", - controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', - function ScriptChangeAbsoluteRefDateController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; - - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_absChange_refDate.js"; - - $scope.tmpIndicatorSelection = undefined; - - $scope.compIndicatorSelection = undefined; - $scope.compIndicatorSelection_old = undefined; - - $scope.parameterName_computationIndicator = "COMPUTATION_ID"; - $scope.parameterDescription_computationIndicator = "Indikatoren-ID des Basisindikators."; - $scope.parameterDefaultValue_computationIndicator = undefined; - $scope.parameterNumericMinValue_computationIndicator = 0; - $scope.parameterNumericMaxValue_computationIndicator = 1; - - $scope.referenceDate = ""; - - $scope.parameterName_referenceDate = "REFERENCE_DATE"; - $scope.parameterDescription_referenceDate = "konkretes Referenzdatum im Format 'YYYY-MM-DD'"; - $scope.parameterDefaultValue_referenceDate = ""; - $scope.parameterNumericMinValue_referenceDate = 0; - $scope.parameterNumericMaxValue_referenceDate = 1; - - /* - availableScriptDataTypes = [ - { - "displayName": "Textuell (String)", - "apiName": "string" - }, - { - "displayName": "Wahrheitswert (Boolean)", - "apiName": "boolean" - }, - { - "displayName": "Ganzzahl (Integer)", - "apiName": "integer" - }, - { - "displayName": "Gleitkommazahl (Double)", - "apiName": "double" - } - ]; - */ - $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; - - $scope.scriptCode_readableString_forPreview = undefined; - $scope.scriptCodeDomElementId = "#scriptCodePreview"; - - $scope.scriptFormulaHTML = undefined; - - /* - * reset relevant things due to change of script type - */ - $scope.init = function(){ - kommonitorScriptHelperService.reset(); - - $scope.initFixedScriptCode(); - }; - - $scope.initFixedScriptCode = function(){ - $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { - $scope.scriptCode_readableString_forPreview = response.data; - kommonitorScriptHelperService.scriptCode_readableString = response.data; - $scope.scriptCode_readableString_forPreview = response.data; - - kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); - }); - }; - - $scope.init(); - - $scope.onChangeComputationIndicator = function(compIndicatorSelection){ - // remove previous refIndicator from requiredIndicators and add new one - if($scope.compIndicatorSelection_old){ - kommonitorScriptHelperService.removeBaseIndicator($scope.compIndicatorSelection_old); - } - kommonitorScriptHelperService.addBaseIndicator(compIndicatorSelection); - - $scope.compIndicatorSelection_old = compIndicatorSelection; - - $scope.resetScriptParameter(); - $scope.resetComputationFormulaAndLegend(); - - }; - - $scope.onChangeNumTemporalItems = function(){ - $scope.numberOfTemporalItems = Math.round($scope.numberOfTemporalItems); - $scope.resetScriptParameter(); - $scope.resetComputationFormulaAndLegend(); - }; - - $scope.onChangeReferenceDate = function(){ - $scope.resetScriptParameter(); - $scope.resetComputationFormulaAndLegend(); - }; - - $scope.resetScriptParameter = function(){ - kommonitorScriptHelperService.requiredScriptParameters_tmp = []; - - $scope.parameterDefaultValue_computationIndicator = undefined; - - if($scope.compIndicatorSelection && $scope.compIndicatorSelection.indicatorId){ - $scope.parameterDefaultValue_computationIndicator = $scope.compIndicatorSelection.indicatorId; - } - - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationIndicator, $scope.parameterDescription_computationIndicator, $scope.parameterDataType, $scope.parameterDefaultValue_computationIndicator, $scope.parameterNumericMinValue_computationIndicator, $scope.parameterNumericMaxValue_computationIndicator); - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_referenceDate, $scope.parameterDescription_referenceDate, $scope.parameterDataType, $scope.referenceDate, $scope.parameterNumericMinValue_referenceDate, $scope.parameterNumericMaxValue_referenceDate); - }; - - $scope.resetComputationFormulaAndLegend = function(){ - kommonitorScriptHelperService.scriptFormulaHTML = ""; - - if (! $scope.compIndicatorSelection){ - return; - } - - var formulaHTML = "Berechnung gemäß Formel
$ A_{N} - A_{M} $"; - var legendItemsHTML = "Legende zur Formel"; - - legendItemsHTML+="
$A$: " + $scope.compIndicatorSelection.indicatorName + " [" + $scope.compIndicatorSelection.unit + "]"; - legendItemsHTML+="
$N$: Ziel-Zeitpunkt"; - legendItemsHTML+="
$M$: fester Referenz-Zeitpunkt '" + $scope.referenceDate + "'"; - - kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; - - }; - - } - ] + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsoluteRefDate/script-change-absolute-ref-date.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + function ScriptChangeAbsoluteRefDateController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_absChange_refDate.js"; + $scope.tmpIndicatorSelection = undefined; + $scope.compIndicatorSelection = undefined; + $scope.compIndicatorSelection_old = undefined; + $scope.parameterName_computationIndicator = "COMPUTATION_ID"; + $scope.parameterDescription_computationIndicator = "Indikatoren-ID des Basisindikators."; + $scope.parameterDefaultValue_computationIndicator = undefined; + $scope.parameterNumericMinValue_computationIndicator = 0; + $scope.parameterNumericMaxValue_computationIndicator = 1; + $scope.referenceDate = ""; + $scope.parameterName_referenceDate = "REFERENCE_DATE"; + $scope.parameterDescription_referenceDate = "konkretes Referenzdatum im Format 'YYYY-MM-DD'"; + $scope.parameterDefaultValue_referenceDate = ""; + $scope.parameterNumericMinValue_referenceDate = 0; + $scope.parameterNumericMaxValue_referenceDate = 1; + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + $scope.scriptFormulaHTML = undefined; + /* + * reset relevant things due to change of script type + */ + $scope.init = function () { + kommonitorScriptHelperService.reset(); + $scope.initFixedScriptCode(); + }; + $scope.initFixedScriptCode = function () { + $http.get($scope.pathToScriptResource, { 'responseType': 'text' }).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + $scope.init(); + $scope.onChangeComputationIndicator = function (compIndicatorSelection) { + // remove previous refIndicator from requiredIndicators and add new one + if ($scope.compIndicatorSelection_old) { + kommonitorScriptHelperService.removeBaseIndicator($scope.compIndicatorSelection_old); + } + kommonitorScriptHelperService.addBaseIndicator(compIndicatorSelection); + $scope.compIndicatorSelection_old = compIndicatorSelection; + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.onChangeNumTemporalItems = function () { + $scope.numberOfTemporalItems = Math.round($scope.numberOfTemporalItems); + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.onChangeReferenceDate = function () { + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.resetScriptParameter = function () { + kommonitorScriptHelperService.requiredScriptParameters_tmp = []; + $scope.parameterDefaultValue_computationIndicator = undefined; + if ($scope.compIndicatorSelection && $scope.compIndicatorSelection.indicatorId) { + $scope.parameterDefaultValue_computationIndicator = $scope.compIndicatorSelection.indicatorId; + } + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationIndicator, $scope.parameterDescription_computationIndicator, $scope.parameterDataType, $scope.parameterDefaultValue_computationIndicator, $scope.parameterNumericMinValue_computationIndicator, $scope.parameterNumericMaxValue_computationIndicator); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_referenceDate, $scope.parameterDescription_referenceDate, $scope.parameterDataType, $scope.referenceDate, $scope.parameterNumericMinValue_referenceDate, $scope.parameterNumericMaxValue_referenceDate); + }; + $scope.resetComputationFormulaAndLegend = function () { + kommonitorScriptHelperService.scriptFormulaHTML = ""; + if (!$scope.compIndicatorSelection) { + return; + } + var formulaHTML = "Berechnung gemäß Formel
$ A_{N} - A_{M} $"; + var legendItemsHTML = "Legende zur Formel"; + legendItemsHTML += "
$A$: " + $scope.compIndicatorSelection.indicatorName + " [" + $scope.compIndicatorSelection.unit + "]"; + legendItemsHTML += "
$N$: Ziel-Zeitpunkt"; + legendItemsHTML += "
$M$: fester Referenz-Zeitpunkt '" + $scope.referenceDate + "'"; + kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; + }; + } + ] }); +//# sourceMappingURL=script-change-absolute-ref-date.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsoluteRefDate/script-change-absolute-ref-date.component.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsoluteRefDate/script-change-absolute-ref-date.component.js.map new file mode 100644 index 000000000..77bbf9c56 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsoluteRefDate/script-change-absolute-ref-date.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-change-absolute-ref-date.component.js","sourceRoot":"","sources":["script-change-absolute-ref-date.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,CAAC,SAAS,CA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,GAAG,MAAM,CAAC,sBAAsB,CAAC,aAAa,GAAI,IAAI,GAAG,MAAM,CAAC,sBAAsB,CAAC,IAAI,GAAI,GAAG,CAAC;gBACjI,eAAe,IAAE,2BAA2B,CAAC;gBAC7C,eAAe,IAAE,wCAAwC,GAAG,MAAM,CAAC,aAAa,GAAG,GAAG,CAAC;gBAEvF,6BAA6B,CAAC,iBAAiB,GAAG,WAAW,GAAG,YAAY,GAAG,eAAe,CAAC;YAEjG,CAAC,CAAC;QAEH,CAAC;KACD;CACD,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsoluteRefDate/script-change-absolute-ref-date.component.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsoluteRefDate/script-change-absolute-ref-date.component.ts new file mode 100644 index 000000000..d5bbccb6c --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsoluteRefDate/script-change-absolute-ref-date.component.ts @@ -0,0 +1,139 @@ +angular.module('scriptChangeAbsoluteRefDate').component('scriptChangeAbsoluteRefDate', { + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsoluteRefDate/script-change-absolute-ref-date.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + function ScriptChangeAbsoluteRefDateController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_absChange_refDate.js"; + + $scope.tmpIndicatorSelection = undefined; + + $scope.compIndicatorSelection = undefined; + $scope.compIndicatorSelection_old = undefined; + + $scope.parameterName_computationIndicator = "COMPUTATION_ID"; + $scope.parameterDescription_computationIndicator = "Indikatoren-ID des Basisindikators."; + $scope.parameterDefaultValue_computationIndicator = undefined; + $scope.parameterNumericMinValue_computationIndicator = 0; + $scope.parameterNumericMaxValue_computationIndicator = 1; + + $scope.referenceDate = ""; + + $scope.parameterName_referenceDate = "REFERENCE_DATE"; + $scope.parameterDescription_referenceDate = "konkretes Referenzdatum im Format 'YYYY-MM-DD'"; + $scope.parameterDefaultValue_referenceDate = ""; + $scope.parameterNumericMinValue_referenceDate = 0; + $scope.parameterNumericMaxValue_referenceDate = 1; + + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + + $scope.scriptFormulaHTML = undefined; + + /* + * reset relevant things due to change of script type + */ + $scope.init = function(){ + kommonitorScriptHelperService.reset(); + + $scope.initFixedScriptCode(); + }; + + $scope.initFixedScriptCode = function(){ + $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + + $scope.init(); + + $scope.onChangeComputationIndicator = function(compIndicatorSelection){ + // remove previous refIndicator from requiredIndicators and add new one + if($scope.compIndicatorSelection_old){ + kommonitorScriptHelperService.removeBaseIndicator($scope.compIndicatorSelection_old); + } + kommonitorScriptHelperService.addBaseIndicator(compIndicatorSelection); + + $scope.compIndicatorSelection_old = compIndicatorSelection; + + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + + }; + + $scope.onChangeNumTemporalItems = function(){ + $scope.numberOfTemporalItems = Math.round($scope.numberOfTemporalItems); + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + + $scope.onChangeReferenceDate = function(){ + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + + $scope.resetScriptParameter = function(){ + kommonitorScriptHelperService.requiredScriptParameters_tmp = []; + + $scope.parameterDefaultValue_computationIndicator = undefined; + + if($scope.compIndicatorSelection && $scope.compIndicatorSelection.indicatorId){ + $scope.parameterDefaultValue_computationIndicator = $scope.compIndicatorSelection.indicatorId; + } + + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationIndicator, $scope.parameterDescription_computationIndicator, $scope.parameterDataType, $scope.parameterDefaultValue_computationIndicator, $scope.parameterNumericMinValue_computationIndicator, $scope.parameterNumericMaxValue_computationIndicator); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_referenceDate, $scope.parameterDescription_referenceDate, $scope.parameterDataType, $scope.referenceDate, $scope.parameterNumericMinValue_referenceDate, $scope.parameterNumericMaxValue_referenceDate); + }; + + $scope.resetComputationFormulaAndLegend = function(){ + kommonitorScriptHelperService.scriptFormulaHTML = ""; + + if (! $scope.compIndicatorSelection){ + return; + } + + var formulaHTML = "Berechnung gemäß Formel
$ A_{N} - A_{M} $"; + var legendItemsHTML = "Legende zur Formel"; + + legendItemsHTML+="
$A$: " + $scope.compIndicatorSelection.indicatorName + " [" + $scope.compIndicatorSelection.unit + "]"; + legendItemsHTML+="
$N$: Ziel-Zeitpunkt"; + legendItemsHTML+="
$M$: fester Referenz-Zeitpunkt '" + $scope.referenceDate + "'"; + + kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; + + }; + + } + ] +}); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsoluteRefDate/script-change-absolute-ref-date.module.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsoluteRefDate/script-change-absolute-ref-date.module.js index c4ada4bea..4596ce666 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsoluteRefDate/script-change-absolute-ref-date.module.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsoluteRefDate/script-change-absolute-ref-date.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('scriptChangeAbsoluteRefDate', ['kommonitorDataExchange', 'kommonitorScriptHelper']); +//# sourceMappingURL=script-change-absolute-ref-date.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsoluteRefDate/script-change-absolute-ref-date.module.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsoluteRefDate/script-change-absolute-ref-date.module.js.map new file mode 100644 index 000000000..1a7154f93 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsoluteRefDate/script-change-absolute-ref-date.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-change-absolute-ref-date.module.js","sourceRoot":"","sources":["script-change-absolute-ref-date.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,6BAA6B,EAAE,CAAC,wBAAwB,EAAE,wBAAwB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsoluteRefDate/script-change-absolute-ref-date.module.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsoluteRefDate/script-change-absolute-ref-date.module.ts new file mode 100644 index 000000000..c4ada4bea --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeAbsoluteRefDate/script-change-absolute-ref-date.module.ts @@ -0,0 +1 @@ +angular.module('scriptChangeAbsoluteRefDate', ['kommonitorDataExchange', 'kommonitorScriptHelper']); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelative/script-change-relative.component.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelative/script-change-relative.component.js index 2edbdc67e..333875695 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelative/script-change-relative.component.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelative/script-change-relative.component.js @@ -1,149 +1,116 @@ +"use strict"; angular.module('scriptChangeRelative').component('scriptChangeRelative', { - templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelative/script-change-relative.template.html", - controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', - function ScriptChangeRelativeController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; - - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_relChange_nTemporalItems.js"; - - $scope.tmpIndicatorSelection = undefined; - - $scope.compIndicatorSelection = undefined; - $scope.compIndicatorSelection_old = undefined; - - $scope.parameterName_computationIndicator = "COMPUTATION_ID"; - $scope.parameterDescription_computationIndicator = "Indikatoren-ID des Basisindikators."; - $scope.parameterDefaultValue_computationIndicator = undefined; - $scope.parameterNumericMinValue_computationIndicator = 0; - $scope.parameterNumericMaxValue_computationIndicator = 1; - - $scope.temporalOption = kommonitorScriptHelperService.temporalOptions[0]; - - $scope.numberOfTemporalItems = 1; - - $scope.parameterName_temporalOption = "TEMPORAL_TYPE"; - $scope.parameterDescription_temporalOption = "Angabe des Zeitbezug-Typs. Standard ist 'Jahre'."; - $scope.parameterDefaultValue_temporalOption = "YEARS"; - $scope.parameterNumericMinValue_temporalOption = 0; - $scope.parameterNumericMaxValue_temporalOption = 1; - - $scope.parameterName_numTemporalItems = "NUMBER_OF_TEMPORAL_ITEMS"; - $scope.parameterDescription_numTemporalItems = "Anzahl der Zeiteinheiten. Standard ist '1'."; - $scope.parameterDefaultValue_numTemporalItems = 1; - $scope.parameterNumericMinValue_numTemporalItems = 1; - $scope.parameterNumericMaxValue_numTemporalItems = 100000; - $scope.parameterDataType_numTemporalItems = kommonitorScriptHelperService.availableScriptDataTypes[3]; - - /* - availableScriptDataTypes = [ - { - "displayName": "Textuell (String)", - "apiName": "string" - }, - { - "displayName": "Wahrheitswert (Boolean)", - "apiName": "boolean" - }, - { - "displayName": "Ganzzahl (Integer)", - "apiName": "integer" - }, - { - "displayName": "Gleitkommazahl (Double)", - "apiName": "double" - } - ]; - */ - $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; - - $scope.scriptCode_readableString_forPreview = undefined; - $scope.scriptCodeDomElementId = "#scriptCodePreview"; - - $scope.scriptFormulaHTML = undefined; - - /* - * reset relevant things due to change of script type - */ - $scope.init = function(){ - kommonitorScriptHelperService.reset(); - - $scope.initFixedScriptCode(); - }; - - $scope.initFixedScriptCode = function(){ - $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { - $scope.scriptCode_readableString_forPreview = response.data; - kommonitorScriptHelperService.scriptCode_readableString = response.data; - $scope.scriptCode_readableString_forPreview = response.data; - - kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); - }); - }; - - $scope.init(); - - $scope.onChangeComputationIndicator = function(compIndicatorSelection){ - // remove previous refIndicator from requiredIndicators and add new one - if($scope.compIndicatorSelection_old){ - kommonitorScriptHelperService.removeBaseIndicator($scope.compIndicatorSelection_old); - } - kommonitorScriptHelperService.addBaseIndicator(compIndicatorSelection); - - $scope.compIndicatorSelection_old = compIndicatorSelection; - - $scope.resetScriptParameter(); - $scope.resetComputationFormulaAndLegend(); - - }; - - $scope.onChangeNumTemporalItems = function(){ - $scope.numberOfTemporalItems = Math.round($scope.numberOfTemporalItems); - $scope.resetScriptParameter(); - $scope.resetComputationFormulaAndLegend(); - }; - - $scope.onChangeTemporalOption = function(){ - $scope.resetScriptParameter(); - $scope.resetComputationFormulaAndLegend(); - }; - - $scope.resetScriptParameter = function(){ - kommonitorScriptHelperService.requiredScriptParameters_tmp = []; - - $scope.parameterDefaultValue_computationIndicator = undefined; - - if($scope.compIndicatorSelection && $scope.compIndicatorSelection.indicatorId){ - $scope.parameterDefaultValue_computationIndicator = $scope.compIndicatorSelection.indicatorId; - } - - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationIndicator, $scope.parameterDescription_computationIndicator, $scope.parameterDataType, $scope.parameterDefaultValue_computationIndicator, $scope.parameterNumericMinValue_computationIndicator, $scope.parameterNumericMaxValue_computationIndicator); - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_numTemporalItems, $scope.parameterDescription_numTemporalItems, $scope.parameterDataType_numTemporalItems, $scope.numberOfTemporalItems, $scope.parameterNumericMinValue_numTemporalItems, $scope.parameterNumericMaxValue_numTemporalItems); - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_temporalOption, $scope.parameterDescription_temporalOption, $scope.parameterDataType, $scope.temporalOption.apiName, $scope.parameterNumericMinValue_temporalOption, $scope.parameterNumericMaxValue_temporalOption); - }; - - $scope.resetComputationFormulaAndLegend = function(){ - kommonitorScriptHelperService.scriptFormulaHTML = ""; - - if (! $scope.compIndicatorSelection){ - return; - } - - var formulaHTML = "Berechnung gemäß Formel
$$ 100 \\times \\frac{A_{N} - A_{M}}{A_{M}} $$"; - var legendItemsHTML = "Legende zur Formel"; - - legendItemsHTML+="
$A$: " + $scope.compIndicatorSelection.indicatorName + " [" + $scope.compIndicatorSelection.unit + "]"; - legendItemsHTML+="
$N$: Ziel-Zeitpunkt"; - legendItemsHTML+="
$M$: Ziel-Zeitpunkt minus " + $scope.numberOfTemporalItems + " " + $scope.temporalOption.displayName ; - - kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; - - }; - - } - ] + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelative/script-change-relative.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + function ScriptChangeRelativeController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_relChange_nTemporalItems.js"; + $scope.tmpIndicatorSelection = undefined; + $scope.compIndicatorSelection = undefined; + $scope.compIndicatorSelection_old = undefined; + $scope.parameterName_computationIndicator = "COMPUTATION_ID"; + $scope.parameterDescription_computationIndicator = "Indikatoren-ID des Basisindikators."; + $scope.parameterDefaultValue_computationIndicator = undefined; + $scope.parameterNumericMinValue_computationIndicator = 0; + $scope.parameterNumericMaxValue_computationIndicator = 1; + $scope.temporalOption = kommonitorScriptHelperService.temporalOptions[0]; + $scope.numberOfTemporalItems = 1; + $scope.parameterName_temporalOption = "TEMPORAL_TYPE"; + $scope.parameterDescription_temporalOption = "Angabe des Zeitbezug-Typs. Standard ist 'Jahre'."; + $scope.parameterDefaultValue_temporalOption = "YEARS"; + $scope.parameterNumericMinValue_temporalOption = 0; + $scope.parameterNumericMaxValue_temporalOption = 1; + $scope.parameterName_numTemporalItems = "NUMBER_OF_TEMPORAL_ITEMS"; + $scope.parameterDescription_numTemporalItems = "Anzahl der Zeiteinheiten. Standard ist '1'."; + $scope.parameterDefaultValue_numTemporalItems = 1; + $scope.parameterNumericMinValue_numTemporalItems = 1; + $scope.parameterNumericMaxValue_numTemporalItems = 100000; + $scope.parameterDataType_numTemporalItems = kommonitorScriptHelperService.availableScriptDataTypes[3]; + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + $scope.scriptFormulaHTML = undefined; + /* + * reset relevant things due to change of script type + */ + $scope.init = function () { + kommonitorScriptHelperService.reset(); + $scope.initFixedScriptCode(); + }; + $scope.initFixedScriptCode = function () { + $http.get($scope.pathToScriptResource, { 'responseType': 'text' }).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + $scope.init(); + $scope.onChangeComputationIndicator = function (compIndicatorSelection) { + // remove previous refIndicator from requiredIndicators and add new one + if ($scope.compIndicatorSelection_old) { + kommonitorScriptHelperService.removeBaseIndicator($scope.compIndicatorSelection_old); + } + kommonitorScriptHelperService.addBaseIndicator(compIndicatorSelection); + $scope.compIndicatorSelection_old = compIndicatorSelection; + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.onChangeNumTemporalItems = function () { + $scope.numberOfTemporalItems = Math.round($scope.numberOfTemporalItems); + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.onChangeTemporalOption = function () { + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.resetScriptParameter = function () { + kommonitorScriptHelperService.requiredScriptParameters_tmp = []; + $scope.parameterDefaultValue_computationIndicator = undefined; + if ($scope.compIndicatorSelection && $scope.compIndicatorSelection.indicatorId) { + $scope.parameterDefaultValue_computationIndicator = $scope.compIndicatorSelection.indicatorId; + } + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationIndicator, $scope.parameterDescription_computationIndicator, $scope.parameterDataType, $scope.parameterDefaultValue_computationIndicator, $scope.parameterNumericMinValue_computationIndicator, $scope.parameterNumericMaxValue_computationIndicator); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_numTemporalItems, $scope.parameterDescription_numTemporalItems, $scope.parameterDataType_numTemporalItems, $scope.numberOfTemporalItems, $scope.parameterNumericMinValue_numTemporalItems, $scope.parameterNumericMaxValue_numTemporalItems); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_temporalOption, $scope.parameterDescription_temporalOption, $scope.parameterDataType, $scope.temporalOption.apiName, $scope.parameterNumericMinValue_temporalOption, $scope.parameterNumericMaxValue_temporalOption); + }; + $scope.resetComputationFormulaAndLegend = function () { + kommonitorScriptHelperService.scriptFormulaHTML = ""; + if (!$scope.compIndicatorSelection) { + return; + } + var formulaHTML = "Berechnung gemäß Formel
$$ 100 \\times \\frac{A_{N} - A_{M}}{A_{M}} $$"; + var legendItemsHTML = "Legende zur Formel"; + legendItemsHTML += "
$A$: " + $scope.compIndicatorSelection.indicatorName + " [" + $scope.compIndicatorSelection.unit + "]"; + legendItemsHTML += "
$N$: Ziel-Zeitpunkt"; + legendItemsHTML += "
$M$: Ziel-Zeitpunkt minus " + $scope.numberOfTemporalItems + " " + $scope.temporalOption.displayName; + kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; + }; + } + ] }); +//# sourceMappingURL=script-change-relative.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelative/script-change-relative.component.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelative/script-change-relative.component.js.map new file mode 100644 index 000000000..c83d3998f --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelative/script-change-relative.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-change-relative.component.js","sourceRoot":"","sources":["script-change-relative.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC,SAAS,CAAC,sBAAsB,EAAE;IACxE,WAAW,EAAE,sIAAsI;IACnJ,UAAU,EAAE,CAAC,+BAA+B,EAAE,+BAA+B,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU;QAClI,SAAS,8BAA8B,CAAC,6BAA6B,EAAE,6BAA6B,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ;YAE/I,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAC3E,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAE3E,sCAAsC;YACtC,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,CAAC;YAEtB,MAAM,CAAC,oBAAoB,GAAG,wEAAwE,CAAC;YAEvG,MAAM,CAAC,qBAAqB,GAAG,SAAS,CAAC;YAEzC,MAAM,CAAC,sBAAsB,GAAG,SAAS,CAAC;YAC1C,MAAM,CAAC,0BAA0B,GAAG,SAAS,CAAC;YAE9C,MAAM,CAAC,kCAAkC,GAAG,gBAAgB,CAAC;YAC7D,MAAM,CAAC,yCAAyC,GAAG,qCAAqC,CAAC;YACzF,MAAM,CAAC,0CAA0C,GAAG,SAAS,CAAC;YAC9D,MAAM,CAAC,6CAA6C,GAAG,CAAC,CAAC;YACzD,MAAM,CAAC,6CAA6C,GAAG,CAAC,CAAC;YAEzD,MAAM,CAAC,cAAc,GAAG,6BAA6B,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;YAEzE,MAAM,CAAC,qBAAqB,GAAG,CAAC,CAAC;YAEjC,MAAM,CAAC,4BAA4B,GAAG,eAAe,CAAC;YACtD,MAAM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ptAddModal/scriptDefinition/changeRelative/script-change-relative.component.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelative/script-change-relative.component.ts new file mode 100644 index 000000000..2edbdc67e --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelative/script-change-relative.component.ts @@ -0,0 +1,149 @@ +angular.module('scriptChangeRelative').component('scriptChangeRelative', { + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelative/script-change-relative.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + function ScriptChangeRelativeController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_relChange_nTemporalItems.js"; + + $scope.tmpIndicatorSelection = undefined; + + $scope.compIndicatorSelection = undefined; + $scope.compIndicatorSelection_old = undefined; + + $scope.parameterName_computationIndicator = "COMPUTATION_ID"; + $scope.parameterDescription_computationIndicator = "Indikatoren-ID des Basisindikators."; + $scope.parameterDefaultValue_computationIndicator = undefined; + $scope.parameterNumericMinValue_computationIndicator = 0; + $scope.parameterNumericMaxValue_computationIndicator = 1; + + $scope.temporalOption = kommonitorScriptHelperService.temporalOptions[0]; + + $scope.numberOfTemporalItems = 1; + + $scope.parameterName_temporalOption = "TEMPORAL_TYPE"; + $scope.parameterDescription_temporalOption = "Angabe des Zeitbezug-Typs. Standard ist 'Jahre'."; + $scope.parameterDefaultValue_temporalOption = "YEARS"; + $scope.parameterNumericMinValue_temporalOption = 0; + $scope.parameterNumericMaxValue_temporalOption = 1; + + $scope.parameterName_numTemporalItems = "NUMBER_OF_TEMPORAL_ITEMS"; + $scope.parameterDescription_numTemporalItems = "Anzahl der Zeiteinheiten. Standard ist '1'."; + $scope.parameterDefaultValue_numTemporalItems = 1; + $scope.parameterNumericMinValue_numTemporalItems = 1; + $scope.parameterNumericMaxValue_numTemporalItems = 100000; + $scope.parameterDataType_numTemporalItems = kommonitorScriptHelperService.availableScriptDataTypes[3]; + + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + + $scope.scriptFormulaHTML = undefined; + + /* + * reset relevant things due to change of script type + */ + $scope.init = function(){ + kommonitorScriptHelperService.reset(); + + $scope.initFixedScriptCode(); + }; + + $scope.initFixedScriptCode = function(){ + $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + + $scope.init(); + + $scope.onChangeComputationIndicator = function(compIndicatorSelection){ + // remove previous refIndicator from requiredIndicators and add new one + if($scope.compIndicatorSelection_old){ + kommonitorScriptHelperService.removeBaseIndicator($scope.compIndicatorSelection_old); + } + kommonitorScriptHelperService.addBaseIndicator(compIndicatorSelection); + + $scope.compIndicatorSelection_old = compIndicatorSelection; + + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + + }; + + $scope.onChangeNumTemporalItems = function(){ + $scope.numberOfTemporalItems = Math.round($scope.numberOfTemporalItems); + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + + $scope.onChangeTemporalOption = function(){ + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + + $scope.resetScriptParameter = function(){ + kommonitorScriptHelperService.requiredScriptParameters_tmp = []; + + $scope.parameterDefaultValue_computationIndicator = undefined; + + if($scope.compIndicatorSelection && $scope.compIndicatorSelection.indicatorId){ + $scope.parameterDefaultValue_computationIndicator = $scope.compIndicatorSelection.indicatorId; + } + + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationIndicator, $scope.parameterDescription_computationIndicator, $scope.parameterDataType, $scope.parameterDefaultValue_computationIndicator, $scope.parameterNumericMinValue_computationIndicator, $scope.parameterNumericMaxValue_computationIndicator); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_numTemporalItems, $scope.parameterDescription_numTemporalItems, $scope.parameterDataType_numTemporalItems, $scope.numberOfTemporalItems, $scope.parameterNumericMinValue_numTemporalItems, $scope.parameterNumericMaxValue_numTemporalItems); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_temporalOption, $scope.parameterDescription_temporalOption, $scope.parameterDataType, $scope.temporalOption.apiName, $scope.parameterNumericMinValue_temporalOption, $scope.parameterNumericMaxValue_temporalOption); + }; + + $scope.resetComputationFormulaAndLegend = function(){ + kommonitorScriptHelperService.scriptFormulaHTML = ""; + + if (! $scope.compIndicatorSelection){ + return; + } + + var formulaHTML = "Berechnung gemäß Formel
$$ 100 \\times \\frac{A_{N} - A_{M}}{A_{M}} $$"; + var legendItemsHTML = "Legende zur Formel"; + + legendItemsHTML+="
$A$: " + $scope.compIndicatorSelection.indicatorName + " [" + $scope.compIndicatorSelection.unit + "]"; + legendItemsHTML+="
$N$: Ziel-Zeitpunkt"; + legendItemsHTML+="
$M$: Ziel-Zeitpunkt minus " + $scope.numberOfTemporalItems + " " + $scope.temporalOption.displayName ; + + kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; + + }; + + } + ] +}); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelative/script-change-relative.module.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelative/script-change-relative.module.js index 2c346192e..d1e194742 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelative/script-change-relative.module.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelative/script-change-relative.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('scriptChangeRelative', ['kommonitorDataExchange', 'kommonitorScriptHelper']); +//# sourceMappingURL=script-change-relative.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelative/script-change-relative.module.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelative/script-change-relative.module.js.map new file mode 100644 index 000000000..16f6bb39c --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelative/script-change-relative.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-change-relative.module.js","sourceRoot":"","sources":["script-change-relative.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,sBAAsB,EAAE,CAAC,wBAAwB,EAAE,wBAAwB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelative/script-change-relative.module.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelative/script-change-relative.module.ts new file mode 100644 index 000000000..2c346192e --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelative/script-change-relative.module.ts @@ -0,0 +1 @@ +angular.module('scriptChangeRelative', ['kommonitorDataExchange', 'kommonitorScriptHelper']); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelativeRefDate/script-change-relative-ref-date.component.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelativeRefDate/script-change-relative-ref-date.component.js index c51b1b72e..bd7a2d8d1 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelativeRefDate/script-change-relative-ref-date.component.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelativeRefDate/script-change-relative-ref-date.component.js @@ -1,139 +1,108 @@ +"use strict"; angular.module('scriptChangeRelativeRefDate').component('scriptChangeRelativeRefDate', { - templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelativeRefDate/script-change-relative-ref-date.template.html", - controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', - function ScriptChangeRelativeRefDateController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; - - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_relChange_refDate.js"; - - $scope.tmpIndicatorSelection = undefined; - - $scope.compIndicatorSelection = undefined; - $scope.compIndicatorSelection_old = undefined; - - $scope.parameterName_computationIndicator = "COMPUTATION_ID"; - $scope.parameterDescription_computationIndicator = "Indikatoren-ID des Basisindikators."; - $scope.parameterDefaultValue_computationIndicator = undefined; - $scope.parameterNumericMinValue_computationIndicator = 0; - $scope.parameterNumericMaxValue_computationIndicator = 1; - - $scope.referenceDate = ""; - - $scope.parameterName_referenceDate = "REFERENCE_DATE"; - $scope.parameterDescription_referenceDate = "konkretes Referenzdatum im Format 'YYYY-MM-DD'"; - $scope.parameterDefaultValue_referenceDate = ""; - $scope.parameterNumericMinValue_referenceDate = 0; - $scope.parameterNumericMaxValue_referenceDate = 1; - - /* - availableScriptDataTypes = [ - { - "displayName": "Textuell (String)", - "apiName": "string" - }, - { - "displayName": "Wahrheitswert (Boolean)", - "apiName": "boolean" - }, - { - "displayName": "Ganzzahl (Integer)", - "apiName": "integer" - }, - { - "displayName": "Gleitkommazahl (Double)", - "apiName": "double" - } - ]; - */ - $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; - - $scope.scriptCode_readableString_forPreview = undefined; - $scope.scriptCodeDomElementId = "#scriptCodePreview"; - - $scope.scriptFormulaHTML = undefined; - - /* - * reset relevant things due to change of script type - */ - $scope.init = function(){ - kommonitorScriptHelperService.reset(); - - $scope.initFixedScriptCode(); - }; - - $scope.initFixedScriptCode = function(){ - $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { - $scope.scriptCode_readableString_forPreview = response.data; - kommonitorScriptHelperService.scriptCode_readableString = response.data; - $scope.scriptCode_readableString_forPreview = response.data; - - kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); - }); - }; - - $scope.init(); - - $scope.onChangeComputationIndicator = function(compIndicatorSelection){ - // remove previous refIndicator from requiredIndicators and add new one - if($scope.compIndicatorSelection_old){ - kommonitorScriptHelperService.removeBaseIndicator($scope.compIndicatorSelection_old); - } - kommonitorScriptHelperService.addBaseIndicator(compIndicatorSelection); - - $scope.compIndicatorSelection_old = compIndicatorSelection; - - $scope.resetScriptParameter(); - $scope.resetComputationFormulaAndLegend(); - - }; - - $scope.onChangeNumTemporalItems = function(){ - $scope.numberOfTemporalItems = Math.round($scope.numberOfTemporalItems); - $scope.resetScriptParameter(); - $scope.resetComputationFormulaAndLegend(); - }; - - $scope.onChangeReferenceDate = function(){ - $scope.resetScriptParameter(); - $scope.resetComputationFormulaAndLegend(); - }; - - $scope.resetScriptParameter = function(){ - kommonitorScriptHelperService.requiredScriptParameters_tmp = []; - - $scope.parameterDefaultValue_computationIndicator = undefined; - - if($scope.compIndicatorSelection && $scope.compIndicatorSelection.indicatorId){ - $scope.parameterDefaultValue_computationIndicator = $scope.compIndicatorSelection.indicatorId; - } - - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationIndicator, $scope.parameterDescription_computationIndicator, $scope.parameterDataType, $scope.parameterDefaultValue_computationIndicator, $scope.parameterNumericMinValue_computationIndicator, $scope.parameterNumericMaxValue_computationIndicator); - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_referenceDate, $scope.parameterDescription_referenceDate, $scope.parameterDataType, $scope.referenceDate, $scope.parameterNumericMinValue_referenceDate, $scope.parameterNumericMaxValue_referenceDate); - }; - - $scope.resetComputationFormulaAndLegend = function(){ - kommonitorScriptHelperService.scriptFormulaHTML = ""; - - if (! $scope.compIndicatorSelection){ - return; - } - - var formulaHTML = "Berechnung gemäß Formel
$$ 100 \\times \\frac{A_{N} - A_{M}}{A_{M}} $$"; - var legendItemsHTML = "Legende zur Formel"; - - legendItemsHTML+="
$A$: " + $scope.compIndicatorSelection.indicatorName + " [" + $scope.compIndicatorSelection.unit + "]"; - legendItemsHTML+="
$N$: Ziel-Zeitpunkt"; - legendItemsHTML+="
$M$: fester Referenz-Zeitpunkt '" + $scope.referenceDate + "'"; - - kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; - - }; - - } - ] + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelativeRefDate/script-change-relative-ref-date.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + function ScriptChangeRelativeRefDateController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_relChange_refDate.js"; + $scope.tmpIndicatorSelection = undefined; + $scope.compIndicatorSelection = undefined; + $scope.compIndicatorSelection_old = undefined; + $scope.parameterName_computationIndicator = "COMPUTATION_ID"; + $scope.parameterDescription_computationIndicator = "Indikatoren-ID des Basisindikators."; + $scope.parameterDefaultValue_computationIndicator = undefined; + $scope.parameterNumericMinValue_computationIndicator = 0; + $scope.parameterNumericMaxValue_computationIndicator = 1; + $scope.referenceDate = ""; + $scope.parameterName_referenceDate = "REFERENCE_DATE"; + $scope.parameterDescription_referenceDate = "konkretes Referenzdatum im Format 'YYYY-MM-DD'"; + $scope.parameterDefaultValue_referenceDate = ""; + $scope.parameterNumericMinValue_referenceDate = 0; + $scope.parameterNumericMaxValue_referenceDate = 1; + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + $scope.scriptFormulaHTML = undefined; + /* + * reset relevant things due to change of script type + */ + $scope.init = function () { + kommonitorScriptHelperService.reset(); + $scope.initFixedScriptCode(); + }; + $scope.initFixedScriptCode = function () { + $http.get($scope.pathToScriptResource, { 'responseType': 'text' }).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + $scope.init(); + $scope.onChangeComputationIndicator = function (compIndicatorSelection) { + // remove previous refIndicator from requiredIndicators and add new one + if ($scope.compIndicatorSelection_old) { + kommonitorScriptHelperService.removeBaseIndicator($scope.compIndicatorSelection_old); + } + kommonitorScriptHelperService.addBaseIndicator(compIndicatorSelection); + $scope.compIndicatorSelection_old = compIndicatorSelection; + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.onChangeNumTemporalItems = function () { + $scope.numberOfTemporalItems = Math.round($scope.numberOfTemporalItems); + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.onChangeReferenceDate = function () { + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.resetScriptParameter = function () { + kommonitorScriptHelperService.requiredScriptParameters_tmp = []; + $scope.parameterDefaultValue_computationIndicator = undefined; + if ($scope.compIndicatorSelection && $scope.compIndicatorSelection.indicatorId) { + $scope.parameterDefaultValue_computationIndicator = $scope.compIndicatorSelection.indicatorId; + } + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationIndicator, $scope.parameterDescription_computationIndicator, $scope.parameterDataType, $scope.parameterDefaultValue_computationIndicator, $scope.parameterNumericMinValue_computationIndicator, $scope.parameterNumericMaxValue_computationIndicator); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_referenceDate, $scope.parameterDescription_referenceDate, $scope.parameterDataType, $scope.referenceDate, $scope.parameterNumericMinValue_referenceDate, $scope.parameterNumericMaxValue_referenceDate); + }; + $scope.resetComputationFormulaAndLegend = function () { + kommonitorScriptHelperService.scriptFormulaHTML = ""; + if (!$scope.compIndicatorSelection) { + return; + } + var formulaHTML = "Berechnung gemäß Formel
$$ 100 \\times \\frac{A_{N} - A_{M}}{A_{M}} $$"; + var legendItemsHTML = "Legende zur Formel"; + legendItemsHTML += "
$A$: " + $scope.compIndicatorSelection.indicatorName + " [" + $scope.compIndicatorSelection.unit + "]"; + legendItemsHTML += "
$N$: Ziel-Zeitpunkt"; + legendItemsHTML += "
$M$: fester Referenz-Zeitpunkt '" + $scope.referenceDate + "'"; + kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; + }; + } + ] }); +//# sourceMappingURL=script-change-relative-ref-date.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelativeRefDate/script-change-relative-ref-date.component.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelativeRefDate/script-change-relative-ref-date.component.js.map new file mode 100644 index 000000000..18414bded --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelativeRefDate/script-change-relative-ref-date.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-change-relative-ref-date.component.js","sourceRoot":"","sources":["script-change-relative-ref-date.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,CAAC,SAAS,CAAC,6BAA6B,EAAE;IACtF,WAAW,EAAE,sJAAsJ;IACnK,UAAU,EAAE,CAAC,+BAA+B,EAAE,+BAA+B,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU;QAClI,SAAS,qCAAqC,CAAC,6BAA6B,EAAE,6BAA6B,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ;YAEtJ,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAC3E,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAE3E,sCAAsC;YACtC,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,CAAC;YAEtB,MAAM,CAAC,oBAAoB,GAAG,iEAAiE,CAAC;YAEhG,MAAM,CAAC,qBAAqB,GAAG,SAAS,CAAC;YAEzC,MAAM,CAAC,sBAAsB,GAAG,SAAS,CAAC;YAC1C,MAAM,CAAC,0BAA0B,GAAG,SAAS,CAAC;YAE9C,MAAM,CAAC,kCAAkC,GAAG,gBAAgB,CAAC;YAC7D,MAAM,CAAC,yCAAyC,GAAG,qCAAqC,CAAC;YACzF,MAAM,CAAC,0CAA0C,GAAG,SAAS,CAAC;YAC9D,MAAM,CAAC,6CAA6C,GAAG,CAAC,CAAC;YACz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AAC,2BAA2B,EAAE,MAAM,CAAC,kCAAkC,EAAE,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,sCAAsC,EAAE,MAAM,CAAC,sCAAsC,CAAC,CAAC;YAC/Q,CAAC,CAAC;YAEF,MAAM,CAAC,gCAAgC,GAAG;gBACzC,6BAA6B,CAAC,iBAAiB,GAAG,EAAE,CAAC;gBAErD,IAAI,CAAE,MAAM,CAAC,sBAAsB,EAAC;oBACnC,OAAO;iBACP;gBAEA,IAAI,WAAW,GAAG,2FAA2F,CAAC;gBAC9G,IAAI,eAAe,GAAG,2BAA2B,CAAC;gBAElD,eAAe,IAAE,aAAa,GAAG,MAAM,CAAC,sBAAsB,CAAC,aAAa,GAAG,IAAI,GAAG,MAAM,CAAC,sBAAsB,CAAC,IAAI,GAAI,GAAG,CAAC;gBAChI,eAAe,IAAE,2BAA2B,CAAC;gBAC7C,eAAe,IAAE,wCAAwC,GAAG,MAAM,CAAC,aAAa,GAAG,GAAG,CAAC;gBAEvF,6BAA6B,CAAC,iBAAiB,GAAG,WAAW,GAAG,YAAY,GAAG,eAAe,CAAC;YAEjG,CAAC,CAAC;QAEH,CAAC;KACD;CACD,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelativeRefDate/script-change-relative-ref-date.component.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelativeRefDate/script-change-relative-ref-date.component.ts new file mode 100644 index 000000000..c51b1b72e --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelativeRefDate/script-change-relative-ref-date.component.ts @@ -0,0 +1,139 @@ +angular.module('scriptChangeRelativeRefDate').component('scriptChangeRelativeRefDate', { + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelativeRefDate/script-change-relative-ref-date.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + function ScriptChangeRelativeRefDateController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_relChange_refDate.js"; + + $scope.tmpIndicatorSelection = undefined; + + $scope.compIndicatorSelection = undefined; + $scope.compIndicatorSelection_old = undefined; + + $scope.parameterName_computationIndicator = "COMPUTATION_ID"; + $scope.parameterDescription_computationIndicator = "Indikatoren-ID des Basisindikators."; + $scope.parameterDefaultValue_computationIndicator = undefined; + $scope.parameterNumericMinValue_computationIndicator = 0; + $scope.parameterNumericMaxValue_computationIndicator = 1; + + $scope.referenceDate = ""; + + $scope.parameterName_referenceDate = "REFERENCE_DATE"; + $scope.parameterDescription_referenceDate = "konkretes Referenzdatum im Format 'YYYY-MM-DD'"; + $scope.parameterDefaultValue_referenceDate = ""; + $scope.parameterNumericMinValue_referenceDate = 0; + $scope.parameterNumericMaxValue_referenceDate = 1; + + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + + $scope.scriptFormulaHTML = undefined; + + /* + * reset relevant things due to change of script type + */ + $scope.init = function(){ + kommonitorScriptHelperService.reset(); + + $scope.initFixedScriptCode(); + }; + + $scope.initFixedScriptCode = function(){ + $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + + $scope.init(); + + $scope.onChangeComputationIndicator = function(compIndicatorSelection){ + // remove previous refIndicator from requiredIndicators and add new one + if($scope.compIndicatorSelection_old){ + kommonitorScriptHelperService.removeBaseIndicator($scope.compIndicatorSelection_old); + } + kommonitorScriptHelperService.addBaseIndicator(compIndicatorSelection); + + $scope.compIndicatorSelection_old = compIndicatorSelection; + + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + + }; + + $scope.onChangeNumTemporalItems = function(){ + $scope.numberOfTemporalItems = Math.round($scope.numberOfTemporalItems); + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + + $scope.onChangeReferenceDate = function(){ + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + + $scope.resetScriptParameter = function(){ + kommonitorScriptHelperService.requiredScriptParameters_tmp = []; + + $scope.parameterDefaultValue_computationIndicator = undefined; + + if($scope.compIndicatorSelection && $scope.compIndicatorSelection.indicatorId){ + $scope.parameterDefaultValue_computationIndicator = $scope.compIndicatorSelection.indicatorId; + } + + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationIndicator, $scope.parameterDescription_computationIndicator, $scope.parameterDataType, $scope.parameterDefaultValue_computationIndicator, $scope.parameterNumericMinValue_computationIndicator, $scope.parameterNumericMaxValue_computationIndicator); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_referenceDate, $scope.parameterDescription_referenceDate, $scope.parameterDataType, $scope.referenceDate, $scope.parameterNumericMinValue_referenceDate, $scope.parameterNumericMaxValue_referenceDate); + }; + + $scope.resetComputationFormulaAndLegend = function(){ + kommonitorScriptHelperService.scriptFormulaHTML = ""; + + if (! $scope.compIndicatorSelection){ + return; + } + + var formulaHTML = "Berechnung gemäß Formel
$$ 100 \\times \\frac{A_{N} - A_{M}}{A_{M}} $$"; + var legendItemsHTML = "Legende zur Formel"; + + legendItemsHTML+="
$A$: " + $scope.compIndicatorSelection.indicatorName + " [" + $scope.compIndicatorSelection.unit + "]"; + legendItemsHTML+="
$N$: Ziel-Zeitpunkt"; + legendItemsHTML+="
$M$: fester Referenz-Zeitpunkt '" + $scope.referenceDate + "'"; + + kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; + + }; + + } + ] +}); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelativeRefDate/script-change-relative-ref-date.module.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelativeRefDate/script-change-relative-ref-date.module.js index b7d28c43d..c1fc4756b 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelativeRefDate/script-change-relative-ref-date.module.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelativeRefDate/script-change-relative-ref-date.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('scriptChangeRelativeRefDate', ['kommonitorDataExchange', 'kommonitorScriptHelper']); +//# sourceMappingURL=script-change-relative-ref-date.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelativeRefDate/script-change-relative-ref-date.module.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelativeRefDate/script-change-relative-ref-date.module.js.map new file mode 100644 index 000000000..2855ef362 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelativeRefDate/script-change-relative-ref-date.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-change-relative-ref-date.module.js","sourceRoot":"","sources":["script-change-relative-ref-date.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,6BAA6B,EAAE,CAAC,wBAAwB,EAAE,wBAAwB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelativeRefDate/script-change-relative-ref-date.module.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelativeRefDate/script-change-relative-ref-date.module.ts new file mode 100644 index 000000000..b7d28c43d --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/changeRelativeRefDate/script-change-relative-ref-date.module.ts @@ -0,0 +1 @@ +angular.module('scriptChangeRelativeRefDate', ['kommonitorDataExchange', 'kommonitorScriptHelper']); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/continuity/script-continuity.component.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/continuity/script-continuity.component.js index 40efd1dd1..4b4608bcb 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/continuity/script-continuity.component.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/continuity/script-continuity.component.js @@ -1,153 +1,120 @@ +"use strict"; angular.module('scriptContinuity').component('scriptContinuity', { - templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/continuity/script-continuity.template.html", - controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', - function ScriptContinuityController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; - - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_continuity_nTemporalItems.js"; - - $scope.tmpIndicatorSelection = undefined; - - $scope.compIndicatorSelection = undefined; - $scope.compIndicatorSelection_old = undefined; - - $scope.parameterName_computationIndicator = "COMPUTATION_ID"; - $scope.parameterDescription_computationIndicator = "Indikatoren-ID des Basisindikators."; - $scope.parameterDefaultValue_computationIndicator = undefined; - $scope.parameterNumericMinValue_computationIndicator = 0; - $scope.parameterNumericMaxValue_computationIndicator = 1; - - $scope.temporalOption = kommonitorScriptHelperService.temporalOptions[0]; - - $scope.numberOfTemporalItems = 3; - - $scope.parameterName_temporalOption = "TEMPORAL_TYPE"; - $scope.parameterDescription_temporalOption = "Angabe des Zeitbezug-Typs. Standard ist 'Jahre'."; - $scope.parameterDefaultValue_temporalOption = "YEARS"; - $scope.parameterNumericMinValue_temporalOption = 0; - $scope.parameterNumericMaxValue_temporalOption = 1; - - $scope.parameterName_numTemporalItems = "NUMBER_OF_TEMPORAL_ITEMS"; - $scope.parameterDescription_numTemporalItems = "Anzahl der Zeiteinheiten. Standard ist '3'."; - $scope.parameterDefaultValue_numTemporalItems = 3; - $scope.parameterNumericMinValue_numTemporalItems = 3; - $scope.parameterNumericMaxValue_numTemporalItems = 100000; - $scope.parameterDataType_numTemporalItems = kommonitorScriptHelperService.availableScriptDataTypes[3]; - - /* - availableScriptDataTypes = [ - { - "displayName": "Textuell (String)", - "apiName": "string" - }, - { - "displayName": "Wahrheitswert (Boolean)", - "apiName": "boolean" - }, - { - "displayName": "Ganzzahl (Integer)", - "apiName": "integer" - }, - { - "displayName": "Gleitkommazahl (Double)", - "apiName": "double" - } - ]; - */ - $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; - - $scope.scriptCode_readableString_forPreview = undefined; - $scope.scriptCodeDomElementId = "#scriptCodePreview"; - - $scope.scriptFormulaHTML = undefined; - - /* - * reset relevant things due to change of script type - */ - $scope.init = function(){ - kommonitorScriptHelperService.reset(); - - $scope.initFixedScriptCode(); - }; - - $scope.initFixedScriptCode = function(){ - $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { - $scope.scriptCode_readableString_forPreview = response.data; - kommonitorScriptHelperService.scriptCode_readableString = response.data; - $scope.scriptCode_readableString_forPreview = response.data; - - kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); - }); - }; - - $scope.init(); - - $scope.onChangeComputationIndicator = function(compIndicatorSelection){ - // remove previous refIndicator from requiredIndicators and add new one - if($scope.compIndicatorSelection_old){ - kommonitorScriptHelperService.removeBaseIndicator($scope.compIndicatorSelection_old); - } - kommonitorScriptHelperService.addBaseIndicator(compIndicatorSelection); - - $scope.compIndicatorSelection_old = compIndicatorSelection; - - $scope.resetScriptParameter(); - $scope.resetComputationFormulaAndLegend(); - - }; - - $scope.onChangeNumTemporalItems = function(){ - $scope.numberOfTemporalItems = Math.round($scope.numberOfTemporalItems); - $scope.resetScriptParameter(); - $scope.resetComputationFormulaAndLegend(); - }; - - $scope.onChangeTemporalOption = function(){ - $scope.resetScriptParameter(); - $scope.resetComputationFormulaAndLegend(); - }; - - $scope.resetScriptParameter = function(){ - kommonitorScriptHelperService.requiredScriptParameters_tmp = []; - - $scope.parameterDefaultValue_computationIndicator = undefined; - - if($scope.compIndicatorSelection && $scope.compIndicatorSelection.indicatorId){ - $scope.parameterDefaultValue_computationIndicator = $scope.compIndicatorSelection.indicatorId; - } - - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationIndicator, $scope.parameterDescription_computationIndicator, $scope.parameterDataType, $scope.parameterDefaultValue_computationIndicator, $scope.parameterNumericMinValue_computationIndicator, $scope.parameterNumericMaxValue_computationIndicator); - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_numTemporalItems, $scope.parameterDescription_numTemporalItems, $scope.parameterDataType_numTemporalItems, $scope.numberOfTemporalItems, $scope.parameterNumericMinValue_numTemporalItems, $scope.parameterNumericMaxValue_numTemporalItems); - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_temporalOption, $scope.parameterDescription_temporalOption, $scope.parameterDataType, $scope.temporalOption.apiName, $scope.parameterNumericMinValue_temporalOption, $scope.parameterNumericMaxValue_temporalOption); - }; - - $scope.resetComputationFormulaAndLegend = function(){ - kommonitorScriptHelperService.scriptFormulaHTML = ""; - - if (! $scope.compIndicatorSelection){ - return; - } - - var formulaHTML = "Berechnung gemäß Formel
$$ r = \\frac{\\sum_{n=1}^{m}((A_{n} - \\bar{A}) \\times (B_{n} - \\bar{B}))}{\\sqrt{\\sum_{n=1}^{m} (A_{n} - \\bar{A})^2 \\times \\sum_{n=1}^{m} (B_{n} - \\bar{B})^2}} $$"; - var legendItemsHTML = "Legende zur Formel"; - - legendItemsHTML+="
$r$: Kontinuität (Korrelationskoeffizient nach Pearson bei linearer Regression über die betrachtete Zeitspanne)"; - legendItemsHTML+="
$m$ = " + $scope.numberOfTemporalItems + " konsekutive vergangene " + $scope.temporalOption.displayName; - legendItemsHTML+="
$A_{n}$ = aufeinander folgende " + $scope.temporalOption.displayName; - legendItemsHTML+="
$\\bar{A}$ = arithmetisches Mittel der aufeinander folgenden " + $scope.temporalOption.displayName; - legendItemsHTML+="
$B_{n}$ = Indikatorenwerte der aufeinander folgenden " + $scope.temporalOption.displayName; - legendItemsHTML+="
$\\bar{B}$ = arithmetisches Mittel der Indikatorenwerte der aufeinander folgenden " + $scope.temporalOption.displayName; - legendItemsHTML+="
$B$ = Indikator '" + $scope.compIndicatorSelection.indicatorName + " [" + $scope.compIndicatorSelection.unit + "]'"; - - kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; - - }; - - } - ] + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/continuity/script-continuity.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + function ScriptContinuityController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_continuity_nTemporalItems.js"; + $scope.tmpIndicatorSelection = undefined; + $scope.compIndicatorSelection = undefined; + $scope.compIndicatorSelection_old = undefined; + $scope.parameterName_computationIndicator = "COMPUTATION_ID"; + $scope.parameterDescription_computationIndicator = "Indikatoren-ID des Basisindikators."; + $scope.parameterDefaultValue_computationIndicator = undefined; + $scope.parameterNumericMinValue_computationIndicator = 0; + $scope.parameterNumericMaxValue_computationIndicator = 1; + $scope.temporalOption = kommonitorScriptHelperService.temporalOptions[0]; + $scope.numberOfTemporalItems = 3; + $scope.parameterName_temporalOption = "TEMPORAL_TYPE"; + $scope.parameterDescription_temporalOption = "Angabe des Zeitbezug-Typs. Standard ist 'Jahre'."; + $scope.parameterDefaultValue_temporalOption = "YEARS"; + $scope.parameterNumericMinValue_temporalOption = 0; + $scope.parameterNumericMaxValue_temporalOption = 1; + $scope.parameterName_numTemporalItems = "NUMBER_OF_TEMPORAL_ITEMS"; + $scope.parameterDescription_numTemporalItems = "Anzahl der Zeiteinheiten. Standard ist '3'."; + $scope.parameterDefaultValue_numTemporalItems = 3; + $scope.parameterNumericMinValue_numTemporalItems = 3; + $scope.parameterNumericMaxValue_numTemporalItems = 100000; + $scope.parameterDataType_numTemporalItems = kommonitorScriptHelperService.availableScriptDataTypes[3]; + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + $scope.scriptFormulaHTML = undefined; + /* + * reset relevant things due to change of script type + */ + $scope.init = function () { + kommonitorScriptHelperService.reset(); + $scope.initFixedScriptCode(); + }; + $scope.initFixedScriptCode = function () { + $http.get($scope.pathToScriptResource, { 'responseType': 'text' }).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + $scope.init(); + $scope.onChangeComputationIndicator = function (compIndicatorSelection) { + // remove previous refIndicator from requiredIndicators and add new one + if ($scope.compIndicatorSelection_old) { + kommonitorScriptHelperService.removeBaseIndicator($scope.compIndicatorSelection_old); + } + kommonitorScriptHelperService.addBaseIndicator(compIndicatorSelection); + $scope.compIndicatorSelection_old = compIndicatorSelection; + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.onChangeNumTemporalItems = function () { + $scope.numberOfTemporalItems = Math.round($scope.numberOfTemporalItems); + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.onChangeTemporalOption = function () { + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.resetScriptParameter = function () { + kommonitorScriptHelperService.requiredScriptParameters_tmp = []; + $scope.parameterDefaultValue_computationIndicator = undefined; + if ($scope.compIndicatorSelection && $scope.compIndicatorSelection.indicatorId) { + $scope.parameterDefaultValue_computationIndicator = $scope.compIndicatorSelection.indicatorId; + } + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationIndicator, $scope.parameterDescription_computationIndicator, $scope.parameterDataType, $scope.parameterDefaultValue_computationIndicator, $scope.parameterNumericMinValue_computationIndicator, $scope.parameterNumericMaxValue_computationIndicator); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_numTemporalItems, $scope.parameterDescription_numTemporalItems, $scope.parameterDataType_numTemporalItems, $scope.numberOfTemporalItems, $scope.parameterNumericMinValue_numTemporalItems, $scope.parameterNumericMaxValue_numTemporalItems); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_temporalOption, $scope.parameterDescription_temporalOption, $scope.parameterDataType, $scope.temporalOption.apiName, $scope.parameterNumericMinValue_temporalOption, $scope.parameterNumericMaxValue_temporalOption); + }; + $scope.resetComputationFormulaAndLegend = function () { + kommonitorScriptHelperService.scriptFormulaHTML = ""; + if (!$scope.compIndicatorSelection) { + return; + } + var formulaHTML = "Berechnung gemäß Formel
$$ r = \\frac{\\sum_{n=1}^{m}((A_{n} - \\bar{A}) \\times (B_{n} - \\bar{B}))}{\\sqrt{\\sum_{n=1}^{m} (A_{n} - \\bar{A})^2 \\times \\sum_{n=1}^{m} (B_{n} - \\bar{B})^2}} $$"; + var legendItemsHTML = "Legende zur Formel"; + legendItemsHTML += "
$r$: Kontinuität (Korrelationskoeffizient nach Pearson bei linearer Regression über die betrachtete Zeitspanne)"; + legendItemsHTML += "
$m$ = " + $scope.numberOfTemporalItems + " konsekutive vergangene " + $scope.temporalOption.displayName; + legendItemsHTML += "
$A_{n}$ = aufeinander folgende " + $scope.temporalOption.displayName; + legendItemsHTML += "
$\\bar{A}$ = arithmetisches Mittel der aufeinander folgenden " + $scope.temporalOption.displayName; + legendItemsHTML += "
$B_{n}$ = Indikatorenwerte der aufeinander folgenden " + $scope.temporalOption.displayName; + legendItemsHTML += "
$\\bar{B}$ = arithmetisches Mittel der Indikatorenwerte der aufeinander folgenden " + $scope.temporalOption.displayName; + legendItemsHTML += "
$B$ = Indikator '" + $scope.compIndicatorSelection.indicatorName + " [" + $scope.compIndicatorSelection.unit + "]'"; + kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; + }; + } + ] }); +//# sourceMappingURL=script-continuity.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/continuity/script-continuity.component.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/continuity/script-continuity.component.js.map new file mode 100644 index 000000000..ca222bb0d --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/continuity/script-continuity.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-continuity.component.js","sourceRoot":"","sources":["script-continuity.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,SAAS,CAAC,kBAAkB,EAAE;IAChE,WAAW,EAAE,6HAA6H;IAC1I,UAAU,EAAE,CAAC,+BAA+B,EAAE,+BAA+B,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU;QAClI,SAAS,0BAA0B,CAAC,6BAA6B,EAAE,6BAA6B,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ;YAE3I,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAC3E,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAE3E,sCAAsC;YACtC,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,CAAC;YAEtB,MAAM,CAAC,oBAAoB,GAAG,yEAAyE,CAAC;YAExG,MAAM,CAAC,qBAAqB,GAAG,SAAS,CAAC;YAEzC,MAAM,CAAC,sBAAsB,GAAG,SAAS,CAAC;YAC1C,MAAM,CAAC,0BAA0B,GAAG,SAAS,CAAC;YAE9C,MAAM,CAAC,kCAAkC,GAAG,gBAAgB,CAAC;YAC7D,MAAM,CAAC,yCAAyC,GAAG,qCAAqC,CAAC;YACzF,MAAM,CAAC,0CAA0C,GAAG,SAAS,CAAC;YAC9D,MAAM,CAAC,6CAA6C,GAAG,CAAC,CAAC;YACzD,MAAM,CAAC,6CAA6C,GAAG,CAAC,CAAC;YAEzD,MAAM,CAAC,cAAc,GAAG,6BAA6B,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;YAEzE,MAAM,CAAC,qBAAqB,GAAG,CAAC,CAAC;YAEjC,MAAM,CAAC,4BAA4B,GAAG,eAAe,CAAC;YACtD,MAAM,CAAC,mCAAmC,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AAC,sBAAsB,CAAC,aAAa,GAAI,IAAI,GAAG,MAAM,CAAC,sBAAsB,CAAC,IAAI,GAAI,IAAI,CAAC;gBAE9I,6BAA6B,CAAC,iBAAiB,GAAG,WAAW,GAAG,YAAY,GAAG,eAAe,CAAC;YAEjG,CAAC,CAAC;QAEH,CAAC;KACD;CACD,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/continuity/script-continuity.component.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/continuity/script-continuity.component.ts new file mode 100644 index 000000000..40efd1dd1 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/continuity/script-continuity.component.ts @@ -0,0 +1,153 @@ +angular.module('scriptContinuity').component('scriptContinuity', { + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/continuity/script-continuity.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + function ScriptContinuityController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_continuity_nTemporalItems.js"; + + $scope.tmpIndicatorSelection = undefined; + + $scope.compIndicatorSelection = undefined; + $scope.compIndicatorSelection_old = undefined; + + $scope.parameterName_computationIndicator = "COMPUTATION_ID"; + $scope.parameterDescription_computationIndicator = "Indikatoren-ID des Basisindikators."; + $scope.parameterDefaultValue_computationIndicator = undefined; + $scope.parameterNumericMinValue_computationIndicator = 0; + $scope.parameterNumericMaxValue_computationIndicator = 1; + + $scope.temporalOption = kommonitorScriptHelperService.temporalOptions[0]; + + $scope.numberOfTemporalItems = 3; + + $scope.parameterName_temporalOption = "TEMPORAL_TYPE"; + $scope.parameterDescription_temporalOption = "Angabe des Zeitbezug-Typs. Standard ist 'Jahre'."; + $scope.parameterDefaultValue_temporalOption = "YEARS"; + $scope.parameterNumericMinValue_temporalOption = 0; + $scope.parameterNumericMaxValue_temporalOption = 1; + + $scope.parameterName_numTemporalItems = "NUMBER_OF_TEMPORAL_ITEMS"; + $scope.parameterDescription_numTemporalItems = "Anzahl der Zeiteinheiten. Standard ist '3'."; + $scope.parameterDefaultValue_numTemporalItems = 3; + $scope.parameterNumericMinValue_numTemporalItems = 3; + $scope.parameterNumericMaxValue_numTemporalItems = 100000; + $scope.parameterDataType_numTemporalItems = kommonitorScriptHelperService.availableScriptDataTypes[3]; + + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + + $scope.scriptFormulaHTML = undefined; + + /* + * reset relevant things due to change of script type + */ + $scope.init = function(){ + kommonitorScriptHelperService.reset(); + + $scope.initFixedScriptCode(); + }; + + $scope.initFixedScriptCode = function(){ + $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + + $scope.init(); + + $scope.onChangeComputationIndicator = function(compIndicatorSelection){ + // remove previous refIndicator from requiredIndicators and add new one + if($scope.compIndicatorSelection_old){ + kommonitorScriptHelperService.removeBaseIndicator($scope.compIndicatorSelection_old); + } + kommonitorScriptHelperService.addBaseIndicator(compIndicatorSelection); + + $scope.compIndicatorSelection_old = compIndicatorSelection; + + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + + }; + + $scope.onChangeNumTemporalItems = function(){ + $scope.numberOfTemporalItems = Math.round($scope.numberOfTemporalItems); + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + + $scope.onChangeTemporalOption = function(){ + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + + $scope.resetScriptParameter = function(){ + kommonitorScriptHelperService.requiredScriptParameters_tmp = []; + + $scope.parameterDefaultValue_computationIndicator = undefined; + + if($scope.compIndicatorSelection && $scope.compIndicatorSelection.indicatorId){ + $scope.parameterDefaultValue_computationIndicator = $scope.compIndicatorSelection.indicatorId; + } + + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationIndicator, $scope.parameterDescription_computationIndicator, $scope.parameterDataType, $scope.parameterDefaultValue_computationIndicator, $scope.parameterNumericMinValue_computationIndicator, $scope.parameterNumericMaxValue_computationIndicator); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_numTemporalItems, $scope.parameterDescription_numTemporalItems, $scope.parameterDataType_numTemporalItems, $scope.numberOfTemporalItems, $scope.parameterNumericMinValue_numTemporalItems, $scope.parameterNumericMaxValue_numTemporalItems); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_temporalOption, $scope.parameterDescription_temporalOption, $scope.parameterDataType, $scope.temporalOption.apiName, $scope.parameterNumericMinValue_temporalOption, $scope.parameterNumericMaxValue_temporalOption); + }; + + $scope.resetComputationFormulaAndLegend = function(){ + kommonitorScriptHelperService.scriptFormulaHTML = ""; + + if (! $scope.compIndicatorSelection){ + return; + } + + var formulaHTML = "Berechnung gemäß Formel
$$ r = \\frac{\\sum_{n=1}^{m}((A_{n} - \\bar{A}) \\times (B_{n} - \\bar{B}))}{\\sqrt{\\sum_{n=1}^{m} (A_{n} - \\bar{A})^2 \\times \\sum_{n=1}^{m} (B_{n} - \\bar{B})^2}} $$"; + var legendItemsHTML = "Legende zur Formel"; + + legendItemsHTML+="
$r$: Kontinuität (Korrelationskoeffizient nach Pearson bei linearer Regression über die betrachtete Zeitspanne)"; + legendItemsHTML+="
$m$ = " + $scope.numberOfTemporalItems + " konsekutive vergangene " + $scope.temporalOption.displayName; + legendItemsHTML+="
$A_{n}$ = aufeinander folgende " + $scope.temporalOption.displayName; + legendItemsHTML+="
$\\bar{A}$ = arithmetisches Mittel der aufeinander folgenden " + $scope.temporalOption.displayName; + legendItemsHTML+="
$B_{n}$ = Indikatorenwerte der aufeinander folgenden " + $scope.temporalOption.displayName; + legendItemsHTML+="
$\\bar{B}$ = arithmetisches Mittel der Indikatorenwerte der aufeinander folgenden " + $scope.temporalOption.displayName; + legendItemsHTML+="
$B$ = Indikator '" + $scope.compIndicatorSelection.indicatorName + " [" + $scope.compIndicatorSelection.unit + "]'"; + + kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; + + }; + + } + ] +}); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/continuity/script-continuity.module.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/continuity/script-continuity.module.js index 3fa4cd4af..6ae54e0fc 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/continuity/script-continuity.module.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/continuity/script-continuity.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('scriptContinuity', ['kommonitorDataExchange', 'kommonitorScriptHelper']); +//# sourceMappingURL=script-continuity.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/continuity/script-continuity.module.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/continuity/script-continuity.module.js.map new file mode 100644 index 000000000..8a3541720 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/continuity/script-continuity.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-continuity.module.js","sourceRoot":"","sources":["script-continuity.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,CAAC,wBAAwB,EAAE,wBAAwB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/continuity/script-continuity.module.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/continuity/script-continuity.module.ts new file mode 100644 index 000000000..3fa4cd4af --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/continuity/script-continuity.module.ts @@ -0,0 +1 @@ +angular.module('scriptContinuity', ['kommonitorDataExchange', 'kommonitorScriptHelper']); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/division/script-division.component.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/division/script-division.component.js index bc3b06943..d524ddd76 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/division/script-division.component.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/division/script-division.component.js @@ -1,141 +1,112 @@ +"use strict"; angular.module('scriptDivision').component('scriptDivision', { - templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/division/script-division.template.html", - controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', - function ScriptDivisionController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; - - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_divide.js"; - - $scope.tmpIndicatorSelection = undefined; - $scope.tmpGeoresourceSelection = undefined; - - $scope.refIndicatorSelection = undefined; - $scope.refIndicatorSelection_old = undefined; - - $scope.compIndicatorSelection = undefined; - $scope.compIndicatorSelection_old = undefined; - - $scope.parameterName_computationIndicators = "COMPUTATION_ID_numerator"; - $scope.parameterDescription_computationIndicators = "Indikatoren-ID des Dividenden."; - $scope.parameterDefaultValue_computationIndicators = undefined; - $scope.parameterNumericMinValue_computationIndicators = 0; - $scope.parameterNumericMaxValue_computationIndicators = 1; - - $scope.parameterName_referenceIndicator = "COMPUTATION_ID_denominator"; - $scope.parameterDescription_referenceIndicator = "Indikatoren-ID des Divisors."; - $scope.parameterDefaultValue_referenceIndicator = undefined; - $scope.parameterNumericMinValue_referenceIndicator = 0; - $scope.parameterNumericMaxValue_referenceIndicator = 1; - - /* - availableScriptDataTypes = [ - { - "displayName": "Textuell (String)", - "apiName": "string" - }, - { - "displayName": "Wahrheitswert (Boolean)", - "apiName": "boolean" - }, - { - "displayName": "Ganzzahl (Integer)", - "apiName": "integer" - }, - { - "displayName": "Gleitkommazahl (Double)", - "apiName": "double" - } - ]; - */ - $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; - - $scope.scriptCode_readableString_forPreview = undefined; - $scope.scriptCodeDomElementId = "#scriptCodePreview"; - - $scope.scriptFormulaHTML = undefined; - - /* - * reset relevant things due to change of script type - */ - $scope.init = function(){ - kommonitorScriptHelperService.reset(); - - $scope.initFixedScriptCode(); - }; - - $scope.initFixedScriptCode = function(){ - $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { - $scope.scriptCode_readableString_forPreview = response.data; - kommonitorScriptHelperService.scriptCode_readableString = response.data; - $scope.scriptCode_readableString_forPreview = response.data; - - kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); - }); - }; - - $scope.init(); - - $scope.onChangeReferenceIndicator = function(refIndicatorSelection){ - // remove previous refIndicator from requiredIndicators and add new one - if($scope.refIndicatorSelection_old){ - kommonitorScriptHelperService.removeBaseIndicator($scope.refIndicatorSelection_old); - } - kommonitorScriptHelperService.addBaseIndicator(refIndicatorSelection); - - $scope.refIndicatorSelection_old = refIndicatorSelection; - - //reset the one and only parameter in this case each time a base indicator is added - $scope.resetRefIndicatorParameter(); - $scope.resetComputationFormulaAndLegend(); - - }; - - $scope.onChangeComputationIndicator = function(compIndicatorSelection){ - // remove previous refIndicator from requiredIndicators and add new one - if($scope.compIndicatorSelection_old){ - kommonitorScriptHelperService.removeBaseIndicator($scope.compIndicatorSelection_old); - } - kommonitorScriptHelperService.addBaseIndicator(compIndicatorSelection); - - $scope.compIndicatorSelection_old = compIndicatorSelection; - - //reset the one and only parameter in this case each time a base indicator is added - $scope.resetCompIndicatorParameter(); - $scope.resetComputationFormulaAndLegend(); - - }; - - $scope.resetRefIndicatorParameter = function(){ - kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_referenceIndicator); - $scope.parameterDefaultValue_referenceIndicator = $scope.refIndicatorSelection.indicatorId; - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_referenceIndicator, $scope.parameterDescription_referenceIndicator, $scope.parameterDataType, $scope.parameterDefaultValue_referenceIndicator, $scope.parameterNumericMinValue_referenceIndicator, $scope.parameterNumericMaxValue_referenceIndicator); - }; - - $scope.resetCompIndicatorParameter = function(){ - kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationIndicators); - $scope.parameterDefaultValue_computationIndicators = $scope.compIndicatorSelection.indicatorId; - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationIndicators, $scope.parameterDescription_computationIndicators, $scope.parameterDataType, $scope.parameterDefaultValue_computationIndicators, $scope.parameterNumericMinValue_computationIndicators, $scope.parameterNumericMaxValue_computationIndicators); - }; - - $scope.resetComputationFormulaAndLegend = function(){ - - if($scope.refIndicatorSelection && $scope.compIndicatorSelection){ - kommonitorScriptHelperService.scriptFormulaHTML = ""; - - var formulaHTML = "Berechnung gemäß Formel
$ \\frac{A}{B} $"; - var legendItemsHTML = "Legende zur Formel"; - - legendItemsHTML+="
$A$: " + $scope.compIndicatorSelection.indicatorName + " [" + $scope.compIndicatorSelection.unit + "]"; - legendItemsHTML+="
$B$: " + $scope.refIndicatorSelection.indicatorName + " [" + $scope.refIndicatorSelection.unit + "]"; - - kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; - } - }; - } - ] + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/division/script-division.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + function ScriptDivisionController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_divide.js"; + $scope.tmpIndicatorSelection = undefined; + $scope.tmpGeoresourceSelection = undefined; + $scope.refIndicatorSelection = undefined; + $scope.refIndicatorSelection_old = undefined; + $scope.compIndicatorSelection = undefined; + $scope.compIndicatorSelection_old = undefined; + $scope.parameterName_computationIndicators = "COMPUTATION_ID_numerator"; + $scope.parameterDescription_computationIndicators = "Indikatoren-ID des Dividenden."; + $scope.parameterDefaultValue_computationIndicators = undefined; + $scope.parameterNumericMinValue_computationIndicators = 0; + $scope.parameterNumericMaxValue_computationIndicators = 1; + $scope.parameterName_referenceIndicator = "COMPUTATION_ID_denominator"; + $scope.parameterDescription_referenceIndicator = "Indikatoren-ID des Divisors."; + $scope.parameterDefaultValue_referenceIndicator = undefined; + $scope.parameterNumericMinValue_referenceIndicator = 0; + $scope.parameterNumericMaxValue_referenceIndicator = 1; + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + $scope.scriptFormulaHTML = undefined; + /* + * reset relevant things due to change of script type + */ + $scope.init = function () { + kommonitorScriptHelperService.reset(); + $scope.initFixedScriptCode(); + }; + $scope.initFixedScriptCode = function () { + $http.get($scope.pathToScriptResource, { 'responseType': 'text' }).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + $scope.init(); + $scope.onChangeReferenceIndicator = function (refIndicatorSelection) { + // remove previous refIndicator from requiredIndicators and add new one + if ($scope.refIndicatorSelection_old) { + kommonitorScriptHelperService.removeBaseIndicator($scope.refIndicatorSelection_old); + } + kommonitorScriptHelperService.addBaseIndicator(refIndicatorSelection); + $scope.refIndicatorSelection_old = refIndicatorSelection; + //reset the one and only parameter in this case each time a base indicator is added + $scope.resetRefIndicatorParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.onChangeComputationIndicator = function (compIndicatorSelection) { + // remove previous refIndicator from requiredIndicators and add new one + if ($scope.compIndicatorSelection_old) { + kommonitorScriptHelperService.removeBaseIndicator($scope.compIndicatorSelection_old); + } + kommonitorScriptHelperService.addBaseIndicator(compIndicatorSelection); + $scope.compIndicatorSelection_old = compIndicatorSelection; + //reset the one and only parameter in this case each time a base indicator is added + $scope.resetCompIndicatorParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.resetRefIndicatorParameter = function () { + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_referenceIndicator); + $scope.parameterDefaultValue_referenceIndicator = $scope.refIndicatorSelection.indicatorId; + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_referenceIndicator, $scope.parameterDescription_referenceIndicator, $scope.parameterDataType, $scope.parameterDefaultValue_referenceIndicator, $scope.parameterNumericMinValue_referenceIndicator, $scope.parameterNumericMaxValue_referenceIndicator); + }; + $scope.resetCompIndicatorParameter = function () { + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationIndicators); + $scope.parameterDefaultValue_computationIndicators = $scope.compIndicatorSelection.indicatorId; + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationIndicators, $scope.parameterDescription_computationIndicators, $scope.parameterDataType, $scope.parameterDefaultValue_computationIndicators, $scope.parameterNumericMinValue_computationIndicators, $scope.parameterNumericMaxValue_computationIndicators); + }; + $scope.resetComputationFormulaAndLegend = function () { + if ($scope.refIndicatorSelection && $scope.compIndicatorSelection) { + kommonitorScriptHelperService.scriptFormulaHTML = ""; + var formulaHTML = "Berechnung gemäß Formel
$ \\frac{A}{B} $"; + var legendItemsHTML = "Legende zur Formel"; + legendItemsHTML += "
$A$: " + $scope.compIndicatorSelection.indicatorName + " [" + $scope.compIndicatorSelection.unit + "]"; + legendItemsHTML += "
$B$: " + $scope.refIndicatorSelection.indicatorName + " [" + $scope.refIndicatorSelection.unit + "]"; + kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; + } + }; + } + ] }); +//# sourceMappingURL=script-division.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/division/script-division.component.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/division/script-division.component.js.map new file mode 100644 index 000000000..0a80df400 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/division/script-division.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-division.component.js","s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AAM,CAAC,8CAA8C,EAAE,MAAM,CAAC,8CAA8C,CAAC,CAAC;YAC7U,CAAC,CAAC;YAEF,MAAM,CAAC,gCAAgC,GAAG;gBAEzC,IAAG,MAAM,CAAC,qBAAqB,IAAI,MAAM,CAAC,sBAAsB,EAAC;oBAChE,6BAA6B,CAAC,iBAAiB,GAAG,EAAE,CAAC;oBAErD,IAAI,WAAW,GAAG,8DAA8D,CAAC;oBACjF,IAAI,eAAe,GAAG,2BAA2B,CAAC;oBAElD,eAAe,IAAE,aAAa,GAAG,MAAM,CAAC,sBAAsB,CAAC,aAAa,GAAG,IAAI,GAAG,MAAM,CAAC,sBAAsB,CAAC,IAAI,GAAI,GAAG,CAAC;oBAChI,eAAe,IAAE,aAAa,GAAG,MAAM,CAAC,qBAAqB,CAAC,aAAa,GAAI,IAAI,GAAG,MAAM,CAAC,qBAAqB,CAAC,IAAI,GAAI,GAAG,CAAC;oBAE/H,6BAA6B,CAAC,iBAAiB,GAAG,WAAW,GAAG,YAAY,GAAG,eAAe,CAAC;iBAC/F;YACF,CAAC,CAAC;QACH,CAAC;KACD;CACD,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/division/script-division.component.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/division/script-division.component.ts new file mode 100644 index 000000000..bc3b06943 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/division/script-division.component.ts @@ -0,0 +1,141 @@ +angular.module('scriptDivision').component('scriptDivision', { + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/division/script-division.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + function ScriptDivisionController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_divide.js"; + + $scope.tmpIndicatorSelection = undefined; + $scope.tmpGeoresourceSelection = undefined; + + $scope.refIndicatorSelection = undefined; + $scope.refIndicatorSelection_old = undefined; + + $scope.compIndicatorSelection = undefined; + $scope.compIndicatorSelection_old = undefined; + + $scope.parameterName_computationIndicators = "COMPUTATION_ID_numerator"; + $scope.parameterDescription_computationIndicators = "Indikatoren-ID des Dividenden."; + $scope.parameterDefaultValue_computationIndicators = undefined; + $scope.parameterNumericMinValue_computationIndicators = 0; + $scope.parameterNumericMaxValue_computationIndicators = 1; + + $scope.parameterName_referenceIndicator = "COMPUTATION_ID_denominator"; + $scope.parameterDescription_referenceIndicator = "Indikatoren-ID des Divisors."; + $scope.parameterDefaultValue_referenceIndicator = undefined; + $scope.parameterNumericMinValue_referenceIndicator = 0; + $scope.parameterNumericMaxValue_referenceIndicator = 1; + + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + + $scope.scriptFormulaHTML = undefined; + + /* + * reset relevant things due to change of script type + */ + $scope.init = function(){ + kommonitorScriptHelperService.reset(); + + $scope.initFixedScriptCode(); + }; + + $scope.initFixedScriptCode = function(){ + $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + + $scope.init(); + + $scope.onChangeReferenceIndicator = function(refIndicatorSelection){ + // remove previous refIndicator from requiredIndicators and add new one + if($scope.refIndicatorSelection_old){ + kommonitorScriptHelperService.removeBaseIndicator($scope.refIndicatorSelection_old); + } + kommonitorScriptHelperService.addBaseIndicator(refIndicatorSelection); + + $scope.refIndicatorSelection_old = refIndicatorSelection; + + //reset the one and only parameter in this case each time a base indicator is added + $scope.resetRefIndicatorParameter(); + $scope.resetComputationFormulaAndLegend(); + + }; + + $scope.onChangeComputationIndicator = function(compIndicatorSelection){ + // remove previous refIndicator from requiredIndicators and add new one + if($scope.compIndicatorSelection_old){ + kommonitorScriptHelperService.removeBaseIndicator($scope.compIndicatorSelection_old); + } + kommonitorScriptHelperService.addBaseIndicator(compIndicatorSelection); + + $scope.compIndicatorSelection_old = compIndicatorSelection; + + //reset the one and only parameter in this case each time a base indicator is added + $scope.resetCompIndicatorParameter(); + $scope.resetComputationFormulaAndLegend(); + + }; + + $scope.resetRefIndicatorParameter = function(){ + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_referenceIndicator); + $scope.parameterDefaultValue_referenceIndicator = $scope.refIndicatorSelection.indicatorId; + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_referenceIndicator, $scope.parameterDescription_referenceIndicator, $scope.parameterDataType, $scope.parameterDefaultValue_referenceIndicator, $scope.parameterNumericMinValue_referenceIndicator, $scope.parameterNumericMaxValue_referenceIndicator); + }; + + $scope.resetCompIndicatorParameter = function(){ + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationIndicators); + $scope.parameterDefaultValue_computationIndicators = $scope.compIndicatorSelection.indicatorId; + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationIndicators, $scope.parameterDescription_computationIndicators, $scope.parameterDataType, $scope.parameterDefaultValue_computationIndicators, $scope.parameterNumericMinValue_computationIndicators, $scope.parameterNumericMaxValue_computationIndicators); + }; + + $scope.resetComputationFormulaAndLegend = function(){ + + if($scope.refIndicatorSelection && $scope.compIndicatorSelection){ + kommonitorScriptHelperService.scriptFormulaHTML = ""; + + var formulaHTML = "Berechnung gemäß Formel
$ \\frac{A}{B} $"; + var legendItemsHTML = "Legende zur Formel"; + + legendItemsHTML+="
$A$: " + $scope.compIndicatorSelection.indicatorName + " [" + $scope.compIndicatorSelection.unit + "]"; + legendItemsHTML+="
$B$: " + $scope.refIndicatorSelection.indicatorName + " [" + $scope.refIndicatorSelection.unit + "]"; + + kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; + } + }; + } + ] +}); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/division/script-division.module.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/division/script-division.module.js index 81e538e41..00b080c28 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/division/script-division.module.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/division/script-division.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('scriptDivision', ['kommonitorDataExchange', 'kommonitorScriptHelper']); +//# sourceMappingURL=script-division.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/division/script-division.module.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/division/script-division.module.js.map new file mode 100644 index 000000000..a5440d7e3 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/division/script-division.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-division.module.js","sourceRoot":"","sources":["script-division.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC,wBAAwB,EAAE,wBAAwB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/division/script-division.module.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/division/script-division.module.ts new file mode 100644 index 000000000..81e538e41 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/division/script-division.module.ts @@ -0,0 +1 @@ +angular.module('scriptDivision', ['kommonitorDataExchange', 'kommonitorScriptHelper']); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/generic/script-generic.component.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/generic/script-generic.component.js index cdb824b21..f9882f162 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/generic/script-generic.component.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/generic/script-generic.component.js @@ -1,185 +1,144 @@ +"use strict"; angular.module('scriptGeneric').component('scriptGeneric', { - templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/generic/script-generic.template.html", - controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', - function ScriptGenericController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; - - /* POST BODY - { - "scriptCodeBase64": "scriptCodeBase64", - "requiredIndicatorIds": [ - "requiredIndicatorIds", - "requiredIndicatorIds" - ], - "variableProcessParameters": [ - { - "minParameterValueForNumericInputs": 6.027456183070403, - "maxParameterValueForNumericInputs": 0.8008281904610115, - "defaultValue": "defaultValue", - "dataType": "string", - "name": "name", - "description": "description" - }, - { - "minParameterValueForNumericInputs": 6.027456183070403, - "maxParameterValueForNumericInputs": 0.8008281904610115, - "defaultValue": "defaultValue", - "dataType": "string", - "name": "name", - "description": "description" - } - ], - "associatedIndicatorId": "associatedIndicatorId", - "name": "name", - "description": "description", - "requiredGeoresourceIds": [ - "requiredGeoresourceIds", - "requiredGeoresourceIds" - ] - } - */ - - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - $scope.tmpIndicatorSelection = undefined; - $scope.tmpGeoresourceSelection = undefined; - - $scope.parameterName_tmp = undefined; - $scope.parameterDescription_tmp = undefined; - $scope.parameterDefaultValue_tmp = undefined; - $scope.parameterNumericMinValue_tmp = 0; - $scope.parameterNumericMaxValue_tmp = 1; - - $scope.scriptCode_readableString_forPreview = undefined; - - $scope.scriptCodeDomElementId = "#scriptCodePreview"; - - /* - * reset relevant things due to change of script type - */ - $scope.init = function(){ - kommonitorScriptHelperService.reset(); - }; - - $scope.init(); - - $scope.onChangeParameterDataType = function(){ - $scope.parameterDefaultValue_tmp = undefined; - - if($scope.parameterDataType_tmp.apiName === 'boolean'){ - $scope.parameterDefaultValue_tmp = false; - } - }; - - $scope.onChangeDefaultValue = function (value) { - $scope.parameterDefaultValue_tmp = value; - }; - - $scope.onChangeNumericMinValue = function (value) { - $scope.parameterNumericMinValue_tmp = value; - }; - - $scope.onChangeNumericMaxValue = function (value) { - $scope.parameterNumericMaxValue_tmp = value; - }; - - $scope.onAddScriptParameter = function () { - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_tmp, $scope.parameterDescription_tmp, $scope.parameterDataType_tmp, $scope.parameterDefaultValue_tmp, $scope.parameterNumericMinValue_tmp, $scope.parameterNumericMaxValue_tmp); - - $scope.resetScriptParameterForm(); - }; - - $scope.resetScriptParameterForm = function () { - $scope.parameterName_tmp = undefined; - $scope.parameterDescription_tmp = undefined; - $scope.parameterDefaultValue_tmp = undefined; - $scope.parameterNumericMinValue_tmp = 0; - $scope.parameterNumericMaxValue_tmp = 1; - }; - - $scope.onImportScriptCodeFile = function(){ - - $scope.indicatorMetadataImportError = ""; - - $("#scriptCodeImportFile").files = []; - - // trigger file chooser - $("#scriptCodeImportFile").click(); - - }; - - $(document).on("change", "#scriptCodeImportFile" ,function(){ - - // get the file - var file = document.getElementById('scriptCodeImportFile').files[0]; - $scope.parseScriptCodeFromFile(file); - }); - - var fileStringIncludesScriptKeywords = function(string){ - var keywords = ["KmHelper", "computeIndicator", "aggregateIndicator", "module.exports.computeIndicator"]; - - var hasAllKeywords = true; - - for (const keyword of keywords) { - if (!string.includes(keyword) ){ - hasAllKeywords = false; - break; - } - } - - return hasAllKeywords; - }; - - $scope.parseScriptCodeFromFile = function(file){ - - var fileReader = new FileReader(); - - fileReader.onload = function(event) { - if (event.target.result == null || event.target.result == undefined || !fileStringIncludesScriptKeywords(event.target.result)){ - console.error("Uploaded Script Code File is null or does not follow script template."); - $scope.indicatorScriptCodeImportError = "Uploaded Script Code File is null or does not follow script template."; - $("#scriptAddScriptCodeImportErrorAlert").show(); - - $scope.$digest(); - return; - } - - kommonitorScriptHelperService.scriptCode_readableString = event.target.result; - $scope.scriptCode_readableString_forPreview = event.target.result; - - $scope.$digest(); - - kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); - - }; - - // Read in the image file as a data URL. - fileReader.readAsText(file); - }; - - $scope.parseFromMetadataFile = function(event){ - // $scope.geoJsonString = event.target.result; - $scope.metadataImportSettings = JSON.parse(event.target.result); - - if(! $scope.metadataImportSettings.metadata){ - console.error("uploaded Metadata File cannot be parsed - wrong structure."); - $scope.indicatorMetadataImportError = "Struktur der Datei stimmt nicht mit erwartetem Muster überein."; - document.getElementById("indicatorsAddMetadataPre").innerHTML = $scope.indicatorMetadataStructure_pretty; - $("#indicatorAddMetadataImportErrorAlert").show(); - - $scope.$digest(); - } - - $scope.$digest(); - }; - - $scope.hideScriptCodeErrorAlert = function(){ - $("#scriptAddScriptCodeImportErrorAlert").hide(); - }; - - } - ] + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/generic/script-generic.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + function ScriptGenericController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + /* POST BODY + { + "scriptCodeBase64": "scriptCodeBase64", + "requiredIndicatorIds": [ + "requiredIndicatorIds", + "requiredIndicatorIds" + ], + "variableProcessParameters": [ + { + "minParameterValueForNumericInputs": 6.027456183070403, + "maxParameterValueForNumericInputs": 0.8008281904610115, + "defaultValue": "defaultValue", + "dataType": "string", + "name": "name", + "description": "description" + }, + { + "minParameterValueForNumericInputs": 6.027456183070403, + "maxParameterValueForNumericInputs": 0.8008281904610115, + "defaultValue": "defaultValue", + "dataType": "string", + "name": "name", + "description": "description" + } + ], + "associatedIndicatorId": "associatedIndicatorId", + "name": "name", + "description": "description", + "requiredGeoresourceIds": [ + "requiredGeoresourceIds", + "requiredGeoresourceIds" + ] + } + */ + // initialize any adminLTE box widgets + $('.box').boxWidget(); + $scope.tmpIndicatorSelection = undefined; + $scope.tmpGeoresourceSelection = undefined; + $scope.parameterName_tmp = undefined; + $scope.parameterDescription_tmp = undefined; + $scope.parameterDefaultValue_tmp = undefined; + $scope.parameterNumericMinValue_tmp = 0; + $scope.parameterNumericMaxValue_tmp = 1; + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + /* + * reset relevant things due to change of script type + */ + $scope.init = function () { + kommonitorScriptHelperService.reset(); + }; + $scope.init(); + $scope.onChangeParameterDataType = function () { + $scope.parameterDefaultValue_tmp = undefined; + if ($scope.parameterDataType_tmp.apiName === 'boolean') { + $scope.parameterDefaultValue_tmp = false; + } + }; + $scope.onChangeDefaultValue = function (value) { + $scope.parameterDefaultValue_tmp = value; + }; + $scope.onChangeNumericMinValue = function (value) { + $scope.parameterNumericMinValue_tmp = value; + }; + $scope.onChangeNumericMaxValue = function (value) { + $scope.parameterNumericMaxValue_tmp = value; + }; + $scope.onAddScriptParameter = function () { + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_tmp, $scope.parameterDescription_tmp, $scope.parameterDataType_tmp, $scope.parameterDefaultValue_tmp, $scope.parameterNumericMinValue_tmp, $scope.parameterNumericMaxValue_tmp); + $scope.resetScriptParameterForm(); + }; + $scope.resetScriptParameterForm = function () { + $scope.parameterName_tmp = undefined; + $scope.parameterDescription_tmp = undefined; + $scope.parameterDefaultValue_tmp = undefined; + $scope.parameterNumericMinValue_tmp = 0; + $scope.parameterNumericMaxValue_tmp = 1; + }; + $scope.onImportScriptCodeFile = function () { + $scope.indicatorMetadataImportError = ""; + $("#scriptCodeImportFile").files = []; + // trigger file chooser + $("#scriptCodeImportFile").click(); + }; + $(document).on("change", "#scriptCodeImportFile", function () { + // get the file + var file = document.getElementById('scriptCodeImportFile').files[0]; + $scope.parseScriptCodeFromFile(file); + }); + var fileStringIncludesScriptKeywords = function (string) { + var keywords = ["KmHelper", "computeIndicator", "aggregateIndicator", "module.exports.computeIndicator"]; + var hasAllKeywords = true; + for (const keyword of keywords) { + if (!string.includes(keyword)) { + hasAllKeywords = false; + break; + } + } + return hasAllKeywords; + }; + $scope.parseScriptCodeFromFile = function (file) { + var fileReader = new FileReader(); + fileReader.onload = function (event) { + if (event.target.result == null || event.target.result == undefined || !fileStringIncludesScriptKeywords(event.target.result)) { + console.error("Uploaded Script Code File is null or does not follow script template."); + $scope.indicatorScriptCodeImportError = "Uploaded Script Code File is null or does not follow script template."; + $("#scriptAddScriptCodeImportErrorAlert").show(); + $scope.$digest(); + return; + } + kommonitorScriptHelperService.scriptCode_readableString = event.target.result; + $scope.scriptCode_readableString_forPreview = event.target.result; + $scope.$digest(); + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }; + // Read in the image file as a data URL. + fileReader.readAsText(file); + }; + $scope.parseFromMetadataFile = function (event) { + // $scope.geoJsonString = event.target.result; + $scope.metadataImportSettings = JSON.parse(event.target.result); + if (!$scope.metadataImportSettings.metadata) { + console.error("uploaded Metadata File cannot be parsed - wrong structure."); + $scope.indicatorMetadataImportError = "Struktur der Datei stimmt nicht mit erwartetem Muster überein."; + document.getElementById("indicatorsAddMetadataPre").innerHTML = $scope.indicatorMetadataStructure_pretty; + $("#indicatorAddMetadataImportErrorAlert").show(); + $scope.$digest(); + } + $scope.$digest(); + }; + $scope.hideScriptCodeErrorAlert = function () { + $("#scriptAddScriptCodeImportErrorAlert").hide(); + }; + } + ] }); +//# sourceMappingURL=script-generic.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/generic/script-generic.component.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/generic/script-generic.component.js.map new file mode 100644 index 000000000..b4f18d8f1 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/generic/script-generic.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-generic.component.js","sourceRoot":"","sources":["script-generic.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,SAAS,CAAC,eAAe,EAAE;IAC1D,WAAW,EAAE,uHAAuH;IACpI,UAAU,EAAE,CAAC,+BAA+B,EAAE,+BAA+B,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU;QAClI,SAAS,uBAAuB,CAAC,6BAA6B,EAAE,6BAA6B,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ;YAExI,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAC3E,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAE3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiCE;YAEF,sCAAsC;YACtC,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,CAAC;YAEtB,MAAM,CAAC,qB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,CAAC,4BAA4B,GAAG,qEAAqE,CAAC;oBAC5G,QAAQ,CAAC,cAAc,CAAC,0BAA0B,CAAC,CAAC,SAAS,GAAG,MAAM,CAAC,iCAAiC,CAAC;oBACzG,CAAC,CAAC,uCAAuC,CAAC,CAAC,IAAI,EAAE,CAAC;oBAElD,MAAM,CAAC,OAAO,EAAE,CAAC;iBACjB;gBAEA,MAAM,CAAC,OAAO,EAAE,CAAC;YACnB,CAAC,CAAC;YAEF,MAAM,CAAC,wBAAwB,GAAG;gBACjC,CAAC,CAAC,sCAAsC,CAAC,CAAC,IAAI,EAAE,CAAC;YAClD,CAAC,CAAC;QAEH,CAAC;KACD;CACD,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/generic/script-generic.component.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/generic/script-generic.component.ts new file mode 100644 index 000000000..cdb824b21 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/generic/script-generic.component.ts @@ -0,0 +1,185 @@ +angular.module('scriptGeneric').component('scriptGeneric', { + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/generic/script-generic.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + function ScriptGenericController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + + /* POST BODY + { + "scriptCodeBase64": "scriptCodeBase64", + "requiredIndicatorIds": [ + "requiredIndicatorIds", + "requiredIndicatorIds" + ], + "variableProcessParameters": [ + { + "minParameterValueForNumericInputs": 6.027456183070403, + "maxParameterValueForNumericInputs": 0.8008281904610115, + "defaultValue": "defaultValue", + "dataType": "string", + "name": "name", + "description": "description" + }, + { + "minParameterValueForNumericInputs": 6.027456183070403, + "maxParameterValueForNumericInputs": 0.8008281904610115, + "defaultValue": "defaultValue", + "dataType": "string", + "name": "name", + "description": "description" + } + ], + "associatedIndicatorId": "associatedIndicatorId", + "name": "name", + "description": "description", + "requiredGeoresourceIds": [ + "requiredGeoresourceIds", + "requiredGeoresourceIds" + ] + } + */ + + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + $scope.tmpIndicatorSelection = undefined; + $scope.tmpGeoresourceSelection = undefined; + + $scope.parameterName_tmp = undefined; + $scope.parameterDescription_tmp = undefined; + $scope.parameterDefaultValue_tmp = undefined; + $scope.parameterNumericMinValue_tmp = 0; + $scope.parameterNumericMaxValue_tmp = 1; + + $scope.scriptCode_readableString_forPreview = undefined; + + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + + /* + * reset relevant things due to change of script type + */ + $scope.init = function(){ + kommonitorScriptHelperService.reset(); + }; + + $scope.init(); + + $scope.onChangeParameterDataType = function(){ + $scope.parameterDefaultValue_tmp = undefined; + + if($scope.parameterDataType_tmp.apiName === 'boolean'){ + $scope.parameterDefaultValue_tmp = false; + } + }; + + $scope.onChangeDefaultValue = function (value) { + $scope.parameterDefaultValue_tmp = value; + }; + + $scope.onChangeNumericMinValue = function (value) { + $scope.parameterNumericMinValue_tmp = value; + }; + + $scope.onChangeNumericMaxValue = function (value) { + $scope.parameterNumericMaxValue_tmp = value; + }; + + $scope.onAddScriptParameter = function () { + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_tmp, $scope.parameterDescription_tmp, $scope.parameterDataType_tmp, $scope.parameterDefaultValue_tmp, $scope.parameterNumericMinValue_tmp, $scope.parameterNumericMaxValue_tmp); + + $scope.resetScriptParameterForm(); + }; + + $scope.resetScriptParameterForm = function () { + $scope.parameterName_tmp = undefined; + $scope.parameterDescription_tmp = undefined; + $scope.parameterDefaultValue_tmp = undefined; + $scope.parameterNumericMinValue_tmp = 0; + $scope.parameterNumericMaxValue_tmp = 1; + }; + + $scope.onImportScriptCodeFile = function(){ + + $scope.indicatorMetadataImportError = ""; + + $("#scriptCodeImportFile").files = []; + + // trigger file chooser + $("#scriptCodeImportFile").click(); + + }; + + $(document).on("change", "#scriptCodeImportFile" ,function(){ + + // get the file + var file = document.getElementById('scriptCodeImportFile').files[0]; + $scope.parseScriptCodeFromFile(file); + }); + + var fileStringIncludesScriptKeywords = function(string){ + var keywords = ["KmHelper", "computeIndicator", "aggregateIndicator", "module.exports.computeIndicator"]; + + var hasAllKeywords = true; + + for (const keyword of keywords) { + if (!string.includes(keyword) ){ + hasAllKeywords = false; + break; + } + } + + return hasAllKeywords; + }; + + $scope.parseScriptCodeFromFile = function(file){ + + var fileReader = new FileReader(); + + fileReader.onload = function(event) { + if (event.target.result == null || event.target.result == undefined || !fileStringIncludesScriptKeywords(event.target.result)){ + console.error("Uploaded Script Code File is null or does not follow script template."); + $scope.indicatorScriptCodeImportError = "Uploaded Script Code File is null or does not follow script template."; + $("#scriptAddScriptCodeImportErrorAlert").show(); + + $scope.$digest(); + return; + } + + kommonitorScriptHelperService.scriptCode_readableString = event.target.result; + $scope.scriptCode_readableString_forPreview = event.target.result; + + $scope.$digest(); + + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + + }; + + // Read in the image file as a data URL. + fileReader.readAsText(file); + }; + + $scope.parseFromMetadataFile = function(event){ + // $scope.geoJsonString = event.target.result; + $scope.metadataImportSettings = JSON.parse(event.target.result); + + if(! $scope.metadataImportSettings.metadata){ + console.error("uploaded Metadata File cannot be parsed - wrong structure."); + $scope.indicatorMetadataImportError = "Struktur der Datei stimmt nicht mit erwartetem Muster überein."; + document.getElementById("indicatorsAddMetadataPre").innerHTML = $scope.indicatorMetadataStructure_pretty; + $("#indicatorAddMetadataImportErrorAlert").show(); + + $scope.$digest(); + } + + $scope.$digest(); + }; + + $scope.hideScriptCodeErrorAlert = function(){ + $("#scriptAddScriptCodeImportErrorAlert").hide(); + }; + + } + ] +}); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/generic/script-generic.module.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/generic/script-generic.module.js index 18d19871b..c1d3e75fd 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/generic/script-generic.module.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/generic/script-generic.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('scriptGeneric', ['kommonitorDataExchange', 'kommonitorScriptHelper']); +//# sourceMappingURL=script-generic.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/generic/script-generic.module.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/generic/script-generic.module.js.map new file mode 100644 index 000000000..bddec29db --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/generic/script-generic.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-generic.module.js","sourceRoot":"","sources":["script-generic.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC,wBAAwB,EAAE,wBAAwB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/generic/script-generic.module.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/generic/script-generic.module.ts new file mode 100644 index 000000000..18d19871b --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/generic/script-generic.module.ts @@ -0,0 +1 @@ +angular.module('scriptGeneric', ['kommonitorDataExchange', 'kommonitorScriptHelper']); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceStatistics/script-georesource-statistics.component.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceStatistics/script-georesource-statistics.component.js index 6c27cb22a..944f8ad0a 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceStatistics/script-georesource-statistics.component.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceStatistics/script-georesource-statistics.component.js @@ -1,188 +1,158 @@ +"use strict"; angular.module('scriptGeoresourceStatistics').component('scriptGeoresourceStatistics', { - templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceStatistics/script-georesource-statistics.template.html", - controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', 'kommonitorCacheHelperService', - function ScriptGeoresourceStatisticsController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout, kommonitorCacheHelperService) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; - - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - $scope.pathToScriptResource = "./kommonitor-script-resources/km_georesource_miscStatistics.js"; - - $scope.propertySchema = {}; - $scope.numericPropertyOptions = undefined; - - $scope.compOptions = [ - { - "apiName": "MIN", - "displayName": "Minimum", - }, - { - "apiName": "MAX", - "displayName": "Maximum", - }, - { - "apiName": "MEAN", - "displayName": "Arithmetisches Mittel", - }, - { - "apiName": "MEDIAN", - "displayName": "Median", - }, - { - "apiName": "SUM", - "displayName": "Summe", - }, - { - "apiName": "STANDARD_DEVIATION", - "displayName": "Standardabweichung", - } - ]; - - $scope.georesourceSelection = undefined; - $scope.georesourceSelection_old = undefined; - - // parameter for georesource dataset - $scope.parameterName_computationGeoresource = "compGeoId"; - $scope.parameterDescription_computationGeoresource = "Georessourcen ID des Punktdatensatzes."; - $scope.parameterDefaultValue_computationGeoresource = undefined; - $scope.parameterNumericMinValue_computationGeoresource = 0; - $scope.parameterNumericMaxValue_computationGeoresource = 1; - - // parameter for object property name - $scope.parameterName_computationProperty = "compProp"; - $scope.parameterDescription_computationProperty = "Georessourcen Attributname."; - $scope.parameterDefaultValue_computationProperty = undefined; - $scope.parameterNumericMinValue_computationProperty = 0; - $scope.parameterNumericMaxValue_computationProperty = 1; - - // parameter for computation method - $scope.parameterName_computationMethod = "compMeth"; - $scope.parameterDescription_computationMethod = "Statistische Berechnungsmethode."; - $scope.parameterDefaultValue_computationMethod = undefined; - $scope.parameterNumericMinValue_computationMethod = 0; - $scope.parameterNumericMaxValue_computationMethod = 1; - - /* - availableScriptDataTypes = [ - { - "displayName": "Textuell (String)", - "apiName": "string" - }, - { - "displayName": "Wahrheitswert (Boolean)", - "apiName": "boolean" - }, - { - "displayName": "Ganzzahl (Integer)", - "apiName": "integer" - }, - { - "displayName": "Gleitkommazahl (Double)", - "apiName": "double" - } - ]; - */ - $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; - - $scope.scriptCode_readableString_forPreview = undefined; - $scope.scriptCodeDomElementId = "#scriptCodePreview"; - - $scope.scriptFormulaHTML = undefined; - - /* - * reset relevant things due to change of script type - */ - $scope.init = function(){ - kommonitorScriptHelperService.reset(); - - $scope.initFixedScriptCode(); - }; - - $scope.initFixedScriptCode = function(){ - $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { - $scope.scriptCode_readableString_forPreview = response.data; - kommonitorScriptHelperService.scriptCode_readableString = response.data; - $scope.scriptCode_readableString_forPreview = response.data; - - kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); - }); - }; - - $scope.init(); - - $scope.onChangeGeoresource = function(georesourceSelection){ - // remove previous refIndicator from requiredIndicators and add new one - if($scope.georesourceSelection_old){ - kommonitorScriptHelperService.removeBaseGeoresource($scope.georesourceSelection_old); - } - kommonitorScriptHelperService.addBaseGeoresource(georesourceSelection); - - $scope.georesourceSelection_old = georesourceSelection; - - //reset the one and only parameter in this case each time a base indicator is added - $scope.resetGeoresourceParameter(); - $scope.resetNumericPropertyOptions(); - $scope.resetComputationFormulaAndLegend(); - - }; - - $scope.resetNumericPropertyOptions = function(){ - $scope.propertySchema = {}; - kommonitorCacheHelperService.fetchSingleGeoresourceSchema($scope.parameterDefaultValue_computationGeoresource) - .then((schema) => { - for (var prop in schema) { - if (schema[prop] === 'Integer' || schema[prop] === 'Double') { - $scope.propertySchema[prop] = schema[prop]; - } - } - $scope.numericPropertyOptions = Object.keys($scope.propertySchema); - }); - }; - - $scope.onChangeNumericPropertyName = function(){ - $scope.resetScriptParameter_objectPropertyName(); - $scope.resetComputationFormulaAndLegend(); - }; - - $scope.onChangeComputationOption = function(){ - $scope.resetScriptParameter_computationMethod(); - $scope.resetComputationFormulaAndLegend(); - }; - - $scope.resetScriptParameter_computationGeoresource = function(georesourceMetadata){ - - return georesourceMetadata.georesourceId; - }; - - $scope.resetGeoresourceParameter = function(){ - kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationGeoresource); - $scope.parameterDefaultValue_computationGeoresource = $scope.resetScriptParameter_computationGeoresource($scope.georesourceSelection); - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationGeoresource, $scope.parameterDescription_computationGeoresource, $scope.parameterDataType, $scope.parameterDefaultValue_computationGeoresource, $scope.parameterNumericMinValue_computationGeoresource, $scope.parameterNumericMaxValue_computationGeoresource); - }; - - $scope.resetScriptParameter_objectPropertyName = function(){ - kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationProperty); - $scope.parameterDefaultValue_computationProperty = $scope.numericPropertyName; - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationProperty, $scope.parameterDescription_computationProperty, $scope.parameterDataType, $scope.parameterDefaultValue_computationProperty, $scope.parameterNumericMinValue_computationProperty, $scope.parameterNumericMaxValue_computationProperty); - }; - - $scope.resetScriptParameter_computationMethod = function(){ - kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationMethod); - $scope.parameterDefaultValue_computationMethod = $scope.compMethod.apiName; - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationMethod, $scope.parameterDescription_computationMethod, $scope.parameterDataType, $scope.parameterDefaultValue_computationMethod, $scope.parameterNumericMinValue_computationMethod, $scope.parameterNumericMaxValue_computationMethod); - }; - - $scope.resetComputationFormulaAndLegend = function(){ - kommonitorScriptHelperService.scriptFormulaHTML = ""; - - var formulaHTML = "Geodatenanalyse: Statistische Berechnung '" + $scope.compMethod.displayName + "' anhand Objekteigenschaft '" + $scope.numericPropertyName + "' für alle Punktobjekte des Datensatzes G1 innerhalb des jeweiligen Raumeinheits-Features"; - var legendItemsHTML = "Legende zur Geodatenanalyse
G1: " + $scope.georesourceSelection.datasetName; - - kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; - }; - } - ] + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceStatistics/script-georesource-statistics.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', 'kommonitorCacheHelperService', + function ScriptGeoresourceStatisticsController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout, kommonitorCacheHelperService) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + $scope.pathToScriptResource = "./kommonitor-script-resources/km_georesource_miscStatistics.js"; + $scope.propertySchema = {}; + $scope.numericPropertyOptions = undefined; + $scope.compOptions = [ + { + "apiName": "MIN", + "displayName": "Minimum", + }, + { + "apiName": "MAX", + "displayName": "Maximum", + }, + { + "apiName": "MEAN", + "displayName": "Arithmetisches Mittel", + }, + { + "apiName": "MEDIAN", + "displayName": "Median", + }, + { + "apiName": "SUM", + "displayName": "Summe", + }, + { + "apiName": "STANDARD_DEVIATION", + "displayName": "Standardabweichung", + } + ]; + $scope.georesourceSelection = undefined; + $scope.georesourceSelection_old = undefined; + // parameter for georesource dataset + $scope.parameterName_computationGeoresource = "compGeoId"; + $scope.parameterDescription_computationGeoresource = "Georessourcen ID des Punktdatensatzes."; + $scope.parameterDefaultValue_computationGeoresource = undefined; + $scope.parameterNumericMinValue_computationGeoresource = 0; + $scope.parameterNumericMaxValue_computationGeoresource = 1; + // parameter for object property name + $scope.parameterName_computationProperty = "compProp"; + $scope.parameterDescription_computationProperty = "Georessourcen Attributname."; + $scope.parameterDefaultValue_computationProperty = undefined; + $scope.parameterNumericMinValue_computationProperty = 0; + $scope.parameterNumericMaxValue_computationProperty = 1; + // parameter for computation method + $scope.parameterName_computationMethod = "compMeth"; + $scope.parameterDescription_computationMethod = "Statistische Berechnungsmethode."; + $scope.parameterDefaultValue_computationMethod = undefined; + $scope.parameterNumericMinValue_computationMethod = 0; + $scope.parameterNumericMaxValue_computationMethod = 1; + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + $scope.scriptFormulaHTML = undefined; + /* + * reset relevant things due to change of script type + */ + $scope.init = function () { + kommonitorScriptHelperService.reset(); + $scope.initFixedScriptCode(); + }; + $scope.initFixedScriptCode = function () { + $http.get($scope.pathToScriptResource, { 'responseType': 'text' }).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + $scope.init(); + $scope.onChangeGeoresource = function (georesourceSelection) { + // remove previous refIndicator from requiredIndicators and add new one + if ($scope.georesourceSelection_old) { + kommonitorScriptHelperService.removeBaseGeoresource($scope.georesourceSelection_old); + } + kommonitorScriptHelperService.addBaseGeoresource(georesourceSelection); + $scope.georesourceSelection_old = georesourceSelection; + //reset the one and only parameter in this case each time a base indicator is added + $scope.resetGeoresourceParameter(); + $scope.resetNumericPropertyOptions(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.resetNumericPropertyOptions = function () { + $scope.propertySchema = {}; + kommonitorCacheHelperService.fetchSingleGeoresourceSchema($scope.parameterDefaultValue_computationGeoresource) + .then((schema) => { + for (var prop in schema) { + if (schema[prop] === 'Integer' || schema[prop] === 'Double') { + $scope.propertySchema[prop] = schema[prop]; + } + } + $scope.numericPropertyOptions = Object.keys($scope.propertySchema); + }); + }; + $scope.onChangeNumericPropertyName = function () { + $scope.resetScriptParameter_objectPropertyName(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.onChangeComputationOption = function () { + $scope.resetScriptParameter_computationMethod(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.resetScriptParameter_computationGeoresource = function (georesourceMetadata) { + return georesourceMetadata.georesourceId; + }; + $scope.resetGeoresourceParameter = function () { + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationGeoresource); + $scope.parameterDefaultValue_computationGeoresource = $scope.resetScriptParameter_computationGeoresource($scope.georesourceSelection); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationGeoresource, $scope.parameterDescription_computationGeoresource, $scope.parameterDataType, $scope.parameterDefaultValue_computationGeoresource, $scope.parameterNumericMinValue_computationGeoresource, $scope.parameterNumericMaxValue_computationGeoresource); + }; + $scope.resetScriptParameter_objectPropertyName = function () { + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationProperty); + $scope.parameterDefaultValue_computationProperty = $scope.numericPropertyName; + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationProperty, $scope.parameterDescription_computationProperty, $scope.parameterDataType, $scope.parameterDefaultValue_computationProperty, $scope.parameterNumericMinValue_computationProperty, $scope.parameterNumericMaxValue_computationProperty); + }; + $scope.resetScriptParameter_computationMethod = function () { + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationMethod); + $scope.parameterDefaultValue_computationMethod = $scope.compMethod.apiName; + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationMethod, $scope.parameterDescription_computationMethod, $scope.parameterDataType, $scope.parameterDefaultValue_computationMethod, $scope.parameterNumericMinValue_computationMethod, $scope.parameterNumericMaxValue_computationMethod); + }; + $scope.resetComputationFormulaAndLegend = function () { + kommonitorScriptHelperService.scriptFormulaHTML = ""; + var formulaHTML = "Geodatenanalyse: Statistische Berechnung '" + $scope.compMethod.displayName + "' anhand Objekteigenschaft '" + $scope.numericPropertyName + "' für alle Punktobjekte des Datensatzes G1 innerhalb des jeweiligen Raumeinheits-Features"; + var legendItemsHTML = "Legende zur Geodatenanalyse
G1: " + $scope.georesourceSelection.datasetName; + kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; + }; + } + ] }); +//# sourceMappingURL=script-georesource-statistics.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceStatistics/script-georesource-statistics.component.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceStatistics/script-georesource-statistics.component.js.map new file mode 100644 index 000000000..5badddc20 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceStatistics/script-georesource-statistics.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-georesource-statistics.component.js","sourceRoot":"","sources":["script-georesource-statistics.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,CAAC,SAAS,CAAC,6BAA6B,EAAE;IACtF,WAAW,EAAE,oJAAoJ;IACjK,UAAU,EAAE,CAAC,+B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C,GAAG,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC;gBAC3E,6BAA6B,CAAC,kBAAkB,CAAC,MAAM,CAAC,+BAA+B,EAAE,MAAM,CAAC,sCAAsC,EAAE,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAAC,uCAAuC,EAAE,MAAM,CAAC,0CAA0C,EAAE,MAAM,CAAC,0CAA0C,CAAC,CAAC;YACzT,CAAC,CAAC;YAEF,MAAM,CAAC,gCAAgC,GAAG;gBACzC,6BAA6B,CAAC,iBAAiB,GAAG,EAAE,CAAC;gBAErD,IAAI,WAAW,GAAG,kDAAkD,GAAG,MAAM,CAAC,UAAU,CAAC,WAAW,GAAG,8BAA8B,GAAG,MAAM,CAAC,mBAAmB,GAAG,mHAAmH,CAAC;gBACzR,IAAI,eAAe,GAAG,wDAAwD,GAAG,MAAM,CAAC,oBAAoB,CAAC,WAAW,CAAC;gBAEzH,6BAA6B,CAAC,iBAAiB,GAAG,WAAW,GAAG,YAAY,GAAG,eAAe,CAAC;YAChG,CAAC,CAAC;QACH,CAAC;KACD;CACD,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceStatistics/script-georesource-statistics.component.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceStatistics/script-georesource-statistics.component.ts new file mode 100644 index 000000000..6c27cb22a --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceStatistics/script-georesource-statistics.component.ts @@ -0,0 +1,188 @@ +angular.module('scriptGeoresourceStatistics').component('scriptGeoresourceStatistics', { + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceStatistics/script-georesource-statistics.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', 'kommonitorCacheHelperService', + function ScriptGeoresourceStatisticsController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout, kommonitorCacheHelperService) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + $scope.pathToScriptResource = "./kommonitor-script-resources/km_georesource_miscStatistics.js"; + + $scope.propertySchema = {}; + $scope.numericPropertyOptions = undefined; + + $scope.compOptions = [ + { + "apiName": "MIN", + "displayName": "Minimum", + }, + { + "apiName": "MAX", + "displayName": "Maximum", + }, + { + "apiName": "MEAN", + "displayName": "Arithmetisches Mittel", + }, + { + "apiName": "MEDIAN", + "displayName": "Median", + }, + { + "apiName": "SUM", + "displayName": "Summe", + }, + { + "apiName": "STANDARD_DEVIATION", + "displayName": "Standardabweichung", + } + ]; + + $scope.georesourceSelection = undefined; + $scope.georesourceSelection_old = undefined; + + // parameter for georesource dataset + $scope.parameterName_computationGeoresource = "compGeoId"; + $scope.parameterDescription_computationGeoresource = "Georessourcen ID des Punktdatensatzes."; + $scope.parameterDefaultValue_computationGeoresource = undefined; + $scope.parameterNumericMinValue_computationGeoresource = 0; + $scope.parameterNumericMaxValue_computationGeoresource = 1; + + // parameter for object property name + $scope.parameterName_computationProperty = "compProp"; + $scope.parameterDescription_computationProperty = "Georessourcen Attributname."; + $scope.parameterDefaultValue_computationProperty = undefined; + $scope.parameterNumericMinValue_computationProperty = 0; + $scope.parameterNumericMaxValue_computationProperty = 1; + + // parameter for computation method + $scope.parameterName_computationMethod = "compMeth"; + $scope.parameterDescription_computationMethod = "Statistische Berechnungsmethode."; + $scope.parameterDefaultValue_computationMethod = undefined; + $scope.parameterNumericMinValue_computationMethod = 0; + $scope.parameterNumericMaxValue_computationMethod = 1; + + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + + $scope.scriptFormulaHTML = undefined; + + /* + * reset relevant things due to change of script type + */ + $scope.init = function(){ + kommonitorScriptHelperService.reset(); + + $scope.initFixedScriptCode(); + }; + + $scope.initFixedScriptCode = function(){ + $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + + $scope.init(); + + $scope.onChangeGeoresource = function(georesourceSelection){ + // remove previous refIndicator from requiredIndicators and add new one + if($scope.georesourceSelection_old){ + kommonitorScriptHelperService.removeBaseGeoresource($scope.georesourceSelection_old); + } + kommonitorScriptHelperService.addBaseGeoresource(georesourceSelection); + + $scope.georesourceSelection_old = georesourceSelection; + + //reset the one and only parameter in this case each time a base indicator is added + $scope.resetGeoresourceParameter(); + $scope.resetNumericPropertyOptions(); + $scope.resetComputationFormulaAndLegend(); + + }; + + $scope.resetNumericPropertyOptions = function(){ + $scope.propertySchema = {}; + kommonitorCacheHelperService.fetchSingleGeoresourceSchema($scope.parameterDefaultValue_computationGeoresource) + .then((schema) => { + for (var prop in schema) { + if (schema[prop] === 'Integer' || schema[prop] === 'Double') { + $scope.propertySchema[prop] = schema[prop]; + } + } + $scope.numericPropertyOptions = Object.keys($scope.propertySchema); + }); + }; + + $scope.onChangeNumericPropertyName = function(){ + $scope.resetScriptParameter_objectPropertyName(); + $scope.resetComputationFormulaAndLegend(); + }; + + $scope.onChangeComputationOption = function(){ + $scope.resetScriptParameter_computationMethod(); + $scope.resetComputationFormulaAndLegend(); + }; + + $scope.resetScriptParameter_computationGeoresource = function(georesourceMetadata){ + + return georesourceMetadata.georesourceId; + }; + + $scope.resetGeoresourceParameter = function(){ + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationGeoresource); + $scope.parameterDefaultValue_computationGeoresource = $scope.resetScriptParameter_computationGeoresource($scope.georesourceSelection); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationGeoresource, $scope.parameterDescription_computationGeoresource, $scope.parameterDataType, $scope.parameterDefaultValue_computationGeoresource, $scope.parameterNumericMinValue_computationGeoresource, $scope.parameterNumericMaxValue_computationGeoresource); + }; + + $scope.resetScriptParameter_objectPropertyName = function(){ + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationProperty); + $scope.parameterDefaultValue_computationProperty = $scope.numericPropertyName; + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationProperty, $scope.parameterDescription_computationProperty, $scope.parameterDataType, $scope.parameterDefaultValue_computationProperty, $scope.parameterNumericMinValue_computationProperty, $scope.parameterNumericMaxValue_computationProperty); + }; + + $scope.resetScriptParameter_computationMethod = function(){ + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationMethod); + $scope.parameterDefaultValue_computationMethod = $scope.compMethod.apiName; + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationMethod, $scope.parameterDescription_computationMethod, $scope.parameterDataType, $scope.parameterDefaultValue_computationMethod, $scope.parameterNumericMinValue_computationMethod, $scope.parameterNumericMaxValue_computationMethod); + }; + + $scope.resetComputationFormulaAndLegend = function(){ + kommonitorScriptHelperService.scriptFormulaHTML = ""; + + var formulaHTML = "Geodatenanalyse: Statistische Berechnung '" + $scope.compMethod.displayName + "' anhand Objekteigenschaft '" + $scope.numericPropertyName + "' für alle Punktobjekte des Datensatzes G1 innerhalb des jeweiligen Raumeinheits-Features"; + var legendItemsHTML = "Legende zur Geodatenanalyse
G1: " + $scope.georesourceSelection.datasetName; + + kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; + }; + } + ] +}); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceStatistics/script-georesource-statistics.module.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceStatistics/script-georesource-statistics.module.js index 7404c4fe5..bf3d16565 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceStatistics/script-georesource-statistics.module.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceStatistics/script-georesource-statistics.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('scriptGeoresourceStatistics', ['kommonitorDataExchange', 'kommonitorScriptHelper', 'kommonitorCacheHelper']); +//# sourceMappingURL=script-georesource-statistics.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceStatistics/script-georesource-statistics.module.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceStatistics/script-georesource-statistics.module.js.map new file mode 100644 index 000000000..2b36049a5 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceStatistics/script-georesource-statistics.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-georesource-statistics.module.js","sourceRoot":"","sources":["script-georesource-statistics.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,6BAA6B,EAAE,CAAC,wBAAwB,EAAE,wBAAwB,EAAE,uBAAuB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceStatistics/script-georesource-statistics.module.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceStatistics/script-georesource-statistics.module.ts new file mode 100644 index 000000000..7404c4fe5 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceStatistics/script-georesource-statistics.module.ts @@ -0,0 +1 @@ +angular.module('scriptGeoresourceStatistics', ['kommonitorDataExchange', 'kommonitorScriptHelper', 'kommonitorCacheHelper']); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceSubsetShare/script-georesource-subset-share.component.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceSubsetShare/script-georesource-subset-share.component.js index 5abd48406..516b69e2d 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceSubsetShare/script-georesource-subset-share.component.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceSubsetShare/script-georesource-subset-share.component.js @@ -1,304 +1,270 @@ +"use strict"; angular.module('scriptGeoresourceSubsetShare').component('scriptGeoresourceSubsetShare', { - templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceSubsetShare/script-georesource-subset-share.template.html", - controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', - 'kommonitorCacheHelperService', - function ScriptPointsInPolygonController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, - __env, $timeout, kommonitorCacheHelperService) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; - - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - $scope.pathToScriptResource = "./kommonitor-script-resources/km_georesource_share_byPropertyValue.js"; - - $scope.propertySchema = {}; - $scope.propertyOptions = undefined; - $scope.propertyValueOptions = undefined; - - $scope.georesourceSelection = undefined; - $scope.georesourceSelection_old = undefined; - - // parameter for georesource dataset - $scope.parameterName_computationGeoresource = "compGeoId"; - $scope.parameterDescription_computationGeoresource = "Georessourcen ID des Punktdatensatzes."; - $scope.parameterDefaultValue_computationGeoresource = undefined; - $scope.parameterNumericMinValue_computationGeoresource = 0; - $scope.parameterNumericMaxValue_computationGeoresource = 1; - - // parameter for object property name - $scope.parameterName_computationFilterProperty = "compFilterProp"; - $scope.parameterDescription_computationFilterProperty = "Georessourcen Attributname."; - $scope.parameterDefaultValue_computationFilterProperty = undefined; - $scope.parameterNumericMinValue_computationFilterProperty = 0; - $scope.parameterNumericMaxValue_computationFilterProperty = 1; - - // parameter for logical operator - $scope.parameterName_computationFilterOperator = "compFilterOperator"; - $scope.parameterDescription_computationFilterOperator = "Vergleichsoperator"; - $scope.parameterDefaultValue_computationFilterOperator = undefined; - $scope.parameterNumericMinValue_computationFilterOperator = 0; - $scope.parameterNumericMaxValue_computationFilterOperator = 1; - - // parameter for property value - $scope.parameterName_computationFilterPropertyValue = "compFilterPropVal"; - $scope.parameterDescription_computationFilterPropertyValue = "Filterwert."; - $scope.parameterDefaultValue_computationFilterPropertyValue = undefined; - $scope.parameterNumericMinValue_computationFilterPropertyValue = 0; - $scope.parameterNumericMaxValue_computationFilterPropertyValue = 1; - - // parameter for property value - $scope.parameterDefaultValue_computationFilterPropertyValueRange_from = undefined; - $scope.parameterDefaultValue_computationFilterPropertyValueRange_to = undefined; - - /* - availableScriptDataTypes = [ - { - "displayName": "Textuell (String)", - "apiName": "string" - }, - { - "displayName": "Wahrheitswert (Boolean)", - "apiName": "boolean" - }, - { - "displayName": "Ganzzahl (Integer)", - "apiName": "integer" - }, - { - "displayName": "Gleitkommazahl (Double)", - "apiName": "double" - } - ]; - */ - $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; - - $scope.scriptCode_readableString_forPreview = undefined; - $scope.scriptCodeDomElementId = "#scriptCodePreview"; - - $scope.scriptFormulaHTML = undefined; - - $scope.propertyValueSelection = []; - - $scope.dropdownTranslations = kommonitorDataExchangeService.multiselectDropdownTranslations; - $scope.dropdownSettings = kommonitorDataExchangeService.multiselectDropdownSettings; - $scope.dropdownEvents = { - onSelectionChanged: function() { - $scope.onChangePropertyValue(); - } - }; - - /* - * reset relevant things due to change of script type - */ - $scope.init = function(){ - kommonitorScriptHelperService.reset(); - - $scope.initFixedScriptCode(); - }; - - $scope.initFixedScriptCode = function(){ - $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { - $scope.scriptCode_readableString_forPreview = response.data; - kommonitorScriptHelperService.scriptCode_readableString = response.data; - $scope.scriptCode_readableString_forPreview = response.data; - - kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); - }); - }; - - $scope.init(); - - $scope.onChangeGeoresource = function(georesourceSelection){ - // remove previous refIndicator from requiredIndicators and add new one - if($scope.georesourceSelection_old){ - kommonitorScriptHelperService.removeBaseGeoresource($scope.georesourceSelection_old); - } - kommonitorScriptHelperService.addBaseGeoresource(georesourceSelection); - - $scope.georesourceSelection_old = georesourceSelection; - - //reset the one and only parameter in this case each time a base indicator is added - $scope.resetGeoresourceParameter(); - $scope.resetPropertyOptions(); - $scope.resetComputationFormulaAndLegend(); - }; - - $scope.onChangePropertyName = function(){ - $scope.resetScriptParameter_filterPropertyName(); - $scope.resetComputationFormulaAndLegend(); - $scope.filterOperatorOptions(); - $scope.resetPropertyValueOptions(); - if ($scope.parameterDefaultValue_computationFilterOperator === 'Contains') { - $scope.propertyValueSelection = []; - } - }; - - $scope.onChangeOperatorOption = function(){ - if ($scope.parameterDefaultValue_computationFilterOperator !== 'Contains') { - $scope.propertyValueSelection = []; - } - $scope.resetScriptParameter_operator(); - $scope.resetComputationFormulaAndLegend(); - }; - - $scope.onChangePropertyValue = function(){ - console.log("auswahl"); - $scope.resetScriptParameter_filterPropertyValue(); - $scope.resetComputationFormulaAndLegend(); - }; - - $scope.resetScriptParameter_computationGeoresource = function(georesourceMetadata){ - - return georesourceMetadata.georesourceId; - }; - - $scope.resetGeoresourceParameter = function(){ - kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationGeoresource); - $scope.parameterDefaultValue_computationGeoresource = $scope.resetScriptParameter_computationGeoresource($scope.georesourceSelection); - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationGeoresource, $scope.parameterDescription_computationGeoresource, $scope.parameterDataType, $scope.parameterDefaultValue_computationGeoresource, $scope.parameterNumericMinValue_computationGeoresource, $scope.parameterNumericMaxValue_computationGeoresource); - }; - - $scope.resetPropertyOptions = function(){ - kommonitorCacheHelperService.fetchSingleGeoresourceSchema($scope.parameterDefaultValue_computationGeoresource) - .then((schema) => { - for (var prop in schema) { - if (schema[prop] !== 'Date') { - $scope.propertySchema[prop] = schema[prop]; - } - } - $scope.propertyOptions = Object.keys($scope.propertySchema); - }); - }; - - $scope.resetScriptParameter_filterPropertyName = function(){ - kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationFilterProperty); - $scope.parameterDefaultValue_computationFilterProperty = $scope.propertyName; - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationFilterProperty, $scope.parameterDescription_computationFilterProperty, $scope.parameterDataType, $scope.parameterDefaultValue_computationFilterProperty, $scope.parameterNumericMinValue_computationFilterProperty, $scope.parameterNumericMaxValue_computationFilterProperty); - }; - - $scope.filterOperatorOptions = function(){ - if ($scope.propertySchema[$scope.parameterDefaultValue_computationFilterProperty] === "String"){ - $scope.operatorOptions = [ - { - "apiName": "Equal", - "displayName": "gleich (=)", - }, - { - "apiName": "Unequal", - "displayName": "ungleich (!=)", - }, - { - "apiName": "Contains", - "displayName": "enthält (kommaseparierte Liste)", - } - ]; - } else { - $scope.operatorOptions = [ - { - "apiName": "Equal", - "displayName": "gleich (=)", - }, - { - "apiName": "Greater_than", - "displayName": "größer als (>)", - }, - { - "apiName": "Greater_than_or_equal", - "displayName": "größer als oder gleich (>=)", - }, - { - "apiName": "Less_than", - "displayName": "kleiner als (<)", - }, - { - "apiName": "Less_than_or_equal", - "displayName": "kleiner als oder gleich (<=)", - }, - { - "apiName": "Unequal", - "displayName": "ungleich (!=)", - }, - { - "apiName": "Range", - "displayName": "Wertebereich (>=untere Grenze & { - var data = dataTable; - var tmpArray = data.map(item => { - let value = item[$scope.parameterDefaultValue_computationFilterProperty]; - return value; - }); - if ($scope.propertySchema[$scope.parameterDefaultValue_computationFilterProperty] === "String" || $scope.propertySchema[$scope.parameterDefaultValue_computationFilterProperty] === "Boolean") { - // sort strings - $scope.propertyValueOptions = Array.from(new Set(tmpArray)).sort(); - } else { - // sort numbers - $scope.propertyValueOptions = Array.from(new Set(tmpArray)).sort(function(a,b){ - return a - b; - }); - } - }); - }; - - $scope.filterPropertyValueRange_toOptions = function() { - return function(item) { - if (item > $scope.propertyValueRange_from) { - return true; - } - return false; - }; - }; - - $scope.resetScriptParameter_filterPropertyValue = function() { - kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationFilterPropertyValue); - if ($scope.parameterDefaultValue_computationFilterOperator !== "Contains") { - $scope.parameterDefaultValue_computationFilterPropertyValue = $scope.propertyValue; - } else { - $scope.parameterDefaultValue_computationFilterPropertyValue = $scope.propertyValueSelection.join(); - } - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationFilterPropertyValue, $scope.parameterDescription_computationFilterPropertyValue, $scope.parameterDataType, $scope.parameterDefaultValue_computationFilterPropertyValue, $scope.parameterNumericMinValue_computationFilterPropertyValue, $scope.parameterNumericMaxValue_computationFilterPropertyValue); - }; - - $scope.resetComputationFormulaAndLegend = function(){ - kommonitorScriptHelperService.scriptFormulaHTML = ""; - var formulaHTML = ""; - if ($scope.propertyName !== undefined && $scope.operator && $scope.operator.apiName !== undefined && ($scope.propertyValue != undefined || $scope.propertyValueSelection != undefined)) { - formulaHTML = "Berechnung gemäß Geodatenanalyse
Prozentualer Anteil der Auswahl an allen Punkten des Datensatzes G1 pro Raumeinheits-Feature
Auswahlkriterium: '" + $scope.propertyName + "' '" + $scope.operator.displayName + "' '" + $scope.propertyValue + "'"; - if ($scope.operator.apiName === "Range") { - formulaHTML = "Berechnung gemäß Geodatenanalyse
Prozentualer Anteil der Auswahl an allen Punkten des Datensatzes G1 pro Raumeinheits-Feature
Auswahlkriterium: '" + $scope.propertyName + "' im Wertebereich von '>=" + $scope.propertyValueRange_from + " bis <" + $scope.propertyValueRange_to + "'"; - } - if ($scope.operator.apiName === "Contains") { - formulaHTML = "Berechnung gemäß Geodatenanalyse
Prozentualer Anteil der Auswahl an allen Punkten des Datensatzes G1 pro Raumeinheits-Feature
Filterkriterium: '" + $scope.propertyName + "' 'enthält' '" + $scope.propertyValueSelection + "'"; - } - } - else { - formulaHTML = "Berechnung gemäß Geodatenanalyse
Prozentualer Anteil der Auswahl an allen Punkten des Datensatzes G1 pro Raumeinheits-Feature"; - } - var legendItemsHTML = "Legende zur Geodatenanalyse
G1: " + $scope.georesourceSelection.datasetName; - - kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; - }; - - $scope.onChangePropertyValueRange_range = function() { - $scope.propertyValue = $scope.propertyValueRange_from + "-" + $scope.propertyValueRange_to; - $scope.resetScriptParameter_filterPropertyValue(); - $scope.resetComputationFormulaAndLegend(); - } - } - ] + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceSubsetShare/script-georesource-subset-share.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + 'kommonitorCacheHelperService', + function ScriptPointsInPolygonController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout, kommonitorCacheHelperService) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + $scope.pathToScriptResource = "./kommonitor-script-resources/km_georesource_share_byPropertyValue.js"; + $scope.propertySchema = {}; + $scope.propertyOptions = undefined; + $scope.propertyValueOptions = undefined; + $scope.georesourceSelection = undefined; + $scope.georesourceSelection_old = undefined; + // parameter for georesource dataset + $scope.parameterName_computationGeoresource = "compGeoId"; + $scope.parameterDescription_computationGeoresource = "Georessourcen ID des Punktdatensatzes."; + $scope.parameterDefaultValue_computationGeoresource = undefined; + $scope.parameterNumericMinValue_computationGeoresource = 0; + $scope.parameterNumericMaxValue_computationGeoresource = 1; + // parameter for object property name + $scope.parameterName_computationFilterProperty = "compFilterProp"; + $scope.parameterDescription_computationFilterProperty = "Georessourcen Attributname."; + $scope.parameterDefaultValue_computationFilterProperty = undefined; + $scope.parameterNumericMinValue_computationFilterProperty = 0; + $scope.parameterNumericMaxValue_computationFilterProperty = 1; + // parameter for logical operator + $scope.parameterName_computationFilterOperator = "compFilterOperator"; + $scope.parameterDescription_computationFilterOperator = "Vergleichsoperator"; + $scope.parameterDefaultValue_computationFilterOperator = undefined; + $scope.parameterNumericMinValue_computationFilterOperator = 0; + $scope.parameterNumericMaxValue_computationFilterOperator = 1; + // parameter for property value + $scope.parameterName_computationFilterPropertyValue = "compFilterPropVal"; + $scope.parameterDescription_computationFilterPropertyValue = "Filterwert."; + $scope.parameterDefaultValue_computationFilterPropertyValue = undefined; + $scope.parameterNumericMinValue_computationFilterPropertyValue = 0; + $scope.parameterNumericMaxValue_computationFilterPropertyValue = 1; + // parameter for property value + $scope.parameterDefaultValue_computationFilterPropertyValueRange_from = undefined; + $scope.parameterDefaultValue_computationFilterPropertyValueRange_to = undefined; + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + $scope.scriptFormulaHTML = undefined; + $scope.propertyValueSelection = []; + $scope.dropdownTranslations = kommonitorDataExchangeService.multiselectDropdownTranslations; + $scope.dropdownSettings = kommonitorDataExchangeService.multiselectDropdownSettings; + $scope.dropdownEvents = { + onSelectionChanged: function () { + $scope.onChangePropertyValue(); + } + }; + /* + * reset relevant things due to change of script type + */ + $scope.init = function () { + kommonitorScriptHelperService.reset(); + $scope.initFixedScriptCode(); + }; + $scope.initFixedScriptCode = function () { + $http.get($scope.pathToScriptResource, { 'responseType': 'text' }).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + $scope.init(); + $scope.onChangeGeoresource = function (georesourceSelection) { + // remove previous refIndicator from requiredIndicators and add new one + if ($scope.georesourceSelection_old) { + kommonitorScriptHelperService.removeBaseGeoresource($scope.georesourceSelection_old); + } + kommonitorScriptHelperService.addBaseGeoresource(georesourceSelection); + $scope.georesourceSelection_old = georesourceSelection; + //reset the one and only parameter in this case each time a base indicator is added + $scope.resetGeoresourceParameter(); + $scope.resetPropertyOptions(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.onChangePropertyName = function () { + $scope.resetScriptParameter_filterPropertyName(); + $scope.resetComputationFormulaAndLegend(); + $scope.filterOperatorOptions(); + $scope.resetPropertyValueOptions(); + if ($scope.parameterDefaultValue_computationFilterOperator === 'Contains') { + $scope.propertyValueSelection = []; + } + }; + $scope.onChangeOperatorOption = function () { + if ($scope.parameterDefaultValue_computationFilterOperator !== 'Contains') { + $scope.propertyValueSelection = []; + } + $scope.resetScriptParameter_operator(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.onChangePropertyValue = function () { + console.log("auswahl"); + $scope.resetScriptParameter_filterPropertyValue(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.resetScriptParameter_computationGeoresource = function (georesourceMetadata) { + return georesourceMetadata.georesourceId; + }; + $scope.resetGeoresourceParameter = function () { + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationGeoresource); + $scope.parameterDefaultValue_computationGeoresource = $scope.resetScriptParameter_computationGeoresource($scope.georesourceSelection); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationGeoresource, $scope.parameterDescription_computationGeoresource, $scope.parameterDataType, $scope.parameterDefaultValue_computationGeoresource, $scope.parameterNumericMinValue_computationGeoresource, $scope.parameterNumericMaxValue_computationGeoresource); + }; + $scope.resetPropertyOptions = function () { + kommonitorCacheHelperService.fetchSingleGeoresourceSchema($scope.parameterDefaultValue_computationGeoresource) + .then((schema) => { + for (var prop in schema) { + if (schema[prop] !== 'Date') { + $scope.propertySchema[prop] = schema[prop]; + } + } + $scope.propertyOptions = Object.keys($scope.propertySchema); + }); + }; + $scope.resetScriptParameter_filterPropertyName = function () { + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationFilterProperty); + $scope.parameterDefaultValue_computationFilterProperty = $scope.propertyName; + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationFilterProperty, $scope.parameterDescription_computationFilterProperty, $scope.parameterDataType, $scope.parameterDefaultValue_computationFilterProperty, $scope.parameterNumericMinValue_computationFilterProperty, $scope.parameterNumericMaxValue_computationFilterProperty); + }; + $scope.filterOperatorOptions = function () { + if ($scope.propertySchema[$scope.parameterDefaultValue_computationFilterProperty] === "String") { + $scope.operatorOptions = [ + { + "apiName": "Equal", + "displayName": "gleich (=)", + }, + { + "apiName": "Unequal", + "displayName": "ungleich (!=)", + }, + { + "apiName": "Contains", + "displayName": "enthält (kommaseparierte Liste)", + } + ]; + } + else { + $scope.operatorOptions = [ + { + "apiName": "Equal", + "displayName": "gleich (=)", + }, + { + "apiName": "Greater_than", + "displayName": "größer als (>)", + }, + { + "apiName": "Greater_than_or_equal", + "displayName": "größer als oder gleich (>=)", + }, + { + "apiName": "Less_than", + "displayName": "kleiner als (<)", + }, + { + "apiName": "Less_than_or_equal", + "displayName": "kleiner als oder gleich (<=)", + }, + { + "apiName": "Unequal", + "displayName": "ungleich (!=)", + }, + { + "apiName": "Range", + "displayName": "Wertebereich (>=untere Grenze & { + var data = dataTable; + var tmpArray = data.map(item => { + let value = item[$scope.parameterDefaultValue_computationFilterProperty]; + return value; + }); + if ($scope.propertySchema[$scope.parameterDefaultValue_computationFilterProperty] === "String" || $scope.propertySchema[$scope.parameterDefaultValue_computationFilterProperty] === "Boolean") { + // sort strings + $scope.propertyValueOptions = Array.from(new Set(tmpArray)).sort(); + } + else { + // sort numbers + $scope.propertyValueOptions = Array.from(new Set(tmpArray)).sort(function (a, b) { + return a - b; + }); + } + }); + }; + $scope.filterPropertyValueRange_toOptions = function () { + return function (item) { + if (item > $scope.propertyValueRange_from) { + return true; + } + return false; + }; + }; + $scope.resetScriptParameter_filterPropertyValue = function () { + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationFilterPropertyValue); + if ($scope.parameterDefaultValue_computationFilterOperator !== "Contains") { + $scope.parameterDefaultValue_computationFilterPropertyValue = $scope.propertyValue; + } + else { + $scope.parameterDefaultValue_computationFilterPropertyValue = $scope.propertyValueSelection.join(); + } + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationFilterPropertyValue, $scope.parameterDescription_computationFilterPropertyValue, $scope.parameterDataType, $scope.parameterDefaultValue_computationFilterPropertyValue, $scope.parameterNumericMinValue_computationFilterPropertyValue, $scope.parameterNumericMaxValue_computationFilterPropertyValue); + }; + $scope.resetComputationFormulaAndLegend = function () { + kommonitorScriptHelperService.scriptFormulaHTML = ""; + var formulaHTML = ""; + if ($scope.propertyName !== undefined && $scope.operator && $scope.operator.apiName !== undefined && ($scope.propertyValue != undefined || $scope.propertyValueSelection != undefined)) { + formulaHTML = "Berechnung gemäß Geodatenanalyse
Prozentualer Anteil der Auswahl an allen Punkten des Datensatzes G1 pro Raumeinheits-Feature
Auswahlkriterium: '" + $scope.propertyName + "' '" + $scope.operator.displayName + "' '" + $scope.propertyValue + "'"; + if ($scope.operator.apiName === "Range") { + formulaHTML = "Berechnung gemäß Geodatenanalyse
Prozentualer Anteil der Auswahl an allen Punkten des Datensatzes G1 pro Raumeinheits-Feature
Auswahlkriterium: '" + $scope.propertyName + "' im Wertebereich von '>=" + $scope.propertyValueRange_from + " bis <" + $scope.propertyValueRange_to + "'"; + } + if ($scope.operator.apiName === "Contains") { + formulaHTML = "Berechnung gemäß Geodatenanalyse
Prozentualer Anteil der Auswahl an allen Punkten des Datensatzes G1 pro Raumeinheits-Feature
Filterkriterium: '" + $scope.propertyName + "' 'enthält' '" + $scope.propertyValueSelection + "'"; + } + } + else { + formulaHTML = "Berechnung gemäß Geodatenanalyse
Prozentualer Anteil der Auswahl an allen Punkten des Datensatzes G1 pro Raumeinheits-Feature"; + } + var legendItemsHTML = "Legende zur Geodatenanalyse
G1: " + $scope.georesourceSelection.datasetName; + kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; + }; + $scope.onChangePropertyValueRange_range = function () { + $scope.propertyValue = $scope.propertyValueRange_from + "-" + $scope.propertyValueRange_to; + $scope.resetScriptParameter_filterPropertyValue(); + $scope.resetComputationFormulaAndLegend(); + }; + } + ] }); +//# sourceMappingURL=script-georesource-subset-share.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceSubsetShare/script-georesource-subset-share.component.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceSubsetShare/script-georesource-subset-share.component.js.map new file mode 100644 index 000000000..72720a63a --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceSubsetShare/script-georesource-subset-share.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-georesource-subset-share.component.js","sourceRoot":"","sources":["script-georesource-subset-share.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,8BAA8B,CAAC,CAAC,SAAS,CAAC,8BAA8B,EAAE;IACxF,WAAW,EAAE,uJAAuJ;IACpK,UAAU,EAAE,CAAC,+BAA+B,EAAE,+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riptDefinition/georesourceSubsetShare/script-georesource-subset-share.component.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceSubsetShare/script-georesource-subset-share.component.ts new file mode 100644 index 000000000..5abd48406 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceSubsetShare/script-georesource-subset-share.component.ts @@ -0,0 +1,304 @@ +angular.module('scriptGeoresourceSubsetShare').component('scriptGeoresourceSubsetShare', { + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceSubsetShare/script-georesource-subset-share.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + 'kommonitorCacheHelperService', + function ScriptPointsInPolygonController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, + __env, $timeout, kommonitorCacheHelperService) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + $scope.pathToScriptResource = "./kommonitor-script-resources/km_georesource_share_byPropertyValue.js"; + + $scope.propertySchema = {}; + $scope.propertyOptions = undefined; + $scope.propertyValueOptions = undefined; + + $scope.georesourceSelection = undefined; + $scope.georesourceSelection_old = undefined; + + // parameter for georesource dataset + $scope.parameterName_computationGeoresource = "compGeoId"; + $scope.parameterDescription_computationGeoresource = "Georessourcen ID des Punktdatensatzes."; + $scope.parameterDefaultValue_computationGeoresource = undefined; + $scope.parameterNumericMinValue_computationGeoresource = 0; + $scope.parameterNumericMaxValue_computationGeoresource = 1; + + // parameter for object property name + $scope.parameterName_computationFilterProperty = "compFilterProp"; + $scope.parameterDescription_computationFilterProperty = "Georessourcen Attributname."; + $scope.parameterDefaultValue_computationFilterProperty = undefined; + $scope.parameterNumericMinValue_computationFilterProperty = 0; + $scope.parameterNumericMaxValue_computationFilterProperty = 1; + + // parameter for logical operator + $scope.parameterName_computationFilterOperator = "compFilterOperator"; + $scope.parameterDescription_computationFilterOperator = "Vergleichsoperator"; + $scope.parameterDefaultValue_computationFilterOperator = undefined; + $scope.parameterNumericMinValue_computationFilterOperator = 0; + $scope.parameterNumericMaxValue_computationFilterOperator = 1; + + // parameter for property value + $scope.parameterName_computationFilterPropertyValue = "compFilterPropVal"; + $scope.parameterDescription_computationFilterPropertyValue = "Filterwert."; + $scope.parameterDefaultValue_computationFilterPropertyValue = undefined; + $scope.parameterNumericMinValue_computationFilterPropertyValue = 0; + $scope.parameterNumericMaxValue_computationFilterPropertyValue = 1; + + // parameter for property value + $scope.parameterDefaultValue_computationFilterPropertyValueRange_from = undefined; + $scope.parameterDefaultValue_computationFilterPropertyValueRange_to = undefined; + + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + + $scope.scriptFormulaHTML = undefined; + + $scope.propertyValueSelection = []; + + $scope.dropdownTranslations = kommonitorDataExchangeService.multiselectDropdownTranslations; + $scope.dropdownSettings = kommonitorDataExchangeService.multiselectDropdownSettings; + $scope.dropdownEvents = { + onSelectionChanged: function() { + $scope.onChangePropertyValue(); + } + }; + + /* + * reset relevant things due to change of script type + */ + $scope.init = function(){ + kommonitorScriptHelperService.reset(); + + $scope.initFixedScriptCode(); + }; + + $scope.initFixedScriptCode = function(){ + $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + + $scope.init(); + + $scope.onChangeGeoresource = function(georesourceSelection){ + // remove previous refIndicator from requiredIndicators and add new one + if($scope.georesourceSelection_old){ + kommonitorScriptHelperService.removeBaseGeoresource($scope.georesourceSelection_old); + } + kommonitorScriptHelperService.addBaseGeoresource(georesourceSelection); + + $scope.georesourceSelection_old = georesourceSelection; + + //reset the one and only parameter in this case each time a base indicator is added + $scope.resetGeoresourceParameter(); + $scope.resetPropertyOptions(); + $scope.resetComputationFormulaAndLegend(); + }; + + $scope.onChangePropertyName = function(){ + $scope.resetScriptParameter_filterPropertyName(); + $scope.resetComputationFormulaAndLegend(); + $scope.filterOperatorOptions(); + $scope.resetPropertyValueOptions(); + if ($scope.parameterDefaultValue_computationFilterOperator === 'Contains') { + $scope.propertyValueSelection = []; + } + }; + + $scope.onChangeOperatorOption = function(){ + if ($scope.parameterDefaultValue_computationFilterOperator !== 'Contains') { + $scope.propertyValueSelection = []; + } + $scope.resetScriptParameter_operator(); + $scope.resetComputationFormulaAndLegend(); + }; + + $scope.onChangePropertyValue = function(){ + console.log("auswahl"); + $scope.resetScriptParameter_filterPropertyValue(); + $scope.resetComputationFormulaAndLegend(); + }; + + $scope.resetScriptParameter_computationGeoresource = function(georesourceMetadata){ + + return georesourceMetadata.georesourceId; + }; + + $scope.resetGeoresourceParameter = function(){ + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationGeoresource); + $scope.parameterDefaultValue_computationGeoresource = $scope.resetScriptParameter_computationGeoresource($scope.georesourceSelection); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationGeoresource, $scope.parameterDescription_computationGeoresource, $scope.parameterDataType, $scope.parameterDefaultValue_computationGeoresource, $scope.parameterNumericMinValue_computationGeoresource, $scope.parameterNumericMaxValue_computationGeoresource); + }; + + $scope.resetPropertyOptions = function(){ + kommonitorCacheHelperService.fetchSingleGeoresourceSchema($scope.parameterDefaultValue_computationGeoresource) + .then((schema) => { + for (var prop in schema) { + if (schema[prop] !== 'Date') { + $scope.propertySchema[prop] = schema[prop]; + } + } + $scope.propertyOptions = Object.keys($scope.propertySchema); + }); + }; + + $scope.resetScriptParameter_filterPropertyName = function(){ + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationFilterProperty); + $scope.parameterDefaultValue_computationFilterProperty = $scope.propertyName; + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationFilterProperty, $scope.parameterDescription_computationFilterProperty, $scope.parameterDataType, $scope.parameterDefaultValue_computationFilterProperty, $scope.parameterNumericMinValue_computationFilterProperty, $scope.parameterNumericMaxValue_computationFilterProperty); + }; + + $scope.filterOperatorOptions = function(){ + if ($scope.propertySchema[$scope.parameterDefaultValue_computationFilterProperty] === "String"){ + $scope.operatorOptions = [ + { + "apiName": "Equal", + "displayName": "gleich (=)", + }, + { + "apiName": "Unequal", + "displayName": "ungleich (!=)", + }, + { + "apiName": "Contains", + "displayName": "enthält (kommaseparierte Liste)", + } + ]; + } else { + $scope.operatorOptions = [ + { + "apiName": "Equal", + "displayName": "gleich (=)", + }, + { + "apiName": "Greater_than", + "displayName": "größer als (>)", + }, + { + "apiName": "Greater_than_or_equal", + "displayName": "größer als oder gleich (>=)", + }, + { + "apiName": "Less_than", + "displayName": "kleiner als (<)", + }, + { + "apiName": "Less_than_or_equal", + "displayName": "kleiner als oder gleich (<=)", + }, + { + "apiName": "Unequal", + "displayName": "ungleich (!=)", + }, + { + "apiName": "Range", + "displayName": "Wertebereich (>=untere Grenze & { + var data = dataTable; + var tmpArray = data.map(item => { + let value = item[$scope.parameterDefaultValue_computationFilterProperty]; + return value; + }); + if ($scope.propertySchema[$scope.parameterDefaultValue_computationFilterProperty] === "String" || $scope.propertySchema[$scope.parameterDefaultValue_computationFilterProperty] === "Boolean") { + // sort strings + $scope.propertyValueOptions = Array.from(new Set(tmpArray)).sort(); + } else { + // sort numbers + $scope.propertyValueOptions = Array.from(new Set(tmpArray)).sort(function(a,b){ + return a - b; + }); + } + }); + }; + + $scope.filterPropertyValueRange_toOptions = function() { + return function(item) { + if (item > $scope.propertyValueRange_from) { + return true; + } + return false; + }; + }; + + $scope.resetScriptParameter_filterPropertyValue = function() { + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationFilterPropertyValue); + if ($scope.parameterDefaultValue_computationFilterOperator !== "Contains") { + $scope.parameterDefaultValue_computationFilterPropertyValue = $scope.propertyValue; + } else { + $scope.parameterDefaultValue_computationFilterPropertyValue = $scope.propertyValueSelection.join(); + } + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationFilterPropertyValue, $scope.parameterDescription_computationFilterPropertyValue, $scope.parameterDataType, $scope.parameterDefaultValue_computationFilterPropertyValue, $scope.parameterNumericMinValue_computationFilterPropertyValue, $scope.parameterNumericMaxValue_computationFilterPropertyValue); + }; + + $scope.resetComputationFormulaAndLegend = function(){ + kommonitorScriptHelperService.scriptFormulaHTML = ""; + var formulaHTML = ""; + if ($scope.propertyName !== undefined && $scope.operator && $scope.operator.apiName !== undefined && ($scope.propertyValue != undefined || $scope.propertyValueSelection != undefined)) { + formulaHTML = "Berechnung gemäß Geodatenanalyse
Prozentualer Anteil der Auswahl an allen Punkten des Datensatzes G1 pro Raumeinheits-Feature
Auswahlkriterium: '" + $scope.propertyName + "' '" + $scope.operator.displayName + "' '" + $scope.propertyValue + "'"; + if ($scope.operator.apiName === "Range") { + formulaHTML = "Berechnung gemäß Geodatenanalyse
Prozentualer Anteil der Auswahl an allen Punkten des Datensatzes G1 pro Raumeinheits-Feature
Auswahlkriterium: '" + $scope.propertyName + "' im Wertebereich von '>=" + $scope.propertyValueRange_from + " bis <" + $scope.propertyValueRange_to + "'"; + } + if ($scope.operator.apiName === "Contains") { + formulaHTML = "Berechnung gemäß Geodatenanalyse
Prozentualer Anteil der Auswahl an allen Punkten des Datensatzes G1 pro Raumeinheits-Feature
Filterkriterium: '" + $scope.propertyName + "' 'enthält' '" + $scope.propertyValueSelection + "'"; + } + } + else { + formulaHTML = "Berechnung gemäß Geodatenanalyse
Prozentualer Anteil der Auswahl an allen Punkten des Datensatzes G1 pro Raumeinheits-Feature"; + } + var legendItemsHTML = "Legende zur Geodatenanalyse
G1: " + $scope.georesourceSelection.datasetName; + + kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; + }; + + $scope.onChangePropertyValueRange_range = function() { + $scope.propertyValue = $scope.propertyValueRange_from + "-" + $scope.propertyValueRange_to; + $scope.resetScriptParameter_filterPropertyValue(); + $scope.resetComputationFormulaAndLegend(); + } + } + ] +}); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceSubsetShare/script-georesource-subset-share.module.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceSubsetShare/script-georesource-subset-share.module.js index ca3b7a035..0674707fe 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceSubsetShare/script-georesource-subset-share.module.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceSubsetShare/script-georesource-subset-share.module.js @@ -1,2 +1,4 @@ -angular.module('scriptGeoresourceSubsetShare', ['kommonitorDataExchange', 'kommonitorScriptHelper', 'angularjs-dropdown-multiselect', +"use strict"; +angular.module('scriptGeoresourceSubsetShare', ['kommonitorDataExchange', 'kommonitorScriptHelper', 'angularjs-dropdown-multiselect', 'kommonitorCacheHelper']); +//# sourceMappingURL=script-georesource-subset-share.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceSubsetShare/script-georesource-subset-share.module.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceSubsetShare/script-georesource-subset-share.module.js.map new file mode 100644 index 000000000..63ddbfff2 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceSubsetShare/script-georesource-subset-share.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-georesource-subset-share.module.js","sourceRoot":"","sources":["script-georesource-subset-share.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,8BAA8B,EAAE,CAAC,wBAAwB,EAAE,wBAAwB,EAAE,gCAAgC;IAChI,uBAAuB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceSubsetShare/script-georesource-subset-share.module.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceSubsetShare/script-georesource-subset-share.module.ts new file mode 100644 index 000000000..ca3b7a035 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/georesourceSubsetShare/script-georesource-subset-share.module.ts @@ -0,0 +1,2 @@ +angular.module('scriptGeoresourceSubsetShare', ['kommonitorDataExchange', 'kommonitorScriptHelper', 'angularjs-dropdown-multiselect', + 'kommonitorCacheHelper']); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/headlineIndicator/script-headline-indicator.component.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/headlineIndicator/script-headline-indicator.component.js index 982dbb032..6bad4008f 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/headlineIndicator/script-headline-indicator.component.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/headlineIndicator/script-headline-indicator.component.js @@ -1,235 +1,183 @@ +"use strict"; angular.module('scriptHeadlineIndicator').component('scriptHeadlineIndicator', { - templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/headlineIndicator/script-headline-indicator.template.html", - controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', - function ScriptHeadlineIndicatorController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; - - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - $scope.pathToScriptResource = "./kommonitor-script-resources/km_headline_indicator.js"; - - $scope.tmpIndicatorSelection = undefined; - $scope.tmpGeoresourceSelection = undefined; - - $scope.baseIndicators = []; - - $scope.polarityOptions = [ - { - "apiName": "regular", - "displayName": "normal [(value - min) / (max - min)]" - }, - { - "apiName": "inverted", - "displayName": "invertiert [1 - ((value - min) / (max - min))]" - } - ]; - - $scope.tmpIndicatorPolarity = $scope.polarityOptions[0]; - - $scope.aggregationOptions = [ - { - "apiName": "geomean", - "displayName": "Geometrisches Mittel" - }, - { - "apiName": "mean", - "displayName": "Arithmetrisches Mittel" - }, - { - "apiName": "min", - "displayName": "Minimum" - } - ]; - - $scope.aggregationOption = $scope.aggregationOptions[0]; - - $scope.fixProcessDescription = "Berechnung: Verknüpfung der (Basis-)Indikatoren zu einem Leitindikator durch Verkettung der Berechnungsschritte rank, Min-Max-Normalisierung (normal/invertiert), Aggregation (geometrisches" - + "Mittel, Mittelwert oder Minimalwert)
" - + "Eine Normierung der (Basis-)Indikatoren wird durch die Vergabe von Rangplätzen erreicht. Hierbei werden die Wertausprägungen aller Raumeinheiten für jeden (Basis-)Indikator in eine Rangfolge gebracht. Die Raumeinheit mit der inhaltlich am schlechtesten zu wertenden " - + "Ausprägung erhält dabei den Rang 1, wohingegen die Raumeinheit mit der besten Wertausprägung den " - + "höchsten Rang (n = Anzahl der Raumeinheiten) erhält. Um einen standardisierten Wertebereich zu erzeugen, " - + "werden die Werte der (Basis-)Indikator noch vor der Aggregation auf eine Skala von null bis 1 " - + "normiert, wobei der schlechteste Wert jeweils eine null erhält und der beste Wert eine 1 (Min/Max-Normierung). Anschließend können die Werte dann mit Hilfe des geeigneten Aggregationsverfahrens " - + "(geometrisches Mittel, Mittelwert oder Minimalwert) zum Leitindikator 1. Ordnung verknüpft werden. "; - - - - - - - - $scope.parameterName_compArray = "COMPUTATION_ID_ARRAY"; - $scope.parameterDescription_compArray = "Komma-separierte Liste aller Indikatoren-IDs zur Leitindikatorbildung."; - $scope.parameterDefaultValue_compArray = undefined; - $scope.parameterNumericMinValue_compArray = 0; - $scope.parameterNumericMaxValue_compArray = 1; - - $scope.parameterName_polArray = "COMPUTATION_POLARITY_ARRAY"; - $scope.parameterDescription_polArray = "Komma-separierte Liste aller Min-Max-Polaritäten der zugehörigen Indikatoren zur Leitindikatorbildung. Die Reihenfolge muss der Reihenfolge der Indikatoren-IDs des Parameters 'COMPUTATION_ID_ARRAY' entsprechen."; - $scope.parameterDefaultValue_polArray = 'regular'; - $scope.parameterNumericMinValue_polArray = 0; - $scope.parameterNumericMaxValue_polArray = 1; - - $scope.parameterName_aggregationOption = "AGGREGATION_METHOD"; - $scope.parameterDescription_aggregationOption = "Angabe der Aggregationsmethode zur Leitindikatorbildung. Standard ist das geometrische Mittel."; - $scope.parameterDefaultValue_aggregationOption = "geomean"; - $scope.parameterNumericMinValue_aggregationOption = 0; - $scope.parameterNumericMaxValue_aggregationOption = 1; - - /* - availableScriptDataTypes = [ - { - "displayName": "Textuell (String)", - "apiName": "string" - }, - { - "displayName": "Wahrheitswert (Boolean)", - "apiName": "boolean" - }, - { - "displayName": "Ganzzahl (Integer)", - "apiName": "integer" - }, - { - "displayName": "Gleitkommazahl (Double)", - "apiName": "double" - } - ]; - */ - $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; - - $scope.scriptCode_readableString_forPreview = undefined; - $scope.scriptCodeDomElementId = "#scriptCodePreview"; - - $scope.scriptFormulaHTML = undefined; - - /* - * reset relevant things due to change of script type - */ - $scope.init = function(){ - kommonitorScriptHelperService.reset(); - - $scope.initFixedScriptCode(); - }; - - $scope.initFixedScriptCode = function(){ - $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { - $scope.scriptCode_readableString_forPreview = response.data; - kommonitorScriptHelperService.scriptCode_readableString = response.data; - $scope.scriptCode_readableString_forPreview = response.data; - - kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); - }); - }; - - $scope.init(); - - $scope.generateParameterValue_compArray = function(requiredIndicatorsArray){ - - var result=""; - for (let index = 0; index < requiredIndicatorsArray.length; index++) { - const indicatorMetadata = requiredIndicatorsArray[index]; - result+=indicatorMetadata.indicatorId; - if(index < requiredIndicatorsArray.length - 1){ - result+=","; - } - } - - return result; - }; - - $scope.generateParameterValue_polArray = function(requiredIndicatorsArray){ - - var result=""; - for (let index = 0; index < requiredIndicatorsArray.length; index++) { - const indicatorMetadata = requiredIndicatorsArray[index]; - result+=indicatorMetadata.polarity.apiName; - if(index < requiredIndicatorsArray.length - 1){ - result+=","; - } - } - - return result; - }; - - $scope.resetScriptParameter = function(){ - kommonitorScriptHelperService.requiredScriptParameters_tmp = []; - $scope.parameterDefaultValue_compArray = $scope.generateParameterValue_compArray($scope.baseIndicators); - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_compArray, $scope.parameterDescription_compArray, $scope.parameterDataType, $scope.parameterDefaultValue_compArray, $scope.parameterNumericMinValue_compArray, $scope.parameterNumericMaxValue_compArray); - $scope.parameterDefaultValue_polArray = $scope.generateParameterValue_polArray($scope.baseIndicators); - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_polArray, $scope.parameterDescription_polArray, $scope.parameterDataType, $scope.parameterDefaultValue_polArray, $scope.parameterNumericMinValue_polArray, $scope.parameterNumericMaxValue_polArray); - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_aggregationOption, $scope.parameterDescription_aggregationOption, $scope.parameterDataType, $scope.aggregationOption.apiName, $scope.parameterNumericMinValue_aggregationOption, $scope.parameterNumericMaxValue_aggregationOption); - }; - - $scope.resetComputationFormulaAndLegend = function(){ - kommonitorScriptHelperService.scriptFormulaHTML = ""; - - var formulaHTML = "Berechnung durch Verkettung der Schritte $rank$, $Min-Max-Normalisierung$ und $Aggregation$ für alle Eingangsdaten
"; - var legendItemsHTML = "Eingehende Daten zur Leitindikatorberechnung:
"; - - var aggregationMethodHTML = "Aggregationsmethode: " + $scope.aggregationOption.displayName; - - formulaHTML += "$ "; - - for (let index = 0; index < $scope.baseIndicators.length; index++) { - const indicatorMetadata = $scope.baseIndicators[index]; - var letterValue = kommonitorScriptHelperService.getAlphabetLetterFromNumber(index); - - // we can use TEX code as we use MathJax library - legendItemsHTML+="$" + letterValue + "$: " + indicatorMetadata.indicatorName + " [" + indicatorMetadata.unit + "]"; - if(index < $scope.baseIndicators.length - 1){ - legendItemsHTML+="
"; - } - } - - formulaHTML += " $"; - - kommonitorScriptHelperService.scriptFormulaHTML = legendItemsHTML + "

" + formulaHTML + "

" + aggregationMethodHTML; - - }; - - $scope.addBaseIndicator = function(tmpIndicatorSelection){ - - tmpIndicatorSelection.polarity = $scope.tmpIndicatorPolarity; - - kommonitorScriptHelperService.addBaseIndicator(tmpIndicatorSelection); - $scope.baseIndicators.push(tmpIndicatorSelection); - - //reset the one and only parameter in this case each time a base indicator is added - $scope.resetScriptParameter(); - $scope.resetComputationFormulaAndLegend(); - - setTimeout(() => { - $scope.$digest(); - }); - }; - - $scope.removeBaseIndicator = function(baseIndicator){ - kommonitorScriptHelperService.removeBaseIndicator(baseIndicator); - - var i; - for (let index = 0; index < $scope.baseIndicators.length; index++) { - const element = $scope.baseIndicators[index]; - - if(baseIndicator.indicatorId == element.indicatorId){ - i = index; - break; - } - } - $scope.baseIndicators.splice(i, 1); - - //reset the one and only parameter in this case each time a base indicator is removed - $scope.resetScriptParameter(); - $scope.resetComputationFormulaAndLegend(); - - setTimeout(() => { - $scope.$digest(); - }); - }; - - } - ] + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/headlineIndicator/script-headline-indicator.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + function ScriptHeadlineIndicatorController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + $scope.pathToScriptResource = "./kommonitor-script-resources/km_headline_indicator.js"; + $scope.tmpIndicatorSelection = undefined; + $scope.tmpGeoresourceSelection = undefined; + $scope.baseIndicators = []; + $scope.polarityOptions = [ + { + "apiName": "regular", + "displayName": "normal [(value - min) / (max - min)]" + }, + { + "apiName": "inverted", + "displayName": "invertiert [1 - ((value - min) / (max - min))]" + } + ]; + $scope.tmpIndicatorPolarity = $scope.polarityOptions[0]; + $scope.aggregationOptions = [ + { + "apiName": "geomean", + "displayName": "Geometrisches Mittel" + }, + { + "apiName": "mean", + "displayName": "Arithmetrisches Mittel" + }, + { + "apiName": "min", + "displayName": "Minimum" + } + ]; + $scope.aggregationOption = $scope.aggregationOptions[0]; + $scope.fixProcessDescription = "Berechnung: Verknüpfung der (Basis-)Indikatoren zu einem Leitindikator durch Verkettung der Berechnungsschritte rank, Min-Max-Normalisierung (normal/invertiert), Aggregation (geometrisches" + + "Mittel, Mittelwert oder Minimalwert)
" + + "Eine Normierung der (Basis-)Indikatoren wird durch die Vergabe von Rangplätzen erreicht. Hierbei werden die Wertausprägungen aller Raumeinheiten für jeden (Basis-)Indikator in eine Rangfolge gebracht. Die Raumeinheit mit der inhaltlich am schlechtesten zu wertenden " + + "Ausprägung erhält dabei den Rang 1, wohingegen die Raumeinheit mit der besten Wertausprägung den " + + "höchsten Rang (n = Anzahl der Raumeinheiten) erhält. Um einen standardisierten Wertebereich zu erzeugen, " + + "werden die Werte der (Basis-)Indikator noch vor der Aggregation auf eine Skala von null bis 1 " + + "normiert, wobei der schlechteste Wert jeweils eine null erhält und der beste Wert eine 1 (Min/Max-Normierung). Anschließend können die Werte dann mit Hilfe des geeigneten Aggregationsverfahrens " + + "(geometrisches Mittel, Mittelwert oder Minimalwert) zum Leitindikator 1. Ordnung verknüpft werden. "; + $scope.parameterName_compArray = "COMPUTATION_ID_ARRAY"; + $scope.parameterDescription_compArray = "Komma-separierte Liste aller Indikatoren-IDs zur Leitindikatorbildung."; + $scope.parameterDefaultValue_compArray = undefined; + $scope.parameterNumericMinValue_compArray = 0; + $scope.parameterNumericMaxValue_compArray = 1; + $scope.parameterName_polArray = "COMPUTATION_POLARITY_ARRAY"; + $scope.parameterDescription_polArray = "Komma-separierte Liste aller Min-Max-Polaritäten der zugehörigen Indikatoren zur Leitindikatorbildung. Die Reihenfolge muss der Reihenfolge der Indikatoren-IDs des Parameters 'COMPUTATION_ID_ARRAY' entsprechen."; + $scope.parameterDefaultValue_polArray = 'regular'; + $scope.parameterNumericMinValue_polArray = 0; + $scope.parameterNumericMaxValue_polArray = 1; + $scope.parameterName_aggregationOption = "AGGREGATION_METHOD"; + $scope.parameterDescription_aggregationOption = "Angabe der Aggregationsmethode zur Leitindikatorbildung. Standard ist das geometrische Mittel."; + $scope.parameterDefaultValue_aggregationOption = "geomean"; + $scope.parameterNumericMinValue_aggregationOption = 0; + $scope.parameterNumericMaxValue_aggregationOption = 1; + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + $scope.scriptFormulaHTML = undefined; + /* + * reset relevant things due to change of script type + */ + $scope.init = function () { + kommonitorScriptHelperService.reset(); + $scope.initFixedScriptCode(); + }; + $scope.initFixedScriptCode = function () { + $http.get($scope.pathToScriptResource, { 'responseType': 'text' }).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + $scope.init(); + $scope.generateParameterValue_compArray = function (requiredIndicatorsArray) { + var result = ""; + for (let index = 0; index < requiredIndicatorsArray.length; index++) { + const indicatorMetadata = requiredIndicatorsArray[index]; + result += indicatorMetadata.indicatorId; + if (index < requiredIndicatorsArray.length - 1) { + result += ","; + } + } + return result; + }; + $scope.generateParameterValue_polArray = function (requiredIndicatorsArray) { + var result = ""; + for (let index = 0; index < requiredIndicatorsArray.length; index++) { + const indicatorMetadata = requiredIndicatorsArray[index]; + result += indicatorMetadata.polarity.apiName; + if (index < requiredIndicatorsArray.length - 1) { + result += ","; + } + } + return result; + }; + $scope.resetScriptParameter = function () { + kommonitorScriptHelperService.requiredScriptParameters_tmp = []; + $scope.parameterDefaultValue_compArray = $scope.generateParameterValue_compArray($scope.baseIndicators); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_compArray, $scope.parameterDescription_compArray, $scope.parameterDataType, $scope.parameterDefaultValue_compArray, $scope.parameterNumericMinValue_compArray, $scope.parameterNumericMaxValue_compArray); + $scope.parameterDefaultValue_polArray = $scope.generateParameterValue_polArray($scope.baseIndicators); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_polArray, $scope.parameterDescription_polArray, $scope.parameterDataType, $scope.parameterDefaultValue_polArray, $scope.parameterNumericMinValue_polArray, $scope.parameterNumericMaxValue_polArray); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_aggregationOption, $scope.parameterDescription_aggregationOption, $scope.parameterDataType, $scope.aggregationOption.apiName, $scope.parameterNumericMinValue_aggregationOption, $scope.parameterNumericMaxValue_aggregationOption); + }; + $scope.resetComputationFormulaAndLegend = function () { + kommonitorScriptHelperService.scriptFormulaHTML = ""; + var formulaHTML = "Berechnung durch Verkettung der Schritte $rank$, $Min-Max-Normalisierung$ und $Aggregation$ für alle Eingangsdaten
"; + var legendItemsHTML = "Eingehende Daten zur Leitindikatorberechnung:
"; + var aggregationMethodHTML = "Aggregationsmethode: " + $scope.aggregationOption.displayName; + formulaHTML += "$ "; + for (let index = 0; index < $scope.baseIndicators.length; index++) { + const indicatorMetadata = $scope.baseIndicators[index]; + var letterValue = kommonitorScriptHelperService.getAlphabetLetterFromNumber(index); + // we can use TEX code as we use MathJax library + legendItemsHTML += "$" + letterValue + "$: " + indicatorMetadata.indicatorName + " [" + indicatorMetadata.unit + "]"; + if (index < $scope.baseIndicators.length - 1) { + legendItemsHTML += "
"; + } + } + formulaHTML += " $"; + kommonitorScriptHelperService.scriptFormulaHTML = legendItemsHTML + "

" + formulaHTML + "

" + aggregationMethodHTML; + }; + $scope.addBaseIndicator = function (tmpIndicatorSelection) { + tmpIndicatorSelection.polarity = $scope.tmpIndicatorPolarity; + kommonitorScriptHelperService.addBaseIndicator(tmpIndicatorSelection); + $scope.baseIndicators.push(tmpIndicatorSelection); + //reset the one and only parameter in this case each time a base indicator is added + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + setTimeout(() => { + $scope.$digest(); + }); + }; + $scope.removeBaseIndicator = function (baseIndicator) { + kommonitorScriptHelperService.removeBaseIndicator(baseIndicator); + var i; + for (let index = 0; index < $scope.baseIndicators.length; index++) { + const element = $scope.baseIndicators[index]; + if (baseIndicator.indicatorId == element.indicatorId) { + i = index; + break; + } + } + $scope.baseIndicators.splice(i, 1); + //reset the one and only parameter in this case each time a base indicator is removed + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + setTimeout(() => { + $scope.$digest(); + }); + }; + } + ] }); +//# sourceMappingURL=script-headline-indicator.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/headlineIndicator/script-headline-indicator.component.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/headlineIndicator/script-headline-indicator.component.js.map new file mode 100644 index 000000000..9f24f317c --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/headlineIndicator/script-headline-indicator.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-headline-indicator.component.js","sourceRoot":"","sources":["script-headline-indicator.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC,SAAS,CAAC,yBAAyB,EAAE;IAC9E,WAAW,EAAE,4IAA4I;IACzJ,UAAU,EAAE,CAAC,+BAA+B,EAAE,+BAA+B,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU;QAClI,SAAS,iCAAiC,CAAC,6BAA6B,EAAE,6BAA6B,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ;YAElJ,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAC3E,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAE3E,sCAAsC;YACtC,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,CAAC;YAEtB,MAAM,CAAC,oBAAoB,GAAG,wDAAwD,CAAC;YAEvF,MAAM,CAAC,qBAAqB,GAAG,SAAS,CAAC;YACzC,MAAM,CAAC,uBAAuB,GAAG,SAAS,CAAC;YAE3C,MAAM,CAAC,cAAc,GAAG,EAAE,CAAC;YAE3B,MAAM,CAAC,eAAe,GAAG;gBACxB;oBACC,SAAS,EAAE,SAAS;oBACpB,aAAa,EAAE,sCAAsC;iBACrD;gBACD;oBACC,SAAS,EAAE,UAAU;oBACrB,aAAa,EAAE,gDAAgD;iBAC/D;aACD,CAAC;YAEF,MAAM,CAAC,oBAAoB,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;YAExD,MAAM,CAAC,kBAAkB,GAAG;gBAC3B;oBACC,SAAS,EAAE,S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AAC,qBAAqB,CAAC,CAAC;gBAElD,mFAAmF;gBACnF,MAAM,CAAC,oBAAoB,EAAE,CAAC;gBAC9B,MAAM,CAAC,gCAAgC,EAAE,CAAC;gBAE1C,UAAU,CAAC,GAAG,EAAE;oBACf,MAAM,CAAC,OAAO,EAAE,CAAC;gBAClB,CAAC,CAAC,CAAC;YACJ,CAAC,CAAC;YAEF,MAAM,CAAC,mBAAmB,GAAG,UAAS,aAAa;gBAClD,6BAA6B,CAAC,mBAAmB,CAAC,aAAa,CAAC,CAAC;gBAEjE,IAAI,CAAC,CAAC;gBACN,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;oBAClE,MAAM,OAAO,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;oBAE7C,IAAG,aAAa,CAAC,WAAW,IAAI,OAAO,CAAC,WAAW,EAAC;wBACnD,CAAC,GAAG,KAAK,CAAC;wBACV,MAAM;qBACN;iBACD;gBACD,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;gBAEnC,qFAAqF;gBACrF,MAAM,CAAC,oBAAoB,EAAE,CAAC;gBAC9B,MAAM,CAAC,gCAAgC,EAAE,CAAC;gBAE1C,UAAU,CAAC,GAAG,EAAE;oBACf,MAAM,CAAC,OAAO,EAAE,CAAC;gBAClB,CAAC,CAAC,CAAC;YACJ,CAAC,CAAC;QAEH,CAAC;KACD;CACD,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/headlineIndicator/script-headline-indicator.component.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/headlineIndicator/script-headline-indicator.component.ts new file mode 100644 index 000000000..982dbb032 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/headlineIndicator/script-headline-indicator.component.ts @@ -0,0 +1,235 @@ +angular.module('scriptHeadlineIndicator').component('scriptHeadlineIndicator', { + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/headlineIndicator/script-headline-indicator.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + function ScriptHeadlineIndicatorController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + $scope.pathToScriptResource = "./kommonitor-script-resources/km_headline_indicator.js"; + + $scope.tmpIndicatorSelection = undefined; + $scope.tmpGeoresourceSelection = undefined; + + $scope.baseIndicators = []; + + $scope.polarityOptions = [ + { + "apiName": "regular", + "displayName": "normal [(value - min) / (max - min)]" + }, + { + "apiName": "inverted", + "displayName": "invertiert [1 - ((value - min) / (max - min))]" + } + ]; + + $scope.tmpIndicatorPolarity = $scope.polarityOptions[0]; + + $scope.aggregationOptions = [ + { + "apiName": "geomean", + "displayName": "Geometrisches Mittel" + }, + { + "apiName": "mean", + "displayName": "Arithmetrisches Mittel" + }, + { + "apiName": "min", + "displayName": "Minimum" + } + ]; + + $scope.aggregationOption = $scope.aggregationOptions[0]; + + $scope.fixProcessDescription = "Berechnung: Verknüpfung der (Basis-)Indikatoren zu einem Leitindikator durch Verkettung der Berechnungsschritte rank, Min-Max-Normalisierung (normal/invertiert), Aggregation (geometrisches" + + "Mittel, Mittelwert oder Minimalwert)
" + + "Eine Normierung der (Basis-)Indikatoren wird durch die Vergabe von Rangplätzen erreicht. Hierbei werden die Wertausprägungen aller Raumeinheiten für jeden (Basis-)Indikator in eine Rangfolge gebracht. Die Raumeinheit mit der inhaltlich am schlechtesten zu wertenden " + + "Ausprägung erhält dabei den Rang 1, wohingegen die Raumeinheit mit der besten Wertausprägung den " + + "höchsten Rang (n = Anzahl der Raumeinheiten) erhält. Um einen standardisierten Wertebereich zu erzeugen, " + + "werden die Werte der (Basis-)Indikator noch vor der Aggregation auf eine Skala von null bis 1 " + + "normiert, wobei der schlechteste Wert jeweils eine null erhält und der beste Wert eine 1 (Min/Max-Normierung). Anschließend können die Werte dann mit Hilfe des geeigneten Aggregationsverfahrens " + + "(geometrisches Mittel, Mittelwert oder Minimalwert) zum Leitindikator 1. Ordnung verknüpft werden. "; + + + + + + + + $scope.parameterName_compArray = "COMPUTATION_ID_ARRAY"; + $scope.parameterDescription_compArray = "Komma-separierte Liste aller Indikatoren-IDs zur Leitindikatorbildung."; + $scope.parameterDefaultValue_compArray = undefined; + $scope.parameterNumericMinValue_compArray = 0; + $scope.parameterNumericMaxValue_compArray = 1; + + $scope.parameterName_polArray = "COMPUTATION_POLARITY_ARRAY"; + $scope.parameterDescription_polArray = "Komma-separierte Liste aller Min-Max-Polaritäten der zugehörigen Indikatoren zur Leitindikatorbildung. Die Reihenfolge muss der Reihenfolge der Indikatoren-IDs des Parameters 'COMPUTATION_ID_ARRAY' entsprechen."; + $scope.parameterDefaultValue_polArray = 'regular'; + $scope.parameterNumericMinValue_polArray = 0; + $scope.parameterNumericMaxValue_polArray = 1; + + $scope.parameterName_aggregationOption = "AGGREGATION_METHOD"; + $scope.parameterDescription_aggregationOption = "Angabe der Aggregationsmethode zur Leitindikatorbildung. Standard ist das geometrische Mittel."; + $scope.parameterDefaultValue_aggregationOption = "geomean"; + $scope.parameterNumericMinValue_aggregationOption = 0; + $scope.parameterNumericMaxValue_aggregationOption = 1; + + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + + $scope.scriptFormulaHTML = undefined; + + /* + * reset relevant things due to change of script type + */ + $scope.init = function(){ + kommonitorScriptHelperService.reset(); + + $scope.initFixedScriptCode(); + }; + + $scope.initFixedScriptCode = function(){ + $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + + $scope.init(); + + $scope.generateParameterValue_compArray = function(requiredIndicatorsArray){ + + var result=""; + for (let index = 0; index < requiredIndicatorsArray.length; index++) { + const indicatorMetadata = requiredIndicatorsArray[index]; + result+=indicatorMetadata.indicatorId; + if(index < requiredIndicatorsArray.length - 1){ + result+=","; + } + } + + return result; + }; + + $scope.generateParameterValue_polArray = function(requiredIndicatorsArray){ + + var result=""; + for (let index = 0; index < requiredIndicatorsArray.length; index++) { + const indicatorMetadata = requiredIndicatorsArray[index]; + result+=indicatorMetadata.polarity.apiName; + if(index < requiredIndicatorsArray.length - 1){ + result+=","; + } + } + + return result; + }; + + $scope.resetScriptParameter = function(){ + kommonitorScriptHelperService.requiredScriptParameters_tmp = []; + $scope.parameterDefaultValue_compArray = $scope.generateParameterValue_compArray($scope.baseIndicators); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_compArray, $scope.parameterDescription_compArray, $scope.parameterDataType, $scope.parameterDefaultValue_compArray, $scope.parameterNumericMinValue_compArray, $scope.parameterNumericMaxValue_compArray); + $scope.parameterDefaultValue_polArray = $scope.generateParameterValue_polArray($scope.baseIndicators); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_polArray, $scope.parameterDescription_polArray, $scope.parameterDataType, $scope.parameterDefaultValue_polArray, $scope.parameterNumericMinValue_polArray, $scope.parameterNumericMaxValue_polArray); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_aggregationOption, $scope.parameterDescription_aggregationOption, $scope.parameterDataType, $scope.aggregationOption.apiName, $scope.parameterNumericMinValue_aggregationOption, $scope.parameterNumericMaxValue_aggregationOption); + }; + + $scope.resetComputationFormulaAndLegend = function(){ + kommonitorScriptHelperService.scriptFormulaHTML = ""; + + var formulaHTML = "Berechnung durch Verkettung der Schritte $rank$, $Min-Max-Normalisierung$ und $Aggregation$ für alle Eingangsdaten
"; + var legendItemsHTML = "Eingehende Daten zur Leitindikatorberechnung:
"; + + var aggregationMethodHTML = "Aggregationsmethode: " + $scope.aggregationOption.displayName; + + formulaHTML += "$ "; + + for (let index = 0; index < $scope.baseIndicators.length; index++) { + const indicatorMetadata = $scope.baseIndicators[index]; + var letterValue = kommonitorScriptHelperService.getAlphabetLetterFromNumber(index); + + // we can use TEX code as we use MathJax library + legendItemsHTML+="$" + letterValue + "$: " + indicatorMetadata.indicatorName + " [" + indicatorMetadata.unit + "]"; + if(index < $scope.baseIndicators.length - 1){ + legendItemsHTML+="
"; + } + } + + formulaHTML += " $"; + + kommonitorScriptHelperService.scriptFormulaHTML = legendItemsHTML + "

" + formulaHTML + "

" + aggregationMethodHTML; + + }; + + $scope.addBaseIndicator = function(tmpIndicatorSelection){ + + tmpIndicatorSelection.polarity = $scope.tmpIndicatorPolarity; + + kommonitorScriptHelperService.addBaseIndicator(tmpIndicatorSelection); + $scope.baseIndicators.push(tmpIndicatorSelection); + + //reset the one and only parameter in this case each time a base indicator is added + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + + setTimeout(() => { + $scope.$digest(); + }); + }; + + $scope.removeBaseIndicator = function(baseIndicator){ + kommonitorScriptHelperService.removeBaseIndicator(baseIndicator); + + var i; + for (let index = 0; index < $scope.baseIndicators.length; index++) { + const element = $scope.baseIndicators[index]; + + if(baseIndicator.indicatorId == element.indicatorId){ + i = index; + break; + } + } + $scope.baseIndicators.splice(i, 1); + + //reset the one and only parameter in this case each time a base indicator is removed + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + + setTimeout(() => { + $scope.$digest(); + }); + }; + + } + ] +}); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/headlineIndicator/script-headline-indicator.module.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/headlineIndicator/script-headline-indicator.module.js index 5438cb0d7..e8ea277a9 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/headlineIndicator/script-headline-indicator.module.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/headlineIndicator/script-headline-indicator.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('scriptHeadlineIndicator', ['kommonitorDataExchange', 'kommonitorScriptHelper']); +//# sourceMappingURL=script-headline-indicator.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/headlineIndicator/script-headline-indicator.module.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/headlineIndicator/script-headline-indicator.module.js.map new file mode 100644 index 000000000..3210e0d96 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/headlineIndicator/script-headline-indicator.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-headline-indicator.module.js","sourceRoot":"","sources":["script-headline-indicator.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,yBAAyB,EAAE,CAAC,wBAAwB,EAAE,wBAAwB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/headlineIndicator/script-headline-indicator.module.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/headlineIndicator/script-headline-indicator.module.ts new file mode 100644 index 000000000..5438cb0d7 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/headlineIndicator/script-headline-indicator.module.ts @@ -0,0 +1 @@ +angular.module('scriptHeadlineIndicator', ['kommonitorDataExchange', 'kommonitorScriptHelper']); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/lineSegmentInPolygon/script-line-segment-in-polygon.component.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/lineSegmentInPolygon/script-line-segment-in-polygon.component.js index ac37951d5..881fc187f 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/lineSegmentInPolygon/script-line-segment-in-polygon.component.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/lineSegmentInPolygon/script-line-segment-in-polygon.component.js @@ -1,304 +1,269 @@ +"use strict"; angular.module('scriptLineSegmentInPolygon').component('scriptLineSegmentInPolygon', { - templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/lineSegmentInPolygon/script-line-segment-in-polygon.template.html", - controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', - 'kommonitorCacheHelperService', - function ScriptLineSegmentInPolygonController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, - $http, __env, $timeout, kommonitorCacheHelperService) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; - - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - $scope.pathToScriptResource = "./kommonitor-script-resources/km_georessouce_length_lineSegmentsWithinPolygon.js"; - - $scope.propertySchema = {}; - $scope.propertyOptions = undefined; - $scope.propertyValueOptions = undefined; - - $scope.georesourceSelection = undefined; - $scope.georesourceSelection_old = undefined; - - // parameter for georesource dataset - $scope.parameterName_computationGeoresource = "compGeoId"; - $scope.parameterDescription_computationGeoresource = "Georessourcen ID des Liniendatensatzes."; - $scope.parameterDefaultValue_computationGeoresource = undefined; - $scope.parameterNumericMinValue_computationGeoresource = 0; - $scope.parameterNumericMaxValue_computationGeoresource = 1; - - // parameter for object property name - $scope.parameterName_computationFilterProperty = "compFilterProp"; - $scope.parameterDescription_computationFilterProperty = "Georessourcen Attributname."; - $scope.parameterDefaultValue_computationFilterProperty = undefined; - $scope.parameterNumericMinValue_computationFilterProperty = 0; - $scope.parameterNumericMaxValue_computationFilterProperty = 1; - - // parameter for logical operator - $scope.parameterName_computationFilterOperator = "compFilterOperator"; - $scope.parameterDescription_computationFilterOperator = "Vergleichsoperator"; - $scope.parameterDefaultValue_computationFilterOperator = undefined; - $scope.parameterNumericMinValue_computationFilterOperator = 0; - $scope.parameterNumericMaxValue_computationFilterOperator = 1; - - // parameter for property value - $scope.parameterName_computationFilterPropertyValue = "compFilterPropVal"; - $scope.parameterDescription_computationFilterPropertyValue = "Filterwert."; - $scope.parameterDefaultValue_computationFilterPropertyValue = undefined; - $scope.parameterNumericMinValue_computationFilterPropertyValue = 0; - $scope.parameterNumericMaxValue_computationFilterPropertyValue = 1; - - // parameter for property value - $scope.parameterDefaultValue_computationFilterPropertyValueRange_from = undefined; - $scope.parameterDefaultValue_computationFilterPropertyValueRange_to = undefined; - - /* - availableScriptDataTypes = [ - { - "displayName": "Textuell (String)", - "apiName": "string" - }, - { - "displayName": "Wahrheitswert (Boolean)", - "apiName": "boolean" - }, - { - "displayName": "Ganzzahl (Integer)", - "apiName": "integer" - }, - { - "displayName": "Gleitkommazahl (Double)", - "apiName": "double" - } - ]; - */ - $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; - - $scope.scriptCode_readableString_forPreview = undefined; - $scope.scriptCodeDomElementId = "#scriptCodePreview"; - - $scope.scriptFormulaHTML = undefined; - - $scope.propertyValueSelection = []; - - $scope.dropdownTranslations = kommonitorDataExchangeService.multiselectDropdownTranslations; - $scope.dropdownSettings = kommonitorDataExchangeService.multiselectDropdownSettings; - $scope.dropdownEvents = { - onSelectionChanged: function() { - $scope.onChangePropertyValue(); - } - }; - - - /* - * reset relevant things due to change of script type - */ - $scope.init = function(){ - kommonitorScriptHelperService.reset(); - - $scope.initFixedScriptCode(); - }; - - $scope.initFixedScriptCode = function(){ - $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { - $scope.scriptCode_readableString_forPreview = response.data; - kommonitorScriptHelperService.scriptCode_readableString = response.data; - $scope.scriptCode_readableString_forPreview = response.data; - - kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); - }); - }; - - $scope.init(); - - $scope.onChangeGeoresource = function(georesourceSelection){ - // remove previous refIndicator from requiredIndicators and add new one - if($scope.georesourceSelection_old){ - kommonitorScriptHelperService.removeBaseGeoresource($scope.georesourceSelection_old); - } - kommonitorScriptHelperService.addBaseGeoresource(georesourceSelection); - - $scope.georesourceSelection_old = georesourceSelection; - - //reset the one and only parameter in this case each time a base indicator is added - $scope.resetGeoresourceParameter(); - $scope.resetPropertyOptions(); - $scope.resetComputationFormulaAndLegend(); - }; - - $scope.onChangePropertyName = function(){ - $scope.resetScriptParameter_filterPropertyName(); - $scope.resetComputationFormulaAndLegend(); - $scope.filterOperatorOptions(); - $scope.resetPropertyValueOptions(); - if ($scope.parameterDefaultValue_computationFilterOperator === 'Contains') { - $scope.propertyValueSelection = []; - } - }; - - $scope.onChangeOperatorOption = function(){ - if ($scope.parameterDefaultValue_computationFilterOperator !== 'Contains') { - $scope.propertyValueSelection = []; - } - $scope.resetScriptParameter_operator(); - $scope.resetComputationFormulaAndLegend(); - }; - - $scope.onChangePropertyValue = function(){ - $scope.resetScriptParameter_filterPropertyValue(); - $scope.resetComputationFormulaAndLegend(); - }; - - $scope.resetScriptParameter_computationGeoresource = function(georesourceMetadata){ - - return georesourceMetadata.georesourceId; - }; - - $scope.resetGeoresourceParameter = function(){ - kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationGeoresource); - $scope.parameterDefaultValue_computationGeoresource = $scope.resetScriptParameter_computationGeoresource($scope.georesourceSelection); - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationGeoresource, $scope.parameterDescription_computationGeoresource, $scope.parameterDataType, $scope.parameterDefaultValue_computationGeoresource, $scope.parameterNumericMinValue_computationGeoresource, $scope.parameterNumericMaxValue_computationGeoresource); - }; - - $scope.resetPropertyOptions = function(){ - kommonitorCacheHelperService.fetchSingleGeoresourceSchema($scope.parameterDefaultValue_computationGeoresource) - .then((schema) => { - for (var prop in schema) { - if (schema[prop] !== 'Date') { - $scope.propertySchema[prop] = schema[prop]; - } - } - $scope.propertyOptions = Object.keys($scope.propertySchema); - }); - }; - - $scope.resetScriptParameter_filterPropertyName = function(){ - kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationFilterProperty); - $scope.parameterDefaultValue_computationFilterProperty = $scope.propertyName; - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationFilterProperty, $scope.parameterDescription_computationFilterProperty, $scope.parameterDataType, $scope.parameterDefaultValue_computationFilterProperty, $scope.parameterNumericMinValue_computationFilterProperty, $scope.parameterNumericMaxValue_computationFilterProperty); - }; - - $scope.filterOperatorOptions = function(){ - if ($scope.propertySchema[$scope.parameterDefaultValue_computationFilterProperty] === "String"){ - $scope.operatorOptions = [ - { - "apiName": "Equal", - "displayName": "gleich (=)", - }, - { - "apiName": "Unequal", - "displayName": "ungleich (!=)", - }, - { - "apiName": "Contains", - "displayName": "enthält (kommaseparierte Liste)", - } - ]; - } else { - $scope.operatorOptions = [ - { - "apiName": "Equal", - "displayName": "gleich (=)", - }, - { - "apiName": "Greater_than", - "displayName": "größer als (>)", - }, - { - "apiName": "Greater_than_or_equal", - "displayName": "größer als oder gleich (>=)", - }, - { - "apiName": "Less_than", - "displayName": "kleiner als (<)", - }, - { - "apiName": "Less_than_or_equal", - "displayName": "kleiner als oder gleich (<=)", - }, - { - "apiName": "Unequal", - "displayName": "ungleich (!=)", - }, - { - "apiName": "Range", - "displayName": "Wertebereich (>=untere Grenze & { - var data = dataTable; - var tmpArray = data.map(item => { - let value = item[$scope.parameterDefaultValue_computationFilterProperty]; - return value; - }); - if ($scope.propertySchema[$scope.parameterDefaultValue_computationFilterProperty] === "String" || $scope.propertySchema[$scope.parameterDefaultValue_computationFilterProperty] === "Boolean") { - // sort strings - $scope.propertyValueOptions = Array.from(new Set(tmpArray)).sort(); - } else { - // sort numbers - $scope.propertyValueOptions = Array.from(new Set(tmpArray)).sort(function(a,b){ - return a - b; - }); - } - }); - }; - - $scope.filterPropertyValueRange_toOptions = function() { - return function(item) { - if (item > $scope.propertyValueRange_from) { - return true; - } - return false; - }; - }; - - $scope.resetScriptParameter_filterPropertyValue = function() { - kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationFilterPropertyValue); - if ($scope.parameterDefaultValue_computationFilterOperator !== "Contains") { - $scope.parameterDefaultValue_computationFilterPropertyValue = $scope.propertyValue; - } else { - $scope.parameterDefaultValue_computationFilterPropertyValue = $scope.propertyValueSelection.join(); - } - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationFilterPropertyValue, $scope.parameterDescription_computationFilterPropertyValue, $scope.parameterDataType, $scope.parameterDefaultValue_computationFilterPropertyValue, $scope.parameterNumericMinValue_computationFilterPropertyValue, $scope.parameterNumericMaxValue_computationFilterPropertyValue); - }; - - $scope.resetComputationFormulaAndLegend = function(){ - kommonitorScriptHelperService.scriptFormulaHTML = ""; - var formulaHTML = ""; - if ($scope.propertyName !== undefined && $scope.operator && $scope.operator.apiName !== undefined && ($scope.propertyValue != undefined || $scope.propertyValueSelection != undefined)) { - formulaHTML = "Berechnung gemäß Geodatenanalyse
Summierte Linienlänge des Datensatzes G1 pro Raumeinheits-Feature
Filterkriterium: '" + $scope.propertyName + "' '" + $scope.operator.displayName + "' '" + $scope.propertyValue + "'"; - if ($scope.operator.apiName === "Range") { - formulaHTML = "Berechnung gemäß Geodatenanalyse
Summierte Linienlänge des Datensatzes G1 pro Raumeinheits-Feature
Filterkriterium: '" + $scope.propertyName + "' im " + "Wertebereich von '>=" + $scope.propertyValueRange_from + " bis <" + $scope.propertyValueRange_to + "'"; - } - if ($scope.operator.apiName === "Contains") { - formulaHTML = "Berechnung gemäß Geodatenanalyse
Anzahl Punkte des Datensatzes G1 pro Raumeinheits-Feature
Filterkriterium: '" + $scope.propertyName + "' 'enthält' '" + $scope.propertyValueSelection + "'"; - } - } - else { - formulaHTML = "Berechnung gemäß Geodatenanalyse
Summierte Linienlänge des Datensatzes G1 pro Raumeinheits-Feature"; - } - var legendItemsHTML = "Legende zur Geodatenanalyse
G1: " + $scope.georesourceSelection.datasetName; - - kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; - }; - - $scope.onChangePropertyValueRange_range = function() { - $scope.propertyValue = $scope.propertyValueRange_from + "-" + $scope.propertyValueRange_to; - $scope.resetScriptParameter_filterPropertyValue(); - $scope.resetComputationFormulaAndLegend(); - }; - } - ] + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/lineSegmentInPolygon/script-line-segment-in-polygon.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + 'kommonitorCacheHelperService', + function ScriptLineSegmentInPolygonController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout, kommonitorCacheHelperService) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + $scope.pathToScriptResource = "./kommonitor-script-resources/km_georessouce_length_lineSegmentsWithinPolygon.js"; + $scope.propertySchema = {}; + $scope.propertyOptions = undefined; + $scope.propertyValueOptions = undefined; + $scope.georesourceSelection = undefined; + $scope.georesourceSelection_old = undefined; + // parameter for georesource dataset + $scope.parameterName_computationGeoresource = "compGeoId"; + $scope.parameterDescription_computationGeoresource = "Georessourcen ID des Liniendatensatzes."; + $scope.parameterDefaultValue_computationGeoresource = undefined; + $scope.parameterNumericMinValue_computationGeoresource = 0; + $scope.parameterNumericMaxValue_computationGeoresource = 1; + // parameter for object property name + $scope.parameterName_computationFilterProperty = "compFilterProp"; + $scope.parameterDescription_computationFilterProperty = "Georessourcen Attributname."; + $scope.parameterDefaultValue_computationFilterProperty = undefined; + $scope.parameterNumericMinValue_computationFilterProperty = 0; + $scope.parameterNumericMaxValue_computationFilterProperty = 1; + // parameter for logical operator + $scope.parameterName_computationFilterOperator = "compFilterOperator"; + $scope.parameterDescription_computationFilterOperator = "Vergleichsoperator"; + $scope.parameterDefaultValue_computationFilterOperator = undefined; + $scope.parameterNumericMinValue_computationFilterOperator = 0; + $scope.parameterNumericMaxValue_computationFilterOperator = 1; + // parameter for property value + $scope.parameterName_computationFilterPropertyValue = "compFilterPropVal"; + $scope.parameterDescription_computationFilterPropertyValue = "Filterwert."; + $scope.parameterDefaultValue_computationFilterPropertyValue = undefined; + $scope.parameterNumericMinValue_computationFilterPropertyValue = 0; + $scope.parameterNumericMaxValue_computationFilterPropertyValue = 1; + // parameter for property value + $scope.parameterDefaultValue_computationFilterPropertyValueRange_from = undefined; + $scope.parameterDefaultValue_computationFilterPropertyValueRange_to = undefined; + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + $scope.scriptFormulaHTML = undefined; + $scope.propertyValueSelection = []; + $scope.dropdownTranslations = kommonitorDataExchangeService.multiselectDropdownTranslations; + $scope.dropdownSettings = kommonitorDataExchangeService.multiselectDropdownSettings; + $scope.dropdownEvents = { + onSelectionChanged: function () { + $scope.onChangePropertyValue(); + } + }; + /* + * reset relevant things due to change of script type + */ + $scope.init = function () { + kommonitorScriptHelperService.reset(); + $scope.initFixedScriptCode(); + }; + $scope.initFixedScriptCode = function () { + $http.get($scope.pathToScriptResource, { 'responseType': 'text' }).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + $scope.init(); + $scope.onChangeGeoresource = function (georesourceSelection) { + // remove previous refIndicator from requiredIndicators and add new one + if ($scope.georesourceSelection_old) { + kommonitorScriptHelperService.removeBaseGeoresource($scope.georesourceSelection_old); + } + kommonitorScriptHelperService.addBaseGeoresource(georesourceSelection); + $scope.georesourceSelection_old = georesourceSelection; + //reset the one and only parameter in this case each time a base indicator is added + $scope.resetGeoresourceParameter(); + $scope.resetPropertyOptions(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.onChangePropertyName = function () { + $scope.resetScriptParameter_filterPropertyName(); + $scope.resetComputationFormulaAndLegend(); + $scope.filterOperatorOptions(); + $scope.resetPropertyValueOptions(); + if ($scope.parameterDefaultValue_computationFilterOperator === 'Contains') { + $scope.propertyValueSelection = []; + } + }; + $scope.onChangeOperatorOption = function () { + if ($scope.parameterDefaultValue_computationFilterOperator !== 'Contains') { + $scope.propertyValueSelection = []; + } + $scope.resetScriptParameter_operator(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.onChangePropertyValue = function () { + $scope.resetScriptParameter_filterPropertyValue(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.resetScriptParameter_computationGeoresource = function (georesourceMetadata) { + return georesourceMetadata.georesourceId; + }; + $scope.resetGeoresourceParameter = function () { + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationGeoresource); + $scope.parameterDefaultValue_computationGeoresource = $scope.resetScriptParameter_computationGeoresource($scope.georesourceSelection); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationGeoresource, $scope.parameterDescription_computationGeoresource, $scope.parameterDataType, $scope.parameterDefaultValue_computationGeoresource, $scope.parameterNumericMinValue_computationGeoresource, $scope.parameterNumericMaxValue_computationGeoresource); + }; + $scope.resetPropertyOptions = function () { + kommonitorCacheHelperService.fetchSingleGeoresourceSchema($scope.parameterDefaultValue_computationGeoresource) + .then((schema) => { + for (var prop in schema) { + if (schema[prop] !== 'Date') { + $scope.propertySchema[prop] = schema[prop]; + } + } + $scope.propertyOptions = Object.keys($scope.propertySchema); + }); + }; + $scope.resetScriptParameter_filterPropertyName = function () { + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationFilterProperty); + $scope.parameterDefaultValue_computationFilterProperty = $scope.propertyName; + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationFilterProperty, $scope.parameterDescription_computationFilterProperty, $scope.parameterDataType, $scope.parameterDefaultValue_computationFilterProperty, $scope.parameterNumericMinValue_computationFilterProperty, $scope.parameterNumericMaxValue_computationFilterProperty); + }; + $scope.filterOperatorOptions = function () { + if ($scope.propertySchema[$scope.parameterDefaultValue_computationFilterProperty] === "String") { + $scope.operatorOptions = [ + { + "apiName": "Equal", + "displayName": "gleich (=)", + }, + { + "apiName": "Unequal", + "displayName": "ungleich (!=)", + }, + { + "apiName": "Contains", + "displayName": "enthält (kommaseparierte Liste)", + } + ]; + } + else { + $scope.operatorOptions = [ + { + "apiName": "Equal", + "displayName": "gleich (=)", + }, + { + "apiName": "Greater_than", + "displayName": "größer als (>)", + }, + { + "apiName": "Greater_than_or_equal", + "displayName": "größer als oder gleich (>=)", + }, + { + "apiName": "Less_than", + "displayName": "kleiner als (<)", + }, + { + "apiName": "Less_than_or_equal", + "displayName": "kleiner als oder gleich (<=)", + }, + { + "apiName": "Unequal", + "displayName": "ungleich (!=)", + }, + { + "apiName": "Range", + "displayName": "Wertebereich (>=untere Grenze & { + var data = dataTable; + var tmpArray = data.map(item => { + let value = item[$scope.parameterDefaultValue_computationFilterProperty]; + return value; + }); + if ($scope.propertySchema[$scope.parameterDefaultValue_computationFilterProperty] === "String" || $scope.propertySchema[$scope.parameterDefaultValue_computationFilterProperty] === "Boolean") { + // sort strings + $scope.propertyValueOptions = Array.from(new Set(tmpArray)).sort(); + } + else { + // sort numbers + $scope.propertyValueOptions = Array.from(new Set(tmpArray)).sort(function (a, b) { + return a - b; + }); + } + }); + }; + $scope.filterPropertyValueRange_toOptions = function () { + return function (item) { + if (item > $scope.propertyValueRange_from) { + return true; + } + return false; + }; + }; + $scope.resetScriptParameter_filterPropertyValue = function () { + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationFilterPropertyValue); + if ($scope.parameterDefaultValue_computationFilterOperator !== "Contains") { + $scope.parameterDefaultValue_computationFilterPropertyValue = $scope.propertyValue; + } + else { + $scope.parameterDefaultValue_computationFilterPropertyValue = $scope.propertyValueSelection.join(); + } + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationFilterPropertyValue, $scope.parameterDescription_computationFilterPropertyValue, $scope.parameterDataType, $scope.parameterDefaultValue_computationFilterPropertyValue, $scope.parameterNumericMinValue_computationFilterPropertyValue, $scope.parameterNumericMaxValue_computationFilterPropertyValue); + }; + $scope.resetComputationFormulaAndLegend = function () { + kommonitorScriptHelperService.scriptFormulaHTML = ""; + var formulaHTML = ""; + if ($scope.propertyName !== undefined && $scope.operator && $scope.operator.apiName !== undefined && ($scope.propertyValue != undefined || $scope.propertyValueSelection != undefined)) { + formulaHTML = "Berechnung gemäß Geodatenanalyse
Summierte Linienlänge des Datensatzes G1 pro Raumeinheits-Feature
Filterkriterium: '" + $scope.propertyName + "' '" + $scope.operator.displayName + "' '" + $scope.propertyValue + "'"; + if ($scope.operator.apiName === "Range") { + formulaHTML = "Berechnung gemäß Geodatenanalyse
Summierte Linienlänge des Datensatzes G1 pro Raumeinheits-Feature
Filterkriterium: '" + $scope.propertyName + "' im " + "Wertebereich von '>=" + $scope.propertyValueRange_from + " bis <" + $scope.propertyValueRange_to + "'"; + } + if ($scope.operator.apiName === "Contains") { + formulaHTML = "Berechnung gemäß Geodatenanalyse
Anzahl Punkte des Datensatzes G1 pro Raumeinheits-Feature
Filterkriterium: '" + $scope.propertyName + "' 'enthält' '" + $scope.propertyValueSelection + "'"; + } + } + else { + formulaHTML = "Berechnung gemäß Geodatenanalyse
Summierte Linienlänge des Datensatzes G1 pro Raumeinheits-Feature"; + } + var legendItemsHTML = "Legende zur Geodatenanalyse
G1: " + $scope.georesourceSelection.datasetName; + kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; + }; + $scope.onChangePropertyValueRange_range = function () { + $scope.propertyValue = $scope.propertyValueRange_from + "-" + $scope.propertyValueRange_to; + $scope.resetScriptParameter_filterPropertyValue(); + $scope.resetComputationFormulaAndLegend(); + }; + } + ] }); +//# sourceMappingURL=script-line-segment-in-polygon.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/lineSegmentInPolygon/script-line-segment-in-polygon.component.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/lineSegmentInPolygon/script-line-segment-in-polygon.component.js.map new file mode 100644 index 000000000..68ece5160 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/lineSegmentInPolygon/script-line-segment-in-polygon.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-line-segment-in-polygon.component.js","sourceRoot":"","sources":["script-line-segment-in-polygon.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,4BAA4B,CAAC,CAAC,SAAS,CAAC,4BAA4B,EAAE;IACpF,WAAW,EAAE,oJAAoJ;IACjK,UAAU,EAAE,CAAC,+BAA+B,EAAE,+BAA+B,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU;QAClI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AS,CAAC,EAAE;oBACvL,WAAW,GAAG,wKAAwK,GAAG,MAAM,CAAC,YAAY,GAAG,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,WAAW,GAAG,KAAK,GAAG,MAAM,CAAC,aAAa,GAAG,GAAG,CAAC;oBACxR,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,KAAK,OAAO,EAAE;wBACxC,WAAW,GAAG,wKAAwK,GAAG,MAAM,CAAC,YAAY,GAAG,OAAO,GAAI,sBAAsB,GAAI,MAAM,CAAC,uBAAuB,GAAG,QAAQ,GAAG,MAAM,CAAC,qBAAqB,GAAG,GAAG,CAAC;qBACnU;oBACD,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,KAAK,UAAU,EAAE;wBAC3C,WAAW,GAAG,gKAAgK,GAAG,MAAM,CAAC,YAAY,GAAG,eAAe,GAAG,MAAM,CAAC,sBAAsB,GAAG,GAAG,CAAC;qBAC7P;iBACD;qBACI;oBACJ,WAAW,GAAG,wIAAwI,CAAC;iBACvJ;gBACD,IAAI,eAAe,GAAG,wDAAwD,GAAG,MAAM,CAAC,oBAAoB,CAAC,WAAW,CAAC;gBAEzH,6BAA6B,CAAC,iBAAiB,GAAG,WAAW,GAAG,YAAY,GAAG,eAAe,CAAC;YAChG,CAAC,CAAC;YAEF,MAAM,CAAC,gCAAgC,GAAG;gBACzC,MAAM,CAAC,aAAa,GAAG,MAAM,CAAC,uBAAuB,GAAG,GAAG,GAAG,MAAM,CAAC,qBAAqB,CAAC;gBAC3F,MAAM,CAAC,wCAAwC,EAAE,CAAC;gBAClD,MAAM,CAAC,gCAAgC,EAAE,CAAC;YAC3C,CAAC,CAAC;QACH,CAAC;KACD;CACD,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/lineSegmentInPolygon/script-line-segment-in-polygon.component.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/lineSegmentInPolygon/script-line-segment-in-polygon.component.ts new file mode 100644 index 000000000..ac37951d5 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/lineSegmentInPolygon/script-line-segment-in-polygon.component.ts @@ -0,0 +1,304 @@ +angular.module('scriptLineSegmentInPolygon').component('scriptLineSegmentInPolygon', { + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/lineSegmentInPolygon/script-line-segment-in-polygon.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + 'kommonitorCacheHelperService', + function ScriptLineSegmentInPolygonController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, + $http, __env, $timeout, kommonitorCacheHelperService) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + $scope.pathToScriptResource = "./kommonitor-script-resources/km_georessouce_length_lineSegmentsWithinPolygon.js"; + + $scope.propertySchema = {}; + $scope.propertyOptions = undefined; + $scope.propertyValueOptions = undefined; + + $scope.georesourceSelection = undefined; + $scope.georesourceSelection_old = undefined; + + // parameter for georesource dataset + $scope.parameterName_computationGeoresource = "compGeoId"; + $scope.parameterDescription_computationGeoresource = "Georessourcen ID des Liniendatensatzes."; + $scope.parameterDefaultValue_computationGeoresource = undefined; + $scope.parameterNumericMinValue_computationGeoresource = 0; + $scope.parameterNumericMaxValue_computationGeoresource = 1; + + // parameter for object property name + $scope.parameterName_computationFilterProperty = "compFilterProp"; + $scope.parameterDescription_computationFilterProperty = "Georessourcen Attributname."; + $scope.parameterDefaultValue_computationFilterProperty = undefined; + $scope.parameterNumericMinValue_computationFilterProperty = 0; + $scope.parameterNumericMaxValue_computationFilterProperty = 1; + + // parameter for logical operator + $scope.parameterName_computationFilterOperator = "compFilterOperator"; + $scope.parameterDescription_computationFilterOperator = "Vergleichsoperator"; + $scope.parameterDefaultValue_computationFilterOperator = undefined; + $scope.parameterNumericMinValue_computationFilterOperator = 0; + $scope.parameterNumericMaxValue_computationFilterOperator = 1; + + // parameter for property value + $scope.parameterName_computationFilterPropertyValue = "compFilterPropVal"; + $scope.parameterDescription_computationFilterPropertyValue = "Filterwert."; + $scope.parameterDefaultValue_computationFilterPropertyValue = undefined; + $scope.parameterNumericMinValue_computationFilterPropertyValue = 0; + $scope.parameterNumericMaxValue_computationFilterPropertyValue = 1; + + // parameter for property value + $scope.parameterDefaultValue_computationFilterPropertyValueRange_from = undefined; + $scope.parameterDefaultValue_computationFilterPropertyValueRange_to = undefined; + + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + + $scope.scriptFormulaHTML = undefined; + + $scope.propertyValueSelection = []; + + $scope.dropdownTranslations = kommonitorDataExchangeService.multiselectDropdownTranslations; + $scope.dropdownSettings = kommonitorDataExchangeService.multiselectDropdownSettings; + $scope.dropdownEvents = { + onSelectionChanged: function() { + $scope.onChangePropertyValue(); + } + }; + + + /* + * reset relevant things due to change of script type + */ + $scope.init = function(){ + kommonitorScriptHelperService.reset(); + + $scope.initFixedScriptCode(); + }; + + $scope.initFixedScriptCode = function(){ + $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + + $scope.init(); + + $scope.onChangeGeoresource = function(georesourceSelection){ + // remove previous refIndicator from requiredIndicators and add new one + if($scope.georesourceSelection_old){ + kommonitorScriptHelperService.removeBaseGeoresource($scope.georesourceSelection_old); + } + kommonitorScriptHelperService.addBaseGeoresource(georesourceSelection); + + $scope.georesourceSelection_old = georesourceSelection; + + //reset the one and only parameter in this case each time a base indicator is added + $scope.resetGeoresourceParameter(); + $scope.resetPropertyOptions(); + $scope.resetComputationFormulaAndLegend(); + }; + + $scope.onChangePropertyName = function(){ + $scope.resetScriptParameter_filterPropertyName(); + $scope.resetComputationFormulaAndLegend(); + $scope.filterOperatorOptions(); + $scope.resetPropertyValueOptions(); + if ($scope.parameterDefaultValue_computationFilterOperator === 'Contains') { + $scope.propertyValueSelection = []; + } + }; + + $scope.onChangeOperatorOption = function(){ + if ($scope.parameterDefaultValue_computationFilterOperator !== 'Contains') { + $scope.propertyValueSelection = []; + } + $scope.resetScriptParameter_operator(); + $scope.resetComputationFormulaAndLegend(); + }; + + $scope.onChangePropertyValue = function(){ + $scope.resetScriptParameter_filterPropertyValue(); + $scope.resetComputationFormulaAndLegend(); + }; + + $scope.resetScriptParameter_computationGeoresource = function(georesourceMetadata){ + + return georesourceMetadata.georesourceId; + }; + + $scope.resetGeoresourceParameter = function(){ + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationGeoresource); + $scope.parameterDefaultValue_computationGeoresource = $scope.resetScriptParameter_computationGeoresource($scope.georesourceSelection); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationGeoresource, $scope.parameterDescription_computationGeoresource, $scope.parameterDataType, $scope.parameterDefaultValue_computationGeoresource, $scope.parameterNumericMinValue_computationGeoresource, $scope.parameterNumericMaxValue_computationGeoresource); + }; + + $scope.resetPropertyOptions = function(){ + kommonitorCacheHelperService.fetchSingleGeoresourceSchema($scope.parameterDefaultValue_computationGeoresource) + .then((schema) => { + for (var prop in schema) { + if (schema[prop] !== 'Date') { + $scope.propertySchema[prop] = schema[prop]; + } + } + $scope.propertyOptions = Object.keys($scope.propertySchema); + }); + }; + + $scope.resetScriptParameter_filterPropertyName = function(){ + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationFilterProperty); + $scope.parameterDefaultValue_computationFilterProperty = $scope.propertyName; + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationFilterProperty, $scope.parameterDescription_computationFilterProperty, $scope.parameterDataType, $scope.parameterDefaultValue_computationFilterProperty, $scope.parameterNumericMinValue_computationFilterProperty, $scope.parameterNumericMaxValue_computationFilterProperty); + }; + + $scope.filterOperatorOptions = function(){ + if ($scope.propertySchema[$scope.parameterDefaultValue_computationFilterProperty] === "String"){ + $scope.operatorOptions = [ + { + "apiName": "Equal", + "displayName": "gleich (=)", + }, + { + "apiName": "Unequal", + "displayName": "ungleich (!=)", + }, + { + "apiName": "Contains", + "displayName": "enthält (kommaseparierte Liste)", + } + ]; + } else { + $scope.operatorOptions = [ + { + "apiName": "Equal", + "displayName": "gleich (=)", + }, + { + "apiName": "Greater_than", + "displayName": "größer als (>)", + }, + { + "apiName": "Greater_than_or_equal", + "displayName": "größer als oder gleich (>=)", + }, + { + "apiName": "Less_than", + "displayName": "kleiner als (<)", + }, + { + "apiName": "Less_than_or_equal", + "displayName": "kleiner als oder gleich (<=)", + }, + { + "apiName": "Unequal", + "displayName": "ungleich (!=)", + }, + { + "apiName": "Range", + "displayName": "Wertebereich (>=untere Grenze & { + var data = dataTable; + var tmpArray = data.map(item => { + let value = item[$scope.parameterDefaultValue_computationFilterProperty]; + return value; + }); + if ($scope.propertySchema[$scope.parameterDefaultValue_computationFilterProperty] === "String" || $scope.propertySchema[$scope.parameterDefaultValue_computationFilterProperty] === "Boolean") { + // sort strings + $scope.propertyValueOptions = Array.from(new Set(tmpArray)).sort(); + } else { + // sort numbers + $scope.propertyValueOptions = Array.from(new Set(tmpArray)).sort(function(a,b){ + return a - b; + }); + } + }); + }; + + $scope.filterPropertyValueRange_toOptions = function() { + return function(item) { + if (item > $scope.propertyValueRange_from) { + return true; + } + return false; + }; + }; + + $scope.resetScriptParameter_filterPropertyValue = function() { + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationFilterPropertyValue); + if ($scope.parameterDefaultValue_computationFilterOperator !== "Contains") { + $scope.parameterDefaultValue_computationFilterPropertyValue = $scope.propertyValue; + } else { + $scope.parameterDefaultValue_computationFilterPropertyValue = $scope.propertyValueSelection.join(); + } + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationFilterPropertyValue, $scope.parameterDescription_computationFilterPropertyValue, $scope.parameterDataType, $scope.parameterDefaultValue_computationFilterPropertyValue, $scope.parameterNumericMinValue_computationFilterPropertyValue, $scope.parameterNumericMaxValue_computationFilterPropertyValue); + }; + + $scope.resetComputationFormulaAndLegend = function(){ + kommonitorScriptHelperService.scriptFormulaHTML = ""; + var formulaHTML = ""; + if ($scope.propertyName !== undefined && $scope.operator && $scope.operator.apiName !== undefined && ($scope.propertyValue != undefined || $scope.propertyValueSelection != undefined)) { + formulaHTML = "Berechnung gemäß Geodatenanalyse
Summierte Linienlänge des Datensatzes G1 pro Raumeinheits-Feature
Filterkriterium: '" + $scope.propertyName + "' '" + $scope.operator.displayName + "' '" + $scope.propertyValue + "'"; + if ($scope.operator.apiName === "Range") { + formulaHTML = "Berechnung gemäß Geodatenanalyse
Summierte Linienlänge des Datensatzes G1 pro Raumeinheits-Feature
Filterkriterium: '" + $scope.propertyName + "' im " + "Wertebereich von '>=" + $scope.propertyValueRange_from + " bis <" + $scope.propertyValueRange_to + "'"; + } + if ($scope.operator.apiName === "Contains") { + formulaHTML = "Berechnung gemäß Geodatenanalyse
Anzahl Punkte des Datensatzes G1 pro Raumeinheits-Feature
Filterkriterium: '" + $scope.propertyName + "' 'enthält' '" + $scope.propertyValueSelection + "'"; + } + } + else { + formulaHTML = "Berechnung gemäß Geodatenanalyse
Summierte Linienlänge des Datensatzes G1 pro Raumeinheits-Feature"; + } + var legendItemsHTML = "Legende zur Geodatenanalyse
G1: " + $scope.georesourceSelection.datasetName; + + kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; + }; + + $scope.onChangePropertyValueRange_range = function() { + $scope.propertyValue = $scope.propertyValueRange_from + "-" + $scope.propertyValueRange_to; + $scope.resetScriptParameter_filterPropertyValue(); + $scope.resetComputationFormulaAndLegend(); + }; + } + ] +}); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/lineSegmentInPolygon/script-line-segment-in-polygon.module.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/lineSegmentInPolygon/script-line-segment-in-polygon.module.js index c904b4158..687b5a2a8 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/lineSegmentInPolygon/script-line-segment-in-polygon.module.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/lineSegmentInPolygon/script-line-segment-in-polygon.module.js @@ -1,2 +1,4 @@ +"use strict"; angular.module('scriptLineSegmentInPolygon', ['kommonitorDataExchange', 'kommonitorScriptHelper', 'angularjs-dropdown-multiselect', 'kommonitorCacheHelper']); +//# sourceMappingURL=script-line-segment-in-polygon.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/lineSegmentInPolygon/script-line-segment-in-polygon.module.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/lineSegmentInPolygon/script-line-segment-in-polygon.module.js.map new file mode 100644 index 000000000..87440f8e2 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/lineSegmentInPolygon/script-line-segment-in-polygon.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-line-segment-in-polygon.module.js","sourceRoot":"","sources":["script-line-segment-in-polygon.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,4BAA4B,EAAE,CAAC,wBAAwB,EAAE,wBAAwB,EAAE,gCAAgC;IAC9H,uBAAuB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/lineSegmentInPolygon/script-line-segment-in-polygon.module.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/lineSegmentInPolygon/script-line-segment-in-polygon.module.ts new file mode 100644 index 000000000..c904b4158 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/lineSegmentInPolygon/script-line-segment-in-polygon.module.ts @@ -0,0 +1,2 @@ +angular.module('scriptLineSegmentInPolygon', ['kommonitorDataExchange', 'kommonitorScriptHelper', 'angularjs-dropdown-multiselect', + 'kommonitorCacheHelper']); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/multiplication/script-multiplication.component.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/multiplication/script-multiplication.component.js index 0ae39dc08..bb8af6c89 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/multiplication/script-multiplication.component.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/multiplication/script-multiplication.component.js @@ -1,159 +1,125 @@ +"use strict"; angular.module('scriptMultiplication').component('scriptMultiplication', { - templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/multiplication/script-multiplication.template.html", - controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', - function ScriptMultiplicationController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; - - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_multiply.js"; - - $scope.tmpIndicatorSelection = undefined; - $scope.tmpGeoresourceSelection = undefined; - - $scope.baseIndicators = []; - - $scope.parameterName = "COMPUTATION_ID"; - $scope.parameterDescription = "Komma-separierte Liste aller Indikatoren-IDs zur Multiplikation."; - $scope.parameterDefaultValue = undefined; - $scope.parameterNumericMinValue = 0; - $scope.parameterNumericMaxValue = 1; - - /* - availableScriptDataTypes = [ - { - "displayName": "Textuell (String)", - "apiName": "string" - }, - { - "displayName": "Wahrheitswert (Boolean)", - "apiName": "boolean" - }, - { - "displayName": "Ganzzahl (Integer)", - "apiName": "integer" - }, - { - "displayName": "Gleitkommazahl (Double)", - "apiName": "double" - } - ]; - */ - $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; - - $scope.scriptCode_readableString_forPreview = undefined; - $scope.scriptCodeDomElementId = "#scriptCodePreview"; - - $scope.scriptFormulaHTML = undefined; - - /* - * reset relevant things due to change of script type - */ - $scope.init = function(){ - kommonitorScriptHelperService.reset(); - - $scope.initFixedScriptCode(); - }; - - $scope.initFixedScriptCode = function(){ - $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { - $scope.scriptCode_readableString_forPreview = response.data; - kommonitorScriptHelperService.scriptCode_readableString = response.data; - $scope.scriptCode_readableString_forPreview = response.data; - - kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); - }); - }; - - $scope.init(); - - $scope.generateParameterValue = function(requiredIndicatorsArray){ - - var result=""; - for (let index = 0; index < requiredIndicatorsArray.length; index++) { - const indicatorMetadata = requiredIndicatorsArray[index]; - result+=indicatorMetadata.indicatorId; - if(index < requiredIndicatorsArray.length - 1){ - result+=","; - } - } - - return result; - }; - - $scope.resetScriptParameter = function(){ - kommonitorScriptHelperService.requiredScriptParameters_tmp = []; - $scope.parameterDefaultValue = $scope.generateParameterValue($scope.baseIndicators); - kommonitorScriptHelperService.addScriptParameter($scope.parameterName, $scope.parameterDescription, $scope.parameterDataType, $scope.parameterDefaultValue, $scope.parameterNumericMinValue, $scope.parameterNumericMaxValue); - }; - - $scope.resetComputationFormulaAndLegend = function(){ - kommonitorScriptHelperService.scriptFormulaHTML = ""; - - var formulaHTML = "Berechnung gemäß Formel
"; - var legendItemsHTML = "Legende zur Formel
"; - - formulaHTML += "$ "; - - for (let index = 0; index < $scope.baseIndicators.length; index++) { - const indicatorMetadata = $scope.baseIndicators[index]; - var letterValue = kommonitorScriptHelperService.getAlphabetLetterFromNumber(index); - - // we can use TEX code as we use MathJax library - formulaHTML+=letterValue; - legendItemsHTML+="$" + letterValue + "$: " + indicatorMetadata.indicatorName + " [" + indicatorMetadata.unit + "]"; - if(index < $scope.baseIndicators.length - 1){ - formulaHTML+=" \\times "; - legendItemsHTML+="
"; - } - } - - formulaHTML += " $"; - - kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; - - }; - - $scope.addBaseIndicator = function(tmpIndicatorSelection){ - - kommonitorScriptHelperService.addBaseIndicator(tmpIndicatorSelection); - $scope.baseIndicators.push(tmpIndicatorSelection); - - //reset the one and only parameter in this case each time a base indicator is added - $scope.resetScriptParameter(); - $scope.resetComputationFormulaAndLegend(); - - setTimeout(() => { - $scope.$digest(); - }); - }; - - $scope.removeBaseIndicator = function(baseIndicator){ - kommonitorScriptHelperService.removeBaseIndicator(baseIndicator); - - var i; - for (let index = 0; index < $scope.baseIndicators.length; index++) { - const element = $scope.baseIndicators[index]; - - if(baseIndicator.indicatorId == element.indicatorId){ - i = index; - break; - } - } - $scope.baseIndicators.splice(i, 1); - - //reset the one and only parameter in this case each time a base indicator is removed - $scope.resetScriptParameter(); - $scope.resetComputationFormulaAndLegend(); - - setTimeout(() => { - $scope.$digest(); - }); - }; - - } - ] + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/multiplication/script-multiplication.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + function ScriptMultiplicationController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_multiply.js"; + $scope.tmpIndicatorSelection = undefined; + $scope.tmpGeoresourceSelection = undefined; + $scope.baseIndicators = []; + $scope.parameterName = "COMPUTATION_ID"; + $scope.parameterDescription = "Komma-separierte Liste aller Indikatoren-IDs zur Multiplikation."; + $scope.parameterDefaultValue = undefined; + $scope.parameterNumericMinValue = 0; + $scope.parameterNumericMaxValue = 1; + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + $scope.scriptFormulaHTML = undefined; + /* + * reset relevant things due to change of script type + */ + $scope.init = function () { + kommonitorScriptHelperService.reset(); + $scope.initFixedScriptCode(); + }; + $scope.initFixedScriptCode = function () { + $http.get($scope.pathToScriptResource, { 'responseType': 'text' }).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + $scope.init(); + $scope.generateParameterValue = function (requiredIndicatorsArray) { + var result = ""; + for (let index = 0; index < requiredIndicatorsArray.length; index++) { + const indicatorMetadata = requiredIndicatorsArray[index]; + result += indicatorMetadata.indicatorId; + if (index < requiredIndicatorsArray.length - 1) { + result += ","; + } + } + return result; + }; + $scope.resetScriptParameter = function () { + kommonitorScriptHelperService.requiredScriptParameters_tmp = []; + $scope.parameterDefaultValue = $scope.generateParameterValue($scope.baseIndicators); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName, $scope.parameterDescription, $scope.parameterDataType, $scope.parameterDefaultValue, $scope.parameterNumericMinValue, $scope.parameterNumericMaxValue); + }; + $scope.resetComputationFormulaAndLegend = function () { + kommonitorScriptHelperService.scriptFormulaHTML = ""; + var formulaHTML = "Berechnung gemäß Formel
"; + var legendItemsHTML = "Legende zur Formel
"; + formulaHTML += "$ "; + for (let index = 0; index < $scope.baseIndicators.length; index++) { + const indicatorMetadata = $scope.baseIndicators[index]; + var letterValue = kommonitorScriptHelperService.getAlphabetLetterFromNumber(index); + // we can use TEX code as we use MathJax library + formulaHTML += letterValue; + legendItemsHTML += "$" + letterValue + "$: " + indicatorMetadata.indicatorName + " [" + indicatorMetadata.unit + "]"; + if (index < $scope.baseIndicators.length - 1) { + formulaHTML += " \\times "; + legendItemsHTML += "
"; + } + } + formulaHTML += " $"; + kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; + }; + $scope.addBaseIndicator = function (tmpIndicatorSelection) { + kommonitorScriptHelperService.addBaseIndicator(tmpIndicatorSelection); + $scope.baseIndicators.push(tmpIndicatorSelection); + //reset the one and only parameter in this case each time a base indicator is added + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + setTimeout(() => { + $scope.$digest(); + }); + }; + $scope.removeBaseIndicator = function (baseIndicator) { + kommonitorScriptHelperService.removeBaseIndicator(baseIndicator); + var i; + for (let index = 0; index < $scope.baseIndicators.length; index++) { + const element = $scope.baseIndicators[index]; + if (baseIndicator.indicatorId == element.indicatorId) { + i = index; + break; + } + } + $scope.baseIndicators.splice(i, 1); + //reset the one and only parameter in this case each time a base indicator is removed + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + setTimeout(() => { + $scope.$digest(); + }); + }; + } + ] }); +//# sourceMappingURL=script-multiplication.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/multiplication/script-multiplication.component.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/multiplication/script-multiplication.component.js.map new file mode 100644 index 000000000..ac80d20e7 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/multiplication/script-multiplication.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-multiplication.component.js","sourceRoot":"","sources":["script-multiplication.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC,SAAS,CAAC,sBAAsB,EAAE;IACxE,WAAW,EAAE,qIAAqI;IAClJ,UAAU,EAAE,CAAC,+BAA+B,EAAE,+BAA+B,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU;QAClI,SAAS,8BAA8B,CAAC,6BAA6B,EAAE,6BAA6B,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ;YAE/I,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAC3E,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAE3E,sCAAsC;YACtC,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,CAAC;YAEtB,MAAM,CAAC,oBAAoB,GAAG,wDAAwD,CAAC;YAEvF,MAAM,CAAC,qBAAqB,GAAG,SAAS,CAAC;YACzC,MAAM,CAAC,uBAAuB,GAAG,SAAS,CAAC;YAE3C,MAAM,CAAC,cAAc,GAAG,EAAE,CAAC;YAE3B,MAAM,CAAC,aAAa,GAAG,gBAAgB,CAAC;YACxC,MAAM,CAAC,oBAAoB,GAAG,kEAAkE,CAAC;YACjG,MAAM,CAAC,qBAAqB,GAAG,SAAS,CAAC;YACzC,MAAM,CAAC,wBAAwB,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E,CAAC;gBAClB,CAAC,CAAC,CAAC;YACJ,CAAC,CAAC;QAEH,CAAC;KACD;CACD,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/multiplication/script-multiplication.component.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/multiplication/script-multiplication.component.ts new file mode 100644 index 000000000..0ae39dc08 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/multiplication/script-multiplication.component.ts @@ -0,0 +1,159 @@ +angular.module('scriptMultiplication').component('scriptMultiplication', { + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/multiplication/script-multiplication.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + function ScriptMultiplicationController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_multiply.js"; + + $scope.tmpIndicatorSelection = undefined; + $scope.tmpGeoresourceSelection = undefined; + + $scope.baseIndicators = []; + + $scope.parameterName = "COMPUTATION_ID"; + $scope.parameterDescription = "Komma-separierte Liste aller Indikatoren-IDs zur Multiplikation."; + $scope.parameterDefaultValue = undefined; + $scope.parameterNumericMinValue = 0; + $scope.parameterNumericMaxValue = 1; + + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + + $scope.scriptFormulaHTML = undefined; + + /* + * reset relevant things due to change of script type + */ + $scope.init = function(){ + kommonitorScriptHelperService.reset(); + + $scope.initFixedScriptCode(); + }; + + $scope.initFixedScriptCode = function(){ + $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + + $scope.init(); + + $scope.generateParameterValue = function(requiredIndicatorsArray){ + + var result=""; + for (let index = 0; index < requiredIndicatorsArray.length; index++) { + const indicatorMetadata = requiredIndicatorsArray[index]; + result+=indicatorMetadata.indicatorId; + if(index < requiredIndicatorsArray.length - 1){ + result+=","; + } + } + + return result; + }; + + $scope.resetScriptParameter = function(){ + kommonitorScriptHelperService.requiredScriptParameters_tmp = []; + $scope.parameterDefaultValue = $scope.generateParameterValue($scope.baseIndicators); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName, $scope.parameterDescription, $scope.parameterDataType, $scope.parameterDefaultValue, $scope.parameterNumericMinValue, $scope.parameterNumericMaxValue); + }; + + $scope.resetComputationFormulaAndLegend = function(){ + kommonitorScriptHelperService.scriptFormulaHTML = ""; + + var formulaHTML = "Berechnung gemäß Formel
"; + var legendItemsHTML = "Legende zur Formel
"; + + formulaHTML += "$ "; + + for (let index = 0; index < $scope.baseIndicators.length; index++) { + const indicatorMetadata = $scope.baseIndicators[index]; + var letterValue = kommonitorScriptHelperService.getAlphabetLetterFromNumber(index); + + // we can use TEX code as we use MathJax library + formulaHTML+=letterValue; + legendItemsHTML+="$" + letterValue + "$: " + indicatorMetadata.indicatorName + " [" + indicatorMetadata.unit + "]"; + if(index < $scope.baseIndicators.length - 1){ + formulaHTML+=" \\times "; + legendItemsHTML+="
"; + } + } + + formulaHTML += " $"; + + kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; + + }; + + $scope.addBaseIndicator = function(tmpIndicatorSelection){ + + kommonitorScriptHelperService.addBaseIndicator(tmpIndicatorSelection); + $scope.baseIndicators.push(tmpIndicatorSelection); + + //reset the one and only parameter in this case each time a base indicator is added + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + + setTimeout(() => { + $scope.$digest(); + }); + }; + + $scope.removeBaseIndicator = function(baseIndicator){ + kommonitorScriptHelperService.removeBaseIndicator(baseIndicator); + + var i; + for (let index = 0; index < $scope.baseIndicators.length; index++) { + const element = $scope.baseIndicators[index]; + + if(baseIndicator.indicatorId == element.indicatorId){ + i = index; + break; + } + } + $scope.baseIndicators.splice(i, 1); + + //reset the one and only parameter in this case each time a base indicator is removed + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + + setTimeout(() => { + $scope.$digest(); + }); + }; + + } + ] +}); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/multiplication/script-multiplication.module.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/multiplication/script-multiplication.module.js index 1a2334421..d9d09fdec 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/multiplication/script-multiplication.module.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/multiplication/script-multiplication.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('scriptMultiplication', ['kommonitorDataExchange', 'kommonitorScriptHelper']); +//# sourceMappingURL=script-multiplication.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/multiplication/script-multiplication.module.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/multiplication/script-multiplication.module.js.map new file mode 100644 index 000000000..b5601c876 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/multiplication/script-multiplication.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-multiplication.module.js","sourceRoot":"","sources":["script-multiplication.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,sBAAsB,EAAE,CAAC,wBAAwB,EAAE,wBAAwB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/multiplication/script-multiplication.module.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/multiplication/script-multiplication.module.ts new file mode 100644 index 000000000..1a2334421 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/multiplication/script-multiplication.module.ts @@ -0,0 +1 @@ +angular.module('scriptMultiplication', ['kommonitorDataExchange', 'kommonitorScriptHelper']); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/percentage/script-percentage.component.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/percentage/script-percentage.component.js index 022662deb..36060ad12 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/percentage/script-percentage.component.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/percentage/script-percentage.component.js @@ -1,190 +1,149 @@ +"use strict"; angular.module('scriptPercentage').component('scriptPercentage', { - templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/percentage/script-percentage.template.html", - controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', - function ScriptPercentagetroller(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; - - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_percentage.js"; - - $scope.tmpIndicatorSelection = undefined; - $scope.tmpGeoresourceSelection = undefined; - - $scope.baseIndicators = []; - - $scope.refIndicatorSelection = undefined; - $scope.refIndicatorSelection_old = undefined; - - $scope.parameterName_computationIndicators = "COMPUTATION_ID"; - $scope.parameterDescription_computationIndicators = "Komma-separierte Liste aller Dividenden Indikatoren-IDs."; - $scope.parameterDefaultValue_computationIndicators = undefined; - $scope.parameterNumericMinValue_computationIndicators = 0; - $scope.parameterNumericMaxValue_computationIndicators = 1; - - $scope.parameterName_referenceIndicator = "REFERENCE_ID"; - $scope.parameterDescription_referenceIndicator = "Indikatoren-ID des Divisors."; - $scope.parameterDefaultValue_referenceIndicator = undefined; - $scope.parameterNumericMinValue_referenceIndicator = 0; - $scope.parameterNumericMaxValue_referenceIndicator = 1; - - /* - availableScriptDataTypes = [ - { - "displayName": "Textuell (String)", - "apiName": "string" - }, - { - "displayName": "Wahrheitswert (Boolean)", - "apiName": "boolean" - }, - { - "displayName": "Ganzzahl (Integer)", - "apiName": "integer" - }, - { - "displayName": "Gleitkommazahl (Double)", - "apiName": "double" - } - ]; - */ - $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; - - $scope.scriptCode_readableString_forPreview = undefined; - $scope.scriptCodeDomElementId = "#scriptCodePreview"; - - $scope.scriptFormulaHTML = undefined; - - /* - * reset relevant things due to change of script type - */ - $scope.init = function(){ - kommonitorScriptHelperService.reset(); - - $scope.initFixedScriptCode(); - }; - - $scope.initFixedScriptCode = function(){ - $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { - $scope.scriptCode_readableString_forPreview = response.data; - kommonitorScriptHelperService.scriptCode_readableString = response.data; - $scope.scriptCode_readableString_forPreview = response.data; - - kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); - }); - }; - - $scope.init(); - - $scope.onChangeReferenceIndicator = function(refIndicatorSelection){ - // remove previous refIndicator from requiredIndicators and add new one - kommonitorScriptHelperService.removeBaseIndicator($scope.refIndicatorSelection_old); - kommonitorScriptHelperService.addBaseIndicator(refIndicatorSelection); - - $scope.refIndicatorSelection_old = refIndicatorSelection; - - //reset the one and only parameter in this case each time a base indicator is added - $scope.resetRefIndicatorParameter(); - $scope.resetComputationFormulaAndLegend(); - - }; - - $scope.resetScriptParameter_computationIndicators = function(requiredIndicatorsArray){ - - var result=""; - for (let index = 0; index < requiredIndicatorsArray.length; index++) { - const indicatorMetadata = requiredIndicatorsArray[index]; - result+=indicatorMetadata.indicatorId; - if(index < requiredIndicatorsArray.length - 1){ - result+=","; - } - } - - return result; - }; - - $scope.resetComputationIndicatorParameter = function(){ - kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationIndicators); - $scope.parameterDefaultValue_computationIndicators = $scope.resetScriptParameter_computationIndicators($scope.baseIndicators); - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationIndicators, $scope.parameterDescription_computationIndicators, $scope.parameterDataType, $scope.parameterDefaultValue_computationIndicators, $scope.parameterNumericMinValue_computationIndicators, $scope.parameterNumericMaxValue_computationIndicators); - }; - - $scope.resetRefIndicatorParameter = function(){ - kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_referenceIndicator); - $scope.parameterDefaultValue_referenceIndicator = $scope.refIndicatorSelection.indicatorId; - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_referenceIndicator, $scope.parameterDescription_referenceIndicator, $scope.parameterDataType, $scope.parameterDefaultValue_referenceIndicator, $scope.parameterNumericMinValue_referenceIndicator, $scope.parameterNumericMaxValue_referenceIndicator); - }; - - $scope.resetComputationFormulaAndLegend = function(){ - kommonitorScriptHelperService.scriptFormulaHTML = ""; - - var formulaHTML = "Berechnung gemäß Formel
"; - var legendItemsHTML = "Legende zur Formel
"; - - // referenceIndicator - formulaHTML+="$$ \\frac{ "; - - // baseIndicators / computationIndicators - for (let index = 0; index < $scope.baseIndicators.length; index++) { - const indicatorMetadata = $scope.baseIndicators[index]; - var letterValue = kommonitorScriptHelperService.getAlphabetLetterFromNumber(index); - - // we can use TEX code as we use MathJax library - formulaHTML+=letterValue; - legendItemsHTML+="$" + letterValue + "$: " + indicatorMetadata.indicatorName + " [" + indicatorMetadata.unit + "]"; - if(index < $scope.baseIndicators.length - 1){ - formulaHTML+=" + "; - legendItemsHTML+="
"; - } - } - - formulaHTML += "}{ I_{ref}} \\times 100 $$"; - legendItemsHTML+="
$ I_{ref} $: " + $scope.refIndicatorSelection.indicatorName + " [" + $scope.refIndicatorSelection.unit + "]" + "
"; - - kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; - - }; - - $scope.addBaseIndicator = function(tmpIndicatorSelection){ - - kommonitorScriptHelperService.addBaseIndicator(tmpIndicatorSelection); - $scope.baseIndicators.push(tmpIndicatorSelection); - - //reset the one and only parameter in this case each time a base indicator is added - $scope.resetComputationIndicatorParameter(); - $scope.resetComputationFormulaAndLegend(); - - setTimeout(() => { - $scope.$digest(); - }); - }; - - $scope.removeBaseIndicator = function(baseIndicator){ - kommonitorScriptHelperService.removeBaseIndicator(baseIndicator); - - var i; - for (let index = 0; index < $scope.baseIndicators.length; index++) { - const element = $scope.baseIndicators[index]; - - if(baseIndicator.indicatorId == element.indicatorId){ - i = index; - break; - } - } - $scope.baseIndicators.splice(i, 1); - - //reset the one and only parameter in this case each time a base indicator is removed - $scope.resetComputationIndicatorParameter(); - $scope.resetComputationFormulaAndLegend(); - - setTimeout(() => { - $scope.$digest(); - }); - }; - - } - ] + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/percentage/script-percentage.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + function ScriptPercentagetroller(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_percentage.js"; + $scope.tmpIndicatorSelection = undefined; + $scope.tmpGeoresourceSelection = undefined; + $scope.baseIndicators = []; + $scope.refIndicatorSelection = undefined; + $scope.refIndicatorSelection_old = undefined; + $scope.parameterName_computationIndicators = "COMPUTATION_ID"; + $scope.parameterDescription_computationIndicators = "Komma-separierte Liste aller Dividenden Indikatoren-IDs."; + $scope.parameterDefaultValue_computationIndicators = undefined; + $scope.parameterNumericMinValue_computationIndicators = 0; + $scope.parameterNumericMaxValue_computationIndicators = 1; + $scope.parameterName_referenceIndicator = "REFERENCE_ID"; + $scope.parameterDescription_referenceIndicator = "Indikatoren-ID des Divisors."; + $scope.parameterDefaultValue_referenceIndicator = undefined; + $scope.parameterNumericMinValue_referenceIndicator = 0; + $scope.parameterNumericMaxValue_referenceIndicator = 1; + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + $scope.scriptFormulaHTML = undefined; + /* + * reset relevant things due to change of script type + */ + $scope.init = function () { + kommonitorScriptHelperService.reset(); + $scope.initFixedScriptCode(); + }; + $scope.initFixedScriptCode = function () { + $http.get($scope.pathToScriptResource, { 'responseType': 'text' }).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + $scope.init(); + $scope.onChangeReferenceIndicator = function (refIndicatorSelection) { + // remove previous refIndicator from requiredIndicators and add new one + kommonitorScriptHelperService.removeBaseIndicator($scope.refIndicatorSelection_old); + kommonitorScriptHelperService.addBaseIndicator(refIndicatorSelection); + $scope.refIndicatorSelection_old = refIndicatorSelection; + //reset the one and only parameter in this case each time a base indicator is added + $scope.resetRefIndicatorParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.resetScriptParameter_computationIndicators = function (requiredIndicatorsArray) { + var result = ""; + for (let index = 0; index < requiredIndicatorsArray.length; index++) { + const indicatorMetadata = requiredIndicatorsArray[index]; + result += indicatorMetadata.indicatorId; + if (index < requiredIndicatorsArray.length - 1) { + result += ","; + } + } + return result; + }; + $scope.resetComputationIndicatorParameter = function () { + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationIndicators); + $scope.parameterDefaultValue_computationIndicators = $scope.resetScriptParameter_computationIndicators($scope.baseIndicators); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationIndicators, $scope.parameterDescription_computationIndicators, $scope.parameterDataType, $scope.parameterDefaultValue_computationIndicators, $scope.parameterNumericMinValue_computationIndicators, $scope.parameterNumericMaxValue_computationIndicators); + }; + $scope.resetRefIndicatorParameter = function () { + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_referenceIndicator); + $scope.parameterDefaultValue_referenceIndicator = $scope.refIndicatorSelection.indicatorId; + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_referenceIndicator, $scope.parameterDescription_referenceIndicator, $scope.parameterDataType, $scope.parameterDefaultValue_referenceIndicator, $scope.parameterNumericMinValue_referenceIndicator, $scope.parameterNumericMaxValue_referenceIndicator); + }; + $scope.resetComputationFormulaAndLegend = function () { + kommonitorScriptHelperService.scriptFormulaHTML = ""; + var formulaHTML = "Berechnung gemäß Formel
"; + var legendItemsHTML = "Legende zur Formel
"; + // referenceIndicator + formulaHTML += "$$ \\frac{ "; + // baseIndicators / computationIndicators + for (let index = 0; index < $scope.baseIndicators.length; index++) { + const indicatorMetadata = $scope.baseIndicators[index]; + var letterValue = kommonitorScriptHelperService.getAlphabetLetterFromNumber(index); + // we can use TEX code as we use MathJax library + formulaHTML += letterValue; + legendItemsHTML += "$" + letterValue + "$: " + indicatorMetadata.indicatorName + " [" + indicatorMetadata.unit + "]"; + if (index < $scope.baseIndicators.length - 1) { + formulaHTML += " + "; + legendItemsHTML += "
"; + } + } + formulaHTML += "}{ I_{ref}} \\times 100 $$"; + legendItemsHTML += "
$ I_{ref} $: " + $scope.refIndicatorSelection.indicatorName + " [" + $scope.refIndicatorSelection.unit + "]" + "
"; + kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; + }; + $scope.addBaseIndicator = function (tmpIndicatorSelection) { + kommonitorScriptHelperService.addBaseIndicator(tmpIndicatorSelection); + $scope.baseIndicators.push(tmpIndicatorSelection); + //reset the one and only parameter in this case each time a base indicator is added + $scope.resetComputationIndicatorParameter(); + $scope.resetComputationFormulaAndLegend(); + setTimeout(() => { + $scope.$digest(); + }); + }; + $scope.removeBaseIndicator = function (baseIndicator) { + kommonitorScriptHelperService.removeBaseIndicator(baseIndicator); + var i; + for (let index = 0; index < $scope.baseIndicators.length; index++) { + const element = $scope.baseIndicators[index]; + if (baseIndicator.indicatorId == element.indicatorId) { + i = index; + break; + } + } + $scope.baseIndicators.splice(i, 1); + //reset the one and only parameter in this case each time a base indicator is removed + $scope.resetComputationIndicatorParameter(); + $scope.resetComputationFormulaAndLegend(); + setTimeout(() => { + $scope.$digest(); + }); + }; + } + ] }); +//# sourceMappingURL=script-percentage.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/percentage/script-percentage.component.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/percentage/script-percentage.component.js.map new file mode 100644 index 000000000..20832b506 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/percentage/script-percentage.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-percentage.component.js","sourceRoot":"","sources":["script-percentage.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,SAAS,CAAC,kBAAkB,EAAE;IAChE,WAAW,EAAE,6HAA6H;IAC1I,UAAU,EAAE,CAAC,+BAA+B,EAAE,+BAA+B,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU;QAClI,SAAS,uBAAuB,CAAC,6BAA6B,EAAE,6BAA6B,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ;YAExI,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAC3E,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAE3E,sCAAsC;YACtC,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,CAAC;YAEtB,MAAM,CAAC,oBAAoB,GAAG,0DAA0D,CAAC;YAEzF,MAAM,CAAC,qBAAqB,GAAG,SAAS,CAAC;YACzC,MAAM,CAAC,uBAAuB,GAAG,SAAS,CAAC;YAE3C,MAAM,CAAC,cAAc,GAAG,EAAE,CAAC;YAE3B,MAAM,CAAC,qBAAqB,GAAG,SAAS,CAAC;YACzC,MAAM,CAAC,yBAAyB,GAAG,SAAS,CAAC;YAE7C,MAAM,CAAC,mCAAmC,GAAG,gBAAgB,CAAC;YAC9D,MAAM,CAAC,0CAA0C,GAAG,0DAA0D,CAAC;YAC/G,MAAM,CAAC,2CAA2C,GAAG,SAAS,CAAC;YAC/D,MAAM,CAAC,8CAA8C,GAAG,CAAC,CAAC;YAC1D,MAAM,CAAC,8CAA8C,GAAG,CAAC,CAAC;YAE1D,MAAM,CAAC,gCAAgC,GAAG,cAAc,CAAC;YACzD,MAAM,CAAC,uCAAuC,GAAG,8BAA8B,CAAC;YAChF,MA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AM,CAAC,gBAAgB,GAAG,UAAS,qBAAqB;gBAEvD,6BAA6B,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,CAAC;gBACtE,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;gBAElD,mFAAmF;gBACnF,MAAM,CAAC,kCAAkC,EAAE,CAAC;gBAC5C,MAAM,CAAC,gCAAgC,EAAE,CAAC;gBAE1C,UAAU,CAAC,GAAG,EAAE;oBACf,MAAM,CAAC,OAAO,EAAE,CAAC;gBAClB,CAAC,CAAC,CAAC;YACJ,CAAC,CAAC;YAEF,MAAM,CAAC,mBAAmB,GAAG,UAAS,aAAa;gBAClD,6BAA6B,CAAC,mBAAmB,CAAC,aAAa,CAAC,CAAC;gBAEjE,IAAI,CAAC,CAAC;gBACN,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;oBAClE,MAAM,OAAO,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;oBAE7C,IAAG,aAAa,CAAC,WAAW,IAAI,OAAO,CAAC,WAAW,EAAC;wBACnD,CAAC,GAAG,KAAK,CAAC;wBACV,MAAM;qBACN;iBACD;gBACD,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;gBAEnC,qFAAqF;gBACrF,MAAM,CAAC,kCAAkC,EAAE,CAAC;gBAC5C,MAAM,CAAC,gCAAgC,EAAE,CAAC;gBAE1C,UAAU,CAAC,GAAG,EAAE;oBACf,MAAM,CAAC,OAAO,EAAE,CAAC;gBAClB,CAAC,CAAC,CAAC;YACJ,CAAC,CAAC;QAEH,CAAC;KACD;CACD,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/percentage/script-percentage.component.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/percentage/script-percentage.component.ts new file mode 100644 index 000000000..022662deb --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/percentage/script-percentage.component.ts @@ -0,0 +1,190 @@ +angular.module('scriptPercentage').component('scriptPercentage', { + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/percentage/script-percentage.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + function ScriptPercentagetroller(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_percentage.js"; + + $scope.tmpIndicatorSelection = undefined; + $scope.tmpGeoresourceSelection = undefined; + + $scope.baseIndicators = []; + + $scope.refIndicatorSelection = undefined; + $scope.refIndicatorSelection_old = undefined; + + $scope.parameterName_computationIndicators = "COMPUTATION_ID"; + $scope.parameterDescription_computationIndicators = "Komma-separierte Liste aller Dividenden Indikatoren-IDs."; + $scope.parameterDefaultValue_computationIndicators = undefined; + $scope.parameterNumericMinValue_computationIndicators = 0; + $scope.parameterNumericMaxValue_computationIndicators = 1; + + $scope.parameterName_referenceIndicator = "REFERENCE_ID"; + $scope.parameterDescription_referenceIndicator = "Indikatoren-ID des Divisors."; + $scope.parameterDefaultValue_referenceIndicator = undefined; + $scope.parameterNumericMinValue_referenceIndicator = 0; + $scope.parameterNumericMaxValue_referenceIndicator = 1; + + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + + $scope.scriptFormulaHTML = undefined; + + /* + * reset relevant things due to change of script type + */ + $scope.init = function(){ + kommonitorScriptHelperService.reset(); + + $scope.initFixedScriptCode(); + }; + + $scope.initFixedScriptCode = function(){ + $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + + $scope.init(); + + $scope.onChangeReferenceIndicator = function(refIndicatorSelection){ + // remove previous refIndicator from requiredIndicators and add new one + kommonitorScriptHelperService.removeBaseIndicator($scope.refIndicatorSelection_old); + kommonitorScriptHelperService.addBaseIndicator(refIndicatorSelection); + + $scope.refIndicatorSelection_old = refIndicatorSelection; + + //reset the one and only parameter in this case each time a base indicator is added + $scope.resetRefIndicatorParameter(); + $scope.resetComputationFormulaAndLegend(); + + }; + + $scope.resetScriptParameter_computationIndicators = function(requiredIndicatorsArray){ + + var result=""; + for (let index = 0; index < requiredIndicatorsArray.length; index++) { + const indicatorMetadata = requiredIndicatorsArray[index]; + result+=indicatorMetadata.indicatorId; + if(index < requiredIndicatorsArray.length - 1){ + result+=","; + } + } + + return result; + }; + + $scope.resetComputationIndicatorParameter = function(){ + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationIndicators); + $scope.parameterDefaultValue_computationIndicators = $scope.resetScriptParameter_computationIndicators($scope.baseIndicators); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationIndicators, $scope.parameterDescription_computationIndicators, $scope.parameterDataType, $scope.parameterDefaultValue_computationIndicators, $scope.parameterNumericMinValue_computationIndicators, $scope.parameterNumericMaxValue_computationIndicators); + }; + + $scope.resetRefIndicatorParameter = function(){ + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_referenceIndicator); + $scope.parameterDefaultValue_referenceIndicator = $scope.refIndicatorSelection.indicatorId; + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_referenceIndicator, $scope.parameterDescription_referenceIndicator, $scope.parameterDataType, $scope.parameterDefaultValue_referenceIndicator, $scope.parameterNumericMinValue_referenceIndicator, $scope.parameterNumericMaxValue_referenceIndicator); + }; + + $scope.resetComputationFormulaAndLegend = function(){ + kommonitorScriptHelperService.scriptFormulaHTML = ""; + + var formulaHTML = "Berechnung gemäß Formel
"; + var legendItemsHTML = "Legende zur Formel
"; + + // referenceIndicator + formulaHTML+="$$ \\frac{ "; + + // baseIndicators / computationIndicators + for (let index = 0; index < $scope.baseIndicators.length; index++) { + const indicatorMetadata = $scope.baseIndicators[index]; + var letterValue = kommonitorScriptHelperService.getAlphabetLetterFromNumber(index); + + // we can use TEX code as we use MathJax library + formulaHTML+=letterValue; + legendItemsHTML+="$" + letterValue + "$: " + indicatorMetadata.indicatorName + " [" + indicatorMetadata.unit + "]"; + if(index < $scope.baseIndicators.length - 1){ + formulaHTML+=" + "; + legendItemsHTML+="
"; + } + } + + formulaHTML += "}{ I_{ref}} \\times 100 $$"; + legendItemsHTML+="
$ I_{ref} $: " + $scope.refIndicatorSelection.indicatorName + " [" + $scope.refIndicatorSelection.unit + "]" + "
"; + + kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; + + }; + + $scope.addBaseIndicator = function(tmpIndicatorSelection){ + + kommonitorScriptHelperService.addBaseIndicator(tmpIndicatorSelection); + $scope.baseIndicators.push(tmpIndicatorSelection); + + //reset the one and only parameter in this case each time a base indicator is added + $scope.resetComputationIndicatorParameter(); + $scope.resetComputationFormulaAndLegend(); + + setTimeout(() => { + $scope.$digest(); + }); + }; + + $scope.removeBaseIndicator = function(baseIndicator){ + kommonitorScriptHelperService.removeBaseIndicator(baseIndicator); + + var i; + for (let index = 0; index < $scope.baseIndicators.length; index++) { + const element = $scope.baseIndicators[index]; + + if(baseIndicator.indicatorId == element.indicatorId){ + i = index; + break; + } + } + $scope.baseIndicators.splice(i, 1); + + //reset the one and only parameter in this case each time a base indicator is removed + $scope.resetComputationIndicatorParameter(); + $scope.resetComputationFormulaAndLegend(); + + setTimeout(() => { + $scope.$digest(); + }); + }; + + } + ] +}); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/percentage/script-percentage.module.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/percentage/script-percentage.module.js index 638b0f202..82d524e12 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/percentage/script-percentage.module.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/percentage/script-percentage.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('scriptPercentage', ['kommonitorDataExchange', 'kommonitorScriptHelper']); +//# sourceMappingURL=script-percentage.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/percentage/script-percentage.module.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/percentage/script-percentage.module.js.map new file mode 100644 index 000000000..cf2d65a13 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/percentage/script-percentage.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-percentage.module.js","sourceRoot":"","sources":["script-percentage.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,CAAC,wBAAwB,EAAE,wBAAwB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/percentage/script-percentage.module.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/percentage/script-percentage.module.ts new file mode 100644 index 000000000..638b0f202 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/percentage/script-percentage.module.ts @@ -0,0 +1 @@ +angular.module('scriptPercentage', ['kommonitorDataExchange', 'kommonitorScriptHelper']); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/pointsInPolygon/script-points-in-polygon.component.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/pointsInPolygon/script-points-in-polygon.component.js index 72f4147ea..0378952d1 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/pointsInPolygon/script-points-in-polygon.component.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/pointsInPolygon/script-points-in-polygon.component.js @@ -1,304 +1,269 @@ +"use strict"; angular.module('scriptPointsInPolygon').component('scriptPointsInPolygon', { - templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/pointsInPolygon/script-points-in-polygon.template.html", - controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', - 'kommonitorCacheHelperService', - function ScriptPointsInPolygonController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, - $http, __env, $timeout, kommonitorCacheHelperService) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; - - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - $scope.pathToScriptResource = "./kommonitor-script-resources/km_georessouce_count_pointsWithinPolygon.js"; - - $scope.propertySchema = {}; - $scope.propertyOptions = undefined; - $scope.propertyValueOptions = undefined; - - $scope.georesourceSelection = undefined; - $scope.georesourceSelection_old = undefined; - - // parameter for georesource dataset - $scope.parameterName_computationGeoresource = "compGeoId"; - $scope.parameterDescription_computationGeoresource = "Georessourcen ID des Punktdatensatzes."; - $scope.parameterDefaultValue_computationGeoresource = undefined; - $scope.parameterNumericMinValue_computationGeoresource = 0; - $scope.parameterNumericMaxValue_computationGeoresource = 1; - - // parameter for object property name - $scope.parameterName_computationFilterProperty = "compFilterProp"; - $scope.parameterDescription_computationFilterProperty = "Georessourcen Attributname."; - $scope.parameterDefaultValue_computationFilterProperty = undefined; - $scope.parameterNumericMinValue_computationFilterProperty = 0; - $scope.parameterNumericMaxValue_computationFilterProperty = 1; - - // parameter for logical operator - $scope.parameterName_computationFilterOperator = "compFilterOperator"; - $scope.parameterDescription_computationFilterOperator = "Vergleichsoperator"; - $scope.parameterDefaultValue_computationFilterOperator = undefined; - $scope.parameterNumericMinValue_computationFilterOperator = 0; - $scope.parameterNumericMaxValue_computationFilterOperator = 1; - - // parameter for property value - $scope.parameterName_computationFilterPropertyValue = "compFilterPropVal"; - $scope.parameterDescription_computationFilterPropertyValue = "Filterwert."; - $scope.parameterDefaultValue_computationFilterPropertyValue = undefined; - $scope.parameterNumericMinValue_computationFilterPropertyValue = 0; - $scope.parameterNumericMaxValue_computationFilterPropertyValue = 1; - - // parameter for property value - $scope.parameterDefaultValue_computationFilterPropertyValueRange_from = undefined; - $scope.parameterDefaultValue_computationFilterPropertyValueRange_to = undefined; - - /* - availableScriptDataTypes = [ - { - "displayName": "Textuell (String)", - "apiName": "string" - }, - { - "displayName": "Wahrheitswert (Boolean)", - "apiName": "boolean" - }, - { - "displayName": "Ganzzahl (Integer)", - "apiName": "integer" - }, - { - "displayName": "Gleitkommazahl (Double)", - "apiName": "double" - } - ]; - */ - $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; - - $scope.scriptCode_readableString_forPreview = undefined; - $scope.scriptCodeDomElementId = "#scriptCodePreview"; - - $scope.scriptFormulaHTML = undefined; - - $scope.propertyValueSelection = []; - - $scope.dropdownTranslations = kommonitorDataExchangeService.multiselectDropdownTranslations; - $scope.dropdownSettings = kommonitorDataExchangeService.multiselectDropdownSettings; - $scope.dropdownEvents = { - onSelectionChanged: function() { - $scope.onChangePropertyValue(); - } - }; - - - /* - * reset relevant things due to change of script type - */ - $scope.init = function(){ - kommonitorScriptHelperService.reset(); - - $scope.initFixedScriptCode(); - }; - - $scope.initFixedScriptCode = function(){ - $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { - $scope.scriptCode_readableString_forPreview = response.data; - kommonitorScriptHelperService.scriptCode_readableString = response.data; - $scope.scriptCode_readableString_forPreview = response.data; - - kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); - }); - }; - - $scope.init(); - - $scope.onChangeGeoresource = function(georesourceSelection){ - // remove previous refIndicator from requiredIndicators and add new one - if($scope.georesourceSelection_old){ - kommonitorScriptHelperService.removeBaseGeoresource($scope.georesourceSelection_old); - } - kommonitorScriptHelperService.addBaseGeoresource(georesourceSelection); - - $scope.georesourceSelection_old = georesourceSelection; - - //reset the one and only parameter in this case each time a base indicator is added - $scope.resetGeoresourceParameter(); - $scope.resetPropertyOptions(); - $scope.resetComputationFormulaAndLegend(); - }; - - $scope.onChangePropertyName = function(){ - $scope.resetScriptParameter_filterPropertyName(); - $scope.resetComputationFormulaAndLegend(); - $scope.filterOperatorOptions(); - $scope.resetPropertyValueOptions(); - if ($scope.parameterDefaultValue_computationFilterOperator === 'Contains') { - $scope.propertyValueSelection = []; - } - }; - - $scope.onChangeOperatorOption = function(){ - if ($scope.parameterDefaultValue_computationFilterOperator !== 'Contains') { - $scope.propertyValueSelection = []; - } - $scope.resetScriptParameter_operator(); - $scope.resetComputationFormulaAndLegend(); - }; - - $scope.onChangePropertyValue = function(){ - $scope.resetScriptParameter_filterPropertyValue(); - $scope.resetComputationFormulaAndLegend(); - }; - - $scope.resetScriptParameter_computationGeoresource = function(georesourceMetadata){ - - return georesourceMetadata.georesourceId; - }; - - $scope.resetGeoresourceParameter = function(){ - kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationGeoresource); - $scope.parameterDefaultValue_computationGeoresource = $scope.resetScriptParameter_computationGeoresource($scope.georesourceSelection); - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationGeoresource, $scope.parameterDescription_computationGeoresource, $scope.parameterDataType, $scope.parameterDefaultValue_computationGeoresource, $scope.parameterNumericMinValue_computationGeoresource, $scope.parameterNumericMaxValue_computationGeoresource); - }; - - $scope.resetPropertyOptions = function(){ - kommonitorCacheHelperService.fetchSingleGeoresourceSchema($scope.parameterDefaultValue_computationGeoresource) - .then((schema) => { - for (var prop in schema) { - if (schema[prop] !== 'Date') { - $scope.propertySchema[prop] = schema[prop]; - } - } - $scope.propertyOptions = Object.keys($scope.propertySchema); - }); - }; - - $scope.resetScriptParameter_filterPropertyName = function(){ - kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationFilterProperty); - $scope.parameterDefaultValue_computationFilterProperty = $scope.propertyName; - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationFilterProperty, $scope.parameterDescription_computationFilterProperty, $scope.parameterDataType, $scope.parameterDefaultValue_computationFilterProperty, $scope.parameterNumericMinValue_computationFilterProperty, $scope.parameterNumericMaxValue_computationFilterProperty); - }; - - $scope.filterOperatorOptions = function(){ - if ($scope.propertySchema[$scope.parameterDefaultValue_computationFilterProperty] === "String"){ - $scope.operatorOptions = [ - { - "apiName": "Equal", - "displayName": "gleich (=)", - }, - { - "apiName": "Unequal", - "displayName": "ungleich (!=)", - }, - { - "apiName": "Contains", - "displayName": "enthält (kommaseparierte Liste)", - } - ]; - } else { - $scope.operatorOptions = [ - { - "apiName": "Equal", - "displayName": "gleich (=)", - }, - { - "apiName": "Greater_than", - "displayName": "größer als (>)", - }, - { - "apiName": "Greater_than_or_equal", - "displayName": "größer als oder gleich (>=)", - }, - { - "apiName": "Less_than", - "displayName": "kleiner als (<)", - }, - { - "apiName": "Less_than_or_equal", - "displayName": "kleiner als oder gleich (<=)", - }, - { - "apiName": "Unequal", - "displayName": "ungleich (!=)", - }, - { - "apiName": "Range", - "displayName": "Wertebereich (>=untere Grenze & { - var data = dataTable; - var tmpArray = data.map(item => { - let value = item[$scope.parameterDefaultValue_computationFilterProperty]; - return value; - }); - if ($scope.propertySchema[$scope.parameterDefaultValue_computationFilterProperty] === "String" || $scope.propertySchema[$scope.parameterDefaultValue_computationFilterProperty] === "Boolean") { - // sort strings - $scope.propertyValueOptions = Array.from(new Set(tmpArray)).sort(); - } else { - // sort numbers - $scope.propertyValueOptions = Array.from(new Set(tmpArray)).sort(function(a,b){ - return a - b; - }); - } - }); - }; - - $scope.filterPropertyValueRange_toOptions = function() { - return function(item) { - if (item > $scope.propertyValueRange_from) { - return true; - } - return false; - }; - }; - - $scope.resetScriptParameter_filterPropertyValue = function() { - kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationFilterPropertyValue); - if ($scope.parameterDefaultValue_computationFilterOperator !== "Contains") { - $scope.parameterDefaultValue_computationFilterPropertyValue = $scope.propertyValue; - } else { - $scope.parameterDefaultValue_computationFilterPropertyValue = $scope.propertyValueSelection.join(); - } - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationFilterPropertyValue, $scope.parameterDescription_computationFilterPropertyValue, $scope.parameterDataType, $scope.parameterDefaultValue_computationFilterPropertyValue, $scope.parameterNumericMinValue_computationFilterPropertyValue, $scope.parameterNumericMaxValue_computationFilterPropertyValue); - }; - - $scope.resetComputationFormulaAndLegend = function(){ - kommonitorScriptHelperService.scriptFormulaHTML = ""; - var formulaHTML = ""; - if ($scope.propertyName !== undefined && $scope.operator && $scope.operator.apiName !== undefined && ($scope.propertyValue != undefined || $scope.propertyValueSelection != undefined)) { - formulaHTML = "Berechnung gemäß Geodatenanalyse
Anzahl Punkte des Datensatzes G1 pro Raumeinheits-Feature
Filterkriterium: '" + $scope.propertyName + "' '" + $scope.operator.displayName + "' '" + $scope.propertyValue + "'"; - if ($scope.operator.apiName === "Range") { - formulaHTML = "Berechnung gemäß Geodatenanalyse
Anzahl Punkte des Datensatzes G1 pro Raumeinheits-Feature
Filterkriterium: '" + $scope.propertyName + "' im " + "Wertebereich von '>=" + $scope.propertyValueRange_from + " bis <" + $scope.propertyValueRange_to + "'"; - } - if ($scope.operator.apiName === "Contains") { - formulaHTML = "Berechnung gemäß Geodatenanalyse
Anzahl Punkte des Datensatzes G1 pro Raumeinheits-Feature
Filterkriterium: '" + $scope.propertyName + "' 'enthält' '" + $scope.propertyValueSelection + "'"; - } - } - else { - formulaHTML = "Berechnung gemäß Geodatenanalyse
Anzahl Punkte des Datensatzes G1 pro Raumeinheits-Feature"; - } - var legendItemsHTML = "Legende zur Geodatenanalyse
G1: " + $scope.georesourceSelection.datasetName; - - kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; - }; - - $scope.onChangePropertyValueRange_range = function() { - $scope.propertyValue = $scope.propertyValueRange_from + "-" + $scope.propertyValueRange_to; - $scope.resetScriptParameter_filterPropertyValue(); - $scope.resetComputationFormulaAndLegend(); - }; - } - ] + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/pointsInPolygon/script-points-in-polygon.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + 'kommonitorCacheHelperService', + function ScriptPointsInPolygonController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout, kommonitorCacheHelperService) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + $scope.pathToScriptResource = "./kommonitor-script-resources/km_georessouce_count_pointsWithinPolygon.js"; + $scope.propertySchema = {}; + $scope.propertyOptions = undefined; + $scope.propertyValueOptions = undefined; + $scope.georesourceSelection = undefined; + $scope.georesourceSelection_old = undefined; + // parameter for georesource dataset + $scope.parameterName_computationGeoresource = "compGeoId"; + $scope.parameterDescription_computationGeoresource = "Georessourcen ID des Punktdatensatzes."; + $scope.parameterDefaultValue_computationGeoresource = undefined; + $scope.parameterNumericMinValue_computationGeoresource = 0; + $scope.parameterNumericMaxValue_computationGeoresource = 1; + // parameter for object property name + $scope.parameterName_computationFilterProperty = "compFilterProp"; + $scope.parameterDescription_computationFilterProperty = "Georessourcen Attributname."; + $scope.parameterDefaultValue_computationFilterProperty = undefined; + $scope.parameterNumericMinValue_computationFilterProperty = 0; + $scope.parameterNumericMaxValue_computationFilterProperty = 1; + // parameter for logical operator + $scope.parameterName_computationFilterOperator = "compFilterOperator"; + $scope.parameterDescription_computationFilterOperator = "Vergleichsoperator"; + $scope.parameterDefaultValue_computationFilterOperator = undefined; + $scope.parameterNumericMinValue_computationFilterOperator = 0; + $scope.parameterNumericMaxValue_computationFilterOperator = 1; + // parameter for property value + $scope.parameterName_computationFilterPropertyValue = "compFilterPropVal"; + $scope.parameterDescription_computationFilterPropertyValue = "Filterwert."; + $scope.parameterDefaultValue_computationFilterPropertyValue = undefined; + $scope.parameterNumericMinValue_computationFilterPropertyValue = 0; + $scope.parameterNumericMaxValue_computationFilterPropertyValue = 1; + // parameter for property value + $scope.parameterDefaultValue_computationFilterPropertyValueRange_from = undefined; + $scope.parameterDefaultValue_computationFilterPropertyValueRange_to = undefined; + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + $scope.scriptFormulaHTML = undefined; + $scope.propertyValueSelection = []; + $scope.dropdownTranslations = kommonitorDataExchangeService.multiselectDropdownTranslations; + $scope.dropdownSettings = kommonitorDataExchangeService.multiselectDropdownSettings; + $scope.dropdownEvents = { + onSelectionChanged: function () { + $scope.onChangePropertyValue(); + } + }; + /* + * reset relevant things due to change of script type + */ + $scope.init = function () { + kommonitorScriptHelperService.reset(); + $scope.initFixedScriptCode(); + }; + $scope.initFixedScriptCode = function () { + $http.get($scope.pathToScriptResource, { 'responseType': 'text' }).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + $scope.init(); + $scope.onChangeGeoresource = function (georesourceSelection) { + // remove previous refIndicator from requiredIndicators and add new one + if ($scope.georesourceSelection_old) { + kommonitorScriptHelperService.removeBaseGeoresource($scope.georesourceSelection_old); + } + kommonitorScriptHelperService.addBaseGeoresource(georesourceSelection); + $scope.georesourceSelection_old = georesourceSelection; + //reset the one and only parameter in this case each time a base indicator is added + $scope.resetGeoresourceParameter(); + $scope.resetPropertyOptions(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.onChangePropertyName = function () { + $scope.resetScriptParameter_filterPropertyName(); + $scope.resetComputationFormulaAndLegend(); + $scope.filterOperatorOptions(); + $scope.resetPropertyValueOptions(); + if ($scope.parameterDefaultValue_computationFilterOperator === 'Contains') { + $scope.propertyValueSelection = []; + } + }; + $scope.onChangeOperatorOption = function () { + if ($scope.parameterDefaultValue_computationFilterOperator !== 'Contains') { + $scope.propertyValueSelection = []; + } + $scope.resetScriptParameter_operator(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.onChangePropertyValue = function () { + $scope.resetScriptParameter_filterPropertyValue(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.resetScriptParameter_computationGeoresource = function (georesourceMetadata) { + return georesourceMetadata.georesourceId; + }; + $scope.resetGeoresourceParameter = function () { + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationGeoresource); + $scope.parameterDefaultValue_computationGeoresource = $scope.resetScriptParameter_computationGeoresource($scope.georesourceSelection); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationGeoresource, $scope.parameterDescription_computationGeoresource, $scope.parameterDataType, $scope.parameterDefaultValue_computationGeoresource, $scope.parameterNumericMinValue_computationGeoresource, $scope.parameterNumericMaxValue_computationGeoresource); + }; + $scope.resetPropertyOptions = function () { + kommonitorCacheHelperService.fetchSingleGeoresourceSchema($scope.parameterDefaultValue_computationGeoresource) + .then((schema) => { + for (var prop in schema) { + if (schema[prop] !== 'Date') { + $scope.propertySchema[prop] = schema[prop]; + } + } + $scope.propertyOptions = Object.keys($scope.propertySchema); + }); + }; + $scope.resetScriptParameter_filterPropertyName = function () { + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationFilterProperty); + $scope.parameterDefaultValue_computationFilterProperty = $scope.propertyName; + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationFilterProperty, $scope.parameterDescription_computationFilterProperty, $scope.parameterDataType, $scope.parameterDefaultValue_computationFilterProperty, $scope.parameterNumericMinValue_computationFilterProperty, $scope.parameterNumericMaxValue_computationFilterProperty); + }; + $scope.filterOperatorOptions = function () { + if ($scope.propertySchema[$scope.parameterDefaultValue_computationFilterProperty] === "String") { + $scope.operatorOptions = [ + { + "apiName": "Equal", + "displayName": "gleich (=)", + }, + { + "apiName": "Unequal", + "displayName": "ungleich (!=)", + }, + { + "apiName": "Contains", + "displayName": "enthält (kommaseparierte Liste)", + } + ]; + } + else { + $scope.operatorOptions = [ + { + "apiName": "Equal", + "displayName": "gleich (=)", + }, + { + "apiName": "Greater_than", + "displayName": "größer als (>)", + }, + { + "apiName": "Greater_than_or_equal", + "displayName": "größer als oder gleich (>=)", + }, + { + "apiName": "Less_than", + "displayName": "kleiner als (<)", + }, + { + "apiName": "Less_than_or_equal", + "displayName": "kleiner als oder gleich (<=)", + }, + { + "apiName": "Unequal", + "displayName": "ungleich (!=)", + }, + { + "apiName": "Range", + "displayName": "Wertebereich (>=untere Grenze & { + var data = dataTable; + var tmpArray = data.map(item => { + let value = item[$scope.parameterDefaultValue_computationFilterProperty]; + return value; + }); + if ($scope.propertySchema[$scope.parameterDefaultValue_computationFilterProperty] === "String" || $scope.propertySchema[$scope.parameterDefaultValue_computationFilterProperty] === "Boolean") { + // sort strings + $scope.propertyValueOptions = Array.from(new Set(tmpArray)).sort(); + } + else { + // sort numbers + $scope.propertyValueOptions = Array.from(new Set(tmpArray)).sort(function (a, b) { + return a - b; + }); + } + }); + }; + $scope.filterPropertyValueRange_toOptions = function () { + return function (item) { + if (item > $scope.propertyValueRange_from) { + return true; + } + return false; + }; + }; + $scope.resetScriptParameter_filterPropertyValue = function () { + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationFilterPropertyValue); + if ($scope.parameterDefaultValue_computationFilterOperator !== "Contains") { + $scope.parameterDefaultValue_computationFilterPropertyValue = $scope.propertyValue; + } + else { + $scope.parameterDefaultValue_computationFilterPropertyValue = $scope.propertyValueSelection.join(); + } + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationFilterPropertyValue, $scope.parameterDescription_computationFilterPropertyValue, $scope.parameterDataType, $scope.parameterDefaultValue_computationFilterPropertyValue, $scope.parameterNumericMinValue_computationFilterPropertyValue, $scope.parameterNumericMaxValue_computationFilterPropertyValue); + }; + $scope.resetComputationFormulaAndLegend = function () { + kommonitorScriptHelperService.scriptFormulaHTML = ""; + var formulaHTML = ""; + if ($scope.propertyName !== undefined && $scope.operator && $scope.operator.apiName !== undefined && ($scope.propertyValue != undefined || $scope.propertyValueSelection != undefined)) { + formulaHTML = "Berechnung gemäß Geodatenanalyse
Anzahl Punkte des Datensatzes G1 pro Raumeinheits-Feature
Filterkriterium: '" + $scope.propertyName + "' '" + $scope.operator.displayName + "' '" + $scope.propertyValue + "'"; + if ($scope.operator.apiName === "Range") { + formulaHTML = "Berechnung gemäß Geodatenanalyse
Anzahl Punkte des Datensatzes G1 pro Raumeinheits-Feature
Filterkriterium: '" + $scope.propertyName + "' im " + "Wertebereich von '>=" + $scope.propertyValueRange_from + " bis <" + $scope.propertyValueRange_to + "'"; + } + if ($scope.operator.apiName === "Contains") { + formulaHTML = "Berechnung gemäß Geodatenanalyse
Anzahl Punkte des Datensatzes G1 pro Raumeinheits-Feature
Filterkriterium: '" + $scope.propertyName + "' 'enthält' '" + $scope.propertyValueSelection + "'"; + } + } + else { + formulaHTML = "Berechnung gemäß Geodatenanalyse
Anzahl Punkte des Datensatzes G1 pro Raumeinheits-Feature"; + } + var legendItemsHTML = "Legende zur Geodatenanalyse
G1: " + $scope.georesourceSelection.datasetName; + kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; + }; + $scope.onChangePropertyValueRange_range = function () { + $scope.propertyValue = $scope.propertyValueRange_from + "-" + $scope.propertyValueRange_to; + $scope.resetScriptParameter_filterPropertyValue(); + $scope.resetComputationFormulaAndLegend(); + }; + } + ] }); +//# sourceMappingURL=script-points-in-polygon.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/pointsInPolygon/script-points-in-polygon.component.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/pointsInPolygon/script-points-in-polygon.component.js.map new file mode 100644 index 000000000..f186d336b --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/pointsInPolygon/script-points-in-polygon.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-points-in-polygon.component.js","sourceRoot":"","sources":["script-points-in-polygon.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,SAAS,CAAC,uBAAuB,EAAE;IAC1E,WAAW,EAAE,yIAAyI;IACtJ,UAAU,EAAE,CAAC,+BAA+B,EAAE,+BAA+B,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU;QAClI,8BAA8B;QAC9B,SAAS,+BAA+B,CAAC,6BAA6B,EAAE,6BAA6B,EAAE,MAAM,EAAE,UAAU,EACxH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,CAAC,QAAQ,CAAC,WAAW,GAAG,KAAK,GAAG,MAAM,CAAC,aAAa,GAAG,GAAG,CAAC;oBAChR,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,KAAK,OAAO,EAAE;wBACxC,WAAW,GAAG,gKAAgK,GAAG,MAAM,CAAC,YAAY,GAAG,OAAO,GAAI,sBAAsB,GAAI,MAAM,CAAC,uBAAuB,GAAG,QAAQ,GAAG,MAAM,CAAC,qBAAqB,GAAG,GAAG,CAAC;qBAC3T;oBACD,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,KAAK,UAAU,EAAE;wBAC3C,WAAW,GAAG,gKAAgK,GAAG,MAAM,CAAC,YAAY,GAAG,eAAe,GAAG,MAAM,CAAC,sBAAsB,GAAG,GAAG,CAAC;qBAC7P;iBACD;qBACI;oBACJ,WAAW,GAAG,gIAAgI,CAAC;iBAC/I;gBACD,IAAI,eAAe,GAAG,wDAAwD,GAAG,MAAM,CAAC,oBAAoB,CAAC,WAAW,CAAC;gBAEzH,6BAA6B,CAAC,iBAAiB,GAAG,WAAW,GAAG,YAAY,GAAG,eAAe,CAAC;YAChG,CAAC,CAAC;YAEF,MAAM,CAAC,gCAAgC,GAAG;gBACzC,MAAM,CAAC,aAAa,GAAG,MAAM,CAAC,uBAAuB,GAAG,GAAG,GAAG,MAAM,CAAC,qBAAqB,CAAC;gBAC3F,MAAM,CAAC,wCAAwC,EAAE,CAAC;gBAClD,MAAM,CAAC,gCAAgC,EAAE,CAAC;YAC3C,CAAC,CAAC;QACH,CAAC;KACD;CACD,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/pointsInPolygon/script-points-in-polygon.component.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/pointsInPolygon/script-points-in-polygon.component.ts new file mode 100644 index 000000000..72f4147ea --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/pointsInPolygon/script-points-in-polygon.component.ts @@ -0,0 +1,304 @@ +angular.module('scriptPointsInPolygon').component('scriptPointsInPolygon', { + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/pointsInPolygon/script-points-in-polygon.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + 'kommonitorCacheHelperService', + function ScriptPointsInPolygonController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, + $http, __env, $timeout, kommonitorCacheHelperService) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + $scope.pathToScriptResource = "./kommonitor-script-resources/km_georessouce_count_pointsWithinPolygon.js"; + + $scope.propertySchema = {}; + $scope.propertyOptions = undefined; + $scope.propertyValueOptions = undefined; + + $scope.georesourceSelection = undefined; + $scope.georesourceSelection_old = undefined; + + // parameter for georesource dataset + $scope.parameterName_computationGeoresource = "compGeoId"; + $scope.parameterDescription_computationGeoresource = "Georessourcen ID des Punktdatensatzes."; + $scope.parameterDefaultValue_computationGeoresource = undefined; + $scope.parameterNumericMinValue_computationGeoresource = 0; + $scope.parameterNumericMaxValue_computationGeoresource = 1; + + // parameter for object property name + $scope.parameterName_computationFilterProperty = "compFilterProp"; + $scope.parameterDescription_computationFilterProperty = "Georessourcen Attributname."; + $scope.parameterDefaultValue_computationFilterProperty = undefined; + $scope.parameterNumericMinValue_computationFilterProperty = 0; + $scope.parameterNumericMaxValue_computationFilterProperty = 1; + + // parameter for logical operator + $scope.parameterName_computationFilterOperator = "compFilterOperator"; + $scope.parameterDescription_computationFilterOperator = "Vergleichsoperator"; + $scope.parameterDefaultValue_computationFilterOperator = undefined; + $scope.parameterNumericMinValue_computationFilterOperator = 0; + $scope.parameterNumericMaxValue_computationFilterOperator = 1; + + // parameter for property value + $scope.parameterName_computationFilterPropertyValue = "compFilterPropVal"; + $scope.parameterDescription_computationFilterPropertyValue = "Filterwert."; + $scope.parameterDefaultValue_computationFilterPropertyValue = undefined; + $scope.parameterNumericMinValue_computationFilterPropertyValue = 0; + $scope.parameterNumericMaxValue_computationFilterPropertyValue = 1; + + // parameter for property value + $scope.parameterDefaultValue_computationFilterPropertyValueRange_from = undefined; + $scope.parameterDefaultValue_computationFilterPropertyValueRange_to = undefined; + + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + + $scope.scriptFormulaHTML = undefined; + + $scope.propertyValueSelection = []; + + $scope.dropdownTranslations = kommonitorDataExchangeService.multiselectDropdownTranslations; + $scope.dropdownSettings = kommonitorDataExchangeService.multiselectDropdownSettings; + $scope.dropdownEvents = { + onSelectionChanged: function() { + $scope.onChangePropertyValue(); + } + }; + + + /* + * reset relevant things due to change of script type + */ + $scope.init = function(){ + kommonitorScriptHelperService.reset(); + + $scope.initFixedScriptCode(); + }; + + $scope.initFixedScriptCode = function(){ + $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + + $scope.init(); + + $scope.onChangeGeoresource = function(georesourceSelection){ + // remove previous refIndicator from requiredIndicators and add new one + if($scope.georesourceSelection_old){ + kommonitorScriptHelperService.removeBaseGeoresource($scope.georesourceSelection_old); + } + kommonitorScriptHelperService.addBaseGeoresource(georesourceSelection); + + $scope.georesourceSelection_old = georesourceSelection; + + //reset the one and only parameter in this case each time a base indicator is added + $scope.resetGeoresourceParameter(); + $scope.resetPropertyOptions(); + $scope.resetComputationFormulaAndLegend(); + }; + + $scope.onChangePropertyName = function(){ + $scope.resetScriptParameter_filterPropertyName(); + $scope.resetComputationFormulaAndLegend(); + $scope.filterOperatorOptions(); + $scope.resetPropertyValueOptions(); + if ($scope.parameterDefaultValue_computationFilterOperator === 'Contains') { + $scope.propertyValueSelection = []; + } + }; + + $scope.onChangeOperatorOption = function(){ + if ($scope.parameterDefaultValue_computationFilterOperator !== 'Contains') { + $scope.propertyValueSelection = []; + } + $scope.resetScriptParameter_operator(); + $scope.resetComputationFormulaAndLegend(); + }; + + $scope.onChangePropertyValue = function(){ + $scope.resetScriptParameter_filterPropertyValue(); + $scope.resetComputationFormulaAndLegend(); + }; + + $scope.resetScriptParameter_computationGeoresource = function(georesourceMetadata){ + + return georesourceMetadata.georesourceId; + }; + + $scope.resetGeoresourceParameter = function(){ + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationGeoresource); + $scope.parameterDefaultValue_computationGeoresource = $scope.resetScriptParameter_computationGeoresource($scope.georesourceSelection); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationGeoresource, $scope.parameterDescription_computationGeoresource, $scope.parameterDataType, $scope.parameterDefaultValue_computationGeoresource, $scope.parameterNumericMinValue_computationGeoresource, $scope.parameterNumericMaxValue_computationGeoresource); + }; + + $scope.resetPropertyOptions = function(){ + kommonitorCacheHelperService.fetchSingleGeoresourceSchema($scope.parameterDefaultValue_computationGeoresource) + .then((schema) => { + for (var prop in schema) { + if (schema[prop] !== 'Date') { + $scope.propertySchema[prop] = schema[prop]; + } + } + $scope.propertyOptions = Object.keys($scope.propertySchema); + }); + }; + + $scope.resetScriptParameter_filterPropertyName = function(){ + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationFilterProperty); + $scope.parameterDefaultValue_computationFilterProperty = $scope.propertyName; + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationFilterProperty, $scope.parameterDescription_computationFilterProperty, $scope.parameterDataType, $scope.parameterDefaultValue_computationFilterProperty, $scope.parameterNumericMinValue_computationFilterProperty, $scope.parameterNumericMaxValue_computationFilterProperty); + }; + + $scope.filterOperatorOptions = function(){ + if ($scope.propertySchema[$scope.parameterDefaultValue_computationFilterProperty] === "String"){ + $scope.operatorOptions = [ + { + "apiName": "Equal", + "displayName": "gleich (=)", + }, + { + "apiName": "Unequal", + "displayName": "ungleich (!=)", + }, + { + "apiName": "Contains", + "displayName": "enthält (kommaseparierte Liste)", + } + ]; + } else { + $scope.operatorOptions = [ + { + "apiName": "Equal", + "displayName": "gleich (=)", + }, + { + "apiName": "Greater_than", + "displayName": "größer als (>)", + }, + { + "apiName": "Greater_than_or_equal", + "displayName": "größer als oder gleich (>=)", + }, + { + "apiName": "Less_than", + "displayName": "kleiner als (<)", + }, + { + "apiName": "Less_than_or_equal", + "displayName": "kleiner als oder gleich (<=)", + }, + { + "apiName": "Unequal", + "displayName": "ungleich (!=)", + }, + { + "apiName": "Range", + "displayName": "Wertebereich (>=untere Grenze & { + var data = dataTable; + var tmpArray = data.map(item => { + let value = item[$scope.parameterDefaultValue_computationFilterProperty]; + return value; + }); + if ($scope.propertySchema[$scope.parameterDefaultValue_computationFilterProperty] === "String" || $scope.propertySchema[$scope.parameterDefaultValue_computationFilterProperty] === "Boolean") { + // sort strings + $scope.propertyValueOptions = Array.from(new Set(tmpArray)).sort(); + } else { + // sort numbers + $scope.propertyValueOptions = Array.from(new Set(tmpArray)).sort(function(a,b){ + return a - b; + }); + } + }); + }; + + $scope.filterPropertyValueRange_toOptions = function() { + return function(item) { + if (item > $scope.propertyValueRange_from) { + return true; + } + return false; + }; + }; + + $scope.resetScriptParameter_filterPropertyValue = function() { + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationFilterPropertyValue); + if ($scope.parameterDefaultValue_computationFilterOperator !== "Contains") { + $scope.parameterDefaultValue_computationFilterPropertyValue = $scope.propertyValue; + } else { + $scope.parameterDefaultValue_computationFilterPropertyValue = $scope.propertyValueSelection.join(); + } + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationFilterPropertyValue, $scope.parameterDescription_computationFilterPropertyValue, $scope.parameterDataType, $scope.parameterDefaultValue_computationFilterPropertyValue, $scope.parameterNumericMinValue_computationFilterPropertyValue, $scope.parameterNumericMaxValue_computationFilterPropertyValue); + }; + + $scope.resetComputationFormulaAndLegend = function(){ + kommonitorScriptHelperService.scriptFormulaHTML = ""; + var formulaHTML = ""; + if ($scope.propertyName !== undefined && $scope.operator && $scope.operator.apiName !== undefined && ($scope.propertyValue != undefined || $scope.propertyValueSelection != undefined)) { + formulaHTML = "Berechnung gemäß Geodatenanalyse
Anzahl Punkte des Datensatzes G1 pro Raumeinheits-Feature
Filterkriterium: '" + $scope.propertyName + "' '" + $scope.operator.displayName + "' '" + $scope.propertyValue + "'"; + if ($scope.operator.apiName === "Range") { + formulaHTML = "Berechnung gemäß Geodatenanalyse
Anzahl Punkte des Datensatzes G1 pro Raumeinheits-Feature
Filterkriterium: '" + $scope.propertyName + "' im " + "Wertebereich von '>=" + $scope.propertyValueRange_from + " bis <" + $scope.propertyValueRange_to + "'"; + } + if ($scope.operator.apiName === "Contains") { + formulaHTML = "Berechnung gemäß Geodatenanalyse
Anzahl Punkte des Datensatzes G1 pro Raumeinheits-Feature
Filterkriterium: '" + $scope.propertyName + "' 'enthält' '" + $scope.propertyValueSelection + "'"; + } + } + else { + formulaHTML = "Berechnung gemäß Geodatenanalyse
Anzahl Punkte des Datensatzes G1 pro Raumeinheits-Feature"; + } + var legendItemsHTML = "Legende zur Geodatenanalyse
G1: " + $scope.georesourceSelection.datasetName; + + kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; + }; + + $scope.onChangePropertyValueRange_range = function() { + $scope.propertyValue = $scope.propertyValueRange_from + "-" + $scope.propertyValueRange_to; + $scope.resetScriptParameter_filterPropertyValue(); + $scope.resetComputationFormulaAndLegend(); + }; + } + ] +}); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/pointsInPolygon/script-points-in-polygon.module.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/pointsInPolygon/script-points-in-polygon.module.js index 82baac84c..f5c4f3755 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/pointsInPolygon/script-points-in-polygon.module.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/pointsInPolygon/script-points-in-polygon.module.js @@ -1,2 +1,4 @@ +"use strict"; angular.module('scriptPointsInPolygon', ['kommonitorDataExchange', 'kommonitorScriptHelper', 'angularjs-dropdown-multiselect', 'kommonitorCacheHelper']); +//# sourceMappingURL=script-points-in-polygon.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/pointsInPolygon/script-points-in-polygon.module.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/pointsInPolygon/script-points-in-polygon.module.js.map new file mode 100644 index 000000000..3279a339d --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/pointsInPolygon/script-points-in-polygon.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-points-in-polygon.module.js","sourceRoot":"","sources":["script-points-in-polygon.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,uBAAuB,EAAE,CAAC,wBAAwB,EAAE,wBAAwB,EAAE,gCAAgC;IACzH,uBAAuB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/pointsInPolygon/script-points-in-polygon.module.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/pointsInPolygon/script-points-in-polygon.module.ts new file mode 100644 index 000000000..82baac84c --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/pointsInPolygon/script-points-in-polygon.module.ts @@ -0,0 +1,2 @@ +angular.module('scriptPointsInPolygon', ['kommonitorDataExchange', 'kommonitorScriptHelper', 'angularjs-dropdown-multiselect', + 'kommonitorCacheHelper']); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/promille/script-promille.component.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/promille/script-promille.component.js index e3dd7411a..e11c90000 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/promille/script-promille.component.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/promille/script-promille.component.js @@ -1,190 +1,149 @@ +"use strict"; angular.module('scriptPromille').component('scriptPromille', { - templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/promille/script-promille.template.html", - controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', - function ScriptPromilleController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; - - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_promille.js"; - - $scope.tmpIndicatorSelection = undefined; - $scope.tmpGeoresourceSelection = undefined; - - $scope.baseIndicators = []; - - $scope.refIndicatorSelection = undefined; - $scope.refIndicatorSelection_old = undefined; - - $scope.parameterName_computationIndicators = "COMPUTATION_ID"; - $scope.parameterDescription_computationIndicators = "Komma-separierte Liste aller Dividenden Indikatoren-IDs."; - $scope.parameterDefaultValue_computationIndicators = undefined; - $scope.parameterNumericMinValue_computationIndicators = 0; - $scope.parameterNumericMaxValue_computationIndicators = 1; - - $scope.parameterName_referenceIndicator = "REFERENCE_ID"; - $scope.parameterDescription_referenceIndicator = "Indikatoren-ID des Divisors."; - $scope.parameterDefaultValue_referenceIndicator = undefined; - $scope.parameterNumericMinValue_referenceIndicator = 0; - $scope.parameterNumericMaxValue_referenceIndicator = 1; - - /* - availableScriptDataTypes = [ - { - "displayName": "Textuell (String)", - "apiName": "string" - }, - { - "displayName": "Wahrheitswert (Boolean)", - "apiName": "boolean" - }, - { - "displayName": "Ganzzahl (Integer)", - "apiName": "integer" - }, - { - "displayName": "Gleitkommazahl (Double)", - "apiName": "double" - } - ]; - */ - $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; - - $scope.scriptCode_readableString_forPreview = undefined; - $scope.scriptCodeDomElementId = "#scriptCodePreview"; - - $scope.scriptFormulaHTML = undefined; - - /* - * reset relevant things due to change of script type - */ - $scope.init = function(){ - kommonitorScriptHelperService.reset(); - - $scope.initFixedScriptCode(); - }; - - $scope.initFixedScriptCode = function(){ - $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { - $scope.scriptCode_readableString_forPreview = response.data; - kommonitorScriptHelperService.scriptCode_readableString = response.data; - $scope.scriptCode_readableString_forPreview = response.data; - - kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); - }); - }; - - $scope.init(); - - $scope.onChangeReferenceIndicator = function(refIndicatorSelection){ - // remove previous refIndicator from requiredIndicators and add new one - kommonitorScriptHelperService.removeBaseIndicator($scope.refIndicatorSelection_old); - kommonitorScriptHelperService.addBaseIndicator(refIndicatorSelection); - - $scope.refIndicatorSelection_old = refIndicatorSelection; - - //reset the one and only parameter in this case each time a base indicator is added - $scope.resetRefIndicatorParameter(); - $scope.resetComputationFormulaAndLegend(); - - }; - - $scope.resetScriptParameter_computationIndicators = function(requiredIndicatorsArray){ - - var result=""; - for (let index = 0; index < requiredIndicatorsArray.length; index++) { - const indicatorMetadata = requiredIndicatorsArray[index]; - result+=indicatorMetadata.indicatorId; - if(index < requiredIndicatorsArray.length - 1){ - result+=","; - } - } - - return result; - }; - - $scope.resetComputationIndicatorParameter = function(){ - kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationIndicators); - $scope.parameterDefaultValue_computationIndicators = $scope.resetScriptParameter_computationIndicators($scope.baseIndicators); - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationIndicators, $scope.parameterDescription_computationIndicators, $scope.parameterDataType, $scope.parameterDefaultValue_computationIndicators, $scope.parameterNumericMinValue_computationIndicators, $scope.parameterNumericMaxValue_computationIndicators); - }; - - $scope.resetRefIndicatorParameter = function(){ - kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_referenceIndicator); - $scope.parameterDefaultValue_referenceIndicator = $scope.refIndicatorSelection.indicatorId; - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_referenceIndicator, $scope.parameterDescription_referenceIndicator, $scope.parameterDataType, $scope.parameterDefaultValue_referenceIndicator, $scope.parameterNumericMinValue_referenceIndicator, $scope.parameterNumericMaxValue_referenceIndicator); - }; - - $scope.resetComputationFormulaAndLegend = function(){ - kommonitorScriptHelperService.scriptFormulaHTML = ""; - - var formulaHTML = "Berechnung gemäß Formel
"; - var legendItemsHTML = "Legende zur Formel
"; - - // referenceIndicator - formulaHTML+="$$ \\frac{ "; - - // baseIndicators / computationIndicators - for (let index = 0; index < $scope.baseIndicators.length; index++) { - const indicatorMetadata = $scope.baseIndicators[index]; - var letterValue = kommonitorScriptHelperService.getAlphabetLetterFromNumber(index); - - // we can use TEX code as we use MathJax library - formulaHTML+=letterValue; - legendItemsHTML+="$" + letterValue + "$: " + indicatorMetadata.indicatorName + " [" + indicatorMetadata.unit + "]"; - if(index < $scope.baseIndicators.length - 1){ - formulaHTML+=" + "; - legendItemsHTML+="
"; - } - } - - formulaHTML += "}{ I_{ref}} \\times 1000 $$"; - legendItemsHTML+="
$ I_{ref} $: " + $scope.refIndicatorSelection.indicatorName + " [" + $scope.refIndicatorSelection.unit + "]" + "
"; - - kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; - - }; - - $scope.addBaseIndicator = function(tmpIndicatorSelection){ - - kommonitorScriptHelperService.addBaseIndicator(tmpIndicatorSelection); - $scope.baseIndicators.push(tmpIndicatorSelection); - - //reset the one and only parameter in this case each time a base indicator is added - $scope.resetComputationIndicatorParameter(); - $scope.resetComputationFormulaAndLegend(); - - $timeout(() => { - $scope.$digest(); - }); - }; - - $scope.removeBaseIndicator = function(baseIndicator){ - kommonitorScriptHelperService.removeBaseIndicator(baseIndicator); - - var i; - for (let index = 0; index < $scope.baseIndicators.length; index++) { - const element = $scope.baseIndicators[index]; - - if(baseIndicator.indicatorId == element.indicatorId){ - i = index; - break; - } - } - $scope.baseIndicators.splice(i, 1); - - //reset the one and only parameter in this case each time a base indicator is removed - $scope.resetComputationIndicatorParameter(); - $scope.resetComputationFormulaAndLegend(); - - setTimeout(() => { - $scope.$digest(); - }); - }; - - } - ] + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/promille/script-promille.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + function ScriptPromilleController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_promille.js"; + $scope.tmpIndicatorSelection = undefined; + $scope.tmpGeoresourceSelection = undefined; + $scope.baseIndicators = []; + $scope.refIndicatorSelection = undefined; + $scope.refIndicatorSelection_old = undefined; + $scope.parameterName_computationIndicators = "COMPUTATION_ID"; + $scope.parameterDescription_computationIndicators = "Komma-separierte Liste aller Dividenden Indikatoren-IDs."; + $scope.parameterDefaultValue_computationIndicators = undefined; + $scope.parameterNumericMinValue_computationIndicators = 0; + $scope.parameterNumericMaxValue_computationIndicators = 1; + $scope.parameterName_referenceIndicator = "REFERENCE_ID"; + $scope.parameterDescription_referenceIndicator = "Indikatoren-ID des Divisors."; + $scope.parameterDefaultValue_referenceIndicator = undefined; + $scope.parameterNumericMinValue_referenceIndicator = 0; + $scope.parameterNumericMaxValue_referenceIndicator = 1; + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + $scope.scriptFormulaHTML = undefined; + /* + * reset relevant things due to change of script type + */ + $scope.init = function () { + kommonitorScriptHelperService.reset(); + $scope.initFixedScriptCode(); + }; + $scope.initFixedScriptCode = function () { + $http.get($scope.pathToScriptResource, { 'responseType': 'text' }).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + $scope.init(); + $scope.onChangeReferenceIndicator = function (refIndicatorSelection) { + // remove previous refIndicator from requiredIndicators and add new one + kommonitorScriptHelperService.removeBaseIndicator($scope.refIndicatorSelection_old); + kommonitorScriptHelperService.addBaseIndicator(refIndicatorSelection); + $scope.refIndicatorSelection_old = refIndicatorSelection; + //reset the one and only parameter in this case each time a base indicator is added + $scope.resetRefIndicatorParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.resetScriptParameter_computationIndicators = function (requiredIndicatorsArray) { + var result = ""; + for (let index = 0; index < requiredIndicatorsArray.length; index++) { + const indicatorMetadata = requiredIndicatorsArray[index]; + result += indicatorMetadata.indicatorId; + if (index < requiredIndicatorsArray.length - 1) { + result += ","; + } + } + return result; + }; + $scope.resetComputationIndicatorParameter = function () { + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationIndicators); + $scope.parameterDefaultValue_computationIndicators = $scope.resetScriptParameter_computationIndicators($scope.baseIndicators); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationIndicators, $scope.parameterDescription_computationIndicators, $scope.parameterDataType, $scope.parameterDefaultValue_computationIndicators, $scope.parameterNumericMinValue_computationIndicators, $scope.parameterNumericMaxValue_computationIndicators); + }; + $scope.resetRefIndicatorParameter = function () { + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_referenceIndicator); + $scope.parameterDefaultValue_referenceIndicator = $scope.refIndicatorSelection.indicatorId; + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_referenceIndicator, $scope.parameterDescription_referenceIndicator, $scope.parameterDataType, $scope.parameterDefaultValue_referenceIndicator, $scope.parameterNumericMinValue_referenceIndicator, $scope.parameterNumericMaxValue_referenceIndicator); + }; + $scope.resetComputationFormulaAndLegend = function () { + kommonitorScriptHelperService.scriptFormulaHTML = ""; + var formulaHTML = "Berechnung gemäß Formel
"; + var legendItemsHTML = "Legende zur Formel
"; + // referenceIndicator + formulaHTML += "$$ \\frac{ "; + // baseIndicators / computationIndicators + for (let index = 0; index < $scope.baseIndicators.length; index++) { + const indicatorMetadata = $scope.baseIndicators[index]; + var letterValue = kommonitorScriptHelperService.getAlphabetLetterFromNumber(index); + // we can use TEX code as we use MathJax library + formulaHTML += letterValue; + legendItemsHTML += "$" + letterValue + "$: " + indicatorMetadata.indicatorName + " [" + indicatorMetadata.unit + "]"; + if (index < $scope.baseIndicators.length - 1) { + formulaHTML += " + "; + legendItemsHTML += "
"; + } + } + formulaHTML += "}{ I_{ref}} \\times 1000 $$"; + legendItemsHTML += "
$ I_{ref} $: " + $scope.refIndicatorSelection.indicatorName + " [" + $scope.refIndicatorSelection.unit + "]" + "
"; + kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; + }; + $scope.addBaseIndicator = function (tmpIndicatorSelection) { + kommonitorScriptHelperService.addBaseIndicator(tmpIndicatorSelection); + $scope.baseIndicators.push(tmpIndicatorSelection); + //reset the one and only parameter in this case each time a base indicator is added + $scope.resetComputationIndicatorParameter(); + $scope.resetComputationFormulaAndLegend(); + $timeout(() => { + $scope.$digest(); + }); + }; + $scope.removeBaseIndicator = function (baseIndicator) { + kommonitorScriptHelperService.removeBaseIndicator(baseIndicator); + var i; + for (let index = 0; index < $scope.baseIndicators.length; index++) { + const element = $scope.baseIndicators[index]; + if (baseIndicator.indicatorId == element.indicatorId) { + i = index; + break; + } + } + $scope.baseIndicators.splice(i, 1); + //reset the one and only parameter in this case each time a base indicator is removed + $scope.resetComputationIndicatorParameter(); + $scope.resetComputationFormulaAndLegend(); + setTimeout(() => { + $scope.$digest(); + }); + }; + } + ] }); +//# sourceMappingURL=script-promille.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/promille/script-promille.component.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/promille/script-promille.component.js.map new file mode 100644 index 000000000..889107a66 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/promille/script-promille.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-promille.component.js","sourceRoot":"","sources":["script-promille.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,SAAS,CAAC,gBAAgB,EAAE;IAC5D,WAAW,EAAE,yHAAyH;IACtI,UAAU,EAAE,CAAC,+BAA+B,EAAE,+BAA+B,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU;QAClI,S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,CAAC,CAAC;YAEF,MAAM,CAAC,mBAAmB,GAAG,UAAS,aAAa;gBAClD,6BAA6B,CAAC,mBAAmB,CAAC,aAAa,CAAC,CAAC;gBAEjE,IAAI,CAAC,CAAC;gBACN,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;oBAClE,MAAM,OAAO,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;oBAE7C,IAAG,aAAa,CAAC,WAAW,IAAI,OAAO,CAAC,WAAW,EAAC;wBACnD,CAAC,GAAG,KAAK,CAAC;wBACV,MAAM;qBACN;iBACD;gBACD,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;gBAEnC,qFAAqF;gBACrF,MAAM,CAAC,kCAAkC,EAAE,CAAC;gBAC5C,MAAM,CAAC,gCAAgC,EAAE,CAAC;gBAE1C,UAAU,CAAC,GAAG,EAAE;oBACf,MAAM,CAAC,OAAO,EAAE,CAAC;gBAClB,CAAC,CAAC,CAAC;YACJ,CAAC,CAAC;QAEH,CAAC;KACD;CACD,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/promille/script-promille.component.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/promille/script-promille.component.ts new file mode 100644 index 000000000..e3dd7411a --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/promille/script-promille.component.ts @@ -0,0 +1,190 @@ +angular.module('scriptPromille').component('scriptPromille', { + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/promille/script-promille.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + function ScriptPromilleController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_promille.js"; + + $scope.tmpIndicatorSelection = undefined; + $scope.tmpGeoresourceSelection = undefined; + + $scope.baseIndicators = []; + + $scope.refIndicatorSelection = undefined; + $scope.refIndicatorSelection_old = undefined; + + $scope.parameterName_computationIndicators = "COMPUTATION_ID"; + $scope.parameterDescription_computationIndicators = "Komma-separierte Liste aller Dividenden Indikatoren-IDs."; + $scope.parameterDefaultValue_computationIndicators = undefined; + $scope.parameterNumericMinValue_computationIndicators = 0; + $scope.parameterNumericMaxValue_computationIndicators = 1; + + $scope.parameterName_referenceIndicator = "REFERENCE_ID"; + $scope.parameterDescription_referenceIndicator = "Indikatoren-ID des Divisors."; + $scope.parameterDefaultValue_referenceIndicator = undefined; + $scope.parameterNumericMinValue_referenceIndicator = 0; + $scope.parameterNumericMaxValue_referenceIndicator = 1; + + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + + $scope.scriptFormulaHTML = undefined; + + /* + * reset relevant things due to change of script type + */ + $scope.init = function(){ + kommonitorScriptHelperService.reset(); + + $scope.initFixedScriptCode(); + }; + + $scope.initFixedScriptCode = function(){ + $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + + $scope.init(); + + $scope.onChangeReferenceIndicator = function(refIndicatorSelection){ + // remove previous refIndicator from requiredIndicators and add new one + kommonitorScriptHelperService.removeBaseIndicator($scope.refIndicatorSelection_old); + kommonitorScriptHelperService.addBaseIndicator(refIndicatorSelection); + + $scope.refIndicatorSelection_old = refIndicatorSelection; + + //reset the one and only parameter in this case each time a base indicator is added + $scope.resetRefIndicatorParameter(); + $scope.resetComputationFormulaAndLegend(); + + }; + + $scope.resetScriptParameter_computationIndicators = function(requiredIndicatorsArray){ + + var result=""; + for (let index = 0; index < requiredIndicatorsArray.length; index++) { + const indicatorMetadata = requiredIndicatorsArray[index]; + result+=indicatorMetadata.indicatorId; + if(index < requiredIndicatorsArray.length - 1){ + result+=","; + } + } + + return result; + }; + + $scope.resetComputationIndicatorParameter = function(){ + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationIndicators); + $scope.parameterDefaultValue_computationIndicators = $scope.resetScriptParameter_computationIndicators($scope.baseIndicators); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationIndicators, $scope.parameterDescription_computationIndicators, $scope.parameterDataType, $scope.parameterDefaultValue_computationIndicators, $scope.parameterNumericMinValue_computationIndicators, $scope.parameterNumericMaxValue_computationIndicators); + }; + + $scope.resetRefIndicatorParameter = function(){ + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_referenceIndicator); + $scope.parameterDefaultValue_referenceIndicator = $scope.refIndicatorSelection.indicatorId; + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_referenceIndicator, $scope.parameterDescription_referenceIndicator, $scope.parameterDataType, $scope.parameterDefaultValue_referenceIndicator, $scope.parameterNumericMinValue_referenceIndicator, $scope.parameterNumericMaxValue_referenceIndicator); + }; + + $scope.resetComputationFormulaAndLegend = function(){ + kommonitorScriptHelperService.scriptFormulaHTML = ""; + + var formulaHTML = "Berechnung gemäß Formel
"; + var legendItemsHTML = "Legende zur Formel
"; + + // referenceIndicator + formulaHTML+="$$ \\frac{ "; + + // baseIndicators / computationIndicators + for (let index = 0; index < $scope.baseIndicators.length; index++) { + const indicatorMetadata = $scope.baseIndicators[index]; + var letterValue = kommonitorScriptHelperService.getAlphabetLetterFromNumber(index); + + // we can use TEX code as we use MathJax library + formulaHTML+=letterValue; + legendItemsHTML+="$" + letterValue + "$: " + indicatorMetadata.indicatorName + " [" + indicatorMetadata.unit + "]"; + if(index < $scope.baseIndicators.length - 1){ + formulaHTML+=" + "; + legendItemsHTML+="
"; + } + } + + formulaHTML += "}{ I_{ref}} \\times 1000 $$"; + legendItemsHTML+="
$ I_{ref} $: " + $scope.refIndicatorSelection.indicatorName + " [" + $scope.refIndicatorSelection.unit + "]" + "
"; + + kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; + + }; + + $scope.addBaseIndicator = function(tmpIndicatorSelection){ + + kommonitorScriptHelperService.addBaseIndicator(tmpIndicatorSelection); + $scope.baseIndicators.push(tmpIndicatorSelection); + + //reset the one and only parameter in this case each time a base indicator is added + $scope.resetComputationIndicatorParameter(); + $scope.resetComputationFormulaAndLegend(); + + $timeout(() => { + $scope.$digest(); + }); + }; + + $scope.removeBaseIndicator = function(baseIndicator){ + kommonitorScriptHelperService.removeBaseIndicator(baseIndicator); + + var i; + for (let index = 0; index < $scope.baseIndicators.length; index++) { + const element = $scope.baseIndicators[index]; + + if(baseIndicator.indicatorId == element.indicatorId){ + i = index; + break; + } + } + $scope.baseIndicators.splice(i, 1); + + //reset the one and only parameter in this case each time a base indicator is removed + $scope.resetComputationIndicatorParameter(); + $scope.resetComputationFormulaAndLegend(); + + setTimeout(() => { + $scope.$digest(); + }); + }; + + } + ] +}); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/promille/script-promille.module.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/promille/script-promille.module.js index 0992f07fe..857361eb9 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/promille/script-promille.module.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/promille/script-promille.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('scriptPromille', ['kommonitorDataExchange', 'kommonitorScriptHelper']); +//# sourceMappingURL=script-promille.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/promille/script-promille.module.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/promille/script-promille.module.js.map new file mode 100644 index 000000000..13c5c8a19 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/promille/script-promille.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-promille.module.js","sourceRoot":"","sources":["script-promille.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC,wBAAwB,EAAE,wBAAwB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/promille/script-promille.module.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/promille/script-promille.module.ts new file mode 100644 index 000000000..0992f07fe --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/promille/script-promille.module.ts @@ -0,0 +1 @@ +angular.module('scriptPromille', ['kommonitorDataExchange', 'kommonitorScriptHelper']); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/share/script-share.component.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/share/script-share.component.js index a6479dd81..d18e88264 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/share/script-share.component.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/share/script-share.component.js @@ -1,190 +1,149 @@ +"use strict"; angular.module('scriptShare').component('scriptShare', { - templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/share/script-share.template.html", - controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', - function ScriptSharetroller(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; - - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_share.js"; - - $scope.tmpIndicatorSelection = undefined; - $scope.tmpGeoresourceSelection = undefined; - - $scope.baseIndicators = []; - - $scope.refIndicatorSelection = undefined; - $scope.refIndicatorSelection_old = undefined; - - $scope.parameterName_computationIndicators = "COMPUTATION_ID"; - $scope.parameterDescription_computationIndicators = "Komma-separierte Liste aller Dividenden Indikatoren-IDs."; - $scope.parameterDefaultValue_computationIndicators = undefined; - $scope.parameterNumericMinValue_computationIndicators = 0; - $scope.parameterNumericMaxValue_computationIndicators = 1; - - $scope.parameterName_referenceIndicator = "REFERENCE_ID"; - $scope.parameterDescription_referenceIndicator = "Indikatoren-ID des Divisors."; - $scope.parameterDefaultValue_referenceIndicator = undefined; - $scope.parameterNumericMinValue_referenceIndicator = 0; - $scope.parameterNumericMaxValue_referenceIndicator = 1; - - /* - availableScriptDataTypes = [ - { - "displayName": "Textuell (String)", - "apiName": "string" - }, - { - "displayName": "Wahrheitswert (Boolean)", - "apiName": "boolean" - }, - { - "displayName": "Ganzzahl (Integer)", - "apiName": "integer" - }, - { - "displayName": "Gleitkommazahl (Double)", - "apiName": "double" - } - ]; - */ - $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; - - $scope.scriptCode_readableString_forPreview = undefined; - $scope.scriptCodeDomElementId = "#scriptCodePreview"; - - $scope.scriptFormulaHTML = undefined; - - /* - * reset relevant things due to change of script type - */ - $scope.init = function(){ - kommonitorScriptHelperService.reset(); - - $scope.initFixedScriptCode(); - }; - - $scope.initFixedScriptCode = function(){ - $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { - $scope.scriptCode_readableString_forPreview = response.data; - kommonitorScriptHelperService.scriptCode_readableString = response.data; - $scope.scriptCode_readableString_forPreview = response.data; - - kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); - }); - }; - - $scope.init(); - - $scope.onChangeReferenceIndicator = function(refIndicatorSelection){ - // remove previous refIndicator from requiredIndicators and add new one - kommonitorScriptHelperService.removeBaseIndicator($scope.refIndicatorSelection_old); - kommonitorScriptHelperService.addBaseIndicator(refIndicatorSelection); - - $scope.refIndicatorSelection_old = refIndicatorSelection; - - //reset the one and only parameter in this case each time a base indicator is added - $scope.resetRefIndicatorParameter(); - $scope.resetComputationFormulaAndLegend(); - - }; - - $scope.resetScriptParameter_computationIndicators = function(requiredIndicatorsArray){ - - var result=""; - for (let index = 0; index < requiredIndicatorsArray.length; index++) { - const indicatorMetadata = requiredIndicatorsArray[index]; - result+=indicatorMetadata.indicatorId; - if(index < requiredIndicatorsArray.length - 1){ - result+=","; - } - } - - return result; - }; - - $scope.resetComputationIndicatorParameter = function(){ - kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationIndicators); - $scope.parameterDefaultValue_computationIndicators = $scope.resetScriptParameter_computationIndicators($scope.baseIndicators); - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationIndicators, $scope.parameterDescription_computationIndicators, $scope.parameterDataType, $scope.parameterDefaultValue_computationIndicators, $scope.parameterNumericMinValue_computationIndicators, $scope.parameterNumericMaxValue_computationIndicators); - }; - - $scope.resetRefIndicatorParameter = function(){ - kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_referenceIndicator); - $scope.parameterDefaultValue_referenceIndicator = $scope.refIndicatorSelection.indicatorId; - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_referenceIndicator, $scope.parameterDescription_referenceIndicator, $scope.parameterDataType, $scope.parameterDefaultValue_referenceIndicator, $scope.parameterNumericMinValue_referenceIndicator, $scope.parameterNumericMaxValue_referenceIndicator); - }; - - $scope.resetComputationFormulaAndLegend = function(){ - kommonitorScriptHelperService.scriptFormulaHTML = ""; - - var formulaHTML = "Berechnung gemäß Formel
"; - var legendItemsHTML = "Legende zur Formel
"; - - // referenceIndicator - formulaHTML+="$$ \\frac{ "; - - // baseIndicators / computationIndicators - for (let index = 0; index < $scope.baseIndicators.length; index++) { - const indicatorMetadata = $scope.baseIndicators[index]; - var letterValue = kommonitorScriptHelperService.getAlphabetLetterFromNumber(index); - - // we can use TEX code as we use MathJax library - formulaHTML+=letterValue; - legendItemsHTML+="$" + letterValue + "$: " + indicatorMetadata.indicatorName + " [" + indicatorMetadata.unit + "]"; - if(index < $scope.baseIndicators.length - 1){ - formulaHTML+=" + "; - legendItemsHTML+="
"; - } - } - - formulaHTML += "}{ I_{ref}} $$"; - legendItemsHTML+="
$ I_{ref} $: " + $scope.refIndicatorSelection.indicatorName + " [" + $scope.refIndicatorSelection.unit + "]" + "
"; - - kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; - - }; - - $scope.addBaseIndicator = function(tmpIndicatorSelection){ - - kommonitorScriptHelperService.addBaseIndicator(tmpIndicatorSelection); - $scope.baseIndicators.push(tmpIndicatorSelection); - - //reset the one and only parameter in this case each time a base indicator is added - $scope.resetComputationIndicatorParameter(); - $scope.resetComputationFormulaAndLegend(); - - setTimeout(() => { - $scope.$digest(); - }); - }; - - $scope.removeBaseIndicator = function(baseIndicator){ - kommonitorScriptHelperService.removeBaseIndicator(baseIndicator); - - var i; - for (let index = 0; index < $scope.baseIndicators.length; index++) { - const element = $scope.baseIndicators[index]; - - if(baseIndicator.indicatorId == element.indicatorId){ - i = index; - break; - } - } - $scope.baseIndicators.splice(i, 1); - - //reset the one and only parameter in this case each time a base indicator is removed - $scope.resetComputationIndicatorParameter(); - $scope.resetComputationFormulaAndLegend(); - - setTimeout(() => { - $scope.$digest(); - }); - }; - - } - ] + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/share/script-share.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + function ScriptSharetroller(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_share.js"; + $scope.tmpIndicatorSelection = undefined; + $scope.tmpGeoresourceSelection = undefined; + $scope.baseIndicators = []; + $scope.refIndicatorSelection = undefined; + $scope.refIndicatorSelection_old = undefined; + $scope.parameterName_computationIndicators = "COMPUTATION_ID"; + $scope.parameterDescription_computationIndicators = "Komma-separierte Liste aller Dividenden Indikatoren-IDs."; + $scope.parameterDefaultValue_computationIndicators = undefined; + $scope.parameterNumericMinValue_computationIndicators = 0; + $scope.parameterNumericMaxValue_computationIndicators = 1; + $scope.parameterName_referenceIndicator = "REFERENCE_ID"; + $scope.parameterDescription_referenceIndicator = "Indikatoren-ID des Divisors."; + $scope.parameterDefaultValue_referenceIndicator = undefined; + $scope.parameterNumericMinValue_referenceIndicator = 0; + $scope.parameterNumericMaxValue_referenceIndicator = 1; + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + $scope.scriptFormulaHTML = undefined; + /* + * reset relevant things due to change of script type + */ + $scope.init = function () { + kommonitorScriptHelperService.reset(); + $scope.initFixedScriptCode(); + }; + $scope.initFixedScriptCode = function () { + $http.get($scope.pathToScriptResource, { 'responseType': 'text' }).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + $scope.init(); + $scope.onChangeReferenceIndicator = function (refIndicatorSelection) { + // remove previous refIndicator from requiredIndicators and add new one + kommonitorScriptHelperService.removeBaseIndicator($scope.refIndicatorSelection_old); + kommonitorScriptHelperService.addBaseIndicator(refIndicatorSelection); + $scope.refIndicatorSelection_old = refIndicatorSelection; + //reset the one and only parameter in this case each time a base indicator is added + $scope.resetRefIndicatorParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.resetScriptParameter_computationIndicators = function (requiredIndicatorsArray) { + var result = ""; + for (let index = 0; index < requiredIndicatorsArray.length; index++) { + const indicatorMetadata = requiredIndicatorsArray[index]; + result += indicatorMetadata.indicatorId; + if (index < requiredIndicatorsArray.length - 1) { + result += ","; + } + } + return result; + }; + $scope.resetComputationIndicatorParameter = function () { + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationIndicators); + $scope.parameterDefaultValue_computationIndicators = $scope.resetScriptParameter_computationIndicators($scope.baseIndicators); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationIndicators, $scope.parameterDescription_computationIndicators, $scope.parameterDataType, $scope.parameterDefaultValue_computationIndicators, $scope.parameterNumericMinValue_computationIndicators, $scope.parameterNumericMaxValue_computationIndicators); + }; + $scope.resetRefIndicatorParameter = function () { + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_referenceIndicator); + $scope.parameterDefaultValue_referenceIndicator = $scope.refIndicatorSelection.indicatorId; + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_referenceIndicator, $scope.parameterDescription_referenceIndicator, $scope.parameterDataType, $scope.parameterDefaultValue_referenceIndicator, $scope.parameterNumericMinValue_referenceIndicator, $scope.parameterNumericMaxValue_referenceIndicator); + }; + $scope.resetComputationFormulaAndLegend = function () { + kommonitorScriptHelperService.scriptFormulaHTML = ""; + var formulaHTML = "Berechnung gemäß Formel
"; + var legendItemsHTML = "Legende zur Formel
"; + // referenceIndicator + formulaHTML += "$$ \\frac{ "; + // baseIndicators / computationIndicators + for (let index = 0; index < $scope.baseIndicators.length; index++) { + const indicatorMetadata = $scope.baseIndicators[index]; + var letterValue = kommonitorScriptHelperService.getAlphabetLetterFromNumber(index); + // we can use TEX code as we use MathJax library + formulaHTML += letterValue; + legendItemsHTML += "$" + letterValue + "$: " + indicatorMetadata.indicatorName + " [" + indicatorMetadata.unit + "]"; + if (index < $scope.baseIndicators.length - 1) { + formulaHTML += " + "; + legendItemsHTML += "
"; + } + } + formulaHTML += "}{ I_{ref}} $$"; + legendItemsHTML += "
$ I_{ref} $: " + $scope.refIndicatorSelection.indicatorName + " [" + $scope.refIndicatorSelection.unit + "]" + "
"; + kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; + }; + $scope.addBaseIndicator = function (tmpIndicatorSelection) { + kommonitorScriptHelperService.addBaseIndicator(tmpIndicatorSelection); + $scope.baseIndicators.push(tmpIndicatorSelection); + //reset the one and only parameter in this case each time a base indicator is added + $scope.resetComputationIndicatorParameter(); + $scope.resetComputationFormulaAndLegend(); + setTimeout(() => { + $scope.$digest(); + }); + }; + $scope.removeBaseIndicator = function (baseIndicator) { + kommonitorScriptHelperService.removeBaseIndicator(baseIndicator); + var i; + for (let index = 0; index < $scope.baseIndicators.length; index++) { + const element = $scope.baseIndicators[index]; + if (baseIndicator.indicatorId == element.indicatorId) { + i = index; + break; + } + } + $scope.baseIndicators.splice(i, 1); + //reset the one and only parameter in this case each time a base indicator is removed + $scope.resetComputationIndicatorParameter(); + $scope.resetComputationFormulaAndLegend(); + setTimeout(() => { + $scope.$digest(); + }); + }; + } + ] }); +//# sourceMappingURL=script-share.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/share/script-share.component.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/share/script-share.component.js.map new file mode 100644 index 000000000..02bbf9986 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/share/script-share.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-share.component.js","sourceRoot":"","sources":["script-share.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,SAAS,CAAC,aAAa,EAAE;IACtD,WAAW,EAAE,mHAAmH;IAChI,UAAU,EAAE,CAAC,+BAA+B,EAAE,+BAA+B,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU;QAClI,SAAS,kBAAkB,CAAC,6BAA6B,EAAE,6BAA6B,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ;YAEnI,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAC3E,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAE3E,sCAAsC;YACtC,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,CAAC;YAEtB,MAAM,CAAC,oBAAoB,GAAG,qDAAqD,CAAC;YAEpF,MAAM,CAAC,qBAAqB,GAAG,SAAS,CAAC;YACzC,MAAM,CAAC,uBAAuB,GAAG,SAAS,CAAC;YAE3C,MAAM,CAAC,cAAc,GAAG,EAAE,CAAC;YAE3B,MAAM,CAAC,qBAAqB,GAAG,SAAS,CAAC;YACzC,MAAM,CAAC,yBAAyB,GAAG,SAAS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AAC,kCAAkC,EAAE,CAAC;gBAC5C,MAAM,CAAC,gCAAgC,EAAE,CAAC;gBAE1C,UAAU,CAAC,GAAG,EAAE;oBACf,MAAM,CAAC,OAAO,EAAE,CAAC;gBAClB,CAAC,CAAC,CAAC;YACJ,CAAC,CAAC;QAEH,CAAC;KACD;CACD,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/share/script-share.component.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/share/script-share.component.ts new file mode 100644 index 000000000..a6479dd81 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/share/script-share.component.ts @@ -0,0 +1,190 @@ +angular.module('scriptShare').component('scriptShare', { + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/share/script-share.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + function ScriptSharetroller(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_share.js"; + + $scope.tmpIndicatorSelection = undefined; + $scope.tmpGeoresourceSelection = undefined; + + $scope.baseIndicators = []; + + $scope.refIndicatorSelection = undefined; + $scope.refIndicatorSelection_old = undefined; + + $scope.parameterName_computationIndicators = "COMPUTATION_ID"; + $scope.parameterDescription_computationIndicators = "Komma-separierte Liste aller Dividenden Indikatoren-IDs."; + $scope.parameterDefaultValue_computationIndicators = undefined; + $scope.parameterNumericMinValue_computationIndicators = 0; + $scope.parameterNumericMaxValue_computationIndicators = 1; + + $scope.parameterName_referenceIndicator = "REFERENCE_ID"; + $scope.parameterDescription_referenceIndicator = "Indikatoren-ID des Divisors."; + $scope.parameterDefaultValue_referenceIndicator = undefined; + $scope.parameterNumericMinValue_referenceIndicator = 0; + $scope.parameterNumericMaxValue_referenceIndicator = 1; + + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + + $scope.scriptFormulaHTML = undefined; + + /* + * reset relevant things due to change of script type + */ + $scope.init = function(){ + kommonitorScriptHelperService.reset(); + + $scope.initFixedScriptCode(); + }; + + $scope.initFixedScriptCode = function(){ + $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + + $scope.init(); + + $scope.onChangeReferenceIndicator = function(refIndicatorSelection){ + // remove previous refIndicator from requiredIndicators and add new one + kommonitorScriptHelperService.removeBaseIndicator($scope.refIndicatorSelection_old); + kommonitorScriptHelperService.addBaseIndicator(refIndicatorSelection); + + $scope.refIndicatorSelection_old = refIndicatorSelection; + + //reset the one and only parameter in this case each time a base indicator is added + $scope.resetRefIndicatorParameter(); + $scope.resetComputationFormulaAndLegend(); + + }; + + $scope.resetScriptParameter_computationIndicators = function(requiredIndicatorsArray){ + + var result=""; + for (let index = 0; index < requiredIndicatorsArray.length; index++) { + const indicatorMetadata = requiredIndicatorsArray[index]; + result+=indicatorMetadata.indicatorId; + if(index < requiredIndicatorsArray.length - 1){ + result+=","; + } + } + + return result; + }; + + $scope.resetComputationIndicatorParameter = function(){ + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationIndicators); + $scope.parameterDefaultValue_computationIndicators = $scope.resetScriptParameter_computationIndicators($scope.baseIndicators); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationIndicators, $scope.parameterDescription_computationIndicators, $scope.parameterDataType, $scope.parameterDefaultValue_computationIndicators, $scope.parameterNumericMinValue_computationIndicators, $scope.parameterNumericMaxValue_computationIndicators); + }; + + $scope.resetRefIndicatorParameter = function(){ + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_referenceIndicator); + $scope.parameterDefaultValue_referenceIndicator = $scope.refIndicatorSelection.indicatorId; + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_referenceIndicator, $scope.parameterDescription_referenceIndicator, $scope.parameterDataType, $scope.parameterDefaultValue_referenceIndicator, $scope.parameterNumericMinValue_referenceIndicator, $scope.parameterNumericMaxValue_referenceIndicator); + }; + + $scope.resetComputationFormulaAndLegend = function(){ + kommonitorScriptHelperService.scriptFormulaHTML = ""; + + var formulaHTML = "Berechnung gemäß Formel
"; + var legendItemsHTML = "Legende zur Formel
"; + + // referenceIndicator + formulaHTML+="$$ \\frac{ "; + + // baseIndicators / computationIndicators + for (let index = 0; index < $scope.baseIndicators.length; index++) { + const indicatorMetadata = $scope.baseIndicators[index]; + var letterValue = kommonitorScriptHelperService.getAlphabetLetterFromNumber(index); + + // we can use TEX code as we use MathJax library + formulaHTML+=letterValue; + legendItemsHTML+="$" + letterValue + "$: " + indicatorMetadata.indicatorName + " [" + indicatorMetadata.unit + "]"; + if(index < $scope.baseIndicators.length - 1){ + formulaHTML+=" + "; + legendItemsHTML+="
"; + } + } + + formulaHTML += "}{ I_{ref}} $$"; + legendItemsHTML+="
$ I_{ref} $: " + $scope.refIndicatorSelection.indicatorName + " [" + $scope.refIndicatorSelection.unit + "]" + "
"; + + kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; + + }; + + $scope.addBaseIndicator = function(tmpIndicatorSelection){ + + kommonitorScriptHelperService.addBaseIndicator(tmpIndicatorSelection); + $scope.baseIndicators.push(tmpIndicatorSelection); + + //reset the one and only parameter in this case each time a base indicator is added + $scope.resetComputationIndicatorParameter(); + $scope.resetComputationFormulaAndLegend(); + + setTimeout(() => { + $scope.$digest(); + }); + }; + + $scope.removeBaseIndicator = function(baseIndicator){ + kommonitorScriptHelperService.removeBaseIndicator(baseIndicator); + + var i; + for (let index = 0; index < $scope.baseIndicators.length; index++) { + const element = $scope.baseIndicators[index]; + + if(baseIndicator.indicatorId == element.indicatorId){ + i = index; + break; + } + } + $scope.baseIndicators.splice(i, 1); + + //reset the one and only parameter in this case each time a base indicator is removed + $scope.resetComputationIndicatorParameter(); + $scope.resetComputationFormulaAndLegend(); + + setTimeout(() => { + $scope.$digest(); + }); + }; + + } + ] +}); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/share/script-share.module.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/share/script-share.module.js index 444f83598..0bf1c3f6f 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/share/script-share.module.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/share/script-share.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('scriptShare', ['kommonitorDataExchange', 'kommonitorScriptHelper']); +//# sourceMappingURL=script-share.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/share/script-share.module.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/share/script-share.module.js.map new file mode 100644 index 000000000..06fefcae9 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/share/script-share.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-share.module.js","sourceRoot":"","sources":["script-share.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC,wBAAwB,EAAE,wBAAwB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/share/script-share.module.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/share/script-share.module.ts new file mode 100644 index 000000000..444f83598 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/share/script-share.module.ts @@ -0,0 +1 @@ +angular.module('scriptShare', ['kommonitorDataExchange', 'kommonitorScriptHelper']); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/subtract/script-subtract.component.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/subtract/script-subtract.component.js index 89ebc04ce..f1be5e7c7 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/subtract/script-subtract.component.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/subtract/script-subtract.component.js @@ -1,190 +1,149 @@ +"use strict"; angular.module('scriptSubtract').component('scriptSubtract', { - templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/subtract/script-subtract.template.html", - controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', - function ScriptSubtractontroller(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; - - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_subtract.js"; - - $scope.tmpIndicatorSelection = undefined; - $scope.tmpGeoresourceSelection = undefined; - - $scope.baseIndicators = []; - - $scope.refIndicatorSelection = undefined; - $scope.refIndicatorSelection_old = undefined; - - $scope.parameterName_computationIndicators = "COMPUTATION_ID"; - $scope.parameterDescription_computationIndicators = "Komma-separierte Liste aller Subtrahenden Indikatoren-IDs."; - $scope.parameterDefaultValue_computationIndicators = undefined; - $scope.parameterNumericMinValue_computationIndicators = 0; - $scope.parameterNumericMaxValue_computationIndicators = 1; - - $scope.parameterName_referenceIndicator = "REFERENCE_ID"; - $scope.parameterDescription_referenceIndicator = "Indikatoren-ID des Minuenden."; - $scope.parameterDefaultValue_referenceIndicator = undefined; - $scope.parameterNumericMinValue_referenceIndicator = 0; - $scope.parameterNumericMaxValue_referenceIndicator = 1; - - /* - availableScriptDataTypes = [ - { - "displayName": "Textuell (String)", - "apiName": "string" - }, - { - "displayName": "Wahrheitswert (Boolean)", - "apiName": "boolean" - }, - { - "displayName": "Ganzzahl (Integer)", - "apiName": "integer" - }, - { - "displayName": "Gleitkommazahl (Double)", - "apiName": "double" - } - ]; - */ - $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; - - $scope.scriptCode_readableString_forPreview = undefined; - $scope.scriptCodeDomElementId = "#scriptCodePreview"; - - $scope.scriptFormulaHTML = undefined; - - /* - * reset relevant things due to change of script type - */ - $scope.init = function(){ - kommonitorScriptHelperService.reset(); - - $scope.initFixedScriptCode(); - }; - - $scope.initFixedScriptCode = function(){ - $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { - $scope.scriptCode_readableString_forPreview = response.data; - kommonitorScriptHelperService.scriptCode_readableString = response.data; - $scope.scriptCode_readableString_forPreview = response.data; - - kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); - }); - }; - - $scope.init(); - - $scope.onChangeReferenceIndicator = function(refIndicatorSelection){ - // remove previous refIndicator from requiredIndicators and add new one - kommonitorScriptHelperService.removeBaseIndicator($scope.refIndicatorSelection_old); - kommonitorScriptHelperService.addBaseIndicator(refIndicatorSelection); - - $scope.refIndicatorSelection_old = refIndicatorSelection; - - //reset the one and only parameter in this case each time a base indicator is added - $scope.resetRefIndicatorParameter(); - $scope.resetComputationFormulaAndLegend(); - - }; - - $scope.resetScriptParameter_computationIndicators = function(requiredIndicatorsArray){ - - var result=""; - for (let index = 0; index < requiredIndicatorsArray.length; index++) { - const indicatorMetadata = requiredIndicatorsArray[index]; - result+=indicatorMetadata.indicatorId; - if(index < requiredIndicatorsArray.length - 1){ - result+=","; - } - } - - return result; - }; - - $scope.resetComputationIndicatorParameter = function(){ - kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationIndicators); - $scope.parameterDefaultValue_computationIndicators = $scope.resetScriptParameter_computationIndicators($scope.baseIndicators); - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationIndicators, $scope.parameterDescription_computationIndicators, $scope.parameterDataType, $scope.parameterDefaultValue_computationIndicators, $scope.parameterNumericMinValue_computationIndicators, $scope.parameterNumericMaxValue_computationIndicators); - }; - - $scope.resetRefIndicatorParameter = function(){ - kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_referenceIndicator); - $scope.parameterDefaultValue_referenceIndicator = $scope.refIndicatorSelection.indicatorId; - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_referenceIndicator, $scope.parameterDescription_referenceIndicator, $scope.parameterDataType, $scope.parameterDefaultValue_referenceIndicator, $scope.parameterNumericMinValue_referenceIndicator, $scope.parameterNumericMaxValue_referenceIndicator); - }; - - $scope.resetComputationFormulaAndLegend = function(){ - kommonitorScriptHelperService.scriptFormulaHTML = ""; - - var formulaHTML = "Berechnung gemäß Formel
"; - var legendItemsHTML = "Legende zur Formel
"; - - // referenceIndicator - formulaHTML+="$ I_{ref} - ("; - legendItemsHTML+="$ I_{ref} $: " + $scope.refIndicatorSelection.indicatorName + " [" + $scope.refIndicatorSelection.unit + "]" + "
"; - - // baseIndicators / computationIndicators - for (let index = 0; index < $scope.baseIndicators.length; index++) { - const indicatorMetadata = $scope.baseIndicators[index]; - var letterValue = kommonitorScriptHelperService.getAlphabetLetterFromNumber(index); - - // we can use TEX code as we use MathJax library - formulaHTML+=letterValue; - legendItemsHTML+="$" + letterValue + "$: " + indicatorMetadata.indicatorName + " [" + indicatorMetadata.unit + "]"; - if(index < $scope.baseIndicators.length - 1){ - formulaHTML+=" + "; - legendItemsHTML+="
"; - } - } - - formulaHTML += ") $"; - - kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; - - }; - - $scope.addBaseIndicator = function(tmpIndicatorSelection){ - - kommonitorScriptHelperService.addBaseIndicator(tmpIndicatorSelection); - $scope.baseIndicators.push(tmpIndicatorSelection); - - //reset the one and only parameter in this case each time a base indicator is added - $scope.resetComputationIndicatorParameter(); - $scope.resetComputationFormulaAndLegend(); - - setTimeout(() => { - $scope.$digest(); - }); - }; - - $scope.removeBaseIndicator = function(baseIndicator){ - kommonitorScriptHelperService.removeBaseIndicator(baseIndicator); - - var i; - for (let index = 0; index < $scope.baseIndicators.length; index++) { - const element = $scope.baseIndicators[index]; - - if(baseIndicator.indicatorId == element.indicatorId){ - i = index; - break; - } - } - $scope.baseIndicators.splice(i, 1); - - //reset the one and only parameter in this case each time a base indicator is removed - $scope.resetComputationIndicatorParameter(); - $scope.resetComputationFormulaAndLegend(); - - setTimeout(() => { - $scope.$digest(); - }); - }; - - } - ] + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/subtract/script-subtract.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + function ScriptSubtractontroller(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_subtract.js"; + $scope.tmpIndicatorSelection = undefined; + $scope.tmpGeoresourceSelection = undefined; + $scope.baseIndicators = []; + $scope.refIndicatorSelection = undefined; + $scope.refIndicatorSelection_old = undefined; + $scope.parameterName_computationIndicators = "COMPUTATION_ID"; + $scope.parameterDescription_computationIndicators = "Komma-separierte Liste aller Subtrahenden Indikatoren-IDs."; + $scope.parameterDefaultValue_computationIndicators = undefined; + $scope.parameterNumericMinValue_computationIndicators = 0; + $scope.parameterNumericMaxValue_computationIndicators = 1; + $scope.parameterName_referenceIndicator = "REFERENCE_ID"; + $scope.parameterDescription_referenceIndicator = "Indikatoren-ID des Minuenden."; + $scope.parameterDefaultValue_referenceIndicator = undefined; + $scope.parameterNumericMinValue_referenceIndicator = 0; + $scope.parameterNumericMaxValue_referenceIndicator = 1; + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + $scope.scriptFormulaHTML = undefined; + /* + * reset relevant things due to change of script type + */ + $scope.init = function () { + kommonitorScriptHelperService.reset(); + $scope.initFixedScriptCode(); + }; + $scope.initFixedScriptCode = function () { + $http.get($scope.pathToScriptResource, { 'responseType': 'text' }).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + $scope.init(); + $scope.onChangeReferenceIndicator = function (refIndicatorSelection) { + // remove previous refIndicator from requiredIndicators and add new one + kommonitorScriptHelperService.removeBaseIndicator($scope.refIndicatorSelection_old); + kommonitorScriptHelperService.addBaseIndicator(refIndicatorSelection); + $scope.refIndicatorSelection_old = refIndicatorSelection; + //reset the one and only parameter in this case each time a base indicator is added + $scope.resetRefIndicatorParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.resetScriptParameter_computationIndicators = function (requiredIndicatorsArray) { + var result = ""; + for (let index = 0; index < requiredIndicatorsArray.length; index++) { + const indicatorMetadata = requiredIndicatorsArray[index]; + result += indicatorMetadata.indicatorId; + if (index < requiredIndicatorsArray.length - 1) { + result += ","; + } + } + return result; + }; + $scope.resetComputationIndicatorParameter = function () { + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationIndicators); + $scope.parameterDefaultValue_computationIndicators = $scope.resetScriptParameter_computationIndicators($scope.baseIndicators); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationIndicators, $scope.parameterDescription_computationIndicators, $scope.parameterDataType, $scope.parameterDefaultValue_computationIndicators, $scope.parameterNumericMinValue_computationIndicators, $scope.parameterNumericMaxValue_computationIndicators); + }; + $scope.resetRefIndicatorParameter = function () { + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_referenceIndicator); + $scope.parameterDefaultValue_referenceIndicator = $scope.refIndicatorSelection.indicatorId; + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_referenceIndicator, $scope.parameterDescription_referenceIndicator, $scope.parameterDataType, $scope.parameterDefaultValue_referenceIndicator, $scope.parameterNumericMinValue_referenceIndicator, $scope.parameterNumericMaxValue_referenceIndicator); + }; + $scope.resetComputationFormulaAndLegend = function () { + kommonitorScriptHelperService.scriptFormulaHTML = ""; + var formulaHTML = "Berechnung gemäß Formel
"; + var legendItemsHTML = "Legende zur Formel
"; + // referenceIndicator + formulaHTML += "$ I_{ref} - ("; + legendItemsHTML += "$ I_{ref} $: " + $scope.refIndicatorSelection.indicatorName + " [" + $scope.refIndicatorSelection.unit + "]" + "
"; + // baseIndicators / computationIndicators + for (let index = 0; index < $scope.baseIndicators.length; index++) { + const indicatorMetadata = $scope.baseIndicators[index]; + var letterValue = kommonitorScriptHelperService.getAlphabetLetterFromNumber(index); + // we can use TEX code as we use MathJax library + formulaHTML += letterValue; + legendItemsHTML += "$" + letterValue + "$: " + indicatorMetadata.indicatorName + " [" + indicatorMetadata.unit + "]"; + if (index < $scope.baseIndicators.length - 1) { + formulaHTML += " + "; + legendItemsHTML += "
"; + } + } + formulaHTML += ") $"; + kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; + }; + $scope.addBaseIndicator = function (tmpIndicatorSelection) { + kommonitorScriptHelperService.addBaseIndicator(tmpIndicatorSelection); + $scope.baseIndicators.push(tmpIndicatorSelection); + //reset the one and only parameter in this case each time a base indicator is added + $scope.resetComputationIndicatorParameter(); + $scope.resetComputationFormulaAndLegend(); + setTimeout(() => { + $scope.$digest(); + }); + }; + $scope.removeBaseIndicator = function (baseIndicator) { + kommonitorScriptHelperService.removeBaseIndicator(baseIndicator); + var i; + for (let index = 0; index < $scope.baseIndicators.length; index++) { + const element = $scope.baseIndicators[index]; + if (baseIndicator.indicatorId == element.indicatorId) { + i = index; + break; + } + } + $scope.baseIndicators.splice(i, 1); + //reset the one and only parameter in this case each time a base indicator is removed + $scope.resetComputationIndicatorParameter(); + $scope.resetComputationFormulaAndLegend(); + setTimeout(() => { + $scope.$digest(); + }); + }; + } + ] }); +//# sourceMappingURL=script-subtract.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/subtract/script-subtract.component.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/subtract/script-subtract.component.js.map new file mode 100644 index 000000000..15c9161a9 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/subtract/script-subtract.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-subtract.component.js","sourceRoot":"","sources":["script-subtract.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,S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CAAkC,EAAE,CAAC;gBAC5C,MAAM,CAAC,gCAAgC,EAAE,CAAC;gBAE1C,UAAU,CAAC,GAAG,EAAE;oBACf,MAAM,CAAC,OAAO,EAAE,CAAC;gBAClB,CAAC,CAAC,CAAC;YACJ,CAAC,CAAC;YAEF,MAAM,CAAC,mBAAmB,GAAG,UAAS,aAAa;gBAClD,6BAA6B,CAAC,mBAAmB,CAAC,aAAa,CAAC,CAAC;gBAEjE,IAAI,CAAC,CAAC;gBACN,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;oBAClE,MAAM,OAAO,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;oBAE7C,IAAG,aAAa,CAAC,WAAW,IAAI,OAAO,CAAC,WAAW,EAAC;wBACnD,CAAC,GAAG,KAAK,CAAC;wBACV,MAAM;qBACN;iBACD;gBACD,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;gBAEnC,qFAAqF;gBACrF,MAAM,CAAC,kCAAkC,EAAE,CAAC;gBAC5C,MAAM,CAAC,gCAAgC,EAAE,CAAC;gBAE1C,UAAU,CAAC,GAAG,EAAE;oBACf,MAAM,CAAC,OAAO,EAAE,CAAC;gBAClB,CAAC,CAAC,CAAC;YACJ,CAAC,CAAC;QAEH,CAAC;KACD;CACD,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/subtract/script-subtract.component.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/subtract/script-subtract.component.ts new file mode 100644 index 000000000..89ebc04ce --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/subtract/script-subtract.component.ts @@ -0,0 +1,190 @@ +angular.module('scriptSubtract').component('scriptSubtract', { + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/subtract/script-subtract.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + function ScriptSubtractontroller(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_subtract.js"; + + $scope.tmpIndicatorSelection = undefined; + $scope.tmpGeoresourceSelection = undefined; + + $scope.baseIndicators = []; + + $scope.refIndicatorSelection = undefined; + $scope.refIndicatorSelection_old = undefined; + + $scope.parameterName_computationIndicators = "COMPUTATION_ID"; + $scope.parameterDescription_computationIndicators = "Komma-separierte Liste aller Subtrahenden Indikatoren-IDs."; + $scope.parameterDefaultValue_computationIndicators = undefined; + $scope.parameterNumericMinValue_computationIndicators = 0; + $scope.parameterNumericMaxValue_computationIndicators = 1; + + $scope.parameterName_referenceIndicator = "REFERENCE_ID"; + $scope.parameterDescription_referenceIndicator = "Indikatoren-ID des Minuenden."; + $scope.parameterDefaultValue_referenceIndicator = undefined; + $scope.parameterNumericMinValue_referenceIndicator = 0; + $scope.parameterNumericMaxValue_referenceIndicator = 1; + + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + + $scope.scriptFormulaHTML = undefined; + + /* + * reset relevant things due to change of script type + */ + $scope.init = function(){ + kommonitorScriptHelperService.reset(); + + $scope.initFixedScriptCode(); + }; + + $scope.initFixedScriptCode = function(){ + $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + + $scope.init(); + + $scope.onChangeReferenceIndicator = function(refIndicatorSelection){ + // remove previous refIndicator from requiredIndicators and add new one + kommonitorScriptHelperService.removeBaseIndicator($scope.refIndicatorSelection_old); + kommonitorScriptHelperService.addBaseIndicator(refIndicatorSelection); + + $scope.refIndicatorSelection_old = refIndicatorSelection; + + //reset the one and only parameter in this case each time a base indicator is added + $scope.resetRefIndicatorParameter(); + $scope.resetComputationFormulaAndLegend(); + + }; + + $scope.resetScriptParameter_computationIndicators = function(requiredIndicatorsArray){ + + var result=""; + for (let index = 0; index < requiredIndicatorsArray.length; index++) { + const indicatorMetadata = requiredIndicatorsArray[index]; + result+=indicatorMetadata.indicatorId; + if(index < requiredIndicatorsArray.length - 1){ + result+=","; + } + } + + return result; + }; + + $scope.resetComputationIndicatorParameter = function(){ + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_computationIndicators); + $scope.parameterDefaultValue_computationIndicators = $scope.resetScriptParameter_computationIndicators($scope.baseIndicators); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationIndicators, $scope.parameterDescription_computationIndicators, $scope.parameterDataType, $scope.parameterDefaultValue_computationIndicators, $scope.parameterNumericMinValue_computationIndicators, $scope.parameterNumericMaxValue_computationIndicators); + }; + + $scope.resetRefIndicatorParameter = function(){ + kommonitorScriptHelperService.removeScriptParameter_byName($scope.parameterName_referenceIndicator); + $scope.parameterDefaultValue_referenceIndicator = $scope.refIndicatorSelection.indicatorId; + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_referenceIndicator, $scope.parameterDescription_referenceIndicator, $scope.parameterDataType, $scope.parameterDefaultValue_referenceIndicator, $scope.parameterNumericMinValue_referenceIndicator, $scope.parameterNumericMaxValue_referenceIndicator); + }; + + $scope.resetComputationFormulaAndLegend = function(){ + kommonitorScriptHelperService.scriptFormulaHTML = ""; + + var formulaHTML = "Berechnung gemäß Formel
"; + var legendItemsHTML = "Legende zur Formel
"; + + // referenceIndicator + formulaHTML+="$ I_{ref} - ("; + legendItemsHTML+="$ I_{ref} $: " + $scope.refIndicatorSelection.indicatorName + " [" + $scope.refIndicatorSelection.unit + "]" + "
"; + + // baseIndicators / computationIndicators + for (let index = 0; index < $scope.baseIndicators.length; index++) { + const indicatorMetadata = $scope.baseIndicators[index]; + var letterValue = kommonitorScriptHelperService.getAlphabetLetterFromNumber(index); + + // we can use TEX code as we use MathJax library + formulaHTML+=letterValue; + legendItemsHTML+="$" + letterValue + "$: " + indicatorMetadata.indicatorName + " [" + indicatorMetadata.unit + "]"; + if(index < $scope.baseIndicators.length - 1){ + formulaHTML+=" + "; + legendItemsHTML+="
"; + } + } + + formulaHTML += ") $"; + + kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; + + }; + + $scope.addBaseIndicator = function(tmpIndicatorSelection){ + + kommonitorScriptHelperService.addBaseIndicator(tmpIndicatorSelection); + $scope.baseIndicators.push(tmpIndicatorSelection); + + //reset the one and only parameter in this case each time a base indicator is added + $scope.resetComputationIndicatorParameter(); + $scope.resetComputationFormulaAndLegend(); + + setTimeout(() => { + $scope.$digest(); + }); + }; + + $scope.removeBaseIndicator = function(baseIndicator){ + kommonitorScriptHelperService.removeBaseIndicator(baseIndicator); + + var i; + for (let index = 0; index < $scope.baseIndicators.length; index++) { + const element = $scope.baseIndicators[index]; + + if(baseIndicator.indicatorId == element.indicatorId){ + i = index; + break; + } + } + $scope.baseIndicators.splice(i, 1); + + //reset the one and only parameter in this case each time a base indicator is removed + $scope.resetComputationIndicatorParameter(); + $scope.resetComputationFormulaAndLegend(); + + setTimeout(() => { + $scope.$digest(); + }); + }; + + } + ] +}); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/subtract/script-subtract.module.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/subtract/script-subtract.module.js index f517612fa..b9d1e6bf8 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/subtract/script-subtract.module.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/subtract/script-subtract.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('scriptSubtract', ['kommonitorDataExchange', 'kommonitorScriptHelper']); +//# sourceMappingURL=script-subtract.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/subtract/script-subtract.module.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/subtract/script-subtract.module.js.map new file mode 100644 index 000000000..3f8f957c1 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/subtract/script-subtract.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-subtract.module.js","sourceRoot":"","sources":["script-subtract.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC,wBAAwB,EAAE,wBAAwB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/subtract/script-subtract.module.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/subtract/script-subtract.module.ts new file mode 100644 index 000000000..f517612fa --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/subtract/script-subtract.module.ts @@ -0,0 +1 @@ +angular.module('scriptSubtract', ['kommonitorDataExchange', 'kommonitorScriptHelper']); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/sum/script-sum.component.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/sum/script-sum.component.js index ca9e8b5fe..61d18f6b0 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/sum/script-sum.component.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/sum/script-sum.component.js @@ -1,159 +1,125 @@ +"use strict"; angular.module('scriptSum').component('scriptSum', { - templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/sum/script-sum.template.html", - controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', - function ScriptSumController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; - - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_sum.js"; - - $scope.tmpIndicatorSelection = undefined; - $scope.tmpGeoresourceSelection = undefined; - - $scope.baseIndicators = []; - - $scope.parameterName = "COMPUTATION_ID"; - $scope.parameterDescription = "Komma-separierte Liste aller Indikatoren-IDs zur Summenbildung."; - $scope.parameterDefaultValue = undefined; - $scope.parameterNumericMinValue = 0; - $scope.parameterNumericMaxValue = 1; - - /* - availableScriptDataTypes = [ - { - "displayName": "Textuell (String)", - "apiName": "string" - }, - { - "displayName": "Wahrheitswert (Boolean)", - "apiName": "boolean" - }, - { - "displayName": "Ganzzahl (Integer)", - "apiName": "integer" - }, - { - "displayName": "Gleitkommazahl (Double)", - "apiName": "double" - } - ]; - */ - $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; - - $scope.scriptCode_readableString_forPreview = undefined; - $scope.scriptCodeDomElementId = "#scriptCodePreview"; - - $scope.scriptFormulaHTML = undefined; - - /* - * reset relevant things due to change of script type - */ - $scope.init = function(){ - kommonitorScriptHelperService.reset(); - - $scope.initFixedScriptCode(); - }; - - $scope.initFixedScriptCode = function(){ - $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { - $scope.scriptCode_readableString_forPreview = response.data; - kommonitorScriptHelperService.scriptCode_readableString = response.data; - $scope.scriptCode_readableString_forPreview = response.data; - - kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); - }); - }; - - $scope.init(); - - $scope.generateParameterValue = function(requiredIndicatorsArray){ - - var result=""; - for (let index = 0; index < requiredIndicatorsArray.length; index++) { - const indicatorMetadata = requiredIndicatorsArray[index]; - result+=indicatorMetadata.indicatorId; - if(index < requiredIndicatorsArray.length - 1){ - result+=","; - } - } - - return result; - }; - - $scope.resetScriptParameter = function(){ - kommonitorScriptHelperService.requiredScriptParameters_tmp = []; - $scope.parameterDefaultValue = $scope.generateParameterValue($scope.baseIndicators); - kommonitorScriptHelperService.addScriptParameter($scope.parameterName, $scope.parameterDescription, $scope.parameterDataType, $scope.parameterDefaultValue, $scope.parameterNumericMinValue, $scope.parameterNumericMaxValue); - }; - - $scope.resetComputationFormulaAndLegend = function(){ - kommonitorScriptHelperService.scriptFormulaHTML = ""; - - var formulaHTML = "Berechnung gemäß Formel
"; - var legendItemsHTML = "Legende zur Formel
"; - - formulaHTML += "$ "; - - for (let index = 0; index < $scope.baseIndicators.length; index++) { - const indicatorMetadata = $scope.baseIndicators[index]; - var letterValue = kommonitorScriptHelperService.getAlphabetLetterFromNumber(index); - - // we can use TEX code as we use MathJax library - formulaHTML+=letterValue; - legendItemsHTML+="$" + letterValue + "$: " + indicatorMetadata.indicatorName + " [" + indicatorMetadata.unit + "]"; - if(index < $scope.baseIndicators.length - 1){ - formulaHTML+=" + "; - legendItemsHTML+="
"; - } - } - - formulaHTML += " $"; - - kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; - - }; - - $scope.addBaseIndicator = function(tmpIndicatorSelection){ - - kommonitorScriptHelperService.addBaseIndicator(tmpIndicatorSelection); - $scope.baseIndicators.push(tmpIndicatorSelection); - - //reset the one and only parameter in this case each time a base indicator is added - $scope.resetScriptParameter(); - $scope.resetComputationFormulaAndLegend(); - - setTimeout(() => { - $scope.$digest(); - }); - }; - - $scope.removeBaseIndicator = function(baseIndicator){ - kommonitorScriptHelperService.removeBaseIndicator(baseIndicator); - - var i; - for (let index = 0; index < $scope.baseIndicators.length; index++) { - const element = $scope.baseIndicators[index]; - - if(baseIndicator.indicatorId == element.indicatorId){ - i = index; - break; - } - } - $scope.baseIndicators.splice(i, 1); - - //reset the one and only parameter in this case each time a base indicator is removed - $scope.resetScriptParameter(); - $scope.resetComputationFormulaAndLegend(); - - setTimeout(() => { - $scope.$digest(); - }); - }; - - } - ] + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/sum/script-sum.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + function ScriptSumController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_sum.js"; + $scope.tmpIndicatorSelection = undefined; + $scope.tmpGeoresourceSelection = undefined; + $scope.baseIndicators = []; + $scope.parameterName = "COMPUTATION_ID"; + $scope.parameterDescription = "Komma-separierte Liste aller Indikatoren-IDs zur Summenbildung."; + $scope.parameterDefaultValue = undefined; + $scope.parameterNumericMinValue = 0; + $scope.parameterNumericMaxValue = 1; + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + $scope.scriptFormulaHTML = undefined; + /* + * reset relevant things due to change of script type + */ + $scope.init = function () { + kommonitorScriptHelperService.reset(); + $scope.initFixedScriptCode(); + }; + $scope.initFixedScriptCode = function () { + $http.get($scope.pathToScriptResource, { 'responseType': 'text' }).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + $scope.init(); + $scope.generateParameterValue = function (requiredIndicatorsArray) { + var result = ""; + for (let index = 0; index < requiredIndicatorsArray.length; index++) { + const indicatorMetadata = requiredIndicatorsArray[index]; + result += indicatorMetadata.indicatorId; + if (index < requiredIndicatorsArray.length - 1) { + result += ","; + } + } + return result; + }; + $scope.resetScriptParameter = function () { + kommonitorScriptHelperService.requiredScriptParameters_tmp = []; + $scope.parameterDefaultValue = $scope.generateParameterValue($scope.baseIndicators); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName, $scope.parameterDescription, $scope.parameterDataType, $scope.parameterDefaultValue, $scope.parameterNumericMinValue, $scope.parameterNumericMaxValue); + }; + $scope.resetComputationFormulaAndLegend = function () { + kommonitorScriptHelperService.scriptFormulaHTML = ""; + var formulaHTML = "Berechnung gemäß Formel
"; + var legendItemsHTML = "Legende zur Formel
"; + formulaHTML += "$ "; + for (let index = 0; index < $scope.baseIndicators.length; index++) { + const indicatorMetadata = $scope.baseIndicators[index]; + var letterValue = kommonitorScriptHelperService.getAlphabetLetterFromNumber(index); + // we can use TEX code as we use MathJax library + formulaHTML += letterValue; + legendItemsHTML += "$" + letterValue + "$: " + indicatorMetadata.indicatorName + " [" + indicatorMetadata.unit + "]"; + if (index < $scope.baseIndicators.length - 1) { + formulaHTML += " + "; + legendItemsHTML += "
"; + } + } + formulaHTML += " $"; + kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; + }; + $scope.addBaseIndicator = function (tmpIndicatorSelection) { + kommonitorScriptHelperService.addBaseIndicator(tmpIndicatorSelection); + $scope.baseIndicators.push(tmpIndicatorSelection); + //reset the one and only parameter in this case each time a base indicator is added + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + setTimeout(() => { + $scope.$digest(); + }); + }; + $scope.removeBaseIndicator = function (baseIndicator) { + kommonitorScriptHelperService.removeBaseIndicator(baseIndicator); + var i; + for (let index = 0; index < $scope.baseIndicators.length; index++) { + const element = $scope.baseIndicators[index]; + if (baseIndicator.indicatorId == element.indicatorId) { + i = index; + break; + } + } + $scope.baseIndicators.splice(i, 1); + //reset the one and only parameter in this case each time a base indicator is removed + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + setTimeout(() => { + $scope.$digest(); + }); + }; + } + ] }); +//# sourceMappingURL=script-sum.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/sum/script-sum.component.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/sum/script-sum.component.js.map new file mode 100644 index 000000000..363f839b2 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/sum/script-sum.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-sum.component.js","sourceRoot":"","sources":["script-sum.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,SAAS,CAAC,WAAW,EAAE;IAClD,WAAW,EAAE,+GAA+G;IAC5H,UAAU,EAAE,CAAC,+BAA+B,EAAE,+BAA+B,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU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GAAG,UAAS,aAAa;gBAClD,6BAA6B,CAAC,mBAAmB,CAAC,aAAa,CAAC,CAAC;gBAEjE,IAAI,CAAC,CAAC;gBACN,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;oBAClE,MAAM,OAAO,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;oBAE7C,IAAG,aAAa,CAAC,WAAW,IAAI,OAAO,CAAC,WAAW,EAAC;wBACnD,CAAC,GAAG,KAAK,CAAC;wBACV,MAAM;qBACN;iBACD;gBACD,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;gBAEnC,qFAAqF;gBACrF,MAAM,CAAC,oBAAoB,EAAE,CAAC;gBAC9B,MAAM,CAAC,gCAAgC,EAAE,CAAC;gBAE1C,UAAU,CAAC,GAAG,EAAE;oBACf,MAAM,CAAC,OAAO,EAAE,CAAC;gBAClB,CAAC,CAAC,CAAC;YACJ,CAAC,CAAC;QAEH,CAAC;KACD;CACD,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/sum/script-sum.component.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/sum/script-sum.component.ts new file mode 100644 index 000000000..ca9e8b5fe --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/sum/script-sum.component.ts @@ -0,0 +1,159 @@ +angular.module('scriptSum').component('scriptSum', { + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/sum/script-sum.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + function ScriptSumController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_sum.js"; + + $scope.tmpIndicatorSelection = undefined; + $scope.tmpGeoresourceSelection = undefined; + + $scope.baseIndicators = []; + + $scope.parameterName = "COMPUTATION_ID"; + $scope.parameterDescription = "Komma-separierte Liste aller Indikatoren-IDs zur Summenbildung."; + $scope.parameterDefaultValue = undefined; + $scope.parameterNumericMinValue = 0; + $scope.parameterNumericMaxValue = 1; + + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + + $scope.scriptFormulaHTML = undefined; + + /* + * reset relevant things due to change of script type + */ + $scope.init = function(){ + kommonitorScriptHelperService.reset(); + + $scope.initFixedScriptCode(); + }; + + $scope.initFixedScriptCode = function(){ + $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + + $scope.init(); + + $scope.generateParameterValue = function(requiredIndicatorsArray){ + + var result=""; + for (let index = 0; index < requiredIndicatorsArray.length; index++) { + const indicatorMetadata = requiredIndicatorsArray[index]; + result+=indicatorMetadata.indicatorId; + if(index < requiredIndicatorsArray.length - 1){ + result+=","; + } + } + + return result; + }; + + $scope.resetScriptParameter = function(){ + kommonitorScriptHelperService.requiredScriptParameters_tmp = []; + $scope.parameterDefaultValue = $scope.generateParameterValue($scope.baseIndicators); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName, $scope.parameterDescription, $scope.parameterDataType, $scope.parameterDefaultValue, $scope.parameterNumericMinValue, $scope.parameterNumericMaxValue); + }; + + $scope.resetComputationFormulaAndLegend = function(){ + kommonitorScriptHelperService.scriptFormulaHTML = ""; + + var formulaHTML = "Berechnung gemäß Formel
"; + var legendItemsHTML = "Legende zur Formel
"; + + formulaHTML += "$ "; + + for (let index = 0; index < $scope.baseIndicators.length; index++) { + const indicatorMetadata = $scope.baseIndicators[index]; + var letterValue = kommonitorScriptHelperService.getAlphabetLetterFromNumber(index); + + // we can use TEX code as we use MathJax library + formulaHTML+=letterValue; + legendItemsHTML+="$" + letterValue + "$: " + indicatorMetadata.indicatorName + " [" + indicatorMetadata.unit + "]"; + if(index < $scope.baseIndicators.length - 1){ + formulaHTML+=" + "; + legendItemsHTML+="
"; + } + } + + formulaHTML += " $"; + + kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; + + }; + + $scope.addBaseIndicator = function(tmpIndicatorSelection){ + + kommonitorScriptHelperService.addBaseIndicator(tmpIndicatorSelection); + $scope.baseIndicators.push(tmpIndicatorSelection); + + //reset the one and only parameter in this case each time a base indicator is added + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + + setTimeout(() => { + $scope.$digest(); + }); + }; + + $scope.removeBaseIndicator = function(baseIndicator){ + kommonitorScriptHelperService.removeBaseIndicator(baseIndicator); + + var i; + for (let index = 0; index < $scope.baseIndicators.length; index++) { + const element = $scope.baseIndicators[index]; + + if(baseIndicator.indicatorId == element.indicatorId){ + i = index; + break; + } + } + $scope.baseIndicators.splice(i, 1); + + //reset the one and only parameter in this case each time a base indicator is removed + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + + setTimeout(() => { + $scope.$digest(); + }); + }; + + } + ] +}); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/sum/script-sum.module.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/sum/script-sum.module.js index aec049141..c3004e226 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/sum/script-sum.module.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/sum/script-sum.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('scriptSum', ['kommonitorDataExchange', 'kommonitorScriptHelper']); +//# sourceMappingURL=script-sum.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/sum/script-sum.module.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/sum/script-sum.module.js.map new file mode 100644 index 000000000..6814b25f5 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/sum/script-sum.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-sum.module.js","sourceRoot":"","sources":["script-sum.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,wBAAwB,EAAE,wBAAwB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/sum/script-sum.module.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/sum/script-sum.module.ts new file mode 100644 index 000000000..aec049141 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/sum/script-sum.module.ts @@ -0,0 +1 @@ +angular.module('scriptSum', ['kommonitorDataExchange', 'kommonitorScriptHelper']); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/trend/script-trend.component.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/trend/script-trend.component.js index d9cb12976..7260d51dd 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/trend/script-trend.component.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/trend/script-trend.component.js @@ -1,153 +1,120 @@ +"use strict"; angular.module('scriptTrend').component('scriptTrend', { - templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/trend/script-trend.template.html", - controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', - function ScriptTrendController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; - - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_trend_nTemporalItems.js"; - - $scope.tmpIndicatorSelection = undefined; - - $scope.compIndicatorSelection = undefined; - $scope.compIndicatorSelection_old = undefined; - - $scope.parameterName_computationIndicator = "COMPUTATION_ID"; - $scope.parameterDescription_computationIndicator = "Indikatoren-ID des Basisindikators."; - $scope.parameterDefaultValue_computationIndicator = undefined; - $scope.parameterNumericMinValue_computationIndicator = 0; - $scope.parameterNumericMaxValue_computationIndicator = 1; - - $scope.temporalOption = kommonitorScriptHelperService.temporalOptions[0]; - - $scope.numberOfTemporalItems = 3; - - $scope.parameterName_temporalOption = "TEMPORAL_TYPE"; - $scope.parameterDescription_temporalOption = "Angabe des Zeitbezug-Typs. Standard ist 'Jahre'."; - $scope.parameterDefaultValue_temporalOption = "YEARS"; - $scope.parameterNumericMinValue_temporalOption = 0; - $scope.parameterNumericMaxValue_temporalOption = 1; - - $scope.parameterName_numTemporalItems = "NUMBER_OF_TEMPORAL_ITEMS"; - $scope.parameterDescription_numTemporalItems = "Anzahl der Zeiteinheiten. Standard ist '3'."; - $scope.parameterDefaultValue_numTemporalItems = 3; - $scope.parameterNumericMinValue_numTemporalItems = 3; - $scope.parameterNumericMaxValue_numTemporalItems = 100000; - $scope.parameterDataType_numTemporalItems = kommonitorScriptHelperService.availableScriptDataTypes[3]; - - /* - availableScriptDataTypes = [ - { - "displayName": "Textuell (String)", - "apiName": "string" - }, - { - "displayName": "Wahrheitswert (Boolean)", - "apiName": "boolean" - }, - { - "displayName": "Ganzzahl (Integer)", - "apiName": "integer" - }, - { - "displayName": "Gleitkommazahl (Double)", - "apiName": "double" - } - ]; - */ - $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; - - $scope.scriptCode_readableString_forPreview = undefined; - $scope.scriptCodeDomElementId = "#scriptCodePreview"; - - $scope.scriptFormulaHTML = undefined; - - /* - * reset relevant things due to change of script type - */ - $scope.init = function(){ - kommonitorScriptHelperService.reset(); - - $scope.initFixedScriptCode(); - }; - - $scope.initFixedScriptCode = function(){ - $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { - $scope.scriptCode_readableString_forPreview = response.data; - kommonitorScriptHelperService.scriptCode_readableString = response.data; - $scope.scriptCode_readableString_forPreview = response.data; - - kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); - }); - }; - - $scope.init(); - - $scope.onChangeComputationIndicator = function(compIndicatorSelection){ - // remove previous refIndicator from requiredIndicators and add new one - if($scope.compIndicatorSelection_old){ - kommonitorScriptHelperService.removeBaseIndicator($scope.compIndicatorSelection_old); - } - kommonitorScriptHelperService.addBaseIndicator(compIndicatorSelection); - - $scope.compIndicatorSelection_old = compIndicatorSelection; - - $scope.resetScriptParameter(); - $scope.resetComputationFormulaAndLegend(); - - }; - - $scope.onChangeNumTemporalItems = function(){ - $scope.numberOfTemporalItems = Math.round($scope.numberOfTemporalItems); - $scope.resetScriptParameter(); - $scope.resetComputationFormulaAndLegend(); - }; - - $scope.onChangeTemporalOption = function(){ - $scope.resetScriptParameter(); - $scope.resetComputationFormulaAndLegend(); - }; - - $scope.resetScriptParameter = function(){ - kommonitorScriptHelperService.requiredScriptParameters_tmp = []; - - $scope.parameterDefaultValue_computationIndicator = undefined; - - if($scope.compIndicatorSelection && $scope.compIndicatorSelection.indicatorId){ - $scope.parameterDefaultValue_computationIndicator = $scope.compIndicatorSelection.indicatorId; - } - - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationIndicator, $scope.parameterDescription_computationIndicator, $scope.parameterDataType, $scope.parameterDefaultValue_computationIndicator, $scope.parameterNumericMinValue_computationIndicator, $scope.parameterNumericMaxValue_computationIndicator); - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_numTemporalItems, $scope.parameterDescription_numTemporalItems, $scope.parameterDataType_numTemporalItems, $scope.numberOfTemporalItems, $scope.parameterNumericMinValue_numTemporalItems, $scope.parameterNumericMaxValue_numTemporalItems); - kommonitorScriptHelperService.addScriptParameter($scope.parameterName_temporalOption, $scope.parameterDescription_temporalOption, $scope.parameterDataType, $scope.temporalOption.apiName, $scope.parameterNumericMinValue_temporalOption, $scope.parameterNumericMaxValue_temporalOption); - }; - - $scope.resetComputationFormulaAndLegend = function(){ - kommonitorScriptHelperService.scriptFormulaHTML = ""; - - if (! $scope.compIndicatorSelection){ - return; - } - - var formulaHTML = "Berechnung gemäß Formel
$$ T = 100 \\times \\frac{b}{B_{1}} $$ wobei $$ b = \\frac{\\sum_{n=1}^{m}((A_{n} - \\bar{A}) \\times (B_{n} - \\bar{B}))}{\\sum_{n=1}^{m} (A_{n} - \\bar{A})^2} $$"; - var legendItemsHTML = "Legende zur Formel"; - - legendItemsHTML+="
$T$: Trend"; - legendItemsHTML+="
$m$ = " + $scope.numberOfTemporalItems + " konsekutive vergangene " + $scope.temporalOption.displayName; - legendItemsHTML+="
$A_{n}$ = aufeinander folgende " + $scope.temporalOption.displayName; - legendItemsHTML+="
$\\bar{A}$ = arithmetisches Mittel der aufeinander folgenden " + $scope.temporalOption.displayName; - legendItemsHTML+="
$B_{n}$ = Indikatorenwerte der aufeinander folgenden " + $scope.temporalOption.displayName; - legendItemsHTML+="
$\\bar{B}$ = arithmetisches Mittel der Indikatorenwerte der aufeinander folgenden " + $scope.temporalOption.displayName; - legendItemsHTML+="
$B$ = Indikator '" + $scope.compIndicatorSelection.indicatorName + " [" + $scope.compIndicatorSelection.unit + "]" + "'"; - - kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; - - }; - - } - ] + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/trend/script-trend.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + function ScriptTrendController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_trend_nTemporalItems.js"; + $scope.tmpIndicatorSelection = undefined; + $scope.compIndicatorSelection = undefined; + $scope.compIndicatorSelection_old = undefined; + $scope.parameterName_computationIndicator = "COMPUTATION_ID"; + $scope.parameterDescription_computationIndicator = "Indikatoren-ID des Basisindikators."; + $scope.parameterDefaultValue_computationIndicator = undefined; + $scope.parameterNumericMinValue_computationIndicator = 0; + $scope.parameterNumericMaxValue_computationIndicator = 1; + $scope.temporalOption = kommonitorScriptHelperService.temporalOptions[0]; + $scope.numberOfTemporalItems = 3; + $scope.parameterName_temporalOption = "TEMPORAL_TYPE"; + $scope.parameterDescription_temporalOption = "Angabe des Zeitbezug-Typs. Standard ist 'Jahre'."; + $scope.parameterDefaultValue_temporalOption = "YEARS"; + $scope.parameterNumericMinValue_temporalOption = 0; + $scope.parameterNumericMaxValue_temporalOption = 1; + $scope.parameterName_numTemporalItems = "NUMBER_OF_TEMPORAL_ITEMS"; + $scope.parameterDescription_numTemporalItems = "Anzahl der Zeiteinheiten. Standard ist '3'."; + $scope.parameterDefaultValue_numTemporalItems = 3; + $scope.parameterNumericMinValue_numTemporalItems = 3; + $scope.parameterNumericMaxValue_numTemporalItems = 100000; + $scope.parameterDataType_numTemporalItems = kommonitorScriptHelperService.availableScriptDataTypes[3]; + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + $scope.scriptFormulaHTML = undefined; + /* + * reset relevant things due to change of script type + */ + $scope.init = function () { + kommonitorScriptHelperService.reset(); + $scope.initFixedScriptCode(); + }; + $scope.initFixedScriptCode = function () { + $http.get($scope.pathToScriptResource, { 'responseType': 'text' }).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + $scope.init(); + $scope.onChangeComputationIndicator = function (compIndicatorSelection) { + // remove previous refIndicator from requiredIndicators and add new one + if ($scope.compIndicatorSelection_old) { + kommonitorScriptHelperService.removeBaseIndicator($scope.compIndicatorSelection_old); + } + kommonitorScriptHelperService.addBaseIndicator(compIndicatorSelection); + $scope.compIndicatorSelection_old = compIndicatorSelection; + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.onChangeNumTemporalItems = function () { + $scope.numberOfTemporalItems = Math.round($scope.numberOfTemporalItems); + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.onChangeTemporalOption = function () { + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + $scope.resetScriptParameter = function () { + kommonitorScriptHelperService.requiredScriptParameters_tmp = []; + $scope.parameterDefaultValue_computationIndicator = undefined; + if ($scope.compIndicatorSelection && $scope.compIndicatorSelection.indicatorId) { + $scope.parameterDefaultValue_computationIndicator = $scope.compIndicatorSelection.indicatorId; + } + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationIndicator, $scope.parameterDescription_computationIndicator, $scope.parameterDataType, $scope.parameterDefaultValue_computationIndicator, $scope.parameterNumericMinValue_computationIndicator, $scope.parameterNumericMaxValue_computationIndicator); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_numTemporalItems, $scope.parameterDescription_numTemporalItems, $scope.parameterDataType_numTemporalItems, $scope.numberOfTemporalItems, $scope.parameterNumericMinValue_numTemporalItems, $scope.parameterNumericMaxValue_numTemporalItems); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_temporalOption, $scope.parameterDescription_temporalOption, $scope.parameterDataType, $scope.temporalOption.apiName, $scope.parameterNumericMinValue_temporalOption, $scope.parameterNumericMaxValue_temporalOption); + }; + $scope.resetComputationFormulaAndLegend = function () { + kommonitorScriptHelperService.scriptFormulaHTML = ""; + if (!$scope.compIndicatorSelection) { + return; + } + var formulaHTML = "Berechnung gemäß Formel
$$ T = 100 \\times \\frac{b}{B_{1}} $$ wobei $$ b = \\frac{\\sum_{n=1}^{m}((A_{n} - \\bar{A}) \\times (B_{n} - \\bar{B}))}{\\sum_{n=1}^{m} (A_{n} - \\bar{A})^2} $$"; + var legendItemsHTML = "Legende zur Formel"; + legendItemsHTML += "
$T$: Trend"; + legendItemsHTML += "
$m$ = " + $scope.numberOfTemporalItems + " konsekutive vergangene " + $scope.temporalOption.displayName; + legendItemsHTML += "
$A_{n}$ = aufeinander folgende " + $scope.temporalOption.displayName; + legendItemsHTML += "
$\\bar{A}$ = arithmetisches Mittel der aufeinander folgenden " + $scope.temporalOption.displayName; + legendItemsHTML += "
$B_{n}$ = Indikatorenwerte der aufeinander folgenden " + $scope.temporalOption.displayName; + legendItemsHTML += "
$\\bar{B}$ = arithmetisches Mittel der Indikatorenwerte der aufeinander folgenden " + $scope.temporalOption.displayName; + legendItemsHTML += "
$B$ = Indikator '" + $scope.compIndicatorSelection.indicatorName + " [" + $scope.compIndicatorSelection.unit + "]" + "'"; + kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; + }; + } + ] }); +//# sourceMappingURL=script-trend.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/trend/script-trend.component.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/trend/script-trend.component.js.map new file mode 100644 index 000000000..87545d65c --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/trend/script-trend.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-trend.component.js","sourceRoot":"","sources":["script-trend.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,SAAS,CAAC,aAAa,EAAE;IACtD,WAAW,EAAE,mHAAmH;IAChI,UAAU,EAAE,CAAC,+BAA+B,EAAE,+BAA+B,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU;QAClI,SAAS,qBAAqB,CAAC,6BAA6B,EAAE,6BAA6B,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ;YAEtI,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAC3E,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAE3E,sCAAsC;YACtC,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,CAAC;YAEtB,MAAM,CAAC,oBAAoB,GAAG,oEAAoE,CAAC;YAEnG,MAAM,CAAC,qBAAqB,GAAG,SAAS,CAAC;YAEzC,MAAM,CAAC,sBAAsB,GAAG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,2BAA2B,CAAC;gBAElD,eAAe,IAAE,kBAAkB,CAAC;gBACpC,eAAe,IAAE,cAAc,GAAG,MAAM,CAAC,qBAAqB,GAAG,0BAA0B,GAAG,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC;gBAChI,eAAe,IAAE,uCAAuC,GAAG,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC;gBAC7F,eAAe,IAAE,qEAAqE,GAAG,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC;gBAC3H,eAAe,IAAE,6DAA6D,GAAG,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC;gBACnH,eAAe,IAAE,0FAA0F,GAAG,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC;gBAChJ,eAAe,IAAE,yBAAyB,GAAG,MAAM,CAAC,sBAAsB,CAAC,aAAa,GAAI,IAAI,GAAG,MAAM,CAAC,sBAAsB,CAAC,IAAI,GAAI,GAAG,GAAG,GAAG,CAAC;gBAEnJ,6BAA6B,CAAC,iBAAiB,GAAG,WAAW,GAAG,YAAY,GAAG,eAAe,CAAC;YAEjG,CAAC,CAAC;QAEH,CAAC;KACD;CACD,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/trend/script-trend.component.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/trend/script-trend.component.ts new file mode 100644 index 000000000..d9cb12976 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/trend/script-trend.component.ts @@ -0,0 +1,153 @@ +angular.module('scriptTrend').component('scriptTrend', { + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/trend/script-trend.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + function ScriptTrendController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $timeout) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + $scope.pathToScriptResource = "./kommonitor-script-resources/km_indicator_trend_nTemporalItems.js"; + + $scope.tmpIndicatorSelection = undefined; + + $scope.compIndicatorSelection = undefined; + $scope.compIndicatorSelection_old = undefined; + + $scope.parameterName_computationIndicator = "COMPUTATION_ID"; + $scope.parameterDescription_computationIndicator = "Indikatoren-ID des Basisindikators."; + $scope.parameterDefaultValue_computationIndicator = undefined; + $scope.parameterNumericMinValue_computationIndicator = 0; + $scope.parameterNumericMaxValue_computationIndicator = 1; + + $scope.temporalOption = kommonitorScriptHelperService.temporalOptions[0]; + + $scope.numberOfTemporalItems = 3; + + $scope.parameterName_temporalOption = "TEMPORAL_TYPE"; + $scope.parameterDescription_temporalOption = "Angabe des Zeitbezug-Typs. Standard ist 'Jahre'."; + $scope.parameterDefaultValue_temporalOption = "YEARS"; + $scope.parameterNumericMinValue_temporalOption = 0; + $scope.parameterNumericMaxValue_temporalOption = 1; + + $scope.parameterName_numTemporalItems = "NUMBER_OF_TEMPORAL_ITEMS"; + $scope.parameterDescription_numTemporalItems = "Anzahl der Zeiteinheiten. Standard ist '3'."; + $scope.parameterDefaultValue_numTemporalItems = 3; + $scope.parameterNumericMinValue_numTemporalItems = 3; + $scope.parameterNumericMaxValue_numTemporalItems = 100000; + $scope.parameterDataType_numTemporalItems = kommonitorScriptHelperService.availableScriptDataTypes[3]; + + /* + availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + */ + $scope.parameterDataType = kommonitorScriptHelperService.availableScriptDataTypes[0]; + + $scope.scriptCode_readableString_forPreview = undefined; + $scope.scriptCodeDomElementId = "#scriptCodePreview"; + + $scope.scriptFormulaHTML = undefined; + + /* + * reset relevant things due to change of script type + */ + $scope.init = function(){ + kommonitorScriptHelperService.reset(); + + $scope.initFixedScriptCode(); + }; + + $scope.initFixedScriptCode = function(){ + $http.get($scope.pathToScriptResource, {'responseType': 'text'}).then(function (response) { + $scope.scriptCode_readableString_forPreview = response.data; + kommonitorScriptHelperService.scriptCode_readableString = response.data; + $scope.scriptCode_readableString_forPreview = response.data; + + kommonitorScriptHelperService.prettifyScriptCodePreview($scope.scriptCodeDomElementId); + }); + }; + + $scope.init(); + + $scope.onChangeComputationIndicator = function(compIndicatorSelection){ + // remove previous refIndicator from requiredIndicators and add new one + if($scope.compIndicatorSelection_old){ + kommonitorScriptHelperService.removeBaseIndicator($scope.compIndicatorSelection_old); + } + kommonitorScriptHelperService.addBaseIndicator(compIndicatorSelection); + + $scope.compIndicatorSelection_old = compIndicatorSelection; + + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + + }; + + $scope.onChangeNumTemporalItems = function(){ + $scope.numberOfTemporalItems = Math.round($scope.numberOfTemporalItems); + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + + $scope.onChangeTemporalOption = function(){ + $scope.resetScriptParameter(); + $scope.resetComputationFormulaAndLegend(); + }; + + $scope.resetScriptParameter = function(){ + kommonitorScriptHelperService.requiredScriptParameters_tmp = []; + + $scope.parameterDefaultValue_computationIndicator = undefined; + + if($scope.compIndicatorSelection && $scope.compIndicatorSelection.indicatorId){ + $scope.parameterDefaultValue_computationIndicator = $scope.compIndicatorSelection.indicatorId; + } + + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_computationIndicator, $scope.parameterDescription_computationIndicator, $scope.parameterDataType, $scope.parameterDefaultValue_computationIndicator, $scope.parameterNumericMinValue_computationIndicator, $scope.parameterNumericMaxValue_computationIndicator); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_numTemporalItems, $scope.parameterDescription_numTemporalItems, $scope.parameterDataType_numTemporalItems, $scope.numberOfTemporalItems, $scope.parameterNumericMinValue_numTemporalItems, $scope.parameterNumericMaxValue_numTemporalItems); + kommonitorScriptHelperService.addScriptParameter($scope.parameterName_temporalOption, $scope.parameterDescription_temporalOption, $scope.parameterDataType, $scope.temporalOption.apiName, $scope.parameterNumericMinValue_temporalOption, $scope.parameterNumericMaxValue_temporalOption); + }; + + $scope.resetComputationFormulaAndLegend = function(){ + kommonitorScriptHelperService.scriptFormulaHTML = ""; + + if (! $scope.compIndicatorSelection){ + return; + } + + var formulaHTML = "Berechnung gemäß Formel
$$ T = 100 \\times \\frac{b}{B_{1}} $$ wobei $$ b = \\frac{\\sum_{n=1}^{m}((A_{n} - \\bar{A}) \\times (B_{n} - \\bar{B}))}{\\sum_{n=1}^{m} (A_{n} - \\bar{A})^2} $$"; + var legendItemsHTML = "Legende zur Formel"; + + legendItemsHTML+="
$T$: Trend"; + legendItemsHTML+="
$m$ = " + $scope.numberOfTemporalItems + " konsekutive vergangene " + $scope.temporalOption.displayName; + legendItemsHTML+="
$A_{n}$ = aufeinander folgende " + $scope.temporalOption.displayName; + legendItemsHTML+="
$\\bar{A}$ = arithmetisches Mittel der aufeinander folgenden " + $scope.temporalOption.displayName; + legendItemsHTML+="
$B_{n}$ = Indikatorenwerte der aufeinander folgenden " + $scope.temporalOption.displayName; + legendItemsHTML+="
$\\bar{B}$ = arithmetisches Mittel der Indikatorenwerte der aufeinander folgenden " + $scope.temporalOption.displayName; + legendItemsHTML+="
$B$ = Indikator '" + $scope.compIndicatorSelection.indicatorName + " [" + $scope.compIndicatorSelection.unit + "]" + "'"; + + kommonitorScriptHelperService.scriptFormulaHTML = formulaHTML + "

" + legendItemsHTML; + + }; + + } + ] +}); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/trend/script-trend.module.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/trend/script-trend.module.js index 771db93a0..e9ea07748 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/trend/script-trend.module.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/trend/script-trend.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('scriptTrend', ['kommonitorDataExchange', 'kommonitorScriptHelper']); +//# sourceMappingURL=script-trend.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/trend/script-trend.module.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/trend/script-trend.module.js.map new file mode 100644 index 000000000..2a6affb8f --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/trend/script-trend.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-trend.module.js","sourceRoot":"","sources":["script-trend.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC,wBAAwB,EAAE,wBAAwB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/trend/script-trend.module.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/trend/script-trend.module.ts new file mode 100644 index 000000000..771db93a0 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptAddModal/scriptDefinition/trend/script-trend.module.ts @@ -0,0 +1 @@ +angular.module('scriptTrend', ['kommonitorDataExchange', 'kommonitorScriptHelper']); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptDeleteModal/script-delete-modal.component.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptDeleteModal/script-delete-modal.component.js index 76be3f5f6..95fef3411 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptDeleteModal/script-delete-modal.component.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptDeleteModal/script-delete-modal.component.js @@ -1,124 +1,92 @@ +"use strict"; angular.module('scriptDeleteModal').component('scriptDeleteModal', { - templateUrl : "components/kommonitorAdmin/adminScriptManagement/scriptDeleteModal/script-delete-modal.template.html", - controller : ['kommonitorDataExchangeService', 'kommonitorScriptHelperService','$scope', '$rootScope', '$http', '__env', '$q', '$timeout', function ScriptDeleteModalController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $q, $timeout) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; - - $scope.datasetsToDelete = []; - - $scope.loadingData = false; - - $scope.successfullyDeletedDatasets = []; - $scope.failedDatasetsAndErrors = []; - - $scope.$on("onDeleteScripts", function (event, datasets) { - - $scope.datasetsToDelete = datasets; - - $scope.resetScriptsDeleteForm(); - - }); - - - $scope.resetScriptsDeleteForm = function(){ - - $scope.successfullyDeletedDatasets = []; - $scope.failedDatasetsAndErrors = []; - $("#scriptsDeleteSuccessAlert").hide(); - $("#scriptsDeleteErrorAlert").hide(); - }; - - $scope.deleteScripts = function(){ - - // TODO verify input - - // TODO Create and perform POST Request with loading screen - - $scope.loadingData = true; - - var deletePromises = []; - - $scope.datasetsToDelete.forEach(function(dataset){ - deletePromises.push($scope.getDeleteDatasetPromise(dataset)); - }); - - $q.all(deletePromises).then(async function successCallback(successArray) { - // - - if($scope.failedDatasetsAndErrors.length > 0){ - // error handling - $("#scriptsDeleteErrorAlert").show(); - // if ($scope.successfullyDeletedDatasets.length > 0){ - // $("#scriptsDeleteSuccessAlert").show(); - // } - } - if($scope.successfullyDeletedDatasets.length > 0){ - $("#scriptsDeleteSuccessAlert").show(); - - // refresh script overview table - $rootScope.$broadcast("refreshScriptOverviewTable", "delete", $scope.successfullyDeletedDatasets.map(dataset => dataset.scriptId)); - - // refresh all admin dashboard diagrams due to modified metadata - $rootScope.$broadcast("refreshAdminDashboardDiagrams"); - } - - $timeout(function(){ - - $scope.loadingData = false; - }); - }, function errorCallback(errorArray) { - - $("#scriptsDeleteErrorAlert").show(); - // if ($scope.successfullyDeletedDatasets.length > 0){ - // $("#scriptsDeleteSuccessAlert").show(); - // } - - $rootScope.$broadcast("refreshScriptOverviewTable"); - $scope.loadingData = false; - }); - - }; - - $scope.getDeleteDatasetPromise = function(dataset){ - return $http({ - url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/process-scripts/" + dataset.scriptId, - method: "DELETE" - }).then(function successCallback(response) { - $scope.successfullyDeletedDatasets.push(dataset); - - // remove entry from array - var index = -1; - - for(var i=0; i< kommonitorDataExchangeService.availableProcessScripts.length; i++){ - if(kommonitorDataExchangeService.availableProcessScripts[i].scriptId === dataset.scriptId){ - index = i; - break; - } - } - - if (index > -1) { - kommonitorDataExchangeService.availableProcessScripts.splice(index, 1); - } - - }, function errorCallback(error) { - if(error.data){ - $scope.failedDatasetsAndErrors.push([dataset, kommonitorDataExchangeService.syntaxHighlightJSON(error.data)]); - } - else{ - $scope.failedDatasetsAndErrors.push([dataset, kommonitorDataExchangeService.syntaxHighlightJSON(error)]); - } - - }); - }; - - $scope.hideSuccessAlert = function(){ - $("#scriptsDeleteSuccessAlert").hide(); - }; - - $scope.hideErrorAlert = function(){ - $("#scriptsDeleteErrorAlert").hide(); - }; - - } -]}); + templateUrl: "components/kommonitorAdmin/adminScriptManagement/scriptDeleteModal/script-delete-modal.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorScriptHelperService', '$scope', '$rootScope', '$http', '__env', '$q', '$timeout', function ScriptDeleteModalController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $q, $timeout) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + $scope.datasetsToDelete = []; + $scope.loadingData = false; + $scope.successfullyDeletedDatasets = []; + $scope.failedDatasetsAndErrors = []; + $scope.$on("onDeleteScripts", function (event, datasets) { + $scope.datasetsToDelete = datasets; + $scope.resetScriptsDeleteForm(); + }); + $scope.resetScriptsDeleteForm = function () { + $scope.successfullyDeletedDatasets = []; + $scope.failedDatasetsAndErrors = []; + $("#scriptsDeleteSuccessAlert").hide(); + $("#scriptsDeleteErrorAlert").hide(); + }; + $scope.deleteScripts = function () { + // TODO verify input + // TODO Create and perform POST Request with loading screen + $scope.loadingData = true; + var deletePromises = []; + $scope.datasetsToDelete.forEach(function (dataset) { + deletePromises.push($scope.getDeleteDatasetPromise(dataset)); + }); + $q.all(deletePromises).then(async function successCallback(successArray) { + // + if ($scope.failedDatasetsAndErrors.length > 0) { + // error handling + $("#scriptsDeleteErrorAlert").show(); + // if ($scope.successfullyDeletedDatasets.length > 0){ + // $("#scriptsDeleteSuccessAlert").show(); + // } + } + if ($scope.successfullyDeletedDatasets.length > 0) { + $("#scriptsDeleteSuccessAlert").show(); + // refresh script overview table + $rootScope.$broadcast("refreshScriptOverviewTable", "delete", $scope.successfullyDeletedDatasets.map(dataset => dataset.scriptId)); + // refresh all admin dashboard diagrams due to modified metadata + $rootScope.$broadcast("refreshAdminDashboardDiagrams"); + } + $timeout(function () { + $scope.loadingData = false; + }); + }, function errorCallback(errorArray) { + $("#scriptsDeleteErrorAlert").show(); + // if ($scope.successfullyDeletedDatasets.length > 0){ + // $("#scriptsDeleteSuccessAlert").show(); + // } + $rootScope.$broadcast("refreshScriptOverviewTable"); + $scope.loadingData = false; + }); + }; + $scope.getDeleteDatasetPromise = function (dataset) { + return $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/process-scripts/" + dataset.scriptId, + method: "DELETE" + }).then(function successCallback(response) { + $scope.successfullyDeletedDatasets.push(dataset); + // remove entry from array + var index = -1; + for (var i = 0; i < kommonitorDataExchangeService.availableProcessScripts.length; i++) { + if (kommonitorDataExchangeService.availableProcessScripts[i].scriptId === dataset.scriptId) { + index = i; + break; + } + } + if (index > -1) { + kommonitorDataExchangeService.availableProcessScripts.splice(index, 1); + } + }, function errorCallback(error) { + if (error.data) { + $scope.failedDatasetsAndErrors.push([dataset, kommonitorDataExchangeService.syntaxHighlightJSON(error.data)]); + } + else { + $scope.failedDatasetsAndErrors.push([dataset, kommonitorDataExchangeService.syntaxHighlightJSON(error)]); + } + }); + }; + $scope.hideSuccessAlert = function () { + $("#scriptsDeleteSuccessAlert").hide(); + }; + $scope.hideErrorAlert = function () { + $("#scriptsDeleteErrorAlert").hide(); + }; + } + ] +}); +//# sourceMappingURL=script-delete-modal.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptDeleteModal/script-delete-modal.component.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptDeleteModal/script-delete-modal.component.js.map new file mode 100644 index 000000000..8b669da8d --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptDeleteModal/script-delete-modal.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-delete-modal.component.js","sourceRoot":"","sources":["script-delete-modal.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,SAAS,CAAC,mBAAmB,EAAE;IAClE,WAAW,EAAG,sGAAsG;IACpH,UAAU,EAAG,CAAC,+BAA+B,EAAE,+BAA+B,EAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,2BAA2B,CAAC,6BAA6B,EAAE,6BAA6B,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ;YAE3R,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAC3E,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAE3E,MAAM,CAAC,gBAAgB,GAAG,EAAE,CAAC;YAE7B,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;YAE3B,MAAM,CAAC,2BAA2B,GAAG,EAAE,CAAC;YACxC,MAAM,CAAC,uBAAuB,GAAG,EAAE,CAAC;YAEpC,MAAM,CAAC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6B,CAAC,uBAAuB,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;qBACxE;gBAEH,CAAC,EAAE,SAAS,aAAa,CAAC,KAAK;oBAC9B,IAAG,KAAK,CAAC,IAAI,EAAC;wBACb,MAAM,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,6BAA6B,CAAC,mBAAmB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;qBAC9G;yBACG;wBACH,MAAM,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,6BAA6B,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;qBACzG;gBAEH,CAAC,CAAC,CAAC;YACJ,CAAC,CAAC;YAEF,MAAM,CAAC,gBAAgB,GAAG;gBACzB,CAAC,CAAC,4BAA4B,CAAC,CAAC,IAAI,EAAE,CAAC;YACxC,CAAC,CAAC;YAEF,MAAM,CAAC,cAAc,GAAG;gBACvB,CAAC,CAAC,0BAA0B,CAAC,CAAC,IAAI,EAAE,CAAC;YACtC,CAAC,CAAC;QAEJ,CAAC;KACD;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptDeleteModal/script-delete-modal.component.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptDeleteModal/script-delete-modal.component.ts new file mode 100644 index 000000000..76be3f5f6 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptDeleteModal/script-delete-modal.component.ts @@ -0,0 +1,124 @@ +angular.module('scriptDeleteModal').component('scriptDeleteModal', { + templateUrl : "components/kommonitorAdmin/adminScriptManagement/scriptDeleteModal/script-delete-modal.template.html", + controller : ['kommonitorDataExchangeService', 'kommonitorScriptHelperService','$scope', '$rootScope', '$http', '__env', '$q', '$timeout', function ScriptDeleteModalController(kommonitorDataExchangeService, kommonitorScriptHelperService, $scope, $rootScope, $http, __env, $q, $timeout) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorScriptHelperServiceInstance = kommonitorScriptHelperService; + + $scope.datasetsToDelete = []; + + $scope.loadingData = false; + + $scope.successfullyDeletedDatasets = []; + $scope.failedDatasetsAndErrors = []; + + $scope.$on("onDeleteScripts", function (event, datasets) { + + $scope.datasetsToDelete = datasets; + + $scope.resetScriptsDeleteForm(); + + }); + + + $scope.resetScriptsDeleteForm = function(){ + + $scope.successfullyDeletedDatasets = []; + $scope.failedDatasetsAndErrors = []; + $("#scriptsDeleteSuccessAlert").hide(); + $("#scriptsDeleteErrorAlert").hide(); + }; + + $scope.deleteScripts = function(){ + + // TODO verify input + + // TODO Create and perform POST Request with loading screen + + $scope.loadingData = true; + + var deletePromises = []; + + $scope.datasetsToDelete.forEach(function(dataset){ + deletePromises.push($scope.getDeleteDatasetPromise(dataset)); + }); + + $q.all(deletePromises).then(async function successCallback(successArray) { + // + + if($scope.failedDatasetsAndErrors.length > 0){ + // error handling + $("#scriptsDeleteErrorAlert").show(); + // if ($scope.successfullyDeletedDatasets.length > 0){ + // $("#scriptsDeleteSuccessAlert").show(); + // } + } + if($scope.successfullyDeletedDatasets.length > 0){ + $("#scriptsDeleteSuccessAlert").show(); + + // refresh script overview table + $rootScope.$broadcast("refreshScriptOverviewTable", "delete", $scope.successfullyDeletedDatasets.map(dataset => dataset.scriptId)); + + // refresh all admin dashboard diagrams due to modified metadata + $rootScope.$broadcast("refreshAdminDashboardDiagrams"); + } + + $timeout(function(){ + + $scope.loadingData = false; + }); + }, function errorCallback(errorArray) { + + $("#scriptsDeleteErrorAlert").show(); + // if ($scope.successfullyDeletedDatasets.length > 0){ + // $("#scriptsDeleteSuccessAlert").show(); + // } + + $rootScope.$broadcast("refreshScriptOverviewTable"); + $scope.loadingData = false; + }); + + }; + + $scope.getDeleteDatasetPromise = function(dataset){ + return $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/process-scripts/" + dataset.scriptId, + method: "DELETE" + }).then(function successCallback(response) { + $scope.successfullyDeletedDatasets.push(dataset); + + // remove entry from array + var index = -1; + + for(var i=0; i< kommonitorDataExchangeService.availableProcessScripts.length; i++){ + if(kommonitorDataExchangeService.availableProcessScripts[i].scriptId === dataset.scriptId){ + index = i; + break; + } + } + + if (index > -1) { + kommonitorDataExchangeService.availableProcessScripts.splice(index, 1); + } + + }, function errorCallback(error) { + if(error.data){ + $scope.failedDatasetsAndErrors.push([dataset, kommonitorDataExchangeService.syntaxHighlightJSON(error.data)]); + } + else{ + $scope.failedDatasetsAndErrors.push([dataset, kommonitorDataExchangeService.syntaxHighlightJSON(error)]); + } + + }); + }; + + $scope.hideSuccessAlert = function(){ + $("#scriptsDeleteSuccessAlert").hide(); + }; + + $scope.hideErrorAlert = function(){ + $("#scriptsDeleteErrorAlert").hide(); + }; + + } +]}); diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptDeleteModal/script-delete-modal.module.js b/app/components/kommonitorAdmin/adminScriptManagement/scriptDeleteModal/script-delete-modal.module.js index 6008923b4..ad17d3978 100644 --- a/app/components/kommonitorAdmin/adminScriptManagement/scriptDeleteModal/script-delete-modal.module.js +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptDeleteModal/script-delete-modal.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('scriptDeleteModal', []); +//# sourceMappingURL=script-delete-modal.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptDeleteModal/script-delete-modal.module.js.map b/app/components/kommonitorAdmin/adminScriptManagement/scriptDeleteModal/script-delete-modal.module.js.map new file mode 100644 index 000000000..dcabeb6e9 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptDeleteModal/script-delete-modal.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"script-delete-modal.module.js","sourceRoot":"","sources":["script-delete-modal.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminScriptManagement/scriptDeleteModal/script-delete-modal.module.ts b/app/components/kommonitorAdmin/adminScriptManagement/scriptDeleteModal/script-delete-modal.module.ts new file mode 100644 index 000000000..6008923b4 --- /dev/null +++ b/app/components/kommonitorAdmin/adminScriptManagement/scriptDeleteModal/script-delete-modal.module.ts @@ -0,0 +1 @@ +angular.module('scriptDeleteModal', []); diff --git a/app/components/kommonitorAdmin/adminSpatialUnitsManagement/admin-spatial-units-management.component.js b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/admin-spatial-units-management.component.js index 77c421b0a..b12209470 100644 --- a/app/components/kommonitorAdmin/adminSpatialUnitsManagement/admin-spatial-units-management.component.js +++ b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/admin-spatial-units-management.component.js @@ -1,164 +1,114 @@ +"use strict"; angular.module('adminSpatialUnitsManagement').component('adminSpatialUnitsManagement', { - templateUrl : "components/kommonitorAdmin/adminSpatialUnitsManagement/admin-spatial-units-management.template.html", - controller : ['kommonitorDataExchangeService', 'kommonitorCacheHelperService', 'kommonitorDataGridHelperService', '$scope', '$timeout', '$rootScope', '__env', '$http', - function SpatialUnitsManagementController(kommonitorDataExchangeService, kommonitorCacheHelperService, kommonitorDataGridHelperService, $scope, $timeout, $rootScope, __env, $http) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - $scope.loadingData = true; - - $scope.$on("initialMetadataLoadingCompleted", function (event) { - - - $timeout(function(){ - - $scope.initializeOrRefreshOverviewTable(); - }, 250); - - }); - - $scope.$on("initialMetadataLoadingFailed", function (event, errorArray) { - - $scope.loadingData = false; - - }); - - $scope.initializeOrRefreshOverviewTable = function(){ - $scope.loadingData = true; - - kommonitorDataGridHelperService.buildDataGrid_spatialUnits(kommonitorDataExchangeService.availableSpatialUnits); - - $timeout(function(){ - - $scope.loadingData = false; - }); - }; - - $scope.$on("refreshSpatialUnitOverviewTable", function (event, crudType, targetSpatialUnitId) { - $scope.loadingData = true; - $scope.refreshSpatialUnitOverviewTable(crudType, targetSpatialUnitId); - }); - - $scope.refreshSpatialUnitOverviewTable = function(crudType, targetSpatialUnitId){ - - if(! crudType || !targetSpatialUnitId){ - // refetch all metadata from spatial units to update table - kommonitorDataExchangeService.fetchSpatialUnitsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(response) { - - $scope.initializeOrRefreshOverviewTable(); - - $timeout(function(){ - - $scope.loadingData = false; - }); - - }, function errorCallback(response) { - - $timeout(function(){ - - $scope.loadingData = false; - }); - }); - } - else if(crudType && targetSpatialUnitId){ - if(crudType == "add"){ - kommonitorCacheHelperService.fetchSingleSpatialUnitMetadata(targetSpatialUnitId, kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(data) { - - kommonitorDataExchangeService.addSingleSpatialUnitMetadata(data); - - $scope.initializeOrRefreshOverviewTable(); - - $timeout(function(){ - - $scope.loadingData = false; - }); - - }, function errorCallback(response) { - - $timeout(function(){ - - $scope.loadingData = false; - }); - }); - } - else if(crudType == "edit"){ - kommonitorCacheHelperService.fetchSingleSpatialUnitMetadata(targetSpatialUnitId, kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(data) { - - kommonitorDataExchangeService.replaceSingleSpatialUnitMetadata(data); - - $scope.initializeOrRefreshOverviewTable(); - - $timeout(function(){ - - $scope.loadingData = false; - }); - - }, function errorCallback(response) { - - $timeout(function(){ - - $scope.loadingData = false; - }); - }); - } - else if(crudType == "delete"){ - // targetSpatialUnitId might be array in this case - if(targetSpatialUnitId && typeof targetSpatialUnitId == "string"){ - kommonitorDataExchangeService.deleteSingleSpatialUnitMetadata(targetSpatialUnitId); - - $scope.initializeOrRefreshOverviewTable(); - - $timeout(function(){ - - $scope.loadingData = false; - }); - } - - else if (targetSpatialUnitId && Array.isArray(targetSpatialUnitId)){ - for (const id of targetSpatialUnitId) { - kommonitorDataExchangeService.deleteSingleSpatialUnitMetadata(id); - } - $scope.initializeOrRefreshOverviewTable(); - - $timeout(function(){ - - $scope.loadingData = false; - }); - } - - } - } - - }; - - $scope.onChangeSelectDataset = function(spatialUnitDataset){ - console.log(spatialUnitDataset.spatialUnitLevel); - }; - - $scope.onClickDeleteDatasets = function(){ - $scope.loadingData = true; - - var markedEntriesForDeletion = kommonitorDataGridHelperService.getSelectedSpatialUnitsMetadata(); - - // submit selected spatial units to modal controller - $rootScope.$broadcast("onDeleteSpatialUnits", markedEntriesForDeletion); - - $timeout(function(){ - - $scope.loadingData = false; - }); - }; - - $scope.onClickEditMetadata = function(spatialUnitDataset){ - // submit selected spatial unit to modal controller - $rootScope.$broadcast("onEditSpatialUnitMetadata", spatialUnitDataset); - }; - - $scope.onClickEditFeatures = function(spatialUnitDataset){ - // submit selected spatial unit to modal controller - $rootScope.$broadcast("onEditSpatialUnitFeatures", spatialUnitDataset); - }; - } -]}); + templateUrl: "components/kommonitorAdmin/adminSpatialUnitsManagement/admin-spatial-units-management.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorCacheHelperService', 'kommonitorDataGridHelperService', '$scope', '$timeout', '$rootScope', '__env', '$http', + function SpatialUnitsManagementController(kommonitorDataExchangeService, kommonitorCacheHelperService, kommonitorDataGridHelperService, $scope, $timeout, $rootScope, __env, $http) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + $scope.loadingData = true; + $scope.$on("initialMetadataLoadingCompleted", function (event) { + $timeout(function () { + $scope.initializeOrRefreshOverviewTable(); + }, 250); + }); + $scope.$on("initialMetadataLoadingFailed", function (event, errorArray) { + $scope.loadingData = false; + }); + $scope.initializeOrRefreshOverviewTable = function () { + $scope.loadingData = true; + kommonitorDataGridHelperService.buildDataGrid_spatialUnits(kommonitorDataExchangeService.availableSpatialUnits); + $timeout(function () { + $scope.loadingData = false; + }); + }; + $scope.$on("refreshSpatialUnitOverviewTable", function (event, crudType, targetSpatialUnitId) { + $scope.loadingData = true; + $scope.refreshSpatialUnitOverviewTable(crudType, targetSpatialUnitId); + }); + $scope.refreshSpatialUnitOverviewTable = function (crudType, targetSpatialUnitId) { + if (!crudType || !targetSpatialUnitId) { + // refetch all metadata from spatial units to update table + kommonitorDataExchangeService.fetchSpatialUnitsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(response) { + $scope.initializeOrRefreshOverviewTable(); + $timeout(function () { + $scope.loadingData = false; + }); + }, function errorCallback(response) { + $timeout(function () { + $scope.loadingData = false; + }); + }); + } + else if (crudType && targetSpatialUnitId) { + if (crudType == "add") { + kommonitorCacheHelperService.fetchSingleSpatialUnitMetadata(targetSpatialUnitId, kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(data) { + kommonitorDataExchangeService.addSingleSpatialUnitMetadata(data); + $scope.initializeOrRefreshOverviewTable(); + $timeout(function () { + $scope.loadingData = false; + }); + }, function errorCallback(response) { + $timeout(function () { + $scope.loadingData = false; + }); + }); + } + else if (crudType == "edit") { + kommonitorCacheHelperService.fetchSingleSpatialUnitMetadata(targetSpatialUnitId, kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(data) { + kommonitorDataExchangeService.replaceSingleSpatialUnitMetadata(data); + $scope.initializeOrRefreshOverviewTable(); + $timeout(function () { + $scope.loadingData = false; + }); + }, function errorCallback(response) { + $timeout(function () { + $scope.loadingData = false; + }); + }); + } + else if (crudType == "delete") { + // targetSpatialUnitId might be array in this case + if (targetSpatialUnitId && typeof targetSpatialUnitId == "string") { + kommonitorDataExchangeService.deleteSingleSpatialUnitMetadata(targetSpatialUnitId); + $scope.initializeOrRefreshOverviewTable(); + $timeout(function () { + $scope.loadingData = false; + }); + } + else if (targetSpatialUnitId && Array.isArray(targetSpatialUnitId)) { + for (const id of targetSpatialUnitId) { + kommonitorDataExchangeService.deleteSingleSpatialUnitMetadata(id); + } + $scope.initializeOrRefreshOverviewTable(); + $timeout(function () { + $scope.loadingData = false; + }); + } + } + } + }; + $scope.onChangeSelectDataset = function (spatialUnitDataset) { + console.log(spatialUnitDataset.spatialUnitLevel); + }; + $scope.onClickDeleteDatasets = function () { + $scope.loadingData = true; + var markedEntriesForDeletion = kommonitorDataGridHelperService.getSelectedSpatialUnitsMetadata(); + // submit selected spatial units to modal controller + $rootScope.$broadcast("onDeleteSpatialUnits", markedEntriesForDeletion); + $timeout(function () { + $scope.loadingData = false; + }); + }; + $scope.onClickEditMetadata = function (spatialUnitDataset) { + // submit selected spatial unit to modal controller + $rootScope.$broadcast("onEditSpatialUnitMetadata", spatialUnitDataset); + }; + $scope.onClickEditFeatures = function (spatialUnitDataset) { + // submit selected spatial unit to modal controller + $rootScope.$broadcast("onEditSpatialUnitFeatures", spatialUnitDataset); + }; + } + ] +}); +//# sourceMappingURL=admin-spatial-units-management.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminSpatialUnitsManagement/admin-spatial-units-management.component.js.map b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/admin-spatial-units-management.component.js.map new file mode 100644 index 000000000..088547aa3 --- /dev/null +++ b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/admin-spatial-units-management.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"admin-spatial-units-management.component.js","sourceRoot":"","sources":["admin-spatial-units-management.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,CAAC,SAAS,CAAC,6BAA6B,EAAE;IACtF,WAAW,EAAG,qGAAqG;IACnH,UAAU,EAAG,CAAC,+BAA+B,EAAE,8BAA8B,EAAE,iCAAiC,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO;QACtK,SAAS,gCAAgC,CAAC,6BAA6B,EAAE,4BAA4B,EAAE,+BAA+B,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK;YAEjL,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;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,CAAC,UAAU,CAAC,2BAA2B,EAAE,kBAAkB,CAAC,CAAC;YACxE,CAAC,CAAC;YAEF,MAAM,CAAC,mBAAmB,GAAG,UAAS,kBAAkB;gBACvD,mDAAmD;gBACnD,UAAU,CAAC,UAAU,CAAC,2BAA2B,EAAE,kBAAkB,CAAC,CAAC;YACxE,CAAC,CAAC;QACH,CAAC;KACD;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminSpatialUnitsManagement/admin-spatial-units-management.component.ts b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/admin-spatial-units-management.component.ts new file mode 100644 index 000000000..77c421b0a --- /dev/null +++ b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/admin-spatial-units-management.component.ts @@ -0,0 +1,164 @@ +angular.module('adminSpatialUnitsManagement').component('adminSpatialUnitsManagement', { + templateUrl : "components/kommonitorAdmin/adminSpatialUnitsManagement/admin-spatial-units-management.template.html", + controller : ['kommonitorDataExchangeService', 'kommonitorCacheHelperService', 'kommonitorDataGridHelperService', '$scope', '$timeout', '$rootScope', '__env', '$http', + function SpatialUnitsManagementController(kommonitorDataExchangeService, kommonitorCacheHelperService, kommonitorDataGridHelperService, $scope, $timeout, $rootScope, __env, $http) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + $scope.loadingData = true; + + $scope.$on("initialMetadataLoadingCompleted", function (event) { + + + $timeout(function(){ + + $scope.initializeOrRefreshOverviewTable(); + }, 250); + + }); + + $scope.$on("initialMetadataLoadingFailed", function (event, errorArray) { + + $scope.loadingData = false; + + }); + + $scope.initializeOrRefreshOverviewTable = function(){ + $scope.loadingData = true; + + kommonitorDataGridHelperService.buildDataGrid_spatialUnits(kommonitorDataExchangeService.availableSpatialUnits); + + $timeout(function(){ + + $scope.loadingData = false; + }); + }; + + $scope.$on("refreshSpatialUnitOverviewTable", function (event, crudType, targetSpatialUnitId) { + $scope.loadingData = true; + $scope.refreshSpatialUnitOverviewTable(crudType, targetSpatialUnitId); + }); + + $scope.refreshSpatialUnitOverviewTable = function(crudType, targetSpatialUnitId){ + + if(! crudType || !targetSpatialUnitId){ + // refetch all metadata from spatial units to update table + kommonitorDataExchangeService.fetchSpatialUnitsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(response) { + + $scope.initializeOrRefreshOverviewTable(); + + $timeout(function(){ + + $scope.loadingData = false; + }); + + }, function errorCallback(response) { + + $timeout(function(){ + + $scope.loadingData = false; + }); + }); + } + else if(crudType && targetSpatialUnitId){ + if(crudType == "add"){ + kommonitorCacheHelperService.fetchSingleSpatialUnitMetadata(targetSpatialUnitId, kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(data) { + + kommonitorDataExchangeService.addSingleSpatialUnitMetadata(data); + + $scope.initializeOrRefreshOverviewTable(); + + $timeout(function(){ + + $scope.loadingData = false; + }); + + }, function errorCallback(response) { + + $timeout(function(){ + + $scope.loadingData = false; + }); + }); + } + else if(crudType == "edit"){ + kommonitorCacheHelperService.fetchSingleSpatialUnitMetadata(targetSpatialUnitId, kommonitorDataExchangeService.currentKeycloakLoginRoles).then(function successCallback(data) { + + kommonitorDataExchangeService.replaceSingleSpatialUnitMetadata(data); + + $scope.initializeOrRefreshOverviewTable(); + + $timeout(function(){ + + $scope.loadingData = false; + }); + + }, function errorCallback(response) { + + $timeout(function(){ + + $scope.loadingData = false; + }); + }); + } + else if(crudType == "delete"){ + // targetSpatialUnitId might be array in this case + if(targetSpatialUnitId && typeof targetSpatialUnitId == "string"){ + kommonitorDataExchangeService.deleteSingleSpatialUnitMetadata(targetSpatialUnitId); + + $scope.initializeOrRefreshOverviewTable(); + + $timeout(function(){ + + $scope.loadingData = false; + }); + } + + else if (targetSpatialUnitId && Array.isArray(targetSpatialUnitId)){ + for (const id of targetSpatialUnitId) { + kommonitorDataExchangeService.deleteSingleSpatialUnitMetadata(id); + } + $scope.initializeOrRefreshOverviewTable(); + + $timeout(function(){ + + $scope.loadingData = false; + }); + } + + } + } + + }; + + $scope.onChangeSelectDataset = function(spatialUnitDataset){ + console.log(spatialUnitDataset.spatialUnitLevel); + }; + + $scope.onClickDeleteDatasets = function(){ + $scope.loadingData = true; + + var markedEntriesForDeletion = kommonitorDataGridHelperService.getSelectedSpatialUnitsMetadata(); + + // submit selected spatial units to modal controller + $rootScope.$broadcast("onDeleteSpatialUnits", markedEntriesForDeletion); + + $timeout(function(){ + + $scope.loadingData = false; + }); + }; + + $scope.onClickEditMetadata = function(spatialUnitDataset){ + // submit selected spatial unit to modal controller + $rootScope.$broadcast("onEditSpatialUnitMetadata", spatialUnitDataset); + }; + + $scope.onClickEditFeatures = function(spatialUnitDataset){ + // submit selected spatial unit to modal controller + $rootScope.$broadcast("onEditSpatialUnitFeatures", spatialUnitDataset); + }; + } +]}); diff --git a/app/components/kommonitorAdmin/adminSpatialUnitsManagement/admin-spatial-units-management.module.js b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/admin-spatial-units-management.module.js index f51f6ab05..bf87c599d 100644 --- a/app/components/kommonitorAdmin/adminSpatialUnitsManagement/admin-spatial-units-management.module.js +++ b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/admin-spatial-units-management.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('adminSpatialUnitsManagement', ['kommonitorDataExchange', 'kommonitorCacheHelper', 'kommonitorDataGridHelper']); +//# sourceMappingURL=admin-spatial-units-management.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminSpatialUnitsManagement/admin-spatial-units-management.module.js.map b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/admin-spatial-units-management.module.js.map new file mode 100644 index 000000000..6e55fef47 --- /dev/null +++ b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/admin-spatial-units-management.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"admin-spatial-units-management.module.js","sourceRoot":"","sources":["admin-spatial-units-management.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,6BAA6B,EAAE,CAAC,wBAAwB,EAAE,uBAAuB,EAAE,0BAA0B,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminSpatialUnitsManagement/admin-spatial-units-management.module.ts b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/admin-spatial-units-management.module.ts new file mode 100644 index 000000000..f51f6ab05 --- /dev/null +++ b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/admin-spatial-units-management.module.ts @@ -0,0 +1 @@ +angular.module('adminSpatialUnitsManagement', ['kommonitorDataExchange', 'kommonitorCacheHelper', 'kommonitorDataGridHelper']); diff --git a/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitAddModal/spatial-unit-add-modal.component.js b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitAddModal/spatial-unit-add-modal.component.js index a12a12da1..3651eb18d 100644 --- a/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitAddModal/spatial-unit-add-modal.component.js +++ b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitAddModal/spatial-unit-add-modal.component.js @@ -1,864 +1,686 @@ +"use strict"; angular.module('spatialUnitAddModal').component('spatialUnitAddModal', { - templateUrl : "components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitAddModal/spatial-unit-add-modal.template.html", - controller : ['kommonitorDataExchangeService', 'kommonitorImporterHelperService', '$scope', '$rootScope', - '$timeout', '$http', '__env', 'kommonitorMultiStepFormHelperService', 'kommonitorDataGridHelperService', - function SpatialUnitAddModalController(kommonitorDataExchangeService, kommonitorImporterHelperService, - $scope, $rootScope, $timeout, $http, __env, kommonitorMultiStepFormHelperService, kommonitorDataGridHelperService) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorImporterHelperServiceInstance = kommonitorImporterHelperService; - - /* POST BODY - { - "geoJsonString": "geoJsonString", - "metadata": { - "note": "note", - "literature": "literature", - "updateInterval": "ARBITRARY", - "sridEPSG": 0.8008281904610115, - "datasource": "datasource", - "contact": "contact", - "lastUpdate": "2000-01-23", - "description": "description", - "databasis": "databasis" - }, - "jsonSchema": "jsonSchema", - "nextLowerHierarchyLevel": "nextLowerHierarchyLevel", - "spatialUnitLevel": "spatialUnitLevel", - "periodOfValidity": { - "endDate": "2000-01-23", - "startDate": "2000-01-23" - }, - "nextUpperHierarchyLevel": "nextUpperHierarchyLevel" - } - */ - - //Date picker - $('#spatialUnitAddDatepickerStart').datepicker(kommonitorDataExchangeService.datePickerOptions); - $('#spatialUnitAddDatepickerEnd').datepicker(kommonitorDataExchangeService.datePickerOptions); - $('#spatialUnitAddLastUpdateDatepicker').datepicker(kommonitorDataExchangeService.datePickerOptions); - - $scope.loadingData = false; - - $scope.spatialUnitMetadataStructure = { - "metadata": { - "note": "an optional note", - "literature": "optional text about literature", - "updateInterval": "YEARLY|HALF_YEARLY|QUARTERLY|MONTHLY|ARBITRARY", - "sridEPSG": 4326, - "datasource": "text about data source", - "contact": "text about contact details", - "lastUpdate": "YYYY-MM-DD", - "description": "description about spatial unit dataset", - "databasis": "text about data basis", - }, - "allowedRoles": ['roleId'], - "nextLowerHierarchyLevel": "Name of lower hierarchy level", - "spatialUnitLevel": "Name of spatial unit dataset", - "nextUpperHierarchyLevel": "Name of upper hierarchy level" - }; - - $scope.spatialUnitMetadataStructure_pretty = kommonitorDataExchangeService.syntaxHighlightJSON($scope.spatialUnitMetadataStructure); - $scope.spatialUnitMappingConfigStructure_pretty = kommonitorDataExchangeService.syntaxHighlightJSON(kommonitorImporterHelperService.mappingConfigStructure); - - $scope.metadataImportSettings; - $scope.spatialUnitMetadataImportError; - $scope.spatialUnitMetadataImportErrorAlert; - $scope.spatialUnitMappingConfigImportError; - - $scope.spatialUnitLevel = undefined; - $scope.spatialUnitLevelInvalid = false; - - $scope.metadata = {}; - $scope.metadata.note = undefined; - $scope.metadata.literature = undefined; - $scope.metadata.updateInterval = undefined; - $scope.metadata.sridEPSG = 4326; - $scope.metadata.datasource = undefined; - $scope.metadata.databasis = undefined; - $scope.metadata.contact = undefined; - $scope.metadata.lastUpdate = undefined; - $scope.metadata.description = undefined; - - $scope.roleManagementTableOptions = undefined; - - $scope.$on("availableRolesUpdate", function (event) { - refreshRoles(); - }); - - // make sure that initial fetching of availableRoles has happened - $scope.$on("initialMetadataLoadingCompleted", function (event) { - refreshRoles(); - }); - - function refreshRoles() { - $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('spatialUnitAddRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, kommonitorDataExchangeService.getCurrentKomMonitorLoginRoleIds()); - } - - $scope.nextLowerHierarchySpatialUnit = undefined; - $scope.nextUpperHierarchySpatialUnit = undefined; - $scope.hierarchyInvalid = false; - - $scope.periodOfValidity = {}; - $scope.periodOfValidity.startDate = undefined; - $scope.periodOfValidity.endDate = undefined; - $scope.periodOfValidityInvalid = false; - - $scope.converter = undefined; - $scope.schema = undefined; - $scope.mimeType = undefined; - $scope.datasourceType = undefined; - $scope.spatialUnitDataSourceIdProperty = undefined; - $scope.spatialUnitDataSourceNameProperty = undefined; - - $scope.successMessagePart = undefined; - $scope.errorMessagePart = undefined; - $scope.importerErrors = undefined; - - $scope.converterDefinition = undefined; - $scope.datasourceTypeDefinition = undefined; - $scope.propertyMappingDefinition = undefined; - $scope.postBody_spatialUnits = undefined; - - $scope.attributeMapping_sourceAttributeName = undefined; - $scope.attributeMapping_destinationAttributeName = undefined; - $scope.attributeMapping_data = undefined; - $scope.attributeMapping_attributeType = kommonitorImporterHelperService.attributeMapping_attributeTypes[0]; - $scope.attributeMappings_adminView = []; - $scope.keepAttributes = true; - $scope.keepMissingValues = true; - - $scope.validityEndDate_perFeature = undefined; - $scope.validityStartDate_perFeature = undefined; - - - $scope.resetSpatialUnitAddForm = function(){ - $scope.importerErrors = undefined; - $scope.successMessagePart = undefined; - $scope.errorMessagePart = undefined; - - $scope.spatialUnitLevel = undefined; - $scope.spatialUnitLevelInvalid = false; - - $scope.metadata = {}; - $scope.metadata.note = undefined; - $scope.metadata.literature = undefined; - $scope.metadata.updateInterval = undefined; - $scope.metadata.sridEPSG = 4326; - $scope.metadata.datasource = undefined; - $scope.metadata.databasis = undefined; - $scope.metadata.contact = undefined; - $scope.metadata.lastUpdate = undefined; - $scope.metadata.description = undefined; - - $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('spatialUnitAddRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, kommonitorDataExchangeService.getCurrentKomMonitorLoginRoleIds()); - - $scope.nextLowerHierarchySpatialUnit = undefined; - $scope.nextUpperHierarchySpatialUnit = undefined; - $scope.hierarchyInvalid = false; - - $scope.periodOfValidity = {}; - $scope.periodOfValidity.startDate = undefined; - $scope.periodOfValidity.endDate = undefined; - $scope.periodOfValidityInvalid = false; - - $scope.converter = undefined; - $scope.schema = undefined; - $scope.mimeType = undefined; - $scope.datasourceType = undefined; - $scope.spatialUnitDataSourceIdProperty = undefined; - $scope.spatialUnitDataSourceNameProperty = undefined; - - $scope.converterDefinition = undefined; - $scope.datasourceTypeDefinition = undefined; - $scope.propertyMappingDefinition = undefined; - $scope.postBody_spatialUnits = undefined; - - $scope.attributeMapping_sourceAttributeName = undefined; - $scope.attributeMapping_destinationAttributeName = undefined; - $scope.attributeMapping_data = undefined; - $scope.attributeMapping_attributeType = kommonitorImporterHelperService.attributeMapping_attributeTypes[0]; - $scope.attributeMappings_adminView = []; - $scope.keepAttributes = true; - $scope.keepMissingValues = true; - - $scope.validityEndDate_perFeature = undefined; - $scope.validityStartDate_perFeature = undefined; - - setTimeout(() => { - $scope.$digest(); - }, 250); - }; - - $scope.checkSpatialUnitName = function(){ - $scope.spatialUnitLevelInvalid = false; - kommonitorDataExchangeService.availableSpatialUnits.forEach(function(spatialUnit){ - if (spatialUnit.spatialUnitLevel === $scope.spatialUnitLevel){ - $scope.spatialUnitLevelInvalid = true; - return; - } - }); - }; - - $scope.checkPeriodOfValidity = function(){ - $scope.periodOfValidityInvalid = false; - if ($scope.periodOfValidity.startDate && $scope.periodOfValidity.endDate){ - var startDate = new Date($scope.periodOfValidity.startDate); - var endDate = new Date($scope.periodOfValidity.endDate); - - if ((startDate === endDate) || startDate > endDate){ - // failure - $scope.periodOfValidityInvalid = true; - } - } - }; - - $scope.checkSpatialUnitHierarchy = function(){ - - $scope.hierarchyInvalid = false; - - // smaller indices represent higher spatial units - // i.e. city districts will have a smaller index than building blocks - if($scope.nextLowerHierarchySpatialUnit && $scope.nextUpperHierarchySpatialUnit){ - var indexOfLowerHierarchyUnit; - var indexOfUpperHierarchyUnit; - - for(var i=0; i { - $scope.$digest(); - }, 250); - }; - - $scope.onClickEditAttributeMapping = function(attributeMappingEntry){ - $scope.attributeMapping_sourceAttributeName = attributeMappingEntry.sourceName; - $scope.attributeMapping_destinationAttributeName = attributeMappingEntry.destinationName; - $scope.attributeMapping_attributeType = attributeMappingEntry.dataType; - - setTimeout(() => { - $scope.$digest(); - }, 250); - }; - - $scope.onClickDeleteAttributeMapping = function(attributeMappingEntry){ - for (let index = 0; index < $scope.attributeMappings_adminView.length; index++) { - - if ($scope.attributeMappings_adminView[index].sourceName === attributeMappingEntry.sourceName){ - // remove object - $scope.attributeMappings_adminView.splice(index, 1); - break; - } - } - - setTimeout(() => { - $scope.$digest(); - }, 250); - }; - - $scope.onChangeConverter = function(schema){ - $scope.schema = $scope.converter.schemas ? $scope.converter.schemas[0] : undefined; - $scope.mimeType = $scope.converter.mimeTypes[0]; - }; - - $scope.onChangeMimeType = function(mimeType){ - $scope.mimeType = mimeType; - }; - - $scope.buildImporterObjects = async function(){ - $scope.converterDefinition = $scope.buildConverterDefinition(); - $scope.datasourceTypeDefinition = await $scope.buildDatasourceTypeDefinition(); - $scope.propertyMappingDefinition = $scope.buildPropertyMappingDefinition(); - $scope.postBody_spatialUnits = $scope.buildPostBody_spatialUnits(); - - if(!$scope.converterDefinition || !$scope.datasourceTypeDefinition || !$scope.propertyMappingDefinition || !$scope.postBody_spatialUnits){ - return false; - } - - return true; - }; - - $scope.buildConverterDefinition = function(){ - - return kommonitorImporterHelperService.buildConverterDefinition($scope.converter, "converterParameter_spatialUnitAdd_", $scope.schema, $scope.mimeType); - }; - - $scope.buildDatasourceTypeDefinition = async function(){ - try { - return await kommonitorImporterHelperService.buildDatasourceTypeDefinition($scope.datasourceType, 'datasourceTypeParameter_spatialUnitAdd_', 'spatialUnitDataSourceInput'); - } catch (error) { - if(error.data){ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else{ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - - $("#spatialUnitAddErrorAlert").show(); - $scope.loadingData = false; - setTimeout(() => { - $scope.$digest(); - }, 250); - return null; - } - }; - - $scope.buildPropertyMappingDefinition = function(){ - // arsion from is undefined currently - return kommonitorImporterHelperService.buildPropertyMapping_spatialResource($scope.spatialUnitDataSourceNameProperty, $scope.spatialUnitDataSourceIdProperty, $scope.validityStartDate_perFeature, $scope.validityEndDate_perFeature, undefined, $scope.keepAttributes, $scope.keepMissingValues, $scope.attributeMappings_adminView); - }; - - $scope.buildPostBody_spatialUnits = function(){ - var postBody = - { - "geoJsonString": "", // will be set by importer - "metadata": { - "note": $scope.metadata.note, - "literature": $scope.metadata.literature, - "updateInterval": $scope.metadata.updateInterval.apiName, - "sridEPSG": $scope.metadata.sridEPSG, - "datasource": $scope.metadata.datasource, - "contact": $scope.metadata.contact, - "lastUpdate": $scope.metadata.lastUpdate, - "description": $scope.metadata.description, - "databasis": $scope.metadata.databasis - }, - "jsonSchema": undefined, - "allowedRoles": [], - "nextLowerHierarchyLevel": $scope.nextLowerHierarchySpatialUnit ? $scope.nextLowerHierarchySpatialUnit.spatialUnitLevel : undefined, - "spatialUnitLevel": $scope.spatialUnitLevel, - "periodOfValidity": { - "endDate": $scope.periodOfValidity.endDate, - "startDate": $scope.periodOfValidity.startDate - }, - "nextUpperHierarchyLevel": $scope.nextUpperHierarchySpatialUnit ? $scope.nextUpperHierarchySpatialUnit.spatialUnitLevel : undefined - }; - - let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); - for (const roleId of roleIds) { - postBody.allowedRoles.push(roleId); - } - - return postBody; - }; - - $scope.addSpatialUnit = async function () { - - $timeout(function(){ - $scope.loadingData = true; - }); - - $scope.importerErrors = undefined; - $scope.successMessagePart = undefined; - $scope.errorMessagePart = undefined; - - /* - now collect data and build request for importer - */ - - /* - if any required importer data is missing --> cancel request and highlight required errors - */ - var allDataSpecified = await $scope.buildImporterObjects(); - - if (!allDataSpecified) { - - $("#spatialUnitAddForm").validator("update"); - $("#spatialUnitAddForm").validator("validate"); - return; - } - else { - - - // TODO verify input - - // TODO Create and perform POST Request with loading screen - - var newSpatialUnitResponse_dryRun = undefined; - try { - newSpatialUnitResponse_dryRun = await kommonitorImporterHelperService.registerNewSpatialUnit($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.postBody_spatialUnits, true); - - if(! kommonitorImporterHelperService.importerResponseContainsErrors(newSpatialUnitResponse_dryRun)){ - // all good, really execute the request to import data against data management API - var newSpatialUnitResponse = await kommonitorImporterHelperService.registerNewSpatialUnit($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.postBody_spatialUnits, false); - - $rootScope.$broadcast("refreshSpatialUnitOverviewTable", "add", kommonitorImporterHelperService.getIdFromImporterResponse(newSpatialUnitResponse)); - - // refresh all admin dashboard diagrams due to modified metadata - $timeout(function(){ - $rootScope.$broadcast("refreshAdminDashboardDiagrams"); - }, 500); - - - $scope.successMessagePart = $scope.postBody_spatialUnits.spatialUnitLevel; - $scope.importedFeatures = kommonitorImporterHelperService.getImportedFeaturesFromImporterResponse(newSpatialUnitResponse); - - $("#spatialUnitAddSucessAlert").show(); - $scope.loadingData = false; - - setTimeout(() => { - $scope.$digest(); - }, 250); - } - else{ - // errors ocurred - // show them - $scope.errorMessagePart = "Einige der zu importierenden Features des Datensatzes weisen kritische Fehler auf"; - $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(newSpatialUnitResponse_dryRun); - - $("#spatialUnitAddErrorAlert").show(); - $scope.loadingData = false; - - setTimeout(() => { - $scope.$digest(); - }, 250); - - } - } catch (error) { - if(error.data){ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else{ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - - if(newSpatialUnitResponse_dryRun){ - $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(newSpatialUnitResponse_dryRun); - } - - $("#spatialUnitAddErrorAlert").show(); - $scope.loadingData = false; - - setTimeout(() => { - $scope.$digest(); - }, 250); - } - } - - }; - - $scope.onImportSpatialUnitAddMetadata = function(){ - - $scope.spatialUnitMetadataImportError = ""; - - $("#spatialUnitMetadataImportFile").files = []; - - // trigger file chooser - $("#spatialUnitMetadataImportFile").click(); - - }; - - $(document).on("change", "#spatialUnitMetadataImportFile" ,function(){ - - console.log("Importing SpatialUnit metadata for Add SpatialUnit Form"); - - // get the file - var file = document.getElementById('spatialUnitMetadataImportFile').files[0]; - $scope.parseMetadataFromFile(file); - }); - - $scope.parseMetadataFromFile = function(file){ - var fileReader = new FileReader(); - - fileReader.onload = function(event) { - - try{ - $scope.parseFromMetadataFile(event); - } - catch(error){ - console.error(error); - console.error("Uploaded Metadata File cannot be parsed."); - $scope.spatialUnitMetadataImportError = "Uploaded Metadata File cannot be parsed correctly"; - document.getElementById("spatialUnitsAddMetadataPre").innerHTML = $scope.spatialUnitMetadataStructure_pretty; - $("#spatialUnitMetadataImportErrorAlert").show(); - - $scope.$digest(); - } - - }; - - // Read in the image file as a data URL. - fileReader.readAsText(file); - }; - - $scope.parseFromMetadataFile = function(event){ - // $scope.geoJsonString = event.target.result; - $scope.metadataImportSettings = JSON.parse(event.target.result); - - if(! $scope.metadataImportSettings.metadata){ - console.error("uploaded Metadata File cannot be parsed - wrong structure."); - $scope.spatialUnitMetadataImportError = "Struktur der Datei stimmt nicht mit erwartetem Muster überein."; - document.getElementById("spatialUnitsAddMetadataPre").innerHTML = $scope.spatialUnitMetadataStructure_pretty; - $("#spatialUnitMetadataImportErrorAlert").show(); - - $scope.$digest(); - } - - $scope.metadata = {}; - $scope.metadata.note = $scope.metadataImportSettings.metadata.note; - $scope.metadata.literature = $scope.metadataImportSettings.metadata.literature; - kommonitorDataExchangeService.updateIntervalOptions.forEach(function(option){ - if(option.apiName === $scope.metadataImportSettings.metadata.updateInterval){ - $scope.metadata.updateInterval = option; - } - }); - $scope.metadata.sridEPSG = $scope.metadataImportSettings.metadata.sridEPSG; - $scope.metadata.datasource = $scope.metadataImportSettings.metadata.datasource; - $scope.metadata.contact = $scope.metadataImportSettings.metadata.contact; - $scope.metadata.lastUpdate = $scope.metadataImportSettings.metadata.lastUpdate; - // initialize date - $('#spatialUnitAddLastUpdateDatepicker').datepicker('setDate', $scope.metadata.lastUpdate); - - $scope.metadata.description = $scope.metadataImportSettings.metadata.description; - $scope.metadata.databasis = $scope.metadataImportSettings.metadata.databasis; - - $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('spatialUnitAddRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, $scope.metadataImportSettings.allowedRoles); - - for(var i=0; i { + $scope.$digest(); + }, 250); + }; + $scope.checkSpatialUnitName = function () { + $scope.spatialUnitLevelInvalid = false; + kommonitorDataExchangeService.availableSpatialUnits.forEach(function (spatialUnit) { + if (spatialUnit.spatialUnitLevel === $scope.spatialUnitLevel) { + $scope.spatialUnitLevelInvalid = true; + return; + } + }); + }; + $scope.checkPeriodOfValidity = function () { + $scope.periodOfValidityInvalid = false; + if ($scope.periodOfValidity.startDate && $scope.periodOfValidity.endDate) { + var startDate = new Date($scope.periodOfValidity.startDate); + var endDate = new Date($scope.periodOfValidity.endDate); + if ((startDate === endDate) || startDate > endDate) { + // failure + $scope.periodOfValidityInvalid = true; + } + } + }; + $scope.checkSpatialUnitHierarchy = function () { + $scope.hierarchyInvalid = false; + // smaller indices represent higher spatial units + // i.e. city districts will have a smaller index than building blocks + if ($scope.nextLowerHierarchySpatialUnit && $scope.nextUpperHierarchySpatialUnit) { + var indexOfLowerHierarchyUnit; + var indexOfUpperHierarchyUnit; + for (var i = 0; i < kommonitorDataExchangeService.availableSpatialUnits.length; i++) { + var spatialUnit = kommonitorDataExchangeService.availableSpatialUnits[i]; + if (spatialUnit.spatialUnitLevel === $scope.nextLowerHierarchySpatialUnit.spatialUnitLevel) { + indexOfLowerHierarchyUnit = i; + } + if (spatialUnit.spatialUnitLevel === $scope.nextUpperHierarchySpatialUnit.spatialUnitLevel) { + indexOfUpperHierarchyUnit = i; + } + } + if ((indexOfLowerHierarchyUnit <= indexOfUpperHierarchyUnit)) { + // failure + $scope.hierarchyInvalid = true; + } + } + }; + $scope.onAddOrUpdateAttributeMapping = function () { + var tmpAttributeMapping_adminView = { + "sourceName": $scope.attributeMapping_sourceAttributeName, + "destinationName": $scope.attributeMapping_destinationAttributeName, + "dataType": $scope.attributeMapping_attributeType + }; + var processed = false; + for (let index = 0; index < $scope.attributeMappings_adminView.length; index++) { + var attributeMappingEntry_adminView = $scope.attributeMappings_adminView[index]; + if (attributeMappingEntry_adminView.sourceName === tmpAttributeMapping_adminView.sourceName) { + // replace object + $scope.attributeMappings_adminView[index] = tmpAttributeMapping_adminView; + processed = true; + break; + } + } + if (!processed) { + // new entry + $scope.attributeMappings_adminView.push(tmpAttributeMapping_adminView); + } + $scope.attributeMapping_sourceAttributeName = undefined; + $scope.attributeMapping_destinationAttributeName = undefined; + $scope.attributeMapping_attributeType = kommonitorImporterHelperService.attributeMapping_attributeTypes[0]; + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.onClickEditAttributeMapping = function (attributeMappingEntry) { + $scope.attributeMapping_sourceAttributeName = attributeMappingEntry.sourceName; + $scope.attributeMapping_destinationAttributeName = attributeMappingEntry.destinationName; + $scope.attributeMapping_attributeType = attributeMappingEntry.dataType; + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.onClickDeleteAttributeMapping = function (attributeMappingEntry) { + for (let index = 0; index < $scope.attributeMappings_adminView.length; index++) { + if ($scope.attributeMappings_adminView[index].sourceName === attributeMappingEntry.sourceName) { + // remove object + $scope.attributeMappings_adminView.splice(index, 1); + break; + } + } + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.onChangeConverter = function (schema) { + $scope.schema = $scope.converter.schemas ? $scope.converter.schemas[0] : undefined; + $scope.mimeType = $scope.converter.mimeTypes[0]; + }; + $scope.onChangeMimeType = function (mimeType) { + $scope.mimeType = mimeType; + }; + $scope.buildImporterObjects = async function () { + $scope.converterDefinition = $scope.buildConverterDefinition(); + $scope.datasourceTypeDefinition = await $scope.buildDatasourceTypeDefinition(); + $scope.propertyMappingDefinition = $scope.buildPropertyMappingDefinition(); + $scope.postBody_spatialUnits = $scope.buildPostBody_spatialUnits(); + if (!$scope.converterDefinition || !$scope.datasourceTypeDefinition || !$scope.propertyMappingDefinition || !$scope.postBody_spatialUnits) { + return false; + } + return true; + }; + $scope.buildConverterDefinition = function () { + return kommonitorImporterHelperService.buildConverterDefinition($scope.converter, "converterParameter_spatialUnitAdd_", $scope.schema, $scope.mimeType); + }; + $scope.buildDatasourceTypeDefinition = async function () { + try { + return await kommonitorImporterHelperService.buildDatasourceTypeDefinition($scope.datasourceType, 'datasourceTypeParameter_spatialUnitAdd_', 'spatialUnitDataSourceInput'); + } + catch (error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + $("#spatialUnitAddErrorAlert").show(); + $scope.loadingData = false; + setTimeout(() => { + $scope.$digest(); + }, 250); + return null; + } + }; + $scope.buildPropertyMappingDefinition = function () { + // arsion from is undefined currently + return kommonitorImporterHelperService.buildPropertyMapping_spatialResource($scope.spatialUnitDataSourceNameProperty, $scope.spatialUnitDataSourceIdProperty, $scope.validityStartDate_perFeature, $scope.validityEndDate_perFeature, undefined, $scope.keepAttributes, $scope.keepMissingValues, $scope.attributeMappings_adminView); + }; + $scope.buildPostBody_spatialUnits = function () { + var postBody = { + "geoJsonString": "", + "metadata": { + "note": $scope.metadata.note, + "literature": $scope.metadata.literature, + "updateInterval": $scope.metadata.updateInterval.apiName, + "sridEPSG": $scope.metadata.sridEPSG, + "datasource": $scope.metadata.datasource, + "contact": $scope.metadata.contact, + "lastUpdate": $scope.metadata.lastUpdate, + "description": $scope.metadata.description, + "databasis": $scope.metadata.databasis + }, + "jsonSchema": undefined, + "allowedRoles": [], + "nextLowerHierarchyLevel": $scope.nextLowerHierarchySpatialUnit ? $scope.nextLowerHierarchySpatialUnit.spatialUnitLevel : undefined, + "spatialUnitLevel": $scope.spatialUnitLevel, + "periodOfValidity": { + "endDate": $scope.periodOfValidity.endDate, + "startDate": $scope.periodOfValidity.startDate + }, + "nextUpperHierarchyLevel": $scope.nextUpperHierarchySpatialUnit ? $scope.nextUpperHierarchySpatialUnit.spatialUnitLevel : undefined + }; + let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); + for (const roleId of roleIds) { + postBody.allowedRoles.push(roleId); + } + return postBody; + }; + $scope.addSpatialUnit = async function () { + $timeout(function () { + $scope.loadingData = true; + }); + $scope.importerErrors = undefined; + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + /* + now collect data and build request for importer + */ + /* + if any required importer data is missing --> cancel request and highlight required errors + */ + var allDataSpecified = await $scope.buildImporterObjects(); + if (!allDataSpecified) { + $("#spatialUnitAddForm").validator("update"); + $("#spatialUnitAddForm").validator("validate"); + return; + } + else { + // TODO verify input + // TODO Create and perform POST Request with loading screen + var newSpatialUnitResponse_dryRun = undefined; + try { + newSpatialUnitResponse_dryRun = await kommonitorImporterHelperService.registerNewSpatialUnit($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.postBody_spatialUnits, true); + if (!kommonitorImporterHelperService.importerResponseContainsErrors(newSpatialUnitResponse_dryRun)) { + // all good, really execute the request to import data against data management API + var newSpatialUnitResponse = await kommonitorImporterHelperService.registerNewSpatialUnit($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.postBody_spatialUnits, false); + $rootScope.$broadcast("refreshSpatialUnitOverviewTable", "add", kommonitorImporterHelperService.getIdFromImporterResponse(newSpatialUnitResponse)); + // refresh all admin dashboard diagrams due to modified metadata + $timeout(function () { + $rootScope.$broadcast("refreshAdminDashboardDiagrams"); + }, 500); + $scope.successMessagePart = $scope.postBody_spatialUnits.spatialUnitLevel; + $scope.importedFeatures = kommonitorImporterHelperService.getImportedFeaturesFromImporterResponse(newSpatialUnitResponse); + $("#spatialUnitAddSucessAlert").show(); + $scope.loadingData = false; + setTimeout(() => { + $scope.$digest(); + }, 250); + } + else { + // errors ocurred + // show them + $scope.errorMessagePart = "Einige der zu importierenden Features des Datensatzes weisen kritische Fehler auf"; + $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(newSpatialUnitResponse_dryRun); + $("#spatialUnitAddErrorAlert").show(); + $scope.loadingData = false; + setTimeout(() => { + $scope.$digest(); + }, 250); + } + } + catch (error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + if (newSpatialUnitResponse_dryRun) { + $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(newSpatialUnitResponse_dryRun); + } + $("#spatialUnitAddErrorAlert").show(); + $scope.loadingData = false; + setTimeout(() => { + $scope.$digest(); + }, 250); + } + } + }; + $scope.onImportSpatialUnitAddMetadata = function () { + $scope.spatialUnitMetadataImportError = ""; + $("#spatialUnitMetadataImportFile").files = []; + // trigger file chooser + $("#spatialUnitMetadataImportFile").click(); + }; + $(document).on("change", "#spatialUnitMetadataImportFile", function () { + console.log("Importing SpatialUnit metadata for Add SpatialUnit Form"); + // get the file + var file = document.getElementById('spatialUnitMetadataImportFile').files[0]; + $scope.parseMetadataFromFile(file); + }); + $scope.parseMetadataFromFile = function (file) { + var fileReader = new FileReader(); + fileReader.onload = function (event) { + try { + $scope.parseFromMetadataFile(event); + } + catch (error) { + console.error(error); + console.error("Uploaded Metadata File cannot be parsed."); + $scope.spatialUnitMetadataImportError = "Uploaded Metadata File cannot be parsed correctly"; + document.getElementById("spatialUnitsAddMetadataPre").innerHTML = $scope.spatialUnitMetadataStructure_pretty; + $("#spatialUnitMetadataImportErrorAlert").show(); + $scope.$digest(); + } + }; + // Read in the image file as a data URL. + fileReader.readAsText(file); + }; + $scope.parseFromMetadataFile = function (event) { + // $scope.geoJsonString = event.target.result; + $scope.metadataImportSettings = JSON.parse(event.target.result); + if (!$scope.metadataImportSettings.metadata) { + console.error("uploaded Metadata File cannot be parsed - wrong structure."); + $scope.spatialUnitMetadataImportError = "Struktur der Datei stimmt nicht mit erwartetem Muster überein."; + document.getElementById("spatialUnitsAddMetadataPre").innerHTML = $scope.spatialUnitMetadataStructure_pretty; + $("#spatialUnitMetadataImportErrorAlert").show(); + $scope.$digest(); + } + $scope.metadata = {}; + $scope.metadata.note = $scope.metadataImportSettings.metadata.note; + $scope.metadata.literature = $scope.metadataImportSettings.metadata.literature; + kommonitorDataExchangeService.updateIntervalOptions.forEach(function (option) { + if (option.apiName === $scope.metadataImportSettings.metadata.updateInterval) { + $scope.metadata.updateInterval = option; + } + }); + $scope.metadata.sridEPSG = $scope.metadataImportSettings.metadata.sridEPSG; + $scope.metadata.datasource = $scope.metadataImportSettings.metadata.datasource; + $scope.metadata.contact = $scope.metadataImportSettings.metadata.contact; + $scope.metadata.lastUpdate = $scope.metadataImportSettings.metadata.lastUpdate; + // initialize date + $('#spatialUnitAddLastUpdateDatepicker').datepicker('setDate', $scope.metadata.lastUpdate); + $scope.metadata.description = $scope.metadataImportSettings.metadata.description; + $scope.metadata.databasis = $scope.metadataImportSettings.metadata.databasis; + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('spatialUnitAddRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, $scope.metadataImportSettings.allowedRoles); + for (var i = 0; i < kommonitorDataExchangeService.availableSpatialUnits.length; i++) { + var spatialUnit = kommonitorDataExchangeService.availableSpatialUnits[i]; + if (spatialUnit.spatialUnitLevel === $scope.metadataImportSettings.nextLowerHierarchyLevel) { + $scope.nextLowerHierarchySpatialUnit = spatialUnit; + } + if (spatialUnit.spatialUnitLevel === $scope.metadataImportSettings.nextUpperHierarchyLevel) { + $scope.nextUpperHierarchySpatialUnit = spatialUnit; + } + } + $scope.spatialUnitLevel = $scope.metadataImportSettings.spatialUnitLevel; + $scope.$digest(); + }; + $scope.onExportSpatialUnitAddMetadataTemplate = function () { + var metadataJSON = JSON.stringify($scope.spatialUnitMetadataStructure); + var fileName = "Raumeinheit_Metadaten_Vorlage_Export.json"; + var blob = new Blob([metadataJSON], { type: "application/json" }); + var data = URL.createObjectURL(blob); + var a = document.createElement('a'); + a.download = fileName; + a.href = data; + a.textContent = "JSON"; + a.target = "_blank"; + a.rel = "noopener noreferrer"; + a.click(); + a.remove(); + }; + $scope.onExportSpatialUnitAddMetadata = function () { + var metadataExport = $scope.spatialUnitMetadataStructure; + metadataExport.metadata.note = $scope.metadata.note || ""; + metadataExport.metadata.literature = $scope.metadata.literature || ""; + metadataExport.metadata.sridEPSG = $scope.metadata.sridEPSG || ""; + metadataExport.metadata.datasource = $scope.metadata.datasource || ""; + metadataExport.metadata.contact = $scope.metadata.contact || ""; + metadataExport.metadata.lastUpdate = $scope.metadata.lastUpdate || ""; + metadataExport.metadata.description = $scope.metadata.description || ""; + metadataExport.metadata.databasis = $scope.metadata.databasis || ""; + metadataExport.spatialUnitLevel = $scope.spatialUnitLevel || ""; + metadataExport.allowedRoles = []; + let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); + for (const roleId of roleIds) { + metadataExport.allowedRoles.push(roleId); + } + if ($scope.metadata.updateInterval) { + metadataExport.metadata.updateInterval = $scope.metadata.updateInterval.apiName; + } + if ($scope.nextLowerHierarchySpatialUnit) { + metadataExport.nextLowerHierarchyLevel = $scope.nextLowerHierarchySpatialUnit.spatialUnitLevel; + } + else { + metadataExport.nextLowerHierarchyLevel = ""; + } + if ($scope.nextUpperHierarchySpatialUnit) { + metadataExport.nextUpperHierarchyLevel = $scope.nextUpperHierarchySpatialUnit.spatialUnitLevel; + } + else { + metadataExport.nextUpperHierarchyLevel = ""; + } + var name = $scope.spatialUnitLevel; + var metadataJSON = JSON.stringify(metadataExport); + var fileName = "Raumeinheit_Metadaten_Export"; + if (name) { + fileName += "-" + name; + } + fileName += ".json"; + var blob = new Blob([metadataJSON], { type: "application/json" }); + var data = URL.createObjectURL(blob); + var a = document.createElement('a'); + a.download = fileName; + a.href = data; + a.textContent = "JSON"; + a.target = "_blank"; + a.rel = "noopener noreferrer"; + a.click(); + a.remove(); + }; + $scope.onImportSpatialUnitAddMappingConfig = function () { + $scope.spatialUnitMappingConfigImportError = ""; + $("#spatialUnitMappingConfigAddImportFile").files = []; + // trigger file chooser + $("#spatialUnitMappingConfigAddImportFile").click(); + }; + $(document).on("change", "#spatialUnitMappingConfigAddImportFile", function () { + console.log("Importing Importer Mapping Config for Add SpatialUnit Form"); + // get the file + var file = document.getElementById('spatialUnitMappingConfigAddImportFile').files[0]; + $scope.parseMappingConfigFromFile(file); + }); + $scope.parseMappingConfigFromFile = function (file) { + var fileReader = new FileReader(); + fileReader.onload = function (event) { + try { + $scope.parseFromMappingConfigFile(event); + } + catch (error) { + console.error(error); + console.error("Uploaded MappingConfig File cannot be parsed."); + $scope.spatialUnitMappingConfigImportError = "Uploaded MappingConfig File cannot be parsed correctly"; + document.getElementById("spatialUnitsAddMappingConfigPre").innerHTML = $scope.spatialUnitMappingConfigStructure_pretty; + $("#spatialUnitMappingConfigImportErrorAlert").show(); + $scope.$digest(); + } + }; + // Read in the image file as a data URL. + fileReader.readAsText(file); + }; + $scope.parseFromMappingConfigFile = function (event) { + $scope.mappingConfigImportSettings = JSON.parse(event.target.result); + if (!$scope.mappingConfigImportSettings.converter || !$scope.mappingConfigImportSettings.dataSource || !$scope.mappingConfigImportSettings.propertyMapping) { + console.error("uploaded MappingConfig File cannot be parsed - wrong structure."); + $scope.spatialUnitMetadataImportError = "Struktur der Datei stimmt nicht mit erwartetem Muster überein."; + document.getElementById("spatialUnitsAddMappingConfigPre").innerHTML = $scope.spatialUnitMappingConfigStructure_pretty; + $("#spatialUnitMappingConfigImportErrorAlert").show(); + $scope.$digest(); + } + $scope.converter = undefined; + for (var converter of kommonitorImporterHelperService.availableConverters) { + if (converter.name === $scope.mappingConfigImportSettings.converter.name) { + $scope.converter = converter; + break; + } + } + $scope.schema = undefined; + if ($scope.converter && $scope.converter.schemas && $scope.mappingConfigImportSettings.converter.schema) { + for (var schema of $scope.converter.schemas) { + if (schema === $scope.mappingConfigImportSettings.converter.schema) { + $scope.schema = schema; + } + } + } + $scope.mimeType = undefined; + if ($scope.converter && $scope.converter.mimeTypes && $scope.mappingConfigImportSettings.converter.mimeType) { + for (var mimeType of $scope.converter.mimeTypes) { + if (mimeType === $scope.mappingConfigImportSettings.converter.mimeType) { + $scope.mimeType = mimeType; + } + } + } + $scope.datasourceType = undefined; + for (var datasourceType of kommonitorImporterHelperService.availableDatasourceTypes) { + if (datasourceType.type === $scope.mappingConfigImportSettings.dataSource.type) { + $scope.datasourceType = datasourceType; + break; + } + } + $scope.$digest(); + // converter parameters + if ($scope.converter) { + for (var convParameter of $scope.mappingConfigImportSettings.converter.parameters) { + $("#converterParameter_spatialUnitAdd_" + convParameter.name).val(convParameter.value); + } + } + // datasourceTypes parameters + if ($scope.datasourceType) { + for (var dsParameter of $scope.mappingConfigImportSettings.dataSource.parameters) { + $("#datasourceTypeParameter_spatialUnitAdd_" + dsParameter.name).val(dsParameter.value); + } + } + // property Mapping + $scope.spatialUnitDataSourceNameProperty = $scope.mappingConfigImportSettings.propertyMapping.nameProperty; + $scope.spatialUnitDataSourceIdProperty = $scope.mappingConfigImportSettings.propertyMapping.identifierProperty; + $scope.validityStartDate_perFeature = $scope.mappingConfigImportSettings.propertyMapping.validStartDateProperty; + $scope.validityEndDate_perFeature = $scope.mappingConfigImportSettings.propertyMapping.validEndDateProperty; + $scope.keepAttributes = $scope.mappingConfigImportSettings.propertyMapping.keepAttributes; + $scope.keepMissingValues = $scope.mappingConfigImportSettings.propertyMapping.keepMissingOrNullValueAttributes; + $scope.attributeMappings_adminView = []; + for (var attributeMapping of $scope.mappingConfigImportSettings.propertyMapping.attributes) { + var tmpEntry = { + "sourceName": attributeMapping.name, + "destinationName": attributeMapping.mappingName + }; + for (const dataType of kommonitorImporterHelperService.attributeMapping_attributeTypes) { + if (dataType.apiName === attributeMapping.type) { + tmpEntry.dataType = dataType; + } + } + $scope.attributeMappings_adminView.push(tmpEntry); + } + if ($scope.mappingConfigImportSettings.periodOfValidity) { + $scope.periodOfValidity = {}; + $scope.periodOfValidity.startDate = $scope.mappingConfigImportSettings.periodOfValidity.startDate; + $scope.periodOfValidity.endDate = $scope.mappingConfigImportSettings.periodOfValidity.endDate; + $scope.periodOfValidityInvalid = false; + // update datePickers + if ($scope.periodOfValidity.startDate) { + $("#spatialUnitAddDatepickerStart").datepicker('setDate', $scope.periodOfValidity.startDate); + } + if ($scope.periodOfValidity.endDate) { + $("#spatialUnitAddDatepickerEnd").datepicker('setDate', $scope.periodOfValidity.endDate); + } + } + $scope.$digest(); + }; + $scope.onExportSpatialUnitAddMappingConfig = async function () { + var converterDefinition = $scope.buildConverterDefinition(); + var datasourceTypeDefinition = await $scope.buildDatasourceTypeDefinition(); + var propertyMappingDefinition = $scope.buildPropertyMappingDefinition(); + var mappingConfigExport = { + "converter": converterDefinition, + "dataSource": datasourceTypeDefinition, + "propertyMapping": propertyMappingDefinition, + }; + mappingConfigExport.periodOfValidity = $scope.periodOfValidity; + var name = $scope.spatialUnitLevel; + var metadataJSON = JSON.stringify(mappingConfigExport); + var fileName = "KomMonitor-Import-Mapping-Konfiguration_Export"; + if (name) { + fileName += "-" + name; + } + fileName += ".json"; + var blob = new Blob([metadataJSON], { type: "application/json" }); + var data = URL.createObjectURL(blob); + var a = document.createElement('a'); + a.download = fileName; + a.href = data; + a.textContent = "JSON"; + a.target = "_blank"; + a.rel = "noopener noreferrer"; + a.click(); + a.remove(); + }; + $scope.hideSuccessAlert = function () { + $("#spatialUnitAddSucessAlert").hide(); + }; + $scope.hideErrorAlert = function () { + $("#spatialUnitAddErrorAlert").hide(); + }; + $scope.hideMetadataErrorAlert = function () { + $("#spatialUnitMetadataImportErrorAlert").hide(); + }; + $scope.hideMappingConfigErrorAlert = function () { + $("#spatialUnitMappingConfigImportErrorAlert").hide(); + }; + kommonitorMultiStepFormHelperService.registerClickHandler(); + } + ] +}); +//# sourceMappingURL=spatial-unit-add-modal.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitAddModal/spatial-unit-add-modal.component.js.map b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitAddModal/spatial-unit-add-modal.component.js.map new file mode 100644 index 000000000..ba6729053 --- /dev/null +++ b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitAddModal/spatial-unit-add-modal.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"spatial-unit-add-modal.component.js","sourceRoot":"","sources":["spatial-unit-add-modal.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,SAAS,CAAC,qBAAqB,EAAE;IACtE,WAAW,EAAG,iHAAiH;IAC/H,UAAU,EAAG,CAAC,+B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AC,CAAC,MAAM,EAAE,CAAC;YACZ,CAAC,CAAC;YAGD,MAAM,CAAC,gBAAgB,GAAG;gBACzB,CAAC,CAAC,4BAA4B,CAAC,CAAC,IAAI,EAAE,CAAC;YACxC,CAAC,CAAC;YAEF,MAAM,CAAC,cAAc,GAAG;gBACvB,CAAC,CAAC,2BAA2B,CAAC,CAAC,IAAI,EAAE,CAAC;YACvC,CAAC,CAAC;YAEF,MAAM,CAAC,sBAAsB,GAAG;gBAC/B,CAAC,CAAC,sCAAsC,CAAC,CAAC,IAAI,EAAE,CAAC;YAClD,CAAC,CAAC;YAEF,MAAM,CAAC,2BAA2B,GAAG;gBACpC,CAAC,CAAC,2CAA2C,CAAC,CAAC,IAAI,EAAE,CAAC;YACvD,CAAC,CAAC;YAGF,oCAAoC,CAAC,oBAAoB,EAAE,CAAC;QAE9D,CAAC;KACD;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitAddModal/spatial-unit-add-modal.component.ts b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitAddModal/spatial-unit-add-modal.component.ts new file mode 100644 index 000000000..a12a12da1 --- /dev/null +++ b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitAddModal/spatial-unit-add-modal.component.ts @@ -0,0 +1,864 @@ +angular.module('spatialUnitAddModal').component('spatialUnitAddModal', { + templateUrl : "components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitAddModal/spatial-unit-add-modal.template.html", + controller : ['kommonitorDataExchangeService', 'kommonitorImporterHelperService', '$scope', '$rootScope', + '$timeout', '$http', '__env', 'kommonitorMultiStepFormHelperService', 'kommonitorDataGridHelperService', + function SpatialUnitAddModalController(kommonitorDataExchangeService, kommonitorImporterHelperService, + $scope, $rootScope, $timeout, $http, __env, kommonitorMultiStepFormHelperService, kommonitorDataGridHelperService) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorImporterHelperServiceInstance = kommonitorImporterHelperService; + + /* POST BODY + { + "geoJsonString": "geoJsonString", + "metadata": { + "note": "note", + "literature": "literature", + "updateInterval": "ARBITRARY", + "sridEPSG": 0.8008281904610115, + "datasource": "datasource", + "contact": "contact", + "lastUpdate": "2000-01-23", + "description": "description", + "databasis": "databasis" + }, + "jsonSchema": "jsonSchema", + "nextLowerHierarchyLevel": "nextLowerHierarchyLevel", + "spatialUnitLevel": "spatialUnitLevel", + "periodOfValidity": { + "endDate": "2000-01-23", + "startDate": "2000-01-23" + }, + "nextUpperHierarchyLevel": "nextUpperHierarchyLevel" + } + */ + + //Date picker + $('#spatialUnitAddDatepickerStart').datepicker(kommonitorDataExchangeService.datePickerOptions); + $('#spatialUnitAddDatepickerEnd').datepicker(kommonitorDataExchangeService.datePickerOptions); + $('#spatialUnitAddLastUpdateDatepicker').datepicker(kommonitorDataExchangeService.datePickerOptions); + + $scope.loadingData = false; + + $scope.spatialUnitMetadataStructure = { + "metadata": { + "note": "an optional note", + "literature": "optional text about literature", + "updateInterval": "YEARLY|HALF_YEARLY|QUARTERLY|MONTHLY|ARBITRARY", + "sridEPSG": 4326, + "datasource": "text about data source", + "contact": "text about contact details", + "lastUpdate": "YYYY-MM-DD", + "description": "description about spatial unit dataset", + "databasis": "text about data basis", + }, + "allowedRoles": ['roleId'], + "nextLowerHierarchyLevel": "Name of lower hierarchy level", + "spatialUnitLevel": "Name of spatial unit dataset", + "nextUpperHierarchyLevel": "Name of upper hierarchy level" + }; + + $scope.spatialUnitMetadataStructure_pretty = kommonitorDataExchangeService.syntaxHighlightJSON($scope.spatialUnitMetadataStructure); + $scope.spatialUnitMappingConfigStructure_pretty = kommonitorDataExchangeService.syntaxHighlightJSON(kommonitorImporterHelperService.mappingConfigStructure); + + $scope.metadataImportSettings; + $scope.spatialUnitMetadataImportError; + $scope.spatialUnitMetadataImportErrorAlert; + $scope.spatialUnitMappingConfigImportError; + + $scope.spatialUnitLevel = undefined; + $scope.spatialUnitLevelInvalid = false; + + $scope.metadata = {}; + $scope.metadata.note = undefined; + $scope.metadata.literature = undefined; + $scope.metadata.updateInterval = undefined; + $scope.metadata.sridEPSG = 4326; + $scope.metadata.datasource = undefined; + $scope.metadata.databasis = undefined; + $scope.metadata.contact = undefined; + $scope.metadata.lastUpdate = undefined; + $scope.metadata.description = undefined; + + $scope.roleManagementTableOptions = undefined; + + $scope.$on("availableRolesUpdate", function (event) { + refreshRoles(); + }); + + // make sure that initial fetching of availableRoles has happened + $scope.$on("initialMetadataLoadingCompleted", function (event) { + refreshRoles(); + }); + + function refreshRoles() { + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('spatialUnitAddRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, kommonitorDataExchangeService.getCurrentKomMonitorLoginRoleIds()); + } + + $scope.nextLowerHierarchySpatialUnit = undefined; + $scope.nextUpperHierarchySpatialUnit = undefined; + $scope.hierarchyInvalid = false; + + $scope.periodOfValidity = {}; + $scope.periodOfValidity.startDate = undefined; + $scope.periodOfValidity.endDate = undefined; + $scope.periodOfValidityInvalid = false; + + $scope.converter = undefined; + $scope.schema = undefined; + $scope.mimeType = undefined; + $scope.datasourceType = undefined; + $scope.spatialUnitDataSourceIdProperty = undefined; + $scope.spatialUnitDataSourceNameProperty = undefined; + + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + $scope.importerErrors = undefined; + + $scope.converterDefinition = undefined; + $scope.datasourceTypeDefinition = undefined; + $scope.propertyMappingDefinition = undefined; + $scope.postBody_spatialUnits = undefined; + + $scope.attributeMapping_sourceAttributeName = undefined; + $scope.attributeMapping_destinationAttributeName = undefined; + $scope.attributeMapping_data = undefined; + $scope.attributeMapping_attributeType = kommonitorImporterHelperService.attributeMapping_attributeTypes[0]; + $scope.attributeMappings_adminView = []; + $scope.keepAttributes = true; + $scope.keepMissingValues = true; + + $scope.validityEndDate_perFeature = undefined; + $scope.validityStartDate_perFeature = undefined; + + + $scope.resetSpatialUnitAddForm = function(){ + $scope.importerErrors = undefined; + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + + $scope.spatialUnitLevel = undefined; + $scope.spatialUnitLevelInvalid = false; + + $scope.metadata = {}; + $scope.metadata.note = undefined; + $scope.metadata.literature = undefined; + $scope.metadata.updateInterval = undefined; + $scope.metadata.sridEPSG = 4326; + $scope.metadata.datasource = undefined; + $scope.metadata.databasis = undefined; + $scope.metadata.contact = undefined; + $scope.metadata.lastUpdate = undefined; + $scope.metadata.description = undefined; + + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('spatialUnitAddRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, kommonitorDataExchangeService.getCurrentKomMonitorLoginRoleIds()); + + $scope.nextLowerHierarchySpatialUnit = undefined; + $scope.nextUpperHierarchySpatialUnit = undefined; + $scope.hierarchyInvalid = false; + + $scope.periodOfValidity = {}; + $scope.periodOfValidity.startDate = undefined; + $scope.periodOfValidity.endDate = undefined; + $scope.periodOfValidityInvalid = false; + + $scope.converter = undefined; + $scope.schema = undefined; + $scope.mimeType = undefined; + $scope.datasourceType = undefined; + $scope.spatialUnitDataSourceIdProperty = undefined; + $scope.spatialUnitDataSourceNameProperty = undefined; + + $scope.converterDefinition = undefined; + $scope.datasourceTypeDefinition = undefined; + $scope.propertyMappingDefinition = undefined; + $scope.postBody_spatialUnits = undefined; + + $scope.attributeMapping_sourceAttributeName = undefined; + $scope.attributeMapping_destinationAttributeName = undefined; + $scope.attributeMapping_data = undefined; + $scope.attributeMapping_attributeType = kommonitorImporterHelperService.attributeMapping_attributeTypes[0]; + $scope.attributeMappings_adminView = []; + $scope.keepAttributes = true; + $scope.keepMissingValues = true; + + $scope.validityEndDate_perFeature = undefined; + $scope.validityStartDate_perFeature = undefined; + + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + + $scope.checkSpatialUnitName = function(){ + $scope.spatialUnitLevelInvalid = false; + kommonitorDataExchangeService.availableSpatialUnits.forEach(function(spatialUnit){ + if (spatialUnit.spatialUnitLevel === $scope.spatialUnitLevel){ + $scope.spatialUnitLevelInvalid = true; + return; + } + }); + }; + + $scope.checkPeriodOfValidity = function(){ + $scope.periodOfValidityInvalid = false; + if ($scope.periodOfValidity.startDate && $scope.periodOfValidity.endDate){ + var startDate = new Date($scope.periodOfValidity.startDate); + var endDate = new Date($scope.periodOfValidity.endDate); + + if ((startDate === endDate) || startDate > endDate){ + // failure + $scope.periodOfValidityInvalid = true; + } + } + }; + + $scope.checkSpatialUnitHierarchy = function(){ + + $scope.hierarchyInvalid = false; + + // smaller indices represent higher spatial units + // i.e. city districts will have a smaller index than building blocks + if($scope.nextLowerHierarchySpatialUnit && $scope.nextUpperHierarchySpatialUnit){ + var indexOfLowerHierarchyUnit; + var indexOfUpperHierarchyUnit; + + for(var i=0; i { + $scope.$digest(); + }, 250); + }; + + $scope.onClickEditAttributeMapping = function(attributeMappingEntry){ + $scope.attributeMapping_sourceAttributeName = attributeMappingEntry.sourceName; + $scope.attributeMapping_destinationAttributeName = attributeMappingEntry.destinationName; + $scope.attributeMapping_attributeType = attributeMappingEntry.dataType; + + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + + $scope.onClickDeleteAttributeMapping = function(attributeMappingEntry){ + for (let index = 0; index < $scope.attributeMappings_adminView.length; index++) { + + if ($scope.attributeMappings_adminView[index].sourceName === attributeMappingEntry.sourceName){ + // remove object + $scope.attributeMappings_adminView.splice(index, 1); + break; + } + } + + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + + $scope.onChangeConverter = function(schema){ + $scope.schema = $scope.converter.schemas ? $scope.converter.schemas[0] : undefined; + $scope.mimeType = $scope.converter.mimeTypes[0]; + }; + + $scope.onChangeMimeType = function(mimeType){ + $scope.mimeType = mimeType; + }; + + $scope.buildImporterObjects = async function(){ + $scope.converterDefinition = $scope.buildConverterDefinition(); + $scope.datasourceTypeDefinition = await $scope.buildDatasourceTypeDefinition(); + $scope.propertyMappingDefinition = $scope.buildPropertyMappingDefinition(); + $scope.postBody_spatialUnits = $scope.buildPostBody_spatialUnits(); + + if(!$scope.converterDefinition || !$scope.datasourceTypeDefinition || !$scope.propertyMappingDefinition || !$scope.postBody_spatialUnits){ + return false; + } + + return true; + }; + + $scope.buildConverterDefinition = function(){ + + return kommonitorImporterHelperService.buildConverterDefinition($scope.converter, "converterParameter_spatialUnitAdd_", $scope.schema, $scope.mimeType); + }; + + $scope.buildDatasourceTypeDefinition = async function(){ + try { + return await kommonitorImporterHelperService.buildDatasourceTypeDefinition($scope.datasourceType, 'datasourceTypeParameter_spatialUnitAdd_', 'spatialUnitDataSourceInput'); + } catch (error) { + if(error.data){ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else{ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + + $("#spatialUnitAddErrorAlert").show(); + $scope.loadingData = false; + setTimeout(() => { + $scope.$digest(); + }, 250); + return null; + } + }; + + $scope.buildPropertyMappingDefinition = function(){ + // arsion from is undefined currently + return kommonitorImporterHelperService.buildPropertyMapping_spatialResource($scope.spatialUnitDataSourceNameProperty, $scope.spatialUnitDataSourceIdProperty, $scope.validityStartDate_perFeature, $scope.validityEndDate_perFeature, undefined, $scope.keepAttributes, $scope.keepMissingValues, $scope.attributeMappings_adminView); + }; + + $scope.buildPostBody_spatialUnits = function(){ + var postBody = + { + "geoJsonString": "", // will be set by importer + "metadata": { + "note": $scope.metadata.note, + "literature": $scope.metadata.literature, + "updateInterval": $scope.metadata.updateInterval.apiName, + "sridEPSG": $scope.metadata.sridEPSG, + "datasource": $scope.metadata.datasource, + "contact": $scope.metadata.contact, + "lastUpdate": $scope.metadata.lastUpdate, + "description": $scope.metadata.description, + "databasis": $scope.metadata.databasis + }, + "jsonSchema": undefined, + "allowedRoles": [], + "nextLowerHierarchyLevel": $scope.nextLowerHierarchySpatialUnit ? $scope.nextLowerHierarchySpatialUnit.spatialUnitLevel : undefined, + "spatialUnitLevel": $scope.spatialUnitLevel, + "periodOfValidity": { + "endDate": $scope.periodOfValidity.endDate, + "startDate": $scope.periodOfValidity.startDate + }, + "nextUpperHierarchyLevel": $scope.nextUpperHierarchySpatialUnit ? $scope.nextUpperHierarchySpatialUnit.spatialUnitLevel : undefined + }; + + let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); + for (const roleId of roleIds) { + postBody.allowedRoles.push(roleId); + } + + return postBody; + }; + + $scope.addSpatialUnit = async function () { + + $timeout(function(){ + $scope.loadingData = true; + }); + + $scope.importerErrors = undefined; + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + + /* + now collect data and build request for importer + */ + + /* + if any required importer data is missing --> cancel request and highlight required errors + */ + var allDataSpecified = await $scope.buildImporterObjects(); + + if (!allDataSpecified) { + + $("#spatialUnitAddForm").validator("update"); + $("#spatialUnitAddForm").validator("validate"); + return; + } + else { + + + // TODO verify input + + // TODO Create and perform POST Request with loading screen + + var newSpatialUnitResponse_dryRun = undefined; + try { + newSpatialUnitResponse_dryRun = await kommonitorImporterHelperService.registerNewSpatialUnit($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.postBody_spatialUnits, true); + + if(! kommonitorImporterHelperService.importerResponseContainsErrors(newSpatialUnitResponse_dryRun)){ + // all good, really execute the request to import data against data management API + var newSpatialUnitResponse = await kommonitorImporterHelperService.registerNewSpatialUnit($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.postBody_spatialUnits, false); + + $rootScope.$broadcast("refreshSpatialUnitOverviewTable", "add", kommonitorImporterHelperService.getIdFromImporterResponse(newSpatialUnitResponse)); + + // refresh all admin dashboard diagrams due to modified metadata + $timeout(function(){ + $rootScope.$broadcast("refreshAdminDashboardDiagrams"); + }, 500); + + + $scope.successMessagePart = $scope.postBody_spatialUnits.spatialUnitLevel; + $scope.importedFeatures = kommonitorImporterHelperService.getImportedFeaturesFromImporterResponse(newSpatialUnitResponse); + + $("#spatialUnitAddSucessAlert").show(); + $scope.loadingData = false; + + setTimeout(() => { + $scope.$digest(); + }, 250); + } + else{ + // errors ocurred + // show them + $scope.errorMessagePart = "Einige der zu importierenden Features des Datensatzes weisen kritische Fehler auf"; + $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(newSpatialUnitResponse_dryRun); + + $("#spatialUnitAddErrorAlert").show(); + $scope.loadingData = false; + + setTimeout(() => { + $scope.$digest(); + }, 250); + + } + } catch (error) { + if(error.data){ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else{ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + + if(newSpatialUnitResponse_dryRun){ + $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(newSpatialUnitResponse_dryRun); + } + + $("#spatialUnitAddErrorAlert").show(); + $scope.loadingData = false; + + setTimeout(() => { + $scope.$digest(); + }, 250); + } + } + + }; + + $scope.onImportSpatialUnitAddMetadata = function(){ + + $scope.spatialUnitMetadataImportError = ""; + + $("#spatialUnitMetadataImportFile").files = []; + + // trigger file chooser + $("#spatialUnitMetadataImportFile").click(); + + }; + + $(document).on("change", "#spatialUnitMetadataImportFile" ,function(){ + + console.log("Importing SpatialUnit metadata for Add SpatialUnit Form"); + + // get the file + var file = document.getElementById('spatialUnitMetadataImportFile').files[0]; + $scope.parseMetadataFromFile(file); + }); + + $scope.parseMetadataFromFile = function(file){ + var fileReader = new FileReader(); + + fileReader.onload = function(event) { + + try{ + $scope.parseFromMetadataFile(event); + } + catch(error){ + console.error(error); + console.error("Uploaded Metadata File cannot be parsed."); + $scope.spatialUnitMetadataImportError = "Uploaded Metadata File cannot be parsed correctly"; + document.getElementById("spatialUnitsAddMetadataPre").innerHTML = $scope.spatialUnitMetadataStructure_pretty; + $("#spatialUnitMetadataImportErrorAlert").show(); + + $scope.$digest(); + } + + }; + + // Read in the image file as a data URL. + fileReader.readAsText(file); + }; + + $scope.parseFromMetadataFile = function(event){ + // $scope.geoJsonString = event.target.result; + $scope.metadataImportSettings = JSON.parse(event.target.result); + + if(! $scope.metadataImportSettings.metadata){ + console.error("uploaded Metadata File cannot be parsed - wrong structure."); + $scope.spatialUnitMetadataImportError = "Struktur der Datei stimmt nicht mit erwartetem Muster überein."; + document.getElementById("spatialUnitsAddMetadataPre").innerHTML = $scope.spatialUnitMetadataStructure_pretty; + $("#spatialUnitMetadataImportErrorAlert").show(); + + $scope.$digest(); + } + + $scope.metadata = {}; + $scope.metadata.note = $scope.metadataImportSettings.metadata.note; + $scope.metadata.literature = $scope.metadataImportSettings.metadata.literature; + kommonitorDataExchangeService.updateIntervalOptions.forEach(function(option){ + if(option.apiName === $scope.metadataImportSettings.metadata.updateInterval){ + $scope.metadata.updateInterval = option; + } + }); + $scope.metadata.sridEPSG = $scope.metadataImportSettings.metadata.sridEPSG; + $scope.metadata.datasource = $scope.metadataImportSettings.metadata.datasource; + $scope.metadata.contact = $scope.metadataImportSettings.metadata.contact; + $scope.metadata.lastUpdate = $scope.metadataImportSettings.metadata.lastUpdate; + // initialize date + $('#spatialUnitAddLastUpdateDatepicker').datepicker('setDate', $scope.metadata.lastUpdate); + + $scope.metadata.description = $scope.metadataImportSettings.metadata.description; + $scope.metadata.databasis = $scope.metadataImportSettings.metadata.databasis; + + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('spatialUnitAddRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, $scope.metadataImportSettings.allowedRoles); + + for(var i=0; i 0){ - // error handling - $("#spatialUnitsDeleteErrorAlert").show(); - // if ($scope.successfullyDeletedDatasets.length > 0){ - // $("#spatialUnitsDeleteSuccessAlert").show(); - // } - } - if($scope.successfullyDeletedDatasets.length > 0){ - $("#spatialUnitsDeleteSuccessAlert").show(); - - // fetch indicatorMetada again as a spatialUnit was deleted - await kommonitorDataExchangeService.fetchIndicatorsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles); - // refresh spatial unit overview table - $rootScope.$broadcast("refreshSpatialUnitOverviewTable", "delete", $scope.successfullyDeletedDatasets.map(dataset => {return dataset.spatialUnitId;})); - - // refresh all admin dashboard diagrams due to modified metadata - $timeout(function(){ - $rootScope.$broadcast("refreshAdminDashboardDiagrams"); - }, 500); - } - - $timeout(function(){ - - $scope.loadingData = false; - }); - }, function errorCallback(errorArray) { - - $("#spatialUnitsDeleteErrorAlert").show(); - // if ($scope.successfullyDeletedDatasets.length > 0){ - // $("#spatialUnitsDeleteSuccessAlert").show(); - // } - - $rootScope.$broadcast("refreshSpatialUnitOverviewTable"); - $timeout(function(){ - - $scope.loadingData = false; - }); - }); - - }; - - $scope.getDeleteDatasetPromise = function(dataset){ - return $http({ - url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/spatial-units/" + dataset.spatialUnitId, - method: "DELETE" - }).then(function successCallback(response) { - $scope.successfullyDeletedDatasets.push(dataset); - - // remove entry from array - var index = -1; - - for(var i=0; i< kommonitorDataExchangeService.availableSpatialUnits.length; i++){ - if(kommonitorDataExchangeService.availableSpatialUnits[i].spatialUnitId === dataset.spatialUnitId){ - index = i; - break; - } - } - - if (index > -1) { - kommonitorDataExchangeService.availableSpatialUnits.splice(index, 1); - } - - }, function errorCallback(error) { - if(error.data){ - $scope.failedDatasetsAndErrors.push([dataset, kommonitorDataExchangeService.syntaxHighlightJSON(error.data)]); - } - else{ - $scope.failedDatasetsAndErrors.push([dataset, kommonitorDataExchangeService.syntaxHighlightJSON(error)]); - } - - }); - }; - - $scope.hideSuccessAlert = function(){ - $("#spatialUnitsDeleteSuccessAlert").hide(); - }; - - $scope.hideErrorAlert = function(){ - $("#spatialUnitsDeleteErrorAlert").hide(); - }; - - } -]}); + templateUrl: "components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitDeleteModal/spatial-unit-delete-modal.template.html", + controller: ['kommonitorDataExchangeService', '$scope', '$rootScope', '$http', '__env', '$q', '$timeout', function SpatialUnitDeleteModalController(kommonitorDataExchangeService, $scope, $rootScope, $http, __env, $q, $timeout) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + $scope.datasetsToDelete = []; + $scope.loadingData = false; + $scope.successfullyDeletedDatasets = []; + $scope.failedDatasetsAndErrors = []; + $scope.$on("onDeleteSpatialUnits", function (event, datasets) { + $scope.loadingData = true; + $scope.datasetsToDelete = datasets; + $scope.resetSpatialUnitsDeleteForm(); + $timeout(function () { + $scope.loadingData = false; + }); + }); + $scope.resetSpatialUnitsDeleteForm = function () { + $scope.successfullyDeletedDatasets = []; + $scope.failedDatasetsAndErrors = []; + $("#spatialUnitsDeleteSuccessAlert").hide(); + $("#spatialUnitsDeleteErrorAlert").hide(); + }; + $scope.deleteSpatialUnits = function () { + // TODO verify input + // TODO Create and perform POST Request with loading screen + $scope.loadingData = true; + var deletePromises = []; + $scope.datasetsToDelete.forEach(function (dataset) { + deletePromises.push($scope.getDeleteDatasetPromise(dataset)); + }); + $q.all(deletePromises).then(async function successCallback(successArray) { + // + if ($scope.failedDatasetsAndErrors.length > 0) { + // error handling + $("#spatialUnitsDeleteErrorAlert").show(); + // if ($scope.successfullyDeletedDatasets.length > 0){ + // $("#spatialUnitsDeleteSuccessAlert").show(); + // } + } + if ($scope.successfullyDeletedDatasets.length > 0) { + $("#spatialUnitsDeleteSuccessAlert").show(); + // fetch indicatorMetada again as a spatialUnit was deleted + await kommonitorDataExchangeService.fetchIndicatorsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles); + // refresh spatial unit overview table + $rootScope.$broadcast("refreshSpatialUnitOverviewTable", "delete", $scope.successfullyDeletedDatasets.map(dataset => { return dataset.spatialUnitId; })); + // refresh all admin dashboard diagrams due to modified metadata + $timeout(function () { + $rootScope.$broadcast("refreshAdminDashboardDiagrams"); + }, 500); + } + $timeout(function () { + $scope.loadingData = false; + }); + }, function errorCallback(errorArray) { + $("#spatialUnitsDeleteErrorAlert").show(); + // if ($scope.successfullyDeletedDatasets.length > 0){ + // $("#spatialUnitsDeleteSuccessAlert").show(); + // } + $rootScope.$broadcast("refreshSpatialUnitOverviewTable"); + $timeout(function () { + $scope.loadingData = false; + }); + }); + }; + $scope.getDeleteDatasetPromise = function (dataset) { + return $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/spatial-units/" + dataset.spatialUnitId, + method: "DELETE" + }).then(function successCallback(response) { + $scope.successfullyDeletedDatasets.push(dataset); + // remove entry from array + var index = -1; + for (var i = 0; i < kommonitorDataExchangeService.availableSpatialUnits.length; i++) { + if (kommonitorDataExchangeService.availableSpatialUnits[i].spatialUnitId === dataset.spatialUnitId) { + index = i; + break; + } + } + if (index > -1) { + kommonitorDataExchangeService.availableSpatialUnits.splice(index, 1); + } + }, function errorCallback(error) { + if (error.data) { + $scope.failedDatasetsAndErrors.push([dataset, kommonitorDataExchangeService.syntaxHighlightJSON(error.data)]); + } + else { + $scope.failedDatasetsAndErrors.push([dataset, kommonitorDataExchangeService.syntaxHighlightJSON(error)]); + } + }); + }; + $scope.hideSuccessAlert = function () { + $("#spatialUnitsDeleteSuccessAlert").hide(); + }; + $scope.hideErrorAlert = function () { + $("#spatialUnitsDeleteErrorAlert").hide(); + }; + } + ] +}); +//# sourceMappingURL=spatial-unit-delete-modal.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitDeleteModal/spatial-unit-delete-modal.component.js.map b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitDeleteModal/spatial-unit-delete-modal.component.js.map new file mode 100644 index 000000000..6b5a72139 --- /dev/null +++ b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitDeleteModal/spatial-unit-delete-modal.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"spatial-unit-delete-modal.component.js","sourceRoot":"","sources":["spatial-unit-delete-modal.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,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CAAC,CAAC,OAAO,EAAE,6BAA6B,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;qBACzG;gBAEH,CAAC,CAAC,CAAC;YACJ,CAAC,CAAC;YAEF,MAAM,CAAC,gBAAgB,GAAG;gBACzB,CAAC,CAAC,iCAAiC,CAAC,CAAC,IAAI,EAAE,CAAC;YAC7C,CAAC,CAAC;YAEF,MAAM,CAAC,cAAc,GAAG;gBACvB,CAAC,CAAC,+BAA+B,CAAC,CAAC,IAAI,EAAE,CAAC;YAC3C,CAAC,CAAC;QAEJ,CAAC;KACD;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitDeleteModal/spatial-unit-delete-modal.component.ts b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitDeleteModal/spatial-unit-delete-modal.component.ts new file mode 100644 index 000000000..424e6c6c0 --- /dev/null +++ b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitDeleteModal/spatial-unit-delete-modal.component.ts @@ -0,0 +1,133 @@ +angular.module('spatialUnitDeleteModal').component('spatialUnitDeleteModal', { + templateUrl : "components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitDeleteModal/spatial-unit-delete-modal.template.html", + controller : ['kommonitorDataExchangeService', '$scope', '$rootScope', '$http', '__env', '$q', '$timeout', function SpatialUnitDeleteModalController(kommonitorDataExchangeService, $scope, $rootScope, $http, __env, $q, $timeout) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + + $scope.datasetsToDelete = []; + + $scope.loadingData = false; + + $scope.successfullyDeletedDatasets = []; + $scope.failedDatasetsAndErrors = []; + + $scope.$on("onDeleteSpatialUnits", function (event, datasets) { + $scope.loadingData = true; + + $scope.datasetsToDelete = datasets; + $scope.resetSpatialUnitsDeleteForm(); + + $timeout(function(){ + $scope.loadingData = false; + }); + }); + + + $scope.resetSpatialUnitsDeleteForm = function(){ + + $scope.successfullyDeletedDatasets = []; + $scope.failedDatasetsAndErrors = []; + $("#spatialUnitsDeleteSuccessAlert").hide(); + $("#spatialUnitsDeleteErrorAlert").hide(); + }; + + $scope.deleteSpatialUnits = function(){ + + // TODO verify input + + // TODO Create and perform POST Request with loading screen + + $scope.loadingData = true; + + var deletePromises = []; + + $scope.datasetsToDelete.forEach(function(dataset){ + deletePromises.push($scope.getDeleteDatasetPromise(dataset)); + }); + + $q.all(deletePromises).then(async function successCallback(successArray) { + // + + if($scope.failedDatasetsAndErrors.length > 0){ + // error handling + $("#spatialUnitsDeleteErrorAlert").show(); + // if ($scope.successfullyDeletedDatasets.length > 0){ + // $("#spatialUnitsDeleteSuccessAlert").show(); + // } + } + if($scope.successfullyDeletedDatasets.length > 0){ + $("#spatialUnitsDeleteSuccessAlert").show(); + + // fetch indicatorMetada again as a spatialUnit was deleted + await kommonitorDataExchangeService.fetchIndicatorsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles); + // refresh spatial unit overview table + $rootScope.$broadcast("refreshSpatialUnitOverviewTable", "delete", $scope.successfullyDeletedDatasets.map(dataset => {return dataset.spatialUnitId;})); + + // refresh all admin dashboard diagrams due to modified metadata + $timeout(function(){ + $rootScope.$broadcast("refreshAdminDashboardDiagrams"); + }, 500); + } + + $timeout(function(){ + + $scope.loadingData = false; + }); + }, function errorCallback(errorArray) { + + $("#spatialUnitsDeleteErrorAlert").show(); + // if ($scope.successfullyDeletedDatasets.length > 0){ + // $("#spatialUnitsDeleteSuccessAlert").show(); + // } + + $rootScope.$broadcast("refreshSpatialUnitOverviewTable"); + $timeout(function(){ + + $scope.loadingData = false; + }); + }); + + }; + + $scope.getDeleteDatasetPromise = function(dataset){ + return $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/spatial-units/" + dataset.spatialUnitId, + method: "DELETE" + }).then(function successCallback(response) { + $scope.successfullyDeletedDatasets.push(dataset); + + // remove entry from array + var index = -1; + + for(var i=0; i< kommonitorDataExchangeService.availableSpatialUnits.length; i++){ + if(kommonitorDataExchangeService.availableSpatialUnits[i].spatialUnitId === dataset.spatialUnitId){ + index = i; + break; + } + } + + if (index > -1) { + kommonitorDataExchangeService.availableSpatialUnits.splice(index, 1); + } + + }, function errorCallback(error) { + if(error.data){ + $scope.failedDatasetsAndErrors.push([dataset, kommonitorDataExchangeService.syntaxHighlightJSON(error.data)]); + } + else{ + $scope.failedDatasetsAndErrors.push([dataset, kommonitorDataExchangeService.syntaxHighlightJSON(error)]); + } + + }); + }; + + $scope.hideSuccessAlert = function(){ + $("#spatialUnitsDeleteSuccessAlert").hide(); + }; + + $scope.hideErrorAlert = function(){ + $("#spatialUnitsDeleteErrorAlert").hide(); + }; + + } +]}); diff --git a/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitDeleteModal/spatial-unit-delete-modal.module.js b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitDeleteModal/spatial-unit-delete-modal.module.js index 9684858f1..70bc97e9e 100644 --- a/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitDeleteModal/spatial-unit-delete-modal.module.js +++ b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitDeleteModal/spatial-unit-delete-modal.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('spatialUnitDeleteModal', []); +//# sourceMappingURL=spatial-unit-delete-modal.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitDeleteModal/spatial-unit-delete-modal.module.js.map b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitDeleteModal/spatial-unit-delete-modal.module.js.map new file mode 100644 index 000000000..1862fd932 --- /dev/null +++ b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitDeleteModal/spatial-unit-delete-modal.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"spatial-unit-delete-modal.module.js","sourceRoot":"","sources":["spatial-unit-delete-modal.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,wBAAwB,EAAE,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitDeleteModal/spatial-unit-delete-modal.module.ts b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitDeleteModal/spatial-unit-delete-modal.module.ts new file mode 100644 index 000000000..9684858f1 --- /dev/null +++ b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitDeleteModal/spatial-unit-delete-modal.module.ts @@ -0,0 +1 @@ +angular.module('spatialUnitDeleteModal', []); diff --git a/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditFeaturesModal/spatial-unit-edit-features-modal.component.js b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditFeaturesModal/spatial-unit-edit-features-modal.component.js index 3fab16074..8d91469ae 100644 --- a/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditFeaturesModal/spatial-unit-edit-features-modal.component.js +++ b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditFeaturesModal/spatial-unit-edit-features-modal.component.js @@ -1,740 +1,577 @@ +"use strict"; angular.module('spatialUnitEditFeaturesModal').component('spatialUnitEditFeaturesModal', { - templateUrl : "components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditFeaturesModal/spatial-unit-edit-features-modal.template.html", - controller : ['kommonitorDataExchangeService', 'kommonitorDataGridHelperService', 'kommonitorImporterHelperService', - '$scope', '$rootScope', '$http', '__env', '$timeout', 'kommonitorMultiStepFormHelperService', - function SpatialUnitEditFeaturesModalController(kommonitorDataExchangeService, kommonitorDataGridHelperService, - kommonitorImporterHelperService, $scope, $rootScope, $http, __env, $timeout, kommonitorMultiStepFormHelperService) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorImporterHelperServiceInstance = kommonitorImporterHelperService; - this.kommonitorDataGridHelperServiceInstance = kommonitorDataGridHelperService; - - /* POST BODY - { - "geoJsonString": "geoJsonString", - "metadata": { - "note": "note", - "literature": "literature", - "updateInterval": "ARBITRARY", - "sridEPSG": 0.8008281904610115, - "datasource": "datasource", - "contact": "contact", - "lastUpdate": "2000-01-23", - "description": "description", - "databasis": "databasis" - }, - "jsonSchema": "jsonSchema", - "nextLowerHierarchyLevel": "nextLowerHierarchyLevel", - "spatialUnitLevel": "spatialUnitLevel", - "periodOfValidity": { - "endDate": "2000-01-23", - "startDate": "2000-01-23" - }, - "nextUpperHierarchyLevel": "nextUpperHierarchyLevel" - } - */ - - //Date picker - $('#spatialUnitEditFeaturesDatepickerStart').datepicker(kommonitorDataExchangeService.datePickerOptions); - $('#spatialUnitEditFeaturesDatepickerEnd').datepicker(kommonitorDataExchangeService.datePickerOptions); - - $scope.spatialUnitFeaturesGeoJSON; - $scope.currentSpatialUnitDataset; - $scope.remainingFeatureHeaders; - - $scope.spatialUnitMappingConfigStructure_pretty = kommonitorDataExchangeService.syntaxHighlightJSON(kommonitorImporterHelperService.mappingConfigStructure); - $scope.spatialUnitMappingConfigImportError; - - $scope.loadingData = false; - - $scope.periodOfValidity = {}; - $scope.periodOfValidity.startDate = undefined; - $scope.periodOfValidity.endDate = undefined; - $scope.periodOfValidityInvalid = false; - - $scope.geoJsonString = undefined; - $scope.spatialUnit_asGeoJson = undefined; - - $scope.spatialUnitEditFeaturesDataSourceInputInvalidReason = undefined; - $scope.spatialUnitEditFeaturesDataSourceInputInvalid = false; - $scope.spatialUnitDataSourceIdProperty = undefined; - $scope.spatialUnitDataSourceNameProperty = undefined; - - $scope.converter = undefined; - $scope.schema = undefined; - $scope.mimeType = undefined; - $scope.datasourceType = undefined; - $scope.spatialUnitDataSourceIdProperty = undefined; - $scope.spatialUnitDataSourceNameProperty = undefined; - - $scope.converterDefinition = undefined; - $scope.datasourceTypeDefinition = undefined; - $scope.propertyMappingDefinition = undefined; - $scope.putBody_spatialUnits = undefined; - - $scope.validityEndDate_perFeature = undefined; - $scope.validityStartDate_perFeature = undefined; - - $scope.attributeMapping_sourceAttributeName = undefined; - $scope.attributeMapping_destinationAttributeName = undefined; - $scope.attributeMapping_data = undefined; - $scope.attributeMapping_attributeType = kommonitorImporterHelperService.attributeMapping_attributeTypes[0]; - $scope.attributeMappings_adminView = []; - $scope.keepAttributes = true; - $scope.keepMissingValues = true; - - $scope.importerErrors = undefined; - $scope.successMessagePart = undefined; - $scope.errorMessagePart = undefined; - - $scope.$on("onEditSpatialUnitFeatures", function (event, spatialUnitDataset) { - - kommonitorMultiStepFormHelperService.registerClickHandler(); - - if($scope.currentSpatialUnitDataset && $scope.currentSpatialUnitDataset.spatialUnitLevel === spatialUnitDataset.spatialUnitLevel){ - return; - } - else{ - $scope.currentSpatialUnitDataset = spatialUnitDataset; - - // $scope.refreshSpatialUnitEditFeaturesOverviewTable(); - - $scope.resetSpatialUnitEditFeaturesForm(); - - kommonitorDataGridHelperService.buildDataGrid_featureTable_spatialResource("spatialUnitFeatureTable", [], []); - } - - - - }); - - $scope.onChangeConverter = function(schema){ - $scope.schema = $scope.converter.schemas ? $scope.converter.schemas[0] : undefined; - $scope.mimeType = $scope.converter.mimeTypes[0]; - }; - - $scope.onChangeMimeType = function(mimeType){ - $scope.mimeType = mimeType; - }; - - $scope.refreshSpatialUnitEditFeaturesOverviewTable = function(){ - - $scope.loadingData = true; - // fetch all spatial unit features - $http({ - url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/spatial-units/" + $scope.currentSpatialUnitDataset.spatialUnitId + "/allFeatures", - method: "GET", - // headers: { - // 'Content-Type': undefined - // } - }).then(function successCallback(response) { - - $scope.spatialUnitFeaturesGeoJSON = response.data; - - var tmpRemainingHeaders = []; - - for (var property in $scope.spatialUnitFeaturesGeoJSON.features[0].properties){ - if (property != __env.FEATURE_ID_PROPERTY_NAME && property != __env.FEATURE_NAME_PROPERTY_NAME && property != __env.VALID_START_DATE_PROPERTY_NAME && property != __env.VALID_END_DATE_PROPERTY_NAME){ - tmpRemainingHeaders.push(property); - } - } - - $scope.remainingFeatureHeaders = tmpRemainingHeaders; - - kommonitorDataGridHelperService.buildDataGrid_featureTable_spatialResource("spatialUnitFeatureTable", tmpRemainingHeaders, $scope.spatialUnitFeaturesGeoJSON.features, $scope.currentSpatialUnitDataset.spatialUnitId, kommonitorDataGridHelperService.resourceType_spatialUnit, $scope.enableDeleteFeatures); - - $timeout(function(){ - - $scope.loadingData = false; - }); - - }, function errorCallback(error) { - if(error.data){ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else{ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - - $("#spatialUnitEditFeaturesErrorAlert").show(); - $timeout(function(){ - - $scope.loadingData = false; - }); - }); - }; - - $scope.clearAllSpatialUnitFeatures = function(){ - $scope.loadingData = true; - // delete all georesource features - $http({ - url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/spatial-units/" + $scope.currentSpatialUnitDataset.spatialUnitId + "/allFeatures", - method: "DELETE", - // headers: { - // 'Content-Type': undefined - // } - }).then(function successCallback(response) { - - $scope.spatialUnitFeaturesGeoJSON = undefined; - $scope.remainingFeatureHeaders = undefined; - - $rootScope.$broadcast("refreshSpatialUnitOverviewTable", "edit", $scope.currentSpatialUnitDataset.spatialUnitId); - // $scope.refreshGeoresourceEditFeaturesOverviewTable(); - // force empty feature overview table on successful deletion of entries - kommonitorDataGridHelperService.buildDataGrid_featureTable_spatialResource("spatialUnitFeatureTable", [], []); - - $scope.successMessagePart = $scope.currentSpatialUnitDataset.spatialUnitLevel; - - $("#spatialUnitEditFeaturesSuccessAlert").show(); - $timeout(function(){ - - $scope.loadingData = false; - }); - - }, function errorCallback(error) { - if(error.data){ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else{ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - - $("#spatialUnitEditFeaturesErrorAlert").show(); - $timeout(function(){ - - $scope.loadingData = false; - }); - }); - }; - - $scope.resetSpatialUnitEditFeaturesForm = function(){ - - // reset edit banners - kommonitorDataGridHelperService.featureTable_spatialUnit_lastUpdate_timestamp_success = undefined; - kommonitorDataGridHelperService.featureTable_spatialUnit_lastUpdate_timestamp_failure = undefined; - - $scope.spatialUnitFeaturesGeoJSON = undefined; - $scope.remainingFeatureHeaders = undefined; - - $scope.periodOfValidity = {}; - $scope.periodOfValidity.startDate = undefined; - $scope.periodOfValidity.endDate = undefined; - $scope.periodOfValidityInvalid = false; - - $scope.geoJsonString = undefined; - $scope.spatialUnit_asGeoJson = undefined; - - $scope.spatialUnitEditFeaturesDataSourceInputInvalidReason = undefined; - $scope.spatialUnitEditFeaturesDataSourceInputInvalid = false; - $scope.spatialUnitDataSourceIdProperty = undefined; - $scope.spatialUnitDataSourceNameProperty = undefined; - - $scope.converter = undefined; - $scope.schema = undefined; - $scope.mimeType = undefined; - $scope.datasourceType = undefined; - $scope.spatialUnitDataSourceIdProperty = undefined; - $scope.spatialUnitDataSourceNameProperty = undefined; - - $scope.converterDefinition = undefined; - $scope.datasourceTypeDefinition = undefined; - $scope.propertyMappingDefinition = undefined; - $scope.putBody_spatialUnits = undefined; - - $scope.validityEndDate_perFeature = undefined; - $scope.validityStartDate_perFeature = undefined; - - $scope.attributeMapping_sourceAttributeName = undefined; - $scope.attributeMapping_destinationAttributeName = undefined; - $scope.attributeMapping_data = undefined; - $scope.attributeMapping_attributeType = kommonitorImporterHelperService.attributeMapping_attributeTypes[0]; - $scope.attributeMappings_adminView = []; - $scope.keepAttributes = true; - $scope.keepMissingValues = true; - - $scope.importerErrors = undefined; - $scope.successMessagePart = undefined; - $scope.errorMessagePart = undefined; - - $("#spatialUnitEditFeaturesSuccessAlert").hide(); - $("#spatialUnitEditFeaturesErrorAlert").hide(); - - setTimeout(() => { - $scope.$digest(); - }, 250); - }; - - $scope.filterByKomMonitorProperties = function() { - return function( item ) { - - try{ - if (item === __env.FEATURE_ID_PROPERTY_NAME || item === __env.FEATURE_NAME_PROPERTY_NAME || item === "validStartDate" || item === "validEndDate"){ - return false; - } - return true; - } - catch(error){ - return false; - } - }; - }; - - $scope.getFeatureId = function(geojsonFeature){ - return geojsonFeature.properties[__env.FEATURE_ID_PROPERTY_NAME]; - }; - - $scope.getFeatureName = function(geojsonFeature){ - return geojsonFeature.properties[__env.FEATURE_NAME_PROPERTY_NAME]; - }; - - $scope.checkPeriodOfValidity = function(){ - $scope.periodOfValidityInvalid = false; - if ($scope.periodOfValidity.startDate && $scope.periodOfValidity.endDate){ - var startDate = new Date($scope.periodOfValidity.startDate); - var endDate = new Date($scope.periodOfValidity.endDate); - - if ((startDate === endDate) || startDate > endDate){ - // failure - $scope.periodOfValidityInvalid = true; - } - } - }; - - $scope.onAddOrUpdateAttributeMapping = function(){ - var tmpAttributeMapping_adminView = { - "sourceName": $scope.attributeMapping_sourceAttributeName, - "destinationName": $scope.attributeMapping_destinationAttributeName, - "dataType": $scope.attributeMapping_attributeType - }; - - var processed = false; - - for (let index = 0; index < $scope.attributeMappings_adminView.length; index++) { - var attributeMappingEntry_adminView = $scope.attributeMappings_adminView[index]; - - if (attributeMappingEntry_adminView.sourceName === tmpAttributeMapping_adminView.sourceName){ - // replace object - $scope.attributeMappings_adminView[index] = tmpAttributeMapping_adminView; - processed = true; - break; - } - } - - if(! processed){ - // new entry - $scope.attributeMappings_adminView.push(tmpAttributeMapping_adminView); - } - - $scope.attributeMapping_sourceAttributeName = undefined; - $scope.attributeMapping_destinationAttributeName = undefined; - $scope.attributeMapping_attributeType = kommonitorImporterHelperService.attributeMapping_attributeTypes[0]; - - setTimeout(() => { - $scope.$digest(); - }, 250); - }; - - $scope.onClickEditAttributeMapping = function(attributeMappingEntry){ - $scope.attributeMapping_sourceAttributeName = attributeMappingEntry.sourceName; - $scope.attributeMapping_destinationAttributeName = attributeMappingEntry.destinationName; - $scope.attributeMapping_attributeType = attributeMappingEntry.dataType; - - setTimeout(() => { - $scope.$digest(); - }, 250); - }; - - $scope.onClickDeleteAttributeMapping = function(attributeMappingEntry){ - for (let index = 0; index < $scope.attributeMappings_adminView.length; index++) { - - if ($scope.attributeMappings_adminView[index].sourceName === attributeMappingEntry.sourceName){ - // remove object - $scope.attributeMappings_adminView.splice(index, 1); - break; - } - } - - setTimeout(() => { - $scope.$digest(); - }, 250); - }; - - $scope.buildImporterObjects = async function(){ - $scope.converterDefinition = $scope.buildConverterDefinition(); - $scope.datasourceTypeDefinition = await $scope.buildDatasourceTypeDefinition(); - $scope.propertyMappingDefinition = $scope.buildPropertyMappingDefinition(); - $scope.putBody_spatialUnits = $scope.buildPutBody_spatialUnits(); - - if(!$scope.converterDefinition || !$scope.datasourceTypeDefinition || !$scope.propertyMappingDefinition || !$scope.putBody_spatialUnits){ - return false; - } - - return true; - }; - - $scope.buildConverterDefinition = function(){ - - return kommonitorImporterHelperService.buildConverterDefinition($scope.converter, "converterParameter_spatialUnitEditFeatures_", $scope.schema, $scope.mimeType); - }; - - $scope.buildDatasourceTypeDefinition = async function(){ - try { - return await kommonitorImporterHelperService.buildDatasourceTypeDefinition($scope.datasourceType, 'datasourceTypeParameter_spatialUnitEditFeatures_', 'spatialUnitDataSourceInput_editFeatures'); - } catch (error) { - if(error.data){ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else{ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - - $("#spatialUnitEditFeaturesErrorAlert").show(); - $timeout(function(){ - - $scope.loadingData = false; - }); - return null; - } - }; - - $scope.buildPropertyMappingDefinition = function(){ - // arsion from is undefined currently - return kommonitorImporterHelperService.buildPropertyMapping_spatialResource($scope.spatialUnitDataSourceNameProperty, $scope.spatialUnitDataSourceIdProperty, $scope.validityStartDate_perFeature, $scope.validityEndDate_perFeature, undefined, $scope.keepAttributes, $scope.keepMissingValues, $scope.attributeMappings_adminView); - }; - - $scope.buildPutBody_spatialUnits = function(){ - var putBody = - { - "geoJsonString": "", // will be set by importer - "periodOfValidity": { - "endDate": $scope.periodOfValidity.endDate, - "startDate": $scope.periodOfValidity.startDate - }, - "isPartialUpdate": $scope.isPartialUpdate - }; - - return putBody; - }; - - - $scope.editSpatialUnitFeatures = async function(){ - - $timeout(function(){ - $scope.loadingData = true; - }); - - $scope.importerErrors = undefined; - $scope.successMessagePart = undefined; - $scope.errorMessagePart = undefined; - - /* - now collect data and build request for importer - */ - - /* - if any required importer data is missing --> cancel request and highlight required errors - */ - var allDataSpecified = await $scope.buildImporterObjects(); - - if (!allDataSpecified) { - - $("#spatialUnitEditFeaturesForm").validator("update"); - $("#spatialUnitEditFeaturesForm").validator("validate"); - return; - } - else { - - - // TODO verify input - - // TODO Create and perform POST Request with loading screen - - var updateSpatialUnitResponse_dryRun = undefined; - try { - updateSpatialUnitResponse_dryRun = await kommonitorImporterHelperService.updateSpatialUnit($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.currentSpatialUnitDataset.spatialUnitId, $scope.putBody_spatialUnits, true); - - if(! kommonitorImporterHelperService.importerResponseContainsErrors(updateSpatialUnitResponse_dryRun)){ - // all good, really execute the request to import data against data management API - - var updateSpatialUnitResponse = await kommonitorImporterHelperService.updateSpatialUnit($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.currentSpatialUnitDataset.spatialUnitId, $scope.putBody_spatialUnits, false); - $scope.successMessagePart = $scope.putBody_spatialUnits.spatialUnitLevel; - $scope.importedFeatures = kommonitorImporterHelperService.getImportedFeaturesFromImporterResponse(updateSpatialUnitResponse); - - $rootScope.$broadcast("refreshSpatialUnitOverviewTable", "edit", $scope.currentSpatialUnitDataset.spatialUnitId); - // $scope.refreshSpatialUnitEditFeaturesOverviewTable(); - - $scope.successMessagePart = $scope.currentSpatialUnitDataset.spatialUnitLevel; - - $("#spatialUnitEditFeaturesSuccessAlert").show(); - $timeout(function(){ - - $scope.loadingData = false; - }); - } - else{ - // errors ocurred - // show them - $scope.errorMessagePart = "Einige der zu importierenden Features des Datensatzes weisen kritische Fehler auf"; - $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(updateSpatialUnitResponse_dryRun); - - $("#spatialUnitEditFeaturesErrorAlert").show(); - $scope.loadingData = false; - - setTimeout(() => { - $scope.$digest(); - }, 250); - - } - - } catch (error) { - if(error.data){ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else{ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - - if(updateSpatialUnitResponse_dryRun){ - $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(updateSpatialUnitResponse_dryRun); - } - - $("#spatialUnitEditFeaturesErrorAlert").show(); - $scope.loadingData = false; - - setTimeout(() => { - $scope.$digest(); - }, 250); - } - } - }; - - $scope.onImportSpatialUnitEditFeaturesMappingConfig = function(){ - - $scope.spatialUnitMappingConfigImportError = ""; - - $("#spatialUnitMappingConfigEditFeaturesImportFile").files = []; - - // trigger file chooser - $("#spatialUnitMappingConfigEditFeaturesImportFile").click(); - - }; - - $(document).on("change", "#spatialUnitMappingConfigEditFeaturesImportFile" ,function(){ - - console.log("Importing Importer Mapping Config for EditFeatures SpatialUnit Form"); - - // get the file - var file = document.getElementById('spatialUnitMappingConfigEditFeaturesImportFile').files[0]; - $scope.parseMappingConfigFromFile(file); - }); - - $scope.parseMappingConfigFromFile = function(file){ - var fileReader = new FileReader(); - - fileReader.onload = function(event) { - - try{ - $scope.parseFromMappingConfigFile(event); - } - catch(error){ - console.error(error); - console.error("Uploaded MappingConfig File cannot be parsed."); - $scope.spatialUnitMappingConfigImportError = "Uploaded MappingConfig File cannot be parsed correctly"; - document.getElementById("spatialUnitsEditFeaturesMappingConfigPre").innerHTML = $scope.spatialUnitMappingConfigStructure_pretty; - $("#spatialUnitEditFeaturesMappingConfigImportErrorAlert").show(); - - $scope.$digest(); - } - - }; - - // Read in the image file as a data URL. - fileReader.readAsText(file); - }; - - $scope.parseFromMappingConfigFile = function(event){ - $scope.mappingConfigImportSettings = JSON.parse(event.target.result); - - if(! $scope.mappingConfigImportSettings.converter || ! $scope.mappingConfigImportSettings.dataSource || ! $scope.mappingConfigImportSettings.propertyMapping){ - console.error("uploaded MappingConfig File cannot be parsed - wrong structure."); - $scope.spatialUnitMetadataImportError = "Struktur der Datei stimmt nicht mit erwartetem Muster überein."; - document.getElementById("spatialUnitsEditFeaturesMappingConfigPre").innerHTML = $scope.spatialUnitMappingConfigStructure_pretty; - $("#spatialUnitEditFeaturesMappingConfigImportErrorAlert").show(); - - $scope.$digest(); - } - - $scope.converter = undefined; - for(var converter of kommonitorImporterHelperService.availableConverters){ - if (converter.name === $scope.mappingConfigImportSettings.converter.name){ - $scope.converter = converter; - break; - } - } - - $scope.schema = undefined; - if ($scope.converter && $scope.converter.schemas && $scope.mappingConfigImportSettings.converter.schema){ - for (var schema of $scope.converter.schemas) { - if (schema === $scope.mappingConfigImportSettings.converter.schema){ - $scope.schema = schema; - } - } - } - - $scope.mimeType = undefined; - if ($scope.converter && $scope.converter.mimeTypes && $scope.mappingConfigImportSettings.converter.mimeType){ - for (var mimeType of $scope.converter.mimeTypes) { - if (mimeType === $scope.mappingConfigImportSettings.converter.mimeType){ - $scope.mimeType = mimeType; - } - } - } - - $scope.datasourceType = undefined; - for(var datasourceType of kommonitorImporterHelperService.availableDatasourceTypes){ - if (datasourceType.type === $scope.mappingConfigImportSettings.dataSource.type){ - $scope.datasourceType = datasourceType; - break; - } - } - - $scope.$digest(); - - // converter parameters - if ($scope.converter){ - for (var convParameter of $scope.mappingConfigImportSettings.converter.parameters) { - $("#converterParameter_spatialUnitEditFeatures_" + convParameter.name).val(convParameter.value); - } - } - - // datasourceTypes parameters - if ($scope.datasourceType){ - for (var dsParameter of $scope.mappingConfigImportSettings.dataSource.parameters) { - $("#datasourceTypeParameter_spatialUnitEditFeatures_" + dsParameter.name).val(dsParameter.value); - } - } - - // property Mapping - $scope.spatialUnitDataSourceNameProperty = $scope.mappingConfigImportSettings.propertyMapping.nameProperty; - $scope.spatialUnitDataSourceIdProperty = $scope.mappingConfigImportSettings.propertyMapping.identifierProperty; - $scope.validityStartDate_perFeature = $scope.mappingConfigImportSettings.propertyMapping.validStartDateProperty; - $scope.validityEndDate_perFeature = $scope.mappingConfigImportSettings.propertyMapping.validEndDateProperty; - $scope.keepAttributes = $scope.mappingConfigImportSettings.propertyMapping.keepAttributes; - $scope.keepMissingValues = $scope.mappingConfigImportSettings.propertyMapping.keepMissingOrNullValueAttributes; - $scope.attributeMappings_adminView = []; - - for (var attributeMapping of $scope.mappingConfigImportSettings.propertyMapping.attributes) { - var tmpEntry = { - "sourceName": attributeMapping.name, - "destinationName": attributeMapping.mappingName - }; - - for (const dataType of kommonitorImporterHelperService.attributeMapping_attributeTypes) { - if (dataType.apiName === attributeMapping.type){ - tmpEntry.dataType = dataType; - } - } - - $scope.attributeMappings_adminView.push(tmpEntry); - } - - if ($scope.mappingConfigImportSettings.periodOfValidity){ - $scope.periodOfValidity = {}; - $scope.periodOfValidity.startDate = $scope.mappingConfigImportSettings.periodOfValidity.startDate; - $scope.periodOfValidity.endDate = $scope.mappingConfigImportSettings.periodOfValidity.endDate; - $scope.periodOfValidityInvalid = false; - - // update datePickers - if ($scope.periodOfValidity.startDate){ - $("#spatialUnitEditFeaturesDatepickerStart").datepicker('setDate', $scope.periodOfValidity.startDate); - } - if ($scope.periodOfValidity.endDate){ - $("#spatialUnitEditFeaturesDatepickerEnd").datepicker('setDate', $scope.periodOfValidity.endDate); - } - } - - $scope.$digest(); - }; - - $scope.onExportSpatialUnitEditFeaturesMappingConfig = async function(){ - var converterDefinition = $scope.buildConverterDefinition(); - var datasourceTypeDefinition = await $scope.buildDatasourceTypeDefinition(); - var propertyMappingDefinition = $scope.buildPropertyMappingDefinition(); - - var mappingConfigExport = { - "converter": converterDefinition, - "dataSource": datasourceTypeDefinition, - "propertyMapping": propertyMappingDefinition, - }; - - mappingConfigExport.periodOfValidity = $scope.periodOfValidity; - - var name = $scope.spatialUnitLevel; - - var metadataJSON = JSON.stringify(mappingConfigExport); - - var fileName = "KomMonitor-Import-Mapping-Konfiguration_Export"; - - if (name){ - fileName += "-" + name; - } - - fileName += ".json"; - - var blob = new Blob([metadataJSON], {type: "application/json"}); - var data = URL.createObjectURL(blob); - - var a = document.createElement('a'); - a.download = fileName; - a.href = data; - a.textContent = "JSON"; - a.target = "_blank"; - a.rel = "noopener noreferrer"; - a.click(); - - a.remove(); - }; - - - $scope.hideSuccessAlert = function(){ - $("#spatialUnitEditFeaturesSuccessAlert").hide(); - }; - - $scope.hideErrorAlert = function(){ - $("#spatialUnitEditFeaturesErrorAlert").hide(); - }; - - $scope.hideMappingConfigErrorAlert = function(){ - $("#spatialUnitEditFeaturesMappingConfigImportErrorAlert").hide(); - }; - - $scope.onChangeEnableDeleteFeatures = function(){ - if($scope.enableDeleteFeatures){ - $(".spatialUnitDeleteFeatureRecordBtn").attr("disabled", false); - } - else{ - $(".spatialUnitDeleteFeatureRecordBtn").attr("disabled", true); - } - } - - $rootScope.$on("showLoadingIcon_" + kommonitorDataGridHelperService.resourceType_spatialUnit, function(event){ - $timeout(function(){ - - $scope.loadingData = true; - }); - }); - - $rootScope.$on("hideLoadingIcon_" + kommonitorDataGridHelperService.resourceType_spatialUnit, function(event){ - $timeout(function(){ - - $scope.loadingData = false; - }); - }); - - $rootScope.$on("onDeleteFeatureEntry_" + kommonitorDataGridHelperService.resourceType_spatialUnit, function(event){ - $rootScope.$broadcast("refreshSpatialUnitOverviewTable", "edit", $scope.currentSpatialUnitDataset.spatialUnitId); - $scope.refreshSpatialUnitEditFeaturesOverviewTable(); - }); - - } -]}); + templateUrl: "components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditFeaturesModal/spatial-unit-edit-features-modal.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorDataGridHelperService', 'kommonitorImporterHelperService', + '$scope', '$rootScope', '$http', '__env', '$timeout', 'kommonitorMultiStepFormHelperService', + function SpatialUnitEditFeaturesModalController(kommonitorDataExchangeService, kommonitorDataGridHelperService, kommonitorImporterHelperService, $scope, $rootScope, $http, __env, $timeout, kommonitorMultiStepFormHelperService) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorImporterHelperServiceInstance = kommonitorImporterHelperService; + this.kommonitorDataGridHelperServiceInstance = kommonitorDataGridHelperService; + /* POST BODY + { + "geoJsonString": "geoJsonString", + "metadata": { + "note": "note", + "literature": "literature", + "updateInterval": "ARBITRARY", + "sridEPSG": 0.8008281904610115, + "datasource": "datasource", + "contact": "contact", + "lastUpdate": "2000-01-23", + "description": "description", + "databasis": "databasis" + }, + "jsonSchema": "jsonSchema", + "nextLowerHierarchyLevel": "nextLowerHierarchyLevel", + "spatialUnitLevel": "spatialUnitLevel", + "periodOfValidity": { + "endDate": "2000-01-23", + "startDate": "2000-01-23" + }, + "nextUpperHierarchyLevel": "nextUpperHierarchyLevel" + } + */ + //Date picker + $('#spatialUnitEditFeaturesDatepickerStart').datepicker(kommonitorDataExchangeService.datePickerOptions); + $('#spatialUnitEditFeaturesDatepickerEnd').datepicker(kommonitorDataExchangeService.datePickerOptions); + $scope.spatialUnitFeaturesGeoJSON; + $scope.currentSpatialUnitDataset; + $scope.remainingFeatureHeaders; + $scope.spatialUnitMappingConfigStructure_pretty = kommonitorDataExchangeService.syntaxHighlightJSON(kommonitorImporterHelperService.mappingConfigStructure); + $scope.spatialUnitMappingConfigImportError; + $scope.loadingData = false; + $scope.periodOfValidity = {}; + $scope.periodOfValidity.startDate = undefined; + $scope.periodOfValidity.endDate = undefined; + $scope.periodOfValidityInvalid = false; + $scope.geoJsonString = undefined; + $scope.spatialUnit_asGeoJson = undefined; + $scope.spatialUnitEditFeaturesDataSourceInputInvalidReason = undefined; + $scope.spatialUnitEditFeaturesDataSourceInputInvalid = false; + $scope.spatialUnitDataSourceIdProperty = undefined; + $scope.spatialUnitDataSourceNameProperty = undefined; + $scope.converter = undefined; + $scope.schema = undefined; + $scope.mimeType = undefined; + $scope.datasourceType = undefined; + $scope.spatialUnitDataSourceIdProperty = undefined; + $scope.spatialUnitDataSourceNameProperty = undefined; + $scope.converterDefinition = undefined; + $scope.datasourceTypeDefinition = undefined; + $scope.propertyMappingDefinition = undefined; + $scope.putBody_spatialUnits = undefined; + $scope.validityEndDate_perFeature = undefined; + $scope.validityStartDate_perFeature = undefined; + $scope.attributeMapping_sourceAttributeName = undefined; + $scope.attributeMapping_destinationAttributeName = undefined; + $scope.attributeMapping_data = undefined; + $scope.attributeMapping_attributeType = kommonitorImporterHelperService.attributeMapping_attributeTypes[0]; + $scope.attributeMappings_adminView = []; + $scope.keepAttributes = true; + $scope.keepMissingValues = true; + $scope.importerErrors = undefined; + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + $scope.$on("onEditSpatialUnitFeatures", function (event, spatialUnitDataset) { + kommonitorMultiStepFormHelperService.registerClickHandler(); + if ($scope.currentSpatialUnitDataset && $scope.currentSpatialUnitDataset.spatialUnitLevel === spatialUnitDataset.spatialUnitLevel) { + return; + } + else { + $scope.currentSpatialUnitDataset = spatialUnitDataset; + // $scope.refreshSpatialUnitEditFeaturesOverviewTable(); + $scope.resetSpatialUnitEditFeaturesForm(); + kommonitorDataGridHelperService.buildDataGrid_featureTable_spatialResource("spatialUnitFeatureTable", [], []); + } + }); + $scope.onChangeConverter = function (schema) { + $scope.schema = $scope.converter.schemas ? $scope.converter.schemas[0] : undefined; + $scope.mimeType = $scope.converter.mimeTypes[0]; + }; + $scope.onChangeMimeType = function (mimeType) { + $scope.mimeType = mimeType; + }; + $scope.refreshSpatialUnitEditFeaturesOverviewTable = function () { + $scope.loadingData = true; + // fetch all spatial unit features + $http({ + url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/spatial-units/" + $scope.currentSpatialUnitDataset.spatialUnitId + "/allFeatures", + method: "GET", + // headers: { + // 'Content-Type': undefined + // } + }).then(function successCallback(response) { + $scope.spatialUnitFeaturesGeoJSON = response.data; + var tmpRemainingHeaders = []; + for (var property in $scope.spatialUnitFeaturesGeoJSON.features[0].properties) { + if (property != __env.FEATURE_ID_PROPERTY_NAME && property != __env.FEATURE_NAME_PROPERTY_NAME && property != __env.VALID_START_DATE_PROPERTY_NAME && property != __env.VALID_END_DATE_PROPERTY_NAME) { + tmpRemainingHeaders.push(property); + } + } + $scope.remainingFeatureHeaders = tmpRemainingHeaders; + kommonitorDataGridHelperService.buildDataGrid_featureTable_spatialResource("spatialUnitFeatureTable", tmpRemainingHeaders, $scope.spatialUnitFeaturesGeoJSON.features, $scope.currentSpatialUnitDataset.spatialUnitId, kommonitorDataGridHelperService.resourceType_spatialUnit, $scope.enableDeleteFeatures); + $timeout(function () { + $scope.loadingData = false; + }); + }, function errorCallback(error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + $("#spatialUnitEditFeaturesErrorAlert").show(); + $timeout(function () { + $scope.loadingData = false; + }); + }); + }; + $scope.clearAllSpatialUnitFeatures = function () { + $scope.loadingData = true; + // delete all georesource features + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/spatial-units/" + $scope.currentSpatialUnitDataset.spatialUnitId + "/allFeatures", + method: "DELETE", + // headers: { + // 'Content-Type': undefined + // } + }).then(function successCallback(response) { + $scope.spatialUnitFeaturesGeoJSON = undefined; + $scope.remainingFeatureHeaders = undefined; + $rootScope.$broadcast("refreshSpatialUnitOverviewTable", "edit", $scope.currentSpatialUnitDataset.spatialUnitId); + // $scope.refreshGeoresourceEditFeaturesOverviewTable(); + // force empty feature overview table on successful deletion of entries + kommonitorDataGridHelperService.buildDataGrid_featureTable_spatialResource("spatialUnitFeatureTable", [], []); + $scope.successMessagePart = $scope.currentSpatialUnitDataset.spatialUnitLevel; + $("#spatialUnitEditFeaturesSuccessAlert").show(); + $timeout(function () { + $scope.loadingData = false; + }); + }, function errorCallback(error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + $("#spatialUnitEditFeaturesErrorAlert").show(); + $timeout(function () { + $scope.loadingData = false; + }); + }); + }; + $scope.resetSpatialUnitEditFeaturesForm = function () { + // reset edit banners + kommonitorDataGridHelperService.featureTable_spatialUnit_lastUpdate_timestamp_success = undefined; + kommonitorDataGridHelperService.featureTable_spatialUnit_lastUpdate_timestamp_failure = undefined; + $scope.spatialUnitFeaturesGeoJSON = undefined; + $scope.remainingFeatureHeaders = undefined; + $scope.periodOfValidity = {}; + $scope.periodOfValidity.startDate = undefined; + $scope.periodOfValidity.endDate = undefined; + $scope.periodOfValidityInvalid = false; + $scope.geoJsonString = undefined; + $scope.spatialUnit_asGeoJson = undefined; + $scope.spatialUnitEditFeaturesDataSourceInputInvalidReason = undefined; + $scope.spatialUnitEditFeaturesDataSourceInputInvalid = false; + $scope.spatialUnitDataSourceIdProperty = undefined; + $scope.spatialUnitDataSourceNameProperty = undefined; + $scope.converter = undefined; + $scope.schema = undefined; + $scope.mimeType = undefined; + $scope.datasourceType = undefined; + $scope.spatialUnitDataSourceIdProperty = undefined; + $scope.spatialUnitDataSourceNameProperty = undefined; + $scope.converterDefinition = undefined; + $scope.datasourceTypeDefinition = undefined; + $scope.propertyMappingDefinition = undefined; + $scope.putBody_spatialUnits = undefined; + $scope.validityEndDate_perFeature = undefined; + $scope.validityStartDate_perFeature = undefined; + $scope.attributeMapping_sourceAttributeName = undefined; + $scope.attributeMapping_destinationAttributeName = undefined; + $scope.attributeMapping_data = undefined; + $scope.attributeMapping_attributeType = kommonitorImporterHelperService.attributeMapping_attributeTypes[0]; + $scope.attributeMappings_adminView = []; + $scope.keepAttributes = true; + $scope.keepMissingValues = true; + $scope.importerErrors = undefined; + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + $("#spatialUnitEditFeaturesSuccessAlert").hide(); + $("#spatialUnitEditFeaturesErrorAlert").hide(); + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.filterByKomMonitorProperties = function () { + return function (item) { + try { + if (item === __env.FEATURE_ID_PROPERTY_NAME || item === __env.FEATURE_NAME_PROPERTY_NAME || item === "validStartDate" || item === "validEndDate") { + return false; + } + return true; + } + catch (error) { + return false; + } + }; + }; + $scope.getFeatureId = function (geojsonFeature) { + return geojsonFeature.properties[__env.FEATURE_ID_PROPERTY_NAME]; + }; + $scope.getFeatureName = function (geojsonFeature) { + return geojsonFeature.properties[__env.FEATURE_NAME_PROPERTY_NAME]; + }; + $scope.checkPeriodOfValidity = function () { + $scope.periodOfValidityInvalid = false; + if ($scope.periodOfValidity.startDate && $scope.periodOfValidity.endDate) { + var startDate = new Date($scope.periodOfValidity.startDate); + var endDate = new Date($scope.periodOfValidity.endDate); + if ((startDate === endDate) || startDate > endDate) { + // failure + $scope.periodOfValidityInvalid = true; + } + } + }; + $scope.onAddOrUpdateAttributeMapping = function () { + var tmpAttributeMapping_adminView = { + "sourceName": $scope.attributeMapping_sourceAttributeName, + "destinationName": $scope.attributeMapping_destinationAttributeName, + "dataType": $scope.attributeMapping_attributeType + }; + var processed = false; + for (let index = 0; index < $scope.attributeMappings_adminView.length; index++) { + var attributeMappingEntry_adminView = $scope.attributeMappings_adminView[index]; + if (attributeMappingEntry_adminView.sourceName === tmpAttributeMapping_adminView.sourceName) { + // replace object + $scope.attributeMappings_adminView[index] = tmpAttributeMapping_adminView; + processed = true; + break; + } + } + if (!processed) { + // new entry + $scope.attributeMappings_adminView.push(tmpAttributeMapping_adminView); + } + $scope.attributeMapping_sourceAttributeName = undefined; + $scope.attributeMapping_destinationAttributeName = undefined; + $scope.attributeMapping_attributeType = kommonitorImporterHelperService.attributeMapping_attributeTypes[0]; + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.onClickEditAttributeMapping = function (attributeMappingEntry) { + $scope.attributeMapping_sourceAttributeName = attributeMappingEntry.sourceName; + $scope.attributeMapping_destinationAttributeName = attributeMappingEntry.destinationName; + $scope.attributeMapping_attributeType = attributeMappingEntry.dataType; + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.onClickDeleteAttributeMapping = function (attributeMappingEntry) { + for (let index = 0; index < $scope.attributeMappings_adminView.length; index++) { + if ($scope.attributeMappings_adminView[index].sourceName === attributeMappingEntry.sourceName) { + // remove object + $scope.attributeMappings_adminView.splice(index, 1); + break; + } + } + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.buildImporterObjects = async function () { + $scope.converterDefinition = $scope.buildConverterDefinition(); + $scope.datasourceTypeDefinition = await $scope.buildDatasourceTypeDefinition(); + $scope.propertyMappingDefinition = $scope.buildPropertyMappingDefinition(); + $scope.putBody_spatialUnits = $scope.buildPutBody_spatialUnits(); + if (!$scope.converterDefinition || !$scope.datasourceTypeDefinition || !$scope.propertyMappingDefinition || !$scope.putBody_spatialUnits) { + return false; + } + return true; + }; + $scope.buildConverterDefinition = function () { + return kommonitorImporterHelperService.buildConverterDefinition($scope.converter, "converterParameter_spatialUnitEditFeatures_", $scope.schema, $scope.mimeType); + }; + $scope.buildDatasourceTypeDefinition = async function () { + try { + return await kommonitorImporterHelperService.buildDatasourceTypeDefinition($scope.datasourceType, 'datasourceTypeParameter_spatialUnitEditFeatures_', 'spatialUnitDataSourceInput_editFeatures'); + } + catch (error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + $("#spatialUnitEditFeaturesErrorAlert").show(); + $timeout(function () { + $scope.loadingData = false; + }); + return null; + } + }; + $scope.buildPropertyMappingDefinition = function () { + // arsion from is undefined currently + return kommonitorImporterHelperService.buildPropertyMapping_spatialResource($scope.spatialUnitDataSourceNameProperty, $scope.spatialUnitDataSourceIdProperty, $scope.validityStartDate_perFeature, $scope.validityEndDate_perFeature, undefined, $scope.keepAttributes, $scope.keepMissingValues, $scope.attributeMappings_adminView); + }; + $scope.buildPutBody_spatialUnits = function () { + var putBody = { + "geoJsonString": "", + "periodOfValidity": { + "endDate": $scope.periodOfValidity.endDate, + "startDate": $scope.periodOfValidity.startDate + }, + "isPartialUpdate": $scope.isPartialUpdate + }; + return putBody; + }; + $scope.editSpatialUnitFeatures = async function () { + $timeout(function () { + $scope.loadingData = true; + }); + $scope.importerErrors = undefined; + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + /* + now collect data and build request for importer + */ + /* + if any required importer data is missing --> cancel request and highlight required errors + */ + var allDataSpecified = await $scope.buildImporterObjects(); + if (!allDataSpecified) { + $("#spatialUnitEditFeaturesForm").validator("update"); + $("#spatialUnitEditFeaturesForm").validator("validate"); + return; + } + else { + // TODO verify input + // TODO Create and perform POST Request with loading screen + var updateSpatialUnitResponse_dryRun = undefined; + try { + updateSpatialUnitResponse_dryRun = await kommonitorImporterHelperService.updateSpatialUnit($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.currentSpatialUnitDataset.spatialUnitId, $scope.putBody_spatialUnits, true); + if (!kommonitorImporterHelperService.importerResponseContainsErrors(updateSpatialUnitResponse_dryRun)) { + // all good, really execute the request to import data against data management API + var updateSpatialUnitResponse = await kommonitorImporterHelperService.updateSpatialUnit($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.currentSpatialUnitDataset.spatialUnitId, $scope.putBody_spatialUnits, false); + $scope.successMessagePart = $scope.putBody_spatialUnits.spatialUnitLevel; + $scope.importedFeatures = kommonitorImporterHelperService.getImportedFeaturesFromImporterResponse(updateSpatialUnitResponse); + $rootScope.$broadcast("refreshSpatialUnitOverviewTable", "edit", $scope.currentSpatialUnitDataset.spatialUnitId); + // $scope.refreshSpatialUnitEditFeaturesOverviewTable(); + $scope.successMessagePart = $scope.currentSpatialUnitDataset.spatialUnitLevel; + $("#spatialUnitEditFeaturesSuccessAlert").show(); + $timeout(function () { + $scope.loadingData = false; + }); + } + else { + // errors ocurred + // show them + $scope.errorMessagePart = "Einige der zu importierenden Features des Datensatzes weisen kritische Fehler auf"; + $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(updateSpatialUnitResponse_dryRun); + $("#spatialUnitEditFeaturesErrorAlert").show(); + $scope.loadingData = false; + setTimeout(() => { + $scope.$digest(); + }, 250); + } + } + catch (error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + if (updateSpatialUnitResponse_dryRun) { + $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(updateSpatialUnitResponse_dryRun); + } + $("#spatialUnitEditFeaturesErrorAlert").show(); + $scope.loadingData = false; + setTimeout(() => { + $scope.$digest(); + }, 250); + } + } + }; + $scope.onImportSpatialUnitEditFeaturesMappingConfig = function () { + $scope.spatialUnitMappingConfigImportError = ""; + $("#spatialUnitMappingConfigEditFeaturesImportFile").files = []; + // trigger file chooser + $("#spatialUnitMappingConfigEditFeaturesImportFile").click(); + }; + $(document).on("change", "#spatialUnitMappingConfigEditFeaturesImportFile", function () { + console.log("Importing Importer Mapping Config for EditFeatures SpatialUnit Form"); + // get the file + var file = document.getElementById('spatialUnitMappingConfigEditFeaturesImportFile').files[0]; + $scope.parseMappingConfigFromFile(file); + }); + $scope.parseMappingConfigFromFile = function (file) { + var fileReader = new FileReader(); + fileReader.onload = function (event) { + try { + $scope.parseFromMappingConfigFile(event); + } + catch (error) { + console.error(error); + console.error("Uploaded MappingConfig File cannot be parsed."); + $scope.spatialUnitMappingConfigImportError = "Uploaded MappingConfig File cannot be parsed correctly"; + document.getElementById("spatialUnitsEditFeaturesMappingConfigPre").innerHTML = $scope.spatialUnitMappingConfigStructure_pretty; + $("#spatialUnitEditFeaturesMappingConfigImportErrorAlert").show(); + $scope.$digest(); + } + }; + // Read in the image file as a data URL. + fileReader.readAsText(file); + }; + $scope.parseFromMappingConfigFile = function (event) { + $scope.mappingConfigImportSettings = JSON.parse(event.target.result); + if (!$scope.mappingConfigImportSettings.converter || !$scope.mappingConfigImportSettings.dataSource || !$scope.mappingConfigImportSettings.propertyMapping) { + console.error("uploaded MappingConfig File cannot be parsed - wrong structure."); + $scope.spatialUnitMetadataImportError = "Struktur der Datei stimmt nicht mit erwartetem Muster überein."; + document.getElementById("spatialUnitsEditFeaturesMappingConfigPre").innerHTML = $scope.spatialUnitMappingConfigStructure_pretty; + $("#spatialUnitEditFeaturesMappingConfigImportErrorAlert").show(); + $scope.$digest(); + } + $scope.converter = undefined; + for (var converter of kommonitorImporterHelperService.availableConverters) { + if (converter.name === $scope.mappingConfigImportSettings.converter.name) { + $scope.converter = converter; + break; + } + } + $scope.schema = undefined; + if ($scope.converter && $scope.converter.schemas && $scope.mappingConfigImportSettings.converter.schema) { + for (var schema of $scope.converter.schemas) { + if (schema === $scope.mappingConfigImportSettings.converter.schema) { + $scope.schema = schema; + } + } + } + $scope.mimeType = undefined; + if ($scope.converter && $scope.converter.mimeTypes && $scope.mappingConfigImportSettings.converter.mimeType) { + for (var mimeType of $scope.converter.mimeTypes) { + if (mimeType === $scope.mappingConfigImportSettings.converter.mimeType) { + $scope.mimeType = mimeType; + } + } + } + $scope.datasourceType = undefined; + for (var datasourceType of kommonitorImporterHelperService.availableDatasourceTypes) { + if (datasourceType.type === $scope.mappingConfigImportSettings.dataSource.type) { + $scope.datasourceType = datasourceType; + break; + } + } + $scope.$digest(); + // converter parameters + if ($scope.converter) { + for (var convParameter of $scope.mappingConfigImportSettings.converter.parameters) { + $("#converterParameter_spatialUnitEditFeatures_" + convParameter.name).val(convParameter.value); + } + } + // datasourceTypes parameters + if ($scope.datasourceType) { + for (var dsParameter of $scope.mappingConfigImportSettings.dataSource.parameters) { + $("#datasourceTypeParameter_spatialUnitEditFeatures_" + dsParameter.name).val(dsParameter.value); + } + } + // property Mapping + $scope.spatialUnitDataSourceNameProperty = $scope.mappingConfigImportSettings.propertyMapping.nameProperty; + $scope.spatialUnitDataSourceIdProperty = $scope.mappingConfigImportSettings.propertyMapping.identifierProperty; + $scope.validityStartDate_perFeature = $scope.mappingConfigImportSettings.propertyMapping.validStartDateProperty; + $scope.validityEndDate_perFeature = $scope.mappingConfigImportSettings.propertyMapping.validEndDateProperty; + $scope.keepAttributes = $scope.mappingConfigImportSettings.propertyMapping.keepAttributes; + $scope.keepMissingValues = $scope.mappingConfigImportSettings.propertyMapping.keepMissingOrNullValueAttributes; + $scope.attributeMappings_adminView = []; + for (var attributeMapping of $scope.mappingConfigImportSettings.propertyMapping.attributes) { + var tmpEntry = { + "sourceName": attributeMapping.name, + "destinationName": attributeMapping.mappingName + }; + for (const dataType of kommonitorImporterHelperService.attributeMapping_attributeTypes) { + if (dataType.apiName === attributeMapping.type) { + tmpEntry.dataType = dataType; + } + } + $scope.attributeMappings_adminView.push(tmpEntry); + } + if ($scope.mappingConfigImportSettings.periodOfValidity) { + $scope.periodOfValidity = {}; + $scope.periodOfValidity.startDate = $scope.mappingConfigImportSettings.periodOfValidity.startDate; + $scope.periodOfValidity.endDate = $scope.mappingConfigImportSettings.periodOfValidity.endDate; + $scope.periodOfValidityInvalid = false; + // update datePickers + if ($scope.periodOfValidity.startDate) { + $("#spatialUnitEditFeaturesDatepickerStart").datepicker('setDate', $scope.periodOfValidity.startDate); + } + if ($scope.periodOfValidity.endDate) { + $("#spatialUnitEditFeaturesDatepickerEnd").datepicker('setDate', $scope.periodOfValidity.endDate); + } + } + $scope.$digest(); + }; + $scope.onExportSpatialUnitEditFeaturesMappingConfig = async function () { + var converterDefinition = $scope.buildConverterDefinition(); + var datasourceTypeDefinition = await $scope.buildDatasourceTypeDefinition(); + var propertyMappingDefinition = $scope.buildPropertyMappingDefinition(); + var mappingConfigExport = { + "converter": converterDefinition, + "dataSource": datasourceTypeDefinition, + "propertyMapping": propertyMappingDefinition, + }; + mappingConfigExport.periodOfValidity = $scope.periodOfValidity; + var name = $scope.spatialUnitLevel; + var metadataJSON = JSON.stringify(mappingConfigExport); + var fileName = "KomMonitor-Import-Mapping-Konfiguration_Export"; + if (name) { + fileName += "-" + name; + } + fileName += ".json"; + var blob = new Blob([metadataJSON], { type: "application/json" }); + var data = URL.createObjectURL(blob); + var a = document.createElement('a'); + a.download = fileName; + a.href = data; + a.textContent = "JSON"; + a.target = "_blank"; + a.rel = "noopener noreferrer"; + a.click(); + a.remove(); + }; + $scope.hideSuccessAlert = function () { + $("#spatialUnitEditFeaturesSuccessAlert").hide(); + }; + $scope.hideErrorAlert = function () { + $("#spatialUnitEditFeaturesErrorAlert").hide(); + }; + $scope.hideMappingConfigErrorAlert = function () { + $("#spatialUnitEditFeaturesMappingConfigImportErrorAlert").hide(); + }; + $scope.onChangeEnableDeleteFeatures = function () { + if ($scope.enableDeleteFeatures) { + $(".spatialUnitDeleteFeatureRecordBtn").attr("disabled", false); + } + else { + $(".spatialUnitDeleteFeatureRecordBtn").attr("disabled", true); + } + }; + $rootScope.$on("showLoadingIcon_" + kommonitorDataGridHelperService.resourceType_spatialUnit, function (event) { + $timeout(function () { + $scope.loadingData = true; + }); + }); + $rootScope.$on("hideLoadingIcon_" + kommonitorDataGridHelperService.resourceType_spatialUnit, function (event) { + $timeout(function () { + $scope.loadingData = false; + }); + }); + $rootScope.$on("onDeleteFeatureEntry_" + kommonitorDataGridHelperService.resourceType_spatialUnit, function (event) { + $rootScope.$broadcast("refreshSpatialUnitOverviewTable", "edit", $scope.currentSpatialUnitDataset.spatialUnitId); + $scope.refreshSpatialUnitEditFeaturesOverviewTable(); + }); + } + ] +}); +//# sourceMappingURL=spatial-unit-edit-features-modal.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditFeaturesModal/spatial-unit-edit-features-modal.component.js.map b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditFeaturesModal/spatial-unit-edit-features-modal.component.js.map new file mode 100644 index 000000000..e9269634e --- /dev/null +++ b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditFeaturesModal/spatial-unit-edit-features-modal.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"spatial-unit-edit-features-modal.component.js","sourceRoot":"","sources":["spatial-unit-edit-features-modal.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,8BAA8B,CAAC,CAAC,SAAS,CAAC,8BAA8B,EAAE;IACxF,WAAW,EAAG,oIAAoI;IAClJ,UAAU,EAAG,CAAC,+BAA+B,EAAE,iCAAiC,EAAE,iCAAiC;QAClH,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,sCAAsC;QAC5F,SAAS,sCAAsC,CAAC,6BAA6B,EAAE,+BAA+B,EAC7G,+BAA+B,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,oCAAoC;YAElH,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAC3E,IAAI,CAAC,uCAAuC,GAAG,+BAA+B,CAAC;YAC/E,IAAI,CAAC,uCAAuC,GAAG,+BAA+B,CAAC;YAE/E;;;;;;;;;;;;;;;;;;;;;;;cAuBE;YAEF,aAAa;YACX,CAAC,CAAC,yCAAyC,CAAC,CAAC,UAAU,CAAC,6BAA6B,CAAC,iBAAiB,CAAC,CAAC;YAC3G,CAAC,CAAC,uCAAuC,CAAC,CAAC,UAAU,CAAC,6BAA6B,CAAC,iBAAiB,CAAC,CAAC;YAEvG,MAAM,CAAC,0BAA0B,CAAC;YAClC,MAAM,CAAC,yBAAyB,CAAC;YACjC,MAAM,CAAC,uBAAuB,CAAC;YAE/B,MAAM,CAAC,wCAAwC,GAAG,6BAA6B,CAAC,mBAAmB,CAAC,+BAA+B,CAAC,sBAAsB,CAAC,CAAC;YAC5J,MAAM,CAAC,mCAAmC,CAAC;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CAAC,CAAC;iBAChE;qBACG;oBACH,CAAC,CAAC,oCAAoC,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;iBAC/D;YACF,CAAC,CAAA;YAEQ,UAAU,CAAC,GAAG,CAAC,kBAAkB,GAAG,+BAA+B,CAAC,wBAAwB,EAAE,UAAS,KAAK;gBACpH,QAAQ,CAAC;oBAER,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC;gBAC3B,CAAC,CAAC,CAAC;YACJ,CAAC,CAAC,CAAC;YAEH,UAAU,CAAC,GAAG,CAAC,kBAAkB,GAAG,+BAA+B,CAAC,wBAAwB,EAAE,UAAS,KAAK;gBAC3G,QAAQ,CAAC;oBAER,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;gBAC5B,CAAC,CAAC,CAAC;YACJ,CAAC,CAAC,CAAC;YAEH,UAAU,CAAC,GAAG,CAAC,uBAAuB,GAAG,+BAA+B,CAAC,wBAAwB,EAAE,UAAS,KAAK;gBAChH,UAAU,CAAC,UAAU,CAAC,iCAAiC,EAAE,MAAM,EAAE,MAAM,CAAC,yBAAyB,CAAC,aAAa,CAAC,CAAC;gBACjH,MAAM,CAAC,2CAA2C,EAAE,CAAC;YACtD,CAAC,CAAC,CAAC;QAEL,CAAC;KACD;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditFeaturesModal/spatial-unit-edit-features-modal.component.ts b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditFeaturesModal/spatial-unit-edit-features-modal.component.ts new file mode 100644 index 000000000..3fab16074 --- /dev/null +++ b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditFeaturesModal/spatial-unit-edit-features-modal.component.ts @@ -0,0 +1,740 @@ +angular.module('spatialUnitEditFeaturesModal').component('spatialUnitEditFeaturesModal', { + templateUrl : "components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditFeaturesModal/spatial-unit-edit-features-modal.template.html", + controller : ['kommonitorDataExchangeService', 'kommonitorDataGridHelperService', 'kommonitorImporterHelperService', + '$scope', '$rootScope', '$http', '__env', '$timeout', 'kommonitorMultiStepFormHelperService', + function SpatialUnitEditFeaturesModalController(kommonitorDataExchangeService, kommonitorDataGridHelperService, + kommonitorImporterHelperService, $scope, $rootScope, $http, __env, $timeout, kommonitorMultiStepFormHelperService) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorImporterHelperServiceInstance = kommonitorImporterHelperService; + this.kommonitorDataGridHelperServiceInstance = kommonitorDataGridHelperService; + + /* POST BODY + { + "geoJsonString": "geoJsonString", + "metadata": { + "note": "note", + "literature": "literature", + "updateInterval": "ARBITRARY", + "sridEPSG": 0.8008281904610115, + "datasource": "datasource", + "contact": "contact", + "lastUpdate": "2000-01-23", + "description": "description", + "databasis": "databasis" + }, + "jsonSchema": "jsonSchema", + "nextLowerHierarchyLevel": "nextLowerHierarchyLevel", + "spatialUnitLevel": "spatialUnitLevel", + "periodOfValidity": { + "endDate": "2000-01-23", + "startDate": "2000-01-23" + }, + "nextUpperHierarchyLevel": "nextUpperHierarchyLevel" + } + */ + + //Date picker + $('#spatialUnitEditFeaturesDatepickerStart').datepicker(kommonitorDataExchangeService.datePickerOptions); + $('#spatialUnitEditFeaturesDatepickerEnd').datepicker(kommonitorDataExchangeService.datePickerOptions); + + $scope.spatialUnitFeaturesGeoJSON; + $scope.currentSpatialUnitDataset; + $scope.remainingFeatureHeaders; + + $scope.spatialUnitMappingConfigStructure_pretty = kommonitorDataExchangeService.syntaxHighlightJSON(kommonitorImporterHelperService.mappingConfigStructure); + $scope.spatialUnitMappingConfigImportError; + + $scope.loadingData = false; + + $scope.periodOfValidity = {}; + $scope.periodOfValidity.startDate = undefined; + $scope.periodOfValidity.endDate = undefined; + $scope.periodOfValidityInvalid = false; + + $scope.geoJsonString = undefined; + $scope.spatialUnit_asGeoJson = undefined; + + $scope.spatialUnitEditFeaturesDataSourceInputInvalidReason = undefined; + $scope.spatialUnitEditFeaturesDataSourceInputInvalid = false; + $scope.spatialUnitDataSourceIdProperty = undefined; + $scope.spatialUnitDataSourceNameProperty = undefined; + + $scope.converter = undefined; + $scope.schema = undefined; + $scope.mimeType = undefined; + $scope.datasourceType = undefined; + $scope.spatialUnitDataSourceIdProperty = undefined; + $scope.spatialUnitDataSourceNameProperty = undefined; + + $scope.converterDefinition = undefined; + $scope.datasourceTypeDefinition = undefined; + $scope.propertyMappingDefinition = undefined; + $scope.putBody_spatialUnits = undefined; + + $scope.validityEndDate_perFeature = undefined; + $scope.validityStartDate_perFeature = undefined; + + $scope.attributeMapping_sourceAttributeName = undefined; + $scope.attributeMapping_destinationAttributeName = undefined; + $scope.attributeMapping_data = undefined; + $scope.attributeMapping_attributeType = kommonitorImporterHelperService.attributeMapping_attributeTypes[0]; + $scope.attributeMappings_adminView = []; + $scope.keepAttributes = true; + $scope.keepMissingValues = true; + + $scope.importerErrors = undefined; + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + + $scope.$on("onEditSpatialUnitFeatures", function (event, spatialUnitDataset) { + + kommonitorMultiStepFormHelperService.registerClickHandler(); + + if($scope.currentSpatialUnitDataset && $scope.currentSpatialUnitDataset.spatialUnitLevel === spatialUnitDataset.spatialUnitLevel){ + return; + } + else{ + $scope.currentSpatialUnitDataset = spatialUnitDataset; + + // $scope.refreshSpatialUnitEditFeaturesOverviewTable(); + + $scope.resetSpatialUnitEditFeaturesForm(); + + kommonitorDataGridHelperService.buildDataGrid_featureTable_spatialResource("spatialUnitFeatureTable", [], []); + } + + + + }); + + $scope.onChangeConverter = function(schema){ + $scope.schema = $scope.converter.schemas ? $scope.converter.schemas[0] : undefined; + $scope.mimeType = $scope.converter.mimeTypes[0]; + }; + + $scope.onChangeMimeType = function(mimeType){ + $scope.mimeType = mimeType; + }; + + $scope.refreshSpatialUnitEditFeaturesOverviewTable = function(){ + + $scope.loadingData = true; + // fetch all spatial unit features + $http({ + url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/spatial-units/" + $scope.currentSpatialUnitDataset.spatialUnitId + "/allFeatures", + method: "GET", + // headers: { + // 'Content-Type': undefined + // } + }).then(function successCallback(response) { + + $scope.spatialUnitFeaturesGeoJSON = response.data; + + var tmpRemainingHeaders = []; + + for (var property in $scope.spatialUnitFeaturesGeoJSON.features[0].properties){ + if (property != __env.FEATURE_ID_PROPERTY_NAME && property != __env.FEATURE_NAME_PROPERTY_NAME && property != __env.VALID_START_DATE_PROPERTY_NAME && property != __env.VALID_END_DATE_PROPERTY_NAME){ + tmpRemainingHeaders.push(property); + } + } + + $scope.remainingFeatureHeaders = tmpRemainingHeaders; + + kommonitorDataGridHelperService.buildDataGrid_featureTable_spatialResource("spatialUnitFeatureTable", tmpRemainingHeaders, $scope.spatialUnitFeaturesGeoJSON.features, $scope.currentSpatialUnitDataset.spatialUnitId, kommonitorDataGridHelperService.resourceType_spatialUnit, $scope.enableDeleteFeatures); + + $timeout(function(){ + + $scope.loadingData = false; + }); + + }, function errorCallback(error) { + if(error.data){ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else{ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + + $("#spatialUnitEditFeaturesErrorAlert").show(); + $timeout(function(){ + + $scope.loadingData = false; + }); + }); + }; + + $scope.clearAllSpatialUnitFeatures = function(){ + $scope.loadingData = true; + // delete all georesource features + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/spatial-units/" + $scope.currentSpatialUnitDataset.spatialUnitId + "/allFeatures", + method: "DELETE", + // headers: { + // 'Content-Type': undefined + // } + }).then(function successCallback(response) { + + $scope.spatialUnitFeaturesGeoJSON = undefined; + $scope.remainingFeatureHeaders = undefined; + + $rootScope.$broadcast("refreshSpatialUnitOverviewTable", "edit", $scope.currentSpatialUnitDataset.spatialUnitId); + // $scope.refreshGeoresourceEditFeaturesOverviewTable(); + // force empty feature overview table on successful deletion of entries + kommonitorDataGridHelperService.buildDataGrid_featureTable_spatialResource("spatialUnitFeatureTable", [], []); + + $scope.successMessagePart = $scope.currentSpatialUnitDataset.spatialUnitLevel; + + $("#spatialUnitEditFeaturesSuccessAlert").show(); + $timeout(function(){ + + $scope.loadingData = false; + }); + + }, function errorCallback(error) { + if(error.data){ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else{ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + + $("#spatialUnitEditFeaturesErrorAlert").show(); + $timeout(function(){ + + $scope.loadingData = false; + }); + }); + }; + + $scope.resetSpatialUnitEditFeaturesForm = function(){ + + // reset edit banners + kommonitorDataGridHelperService.featureTable_spatialUnit_lastUpdate_timestamp_success = undefined; + kommonitorDataGridHelperService.featureTable_spatialUnit_lastUpdate_timestamp_failure = undefined; + + $scope.spatialUnitFeaturesGeoJSON = undefined; + $scope.remainingFeatureHeaders = undefined; + + $scope.periodOfValidity = {}; + $scope.periodOfValidity.startDate = undefined; + $scope.periodOfValidity.endDate = undefined; + $scope.periodOfValidityInvalid = false; + + $scope.geoJsonString = undefined; + $scope.spatialUnit_asGeoJson = undefined; + + $scope.spatialUnitEditFeaturesDataSourceInputInvalidReason = undefined; + $scope.spatialUnitEditFeaturesDataSourceInputInvalid = false; + $scope.spatialUnitDataSourceIdProperty = undefined; + $scope.spatialUnitDataSourceNameProperty = undefined; + + $scope.converter = undefined; + $scope.schema = undefined; + $scope.mimeType = undefined; + $scope.datasourceType = undefined; + $scope.spatialUnitDataSourceIdProperty = undefined; + $scope.spatialUnitDataSourceNameProperty = undefined; + + $scope.converterDefinition = undefined; + $scope.datasourceTypeDefinition = undefined; + $scope.propertyMappingDefinition = undefined; + $scope.putBody_spatialUnits = undefined; + + $scope.validityEndDate_perFeature = undefined; + $scope.validityStartDate_perFeature = undefined; + + $scope.attributeMapping_sourceAttributeName = undefined; + $scope.attributeMapping_destinationAttributeName = undefined; + $scope.attributeMapping_data = undefined; + $scope.attributeMapping_attributeType = kommonitorImporterHelperService.attributeMapping_attributeTypes[0]; + $scope.attributeMappings_adminView = []; + $scope.keepAttributes = true; + $scope.keepMissingValues = true; + + $scope.importerErrors = undefined; + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + + $("#spatialUnitEditFeaturesSuccessAlert").hide(); + $("#spatialUnitEditFeaturesErrorAlert").hide(); + + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + + $scope.filterByKomMonitorProperties = function() { + return function( item ) { + + try{ + if (item === __env.FEATURE_ID_PROPERTY_NAME || item === __env.FEATURE_NAME_PROPERTY_NAME || item === "validStartDate" || item === "validEndDate"){ + return false; + } + return true; + } + catch(error){ + return false; + } + }; + }; + + $scope.getFeatureId = function(geojsonFeature){ + return geojsonFeature.properties[__env.FEATURE_ID_PROPERTY_NAME]; + }; + + $scope.getFeatureName = function(geojsonFeature){ + return geojsonFeature.properties[__env.FEATURE_NAME_PROPERTY_NAME]; + }; + + $scope.checkPeriodOfValidity = function(){ + $scope.periodOfValidityInvalid = false; + if ($scope.periodOfValidity.startDate && $scope.periodOfValidity.endDate){ + var startDate = new Date($scope.periodOfValidity.startDate); + var endDate = new Date($scope.periodOfValidity.endDate); + + if ((startDate === endDate) || startDate > endDate){ + // failure + $scope.periodOfValidityInvalid = true; + } + } + }; + + $scope.onAddOrUpdateAttributeMapping = function(){ + var tmpAttributeMapping_adminView = { + "sourceName": $scope.attributeMapping_sourceAttributeName, + "destinationName": $scope.attributeMapping_destinationAttributeName, + "dataType": $scope.attributeMapping_attributeType + }; + + var processed = false; + + for (let index = 0; index < $scope.attributeMappings_adminView.length; index++) { + var attributeMappingEntry_adminView = $scope.attributeMappings_adminView[index]; + + if (attributeMappingEntry_adminView.sourceName === tmpAttributeMapping_adminView.sourceName){ + // replace object + $scope.attributeMappings_adminView[index] = tmpAttributeMapping_adminView; + processed = true; + break; + } + } + + if(! processed){ + // new entry + $scope.attributeMappings_adminView.push(tmpAttributeMapping_adminView); + } + + $scope.attributeMapping_sourceAttributeName = undefined; + $scope.attributeMapping_destinationAttributeName = undefined; + $scope.attributeMapping_attributeType = kommonitorImporterHelperService.attributeMapping_attributeTypes[0]; + + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + + $scope.onClickEditAttributeMapping = function(attributeMappingEntry){ + $scope.attributeMapping_sourceAttributeName = attributeMappingEntry.sourceName; + $scope.attributeMapping_destinationAttributeName = attributeMappingEntry.destinationName; + $scope.attributeMapping_attributeType = attributeMappingEntry.dataType; + + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + + $scope.onClickDeleteAttributeMapping = function(attributeMappingEntry){ + for (let index = 0; index < $scope.attributeMappings_adminView.length; index++) { + + if ($scope.attributeMappings_adminView[index].sourceName === attributeMappingEntry.sourceName){ + // remove object + $scope.attributeMappings_adminView.splice(index, 1); + break; + } + } + + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + + $scope.buildImporterObjects = async function(){ + $scope.converterDefinition = $scope.buildConverterDefinition(); + $scope.datasourceTypeDefinition = await $scope.buildDatasourceTypeDefinition(); + $scope.propertyMappingDefinition = $scope.buildPropertyMappingDefinition(); + $scope.putBody_spatialUnits = $scope.buildPutBody_spatialUnits(); + + if(!$scope.converterDefinition || !$scope.datasourceTypeDefinition || !$scope.propertyMappingDefinition || !$scope.putBody_spatialUnits){ + return false; + } + + return true; + }; + + $scope.buildConverterDefinition = function(){ + + return kommonitorImporterHelperService.buildConverterDefinition($scope.converter, "converterParameter_spatialUnitEditFeatures_", $scope.schema, $scope.mimeType); + }; + + $scope.buildDatasourceTypeDefinition = async function(){ + try { + return await kommonitorImporterHelperService.buildDatasourceTypeDefinition($scope.datasourceType, 'datasourceTypeParameter_spatialUnitEditFeatures_', 'spatialUnitDataSourceInput_editFeatures'); + } catch (error) { + if(error.data){ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else{ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + + $("#spatialUnitEditFeaturesErrorAlert").show(); + $timeout(function(){ + + $scope.loadingData = false; + }); + return null; + } + }; + + $scope.buildPropertyMappingDefinition = function(){ + // arsion from is undefined currently + return kommonitorImporterHelperService.buildPropertyMapping_spatialResource($scope.spatialUnitDataSourceNameProperty, $scope.spatialUnitDataSourceIdProperty, $scope.validityStartDate_perFeature, $scope.validityEndDate_perFeature, undefined, $scope.keepAttributes, $scope.keepMissingValues, $scope.attributeMappings_adminView); + }; + + $scope.buildPutBody_spatialUnits = function(){ + var putBody = + { + "geoJsonString": "", // will be set by importer + "periodOfValidity": { + "endDate": $scope.periodOfValidity.endDate, + "startDate": $scope.periodOfValidity.startDate + }, + "isPartialUpdate": $scope.isPartialUpdate + }; + + return putBody; + }; + + + $scope.editSpatialUnitFeatures = async function(){ + + $timeout(function(){ + $scope.loadingData = true; + }); + + $scope.importerErrors = undefined; + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + + /* + now collect data and build request for importer + */ + + /* + if any required importer data is missing --> cancel request and highlight required errors + */ + var allDataSpecified = await $scope.buildImporterObjects(); + + if (!allDataSpecified) { + + $("#spatialUnitEditFeaturesForm").validator("update"); + $("#spatialUnitEditFeaturesForm").validator("validate"); + return; + } + else { + + + // TODO verify input + + // TODO Create and perform POST Request with loading screen + + var updateSpatialUnitResponse_dryRun = undefined; + try { + updateSpatialUnitResponse_dryRun = await kommonitorImporterHelperService.updateSpatialUnit($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.currentSpatialUnitDataset.spatialUnitId, $scope.putBody_spatialUnits, true); + + if(! kommonitorImporterHelperService.importerResponseContainsErrors(updateSpatialUnitResponse_dryRun)){ + // all good, really execute the request to import data against data management API + + var updateSpatialUnitResponse = await kommonitorImporterHelperService.updateSpatialUnit($scope.converterDefinition, $scope.datasourceTypeDefinition, $scope.propertyMappingDefinition, $scope.currentSpatialUnitDataset.spatialUnitId, $scope.putBody_spatialUnits, false); + $scope.successMessagePart = $scope.putBody_spatialUnits.spatialUnitLevel; + $scope.importedFeatures = kommonitorImporterHelperService.getImportedFeaturesFromImporterResponse(updateSpatialUnitResponse); + + $rootScope.$broadcast("refreshSpatialUnitOverviewTable", "edit", $scope.currentSpatialUnitDataset.spatialUnitId); + // $scope.refreshSpatialUnitEditFeaturesOverviewTable(); + + $scope.successMessagePart = $scope.currentSpatialUnitDataset.spatialUnitLevel; + + $("#spatialUnitEditFeaturesSuccessAlert").show(); + $timeout(function(){ + + $scope.loadingData = false; + }); + } + else{ + // errors ocurred + // show them + $scope.errorMessagePart = "Einige der zu importierenden Features des Datensatzes weisen kritische Fehler auf"; + $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(updateSpatialUnitResponse_dryRun); + + $("#spatialUnitEditFeaturesErrorAlert").show(); + $scope.loadingData = false; + + setTimeout(() => { + $scope.$digest(); + }, 250); + + } + + } catch (error) { + if(error.data){ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else{ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + + if(updateSpatialUnitResponse_dryRun){ + $scope.importerErrors = kommonitorImporterHelperService.getErrorsFromImporterResponse(updateSpatialUnitResponse_dryRun); + } + + $("#spatialUnitEditFeaturesErrorAlert").show(); + $scope.loadingData = false; + + setTimeout(() => { + $scope.$digest(); + }, 250); + } + } + }; + + $scope.onImportSpatialUnitEditFeaturesMappingConfig = function(){ + + $scope.spatialUnitMappingConfigImportError = ""; + + $("#spatialUnitMappingConfigEditFeaturesImportFile").files = []; + + // trigger file chooser + $("#spatialUnitMappingConfigEditFeaturesImportFile").click(); + + }; + + $(document).on("change", "#spatialUnitMappingConfigEditFeaturesImportFile" ,function(){ + + console.log("Importing Importer Mapping Config for EditFeatures SpatialUnit Form"); + + // get the file + var file = document.getElementById('spatialUnitMappingConfigEditFeaturesImportFile').files[0]; + $scope.parseMappingConfigFromFile(file); + }); + + $scope.parseMappingConfigFromFile = function(file){ + var fileReader = new FileReader(); + + fileReader.onload = function(event) { + + try{ + $scope.parseFromMappingConfigFile(event); + } + catch(error){ + console.error(error); + console.error("Uploaded MappingConfig File cannot be parsed."); + $scope.spatialUnitMappingConfigImportError = "Uploaded MappingConfig File cannot be parsed correctly"; + document.getElementById("spatialUnitsEditFeaturesMappingConfigPre").innerHTML = $scope.spatialUnitMappingConfigStructure_pretty; + $("#spatialUnitEditFeaturesMappingConfigImportErrorAlert").show(); + + $scope.$digest(); + } + + }; + + // Read in the image file as a data URL. + fileReader.readAsText(file); + }; + + $scope.parseFromMappingConfigFile = function(event){ + $scope.mappingConfigImportSettings = JSON.parse(event.target.result); + + if(! $scope.mappingConfigImportSettings.converter || ! $scope.mappingConfigImportSettings.dataSource || ! $scope.mappingConfigImportSettings.propertyMapping){ + console.error("uploaded MappingConfig File cannot be parsed - wrong structure."); + $scope.spatialUnitMetadataImportError = "Struktur der Datei stimmt nicht mit erwartetem Muster überein."; + document.getElementById("spatialUnitsEditFeaturesMappingConfigPre").innerHTML = $scope.spatialUnitMappingConfigStructure_pretty; + $("#spatialUnitEditFeaturesMappingConfigImportErrorAlert").show(); + + $scope.$digest(); + } + + $scope.converter = undefined; + for(var converter of kommonitorImporterHelperService.availableConverters){ + if (converter.name === $scope.mappingConfigImportSettings.converter.name){ + $scope.converter = converter; + break; + } + } + + $scope.schema = undefined; + if ($scope.converter && $scope.converter.schemas && $scope.mappingConfigImportSettings.converter.schema){ + for (var schema of $scope.converter.schemas) { + if (schema === $scope.mappingConfigImportSettings.converter.schema){ + $scope.schema = schema; + } + } + } + + $scope.mimeType = undefined; + if ($scope.converter && $scope.converter.mimeTypes && $scope.mappingConfigImportSettings.converter.mimeType){ + for (var mimeType of $scope.converter.mimeTypes) { + if (mimeType === $scope.mappingConfigImportSettings.converter.mimeType){ + $scope.mimeType = mimeType; + } + } + } + + $scope.datasourceType = undefined; + for(var datasourceType of kommonitorImporterHelperService.availableDatasourceTypes){ + if (datasourceType.type === $scope.mappingConfigImportSettings.dataSource.type){ + $scope.datasourceType = datasourceType; + break; + } + } + + $scope.$digest(); + + // converter parameters + if ($scope.converter){ + for (var convParameter of $scope.mappingConfigImportSettings.converter.parameters) { + $("#converterParameter_spatialUnitEditFeatures_" + convParameter.name).val(convParameter.value); + } + } + + // datasourceTypes parameters + if ($scope.datasourceType){ + for (var dsParameter of $scope.mappingConfigImportSettings.dataSource.parameters) { + $("#datasourceTypeParameter_spatialUnitEditFeatures_" + dsParameter.name).val(dsParameter.value); + } + } + + // property Mapping + $scope.spatialUnitDataSourceNameProperty = $scope.mappingConfigImportSettings.propertyMapping.nameProperty; + $scope.spatialUnitDataSourceIdProperty = $scope.mappingConfigImportSettings.propertyMapping.identifierProperty; + $scope.validityStartDate_perFeature = $scope.mappingConfigImportSettings.propertyMapping.validStartDateProperty; + $scope.validityEndDate_perFeature = $scope.mappingConfigImportSettings.propertyMapping.validEndDateProperty; + $scope.keepAttributes = $scope.mappingConfigImportSettings.propertyMapping.keepAttributes; + $scope.keepMissingValues = $scope.mappingConfigImportSettings.propertyMapping.keepMissingOrNullValueAttributes; + $scope.attributeMappings_adminView = []; + + for (var attributeMapping of $scope.mappingConfigImportSettings.propertyMapping.attributes) { + var tmpEntry = { + "sourceName": attributeMapping.name, + "destinationName": attributeMapping.mappingName + }; + + for (const dataType of kommonitorImporterHelperService.attributeMapping_attributeTypes) { + if (dataType.apiName === attributeMapping.type){ + tmpEntry.dataType = dataType; + } + } + + $scope.attributeMappings_adminView.push(tmpEntry); + } + + if ($scope.mappingConfigImportSettings.periodOfValidity){ + $scope.periodOfValidity = {}; + $scope.periodOfValidity.startDate = $scope.mappingConfigImportSettings.periodOfValidity.startDate; + $scope.periodOfValidity.endDate = $scope.mappingConfigImportSettings.periodOfValidity.endDate; + $scope.periodOfValidityInvalid = false; + + // update datePickers + if ($scope.periodOfValidity.startDate){ + $("#spatialUnitEditFeaturesDatepickerStart").datepicker('setDate', $scope.periodOfValidity.startDate); + } + if ($scope.periodOfValidity.endDate){ + $("#spatialUnitEditFeaturesDatepickerEnd").datepicker('setDate', $scope.periodOfValidity.endDate); + } + } + + $scope.$digest(); + }; + + $scope.onExportSpatialUnitEditFeaturesMappingConfig = async function(){ + var converterDefinition = $scope.buildConverterDefinition(); + var datasourceTypeDefinition = await $scope.buildDatasourceTypeDefinition(); + var propertyMappingDefinition = $scope.buildPropertyMappingDefinition(); + + var mappingConfigExport = { + "converter": converterDefinition, + "dataSource": datasourceTypeDefinition, + "propertyMapping": propertyMappingDefinition, + }; + + mappingConfigExport.periodOfValidity = $scope.periodOfValidity; + + var name = $scope.spatialUnitLevel; + + var metadataJSON = JSON.stringify(mappingConfigExport); + + var fileName = "KomMonitor-Import-Mapping-Konfiguration_Export"; + + if (name){ + fileName += "-" + name; + } + + fileName += ".json"; + + var blob = new Blob([metadataJSON], {type: "application/json"}); + var data = URL.createObjectURL(blob); + + var a = document.createElement('a'); + a.download = fileName; + a.href = data; + a.textContent = "JSON"; + a.target = "_blank"; + a.rel = "noopener noreferrer"; + a.click(); + + a.remove(); + }; + + + $scope.hideSuccessAlert = function(){ + $("#spatialUnitEditFeaturesSuccessAlert").hide(); + }; + + $scope.hideErrorAlert = function(){ + $("#spatialUnitEditFeaturesErrorAlert").hide(); + }; + + $scope.hideMappingConfigErrorAlert = function(){ + $("#spatialUnitEditFeaturesMappingConfigImportErrorAlert").hide(); + }; + + $scope.onChangeEnableDeleteFeatures = function(){ + if($scope.enableDeleteFeatures){ + $(".spatialUnitDeleteFeatureRecordBtn").attr("disabled", false); + } + else{ + $(".spatialUnitDeleteFeatureRecordBtn").attr("disabled", true); + } + } + + $rootScope.$on("showLoadingIcon_" + kommonitorDataGridHelperService.resourceType_spatialUnit, function(event){ + $timeout(function(){ + + $scope.loadingData = true; + }); + }); + + $rootScope.$on("hideLoadingIcon_" + kommonitorDataGridHelperService.resourceType_spatialUnit, function(event){ + $timeout(function(){ + + $scope.loadingData = false; + }); + }); + + $rootScope.$on("onDeleteFeatureEntry_" + kommonitorDataGridHelperService.resourceType_spatialUnit, function(event){ + $rootScope.$broadcast("refreshSpatialUnitOverviewTable", "edit", $scope.currentSpatialUnitDataset.spatialUnitId); + $scope.refreshSpatialUnitEditFeaturesOverviewTable(); + }); + + } +]}); diff --git a/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditFeaturesModal/spatial-unit-edit-features-modal.module.js b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditFeaturesModal/spatial-unit-edit-features-modal.module.js index 02ccd0265..6b158ae59 100644 --- a/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditFeaturesModal/spatial-unit-edit-features-modal.module.js +++ b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditFeaturesModal/spatial-unit-edit-features-modal.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('spatialUnitEditFeaturesModal', ['kommonitorDataGridHelper', 'kommonitorImporterHelper', 'kommonitorMultiStepFormHelper']); +//# sourceMappingURL=spatial-unit-edit-features-modal.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditFeaturesModal/spatial-unit-edit-features-modal.module.js.map b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditFeaturesModal/spatial-unit-edit-features-modal.module.js.map new file mode 100644 index 000000000..01831d636 --- /dev/null +++ b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditFeaturesModal/spatial-unit-edit-features-modal.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"spatial-unit-edit-features-modal.module.js","sourceRoot":"","sources":["spatial-unit-edit-features-modal.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,8BAA8B,EAAE,CAAC,0BAA0B,EAAE,0BAA0B,EAAE,+BAA+B,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditFeaturesModal/spatial-unit-edit-features-modal.module.ts b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditFeaturesModal/spatial-unit-edit-features-modal.module.ts new file mode 100644 index 000000000..02ccd0265 --- /dev/null +++ b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditFeaturesModal/spatial-unit-edit-features-modal.module.ts @@ -0,0 +1 @@ +angular.module('spatialUnitEditFeaturesModal', ['kommonitorDataGridHelper', 'kommonitorImporterHelper', 'kommonitorMultiStepFormHelper']); diff --git a/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditMetadataModal/spatial-unit-edit-metadata-modal.component.js b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditMetadataModal/spatial-unit-edit-metadata-modal.component.js index 456974bf7..1b30d3c93 100644 --- a/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditMetadataModal/spatial-unit-edit-metadata-modal.component.js +++ b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditMetadataModal/spatial-unit-edit-metadata-modal.component.js @@ -1,452 +1,360 @@ +"use strict"; angular.module('spatialUnitEditMetadataModal').component('spatialUnitEditMetadataModal', { - templateUrl : "components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditMetadataModal/spatial-unit-edit-metadata-modal.template.html", - controller : ['kommonitorDataExchangeService', '$scope', '$rootScope', '$http', '__env', '$timeout', - 'kommonitorMultiStepFormHelperService', 'kommonitorDataGridHelperService', - function SpatialUnitEditMetadataModalController(kommonitorDataExchangeService, $scope, $rootScope, $http, __env, $timeout, - kommonitorMultiStepFormHelperService, kommonitorDataGridHelperService) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - - $scope.currentSpatialUnitDataset; - - /* POST BODY - { - "geoJsonString": "geoJsonString", - "metadata": { - "note": "note", - "literature": "literature", - "updateInterval": "ARBITRARY", - "sridEPSG": 0.8008281904610115, - "datasource": "datasource", - "contact": "contact", - "lastUpdate": "2000-01-23", - "description": "description", - "databasis": "databasis" - }, - "jsonSchema": "jsonSchema", - "nextLowerHierarchyLevel": "nextLowerHierarchyLevel", - "spatialUnitLevel": "spatialUnitLevel", - "periodOfValidity": { - "endDate": "2000-01-23", - "startDate": "2000-01-23" - }, - "nextUpperHierarchyLevel": "nextUpperHierarchyLevel" - } - */ - - //Date picker - $('#spatialUnitEditMetadataLastUpdateDatepicker').datepicker(kommonitorDataExchangeService.datePickerOptions); - - $scope.loadingData = false; - - $scope.spatialUnitMetadataStructure = { - "metadata": { - "note": "an optional note", - "literature": "optional text about literature", - "updateInterval": "YEARLY|HALF_YEARLY|QUARTERLY|MONTHLY|ARBITRARY", - "sridEPSG": 4326, - "datasource": "text about data source", - "contact": "text about contact details", - "lastUpdate": "YYYY-MM-DD", - "description": "description about spatial unit dataset", - "databasis": "text about data basis", - }, - "allowedRoles": ['roleId'], - "nextLowerHierarchyLevel": "Name of lower hierarchy level", - "spatialUnitLevel": "Name of spatial unit dataset", - "nextUpperHierarchyLevel": "Name of upper hierarchy level" - }; - - $scope.spatialUnitMetadataStructure_pretty = kommonitorDataExchangeService.syntaxHighlightJSON($scope.spatialUnitMetadataStructure); - - $scope.metadataImportSettings; - $scope.spatialUnitMetadataImportError; - $scope.spatialUnitMetadataImportErrorAlert; - - $scope.spatialUnitLevel = undefined; - $scope.spatialUnitLevelInvalid = false; - - $scope.metadata = {}; - $scope.metadata.note = undefined; - $scope.metadata.literature = undefined; - $scope.metadata.updateInterval = undefined; - $scope.metadata.sridEPSG = undefined; - $scope.metadata.datasource = undefined; - $scope.metadata.databasis = undefined; - $scope.metadata.contact = undefined; - $scope.metadata.lastUpdate = undefined; - $scope.metadata.description = undefined; - - $scope.roleManagementTableOptions = undefined; - - $scope.nextLowerHierarchySpatialUnit = undefined; - $scope.nextUpperHierarchySpatialUnit = undefined; - $scope.hierarchyInvalid = false; - - $scope.successMessagePart = undefined; - $scope.errorMessagePart = undefined; - - $scope.$on("onEditSpatialUnitMetadata", function (event, spatialUnitDataset) { - - $scope.currentSpatialUnitDataset = spatialUnitDataset; - - $scope.resetSpatialUnitEditMetadataForm(); - - kommonitorMultiStepFormHelperService.registerClickHandler(); - - }); - - $scope.$on("availableRolesUpdate", function (event) { - refreshRoles(); - }); - - function refreshRoles() { - let allowedRoles = $scope.currentSpatialUnitDataset ? $scope.currentSpatialUnitDataset.allowedRoles : []; - $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('spatialUnitEditRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, allowedRoles); - } - - $scope.resetSpatialUnitEditMetadataForm = function(){ - - $scope.spatialUnitLevel = $scope.currentSpatialUnitDataset.spatialUnitLevel; - $scope.spatialUnitLevelInvalid = false; - - $scope.metadata = {}; - $scope.metadata.note = $scope.currentSpatialUnitDataset.metadata.note; - $scope.metadata.literature = $scope.currentSpatialUnitDataset.metadata.literature; - $scope.metadata.sridEPSG = 4326; - $scope.metadata.datasource = $scope.currentSpatialUnitDataset.metadata.datasource; - $scope.metadata.databasis = $scope.currentSpatialUnitDataset.metadata.databasis; - $scope.metadata.contact = $scope.currentSpatialUnitDataset.metadata.contact; - $scope.metadata.description = $scope.currentSpatialUnitDataset.metadata.description; - - let allowedRoles = $scope.currentSpatialUnitDataset ? $scope.currentSpatialUnitDataset.allowedRoles : []; - $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('spatialUnitEditRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, allowedRoles); - - $scope.metadata.lastUpdate = $scope.currentSpatialUnitDataset.metadata.lastUpdate; - // $('#spatialUnitEditMetadataLastUpdateDatepicker').data({date: $scope.currentSpatialUnitDataset.metadata.lastUpdate}); - $('#spatialUnitEditMetadataLastUpdateDatepicker').datepicker('setDate', $scope.currentSpatialUnitDataset.metadata.lastUpdate); - - kommonitorDataExchangeService.updateIntervalOptions.forEach(function(option){ - if(option.apiName === $scope.currentSpatialUnitDataset.metadata.updateInterval){ - $scope.metadata.updateInterval = option; - } - }); - - for(var i=0; i { - $scope.$digest(); - }, 250); - }; - - $scope.checkSpatialUnitName = function(){ - $scope.spatialUnitLevelInvalid = false; - kommonitorDataExchangeService.availableSpatialUnits.forEach(function(spatialUnit){ - if (spatialUnit.spatialUnitLevel === $scope.spatialUnitLevel && spatialUnit.spatialUnitId != $scope.currentSpatialUnitDataset.spatialUnitId){ - $scope.spatialUnitLevelInvalid = true; - return; - } - }); - }; - - $scope.checkSpatialUnitHierarchy = function(){ - - $scope.hierarchyInvalid = false; - - // smaller indices represent higher spatial units - // i.e. city districts will have a smaller index than building blocks - if($scope.nextLowerHierarchySpatialUnit && $scope.nextUpperHierarchySpatialUnit){ - var indexOfLowerHierarchyUnit; - var indexOfUpperHierarchyUnit; - - for(var i=0; i { + $scope.$digest(); + }, 250); + }; + $scope.checkSpatialUnitName = function () { + $scope.spatialUnitLevelInvalid = false; + kommonitorDataExchangeService.availableSpatialUnits.forEach(function (spatialUnit) { + if (spatialUnit.spatialUnitLevel === $scope.spatialUnitLevel && spatialUnit.spatialUnitId != $scope.currentSpatialUnitDataset.spatialUnitId) { + $scope.spatialUnitLevelInvalid = true; + return; + } + }); + }; + $scope.checkSpatialUnitHierarchy = function () { + $scope.hierarchyInvalid = false; + // smaller indices represent higher spatial units + // i.e. city districts will have a smaller index than building blocks + if ($scope.nextLowerHierarchySpatialUnit && $scope.nextUpperHierarchySpatialUnit) { + var indexOfLowerHierarchyUnit; + var indexOfUpperHierarchyUnit; + for (var i = 0; i < kommonitorDataExchangeService.availableSpatialUnits.length; i++) { + var spatialUnit = kommonitorDataExchangeService.availableSpatialUnits[i]; + if (spatialUnit.spatialUnitLevel === $scope.nextLowerHierarchySpatialUnit.spatialUnitLevel) { + indexOfLowerHierarchyUnit = i; + } + if (spatialUnit.spatialUnitLevel === $scope.nextUpperHierarchySpatialUnit.spatialUnitLevel) { + indexOfUpperHierarchyUnit = i; + } + } + if ((indexOfLowerHierarchyUnit <= indexOfUpperHierarchyUnit)) { + // failure + $scope.hierarchyInvalid = true; + } + } + }; + $scope.editSpatialUnitMetadata = function () { + let spatialUnitName_old = $scope.currentSpatialUnitDataset.spatialUnitLevel; + let spatialUnitName_new = $scope.spatialUnitLevel; + var patchBody = { + "datasetName": $scope.spatialUnitLevel, + "metadata": { + "note": $scope.metadata.note, + "literature": $scope.metadata.literature, + "updateInterval": $scope.metadata.updateInterval.apiName, + "sridEPSG": $scope.metadata.sridEPSG, + "datasource": $scope.metadata.datasource, + "contact": $scope.metadata.contact, + "lastUpdate": $scope.metadata.lastUpdate, + "description": $scope.metadata.description, + "databasis": $scope.metadata.databasis, + "sridEPSG": 4326 + }, + "allowedRoles": [], + "nextLowerHierarchyLevel": $scope.nextLowerHierarchySpatialUnit ? $scope.nextLowerHierarchySpatialUnit.spatialUnitLevel : null, + "nextUpperHierarchyLevel": $scope.nextUpperHierarchySpatialUnit ? $scope.nextUpperHierarchySpatialUnit.spatialUnitLevel : null + }; + let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); + for (const roleId of roleIds) { + patchBody.allowedRoles.push(roleId); + } + // TODO Create and perform POST Request with loading screen + $scope.loadingData = true; + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/spatial-units/" + $scope.currentSpatialUnitDataset.spatialUnitId, + method: "PATCH", + data: patchBody + // headers: { + // 'Content-Type': undefined + // } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + $scope.successMessagePart = $scope.currentSpatialUnitDataset.spatialUnitLevel; + $rootScope.$broadcast("refreshSpatialUnitOverviewTable"); + // if the name has changed, then indicator metadata must be fetched as well + if (spatialUnitName_old != spatialUnitName_new) { + $rootScope.$broadcast("refreshIndicatorOverviewTable"); + } + $("#spatialUnitEditMetadataSuccessAlert").show(); + $timeout(function () { + $scope.loadingData = false; + }); + }, function errorCallback(error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + $("#spatialUnitEditMetadataErrorAlert").show(); + $timeout(function () { + $scope.loadingData = false; + }); + // setTimeout(function() { + // $("#spatialUnitEditMetadataSuccessAlert").hide(); + // }, 3000); + }); + }; + $scope.onImportSpatialUnitEditMetadata = function () { + $scope.spatialUnitMetadataImportError = ""; + $("#spatialUnitEditMetadataImportFile").files = []; + // trigger file chooser + $("#spatialUnitEditMetadataImportFile").click(); + }; + $(document).on("change", "#spatialUnitEditMetadataImportFile", function () { + console.log("Importing SpatialUnit metadata for Edit SpatialUnit Form"); + // get the file + var file = document.getElementById('spatialUnitEditMetadataImportFile').files[0]; + $scope.parseMetadataFromFile(file); + }); + $scope.parseMetadataFromFile = function (file) { + var fileReader = new FileReader(); + fileReader.onload = function (event) { + try { + $scope.parseFromMetadataFile(event); + } + catch (error) { + console.error("Uploaded Metadata File cannot be parsed."); + $scope.spatialUnitMetadataImportError = "Uploaded Metadata File cannot be parsed correctly"; + document.getElementById("spatialUnitsEditMetadataPre").innerHTML = $scope.spatialUnitMetadataStructure_pretty; + $("#spatialUnitEditMetadataImportErrorAlert").show(); + $scope.$digest(); + } + }; + // Read in the image file as a data URL. + fileReader.readAsText(file); + }; + $scope.parseFromMetadataFile = function (event) { + // $scope.geoJsonString = event.target.result; + $scope.metadataImportSettings = JSON.parse(event.target.result); + if (!$scope.metadataImportSettings.metadata) { + console.error("uploaded Metadata File cannot be parsed - wrong structure."); + $scope.spatialUnitMetadataImportError = "Struktur der Datei stimmt nicht mit erwartetem Muster überein."; + document.getElementById("spatialUnitsEditMetadataPre").innerHTML = $scope.spatialUnitMetadataStructure_pretty; + $("#spatialUnitEditMetadataImportErrorAlert").show(); + $scope.$digest(); + } + $scope.metadata = {}; + $scope.metadata.note = $scope.metadataImportSettings.metadata.note; + $scope.metadata.literature = $scope.metadataImportSettings.metadata.literature; + kommonitorDataExchangeService.updateIntervalOptions.forEach(function (option) { + if (option.apiName === $scope.metadataImportSettings.metadata.updateInterval) { + $scope.metadata.updateInterval = option; + } + }); + $scope.metadata.sridEPSG = $scope.metadataImportSettings.metadata.sridEPSG; + $scope.metadata.datasource = $scope.metadataImportSettings.metadata.datasource; + $scope.metadata.contact = $scope.metadataImportSettings.metadata.contact; + $scope.metadata.lastUpdate = $scope.metadataImportSettings.metadata.lastUpdate; + // initialize date + $('#spatialUnitEditLastUpdateDatepicker').datepicker('setDate', $scope.metadata.lastUpdate); + $scope.metadata.description = $scope.metadataImportSettings.metadata.description; + $scope.metadata.databasis = $scope.metadataImportSettings.metadata.databasis; + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('spatialUnitEditRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, $scope.metadataImportSettings.allowedRoles); + for (var i = 0; i < kommonitorDataExchangeService.availableSpatialUnits.length; i++) { + var spatialUnit = kommonitorDataExchangeService.availableSpatialUnits[i]; + if (spatialUnit.spatialUnitLevel === $scope.metadataImportSettings.nextLowerHierarchyLevel) { + $scope.nextLowerHierarchySpatialUnit = spatialUnit; + } + if (spatialUnit.spatialUnitLevel === $scope.metadataImportSettings.nextUpperHierarchyLevel) { + $scope.nextUpperHierarchySpatialUnit = spatialUnit; + } + } + $scope.spatialUnitLevel = $scope.metadataImportSettings.spatialUnitLevel; + $scope.$digest(); + }; + $scope.onExportSpatialUnitEditMetadataTemplate = function () { + var metadataJSON = JSON.stringify($scope.spatialUnitMetadataStructure); + var fileName = "Raumeinheit_Metadaten_Vorlage_Export.json"; + var blob = new Blob([metadataJSON], { type: "application/json" }); + var data = URL.createObjectURL(blob); + var a = document.createElement('a'); + a.download = fileName; + a.href = data; + a.textContent = "JSON"; + a.target = "_blank"; + a.rel = "noopener noreferrer"; + a.click(); + a.remove(); + }; + $scope.onExportSpatialUnitEditMetadata = function () { + var metadataExport = $scope.spatialUnitMetadataStructure; + metadataExport.metadata.note = $scope.metadata.note || ""; + metadataExport.metadata.literature = $scope.metadata.literature || ""; + metadataExport.metadata.sridEPSG = $scope.metadata.sridEPSG || ""; + metadataExport.metadata.datasource = $scope.metadata.datasource || ""; + metadataExport.metadata.contact = $scope.metadata.contact || ""; + metadataExport.metadata.lastUpdate = $scope.metadata.lastUpdate || ""; + metadataExport.metadata.description = $scope.metadata.description || ""; + metadataExport.metadata.databasis = $scope.metadata.databasis || ""; + metadataExport.spatialUnitLevel = $scope.spatialUnitLevel || ""; + metadataExport.allowedRoles = []; + let roleIds = kommonitorDataGridHelperService.getSelectedRoleIds_roleManagementGrid($scope.roleManagementTableOptions); + for (const roleId of roleIds) { + metadataExport.allowedRoles.push(roleId); + } + if ($scope.metadata.updateInterval) { + metadataExport.metadata.updateInterval = $scope.metadata.updateInterval.apiName; + } + if ($scope.nextLowerHierarchySpatialUnit) { + metadataExport.nextLowerHierarchyLevel = $scope.nextLowerHierarchySpatialUnit.spatialUnitLevel; + } + else { + metadataExport.nextLowerHierarchyLevel = ""; + } + if ($scope.nextUpperHierarchySpatialUnit) { + metadataExport.nextUpperHierarchyLevel = $scope.nextUpperHierarchySpatialUnit.spatialUnitLevel; + } + else { + metadataExport.nextUpperHierarchyLevel = ""; + } + var name = $scope.spatialUnitLevel; + var metadataJSON = JSON.stringify(metadataExport); + var fileName = "Raumeinheit_Metadaten_Export"; + if (name) { + fileName += "-" + name; + } + fileName += ".json"; + var blob = new Blob([metadataJSON], { type: "application/json" }); + var data = URL.createObjectURL(blob); + var a = document.createElement('a'); + a.download = fileName; + a.href = data; + a.textContent = "JSON"; + a.target = "_blank"; + a.rel = "noopener noreferrer"; + a.click(); + a.remove(); + }; + $scope.hideSuccessAlert = function () { + $("#spatialUnitEditMetadataSuccessAlert").hide(); + }; + $scope.hideErrorAlert = function () { + $("#spatialUnitEditMetadataErrorAlert").hide(); + }; + } + ] +}); +//# sourceMappingURL=spatial-unit-edit-metadata-modal.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditMetadataModal/spatial-unit-edit-metadata-modal.component.js.map b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditMetadataModal/spatial-unit-edit-metadata-modal.component.js.map new file mode 100644 index 000000000..7de67bd61 --- /dev/null +++ b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditMetadataModal/spatial-unit-edit-metadata-modal.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"spatial-unit-edit-metadata-modal.component.js","sourceRoot":"","sources":["spatial-unit-edit-metadata-modal.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,8BAA8B,CAAC,CAAC,SAAS,CAAC,8BAA8B,EAAE;IACxF,WAAW,EAAG,oIAAoI;IAClJ,UAAU,EAAG,CAAC,+BAA+B,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU;QAClG,sCAAsC,EAAE,iCAAiC;QACzE,SAAS,sCAAsC,CAAC,6BAA6B,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EACxH,oCAAoC,EAAE,+BAA+B;YAEtE,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAE3E,MAAM,CAAC,yBAAyB,CAAC;YAEjC;;;;;;;;;;;;;;;;;;;;;;;cAuBE;YAEF,aAAa;YACb,CAAC,CAAC,8CAA8C,CAAC,CAAC,UAAU,CAAC,6BAA6B,CAAC,iBAAiB,CAAC,CAAC;YAE9G,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;YAE3B,MAAM,CAAC,4BAA4B,GAAG;gBACrC,UAAU,EAAE;oBACX,MAAM,EAAE,kBAAkB;oBAC1B,YAAY,EAAE,gCAAgC;oBAC9C,gBAAgB,EAAE,gDAAgD;oBAClE,UAAU,EAAE,IAAI;oBAChB,YAAY,EAAE,wBAAwB;oBACtC,SAAS,EA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AC;gBACvB,CAAC,CAAC,MAAM,GAAG,QAAQ,CAAC;gBACpB,CAAC,CAAC,GAAG,GAAG,qBAAqB,CAAC;gBAC9B,CAAC,CAAC,KAAK,EAAE,CAAC;gBAEV,CAAC,CAAC,MAAM,EAAE,CAAC;YACZ,CAAC,CAAC;YAED,MAAM,CAAC,gBAAgB,GAAG;gBACzB,CAAC,CAAC,sCAAsC,CAAC,CAAC,IAAI,EAAE,CAAC;YAClD,CAAC,CAAC;YAEF,MAAM,CAAC,cAAc,GAAG;gBACvB,CAAC,CAAC,oCAAoC,CAAC,CAAC,IAAI,EAAE,CAAC;YAChD,CAAC,CAAC;QAEJ,CAAC;KACD;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditMetadataModal/spatial-unit-edit-metadata-modal.component.ts b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditMetadataModal/spatial-unit-edit-metadata-modal.component.ts new file mode 100644 index 000000000..456974bf7 --- /dev/null +++ b/app/components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditMetadataModal/spatial-unit-edit-metadata-modal.component.ts @@ -0,0 +1,452 @@ +angular.module('spatialUnitEditMetadataModal').component('spatialUnitEditMetadataModal', { + templateUrl : "components/kommonitorAdmin/adminSpatialUnitsManagement/spatialUnitEditMetadataModal/spatial-unit-edit-metadata-modal.template.html", + controller : ['kommonitorDataExchangeService', '$scope', '$rootScope', '$http', '__env', '$timeout', + 'kommonitorMultiStepFormHelperService', 'kommonitorDataGridHelperService', + function SpatialUnitEditMetadataModalController(kommonitorDataExchangeService, $scope, $rootScope, $http, __env, $timeout, + kommonitorMultiStepFormHelperService, kommonitorDataGridHelperService) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + + $scope.currentSpatialUnitDataset; + + /* POST BODY + { + "geoJsonString": "geoJsonString", + "metadata": { + "note": "note", + "literature": "literature", + "updateInterval": "ARBITRARY", + "sridEPSG": 0.8008281904610115, + "datasource": "datasource", + "contact": "contact", + "lastUpdate": "2000-01-23", + "description": "description", + "databasis": "databasis" + }, + "jsonSchema": "jsonSchema", + "nextLowerHierarchyLevel": "nextLowerHierarchyLevel", + "spatialUnitLevel": "spatialUnitLevel", + "periodOfValidity": { + "endDate": "2000-01-23", + "startDate": "2000-01-23" + }, + "nextUpperHierarchyLevel": "nextUpperHierarchyLevel" + } + */ + + //Date picker + $('#spatialUnitEditMetadataLastUpdateDatepicker').datepicker(kommonitorDataExchangeService.datePickerOptions); + + $scope.loadingData = false; + + $scope.spatialUnitMetadataStructure = { + "metadata": { + "note": "an optional note", + "literature": "optional text about literature", + "updateInterval": "YEARLY|HALF_YEARLY|QUARTERLY|MONTHLY|ARBITRARY", + "sridEPSG": 4326, + "datasource": "text about data source", + "contact": "text about contact details", + "lastUpdate": "YYYY-MM-DD", + "description": "description about spatial unit dataset", + "databasis": "text about data basis", + }, + "allowedRoles": ['roleId'], + "nextLowerHierarchyLevel": "Name of lower hierarchy level", + "spatialUnitLevel": "Name of spatial unit dataset", + "nextUpperHierarchyLevel": "Name of upper hierarchy level" + }; + + $scope.spatialUnitMetadataStructure_pretty = kommonitorDataExchangeService.syntaxHighlightJSON($scope.spatialUnitMetadataStructure); + + $scope.metadataImportSettings; + $scope.spatialUnitMetadataImportError; + $scope.spatialUnitMetadataImportErrorAlert; + + $scope.spatialUnitLevel = undefined; + $scope.spatialUnitLevelInvalid = false; + + $scope.metadata = {}; + $scope.metadata.note = undefined; + $scope.metadata.literature = undefined; + $scope.metadata.updateInterval = undefined; + $scope.metadata.sridEPSG = undefined; + $scope.metadata.datasource = undefined; + $scope.metadata.databasis = undefined; + $scope.metadata.contact = undefined; + $scope.metadata.lastUpdate = undefined; + $scope.metadata.description = undefined; + + $scope.roleManagementTableOptions = undefined; + + $scope.nextLowerHierarchySpatialUnit = undefined; + $scope.nextUpperHierarchySpatialUnit = undefined; + $scope.hierarchyInvalid = false; + + $scope.successMessagePart = undefined; + $scope.errorMessagePart = undefined; + + $scope.$on("onEditSpatialUnitMetadata", function (event, spatialUnitDataset) { + + $scope.currentSpatialUnitDataset = spatialUnitDataset; + + $scope.resetSpatialUnitEditMetadataForm(); + + kommonitorMultiStepFormHelperService.registerClickHandler(); + + }); + + $scope.$on("availableRolesUpdate", function (event) { + refreshRoles(); + }); + + function refreshRoles() { + let allowedRoles = $scope.currentSpatialUnitDataset ? $scope.currentSpatialUnitDataset.allowedRoles : []; + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('spatialUnitEditRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, allowedRoles); + } + + $scope.resetSpatialUnitEditMetadataForm = function(){ + + $scope.spatialUnitLevel = $scope.currentSpatialUnitDataset.spatialUnitLevel; + $scope.spatialUnitLevelInvalid = false; + + $scope.metadata = {}; + $scope.metadata.note = $scope.currentSpatialUnitDataset.metadata.note; + $scope.metadata.literature = $scope.currentSpatialUnitDataset.metadata.literature; + $scope.metadata.sridEPSG = 4326; + $scope.metadata.datasource = $scope.currentSpatialUnitDataset.metadata.datasource; + $scope.metadata.databasis = $scope.currentSpatialUnitDataset.metadata.databasis; + $scope.metadata.contact = $scope.currentSpatialUnitDataset.metadata.contact; + $scope.metadata.description = $scope.currentSpatialUnitDataset.metadata.description; + + let allowedRoles = $scope.currentSpatialUnitDataset ? $scope.currentSpatialUnitDataset.allowedRoles : []; + $scope.roleManagementTableOptions = kommonitorDataGridHelperService.buildRoleManagementGrid('spatialUnitEditRoleManagementTable', $scope.roleManagementTableOptions, kommonitorDataExchangeService.accessControl, allowedRoles); + + $scope.metadata.lastUpdate = $scope.currentSpatialUnitDataset.metadata.lastUpdate; + // $('#spatialUnitEditMetadataLastUpdateDatepicker').data({date: $scope.currentSpatialUnitDataset.metadata.lastUpdate}); + $('#spatialUnitEditMetadataLastUpdateDatepicker').datepicker('setDate', $scope.currentSpatialUnitDataset.metadata.lastUpdate); + + kommonitorDataExchangeService.updateIntervalOptions.forEach(function(option){ + if(option.apiName === $scope.currentSpatialUnitDataset.metadata.updateInterval){ + $scope.metadata.updateInterval = option; + } + }); + + for(var i=0; i { + $scope.$digest(); + }, 250); + }; + + $scope.checkSpatialUnitName = function(){ + $scope.spatialUnitLevelInvalid = false; + kommonitorDataExchangeService.availableSpatialUnits.forEach(function(spatialUnit){ + if (spatialUnit.spatialUnitLevel === $scope.spatialUnitLevel && spatialUnit.spatialUnitId != $scope.currentSpatialUnitDataset.spatialUnitId){ + $scope.spatialUnitLevelInvalid = true; + return; + } + }); + }; + + $scope.checkSpatialUnitHierarchy = function(){ + + $scope.hierarchyInvalid = false; + + // smaller indices represent higher spatial units + // i.e. city districts will have a smaller index than building blocks + if($scope.nextLowerHierarchySpatialUnit && $scope.nextUpperHierarchySpatialUnit){ + var indexOfLowerHierarchyUnit; + var indexOfUpperHierarchyUnit; + + for(var i=0; i .collapseTrigger').on('click', function() { - $('.glyphicon', this) - .toggleClass('glyphicon-chevron-right') - .toggleClass('glyphicon-chevron-down'); - - // manage uncollapsed entries - var clickedTopicId = $(this).attr('id'); - if ($scope.unCollapsedTopicIds.includes(clickedTopicId)){ - var index = $scope.unCollapsedTopicIds.indexOf(clickedTopicId); - $scope.unCollapsedTopicIds.splice(index, 1); - } - else{ - $scope.unCollapsedTopicIds.push(clickedTopicId); - } - }); - }, 500); - }; - - $(document).ready(function() { - - addClickListenerToEachCollapseTrigger(); - }); - - $scope.refreshTopicsOverview = function(){ - $scope.loadingData = true; - - $scope.unCollapsedTopicIds.forEach(function(topicId){ - // simulate click on item in order to uncollapse it - $('#'+topicId).click(); - }); - - addClickListenerToEachCollapseTrigger(); - - $scope.loadingData = false; - }; - - $scope.$on("refreshTopicsOverview", function (event) { - $scope.refreshTopicsOverview(); - }); - - $scope.onAddMainTopic = function(resourceType){ - - var postBody = { - "topicResource": resourceType, - "topicType": "main", - "subTopics": [] - }; - - if(resourceType === "indicator"){ - postBody.topicName = $scope.newMainTopicTitle_indicator; - postBody.topicDescription = $scope.newMainTopicDescription_indicator; - } - else{ - postBody.topicName = $scope.newMainTopicTitle_georesource; - postBody.topicDescription = $scope.newMainTopicDescription_georesource; - } - - $scope.loadingData = true; - - $http({ - url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/topics", - method: "POST", - data: postBody - // headers: { - // 'Content-Type': undefined - // } - }).then(async function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - await kommonitorDataExchangeService.fetchTopicsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles); - - $scope.refreshTopicsOverview(); - - // refresh all admin dashboard diagrams due to modified metadata - $rootScope.$broadcast("refreshAdminDashboardDiagrams"); - - $timeout(function(){ - - $scope.loadingData = false; - }); - - }, function errorCallback(error) { - if(error.data){ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else{ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - - $("#topicsErrorAlert").show(); - $timeout(function(){ - - $scope.loadingData = false; - }); - - // setTimeout(function() { - // $("#spatialUnitAddSucessAlert").hide(); - // }, 3000); - }); - - $scope.newMainTopicTitle_indicator = undefined; - $scope.newMainTopicDescription_indicator = undefined; - $scope.newMainTopicTitle_georesource = undefined; - $scope.newMainTopicDescription_georesource = undefined; - }; - - $scope.onAddSubTopic = function(mainTopic, resourceType){ - - $scope.loadingData = true; - var topicId = mainTopic.topicId; - - var subTopic = { - "topicResource": resourceType, - "topicType": "sub", - "subTopics": [] - }; - - if(resourceType === "indicator"){ - subTopic.topicName = mainTopic.newSubTopicTitle_indicator; - subTopic.topicDescription = mainTopic.newSubTopicDescription_indicator; - } - else{ - subTopic.topicName = mainTopic.newSubTopicTitle_georesource; - subTopic.topicDescription = mainTopic.newSubTopicDescription_georesource; - } - - // check if subTopic already exists, then abort - add to mainTopic otherwise - if($scope.alreadyInSubtopics(subTopic, mainTopic.subTopics)){ - $scope.errorMessagePart = "Ein Unterthema mit dem gleichen Titel existiert bereits."; - - $("#topicsErrorAlert").show(); - $scope.loadingData = false; - return; - } - else{ - mainTopic.subTopics.push(subTopic); - } - - var putBody = { - "topicName": mainTopic.topicName, - "topicDescription": mainTopic.topicDescription, - "topicResource": resourceType, - "topicType": mainTopic.topicType, - "subTopics": mainTopic.subTopics - }; - - $http({ - url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/topics/" + topicId, - method: "PUT", - data: putBody - // headers: { - // 'Content-Type': undefined - // } - }).then(async function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - await kommonitorDataExchangeService.fetchTopicsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles); - - $scope.refreshTopicsOverview(); - - // refresh all admin dashboard diagrams due to modified metadata - $rootScope.$broadcast("refreshAdminDashboardDiagrams"); - - $timeout(function(){ - - $scope.loadingData = false; - }); - - }, function errorCallback(error) { - if(error.data){ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else{ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - - $("#topicsErrorAlert").show(); - $timeout(function(){ - - $scope.loadingData = false; - }); - - // setTimeout(function() { - // $("#spatialUnitAddSucessAlert").hide(); - // }, 3000); - }); - - delete mainTopic.newSubTopicTitle_indicator; - delete mainTopic.newSubTopicDescription_indicator; - }; - - $scope.alreadyInSubtopics = function(subTopicCandidate, subTopics){ - for(var subTopic of subTopics){ - if (subTopic.topicName === subTopicCandidate.topicName){ - return true; - } - } - return false; - }; - - $scope.onAddSubSubSubTopic = function(subTopic, resourceType){ - - $scope.loadingData = true; - var topicId = subTopic.topicId; - - var subSubSubTopic = { - "topicResource": resourceType, - "topicType": "sub", - "subTopics": [] - }; - - if(resourceType === "indicator"){ - subSubSubTopic.topicName = subTopic.newSubTopicTitle_indicator; - subSubSubTopic.topicDescription = subTopic.newSubTopicDescription_indicator; - } - else{ - subSubSubTopic.topicName = subTopic.newSubTopicTitle_georesource; - subSubSubTopic.topicDescription = subTopic.newSubTopicDescription_georesource; - } - - // check if subTopic already exists, then abort - add to mainTopic otherwise - if($scope.alreadyInSubtopics(subSubSubTopic, subTopic.subTopics)){ - $scope.errorMessagePart = "Ein Unterthema mit dem gleichen Titel existiert bereits."; - - $("#topicsErrorAlert").show(); - $scope.loadingData = false; - return; - } - else{ - subTopic.subTopics.push(subSubSubTopic); - } - - var putBody = { - "topicName": subTopic.topicName, - "topicDescription": subTopic.topicDescription, - "topicResource": resourceType, - "topicType": subTopic.topicType, - "subTopics": subTopic.subTopics - }; - - $http({ - url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/topics/" + topicId, - method: "PUT", - data: putBody - // headers: { - // 'Content-Type': undefined - // } - }).then(async function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - await kommonitorDataExchangeService.fetchTopicsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles); - - $scope.refreshTopicsOverview(); - - // refresh all admin dashboard diagrams due to modified metadata - $rootScope.$broadcast("refreshAdminDashboardDiagrams"); - - $timeout(function(){ - - $scope.loadingData = false; - }); - - }, function errorCallback(error) { - if(error.data){ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else{ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - - $("#topicsErrorAlert").show(); - $timeout(function(){ - - $scope.loadingData = false; - }); - - // setTimeout(function() { - // $("#spatialUnitAddSucessAlert").hide(); - // }, 3000); - }); - - delete subTopic.newSubTopicTitle_indicator; - delete subTopic.newSubTopicDescription_indicator; - }; - - $scope.onAddSubSubTopic = function(subTopic, resourceType){ - - $scope.loadingData = true; - var topicId = subTopic.topicId; - - var subSubTopic = { - "topicResource": resourceType, - "topicType": "sub", - "subTopics": [] - }; - - if(resourceType === "indicator"){ - subSubTopic.topicName = subTopic.newSubTopicTitle_indicator; - subSubTopic.topicDescription = subTopic.newSubTopicDescription_indicator; - } - else{ - subSubTopic.topicName = subTopic.newSubTopicTitle_georesource; - subSubTopic.topicDescription = subTopic.newSubTopicDescription_georesource; - } - - // check if subTopic already exists, then abort - add to mainTopic otherwise - if($scope.alreadyInSubtopics(subSubTopic, subTopic.subTopics)){ - $scope.errorMessagePart = "Ein Unterthema mit dem gleichen Titel existiert bereits."; - - $("#topicsErrorAlert").show(); - $scope.loadingData = false; - return; - } - else{ - subTopic.subTopics.push(subSubTopic); - } - - var putBody = { - "topicName": subTopic.topicName, - "topicDescription": subTopic.topicDescription, - "topicResource": resourceType, - "topicType": subTopic.topicType, - "subTopics": subTopic.subTopics - }; - - $http({ - url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/topics/" + topicId, - method: "PUT", - data: putBody - // headers: { - // 'Content-Type': undefined - // } - }).then(async function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - await kommonitorDataExchangeService.fetchTopicsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles); - - $scope.refreshTopicsOverview(); - - // refresh all admin dashboard diagrams due to modified metadata - $rootScope.$broadcast("refreshAdminDashboardDiagrams"); - - $timeout(function(){ - - $scope.loadingData = false; - }); - - }, function errorCallback(error) { - if(error.data){ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else{ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - - $("#topicsErrorAlert").show(); - $timeout(function(){ - - $scope.loadingData = false; - }); - - // setTimeout(function() { - // $("#spatialUnitAddSucessAlert").hide(); - // }, 3000); - }); - - delete subTopic.newSubTopicTitle_indicator; - delete subTopic.newSubTopicDescription_indicator; - }; - - $scope.deleteTopic = function(topic){ - - var topicId = topic.topicId; - - $scope.loadingData = true; - - $http({ - url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/topics/" + topicId, - method: "DELETE" - // headers: { - // 'Content-Type': undefined - // } - }).then(async function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - await kommonitorDataExchangeService.fetchTopicsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles); - - $scope.refreshTopicsOverview(); - - $timeout(function(){ - - $scope.loadingData = false; - }); - - }, function errorCallback(error) { - if(error.data){ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else{ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - - $("#topicsErrorAlert").show(); - $timeout(function(){ - - $scope.loadingData = false; - }); - - // setTimeout(function() { - // $("#spatialUnitAddSucessAlert").hide(); - // }, 3000); - }); - }; - - $scope.onClickEditTopic = function(topic){ - // submit selected topic to modal controller - $rootScope.$broadcast("onEditTopic", topic); - }; - - $scope.onClickDeleteTopic = function(topic){ - // submit selected topic to modal controller - $rootScope.$broadcast("onDeleteTopic", topic); - }; - - $scope.hideErrorAlert = function(){ - $("#topicsErrorAlert").hide(); - }; - - } -]}); + templateUrl: "components/kommonitorAdmin/adminTopicsManagement/admin-topics-management.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorCacheHelperService', '$scope', '$rootScope', '__env', '$http', '$timeout', + function TopicsManagementController(kommonitorDataExchangeService, kommonitorCacheHelperService, $scope, $rootScope, __env, $http, $timeout) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + $scope.newMainTopicTitle_indicator; + $scope.newMainTopicDescription_indicator; + $scope.newMainTopicTitle_georesource; + $scope.newMainTopicDescription_georesource; + $scope.showTopicIds = false; + $scope.unCollapsedTopicIds = []; + $scope.errorMessagePart; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + var addClickListenerToEachCollapseTrigger = function () { + setTimeout(function () { + $('.list-group-item > .collapseTrigger').on('click', function () { + $('.glyphicon', this) + .toggleClass('glyphicon-chevron-right') + .toggleClass('glyphicon-chevron-down'); + // manage uncollapsed entries + var clickedTopicId = $(this).attr('id'); + if ($scope.unCollapsedTopicIds.includes(clickedTopicId)) { + var index = $scope.unCollapsedTopicIds.indexOf(clickedTopicId); + $scope.unCollapsedTopicIds.splice(index, 1); + } + else { + $scope.unCollapsedTopicIds.push(clickedTopicId); + } + }); + }, 500); + }; + $(document).ready(function () { + addClickListenerToEachCollapseTrigger(); + }); + $scope.refreshTopicsOverview = function () { + $scope.loadingData = true; + $scope.unCollapsedTopicIds.forEach(function (topicId) { + // simulate click on item in order to uncollapse it + $('#' + topicId).click(); + }); + addClickListenerToEachCollapseTrigger(); + $scope.loadingData = false; + }; + $scope.$on("refreshTopicsOverview", function (event) { + $scope.refreshTopicsOverview(); + }); + $scope.onAddMainTopic = function (resourceType) { + var postBody = { + "topicResource": resourceType, + "topicType": "main", + "subTopics": [] + }; + if (resourceType === "indicator") { + postBody.topicName = $scope.newMainTopicTitle_indicator; + postBody.topicDescription = $scope.newMainTopicDescription_indicator; + } + else { + postBody.topicName = $scope.newMainTopicTitle_georesource; + postBody.topicDescription = $scope.newMainTopicDescription_georesource; + } + $scope.loadingData = true; + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/topics", + method: "POST", + data: postBody + // headers: { + // 'Content-Type': undefined + // } + }).then(async function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + await kommonitorDataExchangeService.fetchTopicsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles); + $scope.refreshTopicsOverview(); + // refresh all admin dashboard diagrams due to modified metadata + $rootScope.$broadcast("refreshAdminDashboardDiagrams"); + $timeout(function () { + $scope.loadingData = false; + }); + }, function errorCallback(error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + $("#topicsErrorAlert").show(); + $timeout(function () { + $scope.loadingData = false; + }); + // setTimeout(function() { + // $("#spatialUnitAddSucessAlert").hide(); + // }, 3000); + }); + $scope.newMainTopicTitle_indicator = undefined; + $scope.newMainTopicDescription_indicator = undefined; + $scope.newMainTopicTitle_georesource = undefined; + $scope.newMainTopicDescription_georesource = undefined; + }; + $scope.onAddSubTopic = function (mainTopic, resourceType) { + $scope.loadingData = true; + var topicId = mainTopic.topicId; + var subTopic = { + "topicResource": resourceType, + "topicType": "sub", + "subTopics": [] + }; + if (resourceType === "indicator") { + subTopic.topicName = mainTopic.newSubTopicTitle_indicator; + subTopic.topicDescription = mainTopic.newSubTopicDescription_indicator; + } + else { + subTopic.topicName = mainTopic.newSubTopicTitle_georesource; + subTopic.topicDescription = mainTopic.newSubTopicDescription_georesource; + } + // check if subTopic already exists, then abort - add to mainTopic otherwise + if ($scope.alreadyInSubtopics(subTopic, mainTopic.subTopics)) { + $scope.errorMessagePart = "Ein Unterthema mit dem gleichen Titel existiert bereits."; + $("#topicsErrorAlert").show(); + $scope.loadingData = false; + return; + } + else { + mainTopic.subTopics.push(subTopic); + } + var putBody = { + "topicName": mainTopic.topicName, + "topicDescription": mainTopic.topicDescription, + "topicResource": resourceType, + "topicType": mainTopic.topicType, + "subTopics": mainTopic.subTopics + }; + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/topics/" + topicId, + method: "PUT", + data: putBody + // headers: { + // 'Content-Type': undefined + // } + }).then(async function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + await kommonitorDataExchangeService.fetchTopicsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles); + $scope.refreshTopicsOverview(); + // refresh all admin dashboard diagrams due to modified metadata + $rootScope.$broadcast("refreshAdminDashboardDiagrams"); + $timeout(function () { + $scope.loadingData = false; + }); + }, function errorCallback(error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + $("#topicsErrorAlert").show(); + $timeout(function () { + $scope.loadingData = false; + }); + // setTimeout(function() { + // $("#spatialUnitAddSucessAlert").hide(); + // }, 3000); + }); + delete mainTopic.newSubTopicTitle_indicator; + delete mainTopic.newSubTopicDescription_indicator; + }; + $scope.alreadyInSubtopics = function (subTopicCandidate, subTopics) { + for (var subTopic of subTopics) { + if (subTopic.topicName === subTopicCandidate.topicName) { + return true; + } + } + return false; + }; + $scope.onAddSubSubSubTopic = function (subTopic, resourceType) { + $scope.loadingData = true; + var topicId = subTopic.topicId; + var subSubSubTopic = { + "topicResource": resourceType, + "topicType": "sub", + "subTopics": [] + }; + if (resourceType === "indicator") { + subSubSubTopic.topicName = subTopic.newSubTopicTitle_indicator; + subSubSubTopic.topicDescription = subTopic.newSubTopicDescription_indicator; + } + else { + subSubSubTopic.topicName = subTopic.newSubTopicTitle_georesource; + subSubSubTopic.topicDescription = subTopic.newSubTopicDescription_georesource; + } + // check if subTopic already exists, then abort - add to mainTopic otherwise + if ($scope.alreadyInSubtopics(subSubSubTopic, subTopic.subTopics)) { + $scope.errorMessagePart = "Ein Unterthema mit dem gleichen Titel existiert bereits."; + $("#topicsErrorAlert").show(); + $scope.loadingData = false; + return; + } + else { + subTopic.subTopics.push(subSubSubTopic); + } + var putBody = { + "topicName": subTopic.topicName, + "topicDescription": subTopic.topicDescription, + "topicResource": resourceType, + "topicType": subTopic.topicType, + "subTopics": subTopic.subTopics + }; + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/topics/" + topicId, + method: "PUT", + data: putBody + // headers: { + // 'Content-Type': undefined + // } + }).then(async function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + await kommonitorDataExchangeService.fetchTopicsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles); + $scope.refreshTopicsOverview(); + // refresh all admin dashboard diagrams due to modified metadata + $rootScope.$broadcast("refreshAdminDashboardDiagrams"); + $timeout(function () { + $scope.loadingData = false; + }); + }, function errorCallback(error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + $("#topicsErrorAlert").show(); + $timeout(function () { + $scope.loadingData = false; + }); + // setTimeout(function() { + // $("#spatialUnitAddSucessAlert").hide(); + // }, 3000); + }); + delete subTopic.newSubTopicTitle_indicator; + delete subTopic.newSubTopicDescription_indicator; + }; + $scope.onAddSubSubTopic = function (subTopic, resourceType) { + $scope.loadingData = true; + var topicId = subTopic.topicId; + var subSubTopic = { + "topicResource": resourceType, + "topicType": "sub", + "subTopics": [] + }; + if (resourceType === "indicator") { + subSubTopic.topicName = subTopic.newSubTopicTitle_indicator; + subSubTopic.topicDescription = subTopic.newSubTopicDescription_indicator; + } + else { + subSubTopic.topicName = subTopic.newSubTopicTitle_georesource; + subSubTopic.topicDescription = subTopic.newSubTopicDescription_georesource; + } + // check if subTopic already exists, then abort - add to mainTopic otherwise + if ($scope.alreadyInSubtopics(subSubTopic, subTopic.subTopics)) { + $scope.errorMessagePart = "Ein Unterthema mit dem gleichen Titel existiert bereits."; + $("#topicsErrorAlert").show(); + $scope.loadingData = false; + return; + } + else { + subTopic.subTopics.push(subSubTopic); + } + var putBody = { + "topicName": subTopic.topicName, + "topicDescription": subTopic.topicDescription, + "topicResource": resourceType, + "topicType": subTopic.topicType, + "subTopics": subTopic.subTopics + }; + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/topics/" + topicId, + method: "PUT", + data: putBody + // headers: { + // 'Content-Type': undefined + // } + }).then(async function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + await kommonitorDataExchangeService.fetchTopicsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles); + $scope.refreshTopicsOverview(); + // refresh all admin dashboard diagrams due to modified metadata + $rootScope.$broadcast("refreshAdminDashboardDiagrams"); + $timeout(function () { + $scope.loadingData = false; + }); + }, function errorCallback(error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + $("#topicsErrorAlert").show(); + $timeout(function () { + $scope.loadingData = false; + }); + // setTimeout(function() { + // $("#spatialUnitAddSucessAlert").hide(); + // }, 3000); + }); + delete subTopic.newSubTopicTitle_indicator; + delete subTopic.newSubTopicDescription_indicator; + }; + $scope.deleteTopic = function (topic) { + var topicId = topic.topicId; + $scope.loadingData = true; + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/topics/" + topicId, + method: "DELETE" + // headers: { + // 'Content-Type': undefined + // } + }).then(async function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + await kommonitorDataExchangeService.fetchTopicsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles); + $scope.refreshTopicsOverview(); + $timeout(function () { + $scope.loadingData = false; + }); + }, function errorCallback(error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + $("#topicsErrorAlert").show(); + $timeout(function () { + $scope.loadingData = false; + }); + // setTimeout(function() { + // $("#spatialUnitAddSucessAlert").hide(); + // }, 3000); + }); + }; + $scope.onClickEditTopic = function (topic) { + // submit selected topic to modal controller + $rootScope.$broadcast("onEditTopic", topic); + }; + $scope.onClickDeleteTopic = function (topic) { + // submit selected topic to modal controller + $rootScope.$broadcast("onDeleteTopic", topic); + }; + $scope.hideErrorAlert = function () { + $("#topicsErrorAlert").hide(); + }; + } + ] +}); +//# sourceMappingURL=admin-topics-management.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminTopicsManagement/admin-topics-management.component.js.map b/app/components/kommonitorAdmin/adminTopicsManagement/admin-topics-management.component.js.map new file mode 100644 index 000000000..10c2289bc --- /dev/null +++ b/app/components/kommonitorAdmin/adminTopicsManagement/admin-topics-management.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"admin-topics-management.component.js","sourceRoot":"","sources":["admin-topics-management.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,SAAS,CAAC,uBAAuB,EAAE;IAC1E,WAAW,EAAG,wFAAwF;IACtG,UAA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CAAC,mBAAmB,CAAC,6BAA6B,CAAC,yBAAyB,CAAC,CAAC;oBAEjH,MAAM,CAAC,qBAAqB,EAAE,CAAC;oBAE/B,QAAQ,CAAC;wBAER,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;oBAC5B,CAAC,CAAC,CAAC;gBAEJ,CAAC,EAAE,SAAS,aAAa,CAAC,KAAK;oBAC9B,IAAG,KAAK,CAAC,IAAI,EAAC;wBACb,MAAM,CAAC,gBAAgB,GAAG,6BAA6B,CAAC,mBAAmB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;qBACxF;yBACG;wBACH,MAAM,CAAC,gBAAgB,GAAG,6BAA6B,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;qBACnF;oBAED,CAAC,CAAC,mBAAmB,CAAC,CAAC,IAAI,EAAE,CAAC;oBAC9B,QAAQ,CAAC;wBAER,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;oBAC5B,CAAC,CAAC,CAAC;oBAEH,0BAA0B;oBAC1B,4CAA4C;oBAC5C,YAAY;gBACd,CAAC,CAAC,CAAC;YACJ,CAAC,CAAC;YAEF,MAAM,CAAC,gBAAgB,GAAG,UAAS,KAAK;gBACvC,4CAA4C;gBAC5C,UAAU,CAAC,UAAU,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;YAC7C,CAAC,CAAC;YAEF,MAAM,CAAC,kBAAkB,GAAG,UAAS,KAAK;gBACzC,4CAA4C;gBAC5C,UAAU,CAAC,UAAU,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;YAC/C,CAAC,CAAC;YAEF,MAAM,CAAC,cAAc,GAAG;gBACvB,CAAC,CAAC,mBAAmB,CAAC,CAAC,IAAI,EAAE,CAAC;YAC/B,CAAC,CAAC;QAEH,CAAC;KACD;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminTopicsManagement/admin-topics-management.component.ts b/app/components/kommonitorAdmin/adminTopicsManagement/admin-topics-management.component.ts new file mode 100644 index 000000000..6ddca97b7 --- /dev/null +++ b/app/components/kommonitorAdmin/adminTopicsManagement/admin-topics-management.component.ts @@ -0,0 +1,459 @@ +angular.module('adminTopicsManagement').component('adminTopicsManagement', { + templateUrl : "components/kommonitorAdmin/adminTopicsManagement/admin-topics-management.template.html", + controller : ['kommonitorDataExchangeService', 'kommonitorCacheHelperService', '$scope', '$rootScope', '__env', '$http', '$timeout', + function TopicsManagementController(kommonitorDataExchangeService, kommonitorCacheHelperService, $scope, $rootScope, __env, $http, $timeout) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + + $scope.newMainTopicTitle_indicator; + $scope.newMainTopicDescription_indicator; + + $scope.newMainTopicTitle_georesource; + $scope.newMainTopicDescription_georesource; + + $scope.showTopicIds = false; + + $scope.unCollapsedTopicIds = []; + + $scope.errorMessagePart; + + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + var addClickListenerToEachCollapseTrigger = function(){ + setTimeout(function(){ + $('.list-group-item > .collapseTrigger').on('click', function() { + $('.glyphicon', this) + .toggleClass('glyphicon-chevron-right') + .toggleClass('glyphicon-chevron-down'); + + // manage uncollapsed entries + var clickedTopicId = $(this).attr('id'); + if ($scope.unCollapsedTopicIds.includes(clickedTopicId)){ + var index = $scope.unCollapsedTopicIds.indexOf(clickedTopicId); + $scope.unCollapsedTopicIds.splice(index, 1); + } + else{ + $scope.unCollapsedTopicIds.push(clickedTopicId); + } + }); + }, 500); + }; + + $(document).ready(function() { + + addClickListenerToEachCollapseTrigger(); + }); + + $scope.refreshTopicsOverview = function(){ + $scope.loadingData = true; + + $scope.unCollapsedTopicIds.forEach(function(topicId){ + // simulate click on item in order to uncollapse it + $('#'+topicId).click(); + }); + + addClickListenerToEachCollapseTrigger(); + + $scope.loadingData = false; + }; + + $scope.$on("refreshTopicsOverview", function (event) { + $scope.refreshTopicsOverview(); + }); + + $scope.onAddMainTopic = function(resourceType){ + + var postBody = { + "topicResource": resourceType, + "topicType": "main", + "subTopics": [] + }; + + if(resourceType === "indicator"){ + postBody.topicName = $scope.newMainTopicTitle_indicator; + postBody.topicDescription = $scope.newMainTopicDescription_indicator; + } + else{ + postBody.topicName = $scope.newMainTopicTitle_georesource; + postBody.topicDescription = $scope.newMainTopicDescription_georesource; + } + + $scope.loadingData = true; + + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/topics", + method: "POST", + data: postBody + // headers: { + // 'Content-Type': undefined + // } + }).then(async function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + await kommonitorDataExchangeService.fetchTopicsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles); + + $scope.refreshTopicsOverview(); + + // refresh all admin dashboard diagrams due to modified metadata + $rootScope.$broadcast("refreshAdminDashboardDiagrams"); + + $timeout(function(){ + + $scope.loadingData = false; + }); + + }, function errorCallback(error) { + if(error.data){ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else{ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + + $("#topicsErrorAlert").show(); + $timeout(function(){ + + $scope.loadingData = false; + }); + + // setTimeout(function() { + // $("#spatialUnitAddSucessAlert").hide(); + // }, 3000); + }); + + $scope.newMainTopicTitle_indicator = undefined; + $scope.newMainTopicDescription_indicator = undefined; + $scope.newMainTopicTitle_georesource = undefined; + $scope.newMainTopicDescription_georesource = undefined; + }; + + $scope.onAddSubTopic = function(mainTopic, resourceType){ + + $scope.loadingData = true; + var topicId = mainTopic.topicId; + + var subTopic = { + "topicResource": resourceType, + "topicType": "sub", + "subTopics": [] + }; + + if(resourceType === "indicator"){ + subTopic.topicName = mainTopic.newSubTopicTitle_indicator; + subTopic.topicDescription = mainTopic.newSubTopicDescription_indicator; + } + else{ + subTopic.topicName = mainTopic.newSubTopicTitle_georesource; + subTopic.topicDescription = mainTopic.newSubTopicDescription_georesource; + } + + // check if subTopic already exists, then abort - add to mainTopic otherwise + if($scope.alreadyInSubtopics(subTopic, mainTopic.subTopics)){ + $scope.errorMessagePart = "Ein Unterthema mit dem gleichen Titel existiert bereits."; + + $("#topicsErrorAlert").show(); + $scope.loadingData = false; + return; + } + else{ + mainTopic.subTopics.push(subTopic); + } + + var putBody = { + "topicName": mainTopic.topicName, + "topicDescription": mainTopic.topicDescription, + "topicResource": resourceType, + "topicType": mainTopic.topicType, + "subTopics": mainTopic.subTopics + }; + + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/topics/" + topicId, + method: "PUT", + data: putBody + // headers: { + // 'Content-Type': undefined + // } + }).then(async function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + await kommonitorDataExchangeService.fetchTopicsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles); + + $scope.refreshTopicsOverview(); + + // refresh all admin dashboard diagrams due to modified metadata + $rootScope.$broadcast("refreshAdminDashboardDiagrams"); + + $timeout(function(){ + + $scope.loadingData = false; + }); + + }, function errorCallback(error) { + if(error.data){ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else{ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + + $("#topicsErrorAlert").show(); + $timeout(function(){ + + $scope.loadingData = false; + }); + + // setTimeout(function() { + // $("#spatialUnitAddSucessAlert").hide(); + // }, 3000); + }); + + delete mainTopic.newSubTopicTitle_indicator; + delete mainTopic.newSubTopicDescription_indicator; + }; + + $scope.alreadyInSubtopics = function(subTopicCandidate, subTopics){ + for(var subTopic of subTopics){ + if (subTopic.topicName === subTopicCandidate.topicName){ + return true; + } + } + return false; + }; + + $scope.onAddSubSubSubTopic = function(subTopic, resourceType){ + + $scope.loadingData = true; + var topicId = subTopic.topicId; + + var subSubSubTopic = { + "topicResource": resourceType, + "topicType": "sub", + "subTopics": [] + }; + + if(resourceType === "indicator"){ + subSubSubTopic.topicName = subTopic.newSubTopicTitle_indicator; + subSubSubTopic.topicDescription = subTopic.newSubTopicDescription_indicator; + } + else{ + subSubSubTopic.topicName = subTopic.newSubTopicTitle_georesource; + subSubSubTopic.topicDescription = subTopic.newSubTopicDescription_georesource; + } + + // check if subTopic already exists, then abort - add to mainTopic otherwise + if($scope.alreadyInSubtopics(subSubSubTopic, subTopic.subTopics)){ + $scope.errorMessagePart = "Ein Unterthema mit dem gleichen Titel existiert bereits."; + + $("#topicsErrorAlert").show(); + $scope.loadingData = false; + return; + } + else{ + subTopic.subTopics.push(subSubSubTopic); + } + + var putBody = { + "topicName": subTopic.topicName, + "topicDescription": subTopic.topicDescription, + "topicResource": resourceType, + "topicType": subTopic.topicType, + "subTopics": subTopic.subTopics + }; + + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/topics/" + topicId, + method: "PUT", + data: putBody + // headers: { + // 'Content-Type': undefined + // } + }).then(async function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + await kommonitorDataExchangeService.fetchTopicsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles); + + $scope.refreshTopicsOverview(); + + // refresh all admin dashboard diagrams due to modified metadata + $rootScope.$broadcast("refreshAdminDashboardDiagrams"); + + $timeout(function(){ + + $scope.loadingData = false; + }); + + }, function errorCallback(error) { + if(error.data){ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else{ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + + $("#topicsErrorAlert").show(); + $timeout(function(){ + + $scope.loadingData = false; + }); + + // setTimeout(function() { + // $("#spatialUnitAddSucessAlert").hide(); + // }, 3000); + }); + + delete subTopic.newSubTopicTitle_indicator; + delete subTopic.newSubTopicDescription_indicator; + }; + + $scope.onAddSubSubTopic = function(subTopic, resourceType){ + + $scope.loadingData = true; + var topicId = subTopic.topicId; + + var subSubTopic = { + "topicResource": resourceType, + "topicType": "sub", + "subTopics": [] + }; + + if(resourceType === "indicator"){ + subSubTopic.topicName = subTopic.newSubTopicTitle_indicator; + subSubTopic.topicDescription = subTopic.newSubTopicDescription_indicator; + } + else{ + subSubTopic.topicName = subTopic.newSubTopicTitle_georesource; + subSubTopic.topicDescription = subTopic.newSubTopicDescription_georesource; + } + + // check if subTopic already exists, then abort - add to mainTopic otherwise + if($scope.alreadyInSubtopics(subSubTopic, subTopic.subTopics)){ + $scope.errorMessagePart = "Ein Unterthema mit dem gleichen Titel existiert bereits."; + + $("#topicsErrorAlert").show(); + $scope.loadingData = false; + return; + } + else{ + subTopic.subTopics.push(subSubTopic); + } + + var putBody = { + "topicName": subTopic.topicName, + "topicDescription": subTopic.topicDescription, + "topicResource": resourceType, + "topicType": subTopic.topicType, + "subTopics": subTopic.subTopics + }; + + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/topics/" + topicId, + method: "PUT", + data: putBody + // headers: { + // 'Content-Type': undefined + // } + }).then(async function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + await kommonitorDataExchangeService.fetchTopicsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles); + + $scope.refreshTopicsOverview(); + + // refresh all admin dashboard diagrams due to modified metadata + $rootScope.$broadcast("refreshAdminDashboardDiagrams"); + + $timeout(function(){ + + $scope.loadingData = false; + }); + + }, function errorCallback(error) { + if(error.data){ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else{ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + + $("#topicsErrorAlert").show(); + $timeout(function(){ + + $scope.loadingData = false; + }); + + // setTimeout(function() { + // $("#spatialUnitAddSucessAlert").hide(); + // }, 3000); + }); + + delete subTopic.newSubTopicTitle_indicator; + delete subTopic.newSubTopicDescription_indicator; + }; + + $scope.deleteTopic = function(topic){ + + var topicId = topic.topicId; + + $scope.loadingData = true; + + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/topics/" + topicId, + method: "DELETE" + // headers: { + // 'Content-Type': undefined + // } + }).then(async function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + await kommonitorDataExchangeService.fetchTopicsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles); + + $scope.refreshTopicsOverview(); + + $timeout(function(){ + + $scope.loadingData = false; + }); + + }, function errorCallback(error) { + if(error.data){ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else{ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + + $("#topicsErrorAlert").show(); + $timeout(function(){ + + $scope.loadingData = false; + }); + + // setTimeout(function() { + // $("#spatialUnitAddSucessAlert").hide(); + // }, 3000); + }); + }; + + $scope.onClickEditTopic = function(topic){ + // submit selected topic to modal controller + $rootScope.$broadcast("onEditTopic", topic); + }; + + $scope.onClickDeleteTopic = function(topic){ + // submit selected topic to modal controller + $rootScope.$broadcast("onDeleteTopic", topic); + }; + + $scope.hideErrorAlert = function(){ + $("#topicsErrorAlert").hide(); + }; + + } +]}); diff --git a/app/components/kommonitorAdmin/adminTopicsManagement/admin-topics-management.module.js b/app/components/kommonitorAdmin/adminTopicsManagement/admin-topics-management.module.js index 75966eaa5..8ebe959fd 100644 --- a/app/components/kommonitorAdmin/adminTopicsManagement/admin-topics-management.module.js +++ b/app/components/kommonitorAdmin/adminTopicsManagement/admin-topics-management.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('adminTopicsManagement', ['kommonitorDataExchange', 'kommonitorCacheHelper', 'ui.bootstrap']); +//# sourceMappingURL=admin-topics-management.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminTopicsManagement/admin-topics-management.module.js.map b/app/components/kommonitorAdmin/adminTopicsManagement/admin-topics-management.module.js.map new file mode 100644 index 000000000..7b272ea41 --- /dev/null +++ b/app/components/kommonitorAdmin/adminTopicsManagement/admin-topics-management.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"admin-topics-management.module.js","sourceRoot":"","sources":["admin-topics-management.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,uBAAuB,EAAE,CAAC,wBAAwB,EAAE,uBAAuB,EAAE,cAAc,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminTopicsManagement/admin-topics-management.module.ts b/app/components/kommonitorAdmin/adminTopicsManagement/admin-topics-management.module.ts new file mode 100644 index 000000000..75966eaa5 --- /dev/null +++ b/app/components/kommonitorAdmin/adminTopicsManagement/admin-topics-management.module.ts @@ -0,0 +1 @@ +angular.module('adminTopicsManagement', ['kommonitorDataExchange', 'kommonitorCacheHelper', 'ui.bootstrap']); diff --git a/app/components/kommonitorAdmin/adminTopicsManagement/topicDeleteModal/topic-delete-modal.component.js b/app/components/kommonitorAdmin/adminTopicsManagement/topicDeleteModal/topic-delete-modal.component.js index 7b283dde5..3074721a1 100644 --- a/app/components/kommonitorAdmin/adminTopicsManagement/topicDeleteModal/topic-delete-modal.component.js +++ b/app/components/kommonitorAdmin/adminTopicsManagement/topicDeleteModal/topic-delete-modal.component.js @@ -1,105 +1,76 @@ +"use strict"; angular.module('topicDeleteModal').component('topicDeleteModal', { - templateUrl : "components/kommonitorAdmin/adminTopicsManagement/topicDeleteModal/topic-delete-modal.template.html", - controller : ['kommonitorDataExchangeService', '$scope', '$rootScope', '$http', '__env', '$q', '$timeout',function TopicDeleteModalController(kommonitorDataExchangeService, $scope, $rootScope, $http, __env, $q, $timeout) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - - $scope.topicToDelete; - $scope.topicToDelete_prettyPrint; - - $scope.loadingData = false; - - $scope.errorMessagePart = undefined; - - $scope.$on("onDeleteTopic", function (event, topic) { - - $scope.topicToDelete = topic; - - // $scope.topicToDelete_prettyPrint = JSON.stringify(topic, null, 2); // spacing level = 2; - $scope.topicToDelete_prettyPrint = kommonitorDataExchangeService.syntaxHighlightJSON(topic); - - document.getElementById("deleteTopicPre").innerHTML = $scope.topicToDelete_prettyPrint; - - $scope.resetTopicDeleteForm(); - - }); - - - $scope.resetTopicDeleteForm = function(){ - $scope.errorMessagePart = undefined; - $("#topicDeleteSuccessAlert").hide(); - $("#topicDeleteErrorAlert").hide(); - }; - - $scope.deleteTopic = function(topic){ - - var topicId = topic.topicId; - - $scope.loadingData = true; - - $http({ - url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/topics/" + topicId, - method: "DELETE" - // headers: { - // 'Content-Type': undefined - // } - }).then(async function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - await kommonitorDataExchangeService.fetchTopicsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles); - - $rootScope.$broadcast("refreshTopicsOverview"); - - // refresh all admin dashboard diagrams due to modified metadata - $rootScope.$broadcast("refreshAdminDashboardDiagrams"); - - $timeout(function(){ - - $scope.loadingData = false; - $scope.showSuccessAlert(); - }); - - }, function errorCallback(error) { - if(error.data){ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else{ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - - $("#topicsErrorAlert").show(); - $timeout(function(){ - - $scope.loadingData = false; - }); - - // setTimeout(function() { - // $("#spatialUnitAddSucessAlert").hide(); - // }, 3000); - }); - - }; - - $scope.hideSuccessAlert = function(){ - $("#topicDeleteSuccessAlert").hide(); - - $scope.topicToDelete = undefined; - $scope.topicToDelete_prettyPrint = undefined; - document.getElementById("deleteTopicPre").innerHTML = undefined; - }; - - $scope.showSuccessAlert = function(){ - $("#topicDeleteSuccessAlert").show(); - }; - - $scope.hideErrorAlert = function(){ - $("#topicDeleteErrorAlert").hide(); - }; - - $scope.showErrorAlert = function(){ - $("#topicDeleteErrorAlert").show(); - }; - - } -]}); + templateUrl: "components/kommonitorAdmin/adminTopicsManagement/topicDeleteModal/topic-delete-modal.template.html", + controller: ['kommonitorDataExchangeService', '$scope', '$rootScope', '$http', '__env', '$q', '$timeout', function TopicDeleteModalController(kommonitorDataExchangeService, $scope, $rootScope, $http, __env, $q, $timeout) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + $scope.topicToDelete; + $scope.topicToDelete_prettyPrint; + $scope.loadingData = false; + $scope.errorMessagePart = undefined; + $scope.$on("onDeleteTopic", function (event, topic) { + $scope.topicToDelete = topic; + // $scope.topicToDelete_prettyPrint = JSON.stringify(topic, null, 2); // spacing level = 2; + $scope.topicToDelete_prettyPrint = kommonitorDataExchangeService.syntaxHighlightJSON(topic); + document.getElementById("deleteTopicPre").innerHTML = $scope.topicToDelete_prettyPrint; + $scope.resetTopicDeleteForm(); + }); + $scope.resetTopicDeleteForm = function () { + $scope.errorMessagePart = undefined; + $("#topicDeleteSuccessAlert").hide(); + $("#topicDeleteErrorAlert").hide(); + }; + $scope.deleteTopic = function (topic) { + var topicId = topic.topicId; + $scope.loadingData = true; + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/topics/" + topicId, + method: "DELETE" + // headers: { + // 'Content-Type': undefined + // } + }).then(async function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + await kommonitorDataExchangeService.fetchTopicsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles); + $rootScope.$broadcast("refreshTopicsOverview"); + // refresh all admin dashboard diagrams due to modified metadata + $rootScope.$broadcast("refreshAdminDashboardDiagrams"); + $timeout(function () { + $scope.loadingData = false; + $scope.showSuccessAlert(); + }); + }, function errorCallback(error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + $("#topicsErrorAlert").show(); + $timeout(function () { + $scope.loadingData = false; + }); + // setTimeout(function() { + // $("#spatialUnitAddSucessAlert").hide(); + // }, 3000); + }); + }; + $scope.hideSuccessAlert = function () { + $("#topicDeleteSuccessAlert").hide(); + $scope.topicToDelete = undefined; + $scope.topicToDelete_prettyPrint = undefined; + document.getElementById("deleteTopicPre").innerHTML = undefined; + }; + $scope.showSuccessAlert = function () { + $("#topicDeleteSuccessAlert").show(); + }; + $scope.hideErrorAlert = function () { + $("#topicDeleteErrorAlert").hide(); + }; + $scope.showErrorAlert = function () { + $("#topicDeleteErrorAlert").show(); + }; + } + ] +}); +//# sourceMappingURL=topic-delete-modal.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminTopicsManagement/topicDeleteModal/topic-delete-modal.component.js.map b/app/components/kommonitorAdmin/adminTopicsManagement/topicDeleteModal/topic-delete-modal.component.js.map new file mode 100644 index 000000000..9aaa7fb1f --- /dev/null +++ b/app/components/kommonitorAdmin/adminTopicsManagement/topicDeleteModal/topic-delete-modal.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"topic-delete-modal.component.js","sourceRoot":"","sources":["topic-delete-modal.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,SAAS,CAAC,kBAAkB,EAAE;IAChE,WAAW,EAAG,oGAAoG;IAClH,UAAU,EAAG,CAAC,+BAA+B,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAC,SAAS,0BAA0B,CAAC,6BAA6B,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ;YAE1N,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAE3E,MAAM,CAAC,aAAa,CAAC;YACrB,MAAM,CAAC,yBAAyB,CAAC;YAEjC,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;YAE3B,MAAM,CAAC,gBAAgB,GAAG,SAAS,CAAC;YAEpC,MAAM,CAAC,GAAG,CAAC,eAAe,EAAE,UAAU,KAAK,EAAE,KAAK;gBAEjD,MAAM,CAAC,aAAa,GAAG,KAAK,CAAC;gBAE7B,2FAA2F;gBAC3F,MAAM,CAAC,yBAAyB,GAAG,6BAA6B,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;gBAE5F,QAAQ,CAAC,cAAc,CAAC,gBAA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yBACG;wBACH,MAAM,CAAC,gBAAgB,GAAG,6BAA6B,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;qBACnF;oBAED,CAAC,CAAC,mBAAmB,CAAC,CAAC,IAAI,EAAE,CAAC;oBAC9B,QAAQ,CAAC;wBAER,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;oBAC5B,CAAC,CAAC,CAAC;oBAEH,0BAA0B;oBAC1B,4CAA4C;oBAC5C,YAAY;gBACd,CAAC,CAAC,CAAC;YAEJ,CAAC,CAAC;YAED,MAAM,CAAC,gBAAgB,GAAG;gBACzB,CAAC,CAAC,0BAA0B,CAAC,CAAC,IAAI,EAAE,CAAC;gBAErC,MAAM,CAAC,aAAa,GAAG,SAAS,CAAC;gBACjC,MAAM,CAAC,yBAAyB,GAAG,SAAS,CAAC;gBAC7C,QAAQ,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC,SAAS,GAAG,SAAS,CAAC;YACjE,CAAC,CAAC;YAEF,MAAM,CAAC,gBAAgB,GAAG;gBACzB,CAAC,CAAC,0BAA0B,CAAC,CAAC,IAAI,EAAE,CAAC;YACtC,CAAC,CAAC;YAEF,MAAM,CAAC,cAAc,GAAG;gBACvB,CAAC,CAAC,wBAAwB,CAAC,CAAC,IAAI,EAAE,CAAC;YACpC,CAAC,CAAC;YAEF,MAAM,CAAC,cAAc,GAAG;gBACvB,CAAC,CAAC,wBAAwB,CAAC,CAAC,IAAI,EAAE,CAAC;YACpC,CAAC,CAAC;QAEJ,CAAC;KACD;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminTopicsManagement/topicDeleteModal/topic-delete-modal.component.ts b/app/components/kommonitorAdmin/adminTopicsManagement/topicDeleteModal/topic-delete-modal.component.ts new file mode 100644 index 000000000..7b283dde5 --- /dev/null +++ b/app/components/kommonitorAdmin/adminTopicsManagement/topicDeleteModal/topic-delete-modal.component.ts @@ -0,0 +1,105 @@ +angular.module('topicDeleteModal').component('topicDeleteModal', { + templateUrl : "components/kommonitorAdmin/adminTopicsManagement/topicDeleteModal/topic-delete-modal.template.html", + controller : ['kommonitorDataExchangeService', '$scope', '$rootScope', '$http', '__env', '$q', '$timeout',function TopicDeleteModalController(kommonitorDataExchangeService, $scope, $rootScope, $http, __env, $q, $timeout) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + + $scope.topicToDelete; + $scope.topicToDelete_prettyPrint; + + $scope.loadingData = false; + + $scope.errorMessagePart = undefined; + + $scope.$on("onDeleteTopic", function (event, topic) { + + $scope.topicToDelete = topic; + + // $scope.topicToDelete_prettyPrint = JSON.stringify(topic, null, 2); // spacing level = 2; + $scope.topicToDelete_prettyPrint = kommonitorDataExchangeService.syntaxHighlightJSON(topic); + + document.getElementById("deleteTopicPre").innerHTML = $scope.topicToDelete_prettyPrint; + + $scope.resetTopicDeleteForm(); + + }); + + + $scope.resetTopicDeleteForm = function(){ + $scope.errorMessagePart = undefined; + $("#topicDeleteSuccessAlert").hide(); + $("#topicDeleteErrorAlert").hide(); + }; + + $scope.deleteTopic = function(topic){ + + var topicId = topic.topicId; + + $scope.loadingData = true; + + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/topics/" + topicId, + method: "DELETE" + // headers: { + // 'Content-Type': undefined + // } + }).then(async function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + await kommonitorDataExchangeService.fetchTopicsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles); + + $rootScope.$broadcast("refreshTopicsOverview"); + + // refresh all admin dashboard diagrams due to modified metadata + $rootScope.$broadcast("refreshAdminDashboardDiagrams"); + + $timeout(function(){ + + $scope.loadingData = false; + $scope.showSuccessAlert(); + }); + + }, function errorCallback(error) { + if(error.data){ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else{ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + + $("#topicsErrorAlert").show(); + $timeout(function(){ + + $scope.loadingData = false; + }); + + // setTimeout(function() { + // $("#spatialUnitAddSucessAlert").hide(); + // }, 3000); + }); + + }; + + $scope.hideSuccessAlert = function(){ + $("#topicDeleteSuccessAlert").hide(); + + $scope.topicToDelete = undefined; + $scope.topicToDelete_prettyPrint = undefined; + document.getElementById("deleteTopicPre").innerHTML = undefined; + }; + + $scope.showSuccessAlert = function(){ + $("#topicDeleteSuccessAlert").show(); + }; + + $scope.hideErrorAlert = function(){ + $("#topicDeleteErrorAlert").hide(); + }; + + $scope.showErrorAlert = function(){ + $("#topicDeleteErrorAlert").show(); + }; + + } +]}); diff --git a/app/components/kommonitorAdmin/adminTopicsManagement/topicDeleteModal/topic-delete-modal.module.js b/app/components/kommonitorAdmin/adminTopicsManagement/topicDeleteModal/topic-delete-modal.module.js index dbfe2522f..1a0fc6404 100644 --- a/app/components/kommonitorAdmin/adminTopicsManagement/topicDeleteModal/topic-delete-modal.module.js +++ b/app/components/kommonitorAdmin/adminTopicsManagement/topicDeleteModal/topic-delete-modal.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('topicDeleteModal', []); +//# sourceMappingURL=topic-delete-modal.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminTopicsManagement/topicDeleteModal/topic-delete-modal.module.js.map b/app/components/kommonitorAdmin/adminTopicsManagement/topicDeleteModal/topic-delete-modal.module.js.map new file mode 100644 index 000000000..1e57e4fba --- /dev/null +++ b/app/components/kommonitorAdmin/adminTopicsManagement/topicDeleteModal/topic-delete-modal.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"topic-delete-modal.module.js","sourceRoot":"","sources":["topic-delete-modal.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminTopicsManagement/topicDeleteModal/topic-delete-modal.module.ts b/app/components/kommonitorAdmin/adminTopicsManagement/topicDeleteModal/topic-delete-modal.module.ts new file mode 100644 index 000000000..dbfe2522f --- /dev/null +++ b/app/components/kommonitorAdmin/adminTopicsManagement/topicDeleteModal/topic-delete-modal.module.ts @@ -0,0 +1 @@ +angular.module('topicDeleteModal', []); diff --git a/app/components/kommonitorAdmin/adminTopicsManagement/topicEditModal/topic-edit-modal.component.js b/app/components/kommonitorAdmin/adminTopicsManagement/topicEditModal/topic-edit-modal.component.js index a4409ccc3..5d808b653 100644 --- a/app/components/kommonitorAdmin/adminTopicsManagement/topicEditModal/topic-edit-modal.component.js +++ b/app/components/kommonitorAdmin/adminTopicsManagement/topicEditModal/topic-edit-modal.component.js @@ -1,80 +1,62 @@ +"use strict"; angular.module('topicEditModal').component('topicEditModal', { - templateUrl : "components/kommonitorAdmin/adminTopicsManagement/topicEditModal/topic-edit-modal.template.html", - controller : ['kommonitorDataExchangeService', '$scope', '$rootScope', '$http', '__env', '$timeout',function TopicEditModalController(kommonitorDataExchangeService, $scope, $rootScope, $http, __env, $timeout) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - - $scope.currentTopic; - - $scope.loadingData = false; - - $scope.errorMessagePart = undefined; - - $scope.$on("onEditTopic", function (event, topic) { - - $scope.currentTopic = topic; - }); - - $scope.updateTopic = function(topic){ - $scope.loadingData = true; - - var topicId = topic.topicId; - - var putBody = { - "topicName": topic.topicName, - "topicDescription": topic.topicDescription, - "topicType": topic.topicType, - "topicResource": topic.topicResource, - "subTopics": topic.subTopics - }; - - $http({ - url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/topics/" + topicId, - method: "PUT", - data: putBody - // headers: { - // 'Content-Type': undefined - // } - }).then(async function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - await kommonitorDataExchangeService.fetchTopicsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles); - - $rootScope.$broadcast("refreshTopicsOverview"); - - $("#topicEditMetadataSuccessAlert").show(); - $timeout(function(){ - - $scope.loadingData = false; - }); - // - // $scope.refreshTopicsOverview(); - - }, async function errorCallback(error) { - if(error.data){ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); - } - else{ - $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); - } - - $("#topicEditMetadataErrorAlert").show(); - $timeout(function(){ - - $scope.loadingData = false; - }); - - }); - }; - - $scope.hideSuccessAlert = function(){ - $("#topicEditMetadataSuccessAlert").hide(); - }; - - $scope.hideErrorAlert = function(){ - $("#topicEditMetadataErrorAlert").hide(); - }; - - } -]}); + templateUrl: "components/kommonitorAdmin/adminTopicsManagement/topicEditModal/topic-edit-modal.template.html", + controller: ['kommonitorDataExchangeService', '$scope', '$rootScope', '$http', '__env', '$timeout', function TopicEditModalController(kommonitorDataExchangeService, $scope, $rootScope, $http, __env, $timeout) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + $scope.currentTopic; + $scope.loadingData = false; + $scope.errorMessagePart = undefined; + $scope.$on("onEditTopic", function (event, topic) { + $scope.currentTopic = topic; + }); + $scope.updateTopic = function (topic) { + $scope.loadingData = true; + var topicId = topic.topicId; + var putBody = { + "topicName": topic.topicName, + "topicDescription": topic.topicDescription, + "topicType": topic.topicType, + "topicResource": topic.topicResource, + "subTopics": topic.subTopics + }; + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/topics/" + topicId, + method: "PUT", + data: putBody + // headers: { + // 'Content-Type': undefined + // } + }).then(async function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + await kommonitorDataExchangeService.fetchTopicsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles); + $rootScope.$broadcast("refreshTopicsOverview"); + $("#topicEditMetadataSuccessAlert").show(); + $timeout(function () { + $scope.loadingData = false; + }); + // + // $scope.refreshTopicsOverview(); + }, async function errorCallback(error) { + if (error.data) { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else { + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + $("#topicEditMetadataErrorAlert").show(); + $timeout(function () { + $scope.loadingData = false; + }); + }); + }; + $scope.hideSuccessAlert = function () { + $("#topicEditMetadataSuccessAlert").hide(); + }; + $scope.hideErrorAlert = function () { + $("#topicEditMetadataErrorAlert").hide(); + }; + } + ] +}); +//# sourceMappingURL=topic-edit-modal.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminTopicsManagement/topicEditModal/topic-edit-modal.component.js.map b/app/components/kommonitorAdmin/adminTopicsManagement/topicEditModal/topic-edit-modal.component.js.map new file mode 100644 index 000000000..0a6ccf626 --- /dev/null +++ b/app/components/kommonitorAdmin/adminTopicsManagement/topicEditModal/topic-edit-modal.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"topic-edit-modal.component.js","sourceRoot":"","sources":["topic-edit-modal.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,SAAS,CAAC,gBAAgB,EAAE;IAC5D,WAAW,EAAG,gGAAgG;IAC9G,UAAU,EAAG,CAAC,+BAA+B,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAC,SAAS,wBAAwB,CAAC,6BAA6B,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ;YAE9M,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAE3E,MAAM,CAAC,YAAY,CAAC;YAEpB,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;YAE3B,MAAM,CAAC,gBAAgB,GAAG,SAAS,CAAC;YAEpC,MAAM,CAAC,GAAG,CAAC,aAAa,EAAE,UAAU,KAAK,EAAE,KAAK;gBAE/C,MAAM,CAAC,YAAY,GAAG,KAAK,CAAC;YAC7B,CAAC,CAAC,CAAC;YAEH,MAAM,CAAC,WAAW,GAAG,UAAS,KAAK;gBAClC,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC;gBAE1B,IAAI,OAAO,GAAG,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CAAC;oBAC5B,CAAC,CAAC,CAAC;gBAEL,CAAC,CAAC,CAAC;YACJ,CAAC,CAAC;YAED,MAAM,CAAC,gBAAgB,GAAG;gBACzB,CAAC,CAAC,gCAAgC,CAAC,CAAC,IAAI,EAAE,CAAC;YAC5C,CAAC,CAAC;YAEF,MAAM,CAAC,cAAc,GAAG;gBACvB,CAAC,CAAC,8BAA8B,CAAC,CAAC,IAAI,EAAE,CAAC;YAC1C,CAAC,CAAC;QAEJ,CAAC;KACD;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminTopicsManagement/topicEditModal/topic-edit-modal.component.ts b/app/components/kommonitorAdmin/adminTopicsManagement/topicEditModal/topic-edit-modal.component.ts new file mode 100644 index 000000000..a4409ccc3 --- /dev/null +++ b/app/components/kommonitorAdmin/adminTopicsManagement/topicEditModal/topic-edit-modal.component.ts @@ -0,0 +1,80 @@ +angular.module('topicEditModal').component('topicEditModal', { + templateUrl : "components/kommonitorAdmin/adminTopicsManagement/topicEditModal/topic-edit-modal.template.html", + controller : ['kommonitorDataExchangeService', '$scope', '$rootScope', '$http', '__env', '$timeout',function TopicEditModalController(kommonitorDataExchangeService, $scope, $rootScope, $http, __env, $timeout) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + + $scope.currentTopic; + + $scope.loadingData = false; + + $scope.errorMessagePart = undefined; + + $scope.$on("onEditTopic", function (event, topic) { + + $scope.currentTopic = topic; + }); + + $scope.updateTopic = function(topic){ + $scope.loadingData = true; + + var topicId = topic.topicId; + + var putBody = { + "topicName": topic.topicName, + "topicDescription": topic.topicDescription, + "topicType": topic.topicType, + "topicResource": topic.topicResource, + "subTopics": topic.subTopics + }; + + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/topics/" + topicId, + method: "PUT", + data: putBody + // headers: { + // 'Content-Type': undefined + // } + }).then(async function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + await kommonitorDataExchangeService.fetchTopicsMetadata(kommonitorDataExchangeService.currentKeycloakLoginRoles); + + $rootScope.$broadcast("refreshTopicsOverview"); + + $("#topicEditMetadataSuccessAlert").show(); + $timeout(function(){ + + $scope.loadingData = false; + }); + // + // $scope.refreshTopicsOverview(); + + }, async function errorCallback(error) { + if(error.data){ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error.data); + } + else{ + $scope.errorMessagePart = kommonitorDataExchangeService.syntaxHighlightJSON(error); + } + + $("#topicEditMetadataErrorAlert").show(); + $timeout(function(){ + + $scope.loadingData = false; + }); + + }); + }; + + $scope.hideSuccessAlert = function(){ + $("#topicEditMetadataSuccessAlert").hide(); + }; + + $scope.hideErrorAlert = function(){ + $("#topicEditMetadataErrorAlert").hide(); + }; + + } +]}); diff --git a/app/components/kommonitorAdmin/adminTopicsManagement/topicEditModal/topic-edit-modal.module.js b/app/components/kommonitorAdmin/adminTopicsManagement/topicEditModal/topic-edit-modal.module.js index 866d723f8..ec32e4205 100644 --- a/app/components/kommonitorAdmin/adminTopicsManagement/topicEditModal/topic-edit-modal.module.js +++ b/app/components/kommonitorAdmin/adminTopicsManagement/topicEditModal/topic-edit-modal.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('topicEditModal', []); +//# sourceMappingURL=topic-edit-modal.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminTopicsManagement/topicEditModal/topic-edit-modal.module.js.map b/app/components/kommonitorAdmin/adminTopicsManagement/topicEditModal/topic-edit-modal.module.js.map new file mode 100644 index 000000000..1ed68a425 --- /dev/null +++ b/app/components/kommonitorAdmin/adminTopicsManagement/topicEditModal/topic-edit-modal.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"topic-edit-modal.module.js","sourceRoot":"","sources":["topic-edit-modal.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/adminTopicsManagement/topicEditModal/topic-edit-modal.module.ts b/app/components/kommonitorAdmin/adminTopicsManagement/topicEditModal/topic-edit-modal.module.ts new file mode 100644 index 000000000..866d723f8 --- /dev/null +++ b/app/components/kommonitorAdmin/adminTopicsManagement/topicEditModal/topic-edit-modal.module.ts @@ -0,0 +1 @@ +angular.module('topicEditModal', []); diff --git a/app/components/kommonitorAdmin/kommonitor-admin.component.js b/app/components/kommonitorAdmin/kommonitor-admin.component.js index 0481afea2..be76dc6de 100644 --- a/app/components/kommonitorAdmin/kommonitor-admin.component.js +++ b/app/components/kommonitorAdmin/kommonitor-admin.component.js @@ -1,82 +1,63 @@ +"use strict"; angular - .module('kommonitorAdmin') - .component( - 'kommonitorAdmin', - { - templateUrl : "components/kommonitorAdmin/kommonitor-admin.template.html", - controller : ['kommonitorDataExchangeService', '$location', "$rootScope", '$scope', function kommonitorAdminController( - kommonitorDataExchangeService, $location, $rootScope, $scope) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - - this.selectedResourceType = 'spatialUnits'; - - $scope.activeItemBackupId = "adminDashboardNavItem"; - - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - // $rootScope.$on("$locationChangeStart", function(event){ - // if (! kommonitorDataExchangeService.adminIsLoggedIn){ - // // redirect to main page - // console.log("No Admin user is logged in - Prevent access to ADMIN panel"); - // $location.path('/'); - // } - // - // }); - - this.init = function(){ - // if(! kommonitorDataExchangeService.enableKeycloakSecurity){ - // this.checkAuthorizationOnStartup_withoutKeycloak(); - // } - kommonitorDataExchangeService.fetchAllMetadata(); - }; - - this.init(); - - $scope.onClickGeodataAdminPanel = function(idOfNavBarItem){ - $scope.activeItemBackupId = idOfNavBarItem; - $('.sidebar-menu li').removeClass("active"); - - document.getElementById('adminGeodataWrapperNavItem').setAttribute("class", "active"); - }; - - $scope.onClickConfigAdminPanel = function(idOfNavBarItem){ - $scope.activeItemBackupId = idOfNavBarItem; - $('.sidebar-menu li').removeClass("active"); - - document.getElementById('adminConfigWrapperNavItem').setAttribute("class", "active"); - }; - - $scope.onClickOtherAdminPanel = function(idOfNavBarItem){ - $scope.activeItemBackupId = idOfNavBarItem; - $('#adminGeodataWrapperNavItem ul li').removeClass("active"); - $('#adminConfigWrapperNavItem ul li').removeClass("active"); - }; - - $scope.onClickGeodataWrapperItem = function(){ - - // $('#adminGeodataWrapperNavItem').toggleClass("active"); - - setTimeout(function(){ - if($scope.activeItemBackupId != 'adminSpatialUnitsNavItem' && $scope.activeItemBackupId != 'adminGeoresourcesNavItem' && $scope.activeItemBackupId != 'adminIndicatorsNavItem'){ - // $('#adminGeodataWrapperNavItem').toggleClass("active"); - $('#'+$scope.activeItemBackupId).addClass("active"); - } - }, 40); - }; - - $scope.onClickConfigWrapperItem = function(){ - - // $('#adminGeodataWrapperNavItem').toggleClass("active"); - - setTimeout(function(){ - if($scope.activeItemBackupId != 'adminAppConfigNavItem' && $scope.activeItemBackupId != 'adminKeycloakConfigNavItem' && $scope.activeItemBackupId != 'adminControlsConfigNavItem'){ - // $('#adminGeodataWrapperNavItem').toggleClass("active"); - $('#'+$scope.activeItemBackupId).addClass("active"); - } - }, 40); - }; - - } - ]}); + .module('kommonitorAdmin') + .component('kommonitorAdmin', { + templateUrl: "components/kommonitorAdmin/kommonitor-admin.template.html", + controller: ['kommonitorDataExchangeService', '$location', "$rootScope", '$scope', function kommonitorAdminController(kommonitorDataExchangeService, $location, $rootScope, $scope) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.selectedResourceType = 'spatialUnits'; + $scope.activeItemBackupId = "adminDashboardNavItem"; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + // $rootScope.$on("$locationChangeStart", function(event){ + // if (! kommonitorDataExchangeService.adminIsLoggedIn){ + // // redirect to main page + // console.log("No Admin user is logged in - Prevent access to ADMIN panel"); + // $location.path('/'); + // } + // + // }); + this.init = function () { + // if(! kommonitorDataExchangeService.enableKeycloakSecurity){ + // this.checkAuthorizationOnStartup_withoutKeycloak(); + // } + kommonitorDataExchangeService.fetchAllMetadata(); + }; + this.init(); + $scope.onClickGeodataAdminPanel = function (idOfNavBarItem) { + $scope.activeItemBackupId = idOfNavBarItem; + $('.sidebar-menu li').removeClass("active"); + document.getElementById('adminGeodataWrapperNavItem').setAttribute("class", "active"); + }; + $scope.onClickConfigAdminPanel = function (idOfNavBarItem) { + $scope.activeItemBackupId = idOfNavBarItem; + $('.sidebar-menu li').removeClass("active"); + document.getElementById('adminConfigWrapperNavItem').setAttribute("class", "active"); + }; + $scope.onClickOtherAdminPanel = function (idOfNavBarItem) { + $scope.activeItemBackupId = idOfNavBarItem; + $('#adminGeodataWrapperNavItem ul li').removeClass("active"); + $('#adminConfigWrapperNavItem ul li').removeClass("active"); + }; + $scope.onClickGeodataWrapperItem = function () { + // $('#adminGeodataWrapperNavItem').toggleClass("active"); + setTimeout(function () { + if ($scope.activeItemBackupId != 'adminSpatialUnitsNavItem' && $scope.activeItemBackupId != 'adminGeoresourcesNavItem' && $scope.activeItemBackupId != 'adminIndicatorsNavItem') { + // $('#adminGeodataWrapperNavItem').toggleClass("active"); + $('#' + $scope.activeItemBackupId).addClass("active"); + } + }, 40); + }; + $scope.onClickConfigWrapperItem = function () { + // $('#adminGeodataWrapperNavItem').toggleClass("active"); + setTimeout(function () { + if ($scope.activeItemBackupId != 'adminAppConfigNavItem' && $scope.activeItemBackupId != 'adminKeycloakConfigNavItem' && $scope.activeItemBackupId != 'adminControlsConfigNavItem') { + // $('#adminGeodataWrapperNavItem').toggleClass("active"); + $('#' + $scope.activeItemBackupId).addClass("active"); + } + }, 40); + }; + } + ] +}); +//# sourceMappingURL=kommonitor-admin.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/kommonitor-admin.component.js.map b/app/components/kommonitorAdmin/kommonitor-admin.component.js.map new file mode 100644 index 000000000..5ad6b8c05 --- /dev/null +++ b/app/components/kommonitorAdmin/kommonitor-admin.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-admin.component.js","sourceRoot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CAAC,cAAc,CAAC,2BAA2B,CAAC,CAAC,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;YACtF,CAAC,CAAC;YAEF,MAAM,CAAC,sBAAsB,GAAG,UAAS,cAAc;gBACtD,MAAM,CAAC,kBAAkB,GAAG,cAAc,CAAC;gBAC3C,CAAC,CAAC,mCAAmC,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;gBAC7D,CAAC,CAAC,kCAAkC,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;YAC7D,CAAC,CAAC;YAEF,MAAM,CAAC,yBAAyB,GAAG;gBAElC,0DAA0D;gBAE1D,UAAU,CAAC;oBACV,IAAG,MAAM,CAAC,kBAAkB,IAAI,0BAA0B,IAAI,MAAM,CAAC,kBAAkB,IAAI,0BAA0B,IAAI,MAAM,CAAC,kBAAkB,IAAI,wBAAwB,EAAC;wBAC9K,0DAA0D;wBAC1D,CAAC,CAAC,GAAG,GAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;qBACpD;gBACF,CAAC,EAAE,EAAE,CAAC,CAAC;YACR,CAAC,CAAC;YAEF,MAAM,CAAC,wBAAwB,GAAG;gBAEjC,0DAA0D;gBAE1D,UAAU,CAAC;oBACV,IAAG,MAAM,CAAC,kBAAkB,IAAI,uBAAuB,IAAI,MAAM,CAAC,kBAAkB,IAAI,4BAA4B,IAAI,MAAM,CAAC,kBAAkB,IAAI,4BAA4B,EAAC;wBACjL,0DAA0D;wBAC1D,CAAC,CAAC,GAAG,GAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;qBACpD;gBACF,CAAC,EAAE,EAAE,CAAC,CAAC;YACR,CAAC,CAAC;QAEL,CAAC;KACD;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/kommonitor-admin.component.ts b/app/components/kommonitorAdmin/kommonitor-admin.component.ts new file mode 100644 index 000000000..0481afea2 --- /dev/null +++ b/app/components/kommonitorAdmin/kommonitor-admin.component.ts @@ -0,0 +1,82 @@ +angular + .module('kommonitorAdmin') + .component( + 'kommonitorAdmin', + { + templateUrl : "components/kommonitorAdmin/kommonitor-admin.template.html", + controller : ['kommonitorDataExchangeService', '$location', "$rootScope", '$scope', function kommonitorAdminController( + kommonitorDataExchangeService, $location, $rootScope, $scope) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + + this.selectedResourceType = 'spatialUnits'; + + $scope.activeItemBackupId = "adminDashboardNavItem"; + + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + // $rootScope.$on("$locationChangeStart", function(event){ + // if (! kommonitorDataExchangeService.adminIsLoggedIn){ + // // redirect to main page + // console.log("No Admin user is logged in - Prevent access to ADMIN panel"); + // $location.path('/'); + // } + // + // }); + + this.init = function(){ + // if(! kommonitorDataExchangeService.enableKeycloakSecurity){ + // this.checkAuthorizationOnStartup_withoutKeycloak(); + // } + kommonitorDataExchangeService.fetchAllMetadata(); + }; + + this.init(); + + $scope.onClickGeodataAdminPanel = function(idOfNavBarItem){ + $scope.activeItemBackupId = idOfNavBarItem; + $('.sidebar-menu li').removeClass("active"); + + document.getElementById('adminGeodataWrapperNavItem').setAttribute("class", "active"); + }; + + $scope.onClickConfigAdminPanel = function(idOfNavBarItem){ + $scope.activeItemBackupId = idOfNavBarItem; + $('.sidebar-menu li').removeClass("active"); + + document.getElementById('adminConfigWrapperNavItem').setAttribute("class", "active"); + }; + + $scope.onClickOtherAdminPanel = function(idOfNavBarItem){ + $scope.activeItemBackupId = idOfNavBarItem; + $('#adminGeodataWrapperNavItem ul li').removeClass("active"); + $('#adminConfigWrapperNavItem ul li').removeClass("active"); + }; + + $scope.onClickGeodataWrapperItem = function(){ + + // $('#adminGeodataWrapperNavItem').toggleClass("active"); + + setTimeout(function(){ + if($scope.activeItemBackupId != 'adminSpatialUnitsNavItem' && $scope.activeItemBackupId != 'adminGeoresourcesNavItem' && $scope.activeItemBackupId != 'adminIndicatorsNavItem'){ + // $('#adminGeodataWrapperNavItem').toggleClass("active"); + $('#'+$scope.activeItemBackupId).addClass("active"); + } + }, 40); + }; + + $scope.onClickConfigWrapperItem = function(){ + + // $('#adminGeodataWrapperNavItem').toggleClass("active"); + + setTimeout(function(){ + if($scope.activeItemBackupId != 'adminAppConfigNavItem' && $scope.activeItemBackupId != 'adminKeycloakConfigNavItem' && $scope.activeItemBackupId != 'adminControlsConfigNavItem'){ + // $('#adminGeodataWrapperNavItem').toggleClass("active"); + $('#'+$scope.activeItemBackupId).addClass("active"); + } + }, 40); + }; + + } + ]}); diff --git a/app/components/kommonitorAdmin/kommonitor-admin.module.js b/app/components/kommonitorAdmin/kommonitor-admin.module.js index 94086d4b2..cb5409996 100644 --- a/app/components/kommonitorAdmin/kommonitor-admin.module.js +++ b/app/components/kommonitorAdmin/kommonitor-admin.module.js @@ -1,14 +1,16 @@ +"use strict"; angular.module('kommonitorAdmin', ['kommonitorDataExchange', 'adminDashboardManagement', 'adminRoleManagement', 'adminTopicsManagement', -'adminSpatialUnitsManagement','adminIndicatorsManagement', 'adminGeoresourcesManagement', 'adminScriptManagement', 'adminScriptExecution', -'spatialUnitAddModal','spatialUnitEditMetadataModal', 'spatialUnitEditFeaturesModal','spatialUnitDeleteModal', -'georesourceDeleteModal','georesourceAddModal', 'georesourceEditFeaturesModal', 'georesourceEditMetadataModal', 'georesourceBatchUpdateModal', -'indicatorDeleteModal','indicatorAddModal', 'indicatorEditFeaturesModal', 'indicatorEditMetadataModal', 'indicatorBatchUpdateModal', -'batchUpdateResultModal', 'indicatorEditTimeseriesMapping', -'indicatorEditIndicatorSpatialUnitRolesModal', -'topicEditModal', 'topicDeleteModal', -'scriptAddModal', "scriptDeleteModal", -'adminAppConfig', 'adminKeycloakConfig', 'adminControlsConfig', -'roleAddModal', 'roleEditMetadataModal', 'roleDeleteModal', -'adminRoleExplanation', -// ,'spatialUnitDeleteModal', + 'adminSpatialUnitsManagement', 'adminIndicatorsManagement', 'adminGeoresourcesManagement', 'adminScriptManagement', 'adminScriptExecution', + 'spatialUnitAddModal', 'spatialUnitEditMetadataModal', 'spatialUnitEditFeaturesModal', 'spatialUnitDeleteModal', + 'georesourceDeleteModal', 'georesourceAddModal', 'georesourceEditFeaturesModal', 'georesourceEditMetadataModal', 'georesourceBatchUpdateModal', + 'indicatorDeleteModal', 'indicatorAddModal', 'indicatorEditFeaturesModal', 'indicatorEditMetadataModal', 'indicatorBatchUpdateModal', + 'batchUpdateResultModal', 'indicatorEditTimeseriesMapping', + 'indicatorEditIndicatorSpatialUnitRolesModal', + 'topicEditModal', 'topicDeleteModal', + 'scriptAddModal', "scriptDeleteModal", + 'adminAppConfig', 'adminKeycloakConfig', 'adminControlsConfig', + 'roleAddModal', 'roleEditMetadataModal', 'roleDeleteModal', + 'adminRoleExplanation', + // ,'spatialUnitDeleteModal', ]); +//# sourceMappingURL=kommonitor-admin.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorAdmin/kommonitor-admin.module.js.map b/app/components/kommonitorAdmin/kommonitor-admin.module.js.map new file mode 100644 index 000000000..8d3cc3aef --- /dev/null +++ b/app/components/kommonitorAdmin/kommonitor-admin.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-admin.module.js","sourceRoot":"","sources":["kommonitor-admin.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC,wBAAwB,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,uBAAuB;IACvI,6BAA6B,EAAC,2BAA2B,EAAE,6BAA6B,EAAE,uBAAuB,EAAE,sBAAsB;IACzI,qBAAqB,EAAC,8BAA8B,EAAE,8BAA8B,EAAC,wBAAwB;IAC7G,wBAAwB,EAAC,qBAAqB,EAAE,8BAA8B,EAAE,8BAA8B,EAAE,6BAA6B;IAC7I,sBAAsB,EAAC,mBAAmB,EAAE,4BAA4B,EAAE,4BAA4B,EAAE,2BAA2B;IACnI,wBAAwB,EAAE,gCAAgC;IAC1D,6CAA6C;IAC7C,gBAAgB,EAAE,kBAAkB;IACpC,gBAAgB,EAAE,mBAAmB;IACrC,gBAAgB,EAAE,qBAAqB,EAAE,qBAAqB;IAC9D,cAAc,EAAE,uBAAuB,EAAE,iBAAiB;IAC1D,sBAAsB;IACtB,6BAA6B;CAC5B,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorAdmin/kommonitor-admin.module.ts b/app/components/kommonitorAdmin/kommonitor-admin.module.ts new file mode 100644 index 000000000..94086d4b2 --- /dev/null +++ b/app/components/kommonitorAdmin/kommonitor-admin.module.ts @@ -0,0 +1,14 @@ +angular.module('kommonitorAdmin', ['kommonitorDataExchange', 'adminDashboardManagement', 'adminRoleManagement', 'adminTopicsManagement', +'adminSpatialUnitsManagement','adminIndicatorsManagement', 'adminGeoresourcesManagement', 'adminScriptManagement', 'adminScriptExecution', +'spatialUnitAddModal','spatialUnitEditMetadataModal', 'spatialUnitEditFeaturesModal','spatialUnitDeleteModal', +'georesourceDeleteModal','georesourceAddModal', 'georesourceEditFeaturesModal', 'georesourceEditMetadataModal', 'georesourceBatchUpdateModal', +'indicatorDeleteModal','indicatorAddModal', 'indicatorEditFeaturesModal', 'indicatorEditMetadataModal', 'indicatorBatchUpdateModal', +'batchUpdateResultModal', 'indicatorEditTimeseriesMapping', +'indicatorEditIndicatorSpatialUnitRolesModal', +'topicEditModal', 'topicDeleteModal', +'scriptAddModal', "scriptDeleteModal", +'adminAppConfig', 'adminKeycloakConfig', 'adminControlsConfig', +'roleAddModal', 'roleEditMetadataModal', 'roleDeleteModal', +'adminRoleExplanation', +// ,'spatialUnitDeleteModal', +]); diff --git a/app/components/kommonitorUserInterface/kommonitor-user-interface.component.js b/app/components/kommonitorUserInterface/kommonitor-user-interface.component.js index 4c8a2733f..979f6c0f4 100644 --- a/app/components/kommonitorUserInterface/kommonitor-user-interface.component.js +++ b/app/components/kommonitorUserInterface/kommonitor-user-interface.component.js @@ -1,1077 +1,988 @@ +"use strict"; angular.module('kommonitorUserInterface').component('kommonitorUserInterface', { - templateUrl : "components/kommonitorUserInterface/kommonitor-user-interface.template.html", - controller : ['kommonitorDataExchangeService', 'kommonitorKeycloakHelperService', 'kommonitorElementVisibilityHelperService', '$scope', - '$rootScope', '$location', 'Auth', 'ControlsConfigService', '$compile', 'kommonitorShareHelperService', '__env', - function UserInterfaceController(kommonitorDataExchangeService, kommonitorKeycloakHelperService, kommonitorElementVisibilityHelperService, - $scope, $rootScope, $location, Auth, ControlsConfigService, $compile, kommonitorShareHelperService, __env) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorKeycloakHelperServiceInstance = kommonitorKeycloakHelperService; - this.kommonitorElementVisibilityHelperServiceInstance = kommonitorElementVisibilityHelperService; - - kommonitorDataExchangeService.anySideBarIsShown = false; - - - kommonitorDataExchangeService.currentKeycloakUser; - $scope.password; - $scope.showAdminLogin = false; - - $scope.init = async function () { - // initialize application - console.log("Initialize Application"); - if ($scope.authenticated) { - console.log("Authetication successfull"); - } - - await checkAuthentication(); - - kommonitorShareHelperService.init(); - - kommonitorDataExchangeService.fetchAllMetadata(); - }; - - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - $scope.sidebarIndicatorConfigClass = "disappear"; - $scope.sidebarDiagramsClass = "disappear"; - $scope.sidebarRadarDiagramClass = "disappear"; - $scope.sidebarProcessingClass = "disappear"; - $scope.sidebarRegressionDiagramClass = "disappear"; - $scope.sidebarFilterClass = "disappear"; - $scope.sidebarBalanceClass = "disappear"; - $scope.sidebarReachabilityClass = "disappear"; - $scope.sidebarPoiClass = "disappear"; - $scope.sidebarDataImportClass = "disappear"; - - $scope.sidebarLegendClass = ""; - - $scope.buttonIndicatorConfigClass = "btn btn-custom btn-circle"; - $scope.buttonDiagramsClass = "btn btn-custom btn-circle"; - $scope.buttonRadarDiagramClass = "btn btn-custom btn-circle"; - $scope.buttonProcessingClass = "btn btn-custom btn-circle"; - $scope.buttonRegressionDiagramClass = "btn btn-custom btn-circle"; - $scope.buttonFilterClass = "btn btn-custom btn-circle"; - $scope.buttonBalanceClass = "btn btn-custom btn-circle"; - $scope.buttonReachabilityClass = "btn btn-custom btn-circle"; - $scope.buttonPoiClass = "btn btn-custom btn-circle"; - $scope.buttonDataImportClass = "btn btn-custom btn-circle"; - - $scope.buttonLegendClass = "btn btn-custom-docked-right btn-docked-right"; - - function sleep(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); - } - - Auth.keycloak.onAuthLogout = function() { - console.log("Logout successfull"); - checkAuthentication(); - } - - Auth.keycloak.onAuthSuccess = function() { - console.log("User successfully authenticated"); - checkAuthentication(); - } - - $scope.tryLoginUser_withoutKeycloak = function(){ - // TODO FIXME make generic user login once user/role concept is implemented - - // currently only simple ADMIN user login is possible - console.log("Check user login"); - if (kommonitorDataExchangeService.adminUserName === kommonitorDataExchangeService.currentKeycloakUser && kommonitorDataExchangeService.adminPassword === $scope.password){ - // success login --> currently switch to ADMIN page directly - console.log("User Login success - redirect to Admin Page"); - kommonitorDataExchangeService.adminIsLoggedIn = true; - $location.path('/administration'); - } - }; - - $scope.tryLoginUser = function(){ - if(kommonitorDataExchangeService.enableKeycloakSecurity){ - Auth.keycloak.login(); - } - else{ - $scope.tryLoginUser_withoutKeycloak(); - } - - }; - - $scope.tryLogoutUser = function() { - Auth.keycloak.logout(); - }; - - $scope.tryLoginUserByKeypress = function ($event) { - var keyCode = $event.which || $event.keyCode; - //check for enter key - if (keyCode === 13) { - $scope.tryLoginUser(); - } - }; - - var checkAuthentication = async function () { - kommonitorDataExchangeService.currentKeycloakLoginRoles = []; - - if (Auth.keycloak.authenticated) { - $scope.authenticated = Auth.keycloak.authenticated; - if(Auth.keycloak.tokenParsed - && Auth.keycloak.tokenParsed.realm_access - && Auth.keycloak.tokenParsed.realm_access.roles - && Auth.keycloak.tokenParsed.realm_access.roles.some(role => role.endsWith("-creator") || role.endsWith("-publisher") || role.endsWith("-editor"))){ - Auth.keycloak.showAdminView = true; - $scope.showAdminLogin = true; - } - } - }; - - $scope.openAdminUI = function () { - $location.path('/administration'); - }; - - $scope.undockButtons = function(){ - $scope.buttonIndicatorConfigClass = "btn btn-custom btn-circle"; - $scope.buttonDiagramsClass = "btn btn-custom btn-circle"; - $scope.buttonRadarDiagramClass = "btn btn-custom btn-circle"; - $scope.buttonProcessingClass = "btn btn-custom btn-circle"; - $scope.buttonRegressionDiagramClass = "btn btn-custom btn-circle"; - $scope.buttonFilterClass = "btn btn-custom btn-circle"; - $scope.buttonBalanceClass = "btn btn-custom btn-circle"; - $scope.buttonReachabilityClass = "btn btn-custom btn-circle"; - $scope.buttonPoiClass = "btn btn-custom btn-circle"; - $scope.buttonDataImportClass = "btn btn-custom btn-circle"; - - // in addition check if balance menue and button are allowed for current indicator - // it is not allowed if indicator is of type "DYNAMIC" - $scope.checkBalanceButtonAndMenueState(); - }; - - $scope.hideSidebars = function(){ - $scope.sidebarIndicatorConfigClass = "disappear"; - $scope.sidebarDiagramsClass = "disappear"; - $scope.sidebarRadarDiagramClass = "disappear"; - $scope.sidebarProcessingClass = "disappear"; - $scope.sidebarRegressionDiagramClass = "disappear"; - $scope.sidebarFilterClass = "disappear"; - $scope.sidebarBalanceClass = "disappear"; - $scope.sidebarReachabilityClass = "disappear"; - $scope.sidebarPoiClass = "disappear"; - $scope.sidebarDataImportClass = "disappear"; - }; - - $scope.checkBalanceButtonAndMenueState = function(){ - // disable if indicator is dynamic or if indicator only contains 1 or less timeseries entries - if(kommonitorDataExchangeService.selectedIndicator && (kommonitorDataExchangeService.selectedIndicator.indicatorType.includes("DYNAMIC") || kommonitorDataExchangeService.selectedIndicator.applicableDates.length < 2)){ - $scope.buttonBalanceClass = "btn btn-custom btn-circle disabled"; - $scope.sidebarBalanceClass = "disappear"; - } - else{ - $scope.buttonBalanceClass = "btn btn-custom btn-circle"; - } - }; - - $scope.$on("checkBalanceMenueAndButton", function(event){ - $scope.checkBalanceButtonAndMenueState(); - }); - - $scope.onSidebarIndicatorButtonClick = function(){ - $scope.undockButtons(); - - if($scope.sidebarIndicatorConfigClass === "disappear"){ - $scope.hideSidebars(); - $scope.sidebarIndicatorConfigClass = ""; - $scope.buttonIndicatorConfigClass = "btn btn-custom-docked btn-docked"; - - if(kommonitorDataExchangeService.anySideBarIsShown === false){ - $rootScope.$broadcast("recenterMapOnShowSideBar"); - } - kommonitorDataExchangeService.anySideBarIsShown = true; - } - else{ - $scope.sidebarIndicatorConfigClass = "disappear"; - $rootScope.$broadcast("recenterMapOnHideSideBar"); - kommonitorDataExchangeService.anySideBarIsShown = false; - } - - $rootScope.$broadcast("refreshIndicatorValueRangeSlider"); - $rootScope.$broadcast("redrawGuidedTourElement"); - - } - - $scope.onSidebarPoiButtonClick = function(){ - $scope.undockButtons(); - - if($scope.sidebarPoiClass === "disappear"){ - $scope.hideSidebars(); - $scope.sidebarPoiClass = ""; - $scope.buttonPoiClass = "btn btn-custom-docked btn-docked"; - - if(kommonitorDataExchangeService.anySideBarIsShown === false){ - $rootScope.$broadcast("recenterMapOnShowSideBar"); - } - kommonitorDataExchangeService.anySideBarIsShown = true; - } - else{ - $scope.sidebarPoiClass = "disappear"; - $rootScope.$broadcast("recenterMapOnHideSideBar"); - kommonitorDataExchangeService.anySideBarIsShown = false; - } - - $rootScope.$broadcast("refreshIndicatorValueRangeSlider"); - $rootScope.$broadcast("redrawGuidedTourElement"); - - } - - $scope.onSidebarDataImportButtonClick = function(){ - $scope.undockButtons(); - - if($scope.sidebarDataImportClass === "disappear"){ - $scope.hideSidebars(); - $scope.sidebarDataImportClass = ""; - $scope.buttonDataImportClass = "btn btn-custom-docked btn-docked"; - - if(kommonitorDataExchangeService.anySideBarIsShown === false){ - $rootScope.$broadcast("recenterMapOnShowSideBar"); - } - kommonitorDataExchangeService.anySideBarIsShown = true; - } - else{ - $scope.sidebarDataImportClass = "disappear"; - $rootScope.$broadcast("recenterMapOnHideSideBar"); - kommonitorDataExchangeService.anySideBarIsShown = false; - } - - $rootScope.$broadcast("refreshIndicatorValueRangeSlider"); - $rootScope.$broadcast("redrawGuidedTourElement"); - - } - - $scope.onSidebarFilterButtonClick = function(){ - $scope.undockButtons(); - - if($scope.sidebarFilterClass === "disappear"){ - $scope.hideSidebars(); - $scope.sidebarFilterClass = ""; - $scope.buttonFilterClass = "btn btn-custom-docked btn-docked"; - - if(kommonitorDataExchangeService.anySideBarIsShown === false){ - $rootScope.$broadcast("recenterMapOnShowSideBar"); - } - kommonitorDataExchangeService.anySideBarIsShown = true; - } - else{ - $scope.sidebarFilterClass = "disappear"; - $rootScope.$broadcast("recenterMapOnHideSideBar"); - kommonitorDataExchangeService.anySideBarIsShown = false; - } - - $rootScope.$broadcast("refreshIndicatorValueRangeSlider"); - $rootScope.$broadcast("redrawGuidedTourElement"); - - } - - $scope.onSidebarBalanceButtonClick = function(){ - - // check if button is marked as disabled - if($scope.buttonBalanceClass.includes("disabled")){ - // do nothing - return; - } - else{ - $scope.undockButtons(); - - if($scope.sidebarBalanceClass === "disappear"){ - $scope.hideSidebars(); - $scope.sidebarBalanceClass = ""; - $scope.buttonBalanceClass = "btn btn-custom-docked btn-docked"; - - if(kommonitorDataExchangeService.anySideBarIsShown === false){ - $rootScope.$broadcast("recenterMapOnShowSideBar"); - } - kommonitorDataExchangeService.anySideBarIsShown = true; - } - else{ - $scope.sidebarBalanceClass = "disappear"; - $rootScope.$broadcast("recenterMapOnHideSideBar"); - kommonitorDataExchangeService.anySideBarIsShown = false; - } - - $rootScope.$broadcast("refreshIndicatorValueRangeSlider"); - $rootScope.$broadcast("redrawGuidedTourElement"); - } - } - - $scope.onSidebarReachabilityButtonClick = function(){ - $scope.undockButtons(); - - if($scope.sidebarReachabilityClass === "disappear"){ - $scope.hideSidebars(); - $scope.sidebarReachabilityClass = ""; - $scope.buttonReachabilityClass = "btn btn-custom-docked btn-docked"; - - if(kommonitorDataExchangeService.anySideBarIsShown === false){ - $rootScope.$broadcast("recenterMapOnShowSideBar"); - } - kommonitorDataExchangeService.anySideBarIsShown = true; - } - else{ - $scope.sidebarReachabilityClass = "disappear"; - $rootScope.$broadcast("recenterMapOnHideSideBar"); - kommonitorDataExchangeService.anySideBarIsShown = false; - } - - $rootScope.$broadcast("refreshIndicatorValueRangeSlider"); - $rootScope.$broadcast("redrawGuidedTourElement"); - - } - - $scope.onSidebarDiagramsClick = function(){ - $scope.undockButtons(); - if($scope.sidebarDiagramsClass === "disappear"){ - $scope.hideSidebars(); - $scope.sidebarDiagramsClass = ""; - $scope.buttonDiagramsClass = "btn btn-custom-docked btn-docked"; - if(kommonitorDataExchangeService.anySideBarIsShown === false){ - $rootScope.$broadcast("recenterMapOnShowSideBar"); - } - kommonitorDataExchangeService.anySideBarIsShown = true; - $rootScope.$broadcast("resizeDiagrams"); - } - else{ - $scope.sidebarDiagramsClass = "disappear"; - $rootScope.$broadcast("recenterMapOnHideSideBar"); - kommonitorDataExchangeService.anySideBarIsShown = false; - } - - $rootScope.$broadcast("refreshIndicatorValueRangeSlider"); - $rootScope.$broadcast("redrawGuidedTourElement"); - } - - $scope.onSidebarRadarDiagramClick = function(){ - $scope.undockButtons(); - if($scope.sidebarRadarDiagramClass === "disappear"){ - $scope.hideSidebars(); - $scope.sidebarRadarDiagramClass = ""; - $scope.buttonRadarDiagramClass = "btn btn-custom-docked btn-docked"; - if(kommonitorDataExchangeService.anySideBarIsShown === false){ - $rootScope.$broadcast("recenterMapOnShowSideBar"); - } - kommonitorDataExchangeService.anySideBarIsShown = true; - $rootScope.$broadcast("resizeDiagrams"); - } - else{ - $scope.sidebarRadarDiagramClass = "disappear"; - $rootScope.$broadcast("recenterMapOnHideSideBar"); - kommonitorDataExchangeService.anySideBarIsShown = false; - } - - $rootScope.$broadcast("refreshIndicatorValueRangeSlider"); - $rootScope.$broadcast("redrawGuidedTourElement"); - } - - $scope.onSidebarProcessingClick = function(){ - $scope.undockButtons(); - if($scope.sidebarProcessingClass === "disappear"){ - $scope.hideSidebars(); - $scope.sidebarProcessingClass = ""; - $scope.buttonProcessingClass = "btn btn-custom-docked btn-docked"; - if(kommonitorDataExchangeService.anySideBarIsShown === false){ - $rootScope.$broadcast("recenterMapOnShowSideBar"); - } - kommonitorDataExchangeService.anySideBarIsShown = true; - } - else{ - $scope.sidebarProcessingClass = "disappear"; - $rootScope.$broadcast("recenterMapOnHideSideBar"); - kommonitorDataExchangeService.anySideBarIsShown = false; - } - - $rootScope.$broadcast("refreshIndicatorValueRangeSlider"); - $rootScope.$broadcast("redrawGuidedTourElement"); - } - - $scope.onSidebarRegressionDiagramClick = function(){ - $scope.undockButtons(); - if($scope.sidebarRegressionDiagramClass === "disappear"){ - $scope.hideSidebars(); - $scope.sidebarRegressionDiagramClass = ""; - $scope.buttonRegressionDiagramClass = "btn btn-custom-docked btn-docked"; - if(kommonitorDataExchangeService.anySideBarIsShown === false){ - $rootScope.$broadcast("recenterMapOnShowSideBar"); - } - kommonitorDataExchangeService.anySideBarIsShown = true; - $rootScope.$broadcast("resizeDiagrams"); - } - else{ - $scope.sidebarRegressionDiagramClass = "disappear"; - $rootScope.$broadcast("recenterMapOnHideSideBar"); - kommonitorDataExchangeService.anySideBarIsShown = false; - } - - $rootScope.$broadcast("refreshIndicatorValueRangeSlider"); - $rootScope.$broadcast("redrawGuidedTourElement"); - } - - $scope.onSidebarLegendButtonClick = function(){ - - if($scope.sidebarLegendClass === "disappear"){ - $scope.hideSidebars(); - $scope.sidebarLegendClass = ""; - $scope.buttonLegendClass = "btn btn-custom-docked-right btn-docked-right"; - } - else{ - $scope.sidebarLegendClass = "disappear"; - $scope.buttonLegendClass = "btn btn-custom-right btn-circle-right"; - } - - $rootScope.$broadcast("invalidateMapSize"); - $rootScope.$broadcast("refreshIndicatorValueRangeSlider"); - }; - - $scope.onRecenterMapButtonClick = function(){ - $rootScope.$broadcast("recenterMapContent"); - } - - $scope.onExportMapButtonClick = function(){ - $rootScope.$broadcast("exportMap"); - } - - $scope.onUnselectFeaturesButtonClick = function(){ - $rootScope.$broadcast("unselectAllFeatures"); - } - - $scope.onToggleInfoControlButtonClick = function(){ - $rootScope.$broadcast("toggleInfoControl"); - } - - $scope.onToggleLegendControlButtonClick = function(){ - $rootScope.$broadcast("toggleLegendControl"); - } - - $scope.$on("startGuidedTour", function(event){ - $scope.startGuidedTour(); - }); - - $scope.tourOptions = { - container: "body", - backdrop: true, - backdropContainer: "body", - smartPlacement: false, - onEnd: function(tour){ - kommonitorDataExchangeService.guidedTour = undefined; - }, - template: "

", - steps: [ - { - element:"#map", - title: "Willkommen zur Guided Tour von KomMonitor", - placement: "left", - content: "In dieser Tour werden die Funktionalitäten der Weboberfläche erläutert. Hier werden sie mit den Elementen der Oberfläche sowie den verschiedenen Buttons vertraut gemacht. " + - "
Die Tour kann jederzeit über den Button Guided Tour beenden verlassen werden. ", - onNext: function(tour){ - if($scope.sidebarLegendClass !== "disappear"){ - $("#sidebarLegendCollapse").click(); - } - } - }, - { - element: "#map", - title: "Inhaltsverzeichnis", - placement: "top", - content: "
    ", - onNext: function(tour){ - if($scope.sidebarLegendClass !== "disappear"){ - $("#sidebarLegendCollapse").click(); - } - }, - onShown: function(tour) { - $scope.generateTableOfContent(); - } - }, - { - element: "#header", - title: "Kopfzeile", - placement: "bottom", - content: "In der Kopfzeile befinden sich neben den Logos und dem Titel der Webanwendung mehrere Buttons.
    " + - "Mit kann zwischen einer vereinfachten und einer erweiterten Ansicht gewechselt werden.
    " + - "Diese Guided Tour kann stets erneut mit aufgerufen werden. " + - " öffnet das beim Aufruf der Seite erschienene Informationsfenster und
    " + - " ermöglicht mit entsprechenden Zugangsdaten den Zugang zur Administrationsoberfläche." - }, - { - element: "#map", - title: "Kartenfenster", - placement: "top", - content: "Die Standardansicht besteht aus einer kartografischen Darstellung, die bereits eine Hintergrundkarte und einen Indikator anzeigt. In dieser Darstellung können Sie in der " + - "Karte frei navigieren (zoomen, verschieben) und beim Herüberfahren mit dem Mauszeiger über eine der Raumeinheiten werden der Name, der Wert und die Einheit des dargestellten Indikators angezeigt.", - // onNext: function(tour){ - // // make sure that legend control is displayed - - // var control = document.getElementById("legendControl"); - // var controlButton = document.getElementById("toggleLegendControlButton"); - // if(control.style.display === "none" || (controlButton.style.display !== undefined && controlButton.style.display !== "none")){ - // $rootScope.$broadcast("toggleLegendControl"); - // } - - // }, - onNext: function(tour){ - if($scope.sidebarLegendClass === "disappear"){ - $("#sidebarLegendCollapse").click(); - } - } - }, - { - element: "#kommonitorLegend", - title: "Indikatorenlegende und Klassifizierung", - placement: "left", - content: "Dieses Element ist in drei Teilbereiche untergliedert, welche
    1. die wichtigsten Metadaten des dargestellten Indikator abbilden,
    " + - "2. Kartenlegenden zur Interpretation der Karteninhalte anbieten und
    3. weitergehende Möglichkeiten zur Klassifizierung bieten.", - onNext: function(tour){ - if($scope.sidebarLegendClass !== "disappear"){ - $("#legendSymbologyCollapse").click(); - } - }, - onPrev: function(tour){ - if($scope.sidebarLegendClass !== "disappear"){ - $("#sidebarLegendCollapse").click(); - } - } - }, - { - element: "#kommonitorIndicatorBasicMetadata", - title: "Indikator-Metadaten, Einstellung- und Exportmöglichkeiten", - placement: "left", - content: "Im oberen Bereich sind der Name eine kurze Beschreibung sowie das Fortführungsintervall des angezeigten Indikators zu finden.
    " + - "Im mittleren Bereich kann die angezeigte Raumebene per Dropdown-Liste gewechselt, der Zeitpunkt per Kalenderauswahl gewählt sowie
    " + - "die Transparenz der Kartendarstellung per Schieberegler angepasst werden.
    " + - "Der untere Bereich bietet Exportmöglichkeiten für die angezeigten Daten in den Formaten GeoJSON, ESRI Shapefile sowie CSV.
    " + - "Zudem kann ein Metadatenblatt aller Metadaten des dargestellten Indikators als PDF-Datei heruntergeladen werden.", - onNext: function(tour){ - if($scope.sidebarLegendClass !== "disappear"){ - $("#indicatorBasicMetadataCollapse").click(); - $("#legendSymbologyCollapse").click(); - } - }, - onPrev: function(tour){ - if($scope.sidebarLegendClass !== "disappear"){ - $("#legendSymbologyCollapse").click(); - } - } - }, - { - element: "#kommonitorLegendSymbology", - title: "Kartenlegenden und Interpretation", - placement: "left", - content: "Dieser Bereich beinhaltet eine Farblegende mit fünf Klassen für den angezeigten Indikator sowie die Wertebereiche und Fallzahlen je Klasse
    " + - "Als ergänzende Informationen werden der Indikatortyp, der Stichtag, die Einheit sowie eine kurze Interpretationshilfe angezeigt.
    " + - "Die einzelnen Reiter ganz oben ermöglichen den Wechsel zwischen verschiedenen Legenden, sofern zusätzlich zu einem Indikator
    " + - "auch die Legende für berechnete Isochronen, ein Routingergebnis oder einen eingebundenen WMS-Dienst angezeigt werden sollen.", - onNext: function(tour){ - if($scope.sidebarLegendClass !== "disappear"){ - $("#legendSymbologyCollapse").click(); - $("#indicatorClassificationCollapse").click(); - } - }, - onPrev: function(tour){ - if($scope.sidebarLegendClass !== "disappear"){ - $("#legendSymbologyCollapse").click(); - $("#indicatorBasicMetadataCollapse").click(); - } - } - }, - { - element: "#kommonitorIndicatorClassification", - title: "Klassifikationsoptionen", - placement: "left", - content: "Hier kann zwischen den drei Klassifizierungsmethoden Jenks, Gleiches Intervall und Quantile gewählt werden
    " + - "
    Detaillierte Informationen zu den Klassifizierungsmethoden können dem Popup entnommen werden, das beim Herüberfahren mit dem Mauszeiger über eine der drei Optionen erscheint. " + - "
    Zudem lässt sich per einstellen, ob die Klassifizierung die Indikatorenwerte der gesamten Zeitreihe berücksichtigen soll, oder nur jene des aktuellen Zeitschnitts.
    " + - "So kann ein vergleichbares Kartenbild für eine komplette Zeitreihe gewährleistet werden.
    " + - "
    KomMonitor überprüft jeden Indikatorendatensatz auf statistische Ausreißer. Werden ein oder mehrere Ausreißer erkannt, so können mit " + - "Ausreißer gesondert markiert und
    aus der Klassifizierung entfernt werden
    . Dies kann hilfreich sein, " + - "um ein differenzierteres Kartenbild zu erzeugen.", - onNext: function(tour){ - if($scope.sidebarLegendClass !== "disappear"){ - $("#sidebarLegendCollapse").click(); - } - }, - onPrev: function(tour){ - if($scope.sidebarLegendClass !== "disappear"){ - $("#legendSymbologyCollapse").click(); - $("#indicatorClassificationCollapse").click(); - } - } - }, - { - element: "#dateSliderWrapper", - title: "Zeitstrahl", - placement: "top", - content: "Die Zeitleiste am unteren Bildschirmrand enthält die verfügbaren Zeitschnitte des selektierten Indikators. Standardmäßig ist der aktuellste Zeitschnitt voreingestellt. "+ - "
    Durch ein Klicken auf einen beliebigen Punkt der Leiste oder durch Verschieben des runden Auswahlknopfs kann ein anderer Zeitschnitt gewählt werden.", - onPrev: function(tour){ - if($scope.sidebarLegendClass === "disappear"){ - $("#sidebarLegendCollapse").click(); - } - } - }, - { - element: "#mapUtilButtons", - title: "Steuerung der Kartendarstellung", - placement: "bottom", - content: "Diese Buttons bieten Steuerungsmöglichkeiten für die Kartendarstellung. Über und kann alternativ zur Verwendung des Mausrades hinein- bzw. hinausgezoomt werden. "+ - "

    zentriert die Karte und zoomt auf die maximale Ausdehnung des dargestellten Themas. " + - "

    hebt jegliche benutzerdefinierte Selektionen auf. " + - "

    erlaubt den Export des aktuellen Kartenausschnitts als Bilddatei. " + - "

    bietet die Möglichkeit, einzelne Karteninhalte temporär auszublenden oder die Hintergrundkarte zu wechseln. " + - "

    ermöglicht das Filtern innerhalb dargestellter Vektorlayer anhand des Namens oder der ID vorhandener Raumelemente. " + - "

    repräsentiert eine Geolokalisierung von Adressen und Orten. " + - "

    Darüber hinaus bietet eine Messfunktion für Abstände und Flächen." - }, - { - element: "#sideBarButtons", - title: "Menü-Buttons", - placement: "right", - content: "Diese Buttons öffnen jeweils ein linksseitig angeordnetets Menü mitzusätzlichen Funktionen. Jedes einzelne Menü wird in den folgenden Schritten kurz erläutert." - }, - { - element: "#sidebarIndicatorConfigCollapse", - title: "Indikatorenkatalog und Metadaten", - placement: "right", - content: "Ein Klick auf diesen Button öffnet das Indikatoren-Auswahl-Fenster.

    Im nächsten Schritt wird das Menü automatisch geöffnet.", - onNext: function(tour){ - if($scope.sidebarIndicatorConfigClass === "disappear"){ - $("#sidebarIndicatorConfigCollapse").click(); - } - } - }, - { - element: "#indicatorSetup", - title: "Indikatorenkatalog und Metadaten", - placement: "right", - content: "Dieses Menü enthält eine Übersicht aller verfügbarer Indikatoren sowie die Option, " + - "den aktuell betrachteten Indikator zu wechseln.

    Indikatoren können in Form einer Themenhierarchie im Datenkatalog oder in einer " + - "alphabetischen Liste betrachtet und selektiert werden.
    " + - "Einen transparenten Zugang zu zusammenschauenden, bewertenden Indikatoren bietet die Leitindikatoren-Hierarchie.
    " + - "Hiermit können Leitindikatoren sowie die zur Berechnung verwendeten Basis-Indikatoren aufgerufen und deren Verknüpfung nachvollzogen werden.
    " + - "Auch die Metadaten des ausgewählten Indikators können hier detailliert eingesehen werden.", - onNext: function(tour){ - if($scope.sidebarIndicatorConfigClass !== "disappear"){ - $("#sidebarIndicatorConfigCollapse").click(); - } - }, - onPrev: function(tour){ - if($scope.sidebarIndicatorConfigClass !== "disappear"){ - $("#sidebarIndicatorConfigCollapse").click(); - } - } - }, - { - element: "#sidebarPoiCollapse", - title: "Georessourcen und -dienste", - placement: "right", - content: "Ein Klick auf diesen Button öffnet das Georessourcen Fenster.

    Im nächsten Schritt wird das Menü automatisch geöffnet.", - onNext: function(tour){ - if($scope.sidebarPoiClass === "disappear"){ - $("#sidebarPoiCollapse").click(); - } - }, - onPrev: function(tour){ - if($scope.sidebarIndicatorConfigClass === "disappear"){ - $("#sidebarIndicatorConfigCollapse").click(); - } - } - }, - { - element: "#poi", - title: "Georessourcen und -dienste", - placement: "right", - content: "Zur Überlagerung von flächenhaft dargestellten Indikatoren mit weiteren relevanten Geodaten können Punkt- Linien und Flächendaten sowie Geodatendienste " + - "zur Karte hinzugefügt werden. Hinzufügen und Entfernen dieser Datensätze geschieht dabei durch (De-) Selektion der Auswahlbox links neben dem jeweiligen Datensatz. " + - "

    In der Standardkonfiguration werden Punktdaten räumlich zu sogenannten Cluster-Punkten zusammengefasst, um die Darstellung je nach Zoom-Stufe zu optimieren und
    " + - "selbst bei bei vielen Punkten eine übersichtliche Darstellung zu gewährleisten." + - "Über eine entsprechende Auswahloption können jedoch bei jeder Zoomstufe wahlweise auch alle Einzelpunkte angezeigt werden. " + - "

    Hinweis zum Zeitbezug der darzustellenden Daten:
    Der Abruf eines Punkt-, Linien- oder Flächendatensatzes bezieht sich immer auf ein Datum. " + - "Standardmäßig wird der aktuelle Zeitpunkt des dargestellten Indikators verwendet. Diese Option kann jedoch auf ein beliebiges frei definierbares Datum oder eine " + - "listenbasierte Auswahl verfügbarer Zeitpunkte jedes Datensatzes abgeändert werden.", - onNext: function(tour){ - if($scope.sidebarPoiClass !== "disappear"){ - $("#sidebarPoiCollapse").click(); - } - }, - onPrev: function(tour){ - if($scope.sidebarPoiClass !== "disappear"){ - $("#sidebarPoiCollapse").click(); - } - } - }, - // { - // element: "#sidebarDataImportCollapse", - // title: "Datenimport aus externen Quellen", - // placement: "right", - // content: "Ein Klick auf diesen Button öffnet das Datenimport Fenster.

    Im nächsten Schritt wird das Menü automatisch geöffnet.", - // onNext: function(tour){ - // if($scope.sidebarDataImportClass === "disappear"){ - // $("#sidebarDataImportCollapse").click(); - // } - // } - // }, - // { - // element: "#dataImport", - // title: "Datenimport aus externen Quellen", - // placement: "right", - // content: "Dieses Fenster bietet Optionen zum Datenimport aus externen Datenquellen, insbesondere mittels Web Map Services und Datei-basierten Quellen wie GeoJSON oder ESRI Shape.

    Jeder WMS-Datensatz wird tabellarisch inklusive Titel, Beschreibung, Transparenzschieberegler, URL und Legende dargestellt. Durch Anhaken/Deselektion der Checkbox kann ein Datensatz hinzugefügt/entfernt werden. Neben den bereits vorkonfigurierten Datensätzen lassen sich weitere Quellen über den unten stehenden Button ergänzen.

    Die Möglichkeit Layer aus einer lokalen Datei einzuladen wird in Kürze verfügbar sein.", - // onNext: function(tour){ - // if($scope.sidebarDataImportClass !== "disappear"){ - // $("#sidebarDataImportCollapse").click(); - // } - // }, - // onPrev: function(tour){ - // if($scope.sidebarDataImportClass !== "disappear"){ - // $("#sidebarDataImportCollapse").click(); - // } - // } - // }, - { - element: "#sidebarFilterCollapse", - title: "Darstellungsfilter", - placement: "right", - content: "Ein Klick auf diesen Button öffnet ein Fenster zur Definition von Darstellungsfiltern.

    Im nächsten Schritt wird das Menü automatisch geöffnet.", - onNext: function(tour){ - if($scope.sidebarFilterClass === "disappear"){ - $("#sidebarFilterCollapse").click(); - } - }, - onPrev: function(tour){ - if($scope.sidebarPoiClass === "disappear"){ - $("#sidebarPoiCollapse").click(); - } - } - }, - { - element: "#kommonitorFilter", - title: "Darstellungsfilter", - placement: "right", - //

    Darüber hinaus können je nach Fragestellung die Raumebenen-Geometrien (z.B. Stadtteile) auf diejenigen eingeschränkt werden, die zur Beantwortung der Fragestellung beitragen. - content: "Hier können verschiedene Darstellungsfilter angewendet werden, die sich auf die kartografische Darstellung auswirken. " + - "Über den Wertebereichsfilter können die angezeigten Raumeinheiten anhand der Wertausprägung des angezeigten Indikators gefiltert werden. " + - "Dazu kann der Schieberegler an dem minimalen und maximalen Werten nach rechts oder links geschoben werden. Alternativ kann die untere und/oder obere Grenze " + - "auch als Zahlenwert eingetragen werden.
    " + - "
    Eine weitere Option ist die dynamische Schwellenwertklassifizierung, bei der ein spezifischer Wert definiert werden kann, " + - "der die Indikator-Darstellung in zwei Bereiche unterteilt (oberhalb und unterhalb des Schwellenwerts) und entsprechend farbig darstellt.", - onNext: function(tour){ - if($scope.sidebarFilterClass !== "disappear"){ - $("#sidebarFilterCollapse").click(); - } - }, - onPrev: function(tour){ - if($scope.sidebarFilterClass !== "disappear"){ - $("#sidebarFilterCollapse").click(); - } - } - }, - { - element: "#sidebarBalanceCollapse", - title: "Zeitliche Bilanzierung", - placement: "right", - content: "Ein Klick auf diesen Button öffnet ein Fenster zur zeitlichen Bilanzierung des aktuell dargestellten Indikators. " + - "

    Im nächsten Schritt wird das Menü automatisch geöffnet.", - onNext: function(tour){ - if($scope.sidebarBalanceClass === "disappear"){ - $("#sidebarBalanceCollapse").click(); - } - }, - onPrev: function(tour){ - if($scope.sidebarFilterClass === "disappear"){ - $("#sidebarFilterCollapse").click(); - } - } - }, - { - element: "#kommonitorBalance", - title: "Zeitliche Bilanzierung", - placement: "right", - content: "Bei der zeitlichen Bilanzierung steht die Wertentwicklung eines Indikators über die Zeit im Fokus (z. B. Wachstum / Schrumpfung). " + - "Wird die Bilanzierung anhand der Auswahlbox aktiviert, kann über die Zeitleiste ein Start- sowie ein Endzeitpunkt festgelegt werden.
    " + - "Für diesen spezifizifischen Betrachtungszeitraum wird dann automatisch die Wertentwicklung des angezeigten Indikators berechnet und dargestellt. " + - "

    Auch die Indikatoren-Legende am rechten Rand der Anwendung beinhaltet dann die Information, dass eine Bilanz des Indikators dargestellt wird. " + - "

    Der Trendverlauf im Betrachtungszeitraumwird zudem in Form eines Liniendiagrammes visualisiert. " + - "
    Zur Trendberechnung kann in KomMonitor zwischen einer linearen, exponentiellen und polynomialen Herleitung gewählt werden. " + - "
    Des Weiteren sind statistische Merkmale der gewählten Trendbetrachtung hinterlegt. Hierzu zählen beispielsweise Standardabweichung, Varianz, Mittelwert und Median sowie " + - "die Art des Trendverlaufes. " + - "

    Bitte beachten Sie, dass eine Bilanzierung nur bei Status-Indikatoren möglich ist, " + - "deren Zeitreihe mehr als einen Zeitpunkt enthält.", - onNext: function(tour){ - if($scope.sidebarBalanceClass !== "disappear"){ - $("#sidebarBalanceCollapse").click(); - } - }, - onPrev: function(tour){ - if($scope.sidebarBalanceClass !== "disappear"){ - $("#sidebarBalanceCollapse").click(); - } - } - }, - { - element: "#sidebarDiagramsCollapse", - title: "Statistische Diagramme", - placement: "right", - content: "Ein Klick auf diesen Button öffnet ein Fenster mit statistischen Diagrammen. " + - "

    Im nächsten Schritt wird das Menü automatisch geöffnet.", - onNext: function(tour){ - if($scope.sidebarDiagramsClass === "disappear"){ - $("#sidebarDiagramsCollapse").click(); - } - }, - onPrev: function(tour){ - if($scope.sidebarBalanceClass === "disappear"){ - $("#sidebarBalanceCollapse").click(); - } - } - }, - { - element: "#indicatorDiagrams", - title: "Statistische Diagramme", - placement: "right", - content: "Zusätzlich zur kartografischen Darstellung bieten grundlegende statistische Diagramme hilfreiche Zusatzinformationen zum gewählten Indikator. " + - "

    Ein Ranking der jeweiligen Raumeinheiten wird anhand eines Säulendiagramms dargestellt. " + - "

    Das untere Liniendiagramm visualisiert die zeitliche Entwicklung des aktuellen Indikators über alle jeweils verfügbaren Zeitschnitte. " + - "Als Zusatzinformation wird hier der Durchschnittswert über alle Raumeinheiten dargestellt. " + - "

    Um einzelne Elemente der gewählten Raumebene im Säulen- und Liniendiagramm zu betrachten und hervorzuheben, " + - "kann mit dem Mauszeiger entweder über die Säule innerhalb des Säulendiagramms oder über das jeweilige Element in der Karte gefahren werden. " + - "Eine dauerhafte Selektion durch Klicken auf das kartografische Element oder die dazugehörige Säule ermöglicht das simultane Betrachten mehrerer Elemente. " + - "

    Jedes Diagramm enthält in der oberen rechte Ecke eine Toolbox, über die das Diagramm entweder als Bilddatei oder im Tabellenformat exportiert werden kann.", - onNext: function(tour){ - if($scope.sidebarDiagramsClass !== "disappear"){ - $("#sidebarDiagramsCollapse").click(); - } - }, - onPrev: function(tour){ - if($scope.sidebarDiagramsClass !== "disappear"){ - $("#sidebarDiagramsCollapse").click(); - } - } - }, - { - element: "#sidebarRadarDiagramCollapse", - title: "Indikatorenradar", - placement: "right", - content: "Ein Klick auf diesen Button öffnet das Indiktorenradar für die Querschnittsbetrachtung mehrerer Indikatoren.

    Im nächsten Schritt wird das Menü automatisch geöffnet.", - onNext: function(tour){ - if($scope.sidebarRadarDiagramClass === "disappear"){ - $("#sidebarRadarDiagramCollapse").click(); - } - }, - onPrev: function(tour){ - if($scope.sidebarDiagramsClass === "disappear"){ - $("#sidebarDiagramsCollapse").click(); - } - } - }, - { - element: "#indicatorRadar", - title: "Indikatorenradar", - placement: "right", - content: "Das Indikatorenradar eignet sich insbesondere für die querschnittsorientierte Betrachtung mehrerer Indikatoren. " + - "
    Für die Anzeige eines solchen Diagramms, selektieren Sie bitte mindestens drei Indikatoren aus der oben stehenden Liste.

    " + - "Für jeden gewählten Indikator wird im Diagramm eine Achse genutzt, auf der einzelne Raumeinheiten anhand ihrer Wertausprägung abgetragen werden. " + - "Jede Achse wird dabei durch Minimum und Maximum der Werte des betrachteten Indikators gebildet (daher ist die Radarmitte ausdrücklich nicht zwingend " + - "mit dem Wert '0' gleichzusetzen, sondern mit dem Minimalwert des Indikators).

    Auch hier ist der Durchschnitt aller Raumeinheiten bereits vorberechnet und " + - "einzelne Elemente können mittels Selektion innerhalb der Karte dem Radar hinzugefügt werden. Die Indikatorenauswahl umfasst dabei nur solche Indikatoren, " + - "die die gewählte Raumebene und den aktuell gewählten Zeitschnitt unterstützen.

    Auch das Radardiagramm besitzt in der oberen rechte Ecke eine " + - "Toolbox, über die das Diagramm entweder als Bilddatei oder im Tabellenformat exportiert werden kann", - onNext: function(tour){ - if($scope.sidebarRadarDiagramClass !== "disappear"){ - $("#sidebarRadarDiagramCollapse").click(); - } - }, - onPrev: function(tour){ - if($scope.sidebarRadarDiagramClass !== "disappear"){ - $("#sidebarRadarDiagramCollapse").click(); - } - } - }, - { - element: "#sidebarRegressionDiagramCollapse", - title: "Regressionsdiagramm", - placement: "right", - content: "Ein Klick auf diesen Button öffnet das Fenster zur Definition von Regressionsdiagrammen.

    Im nächsten Schritt wird das Menü automatisch geöffnet.", - onNext: function(tour){ - if($scope.sidebarRegressionDiagramClass === "disappear"){ - $("#sidebarRegressionDiagramCollapse").click(); - } - }, - onPrev: function(tour){ - if($scope.sidebarRadarDiagramClass === "disappear"){ - $("#sidebarRadarDiagramCollapse").click(); - } - } - }, - { - element: "#indicatorRegression", - title: "Regressionsdiagramm", - placement: "right", - content: "Als exemplarischer weiterer Diagrammtyp unterstützt KomMonitor die Berechnung einer linearen Regression zwischen zwei zu wählenden Indikatoren, um insbesondere die Korrelation zwischen diesen zu betrachten. Nach Auswahl der Indikatoren werden die Regressionsgerade und alle Elemente der gewählten Raumebene gemäß ihrer Wertausprägungen entlang der Indikatorenachsen im Diagramm abgetragen.

    Beim Überfahren eines Datenpunkts mit der Maus im Diagramm oder einer in der Karte dargestellten Raumeinheit, wird das jeweilige Pendant visuell hervorgehoben.

    Die Indikatorenauswahl umfasst dabei nur solche Indikatoren, die die gewählte Raumebene und den aktuell gewählten Zeitschnitt unterstützen.

    Auch das Regressionsdiagramm besitzt in der oberen rechte Ecke eine Toolbox, über die das Diagramm entweder als Bilddatei oder im Tabellenformat exportiert werden kann.", - onNext: function(tour){ - if($scope.sidebarRegressionDiagramClass !== "disappear"){ - $("#sidebarRegressionDiagramCollapse").click(); - } - }, - onPrev: function(tour){ - if($scope.sidebarRegressionDiagramClass !== "disappear"){ - $("#sidebarRegressionDiagramCollapse").click(); - } - } - }, - { - element: "#sidebarReachabilityCollapse", - title: "Erreichbarkeitsanalysen", - placement: "right", - content: "Ein Klick auf diesen Button öffnet ein Fenster für Erreichbarkeitsanalysen.

    Im nächsten Schritt wird das Menü automatisch geöffnet.", - onNext: function(tour){ - if($scope.sidebarReachabilityClass === "disappear"){ - $("#sidebarReachabilityCollapse").click(); - } - }, - onPrev: function(tour){ - if($scope.sidebarRegressionDiagramClass === "disappear"){ - $("#sidebarRegressionDiagramCollapse").click(); - } - } - }, - { - element: "#kommonitorReachability", - title: "Erreichbarkeitsanalysen", - placement: "right", - content: "Als GIS-basiertes Werkzeug soll KomMonitor ausgewählte räumliche Analysen unterstützen. " + - "Insbesondere stehen Erreichbarkeitsanalysen im Fokus, bei denen, neben reinen Puffer-basierten Ansätzen, " + - "Erreichbarkeiten anhand tatsächlicher Wegenetze für verschiedene Transportmittel (z.B. Fußgänger, Fahrrad, Auto) "+ - "berechnet werden können. Konkret soll hierbei sowohl ein Routing zwischen einzelnen Punkten sowie " + - "die Berechnung von Isochronen (Äquidistanzen und zeitliches Abbruchkriterium) angeboten werden.

    " + - "Auswahl der Startpunkte
    " + - "Die Auswahl der Startpunkte kann entweder über die Selektion eines vorhandenen Punktdatensatzes vorgenommen werden oder mittels Einzeichnen eigener beliebiger Punkte in die Karte.

    " + - "Ergebnisdarstellung
    " + - "Sowohl Isochronen- als auch Routingergebnisse werden der Karte als neuer, eigener Layer hinzugefügt. " + - "Die jeweilige Legende über jeweiligen Reiter des rechten Legendenmenüs einsehbar.

    "+ - "Punkt in Isochronen Analyse
    " + - "Nachdem eine Isochronenberechnung erfolgt ist, können vorhandene Punktdatensätze räumlich mit den Isochronen verschnitten werden, bspw. um eine Umfeldanalyse für relevante Einrichtungen durchzuführen.", - onNext: function(tour){ - if($scope.sidebarReachabilityClass !== "disappear"){ - $("#sidebarReachabilityCollapse").click(); - } - }, - onPrev: function(tour){ - if($scope.sidebarReachabilityClass !== "disappear"){ - $("#sidebarReachabilityCollapse").click(); - } - } - }, - { - element: "#map", - title: "Vielen Dank für die Nutzung der Guided Tour von KomMonitor!", - placement: "left", - content: "Wir hoffen, die Erläuterungen konnten einen guten Einblick in die Funktionen bieten, " + - "bei der ersten Orientierung helfen und die zukünftige Nutzung erleichtern!

    " + - "Kritik, Anregungen oder Fragen sind jederzeit willkommen.
    (siehe Begrüßungsfenster für den Kontakt).

    " + - "Viel Spaß bei der Nutzung von KomMonitor! ", - onNext: function(tour){ - kommonitorDataExchangeService.guidedTour = undefined; // ends the tour - } - } - // { - // element: "#sidebarProcessingCollapse", - // title: "Individuelle Indikatoren-Neuberechnung", - // placement: "right", - // content: "Ein Klick auf diesen Button öffnet ein Fenster zur individuellen Neuberechnung einzelner Indikatoren.

    Im nächsten Schritt wird das Menü automatisch geöffnet.", - // onNext: function(tour){ - // if($scope.sidebarProcessingClass === "disappear"){ - // $("#sidebarProcessingCollapse").click(); - // } - // }, - // onPrev: function(tour){ - // if($scope.sidebarReachabilityClass === "disappear"){ - // $("#sidebarReachabilityCollapse").click(); - // } - // } - // }, - // { - // element: "#indicatorProcessing", - // title: "Individuelle Indikatoren-Neuberechnung", - // placement: "right", - // content: "KomMonitor ist mehr als nur ein Darstellungswerkzeug. Es ermöglicht insbesondere auch die automatisierte Berechnung von Indikatoren. Je nach Berechnungsvorschrift kann es dabei konfigurierbare Parameter geben, die die resultierenden Indikatorenwerte beeinflussen (bspw. eine maximle Distanz bei Erreichbarkeiten oder Gewichtungen grundlegender Eingangsdaten).

    Dieses Menü bietet die Möglichkeit einer Nutzer-definierten Neuberechnung von Indikatoren mit mindestens einem konfigurierbaren Parameter. Das jeweilige Berechnungsergebnis steht anschließend temporär zur Verfügung und kann bei Bedarf exportiert werden.

    Künftig sollen darüber hinaus unmittelbare Vergleiche mit der 'Standard'-Variante des Indikators angeboten werden. Diese sind jedoch zum gegenwärtigen Zeitpunkt noch nicht in der Anwendung umgesetzt.", - // onNext: function(tour){ - // if($scope.sidebarProcessingClass !== "disappear"){ - // $("#sidebarProcessingCollapse").click(); - // } - // }, - // onPrev: function(tour){ - // if($scope.sidebarProcessingClass !== "disappear"){ - // $("#sidebarProcessingCollapse").click(); - // } - // } - // } - ], - onShown: function(tour) { - // add shortcut to toc to each title - let titleElement = document.getElementsByClassName("popover-title").item(0); - titleElement.innerHTML += - "" + - ""; - $compile(titleElement)($scope); // let angularjs know that there is new html, add the ng-click event - } - }; - - $scope.generateTableOfContent = function() { - let prevStepTitle = undefined; - for(var i=0;i<$scope.tourOptions.steps.length;i++) { - let step = $scope.tourOptions.steps[i]; - // only show the first guided tour step for each subtheme - // specifically exclude "Individuelle Indikatoren-Neuberechnung" for now as it is not shown in the guided tour - if (step.title !== prevStepTitle && step.title !== "Individuelle Indikatoren-Neuberechnung") { - let html = "
  1. " + step.title + "
  2. "; - let compiled = $compile(html)($scope); // let angularjs know that there is new html, add the ng-click event - angular.element(document.getElementById('guided-tour-toc')).append(compiled); - } - prevStepTitle = step.title; - } - }; - - $scope.goToGuidedTourStep = function(tour, targetStepIndex) { - // The method "goTo" provided by the library jumps directly to the target step, ignoring the "onNext" and "onPrev" methods. - // That leads to menues not being opened/closed. To fix this we iterate the steps manually. - while(tour.getCurrentStep() < targetStepIndex) - tour.next(); - while(tour.getCurrentStep() > targetStepIndex) - tour.prev(); - }; - - $scope.startGuidedTour = function(){ - // GUIDED TOUR - // Instance the tour - kommonitorDataExchangeService.guidedTour = new Tour($scope.tourOptions); - - // Initialize the tour - kommonitorDataExchangeService.guidedTour.init(); - // Start the tour - try{ - kommonitorDataExchangeService.guidedTour.restart(); - } - catch(error){ - kommonitorDataExchangeService.guidedTour.start(true); - } - - // tour gotTo() example to jump to step 7 --> index starts from 0 - // kommonitorDataExchangeService.guidedTour.goTo(6); - - }; - - $scope.$on("redrawGuidedTourElement", async function(event){ - - await sleep(100); - - if(kommonitorDataExchangeService.guidedTour){ - kommonitorDataExchangeService.guidedTour.redraw(); - } - }); - - $scope.init(); - - } -]}); + templateUrl: "components/kommonitorUserInterface/kommonitor-user-interface.template.html", + controller: ['kommonitorDataExchangeService', 'kommonitorKeycloakHelperService', 'kommonitorElementVisibilityHelperService', '$scope', + '$rootScope', '$location', 'Auth', 'ControlsConfigService', '$compile', 'kommonitorShareHelperService', '__env', + function UserInterfaceController(kommonitorDataExchangeService, kommonitorKeycloakHelperService, kommonitorElementVisibilityHelperService, $scope, $rootScope, $location, Auth, ControlsConfigService, $compile, kommonitorShareHelperService, __env) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorKeycloakHelperServiceInstance = kommonitorKeycloakHelperService; + this.kommonitorElementVisibilityHelperServiceInstance = kommonitorElementVisibilityHelperService; + kommonitorDataExchangeService.anySideBarIsShown = false; + kommonitorDataExchangeService.currentKeycloakUser; + $scope.password; + $scope.showAdminLogin = false; + $scope.init = async function () { + // initialize application + console.log("Initialize Application"); + if ($scope.authenticated) { + console.log("Authetication successfull"); + } + await checkAuthentication(); + kommonitorShareHelperService.init(); + kommonitorDataExchangeService.fetchAllMetadata(); + }; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + $scope.sidebarIndicatorConfigClass = "disappear"; + $scope.sidebarDiagramsClass = "disappear"; + $scope.sidebarRadarDiagramClass = "disappear"; + $scope.sidebarProcessingClass = "disappear"; + $scope.sidebarRegressionDiagramClass = "disappear"; + $scope.sidebarFilterClass = "disappear"; + $scope.sidebarBalanceClass = "disappear"; + $scope.sidebarReachabilityClass = "disappear"; + $scope.sidebarPoiClass = "disappear"; + $scope.sidebarDataImportClass = "disappear"; + $scope.sidebarLegendClass = ""; + $scope.buttonIndicatorConfigClass = "btn btn-custom btn-circle"; + $scope.buttonDiagramsClass = "btn btn-custom btn-circle"; + $scope.buttonRadarDiagramClass = "btn btn-custom btn-circle"; + $scope.buttonProcessingClass = "btn btn-custom btn-circle"; + $scope.buttonRegressionDiagramClass = "btn btn-custom btn-circle"; + $scope.buttonFilterClass = "btn btn-custom btn-circle"; + $scope.buttonBalanceClass = "btn btn-custom btn-circle"; + $scope.buttonReachabilityClass = "btn btn-custom btn-circle"; + $scope.buttonPoiClass = "btn btn-custom btn-circle"; + $scope.buttonDataImportClass = "btn btn-custom btn-circle"; + $scope.buttonLegendClass = "btn btn-custom-docked-right btn-docked-right"; + function sleep(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); + } + Auth.keycloak.onAuthLogout = function () { + console.log("Logout successfull"); + checkAuthentication(); + }; + Auth.keycloak.onAuthSuccess = function () { + console.log("User successfully authenticated"); + checkAuthentication(); + }; + $scope.tryLoginUser_withoutKeycloak = function () { + // TODO FIXME make generic user login once user/role concept is implemented + // currently only simple ADMIN user login is possible + console.log("Check user login"); + if (kommonitorDataExchangeService.adminUserName === kommonitorDataExchangeService.currentKeycloakUser && kommonitorDataExchangeService.adminPassword === $scope.password) { + // success login --> currently switch to ADMIN page directly + console.log("User Login success - redirect to Admin Page"); + kommonitorDataExchangeService.adminIsLoggedIn = true; + $location.path('/administration'); + } + }; + $scope.tryLoginUser = function () { + if (kommonitorDataExchangeService.enableKeycloakSecurity) { + Auth.keycloak.login(); + } + else { + $scope.tryLoginUser_withoutKeycloak(); + } + }; + $scope.tryLogoutUser = function () { + Auth.keycloak.logout(); + }; + $scope.tryLoginUserByKeypress = function ($event) { + var keyCode = $event.which || $event.keyCode; + //check for enter key + if (keyCode === 13) { + $scope.tryLoginUser(); + } + }; + var checkAuthentication = async function () { + kommonitorDataExchangeService.currentKeycloakLoginRoles = []; + if (Auth.keycloak.authenticated) { + $scope.authenticated = Auth.keycloak.authenticated; + if (Auth.keycloak.tokenParsed + && Auth.keycloak.tokenParsed.realm_access + && Auth.keycloak.tokenParsed.realm_access.roles + && Auth.keycloak.tokenParsed.realm_access.roles.some(role => role.endsWith("-creator") || role.endsWith("-publisher") || role.endsWith("-editor"))) { + Auth.keycloak.showAdminView = true; + $scope.showAdminLogin = true; + } + } + }; + $scope.openAdminUI = function () { + $location.path('/administration'); + }; + $scope.undockButtons = function () { + $scope.buttonIndicatorConfigClass = "btn btn-custom btn-circle"; + $scope.buttonDiagramsClass = "btn btn-custom btn-circle"; + $scope.buttonRadarDiagramClass = "btn btn-custom btn-circle"; + $scope.buttonProcessingClass = "btn btn-custom btn-circle"; + $scope.buttonRegressionDiagramClass = "btn btn-custom btn-circle"; + $scope.buttonFilterClass = "btn btn-custom btn-circle"; + $scope.buttonBalanceClass = "btn btn-custom btn-circle"; + $scope.buttonReachabilityClass = "btn btn-custom btn-circle"; + $scope.buttonPoiClass = "btn btn-custom btn-circle"; + $scope.buttonDataImportClass = "btn btn-custom btn-circle"; + // in addition check if balance menue and button are allowed for current indicator + // it is not allowed if indicator is of type "DYNAMIC" + $scope.checkBalanceButtonAndMenueState(); + }; + $scope.hideSidebars = function () { + $scope.sidebarIndicatorConfigClass = "disappear"; + $scope.sidebarDiagramsClass = "disappear"; + $scope.sidebarRadarDiagramClass = "disappear"; + $scope.sidebarProcessingClass = "disappear"; + $scope.sidebarRegressionDiagramClass = "disappear"; + $scope.sidebarFilterClass = "disappear"; + $scope.sidebarBalanceClass = "disappear"; + $scope.sidebarReachabilityClass = "disappear"; + $scope.sidebarPoiClass = "disappear"; + $scope.sidebarDataImportClass = "disappear"; + }; + $scope.checkBalanceButtonAndMenueState = function () { + // disable if indicator is dynamic or if indicator only contains 1 or less timeseries entries + if (kommonitorDataExchangeService.selectedIndicator && (kommonitorDataExchangeService.selectedIndicator.indicatorType.includes("DYNAMIC") || kommonitorDataExchangeService.selectedIndicator.applicableDates.length < 2)) { + $scope.buttonBalanceClass = "btn btn-custom btn-circle disabled"; + $scope.sidebarBalanceClass = "disappear"; + } + else { + $scope.buttonBalanceClass = "btn btn-custom btn-circle"; + } + }; + $scope.$on("checkBalanceMenueAndButton", function (event) { + $scope.checkBalanceButtonAndMenueState(); + }); + $scope.onSidebarIndicatorButtonClick = function () { + $scope.undockButtons(); + if ($scope.sidebarIndicatorConfigClass === "disappear") { + $scope.hideSidebars(); + $scope.sidebarIndicatorConfigClass = ""; + $scope.buttonIndicatorConfigClass = "btn btn-custom-docked btn-docked"; + if (kommonitorDataExchangeService.anySideBarIsShown === false) { + $rootScope.$broadcast("recenterMapOnShowSideBar"); + } + kommonitorDataExchangeService.anySideBarIsShown = true; + } + else { + $scope.sidebarIndicatorConfigClass = "disappear"; + $rootScope.$broadcast("recenterMapOnHideSideBar"); + kommonitorDataExchangeService.anySideBarIsShown = false; + } + $rootScope.$broadcast("refreshIndicatorValueRangeSlider"); + $rootScope.$broadcast("redrawGuidedTourElement"); + }; + $scope.onSidebarPoiButtonClick = function () { + $scope.undockButtons(); + if ($scope.sidebarPoiClass === "disappear") { + $scope.hideSidebars(); + $scope.sidebarPoiClass = ""; + $scope.buttonPoiClass = "btn btn-custom-docked btn-docked"; + if (kommonitorDataExchangeService.anySideBarIsShown === false) { + $rootScope.$broadcast("recenterMapOnShowSideBar"); + } + kommonitorDataExchangeService.anySideBarIsShown = true; + } + else { + $scope.sidebarPoiClass = "disappear"; + $rootScope.$broadcast("recenterMapOnHideSideBar"); + kommonitorDataExchangeService.anySideBarIsShown = false; + } + $rootScope.$broadcast("refreshIndicatorValueRangeSlider"); + $rootScope.$broadcast("redrawGuidedTourElement"); + }; + $scope.onSidebarDataImportButtonClick = function () { + $scope.undockButtons(); + if ($scope.sidebarDataImportClass === "disappear") { + $scope.hideSidebars(); + $scope.sidebarDataImportClass = ""; + $scope.buttonDataImportClass = "btn btn-custom-docked btn-docked"; + if (kommonitorDataExchangeService.anySideBarIsShown === false) { + $rootScope.$broadcast("recenterMapOnShowSideBar"); + } + kommonitorDataExchangeService.anySideBarIsShown = true; + } + else { + $scope.sidebarDataImportClass = "disappear"; + $rootScope.$broadcast("recenterMapOnHideSideBar"); + kommonitorDataExchangeService.anySideBarIsShown = false; + } + $rootScope.$broadcast("refreshIndicatorValueRangeSlider"); + $rootScope.$broadcast("redrawGuidedTourElement"); + }; + $scope.onSidebarFilterButtonClick = function () { + $scope.undockButtons(); + if ($scope.sidebarFilterClass === "disappear") { + $scope.hideSidebars(); + $scope.sidebarFilterClass = ""; + $scope.buttonFilterClass = "btn btn-custom-docked btn-docked"; + if (kommonitorDataExchangeService.anySideBarIsShown === false) { + $rootScope.$broadcast("recenterMapOnShowSideBar"); + } + kommonitorDataExchangeService.anySideBarIsShown = true; + } + else { + $scope.sidebarFilterClass = "disappear"; + $rootScope.$broadcast("recenterMapOnHideSideBar"); + kommonitorDataExchangeService.anySideBarIsShown = false; + } + $rootScope.$broadcast("refreshIndicatorValueRangeSlider"); + $rootScope.$broadcast("redrawGuidedTourElement"); + }; + $scope.onSidebarBalanceButtonClick = function () { + // check if button is marked as disabled + if ($scope.buttonBalanceClass.includes("disabled")) { + // do nothing + return; + } + else { + $scope.undockButtons(); + if ($scope.sidebarBalanceClass === "disappear") { + $scope.hideSidebars(); + $scope.sidebarBalanceClass = ""; + $scope.buttonBalanceClass = "btn btn-custom-docked btn-docked"; + if (kommonitorDataExchangeService.anySideBarIsShown === false) { + $rootScope.$broadcast("recenterMapOnShowSideBar"); + } + kommonitorDataExchangeService.anySideBarIsShown = true; + } + else { + $scope.sidebarBalanceClass = "disappear"; + $rootScope.$broadcast("recenterMapOnHideSideBar"); + kommonitorDataExchangeService.anySideBarIsShown = false; + } + $rootScope.$broadcast("refreshIndicatorValueRangeSlider"); + $rootScope.$broadcast("redrawGuidedTourElement"); + } + }; + $scope.onSidebarReachabilityButtonClick = function () { + $scope.undockButtons(); + if ($scope.sidebarReachabilityClass === "disappear") { + $scope.hideSidebars(); + $scope.sidebarReachabilityClass = ""; + $scope.buttonReachabilityClass = "btn btn-custom-docked btn-docked"; + if (kommonitorDataExchangeService.anySideBarIsShown === false) { + $rootScope.$broadcast("recenterMapOnShowSideBar"); + } + kommonitorDataExchangeService.anySideBarIsShown = true; + } + else { + $scope.sidebarReachabilityClass = "disappear"; + $rootScope.$broadcast("recenterMapOnHideSideBar"); + kommonitorDataExchangeService.anySideBarIsShown = false; + } + $rootScope.$broadcast("refreshIndicatorValueRangeSlider"); + $rootScope.$broadcast("redrawGuidedTourElement"); + }; + $scope.onSidebarDiagramsClick = function () { + $scope.undockButtons(); + if ($scope.sidebarDiagramsClass === "disappear") { + $scope.hideSidebars(); + $scope.sidebarDiagramsClass = ""; + $scope.buttonDiagramsClass = "btn btn-custom-docked btn-docked"; + if (kommonitorDataExchangeService.anySideBarIsShown === false) { + $rootScope.$broadcast("recenterMapOnShowSideBar"); + } + kommonitorDataExchangeService.anySideBarIsShown = true; + $rootScope.$broadcast("resizeDiagrams"); + } + else { + $scope.sidebarDiagramsClass = "disappear"; + $rootScope.$broadcast("recenterMapOnHideSideBar"); + kommonitorDataExchangeService.anySideBarIsShown = false; + } + $rootScope.$broadcast("refreshIndicatorValueRangeSlider"); + $rootScope.$broadcast("redrawGuidedTourElement"); + }; + $scope.onSidebarRadarDiagramClick = function () { + $scope.undockButtons(); + if ($scope.sidebarRadarDiagramClass === "disappear") { + $scope.hideSidebars(); + $scope.sidebarRadarDiagramClass = ""; + $scope.buttonRadarDiagramClass = "btn btn-custom-docked btn-docked"; + if (kommonitorDataExchangeService.anySideBarIsShown === false) { + $rootScope.$broadcast("recenterMapOnShowSideBar"); + } + kommonitorDataExchangeService.anySideBarIsShown = true; + $rootScope.$broadcast("resizeDiagrams"); + } + else { + $scope.sidebarRadarDiagramClass = "disappear"; + $rootScope.$broadcast("recenterMapOnHideSideBar"); + kommonitorDataExchangeService.anySideBarIsShown = false; + } + $rootScope.$broadcast("refreshIndicatorValueRangeSlider"); + $rootScope.$broadcast("redrawGuidedTourElement"); + }; + $scope.onSidebarProcessingClick = function () { + $scope.undockButtons(); + if ($scope.sidebarProcessingClass === "disappear") { + $scope.hideSidebars(); + $scope.sidebarProcessingClass = ""; + $scope.buttonProcessingClass = "btn btn-custom-docked btn-docked"; + if (kommonitorDataExchangeService.anySideBarIsShown === false) { + $rootScope.$broadcast("recenterMapOnShowSideBar"); + } + kommonitorDataExchangeService.anySideBarIsShown = true; + } + else { + $scope.sidebarProcessingClass = "disappear"; + $rootScope.$broadcast("recenterMapOnHideSideBar"); + kommonitorDataExchangeService.anySideBarIsShown = false; + } + $rootScope.$broadcast("refreshIndicatorValueRangeSlider"); + $rootScope.$broadcast("redrawGuidedTourElement"); + }; + $scope.onSidebarRegressionDiagramClick = function () { + $scope.undockButtons(); + if ($scope.sidebarRegressionDiagramClass === "disappear") { + $scope.hideSidebars(); + $scope.sidebarRegressionDiagramClass = ""; + $scope.buttonRegressionDiagramClass = "btn btn-custom-docked btn-docked"; + if (kommonitorDataExchangeService.anySideBarIsShown === false) { + $rootScope.$broadcast("recenterMapOnShowSideBar"); + } + kommonitorDataExchangeService.anySideBarIsShown = true; + $rootScope.$broadcast("resizeDiagrams"); + } + else { + $scope.sidebarRegressionDiagramClass = "disappear"; + $rootScope.$broadcast("recenterMapOnHideSideBar"); + kommonitorDataExchangeService.anySideBarIsShown = false; + } + $rootScope.$broadcast("refreshIndicatorValueRangeSlider"); + $rootScope.$broadcast("redrawGuidedTourElement"); + }; + $scope.onSidebarLegendButtonClick = function () { + if ($scope.sidebarLegendClass === "disappear") { + $scope.hideSidebars(); + $scope.sidebarLegendClass = ""; + $scope.buttonLegendClass = "btn btn-custom-docked-right btn-docked-right"; + } + else { + $scope.sidebarLegendClass = "disappear"; + $scope.buttonLegendClass = "btn btn-custom-right btn-circle-right"; + } + $rootScope.$broadcast("invalidateMapSize"); + $rootScope.$broadcast("refreshIndicatorValueRangeSlider"); + }; + $scope.onRecenterMapButtonClick = function () { + $rootScope.$broadcast("recenterMapContent"); + }; + $scope.onExportMapButtonClick = function () { + $rootScope.$broadcast("exportMap"); + }; + $scope.onUnselectFeaturesButtonClick = function () { + $rootScope.$broadcast("unselectAllFeatures"); + }; + $scope.onToggleInfoControlButtonClick = function () { + $rootScope.$broadcast("toggleInfoControl"); + }; + $scope.onToggleLegendControlButtonClick = function () { + $rootScope.$broadcast("toggleLegendControl"); + }; + $scope.$on("startGuidedTour", function (event) { + $scope.startGuidedTour(); + }); + $scope.tourOptions = { + container: "body", + backdrop: true, + backdropContainer: "body", + smartPlacement: false, + onEnd: function (tour) { + kommonitorDataExchangeService.guidedTour = undefined; + }, + template: "

    ", + steps: [ + { + element: "#map", + title: "Willkommen zur Guided Tour von KomMonitor", + placement: "left", + content: "In dieser Tour werden die Funktionalitäten der Weboberfläche erläutert. Hier werden sie mit den Elementen der Oberfläche sowie den verschiedenen Buttons vertraut gemacht. " + + "
    Die Tour kann jederzeit über den Button Guided Tour beenden verlassen werden. ", + onNext: function (tour) { + if ($scope.sidebarLegendClass !== "disappear") { + $("#sidebarLegendCollapse").click(); + } + } + }, + { + element: "#map", + title: "Inhaltsverzeichnis", + placement: "top", + content: "
      ", + onNext: function (tour) { + if ($scope.sidebarLegendClass !== "disappear") { + $("#sidebarLegendCollapse").click(); + } + }, + onShown: function (tour) { + $scope.generateTableOfContent(); + } + }, + { + element: "#header", + title: "Kopfzeile", + placement: "bottom", + content: "In der Kopfzeile befinden sich neben den Logos und dem Titel der Webanwendung mehrere Buttons.
      " + + "Mit kann zwischen einer vereinfachten und einer erweiterten Ansicht gewechselt werden.
      " + + "Diese Guided Tour kann stets erneut mit aufgerufen werden. " + + " öffnet das beim Aufruf der Seite erschienene Informationsfenster und
      " + + " ermöglicht mit entsprechenden Zugangsdaten den Zugang zur Administrationsoberfläche." + }, + { + element: "#map", + title: "Kartenfenster", + placement: "top", + content: "Die Standardansicht besteht aus einer kartografischen Darstellung, die bereits eine Hintergrundkarte und einen Indikator anzeigt. In dieser Darstellung können Sie in der " + + "Karte frei navigieren (zoomen, verschieben) und beim Herüberfahren mit dem Mauszeiger über eine der Raumeinheiten werden der Name, der Wert und die Einheit des dargestellten Indikators angezeigt.", + // onNext: function(tour){ + // // make sure that legend control is displayed + // var control = document.getElementById("legendControl"); + // var controlButton = document.getElementById("toggleLegendControlButton"); + // if(control.style.display === "none" || (controlButton.style.display !== undefined && controlButton.style.display !== "none")){ + // $rootScope.$broadcast("toggleLegendControl"); + // } + // }, + onNext: function (tour) { + if ($scope.sidebarLegendClass === "disappear") { + $("#sidebarLegendCollapse").click(); + } + } + }, + { + element: "#kommonitorLegend", + title: "Indikatorenlegende und Klassifizierung", + placement: "left", + content: "Dieses Element ist in drei Teilbereiche untergliedert, welche
      1. die wichtigsten Metadaten des dargestellten Indikator abbilden,
      " + + "2. Kartenlegenden zur Interpretation der Karteninhalte anbieten und
      3. weitergehende Möglichkeiten zur Klassifizierung bieten.", + onNext: function (tour) { + if ($scope.sidebarLegendClass !== "disappear") { + $("#legendSymbologyCollapse").click(); + } + }, + onPrev: function (tour) { + if ($scope.sidebarLegendClass !== "disappear") { + $("#sidebarLegendCollapse").click(); + } + } + }, + { + element: "#kommonitorIndicatorBasicMetadata", + title: "Indikator-Metadaten, Einstellung- und Exportmöglichkeiten", + placement: "left", + content: "Im oberen Bereich sind der Name eine kurze Beschreibung sowie das Fortführungsintervall des angezeigten Indikators zu finden.
      " + + "Im mittleren Bereich kann die angezeigte Raumebene per Dropdown-Liste gewechselt, der Zeitpunkt per Kalenderauswahl gewählt sowie
      " + + "die Transparenz der Kartendarstellung per Schieberegler angepasst werden.
      " + + "Der untere Bereich bietet Exportmöglichkeiten für die angezeigten Daten in den Formaten GeoJSON, ESRI Shapefile sowie CSV.
      " + + "Zudem kann ein Metadatenblatt aller Metadaten des dargestellten Indikators als PDF-Datei heruntergeladen werden.", + onNext: function (tour) { + if ($scope.sidebarLegendClass !== "disappear") { + $("#indicatorBasicMetadataCollapse").click(); + $("#legendSymbologyCollapse").click(); + } + }, + onPrev: function (tour) { + if ($scope.sidebarLegendClass !== "disappear") { + $("#legendSymbologyCollapse").click(); + } + } + }, + { + element: "#kommonitorLegendSymbology", + title: "Kartenlegenden und Interpretation", + placement: "left", + content: "Dieser Bereich beinhaltet eine Farblegende mit fünf Klassen für den angezeigten Indikator sowie die Wertebereiche und Fallzahlen je Klasse
      " + + "Als ergänzende Informationen werden der Indikatortyp, der Stichtag, die Einheit sowie eine kurze Interpretationshilfe angezeigt.
      " + + "Die einzelnen Reiter ganz oben ermöglichen den Wechsel zwischen verschiedenen Legenden, sofern zusätzlich zu einem Indikator
      " + + "auch die Legende für berechnete Isochronen, ein Routingergebnis oder einen eingebundenen WMS-Dienst angezeigt werden sollen.", + onNext: function (tour) { + if ($scope.sidebarLegendClass !== "disappear") { + $("#legendSymbologyCollapse").click(); + $("#indicatorClassificationCollapse").click(); + } + }, + onPrev: function (tour) { + if ($scope.sidebarLegendClass !== "disappear") { + $("#legendSymbologyCollapse").click(); + $("#indicatorBasicMetadataCollapse").click(); + } + } + }, + { + element: "#kommonitorIndicatorClassification", + title: "Klassifikationsoptionen", + placement: "left", + content: "Hier kann zwischen den drei Klassifizierungsmethoden Jenks, Gleiches Intervall und Quantile gewählt werden
      " + + "
      Detaillierte Informationen zu den Klassifizierungsmethoden können dem Popup entnommen werden, das beim Herüberfahren mit dem Mauszeiger über eine der drei Optionen erscheint. " + + "
      Zudem lässt sich per einstellen, ob die Klassifizierung die Indikatorenwerte der gesamten Zeitreihe berücksichtigen soll, oder nur jene des aktuellen Zeitschnitts.
      " + + "So kann ein vergleichbares Kartenbild für eine komplette Zeitreihe gewährleistet werden.
      " + + "
      KomMonitor überprüft jeden Indikatorendatensatz auf statistische Ausreißer. Werden ein oder mehrere Ausreißer erkannt, so können mit " + + "Ausreißer gesondert markiert und
      aus der Klassifizierung entfernt werden
      . Dies kann hilfreich sein, " + + "um ein differenzierteres Kartenbild zu erzeugen.", + onNext: function (tour) { + if ($scope.sidebarLegendClass !== "disappear") { + $("#sidebarLegendCollapse").click(); + } + }, + onPrev: function (tour) { + if ($scope.sidebarLegendClass !== "disappear") { + $("#legendSymbologyCollapse").click(); + $("#indicatorClassificationCollapse").click(); + } + } + }, + { + element: "#dateSliderWrapper", + title: "Zeitstrahl", + placement: "top", + content: "Die Zeitleiste am unteren Bildschirmrand enthält die verfügbaren Zeitschnitte des selektierten Indikators. Standardmäßig ist der aktuellste Zeitschnitt voreingestellt. " + + "
      Durch ein Klicken auf einen beliebigen Punkt der Leiste oder durch Verschieben des runden Auswahlknopfs kann ein anderer Zeitschnitt gewählt werden.", + onPrev: function (tour) { + if ($scope.sidebarLegendClass === "disappear") { + $("#sidebarLegendCollapse").click(); + } + } + }, + { + element: "#mapUtilButtons", + title: "Steuerung der Kartendarstellung", + placement: "bottom", + content: "Diese Buttons bieten Steuerungsmöglichkeiten für die Kartendarstellung. Über und kann alternativ zur Verwendung des Mausrades hinein- bzw. hinausgezoomt werden. " + + "

      zentriert die Karte und zoomt auf die maximale Ausdehnung des dargestellten Themas. " + + "

      hebt jegliche benutzerdefinierte Selektionen auf. " + + "

      erlaubt den Export des aktuellen Kartenausschnitts als Bilddatei. " + + "

      bietet die Möglichkeit, einzelne Karteninhalte temporär auszublenden oder die Hintergrundkarte zu wechseln. " + + "

      ermöglicht das Filtern innerhalb dargestellter Vektorlayer anhand des Namens oder der ID vorhandener Raumelemente. " + + "

      repräsentiert eine Geolokalisierung von Adressen und Orten. " + + "

      Darüber hinaus bietet eine Messfunktion für Abstände und Flächen." + }, + { + element: "#sideBarButtons", + title: "Menü-Buttons", + placement: "right", + content: "Diese Buttons öffnen jeweils ein linksseitig angeordnetets Menü mitzusätzlichen Funktionen. Jedes einzelne Menü wird in den folgenden Schritten kurz erläutert." + }, + { + element: "#sidebarIndicatorConfigCollapse", + title: "Indikatorenkatalog und Metadaten", + placement: "right", + content: "Ein Klick auf diesen Button öffnet das Indikatoren-Auswahl-Fenster.

      Im nächsten Schritt wird das Menü automatisch geöffnet.", + onNext: function (tour) { + if ($scope.sidebarIndicatorConfigClass === "disappear") { + $("#sidebarIndicatorConfigCollapse").click(); + } + } + }, + { + element: "#indicatorSetup", + title: "Indikatorenkatalog und Metadaten", + placement: "right", + content: "Dieses Menü enthält eine Übersicht aller verfügbarer Indikatoren sowie die Option, " + + "den aktuell betrachteten Indikator zu wechseln.

      Indikatoren können in Form einer Themenhierarchie im Datenkatalog oder in einer " + + "alphabetischen Liste betrachtet und selektiert werden.
      " + + "Einen transparenten Zugang zu zusammenschauenden, bewertenden Indikatoren bietet die Leitindikatoren-Hierarchie.
      " + + "Hiermit können Leitindikatoren sowie die zur Berechnung verwendeten Basis-Indikatoren aufgerufen und deren Verknüpfung nachvollzogen werden.
      " + + "Auch die Metadaten des ausgewählten Indikators können hier detailliert eingesehen werden.", + onNext: function (tour) { + if ($scope.sidebarIndicatorConfigClass !== "disappear") { + $("#sidebarIndicatorConfigCollapse").click(); + } + }, + onPrev: function (tour) { + if ($scope.sidebarIndicatorConfigClass !== "disappear") { + $("#sidebarIndicatorConfigCollapse").click(); + } + } + }, + { + element: "#sidebarPoiCollapse", + title: "Georessourcen und -dienste", + placement: "right", + content: "Ein Klick auf diesen Button öffnet das Georessourcen Fenster.

      Im nächsten Schritt wird das Menü automatisch geöffnet.", + onNext: function (tour) { + if ($scope.sidebarPoiClass === "disappear") { + $("#sidebarPoiCollapse").click(); + } + }, + onPrev: function (tour) { + if ($scope.sidebarIndicatorConfigClass === "disappear") { + $("#sidebarIndicatorConfigCollapse").click(); + } + } + }, + { + element: "#poi", + title: "Georessourcen und -dienste", + placement: "right", + content: "Zur Überlagerung von flächenhaft dargestellten Indikatoren mit weiteren relevanten Geodaten können Punkt- Linien und Flächendaten sowie Geodatendienste " + + "zur Karte hinzugefügt werden. Hinzufügen und Entfernen dieser Datensätze geschieht dabei durch (De-) Selektion der Auswahlbox links neben dem jeweiligen Datensatz. " + + "

      In der Standardkonfiguration werden Punktdaten räumlich zu sogenannten Cluster-Punkten zusammengefasst, um die Darstellung je nach Zoom-Stufe zu optimieren und
      " + + "selbst bei bei vielen Punkten eine übersichtliche Darstellung zu gewährleisten." + + "Über eine entsprechende Auswahloption können jedoch bei jeder Zoomstufe wahlweise auch alle Einzelpunkte angezeigt werden. " + + "

      Hinweis zum Zeitbezug der darzustellenden Daten:
      Der Abruf eines Punkt-, Linien- oder Flächendatensatzes bezieht sich immer auf ein Datum. " + + "Standardmäßig wird der aktuelle Zeitpunkt des dargestellten Indikators verwendet. Diese Option kann jedoch auf ein beliebiges frei definierbares Datum oder eine " + + "listenbasierte Auswahl verfügbarer Zeitpunkte jedes Datensatzes abgeändert werden.", + onNext: function (tour) { + if ($scope.sidebarPoiClass !== "disappear") { + $("#sidebarPoiCollapse").click(); + } + }, + onPrev: function (tour) { + if ($scope.sidebarPoiClass !== "disappear") { + $("#sidebarPoiCollapse").click(); + } + } + }, + // { + // element: "#sidebarDataImportCollapse", + // title: "Datenimport aus externen Quellen", + // placement: "right", + // content: "Ein Klick auf diesen Button öffnet das Datenimport Fenster.

      Im nächsten Schritt wird das Menü automatisch geöffnet.", + // onNext: function(tour){ + // if($scope.sidebarDataImportClass === "disappear"){ + // $("#sidebarDataImportCollapse").click(); + // } + // } + // }, + // { + // element: "#dataImport", + // title: "Datenimport aus externen Quellen", + // placement: "right", + // content: "Dieses Fenster bietet Optionen zum Datenimport aus externen Datenquellen, insbesondere mittels Web Map Services und Datei-basierten Quellen wie GeoJSON oder ESRI Shape.

      Jeder WMS-Datensatz wird tabellarisch inklusive Titel, Beschreibung, Transparenzschieberegler, URL und Legende dargestellt. Durch Anhaken/Deselektion der Checkbox kann ein Datensatz hinzugefügt/entfernt werden. Neben den bereits vorkonfigurierten Datensätzen lassen sich weitere Quellen über den unten stehenden Button ergänzen.

      Die Möglichkeit Layer aus einer lokalen Datei einzuladen wird in Kürze verfügbar sein.", + // onNext: function(tour){ + // if($scope.sidebarDataImportClass !== "disappear"){ + // $("#sidebarDataImportCollapse").click(); + // } + // }, + // onPrev: function(tour){ + // if($scope.sidebarDataImportClass !== "disappear"){ + // $("#sidebarDataImportCollapse").click(); + // } + // } + // }, + { + element: "#sidebarFilterCollapse", + title: "Darstellungsfilter", + placement: "right", + content: "Ein Klick auf diesen Button öffnet ein Fenster zur Definition von Darstellungsfiltern.

      Im nächsten Schritt wird das Menü automatisch geöffnet.", + onNext: function (tour) { + if ($scope.sidebarFilterClass === "disappear") { + $("#sidebarFilterCollapse").click(); + } + }, + onPrev: function (tour) { + if ($scope.sidebarPoiClass === "disappear") { + $("#sidebarPoiCollapse").click(); + } + } + }, + { + element: "#kommonitorFilter", + title: "Darstellungsfilter", + placement: "right", + //

      Darüber hinaus können je nach Fragestellung die Raumebenen-Geometrien (z.B. Stadtteile) auf diejenigen eingeschränkt werden, die zur Beantwortung der Fragestellung beitragen. + content: "Hier können verschiedene Darstellungsfilter angewendet werden, die sich auf die kartografische Darstellung auswirken. " + + "Über den Wertebereichsfilter können die angezeigten Raumeinheiten anhand der Wertausprägung des angezeigten Indikators gefiltert werden. " + + "Dazu kann der Schieberegler an dem minimalen und maximalen Werten nach rechts oder links geschoben werden. Alternativ kann die untere und/oder obere Grenze " + + "auch als Zahlenwert eingetragen werden.
      " + + "
      Eine weitere Option ist die dynamische Schwellenwertklassifizierung, bei der ein spezifischer Wert definiert werden kann, " + + "der die Indikator-Darstellung in zwei Bereiche unterteilt (oberhalb und unterhalb des Schwellenwerts) und entsprechend farbig darstellt.", + onNext: function (tour) { + if ($scope.sidebarFilterClass !== "disappear") { + $("#sidebarFilterCollapse").click(); + } + }, + onPrev: function (tour) { + if ($scope.sidebarFilterClass !== "disappear") { + $("#sidebarFilterCollapse").click(); + } + } + }, + { + element: "#sidebarBalanceCollapse", + title: "Zeitliche Bilanzierung", + placement: "right", + content: "Ein Klick auf diesen Button öffnet ein Fenster zur zeitlichen Bilanzierung des aktuell dargestellten Indikators. " + + "

      Im nächsten Schritt wird das Menü automatisch geöffnet.", + onNext: function (tour) { + if ($scope.sidebarBalanceClass === "disappear") { + $("#sidebarBalanceCollapse").click(); + } + }, + onPrev: function (tour) { + if ($scope.sidebarFilterClass === "disappear") { + $("#sidebarFilterCollapse").click(); + } + } + }, + { + element: "#kommonitorBalance", + title: "Zeitliche Bilanzierung", + placement: "right", + content: "Bei der zeitlichen Bilanzierung steht die Wertentwicklung eines Indikators über die Zeit im Fokus (z. B. Wachstum / Schrumpfung). " + + "Wird die Bilanzierung anhand der Auswahlbox aktiviert, kann über die Zeitleiste ein Start- sowie ein Endzeitpunkt festgelegt werden.
      " + + "Für diesen spezifizifischen Betrachtungszeitraum wird dann automatisch die Wertentwicklung des angezeigten Indikators berechnet und dargestellt. " + + "

      Auch die Indikatoren-Legende am rechten Rand der Anwendung beinhaltet dann die Information, dass eine Bilanz des Indikators dargestellt wird. " + + "

      Der Trendverlauf im Betrachtungszeitraumwird zudem in Form eines Liniendiagrammes visualisiert. " + + "
      Zur Trendberechnung kann in KomMonitor zwischen einer linearen, exponentiellen und polynomialen Herleitung gewählt werden. " + + "
      Des Weiteren sind statistische Merkmale der gewählten Trendbetrachtung hinterlegt. Hierzu zählen beispielsweise Standardabweichung, Varianz, Mittelwert und Median sowie " + + "die Art des Trendverlaufes. " + + "

      Bitte beachten Sie, dass eine Bilanzierung nur bei Status-Indikatoren möglich ist, " + + "deren Zeitreihe mehr als einen Zeitpunkt enthält.", + onNext: function (tour) { + if ($scope.sidebarBalanceClass !== "disappear") { + $("#sidebarBalanceCollapse").click(); + } + }, + onPrev: function (tour) { + if ($scope.sidebarBalanceClass !== "disappear") { + $("#sidebarBalanceCollapse").click(); + } + } + }, + { + element: "#sidebarDiagramsCollapse", + title: "Statistische Diagramme", + placement: "right", + content: "Ein Klick auf diesen Button öffnet ein Fenster mit statistischen Diagrammen. " + + "

      Im nächsten Schritt wird das Menü automatisch geöffnet.", + onNext: function (tour) { + if ($scope.sidebarDiagramsClass === "disappear") { + $("#sidebarDiagramsCollapse").click(); + } + }, + onPrev: function (tour) { + if ($scope.sidebarBalanceClass === "disappear") { + $("#sidebarBalanceCollapse").click(); + } + } + }, + { + element: "#indicatorDiagrams", + title: "Statistische Diagramme", + placement: "right", + content: "Zusätzlich zur kartografischen Darstellung bieten grundlegende statistische Diagramme hilfreiche Zusatzinformationen zum gewählten Indikator. " + + "

      Ein Ranking der jeweiligen Raumeinheiten wird anhand eines Säulendiagramms dargestellt. " + + "

      Das untere Liniendiagramm visualisiert die zeitliche Entwicklung des aktuellen Indikators über alle jeweils verfügbaren Zeitschnitte. " + + "Als Zusatzinformation wird hier der Durchschnittswert über alle Raumeinheiten dargestellt. " + + "

      Um einzelne Elemente der gewählten Raumebene im Säulen- und Liniendiagramm zu betrachten und hervorzuheben, " + + "kann mit dem Mauszeiger entweder über die Säule innerhalb des Säulendiagramms oder über das jeweilige Element in der Karte gefahren werden. " + + "Eine dauerhafte Selektion durch Klicken auf das kartografische Element oder die dazugehörige Säule ermöglicht das simultane Betrachten mehrerer Elemente. " + + "

      Jedes Diagramm enthält in der oberen rechte Ecke eine Toolbox, über die das Diagramm entweder als Bilddatei oder im Tabellenformat exportiert werden kann.", + onNext: function (tour) { + if ($scope.sidebarDiagramsClass !== "disappear") { + $("#sidebarDiagramsCollapse").click(); + } + }, + onPrev: function (tour) { + if ($scope.sidebarDiagramsClass !== "disappear") { + $("#sidebarDiagramsCollapse").click(); + } + } + }, + { + element: "#sidebarRadarDiagramCollapse", + title: "Indikatorenradar", + placement: "right", + content: "Ein Klick auf diesen Button öffnet das Indiktorenradar für die Querschnittsbetrachtung mehrerer Indikatoren.

      Im nächsten Schritt wird das Menü automatisch geöffnet.", + onNext: function (tour) { + if ($scope.sidebarRadarDiagramClass === "disappear") { + $("#sidebarRadarDiagramCollapse").click(); + } + }, + onPrev: function (tour) { + if ($scope.sidebarDiagramsClass === "disappear") { + $("#sidebarDiagramsCollapse").click(); + } + } + }, + { + element: "#indicatorRadar", + title: "Indikatorenradar", + placement: "right", + content: "Das Indikatorenradar eignet sich insbesondere für die querschnittsorientierte Betrachtung mehrerer Indikatoren. " + + "
      Für die Anzeige eines solchen Diagramms, selektieren Sie bitte mindestens drei Indikatoren aus der oben stehenden Liste.

      " + + "Für jeden gewählten Indikator wird im Diagramm eine Achse genutzt, auf der einzelne Raumeinheiten anhand ihrer Wertausprägung abgetragen werden. " + + "Jede Achse wird dabei durch Minimum und Maximum der Werte des betrachteten Indikators gebildet (daher ist die Radarmitte ausdrücklich nicht zwingend " + + "mit dem Wert '0' gleichzusetzen, sondern mit dem Minimalwert des Indikators).

      Auch hier ist der Durchschnitt aller Raumeinheiten bereits vorberechnet und " + + "einzelne Elemente können mittels Selektion innerhalb der Karte dem Radar hinzugefügt werden. Die Indikatorenauswahl umfasst dabei nur solche Indikatoren, " + + "die die gewählte Raumebene und den aktuell gewählten Zeitschnitt unterstützen.

      Auch das Radardiagramm besitzt in der oberen rechte Ecke eine " + + "Toolbox, über die das Diagramm entweder als Bilddatei oder im Tabellenformat exportiert werden kann", + onNext: function (tour) { + if ($scope.sidebarRadarDiagramClass !== "disappear") { + $("#sidebarRadarDiagramCollapse").click(); + } + }, + onPrev: function (tour) { + if ($scope.sidebarRadarDiagramClass !== "disappear") { + $("#sidebarRadarDiagramCollapse").click(); + } + } + }, + { + element: "#sidebarRegressionDiagramCollapse", + title: "Regressionsdiagramm", + placement: "right", + content: "Ein Klick auf diesen Button öffnet das Fenster zur Definition von Regressionsdiagrammen.

      Im nächsten Schritt wird das Menü automatisch geöffnet.", + onNext: function (tour) { + if ($scope.sidebarRegressionDiagramClass === "disappear") { + $("#sidebarRegressionDiagramCollapse").click(); + } + }, + onPrev: function (tour) { + if ($scope.sidebarRadarDiagramClass === "disappear") { + $("#sidebarRadarDiagramCollapse").click(); + } + } + }, + { + element: "#indicatorRegression", + title: "Regressionsdiagramm", + placement: "right", + content: "Als exemplarischer weiterer Diagrammtyp unterstützt KomMonitor die Berechnung einer linearen Regression zwischen zwei zu wählenden Indikatoren, um insbesondere die Korrelation zwischen diesen zu betrachten. Nach Auswahl der Indikatoren werden die Regressionsgerade und alle Elemente der gewählten Raumebene gemäß ihrer Wertausprägungen entlang der Indikatorenachsen im Diagramm abgetragen.

      Beim Überfahren eines Datenpunkts mit der Maus im Diagramm oder einer in der Karte dargestellten Raumeinheit, wird das jeweilige Pendant visuell hervorgehoben.

      Die Indikatorenauswahl umfasst dabei nur solche Indikatoren, die die gewählte Raumebene und den aktuell gewählten Zeitschnitt unterstützen.

      Auch das Regressionsdiagramm besitzt in der oberen rechte Ecke eine Toolbox, über die das Diagramm entweder als Bilddatei oder im Tabellenformat exportiert werden kann.", + onNext: function (tour) { + if ($scope.sidebarRegressionDiagramClass !== "disappear") { + $("#sidebarRegressionDiagramCollapse").click(); + } + }, + onPrev: function (tour) { + if ($scope.sidebarRegressionDiagramClass !== "disappear") { + $("#sidebarRegressionDiagramCollapse").click(); + } + } + }, + { + element: "#sidebarReachabilityCollapse", + title: "Erreichbarkeitsanalysen", + placement: "right", + content: "Ein Klick auf diesen Button öffnet ein Fenster für Erreichbarkeitsanalysen.

      Im nächsten Schritt wird das Menü automatisch geöffnet.", + onNext: function (tour) { + if ($scope.sidebarReachabilityClass === "disappear") { + $("#sidebarReachabilityCollapse").click(); + } + }, + onPrev: function (tour) { + if ($scope.sidebarRegressionDiagramClass === "disappear") { + $("#sidebarRegressionDiagramCollapse").click(); + } + } + }, + { + element: "#kommonitorReachability", + title: "Erreichbarkeitsanalysen", + placement: "right", + content: "Als GIS-basiertes Werkzeug soll KomMonitor ausgewählte räumliche Analysen unterstützen. " + + "Insbesondere stehen Erreichbarkeitsanalysen im Fokus, bei denen, neben reinen Puffer-basierten Ansätzen, " + + "Erreichbarkeiten anhand tatsächlicher Wegenetze für verschiedene Transportmittel (z.B. Fußgänger, Fahrrad, Auto) " + + "berechnet werden können. Konkret soll hierbei sowohl ein Routing zwischen einzelnen Punkten sowie " + + "die Berechnung von Isochronen (Äquidistanzen und zeitliches Abbruchkriterium) angeboten werden.

      " + + "Auswahl der Startpunkte
      " + + "Die Auswahl der Startpunkte kann entweder über die Selektion eines vorhandenen Punktdatensatzes vorgenommen werden oder mittels Einzeichnen eigener beliebiger Punkte in die Karte.

      " + + "Ergebnisdarstellung
      " + + "Sowohl Isochronen- als auch Routingergebnisse werden der Karte als neuer, eigener Layer hinzugefügt. " + + "Die jeweilige Legende über jeweiligen Reiter des rechten Legendenmenüs einsehbar.

      " + + "Punkt in Isochronen Analyse
      " + + "Nachdem eine Isochronenberechnung erfolgt ist, können vorhandene Punktdatensätze räumlich mit den Isochronen verschnitten werden, bspw. um eine Umfeldanalyse für relevante Einrichtungen durchzuführen.", + onNext: function (tour) { + if ($scope.sidebarReachabilityClass !== "disappear") { + $("#sidebarReachabilityCollapse").click(); + } + }, + onPrev: function (tour) { + if ($scope.sidebarReachabilityClass !== "disappear") { + $("#sidebarReachabilityCollapse").click(); + } + } + }, + { + element: "#map", + title: "Vielen Dank für die Nutzung der Guided Tour von KomMonitor!", + placement: "left", + content: "Wir hoffen, die Erläuterungen konnten einen guten Einblick in die Funktionen bieten, " + + "bei der ersten Orientierung helfen und die zukünftige Nutzung erleichtern!

      " + + "Kritik, Anregungen oder Fragen sind jederzeit willkommen.
      (siehe Begrüßungsfenster für den Kontakt).

      " + + "Viel Spaß bei der Nutzung von KomMonitor! ", + onNext: function (tour) { + kommonitorDataExchangeService.guidedTour = undefined; // ends the tour + } + } + // { + // element: "#sidebarProcessingCollapse", + // title: "Individuelle Indikatoren-Neuberechnung", + // placement: "right", + // content: "Ein Klick auf diesen Button öffnet ein Fenster zur individuellen Neuberechnung einzelner Indikatoren.

      Im nächsten Schritt wird das Menü automatisch geöffnet.", + // onNext: function(tour){ + // if($scope.sidebarProcessingClass === "disappear"){ + // $("#sidebarProcessingCollapse").click(); + // } + // }, + // onPrev: function(tour){ + // if($scope.sidebarReachabilityClass === "disappear"){ + // $("#sidebarReachabilityCollapse").click(); + // } + // } + // }, + // { + // element: "#indicatorProcessing", + // title: "Individuelle Indikatoren-Neuberechnung", + // placement: "right", + // content: "KomMonitor ist mehr als nur ein Darstellungswerkzeug. Es ermöglicht insbesondere auch die automatisierte Berechnung von Indikatoren. Je nach Berechnungsvorschrift kann es dabei konfigurierbare Parameter geben, die die resultierenden Indikatorenwerte beeinflussen (bspw. eine maximle Distanz bei Erreichbarkeiten oder Gewichtungen grundlegender Eingangsdaten).

      Dieses Menü bietet die Möglichkeit einer Nutzer-definierten Neuberechnung von Indikatoren mit mindestens einem konfigurierbaren Parameter. Das jeweilige Berechnungsergebnis steht anschließend temporär zur Verfügung und kann bei Bedarf exportiert werden.

      Künftig sollen darüber hinaus unmittelbare Vergleiche mit der 'Standard'-Variante des Indikators angeboten werden. Diese sind jedoch zum gegenwärtigen Zeitpunkt noch nicht in der Anwendung umgesetzt.", + // onNext: function(tour){ + // if($scope.sidebarProcessingClass !== "disappear"){ + // $("#sidebarProcessingCollapse").click(); + // } + // }, + // onPrev: function(tour){ + // if($scope.sidebarProcessingClass !== "disappear"){ + // $("#sidebarProcessingCollapse").click(); + // } + // } + // } + ], + onShown: function (tour) { + // add shortcut to toc to each title + let titleElement = document.getElementsByClassName("popover-title").item(0); + titleElement.innerHTML += + "" + + ""; + $compile(titleElement)($scope); // let angularjs know that there is new html, add the ng-click event + } + }; + $scope.generateTableOfContent = function () { + let prevStepTitle = undefined; + for (var i = 0; i < $scope.tourOptions.steps.length; i++) { + let step = $scope.tourOptions.steps[i]; + // only show the first guided tour step for each subtheme + // specifically exclude "Individuelle Indikatoren-Neuberechnung" for now as it is not shown in the guided tour + if (step.title !== prevStepTitle && step.title !== "Individuelle Indikatoren-Neuberechnung") { + let html = "
    1. " + step.title + "
    2. "; + let compiled = $compile(html)($scope); // let angularjs know that there is new html, add the ng-click event + angular.element(document.getElementById('guided-tour-toc')).append(compiled); + } + prevStepTitle = step.title; + } + }; + $scope.goToGuidedTourStep = function (tour, targetStepIndex) { + // The method "goTo" provided by the library jumps directly to the target step, ignoring the "onNext" and "onPrev" methods. + // That leads to menues not being opened/closed. To fix this we iterate the steps manually. + while (tour.getCurrentStep() < targetStepIndex) + tour.next(); + while (tour.getCurrentStep() > targetStepIndex) + tour.prev(); + }; + $scope.startGuidedTour = function () { + // GUIDED TOUR + // Instance the tour + kommonitorDataExchangeService.guidedTour = new Tour($scope.tourOptions); + // Initialize the tour + kommonitorDataExchangeService.guidedTour.init(); + // Start the tour + try { + kommonitorDataExchangeService.guidedTour.restart(); + } + catch (error) { + kommonitorDataExchangeService.guidedTour.start(true); + } + // tour gotTo() example to jump to step 7 --> index starts from 0 + // kommonitorDataExchangeService.guidedTour.goTo(6); + }; + $scope.$on("redrawGuidedTourElement", async function (event) { + await sleep(100); + if (kommonitorDataExchangeService.guidedTour) { + kommonitorDataExchangeService.guidedTour.redraw(); + } + }); + $scope.init(); + } + ] +}); +//# sourceMappingURL=kommonitor-user-interface.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitor-user-interface.component.js.map b/app/components/kommonitorUserInterface/kommonitor-user-interface.component.js.map new file mode 100644 index 000000000..3ae5711ef --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitor-user-interface.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-user-interface.component.js","sourceRoot":"","sources":["kommonitor-user-interface.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC,SAAS,CAAC,yBAAyB,EAAE;IAC9E,WAAW,EAAG,4EAA4E;IAC1F,UAAU,EAAG,CAAC,+BAA+B,EAAE,iCAAiC,EAAE,0CAA0C,EAAE,QAAQ;QACtI,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,uBAAuB,EAAE,UAAU,EAAE,8BAA8B,EAAE,OAAO;QAC/G,SAAS,uBAAuB,CAAC,6BAA6B,EAAE,+BAA+B,EAA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serInterface/kommonitor-user-interface.component.ts b/app/components/kommonitorUserInterface/kommonitor-user-interface.component.ts new file mode 100644 index 000000000..4c8a2733f --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitor-user-interface.component.ts @@ -0,0 +1,1077 @@ +angular.module('kommonitorUserInterface').component('kommonitorUserInterface', { + templateUrl : "components/kommonitorUserInterface/kommonitor-user-interface.template.html", + controller : ['kommonitorDataExchangeService', 'kommonitorKeycloakHelperService', 'kommonitorElementVisibilityHelperService', '$scope', + '$rootScope', '$location', 'Auth', 'ControlsConfigService', '$compile', 'kommonitorShareHelperService', '__env', + function UserInterfaceController(kommonitorDataExchangeService, kommonitorKeycloakHelperService, kommonitorElementVisibilityHelperService, + $scope, $rootScope, $location, Auth, ControlsConfigService, $compile, kommonitorShareHelperService, __env) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorKeycloakHelperServiceInstance = kommonitorKeycloakHelperService; + this.kommonitorElementVisibilityHelperServiceInstance = kommonitorElementVisibilityHelperService; + + kommonitorDataExchangeService.anySideBarIsShown = false; + + + kommonitorDataExchangeService.currentKeycloakUser; + $scope.password; + $scope.showAdminLogin = false; + + $scope.init = async function () { + // initialize application + console.log("Initialize Application"); + if ($scope.authenticated) { + console.log("Authetication successfull"); + } + + await checkAuthentication(); + + kommonitorShareHelperService.init(); + + kommonitorDataExchangeService.fetchAllMetadata(); + }; + + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + $scope.sidebarIndicatorConfigClass = "disappear"; + $scope.sidebarDiagramsClass = "disappear"; + $scope.sidebarRadarDiagramClass = "disappear"; + $scope.sidebarProcessingClass = "disappear"; + $scope.sidebarRegressionDiagramClass = "disappear"; + $scope.sidebarFilterClass = "disappear"; + $scope.sidebarBalanceClass = "disappear"; + $scope.sidebarReachabilityClass = "disappear"; + $scope.sidebarPoiClass = "disappear"; + $scope.sidebarDataImportClass = "disappear"; + + $scope.sidebarLegendClass = ""; + + $scope.buttonIndicatorConfigClass = "btn btn-custom btn-circle"; + $scope.buttonDiagramsClass = "btn btn-custom btn-circle"; + $scope.buttonRadarDiagramClass = "btn btn-custom btn-circle"; + $scope.buttonProcessingClass = "btn btn-custom btn-circle"; + $scope.buttonRegressionDiagramClass = "btn btn-custom btn-circle"; + $scope.buttonFilterClass = "btn btn-custom btn-circle"; + $scope.buttonBalanceClass = "btn btn-custom btn-circle"; + $scope.buttonReachabilityClass = "btn btn-custom btn-circle"; + $scope.buttonPoiClass = "btn btn-custom btn-circle"; + $scope.buttonDataImportClass = "btn btn-custom btn-circle"; + + $scope.buttonLegendClass = "btn btn-custom-docked-right btn-docked-right"; + + function sleep(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); + } + + Auth.keycloak.onAuthLogout = function() { + console.log("Logout successfull"); + checkAuthentication(); + } + + Auth.keycloak.onAuthSuccess = function() { + console.log("User successfully authenticated"); + checkAuthentication(); + } + + $scope.tryLoginUser_withoutKeycloak = function(){ + // TODO FIXME make generic user login once user/role concept is implemented + + // currently only simple ADMIN user login is possible + console.log("Check user login"); + if (kommonitorDataExchangeService.adminUserName === kommonitorDataExchangeService.currentKeycloakUser && kommonitorDataExchangeService.adminPassword === $scope.password){ + // success login --> currently switch to ADMIN page directly + console.log("User Login success - redirect to Admin Page"); + kommonitorDataExchangeService.adminIsLoggedIn = true; + $location.path('/administration'); + } + }; + + $scope.tryLoginUser = function(){ + if(kommonitorDataExchangeService.enableKeycloakSecurity){ + Auth.keycloak.login(); + } + else{ + $scope.tryLoginUser_withoutKeycloak(); + } + + }; + + $scope.tryLogoutUser = function() { + Auth.keycloak.logout(); + }; + + $scope.tryLoginUserByKeypress = function ($event) { + var keyCode = $event.which || $event.keyCode; + //check for enter key + if (keyCode === 13) { + $scope.tryLoginUser(); + } + }; + + var checkAuthentication = async function () { + kommonitorDataExchangeService.currentKeycloakLoginRoles = []; + + if (Auth.keycloak.authenticated) { + $scope.authenticated = Auth.keycloak.authenticated; + if(Auth.keycloak.tokenParsed + && Auth.keycloak.tokenParsed.realm_access + && Auth.keycloak.tokenParsed.realm_access.roles + && Auth.keycloak.tokenParsed.realm_access.roles.some(role => role.endsWith("-creator") || role.endsWith("-publisher") || role.endsWith("-editor"))){ + Auth.keycloak.showAdminView = true; + $scope.showAdminLogin = true; + } + } + }; + + $scope.openAdminUI = function () { + $location.path('/administration'); + }; + + $scope.undockButtons = function(){ + $scope.buttonIndicatorConfigClass = "btn btn-custom btn-circle"; + $scope.buttonDiagramsClass = "btn btn-custom btn-circle"; + $scope.buttonRadarDiagramClass = "btn btn-custom btn-circle"; + $scope.buttonProcessingClass = "btn btn-custom btn-circle"; + $scope.buttonRegressionDiagramClass = "btn btn-custom btn-circle"; + $scope.buttonFilterClass = "btn btn-custom btn-circle"; + $scope.buttonBalanceClass = "btn btn-custom btn-circle"; + $scope.buttonReachabilityClass = "btn btn-custom btn-circle"; + $scope.buttonPoiClass = "btn btn-custom btn-circle"; + $scope.buttonDataImportClass = "btn btn-custom btn-circle"; + + // in addition check if balance menue and button are allowed for current indicator + // it is not allowed if indicator is of type "DYNAMIC" + $scope.checkBalanceButtonAndMenueState(); + }; + + $scope.hideSidebars = function(){ + $scope.sidebarIndicatorConfigClass = "disappear"; + $scope.sidebarDiagramsClass = "disappear"; + $scope.sidebarRadarDiagramClass = "disappear"; + $scope.sidebarProcessingClass = "disappear"; + $scope.sidebarRegressionDiagramClass = "disappear"; + $scope.sidebarFilterClass = "disappear"; + $scope.sidebarBalanceClass = "disappear"; + $scope.sidebarReachabilityClass = "disappear"; + $scope.sidebarPoiClass = "disappear"; + $scope.sidebarDataImportClass = "disappear"; + }; + + $scope.checkBalanceButtonAndMenueState = function(){ + // disable if indicator is dynamic or if indicator only contains 1 or less timeseries entries + if(kommonitorDataExchangeService.selectedIndicator && (kommonitorDataExchangeService.selectedIndicator.indicatorType.includes("DYNAMIC") || kommonitorDataExchangeService.selectedIndicator.applicableDates.length < 2)){ + $scope.buttonBalanceClass = "btn btn-custom btn-circle disabled"; + $scope.sidebarBalanceClass = "disappear"; + } + else{ + $scope.buttonBalanceClass = "btn btn-custom btn-circle"; + } + }; + + $scope.$on("checkBalanceMenueAndButton", function(event){ + $scope.checkBalanceButtonAndMenueState(); + }); + + $scope.onSidebarIndicatorButtonClick = function(){ + $scope.undockButtons(); + + if($scope.sidebarIndicatorConfigClass === "disappear"){ + $scope.hideSidebars(); + $scope.sidebarIndicatorConfigClass = ""; + $scope.buttonIndicatorConfigClass = "btn btn-custom-docked btn-docked"; + + if(kommonitorDataExchangeService.anySideBarIsShown === false){ + $rootScope.$broadcast("recenterMapOnShowSideBar"); + } + kommonitorDataExchangeService.anySideBarIsShown = true; + } + else{ + $scope.sidebarIndicatorConfigClass = "disappear"; + $rootScope.$broadcast("recenterMapOnHideSideBar"); + kommonitorDataExchangeService.anySideBarIsShown = false; + } + + $rootScope.$broadcast("refreshIndicatorValueRangeSlider"); + $rootScope.$broadcast("redrawGuidedTourElement"); + + } + + $scope.onSidebarPoiButtonClick = function(){ + $scope.undockButtons(); + + if($scope.sidebarPoiClass === "disappear"){ + $scope.hideSidebars(); + $scope.sidebarPoiClass = ""; + $scope.buttonPoiClass = "btn btn-custom-docked btn-docked"; + + if(kommonitorDataExchangeService.anySideBarIsShown === false){ + $rootScope.$broadcast("recenterMapOnShowSideBar"); + } + kommonitorDataExchangeService.anySideBarIsShown = true; + } + else{ + $scope.sidebarPoiClass = "disappear"; + $rootScope.$broadcast("recenterMapOnHideSideBar"); + kommonitorDataExchangeService.anySideBarIsShown = false; + } + + $rootScope.$broadcast("refreshIndicatorValueRangeSlider"); + $rootScope.$broadcast("redrawGuidedTourElement"); + + } + + $scope.onSidebarDataImportButtonClick = function(){ + $scope.undockButtons(); + + if($scope.sidebarDataImportClass === "disappear"){ + $scope.hideSidebars(); + $scope.sidebarDataImportClass = ""; + $scope.buttonDataImportClass = "btn btn-custom-docked btn-docked"; + + if(kommonitorDataExchangeService.anySideBarIsShown === false){ + $rootScope.$broadcast("recenterMapOnShowSideBar"); + } + kommonitorDataExchangeService.anySideBarIsShown = true; + } + else{ + $scope.sidebarDataImportClass = "disappear"; + $rootScope.$broadcast("recenterMapOnHideSideBar"); + kommonitorDataExchangeService.anySideBarIsShown = false; + } + + $rootScope.$broadcast("refreshIndicatorValueRangeSlider"); + $rootScope.$broadcast("redrawGuidedTourElement"); + + } + + $scope.onSidebarFilterButtonClick = function(){ + $scope.undockButtons(); + + if($scope.sidebarFilterClass === "disappear"){ + $scope.hideSidebars(); + $scope.sidebarFilterClass = ""; + $scope.buttonFilterClass = "btn btn-custom-docked btn-docked"; + + if(kommonitorDataExchangeService.anySideBarIsShown === false){ + $rootScope.$broadcast("recenterMapOnShowSideBar"); + } + kommonitorDataExchangeService.anySideBarIsShown = true; + } + else{ + $scope.sidebarFilterClass = "disappear"; + $rootScope.$broadcast("recenterMapOnHideSideBar"); + kommonitorDataExchangeService.anySideBarIsShown = false; + } + + $rootScope.$broadcast("refreshIndicatorValueRangeSlider"); + $rootScope.$broadcast("redrawGuidedTourElement"); + + } + + $scope.onSidebarBalanceButtonClick = function(){ + + // check if button is marked as disabled + if($scope.buttonBalanceClass.includes("disabled")){ + // do nothing + return; + } + else{ + $scope.undockButtons(); + + if($scope.sidebarBalanceClass === "disappear"){ + $scope.hideSidebars(); + $scope.sidebarBalanceClass = ""; + $scope.buttonBalanceClass = "btn btn-custom-docked btn-docked"; + + if(kommonitorDataExchangeService.anySideBarIsShown === false){ + $rootScope.$broadcast("recenterMapOnShowSideBar"); + } + kommonitorDataExchangeService.anySideBarIsShown = true; + } + else{ + $scope.sidebarBalanceClass = "disappear"; + $rootScope.$broadcast("recenterMapOnHideSideBar"); + kommonitorDataExchangeService.anySideBarIsShown = false; + } + + $rootScope.$broadcast("refreshIndicatorValueRangeSlider"); + $rootScope.$broadcast("redrawGuidedTourElement"); + } + } + + $scope.onSidebarReachabilityButtonClick = function(){ + $scope.undockButtons(); + + if($scope.sidebarReachabilityClass === "disappear"){ + $scope.hideSidebars(); + $scope.sidebarReachabilityClass = ""; + $scope.buttonReachabilityClass = "btn btn-custom-docked btn-docked"; + + if(kommonitorDataExchangeService.anySideBarIsShown === false){ + $rootScope.$broadcast("recenterMapOnShowSideBar"); + } + kommonitorDataExchangeService.anySideBarIsShown = true; + } + else{ + $scope.sidebarReachabilityClass = "disappear"; + $rootScope.$broadcast("recenterMapOnHideSideBar"); + kommonitorDataExchangeService.anySideBarIsShown = false; + } + + $rootScope.$broadcast("refreshIndicatorValueRangeSlider"); + $rootScope.$broadcast("redrawGuidedTourElement"); + + } + + $scope.onSidebarDiagramsClick = function(){ + $scope.undockButtons(); + if($scope.sidebarDiagramsClass === "disappear"){ + $scope.hideSidebars(); + $scope.sidebarDiagramsClass = ""; + $scope.buttonDiagramsClass = "btn btn-custom-docked btn-docked"; + if(kommonitorDataExchangeService.anySideBarIsShown === false){ + $rootScope.$broadcast("recenterMapOnShowSideBar"); + } + kommonitorDataExchangeService.anySideBarIsShown = true; + $rootScope.$broadcast("resizeDiagrams"); + } + else{ + $scope.sidebarDiagramsClass = "disappear"; + $rootScope.$broadcast("recenterMapOnHideSideBar"); + kommonitorDataExchangeService.anySideBarIsShown = false; + } + + $rootScope.$broadcast("refreshIndicatorValueRangeSlider"); + $rootScope.$broadcast("redrawGuidedTourElement"); + } + + $scope.onSidebarRadarDiagramClick = function(){ + $scope.undockButtons(); + if($scope.sidebarRadarDiagramClass === "disappear"){ + $scope.hideSidebars(); + $scope.sidebarRadarDiagramClass = ""; + $scope.buttonRadarDiagramClass = "btn btn-custom-docked btn-docked"; + if(kommonitorDataExchangeService.anySideBarIsShown === false){ + $rootScope.$broadcast("recenterMapOnShowSideBar"); + } + kommonitorDataExchangeService.anySideBarIsShown = true; + $rootScope.$broadcast("resizeDiagrams"); + } + else{ + $scope.sidebarRadarDiagramClass = "disappear"; + $rootScope.$broadcast("recenterMapOnHideSideBar"); + kommonitorDataExchangeService.anySideBarIsShown = false; + } + + $rootScope.$broadcast("refreshIndicatorValueRangeSlider"); + $rootScope.$broadcast("redrawGuidedTourElement"); + } + + $scope.onSidebarProcessingClick = function(){ + $scope.undockButtons(); + if($scope.sidebarProcessingClass === "disappear"){ + $scope.hideSidebars(); + $scope.sidebarProcessingClass = ""; + $scope.buttonProcessingClass = "btn btn-custom-docked btn-docked"; + if(kommonitorDataExchangeService.anySideBarIsShown === false){ + $rootScope.$broadcast("recenterMapOnShowSideBar"); + } + kommonitorDataExchangeService.anySideBarIsShown = true; + } + else{ + $scope.sidebarProcessingClass = "disappear"; + $rootScope.$broadcast("recenterMapOnHideSideBar"); + kommonitorDataExchangeService.anySideBarIsShown = false; + } + + $rootScope.$broadcast("refreshIndicatorValueRangeSlider"); + $rootScope.$broadcast("redrawGuidedTourElement"); + } + + $scope.onSidebarRegressionDiagramClick = function(){ + $scope.undockButtons(); + if($scope.sidebarRegressionDiagramClass === "disappear"){ + $scope.hideSidebars(); + $scope.sidebarRegressionDiagramClass = ""; + $scope.buttonRegressionDiagramClass = "btn btn-custom-docked btn-docked"; + if(kommonitorDataExchangeService.anySideBarIsShown === false){ + $rootScope.$broadcast("recenterMapOnShowSideBar"); + } + kommonitorDataExchangeService.anySideBarIsShown = true; + $rootScope.$broadcast("resizeDiagrams"); + } + else{ + $scope.sidebarRegressionDiagramClass = "disappear"; + $rootScope.$broadcast("recenterMapOnHideSideBar"); + kommonitorDataExchangeService.anySideBarIsShown = false; + } + + $rootScope.$broadcast("refreshIndicatorValueRangeSlider"); + $rootScope.$broadcast("redrawGuidedTourElement"); + } + + $scope.onSidebarLegendButtonClick = function(){ + + if($scope.sidebarLegendClass === "disappear"){ + $scope.hideSidebars(); + $scope.sidebarLegendClass = ""; + $scope.buttonLegendClass = "btn btn-custom-docked-right btn-docked-right"; + } + else{ + $scope.sidebarLegendClass = "disappear"; + $scope.buttonLegendClass = "btn btn-custom-right btn-circle-right"; + } + + $rootScope.$broadcast("invalidateMapSize"); + $rootScope.$broadcast("refreshIndicatorValueRangeSlider"); + }; + + $scope.onRecenterMapButtonClick = function(){ + $rootScope.$broadcast("recenterMapContent"); + } + + $scope.onExportMapButtonClick = function(){ + $rootScope.$broadcast("exportMap"); + } + + $scope.onUnselectFeaturesButtonClick = function(){ + $rootScope.$broadcast("unselectAllFeatures"); + } + + $scope.onToggleInfoControlButtonClick = function(){ + $rootScope.$broadcast("toggleInfoControl"); + } + + $scope.onToggleLegendControlButtonClick = function(){ + $rootScope.$broadcast("toggleLegendControl"); + } + + $scope.$on("startGuidedTour", function(event){ + $scope.startGuidedTour(); + }); + + $scope.tourOptions = { + container: "body", + backdrop: true, + backdropContainer: "body", + smartPlacement: false, + onEnd: function(tour){ + kommonitorDataExchangeService.guidedTour = undefined; + }, + template: "

      ", + steps: [ + { + element:"#map", + title: "Willkommen zur Guided Tour von KomMonitor", + placement: "left", + content: "In dieser Tour werden die Funktionalitäten der Weboberfläche erläutert. Hier werden sie mit den Elementen der Oberfläche sowie den verschiedenen Buttons vertraut gemacht. " + + "
      Die Tour kann jederzeit über den Button Guided Tour beenden verlassen werden. ", + onNext: function(tour){ + if($scope.sidebarLegendClass !== "disappear"){ + $("#sidebarLegendCollapse").click(); + } + } + }, + { + element: "#map", + title: "Inhaltsverzeichnis", + placement: "top", + content: "
        ", + onNext: function(tour){ + if($scope.sidebarLegendClass !== "disappear"){ + $("#sidebarLegendCollapse").click(); + } + }, + onShown: function(tour) { + $scope.generateTableOfContent(); + } + }, + { + element: "#header", + title: "Kopfzeile", + placement: "bottom", + content: "In der Kopfzeile befinden sich neben den Logos und dem Titel der Webanwendung mehrere Buttons.
        " + + "Mit kann zwischen einer vereinfachten und einer erweiterten Ansicht gewechselt werden.
        " + + "Diese Guided Tour kann stets erneut mit aufgerufen werden. " + + " öffnet das beim Aufruf der Seite erschienene Informationsfenster und
        " + + " ermöglicht mit entsprechenden Zugangsdaten den Zugang zur Administrationsoberfläche." + }, + { + element: "#map", + title: "Kartenfenster", + placement: "top", + content: "Die Standardansicht besteht aus einer kartografischen Darstellung, die bereits eine Hintergrundkarte und einen Indikator anzeigt. In dieser Darstellung können Sie in der " + + "Karte frei navigieren (zoomen, verschieben) und beim Herüberfahren mit dem Mauszeiger über eine der Raumeinheiten werden der Name, der Wert und die Einheit des dargestellten Indikators angezeigt.", + // onNext: function(tour){ + // // make sure that legend control is displayed + + // var control = document.getElementById("legendControl"); + // var controlButton = document.getElementById("toggleLegendControlButton"); + // if(control.style.display === "none" || (controlButton.style.display !== undefined && controlButton.style.display !== "none")){ + // $rootScope.$broadcast("toggleLegendControl"); + // } + + // }, + onNext: function(tour){ + if($scope.sidebarLegendClass === "disappear"){ + $("#sidebarLegendCollapse").click(); + } + } + }, + { + element: "#kommonitorLegend", + title: "Indikatorenlegende und Klassifizierung", + placement: "left", + content: "Dieses Element ist in drei Teilbereiche untergliedert, welche
        1. die wichtigsten Metadaten des dargestellten Indikator abbilden,
        " + + "2. Kartenlegenden zur Interpretation der Karteninhalte anbieten und
        3. weitergehende Möglichkeiten zur Klassifizierung bieten.", + onNext: function(tour){ + if($scope.sidebarLegendClass !== "disappear"){ + $("#legendSymbologyCollapse").click(); + } + }, + onPrev: function(tour){ + if($scope.sidebarLegendClass !== "disappear"){ + $("#sidebarLegendCollapse").click(); + } + } + }, + { + element: "#kommonitorIndicatorBasicMetadata", + title: "Indikator-Metadaten, Einstellung- und Exportmöglichkeiten", + placement: "left", + content: "Im oberen Bereich sind der Name eine kurze Beschreibung sowie das Fortführungsintervall des angezeigten Indikators zu finden.
        " + + "Im mittleren Bereich kann die angezeigte Raumebene per Dropdown-Liste gewechselt, der Zeitpunkt per Kalenderauswahl gewählt sowie
        " + + "die Transparenz der Kartendarstellung per Schieberegler angepasst werden.
        " + + "Der untere Bereich bietet Exportmöglichkeiten für die angezeigten Daten in den Formaten GeoJSON, ESRI Shapefile sowie CSV.
        " + + "Zudem kann ein Metadatenblatt aller Metadaten des dargestellten Indikators als PDF-Datei heruntergeladen werden.", + onNext: function(tour){ + if($scope.sidebarLegendClass !== "disappear"){ + $("#indicatorBasicMetadataCollapse").click(); + $("#legendSymbologyCollapse").click(); + } + }, + onPrev: function(tour){ + if($scope.sidebarLegendClass !== "disappear"){ + $("#legendSymbologyCollapse").click(); + } + } + }, + { + element: "#kommonitorLegendSymbology", + title: "Kartenlegenden und Interpretation", + placement: "left", + content: "Dieser Bereich beinhaltet eine Farblegende mit fünf Klassen für den angezeigten Indikator sowie die Wertebereiche und Fallzahlen je Klasse
        " + + "Als ergänzende Informationen werden der Indikatortyp, der Stichtag, die Einheit sowie eine kurze Interpretationshilfe angezeigt.
        " + + "Die einzelnen Reiter ganz oben ermöglichen den Wechsel zwischen verschiedenen Legenden, sofern zusätzlich zu einem Indikator
        " + + "auch die Legende für berechnete Isochronen, ein Routingergebnis oder einen eingebundenen WMS-Dienst angezeigt werden sollen.", + onNext: function(tour){ + if($scope.sidebarLegendClass !== "disappear"){ + $("#legendSymbologyCollapse").click(); + $("#indicatorClassificationCollapse").click(); + } + }, + onPrev: function(tour){ + if($scope.sidebarLegendClass !== "disappear"){ + $("#legendSymbologyCollapse").click(); + $("#indicatorBasicMetadataCollapse").click(); + } + } + }, + { + element: "#kommonitorIndicatorClassification", + title: "Klassifikationsoptionen", + placement: "left", + content: "Hier kann zwischen den drei Klassifizierungsmethoden Jenks, Gleiches Intervall und Quantile gewählt werden
        " + + "
        Detaillierte Informationen zu den Klassifizierungsmethoden können dem Popup entnommen werden, das beim Herüberfahren mit dem Mauszeiger über eine der drei Optionen erscheint. " + + "
        Zudem lässt sich per einstellen, ob die Klassifizierung die Indikatorenwerte der gesamten Zeitreihe berücksichtigen soll, oder nur jene des aktuellen Zeitschnitts.
        " + + "So kann ein vergleichbares Kartenbild für eine komplette Zeitreihe gewährleistet werden.
        " + + "
        KomMonitor überprüft jeden Indikatorendatensatz auf statistische Ausreißer. Werden ein oder mehrere Ausreißer erkannt, so können mit " + + "Ausreißer gesondert markiert und
        aus der Klassifizierung entfernt werden
        . Dies kann hilfreich sein, " + + "um ein differenzierteres Kartenbild zu erzeugen.", + onNext: function(tour){ + if($scope.sidebarLegendClass !== "disappear"){ + $("#sidebarLegendCollapse").click(); + } + }, + onPrev: function(tour){ + if($scope.sidebarLegendClass !== "disappear"){ + $("#legendSymbologyCollapse").click(); + $("#indicatorClassificationCollapse").click(); + } + } + }, + { + element: "#dateSliderWrapper", + title: "Zeitstrahl", + placement: "top", + content: "Die Zeitleiste am unteren Bildschirmrand enthält die verfügbaren Zeitschnitte des selektierten Indikators. Standardmäßig ist der aktuellste Zeitschnitt voreingestellt. "+ + "
        Durch ein Klicken auf einen beliebigen Punkt der Leiste oder durch Verschieben des runden Auswahlknopfs kann ein anderer Zeitschnitt gewählt werden.", + onPrev: function(tour){ + if($scope.sidebarLegendClass === "disappear"){ + $("#sidebarLegendCollapse").click(); + } + } + }, + { + element: "#mapUtilButtons", + title: "Steuerung der Kartendarstellung", + placement: "bottom", + content: "Diese Buttons bieten Steuerungsmöglichkeiten für die Kartendarstellung. Über und kann alternativ zur Verwendung des Mausrades hinein- bzw. hinausgezoomt werden. "+ + "

        zentriert die Karte und zoomt auf die maximale Ausdehnung des dargestellten Themas. " + + "

        hebt jegliche benutzerdefinierte Selektionen auf. " + + "

        erlaubt den Export des aktuellen Kartenausschnitts als Bilddatei. " + + "

        bietet die Möglichkeit, einzelne Karteninhalte temporär auszublenden oder die Hintergrundkarte zu wechseln. " + + "

        ermöglicht das Filtern innerhalb dargestellter Vektorlayer anhand des Namens oder der ID vorhandener Raumelemente. " + + "

        repräsentiert eine Geolokalisierung von Adressen und Orten. " + + "

        Darüber hinaus bietet eine Messfunktion für Abstände und Flächen." + }, + { + element: "#sideBarButtons", + title: "Menü-Buttons", + placement: "right", + content: "Diese Buttons öffnen jeweils ein linksseitig angeordnetets Menü mitzusätzlichen Funktionen. Jedes einzelne Menü wird in den folgenden Schritten kurz erläutert." + }, + { + element: "#sidebarIndicatorConfigCollapse", + title: "Indikatorenkatalog und Metadaten", + placement: "right", + content: "Ein Klick auf diesen Button öffnet das Indikatoren-Auswahl-Fenster.

        Im nächsten Schritt wird das Menü automatisch geöffnet.", + onNext: function(tour){ + if($scope.sidebarIndicatorConfigClass === "disappear"){ + $("#sidebarIndicatorConfigCollapse").click(); + } + } + }, + { + element: "#indicatorSetup", + title: "Indikatorenkatalog und Metadaten", + placement: "right", + content: "Dieses Menü enthält eine Übersicht aller verfügbarer Indikatoren sowie die Option, " + + "den aktuell betrachteten Indikator zu wechseln.

        Indikatoren können in Form einer Themenhierarchie im Datenkatalog oder in einer " + + "alphabetischen Liste betrachtet und selektiert werden.
        " + + "Einen transparenten Zugang zu zusammenschauenden, bewertenden Indikatoren bietet die Leitindikatoren-Hierarchie.
        " + + "Hiermit können Leitindikatoren sowie die zur Berechnung verwendeten Basis-Indikatoren aufgerufen und deren Verknüpfung nachvollzogen werden.
        " + + "Auch die Metadaten des ausgewählten Indikators können hier detailliert eingesehen werden.", + onNext: function(tour){ + if($scope.sidebarIndicatorConfigClass !== "disappear"){ + $("#sidebarIndicatorConfigCollapse").click(); + } + }, + onPrev: function(tour){ + if($scope.sidebarIndicatorConfigClass !== "disappear"){ + $("#sidebarIndicatorConfigCollapse").click(); + } + } + }, + { + element: "#sidebarPoiCollapse", + title: "Georessourcen und -dienste", + placement: "right", + content: "Ein Klick auf diesen Button öffnet das Georessourcen Fenster.

        Im nächsten Schritt wird das Menü automatisch geöffnet.", + onNext: function(tour){ + if($scope.sidebarPoiClass === "disappear"){ + $("#sidebarPoiCollapse").click(); + } + }, + onPrev: function(tour){ + if($scope.sidebarIndicatorConfigClass === "disappear"){ + $("#sidebarIndicatorConfigCollapse").click(); + } + } + }, + { + element: "#poi", + title: "Georessourcen und -dienste", + placement: "right", + content: "Zur Überlagerung von flächenhaft dargestellten Indikatoren mit weiteren relevanten Geodaten können Punkt- Linien und Flächendaten sowie Geodatendienste " + + "zur Karte hinzugefügt werden. Hinzufügen und Entfernen dieser Datensätze geschieht dabei durch (De-) Selektion der Auswahlbox links neben dem jeweiligen Datensatz. " + + "

        In der Standardkonfiguration werden Punktdaten räumlich zu sogenannten Cluster-Punkten zusammengefasst, um die Darstellung je nach Zoom-Stufe zu optimieren und
        " + + "selbst bei bei vielen Punkten eine übersichtliche Darstellung zu gewährleisten." + + "Über eine entsprechende Auswahloption können jedoch bei jeder Zoomstufe wahlweise auch alle Einzelpunkte angezeigt werden. " + + "

        Hinweis zum Zeitbezug der darzustellenden Daten:
        Der Abruf eines Punkt-, Linien- oder Flächendatensatzes bezieht sich immer auf ein Datum. " + + "Standardmäßig wird der aktuelle Zeitpunkt des dargestellten Indikators verwendet. Diese Option kann jedoch auf ein beliebiges frei definierbares Datum oder eine " + + "listenbasierte Auswahl verfügbarer Zeitpunkte jedes Datensatzes abgeändert werden.", + onNext: function(tour){ + if($scope.sidebarPoiClass !== "disappear"){ + $("#sidebarPoiCollapse").click(); + } + }, + onPrev: function(tour){ + if($scope.sidebarPoiClass !== "disappear"){ + $("#sidebarPoiCollapse").click(); + } + } + }, + // { + // element: "#sidebarDataImportCollapse", + // title: "Datenimport aus externen Quellen", + // placement: "right", + // content: "Ein Klick auf diesen Button öffnet das Datenimport Fenster.

        Im nächsten Schritt wird das Menü automatisch geöffnet.", + // onNext: function(tour){ + // if($scope.sidebarDataImportClass === "disappear"){ + // $("#sidebarDataImportCollapse").click(); + // } + // } + // }, + // { + // element: "#dataImport", + // title: "Datenimport aus externen Quellen", + // placement: "right", + // content: "Dieses Fenster bietet Optionen zum Datenimport aus externen Datenquellen, insbesondere mittels Web Map Services und Datei-basierten Quellen wie GeoJSON oder ESRI Shape.

        Jeder WMS-Datensatz wird tabellarisch inklusive Titel, Beschreibung, Transparenzschieberegler, URL und Legende dargestellt. Durch Anhaken/Deselektion der Checkbox kann ein Datensatz hinzugefügt/entfernt werden. Neben den bereits vorkonfigurierten Datensätzen lassen sich weitere Quellen über den unten stehenden Button ergänzen.

        Die Möglichkeit Layer aus einer lokalen Datei einzuladen wird in Kürze verfügbar sein.", + // onNext: function(tour){ + // if($scope.sidebarDataImportClass !== "disappear"){ + // $("#sidebarDataImportCollapse").click(); + // } + // }, + // onPrev: function(tour){ + // if($scope.sidebarDataImportClass !== "disappear"){ + // $("#sidebarDataImportCollapse").click(); + // } + // } + // }, + { + element: "#sidebarFilterCollapse", + title: "Darstellungsfilter", + placement: "right", + content: "Ein Klick auf diesen Button öffnet ein Fenster zur Definition von Darstellungsfiltern.

        Im nächsten Schritt wird das Menü automatisch geöffnet.", + onNext: function(tour){ + if($scope.sidebarFilterClass === "disappear"){ + $("#sidebarFilterCollapse").click(); + } + }, + onPrev: function(tour){ + if($scope.sidebarPoiClass === "disappear"){ + $("#sidebarPoiCollapse").click(); + } + } + }, + { + element: "#kommonitorFilter", + title: "Darstellungsfilter", + placement: "right", + //

        Darüber hinaus können je nach Fragestellung die Raumebenen-Geometrien (z.B. Stadtteile) auf diejenigen eingeschränkt werden, die zur Beantwortung der Fragestellung beitragen. + content: "Hier können verschiedene Darstellungsfilter angewendet werden, die sich auf die kartografische Darstellung auswirken. " + + "Über den Wertebereichsfilter können die angezeigten Raumeinheiten anhand der Wertausprägung des angezeigten Indikators gefiltert werden. " + + "Dazu kann der Schieberegler an dem minimalen und maximalen Werten nach rechts oder links geschoben werden. Alternativ kann die untere und/oder obere Grenze " + + "auch als Zahlenwert eingetragen werden.
        " + + "
        Eine weitere Option ist die dynamische Schwellenwertklassifizierung, bei der ein spezifischer Wert definiert werden kann, " + + "der die Indikator-Darstellung in zwei Bereiche unterteilt (oberhalb und unterhalb des Schwellenwerts) und entsprechend farbig darstellt.", + onNext: function(tour){ + if($scope.sidebarFilterClass !== "disappear"){ + $("#sidebarFilterCollapse").click(); + } + }, + onPrev: function(tour){ + if($scope.sidebarFilterClass !== "disappear"){ + $("#sidebarFilterCollapse").click(); + } + } + }, + { + element: "#sidebarBalanceCollapse", + title: "Zeitliche Bilanzierung", + placement: "right", + content: "Ein Klick auf diesen Button öffnet ein Fenster zur zeitlichen Bilanzierung des aktuell dargestellten Indikators. " + + "

        Im nächsten Schritt wird das Menü automatisch geöffnet.", + onNext: function(tour){ + if($scope.sidebarBalanceClass === "disappear"){ + $("#sidebarBalanceCollapse").click(); + } + }, + onPrev: function(tour){ + if($scope.sidebarFilterClass === "disappear"){ + $("#sidebarFilterCollapse").click(); + } + } + }, + { + element: "#kommonitorBalance", + title: "Zeitliche Bilanzierung", + placement: "right", + content: "Bei der zeitlichen Bilanzierung steht die Wertentwicklung eines Indikators über die Zeit im Fokus (z. B. Wachstum / Schrumpfung). " + + "Wird die Bilanzierung anhand der Auswahlbox aktiviert, kann über die Zeitleiste ein Start- sowie ein Endzeitpunkt festgelegt werden.
        " + + "Für diesen spezifizifischen Betrachtungszeitraum wird dann automatisch die Wertentwicklung des angezeigten Indikators berechnet und dargestellt. " + + "

        Auch die Indikatoren-Legende am rechten Rand der Anwendung beinhaltet dann die Information, dass eine Bilanz des Indikators dargestellt wird. " + + "

        Der Trendverlauf im Betrachtungszeitraumwird zudem in Form eines Liniendiagrammes visualisiert. " + + "
        Zur Trendberechnung kann in KomMonitor zwischen einer linearen, exponentiellen und polynomialen Herleitung gewählt werden. " + + "
        Des Weiteren sind statistische Merkmale der gewählten Trendbetrachtung hinterlegt. Hierzu zählen beispielsweise Standardabweichung, Varianz, Mittelwert und Median sowie " + + "die Art des Trendverlaufes. " + + "

        Bitte beachten Sie, dass eine Bilanzierung nur bei Status-Indikatoren möglich ist, " + + "deren Zeitreihe mehr als einen Zeitpunkt enthält.", + onNext: function(tour){ + if($scope.sidebarBalanceClass !== "disappear"){ + $("#sidebarBalanceCollapse").click(); + } + }, + onPrev: function(tour){ + if($scope.sidebarBalanceClass !== "disappear"){ + $("#sidebarBalanceCollapse").click(); + } + } + }, + { + element: "#sidebarDiagramsCollapse", + title: "Statistische Diagramme", + placement: "right", + content: "Ein Klick auf diesen Button öffnet ein Fenster mit statistischen Diagrammen. " + + "

        Im nächsten Schritt wird das Menü automatisch geöffnet.", + onNext: function(tour){ + if($scope.sidebarDiagramsClass === "disappear"){ + $("#sidebarDiagramsCollapse").click(); + } + }, + onPrev: function(tour){ + if($scope.sidebarBalanceClass === "disappear"){ + $("#sidebarBalanceCollapse").click(); + } + } + }, + { + element: "#indicatorDiagrams", + title: "Statistische Diagramme", + placement: "right", + content: "Zusätzlich zur kartografischen Darstellung bieten grundlegende statistische Diagramme hilfreiche Zusatzinformationen zum gewählten Indikator. " + + "

        Ein Ranking der jeweiligen Raumeinheiten wird anhand eines Säulendiagramms dargestellt. " + + "

        Das untere Liniendiagramm visualisiert die zeitliche Entwicklung des aktuellen Indikators über alle jeweils verfügbaren Zeitschnitte. " + + "Als Zusatzinformation wird hier der Durchschnittswert über alle Raumeinheiten dargestellt. " + + "

        Um einzelne Elemente der gewählten Raumebene im Säulen- und Liniendiagramm zu betrachten und hervorzuheben, " + + "kann mit dem Mauszeiger entweder über die Säule innerhalb des Säulendiagramms oder über das jeweilige Element in der Karte gefahren werden. " + + "Eine dauerhafte Selektion durch Klicken auf das kartografische Element oder die dazugehörige Säule ermöglicht das simultane Betrachten mehrerer Elemente. " + + "

        Jedes Diagramm enthält in der oberen rechte Ecke eine Toolbox, über die das Diagramm entweder als Bilddatei oder im Tabellenformat exportiert werden kann.", + onNext: function(tour){ + if($scope.sidebarDiagramsClass !== "disappear"){ + $("#sidebarDiagramsCollapse").click(); + } + }, + onPrev: function(tour){ + if($scope.sidebarDiagramsClass !== "disappear"){ + $("#sidebarDiagramsCollapse").click(); + } + } + }, + { + element: "#sidebarRadarDiagramCollapse", + title: "Indikatorenradar", + placement: "right", + content: "Ein Klick auf diesen Button öffnet das Indiktorenradar für die Querschnittsbetrachtung mehrerer Indikatoren.

        Im nächsten Schritt wird das Menü automatisch geöffnet.", + onNext: function(tour){ + if($scope.sidebarRadarDiagramClass === "disappear"){ + $("#sidebarRadarDiagramCollapse").click(); + } + }, + onPrev: function(tour){ + if($scope.sidebarDiagramsClass === "disappear"){ + $("#sidebarDiagramsCollapse").click(); + } + } + }, + { + element: "#indicatorRadar", + title: "Indikatorenradar", + placement: "right", + content: "Das Indikatorenradar eignet sich insbesondere für die querschnittsorientierte Betrachtung mehrerer Indikatoren. " + + "
        Für die Anzeige eines solchen Diagramms, selektieren Sie bitte mindestens drei Indikatoren aus der oben stehenden Liste.

        " + + "Für jeden gewählten Indikator wird im Diagramm eine Achse genutzt, auf der einzelne Raumeinheiten anhand ihrer Wertausprägung abgetragen werden. " + + "Jede Achse wird dabei durch Minimum und Maximum der Werte des betrachteten Indikators gebildet (daher ist die Radarmitte ausdrücklich nicht zwingend " + + "mit dem Wert '0' gleichzusetzen, sondern mit dem Minimalwert des Indikators).

        Auch hier ist der Durchschnitt aller Raumeinheiten bereits vorberechnet und " + + "einzelne Elemente können mittels Selektion innerhalb der Karte dem Radar hinzugefügt werden. Die Indikatorenauswahl umfasst dabei nur solche Indikatoren, " + + "die die gewählte Raumebene und den aktuell gewählten Zeitschnitt unterstützen.

        Auch das Radardiagramm besitzt in der oberen rechte Ecke eine " + + "Toolbox, über die das Diagramm entweder als Bilddatei oder im Tabellenformat exportiert werden kann", + onNext: function(tour){ + if($scope.sidebarRadarDiagramClass !== "disappear"){ + $("#sidebarRadarDiagramCollapse").click(); + } + }, + onPrev: function(tour){ + if($scope.sidebarRadarDiagramClass !== "disappear"){ + $("#sidebarRadarDiagramCollapse").click(); + } + } + }, + { + element: "#sidebarRegressionDiagramCollapse", + title: "Regressionsdiagramm", + placement: "right", + content: "Ein Klick auf diesen Button öffnet das Fenster zur Definition von Regressionsdiagrammen.

        Im nächsten Schritt wird das Menü automatisch geöffnet.", + onNext: function(tour){ + if($scope.sidebarRegressionDiagramClass === "disappear"){ + $("#sidebarRegressionDiagramCollapse").click(); + } + }, + onPrev: function(tour){ + if($scope.sidebarRadarDiagramClass === "disappear"){ + $("#sidebarRadarDiagramCollapse").click(); + } + } + }, + { + element: "#indicatorRegression", + title: "Regressionsdiagramm", + placement: "right", + content: "Als exemplarischer weiterer Diagrammtyp unterstützt KomMonitor die Berechnung einer linearen Regression zwischen zwei zu wählenden Indikatoren, um insbesondere die Korrelation zwischen diesen zu betrachten. Nach Auswahl der Indikatoren werden die Regressionsgerade und alle Elemente der gewählten Raumebene gemäß ihrer Wertausprägungen entlang der Indikatorenachsen im Diagramm abgetragen.

        Beim Überfahren eines Datenpunkts mit der Maus im Diagramm oder einer in der Karte dargestellten Raumeinheit, wird das jeweilige Pendant visuell hervorgehoben.

        Die Indikatorenauswahl umfasst dabei nur solche Indikatoren, die die gewählte Raumebene und den aktuell gewählten Zeitschnitt unterstützen.

        Auch das Regressionsdiagramm besitzt in der oberen rechte Ecke eine Toolbox, über die das Diagramm entweder als Bilddatei oder im Tabellenformat exportiert werden kann.", + onNext: function(tour){ + if($scope.sidebarRegressionDiagramClass !== "disappear"){ + $("#sidebarRegressionDiagramCollapse").click(); + } + }, + onPrev: function(tour){ + if($scope.sidebarRegressionDiagramClass !== "disappear"){ + $("#sidebarRegressionDiagramCollapse").click(); + } + } + }, + { + element: "#sidebarReachabilityCollapse", + title: "Erreichbarkeitsanalysen", + placement: "right", + content: "Ein Klick auf diesen Button öffnet ein Fenster für Erreichbarkeitsanalysen.

        Im nächsten Schritt wird das Menü automatisch geöffnet.", + onNext: function(tour){ + if($scope.sidebarReachabilityClass === "disappear"){ + $("#sidebarReachabilityCollapse").click(); + } + }, + onPrev: function(tour){ + if($scope.sidebarRegressionDiagramClass === "disappear"){ + $("#sidebarRegressionDiagramCollapse").click(); + } + } + }, + { + element: "#kommonitorReachability", + title: "Erreichbarkeitsanalysen", + placement: "right", + content: "Als GIS-basiertes Werkzeug soll KomMonitor ausgewählte räumliche Analysen unterstützen. " + + "Insbesondere stehen Erreichbarkeitsanalysen im Fokus, bei denen, neben reinen Puffer-basierten Ansätzen, " + + "Erreichbarkeiten anhand tatsächlicher Wegenetze für verschiedene Transportmittel (z.B. Fußgänger, Fahrrad, Auto) "+ + "berechnet werden können. Konkret soll hierbei sowohl ein Routing zwischen einzelnen Punkten sowie " + + "die Berechnung von Isochronen (Äquidistanzen und zeitliches Abbruchkriterium) angeboten werden.

        " + + "Auswahl der Startpunkte
        " + + "Die Auswahl der Startpunkte kann entweder über die Selektion eines vorhandenen Punktdatensatzes vorgenommen werden oder mittels Einzeichnen eigener beliebiger Punkte in die Karte.

        " + + "Ergebnisdarstellung
        " + + "Sowohl Isochronen- als auch Routingergebnisse werden der Karte als neuer, eigener Layer hinzugefügt. " + + "Die jeweilige Legende über jeweiligen Reiter des rechten Legendenmenüs einsehbar.

        "+ + "Punkt in Isochronen Analyse
        " + + "Nachdem eine Isochronenberechnung erfolgt ist, können vorhandene Punktdatensätze räumlich mit den Isochronen verschnitten werden, bspw. um eine Umfeldanalyse für relevante Einrichtungen durchzuführen.", + onNext: function(tour){ + if($scope.sidebarReachabilityClass !== "disappear"){ + $("#sidebarReachabilityCollapse").click(); + } + }, + onPrev: function(tour){ + if($scope.sidebarReachabilityClass !== "disappear"){ + $("#sidebarReachabilityCollapse").click(); + } + } + }, + { + element: "#map", + title: "Vielen Dank für die Nutzung der Guided Tour von KomMonitor!", + placement: "left", + content: "Wir hoffen, die Erläuterungen konnten einen guten Einblick in die Funktionen bieten, " + + "bei der ersten Orientierung helfen und die zukünftige Nutzung erleichtern!

        " + + "Kritik, Anregungen oder Fragen sind jederzeit willkommen.
        (siehe Begrüßungsfenster für den Kontakt).

        " + + "Viel Spaß bei der Nutzung von KomMonitor! ", + onNext: function(tour){ + kommonitorDataExchangeService.guidedTour = undefined; // ends the tour + } + } + // { + // element: "#sidebarProcessingCollapse", + // title: "Individuelle Indikatoren-Neuberechnung", + // placement: "right", + // content: "Ein Klick auf diesen Button öffnet ein Fenster zur individuellen Neuberechnung einzelner Indikatoren.

        Im nächsten Schritt wird das Menü automatisch geöffnet.", + // onNext: function(tour){ + // if($scope.sidebarProcessingClass === "disappear"){ + // $("#sidebarProcessingCollapse").click(); + // } + // }, + // onPrev: function(tour){ + // if($scope.sidebarReachabilityClass === "disappear"){ + // $("#sidebarReachabilityCollapse").click(); + // } + // } + // }, + // { + // element: "#indicatorProcessing", + // title: "Individuelle Indikatoren-Neuberechnung", + // placement: "right", + // content: "KomMonitor ist mehr als nur ein Darstellungswerkzeug. Es ermöglicht insbesondere auch die automatisierte Berechnung von Indikatoren. Je nach Berechnungsvorschrift kann es dabei konfigurierbare Parameter geben, die die resultierenden Indikatorenwerte beeinflussen (bspw. eine maximle Distanz bei Erreichbarkeiten oder Gewichtungen grundlegender Eingangsdaten).

        Dieses Menü bietet die Möglichkeit einer Nutzer-definierten Neuberechnung von Indikatoren mit mindestens einem konfigurierbaren Parameter. Das jeweilige Berechnungsergebnis steht anschließend temporär zur Verfügung und kann bei Bedarf exportiert werden.

        Künftig sollen darüber hinaus unmittelbare Vergleiche mit der 'Standard'-Variante des Indikators angeboten werden. Diese sind jedoch zum gegenwärtigen Zeitpunkt noch nicht in der Anwendung umgesetzt.", + // onNext: function(tour){ + // if($scope.sidebarProcessingClass !== "disappear"){ + // $("#sidebarProcessingCollapse").click(); + // } + // }, + // onPrev: function(tour){ + // if($scope.sidebarProcessingClass !== "disappear"){ + // $("#sidebarProcessingCollapse").click(); + // } + // } + // } + ], + onShown: function(tour) { + // add shortcut to toc to each title + let titleElement = document.getElementsByClassName("popover-title").item(0); + titleElement.innerHTML += + "" + + ""; + $compile(titleElement)($scope); // let angularjs know that there is new html, add the ng-click event + } + }; + + $scope.generateTableOfContent = function() { + let prevStepTitle = undefined; + for(var i=0;i<$scope.tourOptions.steps.length;i++) { + let step = $scope.tourOptions.steps[i]; + // only show the first guided tour step for each subtheme + // specifically exclude "Individuelle Indikatoren-Neuberechnung" for now as it is not shown in the guided tour + if (step.title !== prevStepTitle && step.title !== "Individuelle Indikatoren-Neuberechnung") { + let html = "
      1. " + step.title + "
      2. "; + let compiled = $compile(html)($scope); // let angularjs know that there is new html, add the ng-click event + angular.element(document.getElementById('guided-tour-toc')).append(compiled); + } + prevStepTitle = step.title; + } + }; + + $scope.goToGuidedTourStep = function(tour, targetStepIndex) { + // The method "goTo" provided by the library jumps directly to the target step, ignoring the "onNext" and "onPrev" methods. + // That leads to menues not being opened/closed. To fix this we iterate the steps manually. + while(tour.getCurrentStep() < targetStepIndex) + tour.next(); + while(tour.getCurrentStep() > targetStepIndex) + tour.prev(); + }; + + $scope.startGuidedTour = function(){ + // GUIDED TOUR + // Instance the tour + kommonitorDataExchangeService.guidedTour = new Tour($scope.tourOptions); + + // Initialize the tour + kommonitorDataExchangeService.guidedTour.init(); + // Start the tour + try{ + kommonitorDataExchangeService.guidedTour.restart(); + } + catch(error){ + kommonitorDataExchangeService.guidedTour.start(true); + } + + // tour gotTo() example to jump to step 7 --> index starts from 0 + // kommonitorDataExchangeService.guidedTour.goTo(6); + + }; + + $scope.$on("redrawGuidedTourElement", async function(event){ + + await sleep(100); + + if(kommonitorDataExchangeService.guidedTour){ + kommonitorDataExchangeService.guidedTour.redraw(); + } + }); + + $scope.init(); + + } +]}); diff --git a/app/components/kommonitorUserInterface/kommonitor-user-interface.module.js b/app/components/kommonitorUserInterface/kommonitor-user-interface.module.js index 3f277716e..310280377 100644 --- a/app/components/kommonitorUserInterface/kommonitor-user-interface.module.js +++ b/app/components/kommonitorUserInterface/kommonitor-user-interface.module.js @@ -1,4 +1,6 @@ +"use strict"; angular.module('kommonitorUserInterface', ['kommonitorMap', 'kommonitorDataSetup', 'kommonitorAdmin', - 'kommonitorIndividualIndicatorComputation', 'kommonitorDiagrams', 'indicatorRadar', 'regressionDiagram', 'kommonitorFilter', 'kommonitorBalance', - 'kommonitorReachability', 'poi', 'infoModal', 'spatialUnitNotificationModal', 'feedbackModal', 'reportingModal', 'wmsModal', 'wfsModal', 'kommonitorDataImport', - 'kommonitorLegend', 'kommonitorElementVisibilityHelper', 'kommonitorShareHelper']); + 'kommonitorIndividualIndicatorComputation', 'kommonitorDiagrams', 'indicatorRadar', 'regressionDiagram', 'kommonitorFilter', 'kommonitorBalance', + 'kommonitorReachability', 'poi', 'infoModal', 'spatialUnitNotificationModal', 'feedbackModal', 'reportingModal', 'wmsModal', 'wfsModal', 'kommonitorDataImport', + 'kommonitorLegend', 'kommonitorElementVisibilityHelper', 'kommonitorShareHelper']); +//# sourceMappingURL=kommonitor-user-interface.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitor-user-interface.module.js.map b/app/components/kommonitorUserInterface/kommonitor-user-interface.module.js.map new file mode 100644 index 000000000..6a0d84fa9 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitor-user-interface.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-user-interface.module.js","sourceRoot":"","sources":["kommonitor-user-interface.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,yBAAyB,EAAE,CAAC,eAAe,EAAE,qBAAqB,EAAE,iBAAiB;IAClG,0CAA0C,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,mBAAmB;IAChJ,wBAAwB,EAAE,KAAK,EAAE,WAAW,EAAE,8BAA8B,EAAE,eAAe,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,sBAAsB;IAC/J,kBAAkB,EAAE,mCAAmC,EAAE,uBAAuB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitor-user-interface.module.ts b/app/components/kommonitorUserInterface/kommonitor-user-interface.module.ts new file mode 100644 index 000000000..3f277716e --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitor-user-interface.module.ts @@ -0,0 +1,4 @@ +angular.module('kommonitorUserInterface', ['kommonitorMap', 'kommonitorDataSetup', 'kommonitorAdmin', + 'kommonitorIndividualIndicatorComputation', 'kommonitorDiagrams', 'indicatorRadar', 'regressionDiagram', 'kommonitorFilter', 'kommonitorBalance', + 'kommonitorReachability', 'poi', 'infoModal', 'spatialUnitNotificationModal', 'feedbackModal', 'reportingModal', 'wmsModal', 'wfsModal', 'kommonitorDataImport', + 'kommonitorLegend', 'kommonitorElementVisibilityHelper', 'kommonitorShareHelper']); diff --git a/app/components/kommonitorUserInterface/kommonitorControls/feedbackModal/feedback-modal.component.js b/app/components/kommonitorUserInterface/kommonitorControls/feedbackModal/feedback-modal.component.js index 561a9f63b..c03d4a88d 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/feedbackModal/feedback-modal.component.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/feedbackModal/feedback-modal.component.js @@ -1,135 +1,110 @@ +"use strict"; angular.module('feedbackModal').component('feedbackModal', { - templateUrl : "components/kommonitorUserInterface/kommonitorControls/feedbackModal/feedback-modal.template.html", - controller : ['kommonitorDataExchangeService', '$scope', '$rootScope', '__env', '$http', function FeedbackModalController(kommonitorDataExchangeService, $scope, $rootScope, __env, $http) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - - const feedbackMailRecipient = __env.feedbackMailRecipient; - const emailURL = __env.targetUrlToProcessingEngine + "feedback-mail"; - - // $scope.titel; - $scope.organization; - $scope.contactDetails; - $scope.feedbackType = undefined; - $scope.feedbackContent; - $scope.like = undefined; - $scope.attachment = undefined; - document.getElementById("attachment").value = ""; - - $scope.error = undefined; - $scope.success = undefined; - - var fileToBase64 = (file) => { - return new Promise(resolve => { - var reader = new FileReader(); - // Read file content on file loaded event - reader.onload = function(event) { - resolve(event.target.result); - }; - - // Convert data to base64 - reader.readAsDataURL(file); - }); - }; - - $scope.onSubmit = async function(){ - // var body = "Titel: " + $scope.titel + "\n"; - var body = "Fachbereich/Organisation: " + $scope.organization + "\n\n"; - body += "Kontaktdaten: " + $scope.contactDetails + "\n\n"; - body += "Feedback Typ: " + $scope.feedbackType + "\n\n"; - body += "Feedback Inhalt: " + $scope.feedbackContent + "\n\n"; - body += "KomMonitor Bewertung: " + $scope.like + "\n\n"; - - // var blobFile = $('#attachment').files[0]; - var files = document.getElementById('attachment').files; - if(files.length > 0){ - var uploadFile = files[0]; - var base64 = await fileToBase64(uploadFile); - $scope.attachment = base64; - } - - - // var formData = undefined; - // - // if(files.length > 0){ - // formData = new FormData(); - // - // for (var i = 0; i < files.length; i++) { - // formData.append("files[]", files[i]); - // } - // - // } - - var mailInput = {}; - mailInput.recipientMail = feedbackMailRecipient; - mailInput.subject = "KomMonitor - Feedback"; - mailInput.body = body; - mailInput.attachment = $scope.attachment; - - $scope.sendMail(mailInput); - }; - - $scope.sendMail = function(mailInput){ - - if(! $scope.validate()){ - return; - } - - $scope.error = undefined; - $scope.success = undefined; - - $http({ - url: emailURL, - method: "POST", - data: mailInput - }).then(function successCallback(response) { - - $scope.error = undefined; - $scope.success = true; - - $("#mailSuccessInfo").show(); - - // auto-close after 3 seconds - // setTimeout(function() { - // $("#mailSuccessInfo").alert('close'); - // }, 3000); - - }, function errorCallback(error) { - - $scope.error = error; - $scope.success = undefined; - - $("#mailErrorInfo").show(); - }); - } - - $scope.onCloseSuccessAlert = function(){ - $("#mailSuccessInfo").hide(); - }; - - $scope.onCloseErrorAlert = function(){ - $("#mailErrorInfo").hide(); - }; - - $scope.validate = function(){ - if ($scope.feedbackType && $scope.feedbackContent){ - return true; - } - return false; - } - - $scope.reset = function(){ - $scope.organization = undefined; - $scope.contactDetails = undefined; - $scope.feedbackType = undefined; - $scope.feedbackContent = undefined; - $scope.like = undefined; - $scope.attachment = undefined; - document.getElementById("attachment").value = ""; - - $scope.error = undefined; - $scope.success = undefined; - } - - } -]}); + templateUrl: "components/kommonitorUserInterface/kommonitorControls/feedbackModal/feedback-modal.template.html", + controller: ['kommonitorDataExchangeService', '$scope', '$rootScope', '__env', '$http', function FeedbackModalController(kommonitorDataExchangeService, $scope, $rootScope, __env, $http) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + const feedbackMailRecipient = __env.feedbackMailRecipient; + const emailURL = __env.targetUrlToProcessingEngine + "feedback-mail"; + // $scope.titel; + $scope.organization; + $scope.contactDetails; + $scope.feedbackType = undefined; + $scope.feedbackContent; + $scope.like = undefined; + $scope.attachment = undefined; + document.getElementById("attachment").value = ""; + $scope.error = undefined; + $scope.success = undefined; + var fileToBase64 = (file) => { + return new Promise(resolve => { + var reader = new FileReader(); + // Read file content on file loaded event + reader.onload = function (event) { + resolve(event.target.result); + }; + // Convert data to base64 + reader.readAsDataURL(file); + }); + }; + $scope.onSubmit = async function () { + // var body = "Titel: " + $scope.titel + "\n"; + var body = "Fachbereich/Organisation: " + $scope.organization + "\n\n"; + body += "Kontaktdaten: " + $scope.contactDetails + "\n\n"; + body += "Feedback Typ: " + $scope.feedbackType + "\n\n"; + body += "Feedback Inhalt: " + $scope.feedbackContent + "\n\n"; + body += "KomMonitor Bewertung: " + $scope.like + "\n\n"; + // var blobFile = $('#attachment').files[0]; + var files = document.getElementById('attachment').files; + if (files.length > 0) { + var uploadFile = files[0]; + var base64 = await fileToBase64(uploadFile); + $scope.attachment = base64; + } + // var formData = undefined; + // + // if(files.length > 0){ + // formData = new FormData(); + // + // for (var i = 0; i < files.length; i++) { + // formData.append("files[]", files[i]); + // } + // + // } + var mailInput = {}; + mailInput.recipientMail = feedbackMailRecipient; + mailInput.subject = "KomMonitor - Feedback"; + mailInput.body = body; + mailInput.attachment = $scope.attachment; + $scope.sendMail(mailInput); + }; + $scope.sendMail = function (mailInput) { + if (!$scope.validate()) { + return; + } + $scope.error = undefined; + $scope.success = undefined; + $http({ + url: emailURL, + method: "POST", + data: mailInput + }).then(function successCallback(response) { + $scope.error = undefined; + $scope.success = true; + $("#mailSuccessInfo").show(); + // auto-close after 3 seconds + // setTimeout(function() { + // $("#mailSuccessInfo").alert('close'); + // }, 3000); + }, function errorCallback(error) { + $scope.error = error; + $scope.success = undefined; + $("#mailErrorInfo").show(); + }); + }; + $scope.onCloseSuccessAlert = function () { + $("#mailSuccessInfo").hide(); + }; + $scope.onCloseErrorAlert = function () { + $("#mailErrorInfo").hide(); + }; + $scope.validate = function () { + if ($scope.feedbackType && $scope.feedbackContent) { + return true; + } + return false; + }; + $scope.reset = function () { + $scope.organization = undefined; + $scope.contactDetails = undefined; + $scope.feedbackType = undefined; + $scope.feedbackContent = undefined; + $scope.like = undefined; + $scope.attachment = undefined; + document.getElementById("attachment").value = ""; + $scope.error = undefined; + $scope.success = undefined; + }; + } + ] +}); +//# sourceMappingURL=feedback-modal.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/feedbackModal/feedback-modal.component.js.map b/app/components/kommonitorUserInterface/kommonitorControls/feedbackModal/feedback-modal.component.js.map new file mode 100644 index 000000000..7b30005e1 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/feedbackModal/feedback-modal.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"feedback-modal.component.js","sourceRoot":"","sources":["feedback-modal.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,SAAS,CAAC,eAAe,EAAE;IAC1D,WAAW,EAAG,kGAAkG;IAChH,UAAU,EAAG,CAAC,+BAA+B,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,uBAAuB,CAAC,6BAA6B,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK;YAExL,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAE3E,MAAM,qBAAqB,GAAG,KAAK,CAAC,qBAAqB,CAAC;YAC1D,MAAM,QAAQ,GAAG,KAAK,CAAC,2BAA2B,GAAG,eAAe,CAAC;YAErE,gBAAgB;YAChB,MAAM,CAAC,YAAY,CAAC;YACpB,MAAM,CAAC,cAAc,CAAC;YACtB,MAAM,CAAC,YAAY,GAAG,SAAS,CAAC;YAChC,MAAM,CAAC,eAAe,CAAC;YACvB,MAAM,CAAC,IAAI,GAAG,SAAS,CAAC;YACxB,MAAM,CAAC,UAAU,GAAG,SAAS,CAAC;YAC9B,QAAQ,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;YAEjD,MAAM,CAAC,KAAK,GAAG,SAAS,CAAC;YACzB,MAAM,CAAC,OAAO,GAAG,SAAS,CAAC;YAE3B,I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CAAC;YAEF,MAAM,CAAC,iBAAiB,GAAG;gBAC1B,CAAC,CAAC,gBAAgB,CAAC,CAAC,IAAI,EAAE,CAAC;YAC5B,CAAC,CAAC;YAEF,MAAM,CAAC,QAAQ,GAAG;gBACjB,IAAI,MAAM,CAAC,YAAY,IAAI,MAAM,CAAC,eAAe,EAAC;oBACjD,OAAO,IAAI,CAAC;iBACZ;gBACD,OAAO,KAAK,CAAC;YACd,CAAC,CAAA;YAED,MAAM,CAAC,KAAK,GAAG;gBACd,MAAM,CAAC,YAAY,GAAG,SAAS,CAAC;gBAChC,MAAM,CAAC,cAAc,GAAG,SAAS,CAAC;gBAClC,MAAM,CAAC,YAAY,GAAG,SAAS,CAAC;gBAChC,MAAM,CAAC,eAAe,GAAG,SAAS,CAAC;gBACnC,MAAM,CAAC,IAAI,GAAG,SAAS,CAAC;gBACxB,MAAM,CAAC,UAAU,GAAG,SAAS,CAAC;gBAC9B,QAAQ,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;gBAEjD,MAAM,CAAC,KAAK,GAAG,SAAS,CAAC;gBACzB,MAAM,CAAC,OAAO,GAAG,SAAS,CAAC;YAC5B,CAAC,CAAA;QAEF,CAAC;KACD;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/feedbackModal/feedback-modal.component.ts b/app/components/kommonitorUserInterface/kommonitorControls/feedbackModal/feedback-modal.component.ts new file mode 100644 index 000000000..561a9f63b --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/feedbackModal/feedback-modal.component.ts @@ -0,0 +1,135 @@ +angular.module('feedbackModal').component('feedbackModal', { + templateUrl : "components/kommonitorUserInterface/kommonitorControls/feedbackModal/feedback-modal.template.html", + controller : ['kommonitorDataExchangeService', '$scope', '$rootScope', '__env', '$http', function FeedbackModalController(kommonitorDataExchangeService, $scope, $rootScope, __env, $http) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + + const feedbackMailRecipient = __env.feedbackMailRecipient; + const emailURL = __env.targetUrlToProcessingEngine + "feedback-mail"; + + // $scope.titel; + $scope.organization; + $scope.contactDetails; + $scope.feedbackType = undefined; + $scope.feedbackContent; + $scope.like = undefined; + $scope.attachment = undefined; + document.getElementById("attachment").value = ""; + + $scope.error = undefined; + $scope.success = undefined; + + var fileToBase64 = (file) => { + return new Promise(resolve => { + var reader = new FileReader(); + // Read file content on file loaded event + reader.onload = function(event) { + resolve(event.target.result); + }; + + // Convert data to base64 + reader.readAsDataURL(file); + }); + }; + + $scope.onSubmit = async function(){ + // var body = "Titel: " + $scope.titel + "\n"; + var body = "Fachbereich/Organisation: " + $scope.organization + "\n\n"; + body += "Kontaktdaten: " + $scope.contactDetails + "\n\n"; + body += "Feedback Typ: " + $scope.feedbackType + "\n\n"; + body += "Feedback Inhalt: " + $scope.feedbackContent + "\n\n"; + body += "KomMonitor Bewertung: " + $scope.like + "\n\n"; + + // var blobFile = $('#attachment').files[0]; + var files = document.getElementById('attachment').files; + if(files.length > 0){ + var uploadFile = files[0]; + var base64 = await fileToBase64(uploadFile); + $scope.attachment = base64; + } + + + // var formData = undefined; + // + // if(files.length > 0){ + // formData = new FormData(); + // + // for (var i = 0; i < files.length; i++) { + // formData.append("files[]", files[i]); + // } + // + // } + + var mailInput = {}; + mailInput.recipientMail = feedbackMailRecipient; + mailInput.subject = "KomMonitor - Feedback"; + mailInput.body = body; + mailInput.attachment = $scope.attachment; + + $scope.sendMail(mailInput); + }; + + $scope.sendMail = function(mailInput){ + + if(! $scope.validate()){ + return; + } + + $scope.error = undefined; + $scope.success = undefined; + + $http({ + url: emailURL, + method: "POST", + data: mailInput + }).then(function successCallback(response) { + + $scope.error = undefined; + $scope.success = true; + + $("#mailSuccessInfo").show(); + + // auto-close after 3 seconds + // setTimeout(function() { + // $("#mailSuccessInfo").alert('close'); + // }, 3000); + + }, function errorCallback(error) { + + $scope.error = error; + $scope.success = undefined; + + $("#mailErrorInfo").show(); + }); + } + + $scope.onCloseSuccessAlert = function(){ + $("#mailSuccessInfo").hide(); + }; + + $scope.onCloseErrorAlert = function(){ + $("#mailErrorInfo").hide(); + }; + + $scope.validate = function(){ + if ($scope.feedbackType && $scope.feedbackContent){ + return true; + } + return false; + } + + $scope.reset = function(){ + $scope.organization = undefined; + $scope.contactDetails = undefined; + $scope.feedbackType = undefined; + $scope.feedbackContent = undefined; + $scope.like = undefined; + $scope.attachment = undefined; + document.getElementById("attachment").value = ""; + + $scope.error = undefined; + $scope.success = undefined; + } + + } +]}); diff --git a/app/components/kommonitorUserInterface/kommonitorControls/feedbackModal/feedback-modal.module.js b/app/components/kommonitorUserInterface/kommonitorControls/feedbackModal/feedback-modal.module.js index 57061d6ab..e000de570 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/feedbackModal/feedback-modal.module.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/feedbackModal/feedback-modal.module.js @@ -1,14 +1,15 @@ +"use strict"; angular.module('feedbackModal', []); - // custom directive to read files and parse them to ngModel -angular.module("feedbackModal").directive("selectNgFiles", function() { - return { - require: "ngModel", - link: function postLink(scope,elem,attrs,ngModel) { - elem.on("change", function(e) { - var files = elem[0].files; - ngModel.$setViewValue(files); - }) - } - } +angular.module("feedbackModal").directive("selectNgFiles", function () { + return { + require: "ngModel", + link: function postLink(scope, elem, attrs, ngModel) { + elem.on("change", function (e) { + var files = elem[0].files; + ngModel.$setViewValue(files); + }); + } + }; }); +//# sourceMappingURL=feedback-modal.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/feedbackModal/feedback-modal.module.js.map b/app/components/kommonitorUserInterface/kommonitorControls/feedbackModal/feedback-modal.module.js.map new file mode 100644 index 000000000..78f70d9c4 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/feedbackModal/feedback-modal.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"feedback-modal.module.js","sourceRoot":"","sources":["feedback-modal.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;AAEpC,2DAA2D;AAC3D,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,SAAS,CAAC,eAAe,EAAE;IACzD,OAAO;QACL,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,SAAS,QAAQ,CAAC,KAAK,EAAC,IAAI,EAAC,KAAK,EAAC,OAAO;YAC9C,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,UAAS,CAAC;gBAC1B,IAAI,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;gBAC1B,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YAC/B,CAAC,CAAC,CAAA;QACJ,CAAC;KACF,CAAA;AACH,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/feedbackModal/feedback-modal.module.ts b/app/components/kommonitorUserInterface/kommonitorControls/feedbackModal/feedback-modal.module.ts new file mode 100644 index 000000000..57061d6ab --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/feedbackModal/feedback-modal.module.ts @@ -0,0 +1,14 @@ +angular.module('feedbackModal', []); + +// custom directive to read files and parse them to ngModel +angular.module("feedbackModal").directive("selectNgFiles", function() { + return { + require: "ngModel", + link: function postLink(scope,elem,attrs,ngModel) { + elem.on("change", function(e) { + var files = elem[0].files; + ngModel.$setViewValue(files); + }) + } + } +}); diff --git a/app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.component.js b/app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.component.js index 95cceef81..57b899a81 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.component.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.component.js @@ -1,612 +1,484 @@ +"use strict"; angular - .module('indicatorRadar') - .component( - 'indicatorRadar', - { - templateUrl: "components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.template.html", - - controller: [ - 'kommonitorDataExchangeService', 'kommonitorDiagramHelperService', 'kommonitorFilterHelperService', '$scope', '$rootScope', '$timeout', '$http', '__env', - function indicatorRadarController( - kommonitorDataExchangeService, kommonitorDiagramHelperService, kommonitorFilterHelperService, $scope, $rootScope, $timeout, $http, __env) { - /* - * reference to kommonitorDataExchangeService instances - */ - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorDiagramHelperServiceInstance = kommonitorDiagramHelperService; - - var self = this; - - $scope.activeTab = 0; - - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - $(window).on('resize', function () { - if ($scope.radarChart != null && $scope.radarChart != undefined) { - $scope.radarChart.resize(); - } - }); - - $scope.$on("resizeDiagrams", function (event) { - - setTimeout(function () { - if ($scope.radarChart != null && $scope.radarChart != undefined) { - $scope.radarChart.resize(); - } - }, 350); - }); - - const DATE_PREFIX = __env.indicatorDatePrefix; - - $scope.indicatorNameFilter = undefined; - - $scope.eventsRegistered = false; - - var numberOfDecimals = __env.numberOfDecimals; - - $scope.setupCompleted = true; - - $scope.onChangeFilterSameUnitAndSameTime = function(){ - if($scope.radarChart){ - $scope.radarChart.dispose(); - $scope.radarChart = echarts.init(document.getElementById('radarDiagram')); - } - kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime = []; - - kommonitorDiagramHelperService.setupIndicatorPropertiesForCurrentSpatialUnitAndTime(kommonitorDiagramHelperService.filterSameUnitAndSameTime); - }; - - $scope.date; - $scope.spatialUnitName; - - $scope.$on("updateDiagrams", function (event, indicatorMetadataAndGeoJSON, spatialUnitName, spatialUnitId, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue, justRestyling) { - - // if the layer is just restyled (i.e. due to change of measureOfValue) - // then we do not need to costly update the radar diagram - if (justRestyling) { - return; - } - - console.log("updating radar diagram"); - - $scope.setupCompleted = false; - - updateRadarChart(indicatorMetadataAndGeoJSON, spatialUnitName, spatialUnitId, date); - - $rootScope.$broadcast("preserveHighlightedFeatures"); - - }); - - // RADAR CHART TIME SERIES FUNCTION - var updateRadarChart = async function (indicatorMetadataAndGeoJSON, spatialUnitName, spatialUnitId, date) { - // based on prepared DOM, initialize echarts instance - $scope.date = date; - $scope.spatialUnitName = spatialUnitName; - - if (!$scope.radarChart) - $scope.radarChart = echarts.init(document.getElementById('radarDiagram')); - else { - // explicitly kill and reinstantiate radar diagram to avoid zombie states on spatial unit change - $scope.radarChart.dispose(); - $scope.radarChart = echarts.init(document.getElementById('radarDiagram')); - kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime = new Array(); - } - - await $scope.radarChart.showLoading(); - - kommonitorDiagramHelperService.setupIndicatorPropertiesForCurrentSpatialUnitAndTime(); - - $scope.activeTab = 0; - if(kommonitorDataExchangeService.selectedIndicator.creationType == "COMPUTATION"){ - $scope.activeTab = 1; - } - if(kommonitorDataExchangeService.selectedIndicator.isHeadlineIndicator){ - $scope.activeTab = 2; - } - - modifyRadarContent(kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime); - }; - - $scope.onChangeSelectedDate = function(input){ - if(input.isSelected){ - modifyRadarContent(kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime); - } - }; - - var wait = ms => new Promise((r, j) => setTimeout(r, ms)); - - $scope.$on("allIndicatorPropertiesForCurrentSpatialUnitAndTime setup begin", async function (event) { - - await wait(130); - $scope.setupCompleted = false; - - - $timeout(function(){ - $scope.$digest(); - }, 500); - - }); - - $scope.$on("allIndicatorPropertiesForCurrentSpatialUnitAndTime setup completed", async function (event) { - - await wait(130); - $scope.setupCompleted = true; - - - $timeout(function(){ - $scope.$digest(); - self.filterDisplayedIndicatorsOnRadar(); - }, 500); - - }); - - var modifyRadarContent = async function (indicatorsForRadar) { - var indicatorArrayForRadarChart = new Array(); - var defaultSeriesValueArray = new Array(); - - var sampleProperties = null; - - for (var i = 0; i < indicatorsForRadar.length; i++) { - if (indicatorsForRadar[i].isSelected) { - - await kommonitorDiagramHelperService.fetchIndicatorPropertiesIfNotExists(i); - - // make object to hold indicatorName, max value and average value - var indicatorProperties = indicatorsForRadar[i].indicatorProperties; - - if(kommonitorFilterHelperService.completelyRemoveFilteredFeaturesFromDisplay && kommonitorFilterHelperService.filteredIndicatorFeatureIds.size > 0){ - indicatorProperties = indicatorProperties.filter(featureProperties => ! kommonitorFilterHelperService.featureIsCurrentlyFiltered(featureProperties[__env.FEATURE_ID_PROPERTY_NAME])); - } - - sampleProperties = indicatorsForRadar[i].indicatorProperties; - - // var closestApplicableTimestamp = kommonitorDiagramHelperService.findClostestTimestamForTargetDate(indicatorsForRadar[i], $scope.date); - // indicatorsForRadar[i].closestTimestamp = closestApplicableTimestamp; - - var sample = indicatorProperties[0]; - var maxValue = sample[DATE_PREFIX + indicatorsForRadar[i].selectedDate]; - var minValue = sample[DATE_PREFIX + indicatorsForRadar[i].selectedDate]; - var valueSum = 0; - - for (var indicatorPropertyInstance of indicatorProperties) { - // for average only apply real numeric values - if (!kommonitorDataExchangeService.indicatorValueIsNoData(indicatorPropertyInstance[DATE_PREFIX + indicatorsForRadar[i].selectedDate])) { - var value = kommonitorDataExchangeService.getIndicatorValueFromArray_asNumber(indicatorPropertyInstance, indicatorsForRadar[i].selectedDate) - valueSum += value; - - if (value > maxValue) - maxValue = value; - - if (value < minValue) - minValue = value; - } - } - - if (minValue == null) { - minValue = 0; - } - - if (maxValue == null) { - maxValue = 1; - } - - // IT MIGHT HAPPEN THAT AN INDICATOR IS INSPECTED THAT DOES NOT SUPPORT THE DATE - // HENCE ONLY ADD VALUES TO DEFAULT IF THEY SHOW MEANINGFUL VALUES - // if(valueSum != null){ - indicatorArrayForRadarChart.push({ - name: indicatorsForRadar[i].indicatorMetadata.indicatorName + " - " + indicatorsForRadar[i].selectedDate, - unit: indicatorsForRadar[i].indicatorMetadata.unit, - max: maxValue, - min: minValue - }); - - defaultSeriesValueArray.push(kommonitorDataExchangeService.getIndicatorValue_asNumber(Number(valueSum / indicatorProperties.length))); - // } - } - - } - - if (defaultSeriesValueArray.length === 0) { - - if ($scope.radarChart) { - $scope.radarChart.dispose(); - $scope.radarChart = undefined; - } - - } - else { - - if (!$scope.radarChart) - $scope.radarChart = echarts.init(document.getElementById('radarDiagram')); - // else{ - // // explicitly kill and reinstantiate radar diagram to avoid zombie states on spatial unit change - // $scope.radarChart.dispose(); - // $scope.radarChart = echarts.init(document.getElementById('radarDiagram')); - // } - - $scope.radarOption = { - grid: { - left: '4%', - top: 0, - right: '4%', - bottom: 30, - containLabel: true - }, - title: { - text: 'Indikatorenradar - ' + $scope.spatialUnitName + ' - ' + $scope.date, - left: 'center', - top: 0, - show: false - }, - tooltip: { - confine: 'true', - formatter: function (params) { - - var string = "" + params.name + "
        "; - - for (var index = 0; index < params.value.length; index++) { - string += $scope.radarOption.radar.indicator[index].name + ": " + kommonitorDataExchangeService.getIndicatorValue_asFormattedText(params.value[index]) + " [" + $scope.radarOption.radar.indicator[index].unit + "]
        "; - }; - - return string; - } - // position: ['50%', '50%'] - }, - toolbox: { - show: true, - right: '15', - feature: { - // mark : {show: true}, - dataView: { - show: kommonitorDataExchangeService.showDiagramExportButtons, readOnly: true, title: "Datenansicht", lang: ['Datenansicht - Indikatorenradar', 'schließen', 'refresh'], optionToContent: function (opt) { - - // - // - // - // - // - // - // - // - // - // - // - // - // - //
        Indikator-NameBeschreibung der Verknüpfung
        {{indicator.referencedIndicatorName}}{{indicator.referencedIndicatorDescription}}
        - - var radarSeries = opt.series[0].data; - var indicators = opt.radar[0].indicator; - - var dataTableId = "radarDataTable"; - var tableExportName = opt.title[0].text; - - var htmlString = ''; - htmlString += ""; - htmlString += ""; - htmlString += ""; - - for (var i = 0; i < indicators.length; i++) { - htmlString += ""; - } - - htmlString += ""; - htmlString += ""; - - htmlString += ""; - - - - for (var j = 0; j < radarSeries.length; j++) { - htmlString += ""; - htmlString += ""; - for (var k = 0; k < indicators.length; k++) { - htmlString += ""; - } - htmlString += ""; - } - - htmlString += ""; - htmlString += "
        Feature-Name" + indicators[i].name + " [" + indicators[i].unit + "]
        " + radarSeries[j].name + "" + kommonitorDataExchangeService.getIndicatorValue_asNumber(radarSeries[j].value[k]) + "
        "; - - $rootScope.$broadcast("AppendExportButtonsForTable", dataTableId, tableExportName); - - return htmlString; - } - }, - restore: { show: false, title: "Darstellung erneuern" }, - saveAsImage: { show: true, title: "Export", pixelRatio: 4 } - } - }, - legend: { - type: "scroll", - bottom: 0, - align: 'left', - left: 5, - data: ['Arithmetisches Mittel'] - }, - radar: { - // shape: 'circle', - // name: { - // textStyle: { - // color: '#fff', - // backgroundColor: '#999', - // borderRadius: 3, - // padding: [3, 5] - // } - // }, - name: { - formatter: function (value, indicator) { - - return kommonitorDataExchangeService.formatIndicatorNameForLabel(value, 15); - }, - textStyle: { - color: '#525252' - }, - fontSize: 11 - }, - indicator: indicatorArrayForRadarChart - }, - series: [{ - name: 'Indikatorvergleich', - type: 'radar', - symbolSize: 8, - data: [ - { - value: defaultSeriesValueArray, - name: 'Arithmetisches Mittel', - lineStyle: { - color: 'gray', - type: 'dashed', - width: 3 - }, - itemStyle: { - borderWidth: 2, - color: 'gray' - }, - emphasis: { - lineStyle: { - width: 4 - }, - itemStyle: { - borderType: 'dashed' - } - } - } - ] - }] - }; - - // check if any feature is still clicked/selected - // then append those as series within radar chart - appendSelectedFeaturesIfNecessary(sampleProperties); - - // use configuration item and data specified to show chart - $scope.radarChart.setOption($scope.radarOption); - - $scope.radarChart.hideLoading(); - setTimeout(function () { - $scope.radarChart.resize(); - $scope.$digest(); - }, 350); - registerEventsIfNecessary(); - - } - - } - - var appendSelectedFeaturesIfNecessary = function (sampleProperties) { - - for (var propertiesInstance of sampleProperties) { - if (kommonitorFilterHelperService.featureIsCurrentlySelected(propertiesInstance[__env.FEATURE_ID_PROPERTY_NAME])) { - appendSeriesToRadarChart(propertiesInstance); - } - } - }; - - function registerEventsIfNecessary() { - if (!$scope.eventsRegistered) { - // when hovering over elements of the chart then highlight them in the map. - $scope.radarChart.on('mouseOver', function (params) { - // $scope.userHoveresOverItem = true; - var spatialFeatureName = params.data.name; - // console.log(spatialFeatureName); - if(spatialFeatureName){ - $rootScope.$broadcast("highlightFeatureOnMap", spatialFeatureName); - } - - }); - - $scope.radarChart.on('mouseOut', function (params) { - // $scope.userHoveresOverItem = false; - - var spatialFeatureName = params.data.name; - // console.log(spatialFeatureName); - if(spatialFeatureName){ - $rootScope.$broadcast("unhighlightFeatureOnMap", spatialFeatureName); - } - - }); - - //disable feature removal for radar chart - seems to be unintuititve - // $scope.radarChart.on('click', function(params){ - // var spatialFeatureName = params.data.name; - // // console.log(spatialFeatureName); - // if(spatialFeatureName){ - // $rootScope.$broadcast("switchHighlightFeatureOnMap", spatialFeatureName); - // } - // }); - - $scope.eventsRegistered = true; - } - }; - - - $scope.$on("updateDiagramsForHoveredFeature", function (event, featureProperties) { - - if (!$scope.radarChart || !$scope.radarOption || !$scope.radarOption.legend || !$scope.radarOption.series) { - return; - } - - if (!kommonitorFilterHelperService.featureIsCurrentlySelected(featureProperties[__env.FEATURE_ID_PROPERTY_NAME])) { - appendSeriesToRadarChart(featureProperties); - } - - highlightFeatureInRadarChart(featureProperties); - }); - - var appendSeriesToRadarChart = function (featureProperties) { - // append feature name to legend - $scope.radarOption.legend.data.push(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); - - // create feature data series - var featureSeries = {}; - featureSeries.name = featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]; - featureSeries.value = new Array(); - featureSeries.emphasis = { - lineStyle: { - width: 4, - type: 'dotted' - } - }; - featureSeries.lineStyle = { - width: 3, - type: 'solid' - }; - featureSeries.itemStyle = { - borderWidth: 2 - }; - - - // for each indicator create series data entry for feature - for (var i = 0; i < kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime.length; i++) { - if (kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime[i].isSelected) { - // make object to hold indicatorName, max value and average value - var indicatorProperties = kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime[i].indicatorProperties; - var date = kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime[i].selectedDate; - - for (var indicatorPropertyInstance of indicatorProperties) { - if (indicatorPropertyInstance[__env.FEATURE_NAME_PROPERTY_NAME] == featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]) { - if (!kommonitorDataExchangeService.indicatorValueIsNoData(indicatorPropertyInstance[DATE_PREFIX + date])) { - featureSeries.value.push(kommonitorDataExchangeService.getIndicatorValueFromArray_asNumber(indicatorPropertyInstance, date)); - } - else { - featureSeries.value.push(null); - } - break; - } - } - } - - } - - $scope.radarOption.series[0].data.push(featureSeries); - - $scope.radarChart.setOption($scope.radarOption); - setTimeout(function () { - $scope.radarChart.resize(); - }, 350); - registerEventsIfNecessary(); - }; - - var highlightFeatureInRadarChart = function (featureProperties) { - // highlight the corresponding bar diagram item - // get series index of series - var dataIndex = getSeriesDataIndexByFeatureName(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); - - if (dataIndex > -1) { - $scope.radarChart.dispatchAction({ - type: 'highlight', - seriesIndex: 0, - dataIndex: dataIndex - }); - } - }; - - $scope.$on("updateDiagramsForUnhoveredFeature", function (event, featureProperties) { - - if (!$scope.radarChart || !$scope.radarOption || !$scope.radarOption.legend || !$scope.radarOption.series) { - return; - } - - unhighlightFeatureInRadarChart(featureProperties); - - if (!kommonitorFilterHelperService.featureIsCurrentlySelected(featureProperties[__env.FEATURE_ID_PROPERTY_NAME])) { - removeSeriesFromRadarChart(featureProperties); - } - }); - - var getSeriesDataIndexByFeatureName = function (featureName) { - for (var index = 0; index < $scope.radarOption.series[0].data.length; index++) { - if ($scope.radarOption.series[0].data[index].name == featureName) - return index; - } - - //return -1 if none was found - return -1; - }; - - var removeSeriesFromRadarChart = function (featureProperties) { - // remove feature from legend - var legendIndex = $scope.radarOption.legend.data.indexOf(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); - if (legendIndex > -1) { - $scope.radarOption.legend.data.splice(legendIndex, 1); - } - - // remove feature data series - var dataIndex = getSeriesDataIndexByFeatureName(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); - if (dataIndex > -1) { - $scope.radarOption.series[0].data.splice(dataIndex, 1); - } - - // second parameter tells echarts to not merge options with previous data. hence really remove series from graphic - $scope.radarChart.setOption($scope.radarOption, true); - setTimeout(function () { - $scope.radarChart.resize(); - }, 350); - registerEventsIfNecessary(); - }; - - var unhighlightFeatureInRadarChart = function (featureProperties) { - // highlight the corresponding bar diagram item - // get series index of series - var dataIndex = getSeriesDataIndexByFeatureName(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); - - if (dataIndex > -1) { - $scope.radarChart.dispatchAction({ - type: 'downplay', - seriesIndex: 0, - dataIndex: dataIndex - }); - } - }; - - this.filterDisplayedIndicatorsOnRadar = function () { - console.log("Filtering indicator radar"); - - modifyRadarContent(kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime); - - } - - this.selectAllIndicatorsForRadar = function () { - - for (var indicator of kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime) { - indicator.isSelected = true; - } - - modifyRadarContent(kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime); - } - - this.deselectAllIndicatorsForRadar = function () { - - for (var indicator of kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime) { - indicator.isSelected = false; - } - - modifyRadarContent(kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime); - } - - - }] - }); + .module('indicatorRadar') + .component('indicatorRadar', { + templateUrl: "components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.template.html", + controller: [ + 'kommonitorDataExchangeService', 'kommonitorDiagramHelperService', 'kommonitorFilterHelperService', '$scope', '$rootScope', '$timeout', '$http', '__env', + function indicatorRadarController(kommonitorDataExchangeService, kommonitorDiagramHelperService, kommonitorFilterHelperService, $scope, $rootScope, $timeout, $http, __env) { + /* + * reference to kommonitorDataExchangeService instances + */ + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorDiagramHelperServiceInstance = kommonitorDiagramHelperService; + var self = this; + $scope.activeTab = 0; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + $(window).on('resize', function () { + if ($scope.radarChart != null && $scope.radarChart != undefined) { + $scope.radarChart.resize(); + } + }); + $scope.$on("resizeDiagrams", function (event) { + setTimeout(function () { + if ($scope.radarChart != null && $scope.radarChart != undefined) { + $scope.radarChart.resize(); + } + }, 350); + }); + const DATE_PREFIX = __env.indicatorDatePrefix; + $scope.indicatorNameFilter = undefined; + $scope.eventsRegistered = false; + var numberOfDecimals = __env.numberOfDecimals; + $scope.setupCompleted = true; + $scope.onChangeFilterSameUnitAndSameTime = function () { + if ($scope.radarChart) { + $scope.radarChart.dispose(); + $scope.radarChart = echarts.init(document.getElementById('radarDiagram')); + } + kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime = []; + kommonitorDiagramHelperService.setupIndicatorPropertiesForCurrentSpatialUnitAndTime(kommonitorDiagramHelperService.filterSameUnitAndSameTime); + }; + $scope.date; + $scope.spatialUnitName; + $scope.$on("updateDiagrams", function (event, indicatorMetadataAndGeoJSON, spatialUnitName, spatialUnitId, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue, justRestyling) { + // if the layer is just restyled (i.e. due to change of measureOfValue) + // then we do not need to costly update the radar diagram + if (justRestyling) { + return; + } + console.log("updating radar diagram"); + $scope.setupCompleted = false; + updateRadarChart(indicatorMetadataAndGeoJSON, spatialUnitName, spatialUnitId, date); + $rootScope.$broadcast("preserveHighlightedFeatures"); + }); + // RADAR CHART TIME SERIES FUNCTION + var updateRadarChart = async function (indicatorMetadataAndGeoJSON, spatialUnitName, spatialUnitId, date) { + // based on prepared DOM, initialize echarts instance + $scope.date = date; + $scope.spatialUnitName = spatialUnitName; + if (!$scope.radarChart) + $scope.radarChart = echarts.init(document.getElementById('radarDiagram')); + else { + // explicitly kill and reinstantiate radar diagram to avoid zombie states on spatial unit change + $scope.radarChart.dispose(); + $scope.radarChart = echarts.init(document.getElementById('radarDiagram')); + kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime = new Array(); + } + await $scope.radarChart.showLoading(); + kommonitorDiagramHelperService.setupIndicatorPropertiesForCurrentSpatialUnitAndTime(); + $scope.activeTab = 0; + if (kommonitorDataExchangeService.selectedIndicator.creationType == "COMPUTATION") { + $scope.activeTab = 1; + } + if (kommonitorDataExchangeService.selectedIndicator.isHeadlineIndicator) { + $scope.activeTab = 2; + } + modifyRadarContent(kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime); + }; + $scope.onChangeSelectedDate = function (input) { + if (input.isSelected) { + modifyRadarContent(kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime); + } + }; + var wait = ms => new Promise((r, j) => setTimeout(r, ms)); + $scope.$on("allIndicatorPropertiesForCurrentSpatialUnitAndTime setup begin", async function (event) { + await wait(130); + $scope.setupCompleted = false; + $timeout(function () { + $scope.$digest(); + }, 500); + }); + $scope.$on("allIndicatorPropertiesForCurrentSpatialUnitAndTime setup completed", async function (event) { + await wait(130); + $scope.setupCompleted = true; + $timeout(function () { + $scope.$digest(); + self.filterDisplayedIndicatorsOnRadar(); + }, 500); + }); + var modifyRadarContent = async function (indicatorsForRadar) { + var indicatorArrayForRadarChart = new Array(); + var defaultSeriesValueArray = new Array(); + var sampleProperties = null; + for (var i = 0; i < indicatorsForRadar.length; i++) { + if (indicatorsForRadar[i].isSelected) { + await kommonitorDiagramHelperService.fetchIndicatorPropertiesIfNotExists(i); + // make object to hold indicatorName, max value and average value + var indicatorProperties = indicatorsForRadar[i].indicatorProperties; + if (kommonitorFilterHelperService.completelyRemoveFilteredFeaturesFromDisplay && kommonitorFilterHelperService.filteredIndicatorFeatureIds.size > 0) { + indicatorProperties = indicatorProperties.filter(featureProperties => !kommonitorFilterHelperService.featureIsCurrentlyFiltered(featureProperties[__env.FEATURE_ID_PROPERTY_NAME])); + } + sampleProperties = indicatorsForRadar[i].indicatorProperties; + // var closestApplicableTimestamp = kommonitorDiagramHelperService.findClostestTimestamForTargetDate(indicatorsForRadar[i], $scope.date); + // indicatorsForRadar[i].closestTimestamp = closestApplicableTimestamp; + var sample = indicatorProperties[0]; + var maxValue = sample[DATE_PREFIX + indicatorsForRadar[i].selectedDate]; + var minValue = sample[DATE_PREFIX + indicatorsForRadar[i].selectedDate]; + var valueSum = 0; + for (var indicatorPropertyInstance of indicatorProperties) { + // for average only apply real numeric values + if (!kommonitorDataExchangeService.indicatorValueIsNoData(indicatorPropertyInstance[DATE_PREFIX + indicatorsForRadar[i].selectedDate])) { + var value = kommonitorDataExchangeService.getIndicatorValueFromArray_asNumber(indicatorPropertyInstance, indicatorsForRadar[i].selectedDate); + valueSum += value; + if (value > maxValue) + maxValue = value; + if (value < minValue) + minValue = value; + } + } + if (minValue == null) { + minValue = 0; + } + if (maxValue == null) { + maxValue = 1; + } + // IT MIGHT HAPPEN THAT AN INDICATOR IS INSPECTED THAT DOES NOT SUPPORT THE DATE + // HENCE ONLY ADD VALUES TO DEFAULT IF THEY SHOW MEANINGFUL VALUES + // if(valueSum != null){ + indicatorArrayForRadarChart.push({ + name: indicatorsForRadar[i].indicatorMetadata.indicatorName + " - " + indicatorsForRadar[i].selectedDate, + unit: indicatorsForRadar[i].indicatorMetadata.unit, + max: maxValue, + min: minValue + }); + defaultSeriesValueArray.push(kommonitorDataExchangeService.getIndicatorValue_asNumber(Number(valueSum / indicatorProperties.length))); + // } + } + } + if (defaultSeriesValueArray.length === 0) { + if ($scope.radarChart) { + $scope.radarChart.dispose(); + $scope.radarChart = undefined; + } + } + else { + if (!$scope.radarChart) + $scope.radarChart = echarts.init(document.getElementById('radarDiagram')); + // else{ + // // explicitly kill and reinstantiate radar diagram to avoid zombie states on spatial unit change + // $scope.radarChart.dispose(); + // $scope.radarChart = echarts.init(document.getElementById('radarDiagram')); + // } + $scope.radarOption = { + grid: { + left: '4%', + top: 0, + right: '4%', + bottom: 30, + containLabel: true + }, + title: { + text: 'Indikatorenradar - ' + $scope.spatialUnitName + ' - ' + $scope.date, + left: 'center', + top: 0, + show: false + }, + tooltip: { + confine: 'true', + formatter: function (params) { + var string = "" + params.name + "
        "; + for (var index = 0; index < params.value.length; index++) { + string += $scope.radarOption.radar.indicator[index].name + ": " + kommonitorDataExchangeService.getIndicatorValue_asFormattedText(params.value[index]) + " [" + $scope.radarOption.radar.indicator[index].unit + "]
        "; + } + ; + return string; + } + // position: ['50%', '50%'] + }, + toolbox: { + show: true, + right: '15', + feature: { + // mark : {show: true}, + dataView: { + show: kommonitorDataExchangeService.showDiagramExportButtons, readOnly: true, title: "Datenansicht", lang: ['Datenansicht - Indikatorenradar', 'schließen', 'refresh'], optionToContent: function (opt) { + // + // + // + // + // + // + // + // + // + // + // + // + // + //
        Indikator-NameBeschreibung der Verknüpfung
        {{indicator.referencedIndicatorName}}{{indicator.referencedIndicatorDescription}}
        + var radarSeries = opt.series[0].data; + var indicators = opt.radar[0].indicator; + var dataTableId = "radarDataTable"; + var tableExportName = opt.title[0].text; + var htmlString = ''; + htmlString += ""; + htmlString += ""; + htmlString += ""; + for (var i = 0; i < indicators.length; i++) { + htmlString += ""; + } + htmlString += ""; + htmlString += ""; + htmlString += ""; + for (var j = 0; j < radarSeries.length; j++) { + htmlString += ""; + htmlString += ""; + for (var k = 0; k < indicators.length; k++) { + htmlString += ""; + } + htmlString += ""; + } + htmlString += ""; + htmlString += "
        Feature-Name" + indicators[i].name + " [" + indicators[i].unit + "]
        " + radarSeries[j].name + "" + kommonitorDataExchangeService.getIndicatorValue_asNumber(radarSeries[j].value[k]) + "
        "; + $rootScope.$broadcast("AppendExportButtonsForTable", dataTableId, tableExportName); + return htmlString; + } + }, + restore: { show: false, title: "Darstellung erneuern" }, + saveAsImage: { show: true, title: "Export", pixelRatio: 4 } + } + }, + legend: { + type: "scroll", + bottom: 0, + align: 'left', + left: 5, + data: ['Arithmetisches Mittel'] + }, + radar: { + // shape: 'circle', + // name: { + // textStyle: { + // color: '#fff', + // backgroundColor: '#999', + // borderRadius: 3, + // padding: [3, 5] + // } + // }, + name: { + formatter: function (value, indicator) { + return kommonitorDataExchangeService.formatIndicatorNameForLabel(value, 15); + }, + textStyle: { + color: '#525252' + }, + fontSize: 11 + }, + indicator: indicatorArrayForRadarChart + }, + series: [{ + name: 'Indikatorvergleich', + type: 'radar', + symbolSize: 8, + data: [ + { + value: defaultSeriesValueArray, + name: 'Arithmetisches Mittel', + lineStyle: { + color: 'gray', + type: 'dashed', + width: 3 + }, + itemStyle: { + borderWidth: 2, + color: 'gray' + }, + emphasis: { + lineStyle: { + width: 4 + }, + itemStyle: { + borderType: 'dashed' + } + } + } + ] + }] + }; + // check if any feature is still clicked/selected + // then append those as series within radar chart + appendSelectedFeaturesIfNecessary(sampleProperties); + // use configuration item and data specified to show chart + $scope.radarChart.setOption($scope.radarOption); + $scope.radarChart.hideLoading(); + setTimeout(function () { + $scope.radarChart.resize(); + $scope.$digest(); + }, 350); + registerEventsIfNecessary(); + } + }; + var appendSelectedFeaturesIfNecessary = function (sampleProperties) { + for (var propertiesInstance of sampleProperties) { + if (kommonitorFilterHelperService.featureIsCurrentlySelected(propertiesInstance[__env.FEATURE_ID_PROPERTY_NAME])) { + appendSeriesToRadarChart(propertiesInstance); + } + } + }; + function registerEventsIfNecessary() { + if (!$scope.eventsRegistered) { + // when hovering over elements of the chart then highlight them in the map. + $scope.radarChart.on('mouseOver', function (params) { + // $scope.userHoveresOverItem = true; + var spatialFeatureName = params.data.name; + // console.log(spatialFeatureName); + if (spatialFeatureName) { + $rootScope.$broadcast("highlightFeatureOnMap", spatialFeatureName); + } + }); + $scope.radarChart.on('mouseOut', function (params) { + // $scope.userHoveresOverItem = false; + var spatialFeatureName = params.data.name; + // console.log(spatialFeatureName); + if (spatialFeatureName) { + $rootScope.$broadcast("unhighlightFeatureOnMap", spatialFeatureName); + } + }); + //disable feature removal for radar chart - seems to be unintuititve + // $scope.radarChart.on('click', function(params){ + // var spatialFeatureName = params.data.name; + // // console.log(spatialFeatureName); + // if(spatialFeatureName){ + // $rootScope.$broadcast("switchHighlightFeatureOnMap", spatialFeatureName); + // } + // }); + $scope.eventsRegistered = true; + } + } + ; + $scope.$on("updateDiagramsForHoveredFeature", function (event, featureProperties) { + if (!$scope.radarChart || !$scope.radarOption || !$scope.radarOption.legend || !$scope.radarOption.series) { + return; + } + if (!kommonitorFilterHelperService.featureIsCurrentlySelected(featureProperties[__env.FEATURE_ID_PROPERTY_NAME])) { + appendSeriesToRadarChart(featureProperties); + } + highlightFeatureInRadarChart(featureProperties); + }); + var appendSeriesToRadarChart = function (featureProperties) { + // append feature name to legend + $scope.radarOption.legend.data.push(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); + // create feature data series + var featureSeries = {}; + featureSeries.name = featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]; + featureSeries.value = new Array(); + featureSeries.emphasis = { + lineStyle: { + width: 4, + type: 'dotted' + } + }; + featureSeries.lineStyle = { + width: 3, + type: 'solid' + }; + featureSeries.itemStyle = { + borderWidth: 2 + }; + // for each indicator create series data entry for feature + for (var i = 0; i < kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime.length; i++) { + if (kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime[i].isSelected) { + // make object to hold indicatorName, max value and average value + var indicatorProperties = kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime[i].indicatorProperties; + var date = kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime[i].selectedDate; + for (var indicatorPropertyInstance of indicatorProperties) { + if (indicatorPropertyInstance[__env.FEATURE_NAME_PROPERTY_NAME] == featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]) { + if (!kommonitorDataExchangeService.indicatorValueIsNoData(indicatorPropertyInstance[DATE_PREFIX + date])) { + featureSeries.value.push(kommonitorDataExchangeService.getIndicatorValueFromArray_asNumber(indicatorPropertyInstance, date)); + } + else { + featureSeries.value.push(null); + } + break; + } + } + } + } + $scope.radarOption.series[0].data.push(featureSeries); + $scope.radarChart.setOption($scope.radarOption); + setTimeout(function () { + $scope.radarChart.resize(); + }, 350); + registerEventsIfNecessary(); + }; + var highlightFeatureInRadarChart = function (featureProperties) { + // highlight the corresponding bar diagram item + // get series index of series + var dataIndex = getSeriesDataIndexByFeatureName(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); + if (dataIndex > -1) { + $scope.radarChart.dispatchAction({ + type: 'highlight', + seriesIndex: 0, + dataIndex: dataIndex + }); + } + }; + $scope.$on("updateDiagramsForUnhoveredFeature", function (event, featureProperties) { + if (!$scope.radarChart || !$scope.radarOption || !$scope.radarOption.legend || !$scope.radarOption.series) { + return; + } + unhighlightFeatureInRadarChart(featureProperties); + if (!kommonitorFilterHelperService.featureIsCurrentlySelected(featureProperties[__env.FEATURE_ID_PROPERTY_NAME])) { + removeSeriesFromRadarChart(featureProperties); + } + }); + var getSeriesDataIndexByFeatureName = function (featureName) { + for (var index = 0; index < $scope.radarOption.series[0].data.length; index++) { + if ($scope.radarOption.series[0].data[index].name == featureName) + return index; + } + //return -1 if none was found + return -1; + }; + var removeSeriesFromRadarChart = function (featureProperties) { + // remove feature from legend + var legendIndex = $scope.radarOption.legend.data.indexOf(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); + if (legendIndex > -1) { + $scope.radarOption.legend.data.splice(legendIndex, 1); + } + // remove feature data series + var dataIndex = getSeriesDataIndexByFeatureName(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); + if (dataIndex > -1) { + $scope.radarOption.series[0].data.splice(dataIndex, 1); + } + // second parameter tells echarts to not merge options with previous data. hence really remove series from graphic + $scope.radarChart.setOption($scope.radarOption, true); + setTimeout(function () { + $scope.radarChart.resize(); + }, 350); + registerEventsIfNecessary(); + }; + var unhighlightFeatureInRadarChart = function (featureProperties) { + // highlight the corresponding bar diagram item + // get series index of series + var dataIndex = getSeriesDataIndexByFeatureName(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); + if (dataIndex > -1) { + $scope.radarChart.dispatchAction({ + type: 'downplay', + seriesIndex: 0, + dataIndex: dataIndex + }); + } + }; + this.filterDisplayedIndicatorsOnRadar = function () { + console.log("Filtering indicator radar"); + modifyRadarContent(kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime); + }; + this.selectAllIndicatorsForRadar = function () { + for (var indicator of kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime) { + indicator.isSelected = true; + } + modifyRadarContent(kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime); + }; + this.deselectAllIndicatorsForRadar = function () { + for (var indicator of kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime) { + indicator.isSelected = false; + } + modifyRadarContent(kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime); + }; + } + ] +}); +//# sourceMappingURL=indicator-radar.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.component.js.map b/app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.component.js.map new file mode 100644 index 000000000..083afbe64 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"indicator-radar.component.js","sourceRoot":"","sources":["indicator-radar.component.ts"],"names":[],"mappings":";AAAA,OAAO;KACL,MAAM,CAAC,gBAAgB,CAAC;KACxB,SAAS,CACT,gBAAgB,EAChB;IAC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,CAAC,iBAAiB,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC,CAAC;gBAErG,IAAI,SAAS,GAAG,CAAC,CAAC,EAAE;oBACnB,MAAM,CAAC,UAAU,CAAC,cAAc,CAAC;wBAChC,IAAI,EAAE,UAAU;wBAChB,WAAW,EAAE,CAAC;wBACd,SAAS,EAAE,SAAS;qBACpB,CAAC,CAAC;iBACH;YACF,CAAC,CAAC;YAEF,IAAI,CAAC,gCAAgC,GAAG;gBACvC,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;gBAEzC,kBAAkB,CAAC,8BAA8B,CAAC,+CAA+C,CAAC,CAAC;YAEpG,CAAC,CAAA;YAED,IAAI,CAAC,2BAA2B,GAAG;gBAElC,KAAK,IAAI,SAAS,IAAI,8BAA8B,CAAC,+CAA+C,EAAE;oBACrG,SAAS,CAAC,UAAU,GAAG,IAAI,CAAC;iBAC5B;gBAED,kBAAkB,CAAC,8BAA8B,CAAC,+CAA+C,CAAC,CAAC;YACpG,CAAC,CAAA;YAED,IAAI,CAAC,6BAA6B,GAAG;gBAEpC,KAAK,IAAI,SAAS,IAAI,8BAA8B,CAAC,+CAA+C,EAAE;oBACrG,SAAS,CAAC,UAAU,GAAG,KAAK,CAAC;iBAC7B;gBAED,kBAAkB,CAAC,8BAA8B,CAAC,+CAA+C,CAAC,CAAC;YACpG,CAAC,CAAA;QAGF,CAAC;KAAC;CACH,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.component.ts b/app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.component.ts new file mode 100644 index 000000000..95cceef81 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.component.ts @@ -0,0 +1,612 @@ +angular + .module('indicatorRadar') + .component( + 'indicatorRadar', + { + templateUrl: "components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.template.html", + + controller: [ + 'kommonitorDataExchangeService', 'kommonitorDiagramHelperService', 'kommonitorFilterHelperService', '$scope', '$rootScope', '$timeout', '$http', '__env', + function indicatorRadarController( + kommonitorDataExchangeService, kommonitorDiagramHelperService, kommonitorFilterHelperService, $scope, $rootScope, $timeout, $http, __env) { + /* + * reference to kommonitorDataExchangeService instances + */ + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorDiagramHelperServiceInstance = kommonitorDiagramHelperService; + + var self = this; + + $scope.activeTab = 0; + + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + $(window).on('resize', function () { + if ($scope.radarChart != null && $scope.radarChart != undefined) { + $scope.radarChart.resize(); + } + }); + + $scope.$on("resizeDiagrams", function (event) { + + setTimeout(function () { + if ($scope.radarChart != null && $scope.radarChart != undefined) { + $scope.radarChart.resize(); + } + }, 350); + }); + + const DATE_PREFIX = __env.indicatorDatePrefix; + + $scope.indicatorNameFilter = undefined; + + $scope.eventsRegistered = false; + + var numberOfDecimals = __env.numberOfDecimals; + + $scope.setupCompleted = true; + + $scope.onChangeFilterSameUnitAndSameTime = function(){ + if($scope.radarChart){ + $scope.radarChart.dispose(); + $scope.radarChart = echarts.init(document.getElementById('radarDiagram')); + } + kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime = []; + + kommonitorDiagramHelperService.setupIndicatorPropertiesForCurrentSpatialUnitAndTime(kommonitorDiagramHelperService.filterSameUnitAndSameTime); + }; + + $scope.date; + $scope.spatialUnitName; + + $scope.$on("updateDiagrams", function (event, indicatorMetadataAndGeoJSON, spatialUnitName, spatialUnitId, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue, justRestyling) { + + // if the layer is just restyled (i.e. due to change of measureOfValue) + // then we do not need to costly update the radar diagram + if (justRestyling) { + return; + } + + console.log("updating radar diagram"); + + $scope.setupCompleted = false; + + updateRadarChart(indicatorMetadataAndGeoJSON, spatialUnitName, spatialUnitId, date); + + $rootScope.$broadcast("preserveHighlightedFeatures"); + + }); + + // RADAR CHART TIME SERIES FUNCTION + var updateRadarChart = async function (indicatorMetadataAndGeoJSON, spatialUnitName, spatialUnitId, date) { + // based on prepared DOM, initialize echarts instance + $scope.date = date; + $scope.spatialUnitName = spatialUnitName; + + if (!$scope.radarChart) + $scope.radarChart = echarts.init(document.getElementById('radarDiagram')); + else { + // explicitly kill and reinstantiate radar diagram to avoid zombie states on spatial unit change + $scope.radarChart.dispose(); + $scope.radarChart = echarts.init(document.getElementById('radarDiagram')); + kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime = new Array(); + } + + await $scope.radarChart.showLoading(); + + kommonitorDiagramHelperService.setupIndicatorPropertiesForCurrentSpatialUnitAndTime(); + + $scope.activeTab = 0; + if(kommonitorDataExchangeService.selectedIndicator.creationType == "COMPUTATION"){ + $scope.activeTab = 1; + } + if(kommonitorDataExchangeService.selectedIndicator.isHeadlineIndicator){ + $scope.activeTab = 2; + } + + modifyRadarContent(kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime); + }; + + $scope.onChangeSelectedDate = function(input){ + if(input.isSelected){ + modifyRadarContent(kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime); + } + }; + + var wait = ms => new Promise((r, j) => setTimeout(r, ms)); + + $scope.$on("allIndicatorPropertiesForCurrentSpatialUnitAndTime setup begin", async function (event) { + + await wait(130); + $scope.setupCompleted = false; + + + $timeout(function(){ + $scope.$digest(); + }, 500); + + }); + + $scope.$on("allIndicatorPropertiesForCurrentSpatialUnitAndTime setup completed", async function (event) { + + await wait(130); + $scope.setupCompleted = true; + + + $timeout(function(){ + $scope.$digest(); + self.filterDisplayedIndicatorsOnRadar(); + }, 500); + + }); + + var modifyRadarContent = async function (indicatorsForRadar) { + var indicatorArrayForRadarChart = new Array(); + var defaultSeriesValueArray = new Array(); + + var sampleProperties = null; + + for (var i = 0; i < indicatorsForRadar.length; i++) { + if (indicatorsForRadar[i].isSelected) { + + await kommonitorDiagramHelperService.fetchIndicatorPropertiesIfNotExists(i); + + // make object to hold indicatorName, max value and average value + var indicatorProperties = indicatorsForRadar[i].indicatorProperties; + + if(kommonitorFilterHelperService.completelyRemoveFilteredFeaturesFromDisplay && kommonitorFilterHelperService.filteredIndicatorFeatureIds.size > 0){ + indicatorProperties = indicatorProperties.filter(featureProperties => ! kommonitorFilterHelperService.featureIsCurrentlyFiltered(featureProperties[__env.FEATURE_ID_PROPERTY_NAME])); + } + + sampleProperties = indicatorsForRadar[i].indicatorProperties; + + // var closestApplicableTimestamp = kommonitorDiagramHelperService.findClostestTimestamForTargetDate(indicatorsForRadar[i], $scope.date); + // indicatorsForRadar[i].closestTimestamp = closestApplicableTimestamp; + + var sample = indicatorProperties[0]; + var maxValue = sample[DATE_PREFIX + indicatorsForRadar[i].selectedDate]; + var minValue = sample[DATE_PREFIX + indicatorsForRadar[i].selectedDate]; + var valueSum = 0; + + for (var indicatorPropertyInstance of indicatorProperties) { + // for average only apply real numeric values + if (!kommonitorDataExchangeService.indicatorValueIsNoData(indicatorPropertyInstance[DATE_PREFIX + indicatorsForRadar[i].selectedDate])) { + var value = kommonitorDataExchangeService.getIndicatorValueFromArray_asNumber(indicatorPropertyInstance, indicatorsForRadar[i].selectedDate) + valueSum += value; + + if (value > maxValue) + maxValue = value; + + if (value < minValue) + minValue = value; + } + } + + if (minValue == null) { + minValue = 0; + } + + if (maxValue == null) { + maxValue = 1; + } + + // IT MIGHT HAPPEN THAT AN INDICATOR IS INSPECTED THAT DOES NOT SUPPORT THE DATE + // HENCE ONLY ADD VALUES TO DEFAULT IF THEY SHOW MEANINGFUL VALUES + // if(valueSum != null){ + indicatorArrayForRadarChart.push({ + name: indicatorsForRadar[i].indicatorMetadata.indicatorName + " - " + indicatorsForRadar[i].selectedDate, + unit: indicatorsForRadar[i].indicatorMetadata.unit, + max: maxValue, + min: minValue + }); + + defaultSeriesValueArray.push(kommonitorDataExchangeService.getIndicatorValue_asNumber(Number(valueSum / indicatorProperties.length))); + // } + } + + } + + if (defaultSeriesValueArray.length === 0) { + + if ($scope.radarChart) { + $scope.radarChart.dispose(); + $scope.radarChart = undefined; + } + + } + else { + + if (!$scope.radarChart) + $scope.radarChart = echarts.init(document.getElementById('radarDiagram')); + // else{ + // // explicitly kill and reinstantiate radar diagram to avoid zombie states on spatial unit change + // $scope.radarChart.dispose(); + // $scope.radarChart = echarts.init(document.getElementById('radarDiagram')); + // } + + $scope.radarOption = { + grid: { + left: '4%', + top: 0, + right: '4%', + bottom: 30, + containLabel: true + }, + title: { + text: 'Indikatorenradar - ' + $scope.spatialUnitName + ' - ' + $scope.date, + left: 'center', + top: 0, + show: false + }, + tooltip: { + confine: 'true', + formatter: function (params) { + + var string = "" + params.name + "
        "; + + for (var index = 0; index < params.value.length; index++) { + string += $scope.radarOption.radar.indicator[index].name + ": " + kommonitorDataExchangeService.getIndicatorValue_asFormattedText(params.value[index]) + " [" + $scope.radarOption.radar.indicator[index].unit + "]
        "; + }; + + return string; + } + // position: ['50%', '50%'] + }, + toolbox: { + show: true, + right: '15', + feature: { + // mark : {show: true}, + dataView: { + show: kommonitorDataExchangeService.showDiagramExportButtons, readOnly: true, title: "Datenansicht", lang: ['Datenansicht - Indikatorenradar', 'schließen', 'refresh'], optionToContent: function (opt) { + + // + // + // + // + // + // + // + // + // + // + // + // + // + //
        Indikator-NameBeschreibung der Verknüpfung
        {{indicator.referencedIndicatorName}}{{indicator.referencedIndicatorDescription}}
        + + var radarSeries = opt.series[0].data; + var indicators = opt.radar[0].indicator; + + var dataTableId = "radarDataTable"; + var tableExportName = opt.title[0].text; + + var htmlString = ''; + htmlString += ""; + htmlString += ""; + htmlString += ""; + + for (var i = 0; i < indicators.length; i++) { + htmlString += ""; + } + + htmlString += ""; + htmlString += ""; + + htmlString += ""; + + + + for (var j = 0; j < radarSeries.length; j++) { + htmlString += ""; + htmlString += ""; + for (var k = 0; k < indicators.length; k++) { + htmlString += ""; + } + htmlString += ""; + } + + htmlString += ""; + htmlString += "
        Feature-Name" + indicators[i].name + " [" + indicators[i].unit + "]
        " + radarSeries[j].name + "" + kommonitorDataExchangeService.getIndicatorValue_asNumber(radarSeries[j].value[k]) + "
        "; + + $rootScope.$broadcast("AppendExportButtonsForTable", dataTableId, tableExportName); + + return htmlString; + } + }, + restore: { show: false, title: "Darstellung erneuern" }, + saveAsImage: { show: true, title: "Export", pixelRatio: 4 } + } + }, + legend: { + type: "scroll", + bottom: 0, + align: 'left', + left: 5, + data: ['Arithmetisches Mittel'] + }, + radar: { + // shape: 'circle', + // name: { + // textStyle: { + // color: '#fff', + // backgroundColor: '#999', + // borderRadius: 3, + // padding: [3, 5] + // } + // }, + name: { + formatter: function (value, indicator) { + + return kommonitorDataExchangeService.formatIndicatorNameForLabel(value, 15); + }, + textStyle: { + color: '#525252' + }, + fontSize: 11 + }, + indicator: indicatorArrayForRadarChart + }, + series: [{ + name: 'Indikatorvergleich', + type: 'radar', + symbolSize: 8, + data: [ + { + value: defaultSeriesValueArray, + name: 'Arithmetisches Mittel', + lineStyle: { + color: 'gray', + type: 'dashed', + width: 3 + }, + itemStyle: { + borderWidth: 2, + color: 'gray' + }, + emphasis: { + lineStyle: { + width: 4 + }, + itemStyle: { + borderType: 'dashed' + } + } + } + ] + }] + }; + + // check if any feature is still clicked/selected + // then append those as series within radar chart + appendSelectedFeaturesIfNecessary(sampleProperties); + + // use configuration item and data specified to show chart + $scope.radarChart.setOption($scope.radarOption); + + $scope.radarChart.hideLoading(); + setTimeout(function () { + $scope.radarChart.resize(); + $scope.$digest(); + }, 350); + registerEventsIfNecessary(); + + } + + } + + var appendSelectedFeaturesIfNecessary = function (sampleProperties) { + + for (var propertiesInstance of sampleProperties) { + if (kommonitorFilterHelperService.featureIsCurrentlySelected(propertiesInstance[__env.FEATURE_ID_PROPERTY_NAME])) { + appendSeriesToRadarChart(propertiesInstance); + } + } + }; + + function registerEventsIfNecessary() { + if (!$scope.eventsRegistered) { + // when hovering over elements of the chart then highlight them in the map. + $scope.radarChart.on('mouseOver', function (params) { + // $scope.userHoveresOverItem = true; + var spatialFeatureName = params.data.name; + // console.log(spatialFeatureName); + if(spatialFeatureName){ + $rootScope.$broadcast("highlightFeatureOnMap", spatialFeatureName); + } + + }); + + $scope.radarChart.on('mouseOut', function (params) { + // $scope.userHoveresOverItem = false; + + var spatialFeatureName = params.data.name; + // console.log(spatialFeatureName); + if(spatialFeatureName){ + $rootScope.$broadcast("unhighlightFeatureOnMap", spatialFeatureName); + } + + }); + + //disable feature removal for radar chart - seems to be unintuititve + // $scope.radarChart.on('click', function(params){ + // var spatialFeatureName = params.data.name; + // // console.log(spatialFeatureName); + // if(spatialFeatureName){ + // $rootScope.$broadcast("switchHighlightFeatureOnMap", spatialFeatureName); + // } + // }); + + $scope.eventsRegistered = true; + } + }; + + + $scope.$on("updateDiagramsForHoveredFeature", function (event, featureProperties) { + + if (!$scope.radarChart || !$scope.radarOption || !$scope.radarOption.legend || !$scope.radarOption.series) { + return; + } + + if (!kommonitorFilterHelperService.featureIsCurrentlySelected(featureProperties[__env.FEATURE_ID_PROPERTY_NAME])) { + appendSeriesToRadarChart(featureProperties); + } + + highlightFeatureInRadarChart(featureProperties); + }); + + var appendSeriesToRadarChart = function (featureProperties) { + // append feature name to legend + $scope.radarOption.legend.data.push(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); + + // create feature data series + var featureSeries = {}; + featureSeries.name = featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]; + featureSeries.value = new Array(); + featureSeries.emphasis = { + lineStyle: { + width: 4, + type: 'dotted' + } + }; + featureSeries.lineStyle = { + width: 3, + type: 'solid' + }; + featureSeries.itemStyle = { + borderWidth: 2 + }; + + + // for each indicator create series data entry for feature + for (var i = 0; i < kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime.length; i++) { + if (kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime[i].isSelected) { + // make object to hold indicatorName, max value and average value + var indicatorProperties = kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime[i].indicatorProperties; + var date = kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime[i].selectedDate; + + for (var indicatorPropertyInstance of indicatorProperties) { + if (indicatorPropertyInstance[__env.FEATURE_NAME_PROPERTY_NAME] == featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]) { + if (!kommonitorDataExchangeService.indicatorValueIsNoData(indicatorPropertyInstance[DATE_PREFIX + date])) { + featureSeries.value.push(kommonitorDataExchangeService.getIndicatorValueFromArray_asNumber(indicatorPropertyInstance, date)); + } + else { + featureSeries.value.push(null); + } + break; + } + } + } + + } + + $scope.radarOption.series[0].data.push(featureSeries); + + $scope.radarChart.setOption($scope.radarOption); + setTimeout(function () { + $scope.radarChart.resize(); + }, 350); + registerEventsIfNecessary(); + }; + + var highlightFeatureInRadarChart = function (featureProperties) { + // highlight the corresponding bar diagram item + // get series index of series + var dataIndex = getSeriesDataIndexByFeatureName(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); + + if (dataIndex > -1) { + $scope.radarChart.dispatchAction({ + type: 'highlight', + seriesIndex: 0, + dataIndex: dataIndex + }); + } + }; + + $scope.$on("updateDiagramsForUnhoveredFeature", function (event, featureProperties) { + + if (!$scope.radarChart || !$scope.radarOption || !$scope.radarOption.legend || !$scope.radarOption.series) { + return; + } + + unhighlightFeatureInRadarChart(featureProperties); + + if (!kommonitorFilterHelperService.featureIsCurrentlySelected(featureProperties[__env.FEATURE_ID_PROPERTY_NAME])) { + removeSeriesFromRadarChart(featureProperties); + } + }); + + var getSeriesDataIndexByFeatureName = function (featureName) { + for (var index = 0; index < $scope.radarOption.series[0].data.length; index++) { + if ($scope.radarOption.series[0].data[index].name == featureName) + return index; + } + + //return -1 if none was found + return -1; + }; + + var removeSeriesFromRadarChart = function (featureProperties) { + // remove feature from legend + var legendIndex = $scope.radarOption.legend.data.indexOf(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); + if (legendIndex > -1) { + $scope.radarOption.legend.data.splice(legendIndex, 1); + } + + // remove feature data series + var dataIndex = getSeriesDataIndexByFeatureName(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); + if (dataIndex > -1) { + $scope.radarOption.series[0].data.splice(dataIndex, 1); + } + + // second parameter tells echarts to not merge options with previous data. hence really remove series from graphic + $scope.radarChart.setOption($scope.radarOption, true); + setTimeout(function () { + $scope.radarChart.resize(); + }, 350); + registerEventsIfNecessary(); + }; + + var unhighlightFeatureInRadarChart = function (featureProperties) { + // highlight the corresponding bar diagram item + // get series index of series + var dataIndex = getSeriesDataIndexByFeatureName(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); + + if (dataIndex > -1) { + $scope.radarChart.dispatchAction({ + type: 'downplay', + seriesIndex: 0, + dataIndex: dataIndex + }); + } + }; + + this.filterDisplayedIndicatorsOnRadar = function () { + console.log("Filtering indicator radar"); + + modifyRadarContent(kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime); + + } + + this.selectAllIndicatorsForRadar = function () { + + for (var indicator of kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime) { + indicator.isSelected = true; + } + + modifyRadarContent(kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime); + } + + this.deselectAllIndicatorsForRadar = function () { + + for (var indicator of kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime) { + indicator.isSelected = false; + } + + modifyRadarContent(kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime); + } + + + }] + }); diff --git a/app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.module.js b/app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.module.js index 4358673cd..a6bc83418 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.module.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.module.js @@ -1 +1,3 @@ -angular.module('indicatorRadar', [ 'kommonitorDataExchange', 'kommonitorDiagramHelper']); +"use strict"; +angular.module('indicatorRadar', ['kommonitorDataExchange', 'kommonitorDiagramHelper']); +//# sourceMappingURL=indicator-radar.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.module.js.map b/app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.module.js.map new file mode 100644 index 000000000..d2839e7fa --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"indicator-radar.module.js","sourceRoot":"","sources":["indicator-radar.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAE,wBAAwB,EAAE,yBAAyB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.module.ts b/app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.module.ts new file mode 100644 index 000000000..4358673cd --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.module.ts @@ -0,0 +1 @@ +angular.module('indicatorRadar', [ 'kommonitorDataExchange', 'kommonitorDiagramHelper']); diff --git a/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.component.js b/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.component.js index 90d76b4ef..07543d08e 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.component.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.component.js @@ -1,81 +1,68 @@ +"use strict"; angular.module('infoModal').component('infoModal', { - templateUrl : "components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.template.html", - controller : [ - 'kommonitorDataExchangeService', '$scope', '$rootScope', '__env', '$timeout', - function InfoModalController(kommonitorDataExchangeService, $scope, $rootScope, __env, $timeout) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - - $scope.isHideGreetings = false; - - $scope.init = function(){ - if(! (localStorage.getItem("hideKomMonitorAppGreeting") === "true")) { - - $scope.isHideGreetings = false; - - $('#infoModal').modal('show'); - } - else{ - $scope.isHideGreetings = true; - $("#changeHideGreetingsInput").prop('checked', true); - } - - let tab1 = document.getElementById("infoModalTab1"); - tab1.innerHTML = __env.standardInfoModalTabTitle; - tab1.click(); - tab1.focus(); - - if(__env.enableExtendedInfoModal) { - let tab3 = document.getElementById("infoModalTab3"); - let tab3content = document.getElementById("infoModalTab3Content"); - tab3.innerHTML = __env.extendedInfoModalTabTitle; - tab3content.innerHTML = __env.extendedInfoModalHTMLMessage; - } else { - document.getElementById("infoModalTab3").style.display = "none"; - } - - - $timeout(function(){ - $scope.$digest(); - }, 250); - - }; - - var onChangeHideGreetings = function(){ - if($scope.isHideGreetings){ - localStorage.setItem("hideKomMonitorAppGreeting", "true"); - } - else{ - localStorage.setItem("hideKomMonitorAppGreeting", "false"); - } - }; - - $('#changeHideGreetingsInput').on('click', function(event) { - - if($scope.isHideGreetings){ - $scope.isHideGreetings = false; - } - else{ - $scope.isHideGreetings = true; - } - onChangeHideGreetings(); - event.stopPropagation(); - }); - - var callStartGuidedTour = function(){ - $('#infoModal').modal('hide'); - $rootScope.$broadcast("startGuidedTour"); - }; - - $(document).on('click', '#callStartGuidedTourButton', function (e) { - callStartGuidedTour(); - }); - - $scope.showFeedbackForm = function(){ - $('#infoModal').modal('hide'); - $('#feedbackModal').modal('show'); - }; - - $scope.init(); - } -]}); + templateUrl: "components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.template.html", + controller: [ + 'kommonitorDataExchangeService', '$scope', '$rootScope', '__env', '$timeout', + function InfoModalController(kommonitorDataExchangeService, $scope, $rootScope, __env, $timeout) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + $scope.isHideGreetings = false; + $scope.init = function () { + if (!(localStorage.getItem("hideKomMonitorAppGreeting") === "true")) { + $scope.isHideGreetings = false; + $('#infoModal').modal('show'); + } + else { + $scope.isHideGreetings = true; + $("#changeHideGreetingsInput").prop('checked', true); + } + let tab1 = document.getElementById("infoModalTab1"); + tab1.innerHTML = __env.standardInfoModalTabTitle; + tab1.click(); + tab1.focus(); + if (__env.enableExtendedInfoModal) { + let tab3 = document.getElementById("infoModalTab3"); + let tab3content = document.getElementById("infoModalTab3Content"); + tab3.innerHTML = __env.extendedInfoModalTabTitle; + tab3content.innerHTML = __env.extendedInfoModalHTMLMessage; + } + else { + document.getElementById("infoModalTab3").style.display = "none"; + } + $timeout(function () { + $scope.$digest(); + }, 250); + }; + var onChangeHideGreetings = function () { + if ($scope.isHideGreetings) { + localStorage.setItem("hideKomMonitorAppGreeting", "true"); + } + else { + localStorage.setItem("hideKomMonitorAppGreeting", "false"); + } + }; + $('#changeHideGreetingsInput').on('click', function (event) { + if ($scope.isHideGreetings) { + $scope.isHideGreetings = false; + } + else { + $scope.isHideGreetings = true; + } + onChangeHideGreetings(); + event.stopPropagation(); + }); + var callStartGuidedTour = function () { + $('#infoModal').modal('hide'); + $rootScope.$broadcast("startGuidedTour"); + }; + $(document).on('click', '#callStartGuidedTourButton', function (e) { + callStartGuidedTour(); + }); + $scope.showFeedbackForm = function () { + $('#infoModal').modal('hide'); + $('#feedbackModal').modal('show'); + }; + $scope.init(); + } + ] +}); +//# sourceMappingURL=info-modal.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.component.js.map b/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.component.js.map new file mode 100644 index 000000000..cbae76592 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"info-modal.component.js","sourceRoot":"","sources":["info-modal.component.ts"],"names":[],"mappings":";AAAA,OAAO,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AAC;YAEF,MAAM,CAAC,IAAI,EAAE,CAAC;QACf,CAAC;KACD;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.component.ts b/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.component.ts new file mode 100644 index 000000000..90d76b4ef --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.component.ts @@ -0,0 +1,81 @@ +angular.module('infoModal').component('infoModal', { + templateUrl : "components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.template.html", + controller : [ + 'kommonitorDataExchangeService', '$scope', '$rootScope', '__env', '$timeout', + function InfoModalController(kommonitorDataExchangeService, $scope, $rootScope, __env, $timeout) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + + $scope.isHideGreetings = false; + + $scope.init = function(){ + if(! (localStorage.getItem("hideKomMonitorAppGreeting") === "true")) { + + $scope.isHideGreetings = false; + + $('#infoModal').modal('show'); + } + else{ + $scope.isHideGreetings = true; + $("#changeHideGreetingsInput").prop('checked', true); + } + + let tab1 = document.getElementById("infoModalTab1"); + tab1.innerHTML = __env.standardInfoModalTabTitle; + tab1.click(); + tab1.focus(); + + if(__env.enableExtendedInfoModal) { + let tab3 = document.getElementById("infoModalTab3"); + let tab3content = document.getElementById("infoModalTab3Content"); + tab3.innerHTML = __env.extendedInfoModalTabTitle; + tab3content.innerHTML = __env.extendedInfoModalHTMLMessage; + } else { + document.getElementById("infoModalTab3").style.display = "none"; + } + + + $timeout(function(){ + $scope.$digest(); + }, 250); + + }; + + var onChangeHideGreetings = function(){ + if($scope.isHideGreetings){ + localStorage.setItem("hideKomMonitorAppGreeting", "true"); + } + else{ + localStorage.setItem("hideKomMonitorAppGreeting", "false"); + } + }; + + $('#changeHideGreetingsInput').on('click', function(event) { + + if($scope.isHideGreetings){ + $scope.isHideGreetings = false; + } + else{ + $scope.isHideGreetings = true; + } + onChangeHideGreetings(); + event.stopPropagation(); + }); + + var callStartGuidedTour = function(){ + $('#infoModal').modal('hide'); + $rootScope.$broadcast("startGuidedTour"); + }; + + $(document).on('click', '#callStartGuidedTourButton', function (e) { + callStartGuidedTour(); + }); + + $scope.showFeedbackForm = function(){ + $('#infoModal').modal('hide'); + $('#feedbackModal').modal('show'); + }; + + $scope.init(); + } +]}); diff --git a/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.module.js b/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.module.js index 3b47b77ce..9c9d0df40 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.module.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('infoModal', ['versionInfo']); +//# sourceMappingURL=info-modal.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.module.js.map b/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.module.js.map new file mode 100644 index 000000000..c10e24a3d --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"info-modal.module.js","sourceRoot":"","sources":["info-modal.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.module.ts b/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.module.ts new file mode 100644 index 000000000..3b47b77ce --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.module.ts @@ -0,0 +1 @@ +angular.module('infoModal', ['versionInfo']); diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorBalance/kommonitor-balance.component.js b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorBalance/kommonitor-balance.component.js index c1a9e683b..fc67fc291 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorBalance/kommonitor-balance.component.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorBalance/kommonitor-balance.component.js @@ -1,498 +1,400 @@ +"use strict"; angular - .module('kommonitorBalance') - .component( - 'kommonitorBalance', - { - templateUrl : "components/kommonitorUserInterface/kommonitorControls/kommonitorBalance/kommonitor-balance.template.html", - /* - * injected with a modules service method that manages - * enabled tabs - */ - controller : ['$scope', '$rootScope', 'kommonitorMapService', 'kommonitorDataExchangeService', 'kommonitorDiagramHelperService', - 'kommonitorFilterHelperService', '__env', '$timeout', - function kommonitorBalanceController($scope, $rootScope, kommonitorMapService, kommonitorDataExchangeService, kommonitorDiagramHelperService, - kommonitorFilterHelperService, __env, $timeout) { - - const INDICATOR_DATE_PREFIX = __env.indicatorDatePrefix; - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorMapServiceInstance = kommonitorMapService; - // initialize any adminLTE box widgets - $('.box').boxWidget(); - var numberOfDecimals = __env.numberOfDecimals; - - $scope.targetDate; - $scope.targetIndicatorProperty; - $scope.rangeSliderForBalance; - $scope.datesAsMs; - - $scope.trendConfig_allFeatures = { - showMinMax: true, - showCompleteTimeseries: true, - trendComputationType: "linear" - }; - - $scope.$on("DisableBalance", function (event) { - kommonitorDataExchangeService.isBalanceChecked = false; - if($scope.rangeSliderForBalance){ - $scope.rangeSliderForBalance.update({ - block: true - }); - } - - // reanebalbe DateSlider on map - $rootScope.$broadcast("EnableDateSlider"); - }); - - $scope.$on("replaceBalancedIndicator", function (event) { - if(kommonitorDataExchangeService.isBalanceChecked){ - $scope.onChangeUseBalance(); - } - }); - - $scope.onChangeUseBalance = function(){ - - if(kommonitorDataExchangeService.isMeasureOfValueChecked){ - kommonitorDataExchangeService.isMeasureOfValueChecked = false; - } - - let indicatorMetadataAndGeoJSON = undefined; - - if(kommonitorDataExchangeService.isBalanceChecked){ - kommonitorDataExchangeService.isMeasureOfValueChecked = false; - $scope.rangeSliderForBalance.update({ - block: false - }); - // disable DateSlider on map - $rootScope.$broadcast("DisableDateSlider"); - if(!kommonitorDataExchangeService.indicatorAndMetadataAsBalance){ - kommonitorDataExchangeService.indicatorAndMetadataAsBalance = jQuery.extend(true, {}, kommonitorDataExchangeService.selectedIndicator); - var indicatorType = kommonitorDataExchangeService.selectedIndicator.indicatorType; - if(indicatorType.includes("ABSOLUTE")){ - kommonitorDataExchangeService.indicatorAndMetadataAsBalance.indicatorType = "DYNAMIC_ABSOLUTE"; - } - else if(indicatorType.includes("RELATIVE")){ - kommonitorDataExchangeService.indicatorAndMetadataAsBalance.indicatorType = "DYNAMIC_RELATIVE"; - } - else if(indicatorType.includes("STANDARDIZED")){ - kommonitorDataExchangeService.indicatorAndMetadataAsBalance.indicatorType = "DYNAMIC_STANDARDIZED"; - } - - } - var data = $scope.rangeSliderForBalance.options; - computeAndSetBalance(data); - $timeout(function(){ - - $scope.updateTrendChart(kommonitorDataExchangeService.selectedIndicator, data); - }); - indicatorMetadataAndGeoJSON = kommonitorDataExchangeService.indicatorAndMetadataAsBalance; - // kommonitorMapService.replaceIndicatorGeoJSON(kommonitorDataExchangeService.indicatorAndMetadataAsBalance, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, $scope.targetDate, true); - } - else{ - $scope.rangeSliderForBalance.update({ - block: true - }); - // reanebalbe DateSlider on map - $rootScope.$broadcast("EnableDateSlider"); - indicatorMetadataAndGeoJSON = kommonitorDataExchangeService.selectedIndicator; - // kommonitorMapService.replaceIndicatorGeoJSON(kommonitorDataExchangeService.selectedIndicator, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, $scope.targetDate, true); - } - // $rootScope.$broadcast("updateIndicatorValueRangeFilter", $scope.targetDate, indicatorMetadataAndGeoJSON); - // do not replace dataset directly, but check if any filter can be applied when changing balance mode for the current dataset - kommonitorFilterHelperService.filterAndReplaceDataset(); - }; - - function getFromDate_asPropertyString(datePeriodSliderData){ - // data.from and data.to are index values, not the actual dates! (because we use "values" for rangeSlider) - var fromDate = new Date($scope.datesAsMs[datePeriodSliderData.from]); - - var fromDateAsPropertyString = makePropertyString(fromDate); - var fromDateAsString = makeDateString(fromDate); - if(!kommonitorDataExchangeService.indicatorAndMetadataAsBalance.applicableDates.includes(fromDateAsString)){ - fromDateAsPropertyString = snapToNearestUpperDate(fromDate, kommonitorDataExchangeService.indicatorAndMetadataAsBalance.applicableDates); - } - - return fromDateAsPropertyString; - } - - function getFromDate_asDateString(datePeriodSliderData){ - // data.from and data.to are index values, not the actual dates! (because we use "values" for rangeSlider) - var fromDate = new Date($scope.datesAsMs[datePeriodSliderData.from]); - - var fromDateAsString = makeDateString(fromDate); - - return fromDateAsString; - } - - function getToDate_asPropertyString(datePeriodSliderData){ - // data.from and data.to are index values, not the actual dates! (because we use "values" for rangeSlider) - var toDate = new Date($scope.datesAsMs[datePeriodSliderData.to]); - - var toDateAsPropertyString = makePropertyString(toDate); - var toDateAsString = makeDateString(toDate); - if(!kommonitorDataExchangeService.indicatorAndMetadataAsBalance.applicableDates.includes(toDateAsString)){ - toDateAsPropertyString = snapToNearestLowerDate(toDate, kommonitorDataExchangeService.indicatorAndMetadataAsBalance.applicableDates); - } - - return toDateAsPropertyString; - } - - function getToDate_asDateString(datePeriodSliderData){ - // data.from and data.to are index values, not the actual dates! (because we use "values" for rangeSlider) - var toDate = new Date($scope.datesAsMs[datePeriodSliderData.to]); - - var toDateAsString = makeDateString(toDate); - - return toDateAsString; - } - - $scope.updateTrendChart = function(indicatorMetadata, datePeriodSliderData){ - - - var fromDateAsPropertyString = getFromDate_asPropertyString(datePeriodSliderData); - var toDateAsPropertyString = getToDate_asPropertyString(datePeriodSliderData); - var fromDateString = getFromDate_asDateString(datePeriodSliderData); - var fromDate_date = new Date(fromDateString); - var toDateString = getToDate_asDateString(datePeriodSliderData); - var toDate_date = new Date(toDateString); - - // based on prepared DOM, initialize echarts instance - if (!$scope.trendChart_allFeatures) - $scope.trendChart_allFeatures = echarts.init(document.getElementById('trendDiagram_allFeatures')); - else { - // explicitly kill and reinstantiate line diagram to avoid zombie states on spatial unit change - $scope.trendChart_allFeatures.dispose(); - $scope.trendChart_allFeatures = echarts.init(document.getElementById('trendDiagram_allFeatures')); - } - - // use configuration item and data specified to show chart - $scope.trendOption = kommonitorDiagramHelperService.makeTrendChartOptions_forAllFeatures(indicatorMetadata, fromDateAsPropertyString, toDateAsPropertyString, $scope.trendConfig_allFeatures.showMinMax, $scope.trendConfig_allFeatures.showCompleteTimeseries, $scope.trendConfig_allFeatures.trendComputationType); - $scope.trendChart_allFeatures.setOption($scope.trendOption); - - $scope.trendChart_allFeatures.hideLoading(); - setTimeout(function () { - $scope.trendChart_allFeatures.resize(); - }, 350); - - var trendData = []; - var timeseriesData; - if($scope.trendConfig_allFeatures.showMinMax){ - timeseriesData = $scope.trendOption.series[2].data; - } - else{ - timeseriesData = $scope.trendOption.series[0].data; - } - - if($scope.trendConfig_allFeatures.showCompleteTimeseries){ - for (let index = 0; index < timeseriesData.length; index++) { - var dateCandidate = new Date(indicatorMetadata.applicableDates[index]); - if(dateCandidate >= fromDate_date && dateCandidate <= toDate_date){ - trendData.push(timeseriesData[index]); - } - } - } - else{ - trendData = timeseriesData; - } - - - - var balanceValue = kommonitorDataExchangeService.getIndicatorValue_asFormattedText(trendData[trendData.length - 1] - trendData[0]); - var balanceValue_numeric = kommonitorDataExchangeService.getIndicatorValue_asNumber(trendData[trendData.length - 1] - trendData[0]); - var trendValue = ""; - if(Number(balanceValue_numeric) == 0){ - trendValue = "gleichbleibend"; - } - else if(Number(balanceValue_numeric) > 0){ - trendValue = "steigend"; - } - else { - trendValue = "sinkend"; - } - - $scope.trendAnalysis_allFeatures = { - min: kommonitorDataExchangeService.getIndicatorValue_asFormattedText(ecStat.statistics.min(trendData)), - max: kommonitorDataExchangeService.getIndicatorValue_asFormattedText(ecStat.statistics.max(trendData)), - deviation: kommonitorDataExchangeService.getIndicatorValue_asFormattedText(ecStat.statistics.deviation(trendData)), - variance: kommonitorDataExchangeService.getIndicatorValue_asFormattedText(ecStat.statistics.sampleVariance(trendData)), - mean: kommonitorDataExchangeService.getIndicatorValue_asFormattedText(ecStat.statistics.mean(trendData)), - median: kommonitorDataExchangeService.getIndicatorValue_asFormattedText(ecStat.statistics.median(trendData)), - balance: balanceValue, - trend: trendValue - }; - - }; - - $(window).on('resize', function () { - - if ($scope.trendChart_allFeatures != null && $scope.trendChart_allFeatures != undefined) { - $scope.trendChart_allFeatures.resize(); - } - }); - - $scope.$on("updateBalanceSlider", function (event, date) { - - // kommonitorDataExchangeService.isBalanceChecked = false; - $scope.setupRangeSliderForBalance(date); - - }); - - function dateToTS (date) { - return date.valueOf(); - } - - function tsToDateString (dateAsMs) { - var date = new Date(dateAsMs); - - /** - * TODO FIXME dateSLider formatter will return only year for now to prevent misleading month and day settings - */ - - // return date.getFullYear(); - - return date.toLocaleDateString("de-DE", { - year: 'numeric', - month: 'long', - day: 'numeric' - }); - } - - function dateToDateString (date) { - - /** - * TODO FIXME dateSLider formatter will return only year for now to prevent misleading month and day settings - */ - - // return date.getFullYear(); - - return date.toLocaleDateString("de-DE", { - year: 'numeric', - month: 'long', - day: 'numeric' - }); - } - - function createDatesFromIndicatorDates(indicatorDates) { - - $scope.datesAsMs = []; - - for (var index=0; index < indicatorDates.length; index++){ - // year-month-day - var dateComponents = indicatorDates[index].split("-"); - $scope.datesAsMs.push(dateToTS(new Date(Number(dateComponents[0]), Number(dateComponents[1]) - 1, Number(dateComponents[2])))); - } - return $scope.datesAsMs; - } - - $scope.createNewBalanceInstance = function(){ - $scope.datesAsMs = createDatesFromIndicatorDates(kommonitorDataExchangeService.selectedIndicator.applicableDates); - - // new Date() uses month between 0-11! - $("#rangeSliderForBalance").ionRangeSlider({ - skin: "big", - type: "double", - grid: true, - values: $scope.datesAsMs, - from: 0, // index, not the date - to: $scope.datesAsMs.length -1, // index, not the date - force_edges: true, - prettify: tsToDateString, - onChange: onChangeBalanceRange - }); - - $scope.rangeSliderForBalance = $("#rangeSliderForBalance").data("ionRangeSlider"); - // make sure that the handles are properly set to min and max values - $scope.rangeSliderForBalance.update({ - from: 0, // index, not the date - to: $scope.datesAsMs.length -1, // index, not the date - }); - - if (!kommonitorDataExchangeService.isBalanceChecked){ - // deactivate balance slider - $scope.rangeSliderForBalance.update({ - block: true - }); - } - } - - $scope.removeOldInstance = function(){ - kommonitorDataExchangeService.rangeFilterData = undefined; - $scope.rangeSliderForBalance.destroy(); - kommonitorDataExchangeService.indicatorAndMetadataAsBalance = undefined; - - var domNode = document.getElementById("rangeSliderForBalance"); - - while (domNode.hasChildNodes()) { - domNode.removeChild(domNode.lastChild); - } - } - - $scope.setupRangeSliderForBalance = function(date){ - $scope.targetDate = date; - $scope.targetIndicatorProperty = INDICATOR_DATE_PREFIX + date; - - if(!$scope.rangeSliderForBalance){ - // create new instance - $scope.createNewBalanceInstance(); - } - else { - - if(kommonitorDataExchangeService.indicatorAndMetadataAsBalance){ - if (kommonitorDataExchangeService.selectedIndicator.indicatorName != kommonitorDataExchangeService.indicatorAndMetadataAsBalance.indicatorName){ - $scope.removeOldInstance(); - - // create new instance - $scope.createNewBalanceInstance(); - } - } - else{ - $scope.removeOldInstance(); - $scope.createNewBalanceInstance(); - } - - } - - }; - - function onChangeBalanceRange (data) { - // create balance GeoJSON and broadcast "replaceIndicatorAsGeoJSON" - // Called every time handle position is changed - computeAndSetBalance(data); - - $timeout(function(){ - - $scope.updateTrendChart(kommonitorDataExchangeService.selectedIndicator, data); - }); - // we must call replaceIndicatorGeoJSON because the feature vaues have changed. calling restyle will not work as it only restyles the old numbers - kommonitorMapService.replaceIndicatorGeoJSON(kommonitorDataExchangeService.indicatorAndMetadataAsBalance, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, $scope.targetDate, true); - }; - - function computeAndSetBalance(data){ - - var fromDateAsPropertyString = getFromDate_asPropertyString(data); - var fromDateAsDateString = getFromDate_asDateString(data); - var toDateAsPropertyString = getToDate_asPropertyString(data); - var toDateAsDateString = getToDate_asDateString(data); - - // make another copy of selectedIndicator to ensure that feature order matches each other - kommonitorDataExchangeService.indicatorAndMetadataAsBalance = jQuery.extend(true, {}, kommonitorDataExchangeService.selectedIndicator); - - var indicatorType = kommonitorDataExchangeService.selectedIndicator.indicatorType; - if(indicatorType.includes("ABSOLUTE")){ - kommonitorDataExchangeService.indicatorAndMetadataAsBalance.indicatorType = "DYNAMIC_ABSOLUTE"; - } - else if(indicatorType.includes("RELATIVE")){ - kommonitorDataExchangeService.indicatorAndMetadataAsBalance.indicatorType = "DYNAMIC_RELATIVE"; - } - else if(indicatorType.includes("STANDARDIZED")){ - kommonitorDataExchangeService.indicatorAndMetadataAsBalance.indicatorType = "DYNAMIC_STANDARDIZED"; - } - - // set value of selected target property with the computed balance between toDate - FromDate - for (var index=0; index < kommonitorDataExchangeService.selectedIndicator.geoJSON.features.length; index++){ - - var toDateValue = kommonitorDataExchangeService.getIndicatorValue_asNumber(kommonitorDataExchangeService.selectedIndicator.geoJSON.features[index].properties[toDateAsPropertyString]); - var fromDateValue = kommonitorDataExchangeService.getIndicatorValue_asNumber(kommonitorDataExchangeService.selectedIndicator.geoJSON.features[index].properties[fromDateAsPropertyString]); - - kommonitorDataExchangeService.indicatorAndMetadataAsBalance.geoJSON.features[index].properties[$scope.targetIndicatorProperty] = kommonitorDataExchangeService.getIndicatorValue_asNumber(toDateValue - fromDateValue); - } - kommonitorDataExchangeService.indicatorAndMetadataAsBalance['fromDate'] = dateToDateString(new Date(fromDateAsDateString)); - kommonitorDataExchangeService.indicatorAndMetadataAsBalance['toDate'] = dateToDateString(new Date(toDateAsDateString)); - }; - - function snapToNearestLowerDate(toDate, applicableDates){ - var earliestDateStringComponents = applicableDates[0].split("-"); - - var earliestDate = new Date(Number(earliestDateStringComponents[0]), Number(earliestDateStringComponents[1]) - 1, Number(earliestDateStringComponents[2])); - var dateCandidate = toDate; - - // we need to find the next lower applicableDate - // decrement day by one and check, otherwise decrement month and/or year - dateCandidate.setDate(dateCandidate.getDate() - 1); - - var targetDatePropertyString; - - while(dateCandidate > earliestDate){ - var dateCandidateString = makeDateString(dateCandidate); - if (applicableDates.includes(dateCandidateString)){ - targetDatePropertyString = makePropertyString(dateCandidate); - break; - } - //decrement by one day - dateCandidate.setDate(dateCandidate.getDate() - 1); - } - - if(!targetDatePropertyString) - targetDatePropertyString = makePropertyString(earliestDate); - - return targetDatePropertyString; - } - - function snapToNearestUpperDate(fromDate, applicableDates){ - var lastDateStringComponents = applicableDates[applicableDates.length -1].split("-"); - - var latestDate = new Date(Number(lastDateStringComponents[0]), Number(lastDateStringComponents[1]) - 1, Number(lastDateStringComponents[2])); - var dateCandidate = fromDate; - - // we need to find the next upper applicableDate - // increment day by one and check, otherwise increment month and/or year - dateCandidate.setDate(dateCandidate.getDate() + 1); - - var targetDatePropertyString; - - while(dateCandidate < latestDate){ - var dateCandidateString = makeDateString(dateCandidate); - if (applicableDates.includes(dateCandidateString)){ - targetDatePropertyString = makePropertyString(dateCandidate); - break; - } - //increment by one day - dateCandidate.setDate(dateCandidate.getDate() + 1); - } - - if(!targetDatePropertyString) - targetDatePropertyString = makePropertyString(latestDate); - - return targetDatePropertyString; - } - - function makeDateString(date){ - var year = date.getFullYear(); - var month = date.getMonth() + 1; // because month is from 0-11 - var day = date.getDate(); - - // e.g. 2018-01-01 - var propertyString = year + "-"; - - if(month < 10){ - propertyString += "0" + month + "-"; - } - else{ - propertyString += month + "-"; - } - - if(day < 10){ - propertyString += "0" + day; - } - else{ - propertyString += day; - } - - return propertyString; - }; - - function makePropertyString(date){ - var dateString = makeDateString(date); - return INDICATOR_DATE_PREFIX + dateString; - }; - - - $scope.onChangeTrendConfig = function(){ - var data = $scope.rangeSliderForBalance.result; - $timeout(function(){ - - $scope.updateTrendChart(kommonitorDataExchangeService.selectedIndicator, data); - }); - }; - - }] - }); + .module('kommonitorBalance') + .component('kommonitorBalance', { + templateUrl: "components/kommonitorUserInterface/kommonitorControls/kommonitorBalance/kommonitor-balance.template.html", + /* + * injected with a modules service method that manages + * enabled tabs + */ + controller: ['$scope', '$rootScope', 'kommonitorMapService', 'kommonitorDataExchangeService', 'kommonitorDiagramHelperService', + 'kommonitorFilterHelperService', '__env', '$timeout', + function kommonitorBalanceController($scope, $rootScope, kommonitorMapService, kommonitorDataExchangeService, kommonitorDiagramHelperService, kommonitorFilterHelperService, __env, $timeout) { + const INDICATOR_DATE_PREFIX = __env.indicatorDatePrefix; + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorMapServiceInstance = kommonitorMapService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + var numberOfDecimals = __env.numberOfDecimals; + $scope.targetDate; + $scope.targetIndicatorProperty; + $scope.rangeSliderForBalance; + $scope.datesAsMs; + $scope.trendConfig_allFeatures = { + showMinMax: true, + showCompleteTimeseries: true, + trendComputationType: "linear" + }; + $scope.$on("DisableBalance", function (event) { + kommonitorDataExchangeService.isBalanceChecked = false; + if ($scope.rangeSliderForBalance) { + $scope.rangeSliderForBalance.update({ + block: true + }); + } + // reanebalbe DateSlider on map + $rootScope.$broadcast("EnableDateSlider"); + }); + $scope.$on("replaceBalancedIndicator", function (event) { + if (kommonitorDataExchangeService.isBalanceChecked) { + $scope.onChangeUseBalance(); + } + }); + $scope.onChangeUseBalance = function () { + if (kommonitorDataExchangeService.isMeasureOfValueChecked) { + kommonitorDataExchangeService.isMeasureOfValueChecked = false; + } + let indicatorMetadataAndGeoJSON = undefined; + if (kommonitorDataExchangeService.isBalanceChecked) { + kommonitorDataExchangeService.isMeasureOfValueChecked = false; + $scope.rangeSliderForBalance.update({ + block: false + }); + // disable DateSlider on map + $rootScope.$broadcast("DisableDateSlider"); + if (!kommonitorDataExchangeService.indicatorAndMetadataAsBalance) { + kommonitorDataExchangeService.indicatorAndMetadataAsBalance = jQuery.extend(true, {}, kommonitorDataExchangeService.selectedIndicator); + var indicatorType = kommonitorDataExchangeService.selectedIndicator.indicatorType; + if (indicatorType.includes("ABSOLUTE")) { + kommonitorDataExchangeService.indicatorAndMetadataAsBalance.indicatorType = "DYNAMIC_ABSOLUTE"; + } + else if (indicatorType.includes("RELATIVE")) { + kommonitorDataExchangeService.indicatorAndMetadataAsBalance.indicatorType = "DYNAMIC_RELATIVE"; + } + else if (indicatorType.includes("STANDARDIZED")) { + kommonitorDataExchangeService.indicatorAndMetadataAsBalance.indicatorType = "DYNAMIC_STANDARDIZED"; + } + } + var data = $scope.rangeSliderForBalance.options; + computeAndSetBalance(data); + $timeout(function () { + $scope.updateTrendChart(kommonitorDataExchangeService.selectedIndicator, data); + }); + indicatorMetadataAndGeoJSON = kommonitorDataExchangeService.indicatorAndMetadataAsBalance; + // kommonitorMapService.replaceIndicatorGeoJSON(kommonitorDataExchangeService.indicatorAndMetadataAsBalance, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, $scope.targetDate, true); + } + else { + $scope.rangeSliderForBalance.update({ + block: true + }); + // reanebalbe DateSlider on map + $rootScope.$broadcast("EnableDateSlider"); + indicatorMetadataAndGeoJSON = kommonitorDataExchangeService.selectedIndicator; + // kommonitorMapService.replaceIndicatorGeoJSON(kommonitorDataExchangeService.selectedIndicator, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, $scope.targetDate, true); + } + // $rootScope.$broadcast("updateIndicatorValueRangeFilter", $scope.targetDate, indicatorMetadataAndGeoJSON); + // do not replace dataset directly, but check if any filter can be applied when changing balance mode for the current dataset + kommonitorFilterHelperService.filterAndReplaceDataset(); + }; + function getFromDate_asPropertyString(datePeriodSliderData) { + // data.from and data.to are index values, not the actual dates! (because we use "values" for rangeSlider) + var fromDate = new Date($scope.datesAsMs[datePeriodSliderData.from]); + var fromDateAsPropertyString = makePropertyString(fromDate); + var fromDateAsString = makeDateString(fromDate); + if (!kommonitorDataExchangeService.indicatorAndMetadataAsBalance.applicableDates.includes(fromDateAsString)) { + fromDateAsPropertyString = snapToNearestUpperDate(fromDate, kommonitorDataExchangeService.indicatorAndMetadataAsBalance.applicableDates); + } + return fromDateAsPropertyString; + } + function getFromDate_asDateString(datePeriodSliderData) { + // data.from and data.to are index values, not the actual dates! (because we use "values" for rangeSlider) + var fromDate = new Date($scope.datesAsMs[datePeriodSliderData.from]); + var fromDateAsString = makeDateString(fromDate); + return fromDateAsString; + } + function getToDate_asPropertyString(datePeriodSliderData) { + // data.from and data.to are index values, not the actual dates! (because we use "values" for rangeSlider) + var toDate = new Date($scope.datesAsMs[datePeriodSliderData.to]); + var toDateAsPropertyString = makePropertyString(toDate); + var toDateAsString = makeDateString(toDate); + if (!kommonitorDataExchangeService.indicatorAndMetadataAsBalance.applicableDates.includes(toDateAsString)) { + toDateAsPropertyString = snapToNearestLowerDate(toDate, kommonitorDataExchangeService.indicatorAndMetadataAsBalance.applicableDates); + } + return toDateAsPropertyString; + } + function getToDate_asDateString(datePeriodSliderData) { + // data.from and data.to are index values, not the actual dates! (because we use "values" for rangeSlider) + var toDate = new Date($scope.datesAsMs[datePeriodSliderData.to]); + var toDateAsString = makeDateString(toDate); + return toDateAsString; + } + $scope.updateTrendChart = function (indicatorMetadata, datePeriodSliderData) { + var fromDateAsPropertyString = getFromDate_asPropertyString(datePeriodSliderData); + var toDateAsPropertyString = getToDate_asPropertyString(datePeriodSliderData); + var fromDateString = getFromDate_asDateString(datePeriodSliderData); + var fromDate_date = new Date(fromDateString); + var toDateString = getToDate_asDateString(datePeriodSliderData); + var toDate_date = new Date(toDateString); + // based on prepared DOM, initialize echarts instance + if (!$scope.trendChart_allFeatures) + $scope.trendChart_allFeatures = echarts.init(document.getElementById('trendDiagram_allFeatures')); + else { + // explicitly kill and reinstantiate line diagram to avoid zombie states on spatial unit change + $scope.trendChart_allFeatures.dispose(); + $scope.trendChart_allFeatures = echarts.init(document.getElementById('trendDiagram_allFeatures')); + } + // use configuration item and data specified to show chart + $scope.trendOption = kommonitorDiagramHelperService.makeTrendChartOptions_forAllFeatures(indicatorMetadata, fromDateAsPropertyString, toDateAsPropertyString, $scope.trendConfig_allFeatures.showMinMax, $scope.trendConfig_allFeatures.showCompleteTimeseries, $scope.trendConfig_allFeatures.trendComputationType); + $scope.trendChart_allFeatures.setOption($scope.trendOption); + $scope.trendChart_allFeatures.hideLoading(); + setTimeout(function () { + $scope.trendChart_allFeatures.resize(); + }, 350); + var trendData = []; + var timeseriesData; + if ($scope.trendConfig_allFeatures.showMinMax) { + timeseriesData = $scope.trendOption.series[2].data; + } + else { + timeseriesData = $scope.trendOption.series[0].data; + } + if ($scope.trendConfig_allFeatures.showCompleteTimeseries) { + for (let index = 0; index < timeseriesData.length; index++) { + var dateCandidate = new Date(indicatorMetadata.applicableDates[index]); + if (dateCandidate >= fromDate_date && dateCandidate <= toDate_date) { + trendData.push(timeseriesData[index]); + } + } + } + else { + trendData = timeseriesData; + } + var balanceValue = kommonitorDataExchangeService.getIndicatorValue_asFormattedText(trendData[trendData.length - 1] - trendData[0]); + var balanceValue_numeric = kommonitorDataExchangeService.getIndicatorValue_asNumber(trendData[trendData.length - 1] - trendData[0]); + var trendValue = ""; + if (Number(balanceValue_numeric) == 0) { + trendValue = "gleichbleibend"; + } + else if (Number(balanceValue_numeric) > 0) { + trendValue = "steigend"; + } + else { + trendValue = "sinkend"; + } + $scope.trendAnalysis_allFeatures = { + min: kommonitorDataExchangeService.getIndicatorValue_asFormattedText(ecStat.statistics.min(trendData)), + max: kommonitorDataExchangeService.getIndicatorValue_asFormattedText(ecStat.statistics.max(trendData)), + deviation: kommonitorDataExchangeService.getIndicatorValue_asFormattedText(ecStat.statistics.deviation(trendData)), + variance: kommonitorDataExchangeService.getIndicatorValue_asFormattedText(ecStat.statistics.sampleVariance(trendData)), + mean: kommonitorDataExchangeService.getIndicatorValue_asFormattedText(ecStat.statistics.mean(trendData)), + median: kommonitorDataExchangeService.getIndicatorValue_asFormattedText(ecStat.statistics.median(trendData)), + balance: balanceValue, + trend: trendValue + }; + }; + $(window).on('resize', function () { + if ($scope.trendChart_allFeatures != null && $scope.trendChart_allFeatures != undefined) { + $scope.trendChart_allFeatures.resize(); + } + }); + $scope.$on("updateBalanceSlider", function (event, date) { + // kommonitorDataExchangeService.isBalanceChecked = false; + $scope.setupRangeSliderForBalance(date); + }); + function dateToTS(date) { + return date.valueOf(); + } + function tsToDateString(dateAsMs) { + var date = new Date(dateAsMs); + /** + * TODO FIXME dateSLider formatter will return only year for now to prevent misleading month and day settings + */ + // return date.getFullYear(); + return date.toLocaleDateString("de-DE", { + year: 'numeric', + month: 'long', + day: 'numeric' + }); + } + function dateToDateString(date) { + /** + * TODO FIXME dateSLider formatter will return only year for now to prevent misleading month and day settings + */ + // return date.getFullYear(); + return date.toLocaleDateString("de-DE", { + year: 'numeric', + month: 'long', + day: 'numeric' + }); + } + function createDatesFromIndicatorDates(indicatorDates) { + $scope.datesAsMs = []; + for (var index = 0; index < indicatorDates.length; index++) { + // year-month-day + var dateComponents = indicatorDates[index].split("-"); + $scope.datesAsMs.push(dateToTS(new Date(Number(dateComponents[0]), Number(dateComponents[1]) - 1, Number(dateComponents[2])))); + } + return $scope.datesAsMs; + } + $scope.createNewBalanceInstance = function () { + $scope.datesAsMs = createDatesFromIndicatorDates(kommonitorDataExchangeService.selectedIndicator.applicableDates); + // new Date() uses month between 0-11! + $("#rangeSliderForBalance").ionRangeSlider({ + skin: "big", + type: "double", + grid: true, + values: $scope.datesAsMs, + from: 0, + to: $scope.datesAsMs.length - 1, + force_edges: true, + prettify: tsToDateString, + onChange: onChangeBalanceRange + }); + $scope.rangeSliderForBalance = $("#rangeSliderForBalance").data("ionRangeSlider"); + // make sure that the handles are properly set to min and max values + $scope.rangeSliderForBalance.update({ + from: 0, + to: $scope.datesAsMs.length - 1, // index, not the date + }); + if (!kommonitorDataExchangeService.isBalanceChecked) { + // deactivate balance slider + $scope.rangeSliderForBalance.update({ + block: true + }); + } + }; + $scope.removeOldInstance = function () { + kommonitorDataExchangeService.rangeFilterData = undefined; + $scope.rangeSliderForBalance.destroy(); + kommonitorDataExchangeService.indicatorAndMetadataAsBalance = undefined; + var domNode = document.getElementById("rangeSliderForBalance"); + while (domNode.hasChildNodes()) { + domNode.removeChild(domNode.lastChild); + } + }; + $scope.setupRangeSliderForBalance = function (date) { + $scope.targetDate = date; + $scope.targetIndicatorProperty = INDICATOR_DATE_PREFIX + date; + if (!$scope.rangeSliderForBalance) { + // create new instance + $scope.createNewBalanceInstance(); + } + else { + if (kommonitorDataExchangeService.indicatorAndMetadataAsBalance) { + if (kommonitorDataExchangeService.selectedIndicator.indicatorName != kommonitorDataExchangeService.indicatorAndMetadataAsBalance.indicatorName) { + $scope.removeOldInstance(); + // create new instance + $scope.createNewBalanceInstance(); + } + } + else { + $scope.removeOldInstance(); + $scope.createNewBalanceInstance(); + } + } + }; + function onChangeBalanceRange(data) { + // create balance GeoJSON and broadcast "replaceIndicatorAsGeoJSON" + // Called every time handle position is changed + computeAndSetBalance(data); + $timeout(function () { + $scope.updateTrendChart(kommonitorDataExchangeService.selectedIndicator, data); + }); + // we must call replaceIndicatorGeoJSON because the feature vaues have changed. calling restyle will not work as it only restyles the old numbers + kommonitorMapService.replaceIndicatorGeoJSON(kommonitorDataExchangeService.indicatorAndMetadataAsBalance, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, $scope.targetDate, true); + } + ; + function computeAndSetBalance(data) { + var fromDateAsPropertyString = getFromDate_asPropertyString(data); + var fromDateAsDateString = getFromDate_asDateString(data); + var toDateAsPropertyString = getToDate_asPropertyString(data); + var toDateAsDateString = getToDate_asDateString(data); + // make another copy of selectedIndicator to ensure that feature order matches each other + kommonitorDataExchangeService.indicatorAndMetadataAsBalance = jQuery.extend(true, {}, kommonitorDataExchangeService.selectedIndicator); + var indicatorType = kommonitorDataExchangeService.selectedIndicator.indicatorType; + if (indicatorType.includes("ABSOLUTE")) { + kommonitorDataExchangeService.indicatorAndMetadataAsBalance.indicatorType = "DYNAMIC_ABSOLUTE"; + } + else if (indicatorType.includes("RELATIVE")) { + kommonitorDataExchangeService.indicatorAndMetadataAsBalance.indicatorType = "DYNAMIC_RELATIVE"; + } + else if (indicatorType.includes("STANDARDIZED")) { + kommonitorDataExchangeService.indicatorAndMetadataAsBalance.indicatorType = "DYNAMIC_STANDARDIZED"; + } + // set value of selected target property with the computed balance between toDate - FromDate + for (var index = 0; index < kommonitorDataExchangeService.selectedIndicator.geoJSON.features.length; index++) { + var toDateValue = kommonitorDataExchangeService.getIndicatorValue_asNumber(kommonitorDataExchangeService.selectedIndicator.geoJSON.features[index].properties[toDateAsPropertyString]); + var fromDateValue = kommonitorDataExchangeService.getIndicatorValue_asNumber(kommonitorDataExchangeService.selectedIndicator.geoJSON.features[index].properties[fromDateAsPropertyString]); + kommonitorDataExchangeService.indicatorAndMetadataAsBalance.geoJSON.features[index].properties[$scope.targetIndicatorProperty] = kommonitorDataExchangeService.getIndicatorValue_asNumber(toDateValue - fromDateValue); + } + kommonitorDataExchangeService.indicatorAndMetadataAsBalance['fromDate'] = dateToDateString(new Date(fromDateAsDateString)); + kommonitorDataExchangeService.indicatorAndMetadataAsBalance['toDate'] = dateToDateString(new Date(toDateAsDateString)); + } + ; + function snapToNearestLowerDate(toDate, applicableDates) { + var earliestDateStringComponents = applicableDates[0].split("-"); + var earliestDate = new Date(Number(earliestDateStringComponents[0]), Number(earliestDateStringComponents[1]) - 1, Number(earliestDateStringComponents[2])); + var dateCandidate = toDate; + // we need to find the next lower applicableDate + // decrement day by one and check, otherwise decrement month and/or year + dateCandidate.setDate(dateCandidate.getDate() - 1); + var targetDatePropertyString; + while (dateCandidate > earliestDate) { + var dateCandidateString = makeDateString(dateCandidate); + if (applicableDates.includes(dateCandidateString)) { + targetDatePropertyString = makePropertyString(dateCandidate); + break; + } + //decrement by one day + dateCandidate.setDate(dateCandidate.getDate() - 1); + } + if (!targetDatePropertyString) + targetDatePropertyString = makePropertyString(earliestDate); + return targetDatePropertyString; + } + function snapToNearestUpperDate(fromDate, applicableDates) { + var lastDateStringComponents = applicableDates[applicableDates.length - 1].split("-"); + var latestDate = new Date(Number(lastDateStringComponents[0]), Number(lastDateStringComponents[1]) - 1, Number(lastDateStringComponents[2])); + var dateCandidate = fromDate; + // we need to find the next upper applicableDate + // increment day by one and check, otherwise increment month and/or year + dateCandidate.setDate(dateCandidate.getDate() + 1); + var targetDatePropertyString; + while (dateCandidate < latestDate) { + var dateCandidateString = makeDateString(dateCandidate); + if (applicableDates.includes(dateCandidateString)) { + targetDatePropertyString = makePropertyString(dateCandidate); + break; + } + //increment by one day + dateCandidate.setDate(dateCandidate.getDate() + 1); + } + if (!targetDatePropertyString) + targetDatePropertyString = makePropertyString(latestDate); + return targetDatePropertyString; + } + function makeDateString(date) { + var year = date.getFullYear(); + var month = date.getMonth() + 1; // because month is from 0-11 + var day = date.getDate(); + // e.g. 2018-01-01 + var propertyString = year + "-"; + if (month < 10) { + propertyString += "0" + month + "-"; + } + else { + propertyString += month + "-"; + } + if (day < 10) { + propertyString += "0" + day; + } + else { + propertyString += day; + } + return propertyString; + } + ; + function makePropertyString(date) { + var dateString = makeDateString(date); + return INDICATOR_DATE_PREFIX + dateString; + } + ; + $scope.onChangeTrendConfig = function () { + var data = $scope.rangeSliderForBalance.result; + $timeout(function () { + $scope.updateTrendChart(kommonitorDataExchangeService.selectedIndicator, data); + }); + }; + }] +}); +//# sourceMappingURL=kommonitor-balance.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorBalance/kommonitor-balance.component.js.map b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorBalance/kommonitor-balance.component.js.map new file mode 100644 index 000000000..3d139fe90 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorBalance/kommonitor-balance.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-balance.component.js","sourceRoot":"","sources":["kommonitor-balance.component.ts"],"names":[],"mappings":";AAAA,OAAO;KACJ,MAAM,CAAC,mBAAmB,CAAC;KAC3B,SAAS,CACR,mBAAmB,EACnB;IACC,WAAW,EAAG,0GAA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GAAG,EAAE,EAAC;oBACX,cAAc,IAAI,GAAG,GAAG,GAAG,CAAC;iBAC5B;qBACG;oBACH,cAAc,IAAI,GAAG,CAAC;iBACtB;gBAED,OAAO,cAAc,CAAC;YACvB,CAAC;YAAA,CAAC;YAEF,SAAS,kBAAkB,CAAC,IAAI;gBAC/B,IAAI,UAAU,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;gBACtC,OAAO,qBAAqB,GAAG,UAAU,CAAC;YAC3C,CAAC;YAAA,CAAC;YAGF,MAAM,CAAC,mBAAmB,GAAG;gBAC5B,IAAI,IAAI,GAAG,MAAM,CAAC,qBAAqB,CAAC,MAAM,CAAC;gBAC9C,QAAQ,CAAC;oBAER,MAAM,CAAC,gBAAgB,CAAC,6BAA6B,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;gBAChF,CAAC,CAAC,CAAC;YACL,CAAC,CAAC;QAEH,CAAC,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorBalance/kommonitor-balance.component.ts b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorBalance/kommonitor-balance.component.ts new file mode 100644 index 000000000..c1a9e683b --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorBalance/kommonitor-balance.component.ts @@ -0,0 +1,498 @@ +angular + .module('kommonitorBalance') + .component( + 'kommonitorBalance', + { + templateUrl : "components/kommonitorUserInterface/kommonitorControls/kommonitorBalance/kommonitor-balance.template.html", + /* + * injected with a modules service method that manages + * enabled tabs + */ + controller : ['$scope', '$rootScope', 'kommonitorMapService', 'kommonitorDataExchangeService', 'kommonitorDiagramHelperService', + 'kommonitorFilterHelperService', '__env', '$timeout', + function kommonitorBalanceController($scope, $rootScope, kommonitorMapService, kommonitorDataExchangeService, kommonitorDiagramHelperService, + kommonitorFilterHelperService, __env, $timeout) { + + const INDICATOR_DATE_PREFIX = __env.indicatorDatePrefix; + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorMapServiceInstance = kommonitorMapService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + var numberOfDecimals = __env.numberOfDecimals; + + $scope.targetDate; + $scope.targetIndicatorProperty; + $scope.rangeSliderForBalance; + $scope.datesAsMs; + + $scope.trendConfig_allFeatures = { + showMinMax: true, + showCompleteTimeseries: true, + trendComputationType: "linear" + }; + + $scope.$on("DisableBalance", function (event) { + kommonitorDataExchangeService.isBalanceChecked = false; + if($scope.rangeSliderForBalance){ + $scope.rangeSliderForBalance.update({ + block: true + }); + } + + // reanebalbe DateSlider on map + $rootScope.$broadcast("EnableDateSlider"); + }); + + $scope.$on("replaceBalancedIndicator", function (event) { + if(kommonitorDataExchangeService.isBalanceChecked){ + $scope.onChangeUseBalance(); + } + }); + + $scope.onChangeUseBalance = function(){ + + if(kommonitorDataExchangeService.isMeasureOfValueChecked){ + kommonitorDataExchangeService.isMeasureOfValueChecked = false; + } + + let indicatorMetadataAndGeoJSON = undefined; + + if(kommonitorDataExchangeService.isBalanceChecked){ + kommonitorDataExchangeService.isMeasureOfValueChecked = false; + $scope.rangeSliderForBalance.update({ + block: false + }); + // disable DateSlider on map + $rootScope.$broadcast("DisableDateSlider"); + if(!kommonitorDataExchangeService.indicatorAndMetadataAsBalance){ + kommonitorDataExchangeService.indicatorAndMetadataAsBalance = jQuery.extend(true, {}, kommonitorDataExchangeService.selectedIndicator); + var indicatorType = kommonitorDataExchangeService.selectedIndicator.indicatorType; + if(indicatorType.includes("ABSOLUTE")){ + kommonitorDataExchangeService.indicatorAndMetadataAsBalance.indicatorType = "DYNAMIC_ABSOLUTE"; + } + else if(indicatorType.includes("RELATIVE")){ + kommonitorDataExchangeService.indicatorAndMetadataAsBalance.indicatorType = "DYNAMIC_RELATIVE"; + } + else if(indicatorType.includes("STANDARDIZED")){ + kommonitorDataExchangeService.indicatorAndMetadataAsBalance.indicatorType = "DYNAMIC_STANDARDIZED"; + } + + } + var data = $scope.rangeSliderForBalance.options; + computeAndSetBalance(data); + $timeout(function(){ + + $scope.updateTrendChart(kommonitorDataExchangeService.selectedIndicator, data); + }); + indicatorMetadataAndGeoJSON = kommonitorDataExchangeService.indicatorAndMetadataAsBalance; + // kommonitorMapService.replaceIndicatorGeoJSON(kommonitorDataExchangeService.indicatorAndMetadataAsBalance, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, $scope.targetDate, true); + } + else{ + $scope.rangeSliderForBalance.update({ + block: true + }); + // reanebalbe DateSlider on map + $rootScope.$broadcast("EnableDateSlider"); + indicatorMetadataAndGeoJSON = kommonitorDataExchangeService.selectedIndicator; + // kommonitorMapService.replaceIndicatorGeoJSON(kommonitorDataExchangeService.selectedIndicator, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, $scope.targetDate, true); + } + // $rootScope.$broadcast("updateIndicatorValueRangeFilter", $scope.targetDate, indicatorMetadataAndGeoJSON); + // do not replace dataset directly, but check if any filter can be applied when changing balance mode for the current dataset + kommonitorFilterHelperService.filterAndReplaceDataset(); + }; + + function getFromDate_asPropertyString(datePeriodSliderData){ + // data.from and data.to are index values, not the actual dates! (because we use "values" for rangeSlider) + var fromDate = new Date($scope.datesAsMs[datePeriodSliderData.from]); + + var fromDateAsPropertyString = makePropertyString(fromDate); + var fromDateAsString = makeDateString(fromDate); + if(!kommonitorDataExchangeService.indicatorAndMetadataAsBalance.applicableDates.includes(fromDateAsString)){ + fromDateAsPropertyString = snapToNearestUpperDate(fromDate, kommonitorDataExchangeService.indicatorAndMetadataAsBalance.applicableDates); + } + + return fromDateAsPropertyString; + } + + function getFromDate_asDateString(datePeriodSliderData){ + // data.from and data.to are index values, not the actual dates! (because we use "values" for rangeSlider) + var fromDate = new Date($scope.datesAsMs[datePeriodSliderData.from]); + + var fromDateAsString = makeDateString(fromDate); + + return fromDateAsString; + } + + function getToDate_asPropertyString(datePeriodSliderData){ + // data.from and data.to are index values, not the actual dates! (because we use "values" for rangeSlider) + var toDate = new Date($scope.datesAsMs[datePeriodSliderData.to]); + + var toDateAsPropertyString = makePropertyString(toDate); + var toDateAsString = makeDateString(toDate); + if(!kommonitorDataExchangeService.indicatorAndMetadataAsBalance.applicableDates.includes(toDateAsString)){ + toDateAsPropertyString = snapToNearestLowerDate(toDate, kommonitorDataExchangeService.indicatorAndMetadataAsBalance.applicableDates); + } + + return toDateAsPropertyString; + } + + function getToDate_asDateString(datePeriodSliderData){ + // data.from and data.to are index values, not the actual dates! (because we use "values" for rangeSlider) + var toDate = new Date($scope.datesAsMs[datePeriodSliderData.to]); + + var toDateAsString = makeDateString(toDate); + + return toDateAsString; + } + + $scope.updateTrendChart = function(indicatorMetadata, datePeriodSliderData){ + + + var fromDateAsPropertyString = getFromDate_asPropertyString(datePeriodSliderData); + var toDateAsPropertyString = getToDate_asPropertyString(datePeriodSliderData); + var fromDateString = getFromDate_asDateString(datePeriodSliderData); + var fromDate_date = new Date(fromDateString); + var toDateString = getToDate_asDateString(datePeriodSliderData); + var toDate_date = new Date(toDateString); + + // based on prepared DOM, initialize echarts instance + if (!$scope.trendChart_allFeatures) + $scope.trendChart_allFeatures = echarts.init(document.getElementById('trendDiagram_allFeatures')); + else { + // explicitly kill and reinstantiate line diagram to avoid zombie states on spatial unit change + $scope.trendChart_allFeatures.dispose(); + $scope.trendChart_allFeatures = echarts.init(document.getElementById('trendDiagram_allFeatures')); + } + + // use configuration item and data specified to show chart + $scope.trendOption = kommonitorDiagramHelperService.makeTrendChartOptions_forAllFeatures(indicatorMetadata, fromDateAsPropertyString, toDateAsPropertyString, $scope.trendConfig_allFeatures.showMinMax, $scope.trendConfig_allFeatures.showCompleteTimeseries, $scope.trendConfig_allFeatures.trendComputationType); + $scope.trendChart_allFeatures.setOption($scope.trendOption); + + $scope.trendChart_allFeatures.hideLoading(); + setTimeout(function () { + $scope.trendChart_allFeatures.resize(); + }, 350); + + var trendData = []; + var timeseriesData; + if($scope.trendConfig_allFeatures.showMinMax){ + timeseriesData = $scope.trendOption.series[2].data; + } + else{ + timeseriesData = $scope.trendOption.series[0].data; + } + + if($scope.trendConfig_allFeatures.showCompleteTimeseries){ + for (let index = 0; index < timeseriesData.length; index++) { + var dateCandidate = new Date(indicatorMetadata.applicableDates[index]); + if(dateCandidate >= fromDate_date && dateCandidate <= toDate_date){ + trendData.push(timeseriesData[index]); + } + } + } + else{ + trendData = timeseriesData; + } + + + + var balanceValue = kommonitorDataExchangeService.getIndicatorValue_asFormattedText(trendData[trendData.length - 1] - trendData[0]); + var balanceValue_numeric = kommonitorDataExchangeService.getIndicatorValue_asNumber(trendData[trendData.length - 1] - trendData[0]); + var trendValue = ""; + if(Number(balanceValue_numeric) == 0){ + trendValue = "gleichbleibend"; + } + else if(Number(balanceValue_numeric) > 0){ + trendValue = "steigend"; + } + else { + trendValue = "sinkend"; + } + + $scope.trendAnalysis_allFeatures = { + min: kommonitorDataExchangeService.getIndicatorValue_asFormattedText(ecStat.statistics.min(trendData)), + max: kommonitorDataExchangeService.getIndicatorValue_asFormattedText(ecStat.statistics.max(trendData)), + deviation: kommonitorDataExchangeService.getIndicatorValue_asFormattedText(ecStat.statistics.deviation(trendData)), + variance: kommonitorDataExchangeService.getIndicatorValue_asFormattedText(ecStat.statistics.sampleVariance(trendData)), + mean: kommonitorDataExchangeService.getIndicatorValue_asFormattedText(ecStat.statistics.mean(trendData)), + median: kommonitorDataExchangeService.getIndicatorValue_asFormattedText(ecStat.statistics.median(trendData)), + balance: balanceValue, + trend: trendValue + }; + + }; + + $(window).on('resize', function () { + + if ($scope.trendChart_allFeatures != null && $scope.trendChart_allFeatures != undefined) { + $scope.trendChart_allFeatures.resize(); + } + }); + + $scope.$on("updateBalanceSlider", function (event, date) { + + // kommonitorDataExchangeService.isBalanceChecked = false; + $scope.setupRangeSliderForBalance(date); + + }); + + function dateToTS (date) { + return date.valueOf(); + } + + function tsToDateString (dateAsMs) { + var date = new Date(dateAsMs); + + /** + * TODO FIXME dateSLider formatter will return only year for now to prevent misleading month and day settings + */ + + // return date.getFullYear(); + + return date.toLocaleDateString("de-DE", { + year: 'numeric', + month: 'long', + day: 'numeric' + }); + } + + function dateToDateString (date) { + + /** + * TODO FIXME dateSLider formatter will return only year for now to prevent misleading month and day settings + */ + + // return date.getFullYear(); + + return date.toLocaleDateString("de-DE", { + year: 'numeric', + month: 'long', + day: 'numeric' + }); + } + + function createDatesFromIndicatorDates(indicatorDates) { + + $scope.datesAsMs = []; + + for (var index=0; index < indicatorDates.length; index++){ + // year-month-day + var dateComponents = indicatorDates[index].split("-"); + $scope.datesAsMs.push(dateToTS(new Date(Number(dateComponents[0]), Number(dateComponents[1]) - 1, Number(dateComponents[2])))); + } + return $scope.datesAsMs; + } + + $scope.createNewBalanceInstance = function(){ + $scope.datesAsMs = createDatesFromIndicatorDates(kommonitorDataExchangeService.selectedIndicator.applicableDates); + + // new Date() uses month between 0-11! + $("#rangeSliderForBalance").ionRangeSlider({ + skin: "big", + type: "double", + grid: true, + values: $scope.datesAsMs, + from: 0, // index, not the date + to: $scope.datesAsMs.length -1, // index, not the date + force_edges: true, + prettify: tsToDateString, + onChange: onChangeBalanceRange + }); + + $scope.rangeSliderForBalance = $("#rangeSliderForBalance").data("ionRangeSlider"); + // make sure that the handles are properly set to min and max values + $scope.rangeSliderForBalance.update({ + from: 0, // index, not the date + to: $scope.datesAsMs.length -1, // index, not the date + }); + + if (!kommonitorDataExchangeService.isBalanceChecked){ + // deactivate balance slider + $scope.rangeSliderForBalance.update({ + block: true + }); + } + } + + $scope.removeOldInstance = function(){ + kommonitorDataExchangeService.rangeFilterData = undefined; + $scope.rangeSliderForBalance.destroy(); + kommonitorDataExchangeService.indicatorAndMetadataAsBalance = undefined; + + var domNode = document.getElementById("rangeSliderForBalance"); + + while (domNode.hasChildNodes()) { + domNode.removeChild(domNode.lastChild); + } + } + + $scope.setupRangeSliderForBalance = function(date){ + $scope.targetDate = date; + $scope.targetIndicatorProperty = INDICATOR_DATE_PREFIX + date; + + if(!$scope.rangeSliderForBalance){ + // create new instance + $scope.createNewBalanceInstance(); + } + else { + + if(kommonitorDataExchangeService.indicatorAndMetadataAsBalance){ + if (kommonitorDataExchangeService.selectedIndicator.indicatorName != kommonitorDataExchangeService.indicatorAndMetadataAsBalance.indicatorName){ + $scope.removeOldInstance(); + + // create new instance + $scope.createNewBalanceInstance(); + } + } + else{ + $scope.removeOldInstance(); + $scope.createNewBalanceInstance(); + } + + } + + }; + + function onChangeBalanceRange (data) { + // create balance GeoJSON and broadcast "replaceIndicatorAsGeoJSON" + // Called every time handle position is changed + computeAndSetBalance(data); + + $timeout(function(){ + + $scope.updateTrendChart(kommonitorDataExchangeService.selectedIndicator, data); + }); + // we must call replaceIndicatorGeoJSON because the feature vaues have changed. calling restyle will not work as it only restyles the old numbers + kommonitorMapService.replaceIndicatorGeoJSON(kommonitorDataExchangeService.indicatorAndMetadataAsBalance, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, $scope.targetDate, true); + }; + + function computeAndSetBalance(data){ + + var fromDateAsPropertyString = getFromDate_asPropertyString(data); + var fromDateAsDateString = getFromDate_asDateString(data); + var toDateAsPropertyString = getToDate_asPropertyString(data); + var toDateAsDateString = getToDate_asDateString(data); + + // make another copy of selectedIndicator to ensure that feature order matches each other + kommonitorDataExchangeService.indicatorAndMetadataAsBalance = jQuery.extend(true, {}, kommonitorDataExchangeService.selectedIndicator); + + var indicatorType = kommonitorDataExchangeService.selectedIndicator.indicatorType; + if(indicatorType.includes("ABSOLUTE")){ + kommonitorDataExchangeService.indicatorAndMetadataAsBalance.indicatorType = "DYNAMIC_ABSOLUTE"; + } + else if(indicatorType.includes("RELATIVE")){ + kommonitorDataExchangeService.indicatorAndMetadataAsBalance.indicatorType = "DYNAMIC_RELATIVE"; + } + else if(indicatorType.includes("STANDARDIZED")){ + kommonitorDataExchangeService.indicatorAndMetadataAsBalance.indicatorType = "DYNAMIC_STANDARDIZED"; + } + + // set value of selected target property with the computed balance between toDate - FromDate + for (var index=0; index < kommonitorDataExchangeService.selectedIndicator.geoJSON.features.length; index++){ + + var toDateValue = kommonitorDataExchangeService.getIndicatorValue_asNumber(kommonitorDataExchangeService.selectedIndicator.geoJSON.features[index].properties[toDateAsPropertyString]); + var fromDateValue = kommonitorDataExchangeService.getIndicatorValue_asNumber(kommonitorDataExchangeService.selectedIndicator.geoJSON.features[index].properties[fromDateAsPropertyString]); + + kommonitorDataExchangeService.indicatorAndMetadataAsBalance.geoJSON.features[index].properties[$scope.targetIndicatorProperty] = kommonitorDataExchangeService.getIndicatorValue_asNumber(toDateValue - fromDateValue); + } + kommonitorDataExchangeService.indicatorAndMetadataAsBalance['fromDate'] = dateToDateString(new Date(fromDateAsDateString)); + kommonitorDataExchangeService.indicatorAndMetadataAsBalance['toDate'] = dateToDateString(new Date(toDateAsDateString)); + }; + + function snapToNearestLowerDate(toDate, applicableDates){ + var earliestDateStringComponents = applicableDates[0].split("-"); + + var earliestDate = new Date(Number(earliestDateStringComponents[0]), Number(earliestDateStringComponents[1]) - 1, Number(earliestDateStringComponents[2])); + var dateCandidate = toDate; + + // we need to find the next lower applicableDate + // decrement day by one and check, otherwise decrement month and/or year + dateCandidate.setDate(dateCandidate.getDate() - 1); + + var targetDatePropertyString; + + while(dateCandidate > earliestDate){ + var dateCandidateString = makeDateString(dateCandidate); + if (applicableDates.includes(dateCandidateString)){ + targetDatePropertyString = makePropertyString(dateCandidate); + break; + } + //decrement by one day + dateCandidate.setDate(dateCandidate.getDate() - 1); + } + + if(!targetDatePropertyString) + targetDatePropertyString = makePropertyString(earliestDate); + + return targetDatePropertyString; + } + + function snapToNearestUpperDate(fromDate, applicableDates){ + var lastDateStringComponents = applicableDates[applicableDates.length -1].split("-"); + + var latestDate = new Date(Number(lastDateStringComponents[0]), Number(lastDateStringComponents[1]) - 1, Number(lastDateStringComponents[2])); + var dateCandidate = fromDate; + + // we need to find the next upper applicableDate + // increment day by one and check, otherwise increment month and/or year + dateCandidate.setDate(dateCandidate.getDate() + 1); + + var targetDatePropertyString; + + while(dateCandidate < latestDate){ + var dateCandidateString = makeDateString(dateCandidate); + if (applicableDates.includes(dateCandidateString)){ + targetDatePropertyString = makePropertyString(dateCandidate); + break; + } + //increment by one day + dateCandidate.setDate(dateCandidate.getDate() + 1); + } + + if(!targetDatePropertyString) + targetDatePropertyString = makePropertyString(latestDate); + + return targetDatePropertyString; + } + + function makeDateString(date){ + var year = date.getFullYear(); + var month = date.getMonth() + 1; // because month is from 0-11 + var day = date.getDate(); + + // e.g. 2018-01-01 + var propertyString = year + "-"; + + if(month < 10){ + propertyString += "0" + month + "-"; + } + else{ + propertyString += month + "-"; + } + + if(day < 10){ + propertyString += "0" + day; + } + else{ + propertyString += day; + } + + return propertyString; + }; + + function makePropertyString(date){ + var dateString = makeDateString(date); + return INDICATOR_DATE_PREFIX + dateString; + }; + + + $scope.onChangeTrendConfig = function(){ + var data = $scope.rangeSliderForBalance.result; + $timeout(function(){ + + $scope.updateTrendChart(kommonitorDataExchangeService.selectedIndicator, data); + }); + }; + + }] + }); diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorBalance/kommonitor-balance.module.js b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorBalance/kommonitor-balance.module.js index d878cb9e2..d3d1ff79e 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorBalance/kommonitor-balance.module.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorBalance/kommonitor-balance.module.js @@ -1,15 +1,16 @@ +"use strict"; angular.module('kommonitorBalance', ['kommonitorDataExchange', 'kommonitorDiagramHelper', 'kommonitorMap', 'kommonitorFilterHelper']) - -.directive('stringToNumber', function() { - return { - require: 'ngModel', - link: function(scope, element, attrs, ngModel) { - ngModel.$parsers.push(function(value) { - return '' + value; - }); - ngModel.$formatters.push(function(value) { - return parseFloat(value); - }); - } - }; + .directive('stringToNumber', function () { + return { + require: 'ngModel', + link: function (scope, element, attrs, ngModel) { + ngModel.$parsers.push(function (value) { + return '' + value; + }); + ngModel.$formatters.push(function (value) { + return parseFloat(value); + }); + } + }; }); +//# sourceMappingURL=kommonitor-balance.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorBalance/kommonitor-balance.module.js.map b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorBalance/kommonitor-balance.module.js.map new file mode 100644 index 000000000..354277d08 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorBalance/kommonitor-balance.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-balance.module.js","sourceRoot":"","sources":["kommonitor-balance.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,mBAAmB,EAAE,CAAC,wBAAwB,EAAE,yBAAyB,EAAE,eAAe,EAAE,wBAAwB,CAAC,CAAC;KAEpI,SAAS,CAAC,gBAAgB,EAAE;IAC3B,OAAO;QACL,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,UAAS,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO;YAC3C,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAS,KAAK;gBAClC,OAAO,EAAE,GAAG,KAAK,CAAC;YACpB,CAAC,CAAC,CAAC;YACH,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,UAAS,KAAK;gBACrC,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC;YAC3B,CAAC,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorBalance/kommonitor-balance.module.ts b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorBalance/kommonitor-balance.module.ts new file mode 100644 index 000000000..d878cb9e2 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorBalance/kommonitor-balance.module.ts @@ -0,0 +1,15 @@ +angular.module('kommonitorBalance', ['kommonitorDataExchange', 'kommonitorDiagramHelper', 'kommonitorMap', 'kommonitorFilterHelper']) + +.directive('stringToNumber', function() { + return { + require: 'ngModel', + link: function(scope, element, attrs, ngModel) { + ngModel.$parsers.push(function(value) { + return '' + value; + }); + ngModel.$formatters.push(function(value) { + return parseFloat(value); + }); + } + }; +}); diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataImport/kommonitor-data-import.component.js b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataImport/kommonitor-data-import.component.js index 75bed99f9..93101820e 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataImport/kommonitor-data-import.component.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataImport/kommonitor-data-import.component.js @@ -1,245 +1,192 @@ +"use strict"; angular - .module('kommonitorDataImport') - .component( - 'kommonitorDataImport', - { - templateUrl : "components/kommonitorUserInterface/kommonitorControls/kommonitorDataImport/kommonitor-data-import.template.html", - - controller : [ - 'kommonitorDataExchangeService', 'kommonitorMapService', '$scope', '$rootScope', '$http', '__env', - function kommonitorDataImportController( - kommonitorDataExchangeService, kommonitorMapService, $scope, $rootScope, $http, __env) { - /* - * reference to kommonitorDataExchangeService instances - */ - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorMapServiceInstance = kommonitorMapService; - $scope.loadingData = false; - $scope.date; - - $scope.fileLayerError; - $scope.tmpDatasetName; - - $scope.wmsNameFilter = undefined; - - $scope.customFileInputColor = `#00AABB`; - - $('#customFileInputColorDiv').colorpicker(); - - // initialize colorpicker after some time - // wait to ensure that elements ar available on DOM - setTimeout(function() { - - var colorPickerInputs = $('.input-group.colorpicker-component') - colorPickerInputs.colorpicker(); - - // $('.input-group.colorpicker-component').each(function (index, value){ - // $(this).colorpicker(); - // }); - }, 3000); - - - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - const DATE_PREFIX = __env.indicatorDatePrefix; - - var numberOfDecimals = __env.numberOfDecimals; - - - $scope.dropHandler = function(ev) { - $scope.fileLayerError = undefined; - $("#fileErrorAlert").hide(); - $("#fileSuccessAlert").hide(); - console.log('File(s) dropped'); - - try { - // Prevent default behavior (Prevent file from being opened) - ev.preventDefault(); - - if (ev.dataTransfer.items) { - // Use DataTransferItemList interface to access the file(s) - for (var i = 0; i < ev.dataTransfer.items.length; i++) { - // If dropped items aren't files, reject them - if (ev.dataTransfer.items[i].kind === 'file') { - var file = ev.dataTransfer.items[i].getAsFile(); - $scope.processFileInput(file); - - } - } - } else { - // Use DataTransfer interface to access the file(s) - for (var i = 0; i < ev.dataTransfer.files.length; i++) { - var file = ev.dataTransfer.files[i]; - $scope.processFileInput(file); - } - } - } catch (e) { - $scope.fileLayerError = e; - $("#fileErrorAlert").show(); - } finally { - - } - - }; - - $scope.processFileInput = function(file){ - console.log('... file[' + i + '].name = ' + file.name); - - var fileEnding = file.name.split('.').pop(); - - if(fileEnding.toUpperCase() === "json".toUpperCase() || fileEnding.toUpperCase() === "geojson".toUpperCase()){ - console.log("Potential GeoJSON file identified") - $scope.processFileInput_geoJson(file); - } - else if (fileEnding.toUpperCase() === "zip".toUpperCase()){ - console.log("Potential Shapefile file identified") - $scope.processFileInput_shape(file); - } - else{ - $scope.fileLayerError = "Unknown or unsupported file format"; - $("#fileErrorAlert").show(); - } - }; - - $scope.processFileInput_geoJson = function(file){ - var fileReader = new FileReader(); - - fileReader.onload = function(event) { - var geoJSON = JSON.parse(event.target.result); - - var fileDataset = { - title: file.name, - isSelected: true, - transparency: 0, - displayColor: $scope.customFileInputColor, - type: "GeoJSON", - content: geoJSON - }; - - kommonitorDataExchangeService.fileDatasets.push(fileDataset); - $scope.$digest(); - // initialize colorpicker in table - setTimeout(function() { - // initialize colorpicker - $('.input-group.colorpicker-component').colorpicker(); - }, 350); - - $scope.handleFileOnMap(fileDataset); - - }; - - // Read in the image file as a data URL. - fileReader.readAsText(file); - }; - - $scope.processFileInput_shape = function(file){ - var fileReader = new FileReader(); - - fileReader.onload = function(event) { - var arrayBuffer = event.target.result; - - var fileDataset = { - title: file.name, - isSelected: true, - transparency: 0, - displayColor: $scope.customFileInputColor, - type: "shp", - content: arrayBuffer - }; - - kommonitorDataExchangeService.fileDatasets.push(fileDataset); - $scope.$digest(); - // initialize colorpicker in table - setTimeout(function() { - // initialize colorpicker - $('.input-group.colorpicker-component').colorpicker(); - }, 350); - - $scope.handleFileOnMap(fileDataset); - - }; - - // Read in the image file as a data URL. - fileReader.readAsArrayBuffer(file); - }; - - $scope.handleFileOnMap = function(dataset){ - console.log("Toggle File Layer: " + dataset.title); - - $scope.tmpDatasetName = dataset.title; - - if(dataset.isSelected){ - //display on Map - var opacity = 1 - dataset.transparency; - kommonitorMapService.addFileLayerToMap(dataset, opacity); - } - else{ - //remove WMS layer from map - kommonitorMapService.removeFileLayerFromMap(dataset); - } - }; - - $scope.adjustFileLayerTransparency = function(dataset){ - - var opacity = 1 - dataset.transparency; - - kommonitorMapService.adjustOpacityForFileLayer(dataset, opacity); - }; - - $scope.adjustFileLayerColor = function(dataset){ - - var color = dataset.displayColor; - - kommonitorMapService.adjustColorForFileLayer(dataset, color); - }; - - $scope.$on("onDropFile", function (ev, dropEvent) { - $scope.dropHandler(dropEvent); - }); - - // $scope.dragOverHandler = function(ev) { - // console.log('File(s) in drop zone'); - // - // // Prevent default behavior (Prevent file from being opened) - // ev.preventDefault(); - // }; - - $scope.openFileDialog = function(){ - // $("#fileUploadInput").trigger("click"); - document.getElementById("fileUploadInput").click(); - }; - - $(document).on('change','#fileUploadInput',function(){ - - // get the file - var files = document.getElementById('fileUploadInput').files; - - for (var i = 0; i < files.length; i++) { - var file = files[i]; - $scope.processFileInput(file); - } - }); - - $scope.$on("FileLayerError", function (event, errorMsg, dataset) { - $scope.fileLayerError = errorMsg; - $("#fileErrorAlert").show(); - - // remove element from fileDatasets - for( var i = 0; i < kommonitorDataExchangeService.fileDatasets.length; i++){ - if ( kommonitorDataExchangeService.fileDatasets[i] === dataset) { - kommonitorDataExchangeService.fileDatasets.splice(i, 1); - break; - } - } - }); - - $scope.$on("FileLayerSuccess", function (event, dataset) { - $scope.fileLayerError = undefined; - $("#fileErrorAlert").hide(); - $("#fileSucessAlert").show(); - }); - - - } ] - }); + .module('kommonitorDataImport') + .component('kommonitorDataImport', { + templateUrl: "components/kommonitorUserInterface/kommonitorControls/kommonitorDataImport/kommonitor-data-import.template.html", + controller: [ + 'kommonitorDataExchangeService', 'kommonitorMapService', '$scope', '$rootScope', '$http', '__env', + function kommonitorDataImportController(kommonitorDataExchangeService, kommonitorMapService, $scope, $rootScope, $http, __env) { + /* + * reference to kommonitorDataExchangeService instances + */ + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorMapServiceInstance = kommonitorMapService; + $scope.loadingData = false; + $scope.date; + $scope.fileLayerError; + $scope.tmpDatasetName; + $scope.wmsNameFilter = undefined; + $scope.customFileInputColor = `#00AABB`; + $('#customFileInputColorDiv').colorpicker(); + // initialize colorpicker after some time + // wait to ensure that elements ar available on DOM + setTimeout(function () { + var colorPickerInputs = $('.input-group.colorpicker-component'); + colorPickerInputs.colorpicker(); + // $('.input-group.colorpicker-component').each(function (index, value){ + // $(this).colorpicker(); + // }); + }, 3000); + // initialize any adminLTE box widgets + $('.box').boxWidget(); + const DATE_PREFIX = __env.indicatorDatePrefix; + var numberOfDecimals = __env.numberOfDecimals; + $scope.dropHandler = function (ev) { + $scope.fileLayerError = undefined; + $("#fileErrorAlert").hide(); + $("#fileSuccessAlert").hide(); + console.log('File(s) dropped'); + try { + // Prevent default behavior (Prevent file from being opened) + ev.preventDefault(); + if (ev.dataTransfer.items) { + // Use DataTransferItemList interface to access the file(s) + for (var i = 0; i < ev.dataTransfer.items.length; i++) { + // If dropped items aren't files, reject them + if (ev.dataTransfer.items[i].kind === 'file') { + var file = ev.dataTransfer.items[i].getAsFile(); + $scope.processFileInput(file); + } + } + } + else { + // Use DataTransfer interface to access the file(s) + for (var i = 0; i < ev.dataTransfer.files.length; i++) { + var file = ev.dataTransfer.files[i]; + $scope.processFileInput(file); + } + } + } + catch (e) { + $scope.fileLayerError = e; + $("#fileErrorAlert").show(); + } + finally { + } + }; + $scope.processFileInput = function (file) { + console.log('... file[' + i + '].name = ' + file.name); + var fileEnding = file.name.split('.').pop(); + if (fileEnding.toUpperCase() === "json".toUpperCase() || fileEnding.toUpperCase() === "geojson".toUpperCase()) { + console.log("Potential GeoJSON file identified"); + $scope.processFileInput_geoJson(file); + } + else if (fileEnding.toUpperCase() === "zip".toUpperCase()) { + console.log("Potential Shapefile file identified"); + $scope.processFileInput_shape(file); + } + else { + $scope.fileLayerError = "Unknown or unsupported file format"; + $("#fileErrorAlert").show(); + } + }; + $scope.processFileInput_geoJson = function (file) { + var fileReader = new FileReader(); + fileReader.onload = function (event) { + var geoJSON = JSON.parse(event.target.result); + var fileDataset = { + title: file.name, + isSelected: true, + transparency: 0, + displayColor: $scope.customFileInputColor, + type: "GeoJSON", + content: geoJSON + }; + kommonitorDataExchangeService.fileDatasets.push(fileDataset); + $scope.$digest(); + // initialize colorpicker in table + setTimeout(function () { + // initialize colorpicker + $('.input-group.colorpicker-component').colorpicker(); + }, 350); + $scope.handleFileOnMap(fileDataset); + }; + // Read in the image file as a data URL. + fileReader.readAsText(file); + }; + $scope.processFileInput_shape = function (file) { + var fileReader = new FileReader(); + fileReader.onload = function (event) { + var arrayBuffer = event.target.result; + var fileDataset = { + title: file.name, + isSelected: true, + transparency: 0, + displayColor: $scope.customFileInputColor, + type: "shp", + content: arrayBuffer + }; + kommonitorDataExchangeService.fileDatasets.push(fileDataset); + $scope.$digest(); + // initialize colorpicker in table + setTimeout(function () { + // initialize colorpicker + $('.input-group.colorpicker-component').colorpicker(); + }, 350); + $scope.handleFileOnMap(fileDataset); + }; + // Read in the image file as a data URL. + fileReader.readAsArrayBuffer(file); + }; + $scope.handleFileOnMap = function (dataset) { + console.log("Toggle File Layer: " + dataset.title); + $scope.tmpDatasetName = dataset.title; + if (dataset.isSelected) { + //display on Map + var opacity = 1 - dataset.transparency; + kommonitorMapService.addFileLayerToMap(dataset, opacity); + } + else { + //remove WMS layer from map + kommonitorMapService.removeFileLayerFromMap(dataset); + } + }; + $scope.adjustFileLayerTransparency = function (dataset) { + var opacity = 1 - dataset.transparency; + kommonitorMapService.adjustOpacityForFileLayer(dataset, opacity); + }; + $scope.adjustFileLayerColor = function (dataset) { + var color = dataset.displayColor; + kommonitorMapService.adjustColorForFileLayer(dataset, color); + }; + $scope.$on("onDropFile", function (ev, dropEvent) { + $scope.dropHandler(dropEvent); + }); + // $scope.dragOverHandler = function(ev) { + // console.log('File(s) in drop zone'); + // + // // Prevent default behavior (Prevent file from being opened) + // ev.preventDefault(); + // }; + $scope.openFileDialog = function () { + // $("#fileUploadInput").trigger("click"); + document.getElementById("fileUploadInput").click(); + }; + $(document).on('change', '#fileUploadInput', function () { + // get the file + var files = document.getElementById('fileUploadInput').files; + for (var i = 0; i < files.length; i++) { + var file = files[i]; + $scope.processFileInput(file); + } + }); + $scope.$on("FileLayerError", function (event, errorMsg, dataset) { + $scope.fileLayerError = errorMsg; + $("#fileErrorAlert").show(); + // remove element from fileDatasets + for (var i = 0; i < kommonitorDataExchangeService.fileDatasets.length; i++) { + if (kommonitorDataExchangeService.fileDatasets[i] === dataset) { + kommonitorDataExchangeService.fileDatasets.splice(i, 1); + break; + } + } + }); + $scope.$on("FileLayerSuccess", function (event, dataset) { + $scope.fileLayerError = undefined; + $("#fileErrorAlert").hide(); + $("#fileSucessAlert").show(); + }); + } + ] +}); +//# sourceMappingURL=kommonitor-data-import.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataImport/kommonitor-data-import.component.js.map b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataImport/kommonitor-data-import.component.js.map new file mode 100644 index 000000000..8182eb010 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataImport/kommonitor-data-import.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-data-import.component.js","sourceRoot":"","sources":["kommonitor-data-import.component.ts"],"names":[],"mappings":";AAAA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KAAK,CAAC;gBAE7D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;oBACtC,IAAI,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;oBACpB,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;iBAC9B;YACF,CAAC,CAAC,CAAC;YAEH,MAAM,CAAC,GAAG,CAAC,gBAAgB,EAAE,UAAU,KAAK,EAAE,QAAQ,EAAE,OAAO;gBAC9D,MAAM,CAAC,cAAc,GAAG,QAAQ,CAAC;gBACjC,CAAC,CAAC,iBAAiB,CAAC,CAAC,IAAI,EAAE,CAAC;gBAE5B,mCAAmC;gBACnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,6BAA6B,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAC;oBACxE,IAAK,6BAA6B,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE;wBAC9D,6BAA6B,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;wBAC1D,MAAM;qBACL;iBACH;YACF,CAAC,CAAC,CAAC;YAEH,MAAM,CAAC,GAAG,CAAC,kBAAkB,EAAE,UAAU,KAAK,EAAE,OAAO;gBACtD,MAAM,CAAC,cAAc,GAAG,SAAS,CAAC;gBAClC,CAAC,CAAC,iBAAiB,CAAC,CAAC,IAAI,EAAE,CAAC;gBAC5B,CAAC,CAAC,kBAAkB,CAAC,CAAC,IAAI,EAAE,CAAC;YAC9B,CAAC,CAAC,CAAC;QAGJ,CAAC;KAAE;CACL,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataImport/kommonitor-data-import.component.ts b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataImport/kommonitor-data-import.component.ts new file mode 100644 index 000000000..75bed99f9 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataImport/kommonitor-data-import.component.ts @@ -0,0 +1,245 @@ +angular + .module('kommonitorDataImport') + .component( + 'kommonitorDataImport', + { + templateUrl : "components/kommonitorUserInterface/kommonitorControls/kommonitorDataImport/kommonitor-data-import.template.html", + + controller : [ + 'kommonitorDataExchangeService', 'kommonitorMapService', '$scope', '$rootScope', '$http', '__env', + function kommonitorDataImportController( + kommonitorDataExchangeService, kommonitorMapService, $scope, $rootScope, $http, __env) { + /* + * reference to kommonitorDataExchangeService instances + */ + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorMapServiceInstance = kommonitorMapService; + $scope.loadingData = false; + $scope.date; + + $scope.fileLayerError; + $scope.tmpDatasetName; + + $scope.wmsNameFilter = undefined; + + $scope.customFileInputColor = `#00AABB`; + + $('#customFileInputColorDiv').colorpicker(); + + // initialize colorpicker after some time + // wait to ensure that elements ar available on DOM + setTimeout(function() { + + var colorPickerInputs = $('.input-group.colorpicker-component') + colorPickerInputs.colorpicker(); + + // $('.input-group.colorpicker-component').each(function (index, value){ + // $(this).colorpicker(); + // }); + }, 3000); + + + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + const DATE_PREFIX = __env.indicatorDatePrefix; + + var numberOfDecimals = __env.numberOfDecimals; + + + $scope.dropHandler = function(ev) { + $scope.fileLayerError = undefined; + $("#fileErrorAlert").hide(); + $("#fileSuccessAlert").hide(); + console.log('File(s) dropped'); + + try { + // Prevent default behavior (Prevent file from being opened) + ev.preventDefault(); + + if (ev.dataTransfer.items) { + // Use DataTransferItemList interface to access the file(s) + for (var i = 0; i < ev.dataTransfer.items.length; i++) { + // If dropped items aren't files, reject them + if (ev.dataTransfer.items[i].kind === 'file') { + var file = ev.dataTransfer.items[i].getAsFile(); + $scope.processFileInput(file); + + } + } + } else { + // Use DataTransfer interface to access the file(s) + for (var i = 0; i < ev.dataTransfer.files.length; i++) { + var file = ev.dataTransfer.files[i]; + $scope.processFileInput(file); + } + } + } catch (e) { + $scope.fileLayerError = e; + $("#fileErrorAlert").show(); + } finally { + + } + + }; + + $scope.processFileInput = function(file){ + console.log('... file[' + i + '].name = ' + file.name); + + var fileEnding = file.name.split('.').pop(); + + if(fileEnding.toUpperCase() === "json".toUpperCase() || fileEnding.toUpperCase() === "geojson".toUpperCase()){ + console.log("Potential GeoJSON file identified") + $scope.processFileInput_geoJson(file); + } + else if (fileEnding.toUpperCase() === "zip".toUpperCase()){ + console.log("Potential Shapefile file identified") + $scope.processFileInput_shape(file); + } + else{ + $scope.fileLayerError = "Unknown or unsupported file format"; + $("#fileErrorAlert").show(); + } + }; + + $scope.processFileInput_geoJson = function(file){ + var fileReader = new FileReader(); + + fileReader.onload = function(event) { + var geoJSON = JSON.parse(event.target.result); + + var fileDataset = { + title: file.name, + isSelected: true, + transparency: 0, + displayColor: $scope.customFileInputColor, + type: "GeoJSON", + content: geoJSON + }; + + kommonitorDataExchangeService.fileDatasets.push(fileDataset); + $scope.$digest(); + // initialize colorpicker in table + setTimeout(function() { + // initialize colorpicker + $('.input-group.colorpicker-component').colorpicker(); + }, 350); + + $scope.handleFileOnMap(fileDataset); + + }; + + // Read in the image file as a data URL. + fileReader.readAsText(file); + }; + + $scope.processFileInput_shape = function(file){ + var fileReader = new FileReader(); + + fileReader.onload = function(event) { + var arrayBuffer = event.target.result; + + var fileDataset = { + title: file.name, + isSelected: true, + transparency: 0, + displayColor: $scope.customFileInputColor, + type: "shp", + content: arrayBuffer + }; + + kommonitorDataExchangeService.fileDatasets.push(fileDataset); + $scope.$digest(); + // initialize colorpicker in table + setTimeout(function() { + // initialize colorpicker + $('.input-group.colorpicker-component').colorpicker(); + }, 350); + + $scope.handleFileOnMap(fileDataset); + + }; + + // Read in the image file as a data URL. + fileReader.readAsArrayBuffer(file); + }; + + $scope.handleFileOnMap = function(dataset){ + console.log("Toggle File Layer: " + dataset.title); + + $scope.tmpDatasetName = dataset.title; + + if(dataset.isSelected){ + //display on Map + var opacity = 1 - dataset.transparency; + kommonitorMapService.addFileLayerToMap(dataset, opacity); + } + else{ + //remove WMS layer from map + kommonitorMapService.removeFileLayerFromMap(dataset); + } + }; + + $scope.adjustFileLayerTransparency = function(dataset){ + + var opacity = 1 - dataset.transparency; + + kommonitorMapService.adjustOpacityForFileLayer(dataset, opacity); + }; + + $scope.adjustFileLayerColor = function(dataset){ + + var color = dataset.displayColor; + + kommonitorMapService.adjustColorForFileLayer(dataset, color); + }; + + $scope.$on("onDropFile", function (ev, dropEvent) { + $scope.dropHandler(dropEvent); + }); + + // $scope.dragOverHandler = function(ev) { + // console.log('File(s) in drop zone'); + // + // // Prevent default behavior (Prevent file from being opened) + // ev.preventDefault(); + // }; + + $scope.openFileDialog = function(){ + // $("#fileUploadInput").trigger("click"); + document.getElementById("fileUploadInput").click(); + }; + + $(document).on('change','#fileUploadInput',function(){ + + // get the file + var files = document.getElementById('fileUploadInput').files; + + for (var i = 0; i < files.length; i++) { + var file = files[i]; + $scope.processFileInput(file); + } + }); + + $scope.$on("FileLayerError", function (event, errorMsg, dataset) { + $scope.fileLayerError = errorMsg; + $("#fileErrorAlert").show(); + + // remove element from fileDatasets + for( var i = 0; i < kommonitorDataExchangeService.fileDatasets.length; i++){ + if ( kommonitorDataExchangeService.fileDatasets[i] === dataset) { + kommonitorDataExchangeService.fileDatasets.splice(i, 1); + break; + } + } + }); + + $scope.$on("FileLayerSuccess", function (event, dataset) { + $scope.fileLayerError = undefined; + $("#fileErrorAlert").hide(); + $("#fileSucessAlert").show(); + }); + + + } ] + }); diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataImport/kommonitor-data-import.module.js b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataImport/kommonitor-data-import.module.js index f6e963169..2e52be392 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataImport/kommonitor-data-import.module.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataImport/kommonitor-data-import.module.js @@ -1,62 +1,41 @@ -angular.module('kommonitorDataImport', [ 'kommonitorDataExchange', 'kommonitorMap', 'ngSanitize']); - -angular.module('kommonitorDataImport').directive('droppable', ['$rootScope', function($rootScope) { - return { - scope: { - drop: '&' // parent - }, - link: function(scope, element) { - // again we need the native object - var el = element[0]; - - el.addEventListener( - 'dragover', - function(e) { +"use strict"; +angular.module('kommonitorDataImport', ['kommonitorDataExchange', 'kommonitorMap', 'ngSanitize']); +angular.module('kommonitorDataImport').directive('droppable', ['$rootScope', function ($rootScope) { + return { + scope: { + drop: '&' // parent + }, + link: function (scope, element) { + // again we need the native object + var el = element[0]; + el.addEventListener('dragover', function (e) { e.dataTransfer.dropEffect = 'move'; // allows us to drop - if (e.preventDefault) e.preventDefault(); + if (e.preventDefault) + e.preventDefault(); this.classList.add('over'); return false; - }, - false - ); - - el.addEventListener( - 'dragenter', - function(e) { + }, false); + el.addEventListener('dragenter', function (e) { this.classList.add('over'); return false; - }, - false - ); - - el.addEventListener( - 'dragleave', - function(e) { + }, false); + el.addEventListener('dragleave', function (e) { this.classList.remove('over'); return false; - }, - false - ); - - el.addEventListener( - 'drop', - function(e) { + }, false); + el.addEventListener('drop', function (e) { // Stops some browsers from redirecting. - if (e.stopPropagation) e.stopPropagation(); - + if (e.stopPropagation) + e.stopPropagation(); // Prevent default behavior (Prevent file from being opened) - if (e.preventDefault()) e.preventDefault(); - + if (e.preventDefault()) + e.preventDefault(); this.classList.remove('over'); - $rootScope.$broadcast("onDropFile", e); - - return false; - }, - false - ); - } - } -}]); + }, false); + } + }; + }]); +//# sourceMappingURL=kommonitor-data-import.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataImport/kommonitor-data-import.module.js.map b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataImport/kommonitor-data-import.module.js.map new file mode 100644 index 000000000..4aa7eafc2 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataImport/kommonitor-data-import.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-data-import.module.js","sourceRoot":"","sources":["kommonitor-data-import.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,sBAAsB,EAAE,CAAE,wBAAwB,EAAE,eAAe,EAAE,YAAY,CAAC,CAAC,CAAC;AAEnG,OAAO,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,YAAY,EAAE,UAAS,UAAU;QAC5F,OAAO;YACH,KAAK,EAAE;gBACH,IAAI,EAAE,GAAG,CAAC,SAAS;aACtB;YACD,IAAI,EAAE,UAAS,KAAK,EAAE,OAAO;gBACzB,kCAAkC;gBAClC,IAAI,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;gBAEpB,EAAE,CAAC,gBAAgB,CACf,UAAU,EACV,UAAS,CAAC;oBACN,CAAC,CAAC,YAAY,CAAC,UAAU,GAAG,MAAM,CAAC;oBACnC,oBAAoB;oBACpB,IAAI,CAAC,CAAC,cAAc;wBAAE,CAAC,CAAC,cAAc,EAAE,CAAC;oBACzC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;oBAC3B,OAAO,KAAK,CAAC;gBACjB,CAAC,EACD,KAAK,CACR,CAAC;gBAEF,EAAE,CAAC,gBAAgB,CACf,WAAW,EACX,UAAS,CAAC;oBACN,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;oBAC3B,OAAO,KAAK,CAAC;gBACjB,CAAC,EACD,KAAK,CACR,CAAC;gBAEF,EAAE,CAAC,gBAAgB,CACf,WAAW,EACX,UAAS,CAAC;oBACN,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;oBAC9B,OAAO,KAAK,CAAC;gBACjB,CAAC,EACD,KAAK,CACR,CAAC;gBAEF,EAAE,CAAC,gBAAgB,CACf,MAAM,EACN,UAAS,CAAC;oBACN,wCAAwC;oBACxC,IAAI,CAAC,CAAC,eAAe;wBAAE,CAAC,CAAC,eAAe,EAAE,CAAC;oBAE3C,4DAA4D;oBAC5D,IAAI,CAAC,CAAC,cAAc,EAAE;wBAAE,CAAC,CAAC,cAAc,EAAE,CAAC;oBAE3C,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;oBAE9B,UAAU,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;oBAGvC,OAAO,KAAK,CAAC;gBACjB,CAAC,EACD,KAAK,CACR,CAAC;YACN,CAAC;SACJ,CAAA;IACL,CAAC,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataImport/kommonitor-data-import.module.ts b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataImport/kommonitor-data-import.module.ts new file mode 100644 index 000000000..f6e963169 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataImport/kommonitor-data-import.module.ts @@ -0,0 +1,62 @@ +angular.module('kommonitorDataImport', [ 'kommonitorDataExchange', 'kommonitorMap', 'ngSanitize']); + +angular.module('kommonitorDataImport').directive('droppable', ['$rootScope', function($rootScope) { + return { + scope: { + drop: '&' // parent + }, + link: function(scope, element) { + // again we need the native object + var el = element[0]; + + el.addEventListener( + 'dragover', + function(e) { + e.dataTransfer.dropEffect = 'move'; + // allows us to drop + if (e.preventDefault) e.preventDefault(); + this.classList.add('over'); + return false; + }, + false + ); + + el.addEventListener( + 'dragenter', + function(e) { + this.classList.add('over'); + return false; + }, + false + ); + + el.addEventListener( + 'dragleave', + function(e) { + this.classList.remove('over'); + return false; + }, + false + ); + + el.addEventListener( + 'drop', + function(e) { + // Stops some browsers from redirecting. + if (e.stopPropagation) e.stopPropagation(); + + // Prevent default behavior (Prevent file from being opened) + if (e.preventDefault()) e.preventDefault(); + + this.classList.remove('over'); + + $rootScope.$broadcast("onDropFile", e); + + + return false; + }, + false + ); + } + } +}]); diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataSetup/kommonitor-data-setup.component.js b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataSetup/kommonitor-data-setup.component.js index a468a3590..13e396a46 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataSetup/kommonitor-data-setup.component.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataSetup/kommonitor-data-setup.component.js @@ -1,796 +1,604 @@ +"use strict"; angular - .module('kommonitorDataSetup') - .component( - 'kommonitorDataSetup', - { - templateUrl : "components/kommonitorUserInterface/kommonitorControls/kommonitorDataSetup/kommonitor-data-setup.template.html", - /* - * injected with a modules service method that manages - * enabled tabs - */ - controller : [ - 'kommonitorDataExchangeService', '$scope', 'kommonitorMapService', '$http', '$rootScope', '__env', - '$timeout', - function kommonitorDataSetupController(kommonitorDataExchangeService, $scope, kommonitorMapService, $http, $rootScope, __env, - $timeout) { - - const INDICATOR_DATE_PREFIX = __env.indicatorDatePrefix; - - $scope.indicatorNameFilter = undefined; - - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - var addClickListenerToEachCollapseTrigger = function(){ - setTimeout(function(){ - $('.list-group-item > .collapseTrigger').on('click', function() { - $('.glyphicon', this) - .toggleClass('glyphicon-chevron-right') - .toggleClass('glyphicon-chevron-down'); - - // manage uncollapsed entries - // var clickedTopicId = $(this).attr('id'); - // if ($scope.unCollapsedTopicIds.includes(clickedTopicId)){ - // var index = $scope.unCollapsedTopicIds.indexOf(clickedTopicId); - // $scope.unCollapsedTopicIds.splice(index, 1); - // } - // else{ - // $scope.unCollapsedTopicIds.push(clickedTopicId); - // } - }); - }, 500); - }; - - $(document).ready(function() { - - addClickListenerToEachCollapseTrigger(); - }); - - // var rangeslide = require("rangeslide"); - /* - * references to kommonitorDataExchangeService and wpsFormControl instances - */ - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorDataExchangeServiceInstance.selectedServiceUrl = ''; - this.kommonitorMapServiceInstance = kommonitorMapService; - - $scope.loadingData = true; - $scope.changeIndicatorWasClicked = false; - - $scope.dateSlider; - $scope.datePicker; - $scope.datesAsMs; - - $scope.selectedDate; - - this.addGeopackage = function(){ - this.kommonitorMapServiceInstance.addSpatialUnitGeopackage(); - } - this.addGeoJSON = function(){ - this.kommonitorMapServiceInstance.addSpatialUnitGeoJSON(); - } - - $scope.onClickHierarchyIndicator = function(indicatorMetadata){ - kommonitorDataExchangeService.selectedIndicator = indicatorMetadata; - $scope.onChangeSelectedIndicator(false); - }; - - // $scope.$watch('filteredSpatialUnits', function(value){ - // if ($scope.filteredSpatialUnits) { - // kommonitorDataExchangeService.selectedSpatialUnit = $scope.filteredSpatialUnits[0]; - // } - // }, true); - - this.onClickTheme = function(topicName){ - - for(const topic of this.kommonitorDataExchangeServiceInstance.availableTopics){ - if(topic.topicName === topicName){ - document.getElementById(topicName).setAttribute("class", "active"); - this.kommonitorDataExchangeServiceInstance.selectedTopic = topic; - } - else { - if(document.getElementById(topic.topicName)){ - document.getElementById(topic.topicName).setAttribute("class", ""); - } - } - }; - - if(kommonitorDataExchangeService.selectedIndicator){ - kommonitorDataExchangeService.selectedIndicatorBackup = kommonitorDataExchangeService.selectedIndicator; - } - - // $scope.$digest(); - }; - - this.unsetTopic = function(){ - this.kommonitorDataExchangeServiceInstance.selectedTopic = null; - - for(const topic of this.kommonitorDataExchangeServiceInstance.availableTopics){ - if (document.getElementById(topic.topicName)){ - document.getElementById(topic.topicName).setAttribute("class", ""); - } - }; - - if(!kommonitorDataExchangeService.selectedIndicator){ - kommonitorDataExchangeService.selectedIndicator = kommonitorDataExchangeService.selectedIndicatorBackup; - } - - // $scope.$digest(); - }; - - $scope.filterGeoresourcesByIndicator = function() { - return function( item ) { - - try{ - var referencedGeoresources = kommonitorDataExchangeService.selectedIndicator.referencedGeoresources; - var georesourceId = item.georesourceId; - - for (const refGeoresource of referencedGeoresources){ - if(refGeoresource.referencedGeoresourceId === georesourceId) - return true; - }; - - // return referencedGeoresources.includes(georesourceId); - } - catch(error){ - return false; - } - }; - }; - - $scope.filterReferencedIndicatorsByIndicator = function() { - return function( item ) { - - try{ - var referencedIndicators = kommonitorDataExchangeService.selectedIndicator.referencedIndicators; - var indicatorId = item.indicatorId; - - for (const refIndicator of referencedIndicators){ - if(refIndicator.referencedIndicatorId === indicatorId) - return true; - }; - - } - catch(error){ - return false; - } - }; - }; - - $scope.filterGeoresourcesByTopic = function() { - return function( item ) { - if (kommonitorDataExchangeService.selectedTopic) - return item.applicableTopics.includes(kommonitorDataExchangeService.selectedTopic.topicName); - - return true; - }; - }; - - $scope.filterSpatialUnitsByIndicator = function() { - return function( item ) { - - try{ - var applicableSpatialUnits = kommonitorDataExchangeService.selectedIndicator.applicableSpatialUnits; - - return applicableSpatialUnits.some(o => o.spatialUnitName === item.spatialUnitLevel); - } - catch(error){ - return false; - } - }; - }; - - $scope.getFirstSpatialUnitForSelectedIndicator = function() { - - var result = undefined; - - var applicableSpatialUnits = kommonitorDataExchangeService.selectedIndicator.applicableSpatialUnits; - - for (const spatialUnitEntry of kommonitorDataExchangeService.availableSpatialUnits){ - if(applicableSpatialUnits.some(o => o.spatialUnitName === spatialUnitEntry.spatialUnitLevel)){ - result = spatialUnitEntry; - break; - } - } - - return result; - }; - - this.onDateChange = function(){ - - var date = new Date($scope.selectedDate); - - var month = date.getMonth()+1; - var day = date.getDate(); - - if (month < 10) - month = "0" + month; - - if (day < 10) - day = "0" + day; - - $scope.selectedDate = date.getFullYear() + "-" + month + "-" + day; - kommonitorDataExchangeService.selectedDate = $scope.selectedDate; - - $scope.$digest(); - }; - - $scope.$on("initialMetadataLoadingFailed", function (event, errorArray) { - - $scope.loadingData = false; - $scope.$broadcast("hideLoadingIconOnMap"); - - }); - - // load exemplar indicator - $scope.$on("initialMetadataLoadingCompleted", function (event) { - - console.log("Load an initial example indicator"); - - if (kommonitorDataExchangeService.displayableIndicators == null || kommonitorDataExchangeService.displayableIndicators == undefined || kommonitorDataExchangeService.displayableIndicators.length === 0){ - console.error("Kein darstellbarer Indikator konnte gefunden werden."); - - kommonitorDataExchangeService.displayMapApplicationError("Kein darstellbarer Indikator konnte gefunden werden."); - $scope.loadingData = false; - $scope.$broadcast("hideLoadingIconOnMap"); - - return; - } - - try{ - var indicatorIndex = undefined; - - for (var index=0; index < kommonitorDataExchangeService.displayableIndicators.length; index++){ - if (kommonitorDataExchangeService.displayableIndicators[index].indicatorId === __env.initialIndicatorId){ - if(kommonitorDataExchangeService.displayableIndicators[index].applicableDates.length > 0){ - indicatorIndex = index; - break; - } - } - } - - if( indicatorIndex === undefined){ - for(var t=0; t < 75; t++){ - - var randIndex = getRandomInt(0, kommonitorDataExchangeService.displayableIndicators.length - 1); - if (kommonitorDataExchangeService.displayableIndicators[randIndex].applicableDates.length > 0){ - indicatorIndex = randIndex; - break; - } - } - } - - if( indicatorIndex === undefined){ - throw Error(); - } - - kommonitorDataExchangeService.selectedIndicator = kommonitorDataExchangeService.displayableIndicators[indicatorIndex]; - // create Backup which is used when currently selected indicator is filtered out in select - kommonitorDataExchangeService.selectedIndicatorBackup = kommonitorDataExchangeService.selectedIndicator; - - // set spatialUnit - for (var spatialUnitEntry of kommonitorDataExchangeService.availableSpatialUnits){ - if(spatialUnitEntry.spatialUnitLevel === __env.initialSpatialUnitName){ - kommonitorDataExchangeService.selectedSpatialUnit = spatialUnitEntry; - break; - } - } - if(!kommonitorDataExchangeService.selectedSpatialUnit){ - kommonitorDataExchangeService.selectedSpatialUnit = $scope.getFirstSpatialUnitForSelectedIndicator(); - } - - if(! __env.centerMapInitially){ - $scope.onChangeSelectedIndicator(false); - } - else{ - $scope.onChangeSelectedIndicator(true); - } - - - } - catch(error){ - console.error("Initiales Darstellen eines Indikators ist gescheitert."); - - kommonitorDataExchangeService.displayMapApplicationError("Initiales Darstellen eines Indikators ist gescheitert."); - $scope.loadingData = false; - $scope.$broadcast("hideLoadingIconOnMap"); - - return; - } - - - }); - - /** - * Returns a random integer between min (inclusive) and max (inclusive). - * The value is no lower than min (or the next integer greater than min - * if min isn't an integer) and no greater than max (or the next integer - * lower than max if max isn't an integer). - * Using Math.round() will give you a non-uniform distribution! - */ - function getRandomInt(min, max) { - min = Math.ceil(min); - max = Math.floor(max); - return Math.floor(Math.random() * (max - min + 1)) + min; - } - - this.addSelectedSpatialUnitToMap = function() { - $scope.loadingData = true; - $rootScope.$broadcast("showLoadingIconOnMap"); - - var metadata = kommonitorDataExchangeService.selectedSpatialUnit; - - var id = metadata.spatialUnitId; - - $scope.date = $scope.selectedDate; - - var dateComps = $scope.selectedDate.split("-"); - - var year = dateComps[0]; - var month = dateComps[1]; - var day = dateComps[2]; - - $http({ - url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/spatial-units/" + id + "/" + year + "/" + month + "/" + day + "?" + kommonitorDataExchangeService.simplifyGeometriesParameterName + "=" + kommonitorDataExchangeService.simplifyGeometries, - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - var geoJSON = response.data; - - kommonitorDataExchangeService.selectedSpatialUnit.geoJSON = geoJSON; - - kommonitorMapService.addSpatialUnitGeoJSON(kommonitorDataExchangeService.selectedSpatialUnit, $scope.date); - $scope.loadingData = false; - $rootScope.$broadcast("hideLoadingIconOnMap"); - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - $scope.loadingData = false; - kommonitorDataExchangeService.displayMapApplicationError(error); - $rootScope.$broadcast("hideLoadingIconOnMap"); - }); - }; - - this.addSelectedSpatialUnitToMapAsWFS = function() { - $scope.loadingData = true; - $rootScope.$broadcast("showLoadingIconOnMap"); - - var metadata = kommonitorDataExchangeService.selectedSpatialUnit; - - var name = metadata.spatialUnitLevel; - - var wfsUrl = metadata.wfsUrl; - - kommonitorMapService.addSpatialUnitWFS(name, wfsUrl); - $scope.loadingData = false; - $rootScope.$broadcast("hideLoadingIconOnMap"); - - }; - - this.addSelectedGeoresourceToMap = function() { - $scope.loadingData = true; - $rootScope.$broadcast("showLoadingIconOnMap"); - - var metadata = kommonitorDataExchangeService.selectedGeoresource; - - var id = metadata.georesourceId; - - $scope.date = $scope.selectedDate; - - var dateComps = $scope.selectedDate.split("-"); - - var year = dateComps[0]; - var month = dateComps[1]; - var day = dateComps[2]; - - $http({ - url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + id + "/" + year + "/" + month + "/" + day + "?" + kommonitorDataExchangeService.simplifyGeometriesParameterName + "=" + kommonitorDataExchangeService.simplifyGeometries, - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - var geoJSON = response.data; - - kommonitorDataExchangeService.selectedGeoresource.geoJSON = geoJSON; - - kommonitorMapService.addGeoresourceGeoJSON(kommonitorDataExchangeService.selectedGeoresource, $scope.date); - $scope.loadingData = false; - $rootScope.$broadcast("hideLoadingIconOnMap"); - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - $scope.loadingData = false; - kommonitorDataExchangeService.displayMapApplicationError(error); - $rootScope.$broadcast("hideLoadingIconOnMap"); - }); - - }; - - $scope.addSelectedIndicatorToMap = function(changeIndicator) { - - if(changeIndicator){ - $rootScope.$broadcast("DisableBalance"); - kommonitorMapService.replaceIndicatorGeoJSON(kommonitorDataExchangeService.selectedIndicator, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, $scope.selectedDate, false); - } - else{ - // check if balance mode is active - if (kommonitorDataExchangeService.isBalanceChecked){ - $rootScope.$broadcast("replaceBalancedIndicator"); - } - else{ - kommonitorMapService.replaceIndicatorGeoJSON(kommonitorDataExchangeService.selectedIndicator, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, $scope.selectedDate, false); - } - } - }; - - function prettifyDateSliderLabels (dateAsMs) { - return kommonitorDataExchangeService.tsToDate_withOptionalUpdateInterval(dateAsMs, kommonitorDataExchangeService.selectedIndicator.metadata.updateInterval); - } - - function createDatesFromIndicatorDates(indicatorDates) { - - $scope.datesAsMs = []; - - for (var index=0; index < indicatorDates.length; index++){ - // year-month-day - var dateComponents = indicatorDates[index].split("-"); - $scope.datesAsMs.push(kommonitorDataExchangeService.dateToTS(new Date(Number(dateComponents[0]), Number(dateComponents[1]) - 1, Number(dateComponents[2])))); - } - return $scope.datesAsMs; - } - - $scope.setupDateSliderForIndicator = function(){ - - if($scope.dateSlider){ - $scope.dateSlider.destroy(); - } - - var domNode = document.getElementById("dateSlider"); - - while (domNode.hasChildNodes()) { - domNode.removeChild(domNode.lastChild); - } - - var availableDates = kommonitorDataExchangeService.selectedIndicator.applicableDates; - $scope.date = availableDates[availableDates.length - 1]; - $scope.selectedDate = availableDates[availableDates.length - 1]; - kommonitorDataExchangeService.selectedDate = availableDates[availableDates.length - 1]; - - $scope.datesAsMs = createDatesFromIndicatorDates(kommonitorDataExchangeService.selectedIndicator.applicableDates); - - // new Date() uses month between 0-11! - $("#dateSlider").ionRangeSlider({ - skin: "big", - type: "single", - grid: true, - values: $scope.datesAsMs, - from: $scope.datesAsMs.length -1, // index, not the date - force_edges: true, - prettify: prettifyDateSliderLabels, - onChange: $scope.onChangeDateSliderItem - }); - - $scope.dateSlider = $("#dateSlider").data("ionRangeSlider"); - // make sure that the handle is properly set to max value - $scope.dateSlider.update({ - from: $scope.datesAsMs.length -1 // index, not the date - }); - }; - - $scope.setupDatePickerForIndicator = function(){ - - if($scope.datePicker){ - $('#indicatorDatePicker').datepicker('destroy'); - $scope.datePicker = undefined; - } - - var domNode = document.getElementById("indicatorDatePicker"); - - while (domNode.hasChildNodes()) { - domNode.removeChild(domNode.lastChild); - } - - var availableDates = kommonitorDataExchangeService.selectedIndicator.applicableDates; - $scope.date = availableDates[availableDates.length - 1]; - $scope.selectedDate = availableDates[availableDates.length - 1]; - kommonitorDataExchangeService.selectedDate = availableDates[availableDates.length - 1]; - - $scope.datePicker = $('#indicatorDatePicker').datepicker(kommonitorDataExchangeService.getLimitedDatePickerOptions(availableDates)); - - }; - - - $scope.onChangeDateSliderItem = async function(data){ - - if(!$scope.changeIndicatorWasClicked && kommonitorDataExchangeService.selectedIndicator){ - $scope.loadingData = true; - $rootScope.$broadcast("showLoadingIconOnMap"); - - console.log("Change selected date"); - - //data.from is index of date! - - $scope.selectedDate = kommonitorDataExchangeService.selectedIndicator.applicableDates[data.from]; - $scope.date = $scope.selectedDate; - kommonitorDataExchangeService.selectedDate = $scope.selectedDate; - - $('#indicatorDatePicker').datepicker('update', new Date(kommonitorDataExchangeService.selectedDate)); - - try{ - var selectedIndicator = await $scope.tryUpdateMeasureOfValueBarForIndicator(); - } - catch(error){ - console.error(error); - $scope.loadingData = false; - $rootScope.$broadcast("hideLoadingIconOnMap"); - kommonitorDataExchangeService.displayMapApplicationError(error); - return; - } - - $scope.modifyExports(false); - - if(document.getElementById('controlNoDataDisplay').checked) - $rootScope.$broadcast('applyNoDataDisplay') - - $scope.loadingData = false; - $rootScope.$broadcast("hideLoadingIconOnMap"); - $rootScope.$broadcast("selectedIndicatorDateHasChanged"); - $rootScope.$apply(); - } - }; - - $scope.$on("DisableDateSlider", function (event) { - if($scope.dateSlider){ - $scope.dateSlider.update({ - block: true - }); - } - - kommonitorDataExchangeService.disableIndicatorDatePicker = true; - }); - - $scope.$on("EnableDateSlider", function (event) { - if($scope.dateSlider){ - $scope.dateSlider.update({ - block: false - }); - } - - kommonitorDataExchangeService.disableIndicatorDatePicker = false; - }); - - var wait = ms => new Promise((r, j)=>setTimeout(r, ms)); - - $scope.tryUpdateMeasureOfValueBarForIndicator = async function(){ - var indicatorId = kommonitorDataExchangeService.selectedIndicator.indicatorId; - - if(! ($scope.date && kommonitorDataExchangeService.selectedSpatialUnit && indicatorId)){ - kommonitorDataExchangeService.displayMapApplicationError("Beim Versuch, einen Beispielindikator zu laden, ist ein Fehler aufgetreten. Der Datenbankeintrag scheint eine fehlerhafte Kombination aus Raumeinheit und Zeitschnitt zu enthalten."); - throw Error("Not all parameters have been set up yet."); - } - // - // $scope.selectedDate = $scope.selectedDate; - $scope.spatialUnitName = kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel; - - var dateComps = $scope.date.split("-"); - var year = dateComps[0]; - var month = dateComps[1]; - var day = dateComps[2]; - - return await $http({ - url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/indicators/" + indicatorId + "/" + kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitId + "/" + year + "/" + month + "/" + day + "?" + kommonitorDataExchangeService.simplifyGeometriesParameterName + "=" + kommonitorDataExchangeService.simplifyGeometries, - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - var geoJSON = response.data; - - kommonitorDataExchangeService.selectedIndicator.geoJSON = geoJSON; - - $rootScope.$broadcast("updateMeasureOfValueBar", $scope.date, kommonitorDataExchangeService.selectedIndicator); - - // $scope.updateMeasureOfValueBar($scope.date); - - return kommonitorDataExchangeService.selectedIndicator; - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - $scope.loadingData = false; - kommonitorDataExchangeService.displayMapApplicationError(error); - $rootScope.$broadcast("hideLoadingIconOnMap"); - - return kommonitorDataExchangeService.selectedIndicator; - }); - }; - - $scope.$on("changeSpatialUnit", function(event){ - $scope.onChangeSelectedSpatialUnit(); - }); - - $scope.$on("changeIndicatorDate", async function(event){ - - if(kommonitorDataExchangeService.selectedIndicator && kommonitorDataExchangeService.selectedDate){ - $scope.loadingData = true; - $rootScope.$broadcast("showLoadingIconOnMap"); - - console.log("Change selected date"); - - //data.from is index of date! - var index = kommonitorDataExchangeService.selectedIndicator.applicableDates.indexOf(kommonitorDataExchangeService.selectedDate); ; - - $scope.dateSlider.update({ - from: index // index, not the date - }); - - $scope.date = kommonitorDataExchangeService.selectedDate; - $scope.selectedDate = kommonitorDataExchangeService.selectedDate; - - try{ - var selectedIndicator = await $scope.tryUpdateMeasureOfValueBarForIndicator(); - } - catch(error){ - console.error(error); - $scope.loadingData = false; - $rootScope.$broadcast("hideLoadingIconOnMap"); - kommonitorDataExchangeService.displayMapApplicationError(error); - return; - } - - $scope.modifyExports(false); - - if(document.getElementById('controlNoDataDisplay').checked) - $rootScope.$broadcast('applyNoDataDisplay') - - $scope.loadingData = false; - $rootScope.$broadcast("hideLoadingIconOnMap"); - $rootScope.$broadcast("selectedIndicatorDateHasChanged"); - $rootScope.$apply(); - } - - }); - - $scope.onChangeSelectedSpatialUnit = async function(){ - if(!$scope.changeIndicatorWasClicked && kommonitorDataExchangeService.selectedIndicator){ - $scope.loadingData = true; - $rootScope.$broadcast("showLoadingIconOnMap"); - - console.log("Change spatial unit"); - - try{ - var selectedIndicator = await $scope.tryUpdateMeasureOfValueBarForIndicator(); - } - catch(error){ - console.error(error); - $scope.loadingData = false; - $rootScope.$broadcast("hideLoadingIconOnMap"); - kommonitorDataExchangeService.displayMapApplicationError(error); - return; - } - - $scope.modifyExports(false); - - if(document.getElementById('controlNoDataDisplay').checked) - $rootScope.$broadcast('applyNoDataDisplay'); - - $scope.loadingData = false; - $rootScope.$broadcast("hideLoadingIconOnMap"); - $scope.$digest(); - } - } - - $scope.markAssociatedHierarchyElement = function(selectedIndicatorMetadata){ - var selectedIndicatorId = selectedIndicatorMetadata.indicatorId; - - for (var indicator of kommonitorDataExchangeService.displayableIndicators) { - $("#indicatorHierarchyElement-" + indicator.indicatorId).removeClass('active'); - } - - $("#indicatorHierarchyElement-" + selectedIndicatorId).addClass('active'); - }; - - $scope.onChangeSelectedIndicator_fromAlphabeticalList = function(indicatorMetadata){ - kommonitorDataExchangeService.selectedIndicator = indicatorMetadata; - $scope.onChangeSelectedIndicator(false); - }; - - $scope.onChangeSelectedIndicator = async function(recenterMap){ - - $rootScope.$broadcast("onChangeSelectedIndicator"); - - if(kommonitorDataExchangeService.selectedIndicator){ - - $scope.loadingData = true; - $rootScope.$broadcast("showLoadingIconOnMap"); - $scope.changeIndicatorWasClicked = true; - - $scope.markAssociatedHierarchyElement(kommonitorDataExchangeService.selectedIndicator); - - kommonitorDataExchangeService.selectedIndicatorBackup = kommonitorDataExchangeService.selectedIndicator; - - $scope.setupDateSliderForIndicator(); - $scope.setupDatePickerForIndicator(); - - if(!kommonitorDataExchangeService.selectedSpatialUnit || !kommonitorDataExchangeService.selectedIndicator.applicableSpatialUnits.some(o => o.spatialUnitName === kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel)){ - kommonitorDataExchangeService.selectedSpatialUnit = $scope.getFirstSpatialUnitForSelectedIndicator(); - } - - try{ - var selectedIndicator = await $scope.tryUpdateMeasureOfValueBarForIndicator(); - } - catch(error){ - console.error(error); - $scope.loadingData = false; - $rootScope.$broadcast("hideLoadingIconOnMap"); - kommonitorDataExchangeService.displayMapApplicationError(error); - return; - } - - $rootScope.$broadcast("DisableBalance"); - $scope.modifyExports(true); - - if(document.getElementById('controlNoDataDisplay').checked) - $rootScope.$broadcast('applyNoDataDisplay'); - - $scope.loadingData = false; - - if(recenterMap){ - $rootScope.$broadcast("recenterMapContent"); - } - - $rootScope.$broadcast("hideLoadingIconOnMap"); - $scope.changeIndicatorWasClicked = false; - - // $rootScope.$broadcast("updateDiagrams", kommonitorDataExchangeService.selectedIndicator, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, $scope.selectedDate); - - $rootScope.$apply(); - - - } - else{ - if (kommonitorDataExchangeService.selectedIndicatorBackup){ - kommonitorDataExchangeService.selectedIndicator = kommonitorDataExchangeService.selectedIndicatorBackup; - } - } - - $rootScope.$broadcast("selectedIndicatorDateHasChanged"); - } - - - - $scope.modifyExports = function(changeIndicator){ - kommonitorDataExchangeService.wmsUrlForSelectedIndicator = undefined; - kommonitorDataExchangeService.wmsUrlForSelectedIndicator = undefined; - - var selectedSpatialUnitName = kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel; - - for(const ogcServiceEntry of kommonitorDataExchangeService.selectedIndicator.ogcServices){ - if (ogcServiceEntry.spatialUnit === selectedSpatialUnitName){ - kommonitorDataExchangeService.wmsUrlForSelectedIndicator = ogcServiceEntry.wmsUrl; - kommonitorDataExchangeService.wfsUrlForSelectedIndicator = ogcServiceEntry.wfsUrl; - break; - } - }; - - $rootScope.$broadcast("updateBalanceSlider", kommonitorDataExchangeService.selectedDate); - $rootScope.$broadcast("updateIndicatorValueRangeFilter", kommonitorDataExchangeService.selectedDate, kommonitorDataExchangeService.selectedIndicator); - $scope.addSelectedIndicatorToMap(changeIndicator); - - } - - $scope.$on("updateIndicatorOgcServices", function (event, indicatorWmsUrl, indicatorWfsUrl) { - - console.log('updateIndicatorOgcServices was called'); - - kommonitorDataExchangeService.wmsUrlForSelectedIndicator = indicatorWmsUrl; - kommonitorDataExchangeService.wfsUrlForSelectedIndicator = indicatorWfsUrl; - $scope.$digest(); - - }); - - - } ] - }); + .module('kommonitorDataSetup') + .component('kommonitorDataSetup', { + templateUrl: "components/kommonitorUserInterface/kommonitorControls/kommonitorDataSetup/kommonitor-data-setup.template.html", + /* + * injected with a modules service method that manages + * enabled tabs + */ + controller: [ + 'kommonitorDataExchangeService', '$scope', 'kommonitorMapService', '$http', '$rootScope', '__env', + '$timeout', + function kommonitorDataSetupController(kommonitorDataExchangeService, $scope, kommonitorMapService, $http, $rootScope, __env, $timeout) { + const INDICATOR_DATE_PREFIX = __env.indicatorDatePrefix; + $scope.indicatorNameFilter = undefined; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + var addClickListenerToEachCollapseTrigger = function () { + setTimeout(function () { + $('.list-group-item > .collapseTrigger').on('click', function () { + $('.glyphicon', this) + .toggleClass('glyphicon-chevron-right') + .toggleClass('glyphicon-chevron-down'); + // manage uncollapsed entries + // var clickedTopicId = $(this).attr('id'); + // if ($scope.unCollapsedTopicIds.includes(clickedTopicId)){ + // var index = $scope.unCollapsedTopicIds.indexOf(clickedTopicId); + // $scope.unCollapsedTopicIds.splice(index, 1); + // } + // else{ + // $scope.unCollapsedTopicIds.push(clickedTopicId); + // } + }); + }, 500); + }; + $(document).ready(function () { + addClickListenerToEachCollapseTrigger(); + }); + // var rangeslide = require("rangeslide"); + /* + * references to kommonitorDataExchangeService and wpsFormControl instances + */ + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorDataExchangeServiceInstance.selectedServiceUrl = ''; + this.kommonitorMapServiceInstance = kommonitorMapService; + $scope.loadingData = true; + $scope.changeIndicatorWasClicked = false; + $scope.dateSlider; + $scope.datePicker; + $scope.datesAsMs; + $scope.selectedDate; + this.addGeopackage = function () { + this.kommonitorMapServiceInstance.addSpatialUnitGeopackage(); + }; + this.addGeoJSON = function () { + this.kommonitorMapServiceInstance.addSpatialUnitGeoJSON(); + }; + $scope.onClickHierarchyIndicator = function (indicatorMetadata) { + kommonitorDataExchangeService.selectedIndicator = indicatorMetadata; + $scope.onChangeSelectedIndicator(false); + }; + // $scope.$watch('filteredSpatialUnits', function(value){ + // if ($scope.filteredSpatialUnits) { + // kommonitorDataExchangeService.selectedSpatialUnit = $scope.filteredSpatialUnits[0]; + // } + // }, true); + this.onClickTheme = function (topicName) { + for (const topic of this.kommonitorDataExchangeServiceInstance.availableTopics) { + if (topic.topicName === topicName) { + document.getElementById(topicName).setAttribute("class", "active"); + this.kommonitorDataExchangeServiceInstance.selectedTopic = topic; + } + else { + if (document.getElementById(topic.topicName)) { + document.getElementById(topic.topicName).setAttribute("class", ""); + } + } + } + ; + if (kommonitorDataExchangeService.selectedIndicator) { + kommonitorDataExchangeService.selectedIndicatorBackup = kommonitorDataExchangeService.selectedIndicator; + } + // $scope.$digest(); + }; + this.unsetTopic = function () { + this.kommonitorDataExchangeServiceInstance.selectedTopic = null; + for (const topic of this.kommonitorDataExchangeServiceInstance.availableTopics) { + if (document.getElementById(topic.topicName)) { + document.getElementById(topic.topicName).setAttribute("class", ""); + } + } + ; + if (!kommonitorDataExchangeService.selectedIndicator) { + kommonitorDataExchangeService.selectedIndicator = kommonitorDataExchangeService.selectedIndicatorBackup; + } + // $scope.$digest(); + }; + $scope.filterGeoresourcesByIndicator = function () { + return function (item) { + try { + var referencedGeoresources = kommonitorDataExchangeService.selectedIndicator.referencedGeoresources; + var georesourceId = item.georesourceId; + for (const refGeoresource of referencedGeoresources) { + if (refGeoresource.referencedGeoresourceId === georesourceId) + return true; + } + ; + // return referencedGeoresources.includes(georesourceId); + } + catch (error) { + return false; + } + }; + }; + $scope.filterReferencedIndicatorsByIndicator = function () { + return function (item) { + try { + var referencedIndicators = kommonitorDataExchangeService.selectedIndicator.referencedIndicators; + var indicatorId = item.indicatorId; + for (const refIndicator of referencedIndicators) { + if (refIndicator.referencedIndicatorId === indicatorId) + return true; + } + ; + } + catch (error) { + return false; + } + }; + }; + $scope.filterGeoresourcesByTopic = function () { + return function (item) { + if (kommonitorDataExchangeService.selectedTopic) + return item.applicableTopics.includes(kommonitorDataExchangeService.selectedTopic.topicName); + return true; + }; + }; + $scope.filterSpatialUnitsByIndicator = function () { + return function (item) { + try { + var applicableSpatialUnits = kommonitorDataExchangeService.selectedIndicator.applicableSpatialUnits; + return applicableSpatialUnits.some(o => o.spatialUnitName === item.spatialUnitLevel); + } + catch (error) { + return false; + } + }; + }; + $scope.getFirstSpatialUnitForSelectedIndicator = function () { + var result = undefined; + var applicableSpatialUnits = kommonitorDataExchangeService.selectedIndicator.applicableSpatialUnits; + for (const spatialUnitEntry of kommonitorDataExchangeService.availableSpatialUnits) { + if (applicableSpatialUnits.some(o => o.spatialUnitName === spatialUnitEntry.spatialUnitLevel)) { + result = spatialUnitEntry; + break; + } + } + return result; + }; + this.onDateChange = function () { + var date = new Date($scope.selectedDate); + var month = date.getMonth() + 1; + var day = date.getDate(); + if (month < 10) + month = "0" + month; + if (day < 10) + day = "0" + day; + $scope.selectedDate = date.getFullYear() + "-" + month + "-" + day; + kommonitorDataExchangeService.selectedDate = $scope.selectedDate; + $scope.$digest(); + }; + $scope.$on("initialMetadataLoadingFailed", function (event, errorArray) { + $scope.loadingData = false; + $scope.$broadcast("hideLoadingIconOnMap"); + }); + // load exemplar indicator + $scope.$on("initialMetadataLoadingCompleted", function (event) { + console.log("Load an initial example indicator"); + if (kommonitorDataExchangeService.displayableIndicators == null || kommonitorDataExchangeService.displayableIndicators == undefined || kommonitorDataExchangeService.displayableIndicators.length === 0) { + console.error("Kein darstellbarer Indikator konnte gefunden werden."); + kommonitorDataExchangeService.displayMapApplicationError("Kein darstellbarer Indikator konnte gefunden werden."); + $scope.loadingData = false; + $scope.$broadcast("hideLoadingIconOnMap"); + return; + } + try { + var indicatorIndex = undefined; + for (var index = 0; index < kommonitorDataExchangeService.displayableIndicators.length; index++) { + if (kommonitorDataExchangeService.displayableIndicators[index].indicatorId === __env.initialIndicatorId) { + if (kommonitorDataExchangeService.displayableIndicators[index].applicableDates.length > 0) { + indicatorIndex = index; + break; + } + } + } + if (indicatorIndex === undefined) { + for (var t = 0; t < 75; t++) { + var randIndex = getRandomInt(0, kommonitorDataExchangeService.displayableIndicators.length - 1); + if (kommonitorDataExchangeService.displayableIndicators[randIndex].applicableDates.length > 0) { + indicatorIndex = randIndex; + break; + } + } + } + if (indicatorIndex === undefined) { + throw Error(); + } + kommonitorDataExchangeService.selectedIndicator = kommonitorDataExchangeService.displayableIndicators[indicatorIndex]; + // create Backup which is used when currently selected indicator is filtered out in select + kommonitorDataExchangeService.selectedIndicatorBackup = kommonitorDataExchangeService.selectedIndicator; + // set spatialUnit + for (var spatialUnitEntry of kommonitorDataExchangeService.availableSpatialUnits) { + if (spatialUnitEntry.spatialUnitLevel === __env.initialSpatialUnitName) { + kommonitorDataExchangeService.selectedSpatialUnit = spatialUnitEntry; + break; + } + } + if (!kommonitorDataExchangeService.selectedSpatialUnit) { + kommonitorDataExchangeService.selectedSpatialUnit = $scope.getFirstSpatialUnitForSelectedIndicator(); + } + if (!__env.centerMapInitially) { + $scope.onChangeSelectedIndicator(false); + } + else { + $scope.onChangeSelectedIndicator(true); + } + } + catch (error) { + console.error("Initiales Darstellen eines Indikators ist gescheitert."); + kommonitorDataExchangeService.displayMapApplicationError("Initiales Darstellen eines Indikators ist gescheitert."); + $scope.loadingData = false; + $scope.$broadcast("hideLoadingIconOnMap"); + return; + } + }); + /** + * Returns a random integer between min (inclusive) and max (inclusive). + * The value is no lower than min (or the next integer greater than min + * if min isn't an integer) and no greater than max (or the next integer + * lower than max if max isn't an integer). + * Using Math.round() will give you a non-uniform distribution! + */ + function getRandomInt(min, max) { + min = Math.ceil(min); + max = Math.floor(max); + return Math.floor(Math.random() * (max - min + 1)) + min; + } + this.addSelectedSpatialUnitToMap = function () { + $scope.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + var metadata = kommonitorDataExchangeService.selectedSpatialUnit; + var id = metadata.spatialUnitId; + $scope.date = $scope.selectedDate; + var dateComps = $scope.selectedDate.split("-"); + var year = dateComps[0]; + var month = dateComps[1]; + var day = dateComps[2]; + $http({ + url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/spatial-units/" + id + "/" + year + "/" + month + "/" + day + "?" + kommonitorDataExchangeService.simplifyGeometriesParameterName + "=" + kommonitorDataExchangeService.simplifyGeometries, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + var geoJSON = response.data; + kommonitorDataExchangeService.selectedSpatialUnit.geoJSON = geoJSON; + kommonitorMapService.addSpatialUnitGeoJSON(kommonitorDataExchangeService.selectedSpatialUnit, $scope.date); + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + $rootScope.$broadcast("hideLoadingIconOnMap"); + }); + }; + this.addSelectedSpatialUnitToMapAsWFS = function () { + $scope.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + var metadata = kommonitorDataExchangeService.selectedSpatialUnit; + var name = metadata.spatialUnitLevel; + var wfsUrl = metadata.wfsUrl; + kommonitorMapService.addSpatialUnitWFS(name, wfsUrl); + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + }; + this.addSelectedGeoresourceToMap = function () { + $scope.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + var metadata = kommonitorDataExchangeService.selectedGeoresource; + var id = metadata.georesourceId; + $scope.date = $scope.selectedDate; + var dateComps = $scope.selectedDate.split("-"); + var year = dateComps[0]; + var month = dateComps[1]; + var day = dateComps[2]; + $http({ + url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + id + "/" + year + "/" + month + "/" + day + "?" + kommonitorDataExchangeService.simplifyGeometriesParameterName + "=" + kommonitorDataExchangeService.simplifyGeometries, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + var geoJSON = response.data; + kommonitorDataExchangeService.selectedGeoresource.geoJSON = geoJSON; + kommonitorMapService.addGeoresourceGeoJSON(kommonitorDataExchangeService.selectedGeoresource, $scope.date); + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + $rootScope.$broadcast("hideLoadingIconOnMap"); + }); + }; + $scope.addSelectedIndicatorToMap = function (changeIndicator) { + if (changeIndicator) { + $rootScope.$broadcast("DisableBalance"); + kommonitorMapService.replaceIndicatorGeoJSON(kommonitorDataExchangeService.selectedIndicator, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, $scope.selectedDate, false); + } + else { + // check if balance mode is active + if (kommonitorDataExchangeService.isBalanceChecked) { + $rootScope.$broadcast("replaceBalancedIndicator"); + } + else { + kommonitorMapService.replaceIndicatorGeoJSON(kommonitorDataExchangeService.selectedIndicator, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, $scope.selectedDate, false); + } + } + }; + function prettifyDateSliderLabels(dateAsMs) { + return kommonitorDataExchangeService.tsToDate_withOptionalUpdateInterval(dateAsMs, kommonitorDataExchangeService.selectedIndicator.metadata.updateInterval); + } + function createDatesFromIndicatorDates(indicatorDates) { + $scope.datesAsMs = []; + for (var index = 0; index < indicatorDates.length; index++) { + // year-month-day + var dateComponents = indicatorDates[index].split("-"); + $scope.datesAsMs.push(kommonitorDataExchangeService.dateToTS(new Date(Number(dateComponents[0]), Number(dateComponents[1]) - 1, Number(dateComponents[2])))); + } + return $scope.datesAsMs; + } + $scope.setupDateSliderForIndicator = function () { + if ($scope.dateSlider) { + $scope.dateSlider.destroy(); + } + var domNode = document.getElementById("dateSlider"); + while (domNode.hasChildNodes()) { + domNode.removeChild(domNode.lastChild); + } + var availableDates = kommonitorDataExchangeService.selectedIndicator.applicableDates; + $scope.date = availableDates[availableDates.length - 1]; + $scope.selectedDate = availableDates[availableDates.length - 1]; + kommonitorDataExchangeService.selectedDate = availableDates[availableDates.length - 1]; + $scope.datesAsMs = createDatesFromIndicatorDates(kommonitorDataExchangeService.selectedIndicator.applicableDates); + // new Date() uses month between 0-11! + $("#dateSlider").ionRangeSlider({ + skin: "big", + type: "single", + grid: true, + values: $scope.datesAsMs, + from: $scope.datesAsMs.length - 1, + force_edges: true, + prettify: prettifyDateSliderLabels, + onChange: $scope.onChangeDateSliderItem + }); + $scope.dateSlider = $("#dateSlider").data("ionRangeSlider"); + // make sure that the handle is properly set to max value + $scope.dateSlider.update({ + from: $scope.datesAsMs.length - 1 // index, not the date + }); + }; + $scope.setupDatePickerForIndicator = function () { + if ($scope.datePicker) { + $('#indicatorDatePicker').datepicker('destroy'); + $scope.datePicker = undefined; + } + var domNode = document.getElementById("indicatorDatePicker"); + while (domNode.hasChildNodes()) { + domNode.removeChild(domNode.lastChild); + } + var availableDates = kommonitorDataExchangeService.selectedIndicator.applicableDates; + $scope.date = availableDates[availableDates.length - 1]; + $scope.selectedDate = availableDates[availableDates.length - 1]; + kommonitorDataExchangeService.selectedDate = availableDates[availableDates.length - 1]; + $scope.datePicker = $('#indicatorDatePicker').datepicker(kommonitorDataExchangeService.getLimitedDatePickerOptions(availableDates)); + }; + $scope.onChangeDateSliderItem = async function (data) { + if (!$scope.changeIndicatorWasClicked && kommonitorDataExchangeService.selectedIndicator) { + $scope.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + console.log("Change selected date"); + //data.from is index of date! + $scope.selectedDate = kommonitorDataExchangeService.selectedIndicator.applicableDates[data.from]; + $scope.date = $scope.selectedDate; + kommonitorDataExchangeService.selectedDate = $scope.selectedDate; + $('#indicatorDatePicker').datepicker('update', new Date(kommonitorDataExchangeService.selectedDate)); + try { + var selectedIndicator = await $scope.tryUpdateMeasureOfValueBarForIndicator(); + } + catch (error) { + console.error(error); + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + kommonitorDataExchangeService.displayMapApplicationError(error); + return; + } + $scope.modifyExports(false); + if (document.getElementById('controlNoDataDisplay').checked) + $rootScope.$broadcast('applyNoDataDisplay'); + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + $rootScope.$broadcast("selectedIndicatorDateHasChanged"); + $rootScope.$apply(); + } + }; + $scope.$on("DisableDateSlider", function (event) { + if ($scope.dateSlider) { + $scope.dateSlider.update({ + block: true + }); + } + kommonitorDataExchangeService.disableIndicatorDatePicker = true; + }); + $scope.$on("EnableDateSlider", function (event) { + if ($scope.dateSlider) { + $scope.dateSlider.update({ + block: false + }); + } + kommonitorDataExchangeService.disableIndicatorDatePicker = false; + }); + var wait = ms => new Promise((r, j) => setTimeout(r, ms)); + $scope.tryUpdateMeasureOfValueBarForIndicator = async function () { + var indicatorId = kommonitorDataExchangeService.selectedIndicator.indicatorId; + if (!($scope.date && kommonitorDataExchangeService.selectedSpatialUnit && indicatorId)) { + kommonitorDataExchangeService.displayMapApplicationError("Beim Versuch, einen Beispielindikator zu laden, ist ein Fehler aufgetreten. Der Datenbankeintrag scheint eine fehlerhafte Kombination aus Raumeinheit und Zeitschnitt zu enthalten."); + throw Error("Not all parameters have been set up yet."); + } + // + // $scope.selectedDate = $scope.selectedDate; + $scope.spatialUnitName = kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel; + var dateComps = $scope.date.split("-"); + var year = dateComps[0]; + var month = dateComps[1]; + var day = dateComps[2]; + return await $http({ + url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/indicators/" + indicatorId + "/" + kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitId + "/" + year + "/" + month + "/" + day + "?" + kommonitorDataExchangeService.simplifyGeometriesParameterName + "=" + kommonitorDataExchangeService.simplifyGeometries, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + var geoJSON = response.data; + kommonitorDataExchangeService.selectedIndicator.geoJSON = geoJSON; + $rootScope.$broadcast("updateMeasureOfValueBar", $scope.date, kommonitorDataExchangeService.selectedIndicator); + // $scope.updateMeasureOfValueBar($scope.date); + return kommonitorDataExchangeService.selectedIndicator; + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + $rootScope.$broadcast("hideLoadingIconOnMap"); + return kommonitorDataExchangeService.selectedIndicator; + }); + }; + $scope.$on("changeSpatialUnit", function (event) { + $scope.onChangeSelectedSpatialUnit(); + }); + $scope.$on("changeIndicatorDate", async function (event) { + if (kommonitorDataExchangeService.selectedIndicator && kommonitorDataExchangeService.selectedDate) { + $scope.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + console.log("Change selected date"); + //data.from is index of date! + var index = kommonitorDataExchangeService.selectedIndicator.applicableDates.indexOf(kommonitorDataExchangeService.selectedDate); + ; + $scope.dateSlider.update({ + from: index // index, not the date + }); + $scope.date = kommonitorDataExchangeService.selectedDate; + $scope.selectedDate = kommonitorDataExchangeService.selectedDate; + try { + var selectedIndicator = await $scope.tryUpdateMeasureOfValueBarForIndicator(); + } + catch (error) { + console.error(error); + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + kommonitorDataExchangeService.displayMapApplicationError(error); + return; + } + $scope.modifyExports(false); + if (document.getElementById('controlNoDataDisplay').checked) + $rootScope.$broadcast('applyNoDataDisplay'); + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + $rootScope.$broadcast("selectedIndicatorDateHasChanged"); + $rootScope.$apply(); + } + }); + $scope.onChangeSelectedSpatialUnit = async function () { + if (!$scope.changeIndicatorWasClicked && kommonitorDataExchangeService.selectedIndicator) { + $scope.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + console.log("Change spatial unit"); + try { + var selectedIndicator = await $scope.tryUpdateMeasureOfValueBarForIndicator(); + } + catch (error) { + console.error(error); + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + kommonitorDataExchangeService.displayMapApplicationError(error); + return; + } + $scope.modifyExports(false); + if (document.getElementById('controlNoDataDisplay').checked) + $rootScope.$broadcast('applyNoDataDisplay'); + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + $scope.$digest(); + } + }; + $scope.markAssociatedHierarchyElement = function (selectedIndicatorMetadata) { + var selectedIndicatorId = selectedIndicatorMetadata.indicatorId; + for (var indicator of kommonitorDataExchangeService.displayableIndicators) { + $("#indicatorHierarchyElement-" + indicator.indicatorId).removeClass('active'); + } + $("#indicatorHierarchyElement-" + selectedIndicatorId).addClass('active'); + }; + $scope.onChangeSelectedIndicator_fromAlphabeticalList = function (indicatorMetadata) { + kommonitorDataExchangeService.selectedIndicator = indicatorMetadata; + $scope.onChangeSelectedIndicator(false); + }; + $scope.onChangeSelectedIndicator = async function (recenterMap) { + $rootScope.$broadcast("onChangeSelectedIndicator"); + if (kommonitorDataExchangeService.selectedIndicator) { + $scope.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + $scope.changeIndicatorWasClicked = true; + $scope.markAssociatedHierarchyElement(kommonitorDataExchangeService.selectedIndicator); + kommonitorDataExchangeService.selectedIndicatorBackup = kommonitorDataExchangeService.selectedIndicator; + $scope.setupDateSliderForIndicator(); + $scope.setupDatePickerForIndicator(); + if (!kommonitorDataExchangeService.selectedSpatialUnit || !kommonitorDataExchangeService.selectedIndicator.applicableSpatialUnits.some(o => o.spatialUnitName === kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel)) { + kommonitorDataExchangeService.selectedSpatialUnit = $scope.getFirstSpatialUnitForSelectedIndicator(); + } + try { + var selectedIndicator = await $scope.tryUpdateMeasureOfValueBarForIndicator(); + } + catch (error) { + console.error(error); + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + kommonitorDataExchangeService.displayMapApplicationError(error); + return; + } + $rootScope.$broadcast("DisableBalance"); + $scope.modifyExports(true); + if (document.getElementById('controlNoDataDisplay').checked) + $rootScope.$broadcast('applyNoDataDisplay'); + $scope.loadingData = false; + if (recenterMap) { + $rootScope.$broadcast("recenterMapContent"); + } + $rootScope.$broadcast("hideLoadingIconOnMap"); + $scope.changeIndicatorWasClicked = false; + // $rootScope.$broadcast("updateDiagrams", kommonitorDataExchangeService.selectedIndicator, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, $scope.selectedDate); + $rootScope.$apply(); + } + else { + if (kommonitorDataExchangeService.selectedIndicatorBackup) { + kommonitorDataExchangeService.selectedIndicator = kommonitorDataExchangeService.selectedIndicatorBackup; + } + } + $rootScope.$broadcast("selectedIndicatorDateHasChanged"); + }; + $scope.modifyExports = function (changeIndicator) { + kommonitorDataExchangeService.wmsUrlForSelectedIndicator = undefined; + kommonitorDataExchangeService.wmsUrlForSelectedIndicator = undefined; + var selectedSpatialUnitName = kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel; + for (const ogcServiceEntry of kommonitorDataExchangeService.selectedIndicator.ogcServices) { + if (ogcServiceEntry.spatialUnit === selectedSpatialUnitName) { + kommonitorDataExchangeService.wmsUrlForSelectedIndicator = ogcServiceEntry.wmsUrl; + kommonitorDataExchangeService.wfsUrlForSelectedIndicator = ogcServiceEntry.wfsUrl; + break; + } + } + ; + $rootScope.$broadcast("updateBalanceSlider", kommonitorDataExchangeService.selectedDate); + $rootScope.$broadcast("updateIndicatorValueRangeFilter", kommonitorDataExchangeService.selectedDate, kommonitorDataExchangeService.selectedIndicator); + $scope.addSelectedIndicatorToMap(changeIndicator); + }; + $scope.$on("updateIndicatorOgcServices", function (event, indicatorWmsUrl, indicatorWfsUrl) { + console.log('updateIndicatorOgcServices was called'); + kommonitorDataExchangeService.wmsUrlForSelectedIndicator = indicatorWmsUrl; + kommonitorDataExchangeService.wfsUrlForSelectedIndicator = indicatorWfsUrl; + $scope.$digest(); + }); + } + ] +}); +//# sourceMappingURL=kommonitor-data-setup.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataSetup/kommonitor-data-setup.component.js.map b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataSetup/kommonitor-data-setup.component.js.map new file mode 100644 index 000000000..ebe8c7e5f --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataSetup/kommonitor-data-setup.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-data-setup.component.js","sourceRoot":"","sources":["kommonitor-data-setup.component.ts"],"names":[],"mappings":";AAAA,OAAO;KACJ,MAAM,CAAC,qBAAqB,CAAC;KAC7B,SAAS,CACR,qBAAqB,EACrB;IACC,WAAW,EAAG,+GAA+G;IAC7H;;;OAGG;IACH,UAAU,EAAG;QACX,+BAA+B,EAAE,QAAQ,EAAE,sBAAsB,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO;QACjG,UAAU;QACV,SAAS,6BAA6B,CAAC,6BAA6B,EAAE,MAAM,EAAE,oBAAoB,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAC3H,QAAQ;YAER,MAAM,qBAAqB,GAAG,KAAK,CAAC,mBAAmB,CAAC;YAExD,MAAM,CAAC,mBAAmB,GAAG,SAAS,CAAC;YAEvC,sCAAsC;YACtC,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,CAAC;YAEtB,IAAI,qC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C9C,6BAA6B,CAAC,0BAA0B,GAAG,SAAS,CAAC;gBACrE,6BAA6B,CAAC,0BAA0B,GAAG,SAAS,CAAC;gBAErE,IAAI,uBAAuB,GAAG,6BAA6B,CAAC,mBAAmB,CAAC,gBAAgB,CAAC;gBAEjG,KAAI,MAAM,eAAe,IAAI,6BAA6B,CAAC,iBAAiB,CAAC,WAAW,EAAC;oBACxF,IAAI,eAAe,CAAC,WAAW,KAAK,uBAAuB,EAAC;wBAC3D,6BAA6B,CAAC,0BAA0B,GAAG,eAAe,CAAC,MAAM,CAAC;wBAClF,6BAA6B,CAAC,0BAA0B,GAAG,eAAe,CAAC,MAAM,CAAC;wBAClF,MAAM;qBACN;iBACD;gBAAA,CAAC;gBAEF,UAAU,CAAC,UAAU,CAAC,qBAAqB,EAAE,6BAA6B,CAAC,YAAY,CAAC,CAAC;gBACzF,UAAU,CAAC,UAAU,CAAC,iCAAiC,EAAE,6BAA6B,CAAC,YAAY,EAAE,6BAA6B,CAAC,iBAAiB,CAAC,CAAC;gBACtJ,MAAM,CAAC,yBAAyB,CAAC,eAAe,CAAC,CAAC;YAEnD,CAAC,CAAA;YAED,MAAM,CAAC,GAAG,CAAC,4BAA4B,EAAE,UAAU,KAAK,EAAE,eAAe,EAAE,eAAe;gBAEnF,OAAO,CAAC,GAAG,CAAC,uCAAuC,CAAC,CAAC;gBAErD,6BAA6B,CAAC,0BAA0B,GAAG,eAAe,CAAC;gBAC3E,6BAA6B,CAAC,0BAA0B,GAAG,eAAe,CAAC;gBAC3E,MAAM,CAAC,OAAO,EAAE,CAAC;YAExB,CAAC,CAAC,CAAC;QAGJ,CAAC;KAAE;CACL,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataSetup/kommonitor-data-setup.component.ts b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataSetup/kommonitor-data-setup.component.ts new file mode 100644 index 000000000..a468a3590 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataSetup/kommonitor-data-setup.component.ts @@ -0,0 +1,796 @@ +angular + .module('kommonitorDataSetup') + .component( + 'kommonitorDataSetup', + { + templateUrl : "components/kommonitorUserInterface/kommonitorControls/kommonitorDataSetup/kommonitor-data-setup.template.html", + /* + * injected with a modules service method that manages + * enabled tabs + */ + controller : [ + 'kommonitorDataExchangeService', '$scope', 'kommonitorMapService', '$http', '$rootScope', '__env', + '$timeout', + function kommonitorDataSetupController(kommonitorDataExchangeService, $scope, kommonitorMapService, $http, $rootScope, __env, + $timeout) { + + const INDICATOR_DATE_PREFIX = __env.indicatorDatePrefix; + + $scope.indicatorNameFilter = undefined; + + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + var addClickListenerToEachCollapseTrigger = function(){ + setTimeout(function(){ + $('.list-group-item > .collapseTrigger').on('click', function() { + $('.glyphicon', this) + .toggleClass('glyphicon-chevron-right') + .toggleClass('glyphicon-chevron-down'); + + // manage uncollapsed entries + // var clickedTopicId = $(this).attr('id'); + // if ($scope.unCollapsedTopicIds.includes(clickedTopicId)){ + // var index = $scope.unCollapsedTopicIds.indexOf(clickedTopicId); + // $scope.unCollapsedTopicIds.splice(index, 1); + // } + // else{ + // $scope.unCollapsedTopicIds.push(clickedTopicId); + // } + }); + }, 500); + }; + + $(document).ready(function() { + + addClickListenerToEachCollapseTrigger(); + }); + + // var rangeslide = require("rangeslide"); + /* + * references to kommonitorDataExchangeService and wpsFormControl instances + */ + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorDataExchangeServiceInstance.selectedServiceUrl = ''; + this.kommonitorMapServiceInstance = kommonitorMapService; + + $scope.loadingData = true; + $scope.changeIndicatorWasClicked = false; + + $scope.dateSlider; + $scope.datePicker; + $scope.datesAsMs; + + $scope.selectedDate; + + this.addGeopackage = function(){ + this.kommonitorMapServiceInstance.addSpatialUnitGeopackage(); + } + this.addGeoJSON = function(){ + this.kommonitorMapServiceInstance.addSpatialUnitGeoJSON(); + } + + $scope.onClickHierarchyIndicator = function(indicatorMetadata){ + kommonitorDataExchangeService.selectedIndicator = indicatorMetadata; + $scope.onChangeSelectedIndicator(false); + }; + + // $scope.$watch('filteredSpatialUnits', function(value){ + // if ($scope.filteredSpatialUnits) { + // kommonitorDataExchangeService.selectedSpatialUnit = $scope.filteredSpatialUnits[0]; + // } + // }, true); + + this.onClickTheme = function(topicName){ + + for(const topic of this.kommonitorDataExchangeServiceInstance.availableTopics){ + if(topic.topicName === topicName){ + document.getElementById(topicName).setAttribute("class", "active"); + this.kommonitorDataExchangeServiceInstance.selectedTopic = topic; + } + else { + if(document.getElementById(topic.topicName)){ + document.getElementById(topic.topicName).setAttribute("class", ""); + } + } + }; + + if(kommonitorDataExchangeService.selectedIndicator){ + kommonitorDataExchangeService.selectedIndicatorBackup = kommonitorDataExchangeService.selectedIndicator; + } + + // $scope.$digest(); + }; + + this.unsetTopic = function(){ + this.kommonitorDataExchangeServiceInstance.selectedTopic = null; + + for(const topic of this.kommonitorDataExchangeServiceInstance.availableTopics){ + if (document.getElementById(topic.topicName)){ + document.getElementById(topic.topicName).setAttribute("class", ""); + } + }; + + if(!kommonitorDataExchangeService.selectedIndicator){ + kommonitorDataExchangeService.selectedIndicator = kommonitorDataExchangeService.selectedIndicatorBackup; + } + + // $scope.$digest(); + }; + + $scope.filterGeoresourcesByIndicator = function() { + return function( item ) { + + try{ + var referencedGeoresources = kommonitorDataExchangeService.selectedIndicator.referencedGeoresources; + var georesourceId = item.georesourceId; + + for (const refGeoresource of referencedGeoresources){ + if(refGeoresource.referencedGeoresourceId === georesourceId) + return true; + }; + + // return referencedGeoresources.includes(georesourceId); + } + catch(error){ + return false; + } + }; + }; + + $scope.filterReferencedIndicatorsByIndicator = function() { + return function( item ) { + + try{ + var referencedIndicators = kommonitorDataExchangeService.selectedIndicator.referencedIndicators; + var indicatorId = item.indicatorId; + + for (const refIndicator of referencedIndicators){ + if(refIndicator.referencedIndicatorId === indicatorId) + return true; + }; + + } + catch(error){ + return false; + } + }; + }; + + $scope.filterGeoresourcesByTopic = function() { + return function( item ) { + if (kommonitorDataExchangeService.selectedTopic) + return item.applicableTopics.includes(kommonitorDataExchangeService.selectedTopic.topicName); + + return true; + }; + }; + + $scope.filterSpatialUnitsByIndicator = function() { + return function( item ) { + + try{ + var applicableSpatialUnits = kommonitorDataExchangeService.selectedIndicator.applicableSpatialUnits; + + return applicableSpatialUnits.some(o => o.spatialUnitName === item.spatialUnitLevel); + } + catch(error){ + return false; + } + }; + }; + + $scope.getFirstSpatialUnitForSelectedIndicator = function() { + + var result = undefined; + + var applicableSpatialUnits = kommonitorDataExchangeService.selectedIndicator.applicableSpatialUnits; + + for (const spatialUnitEntry of kommonitorDataExchangeService.availableSpatialUnits){ + if(applicableSpatialUnits.some(o => o.spatialUnitName === spatialUnitEntry.spatialUnitLevel)){ + result = spatialUnitEntry; + break; + } + } + + return result; + }; + + this.onDateChange = function(){ + + var date = new Date($scope.selectedDate); + + var month = date.getMonth()+1; + var day = date.getDate(); + + if (month < 10) + month = "0" + month; + + if (day < 10) + day = "0" + day; + + $scope.selectedDate = date.getFullYear() + "-" + month + "-" + day; + kommonitorDataExchangeService.selectedDate = $scope.selectedDate; + + $scope.$digest(); + }; + + $scope.$on("initialMetadataLoadingFailed", function (event, errorArray) { + + $scope.loadingData = false; + $scope.$broadcast("hideLoadingIconOnMap"); + + }); + + // load exemplar indicator + $scope.$on("initialMetadataLoadingCompleted", function (event) { + + console.log("Load an initial example indicator"); + + if (kommonitorDataExchangeService.displayableIndicators == null || kommonitorDataExchangeService.displayableIndicators == undefined || kommonitorDataExchangeService.displayableIndicators.length === 0){ + console.error("Kein darstellbarer Indikator konnte gefunden werden."); + + kommonitorDataExchangeService.displayMapApplicationError("Kein darstellbarer Indikator konnte gefunden werden."); + $scope.loadingData = false; + $scope.$broadcast("hideLoadingIconOnMap"); + + return; + } + + try{ + var indicatorIndex = undefined; + + for (var index=0; index < kommonitorDataExchangeService.displayableIndicators.length; index++){ + if (kommonitorDataExchangeService.displayableIndicators[index].indicatorId === __env.initialIndicatorId){ + if(kommonitorDataExchangeService.displayableIndicators[index].applicableDates.length > 0){ + indicatorIndex = index; + break; + } + } + } + + if( indicatorIndex === undefined){ + for(var t=0; t < 75; t++){ + + var randIndex = getRandomInt(0, kommonitorDataExchangeService.displayableIndicators.length - 1); + if (kommonitorDataExchangeService.displayableIndicators[randIndex].applicableDates.length > 0){ + indicatorIndex = randIndex; + break; + } + } + } + + if( indicatorIndex === undefined){ + throw Error(); + } + + kommonitorDataExchangeService.selectedIndicator = kommonitorDataExchangeService.displayableIndicators[indicatorIndex]; + // create Backup which is used when currently selected indicator is filtered out in select + kommonitorDataExchangeService.selectedIndicatorBackup = kommonitorDataExchangeService.selectedIndicator; + + // set spatialUnit + for (var spatialUnitEntry of kommonitorDataExchangeService.availableSpatialUnits){ + if(spatialUnitEntry.spatialUnitLevel === __env.initialSpatialUnitName){ + kommonitorDataExchangeService.selectedSpatialUnit = spatialUnitEntry; + break; + } + } + if(!kommonitorDataExchangeService.selectedSpatialUnit){ + kommonitorDataExchangeService.selectedSpatialUnit = $scope.getFirstSpatialUnitForSelectedIndicator(); + } + + if(! __env.centerMapInitially){ + $scope.onChangeSelectedIndicator(false); + } + else{ + $scope.onChangeSelectedIndicator(true); + } + + + } + catch(error){ + console.error("Initiales Darstellen eines Indikators ist gescheitert."); + + kommonitorDataExchangeService.displayMapApplicationError("Initiales Darstellen eines Indikators ist gescheitert."); + $scope.loadingData = false; + $scope.$broadcast("hideLoadingIconOnMap"); + + return; + } + + + }); + + /** + * Returns a random integer between min (inclusive) and max (inclusive). + * The value is no lower than min (or the next integer greater than min + * if min isn't an integer) and no greater than max (or the next integer + * lower than max if max isn't an integer). + * Using Math.round() will give you a non-uniform distribution! + */ + function getRandomInt(min, max) { + min = Math.ceil(min); + max = Math.floor(max); + return Math.floor(Math.random() * (max - min + 1)) + min; + } + + this.addSelectedSpatialUnitToMap = function() { + $scope.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + + var metadata = kommonitorDataExchangeService.selectedSpatialUnit; + + var id = metadata.spatialUnitId; + + $scope.date = $scope.selectedDate; + + var dateComps = $scope.selectedDate.split("-"); + + var year = dateComps[0]; + var month = dateComps[1]; + var day = dateComps[2]; + + $http({ + url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/spatial-units/" + id + "/" + year + "/" + month + "/" + day + "?" + kommonitorDataExchangeService.simplifyGeometriesParameterName + "=" + kommonitorDataExchangeService.simplifyGeometries, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + var geoJSON = response.data; + + kommonitorDataExchangeService.selectedSpatialUnit.geoJSON = geoJSON; + + kommonitorMapService.addSpatialUnitGeoJSON(kommonitorDataExchangeService.selectedSpatialUnit, $scope.date); + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + $rootScope.$broadcast("hideLoadingIconOnMap"); + }); + }; + + this.addSelectedSpatialUnitToMapAsWFS = function() { + $scope.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + + var metadata = kommonitorDataExchangeService.selectedSpatialUnit; + + var name = metadata.spatialUnitLevel; + + var wfsUrl = metadata.wfsUrl; + + kommonitorMapService.addSpatialUnitWFS(name, wfsUrl); + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + + }; + + this.addSelectedGeoresourceToMap = function() { + $scope.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + + var metadata = kommonitorDataExchangeService.selectedGeoresource; + + var id = metadata.georesourceId; + + $scope.date = $scope.selectedDate; + + var dateComps = $scope.selectedDate.split("-"); + + var year = dateComps[0]; + var month = dateComps[1]; + var day = dateComps[2]; + + $http({ + url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + id + "/" + year + "/" + month + "/" + day + "?" + kommonitorDataExchangeService.simplifyGeometriesParameterName + "=" + kommonitorDataExchangeService.simplifyGeometries, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + var geoJSON = response.data; + + kommonitorDataExchangeService.selectedGeoresource.geoJSON = geoJSON; + + kommonitorMapService.addGeoresourceGeoJSON(kommonitorDataExchangeService.selectedGeoresource, $scope.date); + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + $rootScope.$broadcast("hideLoadingIconOnMap"); + }); + + }; + + $scope.addSelectedIndicatorToMap = function(changeIndicator) { + + if(changeIndicator){ + $rootScope.$broadcast("DisableBalance"); + kommonitorMapService.replaceIndicatorGeoJSON(kommonitorDataExchangeService.selectedIndicator, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, $scope.selectedDate, false); + } + else{ + // check if balance mode is active + if (kommonitorDataExchangeService.isBalanceChecked){ + $rootScope.$broadcast("replaceBalancedIndicator"); + } + else{ + kommonitorMapService.replaceIndicatorGeoJSON(kommonitorDataExchangeService.selectedIndicator, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, $scope.selectedDate, false); + } + } + }; + + function prettifyDateSliderLabels (dateAsMs) { + return kommonitorDataExchangeService.tsToDate_withOptionalUpdateInterval(dateAsMs, kommonitorDataExchangeService.selectedIndicator.metadata.updateInterval); + } + + function createDatesFromIndicatorDates(indicatorDates) { + + $scope.datesAsMs = []; + + for (var index=0; index < indicatorDates.length; index++){ + // year-month-day + var dateComponents = indicatorDates[index].split("-"); + $scope.datesAsMs.push(kommonitorDataExchangeService.dateToTS(new Date(Number(dateComponents[0]), Number(dateComponents[1]) - 1, Number(dateComponents[2])))); + } + return $scope.datesAsMs; + } + + $scope.setupDateSliderForIndicator = function(){ + + if($scope.dateSlider){ + $scope.dateSlider.destroy(); + } + + var domNode = document.getElementById("dateSlider"); + + while (domNode.hasChildNodes()) { + domNode.removeChild(domNode.lastChild); + } + + var availableDates = kommonitorDataExchangeService.selectedIndicator.applicableDates; + $scope.date = availableDates[availableDates.length - 1]; + $scope.selectedDate = availableDates[availableDates.length - 1]; + kommonitorDataExchangeService.selectedDate = availableDates[availableDates.length - 1]; + + $scope.datesAsMs = createDatesFromIndicatorDates(kommonitorDataExchangeService.selectedIndicator.applicableDates); + + // new Date() uses month between 0-11! + $("#dateSlider").ionRangeSlider({ + skin: "big", + type: "single", + grid: true, + values: $scope.datesAsMs, + from: $scope.datesAsMs.length -1, // index, not the date + force_edges: true, + prettify: prettifyDateSliderLabels, + onChange: $scope.onChangeDateSliderItem + }); + + $scope.dateSlider = $("#dateSlider").data("ionRangeSlider"); + // make sure that the handle is properly set to max value + $scope.dateSlider.update({ + from: $scope.datesAsMs.length -1 // index, not the date + }); + }; + + $scope.setupDatePickerForIndicator = function(){ + + if($scope.datePicker){ + $('#indicatorDatePicker').datepicker('destroy'); + $scope.datePicker = undefined; + } + + var domNode = document.getElementById("indicatorDatePicker"); + + while (domNode.hasChildNodes()) { + domNode.removeChild(domNode.lastChild); + } + + var availableDates = kommonitorDataExchangeService.selectedIndicator.applicableDates; + $scope.date = availableDates[availableDates.length - 1]; + $scope.selectedDate = availableDates[availableDates.length - 1]; + kommonitorDataExchangeService.selectedDate = availableDates[availableDates.length - 1]; + + $scope.datePicker = $('#indicatorDatePicker').datepicker(kommonitorDataExchangeService.getLimitedDatePickerOptions(availableDates)); + + }; + + + $scope.onChangeDateSliderItem = async function(data){ + + if(!$scope.changeIndicatorWasClicked && kommonitorDataExchangeService.selectedIndicator){ + $scope.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + + console.log("Change selected date"); + + //data.from is index of date! + + $scope.selectedDate = kommonitorDataExchangeService.selectedIndicator.applicableDates[data.from]; + $scope.date = $scope.selectedDate; + kommonitorDataExchangeService.selectedDate = $scope.selectedDate; + + $('#indicatorDatePicker').datepicker('update', new Date(kommonitorDataExchangeService.selectedDate)); + + try{ + var selectedIndicator = await $scope.tryUpdateMeasureOfValueBarForIndicator(); + } + catch(error){ + console.error(error); + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + kommonitorDataExchangeService.displayMapApplicationError(error); + return; + } + + $scope.modifyExports(false); + + if(document.getElementById('controlNoDataDisplay').checked) + $rootScope.$broadcast('applyNoDataDisplay') + + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + $rootScope.$broadcast("selectedIndicatorDateHasChanged"); + $rootScope.$apply(); + } + }; + + $scope.$on("DisableDateSlider", function (event) { + if($scope.dateSlider){ + $scope.dateSlider.update({ + block: true + }); + } + + kommonitorDataExchangeService.disableIndicatorDatePicker = true; + }); + + $scope.$on("EnableDateSlider", function (event) { + if($scope.dateSlider){ + $scope.dateSlider.update({ + block: false + }); + } + + kommonitorDataExchangeService.disableIndicatorDatePicker = false; + }); + + var wait = ms => new Promise((r, j)=>setTimeout(r, ms)); + + $scope.tryUpdateMeasureOfValueBarForIndicator = async function(){ + var indicatorId = kommonitorDataExchangeService.selectedIndicator.indicatorId; + + if(! ($scope.date && kommonitorDataExchangeService.selectedSpatialUnit && indicatorId)){ + kommonitorDataExchangeService.displayMapApplicationError("Beim Versuch, einen Beispielindikator zu laden, ist ein Fehler aufgetreten. Der Datenbankeintrag scheint eine fehlerhafte Kombination aus Raumeinheit und Zeitschnitt zu enthalten."); + throw Error("Not all parameters have been set up yet."); + } + // + // $scope.selectedDate = $scope.selectedDate; + $scope.spatialUnitName = kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel; + + var dateComps = $scope.date.split("-"); + var year = dateComps[0]; + var month = dateComps[1]; + var day = dateComps[2]; + + return await $http({ + url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/indicators/" + indicatorId + "/" + kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitId + "/" + year + "/" + month + "/" + day + "?" + kommonitorDataExchangeService.simplifyGeometriesParameterName + "=" + kommonitorDataExchangeService.simplifyGeometries, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + var geoJSON = response.data; + + kommonitorDataExchangeService.selectedIndicator.geoJSON = geoJSON; + + $rootScope.$broadcast("updateMeasureOfValueBar", $scope.date, kommonitorDataExchangeService.selectedIndicator); + + // $scope.updateMeasureOfValueBar($scope.date); + + return kommonitorDataExchangeService.selectedIndicator; + + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + $rootScope.$broadcast("hideLoadingIconOnMap"); + + return kommonitorDataExchangeService.selectedIndicator; + }); + }; + + $scope.$on("changeSpatialUnit", function(event){ + $scope.onChangeSelectedSpatialUnit(); + }); + + $scope.$on("changeIndicatorDate", async function(event){ + + if(kommonitorDataExchangeService.selectedIndicator && kommonitorDataExchangeService.selectedDate){ + $scope.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + + console.log("Change selected date"); + + //data.from is index of date! + var index = kommonitorDataExchangeService.selectedIndicator.applicableDates.indexOf(kommonitorDataExchangeService.selectedDate); ; + + $scope.dateSlider.update({ + from: index // index, not the date + }); + + $scope.date = kommonitorDataExchangeService.selectedDate; + $scope.selectedDate = kommonitorDataExchangeService.selectedDate; + + try{ + var selectedIndicator = await $scope.tryUpdateMeasureOfValueBarForIndicator(); + } + catch(error){ + console.error(error); + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + kommonitorDataExchangeService.displayMapApplicationError(error); + return; + } + + $scope.modifyExports(false); + + if(document.getElementById('controlNoDataDisplay').checked) + $rootScope.$broadcast('applyNoDataDisplay') + + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + $rootScope.$broadcast("selectedIndicatorDateHasChanged"); + $rootScope.$apply(); + } + + }); + + $scope.onChangeSelectedSpatialUnit = async function(){ + if(!$scope.changeIndicatorWasClicked && kommonitorDataExchangeService.selectedIndicator){ + $scope.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + + console.log("Change spatial unit"); + + try{ + var selectedIndicator = await $scope.tryUpdateMeasureOfValueBarForIndicator(); + } + catch(error){ + console.error(error); + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + kommonitorDataExchangeService.displayMapApplicationError(error); + return; + } + + $scope.modifyExports(false); + + if(document.getElementById('controlNoDataDisplay').checked) + $rootScope.$broadcast('applyNoDataDisplay'); + + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + $scope.$digest(); + } + } + + $scope.markAssociatedHierarchyElement = function(selectedIndicatorMetadata){ + var selectedIndicatorId = selectedIndicatorMetadata.indicatorId; + + for (var indicator of kommonitorDataExchangeService.displayableIndicators) { + $("#indicatorHierarchyElement-" + indicator.indicatorId).removeClass('active'); + } + + $("#indicatorHierarchyElement-" + selectedIndicatorId).addClass('active'); + }; + + $scope.onChangeSelectedIndicator_fromAlphabeticalList = function(indicatorMetadata){ + kommonitorDataExchangeService.selectedIndicator = indicatorMetadata; + $scope.onChangeSelectedIndicator(false); + }; + + $scope.onChangeSelectedIndicator = async function(recenterMap){ + + $rootScope.$broadcast("onChangeSelectedIndicator"); + + if(kommonitorDataExchangeService.selectedIndicator){ + + $scope.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + $scope.changeIndicatorWasClicked = true; + + $scope.markAssociatedHierarchyElement(kommonitorDataExchangeService.selectedIndicator); + + kommonitorDataExchangeService.selectedIndicatorBackup = kommonitorDataExchangeService.selectedIndicator; + + $scope.setupDateSliderForIndicator(); + $scope.setupDatePickerForIndicator(); + + if(!kommonitorDataExchangeService.selectedSpatialUnit || !kommonitorDataExchangeService.selectedIndicator.applicableSpatialUnits.some(o => o.spatialUnitName === kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel)){ + kommonitorDataExchangeService.selectedSpatialUnit = $scope.getFirstSpatialUnitForSelectedIndicator(); + } + + try{ + var selectedIndicator = await $scope.tryUpdateMeasureOfValueBarForIndicator(); + } + catch(error){ + console.error(error); + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + kommonitorDataExchangeService.displayMapApplicationError(error); + return; + } + + $rootScope.$broadcast("DisableBalance"); + $scope.modifyExports(true); + + if(document.getElementById('controlNoDataDisplay').checked) + $rootScope.$broadcast('applyNoDataDisplay'); + + $scope.loadingData = false; + + if(recenterMap){ + $rootScope.$broadcast("recenterMapContent"); + } + + $rootScope.$broadcast("hideLoadingIconOnMap"); + $scope.changeIndicatorWasClicked = false; + + // $rootScope.$broadcast("updateDiagrams", kommonitorDataExchangeService.selectedIndicator, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, $scope.selectedDate); + + $rootScope.$apply(); + + + } + else{ + if (kommonitorDataExchangeService.selectedIndicatorBackup){ + kommonitorDataExchangeService.selectedIndicator = kommonitorDataExchangeService.selectedIndicatorBackup; + } + } + + $rootScope.$broadcast("selectedIndicatorDateHasChanged"); + } + + + + $scope.modifyExports = function(changeIndicator){ + kommonitorDataExchangeService.wmsUrlForSelectedIndicator = undefined; + kommonitorDataExchangeService.wmsUrlForSelectedIndicator = undefined; + + var selectedSpatialUnitName = kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel; + + for(const ogcServiceEntry of kommonitorDataExchangeService.selectedIndicator.ogcServices){ + if (ogcServiceEntry.spatialUnit === selectedSpatialUnitName){ + kommonitorDataExchangeService.wmsUrlForSelectedIndicator = ogcServiceEntry.wmsUrl; + kommonitorDataExchangeService.wfsUrlForSelectedIndicator = ogcServiceEntry.wfsUrl; + break; + } + }; + + $rootScope.$broadcast("updateBalanceSlider", kommonitorDataExchangeService.selectedDate); + $rootScope.$broadcast("updateIndicatorValueRangeFilter", kommonitorDataExchangeService.selectedDate, kommonitorDataExchangeService.selectedIndicator); + $scope.addSelectedIndicatorToMap(changeIndicator); + + } + + $scope.$on("updateIndicatorOgcServices", function (event, indicatorWmsUrl, indicatorWfsUrl) { + + console.log('updateIndicatorOgcServices was called'); + + kommonitorDataExchangeService.wmsUrlForSelectedIndicator = indicatorWmsUrl; + kommonitorDataExchangeService.wfsUrlForSelectedIndicator = indicatorWfsUrl; + $scope.$digest(); + + }); + + + } ] + }); diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataSetup/kommonitor-data-setup.module.js b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataSetup/kommonitor-data-setup.module.js index cf61d4599..059de2d3b 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataSetup/kommonitor-data-setup.module.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataSetup/kommonitor-data-setup.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('kommonitorDataSetup', ['kommonitorDataExchange', 'kommonitorMap', 'kommonitorShareHelper']); +//# sourceMappingURL=kommonitor-data-setup.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataSetup/kommonitor-data-setup.module.js.map b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataSetup/kommonitor-data-setup.module.js.map new file mode 100644 index 000000000..a846bb082 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataSetup/kommonitor-data-setup.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-data-setup.module.js","sourceRoot":"","sources":["kommonitor-data-setup.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,qBAAqB,EAAE,CAAC,wBAAwB,EAAE,eAAe,EAAE,uBAAuB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataSetup/kommonitor-data-setup.module.ts b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataSetup/kommonitor-data-setup.module.ts new file mode 100644 index 000000000..cf61d4599 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDataSetup/kommonitor-data-setup.module.ts @@ -0,0 +1 @@ +angular.module('kommonitorDataSetup', ['kommonitorDataExchange', 'kommonitorMap', 'kommonitorShareHelper']); diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDiagrams/kommonitor-diagrams.component.js b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDiagrams/kommonitor-diagrams.component.js index 4c670a9a2..f35a8c56a 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDiagrams/kommonitor-diagrams.component.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDiagrams/kommonitor-diagrams.component.js @@ -1,451 +1,363 @@ +"use strict"; angular - .module('kommonitorDiagrams') - .component( - 'kommonitorDiagrams', - { - templateUrl: "components/kommonitorUserInterface/kommonitorControls/kommonitorDiagrams/kommonitor-diagrams.template.html", - /* - * injected with a modules service method that manages - * enabled tabs - */ - controller: [ - 'kommonitorDataExchangeService', 'kommonitorDiagramHelperService', 'kommonitorFilterHelperService', - '$scope', '$rootScope', '__env', - function kommonitorDiagramsController(kommonitorDataExchangeService, kommonitorDiagramHelperService, kommonitorFilterHelperService, - $scope, $rootScope, __env) { - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorDiagramHelperServiceInstance = kommonitorDiagramHelperService; - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - $(window).on('resize', function () { - if ($scope.histogramChart != null && $scope.histogramChart != undefined) { - $scope.histogramChart.resize(); - } - - if ($scope.barChart != null && $scope.barChart != undefined) { - $scope.barChart.resize(); - } - - if ($scope.lineChart != null && $scope.lineChart != undefined) { - $scope.lineChart.resize(); - } - }); - - $scope.$on("resizeDiagrams", function (event) { - - setTimeout(function () { - if ($scope.histogramChart != null && $scope.histogramChart != undefined) { - $scope.histogramChart.resize(); - } - - if ($scope.barChart != null && $scope.barChart != undefined) { - $scope.barChart.resize(); - } - - if ($scope.lineChart != null && $scope.lineChart != undefined) { - $scope.lineChart.resize(); - } - }, 350); - }); - - const INDICATOR_DATE_PREFIX = __env.indicatorDatePrefix; - const defaultColorForHoveredFeatures = __env.defaultColorForHoveredFeatures; - const defaultColorForClickedFeatures = __env.defaultColorForClickedFeatures; - - // $scope.userHoveresOverBarItem = false; - $scope.eventsRegistered = false; - $scope.isTooManyFeatures = false; - $scope.histogramCanBeDisplayed = false; - $scope.spatialUnitName; - $scope.date; - var numberOfDecimals = __env.numberOfDecimals; - var defaultColorForZeroValues = __env.defaultColorForZeroValues; - var defaultColorForNoDataValues = __env.defaultColorForNoDataValues; - var defaultColorForFilteredValues = __env.defaultColorForFilteredValues; - - const defaultColorForOutliers_high = __env.defaultColorForOutliers_high; - const defaultBorderColorForOutliers_high = __env.defaultBorderColorForOutliers_high; - const defaultFillOpacityForOutliers_high = __env.defaultFillOpacityForOutliers_high; - const defaultColorForOutliers_low = __env.defaultColorForOutliers_low; - const defaultBorderColorForOutliers_low = __env.defaultBorderColorForOutliers_low; - const defaultFillOpacityForOutliers_low = __env.defaultFillOpacityForOutliers_low; - - var compareFeaturesByIndicatorValue = function (featureA, featureB) { - if (featureA.properties[$scope.indicatorPropertyName] < featureB.properties[$scope.indicatorPropertyName]) - return -1; - if (featureA.properties[$scope.indicatorPropertyName] > featureB.properties[$scope.indicatorPropertyName]) - return 1; - return 0; - } - - var showLoadingIcons = function () { - - if ($scope.histogramChart) - $scope.histogramChart.showLoading(); - - if ($scope.barChart) - $scope.barChart.showLoading(); - - if ($scope.lineChart) - $scope.lineChart.showLoading(); - }; - - $scope.$on("updateDiagrams", function (event, indicatorMetadataAndGeoJSON, spatialUnitName, spatialUnitId, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue, justRestyling) { - - // console.log("Updating diagrams!"); - - $scope.loadingData = true; - - showLoadingIcons(); - - $scope.spatialUnitName = spatialUnitName; - $scope.date = date; - - kommonitorDiagramHelperService.prepareAllDiagramResources_forCurrentMapIndicator(indicatorMetadataAndGeoJSON, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue, false); - - // updateHistogramChart(); - - updateLineChart(); - - updateBarChart(); - $scope.loadingData = false; - }); - - //HISTOGRAM CHART FUNCTION - var updateHistogramChart = function () { - - $scope.histogramCanBeDisplayed = false; - - if (!$scope.histogramChart) - $scope.histogramChart = echarts.init(document.getElementById('histogramDiagram')); - else { - // explicitly kill and reinstantiate histogram diagram to avoid zombie states on spatial unit change - $scope.histogramChart.dispose(); - $scope.histogramChart = echarts.init(document.getElementById('histogramDiagram')); - } - - $scope.histogramOption = kommonitorDiagramHelperService.getHistogramChartOptions(); - - $scope.histogramChart.setOption($scope.histogramOption); - $scope.histogramChart.hideLoading(); - $scope.histogramCanBeDisplayed = true; - setTimeout(function () { - $scope.histogramChart.resize(); - }, 350); - }; - - // BAR CHART FUNCTION - - var updateBarChart = function (indicatorMetadataAndGeoJSON, featureNamesArray, indicatorValueBarChartArray) { - // based on prepared DOM, initialize echarts instance - $scope.eventsRegistered = false; - - if (!$scope.barChart) - $scope.barChart = echarts.init(document.getElementById('barDiagram')); - else { - // explicitly kill and reinstantiate bar diagram to avoid zombie states on spatial unit change - $scope.barChart.dispose(); - $scope.barChart = echarts.init(document.getElementById('barDiagram')); - } - - // use configuration item and data specified to show chart - $scope.barOption = kommonitorDiagramHelperService.getBarChartOptions(); - $scope.barChart.setOption($scope.barOption); - - $scope.barChart.hideLoading(); - - setTimeout(function () { - $scope.barChart.resize(); - }, 350); - - registerEventsIfNecessary(); - }; - - function registerEventsIfNecessary() { - if (!$scope.eventsRegistered) { - // when hovering over elements of the chart then highlight them in the map. - $scope.barChart.on('mouseOver', function (params) { - // $scope.userHoveresOverBarItem = true; - var seriesIndex = params.seriesIndex; - var dataIndex = params.dataIndex; - - // console.log("Series: " + seriesIndex + ", dataIndex: " + dataIndex); - // - // var barElement = $scope.barOption.series[seriesIndex].data[dataIndex]; - // - // console.log(barElement); - - var spatialFeatureName = $scope.barOption.xAxis.data[dataIndex]; - if(spatialFeatureName){ - // console.log(spatialFeatureName); - $rootScope.$broadcast("highlightFeatureOnMap", spatialFeatureName); - } - - }); - - $scope.barChart.on('mouseOut', function (params) { - // $scope.userHoveresOverBarItem = false; - var seriesIndex = params.seriesIndex; - var dataIndex = params.dataIndex; - - // console.log("Series: " + seriesIndex + ", dataIndex: " + dataIndex); - // - // var barElement = $scope.barOption.series[seriesIndex].data[dataIndex]; - // - // console.log(barElement); - - var spatialFeatureName = $scope.barOption.xAxis.data[dataIndex]; - // console.log(spatialFeatureName); - if(spatialFeatureName){ - $rootScope.$broadcast("unhighlightFeatureOnMap", spatialFeatureName); - } - - }); - - $scope.barChart.on('click', function (params) { - var seriesIndex = params.seriesIndex; - var dataIndex = params.dataIndex; - - // console.log("Series: " + seriesIndex + ", dataIndex: " + dataIndex); - // - // var barElement = $scope.barOption.series[seriesIndex].data[dataIndex]; - // - // console.log(barElement); - - var spatialFeatureName = $scope.barOption.xAxis.data[dataIndex]; - // console.log(spatialFeatureName); - if(spatialFeatureName){ - $rootScope.$broadcast("switchHighlightFeatureOnMap", spatialFeatureName); - } - - }); - - $scope.eventsRegistered = true; - } - }; - - // LINE CHART TIME SERIES FUNCTION - var updateLineChart = function (indicatorMetadataAndGeoJSON, indicatorTimeSeriesDatesArray, indicatorTimeSeriesAverageArray) { - // based on prepared DOM, initialize echarts instance - if (!$scope.lineChart) - $scope.lineChart = echarts.init(document.getElementById('lineDiagram')); - else { - // explicitly kill and reinstantiate line diagram to avoid zombie states on spatial unit change - $scope.lineChart.dispose(); - $scope.lineChart = echarts.init(document.getElementById('lineDiagram')); - } - - // use configuration item and data specified to show chart - $scope.lineOption = kommonitorDiagramHelperService.getLineChartOptions(); - $scope.lineChart.setOption($scope.lineOption); - - $scope.lineChart.hideLoading(); - setTimeout(function () { - $scope.lineChart.resize(); - }, 350); - }; - - $scope.$on("updateDiagramsForHoveredFeature", function (event, featureProperties) { - - if (!$scope.lineOption.legend.data.includes(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME])) { - appendSeriesToLineChart(featureProperties); - } - - highlightFeatureInBarChart(featureProperties); - highlightFeatureInLineChart(featureProperties); - }); - - var appendSeriesToLineChart = function (featureProperties) { - - // in case of activated balance mode, we must use the properties of kommonitorDataExchangeService.selectedIndicator, to aquire the correct time series item! - if (kommonitorDataExchangeService.isBalanceChecked) { - featureProperties = findPropertiesForTimeSeries(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); - } - - // append feature name to legend - $scope.lineOption.legend.data.push(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); - - // create feature data series - var featureSeries = {}; - featureSeries.name = featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]; - featureSeries.type = 'line'; - featureSeries.data = new Array(); - - // for each date create series data entry for feature - for (var date of $scope.lineOption.xAxis.data) { - var value; - if (kommonitorDataExchangeService.indicatorValueIsNoData(featureProperties[INDICATOR_DATE_PREFIX + date])) { - value = null; - } - else { - value = kommonitorDataExchangeService.getIndicatorValue_asNumber(featureProperties[INDICATOR_DATE_PREFIX + date]); - } - featureSeries.data.push(value); - } - - $scope.lineOption.series.push(featureSeries); - - $scope.lineChart.setOption($scope.lineOption); - setTimeout(function () { - $scope.lineChart.resize(); - }, 350); - }; - - var findPropertiesForTimeSeries = function (spatialUnitFeatureName) { - for (var feature of kommonitorDataExchangeService.selectedIndicator.geoJSON.features) { - if (feature.properties[__env.FEATURE_NAME_PROPERTY_NAME] == spatialUnitFeatureName) { - return feature.properties; - } - } - } - - var highlightFeatureInBarChart = function (featureProperties) { - // highlight the corresponding bar diagram item - // get index of bar item - - // if($scope.userHoveresOverBarItem){ - // return; - // } - - var index = -1; - for (var i = 0; i < $scope.barOption.xAxis.data.length; i++) { - if ($scope.barOption.xAxis.data[i] === featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]) { - index = i; - break; - } - } - - if (index > -1) { - $scope.barChart.dispatchAction({ - type: 'highlight', - seriesIndex: 0, - dataIndex: index - }); - // tooltip - $scope.barChart.dispatchAction({ - type: 'showTip', - seriesIndex: 0, - dataIndex: index - }); - } - }; - - var highlightFeatureInLineChart = function (featureProperties) { - // highlight the corresponding bar diagram item - // get series index of series - var seriesIndex = getSeriesIndexByFeatureName(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); - - if (seriesIndex > -1) { - $scope.lineChart.dispatchAction({ - type: 'highlight', - seriesIndex: seriesIndex - }); - } - }; - - $scope.$on("updateDiagramsForUnhoveredFeature", function (event, featureProperties) { - - if (!kommonitorFilterHelperService.featureIsCurrentlySelected(featureProperties[__env.FEATURE_ID_PROPERTY_NAME])) { - unhighlightFeatureInLineChart(featureProperties); - - removeSeriesFromLineChart(featureProperties); - - unhighlightFeatureInBarChart(featureProperties); - } - }); - - var getSeriesIndexByFeatureName = function (featureName) { - for (var index = 0; index < $scope.lineOption.series.length; index++) { - if ($scope.lineOption.series[index].name === featureName) - return index; - } - - //return -1 if none was found - return -1; - }; - - var removeSeriesFromLineChart = function (featureProperties) { - // remove feature from legend - var legendIndex = $scope.lineOption.legend.data.indexOf(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); - if (legendIndex > -1) { - $scope.lineOption.legend.data.splice(legendIndex, 1); - } - - // remove feature data series - var seriesIndex = getSeriesIndexByFeatureName(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); - if (seriesIndex > -1) { - $scope.lineOption.series.splice(seriesIndex, 1); - } - - // second parameter tells echarts to not merge options with previous data. hence really remove series from graphic - $scope.lineChart.setOption($scope.lineOption, true); - setTimeout(function () { - $scope.lineChart.resize(); - }, 350); - }; - - var unhighlightFeatureInBarChart = function (featureProperties) { - // highlight the corresponding bar diagram item - // get index of bar item - var index = -1; - for (var i = 0; i < $scope.barOption.xAxis.data.length; i++) { - if ($scope.barOption.xAxis.data[i] === featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]) { - index = i; - break; - } - } - - if (index > -1) { - $scope.barChart.dispatchAction({ - type: 'downplay', - seriesIndex: 0, - dataIndex: index - }); - // tooltip - $scope.barChart.dispatchAction({ - type: 'hideTip', - seriesIndex: 0, - dataIndex: index - }); - } - }; - - var unhighlightFeatureInLineChart = function (featureProperties) { - // highlight the corresponding bar diagram item - // get series index of series - var seriesIndex = getSeriesIndexByFeatureName(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); - - if (seriesIndex > -1) { - $scope.lineChart.dispatchAction({ - type: 'downplay', - seriesIndex: seriesIndex - }); - } - }; - - $scope.$on("AppendExportButtonsForTable", function (event, tableId, tableExportName) { - - setTimeout(function () { - - - // new TableExport(document.getElementsByTagName("table"), { - new TableExport(document.getElementById(tableId), { - headers: true, // (Boolean), display table headers (th or td elements) in the , (default: true) - footers: true, // (Boolean), display table footers (th or td elements) in the , (default: false) - formats: ['xlsx', 'csv', 'txt'], // (String[]), filetype(s) for the export, (default: ['xlsx', 'csv', 'txt']) - filename: tableExportName, // (id, String), filename for the downloaded file, (default: 'id') - bootstrap: true, // (Boolean), style buttons using bootstrap, (default: true) - exportButtons: true, // (Boolean), automatically generate the built-in export buttons for each of the specified formats (default: true) - position: 'top', // (top, bottom), position of the caption element relative to table, (default: 'bottom') - ignoreRows: null, // (Number, Number[]), row indices to exclude from the exported file(s) (default: null) - ignoreCols: null, // (Number, Number[]), column indices to exclude from the exported file(s) (default: null) - trimWhitespace: true // (Boolean), remove all leading/trailing newlines, spaces, and tabs from cell text in the exported file(s) (default: false) - }); - }, 50); - - - }); - - }] - }); + .module('kommonitorDiagrams') + .component('kommonitorDiagrams', { + templateUrl: "components/kommonitorUserInterface/kommonitorControls/kommonitorDiagrams/kommonitor-diagrams.template.html", + /* + * injected with a modules service method that manages + * enabled tabs + */ + controller: [ + 'kommonitorDataExchangeService', 'kommonitorDiagramHelperService', 'kommonitorFilterHelperService', + '$scope', '$rootScope', '__env', + function kommonitorDiagramsController(kommonitorDataExchangeService, kommonitorDiagramHelperService, kommonitorFilterHelperService, $scope, $rootScope, __env) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorDiagramHelperServiceInstance = kommonitorDiagramHelperService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + $(window).on('resize', function () { + if ($scope.histogramChart != null && $scope.histogramChart != undefined) { + $scope.histogramChart.resize(); + } + if ($scope.barChart != null && $scope.barChart != undefined) { + $scope.barChart.resize(); + } + if ($scope.lineChart != null && $scope.lineChart != undefined) { + $scope.lineChart.resize(); + } + }); + $scope.$on("resizeDiagrams", function (event) { + setTimeout(function () { + if ($scope.histogramChart != null && $scope.histogramChart != undefined) { + $scope.histogramChart.resize(); + } + if ($scope.barChart != null && $scope.barChart != undefined) { + $scope.barChart.resize(); + } + if ($scope.lineChart != null && $scope.lineChart != undefined) { + $scope.lineChart.resize(); + } + }, 350); + }); + const INDICATOR_DATE_PREFIX = __env.indicatorDatePrefix; + const defaultColorForHoveredFeatures = __env.defaultColorForHoveredFeatures; + const defaultColorForClickedFeatures = __env.defaultColorForClickedFeatures; + // $scope.userHoveresOverBarItem = false; + $scope.eventsRegistered = false; + $scope.isTooManyFeatures = false; + $scope.histogramCanBeDisplayed = false; + $scope.spatialUnitName; + $scope.date; + var numberOfDecimals = __env.numberOfDecimals; + var defaultColorForZeroValues = __env.defaultColorForZeroValues; + var defaultColorForNoDataValues = __env.defaultColorForNoDataValues; + var defaultColorForFilteredValues = __env.defaultColorForFilteredValues; + const defaultColorForOutliers_high = __env.defaultColorForOutliers_high; + const defaultBorderColorForOutliers_high = __env.defaultBorderColorForOutliers_high; + const defaultFillOpacityForOutliers_high = __env.defaultFillOpacityForOutliers_high; + const defaultColorForOutliers_low = __env.defaultColorForOutliers_low; + const defaultBorderColorForOutliers_low = __env.defaultBorderColorForOutliers_low; + const defaultFillOpacityForOutliers_low = __env.defaultFillOpacityForOutliers_low; + var compareFeaturesByIndicatorValue = function (featureA, featureB) { + if (featureA.properties[$scope.indicatorPropertyName] < featureB.properties[$scope.indicatorPropertyName]) + return -1; + if (featureA.properties[$scope.indicatorPropertyName] > featureB.properties[$scope.indicatorPropertyName]) + return 1; + return 0; + }; + var showLoadingIcons = function () { + if ($scope.histogramChart) + $scope.histogramChart.showLoading(); + if ($scope.barChart) + $scope.barChart.showLoading(); + if ($scope.lineChart) + $scope.lineChart.showLoading(); + }; + $scope.$on("updateDiagrams", function (event, indicatorMetadataAndGeoJSON, spatialUnitName, spatialUnitId, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue, justRestyling) { + // console.log("Updating diagrams!"); + $scope.loadingData = true; + showLoadingIcons(); + $scope.spatialUnitName = spatialUnitName; + $scope.date = date; + kommonitorDiagramHelperService.prepareAllDiagramResources_forCurrentMapIndicator(indicatorMetadataAndGeoJSON, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue, false); + // updateHistogramChart(); + updateLineChart(); + updateBarChart(); + $scope.loadingData = false; + }); + //HISTOGRAM CHART FUNCTION + var updateHistogramChart = function () { + $scope.histogramCanBeDisplayed = false; + if (!$scope.histogramChart) + $scope.histogramChart = echarts.init(document.getElementById('histogramDiagram')); + else { + // explicitly kill and reinstantiate histogram diagram to avoid zombie states on spatial unit change + $scope.histogramChart.dispose(); + $scope.histogramChart = echarts.init(document.getElementById('histogramDiagram')); + } + $scope.histogramOption = kommonitorDiagramHelperService.getHistogramChartOptions(); + $scope.histogramChart.setOption($scope.histogramOption); + $scope.histogramChart.hideLoading(); + $scope.histogramCanBeDisplayed = true; + setTimeout(function () { + $scope.histogramChart.resize(); + }, 350); + }; + // BAR CHART FUNCTION + var updateBarChart = function (indicatorMetadataAndGeoJSON, featureNamesArray, indicatorValueBarChartArray) { + // based on prepared DOM, initialize echarts instance + $scope.eventsRegistered = false; + if (!$scope.barChart) + $scope.barChart = echarts.init(document.getElementById('barDiagram')); + else { + // explicitly kill and reinstantiate bar diagram to avoid zombie states on spatial unit change + $scope.barChart.dispose(); + $scope.barChart = echarts.init(document.getElementById('barDiagram')); + } + // use configuration item and data specified to show chart + $scope.barOption = kommonitorDiagramHelperService.getBarChartOptions(); + $scope.barChart.setOption($scope.barOption); + $scope.barChart.hideLoading(); + setTimeout(function () { + $scope.barChart.resize(); + }, 350); + registerEventsIfNecessary(); + }; + function registerEventsIfNecessary() { + if (!$scope.eventsRegistered) { + // when hovering over elements of the chart then highlight them in the map. + $scope.barChart.on('mouseOver', function (params) { + // $scope.userHoveresOverBarItem = true; + var seriesIndex = params.seriesIndex; + var dataIndex = params.dataIndex; + // console.log("Series: " + seriesIndex + ", dataIndex: " + dataIndex); + // + // var barElement = $scope.barOption.series[seriesIndex].data[dataIndex]; + // + // console.log(barElement); + var spatialFeatureName = $scope.barOption.xAxis.data[dataIndex]; + if (spatialFeatureName) { + // console.log(spatialFeatureName); + $rootScope.$broadcast("highlightFeatureOnMap", spatialFeatureName); + } + }); + $scope.barChart.on('mouseOut', function (params) { + // $scope.userHoveresOverBarItem = false; + var seriesIndex = params.seriesIndex; + var dataIndex = params.dataIndex; + // console.log("Series: " + seriesIndex + ", dataIndex: " + dataIndex); + // + // var barElement = $scope.barOption.series[seriesIndex].data[dataIndex]; + // + // console.log(barElement); + var spatialFeatureName = $scope.barOption.xAxis.data[dataIndex]; + // console.log(spatialFeatureName); + if (spatialFeatureName) { + $rootScope.$broadcast("unhighlightFeatureOnMap", spatialFeatureName); + } + }); + $scope.barChart.on('click', function (params) { + var seriesIndex = params.seriesIndex; + var dataIndex = params.dataIndex; + // console.log("Series: " + seriesIndex + ", dataIndex: " + dataIndex); + // + // var barElement = $scope.barOption.series[seriesIndex].data[dataIndex]; + // + // console.log(barElement); + var spatialFeatureName = $scope.barOption.xAxis.data[dataIndex]; + // console.log(spatialFeatureName); + if (spatialFeatureName) { + $rootScope.$broadcast("switchHighlightFeatureOnMap", spatialFeatureName); + } + }); + $scope.eventsRegistered = true; + } + } + ; + // LINE CHART TIME SERIES FUNCTION + var updateLineChart = function (indicatorMetadataAndGeoJSON, indicatorTimeSeriesDatesArray, indicatorTimeSeriesAverageArray) { + // based on prepared DOM, initialize echarts instance + if (!$scope.lineChart) + $scope.lineChart = echarts.init(document.getElementById('lineDiagram')); + else { + // explicitly kill and reinstantiate line diagram to avoid zombie states on spatial unit change + $scope.lineChart.dispose(); + $scope.lineChart = echarts.init(document.getElementById('lineDiagram')); + } + // use configuration item and data specified to show chart + $scope.lineOption = kommonitorDiagramHelperService.getLineChartOptions(); + $scope.lineChart.setOption($scope.lineOption); + $scope.lineChart.hideLoading(); + setTimeout(function () { + $scope.lineChart.resize(); + }, 350); + }; + $scope.$on("updateDiagramsForHoveredFeature", function (event, featureProperties) { + if (!$scope.lineOption.legend.data.includes(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME])) { + appendSeriesToLineChart(featureProperties); + } + highlightFeatureInBarChart(featureProperties); + highlightFeatureInLineChart(featureProperties); + }); + var appendSeriesToLineChart = function (featureProperties) { + // in case of activated balance mode, we must use the properties of kommonitorDataExchangeService.selectedIndicator, to aquire the correct time series item! + if (kommonitorDataExchangeService.isBalanceChecked) { + featureProperties = findPropertiesForTimeSeries(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); + } + // append feature name to legend + $scope.lineOption.legend.data.push(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); + // create feature data series + var featureSeries = {}; + featureSeries.name = featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]; + featureSeries.type = 'line'; + featureSeries.data = new Array(); + // for each date create series data entry for feature + for (var date of $scope.lineOption.xAxis.data) { + var value; + if (kommonitorDataExchangeService.indicatorValueIsNoData(featureProperties[INDICATOR_DATE_PREFIX + date])) { + value = null; + } + else { + value = kommonitorDataExchangeService.getIndicatorValue_asNumber(featureProperties[INDICATOR_DATE_PREFIX + date]); + } + featureSeries.data.push(value); + } + $scope.lineOption.series.push(featureSeries); + $scope.lineChart.setOption($scope.lineOption); + setTimeout(function () { + $scope.lineChart.resize(); + }, 350); + }; + var findPropertiesForTimeSeries = function (spatialUnitFeatureName) { + for (var feature of kommonitorDataExchangeService.selectedIndicator.geoJSON.features) { + if (feature.properties[__env.FEATURE_NAME_PROPERTY_NAME] == spatialUnitFeatureName) { + return feature.properties; + } + } + }; + var highlightFeatureInBarChart = function (featureProperties) { + // highlight the corresponding bar diagram item + // get index of bar item + // if($scope.userHoveresOverBarItem){ + // return; + // } + var index = -1; + for (var i = 0; i < $scope.barOption.xAxis.data.length; i++) { + if ($scope.barOption.xAxis.data[i] === featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]) { + index = i; + break; + } + } + if (index > -1) { + $scope.barChart.dispatchAction({ + type: 'highlight', + seriesIndex: 0, + dataIndex: index + }); + // tooltip + $scope.barChart.dispatchAction({ + type: 'showTip', + seriesIndex: 0, + dataIndex: index + }); + } + }; + var highlightFeatureInLineChart = function (featureProperties) { + // highlight the corresponding bar diagram item + // get series index of series + var seriesIndex = getSeriesIndexByFeatureName(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); + if (seriesIndex > -1) { + $scope.lineChart.dispatchAction({ + type: 'highlight', + seriesIndex: seriesIndex + }); + } + }; + $scope.$on("updateDiagramsForUnhoveredFeature", function (event, featureProperties) { + if (!kommonitorFilterHelperService.featureIsCurrentlySelected(featureProperties[__env.FEATURE_ID_PROPERTY_NAME])) { + unhighlightFeatureInLineChart(featureProperties); + removeSeriesFromLineChart(featureProperties); + unhighlightFeatureInBarChart(featureProperties); + } + }); + var getSeriesIndexByFeatureName = function (featureName) { + for (var index = 0; index < $scope.lineOption.series.length; index++) { + if ($scope.lineOption.series[index].name === featureName) + return index; + } + //return -1 if none was found + return -1; + }; + var removeSeriesFromLineChart = function (featureProperties) { + // remove feature from legend + var legendIndex = $scope.lineOption.legend.data.indexOf(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); + if (legendIndex > -1) { + $scope.lineOption.legend.data.splice(legendIndex, 1); + } + // remove feature data series + var seriesIndex = getSeriesIndexByFeatureName(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); + if (seriesIndex > -1) { + $scope.lineOption.series.splice(seriesIndex, 1); + } + // second parameter tells echarts to not merge options with previous data. hence really remove series from graphic + $scope.lineChart.setOption($scope.lineOption, true); + setTimeout(function () { + $scope.lineChart.resize(); + }, 350); + }; + var unhighlightFeatureInBarChart = function (featureProperties) { + // highlight the corresponding bar diagram item + // get index of bar item + var index = -1; + for (var i = 0; i < $scope.barOption.xAxis.data.length; i++) { + if ($scope.barOption.xAxis.data[i] === featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]) { + index = i; + break; + } + } + if (index > -1) { + $scope.barChart.dispatchAction({ + type: 'downplay', + seriesIndex: 0, + dataIndex: index + }); + // tooltip + $scope.barChart.dispatchAction({ + type: 'hideTip', + seriesIndex: 0, + dataIndex: index + }); + } + }; + var unhighlightFeatureInLineChart = function (featureProperties) { + // highlight the corresponding bar diagram item + // get series index of series + var seriesIndex = getSeriesIndexByFeatureName(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); + if (seriesIndex > -1) { + $scope.lineChart.dispatchAction({ + type: 'downplay', + seriesIndex: seriesIndex + }); + } + }; + $scope.$on("AppendExportButtonsForTable", function (event, tableId, tableExportName) { + setTimeout(function () { + // new TableExport(document.getElementsByTagName("table"), { + new TableExport(document.getElementById(tableId), { + headers: true, + footers: true, + formats: ['xlsx', 'csv', 'txt'], + filename: tableExportName, + bootstrap: true, + exportButtons: true, + position: 'top', + ignoreRows: null, + ignoreCols: null, + trimWhitespace: true // (Boolean), remove all leading/trailing newlines, spaces, and tabs from cell text in the exported file(s) (default: false) + }); + }, 50); + }); + } + ] +}); +//# sourceMappingURL=kommonitor-diagrams.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDiagrams/kommonitor-diagrams.component.js.map b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDiagrams/kommonitor-diagrams.component.js.map new file mode 100644 index 000000000..d2ba2e0f5 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDiagrams/kommonitor-diagrams.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-diagrams.component.js","sourceRoot":"","sources":["kommonitor-diagrams.component.ts"],"names":[],"mappings":";AAAA,OAAO;KACL,MAAM,CAAC,oBAAoB,CAAC;KAC5B,SAAS,CACT,oBAAoB,EACpB;IACC,WAAW,EAAE,4GAA4G;IACzH;;;OAGG;IACH,UAAU,EAAE;QACX,+BAA+B,EAAE,gCAAgC,EAAE,+BAA+B;QAClG,QAAQ,EAAE,YAAY,EAAE,OAAO;QAC/B,SAAS,4BAA4B,CAAC,6BAA6B,EAAE,8BAA8B,EAAE,6BAA6B,EACjI,MAAM,EAAE,UAAU,EAAE,KAAK;YACzB,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAC3E,IAAI,CAAC,sCAAsC,GAAG,8BAA8B,CAAC;YAC7E,sCAAsC;YACtC,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,CAAC;YAEtB,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE;gBACtB,IAAI,MAAM,CAAC,cAAc,IAAI,IAAI,IAAI,MAAM,CAAC,cAAc,IAAI,SAAS,EAAE;oBACxE,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC;iBAC/B;gBAED,IAAI,MAAM,CAAC,QAAQ,IAAI,IAAI,IAAI,MAAM,CAAC,QAAQ,IAAI,SAAS,EAAE;oBAC5D,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;iBACzB;gBAED,IAAI,MAAM,CAAC,SAAS,IAAI,IAAI,IAAI,MAAM,CAAC,SAAS,IAAI,SAAS,EAAE;oBAC9D,MAAM,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A6B,GAAG,UAAU,iBAAiB;gBAC9D,+CAA+C;gBAC/C,6BAA6B;gBAC7B,IAAI,WAAW,GAAG,2BAA2B,CAAC,iBAAiB,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC,CAAC;gBAEnG,IAAI,WAAW,GAAG,CAAC,CAAC,EAAE;oBACrB,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;wBAC/B,IAAI,EAAE,UAAU;wBAChB,WAAW,EAAE,WAAW;qBACxB,CAAC,CAAC;iBACH;YACF,CAAC,CAAC;YAEF,MAAM,CAAC,GAAG,CAAC,6BAA6B,EAAE,UAAU,KAAK,EAAE,OAAO,EAAE,eAAe;gBAElF,UAAU,CAAC;oBAGV,4DAA4D;oBAC5D,IAAI,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE;wBACjD,OAAO,EAAE,IAAI;wBACb,OAAO,EAAE,IAAI;wBACb,OAAO,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC;wBAC/B,QAAQ,EAAE,eAAe;wBACzB,SAAS,EAAE,IAAI;wBACf,aAAa,EAAE,IAAI;wBACnB,QAAQ,EAAE,KAAK;wBACf,UAAU,EAAE,IAAI;wBAChB,UAAU,EAAE,IAAI;wBAChB,cAAc,EAAE,IAAI,CAAwB,4HAA4H;qBACxK,CAAC,CAAC;gBACJ,CAAC,EAAE,EAAE,CAAC,CAAC;YAGR,CAAC,CAAC,CAAC;QAEJ,CAAC;KAAC;CACH,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDiagrams/kommonitor-diagrams.component.ts b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDiagrams/kommonitor-diagrams.component.ts new file mode 100644 index 000000000..4c670a9a2 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDiagrams/kommonitor-diagrams.component.ts @@ -0,0 +1,451 @@ +angular + .module('kommonitorDiagrams') + .component( + 'kommonitorDiagrams', + { + templateUrl: "components/kommonitorUserInterface/kommonitorControls/kommonitorDiagrams/kommonitor-diagrams.template.html", + /* + * injected with a modules service method that manages + * enabled tabs + */ + controller: [ + 'kommonitorDataExchangeService', 'kommonitorDiagramHelperService', 'kommonitorFilterHelperService', + '$scope', '$rootScope', '__env', + function kommonitorDiagramsController(kommonitorDataExchangeService, kommonitorDiagramHelperService, kommonitorFilterHelperService, + $scope, $rootScope, __env) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorDiagramHelperServiceInstance = kommonitorDiagramHelperService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + $(window).on('resize', function () { + if ($scope.histogramChart != null && $scope.histogramChart != undefined) { + $scope.histogramChart.resize(); + } + + if ($scope.barChart != null && $scope.barChart != undefined) { + $scope.barChart.resize(); + } + + if ($scope.lineChart != null && $scope.lineChart != undefined) { + $scope.lineChart.resize(); + } + }); + + $scope.$on("resizeDiagrams", function (event) { + + setTimeout(function () { + if ($scope.histogramChart != null && $scope.histogramChart != undefined) { + $scope.histogramChart.resize(); + } + + if ($scope.barChart != null && $scope.barChart != undefined) { + $scope.barChart.resize(); + } + + if ($scope.lineChart != null && $scope.lineChart != undefined) { + $scope.lineChart.resize(); + } + }, 350); + }); + + const INDICATOR_DATE_PREFIX = __env.indicatorDatePrefix; + const defaultColorForHoveredFeatures = __env.defaultColorForHoveredFeatures; + const defaultColorForClickedFeatures = __env.defaultColorForClickedFeatures; + + // $scope.userHoveresOverBarItem = false; + $scope.eventsRegistered = false; + $scope.isTooManyFeatures = false; + $scope.histogramCanBeDisplayed = false; + $scope.spatialUnitName; + $scope.date; + var numberOfDecimals = __env.numberOfDecimals; + var defaultColorForZeroValues = __env.defaultColorForZeroValues; + var defaultColorForNoDataValues = __env.defaultColorForNoDataValues; + var defaultColorForFilteredValues = __env.defaultColorForFilteredValues; + + const defaultColorForOutliers_high = __env.defaultColorForOutliers_high; + const defaultBorderColorForOutliers_high = __env.defaultBorderColorForOutliers_high; + const defaultFillOpacityForOutliers_high = __env.defaultFillOpacityForOutliers_high; + const defaultColorForOutliers_low = __env.defaultColorForOutliers_low; + const defaultBorderColorForOutliers_low = __env.defaultBorderColorForOutliers_low; + const defaultFillOpacityForOutliers_low = __env.defaultFillOpacityForOutliers_low; + + var compareFeaturesByIndicatorValue = function (featureA, featureB) { + if (featureA.properties[$scope.indicatorPropertyName] < featureB.properties[$scope.indicatorPropertyName]) + return -1; + if (featureA.properties[$scope.indicatorPropertyName] > featureB.properties[$scope.indicatorPropertyName]) + return 1; + return 0; + } + + var showLoadingIcons = function () { + + if ($scope.histogramChart) + $scope.histogramChart.showLoading(); + + if ($scope.barChart) + $scope.barChart.showLoading(); + + if ($scope.lineChart) + $scope.lineChart.showLoading(); + }; + + $scope.$on("updateDiagrams", function (event, indicatorMetadataAndGeoJSON, spatialUnitName, spatialUnitId, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue, justRestyling) { + + // console.log("Updating diagrams!"); + + $scope.loadingData = true; + + showLoadingIcons(); + + $scope.spatialUnitName = spatialUnitName; + $scope.date = date; + + kommonitorDiagramHelperService.prepareAllDiagramResources_forCurrentMapIndicator(indicatorMetadataAndGeoJSON, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue, false); + + // updateHistogramChart(); + + updateLineChart(); + + updateBarChart(); + $scope.loadingData = false; + }); + + //HISTOGRAM CHART FUNCTION + var updateHistogramChart = function () { + + $scope.histogramCanBeDisplayed = false; + + if (!$scope.histogramChart) + $scope.histogramChart = echarts.init(document.getElementById('histogramDiagram')); + else { + // explicitly kill and reinstantiate histogram diagram to avoid zombie states on spatial unit change + $scope.histogramChart.dispose(); + $scope.histogramChart = echarts.init(document.getElementById('histogramDiagram')); + } + + $scope.histogramOption = kommonitorDiagramHelperService.getHistogramChartOptions(); + + $scope.histogramChart.setOption($scope.histogramOption); + $scope.histogramChart.hideLoading(); + $scope.histogramCanBeDisplayed = true; + setTimeout(function () { + $scope.histogramChart.resize(); + }, 350); + }; + + // BAR CHART FUNCTION + + var updateBarChart = function (indicatorMetadataAndGeoJSON, featureNamesArray, indicatorValueBarChartArray) { + // based on prepared DOM, initialize echarts instance + $scope.eventsRegistered = false; + + if (!$scope.barChart) + $scope.barChart = echarts.init(document.getElementById('barDiagram')); + else { + // explicitly kill and reinstantiate bar diagram to avoid zombie states on spatial unit change + $scope.barChart.dispose(); + $scope.barChart = echarts.init(document.getElementById('barDiagram')); + } + + // use configuration item and data specified to show chart + $scope.barOption = kommonitorDiagramHelperService.getBarChartOptions(); + $scope.barChart.setOption($scope.barOption); + + $scope.barChart.hideLoading(); + + setTimeout(function () { + $scope.barChart.resize(); + }, 350); + + registerEventsIfNecessary(); + }; + + function registerEventsIfNecessary() { + if (!$scope.eventsRegistered) { + // when hovering over elements of the chart then highlight them in the map. + $scope.barChart.on('mouseOver', function (params) { + // $scope.userHoveresOverBarItem = true; + var seriesIndex = params.seriesIndex; + var dataIndex = params.dataIndex; + + // console.log("Series: " + seriesIndex + ", dataIndex: " + dataIndex); + // + // var barElement = $scope.barOption.series[seriesIndex].data[dataIndex]; + // + // console.log(barElement); + + var spatialFeatureName = $scope.barOption.xAxis.data[dataIndex]; + if(spatialFeatureName){ + // console.log(spatialFeatureName); + $rootScope.$broadcast("highlightFeatureOnMap", spatialFeatureName); + } + + }); + + $scope.barChart.on('mouseOut', function (params) { + // $scope.userHoveresOverBarItem = false; + var seriesIndex = params.seriesIndex; + var dataIndex = params.dataIndex; + + // console.log("Series: " + seriesIndex + ", dataIndex: " + dataIndex); + // + // var barElement = $scope.barOption.series[seriesIndex].data[dataIndex]; + // + // console.log(barElement); + + var spatialFeatureName = $scope.barOption.xAxis.data[dataIndex]; + // console.log(spatialFeatureName); + if(spatialFeatureName){ + $rootScope.$broadcast("unhighlightFeatureOnMap", spatialFeatureName); + } + + }); + + $scope.barChart.on('click', function (params) { + var seriesIndex = params.seriesIndex; + var dataIndex = params.dataIndex; + + // console.log("Series: " + seriesIndex + ", dataIndex: " + dataIndex); + // + // var barElement = $scope.barOption.series[seriesIndex].data[dataIndex]; + // + // console.log(barElement); + + var spatialFeatureName = $scope.barOption.xAxis.data[dataIndex]; + // console.log(spatialFeatureName); + if(spatialFeatureName){ + $rootScope.$broadcast("switchHighlightFeatureOnMap", spatialFeatureName); + } + + }); + + $scope.eventsRegistered = true; + } + }; + + // LINE CHART TIME SERIES FUNCTION + var updateLineChart = function (indicatorMetadataAndGeoJSON, indicatorTimeSeriesDatesArray, indicatorTimeSeriesAverageArray) { + // based on prepared DOM, initialize echarts instance + if (!$scope.lineChart) + $scope.lineChart = echarts.init(document.getElementById('lineDiagram')); + else { + // explicitly kill and reinstantiate line diagram to avoid zombie states on spatial unit change + $scope.lineChart.dispose(); + $scope.lineChart = echarts.init(document.getElementById('lineDiagram')); + } + + // use configuration item and data specified to show chart + $scope.lineOption = kommonitorDiagramHelperService.getLineChartOptions(); + $scope.lineChart.setOption($scope.lineOption); + + $scope.lineChart.hideLoading(); + setTimeout(function () { + $scope.lineChart.resize(); + }, 350); + }; + + $scope.$on("updateDiagramsForHoveredFeature", function (event, featureProperties) { + + if (!$scope.lineOption.legend.data.includes(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME])) { + appendSeriesToLineChart(featureProperties); + } + + highlightFeatureInBarChart(featureProperties); + highlightFeatureInLineChart(featureProperties); + }); + + var appendSeriesToLineChart = function (featureProperties) { + + // in case of activated balance mode, we must use the properties of kommonitorDataExchangeService.selectedIndicator, to aquire the correct time series item! + if (kommonitorDataExchangeService.isBalanceChecked) { + featureProperties = findPropertiesForTimeSeries(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); + } + + // append feature name to legend + $scope.lineOption.legend.data.push(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); + + // create feature data series + var featureSeries = {}; + featureSeries.name = featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]; + featureSeries.type = 'line'; + featureSeries.data = new Array(); + + // for each date create series data entry for feature + for (var date of $scope.lineOption.xAxis.data) { + var value; + if (kommonitorDataExchangeService.indicatorValueIsNoData(featureProperties[INDICATOR_DATE_PREFIX + date])) { + value = null; + } + else { + value = kommonitorDataExchangeService.getIndicatorValue_asNumber(featureProperties[INDICATOR_DATE_PREFIX + date]); + } + featureSeries.data.push(value); + } + + $scope.lineOption.series.push(featureSeries); + + $scope.lineChart.setOption($scope.lineOption); + setTimeout(function () { + $scope.lineChart.resize(); + }, 350); + }; + + var findPropertiesForTimeSeries = function (spatialUnitFeatureName) { + for (var feature of kommonitorDataExchangeService.selectedIndicator.geoJSON.features) { + if (feature.properties[__env.FEATURE_NAME_PROPERTY_NAME] == spatialUnitFeatureName) { + return feature.properties; + } + } + } + + var highlightFeatureInBarChart = function (featureProperties) { + // highlight the corresponding bar diagram item + // get index of bar item + + // if($scope.userHoveresOverBarItem){ + // return; + // } + + var index = -1; + for (var i = 0; i < $scope.barOption.xAxis.data.length; i++) { + if ($scope.barOption.xAxis.data[i] === featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]) { + index = i; + break; + } + } + + if (index > -1) { + $scope.barChart.dispatchAction({ + type: 'highlight', + seriesIndex: 0, + dataIndex: index + }); + // tooltip + $scope.barChart.dispatchAction({ + type: 'showTip', + seriesIndex: 0, + dataIndex: index + }); + } + }; + + var highlightFeatureInLineChart = function (featureProperties) { + // highlight the corresponding bar diagram item + // get series index of series + var seriesIndex = getSeriesIndexByFeatureName(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); + + if (seriesIndex > -1) { + $scope.lineChart.dispatchAction({ + type: 'highlight', + seriesIndex: seriesIndex + }); + } + }; + + $scope.$on("updateDiagramsForUnhoveredFeature", function (event, featureProperties) { + + if (!kommonitorFilterHelperService.featureIsCurrentlySelected(featureProperties[__env.FEATURE_ID_PROPERTY_NAME])) { + unhighlightFeatureInLineChart(featureProperties); + + removeSeriesFromLineChart(featureProperties); + + unhighlightFeatureInBarChart(featureProperties); + } + }); + + var getSeriesIndexByFeatureName = function (featureName) { + for (var index = 0; index < $scope.lineOption.series.length; index++) { + if ($scope.lineOption.series[index].name === featureName) + return index; + } + + //return -1 if none was found + return -1; + }; + + var removeSeriesFromLineChart = function (featureProperties) { + // remove feature from legend + var legendIndex = $scope.lineOption.legend.data.indexOf(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); + if (legendIndex > -1) { + $scope.lineOption.legend.data.splice(legendIndex, 1); + } + + // remove feature data series + var seriesIndex = getSeriesIndexByFeatureName(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); + if (seriesIndex > -1) { + $scope.lineOption.series.splice(seriesIndex, 1); + } + + // second parameter tells echarts to not merge options with previous data. hence really remove series from graphic + $scope.lineChart.setOption($scope.lineOption, true); + setTimeout(function () { + $scope.lineChart.resize(); + }, 350); + }; + + var unhighlightFeatureInBarChart = function (featureProperties) { + // highlight the corresponding bar diagram item + // get index of bar item + var index = -1; + for (var i = 0; i < $scope.barOption.xAxis.data.length; i++) { + if ($scope.barOption.xAxis.data[i] === featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]) { + index = i; + break; + } + } + + if (index > -1) { + $scope.barChart.dispatchAction({ + type: 'downplay', + seriesIndex: 0, + dataIndex: index + }); + // tooltip + $scope.barChart.dispatchAction({ + type: 'hideTip', + seriesIndex: 0, + dataIndex: index + }); + } + }; + + var unhighlightFeatureInLineChart = function (featureProperties) { + // highlight the corresponding bar diagram item + // get series index of series + var seriesIndex = getSeriesIndexByFeatureName(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); + + if (seriesIndex > -1) { + $scope.lineChart.dispatchAction({ + type: 'downplay', + seriesIndex: seriesIndex + }); + } + }; + + $scope.$on("AppendExportButtonsForTable", function (event, tableId, tableExportName) { + + setTimeout(function () { + + + // new TableExport(document.getElementsByTagName("table"), { + new TableExport(document.getElementById(tableId), { + headers: true, // (Boolean), display table headers (th or td elements) in the , (default: true) + footers: true, // (Boolean), display table footers (th or td elements) in the , (default: false) + formats: ['xlsx', 'csv', 'txt'], // (String[]), filetype(s) for the export, (default: ['xlsx', 'csv', 'txt']) + filename: tableExportName, // (id, String), filename for the downloaded file, (default: 'id') + bootstrap: true, // (Boolean), style buttons using bootstrap, (default: true) + exportButtons: true, // (Boolean), automatically generate the built-in export buttons for each of the specified formats (default: true) + position: 'top', // (top, bottom), position of the caption element relative to table, (default: 'bottom') + ignoreRows: null, // (Number, Number[]), row indices to exclude from the exported file(s) (default: null) + ignoreCols: null, // (Number, Number[]), column indices to exclude from the exported file(s) (default: null) + trimWhitespace: true // (Boolean), remove all leading/trailing newlines, spaces, and tabs from cell text in the exported file(s) (default: false) + }); + }, 50); + + + }); + + }] + }); diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDiagrams/kommonitor-diagrams.module.js b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDiagrams/kommonitor-diagrams.module.js index e2e076e1c..b909c5448 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDiagrams/kommonitor-diagrams.module.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDiagrams/kommonitor-diagrams.module.js @@ -1 +1,3 @@ -angular.module('kommonitorDiagrams', [ 'kommonitorDataExchange', 'kommonitorDiagramHelper']); +"use strict"; +angular.module('kommonitorDiagrams', ['kommonitorDataExchange', 'kommonitorDiagramHelper']); +//# sourceMappingURL=kommonitor-diagrams.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDiagrams/kommonitor-diagrams.module.js.map b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDiagrams/kommonitor-diagrams.module.js.map new file mode 100644 index 000000000..a940e2e05 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDiagrams/kommonitor-diagrams.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-diagrams.module.js","sourceRoot":"","sources":["kommonitor-diagrams.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE,CAAE,wBAAwB,EAAE,yBAAyB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDiagrams/kommonitor-diagrams.module.ts b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDiagrams/kommonitor-diagrams.module.ts new file mode 100644 index 000000000..e2e076e1c --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorDiagrams/kommonitor-diagrams.module.ts @@ -0,0 +1 @@ +angular.module('kommonitorDiagrams', [ 'kommonitorDataExchange', 'kommonitorDiagramHelper']); diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorFilter/kommonitor-filter.component.js b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorFilter/kommonitor-filter.component.js index 39a8ea4fb..5ae890376 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorFilter/kommonitor-filter.component.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorFilter/kommonitor-filter.component.js @@ -1,580 +1,460 @@ +"use strict"; angular - .module('kommonitorFilter') - .component( - 'kommonitorFilter', - { - templateUrl : "components/kommonitorUserInterface/kommonitorControls/kommonitorFilter/kommonitor-filter.template.html", - /* - * injected with a modules service method that manages - * enabled tabs - */ - controller : ['$scope', '$rootScope', 'kommonitorMapService', 'kommonitorDataExchangeService', 'kommonitorFilterHelperService', - '__env', '$http', function kommonitorFilterController($scope, $rootScope, kommonitorMapService, kommonitorDataExchangeService, - kommonitorFilterHelperService, __env, $http) { - - const INDICATOR_DATE_PREFIX = __env.indicatorDatePrefix; - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorMapServiceInstance = kommonitorMapService; - this.kommonitorFilterHelperServiceInstance = kommonitorFilterHelperService; - var numberOfDecimals = __env.numberOfDecimals; - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - $scope.considerAllowedSpatialUnitsOfCurrentIndicator = true; - $scope.loadingData = false; - - $scope.rangeSliderForFilter; - $scope.valueRangeMinValue; - $scope.valueRangeMaxValue; - $scope.currentLowerFilterValue; - $scope.currentHigherFilterValue; - $scope.lowerFilterInputNotValid = false; - $scope.higherFilterInputNotValid = false; - $scope.indicatorMetadataAndGeoJSON; - - //measureOfValue stuff - $scope.movMinValue; - $scope.movMaxValue; - $scope.movMiddleValue; - $scope.movStep; - $scope.movRangeSlider; - - // SPATIAL FILTER STUFF - $scope.selectedSpatialUnitForFilter; - $scope.higherSpatialUnits = undefined; - $scope.higherSpatialUnitFilterFeatureGeoJSON; - $scope.reappliedFilter = false; - - $scope.selectionByFeatureSpatialFilterDuallistOptions = { - title: {label: 'Gebiete', helpMessage: 'help'}, - selectOptions: {initialText: "Gebiete"}, - items: [], - button: {leftText: "Alle auswählen" , rightText: "Alle entfernen"}, - selectedItems: [] - }; - - $scope.manualSelectionSpatialFilterDuallistOptions = { - title: {label: 'Gebiete', helpMessage: 'help'}, - selectOptions: {initialText: "Gebiete"}, - items: [], - button: {leftText: "Alle auswählen" , rightText: "Alle entfernen"}, - selectedItems: [] - }; - - - $scope.setupSpatialUnitFilter = function(indicatorMetadataAndGeoJSON, spatialUnitName, date){ - - $scope.loadingData = true; - - let allowedSpatialUnitIds = indicatorMetadataAndGeoJSON.applicableSpatialUnits.map(spatialUnitEntry => { - return spatialUnitEntry.spatialUnitId; - }); - - $scope.higherSpatialUnits = JSON.parse(JSON.stringify(kommonitorDataExchangeService.availableSpatialUnits)); - - // only show those spatial units that are actually visible according to keycloak role - // and associated to the current indicator as well - for (let index = 0; index < $scope.higherSpatialUnits.length; index++) { - const spatialUnitMetadata = $scope.higherSpatialUnits[index]; - - // remove if it is not applicable for current indicator OR - // remove if it is the currently displayed spatial unit to show only hierarchically higher spatial units - if($scope.considerAllowedSpatialUnitsOfCurrentIndicator && ! allowedSpatialUnitIds.includes(spatialUnitMetadata.spatialUnitId)){ - - // only remove the current element - // which represents a spatial unit that is - // not supported by the current indicator - $scope.higherSpatialUnits.splice(index, 1); - } - - // since we query through a hierarchically sorted array of ALL spatial units - // we have to stop when we identify the currently displayed spatial unit - // in that case we have to remove that from the list of upper - if (spatialUnitName == spatialUnitMetadata.spatialUnitLevel){ - // remove current all all remaining elements from array - // (which are lower hierarchy spatial units) - $scope.higherSpatialUnits.splice(index); - break; - } - } - - // $scope.higherSpatialUnits.splice(targetIndex); - $scope.selectedSpatialUnitForFilter = $scope.higherSpatialUnits[$scope.higherSpatialUnits.length - 1]; - - $scope.loadingData = false; - }; - - $scope.inputNotValid = false; - - $scope.$on("onChangeSelectedIndicator", function(event){ - $scope.reappliedFilter = false; - }); - - $scope.$on("indicatortMapDisplayFinished", function(){ - // trigger the continous display of current filter - if(! $scope.reappliedFilter){ - $scope.reappliedFilter = true; - if ($scope.showSelectionByFeatureSpatialFilter){ - $scope.onSelectionByFeatureSpatialFilterSelectBtnPressed(); - } - if ($scope.showManualSelectionSpatialFilter){ - $scope.onManualSelectionBySelectedMapFeaturesBtnPressed(); - } - } - }); - - $scope.$on("replaceIndicatorAsGeoJSON", function (event, indicatorMetadataAndGeoJSON, spatialUnitName, date, justRestyling, isCustomComputation) { - - $scope.setupSpatialUnitFilter(indicatorMetadataAndGeoJSON, spatialUnitName, date); - - if(! $scope.previouslySelectedIndicator){ - $scope.previouslySelectedIndicator = kommonitorDataExchangeService.selectedIndicator; - } - if(! $scope.previouslySelectedSpatialUnit){ - $scope.previouslySelectedSpatialUnit = kommonitorDataExchangeService.selectedSpatialUnit; - } - - // if($scope.previouslySelectedIndicator.indicatorId != indicatorMetadataAndGeoJSON.indicatorId || $scope.previouslySelectedSpatialUnit.spatialUnitLevel != spatialUnitName){ - if($scope.previouslySelectedSpatialUnit.spatialUnitLevel != spatialUnitName){ - // reset filter component - if ($scope.showSelectionByFeatureSpatialFilter) - $scope.updateSelectableAreas("byFeature"); - kommonitorFilterHelperService.clearFilteredFeatures(); - kommonitorFilterHelperService.clearSelectedFeatures(); - if ($scope.showManualSelectionSpatialFilter) - $scope.updateSelectableAreas("manual"); - kommonitorFilterHelperService.clearFilteredFeatures(); - kommonitorFilterHelperService.clearSelectedFeatures(); - } - - $scope.previouslySelectedIndicator = kommonitorDataExchangeService.selectedIndicator; - $scope.previouslySelectedSpatialUnit = kommonitorDataExchangeService.selectedSpatialUnit; - - }); - - $scope.$on("updateIndicatorValueRangeFilter", function (event, date, indicatorMetadataAndGeoJSON) { - - $scope.setupRangeSliderForFilter(date, indicatorMetadataAndGeoJSON); - - }); - - $scope.setupRangeSliderForFilter = function(date, indicatorMetadataAndGeoJSON){ - date = INDICATOR_DATE_PREFIX + date; - - if($scope.rangeSliderForFilter){ - kommonitorDataExchangeService.rangeFilterData = undefined; - $scope.rangeSliderForFilter.destroy(); - - var domNode = document.getElementById("rangeSliderForFiltering"); - - while (domNode.hasChildNodes()) { - domNode.removeChild(domNode.lastChild); - } - } - - $scope.indicatorMetadataAndGeoJSON = indicatorMetadataAndGeoJSON; - - var values = []; - - $scope.indicatorMetadataAndGeoJSON.geoJSON.features.forEach(function(feature){ - // if (feature.properties[date] > movMaxValue) - // movMaxValue = feature.properties[date]; - // - // else if (feature.properties[date] < movMinValue) - // movMinValue = feature.properties[date]; - - if(! kommonitorDataExchangeService.indicatorValueIsNoData(feature.properties[date])){ - values.push(feature.properties[date]); - } - }); - - if(values.length === 0){ - console.warn("Filter range slider cannot be created, as there is no valid indicator value on the selected dataset for the selected date."); - return ; - } - - //sort ascending order - values.sort(function(a, b){return a-b}); - - // initialize and fill in loop - $scope.valueRangeMinValue = values[0]; - $scope.valueRangeMaxValue = values[values.length - 1]; - - $scope.valueRangeMinValue = kommonitorDataExchangeService.getIndicatorValue_asNumber($scope.valueRangeMinValue); - $scope.valueRangeMaxValue = kommonitorDataExchangeService.getIndicatorValue_asNumber($scope.valueRangeMaxValue); - - $scope.currentLowerFilterValue = $scope.valueRangeMinValue; - $scope.currentHigherFilterValue = $scope.valueRangeMaxValue; - - $("#rangeSliderForFiltering").ionRangeSlider({ - skin: "big", - type: "double", - min: $scope.valueRangeMinValue, - max: $scope.valueRangeMaxValue, - from: $scope.valueRangeMinValue, - to: $scope.valueRangeMaxValue, - force_edges: true, - step: 0.01, - grid: true, - prettify_enabled: true, - prettify_separator: "", - onChange: onChangeRangeFilter - }); - - $scope.rangeSliderForFilter = $("#rangeSliderForFiltering").data("ionRangeSlider"); - // make sure that the handles are properly set to min and max values - $scope.rangeSliderForFilter.update({ - from: $scope.valueRangeMinValue, - to: $scope.valueRangeMaxValue - }); - - }; - - $scope.onChangeLowerFilterValue = function(){ - if(($scope.currentLowerFilterValue >= $scope.valueRangeMinValue) && ($scope.currentLowerFilterValue <= $scope.valueRangeMaxValue) && ($scope.currentLowerFilterValue <= $scope.currentHigherFilterValue)){ - $scope.lowerFilterInputNotValid = false; - $scope.rangeSliderForFilter.update({ - from: $scope.currentLowerFilterValue, - to: $scope.currentHigherFilterValue - }); - - $scope.applyRangeFilter(); - } - else{ - $scope.lowerFilterInputNotValid = true; - } - }; - - $scope.onChangeHigherFilterValue = function(){ - if(($scope.currentHigherFilterValue <= $scope.valueRangeMaxValue) && ($scope.currentHigherFilterValue >= $scope.valueRangeMinValue) && ($scope.currentLowerFilterValue <= $scope.currentHigherFilterValue)){ - $scope.higherFilterInputNotValid = false; - $scope.rangeSliderForFilter.update({ - from: $scope.currentLowerFilterValue, - to: $scope.currentHigherFilterValue - }); - - $scope.applyRangeFilter(); - } - else{ - $scope.higherFilterInputNotValid = true; - } - }; - - function onChangeRangeFilter (data) { - // Called every time handle position is changed - kommonitorDataExchangeService.rangeFilterData = data; - - $scope.lowerFilterInputNotValid = false; - $scope.higherFilterInputNotValid = false; - - $scope.currentLowerFilterValue = data.from; - $scope.currentHigherFilterValue = data.to; - - $scope.applyRangeFilter(); - }; - - $scope.applyRangeFilter = function(){ - - var dateProperty = INDICATOR_DATE_PREFIX + kommonitorDataExchangeService.selectedDate; - - kommonitorFilterHelperService.applyRangeFilter($scope.indicatorMetadataAndGeoJSON.geoJSON.features, dateProperty, $scope.currentLowerFilterValue, $scope.currentHigherFilterValue); - - $scope.$digest(); - } - - - // MeasureOfValue stuff - $scope.inputNotValid = false; - - - this.onChangeUseMeasureOfValue = function(){ - if(kommonitorDataExchangeService.isBalanceChecked){ - $rootScope.$broadcast("DisableBalance"); - $rootScope.$broadcast("updateIndicatorValueRangeFilter", kommonitorDataExchangeService.selectedDate, kommonitorDataExchangeService.selectedIndicator); - //replace displayed indicator on map - kommonitorFilterHelperService.filterAndReplaceDataset(); - // kommonitorMapService.replaceIndicatorGeoJSON(kommonitorDataExchangeService.selectedIndicator, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, kommonitorDataExchangeService.selectedDate, true); - } - else{ - this.kommonitorMapServiceInstance.restyleCurrentLayer(); - } - - }; - - $scope.$on("updateMeasureOfValueBar", function (event, date, indicatorMetadataAndGeoJSON) { - - $scope.updateMeasureOfValueBar(date, indicatorMetadataAndGeoJSON); - - }); - - $scope.updateMeasureOfValueBar = function(date, indicatorMetadataAndGeoJSON){ - - //append date prefix to access correct property! - date = INDICATOR_DATE_PREFIX + date; - var geoJSON = indicatorMetadataAndGeoJSON.geoJSON; - - // var measureOfValueInput = document.getElementById("measureOfValueInput"); - - var values = []; - - geoJSON.features.forEach(function(feature){ - // if (feature.properties[date] > movMaxValue) - // movMaxValue = feature.properties[date]; - // - // else if (feature.properties[date] < movMinValue) - // movMinValue = feature.properties[date]; - - if(! kommonitorDataExchangeService.indicatorValueIsNoData(feature.properties[date])){ - values.push(feature.properties[date]); - } - }); - - //sort ascending order - values.sort(function(a, b){return a-b}); - - $scope.movMinValue = +Number(values[0]).toFixed(numberOfDecimals); - $scope.movMaxValue = +Number(values[values.length - 1]).toFixed(numberOfDecimals); - - $scope.movMiddleValue = +(($scope.movMaxValue + $scope.movMinValue) / 2).toFixed(numberOfDecimals); - // $scope.movStep = +(($scope.movMaxValue - $scope.movMinValue)/35).toFixed(numberOfDecimals); - $scope.movStep = 0.01; - - // measureOfValueInput.setAttribute("min", $scope.movMinValue); - // measureOfValueInput.setAttribute("max", $scope.movMaxValue); - // measureOfValueInput.setAttribute("movStep", $scope.movStep); - // measureOfValueInput.setAttribute("value", $scope.movMiddleValue); - - kommonitorDataExchangeService.measureOfValue = $scope.movMiddleValue; - - var measureOfValueTextInput = document.getElementById("measureOfValueTextInput"); - measureOfValueTextInput.setAttribute("min", $scope.movMinValue); - measureOfValueTextInput.setAttribute("max", $scope.movMaxValue); - measureOfValueTextInput.setAttribute("value", $scope.movMiddleValue); - measureOfValueTextInput.setAttribute("step", $scope.movStep); - - if($scope.movRangeSlider){ - $scope.movRangeSlider.destroy(); - - var domNode = document.getElementById("measureOfValueInput"); - - while (domNode.hasChildNodes()) { - domNode.removeChild(domNode.lastChild); - } - } - - // rangeSLider - $("#measureOfValueInput").ionRangeSlider({ - skin: "big", - type: "single", - min: $scope.movMinValue, - max: $scope.movMaxValue, - from: $scope.movMiddleValue, - force_edges: true, - step: 0.01, - grid: true, - prettify_enabled: true, - prettify_separator: "", - onChange: $scope.onMeasureOfValueChange - }); - - $scope.movRangeSlider = $("#measureOfValueInput").data("ionRangeSlider"); - // make sure that the handles are properly set to min and max values - $scope.movRangeSlider.update({ - from: $scope.movMiddleValue - }); - - $scope.inputNotValid = false; - - }; - - $scope.onMeasureOfValueChange = function(data){ - - kommonitorDataExchangeService.measureOfValue = +Number(data.from).toFixed(numberOfDecimals); - - // kommonitorDataExchangeService.measureOfValue = +Number(kommonitorDataExchangeService.measureOfValue).toFixed(numberOfDecimals); - - if(kommonitorDataExchangeService.measureOfValue >= $scope.movMinValue && kommonitorDataExchangeService.measureOfValue <= $scope.movMaxValue){ - $scope.inputNotValid = false; - kommonitorMapService.restyleCurrentLayer(); - } - else{ - $scope.inputNotValid = true; - } - - }; - - $scope.onMeasureOfValueChangeByText = function(){ - - kommonitorDataExchangeService.measureOfValue = +Number(kommonitorDataExchangeService.measureOfValue).toFixed(numberOfDecimals); - - // kommonitorDataExchangeService.measureOfValue = +Number(kommonitorDataExchangeService.measureOfValue).toFixed(numberOfDecimals); - - if(kommonitorDataExchangeService.measureOfValue >= $scope.movMinValue && kommonitorDataExchangeService.measureOfValue <= $scope.movMaxValue){ - $scope.inputNotValid = false; - $scope.movRangeSlider.update({ - from: kommonitorDataExchangeService.measureOfValue - }); - kommonitorMapService.restyleCurrentLayer(); - } - else{ - $scope.inputNotValid = true; - } - - }; - - $scope.updateSelectableAreas = async function(selectionType) { - $scope.loadingData = true; - //send request to datamanagement API - let selectedSpatialUnit = kommonitorDataExchangeService.selectedSpatialUnit; - let selectedSpatialUnitId = selectedSpatialUnit.spatialUnitId; - let upperSpatialUnitId = undefined; - - // spatial filter not applicable since no upper spatial unit is available or selected - if(! $scope.selectedSpatialUnitForFilter){ - $scope.loadingData = false; - return; - } - - if (selectionType === "byFeature" && $scope.selectedSpatialUnitForFilter) { - upperSpatialUnitId = $scope.selectedSpatialUnitForFilter.spatialUnitId; - } - let selectedIndicatorId = kommonitorDataExchangeService.selectedIndicator.indicatorId; - - // example: 2020-12-31 - let selectedDateComponents = kommonitorDataExchangeService.selectedDate.split("-"); - - //build request - let datePath = ""; - if(selectedDateComponents && selectedDateComponents.length && selectedDateComponents.length == 3){ - datePath = selectedDateComponents[0] + "/" + selectedDateComponents[1] + "/" + selectedDateComponents[2]; - } - else{ - // fallback option, if no valid date could be used - datePath = "allFeatures"; - } - let url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + - "/spatial-units/" + selectedSpatialUnitId + "/" + datePath; - - if (selectionType === "byFeature" && upperSpatialUnitId) - url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + - "/spatial-units/" + upperSpatialUnitId + "/" + datePath; - //send request - console.log(url); - await $http({ - url: url, - method: "GET" - }).then(function successCallback(response) { //TODO add error callback for the case that the combination of indicator and nextUpperHierarchyLevel doesn't exist - let areaNames = []; - $(response.data.features).each( (id, obj) => { - areaNames.push({name: obj.properties[__env.FEATURE_NAME_PROPERTY_NAME], id: obj.properties[__env.FEATURE_ID_PROPERTY_NAME]}); - }); - if (selectionType === "manual") { - $scope.manualSelectionSpatialFilterDuallistOptions.selectedItems = []; - let dataArray = kommonitorDataExchangeService.createDualListInputArray(areaNames, "name", "id"); - $scope.manualSelectionSpatialFilterDuallistOptions.items = dataArray; - } - if (selectionType === "byFeature") { - $scope.higherSpatialUnitFilterFeatureGeoJSON = response.data; - $scope.selectionByFeatureSpatialFilterDuallistOptions.selectedItems = []; - let dataArray = kommonitorDataExchangeService.createDualListInputArray(areaNames, "name", "id"); - $scope.selectionByFeatureSpatialFilterDuallistOptions.items = dataArray; - } - $scope.loadingData = false; - $scope.$digest(); - }); - }; - - $scope.onChangeShowManualSelection = async function() { - // return if toggle was deactivated - if(!$scope.showManualSelectionSpatialFilter) - $scope.onManualSelectionSpatialFilterResetBtnPressed(); - else { - $scope.showSelectionByFeatureSpatialFilter = false; - $scope.onManualSelectionSpatialFilterResetBtnPressed(); - } - }; - - $scope.onChangeShowSelectionByFeature = async function() { - // return if toggle was deactivated - if(!$scope.showSelectionByFeatureSpatialFilter) - $scope.onSelectionByFeatureSpatialFilterResetBtnPressed(); - else { - $scope.showManualSelectionSpatialFilter = false; - $scope.onSelectionByFeatureSpatialFilterResetBtnPressed(); - } - }; - - $scope.onChangeSelectedSpatialUnitForFilter = function(){ - if ($scope.showSelectionByFeatureSpatialFilter) - $scope.updateSelectableAreas("byFeature"); - - if($scope.showManualSelectionSpatialFilter){ - $scope.updateSelectableAreas("manual"); - } - }; - - $scope.onSelectionByFeatureSpatialFilterSelectBtnPressed = function(){ - if($scope.selectionByFeatureSpatialFilterDuallistOptions.selectedItems && $scope.selectionByFeatureSpatialFilterDuallistOptions.selectedItems.length > 0){ - // objects like {category: category, name:name} - //$scope.selectionByFeatureSpatialFilterDuallistOptions.selectedItems - let targetFeatureNames = $scope.selectionByFeatureSpatialFilterDuallistOptions.selectedItems.map(object => object.name); - - kommonitorFilterHelperService.applySpatialFilter_higherSpatialUnitFeatures($scope.higherSpatialUnitFilterFeatureGeoJSON, targetFeatureNames); - } - }; - - $scope.onSelectionByFeatureSpatialFilterResetBtnPressed = function(){ - $scope.updateSelectableAreas("byFeature"); - - kommonitorFilterHelperService.clearFilteredFeatures(); - kommonitorFilterHelperService.filterAndReplaceDataset(); - if(document.getElementById('controlNoDataDisplay').checked) - $rootScope.$broadcast('applyNoDataDisplay') - }; - - $scope.onManualSelectionSpatialFilterSelectBtnPressed = function(){ - if($scope.manualSelectionSpatialFilterDuallistOptions.selectedItems && $scope.manualSelectionSpatialFilterDuallistOptions.selectedItems.length > 0){ - // objects like {category: category, name:name} - //$scope.manualSelectionSpatialFilterDuallistOptions.selectedItems - let targetFeatureNames = $scope.manualSelectionSpatialFilterDuallistOptions.selectedItems.map(object => object.name); - - kommonitorFilterHelperService.applySpatialFilter_currentSpatialUnitFeatures(targetFeatureNames); - } - }; - - $scope.onManualSelectionSpatialFilterResetBtnPressed = function(){ - $scope.updateSelectableAreas("manual"); - - kommonitorFilterHelperService.clearFilteredFeatures(); - kommonitorFilterHelperService.filterAndReplaceDataset(); - if(document.getElementById('controlNoDataDisplay').checked) - $rootScope.$broadcast('applyNoDataDisplay') - }; - - $scope.onManualSelectionBySelectedMapFeaturesBtnPressed = function(){ - // manage duallist items display - $scope.manageManualDualList_fromMapSelection(); - - // apply spatial filter from selected map features - $scope.onManualSelectionSpatialFilterSelectBtnPressed(); - }; - - $scope.manageManualDualList_fromMapSelection = function(){ - $scope.manualSelectionSpatialFilterDuallistOptions.items = $scope.manualSelectionSpatialFilterDuallistOptions.items.concat($scope.manualSelectionSpatialFilterDuallistOptions.selectedItems); - $scope.manualSelectionSpatialFilterDuallistOptions.selectedItems = []; - - $scope.manualSelectionSpatialFilterDuallistOptions.selectedItems = $scope.manualSelectionSpatialFilterDuallistOptions.items.filter(item => kommonitorFilterHelperService.featureIsCurrentlySelected(item.id)); - $scope.manualSelectionSpatialFilterDuallistOptions.items = $scope.manualSelectionSpatialFilterDuallistOptions.items.filter(item => ! kommonitorFilterHelperService.featureIsCurrentlySelected(item.id)); - }; - - // $rootScope.$on("changeSpatialUnit", function() { - // if ($scope.showSelectionByFeatureSpatialFilter) - // $scope.updateSelectableAreas("byFeature"); - // if ($scope.showManualSelectionSpatialFilter) - // $scope.updateSelectableAreas("manual"); - // }); - - //TODO on indicator change - - }] - }); + .module('kommonitorFilter') + .component('kommonitorFilter', { + templateUrl: "components/kommonitorUserInterface/kommonitorControls/kommonitorFilter/kommonitor-filter.template.html", + /* + * injected with a modules service method that manages + * enabled tabs + */ + controller: ['$scope', '$rootScope', 'kommonitorMapService', 'kommonitorDataExchangeService', 'kommonitorFilterHelperService', + '__env', '$http', function kommonitorFilterController($scope, $rootScope, kommonitorMapService, kommonitorDataExchangeService, kommonitorFilterHelperService, __env, $http) { + const INDICATOR_DATE_PREFIX = __env.indicatorDatePrefix; + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorMapServiceInstance = kommonitorMapService; + this.kommonitorFilterHelperServiceInstance = kommonitorFilterHelperService; + var numberOfDecimals = __env.numberOfDecimals; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + $scope.considerAllowedSpatialUnitsOfCurrentIndicator = true; + $scope.loadingData = false; + $scope.rangeSliderForFilter; + $scope.valueRangeMinValue; + $scope.valueRangeMaxValue; + $scope.currentLowerFilterValue; + $scope.currentHigherFilterValue; + $scope.lowerFilterInputNotValid = false; + $scope.higherFilterInputNotValid = false; + $scope.indicatorMetadataAndGeoJSON; + //measureOfValue stuff + $scope.movMinValue; + $scope.movMaxValue; + $scope.movMiddleValue; + $scope.movStep; + $scope.movRangeSlider; + // SPATIAL FILTER STUFF + $scope.selectedSpatialUnitForFilter; + $scope.higherSpatialUnits = undefined; + $scope.higherSpatialUnitFilterFeatureGeoJSON; + $scope.reappliedFilter = false; + $scope.selectionByFeatureSpatialFilterDuallistOptions = { + title: { label: 'Gebiete', helpMessage: 'help' }, + selectOptions: { initialText: "Gebiete" }, + items: [], + button: { leftText: "Alle auswählen", rightText: "Alle entfernen" }, + selectedItems: [] + }; + $scope.manualSelectionSpatialFilterDuallistOptions = { + title: { label: 'Gebiete', helpMessage: 'help' }, + selectOptions: { initialText: "Gebiete" }, + items: [], + button: { leftText: "Alle auswählen", rightText: "Alle entfernen" }, + selectedItems: [] + }; + $scope.setupSpatialUnitFilter = function (indicatorMetadataAndGeoJSON, spatialUnitName, date) { + $scope.loadingData = true; + let allowedSpatialUnitIds = indicatorMetadataAndGeoJSON.applicableSpatialUnits.map(spatialUnitEntry => { + return spatialUnitEntry.spatialUnitId; + }); + $scope.higherSpatialUnits = JSON.parse(JSON.stringify(kommonitorDataExchangeService.availableSpatialUnits)); + // only show those spatial units that are actually visible according to keycloak role + // and associated to the current indicator as well + for (let index = 0; index < $scope.higherSpatialUnits.length; index++) { + const spatialUnitMetadata = $scope.higherSpatialUnits[index]; + // remove if it is not applicable for current indicator OR + // remove if it is the currently displayed spatial unit to show only hierarchically higher spatial units + if ($scope.considerAllowedSpatialUnitsOfCurrentIndicator && !allowedSpatialUnitIds.includes(spatialUnitMetadata.spatialUnitId)) { + // only remove the current element + // which represents a spatial unit that is + // not supported by the current indicator + $scope.higherSpatialUnits.splice(index, 1); + } + // since we query through a hierarchically sorted array of ALL spatial units + // we have to stop when we identify the currently displayed spatial unit + // in that case we have to remove that from the list of upper + if (spatialUnitName == spatialUnitMetadata.spatialUnitLevel) { + // remove current all all remaining elements from array + // (which are lower hierarchy spatial units) + $scope.higherSpatialUnits.splice(index); + break; + } + } + // $scope.higherSpatialUnits.splice(targetIndex); + $scope.selectedSpatialUnitForFilter = $scope.higherSpatialUnits[$scope.higherSpatialUnits.length - 1]; + $scope.loadingData = false; + }; + $scope.inputNotValid = false; + $scope.$on("onChangeSelectedIndicator", function (event) { + $scope.reappliedFilter = false; + }); + $scope.$on("indicatortMapDisplayFinished", function () { + // trigger the continous display of current filter + if (!$scope.reappliedFilter) { + $scope.reappliedFilter = true; + if ($scope.showSelectionByFeatureSpatialFilter) { + $scope.onSelectionByFeatureSpatialFilterSelectBtnPressed(); + } + if ($scope.showManualSelectionSpatialFilter) { + $scope.onManualSelectionBySelectedMapFeaturesBtnPressed(); + } + } + }); + $scope.$on("replaceIndicatorAsGeoJSON", function (event, indicatorMetadataAndGeoJSON, spatialUnitName, date, justRestyling, isCustomComputation) { + $scope.setupSpatialUnitFilter(indicatorMetadataAndGeoJSON, spatialUnitName, date); + if (!$scope.previouslySelectedIndicator) { + $scope.previouslySelectedIndicator = kommonitorDataExchangeService.selectedIndicator; + } + if (!$scope.previouslySelectedSpatialUnit) { + $scope.previouslySelectedSpatialUnit = kommonitorDataExchangeService.selectedSpatialUnit; + } + // if($scope.previouslySelectedIndicator.indicatorId != indicatorMetadataAndGeoJSON.indicatorId || $scope.previouslySelectedSpatialUnit.spatialUnitLevel != spatialUnitName){ + if ($scope.previouslySelectedSpatialUnit.spatialUnitLevel != spatialUnitName) { + // reset filter component + if ($scope.showSelectionByFeatureSpatialFilter) + $scope.updateSelectableAreas("byFeature"); + kommonitorFilterHelperService.clearFilteredFeatures(); + kommonitorFilterHelperService.clearSelectedFeatures(); + if ($scope.showManualSelectionSpatialFilter) + $scope.updateSelectableAreas("manual"); + kommonitorFilterHelperService.clearFilteredFeatures(); + kommonitorFilterHelperService.clearSelectedFeatures(); + } + $scope.previouslySelectedIndicator = kommonitorDataExchangeService.selectedIndicator; + $scope.previouslySelectedSpatialUnit = kommonitorDataExchangeService.selectedSpatialUnit; + }); + $scope.$on("updateIndicatorValueRangeFilter", function (event, date, indicatorMetadataAndGeoJSON) { + $scope.setupRangeSliderForFilter(date, indicatorMetadataAndGeoJSON); + }); + $scope.setupRangeSliderForFilter = function (date, indicatorMetadataAndGeoJSON) { + date = INDICATOR_DATE_PREFIX + date; + if ($scope.rangeSliderForFilter) { + kommonitorDataExchangeService.rangeFilterData = undefined; + $scope.rangeSliderForFilter.destroy(); + var domNode = document.getElementById("rangeSliderForFiltering"); + while (domNode.hasChildNodes()) { + domNode.removeChild(domNode.lastChild); + } + } + $scope.indicatorMetadataAndGeoJSON = indicatorMetadataAndGeoJSON; + var values = []; + $scope.indicatorMetadataAndGeoJSON.geoJSON.features.forEach(function (feature) { + // if (feature.properties[date] > movMaxValue) + // movMaxValue = feature.properties[date]; + // + // else if (feature.properties[date] < movMinValue) + // movMinValue = feature.properties[date]; + if (!kommonitorDataExchangeService.indicatorValueIsNoData(feature.properties[date])) { + values.push(feature.properties[date]); + } + }); + if (values.length === 0) { + console.warn("Filter range slider cannot be created, as there is no valid indicator value on the selected dataset for the selected date."); + return; + } + //sort ascending order + values.sort(function (a, b) { return a - b; }); + // initialize and fill in loop + $scope.valueRangeMinValue = values[0]; + $scope.valueRangeMaxValue = values[values.length - 1]; + $scope.valueRangeMinValue = kommonitorDataExchangeService.getIndicatorValue_asNumber($scope.valueRangeMinValue); + $scope.valueRangeMaxValue = kommonitorDataExchangeService.getIndicatorValue_asNumber($scope.valueRangeMaxValue); + $scope.currentLowerFilterValue = $scope.valueRangeMinValue; + $scope.currentHigherFilterValue = $scope.valueRangeMaxValue; + $("#rangeSliderForFiltering").ionRangeSlider({ + skin: "big", + type: "double", + min: $scope.valueRangeMinValue, + max: $scope.valueRangeMaxValue, + from: $scope.valueRangeMinValue, + to: $scope.valueRangeMaxValue, + force_edges: true, + step: 0.01, + grid: true, + prettify_enabled: true, + prettify_separator: "", + onChange: onChangeRangeFilter + }); + $scope.rangeSliderForFilter = $("#rangeSliderForFiltering").data("ionRangeSlider"); + // make sure that the handles are properly set to min and max values + $scope.rangeSliderForFilter.update({ + from: $scope.valueRangeMinValue, + to: $scope.valueRangeMaxValue + }); + }; + $scope.onChangeLowerFilterValue = function () { + if (($scope.currentLowerFilterValue >= $scope.valueRangeMinValue) && ($scope.currentLowerFilterValue <= $scope.valueRangeMaxValue) && ($scope.currentLowerFilterValue <= $scope.currentHigherFilterValue)) { + $scope.lowerFilterInputNotValid = false; + $scope.rangeSliderForFilter.update({ + from: $scope.currentLowerFilterValue, + to: $scope.currentHigherFilterValue + }); + $scope.applyRangeFilter(); + } + else { + $scope.lowerFilterInputNotValid = true; + } + }; + $scope.onChangeHigherFilterValue = function () { + if (($scope.currentHigherFilterValue <= $scope.valueRangeMaxValue) && ($scope.currentHigherFilterValue >= $scope.valueRangeMinValue) && ($scope.currentLowerFilterValue <= $scope.currentHigherFilterValue)) { + $scope.higherFilterInputNotValid = false; + $scope.rangeSliderForFilter.update({ + from: $scope.currentLowerFilterValue, + to: $scope.currentHigherFilterValue + }); + $scope.applyRangeFilter(); + } + else { + $scope.higherFilterInputNotValid = true; + } + }; + function onChangeRangeFilter(data) { + // Called every time handle position is changed + kommonitorDataExchangeService.rangeFilterData = data; + $scope.lowerFilterInputNotValid = false; + $scope.higherFilterInputNotValid = false; + $scope.currentLowerFilterValue = data.from; + $scope.currentHigherFilterValue = data.to; + $scope.applyRangeFilter(); + } + ; + $scope.applyRangeFilter = function () { + var dateProperty = INDICATOR_DATE_PREFIX + kommonitorDataExchangeService.selectedDate; + kommonitorFilterHelperService.applyRangeFilter($scope.indicatorMetadataAndGeoJSON.geoJSON.features, dateProperty, $scope.currentLowerFilterValue, $scope.currentHigherFilterValue); + $scope.$digest(); + }; + // MeasureOfValue stuff + $scope.inputNotValid = false; + this.onChangeUseMeasureOfValue = function () { + if (kommonitorDataExchangeService.isBalanceChecked) { + $rootScope.$broadcast("DisableBalance"); + $rootScope.$broadcast("updateIndicatorValueRangeFilter", kommonitorDataExchangeService.selectedDate, kommonitorDataExchangeService.selectedIndicator); + //replace displayed indicator on map + kommonitorFilterHelperService.filterAndReplaceDataset(); + // kommonitorMapService.replaceIndicatorGeoJSON(kommonitorDataExchangeService.selectedIndicator, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, kommonitorDataExchangeService.selectedDate, true); + } + else { + this.kommonitorMapServiceInstance.restyleCurrentLayer(); + } + }; + $scope.$on("updateMeasureOfValueBar", function (event, date, indicatorMetadataAndGeoJSON) { + $scope.updateMeasureOfValueBar(date, indicatorMetadataAndGeoJSON); + }); + $scope.updateMeasureOfValueBar = function (date, indicatorMetadataAndGeoJSON) { + //append date prefix to access correct property! + date = INDICATOR_DATE_PREFIX + date; + var geoJSON = indicatorMetadataAndGeoJSON.geoJSON; + // var measureOfValueInput = document.getElementById("measureOfValueInput"); + var values = []; + geoJSON.features.forEach(function (feature) { + // if (feature.properties[date] > movMaxValue) + // movMaxValue = feature.properties[date]; + // + // else if (feature.properties[date] < movMinValue) + // movMinValue = feature.properties[date]; + if (!kommonitorDataExchangeService.indicatorValueIsNoData(feature.properties[date])) { + values.push(feature.properties[date]); + } + }); + //sort ascending order + values.sort(function (a, b) { return a - b; }); + $scope.movMinValue = +Number(values[0]).toFixed(numberOfDecimals); + $scope.movMaxValue = +Number(values[values.length - 1]).toFixed(numberOfDecimals); + $scope.movMiddleValue = +(($scope.movMaxValue + $scope.movMinValue) / 2).toFixed(numberOfDecimals); + // $scope.movStep = +(($scope.movMaxValue - $scope.movMinValue)/35).toFixed(numberOfDecimals); + $scope.movStep = 0.01; + // measureOfValueInput.setAttribute("min", $scope.movMinValue); + // measureOfValueInput.setAttribute("max", $scope.movMaxValue); + // measureOfValueInput.setAttribute("movStep", $scope.movStep); + // measureOfValueInput.setAttribute("value", $scope.movMiddleValue); + kommonitorDataExchangeService.measureOfValue = $scope.movMiddleValue; + var measureOfValueTextInput = document.getElementById("measureOfValueTextInput"); + measureOfValueTextInput.setAttribute("min", $scope.movMinValue); + measureOfValueTextInput.setAttribute("max", $scope.movMaxValue); + measureOfValueTextInput.setAttribute("value", $scope.movMiddleValue); + measureOfValueTextInput.setAttribute("step", $scope.movStep); + if ($scope.movRangeSlider) { + $scope.movRangeSlider.destroy(); + var domNode = document.getElementById("measureOfValueInput"); + while (domNode.hasChildNodes()) { + domNode.removeChild(domNode.lastChild); + } + } + // rangeSLider + $("#measureOfValueInput").ionRangeSlider({ + skin: "big", + type: "single", + min: $scope.movMinValue, + max: $scope.movMaxValue, + from: $scope.movMiddleValue, + force_edges: true, + step: 0.01, + grid: true, + prettify_enabled: true, + prettify_separator: "", + onChange: $scope.onMeasureOfValueChange + }); + $scope.movRangeSlider = $("#measureOfValueInput").data("ionRangeSlider"); + // make sure that the handles are properly set to min and max values + $scope.movRangeSlider.update({ + from: $scope.movMiddleValue + }); + $scope.inputNotValid = false; + }; + $scope.onMeasureOfValueChange = function (data) { + kommonitorDataExchangeService.measureOfValue = +Number(data.from).toFixed(numberOfDecimals); + // kommonitorDataExchangeService.measureOfValue = +Number(kommonitorDataExchangeService.measureOfValue).toFixed(numberOfDecimals); + if (kommonitorDataExchangeService.measureOfValue >= $scope.movMinValue && kommonitorDataExchangeService.measureOfValue <= $scope.movMaxValue) { + $scope.inputNotValid = false; + kommonitorMapService.restyleCurrentLayer(); + } + else { + $scope.inputNotValid = true; + } + }; + $scope.onMeasureOfValueChangeByText = function () { + kommonitorDataExchangeService.measureOfValue = +Number(kommonitorDataExchangeService.measureOfValue).toFixed(numberOfDecimals); + // kommonitorDataExchangeService.measureOfValue = +Number(kommonitorDataExchangeService.measureOfValue).toFixed(numberOfDecimals); + if (kommonitorDataExchangeService.measureOfValue >= $scope.movMinValue && kommonitorDataExchangeService.measureOfValue <= $scope.movMaxValue) { + $scope.inputNotValid = false; + $scope.movRangeSlider.update({ + from: kommonitorDataExchangeService.measureOfValue + }); + kommonitorMapService.restyleCurrentLayer(); + } + else { + $scope.inputNotValid = true; + } + }; + $scope.updateSelectableAreas = async function (selectionType) { + $scope.loadingData = true; + //send request to datamanagement API + let selectedSpatialUnit = kommonitorDataExchangeService.selectedSpatialUnit; + let selectedSpatialUnitId = selectedSpatialUnit.spatialUnitId; + let upperSpatialUnitId = undefined; + // spatial filter not applicable since no upper spatial unit is available or selected + if (!$scope.selectedSpatialUnitForFilter) { + $scope.loadingData = false; + return; + } + if (selectionType === "byFeature" && $scope.selectedSpatialUnitForFilter) { + upperSpatialUnitId = $scope.selectedSpatialUnitForFilter.spatialUnitId; + } + let selectedIndicatorId = kommonitorDataExchangeService.selectedIndicator.indicatorId; + // example: 2020-12-31 + let selectedDateComponents = kommonitorDataExchangeService.selectedDate.split("-"); + //build request + let datePath = ""; + if (selectedDateComponents && selectedDateComponents.length && selectedDateComponents.length == 3) { + datePath = selectedDateComponents[0] + "/" + selectedDateComponents[1] + "/" + selectedDateComponents[2]; + } + else { + // fallback option, if no valid date could be used + datePath = "allFeatures"; + } + let url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + + "/spatial-units/" + selectedSpatialUnitId + "/" + datePath; + if (selectionType === "byFeature" && upperSpatialUnitId) + url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + + "/spatial-units/" + upperSpatialUnitId + "/" + datePath; + //send request + console.log(url); + await $http({ + url: url, + method: "GET" + }).then(function successCallback(response) { + let areaNames = []; + $(response.data.features).each((id, obj) => { + areaNames.push({ name: obj.properties[__env.FEATURE_NAME_PROPERTY_NAME], id: obj.properties[__env.FEATURE_ID_PROPERTY_NAME] }); + }); + if (selectionType === "manual") { + $scope.manualSelectionSpatialFilterDuallistOptions.selectedItems = []; + let dataArray = kommonitorDataExchangeService.createDualListInputArray(areaNames, "name", "id"); + $scope.manualSelectionSpatialFilterDuallistOptions.items = dataArray; + } + if (selectionType === "byFeature") { + $scope.higherSpatialUnitFilterFeatureGeoJSON = response.data; + $scope.selectionByFeatureSpatialFilterDuallistOptions.selectedItems = []; + let dataArray = kommonitorDataExchangeService.createDualListInputArray(areaNames, "name", "id"); + $scope.selectionByFeatureSpatialFilterDuallistOptions.items = dataArray; + } + $scope.loadingData = false; + $scope.$digest(); + }); + }; + $scope.onChangeShowManualSelection = async function () { + // return if toggle was deactivated + if (!$scope.showManualSelectionSpatialFilter) + $scope.onManualSelectionSpatialFilterResetBtnPressed(); + else { + $scope.showSelectionByFeatureSpatialFilter = false; + $scope.onManualSelectionSpatialFilterResetBtnPressed(); + } + }; + $scope.onChangeShowSelectionByFeature = async function () { + // return if toggle was deactivated + if (!$scope.showSelectionByFeatureSpatialFilter) + $scope.onSelectionByFeatureSpatialFilterResetBtnPressed(); + else { + $scope.showManualSelectionSpatialFilter = false; + $scope.onSelectionByFeatureSpatialFilterResetBtnPressed(); + } + }; + $scope.onChangeSelectedSpatialUnitForFilter = function () { + if ($scope.showSelectionByFeatureSpatialFilter) + $scope.updateSelectableAreas("byFeature"); + if ($scope.showManualSelectionSpatialFilter) { + $scope.updateSelectableAreas("manual"); + } + }; + $scope.onSelectionByFeatureSpatialFilterSelectBtnPressed = function () { + if ($scope.selectionByFeatureSpatialFilterDuallistOptions.selectedItems && $scope.selectionByFeatureSpatialFilterDuallistOptions.selectedItems.length > 0) { + // objects like {category: category, name:name} + //$scope.selectionByFeatureSpatialFilterDuallistOptions.selectedItems + let targetFeatureNames = $scope.selectionByFeatureSpatialFilterDuallistOptions.selectedItems.map(object => object.name); + kommonitorFilterHelperService.applySpatialFilter_higherSpatialUnitFeatures($scope.higherSpatialUnitFilterFeatureGeoJSON, targetFeatureNames); + } + }; + $scope.onSelectionByFeatureSpatialFilterResetBtnPressed = function () { + $scope.updateSelectableAreas("byFeature"); + kommonitorFilterHelperService.clearFilteredFeatures(); + kommonitorFilterHelperService.filterAndReplaceDataset(); + if (document.getElementById('controlNoDataDisplay').checked) + $rootScope.$broadcast('applyNoDataDisplay'); + }; + $scope.onManualSelectionSpatialFilterSelectBtnPressed = function () { + if ($scope.manualSelectionSpatialFilterDuallistOptions.selectedItems && $scope.manualSelectionSpatialFilterDuallistOptions.selectedItems.length > 0) { + // objects like {category: category, name:name} + //$scope.manualSelectionSpatialFilterDuallistOptions.selectedItems + let targetFeatureNames = $scope.manualSelectionSpatialFilterDuallistOptions.selectedItems.map(object => object.name); + kommonitorFilterHelperService.applySpatialFilter_currentSpatialUnitFeatures(targetFeatureNames); + } + }; + $scope.onManualSelectionSpatialFilterResetBtnPressed = function () { + $scope.updateSelectableAreas("manual"); + kommonitorFilterHelperService.clearFilteredFeatures(); + kommonitorFilterHelperService.filterAndReplaceDataset(); + if (document.getElementById('controlNoDataDisplay').checked) + $rootScope.$broadcast('applyNoDataDisplay'); + }; + $scope.onManualSelectionBySelectedMapFeaturesBtnPressed = function () { + // manage duallist items display + $scope.manageManualDualList_fromMapSelection(); + // apply spatial filter from selected map features + $scope.onManualSelectionSpatialFilterSelectBtnPressed(); + }; + $scope.manageManualDualList_fromMapSelection = function () { + $scope.manualSelectionSpatialFilterDuallistOptions.items = $scope.manualSelectionSpatialFilterDuallistOptions.items.concat($scope.manualSelectionSpatialFilterDuallistOptions.selectedItems); + $scope.manualSelectionSpatialFilterDuallistOptions.selectedItems = []; + $scope.manualSelectionSpatialFilterDuallistOptions.selectedItems = $scope.manualSelectionSpatialFilterDuallistOptions.items.filter(item => kommonitorFilterHelperService.featureIsCurrentlySelected(item.id)); + $scope.manualSelectionSpatialFilterDuallistOptions.items = $scope.manualSelectionSpatialFilterDuallistOptions.items.filter(item => !kommonitorFilterHelperService.featureIsCurrentlySelected(item.id)); + }; + // $rootScope.$on("changeSpatialUnit", function() { + // if ($scope.showSelectionByFeatureSpatialFilter) + // $scope.updateSelectableAreas("byFeature"); + // if ($scope.showManualSelectionSpatialFilter) + // $scope.updateSelectableAreas("manual"); + // }); + //TODO on indicator change + }] +}); +//# sourceMappingURL=kommonitor-filter.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorFilter/kommonitor-filter.component.js.map b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorFilter/kommonitor-filter.component.js.map new file mode 100644 index 000000000..6937ed42d --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorFilter/kommonitor-filter.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-filter.component.js","sourceRoot":"","sources":["kommonitor-filter.component.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MAAM,CAAC,MAAM,CAAC,2CAA2C,CAAC,aAAa,CAAC,CAAC;gBAC7L,MAAM,CAAC,2CAA2C,CAAC,aAAa,GAAG,EAAE,CAAC;gBAEtE,MAAM,CAAC,2CAA2C,CAAC,aAAa,GAAG,MAAM,CAAC,2CAA2C,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,6BAA6B,CAAC,0BAA0B,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;gBAC9M,MAAM,CAAC,2CAA2C,CAAC,KAAK,GAAG,MAAM,CAAC,2CAA2C,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAE,6BAA6B,CAAC,0BAA0B,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;YACzM,CAAC,CAAC;YAEF,mDAAmD;YACnD,mDAAmD;YACnD,+CAA+C;YAC/C,gDAAgD;YAChD,4CAA4C;YAC5C,MAAM;YAEN,0BAA0B;QAE5B,CAAC,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorFilter/kommonitor-filter.component.ts b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorFilter/kommonitor-filter.component.ts new file mode 100644 index 000000000..39a8ea4fb --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorFilter/kommonitor-filter.component.ts @@ -0,0 +1,580 @@ +angular + .module('kommonitorFilter') + .component( + 'kommonitorFilter', + { + templateUrl : "components/kommonitorUserInterface/kommonitorControls/kommonitorFilter/kommonitor-filter.template.html", + /* + * injected with a modules service method that manages + * enabled tabs + */ + controller : ['$scope', '$rootScope', 'kommonitorMapService', 'kommonitorDataExchangeService', 'kommonitorFilterHelperService', + '__env', '$http', function kommonitorFilterController($scope, $rootScope, kommonitorMapService, kommonitorDataExchangeService, + kommonitorFilterHelperService, __env, $http) { + + const INDICATOR_DATE_PREFIX = __env.indicatorDatePrefix; + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorMapServiceInstance = kommonitorMapService; + this.kommonitorFilterHelperServiceInstance = kommonitorFilterHelperService; + var numberOfDecimals = __env.numberOfDecimals; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + $scope.considerAllowedSpatialUnitsOfCurrentIndicator = true; + $scope.loadingData = false; + + $scope.rangeSliderForFilter; + $scope.valueRangeMinValue; + $scope.valueRangeMaxValue; + $scope.currentLowerFilterValue; + $scope.currentHigherFilterValue; + $scope.lowerFilterInputNotValid = false; + $scope.higherFilterInputNotValid = false; + $scope.indicatorMetadataAndGeoJSON; + + //measureOfValue stuff + $scope.movMinValue; + $scope.movMaxValue; + $scope.movMiddleValue; + $scope.movStep; + $scope.movRangeSlider; + + // SPATIAL FILTER STUFF + $scope.selectedSpatialUnitForFilter; + $scope.higherSpatialUnits = undefined; + $scope.higherSpatialUnitFilterFeatureGeoJSON; + $scope.reappliedFilter = false; + + $scope.selectionByFeatureSpatialFilterDuallistOptions = { + title: {label: 'Gebiete', helpMessage: 'help'}, + selectOptions: {initialText: "Gebiete"}, + items: [], + button: {leftText: "Alle auswählen" , rightText: "Alle entfernen"}, + selectedItems: [] + }; + + $scope.manualSelectionSpatialFilterDuallistOptions = { + title: {label: 'Gebiete', helpMessage: 'help'}, + selectOptions: {initialText: "Gebiete"}, + items: [], + button: {leftText: "Alle auswählen" , rightText: "Alle entfernen"}, + selectedItems: [] + }; + + + $scope.setupSpatialUnitFilter = function(indicatorMetadataAndGeoJSON, spatialUnitName, date){ + + $scope.loadingData = true; + + let allowedSpatialUnitIds = indicatorMetadataAndGeoJSON.applicableSpatialUnits.map(spatialUnitEntry => { + return spatialUnitEntry.spatialUnitId; + }); + + $scope.higherSpatialUnits = JSON.parse(JSON.stringify(kommonitorDataExchangeService.availableSpatialUnits)); + + // only show those spatial units that are actually visible according to keycloak role + // and associated to the current indicator as well + for (let index = 0; index < $scope.higherSpatialUnits.length; index++) { + const spatialUnitMetadata = $scope.higherSpatialUnits[index]; + + // remove if it is not applicable for current indicator OR + // remove if it is the currently displayed spatial unit to show only hierarchically higher spatial units + if($scope.considerAllowedSpatialUnitsOfCurrentIndicator && ! allowedSpatialUnitIds.includes(spatialUnitMetadata.spatialUnitId)){ + + // only remove the current element + // which represents a spatial unit that is + // not supported by the current indicator + $scope.higherSpatialUnits.splice(index, 1); + } + + // since we query through a hierarchically sorted array of ALL spatial units + // we have to stop when we identify the currently displayed spatial unit + // in that case we have to remove that from the list of upper + if (spatialUnitName == spatialUnitMetadata.spatialUnitLevel){ + // remove current all all remaining elements from array + // (which are lower hierarchy spatial units) + $scope.higherSpatialUnits.splice(index); + break; + } + } + + // $scope.higherSpatialUnits.splice(targetIndex); + $scope.selectedSpatialUnitForFilter = $scope.higherSpatialUnits[$scope.higherSpatialUnits.length - 1]; + + $scope.loadingData = false; + }; + + $scope.inputNotValid = false; + + $scope.$on("onChangeSelectedIndicator", function(event){ + $scope.reappliedFilter = false; + }); + + $scope.$on("indicatortMapDisplayFinished", function(){ + // trigger the continous display of current filter + if(! $scope.reappliedFilter){ + $scope.reappliedFilter = true; + if ($scope.showSelectionByFeatureSpatialFilter){ + $scope.onSelectionByFeatureSpatialFilterSelectBtnPressed(); + } + if ($scope.showManualSelectionSpatialFilter){ + $scope.onManualSelectionBySelectedMapFeaturesBtnPressed(); + } + } + }); + + $scope.$on("replaceIndicatorAsGeoJSON", function (event, indicatorMetadataAndGeoJSON, spatialUnitName, date, justRestyling, isCustomComputation) { + + $scope.setupSpatialUnitFilter(indicatorMetadataAndGeoJSON, spatialUnitName, date); + + if(! $scope.previouslySelectedIndicator){ + $scope.previouslySelectedIndicator = kommonitorDataExchangeService.selectedIndicator; + } + if(! $scope.previouslySelectedSpatialUnit){ + $scope.previouslySelectedSpatialUnit = kommonitorDataExchangeService.selectedSpatialUnit; + } + + // if($scope.previouslySelectedIndicator.indicatorId != indicatorMetadataAndGeoJSON.indicatorId || $scope.previouslySelectedSpatialUnit.spatialUnitLevel != spatialUnitName){ + if($scope.previouslySelectedSpatialUnit.spatialUnitLevel != spatialUnitName){ + // reset filter component + if ($scope.showSelectionByFeatureSpatialFilter) + $scope.updateSelectableAreas("byFeature"); + kommonitorFilterHelperService.clearFilteredFeatures(); + kommonitorFilterHelperService.clearSelectedFeatures(); + if ($scope.showManualSelectionSpatialFilter) + $scope.updateSelectableAreas("manual"); + kommonitorFilterHelperService.clearFilteredFeatures(); + kommonitorFilterHelperService.clearSelectedFeatures(); + } + + $scope.previouslySelectedIndicator = kommonitorDataExchangeService.selectedIndicator; + $scope.previouslySelectedSpatialUnit = kommonitorDataExchangeService.selectedSpatialUnit; + + }); + + $scope.$on("updateIndicatorValueRangeFilter", function (event, date, indicatorMetadataAndGeoJSON) { + + $scope.setupRangeSliderForFilter(date, indicatorMetadataAndGeoJSON); + + }); + + $scope.setupRangeSliderForFilter = function(date, indicatorMetadataAndGeoJSON){ + date = INDICATOR_DATE_PREFIX + date; + + if($scope.rangeSliderForFilter){ + kommonitorDataExchangeService.rangeFilterData = undefined; + $scope.rangeSliderForFilter.destroy(); + + var domNode = document.getElementById("rangeSliderForFiltering"); + + while (domNode.hasChildNodes()) { + domNode.removeChild(domNode.lastChild); + } + } + + $scope.indicatorMetadataAndGeoJSON = indicatorMetadataAndGeoJSON; + + var values = []; + + $scope.indicatorMetadataAndGeoJSON.geoJSON.features.forEach(function(feature){ + // if (feature.properties[date] > movMaxValue) + // movMaxValue = feature.properties[date]; + // + // else if (feature.properties[date] < movMinValue) + // movMinValue = feature.properties[date]; + + if(! kommonitorDataExchangeService.indicatorValueIsNoData(feature.properties[date])){ + values.push(feature.properties[date]); + } + }); + + if(values.length === 0){ + console.warn("Filter range slider cannot be created, as there is no valid indicator value on the selected dataset for the selected date."); + return ; + } + + //sort ascending order + values.sort(function(a, b){return a-b}); + + // initialize and fill in loop + $scope.valueRangeMinValue = values[0]; + $scope.valueRangeMaxValue = values[values.length - 1]; + + $scope.valueRangeMinValue = kommonitorDataExchangeService.getIndicatorValue_asNumber($scope.valueRangeMinValue); + $scope.valueRangeMaxValue = kommonitorDataExchangeService.getIndicatorValue_asNumber($scope.valueRangeMaxValue); + + $scope.currentLowerFilterValue = $scope.valueRangeMinValue; + $scope.currentHigherFilterValue = $scope.valueRangeMaxValue; + + $("#rangeSliderForFiltering").ionRangeSlider({ + skin: "big", + type: "double", + min: $scope.valueRangeMinValue, + max: $scope.valueRangeMaxValue, + from: $scope.valueRangeMinValue, + to: $scope.valueRangeMaxValue, + force_edges: true, + step: 0.01, + grid: true, + prettify_enabled: true, + prettify_separator: "", + onChange: onChangeRangeFilter + }); + + $scope.rangeSliderForFilter = $("#rangeSliderForFiltering").data("ionRangeSlider"); + // make sure that the handles are properly set to min and max values + $scope.rangeSliderForFilter.update({ + from: $scope.valueRangeMinValue, + to: $scope.valueRangeMaxValue + }); + + }; + + $scope.onChangeLowerFilterValue = function(){ + if(($scope.currentLowerFilterValue >= $scope.valueRangeMinValue) && ($scope.currentLowerFilterValue <= $scope.valueRangeMaxValue) && ($scope.currentLowerFilterValue <= $scope.currentHigherFilterValue)){ + $scope.lowerFilterInputNotValid = false; + $scope.rangeSliderForFilter.update({ + from: $scope.currentLowerFilterValue, + to: $scope.currentHigherFilterValue + }); + + $scope.applyRangeFilter(); + } + else{ + $scope.lowerFilterInputNotValid = true; + } + }; + + $scope.onChangeHigherFilterValue = function(){ + if(($scope.currentHigherFilterValue <= $scope.valueRangeMaxValue) && ($scope.currentHigherFilterValue >= $scope.valueRangeMinValue) && ($scope.currentLowerFilterValue <= $scope.currentHigherFilterValue)){ + $scope.higherFilterInputNotValid = false; + $scope.rangeSliderForFilter.update({ + from: $scope.currentLowerFilterValue, + to: $scope.currentHigherFilterValue + }); + + $scope.applyRangeFilter(); + } + else{ + $scope.higherFilterInputNotValid = true; + } + }; + + function onChangeRangeFilter (data) { + // Called every time handle position is changed + kommonitorDataExchangeService.rangeFilterData = data; + + $scope.lowerFilterInputNotValid = false; + $scope.higherFilterInputNotValid = false; + + $scope.currentLowerFilterValue = data.from; + $scope.currentHigherFilterValue = data.to; + + $scope.applyRangeFilter(); + }; + + $scope.applyRangeFilter = function(){ + + var dateProperty = INDICATOR_DATE_PREFIX + kommonitorDataExchangeService.selectedDate; + + kommonitorFilterHelperService.applyRangeFilter($scope.indicatorMetadataAndGeoJSON.geoJSON.features, dateProperty, $scope.currentLowerFilterValue, $scope.currentHigherFilterValue); + + $scope.$digest(); + } + + + // MeasureOfValue stuff + $scope.inputNotValid = false; + + + this.onChangeUseMeasureOfValue = function(){ + if(kommonitorDataExchangeService.isBalanceChecked){ + $rootScope.$broadcast("DisableBalance"); + $rootScope.$broadcast("updateIndicatorValueRangeFilter", kommonitorDataExchangeService.selectedDate, kommonitorDataExchangeService.selectedIndicator); + //replace displayed indicator on map + kommonitorFilterHelperService.filterAndReplaceDataset(); + // kommonitorMapService.replaceIndicatorGeoJSON(kommonitorDataExchangeService.selectedIndicator, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, kommonitorDataExchangeService.selectedDate, true); + } + else{ + this.kommonitorMapServiceInstance.restyleCurrentLayer(); + } + + }; + + $scope.$on("updateMeasureOfValueBar", function (event, date, indicatorMetadataAndGeoJSON) { + + $scope.updateMeasureOfValueBar(date, indicatorMetadataAndGeoJSON); + + }); + + $scope.updateMeasureOfValueBar = function(date, indicatorMetadataAndGeoJSON){ + + //append date prefix to access correct property! + date = INDICATOR_DATE_PREFIX + date; + var geoJSON = indicatorMetadataAndGeoJSON.geoJSON; + + // var measureOfValueInput = document.getElementById("measureOfValueInput"); + + var values = []; + + geoJSON.features.forEach(function(feature){ + // if (feature.properties[date] > movMaxValue) + // movMaxValue = feature.properties[date]; + // + // else if (feature.properties[date] < movMinValue) + // movMinValue = feature.properties[date]; + + if(! kommonitorDataExchangeService.indicatorValueIsNoData(feature.properties[date])){ + values.push(feature.properties[date]); + } + }); + + //sort ascending order + values.sort(function(a, b){return a-b}); + + $scope.movMinValue = +Number(values[0]).toFixed(numberOfDecimals); + $scope.movMaxValue = +Number(values[values.length - 1]).toFixed(numberOfDecimals); + + $scope.movMiddleValue = +(($scope.movMaxValue + $scope.movMinValue) / 2).toFixed(numberOfDecimals); + // $scope.movStep = +(($scope.movMaxValue - $scope.movMinValue)/35).toFixed(numberOfDecimals); + $scope.movStep = 0.01; + + // measureOfValueInput.setAttribute("min", $scope.movMinValue); + // measureOfValueInput.setAttribute("max", $scope.movMaxValue); + // measureOfValueInput.setAttribute("movStep", $scope.movStep); + // measureOfValueInput.setAttribute("value", $scope.movMiddleValue); + + kommonitorDataExchangeService.measureOfValue = $scope.movMiddleValue; + + var measureOfValueTextInput = document.getElementById("measureOfValueTextInput"); + measureOfValueTextInput.setAttribute("min", $scope.movMinValue); + measureOfValueTextInput.setAttribute("max", $scope.movMaxValue); + measureOfValueTextInput.setAttribute("value", $scope.movMiddleValue); + measureOfValueTextInput.setAttribute("step", $scope.movStep); + + if($scope.movRangeSlider){ + $scope.movRangeSlider.destroy(); + + var domNode = document.getElementById("measureOfValueInput"); + + while (domNode.hasChildNodes()) { + domNode.removeChild(domNode.lastChild); + } + } + + // rangeSLider + $("#measureOfValueInput").ionRangeSlider({ + skin: "big", + type: "single", + min: $scope.movMinValue, + max: $scope.movMaxValue, + from: $scope.movMiddleValue, + force_edges: true, + step: 0.01, + grid: true, + prettify_enabled: true, + prettify_separator: "", + onChange: $scope.onMeasureOfValueChange + }); + + $scope.movRangeSlider = $("#measureOfValueInput").data("ionRangeSlider"); + // make sure that the handles are properly set to min and max values + $scope.movRangeSlider.update({ + from: $scope.movMiddleValue + }); + + $scope.inputNotValid = false; + + }; + + $scope.onMeasureOfValueChange = function(data){ + + kommonitorDataExchangeService.measureOfValue = +Number(data.from).toFixed(numberOfDecimals); + + // kommonitorDataExchangeService.measureOfValue = +Number(kommonitorDataExchangeService.measureOfValue).toFixed(numberOfDecimals); + + if(kommonitorDataExchangeService.measureOfValue >= $scope.movMinValue && kommonitorDataExchangeService.measureOfValue <= $scope.movMaxValue){ + $scope.inputNotValid = false; + kommonitorMapService.restyleCurrentLayer(); + } + else{ + $scope.inputNotValid = true; + } + + }; + + $scope.onMeasureOfValueChangeByText = function(){ + + kommonitorDataExchangeService.measureOfValue = +Number(kommonitorDataExchangeService.measureOfValue).toFixed(numberOfDecimals); + + // kommonitorDataExchangeService.measureOfValue = +Number(kommonitorDataExchangeService.measureOfValue).toFixed(numberOfDecimals); + + if(kommonitorDataExchangeService.measureOfValue >= $scope.movMinValue && kommonitorDataExchangeService.measureOfValue <= $scope.movMaxValue){ + $scope.inputNotValid = false; + $scope.movRangeSlider.update({ + from: kommonitorDataExchangeService.measureOfValue + }); + kommonitorMapService.restyleCurrentLayer(); + } + else{ + $scope.inputNotValid = true; + } + + }; + + $scope.updateSelectableAreas = async function(selectionType) { + $scope.loadingData = true; + //send request to datamanagement API + let selectedSpatialUnit = kommonitorDataExchangeService.selectedSpatialUnit; + let selectedSpatialUnitId = selectedSpatialUnit.spatialUnitId; + let upperSpatialUnitId = undefined; + + // spatial filter not applicable since no upper spatial unit is available or selected + if(! $scope.selectedSpatialUnitForFilter){ + $scope.loadingData = false; + return; + } + + if (selectionType === "byFeature" && $scope.selectedSpatialUnitForFilter) { + upperSpatialUnitId = $scope.selectedSpatialUnitForFilter.spatialUnitId; + } + let selectedIndicatorId = kommonitorDataExchangeService.selectedIndicator.indicatorId; + + // example: 2020-12-31 + let selectedDateComponents = kommonitorDataExchangeService.selectedDate.split("-"); + + //build request + let datePath = ""; + if(selectedDateComponents && selectedDateComponents.length && selectedDateComponents.length == 3){ + datePath = selectedDateComponents[0] + "/" + selectedDateComponents[1] + "/" + selectedDateComponents[2]; + } + else{ + // fallback option, if no valid date could be used + datePath = "allFeatures"; + } + let url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + + "/spatial-units/" + selectedSpatialUnitId + "/" + datePath; + + if (selectionType === "byFeature" && upperSpatialUnitId) + url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + + "/spatial-units/" + upperSpatialUnitId + "/" + datePath; + //send request + console.log(url); + await $http({ + url: url, + method: "GET" + }).then(function successCallback(response) { //TODO add error callback for the case that the combination of indicator and nextUpperHierarchyLevel doesn't exist + let areaNames = []; + $(response.data.features).each( (id, obj) => { + areaNames.push({name: obj.properties[__env.FEATURE_NAME_PROPERTY_NAME], id: obj.properties[__env.FEATURE_ID_PROPERTY_NAME]}); + }); + if (selectionType === "manual") { + $scope.manualSelectionSpatialFilterDuallistOptions.selectedItems = []; + let dataArray = kommonitorDataExchangeService.createDualListInputArray(areaNames, "name", "id"); + $scope.manualSelectionSpatialFilterDuallistOptions.items = dataArray; + } + if (selectionType === "byFeature") { + $scope.higherSpatialUnitFilterFeatureGeoJSON = response.data; + $scope.selectionByFeatureSpatialFilterDuallistOptions.selectedItems = []; + let dataArray = kommonitorDataExchangeService.createDualListInputArray(areaNames, "name", "id"); + $scope.selectionByFeatureSpatialFilterDuallistOptions.items = dataArray; + } + $scope.loadingData = false; + $scope.$digest(); + }); + }; + + $scope.onChangeShowManualSelection = async function() { + // return if toggle was deactivated + if(!$scope.showManualSelectionSpatialFilter) + $scope.onManualSelectionSpatialFilterResetBtnPressed(); + else { + $scope.showSelectionByFeatureSpatialFilter = false; + $scope.onManualSelectionSpatialFilterResetBtnPressed(); + } + }; + + $scope.onChangeShowSelectionByFeature = async function() { + // return if toggle was deactivated + if(!$scope.showSelectionByFeatureSpatialFilter) + $scope.onSelectionByFeatureSpatialFilterResetBtnPressed(); + else { + $scope.showManualSelectionSpatialFilter = false; + $scope.onSelectionByFeatureSpatialFilterResetBtnPressed(); + } + }; + + $scope.onChangeSelectedSpatialUnitForFilter = function(){ + if ($scope.showSelectionByFeatureSpatialFilter) + $scope.updateSelectableAreas("byFeature"); + + if($scope.showManualSelectionSpatialFilter){ + $scope.updateSelectableAreas("manual"); + } + }; + + $scope.onSelectionByFeatureSpatialFilterSelectBtnPressed = function(){ + if($scope.selectionByFeatureSpatialFilterDuallistOptions.selectedItems && $scope.selectionByFeatureSpatialFilterDuallistOptions.selectedItems.length > 0){ + // objects like {category: category, name:name} + //$scope.selectionByFeatureSpatialFilterDuallistOptions.selectedItems + let targetFeatureNames = $scope.selectionByFeatureSpatialFilterDuallistOptions.selectedItems.map(object => object.name); + + kommonitorFilterHelperService.applySpatialFilter_higherSpatialUnitFeatures($scope.higherSpatialUnitFilterFeatureGeoJSON, targetFeatureNames); + } + }; + + $scope.onSelectionByFeatureSpatialFilterResetBtnPressed = function(){ + $scope.updateSelectableAreas("byFeature"); + + kommonitorFilterHelperService.clearFilteredFeatures(); + kommonitorFilterHelperService.filterAndReplaceDataset(); + if(document.getElementById('controlNoDataDisplay').checked) + $rootScope.$broadcast('applyNoDataDisplay') + }; + + $scope.onManualSelectionSpatialFilterSelectBtnPressed = function(){ + if($scope.manualSelectionSpatialFilterDuallistOptions.selectedItems && $scope.manualSelectionSpatialFilterDuallistOptions.selectedItems.length > 0){ + // objects like {category: category, name:name} + //$scope.manualSelectionSpatialFilterDuallistOptions.selectedItems + let targetFeatureNames = $scope.manualSelectionSpatialFilterDuallistOptions.selectedItems.map(object => object.name); + + kommonitorFilterHelperService.applySpatialFilter_currentSpatialUnitFeatures(targetFeatureNames); + } + }; + + $scope.onManualSelectionSpatialFilterResetBtnPressed = function(){ + $scope.updateSelectableAreas("manual"); + + kommonitorFilterHelperService.clearFilteredFeatures(); + kommonitorFilterHelperService.filterAndReplaceDataset(); + if(document.getElementById('controlNoDataDisplay').checked) + $rootScope.$broadcast('applyNoDataDisplay') + }; + + $scope.onManualSelectionBySelectedMapFeaturesBtnPressed = function(){ + // manage duallist items display + $scope.manageManualDualList_fromMapSelection(); + + // apply spatial filter from selected map features + $scope.onManualSelectionSpatialFilterSelectBtnPressed(); + }; + + $scope.manageManualDualList_fromMapSelection = function(){ + $scope.manualSelectionSpatialFilterDuallistOptions.items = $scope.manualSelectionSpatialFilterDuallistOptions.items.concat($scope.manualSelectionSpatialFilterDuallistOptions.selectedItems); + $scope.manualSelectionSpatialFilterDuallistOptions.selectedItems = []; + + $scope.manualSelectionSpatialFilterDuallistOptions.selectedItems = $scope.manualSelectionSpatialFilterDuallistOptions.items.filter(item => kommonitorFilterHelperService.featureIsCurrentlySelected(item.id)); + $scope.manualSelectionSpatialFilterDuallistOptions.items = $scope.manualSelectionSpatialFilterDuallistOptions.items.filter(item => ! kommonitorFilterHelperService.featureIsCurrentlySelected(item.id)); + }; + + // $rootScope.$on("changeSpatialUnit", function() { + // if ($scope.showSelectionByFeatureSpatialFilter) + // $scope.updateSelectableAreas("byFeature"); + // if ($scope.showManualSelectionSpatialFilter) + // $scope.updateSelectableAreas("manual"); + // }); + + //TODO on indicator change + + }] + }); diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorFilter/kommonitor-filter.module.js b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorFilter/kommonitor-filter.module.js index 61070bda9..0745e2a58 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorFilter/kommonitor-filter.module.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorFilter/kommonitor-filter.module.js @@ -1,15 +1,16 @@ +"use strict"; angular.module('kommonitorFilter', ['kommonitorDataExchange', 'kommonitorMap', 'kommonitorFilterHelper']) - -.directive('stringToNumber', function() { - return { - require: 'ngModel', - link: function(scope, element, attrs, ngModel) { - ngModel.$parsers.push(function(value) { - return '' + value; - }); - ngModel.$formatters.push(function(value) { - return parseFloat(value); - }); - } - }; + .directive('stringToNumber', function () { + return { + require: 'ngModel', + link: function (scope, element, attrs, ngModel) { + ngModel.$parsers.push(function (value) { + return '' + value; + }); + ngModel.$formatters.push(function (value) { + return parseFloat(value); + }); + } + }; }); +//# sourceMappingURL=kommonitor-filter.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorFilter/kommonitor-filter.module.js.map b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorFilter/kommonitor-filter.module.js.map new file mode 100644 index 000000000..69f5a6447 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorFilter/kommonitor-filter.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-filter.module.js","sourceRoot":"","sources":["kommonitor-filter.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,CAAC,wBAAwB,EAAE,eAAe,EAAE,wBAAwB,CAAC,CAAC;KAExG,SAAS,CAAC,gBAAgB,EAAE;IAC3B,OAAO;QACL,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,UAAS,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO;YAC3C,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAS,KAAK;gBAClC,OAAO,EAAE,GAAG,KAAK,CAAC;YACpB,CAAC,CAAC,CAAC;YACH,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,UAAS,KAAK;gBACrC,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC;YAC3B,CAAC,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorFilter/kommonitor-filter.module.ts b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorFilter/kommonitor-filter.module.ts new file mode 100644 index 000000000..61070bda9 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorFilter/kommonitor-filter.module.ts @@ -0,0 +1,15 @@ +angular.module('kommonitorFilter', ['kommonitorDataExchange', 'kommonitorMap', 'kommonitorFilterHelper']) + +.directive('stringToNumber', function() { + return { + require: 'ngModel', + link: function(scope, element, attrs, ngModel) { + ngModel.$parsers.push(function(value) { + return '' + value; + }); + ngModel.$formatters.push(function(value) { + return parseFloat(value); + }); + } + }; +}); diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorIndividualIndicatorComputation/kommonitor-individual-indicator-computation.component.js b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorIndividualIndicatorComputation/kommonitor-individual-indicator-computation.component.js index 73d678b56..36056aef6 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorIndividualIndicatorComputation/kommonitor-individual-indicator-computation.component.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorIndividualIndicatorComputation/kommonitor-individual-indicator-computation.component.js @@ -1,819 +1,615 @@ +"use strict"; angular - .module('kommonitorIndividualIndicatorComputation') - .component( - 'kommonitorIndividualIndicatorComputation', - { - templateUrl : "components/kommonitorUserInterface/kommonitorControls/kommonitorIndividualIndicatorComputation/kommonitor-individual-indicator-computation.template.html", - controller : ['kommonitorDataExchangeService', '$rootScope', '$scope', '$http','kommonitorMapService', '__env', '$timeout', function kommonitorIndividualIndicatorComputationController( - kommonitorDataExchangeService, $rootScope, $scope, $http, kommonitorMapService, __env, $timeout) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - const targetURL = __env.targetUrlToProcessingEngine + "script-engine/customizableIndicatorComputation"; - - $scope.loadingData = false; - - $scope.targetIndicator; - $scope.targetIndicator_backup; - - $scope.indicatorNameFilter = undefined; - - $scope.targetDate; - $scope.targetSpatialUnit; - $scope.targetScriptMetadata; - $scope.jobInfoText; - $scope.computedCustomizedIndicatorGeoJSON; - $scope.datesAsMs; - $scope.availableDates; - $scope.inputNgModels = {}; - - $scope.dateSliderForComputation; - - $scope.filterComputableIndicators = function() { - return function( item ) { - - // if(item.indicatorName.includes("Erreichbarkeit")){ - // return false; - // } - - var scriptForIndicator; - - for (var script of kommonitorDataExchangeService.availableProcessScripts){ - if (script.indicatorId === item.indicatorId){ - scriptForIndicator = script; - break; - } - }; - - if (! script.variableProcessParameters.length > 0){ - return false; - } - - return true; - }; - }; - - $scope.resetComputationForm = function(){ - - $scope.stopLoop = true; - $scope.computationStarted = false; - - $scope.loadingData = false; - - $scope.targetIndicator = undefined; - $scope.targetDate = undefined; - $scope.targetSpatialUnit = undefined; - $scope.targetScriptMetadata = undefined; - $scope.jobInfoText = undefined; - $scope.computedCustomizedIndicatorGeoJSON = undefined; - $scope.datesAsMs = undefined; - $scope.availableDates = undefined; - $scope.inputNgModels = {}; - $scope.error = undefined; - - if($scope.dateSliderForComputation){ - $scope.dateSliderForComputation.destroy(); - } - - var domNode = document.getElementById("dateSliderForComputation"); - - while (domNode.hasChildNodes()) { - domNode.removeChild(domNode.lastChild); - } - - $scope.resetProgressBar(); - }; - - $scope.onTargetDateChange = function(){ - - $scope.computedCustomizedIndicatorGeoJSON = undefined; - $scope.resetProgressBar(); - - var date = new Date($scope.targetDate); - - var month = date.getMonth()+1; - var day = date.getDate(); - - if (month < 10) - month = "0" + month; - - if (day < 10) - day = "0" + day; - - $scope.targetDate = date.getFullYear() + "-" + month + "-" + day; - - $scope.$digest(); - }; - - var updateInputDisplay = function(input){ - - var inputDOMElement = document.getElementById(input.parameterData.name); - var inputDOMLabelInput = document.getElementById(input.parameterData.name + "Label"); - - input.inputElement.value = inputDOMElement.value; - inputDOMLabelInput.value = inputDOMElement.value; - } - - var createInputAsString = function(parameterData){ - // { - // "minParameterValueForNumericInputs": 6.027456183070403, - // "maxParameterValueForNumericInputs": 0.8008281904610115, - // "defaultValue": "defaultValue", - // "dataType": "string", - // "name": "name", - // "description": "description" - // } - - var inputElement = document.createElement("input"); - inputElement.setAttribute("id", parameterData.name); - inputElement.setAttribute("type", "text"); - inputElement.setAttribute("value", parameterData.defaultValue); - inputElement.value = parameterData.defaultValue; - - return inputElement; - }; - - var createInputAsBoolean = function(parameterData){ - // { - // "minParameterValueForNumericInputs": 6.027456183070403, - // "maxParameterValueForNumericInputs": 0.8008281904610115, - // "defaultValue": "defaultValue", - // "dataType": "string", - // "name": "name", - // "description": "description" - // } - - var inputElement = document.createElement("input"); - inputElement.setAttribute("id", parameterData.name); - inputElement.setAttribute("type", "checkbox"); - inputElement.setAttribute("value", parameterData.name); - - if(parameterData.defaultValue === 'true') - inputElement.setAttribute("checked", "checked"); - - return inputElement; - }; - - var createInputAsInteger = function(parameterData){ - // { - // "minParameterValueForNumericInputs": 6.027456183070403, - // "maxParameterValueForNumericInputs": 0.8008281904610115, - // "defaultValue": "defaultValue", - // "dataType": "string", - // "name": "name", - // "description": "description" - // } - - // - - var inputElement = document.createElement("input"); - inputElement.setAttribute("id", parameterData.name); - inputElement.setAttribute("type", "range"); - inputElement.setAttribute("value", Number(parameterData.defaultValue)); - inputElement.value = Number(parameterData.defaultValue); - // inputElement.setAttribute("class", "slider"); - inputElement.setAttribute("min", parameterData.minParameterValueForNumericInputs); - inputElement.setAttribute("max", parameterData.maxParameterValueForNumericInputs); - inputElement.setAttribute("data-show-value", "true"); - inputElement.setAttribute("step", "1"); - - return inputElement; - }; - - var createInputAsDouble = function(parameterData){ - // { - // "minParameterValueForNumericInputs": 6.027456183070403, - // "maxParameterValueForNumericInputs": 0.8008281904610115, - // "defaultValue": "defaultValue", - // "dataType": "string", - // "name": "name", - // "description": "description" - // } - - // - - // var inputElement = document.createElement("input"); - var inputElement = {}; - inputElement.id = parameterData.name; - inputElement.type = "range"; - inputElement.value = Number(parameterData.defaultValue); - // inputElement.class = "slider"; - inputElement.min = parameterData.minParameterValueForNumericInputs; - inputElement.max = parameterData.maxParameterValueForNumericInputs; - // inputElement.dataShowValue = "true"; - inputElement.step = "0.01"; - - // inputElement.ngModelVariable = parameterData.name + "Value"; - // - // // inputElement.setAttribute("ng-model", parameterData.name + "Value"); - // $scope.inputNgModels[inputElement.ngModelVariable] = Number(parameterData.defaultValue); - - return inputElement; - }; - - function sleep(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); - } - - var buildParameterFormHtml = function(targetScriptMetadata){ - - $scope.computedCustomizedIndicatorGeoJSON = undefined; - $scope.resetProgressBar(); - $scope.inputNgModels = {}; - - // await sleep(1000); - - // try{ - // var processInputFormNode = document.getElementById("processInputForm"); - // // remove old content - // while (processInputFormNode.firstChild) { - // processInputFormNode.removeChild(processInputFormNode.firstChild); - // } - // } - // catch(error){ - // console.error("DOM Element with ID 'processInputForm' was not found"); - // } - - - - //example to create elements via code - - // we must iterate over all process parameters and setup form elements for each input type - // e.g. sliders for range values, checkboxes for boolean - - // var processInputFormNode = document.getElementById("processInputForm"); - - $scope.processInputs = []; - - targetScriptMetadata.variableProcessParameters.forEach(function(parameterData){ - // looks like: - - // { - // "minParameterValueForNumericInputs": 6.027456183070403, - // "maxParameterValueForNumericInputs": 0.8008281904610115, - // "defaultValue": "defaultValue", - // "dataType": "string", - // "name": "name", - // "description": "description" - // } - - // var parameterNode = document.createDocumentFragment(); - - var processInput = {}; - processInput.parameterData = parameterData; - - // var parameterDiv = document.createElement("div"); - // parameterDiv.setAttribute("class", "slidecontainer"); - // - // var parameterLabel = document.createElement("label"); - // parameterLabel.appendChild(document.createTextNode(parameterData.name + ": {{" + parameterData.name + "Value}}")); - // - // var parameterDescription = document.createElement("p"); - // parameterDescription.appendChild(document.createTextNode(parameterData.description)); - // - // parameterDiv.appendChild(parameterLabel); - // parameterDiv.appendChild(parameterDescription); - - // create input element depending on dataType - // dataType can be string, boolean, integer, double - switch(parameterData.dataType) { - case "string": - // parameterDiv.appendChild(createInputAsString(parameterData)); - processInput.inputElement = createInputAsString(parameterData); - break; - case "boolean": - // parameterDiv.appendChild(createInputAsBoolean(parameterData)); - processInput.inputElement = createInputAsBoolean(parameterData); - break; - case "integer": - // parameterDiv.appendChild(createInputAsInteger(parameterData)); - processInput.inputElement = createInputAsInteger(parameterData); - break; - case "double": - // parameterDiv.appendChild(createInputAsDouble(parameterData)); - processInput.inputElement = createInputAsDouble(parameterData); - break; - default: - // parameterDiv.appendChild(createInputAsString(parameterData)); - processInput.inputElement = createInputAsString(parameterData); - } - - $scope.processInputs.push(processInput); - - // $scope[processInput.inputElement.ngModelVariable] = processInput.parameterData.defaultValue; - - // make a bit space after paramter - // parameterDiv.appendChild(document.createElement("p")); - - // processInputFormNode.appendChild(parameterDiv); - }); - - // parameterNode.appendChild(parameterDiv); - - // $scope.$digest(); - }; - - $scope.getScriptMetadataForIndicatorId = function(indicatorId){ - var targetScriptMetadata; - - for (const scriptElement of kommonitorDataExchangeService.availableProcessScripts){ - if (scriptElement.indicatorId === indicatorId){ - targetScriptMetadata = scriptElement; - break; - } - }; - - return targetScriptMetadata; - }; - - $scope.onChangeTargetIndicator = function(){ - - if($scope.targetIndicator){ - $scope.targetIndicator_backup = $scope.targetIndicator; - } - else{ - $scope.targetIndicator = $scope.targetIndicator_backup; - } - - $scope.computedCustomizedIndicatorGeoJSON = undefined; - $scope.resetProgressBar(); - - $scope.targetScriptMetadata = $scope.getScriptMetadataForIndicatorId($scope.targetIndicator.indicatorId); - - buildParameterFormHtml($scope.targetScriptMetadata); - - $scope.setupDateSliderForComputation(); - - if(!$scope.targetSpatialUnit){ - $scope.targetSpatialUnit = $scope.getFirstSpatialUnitForSelectedIndicator(); - } - - // modify guidedTour if required - $rootScope.$broadcast("redrawGuidedTourElement"); - - }; - - $scope.getFirstSpatialUnitForSelectedIndicator = function() { - - var result = undefined; - - var applicableSpatialUnits = $scope.targetIndicator.applicableSpatialUnits; - - for (const spatialUnitEntry of kommonitorDataExchangeService.availableSpatialUnits){ - if(applicableSpatialUnits.some(o => o.spatialUnitName === spatialUnitEntry.spatialUnitLevel)) - result = spatialUnitEntry; - break; - } - - return result; - }; - - $scope.onChangeTargetSpatialUnit = function(){ - - $scope.computedCustomizedIndicatorGeoJSON = undefined; - $scope.resetProgressBar(); - - - buildParameterFormHtml($scope.targetScriptMetadata); - $scope.setupDateSliderForComputation(); - - }; - - $scope.fetchBaseIndicatorMetadata = function(baseIndicatorId){ - for (const indicatorMetadata of kommonitorDataExchangeService.displayableIndicators){ - if(indicatorMetadata.indicatorId === baseIndicatorId) - return indicatorMetadata; - } - } - - $scope.fetchGeoresourceMetadata = function(georesourceId){ - for (const georesourceMetadata of kommonitorDataExchangeService.availableGeoresources){ - if(georesourceMetadata.datasetId === georesourceId) - return georesourceMetadata; - } - } - - $scope.appendDatesFromIndicatorMetadataApplicableDates = function(dates){ - - var indicatorMetadata = $scope.fetchBaseIndicatorMetadata($scope.targetScriptMetadata.indicatorId); - for (const date of indicatorMetadata.applicableDates){ - if(!dates.includes(date)) - dates.push(date); - } - - return dates; - } - - $scope.appendDatesFromBaseIndicators = function(dates){ - - for (const baseIndicatorId of $scope.targetScriptMetadata.requiredIndicatorIds){ - var baseIndicator = $scope.fetchBaseIndicatorMetadata(baseIndicatorId); - for (const date of baseIndicator.applicableDates){ - if(!dates.includes(date)) - dates.push(date); - } - } - - return dates; - } - - $scope.appendDatesFromGeoresources = function(dates){ - - for (const georesourceId of $scope.targetScriptMetadata.requiredGeoresourceIds){ - var georesource = $scope.fetchGeoresourceMetadata(georesourceId); - for (const date of georesource.applicableDates){ - if(!dates.includes(date)) - dates.push(date); - } - } - - return dates; - } - - function dateToTS (date) { - return date.valueOf(); - } - - function tsToDateString (dateAsMs) { - var date = new Date(dateAsMs); - - /** - * TODO FIXME dateSLider formatter will return only year for now to prevent misleading month and day settings - */ - - // return date.getFullYear(); - - return date.toLocaleDateString("de-DE", { - year: 'numeric', - month: 'long', - day: 'numeric' - }); - } - - function dateToDateString (date) { - - /** - * TODO FIXME dateSLider formatter will return only year for now to prevent misleading month and day settings - */ - - // return date.getFullYear(); - - return date.toLocaleDateString("de-DE", { - year: 'numeric', - month: 'long', - day: 'numeric' - }); - } - - function createDatesFromIndicatorDates(indicatorDates) { - - $scope.datesAsMs = []; - - for (var index=0; index < indicatorDates.length; index++){ - // year-month-day - var dateComponents = indicatorDates[index].split("-"); - $scope.datesAsMs.push(dateToTS(new Date(Number(dateComponents[0]), Number(dateComponents[1]) - 1, Number(dateComponents[2])))); - } - return $scope.datesAsMs; - } - - - $scope.setupDateSliderForComputation = function(){ - - if($scope.dateSliderForComputation){ - $scope.dateSliderForComputation.destroy(); - } - - var domNode = document.getElementById("dateSliderForComputation"); - - while (domNode.hasChildNodes()) { - domNode.removeChild(domNode.lastChild); - } - - $scope.availableDates = new Array(); - - // availableDates = $scope.appendDatesFromBaseIndicators(availableDates); - $scope.availableDates = $scope.appendDatesFromIndicatorMetadataApplicableDates($scope.availableDates); - // availableDates = $scope.appendDatesFromGeoresources(availableDates); - - // sort ascending - $scope.availableDates.sort(function(a, b) { - return a - b; - }); - - $scope.date = $scope.availableDates[$scope.availableDates.length - 1]; - $scope.targetDate = $scope.availableDates[$scope.availableDates.length - 1]; - - $scope.datesAsMs = createDatesFromIndicatorDates($scope.availableDates); - - // new Date() uses month between 0-11! - $("#dateSliderForComputation").ionRangeSlider({ - skin: "big", - type: "single", - grid: true, - values: $scope.datesAsMs, - from: $scope.datesAsMs.length -1, // index, not the date - force_edges: true, - prettify: tsToDateString, - onChange: $scope.onChangeDateSliderItem - }); - - $scope.dateSliderForComputation = $("#dateSliderForComputation").data("ionRangeSlider"); - // make sure that the handle is properly set to max value - $scope.dateSliderForComputation.update({ - from: $scope.datesAsMs.length -1 // index, not the date - }); - }; - - $scope.onChangeDateSliderItem = async function(data){ - - $scope.targetDate = $scope.availableDates[data.from]; - $scope.date = $scope.targetDate; - }; - - - $scope.calculateCustomIndicator = function(){ - - $scope.computationStarted = true; - - $scope.computedCustomizedIndicatorGeoJSON = undefined; - $scope.jobInfoText = undefined; - $scope.resetProgressBar(); - - $scope.stopLoop = false; - - console.log("calculateCustomIndicator called!"); - - $scope.loadingData = true; - // example request model - - // { - // "targetSpatialUnitId": "targetSpatialUnitId", - // "scriptId": "scriptId", - // "customProcessProperties": [ - // { - // "dataType": "string", - // "name": "name", - // "value": "customValue" - // }, - // { - // "dataType": "string", - // "name": "name", - // "value": "customValue" - // } - // ], - // "targetDate": "2000-01-23", - // "georesourceIds": [ - // "georesourceIds", - // "georesourceIds" - // ], - // "baseIndicatorIds": [ - // "baseIndicatorIds", - // "baseIndicatorIds" - // ] - // } - - var processingInput = {}; - processingInput.targetSpatialUnitId = $scope.targetSpatialUnit.spatialUnitId; - processingInput.scriptId = $scope.targetScriptMetadata.scriptId; - processingInput.targetDate = $scope.targetDate; - processingInput.georesourceIds = $scope.targetScriptMetadata.requiredGeoresourceIds; - processingInput.baseIndicatorIds = $scope.targetScriptMetadata.requiredIndicatorIds; - processingInput.customProcessProperties = new Array(); - - $scope.targetScriptMetadata.variableProcessParameters.forEach(function(processParam){ - // now get name of parameter - // then seach for input element within DOM with id=name - // get value of that DOM element and create parameter object - var scriptParam = {}; - scriptParam.name = processParam.name; - scriptParam.dataType = processParam.dataType; - scriptParam.value = document.getElementById(scriptParam.name).value; - - processingInput.customProcessProperties.push(scriptParam); - }); - - console.log("created URL POST body for CUSTOM PROCESSING: " + processingInput); - - $scope.indicatorName = $scope.targetIndicator.indicatorName; - $scope.spatialUnitName = $scope.targetSpatialUnit.spatialUnitLevel; - $scope.date = $scope.targetDate; - - $http({ - url: targetURL, - method: "POST", - headers: { - 'Content-Type': 'application/json' - }, - data: processingInput - }).then(async function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - console.log("success callback for customizable indicator comutation"); - // get location header to achieve jobId - var jobId = response.headers('Location'); - - await sleep(300); - - $scope.showInitialJobStatus(jobId); - - $timeout(function(){ - - $scope.loadingData = false; - }); - - $scope.pendForResult(jobId); - - // $scope.downloadGeoJSON(geoJSON_string); - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - $scope.error = error.statusText; - - kommonitorDataExchangeService.displayMapApplicationError(error); - - $timeout(function(){ - - $scope.loadingData = false; - }); - }); - - } - - $scope.showInitialJobStatus = function(jobId){ - - $http({ - url: targetURL + "/" + jobId, - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - console.log("success callback for showInitialJobStatus"); - $scope.jobInfoText = "Berechnung begonnen. Siehe Fortschrittsbalken."; - - if(response.data.progress) - $scope.updateProgressBar(response.data.progress); - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - $scope.error = error.data.error; - - kommonitorDataExchangeService.displayMapApplicationError(error); - - $scope.loadingData = false; - }); - }; - - $scope.pendForResult = async function(jobId){ - - var sleepTimeInMS = 1000; - - - while(!$scope.computedCustomizedIndicatorGeoJSON && !$scope.stopLoop){ - - if($scope.stopLoop) - break; - - $http({ - url: targetURL + '/' + jobId, - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - console.log("success callback for pendForResult"); - - if(response.data.status === "failed"){ - $scope.error = response.data.error; - console.error(response.data.error); - $scope.stopLoop = true; - return; - } - - if(response.data.progress) - $scope.updateProgressBar(response.data.progress); - - - if(response.data.progress === 100 || response.data.status === "succeeded"){ - var geoJSON_base64 = response.data.result_geoJSON_base64; - // first decode Base64 and then parse string as JSON - $scope.computedCustomizedIndicatorGeoJSON = JSON.parse(atob(geoJSON_base64)); - $scope.jobInfoText = undefined; - $scope.stopLoop = true; - - $scope.prepareDownloadGeoJSON(); - - // $scope.$digest(); - } - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - $scope.error = error.data.error; - console.error(error.data.error); - kommonitorDataExchangeService.displayMapApplicationError(error); - $scope.stopLoop = true; - $scope.loadingData = false; - return; - - - }); - - if ($scope.computedCustomizedIndicatorGeoJSON) - return; - - await sleep(sleepTimeInMS); - } - - }; - - $scope.updateProgressBar = function(progress){ - var progressBarNode = document.getElementById("customComputationProgressBar"); - - progressBarNode.setAttribute("aria-valuenow", ""+progress); - progressBarNode.setAttribute("style", "width:"+progress+"%"); - progressBarNode.textContent = progress + "% Fortschritt"; - // $scope.progress = progress; - }; - - $scope.resetProgressBar = function(){ - var progressBarNode = document.getElementById("customComputationProgressBar"); - - progressBarNode.setAttribute("aria-valuenow", "0"); - progressBarNode.setAttribute("style", "width:0%"); - progressBarNode.textContent = "0% Fortschritt"; - // $scope.progress = 0; - }; - - $scope.addComputedIndicatorToMap = function(){ - console.log("Adding customized indicator to map."); - - $scope.targetIndicator.geoJSON = $scope.computedCustomizedIndicatorGeoJSON; - kommonitorDataExchangeService.selectedIndicator = $scope.targetIndicator; - // kommonitorMapService.addCustomIndicatorGeoJSON($scope.targetIndicator, $scope.targetSpatialUnit.spatialUnitLevel, $scope.targetDate); - kommonitorMapService.replaceIndicatorGeoJSON($scope.targetIndicator, $scope.targetSpatialUnit.spatialUnitLevel, $scope.targetDate, false, true); - }; - - $scope.prepareDownloadGeoJSON = function(){ - - console.log("removing old download button if available") - if(document.getElementById("downloadComputedIndicator")) - document.getElementById("downloadComputedIndicator").remove(); - - var geoJSON_string = JSON.stringify($scope.computedCustomizedIndicatorGeoJSON); - - var fileName = $scope.indicatorName + "_" + $scope.spatialUnitName + "_" + $scope.date + "_CUSTOM.geojson"; - // var fileName = "export.geojson" - - // if (!geoJSON_string.match(/^data:application\/vnd.geo+json/i)) { - // geoJSON_string = 'data:application/vnd.geo+json;charset=utf-8,' + geoJSON_string; - // } - // data = encodeURI(geoJSON_string); - - var blob = new Blob([geoJSON_string], {type: "application/json"}); - var data = URL.createObjectURL(blob); - // - // $scope.indicatorDownloadURL = data; - // $scope.indicatorDownloadName = fileName; - - console.log("create new Download button and append it to DOM"); - var a = document.createElement('a'); - a.download = fileName; - a.href = data; - a.textContent = "Download GeoJSON"; - a.id = "downloadComputedIndicator"; - a.setAttribute("class", "btn btn-primary"); - - document.getElementById('indicatorOutput').appendChild(a); - } - - $scope.downloadGeoJSON = function(){ - - var geoJSON_string = JSON.stringify($scope.computedCustomizedIndicatorGeoJSON); - - filename = $scope.targetIndicator.indicatorName + "_" + $scope.targetSpatialUnit.spatialUnitLevel + "_" + $scope.targetDate + "_CUSTOM.geojson"; - - if (!geoJSON_string.match(/^data:application\/vnd.geo+json/i)) { - geoJSON_string = 'data:application/vnd.geo+json;charset=utf-8,' + geoJSON_string; - } - data = encodeURI(geoJSON_string); - - link = document.createElement('a'); - link.setAttribute('href', data); - link.setAttribute('download', filename); - - document.body.appendChild(link); - - console.log("Trigger download"); - - link.click(); - } - - }] - }); + .module('kommonitorIndividualIndicatorComputation') + .component('kommonitorIndividualIndicatorComputation', { + templateUrl: "components/kommonitorUserInterface/kommonitorControls/kommonitorIndividualIndicatorComputation/kommonitor-individual-indicator-computation.template.html", + controller: ['kommonitorDataExchangeService', '$rootScope', '$scope', '$http', 'kommonitorMapService', '__env', '$timeout', function kommonitorIndividualIndicatorComputationController(kommonitorDataExchangeService, $rootScope, $scope, $http, kommonitorMapService, __env, $timeout) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + const targetURL = __env.targetUrlToProcessingEngine + "script-engine/customizableIndicatorComputation"; + $scope.loadingData = false; + $scope.targetIndicator; + $scope.targetIndicator_backup; + $scope.indicatorNameFilter = undefined; + $scope.targetDate; + $scope.targetSpatialUnit; + $scope.targetScriptMetadata; + $scope.jobInfoText; + $scope.computedCustomizedIndicatorGeoJSON; + $scope.datesAsMs; + $scope.availableDates; + $scope.inputNgModels = {}; + $scope.dateSliderForComputation; + $scope.filterComputableIndicators = function () { + return function (item) { + // if(item.indicatorName.includes("Erreichbarkeit")){ + // return false; + // } + var scriptForIndicator; + for (var script of kommonitorDataExchangeService.availableProcessScripts) { + if (script.indicatorId === item.indicatorId) { + scriptForIndicator = script; + break; + } + } + ; + if (!script.variableProcessParameters.length > 0) { + return false; + } + return true; + }; + }; + $scope.resetComputationForm = function () { + $scope.stopLoop = true; + $scope.computationStarted = false; + $scope.loadingData = false; + $scope.targetIndicator = undefined; + $scope.targetDate = undefined; + $scope.targetSpatialUnit = undefined; + $scope.targetScriptMetadata = undefined; + $scope.jobInfoText = undefined; + $scope.computedCustomizedIndicatorGeoJSON = undefined; + $scope.datesAsMs = undefined; + $scope.availableDates = undefined; + $scope.inputNgModels = {}; + $scope.error = undefined; + if ($scope.dateSliderForComputation) { + $scope.dateSliderForComputation.destroy(); + } + var domNode = document.getElementById("dateSliderForComputation"); + while (domNode.hasChildNodes()) { + domNode.removeChild(domNode.lastChild); + } + $scope.resetProgressBar(); + }; + $scope.onTargetDateChange = function () { + $scope.computedCustomizedIndicatorGeoJSON = undefined; + $scope.resetProgressBar(); + var date = new Date($scope.targetDate); + var month = date.getMonth() + 1; + var day = date.getDate(); + if (month < 10) + month = "0" + month; + if (day < 10) + day = "0" + day; + $scope.targetDate = date.getFullYear() + "-" + month + "-" + day; + $scope.$digest(); + }; + var updateInputDisplay = function (input) { + var inputDOMElement = document.getElementById(input.parameterData.name); + var inputDOMLabelInput = document.getElementById(input.parameterData.name + "Label"); + input.inputElement.value = inputDOMElement.value; + inputDOMLabelInput.value = inputDOMElement.value; + }; + var createInputAsString = function (parameterData) { + // { + // "minParameterValueForNumericInputs": 6.027456183070403, + // "maxParameterValueForNumericInputs": 0.8008281904610115, + // "defaultValue": "defaultValue", + // "dataType": "string", + // "name": "name", + // "description": "description" + // } + var inputElement = document.createElement("input"); + inputElement.setAttribute("id", parameterData.name); + inputElement.setAttribute("type", "text"); + inputElement.setAttribute("value", parameterData.defaultValue); + inputElement.value = parameterData.defaultValue; + return inputElement; + }; + var createInputAsBoolean = function (parameterData) { + // { + // "minParameterValueForNumericInputs": 6.027456183070403, + // "maxParameterValueForNumericInputs": 0.8008281904610115, + // "defaultValue": "defaultValue", + // "dataType": "string", + // "name": "name", + // "description": "description" + // } + var inputElement = document.createElement("input"); + inputElement.setAttribute("id", parameterData.name); + inputElement.setAttribute("type", "checkbox"); + inputElement.setAttribute("value", parameterData.name); + if (parameterData.defaultValue === 'true') + inputElement.setAttribute("checked", "checked"); + return inputElement; + }; + var createInputAsInteger = function (parameterData) { + // { + // "minParameterValueForNumericInputs": 6.027456183070403, + // "maxParameterValueForNumericInputs": 0.8008281904610115, + // "defaultValue": "defaultValue", + // "dataType": "string", + // "name": "name", + // "description": "description" + // } + // + var inputElement = document.createElement("input"); + inputElement.setAttribute("id", parameterData.name); + inputElement.setAttribute("type", "range"); + inputElement.setAttribute("value", Number(parameterData.defaultValue)); + inputElement.value = Number(parameterData.defaultValue); + // inputElement.setAttribute("class", "slider"); + inputElement.setAttribute("min", parameterData.minParameterValueForNumericInputs); + inputElement.setAttribute("max", parameterData.maxParameterValueForNumericInputs); + inputElement.setAttribute("data-show-value", "true"); + inputElement.setAttribute("step", "1"); + return inputElement; + }; + var createInputAsDouble = function (parameterData) { + // { + // "minParameterValueForNumericInputs": 6.027456183070403, + // "maxParameterValueForNumericInputs": 0.8008281904610115, + // "defaultValue": "defaultValue", + // "dataType": "string", + // "name": "name", + // "description": "description" + // } + // + // var inputElement = document.createElement("input"); + var inputElement = {}; + inputElement.id = parameterData.name; + inputElement.type = "range"; + inputElement.value = Number(parameterData.defaultValue); + // inputElement.class = "slider"; + inputElement.min = parameterData.minParameterValueForNumericInputs; + inputElement.max = parameterData.maxParameterValueForNumericInputs; + // inputElement.dataShowValue = "true"; + inputElement.step = "0.01"; + // inputElement.ngModelVariable = parameterData.name + "Value"; + // + // // inputElement.setAttribute("ng-model", parameterData.name + "Value"); + // $scope.inputNgModels[inputElement.ngModelVariable] = Number(parameterData.defaultValue); + return inputElement; + }; + function sleep(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); + } + var buildParameterFormHtml = function (targetScriptMetadata) { + $scope.computedCustomizedIndicatorGeoJSON = undefined; + $scope.resetProgressBar(); + $scope.inputNgModels = {}; + // await sleep(1000); + // try{ + // var processInputFormNode = document.getElementById("processInputForm"); + // // remove old content + // while (processInputFormNode.firstChild) { + // processInputFormNode.removeChild(processInputFormNode.firstChild); + // } + // } + // catch(error){ + // console.error("DOM Element with ID 'processInputForm' was not found"); + // } + //example to create elements via code + // we must iterate over all process parameters and setup form elements for each input type + // e.g. sliders for range values, checkboxes for boolean + // var processInputFormNode = document.getElementById("processInputForm"); + $scope.processInputs = []; + targetScriptMetadata.variableProcessParameters.forEach(function (parameterData) { + // looks like: + // { + // "minParameterValueForNumericInputs": 6.027456183070403, + // "maxParameterValueForNumericInputs": 0.8008281904610115, + // "defaultValue": "defaultValue", + // "dataType": "string", + // "name": "name", + // "description": "description" + // } + // var parameterNode = document.createDocumentFragment(); + var processInput = {}; + processInput.parameterData = parameterData; + // var parameterDiv = document.createElement("div"); + // parameterDiv.setAttribute("class", "slidecontainer"); + // + // var parameterLabel = document.createElement("label"); + // parameterLabel.appendChild(document.createTextNode(parameterData.name + ": {{" + parameterData.name + "Value}}")); + // + // var parameterDescription = document.createElement("p"); + // parameterDescription.appendChild(document.createTextNode(parameterData.description)); + // + // parameterDiv.appendChild(parameterLabel); + // parameterDiv.appendChild(parameterDescription); + // create input element depending on dataType + // dataType can be string, boolean, integer, double + switch (parameterData.dataType) { + case "string": + // parameterDiv.appendChild(createInputAsString(parameterData)); + processInput.inputElement = createInputAsString(parameterData); + break; + case "boolean": + // parameterDiv.appendChild(createInputAsBoolean(parameterData)); + processInput.inputElement = createInputAsBoolean(parameterData); + break; + case "integer": + // parameterDiv.appendChild(createInputAsInteger(parameterData)); + processInput.inputElement = createInputAsInteger(parameterData); + break; + case "double": + // parameterDiv.appendChild(createInputAsDouble(parameterData)); + processInput.inputElement = createInputAsDouble(parameterData); + break; + default: + // parameterDiv.appendChild(createInputAsString(parameterData)); + processInput.inputElement = createInputAsString(parameterData); + } + $scope.processInputs.push(processInput); + // $scope[processInput.inputElement.ngModelVariable] = processInput.parameterData.defaultValue; + // make a bit space after paramter + // parameterDiv.appendChild(document.createElement("p")); + // processInputFormNode.appendChild(parameterDiv); + }); + // parameterNode.appendChild(parameterDiv); + // $scope.$digest(); + }; + $scope.getScriptMetadataForIndicatorId = function (indicatorId) { + var targetScriptMetadata; + for (const scriptElement of kommonitorDataExchangeService.availableProcessScripts) { + if (scriptElement.indicatorId === indicatorId) { + targetScriptMetadata = scriptElement; + break; + } + } + ; + return targetScriptMetadata; + }; + $scope.onChangeTargetIndicator = function () { + if ($scope.targetIndicator) { + $scope.targetIndicator_backup = $scope.targetIndicator; + } + else { + $scope.targetIndicator = $scope.targetIndicator_backup; + } + $scope.computedCustomizedIndicatorGeoJSON = undefined; + $scope.resetProgressBar(); + $scope.targetScriptMetadata = $scope.getScriptMetadataForIndicatorId($scope.targetIndicator.indicatorId); + buildParameterFormHtml($scope.targetScriptMetadata); + $scope.setupDateSliderForComputation(); + if (!$scope.targetSpatialUnit) { + $scope.targetSpatialUnit = $scope.getFirstSpatialUnitForSelectedIndicator(); + } + // modify guidedTour if required + $rootScope.$broadcast("redrawGuidedTourElement"); + }; + $scope.getFirstSpatialUnitForSelectedIndicator = function () { + var result = undefined; + var applicableSpatialUnits = $scope.targetIndicator.applicableSpatialUnits; + for (const spatialUnitEntry of kommonitorDataExchangeService.availableSpatialUnits) { + if (applicableSpatialUnits.some(o => o.spatialUnitName === spatialUnitEntry.spatialUnitLevel)) + result = spatialUnitEntry; + break; + } + return result; + }; + $scope.onChangeTargetSpatialUnit = function () { + $scope.computedCustomizedIndicatorGeoJSON = undefined; + $scope.resetProgressBar(); + buildParameterFormHtml($scope.targetScriptMetadata); + $scope.setupDateSliderForComputation(); + }; + $scope.fetchBaseIndicatorMetadata = function (baseIndicatorId) { + for (const indicatorMetadata of kommonitorDataExchangeService.displayableIndicators) { + if (indicatorMetadata.indicatorId === baseIndicatorId) + return indicatorMetadata; + } + }; + $scope.fetchGeoresourceMetadata = function (georesourceId) { + for (const georesourceMetadata of kommonitorDataExchangeService.availableGeoresources) { + if (georesourceMetadata.datasetId === georesourceId) + return georesourceMetadata; + } + }; + $scope.appendDatesFromIndicatorMetadataApplicableDates = function (dates) { + var indicatorMetadata = $scope.fetchBaseIndicatorMetadata($scope.targetScriptMetadata.indicatorId); + for (const date of indicatorMetadata.applicableDates) { + if (!dates.includes(date)) + dates.push(date); + } + return dates; + }; + $scope.appendDatesFromBaseIndicators = function (dates) { + for (const baseIndicatorId of $scope.targetScriptMetadata.requiredIndicatorIds) { + var baseIndicator = $scope.fetchBaseIndicatorMetadata(baseIndicatorId); + for (const date of baseIndicator.applicableDates) { + if (!dates.includes(date)) + dates.push(date); + } + } + return dates; + }; + $scope.appendDatesFromGeoresources = function (dates) { + for (const georesourceId of $scope.targetScriptMetadata.requiredGeoresourceIds) { + var georesource = $scope.fetchGeoresourceMetadata(georesourceId); + for (const date of georesource.applicableDates) { + if (!dates.includes(date)) + dates.push(date); + } + } + return dates; + }; + function dateToTS(date) { + return date.valueOf(); + } + function tsToDateString(dateAsMs) { + var date = new Date(dateAsMs); + /** + * TODO FIXME dateSLider formatter will return only year for now to prevent misleading month and day settings + */ + // return date.getFullYear(); + return date.toLocaleDateString("de-DE", { + year: 'numeric', + month: 'long', + day: 'numeric' + }); + } + function dateToDateString(date) { + /** + * TODO FIXME dateSLider formatter will return only year for now to prevent misleading month and day settings + */ + // return date.getFullYear(); + return date.toLocaleDateString("de-DE", { + year: 'numeric', + month: 'long', + day: 'numeric' + }); + } + function createDatesFromIndicatorDates(indicatorDates) { + $scope.datesAsMs = []; + for (var index = 0; index < indicatorDates.length; index++) { + // year-month-day + var dateComponents = indicatorDates[index].split("-"); + $scope.datesAsMs.push(dateToTS(new Date(Number(dateComponents[0]), Number(dateComponents[1]) - 1, Number(dateComponents[2])))); + } + return $scope.datesAsMs; + } + $scope.setupDateSliderForComputation = function () { + if ($scope.dateSliderForComputation) { + $scope.dateSliderForComputation.destroy(); + } + var domNode = document.getElementById("dateSliderForComputation"); + while (domNode.hasChildNodes()) { + domNode.removeChild(domNode.lastChild); + } + $scope.availableDates = new Array(); + // availableDates = $scope.appendDatesFromBaseIndicators(availableDates); + $scope.availableDates = $scope.appendDatesFromIndicatorMetadataApplicableDates($scope.availableDates); + // availableDates = $scope.appendDatesFromGeoresources(availableDates); + // sort ascending + $scope.availableDates.sort(function (a, b) { + return a - b; + }); + $scope.date = $scope.availableDates[$scope.availableDates.length - 1]; + $scope.targetDate = $scope.availableDates[$scope.availableDates.length - 1]; + $scope.datesAsMs = createDatesFromIndicatorDates($scope.availableDates); + // new Date() uses month between 0-11! + $("#dateSliderForComputation").ionRangeSlider({ + skin: "big", + type: "single", + grid: true, + values: $scope.datesAsMs, + from: $scope.datesAsMs.length - 1, + force_edges: true, + prettify: tsToDateString, + onChange: $scope.onChangeDateSliderItem + }); + $scope.dateSliderForComputation = $("#dateSliderForComputation").data("ionRangeSlider"); + // make sure that the handle is properly set to max value + $scope.dateSliderForComputation.update({ + from: $scope.datesAsMs.length - 1 // index, not the date + }); + }; + $scope.onChangeDateSliderItem = async function (data) { + $scope.targetDate = $scope.availableDates[data.from]; + $scope.date = $scope.targetDate; + }; + $scope.calculateCustomIndicator = function () { + $scope.computationStarted = true; + $scope.computedCustomizedIndicatorGeoJSON = undefined; + $scope.jobInfoText = undefined; + $scope.resetProgressBar(); + $scope.stopLoop = false; + console.log("calculateCustomIndicator called!"); + $scope.loadingData = true; + // example request model + // { + // "targetSpatialUnitId": "targetSpatialUnitId", + // "scriptId": "scriptId", + // "customProcessProperties": [ + // { + // "dataType": "string", + // "name": "name", + // "value": "customValue" + // }, + // { + // "dataType": "string", + // "name": "name", + // "value": "customValue" + // } + // ], + // "targetDate": "2000-01-23", + // "georesourceIds": [ + // "georesourceIds", + // "georesourceIds" + // ], + // "baseIndicatorIds": [ + // "baseIndicatorIds", + // "baseIndicatorIds" + // ] + // } + var processingInput = {}; + processingInput.targetSpatialUnitId = $scope.targetSpatialUnit.spatialUnitId; + processingInput.scriptId = $scope.targetScriptMetadata.scriptId; + processingInput.targetDate = $scope.targetDate; + processingInput.georesourceIds = $scope.targetScriptMetadata.requiredGeoresourceIds; + processingInput.baseIndicatorIds = $scope.targetScriptMetadata.requiredIndicatorIds; + processingInput.customProcessProperties = new Array(); + $scope.targetScriptMetadata.variableProcessParameters.forEach(function (processParam) { + // now get name of parameter + // then seach for input element within DOM with id=name + // get value of that DOM element and create parameter object + var scriptParam = {}; + scriptParam.name = processParam.name; + scriptParam.dataType = processParam.dataType; + scriptParam.value = document.getElementById(scriptParam.name).value; + processingInput.customProcessProperties.push(scriptParam); + }); + console.log("created URL POST body for CUSTOM PROCESSING: " + processingInput); + $scope.indicatorName = $scope.targetIndicator.indicatorName; + $scope.spatialUnitName = $scope.targetSpatialUnit.spatialUnitLevel; + $scope.date = $scope.targetDate; + $http({ + url: targetURL, + method: "POST", + headers: { + 'Content-Type': 'application/json' + }, + data: processingInput + }).then(async function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + console.log("success callback for customizable indicator comutation"); + // get location header to achieve jobId + var jobId = response.headers('Location'); + await sleep(300); + $scope.showInitialJobStatus(jobId); + $timeout(function () { + $scope.loadingData = false; + }); + $scope.pendForResult(jobId); + // $scope.downloadGeoJSON(geoJSON_string); + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.error = error.statusText; + kommonitorDataExchangeService.displayMapApplicationError(error); + $timeout(function () { + $scope.loadingData = false; + }); + }); + }; + $scope.showInitialJobStatus = function (jobId) { + $http({ + url: targetURL + "/" + jobId, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + console.log("success callback for showInitialJobStatus"); + $scope.jobInfoText = "Berechnung begonnen. Siehe Fortschrittsbalken."; + if (response.data.progress) + $scope.updateProgressBar(response.data.progress); + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.error = error.data.error; + kommonitorDataExchangeService.displayMapApplicationError(error); + $scope.loadingData = false; + }); + }; + $scope.pendForResult = async function (jobId) { + var sleepTimeInMS = 1000; + while (!$scope.computedCustomizedIndicatorGeoJSON && !$scope.stopLoop) { + if ($scope.stopLoop) + break; + $http({ + url: targetURL + '/' + jobId, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + console.log("success callback for pendForResult"); + if (response.data.status === "failed") { + $scope.error = response.data.error; + console.error(response.data.error); + $scope.stopLoop = true; + return; + } + if (response.data.progress) + $scope.updateProgressBar(response.data.progress); + if (response.data.progress === 100 || response.data.status === "succeeded") { + var geoJSON_base64 = response.data.result_geoJSON_base64; + // first decode Base64 and then parse string as JSON + $scope.computedCustomizedIndicatorGeoJSON = JSON.parse(atob(geoJSON_base64)); + $scope.jobInfoText = undefined; + $scope.stopLoop = true; + $scope.prepareDownloadGeoJSON(); + // $scope.$digest(); + } + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.error = error.data.error; + console.error(error.data.error); + kommonitorDataExchangeService.displayMapApplicationError(error); + $scope.stopLoop = true; + $scope.loadingData = false; + return; + }); + if ($scope.computedCustomizedIndicatorGeoJSON) + return; + await sleep(sleepTimeInMS); + } + }; + $scope.updateProgressBar = function (progress) { + var progressBarNode = document.getElementById("customComputationProgressBar"); + progressBarNode.setAttribute("aria-valuenow", "" + progress); + progressBarNode.setAttribute("style", "width:" + progress + "%"); + progressBarNode.textContent = progress + "% Fortschritt"; + // $scope.progress = progress; + }; + $scope.resetProgressBar = function () { + var progressBarNode = document.getElementById("customComputationProgressBar"); + progressBarNode.setAttribute("aria-valuenow", "0"); + progressBarNode.setAttribute("style", "width:0%"); + progressBarNode.textContent = "0% Fortschritt"; + // $scope.progress = 0; + }; + $scope.addComputedIndicatorToMap = function () { + console.log("Adding customized indicator to map."); + $scope.targetIndicator.geoJSON = $scope.computedCustomizedIndicatorGeoJSON; + kommonitorDataExchangeService.selectedIndicator = $scope.targetIndicator; + // kommonitorMapService.addCustomIndicatorGeoJSON($scope.targetIndicator, $scope.targetSpatialUnit.spatialUnitLevel, $scope.targetDate); + kommonitorMapService.replaceIndicatorGeoJSON($scope.targetIndicator, $scope.targetSpatialUnit.spatialUnitLevel, $scope.targetDate, false, true); + }; + $scope.prepareDownloadGeoJSON = function () { + console.log("removing old download button if available"); + if (document.getElementById("downloadComputedIndicator")) + document.getElementById("downloadComputedIndicator").remove(); + var geoJSON_string = JSON.stringify($scope.computedCustomizedIndicatorGeoJSON); + var fileName = $scope.indicatorName + "_" + $scope.spatialUnitName + "_" + $scope.date + "_CUSTOM.geojson"; + // var fileName = "export.geojson" + // if (!geoJSON_string.match(/^data:application\/vnd.geo+json/i)) { + // geoJSON_string = 'data:application/vnd.geo+json;charset=utf-8,' + geoJSON_string; + // } + // data = encodeURI(geoJSON_string); + var blob = new Blob([geoJSON_string], { type: "application/json" }); + var data = URL.createObjectURL(blob); + // + // $scope.indicatorDownloadURL = data; + // $scope.indicatorDownloadName = fileName; + console.log("create new Download button and append it to DOM"); + var a = document.createElement('a'); + a.download = fileName; + a.href = data; + a.textContent = "Download GeoJSON"; + a.id = "downloadComputedIndicator"; + a.setAttribute("class", "btn btn-primary"); + document.getElementById('indicatorOutput').appendChild(a); + }; + $scope.downloadGeoJSON = function () { + var geoJSON_string = JSON.stringify($scope.computedCustomizedIndicatorGeoJSON); + filename = $scope.targetIndicator.indicatorName + "_" + $scope.targetSpatialUnit.spatialUnitLevel + "_" + $scope.targetDate + "_CUSTOM.geojson"; + if (!geoJSON_string.match(/^data:application\/vnd.geo+json/i)) { + geoJSON_string = 'data:application/vnd.geo+json;charset=utf-8,' + geoJSON_string; + } + data = encodeURI(geoJSON_string); + link = document.createElement('a'); + link.setAttribute('href', data); + link.setAttribute('download', filename); + document.body.appendChild(link); + console.log("Trigger download"); + link.click(); + }; + }] +}); +//# sourceMappingURL=kommonitor-individual-indicator-computation.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorIndividualIndicatorComputation/kommonitor-individual-indicator-computation.component.js.map b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorIndividualIndicatorComputation/kommonitor-individual-indicator-computation.component.js.map new file mode 100644 index 000000000..7fec528b3 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorIndividualIndicatorComputation/kommonitor-individual-indicator-computation.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-individual-indicator-computation.component.js","sourceRoot":"","sources":["kommonitor-individual-indicator-computation.component.ts"],"names":[],"mappings":";AAAA,OAAO;KACJ,MAAM,CAAC,0CAA0C,CAAC;KAClD,SAAS,CACR,0CAA0C,EAC1C;IACC,WAAW,EAAG,0JAA0J;IACxK,UAAU,EAAG,CAAC,+BAA+B,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAC,sBAAsB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BACnC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;gBAChC,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;gBAExC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;gBAEhC,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;gBAEhC,IAAI,CAAC,KAAK,EAAE,CAAC;YACd,CAAC,CAAA;QAEF,CAAC,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorIndividualIndicatorComputation/kommonitor-individual-indicator-computation.component.ts b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorIndividualIndicatorComputation/kommonitor-individual-indicator-computation.component.ts new file mode 100644 index 000000000..73d678b56 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorIndividualIndicatorComputation/kommonitor-individual-indicator-computation.component.ts @@ -0,0 +1,819 @@ +angular + .module('kommonitorIndividualIndicatorComputation') + .component( + 'kommonitorIndividualIndicatorComputation', + { + templateUrl : "components/kommonitorUserInterface/kommonitorControls/kommonitorIndividualIndicatorComputation/kommonitor-individual-indicator-computation.template.html", + controller : ['kommonitorDataExchangeService', '$rootScope', '$scope', '$http','kommonitorMapService', '__env', '$timeout', function kommonitorIndividualIndicatorComputationController( + kommonitorDataExchangeService, $rootScope, $scope, $http, kommonitorMapService, __env, $timeout) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + const targetURL = __env.targetUrlToProcessingEngine + "script-engine/customizableIndicatorComputation"; + + $scope.loadingData = false; + + $scope.targetIndicator; + $scope.targetIndicator_backup; + + $scope.indicatorNameFilter = undefined; + + $scope.targetDate; + $scope.targetSpatialUnit; + $scope.targetScriptMetadata; + $scope.jobInfoText; + $scope.computedCustomizedIndicatorGeoJSON; + $scope.datesAsMs; + $scope.availableDates; + $scope.inputNgModels = {}; + + $scope.dateSliderForComputation; + + $scope.filterComputableIndicators = function() { + return function( item ) { + + // if(item.indicatorName.includes("Erreichbarkeit")){ + // return false; + // } + + var scriptForIndicator; + + for (var script of kommonitorDataExchangeService.availableProcessScripts){ + if (script.indicatorId === item.indicatorId){ + scriptForIndicator = script; + break; + } + }; + + if (! script.variableProcessParameters.length > 0){ + return false; + } + + return true; + }; + }; + + $scope.resetComputationForm = function(){ + + $scope.stopLoop = true; + $scope.computationStarted = false; + + $scope.loadingData = false; + + $scope.targetIndicator = undefined; + $scope.targetDate = undefined; + $scope.targetSpatialUnit = undefined; + $scope.targetScriptMetadata = undefined; + $scope.jobInfoText = undefined; + $scope.computedCustomizedIndicatorGeoJSON = undefined; + $scope.datesAsMs = undefined; + $scope.availableDates = undefined; + $scope.inputNgModels = {}; + $scope.error = undefined; + + if($scope.dateSliderForComputation){ + $scope.dateSliderForComputation.destroy(); + } + + var domNode = document.getElementById("dateSliderForComputation"); + + while (domNode.hasChildNodes()) { + domNode.removeChild(domNode.lastChild); + } + + $scope.resetProgressBar(); + }; + + $scope.onTargetDateChange = function(){ + + $scope.computedCustomizedIndicatorGeoJSON = undefined; + $scope.resetProgressBar(); + + var date = new Date($scope.targetDate); + + var month = date.getMonth()+1; + var day = date.getDate(); + + if (month < 10) + month = "0" + month; + + if (day < 10) + day = "0" + day; + + $scope.targetDate = date.getFullYear() + "-" + month + "-" + day; + + $scope.$digest(); + }; + + var updateInputDisplay = function(input){ + + var inputDOMElement = document.getElementById(input.parameterData.name); + var inputDOMLabelInput = document.getElementById(input.parameterData.name + "Label"); + + input.inputElement.value = inputDOMElement.value; + inputDOMLabelInput.value = inputDOMElement.value; + } + + var createInputAsString = function(parameterData){ + // { + // "minParameterValueForNumericInputs": 6.027456183070403, + // "maxParameterValueForNumericInputs": 0.8008281904610115, + // "defaultValue": "defaultValue", + // "dataType": "string", + // "name": "name", + // "description": "description" + // } + + var inputElement = document.createElement("input"); + inputElement.setAttribute("id", parameterData.name); + inputElement.setAttribute("type", "text"); + inputElement.setAttribute("value", parameterData.defaultValue); + inputElement.value = parameterData.defaultValue; + + return inputElement; + }; + + var createInputAsBoolean = function(parameterData){ + // { + // "minParameterValueForNumericInputs": 6.027456183070403, + // "maxParameterValueForNumericInputs": 0.8008281904610115, + // "defaultValue": "defaultValue", + // "dataType": "string", + // "name": "name", + // "description": "description" + // } + + var inputElement = document.createElement("input"); + inputElement.setAttribute("id", parameterData.name); + inputElement.setAttribute("type", "checkbox"); + inputElement.setAttribute("value", parameterData.name); + + if(parameterData.defaultValue === 'true') + inputElement.setAttribute("checked", "checked"); + + return inputElement; + }; + + var createInputAsInteger = function(parameterData){ + // { + // "minParameterValueForNumericInputs": 6.027456183070403, + // "maxParameterValueForNumericInputs": 0.8008281904610115, + // "defaultValue": "defaultValue", + // "dataType": "string", + // "name": "name", + // "description": "description" + // } + + // + + var inputElement = document.createElement("input"); + inputElement.setAttribute("id", parameterData.name); + inputElement.setAttribute("type", "range"); + inputElement.setAttribute("value", Number(parameterData.defaultValue)); + inputElement.value = Number(parameterData.defaultValue); + // inputElement.setAttribute("class", "slider"); + inputElement.setAttribute("min", parameterData.minParameterValueForNumericInputs); + inputElement.setAttribute("max", parameterData.maxParameterValueForNumericInputs); + inputElement.setAttribute("data-show-value", "true"); + inputElement.setAttribute("step", "1"); + + return inputElement; + }; + + var createInputAsDouble = function(parameterData){ + // { + // "minParameterValueForNumericInputs": 6.027456183070403, + // "maxParameterValueForNumericInputs": 0.8008281904610115, + // "defaultValue": "defaultValue", + // "dataType": "string", + // "name": "name", + // "description": "description" + // } + + // + + // var inputElement = document.createElement("input"); + var inputElement = {}; + inputElement.id = parameterData.name; + inputElement.type = "range"; + inputElement.value = Number(parameterData.defaultValue); + // inputElement.class = "slider"; + inputElement.min = parameterData.minParameterValueForNumericInputs; + inputElement.max = parameterData.maxParameterValueForNumericInputs; + // inputElement.dataShowValue = "true"; + inputElement.step = "0.01"; + + // inputElement.ngModelVariable = parameterData.name + "Value"; + // + // // inputElement.setAttribute("ng-model", parameterData.name + "Value"); + // $scope.inputNgModels[inputElement.ngModelVariable] = Number(parameterData.defaultValue); + + return inputElement; + }; + + function sleep(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); + } + + var buildParameterFormHtml = function(targetScriptMetadata){ + + $scope.computedCustomizedIndicatorGeoJSON = undefined; + $scope.resetProgressBar(); + $scope.inputNgModels = {}; + + // await sleep(1000); + + // try{ + // var processInputFormNode = document.getElementById("processInputForm"); + // // remove old content + // while (processInputFormNode.firstChild) { + // processInputFormNode.removeChild(processInputFormNode.firstChild); + // } + // } + // catch(error){ + // console.error("DOM Element with ID 'processInputForm' was not found"); + // } + + + + //example to create elements via code + + // we must iterate over all process parameters and setup form elements for each input type + // e.g. sliders for range values, checkboxes for boolean + + // var processInputFormNode = document.getElementById("processInputForm"); + + $scope.processInputs = []; + + targetScriptMetadata.variableProcessParameters.forEach(function(parameterData){ + // looks like: + + // { + // "minParameterValueForNumericInputs": 6.027456183070403, + // "maxParameterValueForNumericInputs": 0.8008281904610115, + // "defaultValue": "defaultValue", + // "dataType": "string", + // "name": "name", + // "description": "description" + // } + + // var parameterNode = document.createDocumentFragment(); + + var processInput = {}; + processInput.parameterData = parameterData; + + // var parameterDiv = document.createElement("div"); + // parameterDiv.setAttribute("class", "slidecontainer"); + // + // var parameterLabel = document.createElement("label"); + // parameterLabel.appendChild(document.createTextNode(parameterData.name + ": {{" + parameterData.name + "Value}}")); + // + // var parameterDescription = document.createElement("p"); + // parameterDescription.appendChild(document.createTextNode(parameterData.description)); + // + // parameterDiv.appendChild(parameterLabel); + // parameterDiv.appendChild(parameterDescription); + + // create input element depending on dataType + // dataType can be string, boolean, integer, double + switch(parameterData.dataType) { + case "string": + // parameterDiv.appendChild(createInputAsString(parameterData)); + processInput.inputElement = createInputAsString(parameterData); + break; + case "boolean": + // parameterDiv.appendChild(createInputAsBoolean(parameterData)); + processInput.inputElement = createInputAsBoolean(parameterData); + break; + case "integer": + // parameterDiv.appendChild(createInputAsInteger(parameterData)); + processInput.inputElement = createInputAsInteger(parameterData); + break; + case "double": + // parameterDiv.appendChild(createInputAsDouble(parameterData)); + processInput.inputElement = createInputAsDouble(parameterData); + break; + default: + // parameterDiv.appendChild(createInputAsString(parameterData)); + processInput.inputElement = createInputAsString(parameterData); + } + + $scope.processInputs.push(processInput); + + // $scope[processInput.inputElement.ngModelVariable] = processInput.parameterData.defaultValue; + + // make a bit space after paramter + // parameterDiv.appendChild(document.createElement("p")); + + // processInputFormNode.appendChild(parameterDiv); + }); + + // parameterNode.appendChild(parameterDiv); + + // $scope.$digest(); + }; + + $scope.getScriptMetadataForIndicatorId = function(indicatorId){ + var targetScriptMetadata; + + for (const scriptElement of kommonitorDataExchangeService.availableProcessScripts){ + if (scriptElement.indicatorId === indicatorId){ + targetScriptMetadata = scriptElement; + break; + } + }; + + return targetScriptMetadata; + }; + + $scope.onChangeTargetIndicator = function(){ + + if($scope.targetIndicator){ + $scope.targetIndicator_backup = $scope.targetIndicator; + } + else{ + $scope.targetIndicator = $scope.targetIndicator_backup; + } + + $scope.computedCustomizedIndicatorGeoJSON = undefined; + $scope.resetProgressBar(); + + $scope.targetScriptMetadata = $scope.getScriptMetadataForIndicatorId($scope.targetIndicator.indicatorId); + + buildParameterFormHtml($scope.targetScriptMetadata); + + $scope.setupDateSliderForComputation(); + + if(!$scope.targetSpatialUnit){ + $scope.targetSpatialUnit = $scope.getFirstSpatialUnitForSelectedIndicator(); + } + + // modify guidedTour if required + $rootScope.$broadcast("redrawGuidedTourElement"); + + }; + + $scope.getFirstSpatialUnitForSelectedIndicator = function() { + + var result = undefined; + + var applicableSpatialUnits = $scope.targetIndicator.applicableSpatialUnits; + + for (const spatialUnitEntry of kommonitorDataExchangeService.availableSpatialUnits){ + if(applicableSpatialUnits.some(o => o.spatialUnitName === spatialUnitEntry.spatialUnitLevel)) + result = spatialUnitEntry; + break; + } + + return result; + }; + + $scope.onChangeTargetSpatialUnit = function(){ + + $scope.computedCustomizedIndicatorGeoJSON = undefined; + $scope.resetProgressBar(); + + + buildParameterFormHtml($scope.targetScriptMetadata); + $scope.setupDateSliderForComputation(); + + }; + + $scope.fetchBaseIndicatorMetadata = function(baseIndicatorId){ + for (const indicatorMetadata of kommonitorDataExchangeService.displayableIndicators){ + if(indicatorMetadata.indicatorId === baseIndicatorId) + return indicatorMetadata; + } + } + + $scope.fetchGeoresourceMetadata = function(georesourceId){ + for (const georesourceMetadata of kommonitorDataExchangeService.availableGeoresources){ + if(georesourceMetadata.datasetId === georesourceId) + return georesourceMetadata; + } + } + + $scope.appendDatesFromIndicatorMetadataApplicableDates = function(dates){ + + var indicatorMetadata = $scope.fetchBaseIndicatorMetadata($scope.targetScriptMetadata.indicatorId); + for (const date of indicatorMetadata.applicableDates){ + if(!dates.includes(date)) + dates.push(date); + } + + return dates; + } + + $scope.appendDatesFromBaseIndicators = function(dates){ + + for (const baseIndicatorId of $scope.targetScriptMetadata.requiredIndicatorIds){ + var baseIndicator = $scope.fetchBaseIndicatorMetadata(baseIndicatorId); + for (const date of baseIndicator.applicableDates){ + if(!dates.includes(date)) + dates.push(date); + } + } + + return dates; + } + + $scope.appendDatesFromGeoresources = function(dates){ + + for (const georesourceId of $scope.targetScriptMetadata.requiredGeoresourceIds){ + var georesource = $scope.fetchGeoresourceMetadata(georesourceId); + for (const date of georesource.applicableDates){ + if(!dates.includes(date)) + dates.push(date); + } + } + + return dates; + } + + function dateToTS (date) { + return date.valueOf(); + } + + function tsToDateString (dateAsMs) { + var date = new Date(dateAsMs); + + /** + * TODO FIXME dateSLider formatter will return only year for now to prevent misleading month and day settings + */ + + // return date.getFullYear(); + + return date.toLocaleDateString("de-DE", { + year: 'numeric', + month: 'long', + day: 'numeric' + }); + } + + function dateToDateString (date) { + + /** + * TODO FIXME dateSLider formatter will return only year for now to prevent misleading month and day settings + */ + + // return date.getFullYear(); + + return date.toLocaleDateString("de-DE", { + year: 'numeric', + month: 'long', + day: 'numeric' + }); + } + + function createDatesFromIndicatorDates(indicatorDates) { + + $scope.datesAsMs = []; + + for (var index=0; index < indicatorDates.length; index++){ + // year-month-day + var dateComponents = indicatorDates[index].split("-"); + $scope.datesAsMs.push(dateToTS(new Date(Number(dateComponents[0]), Number(dateComponents[1]) - 1, Number(dateComponents[2])))); + } + return $scope.datesAsMs; + } + + + $scope.setupDateSliderForComputation = function(){ + + if($scope.dateSliderForComputation){ + $scope.dateSliderForComputation.destroy(); + } + + var domNode = document.getElementById("dateSliderForComputation"); + + while (domNode.hasChildNodes()) { + domNode.removeChild(domNode.lastChild); + } + + $scope.availableDates = new Array(); + + // availableDates = $scope.appendDatesFromBaseIndicators(availableDates); + $scope.availableDates = $scope.appendDatesFromIndicatorMetadataApplicableDates($scope.availableDates); + // availableDates = $scope.appendDatesFromGeoresources(availableDates); + + // sort ascending + $scope.availableDates.sort(function(a, b) { + return a - b; + }); + + $scope.date = $scope.availableDates[$scope.availableDates.length - 1]; + $scope.targetDate = $scope.availableDates[$scope.availableDates.length - 1]; + + $scope.datesAsMs = createDatesFromIndicatorDates($scope.availableDates); + + // new Date() uses month between 0-11! + $("#dateSliderForComputation").ionRangeSlider({ + skin: "big", + type: "single", + grid: true, + values: $scope.datesAsMs, + from: $scope.datesAsMs.length -1, // index, not the date + force_edges: true, + prettify: tsToDateString, + onChange: $scope.onChangeDateSliderItem + }); + + $scope.dateSliderForComputation = $("#dateSliderForComputation").data("ionRangeSlider"); + // make sure that the handle is properly set to max value + $scope.dateSliderForComputation.update({ + from: $scope.datesAsMs.length -1 // index, not the date + }); + }; + + $scope.onChangeDateSliderItem = async function(data){ + + $scope.targetDate = $scope.availableDates[data.from]; + $scope.date = $scope.targetDate; + }; + + + $scope.calculateCustomIndicator = function(){ + + $scope.computationStarted = true; + + $scope.computedCustomizedIndicatorGeoJSON = undefined; + $scope.jobInfoText = undefined; + $scope.resetProgressBar(); + + $scope.stopLoop = false; + + console.log("calculateCustomIndicator called!"); + + $scope.loadingData = true; + // example request model + + // { + // "targetSpatialUnitId": "targetSpatialUnitId", + // "scriptId": "scriptId", + // "customProcessProperties": [ + // { + // "dataType": "string", + // "name": "name", + // "value": "customValue" + // }, + // { + // "dataType": "string", + // "name": "name", + // "value": "customValue" + // } + // ], + // "targetDate": "2000-01-23", + // "georesourceIds": [ + // "georesourceIds", + // "georesourceIds" + // ], + // "baseIndicatorIds": [ + // "baseIndicatorIds", + // "baseIndicatorIds" + // ] + // } + + var processingInput = {}; + processingInput.targetSpatialUnitId = $scope.targetSpatialUnit.spatialUnitId; + processingInput.scriptId = $scope.targetScriptMetadata.scriptId; + processingInput.targetDate = $scope.targetDate; + processingInput.georesourceIds = $scope.targetScriptMetadata.requiredGeoresourceIds; + processingInput.baseIndicatorIds = $scope.targetScriptMetadata.requiredIndicatorIds; + processingInput.customProcessProperties = new Array(); + + $scope.targetScriptMetadata.variableProcessParameters.forEach(function(processParam){ + // now get name of parameter + // then seach for input element within DOM with id=name + // get value of that DOM element and create parameter object + var scriptParam = {}; + scriptParam.name = processParam.name; + scriptParam.dataType = processParam.dataType; + scriptParam.value = document.getElementById(scriptParam.name).value; + + processingInput.customProcessProperties.push(scriptParam); + }); + + console.log("created URL POST body for CUSTOM PROCESSING: " + processingInput); + + $scope.indicatorName = $scope.targetIndicator.indicatorName; + $scope.spatialUnitName = $scope.targetSpatialUnit.spatialUnitLevel; + $scope.date = $scope.targetDate; + + $http({ + url: targetURL, + method: "POST", + headers: { + 'Content-Type': 'application/json' + }, + data: processingInput + }).then(async function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + console.log("success callback for customizable indicator comutation"); + // get location header to achieve jobId + var jobId = response.headers('Location'); + + await sleep(300); + + $scope.showInitialJobStatus(jobId); + + $timeout(function(){ + + $scope.loadingData = false; + }); + + $scope.pendForResult(jobId); + + // $scope.downloadGeoJSON(geoJSON_string); + + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.error = error.statusText; + + kommonitorDataExchangeService.displayMapApplicationError(error); + + $timeout(function(){ + + $scope.loadingData = false; + }); + }); + + } + + $scope.showInitialJobStatus = function(jobId){ + + $http({ + url: targetURL + "/" + jobId, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + console.log("success callback for showInitialJobStatus"); + $scope.jobInfoText = "Berechnung begonnen. Siehe Fortschrittsbalken."; + + if(response.data.progress) + $scope.updateProgressBar(response.data.progress); + + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.error = error.data.error; + + kommonitorDataExchangeService.displayMapApplicationError(error); + + $scope.loadingData = false; + }); + }; + + $scope.pendForResult = async function(jobId){ + + var sleepTimeInMS = 1000; + + + while(!$scope.computedCustomizedIndicatorGeoJSON && !$scope.stopLoop){ + + if($scope.stopLoop) + break; + + $http({ + url: targetURL + '/' + jobId, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + console.log("success callback for pendForResult"); + + if(response.data.status === "failed"){ + $scope.error = response.data.error; + console.error(response.data.error); + $scope.stopLoop = true; + return; + } + + if(response.data.progress) + $scope.updateProgressBar(response.data.progress); + + + if(response.data.progress === 100 || response.data.status === "succeeded"){ + var geoJSON_base64 = response.data.result_geoJSON_base64; + // first decode Base64 and then parse string as JSON + $scope.computedCustomizedIndicatorGeoJSON = JSON.parse(atob(geoJSON_base64)); + $scope.jobInfoText = undefined; + $scope.stopLoop = true; + + $scope.prepareDownloadGeoJSON(); + + // $scope.$digest(); + } + + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.error = error.data.error; + console.error(error.data.error); + kommonitorDataExchangeService.displayMapApplicationError(error); + $scope.stopLoop = true; + $scope.loadingData = false; + return; + + + }); + + if ($scope.computedCustomizedIndicatorGeoJSON) + return; + + await sleep(sleepTimeInMS); + } + + }; + + $scope.updateProgressBar = function(progress){ + var progressBarNode = document.getElementById("customComputationProgressBar"); + + progressBarNode.setAttribute("aria-valuenow", ""+progress); + progressBarNode.setAttribute("style", "width:"+progress+"%"); + progressBarNode.textContent = progress + "% Fortschritt"; + // $scope.progress = progress; + }; + + $scope.resetProgressBar = function(){ + var progressBarNode = document.getElementById("customComputationProgressBar"); + + progressBarNode.setAttribute("aria-valuenow", "0"); + progressBarNode.setAttribute("style", "width:0%"); + progressBarNode.textContent = "0% Fortschritt"; + // $scope.progress = 0; + }; + + $scope.addComputedIndicatorToMap = function(){ + console.log("Adding customized indicator to map."); + + $scope.targetIndicator.geoJSON = $scope.computedCustomizedIndicatorGeoJSON; + kommonitorDataExchangeService.selectedIndicator = $scope.targetIndicator; + // kommonitorMapService.addCustomIndicatorGeoJSON($scope.targetIndicator, $scope.targetSpatialUnit.spatialUnitLevel, $scope.targetDate); + kommonitorMapService.replaceIndicatorGeoJSON($scope.targetIndicator, $scope.targetSpatialUnit.spatialUnitLevel, $scope.targetDate, false, true); + }; + + $scope.prepareDownloadGeoJSON = function(){ + + console.log("removing old download button if available") + if(document.getElementById("downloadComputedIndicator")) + document.getElementById("downloadComputedIndicator").remove(); + + var geoJSON_string = JSON.stringify($scope.computedCustomizedIndicatorGeoJSON); + + var fileName = $scope.indicatorName + "_" + $scope.spatialUnitName + "_" + $scope.date + "_CUSTOM.geojson"; + // var fileName = "export.geojson" + + // if (!geoJSON_string.match(/^data:application\/vnd.geo+json/i)) { + // geoJSON_string = 'data:application/vnd.geo+json;charset=utf-8,' + geoJSON_string; + // } + // data = encodeURI(geoJSON_string); + + var blob = new Blob([geoJSON_string], {type: "application/json"}); + var data = URL.createObjectURL(blob); + // + // $scope.indicatorDownloadURL = data; + // $scope.indicatorDownloadName = fileName; + + console.log("create new Download button and append it to DOM"); + var a = document.createElement('a'); + a.download = fileName; + a.href = data; + a.textContent = "Download GeoJSON"; + a.id = "downloadComputedIndicator"; + a.setAttribute("class", "btn btn-primary"); + + document.getElementById('indicatorOutput').appendChild(a); + } + + $scope.downloadGeoJSON = function(){ + + var geoJSON_string = JSON.stringify($scope.computedCustomizedIndicatorGeoJSON); + + filename = $scope.targetIndicator.indicatorName + "_" + $scope.targetSpatialUnit.spatialUnitLevel + "_" + $scope.targetDate + "_CUSTOM.geojson"; + + if (!geoJSON_string.match(/^data:application\/vnd.geo+json/i)) { + geoJSON_string = 'data:application/vnd.geo+json;charset=utf-8,' + geoJSON_string; + } + data = encodeURI(geoJSON_string); + + link = document.createElement('a'); + link.setAttribute('href', data); + link.setAttribute('download', filename); + + document.body.appendChild(link); + + console.log("Trigger download"); + + link.click(); + } + + }] + }); diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorIndividualIndicatorComputation/kommonitor-individual-indicator-computation.module.js b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorIndividualIndicatorComputation/kommonitor-individual-indicator-computation.module.js index fd566b6a8..f2b94d24c 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorIndividualIndicatorComputation/kommonitor-individual-indicator-computation.module.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorIndividualIndicatorComputation/kommonitor-individual-indicator-computation.module.js @@ -1,15 +1,16 @@ +"use strict"; angular.module('kommonitorIndividualIndicatorComputation', ['kommonitorDataExchange']) - -.directive('stringToNumber', function() { - return { - require: 'ngModel', - link: function(scope, element, attrs, ngModel) { - ngModel.$parsers.push(function(value) { - return parseFloat(value); - }); - ngModel.$formatters.push(function(value) { - return '' + value; - }); - } - }; + .directive('stringToNumber', function () { + return { + require: 'ngModel', + link: function (scope, element, attrs, ngModel) { + ngModel.$parsers.push(function (value) { + return parseFloat(value); + }); + ngModel.$formatters.push(function (value) { + return '' + value; + }); + } + }; }); +//# sourceMappingURL=kommonitor-individual-indicator-computation.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorIndividualIndicatorComputation/kommonitor-individual-indicator-computation.module.js.map b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorIndividualIndicatorComputation/kommonitor-individual-indicator-computation.module.js.map new file mode 100644 index 000000000..11677fcf9 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorIndividualIndicatorComputation/kommonitor-individual-indicator-computation.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-individual-indicator-computation.module.js","sourceRoot":"","sources":["kommonitor-individual-indicator-computation.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,0CAA0C,EAAE,CAAC,wBAAwB,CAAC,CAAC;KAErF,SAAS,CAAC,gBAAgB,EAAE;IAC3B,OAAO;QACL,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,UAAS,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO;YAC3C,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAS,KAAK;gBAClC,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC;YAC3B,CAAC,CAAC,CAAC;YACH,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,UAAS,KAAK;gBACrC,OAAO,EAAE,GAAG,KAAK,CAAC;YACpB,CAAC,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorIndividualIndicatorComputation/kommonitor-individual-indicator-computation.module.ts b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorIndividualIndicatorComputation/kommonitor-individual-indicator-computation.module.ts new file mode 100644 index 000000000..fd566b6a8 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorIndividualIndicatorComputation/kommonitor-individual-indicator-computation.module.ts @@ -0,0 +1,15 @@ +angular.module('kommonitorIndividualIndicatorComputation', ['kommonitorDataExchange']) + +.directive('stringToNumber', function() { + return { + require: 'ngModel', + link: function(scope, element, attrs, ngModel) { + ngModel.$parsers.push(function(value) { + return parseFloat(value); + }); + ngModel.$formatters.push(function(value) { + return '' + value; + }); + } + }; +}); diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorLegend/kommonitor-legend.component.js b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorLegend/kommonitor-legend.component.js index 3293791f4..5836e1e7a 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorLegend/kommonitor-legend.component.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorLegend/kommonitor-legend.component.js @@ -1,381 +1,300 @@ +"use strict"; angular - .module('kommonitorLegend') - .component( - 'kommonitorLegend', - { - templateUrl : "components/kommonitorUserInterface/kommonitorControls/kommonitorLegend/kommonitor-legend.template.html", - /* - * injected with a modules service method that manages - * enabled tabs - */ - controller : ['$scope', '$rootScope', 'kommonitorMapService', 'kommonitorVisualStyleHelperService', - 'kommonitorDataExchangeService', 'kommonitorDiagramHelperService', 'kommonitorElementVisibilityHelperService', - 'kommonitorFilterHelperService', '__env', '$timeout', '$sce', 'kommonitorShareHelperService', - function KommonitorLegendController($scope, $rootScope, kommonitorMapService, - kommonitorVisualStyleHelperService, kommonitorDataExchangeService, kommonitorDiagramHelperService, kommonitorElementVisibilityHelperService, - kommonitorFilterHelperService, __env, $timeout, $sce, kommonitorShareHelperService) { - - const INDICATOR_DATE_PREFIX = __env.indicatorDatePrefix; - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorMapServiceInstance = kommonitorMapService; - this.kommonitorVisualStyleHelperServiceInstance = kommonitorVisualStyleHelperService; - this.kommonitorElementVisibilityHelperServiceInstance = kommonitorElementVisibilityHelperService; - this.kommonitorFilterHelperServiceInstance = kommonitorFilterHelperService; - this.kommonitorShareHelperServiceInstance = kommonitorShareHelperService; - this.envInstance = __env; - - this.env = __env; - $scope.svgString_outlierLow = $sce.trustAsHtml('Sorry, your browser does not support inline SVG.'); - $scope.svgString_outlierHigh = $sce.trustAsHtml('Sorry, your browser does not support inline SVG.'); - - - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - $rootScope.$on( "updateLegendDisplay", function(event, containsZeroValues, containsNegativeValues, containsNoData, containsOutliers_high, containsOutliers_low, outliers_low, outliers_high, selectedDate) { - $scope.containsZeroValues = containsZeroValues; - $scope.containsNegativeValues = containsNegativeValues; - $scope.containsOutliers_high = containsOutliers_high; - $scope.containsOutliers_low = containsOutliers_low; - $scope.outliers_high = outliers_high; - $scope.outliers_low = outliers_low; - $scope.containsNoData = containsNoData; - var dateComponents = selectedDate.split("-"); - $scope.dateAsDate = new Date(Number(dateComponents[0]), Number(dateComponents[1]) - 1, Number(dateComponents[2])); - - }); - - $scope.onChangeIndicatorDatepickerDate = function(){ - $rootScope.$broadcast("changeIndicatorDate"); - }; - - - $scope.filterSpatialUnits = function(){ - return function( item ) { - return kommonitorDataExchangeService.isAllowedSpatialUnitForCurrentIndicator(item); - }; - }; - - $scope.makeOutliersLowLegendString = function(outliersArray) { - if (outliersArray.length > 1) { - - return "(" + kommonitorDataExchangeService.getIndicatorValue_asFormattedText(outliersArray[0]) + " - " + kommonitorDataExchangeService.getIndicatorValue_asFormattedText(outliersArray[outliersArray.length - 1]) + ")"; - } - else { - return "(" + kommonitorDataExchangeService.getIndicatorValue_asFormattedText(outliersArray[0]) + ")"; - } - }; - - $scope.makeOutliersHighLegendString = function(outliersArray) { - if (outliersArray.length > 1) { - return "(" + kommonitorDataExchangeService.getIndicatorValue_asFormattedText(outliersArray[0]) + " - " + kommonitorDataExchangeService.getIndicatorValue_asFormattedText(outliersArray[outliersArray.length - 1]) + ")"; - } - else { - return "(" + kommonitorDataExchangeService.getIndicatorValue_asFormattedText(outliersArray[0]) + ")"; - } - }; - - $scope.onChangeSelectedSpatialUnit = function(){ - - $rootScope.$broadcast("changeSpatialUnit"); - - if(__env.enableSpatialUnitNotificationSelection) { - if(! (localStorage.getItem("hideKomMonitorSpatialUnitNotification") === "true")) { - let selectedSpatialUnitName = kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel; - if(__env.spatialUnitNotificationSelection.includes(selectedSpatialUnitName)) { - $('#spatialUnitNotificationModal').modal('show'); - } - } - } - }; - - - $scope.showSpatialUnitNotificationModalIfEnabled = function() { - if(__env.enableSpatialUnitNotificationSelection) { - $('#spatialUnitNotificationModal').modal('show'); - } - } - - $(document).on('click', '#controlIndicatorClassifyOption_wholeTimeseries', function (e) { - var wholeTimeseriesClassificationCheckbox = document.getElementById('controlIndicatorClassifyOption_wholeTimeseries'); - if (wholeTimeseriesClassificationCheckbox.checked) { - kommonitorDataExchangeService.classifyUsingWholeTimeseries = true; - } - else { - kommonitorDataExchangeService.classifyUsingWholeTimeseries = false; - } - $rootScope.$broadcast("restyleCurrentLayer", false); - }); - - $(document).on('input change', '#indicatorTransparencyInput', function (e) { - e.stopImmediatePropagation(); - var indicatorMetadata = kommonitorDataExchangeService.selectedIndicator; - - var transparency = document.getElementById("indicatorTransparencyInput").value; - var opacity = 1 - transparency; - - $rootScope.$broadcast("adjustOpacityForIndicatorLayer", indicatorMetadata, opacity); - }); - - $(document).on('click', '#radiojenks', function (e) { - $rootScope.$broadcast("changeClassifyMethod", "jenks"); - }); - - $(document).on('click', '#radioquantile', function (e) { - $rootScope.$broadcast("changeClassifyMethod", "quantile"); - }); - - $(document).on('click', '#radioequal_interval', function (e) { - $rootScope.$broadcast("changeClassifyMethod", "equal_interval"); - }); - - $scope.onClickDownloadMetadata = async function(){ - // create PDF from currently selected/displayed indicator! - var indicatorMetadata = kommonitorDataExchangeService.selectedIndicator; - var pdfName = indicatorMetadata.indicatorName + ".pdf"; - var jspdf = await kommonitorDataExchangeService.generateIndicatorMetadataPdf(indicatorMetadata, pdfName); - jspdf.save(pdfName); - }; - - function prepareBalanceGeoJSON(geoJSON, indicatorMetadataAsBalance){ - var fromDate = indicatorMetadataAsBalance["fromDate"]; - var toDate = indicatorMetadataAsBalance["toDate"]; - var targetDate = kommonitorDataExchangeService.selectedDate; - - for (var feature of geoJSON.features) { - var properties = feature.properties; - - var targetValue = properties[kommonitorDataExchangeService.indicatorDatePrefix + targetDate]; - properties["balance"] = targetValue; - - // rename all properties due to char limit in shaoefiles - var keys = Object.keys(properties); - - for (var key of keys) { - if (key.toLowerCase().includes("date_")) { - // from DATE_2018-01-01 - // to 20180101 - delete properties[key]; - } - } - - // replace properties with the one with new keys - feature.properties = properties; - } - - return geoJSON; - } - - $scope.downloadIndicatorAsGeoJSON = function () { - - var fileName = kommonitorDataExchangeService.selectedIndicator.indicatorName + "_" + kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel; - - var geoJSON_string; - var geoJSON; - - if(kommonitorDataExchangeService.isBalanceChecked){ - geoJSON = jQuery.extend(true, {}, kommonitorDataExchangeService.indicatorAndMetadataAsBalance.geoJSON); - geoJSON = prepareBalanceGeoJSON(geoJSON, kommonitorDataExchangeService.indicatorAndMetadataAsBalance); - geoJSON_string = JSON.stringify(geoJSON); - fileName += "_Bilanz" + kommonitorDataExchangeService.indicatorAndMetadataAsBalance['fromDate'] + " - " + kommonitorDataExchangeService.indicatorAndMetadataAsBalance['toDate']; - } - else{ - geoJSON_string = JSON.stringify(kommonitorDataExchangeService.selectedIndicator.geoJSON); - fileName += "_" + kommonitorDataExchangeService.selectedDate; - } - - kommonitorDataExchangeService.generateAndDownloadIndicatorZIP(geoJSON_string, fileName, ".geojson", {}); - }; - - $scope.downloadIndicatorAsShape = function () { - - var fileName = kommonitorDataExchangeService.selectedIndicator.indicatorName + "_" + kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel; - var polygonName = kommonitorDataExchangeService.selectedIndicator.indicatorName + "_" + kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel; - - var options = { - folder: "shape", - types: { - point: 'points', - polygon: polygonName, - line: 'lines' - } - }; - - var geoJSON; - - if(kommonitorDataExchangeService.isBalanceChecked){ - geoJSON = jQuery.extend(true, {}, kommonitorDataExchangeService.indicatorAndMetadataAsBalance.geoJSON); - geoJSON = prepareBalanceGeoJSON(geoJSON, kommonitorDataExchangeService.indicatorAndMetadataAsBalance); - fileName += "_Bilanz_" + kommonitorDataExchangeService.indicatorAndMetadataAsBalance['fromDate'] + " - " + kommonitorDataExchangeService.indicatorAndMetadataAsBalance['toDate']; - } - else{ - geoJSON = jQuery.extend(true, {}, kommonitorDataExchangeService.selectedIndicator.geoJSON); - fileName += "_" + kommonitorDataExchangeService.selectedDate; - } - - for (var feature of geoJSON.features) { - var properties = feature.properties; - - // rename all properties due to char limit in shaoefiles - var keys = Object.keys(properties); - - for (var key of keys) { - var newKey = undefined; - if (key.toLowerCase().includes("featureid")) { - newKey = "ID"; - } - else if (key.toLowerCase().includes("featurename")) { - newKey = "NAME"; - } - else if (key.toLowerCase().includes("date_")) { - // from DATE_2018-01-01 - // to 20180101 - newKey = key.split("_")[1].replace(/-|\s/g, ""); - } - else if (key.toLowerCase().includes("startdate")) { - newKey = "validFrom"; - } - else if (key.toLowerCase().includes("enddate")) { - newKey = "validTo"; - } - - if (newKey) { - properties[newKey] = properties[key]; - delete properties[key]; - } - } - - // replace properties with the one with new keys - feature.properties = properties; - } - - // shpwrite.download(geoJSON, options); - var arrayBuffer = shpwrite.zip(geoJSON, options); - kommonitorDataExchangeService.generateAndDownloadIndicatorZIP(arrayBuffer, fileName, "_shape.zip", {base64: true}); - }; - - $scope.downloadIndicatorAsCSV = function () { - - var fileName = kommonitorDataExchangeService.selectedIndicator.indicatorName + "_" + kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel; - - var geoJSON; - - if(kommonitorDataExchangeService.isBalanceChecked){ - geoJSON = jQuery.extend(true, {}, kommonitorDataExchangeService.indicatorAndMetadataAsBalance.geoJSON); - geoJSON = prepareBalanceGeoJSON(geoJSON, kommonitorDataExchangeService.indicatorAndMetadataAsBalance); - fileName += "_Bilanz_" + kommonitorDataExchangeService.indicatorAndMetadataAsBalance['fromDate'] + " - " + kommonitorDataExchangeService.indicatorAndMetadataAsBalance['toDate']; - } - else{ - geoJSON = jQuery.extend(true, {}, kommonitorDataExchangeService.selectedIndicator.geoJSON); - fileName += "_" + kommonitorDataExchangeService.selectedDate; - } - - var items = []; - - for (var feature of geoJSON.features) { - var properties = feature.properties; - - // rename all properties due to char limit in shaoefiles - var keys = Object.keys(properties); - - for (var key of keys) { - var newKey = undefined; - if (key.toLowerCase().includes("featureid")) { - newKey = "ID"; - } - else if (key.toLowerCase().includes("featurename")) { - newKey = "NAME"; - } - else if (key.toLowerCase().includes("date_")) { - // from DATE_2018-01-01 - // to 2018-01-01 - newKey = key.split("_")[1]; - } - else if (key.toLowerCase().includes("startdate")) { - newKey = "validFrom"; - } - else if (key.toLowerCase().includes("enddate")) { - newKey = "validTo"; - } - - if (newKey) { - properties[newKey] = properties[key]; - delete properties[key]; - } - } - - // replace properties with the one with new keys - feature.properties = properties; - - items.push(properties); - } - - var headers = {}; - - for (const key in items[0]) { - if (Object.hasOwnProperty.call(items[0], key)) { - headers[key] = key; - } - } - - exportCSVFile(headers, items, fileName); - }; - - function convertToCSV(objArray) { - var array = typeof objArray != 'object' ? JSON.parse(objArray) : objArray; - var str = ''; - - for (var i = 0; i < array.length; i++) { - var line = ''; - for (var index in array[i]) { - if (line != '') line += ';'; - - line += array[i][index]; - } - - str += line + '\r\n'; - } - - return str; - } - - function exportCSVFile(headers, items, fileTitle) { - if (headers) { - items.unshift(headers); - } - - // Convert Object to JSON - var jsonObject = JSON.stringify(items); - - var csv = convertToCSV(jsonObject); - - kommonitorDataExchangeService.generateAndDownloadIndicatorZIP(csv, fileTitle, ".csv", {}); - } - - $scope.onClickShareLinkButton = function(){ - - kommonitorShareHelperService.generateCurrentShareLink(); - - /* Copy to clipboard */ - if(navigator && navigator.clipboard){ - navigator.clipboard.writeText(kommonitorShareHelperService.currentShareLink); - - // Get the snackbar DIV - var x = document.getElementById("snackbar"); - - // Add the "show" class to DIV - x.className = "show"; - - // After 3 seconds, remove the show class from DIV - setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); - } - else{ - // open in new tab - window.open(kommonitorShareHelperService.currentShareLink, '_blank'); - } - - }; - - - }] - }); + .module('kommonitorLegend') + .component('kommonitorLegend', { + templateUrl: "components/kommonitorUserInterface/kommonitorControls/kommonitorLegend/kommonitor-legend.template.html", + /* + * injected with a modules service method that manages + * enabled tabs + */ + controller: ['$scope', '$rootScope', 'kommonitorMapService', 'kommonitorVisualStyleHelperService', + 'kommonitorDataExchangeService', 'kommonitorDiagramHelperService', 'kommonitorElementVisibilityHelperService', + 'kommonitorFilterHelperService', '__env', '$timeout', '$sce', 'kommonitorShareHelperService', + function KommonitorLegendController($scope, $rootScope, kommonitorMapService, kommonitorVisualStyleHelperService, kommonitorDataExchangeService, kommonitorDiagramHelperService, kommonitorElementVisibilityHelperService, kommonitorFilterHelperService, __env, $timeout, $sce, kommonitorShareHelperService) { + const INDICATOR_DATE_PREFIX = __env.indicatorDatePrefix; + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorMapServiceInstance = kommonitorMapService; + this.kommonitorVisualStyleHelperServiceInstance = kommonitorVisualStyleHelperService; + this.kommonitorElementVisibilityHelperServiceInstance = kommonitorElementVisibilityHelperService; + this.kommonitorFilterHelperServiceInstance = kommonitorFilterHelperService; + this.kommonitorShareHelperServiceInstance = kommonitorShareHelperService; + this.envInstance = __env; + this.env = __env; + $scope.svgString_outlierLow = $sce.trustAsHtml('Sorry, your browser does not support inline SVG.'); + $scope.svgString_outlierHigh = $sce.trustAsHtml('Sorry, your browser does not support inline SVG.'); + // initialize any adminLTE box widgets + $('.box').boxWidget(); + $rootScope.$on("updateLegendDisplay", function (event, containsZeroValues, containsNegativeValues, containsNoData, containsOutliers_high, containsOutliers_low, outliers_low, outliers_high, selectedDate) { + $scope.containsZeroValues = containsZeroValues; + $scope.containsNegativeValues = containsNegativeValues; + $scope.containsOutliers_high = containsOutliers_high; + $scope.containsOutliers_low = containsOutliers_low; + $scope.outliers_high = outliers_high; + $scope.outliers_low = outliers_low; + $scope.containsNoData = containsNoData; + var dateComponents = selectedDate.split("-"); + $scope.dateAsDate = new Date(Number(dateComponents[0]), Number(dateComponents[1]) - 1, Number(dateComponents[2])); + }); + $scope.onChangeIndicatorDatepickerDate = function () { + $rootScope.$broadcast("changeIndicatorDate"); + }; + $scope.filterSpatialUnits = function () { + return function (item) { + return kommonitorDataExchangeService.isAllowedSpatialUnitForCurrentIndicator(item); + }; + }; + $scope.makeOutliersLowLegendString = function (outliersArray) { + if (outliersArray.length > 1) { + return "(" + kommonitorDataExchangeService.getIndicatorValue_asFormattedText(outliersArray[0]) + " - " + kommonitorDataExchangeService.getIndicatorValue_asFormattedText(outliersArray[outliersArray.length - 1]) + ")"; + } + else { + return "(" + kommonitorDataExchangeService.getIndicatorValue_asFormattedText(outliersArray[0]) + ")"; + } + }; + $scope.makeOutliersHighLegendString = function (outliersArray) { + if (outliersArray.length > 1) { + return "(" + kommonitorDataExchangeService.getIndicatorValue_asFormattedText(outliersArray[0]) + " - " + kommonitorDataExchangeService.getIndicatorValue_asFormattedText(outliersArray[outliersArray.length - 1]) + ")"; + } + else { + return "(" + kommonitorDataExchangeService.getIndicatorValue_asFormattedText(outliersArray[0]) + ")"; + } + }; + $scope.onChangeSelectedSpatialUnit = function () { + $rootScope.$broadcast("changeSpatialUnit"); + if (__env.enableSpatialUnitNotificationSelection) { + if (!(localStorage.getItem("hideKomMonitorSpatialUnitNotification") === "true")) { + let selectedSpatialUnitName = kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel; + if (__env.spatialUnitNotificationSelection.includes(selectedSpatialUnitName)) { + $('#spatialUnitNotificationModal').modal('show'); + } + } + } + }; + $scope.showSpatialUnitNotificationModalIfEnabled = function () { + if (__env.enableSpatialUnitNotificationSelection) { + $('#spatialUnitNotificationModal').modal('show'); + } + }; + $(document).on('click', '#controlIndicatorClassifyOption_wholeTimeseries', function (e) { + var wholeTimeseriesClassificationCheckbox = document.getElementById('controlIndicatorClassifyOption_wholeTimeseries'); + if (wholeTimeseriesClassificationCheckbox.checked) { + kommonitorDataExchangeService.classifyUsingWholeTimeseries = true; + } + else { + kommonitorDataExchangeService.classifyUsingWholeTimeseries = false; + } + $rootScope.$broadcast("restyleCurrentLayer", false); + }); + $(document).on('input change', '#indicatorTransparencyInput', function (e) { + e.stopImmediatePropagation(); + var indicatorMetadata = kommonitorDataExchangeService.selectedIndicator; + var transparency = document.getElementById("indicatorTransparencyInput").value; + var opacity = 1 - transparency; + $rootScope.$broadcast("adjustOpacityForIndicatorLayer", indicatorMetadata, opacity); + }); + $(document).on('click', '#radiojenks', function (e) { + $rootScope.$broadcast("changeClassifyMethod", "jenks"); + }); + $(document).on('click', '#radioquantile', function (e) { + $rootScope.$broadcast("changeClassifyMethod", "quantile"); + }); + $(document).on('click', '#radioequal_interval', function (e) { + $rootScope.$broadcast("changeClassifyMethod", "equal_interval"); + }); + $scope.onClickDownloadMetadata = async function () { + // create PDF from currently selected/displayed indicator! + var indicatorMetadata = kommonitorDataExchangeService.selectedIndicator; + var pdfName = indicatorMetadata.indicatorName + ".pdf"; + var jspdf = await kommonitorDataExchangeService.generateIndicatorMetadataPdf(indicatorMetadata, pdfName); + jspdf.save(pdfName); + }; + function prepareBalanceGeoJSON(geoJSON, indicatorMetadataAsBalance) { + var fromDate = indicatorMetadataAsBalance["fromDate"]; + var toDate = indicatorMetadataAsBalance["toDate"]; + var targetDate = kommonitorDataExchangeService.selectedDate; + for (var feature of geoJSON.features) { + var properties = feature.properties; + var targetValue = properties[kommonitorDataExchangeService.indicatorDatePrefix + targetDate]; + properties["balance"] = targetValue; + // rename all properties due to char limit in shaoefiles + var keys = Object.keys(properties); + for (var key of keys) { + if (key.toLowerCase().includes("date_")) { + // from DATE_2018-01-01 + // to 20180101 + delete properties[key]; + } + } + // replace properties with the one with new keys + feature.properties = properties; + } + return geoJSON; + } + $scope.downloadIndicatorAsGeoJSON = function () { + var fileName = kommonitorDataExchangeService.selectedIndicator.indicatorName + "_" + kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel; + var geoJSON_string; + var geoJSON; + if (kommonitorDataExchangeService.isBalanceChecked) { + geoJSON = jQuery.extend(true, {}, kommonitorDataExchangeService.indicatorAndMetadataAsBalance.geoJSON); + geoJSON = prepareBalanceGeoJSON(geoJSON, kommonitorDataExchangeService.indicatorAndMetadataAsBalance); + geoJSON_string = JSON.stringify(geoJSON); + fileName += "_Bilanz" + kommonitorDataExchangeService.indicatorAndMetadataAsBalance['fromDate'] + " - " + kommonitorDataExchangeService.indicatorAndMetadataAsBalance['toDate']; + } + else { + geoJSON_string = JSON.stringify(kommonitorDataExchangeService.selectedIndicator.geoJSON); + fileName += "_" + kommonitorDataExchangeService.selectedDate; + } + kommonitorDataExchangeService.generateAndDownloadIndicatorZIP(geoJSON_string, fileName, ".geojson", {}); + }; + $scope.downloadIndicatorAsShape = function () { + var fileName = kommonitorDataExchangeService.selectedIndicator.indicatorName + "_" + kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel; + var polygonName = kommonitorDataExchangeService.selectedIndicator.indicatorName + "_" + kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel; + var options = { + folder: "shape", + types: { + point: 'points', + polygon: polygonName, + line: 'lines' + } + }; + var geoJSON; + if (kommonitorDataExchangeService.isBalanceChecked) { + geoJSON = jQuery.extend(true, {}, kommonitorDataExchangeService.indicatorAndMetadataAsBalance.geoJSON); + geoJSON = prepareBalanceGeoJSON(geoJSON, kommonitorDataExchangeService.indicatorAndMetadataAsBalance); + fileName += "_Bilanz_" + kommonitorDataExchangeService.indicatorAndMetadataAsBalance['fromDate'] + " - " + kommonitorDataExchangeService.indicatorAndMetadataAsBalance['toDate']; + } + else { + geoJSON = jQuery.extend(true, {}, kommonitorDataExchangeService.selectedIndicator.geoJSON); + fileName += "_" + kommonitorDataExchangeService.selectedDate; + } + for (var feature of geoJSON.features) { + var properties = feature.properties; + // rename all properties due to char limit in shaoefiles + var keys = Object.keys(properties); + for (var key of keys) { + var newKey = undefined; + if (key.toLowerCase().includes("featureid")) { + newKey = "ID"; + } + else if (key.toLowerCase().includes("featurename")) { + newKey = "NAME"; + } + else if (key.toLowerCase().includes("date_")) { + // from DATE_2018-01-01 + // to 20180101 + newKey = key.split("_")[1].replace(/-|\s/g, ""); + } + else if (key.toLowerCase().includes("startdate")) { + newKey = "validFrom"; + } + else if (key.toLowerCase().includes("enddate")) { + newKey = "validTo"; + } + if (newKey) { + properties[newKey] = properties[key]; + delete properties[key]; + } + } + // replace properties with the one with new keys + feature.properties = properties; + } + // shpwrite.download(geoJSON, options); + var arrayBuffer = shpwrite.zip(geoJSON, options); + kommonitorDataExchangeService.generateAndDownloadIndicatorZIP(arrayBuffer, fileName, "_shape.zip", { base64: true }); + }; + $scope.downloadIndicatorAsCSV = function () { + var fileName = kommonitorDataExchangeService.selectedIndicator.indicatorName + "_" + kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel; + var geoJSON; + if (kommonitorDataExchangeService.isBalanceChecked) { + geoJSON = jQuery.extend(true, {}, kommonitorDataExchangeService.indicatorAndMetadataAsBalance.geoJSON); + geoJSON = prepareBalanceGeoJSON(geoJSON, kommonitorDataExchangeService.indicatorAndMetadataAsBalance); + fileName += "_Bilanz_" + kommonitorDataExchangeService.indicatorAndMetadataAsBalance['fromDate'] + " - " + kommonitorDataExchangeService.indicatorAndMetadataAsBalance['toDate']; + } + else { + geoJSON = jQuery.extend(true, {}, kommonitorDataExchangeService.selectedIndicator.geoJSON); + fileName += "_" + kommonitorDataExchangeService.selectedDate; + } + var items = []; + for (var feature of geoJSON.features) { + var properties = feature.properties; + // rename all properties due to char limit in shaoefiles + var keys = Object.keys(properties); + for (var key of keys) { + var newKey = undefined; + if (key.toLowerCase().includes("featureid")) { + newKey = "ID"; + } + else if (key.toLowerCase().includes("featurename")) { + newKey = "NAME"; + } + else if (key.toLowerCase().includes("date_")) { + // from DATE_2018-01-01 + // to 2018-01-01 + newKey = key.split("_")[1]; + } + else if (key.toLowerCase().includes("startdate")) { + newKey = "validFrom"; + } + else if (key.toLowerCase().includes("enddate")) { + newKey = "validTo"; + } + if (newKey) { + properties[newKey] = properties[key]; + delete properties[key]; + } + } + // replace properties with the one with new keys + feature.properties = properties; + items.push(properties); + } + var headers = {}; + for (const key in items[0]) { + if (Object.hasOwnProperty.call(items[0], key)) { + headers[key] = key; + } + } + exportCSVFile(headers, items, fileName); + }; + function convertToCSV(objArray) { + var array = typeof objArray != 'object' ? JSON.parse(objArray) : objArray; + var str = ''; + for (var i = 0; i < array.length; i++) { + var line = ''; + for (var index in array[i]) { + if (line != '') + line += ';'; + line += array[i][index]; + } + str += line + '\r\n'; + } + return str; + } + function exportCSVFile(headers, items, fileTitle) { + if (headers) { + items.unshift(headers); + } + // Convert Object to JSON + var jsonObject = JSON.stringify(items); + var csv = convertToCSV(jsonObject); + kommonitorDataExchangeService.generateAndDownloadIndicatorZIP(csv, fileTitle, ".csv", {}); + } + $scope.onClickShareLinkButton = function () { + kommonitorShareHelperService.generateCurrentShareLink(); + /* Copy to clipboard */ + if (navigator && navigator.clipboard) { + navigator.clipboard.writeText(kommonitorShareHelperService.currentShareLink); + // Get the snackbar DIV + var x = document.getElementById("snackbar"); + // Add the "show" class to DIV + x.className = "show"; + // After 3 seconds, remove the show class from DIV + setTimeout(function () { x.className = x.className.replace("show", ""); }, 3000); + } + else { + // open in new tab + window.open(kommonitorShareHelperService.currentShareLink, '_blank'); + } + }; + }] +}); +//# sourceMappingURL=kommonitor-legend.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorLegend/kommonitor-legend.component.js.map b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorLegend/kommonitor-legend.component.js.map new file mode 100644 index 000000000..f14186c05 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorLegend/kommonitor-legend.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-legend.component.js","sourceRoot":"","sources":["kommonitor-legend.component.ts"],"names":[],"mappings":";AAAA,OAAO;KACJ,MAAM,CAAC,kBAAkB,CAAC;KAC1B,SAAS,CACR,kBAAkB,EAClB;IACC,WAAW,EAAG,wGAAwG;IACtH;;;OAGG;IACH,UAAU,EAAG,CAAC,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AAC,CAAC;oBAE5C,8BAA8B;oBAC9B,CAAC,CAAC,SAAS,GAAG,MAAM,CAAC;oBAErB,kDAAkD;oBAClD,UAAU,CAAC,cAAY,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;iBAC/E;qBACG;oBACH,kBAAkB;oBAClB,MAAM,CAAC,IAAI,CAAC,4BAA4B,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;iBACrE;YAEF,CAAC,CAAC;QAGH,CAAC,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorLegend/kommonitor-legend.component.ts b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorLegend/kommonitor-legend.component.ts new file mode 100644 index 000000000..3293791f4 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorLegend/kommonitor-legend.component.ts @@ -0,0 +1,381 @@ +angular + .module('kommonitorLegend') + .component( + 'kommonitorLegend', + { + templateUrl : "components/kommonitorUserInterface/kommonitorControls/kommonitorLegend/kommonitor-legend.template.html", + /* + * injected with a modules service method that manages + * enabled tabs + */ + controller : ['$scope', '$rootScope', 'kommonitorMapService', 'kommonitorVisualStyleHelperService', + 'kommonitorDataExchangeService', 'kommonitorDiagramHelperService', 'kommonitorElementVisibilityHelperService', + 'kommonitorFilterHelperService', '__env', '$timeout', '$sce', 'kommonitorShareHelperService', + function KommonitorLegendController($scope, $rootScope, kommonitorMapService, + kommonitorVisualStyleHelperService, kommonitorDataExchangeService, kommonitorDiagramHelperService, kommonitorElementVisibilityHelperService, + kommonitorFilterHelperService, __env, $timeout, $sce, kommonitorShareHelperService) { + + const INDICATOR_DATE_PREFIX = __env.indicatorDatePrefix; + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorMapServiceInstance = kommonitorMapService; + this.kommonitorVisualStyleHelperServiceInstance = kommonitorVisualStyleHelperService; + this.kommonitorElementVisibilityHelperServiceInstance = kommonitorElementVisibilityHelperService; + this.kommonitorFilterHelperServiceInstance = kommonitorFilterHelperService; + this.kommonitorShareHelperServiceInstance = kommonitorShareHelperService; + this.envInstance = __env; + + this.env = __env; + $scope.svgString_outlierLow = $sce.trustAsHtml('Sorry, your browser does not support inline SVG.'); + $scope.svgString_outlierHigh = $sce.trustAsHtml('Sorry, your browser does not support inline SVG.'); + + + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + $rootScope.$on( "updateLegendDisplay", function(event, containsZeroValues, containsNegativeValues, containsNoData, containsOutliers_high, containsOutliers_low, outliers_low, outliers_high, selectedDate) { + $scope.containsZeroValues = containsZeroValues; + $scope.containsNegativeValues = containsNegativeValues; + $scope.containsOutliers_high = containsOutliers_high; + $scope.containsOutliers_low = containsOutliers_low; + $scope.outliers_high = outliers_high; + $scope.outliers_low = outliers_low; + $scope.containsNoData = containsNoData; + var dateComponents = selectedDate.split("-"); + $scope.dateAsDate = new Date(Number(dateComponents[0]), Number(dateComponents[1]) - 1, Number(dateComponents[2])); + + }); + + $scope.onChangeIndicatorDatepickerDate = function(){ + $rootScope.$broadcast("changeIndicatorDate"); + }; + + + $scope.filterSpatialUnits = function(){ + return function( item ) { + return kommonitorDataExchangeService.isAllowedSpatialUnitForCurrentIndicator(item); + }; + }; + + $scope.makeOutliersLowLegendString = function(outliersArray) { + if (outliersArray.length > 1) { + + return "(" + kommonitorDataExchangeService.getIndicatorValue_asFormattedText(outliersArray[0]) + " - " + kommonitorDataExchangeService.getIndicatorValue_asFormattedText(outliersArray[outliersArray.length - 1]) + ")"; + } + else { + return "(" + kommonitorDataExchangeService.getIndicatorValue_asFormattedText(outliersArray[0]) + ")"; + } + }; + + $scope.makeOutliersHighLegendString = function(outliersArray) { + if (outliersArray.length > 1) { + return "(" + kommonitorDataExchangeService.getIndicatorValue_asFormattedText(outliersArray[0]) + " - " + kommonitorDataExchangeService.getIndicatorValue_asFormattedText(outliersArray[outliersArray.length - 1]) + ")"; + } + else { + return "(" + kommonitorDataExchangeService.getIndicatorValue_asFormattedText(outliersArray[0]) + ")"; + } + }; + + $scope.onChangeSelectedSpatialUnit = function(){ + + $rootScope.$broadcast("changeSpatialUnit"); + + if(__env.enableSpatialUnitNotificationSelection) { + if(! (localStorage.getItem("hideKomMonitorSpatialUnitNotification") === "true")) { + let selectedSpatialUnitName = kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel; + if(__env.spatialUnitNotificationSelection.includes(selectedSpatialUnitName)) { + $('#spatialUnitNotificationModal').modal('show'); + } + } + } + }; + + + $scope.showSpatialUnitNotificationModalIfEnabled = function() { + if(__env.enableSpatialUnitNotificationSelection) { + $('#spatialUnitNotificationModal').modal('show'); + } + } + + $(document).on('click', '#controlIndicatorClassifyOption_wholeTimeseries', function (e) { + var wholeTimeseriesClassificationCheckbox = document.getElementById('controlIndicatorClassifyOption_wholeTimeseries'); + if (wholeTimeseriesClassificationCheckbox.checked) { + kommonitorDataExchangeService.classifyUsingWholeTimeseries = true; + } + else { + kommonitorDataExchangeService.classifyUsingWholeTimeseries = false; + } + $rootScope.$broadcast("restyleCurrentLayer", false); + }); + + $(document).on('input change', '#indicatorTransparencyInput', function (e) { + e.stopImmediatePropagation(); + var indicatorMetadata = kommonitorDataExchangeService.selectedIndicator; + + var transparency = document.getElementById("indicatorTransparencyInput").value; + var opacity = 1 - transparency; + + $rootScope.$broadcast("adjustOpacityForIndicatorLayer", indicatorMetadata, opacity); + }); + + $(document).on('click', '#radiojenks', function (e) { + $rootScope.$broadcast("changeClassifyMethod", "jenks"); + }); + + $(document).on('click', '#radioquantile', function (e) { + $rootScope.$broadcast("changeClassifyMethod", "quantile"); + }); + + $(document).on('click', '#radioequal_interval', function (e) { + $rootScope.$broadcast("changeClassifyMethod", "equal_interval"); + }); + + $scope.onClickDownloadMetadata = async function(){ + // create PDF from currently selected/displayed indicator! + var indicatorMetadata = kommonitorDataExchangeService.selectedIndicator; + var pdfName = indicatorMetadata.indicatorName + ".pdf"; + var jspdf = await kommonitorDataExchangeService.generateIndicatorMetadataPdf(indicatorMetadata, pdfName); + jspdf.save(pdfName); + }; + + function prepareBalanceGeoJSON(geoJSON, indicatorMetadataAsBalance){ + var fromDate = indicatorMetadataAsBalance["fromDate"]; + var toDate = indicatorMetadataAsBalance["toDate"]; + var targetDate = kommonitorDataExchangeService.selectedDate; + + for (var feature of geoJSON.features) { + var properties = feature.properties; + + var targetValue = properties[kommonitorDataExchangeService.indicatorDatePrefix + targetDate]; + properties["balance"] = targetValue; + + // rename all properties due to char limit in shaoefiles + var keys = Object.keys(properties); + + for (var key of keys) { + if (key.toLowerCase().includes("date_")) { + // from DATE_2018-01-01 + // to 20180101 + delete properties[key]; + } + } + + // replace properties with the one with new keys + feature.properties = properties; + } + + return geoJSON; + } + + $scope.downloadIndicatorAsGeoJSON = function () { + + var fileName = kommonitorDataExchangeService.selectedIndicator.indicatorName + "_" + kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel; + + var geoJSON_string; + var geoJSON; + + if(kommonitorDataExchangeService.isBalanceChecked){ + geoJSON = jQuery.extend(true, {}, kommonitorDataExchangeService.indicatorAndMetadataAsBalance.geoJSON); + geoJSON = prepareBalanceGeoJSON(geoJSON, kommonitorDataExchangeService.indicatorAndMetadataAsBalance); + geoJSON_string = JSON.stringify(geoJSON); + fileName += "_Bilanz" + kommonitorDataExchangeService.indicatorAndMetadataAsBalance['fromDate'] + " - " + kommonitorDataExchangeService.indicatorAndMetadataAsBalance['toDate']; + } + else{ + geoJSON_string = JSON.stringify(kommonitorDataExchangeService.selectedIndicator.geoJSON); + fileName += "_" + kommonitorDataExchangeService.selectedDate; + } + + kommonitorDataExchangeService.generateAndDownloadIndicatorZIP(geoJSON_string, fileName, ".geojson", {}); + }; + + $scope.downloadIndicatorAsShape = function () { + + var fileName = kommonitorDataExchangeService.selectedIndicator.indicatorName + "_" + kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel; + var polygonName = kommonitorDataExchangeService.selectedIndicator.indicatorName + "_" + kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel; + + var options = { + folder: "shape", + types: { + point: 'points', + polygon: polygonName, + line: 'lines' + } + }; + + var geoJSON; + + if(kommonitorDataExchangeService.isBalanceChecked){ + geoJSON = jQuery.extend(true, {}, kommonitorDataExchangeService.indicatorAndMetadataAsBalance.geoJSON); + geoJSON = prepareBalanceGeoJSON(geoJSON, kommonitorDataExchangeService.indicatorAndMetadataAsBalance); + fileName += "_Bilanz_" + kommonitorDataExchangeService.indicatorAndMetadataAsBalance['fromDate'] + " - " + kommonitorDataExchangeService.indicatorAndMetadataAsBalance['toDate']; + } + else{ + geoJSON = jQuery.extend(true, {}, kommonitorDataExchangeService.selectedIndicator.geoJSON); + fileName += "_" + kommonitorDataExchangeService.selectedDate; + } + + for (var feature of geoJSON.features) { + var properties = feature.properties; + + // rename all properties due to char limit in shaoefiles + var keys = Object.keys(properties); + + for (var key of keys) { + var newKey = undefined; + if (key.toLowerCase().includes("featureid")) { + newKey = "ID"; + } + else if (key.toLowerCase().includes("featurename")) { + newKey = "NAME"; + } + else if (key.toLowerCase().includes("date_")) { + // from DATE_2018-01-01 + // to 20180101 + newKey = key.split("_")[1].replace(/-|\s/g, ""); + } + else if (key.toLowerCase().includes("startdate")) { + newKey = "validFrom"; + } + else if (key.toLowerCase().includes("enddate")) { + newKey = "validTo"; + } + + if (newKey) { + properties[newKey] = properties[key]; + delete properties[key]; + } + } + + // replace properties with the one with new keys + feature.properties = properties; + } + + // shpwrite.download(geoJSON, options); + var arrayBuffer = shpwrite.zip(geoJSON, options); + kommonitorDataExchangeService.generateAndDownloadIndicatorZIP(arrayBuffer, fileName, "_shape.zip", {base64: true}); + }; + + $scope.downloadIndicatorAsCSV = function () { + + var fileName = kommonitorDataExchangeService.selectedIndicator.indicatorName + "_" + kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel; + + var geoJSON; + + if(kommonitorDataExchangeService.isBalanceChecked){ + geoJSON = jQuery.extend(true, {}, kommonitorDataExchangeService.indicatorAndMetadataAsBalance.geoJSON); + geoJSON = prepareBalanceGeoJSON(geoJSON, kommonitorDataExchangeService.indicatorAndMetadataAsBalance); + fileName += "_Bilanz_" + kommonitorDataExchangeService.indicatorAndMetadataAsBalance['fromDate'] + " - " + kommonitorDataExchangeService.indicatorAndMetadataAsBalance['toDate']; + } + else{ + geoJSON = jQuery.extend(true, {}, kommonitorDataExchangeService.selectedIndicator.geoJSON); + fileName += "_" + kommonitorDataExchangeService.selectedDate; + } + + var items = []; + + for (var feature of geoJSON.features) { + var properties = feature.properties; + + // rename all properties due to char limit in shaoefiles + var keys = Object.keys(properties); + + for (var key of keys) { + var newKey = undefined; + if (key.toLowerCase().includes("featureid")) { + newKey = "ID"; + } + else if (key.toLowerCase().includes("featurename")) { + newKey = "NAME"; + } + else if (key.toLowerCase().includes("date_")) { + // from DATE_2018-01-01 + // to 2018-01-01 + newKey = key.split("_")[1]; + } + else if (key.toLowerCase().includes("startdate")) { + newKey = "validFrom"; + } + else if (key.toLowerCase().includes("enddate")) { + newKey = "validTo"; + } + + if (newKey) { + properties[newKey] = properties[key]; + delete properties[key]; + } + } + + // replace properties with the one with new keys + feature.properties = properties; + + items.push(properties); + } + + var headers = {}; + + for (const key in items[0]) { + if (Object.hasOwnProperty.call(items[0], key)) { + headers[key] = key; + } + } + + exportCSVFile(headers, items, fileName); + }; + + function convertToCSV(objArray) { + var array = typeof objArray != 'object' ? JSON.parse(objArray) : objArray; + var str = ''; + + for (var i = 0; i < array.length; i++) { + var line = ''; + for (var index in array[i]) { + if (line != '') line += ';'; + + line += array[i][index]; + } + + str += line + '\r\n'; + } + + return str; + } + + function exportCSVFile(headers, items, fileTitle) { + if (headers) { + items.unshift(headers); + } + + // Convert Object to JSON + var jsonObject = JSON.stringify(items); + + var csv = convertToCSV(jsonObject); + + kommonitorDataExchangeService.generateAndDownloadIndicatorZIP(csv, fileTitle, ".csv", {}); + } + + $scope.onClickShareLinkButton = function(){ + + kommonitorShareHelperService.generateCurrentShareLink(); + + /* Copy to clipboard */ + if(navigator && navigator.clipboard){ + navigator.clipboard.writeText(kommonitorShareHelperService.currentShareLink); + + // Get the snackbar DIV + var x = document.getElementById("snackbar"); + + // Add the "show" class to DIV + x.className = "show"; + + // After 3 seconds, remove the show class from DIV + setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000); + } + else{ + // open in new tab + window.open(kommonitorShareHelperService.currentShareLink, '_blank'); + } + + }; + + + }] + }); diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorLegend/kommonitor-legend.module.js b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorLegend/kommonitor-legend.module.js index 03eb82c2f..a4b58e645 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorLegend/kommonitor-legend.module.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorLegend/kommonitor-legend.module.js @@ -1,16 +1,17 @@ +"use strict"; angular.module('kommonitorLegend', ['kommonitorDataExchange', 'kommonitorDiagramHelper', 'kommonitorVisualStyleHelper', -'kommonitorMap', 'kommonitorElementVisibilityHelper', 'kommonitorFilterHelper', 'kommonitorShareHelper']) - -.directive('stringToNumber', function() { - return { - require: 'ngModel', - link: function(scope, element, attrs, ngModel) { - ngModel.$parsers.push(function(value) { - return '' + value; - }); - ngModel.$formatters.push(function(value) { - return parseFloat(value); - }); - } - }; + 'kommonitorMap', 'kommonitorElementVisibilityHelper', 'kommonitorFilterHelper', 'kommonitorShareHelper']) + .directive('stringToNumber', function () { + return { + require: 'ngModel', + link: function (scope, element, attrs, ngModel) { + ngModel.$parsers.push(function (value) { + return '' + value; + }); + ngModel.$formatters.push(function (value) { + return parseFloat(value); + }); + } + }; }); +//# sourceMappingURL=kommonitor-legend.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorLegend/kommonitor-legend.module.js.map b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorLegend/kommonitor-legend.module.js.map new file mode 100644 index 000000000..a10472dce --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorLegend/kommonitor-legend.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-legend.module.js","sourceRoot":"","sources":["kommonitor-legend.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,CAAC,wBAAwB,EAAE,yBAAyB,EAAE,6BAA6B;IACtH,eAAe,EAAE,mCAAmC,EAAE,wBAAwB,EAAE,uBAAuB,CAAC,CAAC;KAExG,SAAS,CAAC,gBAAgB,EAAE;IAC3B,OAAO;QACL,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,UAAS,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO;YAC3C,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAS,KAAK;gBAClC,OAAO,EAAE,GAAG,KAAK,CAAC;YACpB,CAAC,CAAC,CAAC;YACH,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,UAAS,KAAK;gBACrC,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC;YAC3B,CAAC,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorLegend/kommonitor-legend.module.ts b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorLegend/kommonitor-legend.module.ts new file mode 100644 index 000000000..03eb82c2f --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorLegend/kommonitor-legend.module.ts @@ -0,0 +1,16 @@ +angular.module('kommonitorLegend', ['kommonitorDataExchange', 'kommonitorDiagramHelper', 'kommonitorVisualStyleHelper', +'kommonitorMap', 'kommonitorElementVisibilityHelper', 'kommonitorFilterHelper', 'kommonitorShareHelper']) + +.directive('stringToNumber', function() { + return { + require: 'ngModel', + link: function(scope, element, attrs, ngModel) { + ngModel.$parsers.push(function(value) { + return '' + value; + }); + ngModel.$formatters.push(function(value) { + return parseFloat(value); + }); + } + }; +}); diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorReachability/kommonitor-reachability.component.js b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorReachability/kommonitor-reachability.component.js index e9b726c6a..996d381cd 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorReachability/kommonitor-reachability.component.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorReachability/kommonitor-reachability.component.js @@ -1,1817 +1,1436 @@ +"use strict"; angular - .module('kommonitorReachability') - .component( - 'kommonitorReachability', { - templateUrl: 'components/kommonitorUserInterface/kommonitorControls/kommonitorReachability/kommonitor-reachability.template.html', - /* - * injected with a modules service method that manages - * enabled tabs - */ - controller: [ - '$scope', - '$rootScope', - '$http', - '$timeout', - 'kommonitorMapService', - 'kommonitorDataExchangeService', - 'kommonitorDiagramHelperService', - '__env', - /** - * TODO - */ - function kommonitorReachabilityController($scope, - $rootScope, $http, $timeout, kommonitorMapService, - kommonitorDataExchangeService, kommonitorDiagramHelperService,__env) { - - //$("[data-toggle=tooltip]").tooltip(); - - $scope.isUsedInReporting = false; - - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - let input = document.getElementById("isochroneCutInput"); - input.addEventListener("keypress", function isInputAllowed(evt) { - var code = (evt.keyCode ? evt.keyCode : evt.which); - if (code == 8) { //Backspace key press - return true; - } else { - var ch = String.fromCharCode(evt.which); - if (!(/[0-9,]/.test(ch))) { - evt.preventDefault(); - } - } - }); - - - - var OpenStreetMapProvider = window.GeoSearch.OpenStreetMapProvider; - - $scope.openStreetMapProvider = new OpenStreetMapProvider( - { - params: { - 'accept-language': 'de', // render results in Dutch - countrycodes: 'de', // limit search results to the Netherlands - addressdetails: 1, // include additional address detail parts - viewbox: "" + (Number(__env.initialLongitude) - 0.001) + "," + (Number(__env.initialLatitude) - 0.001) + "," + (Number(__env.initialLongitude) + 0.001) + "," + (Number(__env.initialLatitude) + 0.001) - }, - searchUrl: __env.targetUrlToGeocoderService + '/search', - reverseUrl: __env.targetUrlToGeocoderService + '/reverse' - } - ); - - const INDICATOR_DATE_PREFIX = __env.indicatorDatePrefix; - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorDiagramHelperServiceInstance = kommonitorDiagramHelperService; - this.kommonitorMapServiceInstance = kommonitorMapService; - $scope.targetUrlToReachabilityService_ORS = __env.targetUrlToReachabilityService_ORS; - var numberOfDecimals = __env.numberOfDecimals; - - $scope.currentIsochronesGeoJSON = undefined; - $scope.currentRouteGeoJSON = undefined; - $scope.error = undefined; - - $scope.echartsInstances_reachabilityAnalysis = new Map(); - - /** - * a delay object for geosearch input - */ - $scope.delay = undefined; - - $scope.geosearchResults_startingPoint; - $scope.geosearchResults_endPoint; - - $scope.settings = {}; - - $scope.settings.usePreconfigRanges_500_1000 = false; - - $scope.settings.dateSelectionType_valueIndicator = "date_indicator"; - $scope.settings.dateSelectionType_valueManual = "date_manual"; - $scope.settings.dateSelectionType_valuePerDataset = "date_perDataset"; - $scope.settings.dateSelectionType = { - selectedDateType: $scope.settings.dateSelectionType_valuePerDataset - }; - - $scope.settings.selectedDate_manual = undefined; - - $scope.settings.isochroneConfig = {}; - $scope.settings.isochroneConfig.dateSelectionType_valueIndicator = "date_indicator"; - $scope.settings.isochroneConfig.dateSelectionType_valueManual = "date_manual"; - $scope.settings.isochroneConfig.dateSelectionType_valuePerDataset = "date_perDataset"; - $scope.settings.isochroneConfig.dateSelectionType = { - selectedDateType: $scope.settings.isochroneConfig.dateSelectionType_valuePerDataset - }; - - $scope.settings.isochroneConfig.selectedDate_manual = undefined; - $('#manualDateDatepicker_reachabilityAnalysis').datepicker(kommonitorDataExchangeService.datePickerOptions); - $('#manualDateDatepicker_reachabilityConfig').datepicker(kommonitorDataExchangeService.datePickerOptions); - - - $scope.routeDistance_km = undefined; - $scope.routeDuration_minutes = undefined; - - - /** - * Show the isochrone-calculation-div if this - * value is set to 'true', if the value is set - * to 'false' the routing between different - * points shall be displayed. - */ - $scope.showIsochrones = true; - - $scope.settings.dissolveIsochrones = true; - - /** - * TODO : Folgende drei Variablen werden fuer den - * Produktivbetrieb eigentlich nicht benoetigt, - * oder? - */ - $scope.locationsArray = [[7.049869894,51.42055331]]; - - /** - * Values used in the GUI (initial). - */ - $scope.latitudeStart = 51.42055331; - $scope.longitudeStart = 7.049869894; - $scope.latitudeEnd = 51.42055331+0.05; - $scope.longitudeEnd = 7.049869894+0.05; - $scope.settings.routingStartPointInput = undefined; - $scope.settings.routingEndPointInput = undefined; - - /** - * The range array (for isochrone calculation) - * prefilled with dummy-values. TODO : Werte und - * Variable behalten, oder im Grunde dann nicht - * mehr benoetigt? - */ - $scope.rangeArray = [300, 600, 900]; - - /** - * Variable to save the keywords used by the - * routing API. Valid values are: - * driving-car - * driving-hgv // LKW - * cycling-regular - * cycling-road - * cycling-safe - * cycling-mountain - * cycling-tour - * cycling-electric - * foot-walking - * foot-hiking - * wheelchair - */ - $scope.settings.transitMode = 'buffer'; - - /** - * The focus of the analysis. Valid values are: - * 'distance' and 'time'. TODO : Starke - * Ueberschneidung mit der Variablen 'focus', - * die im Grunde genau das gleiche speichert. - */ - $scope.settings.focus = 'distance'; - - /** - * config of starting points source (layer or manual draw) for isochrones - */ - $scope.settings.startPointsSource = "fromLayer"; - - /** - * selected start point layer for isochrone computation - * GeoJSON within property .geoJSON - */ - $scope.settings.selectedStartPointLayer = undefined; - - /** - * start points that were drawn manually - * direct GeoJSON structure - */ - $scope.manualStartPoints = undefined; - - /** - * indicator wheather the isochrone point source is configured - */ - $scope.pointSourceConfigured = false; - - /** - * The analysis speed (for the current vehicle) - * in km/h. - */ - $scope.settings.speedInKilometersPerHour = 3; - - /** - * Indicator if multiple starting-points shall - * be used. - */ - $scope.useMultipleStartPoints = false; - - /** - * Flag indicating if data is loading / - * calculations are in progress. Used to set the - * GUI on 'standby' until the progress is - * completed. - */ - $scope.settings.loadingData = false; - - /** - * The calculation unit-indicator. - */ - $scope.unit = 'Meter'; - - /** - * Stores the minimal speed in km/h for the - * currently chosen vehicle. - */ - $scope.minSpeedInKilometersPerHour = 3; - - /** - * Stores the maximum speed in km/h for the - * currently chosen vehicle. - */ - $scope.maxSpeedInKilometersPerHour = 6; - - /** - * The maximum distance or time for the current - * vehicle. The unit of the stored value can be - * found in the variable 'unit'. - */ - $scope.max_value = 5000; - - /** - * The current time-or-distance value of the - * analysis. The unit of the stored value can be - * found in the variable 'unit'. This value - * represents value of the slider in the GUI and - * handed to the routing API. - */ - $scope.settings.currentTODValue = 1; - - /** - * Variable that stores 'true' if the speed-selection - * shall be shown or 'false' if not. - */ - $scope.isTime = false; - - /** - * Specifies the route preference. - * - * Allowed values are: - * - "fastest" - * - "shortest" - * - "recommended" - */ - $scope.settings.preference = "fastest"; - - /* - * array of arrays of lon, lat - * [[lon,lat],[lon,lat]] - */ - $scope.locationsArray = []; - - $scope.settings.isochroneInput = undefined; - - /** - * TODO - */ - var isochronesGETParameter = 'profile=foot-walking&units=m&location_type=start&locations=7.268504,51.448405&range_type=time&range=300,600,900&attributes=area|reachfactor&options={"maximum_speed":3}'; - - /** - * TODO - */ - var createRoutingRequest = function(transitMode, preference, routingStartPointInput, routingEndPointInput){ - var locString = routingStartPointInput+'%7C'+routingEndPointInput; - - // if user never clicked transit mode set standard - if(transitMode === "buffer"){ - transitMode = "foot-walking"; - } - - // var getRequest = $scope.targetUrlToReachabilityService_ORS - // + '/routes?' - // + 'coordinates=' + locString - // + '&profile='+transitMode - // + '&preference='+preference - // + '&units='+'km' - // + '&language='+'de' - // + '&format='+'geojson' - // + '&instructions='+'true' - // + '&instructions_format='+'html' - // + '&maneuvers='+'true' - // + '&attributes='+'avgspeed' - // + '&elevation='+'true'; - - //console.log(getRequest); - - var getRequest = $scope.targetUrlToReachabilityService_ORS - + '/v2/directions/' + transitMode + '?' - + 'start=' + routingStartPointInput - + '&end=' + routingEndPointInput; - - return getRequest; - } - - /** - * TODO - */ - var createORSIsochroneRequestBody = function (locationsArray, rangeArray) { - let body = { - "locations": [], - "range": [], - "attributes": ["reachfactor", "area"], - "location_type": "start", - "range_type": $scope.settings.focus, - "smoothing": 0, - "area_units": "km", - "units": "m" - }; - - for (var index = 0; index < locationsArray.length; index++) { - // element looks like - // [longitude,latitude] - let point = [locationsArray[index][0], locationsArray[index][1]]; - body.locations.push(point); - }; - - for (var i = 0; i < rangeArray.length; i++) { - var cValue = rangeArray[i]; - - // CALCULATE SECONDS FROM MINUTE VALUES IF TIME-ANALYSIS IS WANTED - if($scope.settings.focus=='time'){ - cValue = cValue*60; - } - - body.range.push(cValue); - }; - - return body; - }; - - // If the reporting modal is shown we want to integrate this component there. - // A couple of modifications need to be done to achieve that. - // These are controlled by setting a variable and checking it when needed. - $('#reporting-modal').on('hidden.bs.modal', function (e) { - $scope.isUsedInReporting = false; - $scope.$digest(); - }) - - $scope.$on("reportingPoiLayerSelected", function(event, data) { - $scope.isUsedInReporting = true; - $scope.settings.selectedStartPointLayer = data; - $scope.pointSourceConfigured = true; // timestamp selection is hidden, so we are good to go for now. - $scope.$digest(); - }); - - - $scope.resetPoisInIsochrone = function(){ - $scope.echartsInstances_reachabilityAnalysis = new Map(); - document.getElementById("reachability_diagrams_section").innerHTML = ""; - for (var poi of kommonitorDataExchangeService.availableGeoresources){ - if (poi.isSelected_reachabilityAnalysis){ - poi.isSelected_reachabilityAnalysis = false; - //remove POI layer from map - $scope.removePoiLayerFromMap(poi); - } - } - }; - - $scope.resetForm = function(){ - $scope.resetSlider(); - - $scope.resetPoisInIsochrone(); - - $scope.error = undefined; - - $scope.settings = {}; - - $scope.settings = {}; - - $scope.settings.usePreconfigRanges_500_1000 = false; - - $scope.settings.dateSelectionType_valueIndicator = "date_indicator"; - $scope.settings.dateSelectionType_valueManual = "date_manual"; - $scope.settings.dateSelectionType_valuePerDataset = "date_perDataset"; - $scope.settings.dateSelectionType = { - selectedDateType: $scope.settings.dateSelectionType_valuePerDataset - }; - - $scope.settings.selectedDate_manual = undefined; - - $scope.settings.isochroneConfig = {}; - $scope.settings.isochroneConfig.dateSelectionType_valueIndicator = "date_indicator"; - $scope.settings.isochroneConfig.dateSelectionType_valueManual = "date_manual"; - $scope.settings.isochroneConfig.dateSelectionType_valuePerDataset = "date_perDataset"; - $scope.settings.isochroneConfig.dateSelectionType = { - selectedDateType: $scope.settings.isochroneConfig.dateSelectionType_valuePerDataset - }; - - $scope.settings.isochroneConfig.selectedDate_manual = undefined; - - $scope.showIsochrones = true; - $scope.settings.dissolveIsochrones = true; - document.getElementById("btn_isochrones").click(); - $scope.settings.transitMode = 'buffer'; - document.getElementById("optBuffer").click(); - $scope.settings.focus = 'distance'; - document.getElementById("focus_distance").click(); - $scope.settings.startPointsSource = "fromLayer"; - $scope.changeStartPointsSource_fromLayer(); - document.getElementById("startPointsSource_layer").click(); - $scope.settings.selectedStartPointLayer = undefined; - $scope.pointSourceConfigured = false; - $scope.settings.speedInKilometersPerHour = 3; - $scope.useMultipleStartPoints = false; - $scope.settings.loadingData = false; - $scope.unit = 'Meter'; - $scope.settings.currentTODValue = 1; - $scope.isTime = false; - $scope.settings.preference = "fastest"; - $scope.locationsArray = []; - - $scope.rangeArray = []; - - $scope.removePotentialDrawnStartingPoints(); - - $scope.routeDistance_km = undefined; - $scope.routeDuration_minutes = undefined; - - $scope.currentIsochronesGeoJSON = undefined; - $scope.currentRouteGeoJSON = undefined; - $scope.error = undefined; - - $scope.geosearchResults_startingPoint; - $scope.geosearchResults_endPoint; - - $scope.routingStartPoint = undefined; - $scope.routingEndPoint = undefined; - - $scope.settings.routingStartPointInput = undefined; - $scope.settings.routingEndPointInput = undefined; - - setTimeout(function(){ - $scope.$digest(); - }, 200); - }; - - $scope.removePotentialDrawnStartingPoints = function(){ - // TODO - $scope.manualStartPoints = undefined; - $scope.disablePointDrawTool(); - $scope.removeAllDrawnPoints(); - }; - - /** - * TODO - */ - $scope.removeReachabilityLayers = function() { - $scope.settings.loadingData = true; - $rootScope - .$broadcast('showLoadingIconOnMap'); - - kommonitorMapService - .removeReachabilityLayers(); - $scope.currentIsochronesGeoJSON = undefined; - kommonitorDataExchangeService.isochroneLegend = undefined; - // remove any diagram - $scope.resetPoisInIsochrone(); - $scope.settings.loadingData = false; - $rootScope - .$broadcast('hideLoadingIconOnMap'); - }; - - $scope.removeRoutingLayers = function() { - $scope.settings.loadingData = true; - $rootScope - .$broadcast('showLoadingIconOnMap'); - - kommonitorMapService - .removeRoutingLayers(); - $scope.currentRouteGeoJSON = undefined; - kommonitorDataExchangeService.routingLegend = undefined; - $scope.settings.loadingData = false; - $rootScope - .$broadcast('hideLoadingIconOnMap'); - }; - - /** - * TODO - */ - $scope.prepareDownloadGeoJSON = function() { - - if($scope.currentIsochronesGeoJSON){ - $scope.prepareIsochroneDownload(); - } - if($scope.currentRouteGeoJSON){ - $scope.prepareRouteDownload(); - } - - }; - - $scope.prepareIsochroneDownload = function(){ - console.log('removing old download button if available') - if (document - .getElementById('downloadReachabilityIsochrones')) - document - .getElementById( - 'downloadReachabilityIsochrones') - .remove(); - - var geoJSON_string = JSON - .stringify($scope.currentIsochronesGeoJSON); - - var fileName = 'Erreichbarkeitsisochronen_via-' + - $scope.settings.transitMode + - '_Abbruchkriterium-' + - $scope.settings.focus + '.geojson'; - - var blob = new Blob([geoJSON_string], { - type: 'application/json' - }); - var data = URL.createObjectURL(blob); - - console.log('create new Download button and append it to DOM'); - var a = document.createElement('a'); - a.download = fileName; - a.href = data; - a.textContent = 'Download Isochronen als GeoJSON'; - a.id = 'downloadReachabilityIsochrones'; - a.setAttribute('class', 'btn btn-info'); - - let elements = document.getElementsByClassName( - 'reachabilityIsochroneButtonSection'); - - for (const element of elements) { - element.appendChild(a); - } - }; - - $scope.prepareRouteDownload = function(){ - console.log('removing old download button if available') - if (document - .getElementById('downloadReachabilityRoute')) - document - .getElementById( - 'downloadReachabilityRoute') - .remove(); - - var geoJSON_string = JSON - .stringify($scope.currentRouteGeoJSON); - - var fileName = 'Routing-Ergebnis.geojson'; - - var blob = new Blob([geoJSON_string], { - type: 'application/json' - }); - var data = URL.createObjectURL(blob); - - console.log('create new Download button and append it to DOM'); - var a = document.createElement('a'); - a.download = fileName; - a.href = data; - a.textContent = 'Download Route als GeoJSON'; - a.id = 'downloadReachabilityRoute'; - a.setAttribute('class', 'btn btn-info'); - - let elements = document.getElementsByClassName( - 'reachabilityRouteButtonSection'); - - for (const element of elements) { - element.appendChild(a); - } - }; - - /** - * Dummy function. - */ - $scope.TODO = function() { - alert('Funktion wurde noch nicht implementiert!'); - }; - - /** - * Changes the focus of the analysis between - * distance and time. - */ - $scope.changeFocus = function(value) { - - if(value === 'time' && $scope.settings.transitMode === "buffer") { - $scope.settings.focus = 'distance' - $scope.isTime=false; - $scope.unit = 'Meter'; - $scope.changeValues(); - return; - } - - $scope.resetSlider(); - - if ($scope.settings.focus=='distance'){ - $scope.isTime=false; - $scope.unit = 'Meter'; - } - else if ($scope.settings.focus=='time'){ - $scope.unit = 'Minuten'; - $scope.isTime=true; - } - - $scope.changeMinMaxSpeed(); - $scope.changeValues(); - }; - - /** - * Changes the start points source of the analysis between - * fromLayer and manualDraw. - */ - $scope.changeStartPointsSource_fromLayer = function() { - - $scope.disablePointDrawTool(); - $scope.settings.startPointsSource = "fromLayer"; - - }; - $scope.changeStartPointsSource_manual = function() { - - $scope.enablePointDrawTool(); - $scope.settings.startPointsSource = "manual"; - - }; - - $scope.removeAllDrawnPoints = function(){ - // TODO - - $rootScope.$broadcast("removeAllDrawnPoints"); - }; - - $scope.enablePointDrawTool = function(){ - // add/activate leaflet-draw toolbar for only POINT features - - $rootScope.$broadcast("enablePointDrawTool"); - }; - - $scope.disablePointDrawTool = function(){ - // disable/hide leaflet-draw toolbar for only POINT features - $rootScope.$broadcast("disablePointDrawTool"); - }; - - $scope.$on("onUpdateDrawnPointFeatures", function (event, drawnPointsFeatureGroup) { - - // if drawnPointsFeatureGroup is empty or does not exist, we must catch that - try{ - $scope.manualStartPoints = drawnPointsFeatureGroup.toGeoJSON(); - $scope.pointSourceConfigured = true; - } - catch (error){ - $scope.manualStartPoints = undefined; - $scope.pointSourceConfigured = false; - } - - setTimeout(function(){ - $scope.$digest(); - }, 150); - }); - - - /** - * Resets the slider for the distance-/time and - * speed to initial values. - */ - $scope.resetSlider = function() { - $scope.settings.speedInKilometersPerHour = $scope.minSpeedInKilometersPerHour; - $scope.settings.currentTODValue = 1; - }; - - /** - * Changes the vehicle type according to an - * action on the related buttons. - */ - $scope.changeType = function() { - $scope.changeValues(); - $scope.changeMinMaxSpeed(); - $scope.resetSlider(); - }; - - /** - * Changes the max_value depending on the - * selected vehicle type. - */ - $scope.changeValues = function() { - if ($scope.settings.transitMode == 'buffer'){ - $scope.settings.focus = 'distance'; - $("#focus_distance").click(); - if ($scope.settings.focus == 'distance') - $scope.max_value = 5000; - else - $scope.max_value = 25; - } - - if ($scope.settings.transitMode == 'foot-walking'){ - if ($scope.settings.focus == 'distance') - $scope.max_value = 5000; - else - $scope.max_value = 25; - } - - - if ($scope.settings.transitMode == 'cycling-regular'){ - if ($scope.settings.focus == 'distance') - $scope.max_value = 5000; - else - $scope.max_value = 20; - } - - - if ($scope.settings.transitMode == 'driving-car'){ - if ($scope.settings.focus == 'distance') - $scope.max_value = 5000; - else - $scope.max_value = 15; - } - - if ($scope.settings.transitMode == 'wheelchair'){ - if ($scope.settings.focus == 'distance') - $scope.max_value = 5000; - else - $scope.max_value = 25; - } - - }; - - /** - * Changes the minimum and maximum - * speed-per-hour value depending on the current - * selected vehicle type. - */ - $scope.changeMinMaxSpeed = function() { - if ($scope.settings.transitMode == 'buffer') { - $scope.minSpeedInKilometersPerHour = 1; - $scope.maxSpeedInKilometersPerHour = 6; - } - if ($scope.settings.transitMode == 'foot-walking') { - $scope.minSpeedInKilometersPerHour = 1; - $scope.maxSpeedInKilometersPerHour = 6; - } - if ($scope.settings.transitMode == 'cycling-regular') { - $scope.minSpeedInKilometersPerHour = 10; - $scope.maxSpeedInKilometersPerHour = 25; - } - if ($scope.settings.transitMode == 'driving-car') { - $scope.minSpeedInKilometersPerHour = 30; - $scope.maxSpeedInKilometersPerHour = 130; - } - if ($scope.settings.transitMode == 'wheelchair') { - $scope.minSpeedInKilometersPerHour = 1; - $scope.maxSpeedInKilometersPerHour = 6; - } - - $scope.settings.speedInKilometersPerHour = $scope.minSpeedInKilometersPerHour; - }; - - /** - * Checks the input-textfield for the - * isochrone-distance-array for validity. - * Extracts the text value of the textfield, - * splits it at every ',' and writes the values - * into the array of desired distances. Adds the - * analysis distance at the end of the array so - * the whole distance of the analysis will be - * covered by isochones. - */ - $scope.checkArrayInput = function() { - $scope.rangeArray = []; - var split = $scope.settings.isochroneInput.split(','); - var actVal; - if (split.length > 0) { - for (var a = 0; a < split.length; a++) { - if (!isNaN(split[a])) { - actVal = parseFloat(split[a]); - if (!isNaN(actVal)) - $scope.rangeArray - .push(actVal); - } - } - } - - $scope.rangeArray.sort(function(a, b){return a-b;}); - }; - - /** - * Changes variables so the isochrone-calculation-elements will be shown. - */ - $scope.showIso = function() { - $scope.showIsochrones = true; - }; - - /** - * Changes variables so the routing-calculation-elements will be shown. - */ - $scope.showRouting = function() { - $scope.showIsochrones = false; - // force active setting of transit mode foot-walking when changing to routing mode - $scope.settings.transitMode = "foot-walking"; - document.getElementById("optFeet").click(); - document.getElementById("optFeetRadioButtonLabel").classList.add('active'); - $timeout(function(){ - $scope.$digest(); - }); - }; - - $scope.onClickPerDataset_isochroneConfig = function(){ - $timeout(function(){ - if(! $scope.settings.isochroneConfig.selectedDate){ - $scope.settings.isochroneConfig.selectedDate = $scope.settings.selectedStartPointLayer.availablePeriodsOfValidity[$scope.settings.selectedStartPointLayer.availablePeriodsOfValidity.length - 1]; - } - if(!$scope.isUsedInReporting) { - $scope.fetchGeoJSONForIsochrones(); - } - }, 500); - }; - - $scope.fetchGeoJSONForIsochrones = async function(){ - if(! $scope.settings.selectedStartPointLayer){ - $scope.settings.loadingData = false; - return; - } - - // clear any previous results - $scope.settings.selectedStartPointLayer.geoJSON = undefined; - - var date; - - if($scope.settings.isochroneConfig.dateSelectionType.selectedDateType === $scope.settings.isochroneConfig.dateSelectionType_valuePerDataset){ - date = $scope.settings.isochroneConfig.selectedDate.startDate; - } - else if($scope.settings.isochroneConfig.dateSelectionType.selectedDateType === $scope.settings.isochroneConfig.dateSelectionType_valueManual){ - date = $scope.settings.isochroneConfig.selectedDate_manual; - } - else{ - date = kommonitorDataExchangeService.selectedDate; - } - - if(! date){ - $scope.settings.loadingData = false; - return; - } - - - $scope.settings.loadingData = true; - var id = $scope.settings.selectedStartPointLayer.georesourceId; - - var dateComps = date.split("-"); - - var year = dateComps[0]; - var month = dateComps[1]; - var day = dateComps[2]; - - await $http({ - url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + id + "/" + year + "/" + month + "/" + day, - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - var geoJSON = response.data; - - $scope.settings.selectedStartPointLayer.geoJSON = geoJSON; - - $scope.settings.loadingData = false; - $scope.pointSourceConfigured = true; - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - $scope.pointSourceConfigured = false; - $scope.settings.loadingData = false; - console.error(error.statusText); - kommonitorDataExchangeService.displayMapApplicationError(error); - $scope.error = error.statusText; - }); - }; - - $scope.onChangeSelectedStartPointLayer = async function(){ - $scope.settings.isochroneConfig.selectedDate = undefined; - - if(! $scope.settings.isochroneConfig.selectedDate){ - $scope.settings.isochroneConfig.selectedDate = $scope.settings.selectedStartPointLayer.availablePeriodsOfValidity[$scope.settings.selectedStartPointLayer.availablePeriodsOfValidity.length - 1]; - } - - if(!$scope.isUsedInReporting) { - $scope.fetchGeoJSONForIsochrones(); - } - }; - - /** - * Starts the analysis. This function is fired - * when the related button is pushed. - * - * Depending on the current selection of the - * calculation-task the function - * 'startRoutingAnalysis' or - * 'startIsochroneCalculation' will be - * triggered. - * - * The values from the input-elements are all - * up-to-date and saved in the variables - * accessible via the scope. The request URL - * will be build by this values and send towards - * the routing-API. The result will be handled, - * stored in the related scope- variables and - * displayed in the KM GUI. - * - * If this method is fired from within the reporting modal - * ($scope.isUsedInReporting = true) the result is not added to the main map, - * but returned to the reporting component per broadcast. - */ - $scope.startAnalysis = function() { - - $timeout(function(){ - // Any code in here will automatically have an $scope.apply() run afterwards - if(!$scope.isUsedInReporting) { // reporting uses it's own loading overlay, which is controlled there - $scope.settings.loadingData = true; - $rootScope.$broadcast("showLoadingIconOnMap"); - } - // And it just works! - }, 50); - - $timeout(function(){ - $scope.error = undefined; - - if ($scope.showIsochrones) - $scope.startIsochroneCalculation(); - else - $scope.startRoutingCalculation(); - }, 150); - - }; - - /** - * Starts the routing-calculation. - */ - $scope.startRoutingCalculation = function() { - - $scope.settings.loadingData = true; - $rootScope.$broadcast("showLoadingIconOnMap"); - var startPointString = $scope.routingStartPoint.longitude + "," + $scope.routingStartPoint.latitude; - var endPointString = $scope.routingEndPoint.longitude + "," + $scope.routingEndPoint.latitude; - - var url = createRoutingRequest($scope.settings.transitMode, $scope.settings.preference, startPointString, endPointString); - // let coordinatesArray = []; - // coordinatesArray.push(startPointString); - // coordinatesArray.push(endPointString); - // let postBody = { - // "coordinates": coordinatesArray - // }; - // let url = $scope.targetUrlToReachabilityService_ORS - // + '/v2/directions/' + $scope.settings.transitMode + '/geojson'; - - console.log("execute OpenRouteService routing request: " + url); - - var req = { - method: 'GET', - url: url, - headers: { - // 'Accept': 'application/json' - } - }; - - $http(req) - // $http.post(url, postBody) - .then( - function successCallback( - response) { - $scope.currentRouteGeoJSON = response.data; - - $scope.routeDistance_km = $scope.currentRouteGeoJSON.features[0].properties.summary.distance / 1000; - $scope.routeDuration_minutes = Math.round($scope.currentRouteGeoJSON.features[0].properties.summary.duration / 60); - - - // TODO : CDB - kommonitorMapService - .replaceRouteGeoJSON( - $scope.currentRouteGeoJSON, - $scope.settings.transitMode, - $scope.settings.preference, $scope.routingStartPoint, $scope.routingEndPoint, - $scope.routeDistance_km, $scope.routeDuration_minutes); - $scope.prepareDownloadGeoJSON(); - $scope.settings.loadingData = false; - $rootScope.$broadcast('hideLoadingIconOnMap'); - }, - function errorCallback( - error) { - // called asynchronously - // if an error occurs - // or server returns - // response with an - // error status. - console.error(error.data.error.message); - $scope.error = error.data.error.message; - - $scope.settings.loadingData = false; - kommonitorDataExchangeService.displayMapApplicationError(error); - $rootScope.$broadcast("hideLoadingIconOnMap"); - }); - }; - - $scope.makeLocationsArrayFromStartPoints = function(){ - // array of arrays of lon,lat - $scope.locationsArray = []; - - if($scope.settings.startPointsSource === "manual"){ - // establish from drawn points - $scope.manualStartPoints.features.forEach(function(feature){ - $scope.locationsArray.push(feature.geometry.coordinates); - }); - } - else{ - // establish from chosen layer - $scope.settings.selectedStartPointLayer.geoJSON.features.forEach(function(feature){ - $scope.locationsArray.push(feature.geometry.coordinates); - }); - } - - return $scope.locationsArray; - }; - - /** - * Starts an isochrone-calculation. - */ - $scope.startIsochroneCalculation = async function() { - if(!$scope.isUsedInReporting) { // reporting uses it's own loading overlay, which is controlled there - $scope.settings.loadingData = true; - $rootScope.$broadcast("showLoadingIconOnMap"); - } else { - $scope.$emit("reportingIsochronesCalculationStarted"); - } - - $scope.checkArrayInput(); - - $scope.locationsArray = $scope.makeLocationsArrayFromStartPoints(); - - // SWITCH THE VALUE DEPENDING ON THE LENGTH - // OF THE LOCATIONS ARRAY - if ($scope.locationsArray.length > 1) - $scope.useMultipleStartPoints = true; - else - $scope.useMultipleStartPoints = false; - - var resultIsochrones; - - if($scope.settings.transitMode === 'buffer'){ - resultIsochrones = await $scope.createBuffers(); - } - else{ - resultIsochrones = await $scope.createIsochrones(); - } - - if($scope.isUsedInReporting) { - // No need to add isochrones to main map. - // Instead they are returned to reporting modal - $scope.$emit("reportingIsochronesCalculationFinished", resultIsochrones) - return; - } - - $scope.currentIsochronesGeoJSON = resultIsochrones; - - - kommonitorMapService.replaceIsochroneMarker($scope.locationsArray); - kommonitorMapService - .replaceIsochroneGeoJSON( - $scope.currentIsochronesGeoJSON, - $scope.settings.transitMode, - $scope.settings.focus, - $scope.rangeArray, - $scope.useMultipleStartPoints, - $scope.settings.dissolveIsochrones, - $scope.settings.speedInKilometersPerHour); - $scope - .prepareDownloadGeoJSON(); - - $scope.settings.loadingData = false; - $timeout(function(){ - $rootScope.$broadcast('hideLoadingIconOnMap'); - }, 500); - - - $scope.$digest(); - }; - - - - $scope.fetchIsochrones = async function(tempStartPointsArray){ - var body = createORSIsochroneRequestBody( - tempStartPointsArray, - $scope.rangeArray); - - let url = $scope.targetUrlToReachabilityService_ORS + - '/v2/isochrones/' + $scope.settings.transitMode; - - var req = { - method: 'POST', - url: url, - data: body, - headers: { - // 'Accept': 'application/json', - "Content-Type": 'application/json' - } - }; - - return await $http(req) - .then( - function successCallback( - response) { - // this callback will - // becalled - // asynchronously - // when the response is - // available - - // dissolve features - if ($scope.settings.dissolveIsochrones){ - try { - var dissolved = turf.dissolve(response.data, {propertyName: 'value'}); - return dissolved; - } catch (e) { - console.error("Dissolving Isochrones failed with error: " + e); - console.error("Will return undissolved isochrones"); - return response.data; - } finally { - - } - - } - else{ - return response.data; - } - - }, - function errorCallback( - error) { - // called asynchronously - // if an error occurs - // or server returns - // response with an - // error status. - console.error(error.data.error.message); - $scope.error = error.data.error.message; - $scope.settings.loadingData = false; - kommonitorDataExchangeService.displayMapApplicationError(error); - $rootScope.$broadcast("hideLoadingIconOnMap"); - }); - }; - - $scope.createBuffers = function(){ - var resultIsochrones; - - var startingPoints_geoJSON; - // create Buffers for each input and range definition - if($scope.settings.startPointsSource === "manual"){ - // establish from drawn points - startingPoints_geoJSON = $scope.manualStartPoints; - } - else{ - // establish from chosen layer - startingPoints_geoJSON = $scope.settings.selectedStartPointLayer.geoJSON; - } - - // range in meters - for (const range of $scope.rangeArray) { - var geoJSON_buffered = turf.buffer(startingPoints_geoJSON, Number(range)/1000, {units: 'kilometers', steps: 12}); - - if(! geoJSON_buffered.features){ - // transform single feature to featureCollection - geoJSON_buffered = turf.featureCollection([ - geoJSON_buffered - ]); - } - - if ($scope.settings.dissolveIsochrones){ - try { - geoJSON_buffered = turf.dissolve(geoJSON_buffered); - } catch (e) { - console.error("Dissolving Isochrones failed with error: " + e); - console.error("Will return undissolved isochrones"); - } finally { - - } - - } - - // add property: value --> range - if (geoJSON_buffered.features && geoJSON_buffered.features.length > 0){ - for (const feature of geoJSON_buffered.features) { - feature.properties.value = range; - } - } - - if(! resultIsochrones){ - resultIsochrones = geoJSON_buffered; - } - else{ - resultIsochrones.features = resultIsochrones.features.concat(geoJSON_buffered.features); - } - } - - return resultIsochrones; - }; - - $scope.createIsochrones = async function(){ - var resultIsochrones; - - console.log('Calculating isochrones for ' + - $scope.locationsArray.length + - ' start points.'); - - var maxLocationsForORSRequest = 400; - - var featureIndex = 0; - // log progress for each 10% of features - var logProgressIndexSeparator = Math.round($scope.locationsArray.length / 100 * 10); - - var countFeatures = 0; - var tempStartPointsArray = []; - for (var pointIndex=0; pointIndex < $scope.locationsArray.length; pointIndex++){ - tempStartPointsArray.push($scope.locationsArray[pointIndex]); - countFeatures++; - - // if maxNumber of locations is reached or the last starting point is reached - if(countFeatures === maxLocationsForORSRequest || pointIndex === $scope.locationsArray.length -1){ - // make request, collect results - - // responses will be GeoJSON FeatureCollections - var tempIsochrones = await $scope.fetchIsochrones(tempStartPointsArray); - - if (! resultIsochrones){ - resultIsochrones = tempIsochrones; - } - else{ - // apend results of tempIsochrones to resultIsochrones - resultIsochrones.features = resultIsochrones.features.concat(tempIsochrones.features); - } - // increment featureIndex - featureIndex++; - if(featureIndex % logProgressIndexSeparator === 0){ - console.log("PROGRESS: Computed isochrones for '" + featureIndex + "' of total '" + $scope.locationsArray.length + "' starting points."); - } - - // reset temp vars - tempStartPointsArray = []; - countFeatures = 0; - - } // end if - } // end for - - return resultIsochrones; - - }; - - $scope.onChangeRoutingStartPoint = function(){ - - // Clear the timeout if it has already been set. - // This will prevent the previous task from executing - // if it has been less than - clearTimeout($scope.delay); - - $scope.geosearchResults_startingPoint = undefined; - - // Make a new timeout set to go off in 800ms - $scope.delay = setTimeout(function () { - console.log('Geosearch for Input String: ', $scope.settings.routingStartPointInput); - - $scope.openStreetMapProvider.search({ query: $scope.settings.routingStartPointInput }) - .then(function(result){ - $scope.geosearchResults_startingPoint = result; - - $scope.$digest(); - }); - - }, 500); - }; - - $scope.onClickGeosearchResult_startingPoint = function(geosearchResult){ - // result object from leaflet-geosearch - - // const result = { - // x: Number, // lon, - // y: Number, // lat, - // label: String, // formatted address - // bounds: [ - // [Number, Number], // s, w - lat, lon - // [Number, Number], // n, e - lat, lon - // ], - // raw: {}, // raw provider result - // } - - $scope.routingStartPoint = { - label: geosearchResult.label, - longitude: geosearchResult.x, - latitude: geosearchResult.y - }; - - // hide geosearch results to minimize page height - $scope.geosearchResults_startingPoint = undefined; - }; - - $scope.onChangeRoutingEndPoint = function(){ - - // Clear the timeout if it has already been set. - // This will prevent the previous task from executing - // if it has been less than - clearTimeout($scope.delay); - - $scope.geosearchResults_endPoint = undefined; - - // Make a new timeout set to go off in 800ms - $scope.delay = setTimeout(function () { - console.log('Geosearch for Input String: ', $scope.settings.routingEndPointInput); - - $scope.openStreetMapProvider.search({ query: $scope.settings.routingEndPointInput }) - .then(function(result){ - $scope.geosearchResults_endPoint = result; - - $scope.$digest(); - }); - - }, 500); - }; - - $scope.onClickGeosearchResult_endPoint = function(geosearchResult){ - // result object from leaflet-geosearch - - // const result = { - // x: Number, // lon, - // y: Number, // lat, - // label: String, // formatted address - // bounds: [ - // [Number, Number], // s, w - lat, lon - // [Number, Number], // n, e - lat, lon - // ], - // raw: {}, // raw provider result - // } - - $scope.routingEndPoint = { - label: geosearchResult.label, - longitude: geosearchResult.x, - latitude: geosearchResult.y - }; - - // hide geosearch results to minimize page height - $scope.geosearchResults_endPoint = undefined; - }; - - - //////////////////////////// SECTION FOR GORESOURCE AND INDICATOR ANALYSIS - - $scope.getQueryDate = function(resource){ - if ($scope.settings.dateSelectionType.selectedDateType === $scope.settings.dateSelectionType_valueIndicator){ - return kommonitorDataExchangeService.selectedDate; - } - else if($scope.settings.dateSelectionType.selectedDateType === $scope.settings.dateSelectionType_valueManual){ - return $scope.settings.selectedDate_manual; - } - else if($scope.settings.dateSelectionType.selectedDateType === $scope.settings.dateSelectionType_valuePerDataset){ - return resource.selectedDate.startDate; - } - else{ - return kommonitorDataExchangeService.selectedDate; - } - }; - - $scope.handlePoiForAnalysis = async function(poi){ - $scope.settings.loadingData = true; - $rootScope.$broadcast("showLoadingIconOnMap"); - - try { - if(poi.isSelected_reachabilityAnalysis){ - poi = await $scope.fetchGeoJSONForDate(poi); - } - - poi = await $scope.handlePoiOnDiagram(poi); - - if(kommonitorDataExchangeService.isDisplayableGeoresource(poi)){ - $scope.handlePoiOnMap(poi); - } - } catch (error) { - console.error(error); - } - - $scope.settings.loadingData = false; - $rootScope.$broadcast("hideLoadingIconOnMap"); - - // as method is async we may call angular digest cycle - setTimeout(() => { - $scope.$digest(); - }, 250); - }; - - $scope.fetchGeoJSONForDate = function(poiGeoresource){ - var id = poiGeoresource.georesourceId; - - var date = $scope.getQueryDate(poiGeoresource); - - var dateComps = date.split("-"); - - var year = dateComps[0]; - var month = dateComps[1]; - var day = dateComps[2]; - - return $http({ - url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + id + "/" + year + "/" + month + "/" + day, - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - var geoJSON = response.data; - - poiGeoresource.geoJSON = geoJSON; - - return poiGeoresource; - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - $scope.settings.loadingData = false; - kommonitorDataExchangeService.displayMapApplicationError(error); - $rootScope.$broadcast("hideLoadingIconOnMap"); - }); - }; - - $scope.handlePoiOnDiagram = async function(poi){ - if(poi.isSelected_reachabilityAnalysis){ - // maps range value to result GeoJSON - var pointsPerIsochroneRangeMap = await $scope.computePoisWithinIsochrones(poi); - $scope.addOrReplaceWithinDiagrams(poi, pointsPerIsochroneRangeMap); - // now filter the geoJSON to only include those datasets that are actually inside any isochrone - poi = filterGeoJSONPointsInsideLargestIsochrone(poi, pointsPerIsochroneRangeMap); - } - else{ - //remove POI layer from map - $scope.removePoiFromDiagram(poi); - } - - return poi; - }; - - function filterGeoJSONPointsInsideLargestIsochrone(poi, pointsPerIsochroneRangeMap){ - var keyIter = pointsPerIsochroneRangeMap.keys(); - - var nextKey = keyIter.next(); - - var largestRange; - - while(nextKey.value){ - var nextRange = nextKey.value; - if (! largestRange){ - largestRange = Number(nextRange); - } - else if (largestRange < Number(nextRange)){ - largestRange = Number(nextRange); - } - - nextKey = keyIter.next(); - } - - // map stores keys as string - poi.geoJSON = pointsPerIsochroneRangeMap.get("" + largestRange); - - return poi; - } - - $scope.computePoisWithinIsochrones = async function(poi){ - var pointsPerIsochroneRangeMap = $scope.initializeMapWithRangeKeys(); - if (! poi.geoJSON){ - poi = await $scope.fetchGeoJSONForDate(poi); - } - - // as there might be mutliple isochrone ranges - // we must perform point in polygon for each range - var keyIter = pointsPerIsochroneRangeMap.keys(); - - var nextKey = keyIter.next(); - - while(nextKey.value){ - var nextKeyValue = nextKey.value; - - var geoJSON_featureCollection = $scope.computePoisWithinIsochrone(nextKeyValue, poi); - pointsPerIsochroneRangeMap.set(nextKeyValue, geoJSON_featureCollection); - nextKey = keyIter.next(); - } - - return pointsPerIsochroneRangeMap; - }; - - $scope.computePoisWithinIsochrone = function(rangeValue, poi){ - // create clones of poi geoJSON and isochrone geoJSON - var isochrones_geoJSON_clone = JSON.parse(JSON.stringify($scope.currentIsochronesGeoJSON)); - var poi_geoJSON_clone = JSON.parse(JSON.stringify(poi.geoJSON)); - - // filter isochrone geoJSON clone by range value - isochrones_geoJSON_clone.features = isochrones_geoJSON_clone.features.filter(feature => { - return String(feature.properties.value) === String(rangeValue); - }); - - // filter poi geoJSON clone by spatial within isochrone - var pointsWithinIsochrones = turf.pointsWithinPolygon(poi_geoJSON_clone, isochrones_geoJSON_clone); - - return pointsWithinIsochrones; - }; - - - $scope.initializeMapWithRangeKeys = function(){ - var map = new Map(); - - for (const feature of $scope.currentIsochronesGeoJSON.features) { - map.set("" + feature.properties.value, null); - } - - return map; - }; - - - - $scope.addOrReplaceWithinDiagrams = function(poi, pointsPerIsochroneRangeMap){ - var mapEntries = pointsPerIsochroneRangeMap.entries(); - - var nextEntry = mapEntries.next(); - while(nextEntry.value){ - - var nextEntry_keyRange = nextEntry.value[0]; - var nextEntry_valueGeoJSON = nextEntry.value[1]; - var numberOfFeatures = 0; - - var nextEntry_keyRange_label = nextEntry_keyRange; - if($scope.settings.focus == 'time'){ - // compute seconds to minutes for display - nextEntry_keyRange_label = nextEntry_keyRange_label / 60; - } - - if(nextEntry_valueGeoJSON){ - numberOfFeatures = nextEntry_valueGeoJSON.features.length; - } - console.log("Number of Points wihtin Range '" + nextEntry_keyRange + "' is '" + numberOfFeatures + "'"); - - var date = $scope.getQueryDate(poi); - - if ($scope.echartsInstances_reachabilityAnalysis && $scope.echartsInstances_reachabilityAnalysis.has(nextEntry_keyRange)){ - // append to diagram - - var echartsInstance = $scope.echartsInstances_reachabilityAnalysis.get(nextEntry_keyRange); - var echartsOptions = echartsInstance.getOption(); - echartsOptions = kommonitorDiagramHelperService.appendToReachabilityAnalysisOptions(poi, nextEntry_valueGeoJSON, echartsOptions, date); - echartsInstance.setOption(echartsOptions); - $scope.echartsInstances_reachabilityAnalysis.set(nextEntry_keyRange, echartsInstance); - } - else{ - var reachabilityDiagramsSectionNode = document.getElementById("reachability_diagrams_section"); - var newChartNode = document.createElement("div"); - newChartNode.innerHTML = '

        Analyse Einzugsgebiet ' + nextEntry_keyRange_label + ' [' + kommonitorDataExchangeService.isochroneLegend.cutOffUnit + ']



        '; - reachabilityDiagramsSectionNode.appendChild(newChartNode); - - // init new echarts instance - var echartsInstance = echarts.init(document.getElementById('reachability_pieDiagram_range_' + nextEntry_keyRange + '')); - // use configuration item and data specified to show chart - var echartsOptions = kommonitorDiagramHelperService.createInitialReachabilityAnalysisPieOptions(poi, nextEntry_valueGeoJSON, nextEntry_keyRange_label + " " + $scope.unit, date); - echartsInstance.setOption(echartsOptions); - - echartsInstance.hideLoading(); - - $scope.echartsInstances_reachabilityAnalysis.set(nextEntry_keyRange, echartsInstance); - - setTimeout(function () { - echartsInstance.resize(); - }, 350); - } - - nextEntry = mapEntries.next(); - } - }; - - $scope.removePoiFromDiagram = function(poiGeoresource){ - var chart_entries = $scope.echartsInstances_reachabilityAnalysis.entries(); - - var nextChartInstanceEntry = chart_entries.next(); - while(nextChartInstanceEntry.value){ - - var nextChartInstance = nextChartInstanceEntry.value[1]; - var nextChartOptions = nextChartInstance.getOption(); - - nextChartOptions = kommonitorDiagramHelperService.removePoiFromReachabilityAnalysisOption(nextChartOptions, poiGeoresource); - nextChartInstance.setOption(nextChartOptions); - - $scope.echartsInstances_reachabilityAnalysis.set(nextChartInstanceEntry.value[0], nextChartInstance); - - nextChartInstanceEntry = chart_entries.next(); - } - }; - - $scope.handlePoiOnMap = function(poi){ - - if(poi.isSelected_reachabilityAnalysis){ - //display on Map - $scope.addPoiLayerToMap(poi); - } - else{ - //remove POI layer from map - $scope.removePoiLayerFromMap(poi); - } - - }; - - $scope.addPoiLayerToMap = function(poiGeoresource) { - $scope.settings.loadingData = true; - $rootScope.$broadcast("showLoadingIconOnMap"); - - // fale --> useCluster = false - kommonitorMapService.addPoiGeoresourceGeoJSON_reachabilityAnalysis(poiGeoresource, $scope.getQueryDate(poiGeoresource), false); - $scope.settings.loadingData = false; - $rootScope.$broadcast("hideLoadingIconOnMap"); - - }; - - $scope.removePoiLayerFromMap = function(poiGeoresource) { - $scope.settings.loadingData = true; - $rootScope.$broadcast("showLoadingIconOnMap"); - - poiGeoresource = poiGeoresource; - - kommonitorMapService.removePoiGeoresource_reachabilityAnalysis(poiGeoresource); - $scope.settings.loadingData = false; - $rootScope.$broadcast("hideLoadingIconOnMap"); - - }; - - $scope.refreshPoiLayers = async function(){ - for (var poi of kommonitorDataExchangeService.availableGeoresources){ - if (poi.isSelected_reachabilityAnalysis){ - //remove POI layer from map - $scope.removePoiLayerFromMap(poi); - - poi = await $scope.fetchGeoJSONForDate(poi); - - // remove layer and add layer again - $scope.addPoiLayerToMap(poi); - } - } - }; - - $scope.onClickUseIndicatorTimestamp = function(){ - $scope.settings.dateSelectionType.selectedDateType = $scope.settings.dateSelectionType_valueIndicator; - - $scope.refreshSelectedGeoresources(); - }; - - $scope.timeout_manualdate; - - function isNoValidDate(dateCandidate){ - var dateComps = dateCandidate.split("-"); - - if(dateComps.length < 3){ - return true; - } - else if(! dateComps[0] || ! dateComps[1] || ! dateComps[2]){ - return true; - } - else if(isNaN(dateComps[0]) || isNaN(dateComps[1]) || isNaN(dateComps[2])){ - return true; - } - else if(Number(dateComps[1]) > 12 || Number(dateComps[2]) > 31){ - return true; - } - - return false; - } - - $scope.onChangeManualDate = function(){ - // check if date is an actual date - // if so then refresh selected layers - - // Clear the timeout if it has already been set. - // This will prevent the previous task from executing - // if it has been less than - clearTimeout($scope.timeout_manualdate); - - // Make a new timeout set to go off in 1000ms (1 second) - $scope.timeout_manualdate = setTimeout(function () { - var dateCandidate = $scope.settings.selectedDate_manual; - - if(isNoValidDate(dateCandidate)){ - return; - } - - $timeout(function(){ - - $scope.loadingData = true; - $rootScope.$broadcast("showLoadingIconOnMap"); - }); - - $timeout(function(){ - - $scope.refreshSelectedGeoresources(); - }, 250); - }, 1000); - - }; - - $scope.onChangeManualDate_isochroneConfig = function(){ - // check if date is an actual date - // if so then refresh selected layers - - // Clear the timeout if it has already been set. - // This will prevent the previous task from executing - // if it has been less than - clearTimeout($scope.timeout_manualdate); - - // Make a new timeout set to go off in 1000ms (1 second) - $scope.timeout_manualdate = setTimeout(function () { - var dateCandidate = $scope.settings.isochroneConfig.selectedDate_manual; - - if(isNoValidDate(dateCandidate)){ - return; - } - - if(!$scope.isUsedInReporting) { - $scope.fetchGeoJSONForIsochrones(); - } - - // $timeout(function(){ - - // $scope.loadingData = true; - // $rootScope.$broadcast("showLoadingIconOnMap"); - // }); - - // $timeout(function(){ - - // $scope.fetchGeoJSONForIsochrones(); - // }, 250); - }, 1000); - - }; - - $scope.$on("selectedIndicatorDateHasChanged", function (event) { - - console.log("refresh selected georesource layers according to new date"); - - // only refresh georesources if sync with indicator timestamp is selected - if(! $scope.settings.dateSelectionType.selectedDateType.includes($scope.settings.dateSelectionType_valueIndicator)){ - return; - } - - $timeout(function(){ - - $scope.loadingData = true; - $rootScope.$broadcast("showLoadingIconOnMap"); - }); - - $timeout(function(){ - - $scope.refreshSelectedGeoresources(); - }, 250); - }); - - $scope.refreshSelectedGeoresources = async function(){ - for (const georesource of kommonitorDataExchangeService.availableGeoresources) { - if (georesource.isSelected_reachabilityAnalysis){ - - if(georesource.isPOI){ - georesource.isSelected_reachabilityAnalysis = false; - await $scope.handlePoiForAnalysis(georesource); - georesource.isSelected_reachabilityAnalysis = true; - await $scope.handlePoiForAnalysis(georesource); - } - - } - } - - $scope.loadingData = false; - $rootScope.$broadcast("hideLoadingIconOnMap"); - }; - - $scope.onChangeSelectedDate = async function(georesourceDataset){ - // only if it s already selected, we must modify the shown dataset - - - if(georesourceDataset.isSelected_reachabilityAnalysis){ - // depending on type we must call different methods - if (georesourceDataset.isPOI){ - georesourceDataset.isSelected_reachabilityAnalysis = false; - await $scope.handlePoiForAnalysis(georesourceDataset); - georesourceDataset.isSelected_reachabilityAnalysis = true; - await $scope.handlePoiForAnalysis(georesourceDataset); - } - } - }; - - - $(window).on('resize', function () { - var chart_entries = $scope.echartsInstances_reachabilityAnalysis.entries(); - - var nextChartInstanceEntry = chart_entries.next(); - while(nextChartInstanceEntry.value){ - - var nextChartInstance = nextChartInstanceEntry.value[1]; - if (nextChartInstance != null && nextChartInstance != undefined) { - nextChartInstance.resize(); - } - nextChartInstanceEntry = chart_entries.next(); - } - - - }); - - - } - ] - }); + .module('kommonitorReachability') + .component('kommonitorReachability', { + templateUrl: 'components/kommonitorUserInterface/kommonitorControls/kommonitorReachability/kommonitor-reachability.template.html', + /* + * injected with a modules service method that manages + * enabled tabs + */ + controller: [ + '$scope', + '$rootScope', + '$http', + '$timeout', + 'kommonitorMapService', + 'kommonitorDataExchangeService', + 'kommonitorDiagramHelperService', + '__env', + /** + * TODO + */ + function kommonitorReachabilityController($scope, $rootScope, $http, $timeout, kommonitorMapService, kommonitorDataExchangeService, kommonitorDiagramHelperService, __env) { + //$("[data-toggle=tooltip]").tooltip(); + $scope.isUsedInReporting = false; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + let input = document.getElementById("isochroneCutInput"); + input.addEventListener("keypress", function isInputAllowed(evt) { + var code = (evt.keyCode ? evt.keyCode : evt.which); + if (code == 8) { //Backspace key press + return true; + } + else { + var ch = String.fromCharCode(evt.which); + if (!(/[0-9,]/.test(ch))) { + evt.preventDefault(); + } + } + }); + var OpenStreetMapProvider = window.GeoSearch.OpenStreetMapProvider; + $scope.openStreetMapProvider = new OpenStreetMapProvider({ + params: { + 'accept-language': 'de', + countrycodes: 'de', + addressdetails: 1, + viewbox: "" + (Number(__env.initialLongitude) - 0.001) + "," + (Number(__env.initialLatitude) - 0.001) + "," + (Number(__env.initialLongitude) + 0.001) + "," + (Number(__env.initialLatitude) + 0.001) + }, + searchUrl: __env.targetUrlToGeocoderService + '/search', + reverseUrl: __env.targetUrlToGeocoderService + '/reverse' + }); + const INDICATOR_DATE_PREFIX = __env.indicatorDatePrefix; + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorDiagramHelperServiceInstance = kommonitorDiagramHelperService; + this.kommonitorMapServiceInstance = kommonitorMapService; + $scope.targetUrlToReachabilityService_ORS = __env.targetUrlToReachabilityService_ORS; + var numberOfDecimals = __env.numberOfDecimals; + $scope.currentIsochronesGeoJSON = undefined; + $scope.currentRouteGeoJSON = undefined; + $scope.error = undefined; + $scope.echartsInstances_reachabilityAnalysis = new Map(); + /** + * a delay object for geosearch input + */ + $scope.delay = undefined; + $scope.geosearchResults_startingPoint; + $scope.geosearchResults_endPoint; + $scope.settings = {}; + $scope.settings.usePreconfigRanges_500_1000 = false; + $scope.settings.dateSelectionType_valueIndicator = "date_indicator"; + $scope.settings.dateSelectionType_valueManual = "date_manual"; + $scope.settings.dateSelectionType_valuePerDataset = "date_perDataset"; + $scope.settings.dateSelectionType = { + selectedDateType: $scope.settings.dateSelectionType_valuePerDataset + }; + $scope.settings.selectedDate_manual = undefined; + $scope.settings.isochroneConfig = {}; + $scope.settings.isochroneConfig.dateSelectionType_valueIndicator = "date_indicator"; + $scope.settings.isochroneConfig.dateSelectionType_valueManual = "date_manual"; + $scope.settings.isochroneConfig.dateSelectionType_valuePerDataset = "date_perDataset"; + $scope.settings.isochroneConfig.dateSelectionType = { + selectedDateType: $scope.settings.isochroneConfig.dateSelectionType_valuePerDataset + }; + $scope.settings.isochroneConfig.selectedDate_manual = undefined; + $('#manualDateDatepicker_reachabilityAnalysis').datepicker(kommonitorDataExchangeService.datePickerOptions); + $('#manualDateDatepicker_reachabilityConfig').datepicker(kommonitorDataExchangeService.datePickerOptions); + $scope.routeDistance_km = undefined; + $scope.routeDuration_minutes = undefined; + /** + * Show the isochrone-calculation-div if this + * value is set to 'true', if the value is set + * to 'false' the routing between different + * points shall be displayed. + */ + $scope.showIsochrones = true; + $scope.settings.dissolveIsochrones = true; + /** + * TODO : Folgende drei Variablen werden fuer den + * Produktivbetrieb eigentlich nicht benoetigt, + * oder? + */ + $scope.locationsArray = [[7.049869894, 51.42055331]]; + /** + * Values used in the GUI (initial). + */ + $scope.latitudeStart = 51.42055331; + $scope.longitudeStart = 7.049869894; + $scope.latitudeEnd = 51.42055331 + 0.05; + $scope.longitudeEnd = 7.049869894 + 0.05; + $scope.settings.routingStartPointInput = undefined; + $scope.settings.routingEndPointInput = undefined; + /** + * The range array (for isochrone calculation) + * prefilled with dummy-values. TODO : Werte und + * Variable behalten, oder im Grunde dann nicht + * mehr benoetigt? + */ + $scope.rangeArray = [300, 600, 900]; + /** + * Variable to save the keywords used by the + * routing API. Valid values are: + * driving-car + * driving-hgv // LKW + * cycling-regular + * cycling-road + * cycling-safe + * cycling-mountain + * cycling-tour + * cycling-electric + * foot-walking + * foot-hiking + * wheelchair + */ + $scope.settings.transitMode = 'buffer'; + /** + * The focus of the analysis. Valid values are: + * 'distance' and 'time'. TODO : Starke + * Ueberschneidung mit der Variablen 'focus', + * die im Grunde genau das gleiche speichert. + */ + $scope.settings.focus = 'distance'; + /** + * config of starting points source (layer or manual draw) for isochrones + */ + $scope.settings.startPointsSource = "fromLayer"; + /** + * selected start point layer for isochrone computation + * GeoJSON within property .geoJSON + */ + $scope.settings.selectedStartPointLayer = undefined; + /** + * start points that were drawn manually + * direct GeoJSON structure + */ + $scope.manualStartPoints = undefined; + /** + * indicator wheather the isochrone point source is configured + */ + $scope.pointSourceConfigured = false; + /** + * The analysis speed (for the current vehicle) + * in km/h. + */ + $scope.settings.speedInKilometersPerHour = 3; + /** + * Indicator if multiple starting-points shall + * be used. + */ + $scope.useMultipleStartPoints = false; + /** + * Flag indicating if data is loading / + * calculations are in progress. Used to set the + * GUI on 'standby' until the progress is + * completed. + */ + $scope.settings.loadingData = false; + /** + * The calculation unit-indicator. + */ + $scope.unit = 'Meter'; + /** + * Stores the minimal speed in km/h for the + * currently chosen vehicle. + */ + $scope.minSpeedInKilometersPerHour = 3; + /** + * Stores the maximum speed in km/h for the + * currently chosen vehicle. + */ + $scope.maxSpeedInKilometersPerHour = 6; + /** + * The maximum distance or time for the current + * vehicle. The unit of the stored value can be + * found in the variable 'unit'. + */ + $scope.max_value = 5000; + /** + * The current time-or-distance value of the + * analysis. The unit of the stored value can be + * found in the variable 'unit'. This value + * represents value of the slider in the GUI and + * handed to the routing API. + */ + $scope.settings.currentTODValue = 1; + /** + * Variable that stores 'true' if the speed-selection + * shall be shown or 'false' if not. + */ + $scope.isTime = false; + /** + * Specifies the route preference. + * + * Allowed values are: + * - "fastest" + * - "shortest" + * - "recommended" + */ + $scope.settings.preference = "fastest"; + /* + * array of arrays of lon, lat + * [[lon,lat],[lon,lat]] + */ + $scope.locationsArray = []; + $scope.settings.isochroneInput = undefined; + /** + * TODO + */ + var isochronesGETParameter = 'profile=foot-walking&units=m&location_type=start&locations=7.268504,51.448405&range_type=time&range=300,600,900&attributes=area|reachfactor&options={"maximum_speed":3}'; + /** + * TODO + */ + var createRoutingRequest = function (transitMode, preference, routingStartPointInput, routingEndPointInput) { + var locString = routingStartPointInput + '%7C' + routingEndPointInput; + // if user never clicked transit mode set standard + if (transitMode === "buffer") { + transitMode = "foot-walking"; + } + // var getRequest = $scope.targetUrlToReachabilityService_ORS + // + '/routes?' + // + 'coordinates=' + locString + // + '&profile='+transitMode + // + '&preference='+preference + // + '&units='+'km' + // + '&language='+'de' + // + '&format='+'geojson' + // + '&instructions='+'true' + // + '&instructions_format='+'html' + // + '&maneuvers='+'true' + // + '&attributes='+'avgspeed' + // + '&elevation='+'true'; + //console.log(getRequest); + var getRequest = $scope.targetUrlToReachabilityService_ORS + + '/v2/directions/' + transitMode + '?' + + 'start=' + routingStartPointInput + + '&end=' + routingEndPointInput; + return getRequest; + }; + /** + * TODO + */ + var createORSIsochroneRequestBody = function (locationsArray, rangeArray) { + let body = { + "locations": [], + "range": [], + "attributes": ["reachfactor", "area"], + "location_type": "start", + "range_type": $scope.settings.focus, + "smoothing": 0, + "area_units": "km", + "units": "m" + }; + for (var index = 0; index < locationsArray.length; index++) { + // element looks like + // [longitude,latitude] + let point = [locationsArray[index][0], locationsArray[index][1]]; + body.locations.push(point); + } + ; + for (var i = 0; i < rangeArray.length; i++) { + var cValue = rangeArray[i]; + // CALCULATE SECONDS FROM MINUTE VALUES IF TIME-ANALYSIS IS WANTED + if ($scope.settings.focus == 'time') { + cValue = cValue * 60; + } + body.range.push(cValue); + } + ; + return body; + }; + // If the reporting modal is shown we want to integrate this component there. + // A couple of modifications need to be done to achieve that. + // These are controlled by setting a variable and checking it when needed. + $('#reporting-modal').on('hidden.bs.modal', function (e) { + $scope.isUsedInReporting = false; + $scope.$digest(); + }); + $scope.$on("reportingPoiLayerSelected", function (event, data) { + $scope.isUsedInReporting = true; + $scope.settings.selectedStartPointLayer = data; + $scope.pointSourceConfigured = true; // timestamp selection is hidden, so we are good to go for now. + $scope.$digest(); + }); + $scope.resetPoisInIsochrone = function () { + $scope.echartsInstances_reachabilityAnalysis = new Map(); + document.getElementById("reachability_diagrams_section").innerHTML = ""; + for (var poi of kommonitorDataExchangeService.availableGeoresources) { + if (poi.isSelected_reachabilityAnalysis) { + poi.isSelected_reachabilityAnalysis = false; + //remove POI layer from map + $scope.removePoiLayerFromMap(poi); + } + } + }; + $scope.resetForm = function () { + $scope.resetSlider(); + $scope.resetPoisInIsochrone(); + $scope.error = undefined; + $scope.settings = {}; + $scope.settings = {}; + $scope.settings.usePreconfigRanges_500_1000 = false; + $scope.settings.dateSelectionType_valueIndicator = "date_indicator"; + $scope.settings.dateSelectionType_valueManual = "date_manual"; + $scope.settings.dateSelectionType_valuePerDataset = "date_perDataset"; + $scope.settings.dateSelectionType = { + selectedDateType: $scope.settings.dateSelectionType_valuePerDataset + }; + $scope.settings.selectedDate_manual = undefined; + $scope.settings.isochroneConfig = {}; + $scope.settings.isochroneConfig.dateSelectionType_valueIndicator = "date_indicator"; + $scope.settings.isochroneConfig.dateSelectionType_valueManual = "date_manual"; + $scope.settings.isochroneConfig.dateSelectionType_valuePerDataset = "date_perDataset"; + $scope.settings.isochroneConfig.dateSelectionType = { + selectedDateType: $scope.settings.isochroneConfig.dateSelectionType_valuePerDataset + }; + $scope.settings.isochroneConfig.selectedDate_manual = undefined; + $scope.showIsochrones = true; + $scope.settings.dissolveIsochrones = true; + document.getElementById("btn_isochrones").click(); + $scope.settings.transitMode = 'buffer'; + document.getElementById("optBuffer").click(); + $scope.settings.focus = 'distance'; + document.getElementById("focus_distance").click(); + $scope.settings.startPointsSource = "fromLayer"; + $scope.changeStartPointsSource_fromLayer(); + document.getElementById("startPointsSource_layer").click(); + $scope.settings.selectedStartPointLayer = undefined; + $scope.pointSourceConfigured = false; + $scope.settings.speedInKilometersPerHour = 3; + $scope.useMultipleStartPoints = false; + $scope.settings.loadingData = false; + $scope.unit = 'Meter'; + $scope.settings.currentTODValue = 1; + $scope.isTime = false; + $scope.settings.preference = "fastest"; + $scope.locationsArray = []; + $scope.rangeArray = []; + $scope.removePotentialDrawnStartingPoints(); + $scope.routeDistance_km = undefined; + $scope.routeDuration_minutes = undefined; + $scope.currentIsochronesGeoJSON = undefined; + $scope.currentRouteGeoJSON = undefined; + $scope.error = undefined; + $scope.geosearchResults_startingPoint; + $scope.geosearchResults_endPoint; + $scope.routingStartPoint = undefined; + $scope.routingEndPoint = undefined; + $scope.settings.routingStartPointInput = undefined; + $scope.settings.routingEndPointInput = undefined; + setTimeout(function () { + $scope.$digest(); + }, 200); + }; + $scope.removePotentialDrawnStartingPoints = function () { + // TODO + $scope.manualStartPoints = undefined; + $scope.disablePointDrawTool(); + $scope.removeAllDrawnPoints(); + }; + /** + * TODO + */ + $scope.removeReachabilityLayers = function () { + $scope.settings.loadingData = true; + $rootScope + .$broadcast('showLoadingIconOnMap'); + kommonitorMapService + .removeReachabilityLayers(); + $scope.currentIsochronesGeoJSON = undefined; + kommonitorDataExchangeService.isochroneLegend = undefined; + // remove any diagram + $scope.resetPoisInIsochrone(); + $scope.settings.loadingData = false; + $rootScope + .$broadcast('hideLoadingIconOnMap'); + }; + $scope.removeRoutingLayers = function () { + $scope.settings.loadingData = true; + $rootScope + .$broadcast('showLoadingIconOnMap'); + kommonitorMapService + .removeRoutingLayers(); + $scope.currentRouteGeoJSON = undefined; + kommonitorDataExchangeService.routingLegend = undefined; + $scope.settings.loadingData = false; + $rootScope + .$broadcast('hideLoadingIconOnMap'); + }; + /** + * TODO + */ + $scope.prepareDownloadGeoJSON = function () { + if ($scope.currentIsochronesGeoJSON) { + $scope.prepareIsochroneDownload(); + } + if ($scope.currentRouteGeoJSON) { + $scope.prepareRouteDownload(); + } + }; + $scope.prepareIsochroneDownload = function () { + console.log('removing old download button if available'); + if (document + .getElementById('downloadReachabilityIsochrones')) + document + .getElementById('downloadReachabilityIsochrones') + .remove(); + var geoJSON_string = JSON + .stringify($scope.currentIsochronesGeoJSON); + var fileName = 'Erreichbarkeitsisochronen_via-' + + $scope.settings.transitMode + + '_Abbruchkriterium-' + + $scope.settings.focus + '.geojson'; + var blob = new Blob([geoJSON_string], { + type: 'application/json' + }); + var data = URL.createObjectURL(blob); + console.log('create new Download button and append it to DOM'); + var a = document.createElement('a'); + a.download = fileName; + a.href = data; + a.textContent = 'Download Isochronen als GeoJSON'; + a.id = 'downloadReachabilityIsochrones'; + a.setAttribute('class', 'btn btn-info'); + let elements = document.getElementsByClassName('reachabilityIsochroneButtonSection'); + for (const element of elements) { + element.appendChild(a); + } + }; + $scope.prepareRouteDownload = function () { + console.log('removing old download button if available'); + if (document + .getElementById('downloadReachabilityRoute')) + document + .getElementById('downloadReachabilityRoute') + .remove(); + var geoJSON_string = JSON + .stringify($scope.currentRouteGeoJSON); + var fileName = 'Routing-Ergebnis.geojson'; + var blob = new Blob([geoJSON_string], { + type: 'application/json' + }); + var data = URL.createObjectURL(blob); + console.log('create new Download button and append it to DOM'); + var a = document.createElement('a'); + a.download = fileName; + a.href = data; + a.textContent = 'Download Route als GeoJSON'; + a.id = 'downloadReachabilityRoute'; + a.setAttribute('class', 'btn btn-info'); + let elements = document.getElementsByClassName('reachabilityRouteButtonSection'); + for (const element of elements) { + element.appendChild(a); + } + }; + /** + * Dummy function. + */ + $scope.TODO = function () { + alert('Funktion wurde noch nicht implementiert!'); + }; + /** + * Changes the focus of the analysis between + * distance and time. + */ + $scope.changeFocus = function (value) { + if (value === 'time' && $scope.settings.transitMode === "buffer") { + $scope.settings.focus = 'distance'; + $scope.isTime = false; + $scope.unit = 'Meter'; + $scope.changeValues(); + return; + } + $scope.resetSlider(); + if ($scope.settings.focus == 'distance') { + $scope.isTime = false; + $scope.unit = 'Meter'; + } + else if ($scope.settings.focus == 'time') { + $scope.unit = 'Minuten'; + $scope.isTime = true; + } + $scope.changeMinMaxSpeed(); + $scope.changeValues(); + }; + /** + * Changes the start points source of the analysis between + * fromLayer and manualDraw. + */ + $scope.changeStartPointsSource_fromLayer = function () { + $scope.disablePointDrawTool(); + $scope.settings.startPointsSource = "fromLayer"; + }; + $scope.changeStartPointsSource_manual = function () { + $scope.enablePointDrawTool(); + $scope.settings.startPointsSource = "manual"; + }; + $scope.removeAllDrawnPoints = function () { + // TODO + $rootScope.$broadcast("removeAllDrawnPoints"); + }; + $scope.enablePointDrawTool = function () { + // add/activate leaflet-draw toolbar for only POINT features + $rootScope.$broadcast("enablePointDrawTool"); + }; + $scope.disablePointDrawTool = function () { + // disable/hide leaflet-draw toolbar for only POINT features + $rootScope.$broadcast("disablePointDrawTool"); + }; + $scope.$on("onUpdateDrawnPointFeatures", function (event, drawnPointsFeatureGroup) { + // if drawnPointsFeatureGroup is empty or does not exist, we must catch that + try { + $scope.manualStartPoints = drawnPointsFeatureGroup.toGeoJSON(); + $scope.pointSourceConfigured = true; + } + catch (error) { + $scope.manualStartPoints = undefined; + $scope.pointSourceConfigured = false; + } + setTimeout(function () { + $scope.$digest(); + }, 150); + }); + /** + * Resets the slider for the distance-/time and + * speed to initial values. + */ + $scope.resetSlider = function () { + $scope.settings.speedInKilometersPerHour = $scope.minSpeedInKilometersPerHour; + $scope.settings.currentTODValue = 1; + }; + /** + * Changes the vehicle type according to an + * action on the related buttons. + */ + $scope.changeType = function () { + $scope.changeValues(); + $scope.changeMinMaxSpeed(); + $scope.resetSlider(); + }; + /** + * Changes the max_value depending on the + * selected vehicle type. + */ + $scope.changeValues = function () { + if ($scope.settings.transitMode == 'buffer') { + $scope.settings.focus = 'distance'; + $("#focus_distance").click(); + if ($scope.settings.focus == 'distance') + $scope.max_value = 5000; + else + $scope.max_value = 25; + } + if ($scope.settings.transitMode == 'foot-walking') { + if ($scope.settings.focus == 'distance') + $scope.max_value = 5000; + else + $scope.max_value = 25; + } + if ($scope.settings.transitMode == 'cycling-regular') { + if ($scope.settings.focus == 'distance') + $scope.max_value = 5000; + else + $scope.max_value = 20; + } + if ($scope.settings.transitMode == 'driving-car') { + if ($scope.settings.focus == 'distance') + $scope.max_value = 5000; + else + $scope.max_value = 15; + } + if ($scope.settings.transitMode == 'wheelchair') { + if ($scope.settings.focus == 'distance') + $scope.max_value = 5000; + else + $scope.max_value = 25; + } + }; + /** + * Changes the minimum and maximum + * speed-per-hour value depending on the current + * selected vehicle type. + */ + $scope.changeMinMaxSpeed = function () { + if ($scope.settings.transitMode == 'buffer') { + $scope.minSpeedInKilometersPerHour = 1; + $scope.maxSpeedInKilometersPerHour = 6; + } + if ($scope.settings.transitMode == 'foot-walking') { + $scope.minSpeedInKilometersPerHour = 1; + $scope.maxSpeedInKilometersPerHour = 6; + } + if ($scope.settings.transitMode == 'cycling-regular') { + $scope.minSpeedInKilometersPerHour = 10; + $scope.maxSpeedInKilometersPerHour = 25; + } + if ($scope.settings.transitMode == 'driving-car') { + $scope.minSpeedInKilometersPerHour = 30; + $scope.maxSpeedInKilometersPerHour = 130; + } + if ($scope.settings.transitMode == 'wheelchair') { + $scope.minSpeedInKilometersPerHour = 1; + $scope.maxSpeedInKilometersPerHour = 6; + } + $scope.settings.speedInKilometersPerHour = $scope.minSpeedInKilometersPerHour; + }; + /** + * Checks the input-textfield for the + * isochrone-distance-array for validity. + * Extracts the text value of the textfield, + * splits it at every ',' and writes the values + * into the array of desired distances. Adds the + * analysis distance at the end of the array so + * the whole distance of the analysis will be + * covered by isochones. + */ + $scope.checkArrayInput = function () { + $scope.rangeArray = []; + var split = $scope.settings.isochroneInput.split(','); + var actVal; + if (split.length > 0) { + for (var a = 0; a < split.length; a++) { + if (!isNaN(split[a])) { + actVal = parseFloat(split[a]); + if (!isNaN(actVal)) + $scope.rangeArray + .push(actVal); + } + } + } + $scope.rangeArray.sort(function (a, b) { return a - b; }); + }; + /** + * Changes variables so the isochrone-calculation-elements will be shown. + */ + $scope.showIso = function () { + $scope.showIsochrones = true; + }; + /** + * Changes variables so the routing-calculation-elements will be shown. + */ + $scope.showRouting = function () { + $scope.showIsochrones = false; + // force active setting of transit mode foot-walking when changing to routing mode + $scope.settings.transitMode = "foot-walking"; + document.getElementById("optFeet").click(); + document.getElementById("optFeetRadioButtonLabel").classList.add('active'); + $timeout(function () { + $scope.$digest(); + }); + }; + $scope.onClickPerDataset_isochroneConfig = function () { + $timeout(function () { + if (!$scope.settings.isochroneConfig.selectedDate) { + $scope.settings.isochroneConfig.selectedDate = $scope.settings.selectedStartPointLayer.availablePeriodsOfValidity[$scope.settings.selectedStartPointLayer.availablePeriodsOfValidity.length - 1]; + } + if (!$scope.isUsedInReporting) { + $scope.fetchGeoJSONForIsochrones(); + } + }, 500); + }; + $scope.fetchGeoJSONForIsochrones = async function () { + if (!$scope.settings.selectedStartPointLayer) { + $scope.settings.loadingData = false; + return; + } + // clear any previous results + $scope.settings.selectedStartPointLayer.geoJSON = undefined; + var date; + if ($scope.settings.isochroneConfig.dateSelectionType.selectedDateType === $scope.settings.isochroneConfig.dateSelectionType_valuePerDataset) { + date = $scope.settings.isochroneConfig.selectedDate.startDate; + } + else if ($scope.settings.isochroneConfig.dateSelectionType.selectedDateType === $scope.settings.isochroneConfig.dateSelectionType_valueManual) { + date = $scope.settings.isochroneConfig.selectedDate_manual; + } + else { + date = kommonitorDataExchangeService.selectedDate; + } + if (!date) { + $scope.settings.loadingData = false; + return; + } + $scope.settings.loadingData = true; + var id = $scope.settings.selectedStartPointLayer.georesourceId; + var dateComps = date.split("-"); + var year = dateComps[0]; + var month = dateComps[1]; + var day = dateComps[2]; + await $http({ + url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + id + "/" + year + "/" + month + "/" + day, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + var geoJSON = response.data; + $scope.settings.selectedStartPointLayer.geoJSON = geoJSON; + $scope.settings.loadingData = false; + $scope.pointSourceConfigured = true; + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.pointSourceConfigured = false; + $scope.settings.loadingData = false; + console.error(error.statusText); + kommonitorDataExchangeService.displayMapApplicationError(error); + $scope.error = error.statusText; + }); + }; + $scope.onChangeSelectedStartPointLayer = async function () { + $scope.settings.isochroneConfig.selectedDate = undefined; + if (!$scope.settings.isochroneConfig.selectedDate) { + $scope.settings.isochroneConfig.selectedDate = $scope.settings.selectedStartPointLayer.availablePeriodsOfValidity[$scope.settings.selectedStartPointLayer.availablePeriodsOfValidity.length - 1]; + } + if (!$scope.isUsedInReporting) { + $scope.fetchGeoJSONForIsochrones(); + } + }; + /** + * Starts the analysis. This function is fired + * when the related button is pushed. + * + * Depending on the current selection of the + * calculation-task the function + * 'startRoutingAnalysis' or + * 'startIsochroneCalculation' will be + * triggered. + * + * The values from the input-elements are all + * up-to-date and saved in the variables + * accessible via the scope. The request URL + * will be build by this values and send towards + * the routing-API. The result will be handled, + * stored in the related scope- variables and + * displayed in the KM GUI. + * + * If this method is fired from within the reporting modal + * ($scope.isUsedInReporting = true) the result is not added to the main map, + * but returned to the reporting component per broadcast. + */ + $scope.startAnalysis = function () { + $timeout(function () { + // Any code in here will automatically have an $scope.apply() run afterwards + if (!$scope.isUsedInReporting) { // reporting uses it's own loading overlay, which is controlled there + $scope.settings.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + } + // And it just works! + }, 50); + $timeout(function () { + $scope.error = undefined; + if ($scope.showIsochrones) + $scope.startIsochroneCalculation(); + else + $scope.startRoutingCalculation(); + }, 150); + }; + /** + * Starts the routing-calculation. + */ + $scope.startRoutingCalculation = function () { + $scope.settings.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + var startPointString = $scope.routingStartPoint.longitude + "," + $scope.routingStartPoint.latitude; + var endPointString = $scope.routingEndPoint.longitude + "," + $scope.routingEndPoint.latitude; + var url = createRoutingRequest($scope.settings.transitMode, $scope.settings.preference, startPointString, endPointString); + // let coordinatesArray = []; + // coordinatesArray.push(startPointString); + // coordinatesArray.push(endPointString); + // let postBody = { + // "coordinates": coordinatesArray + // }; + // let url = $scope.targetUrlToReachabilityService_ORS + // + '/v2/directions/' + $scope.settings.transitMode + '/geojson'; + console.log("execute OpenRouteService routing request: " + url); + var req = { + method: 'GET', + url: url, + headers: { + // 'Accept': 'application/json' + } + }; + $http(req) + // $http.post(url, postBody) + .then(function successCallback(response) { + $scope.currentRouteGeoJSON = response.data; + $scope.routeDistance_km = $scope.currentRouteGeoJSON.features[0].properties.summary.distance / 1000; + $scope.routeDuration_minutes = Math.round($scope.currentRouteGeoJSON.features[0].properties.summary.duration / 60); + // TODO : CDB + kommonitorMapService + .replaceRouteGeoJSON($scope.currentRouteGeoJSON, $scope.settings.transitMode, $scope.settings.preference, $scope.routingStartPoint, $scope.routingEndPoint, $scope.routeDistance_km, $scope.routeDuration_minutes); + $scope.prepareDownloadGeoJSON(); + $scope.settings.loadingData = false; + $rootScope.$broadcast('hideLoadingIconOnMap'); + }, function errorCallback(error) { + // called asynchronously + // if an error occurs + // or server returns + // response with an + // error status. + console.error(error.data.error.message); + $scope.error = error.data.error.message; + $scope.settings.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + $rootScope.$broadcast("hideLoadingIconOnMap"); + }); + }; + $scope.makeLocationsArrayFromStartPoints = function () { + // array of arrays of lon,lat + $scope.locationsArray = []; + if ($scope.settings.startPointsSource === "manual") { + // establish from drawn points + $scope.manualStartPoints.features.forEach(function (feature) { + $scope.locationsArray.push(feature.geometry.coordinates); + }); + } + else { + // establish from chosen layer + $scope.settings.selectedStartPointLayer.geoJSON.features.forEach(function (feature) { + $scope.locationsArray.push(feature.geometry.coordinates); + }); + } + return $scope.locationsArray; + }; + /** + * Starts an isochrone-calculation. + */ + $scope.startIsochroneCalculation = async function () { + if (!$scope.isUsedInReporting) { // reporting uses it's own loading overlay, which is controlled there + $scope.settings.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + } + else { + $scope.$emit("reportingIsochronesCalculationStarted"); + } + $scope.checkArrayInput(); + $scope.locationsArray = $scope.makeLocationsArrayFromStartPoints(); + // SWITCH THE VALUE DEPENDING ON THE LENGTH + // OF THE LOCATIONS ARRAY + if ($scope.locationsArray.length > 1) + $scope.useMultipleStartPoints = true; + else + $scope.useMultipleStartPoints = false; + var resultIsochrones; + if ($scope.settings.transitMode === 'buffer') { + resultIsochrones = await $scope.createBuffers(); + } + else { + resultIsochrones = await $scope.createIsochrones(); + } + if ($scope.isUsedInReporting) { + // No need to add isochrones to main map. + // Instead they are returned to reporting modal + $scope.$emit("reportingIsochronesCalculationFinished", resultIsochrones); + return; + } + $scope.currentIsochronesGeoJSON = resultIsochrones; + kommonitorMapService.replaceIsochroneMarker($scope.locationsArray); + kommonitorMapService + .replaceIsochroneGeoJSON($scope.currentIsochronesGeoJSON, $scope.settings.transitMode, $scope.settings.focus, $scope.rangeArray, $scope.useMultipleStartPoints, $scope.settings.dissolveIsochrones, $scope.settings.speedInKilometersPerHour); + $scope + .prepareDownloadGeoJSON(); + $scope.settings.loadingData = false; + $timeout(function () { + $rootScope.$broadcast('hideLoadingIconOnMap'); + }, 500); + $scope.$digest(); + }; + $scope.fetchIsochrones = async function (tempStartPointsArray) { + var body = createORSIsochroneRequestBody(tempStartPointsArray, $scope.rangeArray); + let url = $scope.targetUrlToReachabilityService_ORS + + '/v2/isochrones/' + $scope.settings.transitMode; + var req = { + method: 'POST', + url: url, + data: body, + headers: { + // 'Accept': 'application/json', + "Content-Type": 'application/json' + } + }; + return await $http(req) + .then(function successCallback(response) { + // this callback will + // becalled + // asynchronously + // when the response is + // available + // dissolve features + if ($scope.settings.dissolveIsochrones) { + try { + var dissolved = turf.dissolve(response.data, { propertyName: 'value' }); + return dissolved; + } + catch (e) { + console.error("Dissolving Isochrones failed with error: " + e); + console.error("Will return undissolved isochrones"); + return response.data; + } + finally { + } + } + else { + return response.data; + } + }, function errorCallback(error) { + // called asynchronously + // if an error occurs + // or server returns + // response with an + // error status. + console.error(error.data.error.message); + $scope.error = error.data.error.message; + $scope.settings.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + $rootScope.$broadcast("hideLoadingIconOnMap"); + }); + }; + $scope.createBuffers = function () { + var resultIsochrones; + var startingPoints_geoJSON; + // create Buffers for each input and range definition + if ($scope.settings.startPointsSource === "manual") { + // establish from drawn points + startingPoints_geoJSON = $scope.manualStartPoints; + } + else { + // establish from chosen layer + startingPoints_geoJSON = $scope.settings.selectedStartPointLayer.geoJSON; + } + // range in meters + for (const range of $scope.rangeArray) { + var geoJSON_buffered = turf.buffer(startingPoints_geoJSON, Number(range) / 1000, { units: 'kilometers', steps: 12 }); + if (!geoJSON_buffered.features) { + // transform single feature to featureCollection + geoJSON_buffered = turf.featureCollection([ + geoJSON_buffered + ]); + } + if ($scope.settings.dissolveIsochrones) { + try { + geoJSON_buffered = turf.dissolve(geoJSON_buffered); + } + catch (e) { + console.error("Dissolving Isochrones failed with error: " + e); + console.error("Will return undissolved isochrones"); + } + finally { + } + } + // add property: value --> range + if (geoJSON_buffered.features && geoJSON_buffered.features.length > 0) { + for (const feature of geoJSON_buffered.features) { + feature.properties.value = range; + } + } + if (!resultIsochrones) { + resultIsochrones = geoJSON_buffered; + } + else { + resultIsochrones.features = resultIsochrones.features.concat(geoJSON_buffered.features); + } + } + return resultIsochrones; + }; + $scope.createIsochrones = async function () { + var resultIsochrones; + console.log('Calculating isochrones for ' + + $scope.locationsArray.length + + ' start points.'); + var maxLocationsForORSRequest = 400; + var featureIndex = 0; + // log progress for each 10% of features + var logProgressIndexSeparator = Math.round($scope.locationsArray.length / 100 * 10); + var countFeatures = 0; + var tempStartPointsArray = []; + for (var pointIndex = 0; pointIndex < $scope.locationsArray.length; pointIndex++) { + tempStartPointsArray.push($scope.locationsArray[pointIndex]); + countFeatures++; + // if maxNumber of locations is reached or the last starting point is reached + if (countFeatures === maxLocationsForORSRequest || pointIndex === $scope.locationsArray.length - 1) { + // make request, collect results + // responses will be GeoJSON FeatureCollections + var tempIsochrones = await $scope.fetchIsochrones(tempStartPointsArray); + if (!resultIsochrones) { + resultIsochrones = tempIsochrones; + } + else { + // apend results of tempIsochrones to resultIsochrones + resultIsochrones.features = resultIsochrones.features.concat(tempIsochrones.features); + } + // increment featureIndex + featureIndex++; + if (featureIndex % logProgressIndexSeparator === 0) { + console.log("PROGRESS: Computed isochrones for '" + featureIndex + "' of total '" + $scope.locationsArray.length + "' starting points."); + } + // reset temp vars + tempStartPointsArray = []; + countFeatures = 0; + } // end if + } // end for + return resultIsochrones; + }; + $scope.onChangeRoutingStartPoint = function () { + // Clear the timeout if it has already been set. + // This will prevent the previous task from executing + // if it has been less than + clearTimeout($scope.delay); + $scope.geosearchResults_startingPoint = undefined; + // Make a new timeout set to go off in 800ms + $scope.delay = setTimeout(function () { + console.log('Geosearch for Input String: ', $scope.settings.routingStartPointInput); + $scope.openStreetMapProvider.search({ query: $scope.settings.routingStartPointInput }) + .then(function (result) { + $scope.geosearchResults_startingPoint = result; + $scope.$digest(); + }); + }, 500); + }; + $scope.onClickGeosearchResult_startingPoint = function (geosearchResult) { + // result object from leaflet-geosearch + // const result = { + // x: Number, // lon, + // y: Number, // lat, + // label: String, // formatted address + // bounds: [ + // [Number, Number], // s, w - lat, lon + // [Number, Number], // n, e - lat, lon + // ], + // raw: {}, // raw provider result + // } + $scope.routingStartPoint = { + label: geosearchResult.label, + longitude: geosearchResult.x, + latitude: geosearchResult.y + }; + // hide geosearch results to minimize page height + $scope.geosearchResults_startingPoint = undefined; + }; + $scope.onChangeRoutingEndPoint = function () { + // Clear the timeout if it has already been set. + // This will prevent the previous task from executing + // if it has been less than + clearTimeout($scope.delay); + $scope.geosearchResults_endPoint = undefined; + // Make a new timeout set to go off in 800ms + $scope.delay = setTimeout(function () { + console.log('Geosearch for Input String: ', $scope.settings.routingEndPointInput); + $scope.openStreetMapProvider.search({ query: $scope.settings.routingEndPointInput }) + .then(function (result) { + $scope.geosearchResults_endPoint = result; + $scope.$digest(); + }); + }, 500); + }; + $scope.onClickGeosearchResult_endPoint = function (geosearchResult) { + // result object from leaflet-geosearch + // const result = { + // x: Number, // lon, + // y: Number, // lat, + // label: String, // formatted address + // bounds: [ + // [Number, Number], // s, w - lat, lon + // [Number, Number], // n, e - lat, lon + // ], + // raw: {}, // raw provider result + // } + $scope.routingEndPoint = { + label: geosearchResult.label, + longitude: geosearchResult.x, + latitude: geosearchResult.y + }; + // hide geosearch results to minimize page height + $scope.geosearchResults_endPoint = undefined; + }; + //////////////////////////// SECTION FOR GORESOURCE AND INDICATOR ANALYSIS + $scope.getQueryDate = function (resource) { + if ($scope.settings.dateSelectionType.selectedDateType === $scope.settings.dateSelectionType_valueIndicator) { + return kommonitorDataExchangeService.selectedDate; + } + else if ($scope.settings.dateSelectionType.selectedDateType === $scope.settings.dateSelectionType_valueManual) { + return $scope.settings.selectedDate_manual; + } + else if ($scope.settings.dateSelectionType.selectedDateType === $scope.settings.dateSelectionType_valuePerDataset) { + return resource.selectedDate.startDate; + } + else { + return kommonitorDataExchangeService.selectedDate; + } + }; + $scope.handlePoiForAnalysis = async function (poi) { + $scope.settings.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + try { + if (poi.isSelected_reachabilityAnalysis) { + poi = await $scope.fetchGeoJSONForDate(poi); + } + poi = await $scope.handlePoiOnDiagram(poi); + if (kommonitorDataExchangeService.isDisplayableGeoresource(poi)) { + $scope.handlePoiOnMap(poi); + } + } + catch (error) { + console.error(error); + } + $scope.settings.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + // as method is async we may call angular digest cycle + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + $scope.fetchGeoJSONForDate = function (poiGeoresource) { + var id = poiGeoresource.georesourceId; + var date = $scope.getQueryDate(poiGeoresource); + var dateComps = date.split("-"); + var year = dateComps[0]; + var month = dateComps[1]; + var day = dateComps[2]; + return $http({ + url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + id + "/" + year + "/" + month + "/" + day, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + var geoJSON = response.data; + poiGeoresource.geoJSON = geoJSON; + return poiGeoresource; + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.settings.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + $rootScope.$broadcast("hideLoadingIconOnMap"); + }); + }; + $scope.handlePoiOnDiagram = async function (poi) { + if (poi.isSelected_reachabilityAnalysis) { + // maps range value to result GeoJSON + var pointsPerIsochroneRangeMap = await $scope.computePoisWithinIsochrones(poi); + $scope.addOrReplaceWithinDiagrams(poi, pointsPerIsochroneRangeMap); + // now filter the geoJSON to only include those datasets that are actually inside any isochrone + poi = filterGeoJSONPointsInsideLargestIsochrone(poi, pointsPerIsochroneRangeMap); + } + else { + //remove POI layer from map + $scope.removePoiFromDiagram(poi); + } + return poi; + }; + function filterGeoJSONPointsInsideLargestIsochrone(poi, pointsPerIsochroneRangeMap) { + var keyIter = pointsPerIsochroneRangeMap.keys(); + var nextKey = keyIter.next(); + var largestRange; + while (nextKey.value) { + var nextRange = nextKey.value; + if (!largestRange) { + largestRange = Number(nextRange); + } + else if (largestRange < Number(nextRange)) { + largestRange = Number(nextRange); + } + nextKey = keyIter.next(); + } + // map stores keys as string + poi.geoJSON = pointsPerIsochroneRangeMap.get("" + largestRange); + return poi; + } + $scope.computePoisWithinIsochrones = async function (poi) { + var pointsPerIsochroneRangeMap = $scope.initializeMapWithRangeKeys(); + if (!poi.geoJSON) { + poi = await $scope.fetchGeoJSONForDate(poi); + } + // as there might be mutliple isochrone ranges + // we must perform point in polygon for each range + var keyIter = pointsPerIsochroneRangeMap.keys(); + var nextKey = keyIter.next(); + while (nextKey.value) { + var nextKeyValue = nextKey.value; + var geoJSON_featureCollection = $scope.computePoisWithinIsochrone(nextKeyValue, poi); + pointsPerIsochroneRangeMap.set(nextKeyValue, geoJSON_featureCollection); + nextKey = keyIter.next(); + } + return pointsPerIsochroneRangeMap; + }; + $scope.computePoisWithinIsochrone = function (rangeValue, poi) { + // create clones of poi geoJSON and isochrone geoJSON + var isochrones_geoJSON_clone = JSON.parse(JSON.stringify($scope.currentIsochronesGeoJSON)); + var poi_geoJSON_clone = JSON.parse(JSON.stringify(poi.geoJSON)); + // filter isochrone geoJSON clone by range value + isochrones_geoJSON_clone.features = isochrones_geoJSON_clone.features.filter(feature => { + return String(feature.properties.value) === String(rangeValue); + }); + // filter poi geoJSON clone by spatial within isochrone + var pointsWithinIsochrones = turf.pointsWithinPolygon(poi_geoJSON_clone, isochrones_geoJSON_clone); + return pointsWithinIsochrones; + }; + $scope.initializeMapWithRangeKeys = function () { + var map = new Map(); + for (const feature of $scope.currentIsochronesGeoJSON.features) { + map.set("" + feature.properties.value, null); + } + return map; + }; + $scope.addOrReplaceWithinDiagrams = function (poi, pointsPerIsochroneRangeMap) { + var mapEntries = pointsPerIsochroneRangeMap.entries(); + var nextEntry = mapEntries.next(); + while (nextEntry.value) { + var nextEntry_keyRange = nextEntry.value[0]; + var nextEntry_valueGeoJSON = nextEntry.value[1]; + var numberOfFeatures = 0; + var nextEntry_keyRange_label = nextEntry_keyRange; + if ($scope.settings.focus == 'time') { + // compute seconds to minutes for display + nextEntry_keyRange_label = nextEntry_keyRange_label / 60; + } + if (nextEntry_valueGeoJSON) { + numberOfFeatures = nextEntry_valueGeoJSON.features.length; + } + console.log("Number of Points wihtin Range '" + nextEntry_keyRange + "' is '" + numberOfFeatures + "'"); + var date = $scope.getQueryDate(poi); + if ($scope.echartsInstances_reachabilityAnalysis && $scope.echartsInstances_reachabilityAnalysis.has(nextEntry_keyRange)) { + // append to diagram + var echartsInstance = $scope.echartsInstances_reachabilityAnalysis.get(nextEntry_keyRange); + var echartsOptions = echartsInstance.getOption(); + echartsOptions = kommonitorDiagramHelperService.appendToReachabilityAnalysisOptions(poi, nextEntry_valueGeoJSON, echartsOptions, date); + echartsInstance.setOption(echartsOptions); + $scope.echartsInstances_reachabilityAnalysis.set(nextEntry_keyRange, echartsInstance); + } + else { + var reachabilityDiagramsSectionNode = document.getElementById("reachability_diagrams_section"); + var newChartNode = document.createElement("div"); + newChartNode.innerHTML = '

        Analyse Einzugsgebiet ' + nextEntry_keyRange_label + ' [' + kommonitorDataExchangeService.isochroneLegend.cutOffUnit + ']



        '; + reachabilityDiagramsSectionNode.appendChild(newChartNode); + // init new echarts instance + var echartsInstance = echarts.init(document.getElementById('reachability_pieDiagram_range_' + nextEntry_keyRange + '')); + // use configuration item and data specified to show chart + var echartsOptions = kommonitorDiagramHelperService.createInitialReachabilityAnalysisPieOptions(poi, nextEntry_valueGeoJSON, nextEntry_keyRange_label + " " + $scope.unit, date); + echartsInstance.setOption(echartsOptions); + echartsInstance.hideLoading(); + $scope.echartsInstances_reachabilityAnalysis.set(nextEntry_keyRange, echartsInstance); + setTimeout(function () { + echartsInstance.resize(); + }, 350); + } + nextEntry = mapEntries.next(); + } + }; + $scope.removePoiFromDiagram = function (poiGeoresource) { + var chart_entries = $scope.echartsInstances_reachabilityAnalysis.entries(); + var nextChartInstanceEntry = chart_entries.next(); + while (nextChartInstanceEntry.value) { + var nextChartInstance = nextChartInstanceEntry.value[1]; + var nextChartOptions = nextChartInstance.getOption(); + nextChartOptions = kommonitorDiagramHelperService.removePoiFromReachabilityAnalysisOption(nextChartOptions, poiGeoresource); + nextChartInstance.setOption(nextChartOptions); + $scope.echartsInstances_reachabilityAnalysis.set(nextChartInstanceEntry.value[0], nextChartInstance); + nextChartInstanceEntry = chart_entries.next(); + } + }; + $scope.handlePoiOnMap = function (poi) { + if (poi.isSelected_reachabilityAnalysis) { + //display on Map + $scope.addPoiLayerToMap(poi); + } + else { + //remove POI layer from map + $scope.removePoiLayerFromMap(poi); + } + }; + $scope.addPoiLayerToMap = function (poiGeoresource) { + $scope.settings.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + // fale --> useCluster = false + kommonitorMapService.addPoiGeoresourceGeoJSON_reachabilityAnalysis(poiGeoresource, $scope.getQueryDate(poiGeoresource), false); + $scope.settings.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + }; + $scope.removePoiLayerFromMap = function (poiGeoresource) { + $scope.settings.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + poiGeoresource = poiGeoresource; + kommonitorMapService.removePoiGeoresource_reachabilityAnalysis(poiGeoresource); + $scope.settings.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + }; + $scope.refreshPoiLayers = async function () { + for (var poi of kommonitorDataExchangeService.availableGeoresources) { + if (poi.isSelected_reachabilityAnalysis) { + //remove POI layer from map + $scope.removePoiLayerFromMap(poi); + poi = await $scope.fetchGeoJSONForDate(poi); + // remove layer and add layer again + $scope.addPoiLayerToMap(poi); + } + } + }; + $scope.onClickUseIndicatorTimestamp = function () { + $scope.settings.dateSelectionType.selectedDateType = $scope.settings.dateSelectionType_valueIndicator; + $scope.refreshSelectedGeoresources(); + }; + $scope.timeout_manualdate; + function isNoValidDate(dateCandidate) { + var dateComps = dateCandidate.split("-"); + if (dateComps.length < 3) { + return true; + } + else if (!dateComps[0] || !dateComps[1] || !dateComps[2]) { + return true; + } + else if (isNaN(dateComps[0]) || isNaN(dateComps[1]) || isNaN(dateComps[2])) { + return true; + } + else if (Number(dateComps[1]) > 12 || Number(dateComps[2]) > 31) { + return true; + } + return false; + } + $scope.onChangeManualDate = function () { + // check if date is an actual date + // if so then refresh selected layers + // Clear the timeout if it has already been set. + // This will prevent the previous task from executing + // if it has been less than + clearTimeout($scope.timeout_manualdate); + // Make a new timeout set to go off in 1000ms (1 second) + $scope.timeout_manualdate = setTimeout(function () { + var dateCandidate = $scope.settings.selectedDate_manual; + if (isNoValidDate(dateCandidate)) { + return; + } + $timeout(function () { + $scope.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + }); + $timeout(function () { + $scope.refreshSelectedGeoresources(); + }, 250); + }, 1000); + }; + $scope.onChangeManualDate_isochroneConfig = function () { + // check if date is an actual date + // if so then refresh selected layers + // Clear the timeout if it has already been set. + // This will prevent the previous task from executing + // if it has been less than + clearTimeout($scope.timeout_manualdate); + // Make a new timeout set to go off in 1000ms (1 second) + $scope.timeout_manualdate = setTimeout(function () { + var dateCandidate = $scope.settings.isochroneConfig.selectedDate_manual; + if (isNoValidDate(dateCandidate)) { + return; + } + if (!$scope.isUsedInReporting) { + $scope.fetchGeoJSONForIsochrones(); + } + // $timeout(function(){ + // $scope.loadingData = true; + // $rootScope.$broadcast("showLoadingIconOnMap"); + // }); + // $timeout(function(){ + // $scope.fetchGeoJSONForIsochrones(); + // }, 250); + }, 1000); + }; + $scope.$on("selectedIndicatorDateHasChanged", function (event) { + console.log("refresh selected georesource layers according to new date"); + // only refresh georesources if sync with indicator timestamp is selected + if (!$scope.settings.dateSelectionType.selectedDateType.includes($scope.settings.dateSelectionType_valueIndicator)) { + return; + } + $timeout(function () { + $scope.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + }); + $timeout(function () { + $scope.refreshSelectedGeoresources(); + }, 250); + }); + $scope.refreshSelectedGeoresources = async function () { + for (const georesource of kommonitorDataExchangeService.availableGeoresources) { + if (georesource.isSelected_reachabilityAnalysis) { + if (georesource.isPOI) { + georesource.isSelected_reachabilityAnalysis = false; + await $scope.handlePoiForAnalysis(georesource); + georesource.isSelected_reachabilityAnalysis = true; + await $scope.handlePoiForAnalysis(georesource); + } + } + } + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + }; + $scope.onChangeSelectedDate = async function (georesourceDataset) { + // only if it s already selected, we must modify the shown dataset + if (georesourceDataset.isSelected_reachabilityAnalysis) { + // depending on type we must call different methods + if (georesourceDataset.isPOI) { + georesourceDataset.isSelected_reachabilityAnalysis = false; + await $scope.handlePoiForAnalysis(georesourceDataset); + georesourceDataset.isSelected_reachabilityAnalysis = true; + await $scope.handlePoiForAnalysis(georesourceDataset); + } + } + }; + $(window).on('resize', function () { + var chart_entries = $scope.echartsInstances_reachabilityAnalysis.entries(); + var nextChartInstanceEntry = chart_entries.next(); + while (nextChartInstanceEntry.value) { + var nextChartInstance = nextChartInstanceEntry.value[1]; + if (nextChartInstance != null && nextChartInstance != undefined) { + nextChartInstance.resize(); + } + nextChartInstanceEntry = chart_entries.next(); + } + }); + } + ] +}); +//# sourceMappingURL=kommonitor-reachability.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorReachability/kommonitor-reachability.component.js.map b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorReachability/kommonitor-reachability.component.js.map new file mode 100644 index 000000000..0ac18c484 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorReachability/kommonitor-reachability.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-reachability.component.js","sourceRoot":"","sources":["kommonitor-reachability.component.ts"],"names":[],"mappings":";AAAA,OAAO;KACL,MAAM,CAAC,wBAAwB,CAAC;KAChC,SAAS,CACT,wBAAwB,EAAE;IACzB,WAAW,EAAE,oHAAoH;IACjI;;;OAGG;IACH,UAAU,EAAE;QACX,QAAQ;QACR,YAAY;QACZ,OAAO;QACP,UAAU;QACV,sBAAsB;QACtB,+BAA+B;QAC/B,gCAAgC;QAChC,OAAO;QACP;;WAEG;QACH,SAAS,gCAAgC,CAAC,MAAM,EAC/C,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,oBAAoB,EACjD,6BAA6B,EAAE,8BAA8B,EAAC,KAAK;YAEnE,uCAAuC;YAEvC,MAAM,CAAC,iBAAiB,GAAG,KAAK,CAAC;YAEjC,sCAAsC;YACtC,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,CAAC;YAEtB,IAAI,KAAK,GAAG,QAAQ,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC;YACzD,KAAK,CAAC,gBA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GnE,IAAG,kBAAkB,CAAC,+BAA+B,EAAC;oBACrD,mDAAmD;oBACnD,IAAI,kBAAkB,CAAC,KAAK,EAAC;wBAC5B,kBAAkB,CAAC,+BAA+B,GAAG,KAAK,CAAC;wBAC3D,MAAM,MAAM,CAAC,oBAAoB,CAAC,kBAAkB,CAAC,CAAC;wBACtD,kBAAkB,CAAC,+BAA+B,GAAG,IAAI,CAAC;wBAC1D,MAAM,MAAM,CAAC,oBAAoB,CAAC,kBAAkB,CAAC,CAAC;qBACtD;iBACD;YACF,CAAC,CAAC;YAGF,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE;gBACtB,IAAI,aAAa,GAAG,MAAM,CAAC,qCAAqC,CAAC,OAAO,EAAE,CAAC;gBAE3E,IAAI,sBAAsB,GAAG,aAAa,CAAC,IAAI,EAAE,CAAC;gBAClD,OAAM,sBAAsB,CAAC,KAAK,EAAC;oBAElC,IAAI,iBAAiB,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;oBACxD,IAAI,iBAAiB,IAAI,IAAI,IAAI,iBAAiB,IAAI,SAAS,EAAE;wBAChE,iBAAiB,CAAC,MAAM,EAAE,CAAC;qBAC3B;oBACD,sBAAsB,GAAG,aAAa,CAAC,IAAI,EAAE,CAAC;iBAC9C;YAGF,CAAC,CAAC,CAAC;QAGJ,CAAC;KACD;CACD,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorReachability/kommonitor-reachability.component.ts b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorReachability/kommonitor-reachability.component.ts new file mode 100644 index 000000000..e9b726c6a --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorReachability/kommonitor-reachability.component.ts @@ -0,0 +1,1817 @@ +angular + .module('kommonitorReachability') + .component( + 'kommonitorReachability', { + templateUrl: 'components/kommonitorUserInterface/kommonitorControls/kommonitorReachability/kommonitor-reachability.template.html', + /* + * injected with a modules service method that manages + * enabled tabs + */ + controller: [ + '$scope', + '$rootScope', + '$http', + '$timeout', + 'kommonitorMapService', + 'kommonitorDataExchangeService', + 'kommonitorDiagramHelperService', + '__env', + /** + * TODO + */ + function kommonitorReachabilityController($scope, + $rootScope, $http, $timeout, kommonitorMapService, + kommonitorDataExchangeService, kommonitorDiagramHelperService,__env) { + + //$("[data-toggle=tooltip]").tooltip(); + + $scope.isUsedInReporting = false; + + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + let input = document.getElementById("isochroneCutInput"); + input.addEventListener("keypress", function isInputAllowed(evt) { + var code = (evt.keyCode ? evt.keyCode : evt.which); + if (code == 8) { //Backspace key press + return true; + } else { + var ch = String.fromCharCode(evt.which); + if (!(/[0-9,]/.test(ch))) { + evt.preventDefault(); + } + } + }); + + + + var OpenStreetMapProvider = window.GeoSearch.OpenStreetMapProvider; + + $scope.openStreetMapProvider = new OpenStreetMapProvider( + { + params: { + 'accept-language': 'de', // render results in Dutch + countrycodes: 'de', // limit search results to the Netherlands + addressdetails: 1, // include additional address detail parts + viewbox: "" + (Number(__env.initialLongitude) - 0.001) + "," + (Number(__env.initialLatitude) - 0.001) + "," + (Number(__env.initialLongitude) + 0.001) + "," + (Number(__env.initialLatitude) + 0.001) + }, + searchUrl: __env.targetUrlToGeocoderService + '/search', + reverseUrl: __env.targetUrlToGeocoderService + '/reverse' + } + ); + + const INDICATOR_DATE_PREFIX = __env.indicatorDatePrefix; + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorDiagramHelperServiceInstance = kommonitorDiagramHelperService; + this.kommonitorMapServiceInstance = kommonitorMapService; + $scope.targetUrlToReachabilityService_ORS = __env.targetUrlToReachabilityService_ORS; + var numberOfDecimals = __env.numberOfDecimals; + + $scope.currentIsochronesGeoJSON = undefined; + $scope.currentRouteGeoJSON = undefined; + $scope.error = undefined; + + $scope.echartsInstances_reachabilityAnalysis = new Map(); + + /** + * a delay object for geosearch input + */ + $scope.delay = undefined; + + $scope.geosearchResults_startingPoint; + $scope.geosearchResults_endPoint; + + $scope.settings = {}; + + $scope.settings.usePreconfigRanges_500_1000 = false; + + $scope.settings.dateSelectionType_valueIndicator = "date_indicator"; + $scope.settings.dateSelectionType_valueManual = "date_manual"; + $scope.settings.dateSelectionType_valuePerDataset = "date_perDataset"; + $scope.settings.dateSelectionType = { + selectedDateType: $scope.settings.dateSelectionType_valuePerDataset + }; + + $scope.settings.selectedDate_manual = undefined; + + $scope.settings.isochroneConfig = {}; + $scope.settings.isochroneConfig.dateSelectionType_valueIndicator = "date_indicator"; + $scope.settings.isochroneConfig.dateSelectionType_valueManual = "date_manual"; + $scope.settings.isochroneConfig.dateSelectionType_valuePerDataset = "date_perDataset"; + $scope.settings.isochroneConfig.dateSelectionType = { + selectedDateType: $scope.settings.isochroneConfig.dateSelectionType_valuePerDataset + }; + + $scope.settings.isochroneConfig.selectedDate_manual = undefined; + $('#manualDateDatepicker_reachabilityAnalysis').datepicker(kommonitorDataExchangeService.datePickerOptions); + $('#manualDateDatepicker_reachabilityConfig').datepicker(kommonitorDataExchangeService.datePickerOptions); + + + $scope.routeDistance_km = undefined; + $scope.routeDuration_minutes = undefined; + + + /** + * Show the isochrone-calculation-div if this + * value is set to 'true', if the value is set + * to 'false' the routing between different + * points shall be displayed. + */ + $scope.showIsochrones = true; + + $scope.settings.dissolveIsochrones = true; + + /** + * TODO : Folgende drei Variablen werden fuer den + * Produktivbetrieb eigentlich nicht benoetigt, + * oder? + */ + $scope.locationsArray = [[7.049869894,51.42055331]]; + + /** + * Values used in the GUI (initial). + */ + $scope.latitudeStart = 51.42055331; + $scope.longitudeStart = 7.049869894; + $scope.latitudeEnd = 51.42055331+0.05; + $scope.longitudeEnd = 7.049869894+0.05; + $scope.settings.routingStartPointInput = undefined; + $scope.settings.routingEndPointInput = undefined; + + /** + * The range array (for isochrone calculation) + * prefilled with dummy-values. TODO : Werte und + * Variable behalten, oder im Grunde dann nicht + * mehr benoetigt? + */ + $scope.rangeArray = [300, 600, 900]; + + /** + * Variable to save the keywords used by the + * routing API. Valid values are: + * driving-car + * driving-hgv // LKW + * cycling-regular + * cycling-road + * cycling-safe + * cycling-mountain + * cycling-tour + * cycling-electric + * foot-walking + * foot-hiking + * wheelchair + */ + $scope.settings.transitMode = 'buffer'; + + /** + * The focus of the analysis. Valid values are: + * 'distance' and 'time'. TODO : Starke + * Ueberschneidung mit der Variablen 'focus', + * die im Grunde genau das gleiche speichert. + */ + $scope.settings.focus = 'distance'; + + /** + * config of starting points source (layer or manual draw) for isochrones + */ + $scope.settings.startPointsSource = "fromLayer"; + + /** + * selected start point layer for isochrone computation + * GeoJSON within property .geoJSON + */ + $scope.settings.selectedStartPointLayer = undefined; + + /** + * start points that were drawn manually + * direct GeoJSON structure + */ + $scope.manualStartPoints = undefined; + + /** + * indicator wheather the isochrone point source is configured + */ + $scope.pointSourceConfigured = false; + + /** + * The analysis speed (for the current vehicle) + * in km/h. + */ + $scope.settings.speedInKilometersPerHour = 3; + + /** + * Indicator if multiple starting-points shall + * be used. + */ + $scope.useMultipleStartPoints = false; + + /** + * Flag indicating if data is loading / + * calculations are in progress. Used to set the + * GUI on 'standby' until the progress is + * completed. + */ + $scope.settings.loadingData = false; + + /** + * The calculation unit-indicator. + */ + $scope.unit = 'Meter'; + + /** + * Stores the minimal speed in km/h for the + * currently chosen vehicle. + */ + $scope.minSpeedInKilometersPerHour = 3; + + /** + * Stores the maximum speed in km/h for the + * currently chosen vehicle. + */ + $scope.maxSpeedInKilometersPerHour = 6; + + /** + * The maximum distance or time for the current + * vehicle. The unit of the stored value can be + * found in the variable 'unit'. + */ + $scope.max_value = 5000; + + /** + * The current time-or-distance value of the + * analysis. The unit of the stored value can be + * found in the variable 'unit'. This value + * represents value of the slider in the GUI and + * handed to the routing API. + */ + $scope.settings.currentTODValue = 1; + + /** + * Variable that stores 'true' if the speed-selection + * shall be shown or 'false' if not. + */ + $scope.isTime = false; + + /** + * Specifies the route preference. + * + * Allowed values are: + * - "fastest" + * - "shortest" + * - "recommended" + */ + $scope.settings.preference = "fastest"; + + /* + * array of arrays of lon, lat + * [[lon,lat],[lon,lat]] + */ + $scope.locationsArray = []; + + $scope.settings.isochroneInput = undefined; + + /** + * TODO + */ + var isochronesGETParameter = 'profile=foot-walking&units=m&location_type=start&locations=7.268504,51.448405&range_type=time&range=300,600,900&attributes=area|reachfactor&options={"maximum_speed":3}'; + + /** + * TODO + */ + var createRoutingRequest = function(transitMode, preference, routingStartPointInput, routingEndPointInput){ + var locString = routingStartPointInput+'%7C'+routingEndPointInput; + + // if user never clicked transit mode set standard + if(transitMode === "buffer"){ + transitMode = "foot-walking"; + } + + // var getRequest = $scope.targetUrlToReachabilityService_ORS + // + '/routes?' + // + 'coordinates=' + locString + // + '&profile='+transitMode + // + '&preference='+preference + // + '&units='+'km' + // + '&language='+'de' + // + '&format='+'geojson' + // + '&instructions='+'true' + // + '&instructions_format='+'html' + // + '&maneuvers='+'true' + // + '&attributes='+'avgspeed' + // + '&elevation='+'true'; + + //console.log(getRequest); + + var getRequest = $scope.targetUrlToReachabilityService_ORS + + '/v2/directions/' + transitMode + '?' + + 'start=' + routingStartPointInput + + '&end=' + routingEndPointInput; + + return getRequest; + } + + /** + * TODO + */ + var createORSIsochroneRequestBody = function (locationsArray, rangeArray) { + let body = { + "locations": [], + "range": [], + "attributes": ["reachfactor", "area"], + "location_type": "start", + "range_type": $scope.settings.focus, + "smoothing": 0, + "area_units": "km", + "units": "m" + }; + + for (var index = 0; index < locationsArray.length; index++) { + // element looks like + // [longitude,latitude] + let point = [locationsArray[index][0], locationsArray[index][1]]; + body.locations.push(point); + }; + + for (var i = 0; i < rangeArray.length; i++) { + var cValue = rangeArray[i]; + + // CALCULATE SECONDS FROM MINUTE VALUES IF TIME-ANALYSIS IS WANTED + if($scope.settings.focus=='time'){ + cValue = cValue*60; + } + + body.range.push(cValue); + }; + + return body; + }; + + // If the reporting modal is shown we want to integrate this component there. + // A couple of modifications need to be done to achieve that. + // These are controlled by setting a variable and checking it when needed. + $('#reporting-modal').on('hidden.bs.modal', function (e) { + $scope.isUsedInReporting = false; + $scope.$digest(); + }) + + $scope.$on("reportingPoiLayerSelected", function(event, data) { + $scope.isUsedInReporting = true; + $scope.settings.selectedStartPointLayer = data; + $scope.pointSourceConfigured = true; // timestamp selection is hidden, so we are good to go for now. + $scope.$digest(); + }); + + + $scope.resetPoisInIsochrone = function(){ + $scope.echartsInstances_reachabilityAnalysis = new Map(); + document.getElementById("reachability_diagrams_section").innerHTML = ""; + for (var poi of kommonitorDataExchangeService.availableGeoresources){ + if (poi.isSelected_reachabilityAnalysis){ + poi.isSelected_reachabilityAnalysis = false; + //remove POI layer from map + $scope.removePoiLayerFromMap(poi); + } + } + }; + + $scope.resetForm = function(){ + $scope.resetSlider(); + + $scope.resetPoisInIsochrone(); + + $scope.error = undefined; + + $scope.settings = {}; + + $scope.settings = {}; + + $scope.settings.usePreconfigRanges_500_1000 = false; + + $scope.settings.dateSelectionType_valueIndicator = "date_indicator"; + $scope.settings.dateSelectionType_valueManual = "date_manual"; + $scope.settings.dateSelectionType_valuePerDataset = "date_perDataset"; + $scope.settings.dateSelectionType = { + selectedDateType: $scope.settings.dateSelectionType_valuePerDataset + }; + + $scope.settings.selectedDate_manual = undefined; + + $scope.settings.isochroneConfig = {}; + $scope.settings.isochroneConfig.dateSelectionType_valueIndicator = "date_indicator"; + $scope.settings.isochroneConfig.dateSelectionType_valueManual = "date_manual"; + $scope.settings.isochroneConfig.dateSelectionType_valuePerDataset = "date_perDataset"; + $scope.settings.isochroneConfig.dateSelectionType = { + selectedDateType: $scope.settings.isochroneConfig.dateSelectionType_valuePerDataset + }; + + $scope.settings.isochroneConfig.selectedDate_manual = undefined; + + $scope.showIsochrones = true; + $scope.settings.dissolveIsochrones = true; + document.getElementById("btn_isochrones").click(); + $scope.settings.transitMode = 'buffer'; + document.getElementById("optBuffer").click(); + $scope.settings.focus = 'distance'; + document.getElementById("focus_distance").click(); + $scope.settings.startPointsSource = "fromLayer"; + $scope.changeStartPointsSource_fromLayer(); + document.getElementById("startPointsSource_layer").click(); + $scope.settings.selectedStartPointLayer = undefined; + $scope.pointSourceConfigured = false; + $scope.settings.speedInKilometersPerHour = 3; + $scope.useMultipleStartPoints = false; + $scope.settings.loadingData = false; + $scope.unit = 'Meter'; + $scope.settings.currentTODValue = 1; + $scope.isTime = false; + $scope.settings.preference = "fastest"; + $scope.locationsArray = []; + + $scope.rangeArray = []; + + $scope.removePotentialDrawnStartingPoints(); + + $scope.routeDistance_km = undefined; + $scope.routeDuration_minutes = undefined; + + $scope.currentIsochronesGeoJSON = undefined; + $scope.currentRouteGeoJSON = undefined; + $scope.error = undefined; + + $scope.geosearchResults_startingPoint; + $scope.geosearchResults_endPoint; + + $scope.routingStartPoint = undefined; + $scope.routingEndPoint = undefined; + + $scope.settings.routingStartPointInput = undefined; + $scope.settings.routingEndPointInput = undefined; + + setTimeout(function(){ + $scope.$digest(); + }, 200); + }; + + $scope.removePotentialDrawnStartingPoints = function(){ + // TODO + $scope.manualStartPoints = undefined; + $scope.disablePointDrawTool(); + $scope.removeAllDrawnPoints(); + }; + + /** + * TODO + */ + $scope.removeReachabilityLayers = function() { + $scope.settings.loadingData = true; + $rootScope + .$broadcast('showLoadingIconOnMap'); + + kommonitorMapService + .removeReachabilityLayers(); + $scope.currentIsochronesGeoJSON = undefined; + kommonitorDataExchangeService.isochroneLegend = undefined; + // remove any diagram + $scope.resetPoisInIsochrone(); + $scope.settings.loadingData = false; + $rootScope + .$broadcast('hideLoadingIconOnMap'); + }; + + $scope.removeRoutingLayers = function() { + $scope.settings.loadingData = true; + $rootScope + .$broadcast('showLoadingIconOnMap'); + + kommonitorMapService + .removeRoutingLayers(); + $scope.currentRouteGeoJSON = undefined; + kommonitorDataExchangeService.routingLegend = undefined; + $scope.settings.loadingData = false; + $rootScope + .$broadcast('hideLoadingIconOnMap'); + }; + + /** + * TODO + */ + $scope.prepareDownloadGeoJSON = function() { + + if($scope.currentIsochronesGeoJSON){ + $scope.prepareIsochroneDownload(); + } + if($scope.currentRouteGeoJSON){ + $scope.prepareRouteDownload(); + } + + }; + + $scope.prepareIsochroneDownload = function(){ + console.log('removing old download button if available') + if (document + .getElementById('downloadReachabilityIsochrones')) + document + .getElementById( + 'downloadReachabilityIsochrones') + .remove(); + + var geoJSON_string = JSON + .stringify($scope.currentIsochronesGeoJSON); + + var fileName = 'Erreichbarkeitsisochronen_via-' + + $scope.settings.transitMode + + '_Abbruchkriterium-' + + $scope.settings.focus + '.geojson'; + + var blob = new Blob([geoJSON_string], { + type: 'application/json' + }); + var data = URL.createObjectURL(blob); + + console.log('create new Download button and append it to DOM'); + var a = document.createElement('a'); + a.download = fileName; + a.href = data; + a.textContent = 'Download Isochronen als GeoJSON'; + a.id = 'downloadReachabilityIsochrones'; + a.setAttribute('class', 'btn btn-info'); + + let elements = document.getElementsByClassName( + 'reachabilityIsochroneButtonSection'); + + for (const element of elements) { + element.appendChild(a); + } + }; + + $scope.prepareRouteDownload = function(){ + console.log('removing old download button if available') + if (document + .getElementById('downloadReachabilityRoute')) + document + .getElementById( + 'downloadReachabilityRoute') + .remove(); + + var geoJSON_string = JSON + .stringify($scope.currentRouteGeoJSON); + + var fileName = 'Routing-Ergebnis.geojson'; + + var blob = new Blob([geoJSON_string], { + type: 'application/json' + }); + var data = URL.createObjectURL(blob); + + console.log('create new Download button and append it to DOM'); + var a = document.createElement('a'); + a.download = fileName; + a.href = data; + a.textContent = 'Download Route als GeoJSON'; + a.id = 'downloadReachabilityRoute'; + a.setAttribute('class', 'btn btn-info'); + + let elements = document.getElementsByClassName( + 'reachabilityRouteButtonSection'); + + for (const element of elements) { + element.appendChild(a); + } + }; + + /** + * Dummy function. + */ + $scope.TODO = function() { + alert('Funktion wurde noch nicht implementiert!'); + }; + + /** + * Changes the focus of the analysis between + * distance and time. + */ + $scope.changeFocus = function(value) { + + if(value === 'time' && $scope.settings.transitMode === "buffer") { + $scope.settings.focus = 'distance' + $scope.isTime=false; + $scope.unit = 'Meter'; + $scope.changeValues(); + return; + } + + $scope.resetSlider(); + + if ($scope.settings.focus=='distance'){ + $scope.isTime=false; + $scope.unit = 'Meter'; + } + else if ($scope.settings.focus=='time'){ + $scope.unit = 'Minuten'; + $scope.isTime=true; + } + + $scope.changeMinMaxSpeed(); + $scope.changeValues(); + }; + + /** + * Changes the start points source of the analysis between + * fromLayer and manualDraw. + */ + $scope.changeStartPointsSource_fromLayer = function() { + + $scope.disablePointDrawTool(); + $scope.settings.startPointsSource = "fromLayer"; + + }; + $scope.changeStartPointsSource_manual = function() { + + $scope.enablePointDrawTool(); + $scope.settings.startPointsSource = "manual"; + + }; + + $scope.removeAllDrawnPoints = function(){ + // TODO + + $rootScope.$broadcast("removeAllDrawnPoints"); + }; + + $scope.enablePointDrawTool = function(){ + // add/activate leaflet-draw toolbar for only POINT features + + $rootScope.$broadcast("enablePointDrawTool"); + }; + + $scope.disablePointDrawTool = function(){ + // disable/hide leaflet-draw toolbar for only POINT features + $rootScope.$broadcast("disablePointDrawTool"); + }; + + $scope.$on("onUpdateDrawnPointFeatures", function (event, drawnPointsFeatureGroup) { + + // if drawnPointsFeatureGroup is empty or does not exist, we must catch that + try{ + $scope.manualStartPoints = drawnPointsFeatureGroup.toGeoJSON(); + $scope.pointSourceConfigured = true; + } + catch (error){ + $scope.manualStartPoints = undefined; + $scope.pointSourceConfigured = false; + } + + setTimeout(function(){ + $scope.$digest(); + }, 150); + }); + + + /** + * Resets the slider for the distance-/time and + * speed to initial values. + */ + $scope.resetSlider = function() { + $scope.settings.speedInKilometersPerHour = $scope.minSpeedInKilometersPerHour; + $scope.settings.currentTODValue = 1; + }; + + /** + * Changes the vehicle type according to an + * action on the related buttons. + */ + $scope.changeType = function() { + $scope.changeValues(); + $scope.changeMinMaxSpeed(); + $scope.resetSlider(); + }; + + /** + * Changes the max_value depending on the + * selected vehicle type. + */ + $scope.changeValues = function() { + if ($scope.settings.transitMode == 'buffer'){ + $scope.settings.focus = 'distance'; + $("#focus_distance").click(); + if ($scope.settings.focus == 'distance') + $scope.max_value = 5000; + else + $scope.max_value = 25; + } + + if ($scope.settings.transitMode == 'foot-walking'){ + if ($scope.settings.focus == 'distance') + $scope.max_value = 5000; + else + $scope.max_value = 25; + } + + + if ($scope.settings.transitMode == 'cycling-regular'){ + if ($scope.settings.focus == 'distance') + $scope.max_value = 5000; + else + $scope.max_value = 20; + } + + + if ($scope.settings.transitMode == 'driving-car'){ + if ($scope.settings.focus == 'distance') + $scope.max_value = 5000; + else + $scope.max_value = 15; + } + + if ($scope.settings.transitMode == 'wheelchair'){ + if ($scope.settings.focus == 'distance') + $scope.max_value = 5000; + else + $scope.max_value = 25; + } + + }; + + /** + * Changes the minimum and maximum + * speed-per-hour value depending on the current + * selected vehicle type. + */ + $scope.changeMinMaxSpeed = function() { + if ($scope.settings.transitMode == 'buffer') { + $scope.minSpeedInKilometersPerHour = 1; + $scope.maxSpeedInKilometersPerHour = 6; + } + if ($scope.settings.transitMode == 'foot-walking') { + $scope.minSpeedInKilometersPerHour = 1; + $scope.maxSpeedInKilometersPerHour = 6; + } + if ($scope.settings.transitMode == 'cycling-regular') { + $scope.minSpeedInKilometersPerHour = 10; + $scope.maxSpeedInKilometersPerHour = 25; + } + if ($scope.settings.transitMode == 'driving-car') { + $scope.minSpeedInKilometersPerHour = 30; + $scope.maxSpeedInKilometersPerHour = 130; + } + if ($scope.settings.transitMode == 'wheelchair') { + $scope.minSpeedInKilometersPerHour = 1; + $scope.maxSpeedInKilometersPerHour = 6; + } + + $scope.settings.speedInKilometersPerHour = $scope.minSpeedInKilometersPerHour; + }; + + /** + * Checks the input-textfield for the + * isochrone-distance-array for validity. + * Extracts the text value of the textfield, + * splits it at every ',' and writes the values + * into the array of desired distances. Adds the + * analysis distance at the end of the array so + * the whole distance of the analysis will be + * covered by isochones. + */ + $scope.checkArrayInput = function() { + $scope.rangeArray = []; + var split = $scope.settings.isochroneInput.split(','); + var actVal; + if (split.length > 0) { + for (var a = 0; a < split.length; a++) { + if (!isNaN(split[a])) { + actVal = parseFloat(split[a]); + if (!isNaN(actVal)) + $scope.rangeArray + .push(actVal); + } + } + } + + $scope.rangeArray.sort(function(a, b){return a-b;}); + }; + + /** + * Changes variables so the isochrone-calculation-elements will be shown. + */ + $scope.showIso = function() { + $scope.showIsochrones = true; + }; + + /** + * Changes variables so the routing-calculation-elements will be shown. + */ + $scope.showRouting = function() { + $scope.showIsochrones = false; + // force active setting of transit mode foot-walking when changing to routing mode + $scope.settings.transitMode = "foot-walking"; + document.getElementById("optFeet").click(); + document.getElementById("optFeetRadioButtonLabel").classList.add('active'); + $timeout(function(){ + $scope.$digest(); + }); + }; + + $scope.onClickPerDataset_isochroneConfig = function(){ + $timeout(function(){ + if(! $scope.settings.isochroneConfig.selectedDate){ + $scope.settings.isochroneConfig.selectedDate = $scope.settings.selectedStartPointLayer.availablePeriodsOfValidity[$scope.settings.selectedStartPointLayer.availablePeriodsOfValidity.length - 1]; + } + if(!$scope.isUsedInReporting) { + $scope.fetchGeoJSONForIsochrones(); + } + }, 500); + }; + + $scope.fetchGeoJSONForIsochrones = async function(){ + if(! $scope.settings.selectedStartPointLayer){ + $scope.settings.loadingData = false; + return; + } + + // clear any previous results + $scope.settings.selectedStartPointLayer.geoJSON = undefined; + + var date; + + if($scope.settings.isochroneConfig.dateSelectionType.selectedDateType === $scope.settings.isochroneConfig.dateSelectionType_valuePerDataset){ + date = $scope.settings.isochroneConfig.selectedDate.startDate; + } + else if($scope.settings.isochroneConfig.dateSelectionType.selectedDateType === $scope.settings.isochroneConfig.dateSelectionType_valueManual){ + date = $scope.settings.isochroneConfig.selectedDate_manual; + } + else{ + date = kommonitorDataExchangeService.selectedDate; + } + + if(! date){ + $scope.settings.loadingData = false; + return; + } + + + $scope.settings.loadingData = true; + var id = $scope.settings.selectedStartPointLayer.georesourceId; + + var dateComps = date.split("-"); + + var year = dateComps[0]; + var month = dateComps[1]; + var day = dateComps[2]; + + await $http({ + url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + id + "/" + year + "/" + month + "/" + day, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + var geoJSON = response.data; + + $scope.settings.selectedStartPointLayer.geoJSON = geoJSON; + + $scope.settings.loadingData = false; + $scope.pointSourceConfigured = true; + + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.pointSourceConfigured = false; + $scope.settings.loadingData = false; + console.error(error.statusText); + kommonitorDataExchangeService.displayMapApplicationError(error); + $scope.error = error.statusText; + }); + }; + + $scope.onChangeSelectedStartPointLayer = async function(){ + $scope.settings.isochroneConfig.selectedDate = undefined; + + if(! $scope.settings.isochroneConfig.selectedDate){ + $scope.settings.isochroneConfig.selectedDate = $scope.settings.selectedStartPointLayer.availablePeriodsOfValidity[$scope.settings.selectedStartPointLayer.availablePeriodsOfValidity.length - 1]; + } + + if(!$scope.isUsedInReporting) { + $scope.fetchGeoJSONForIsochrones(); + } + }; + + /** + * Starts the analysis. This function is fired + * when the related button is pushed. + * + * Depending on the current selection of the + * calculation-task the function + * 'startRoutingAnalysis' or + * 'startIsochroneCalculation' will be + * triggered. + * + * The values from the input-elements are all + * up-to-date and saved in the variables + * accessible via the scope. The request URL + * will be build by this values and send towards + * the routing-API. The result will be handled, + * stored in the related scope- variables and + * displayed in the KM GUI. + * + * If this method is fired from within the reporting modal + * ($scope.isUsedInReporting = true) the result is not added to the main map, + * but returned to the reporting component per broadcast. + */ + $scope.startAnalysis = function() { + + $timeout(function(){ + // Any code in here will automatically have an $scope.apply() run afterwards + if(!$scope.isUsedInReporting) { // reporting uses it's own loading overlay, which is controlled there + $scope.settings.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + } + // And it just works! + }, 50); + + $timeout(function(){ + $scope.error = undefined; + + if ($scope.showIsochrones) + $scope.startIsochroneCalculation(); + else + $scope.startRoutingCalculation(); + }, 150); + + }; + + /** + * Starts the routing-calculation. + */ + $scope.startRoutingCalculation = function() { + + $scope.settings.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + var startPointString = $scope.routingStartPoint.longitude + "," + $scope.routingStartPoint.latitude; + var endPointString = $scope.routingEndPoint.longitude + "," + $scope.routingEndPoint.latitude; + + var url = createRoutingRequest($scope.settings.transitMode, $scope.settings.preference, startPointString, endPointString); + // let coordinatesArray = []; + // coordinatesArray.push(startPointString); + // coordinatesArray.push(endPointString); + // let postBody = { + // "coordinates": coordinatesArray + // }; + // let url = $scope.targetUrlToReachabilityService_ORS + // + '/v2/directions/' + $scope.settings.transitMode + '/geojson'; + + console.log("execute OpenRouteService routing request: " + url); + + var req = { + method: 'GET', + url: url, + headers: { + // 'Accept': 'application/json' + } + }; + + $http(req) + // $http.post(url, postBody) + .then( + function successCallback( + response) { + $scope.currentRouteGeoJSON = response.data; + + $scope.routeDistance_km = $scope.currentRouteGeoJSON.features[0].properties.summary.distance / 1000; + $scope.routeDuration_minutes = Math.round($scope.currentRouteGeoJSON.features[0].properties.summary.duration / 60); + + + // TODO : CDB + kommonitorMapService + .replaceRouteGeoJSON( + $scope.currentRouteGeoJSON, + $scope.settings.transitMode, + $scope.settings.preference, $scope.routingStartPoint, $scope.routingEndPoint, + $scope.routeDistance_km, $scope.routeDuration_minutes); + $scope.prepareDownloadGeoJSON(); + $scope.settings.loadingData = false; + $rootScope.$broadcast('hideLoadingIconOnMap'); + }, + function errorCallback( + error) { + // called asynchronously + // if an error occurs + // or server returns + // response with an + // error status. + console.error(error.data.error.message); + $scope.error = error.data.error.message; + + $scope.settings.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + $rootScope.$broadcast("hideLoadingIconOnMap"); + }); + }; + + $scope.makeLocationsArrayFromStartPoints = function(){ + // array of arrays of lon,lat + $scope.locationsArray = []; + + if($scope.settings.startPointsSource === "manual"){ + // establish from drawn points + $scope.manualStartPoints.features.forEach(function(feature){ + $scope.locationsArray.push(feature.geometry.coordinates); + }); + } + else{ + // establish from chosen layer + $scope.settings.selectedStartPointLayer.geoJSON.features.forEach(function(feature){ + $scope.locationsArray.push(feature.geometry.coordinates); + }); + } + + return $scope.locationsArray; + }; + + /** + * Starts an isochrone-calculation. + */ + $scope.startIsochroneCalculation = async function() { + if(!$scope.isUsedInReporting) { // reporting uses it's own loading overlay, which is controlled there + $scope.settings.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + } else { + $scope.$emit("reportingIsochronesCalculationStarted"); + } + + $scope.checkArrayInput(); + + $scope.locationsArray = $scope.makeLocationsArrayFromStartPoints(); + + // SWITCH THE VALUE DEPENDING ON THE LENGTH + // OF THE LOCATIONS ARRAY + if ($scope.locationsArray.length > 1) + $scope.useMultipleStartPoints = true; + else + $scope.useMultipleStartPoints = false; + + var resultIsochrones; + + if($scope.settings.transitMode === 'buffer'){ + resultIsochrones = await $scope.createBuffers(); + } + else{ + resultIsochrones = await $scope.createIsochrones(); + } + + if($scope.isUsedInReporting) { + // No need to add isochrones to main map. + // Instead they are returned to reporting modal + $scope.$emit("reportingIsochronesCalculationFinished", resultIsochrones) + return; + } + + $scope.currentIsochronesGeoJSON = resultIsochrones; + + + kommonitorMapService.replaceIsochroneMarker($scope.locationsArray); + kommonitorMapService + .replaceIsochroneGeoJSON( + $scope.currentIsochronesGeoJSON, + $scope.settings.transitMode, + $scope.settings.focus, + $scope.rangeArray, + $scope.useMultipleStartPoints, + $scope.settings.dissolveIsochrones, + $scope.settings.speedInKilometersPerHour); + $scope + .prepareDownloadGeoJSON(); + + $scope.settings.loadingData = false; + $timeout(function(){ + $rootScope.$broadcast('hideLoadingIconOnMap'); + }, 500); + + + $scope.$digest(); + }; + + + + $scope.fetchIsochrones = async function(tempStartPointsArray){ + var body = createORSIsochroneRequestBody( + tempStartPointsArray, + $scope.rangeArray); + + let url = $scope.targetUrlToReachabilityService_ORS + + '/v2/isochrones/' + $scope.settings.transitMode; + + var req = { + method: 'POST', + url: url, + data: body, + headers: { + // 'Accept': 'application/json', + "Content-Type": 'application/json' + } + }; + + return await $http(req) + .then( + function successCallback( + response) { + // this callback will + // becalled + // asynchronously + // when the response is + // available + + // dissolve features + if ($scope.settings.dissolveIsochrones){ + try { + var dissolved = turf.dissolve(response.data, {propertyName: 'value'}); + return dissolved; + } catch (e) { + console.error("Dissolving Isochrones failed with error: " + e); + console.error("Will return undissolved isochrones"); + return response.data; + } finally { + + } + + } + else{ + return response.data; + } + + }, + function errorCallback( + error) { + // called asynchronously + // if an error occurs + // or server returns + // response with an + // error status. + console.error(error.data.error.message); + $scope.error = error.data.error.message; + $scope.settings.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + $rootScope.$broadcast("hideLoadingIconOnMap"); + }); + }; + + $scope.createBuffers = function(){ + var resultIsochrones; + + var startingPoints_geoJSON; + // create Buffers for each input and range definition + if($scope.settings.startPointsSource === "manual"){ + // establish from drawn points + startingPoints_geoJSON = $scope.manualStartPoints; + } + else{ + // establish from chosen layer + startingPoints_geoJSON = $scope.settings.selectedStartPointLayer.geoJSON; + } + + // range in meters + for (const range of $scope.rangeArray) { + var geoJSON_buffered = turf.buffer(startingPoints_geoJSON, Number(range)/1000, {units: 'kilometers', steps: 12}); + + if(! geoJSON_buffered.features){ + // transform single feature to featureCollection + geoJSON_buffered = turf.featureCollection([ + geoJSON_buffered + ]); + } + + if ($scope.settings.dissolveIsochrones){ + try { + geoJSON_buffered = turf.dissolve(geoJSON_buffered); + } catch (e) { + console.error("Dissolving Isochrones failed with error: " + e); + console.error("Will return undissolved isochrones"); + } finally { + + } + + } + + // add property: value --> range + if (geoJSON_buffered.features && geoJSON_buffered.features.length > 0){ + for (const feature of geoJSON_buffered.features) { + feature.properties.value = range; + } + } + + if(! resultIsochrones){ + resultIsochrones = geoJSON_buffered; + } + else{ + resultIsochrones.features = resultIsochrones.features.concat(geoJSON_buffered.features); + } + } + + return resultIsochrones; + }; + + $scope.createIsochrones = async function(){ + var resultIsochrones; + + console.log('Calculating isochrones for ' + + $scope.locationsArray.length + + ' start points.'); + + var maxLocationsForORSRequest = 400; + + var featureIndex = 0; + // log progress for each 10% of features + var logProgressIndexSeparator = Math.round($scope.locationsArray.length / 100 * 10); + + var countFeatures = 0; + var tempStartPointsArray = []; + for (var pointIndex=0; pointIndex < $scope.locationsArray.length; pointIndex++){ + tempStartPointsArray.push($scope.locationsArray[pointIndex]); + countFeatures++; + + // if maxNumber of locations is reached or the last starting point is reached + if(countFeatures === maxLocationsForORSRequest || pointIndex === $scope.locationsArray.length -1){ + // make request, collect results + + // responses will be GeoJSON FeatureCollections + var tempIsochrones = await $scope.fetchIsochrones(tempStartPointsArray); + + if (! resultIsochrones){ + resultIsochrones = tempIsochrones; + } + else{ + // apend results of tempIsochrones to resultIsochrones + resultIsochrones.features = resultIsochrones.features.concat(tempIsochrones.features); + } + // increment featureIndex + featureIndex++; + if(featureIndex % logProgressIndexSeparator === 0){ + console.log("PROGRESS: Computed isochrones for '" + featureIndex + "' of total '" + $scope.locationsArray.length + "' starting points."); + } + + // reset temp vars + tempStartPointsArray = []; + countFeatures = 0; + + } // end if + } // end for + + return resultIsochrones; + + }; + + $scope.onChangeRoutingStartPoint = function(){ + + // Clear the timeout if it has already been set. + // This will prevent the previous task from executing + // if it has been less than + clearTimeout($scope.delay); + + $scope.geosearchResults_startingPoint = undefined; + + // Make a new timeout set to go off in 800ms + $scope.delay = setTimeout(function () { + console.log('Geosearch for Input String: ', $scope.settings.routingStartPointInput); + + $scope.openStreetMapProvider.search({ query: $scope.settings.routingStartPointInput }) + .then(function(result){ + $scope.geosearchResults_startingPoint = result; + + $scope.$digest(); + }); + + }, 500); + }; + + $scope.onClickGeosearchResult_startingPoint = function(geosearchResult){ + // result object from leaflet-geosearch + + // const result = { + // x: Number, // lon, + // y: Number, // lat, + // label: String, // formatted address + // bounds: [ + // [Number, Number], // s, w - lat, lon + // [Number, Number], // n, e - lat, lon + // ], + // raw: {}, // raw provider result + // } + + $scope.routingStartPoint = { + label: geosearchResult.label, + longitude: geosearchResult.x, + latitude: geosearchResult.y + }; + + // hide geosearch results to minimize page height + $scope.geosearchResults_startingPoint = undefined; + }; + + $scope.onChangeRoutingEndPoint = function(){ + + // Clear the timeout if it has already been set. + // This will prevent the previous task from executing + // if it has been less than + clearTimeout($scope.delay); + + $scope.geosearchResults_endPoint = undefined; + + // Make a new timeout set to go off in 800ms + $scope.delay = setTimeout(function () { + console.log('Geosearch for Input String: ', $scope.settings.routingEndPointInput); + + $scope.openStreetMapProvider.search({ query: $scope.settings.routingEndPointInput }) + .then(function(result){ + $scope.geosearchResults_endPoint = result; + + $scope.$digest(); + }); + + }, 500); + }; + + $scope.onClickGeosearchResult_endPoint = function(geosearchResult){ + // result object from leaflet-geosearch + + // const result = { + // x: Number, // lon, + // y: Number, // lat, + // label: String, // formatted address + // bounds: [ + // [Number, Number], // s, w - lat, lon + // [Number, Number], // n, e - lat, lon + // ], + // raw: {}, // raw provider result + // } + + $scope.routingEndPoint = { + label: geosearchResult.label, + longitude: geosearchResult.x, + latitude: geosearchResult.y + }; + + // hide geosearch results to minimize page height + $scope.geosearchResults_endPoint = undefined; + }; + + + //////////////////////////// SECTION FOR GORESOURCE AND INDICATOR ANALYSIS + + $scope.getQueryDate = function(resource){ + if ($scope.settings.dateSelectionType.selectedDateType === $scope.settings.dateSelectionType_valueIndicator){ + return kommonitorDataExchangeService.selectedDate; + } + else if($scope.settings.dateSelectionType.selectedDateType === $scope.settings.dateSelectionType_valueManual){ + return $scope.settings.selectedDate_manual; + } + else if($scope.settings.dateSelectionType.selectedDateType === $scope.settings.dateSelectionType_valuePerDataset){ + return resource.selectedDate.startDate; + } + else{ + return kommonitorDataExchangeService.selectedDate; + } + }; + + $scope.handlePoiForAnalysis = async function(poi){ + $scope.settings.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + + try { + if(poi.isSelected_reachabilityAnalysis){ + poi = await $scope.fetchGeoJSONForDate(poi); + } + + poi = await $scope.handlePoiOnDiagram(poi); + + if(kommonitorDataExchangeService.isDisplayableGeoresource(poi)){ + $scope.handlePoiOnMap(poi); + } + } catch (error) { + console.error(error); + } + + $scope.settings.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + + // as method is async we may call angular digest cycle + setTimeout(() => { + $scope.$digest(); + }, 250); + }; + + $scope.fetchGeoJSONForDate = function(poiGeoresource){ + var id = poiGeoresource.georesourceId; + + var date = $scope.getQueryDate(poiGeoresource); + + var dateComps = date.split("-"); + + var year = dateComps[0]; + var month = dateComps[1]; + var day = dateComps[2]; + + return $http({ + url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + id + "/" + year + "/" + month + "/" + day, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + var geoJSON = response.data; + + poiGeoresource.geoJSON = geoJSON; + + return poiGeoresource; + + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.settings.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + $rootScope.$broadcast("hideLoadingIconOnMap"); + }); + }; + + $scope.handlePoiOnDiagram = async function(poi){ + if(poi.isSelected_reachabilityAnalysis){ + // maps range value to result GeoJSON + var pointsPerIsochroneRangeMap = await $scope.computePoisWithinIsochrones(poi); + $scope.addOrReplaceWithinDiagrams(poi, pointsPerIsochroneRangeMap); + // now filter the geoJSON to only include those datasets that are actually inside any isochrone + poi = filterGeoJSONPointsInsideLargestIsochrone(poi, pointsPerIsochroneRangeMap); + } + else{ + //remove POI layer from map + $scope.removePoiFromDiagram(poi); + } + + return poi; + }; + + function filterGeoJSONPointsInsideLargestIsochrone(poi, pointsPerIsochroneRangeMap){ + var keyIter = pointsPerIsochroneRangeMap.keys(); + + var nextKey = keyIter.next(); + + var largestRange; + + while(nextKey.value){ + var nextRange = nextKey.value; + if (! largestRange){ + largestRange = Number(nextRange); + } + else if (largestRange < Number(nextRange)){ + largestRange = Number(nextRange); + } + + nextKey = keyIter.next(); + } + + // map stores keys as string + poi.geoJSON = pointsPerIsochroneRangeMap.get("" + largestRange); + + return poi; + } + + $scope.computePoisWithinIsochrones = async function(poi){ + var pointsPerIsochroneRangeMap = $scope.initializeMapWithRangeKeys(); + if (! poi.geoJSON){ + poi = await $scope.fetchGeoJSONForDate(poi); + } + + // as there might be mutliple isochrone ranges + // we must perform point in polygon for each range + var keyIter = pointsPerIsochroneRangeMap.keys(); + + var nextKey = keyIter.next(); + + while(nextKey.value){ + var nextKeyValue = nextKey.value; + + var geoJSON_featureCollection = $scope.computePoisWithinIsochrone(nextKeyValue, poi); + pointsPerIsochroneRangeMap.set(nextKeyValue, geoJSON_featureCollection); + nextKey = keyIter.next(); + } + + return pointsPerIsochroneRangeMap; + }; + + $scope.computePoisWithinIsochrone = function(rangeValue, poi){ + // create clones of poi geoJSON and isochrone geoJSON + var isochrones_geoJSON_clone = JSON.parse(JSON.stringify($scope.currentIsochronesGeoJSON)); + var poi_geoJSON_clone = JSON.parse(JSON.stringify(poi.geoJSON)); + + // filter isochrone geoJSON clone by range value + isochrones_geoJSON_clone.features = isochrones_geoJSON_clone.features.filter(feature => { + return String(feature.properties.value) === String(rangeValue); + }); + + // filter poi geoJSON clone by spatial within isochrone + var pointsWithinIsochrones = turf.pointsWithinPolygon(poi_geoJSON_clone, isochrones_geoJSON_clone); + + return pointsWithinIsochrones; + }; + + + $scope.initializeMapWithRangeKeys = function(){ + var map = new Map(); + + for (const feature of $scope.currentIsochronesGeoJSON.features) { + map.set("" + feature.properties.value, null); + } + + return map; + }; + + + + $scope.addOrReplaceWithinDiagrams = function(poi, pointsPerIsochroneRangeMap){ + var mapEntries = pointsPerIsochroneRangeMap.entries(); + + var nextEntry = mapEntries.next(); + while(nextEntry.value){ + + var nextEntry_keyRange = nextEntry.value[0]; + var nextEntry_valueGeoJSON = nextEntry.value[1]; + var numberOfFeatures = 0; + + var nextEntry_keyRange_label = nextEntry_keyRange; + if($scope.settings.focus == 'time'){ + // compute seconds to minutes for display + nextEntry_keyRange_label = nextEntry_keyRange_label / 60; + } + + if(nextEntry_valueGeoJSON){ + numberOfFeatures = nextEntry_valueGeoJSON.features.length; + } + console.log("Number of Points wihtin Range '" + nextEntry_keyRange + "' is '" + numberOfFeatures + "'"); + + var date = $scope.getQueryDate(poi); + + if ($scope.echartsInstances_reachabilityAnalysis && $scope.echartsInstances_reachabilityAnalysis.has(nextEntry_keyRange)){ + // append to diagram + + var echartsInstance = $scope.echartsInstances_reachabilityAnalysis.get(nextEntry_keyRange); + var echartsOptions = echartsInstance.getOption(); + echartsOptions = kommonitorDiagramHelperService.appendToReachabilityAnalysisOptions(poi, nextEntry_valueGeoJSON, echartsOptions, date); + echartsInstance.setOption(echartsOptions); + $scope.echartsInstances_reachabilityAnalysis.set(nextEntry_keyRange, echartsInstance); + } + else{ + var reachabilityDiagramsSectionNode = document.getElementById("reachability_diagrams_section"); + var newChartNode = document.createElement("div"); + newChartNode.innerHTML = '

        Analyse Einzugsgebiet ' + nextEntry_keyRange_label + ' [' + kommonitorDataExchangeService.isochroneLegend.cutOffUnit + ']



        '; + reachabilityDiagramsSectionNode.appendChild(newChartNode); + + // init new echarts instance + var echartsInstance = echarts.init(document.getElementById('reachability_pieDiagram_range_' + nextEntry_keyRange + '')); + // use configuration item and data specified to show chart + var echartsOptions = kommonitorDiagramHelperService.createInitialReachabilityAnalysisPieOptions(poi, nextEntry_valueGeoJSON, nextEntry_keyRange_label + " " + $scope.unit, date); + echartsInstance.setOption(echartsOptions); + + echartsInstance.hideLoading(); + + $scope.echartsInstances_reachabilityAnalysis.set(nextEntry_keyRange, echartsInstance); + + setTimeout(function () { + echartsInstance.resize(); + }, 350); + } + + nextEntry = mapEntries.next(); + } + }; + + $scope.removePoiFromDiagram = function(poiGeoresource){ + var chart_entries = $scope.echartsInstances_reachabilityAnalysis.entries(); + + var nextChartInstanceEntry = chart_entries.next(); + while(nextChartInstanceEntry.value){ + + var nextChartInstance = nextChartInstanceEntry.value[1]; + var nextChartOptions = nextChartInstance.getOption(); + + nextChartOptions = kommonitorDiagramHelperService.removePoiFromReachabilityAnalysisOption(nextChartOptions, poiGeoresource); + nextChartInstance.setOption(nextChartOptions); + + $scope.echartsInstances_reachabilityAnalysis.set(nextChartInstanceEntry.value[0], nextChartInstance); + + nextChartInstanceEntry = chart_entries.next(); + } + }; + + $scope.handlePoiOnMap = function(poi){ + + if(poi.isSelected_reachabilityAnalysis){ + //display on Map + $scope.addPoiLayerToMap(poi); + } + else{ + //remove POI layer from map + $scope.removePoiLayerFromMap(poi); + } + + }; + + $scope.addPoiLayerToMap = function(poiGeoresource) { + $scope.settings.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + + // fale --> useCluster = false + kommonitorMapService.addPoiGeoresourceGeoJSON_reachabilityAnalysis(poiGeoresource, $scope.getQueryDate(poiGeoresource), false); + $scope.settings.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + + }; + + $scope.removePoiLayerFromMap = function(poiGeoresource) { + $scope.settings.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + + poiGeoresource = poiGeoresource; + + kommonitorMapService.removePoiGeoresource_reachabilityAnalysis(poiGeoresource); + $scope.settings.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + + }; + + $scope.refreshPoiLayers = async function(){ + for (var poi of kommonitorDataExchangeService.availableGeoresources){ + if (poi.isSelected_reachabilityAnalysis){ + //remove POI layer from map + $scope.removePoiLayerFromMap(poi); + + poi = await $scope.fetchGeoJSONForDate(poi); + + // remove layer and add layer again + $scope.addPoiLayerToMap(poi); + } + } + }; + + $scope.onClickUseIndicatorTimestamp = function(){ + $scope.settings.dateSelectionType.selectedDateType = $scope.settings.dateSelectionType_valueIndicator; + + $scope.refreshSelectedGeoresources(); + }; + + $scope.timeout_manualdate; + + function isNoValidDate(dateCandidate){ + var dateComps = dateCandidate.split("-"); + + if(dateComps.length < 3){ + return true; + } + else if(! dateComps[0] || ! dateComps[1] || ! dateComps[2]){ + return true; + } + else if(isNaN(dateComps[0]) || isNaN(dateComps[1]) || isNaN(dateComps[2])){ + return true; + } + else if(Number(dateComps[1]) > 12 || Number(dateComps[2]) > 31){ + return true; + } + + return false; + } + + $scope.onChangeManualDate = function(){ + // check if date is an actual date + // if so then refresh selected layers + + // Clear the timeout if it has already been set. + // This will prevent the previous task from executing + // if it has been less than + clearTimeout($scope.timeout_manualdate); + + // Make a new timeout set to go off in 1000ms (1 second) + $scope.timeout_manualdate = setTimeout(function () { + var dateCandidate = $scope.settings.selectedDate_manual; + + if(isNoValidDate(dateCandidate)){ + return; + } + + $timeout(function(){ + + $scope.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + }); + + $timeout(function(){ + + $scope.refreshSelectedGeoresources(); + }, 250); + }, 1000); + + }; + + $scope.onChangeManualDate_isochroneConfig = function(){ + // check if date is an actual date + // if so then refresh selected layers + + // Clear the timeout if it has already been set. + // This will prevent the previous task from executing + // if it has been less than + clearTimeout($scope.timeout_manualdate); + + // Make a new timeout set to go off in 1000ms (1 second) + $scope.timeout_manualdate = setTimeout(function () { + var dateCandidate = $scope.settings.isochroneConfig.selectedDate_manual; + + if(isNoValidDate(dateCandidate)){ + return; + } + + if(!$scope.isUsedInReporting) { + $scope.fetchGeoJSONForIsochrones(); + } + + // $timeout(function(){ + + // $scope.loadingData = true; + // $rootScope.$broadcast("showLoadingIconOnMap"); + // }); + + // $timeout(function(){ + + // $scope.fetchGeoJSONForIsochrones(); + // }, 250); + }, 1000); + + }; + + $scope.$on("selectedIndicatorDateHasChanged", function (event) { + + console.log("refresh selected georesource layers according to new date"); + + // only refresh georesources if sync with indicator timestamp is selected + if(! $scope.settings.dateSelectionType.selectedDateType.includes($scope.settings.dateSelectionType_valueIndicator)){ + return; + } + + $timeout(function(){ + + $scope.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + }); + + $timeout(function(){ + + $scope.refreshSelectedGeoresources(); + }, 250); + }); + + $scope.refreshSelectedGeoresources = async function(){ + for (const georesource of kommonitorDataExchangeService.availableGeoresources) { + if (georesource.isSelected_reachabilityAnalysis){ + + if(georesource.isPOI){ + georesource.isSelected_reachabilityAnalysis = false; + await $scope.handlePoiForAnalysis(georesource); + georesource.isSelected_reachabilityAnalysis = true; + await $scope.handlePoiForAnalysis(georesource); + } + + } + } + + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + }; + + $scope.onChangeSelectedDate = async function(georesourceDataset){ + // only if it s already selected, we must modify the shown dataset + + + if(georesourceDataset.isSelected_reachabilityAnalysis){ + // depending on type we must call different methods + if (georesourceDataset.isPOI){ + georesourceDataset.isSelected_reachabilityAnalysis = false; + await $scope.handlePoiForAnalysis(georesourceDataset); + georesourceDataset.isSelected_reachabilityAnalysis = true; + await $scope.handlePoiForAnalysis(georesourceDataset); + } + } + }; + + + $(window).on('resize', function () { + var chart_entries = $scope.echartsInstances_reachabilityAnalysis.entries(); + + var nextChartInstanceEntry = chart_entries.next(); + while(nextChartInstanceEntry.value){ + + var nextChartInstance = nextChartInstanceEntry.value[1]; + if (nextChartInstance != null && nextChartInstance != undefined) { + nextChartInstance.resize(); + } + nextChartInstanceEntry = chart_entries.next(); + } + + + }); + + + } + ] + }); diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorReachability/kommonitor-reachability.module.js b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorReachability/kommonitor-reachability.module.js index 35b3bab97..0ef22e8d1 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorReachability/kommonitor-reachability.module.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorReachability/kommonitor-reachability.module.js @@ -1,15 +1,16 @@ +"use strict"; angular.module('kommonitorReachability', ['kommonitorDataExchange', 'kommonitorMap', 'kommonitorDiagramHelper']) - -.directive('stringToNumber', function() { - return { - require: 'ngModel', - link: function(scope, element, attrs, ngModel) { - ngModel.$parsers.push(function(value) { - return '' + value; - }); - ngModel.$formatters.push(function(value) { - return parseFloat(value); - }); - } - }; + .directive('stringToNumber', function () { + return { + require: 'ngModel', + link: function (scope, element, attrs, ngModel) { + ngModel.$parsers.push(function (value) { + return '' + value; + }); + ngModel.$formatters.push(function (value) { + return parseFloat(value); + }); + } + }; }); +//# sourceMappingURL=kommonitor-reachability.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorReachability/kommonitor-reachability.module.js.map b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorReachability/kommonitor-reachability.module.js.map new file mode 100644 index 000000000..4c0c34a0f --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorReachability/kommonitor-reachability.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-reachability.module.js","sourceRoot":"","sources":["kommonitor-reachability.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,wBAAwB,EAAE,CAAC,wBAAwB,EAAE,eAAe,EAAE,yBAAyB,CAAC,CAAC;KAE/G,SAAS,CAAC,gBAAgB,EAAE;IAC3B,OAAO;QACL,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,UAAS,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO;YAC3C,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAS,KAAK;gBAClC,OAAO,EAAE,GAAG,KAAK,CAAC;YACpB,CAAC,CAAC,CAAC;YACH,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,UAAS,KAAK;gBACrC,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC;YAC3B,CAAC,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/kommonitorReachability/kommonitor-reachability.module.ts b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorReachability/kommonitor-reachability.module.ts new file mode 100644 index 000000000..35b3bab97 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/kommonitorReachability/kommonitor-reachability.module.ts @@ -0,0 +1,15 @@ +angular.module('kommonitorReachability', ['kommonitorDataExchange', 'kommonitorMap', 'kommonitorDiagramHelper']) + +.directive('stringToNumber', function() { + return { + require: 'ngModel', + link: function(scope, element, attrs, ngModel) { + ngModel.$parsers.push(function(value) { + return '' + value; + }); + ngModel.$formatters.push(function(value) { + return parseFloat(value); + }); + } + }; +}); diff --git a/app/components/kommonitorUserInterface/kommonitorControls/poi/poi.component.js b/app/components/kommonitorUserInterface/kommonitorControls/poi/poi.component.js index f36b97055..85147dc90 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/poi/poi.component.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/poi/poi.component.js @@ -1,867 +1,675 @@ +"use strict"; angular - .module('poi') - .component( - 'poi', - { - templateUrl : "components/kommonitorUserInterface/kommonitorControls/poi/poi.template.html", - - controller : [ - 'kommonitorDataExchangeService', 'kommonitorMapService', '$scope', '$rootScope', '$http', '__env', '$timeout', - function indicatorRadarController( - kommonitorDataExchangeService, kommonitorMapService, $scope, $rootScope, $http, __env, $timeout) { - /* - * reference to kommonitorDataExchangeService instances - */ - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorMapServiceInstance = kommonitorMapService; - $scope.useCluster = true; - $scope.loadingData = false; - $scope.date; - - $scope.poiNameFilter = undefined; - $scope.loiNameFilter = undefined; - $scope.aoiNameFilter = undefined; - - $scope.georesourceNameFilter = {value: undefined}; - - $scope.dateSelectionType_valueIndicator = "date_indicator"; - $scope.dateSelectionType_valueManual = "date_manual"; - $scope.dateSelectionType_valuePerDataset = "date_perDataset"; - $scope.dateSelectionType = { - selectedDateType: $scope.dateSelectionType_valuePerDataset - }; - - $scope.selectedDate_manual = undefined; - $('#manualDateDatepicker').datepicker(kommonitorDataExchangeService.datePickerOptions); - - $scope.showPOI = true; - $scope.showLOI = true; - $scope.showAOI = true; - $scope.showWMS = true; - $scope.showWFS = true; - - $scope.showAllForTopic_null = false; - - - // initialize any adminLTE box widgets - $timeout(function(){ - $('.box').boxWidget(); - }, 750); - - - const DATE_PREFIX = __env.indicatorDatePrefix; - - var numberOfDecimals = __env.numberOfDecimals; - - // initialize colorpicker after some time - // wait to ensure that elements ar available on DOM - setTimeout(function() { - - var colorPickerInputs = $('.input-group.colorpicker-component') - colorPickerInputs.colorpicker(); - - // $('.input-group.colorpicker-component').each(function (index, value){ - // $(this).colorpicker(); - // }); - }, 3000); - - var addClickListenerToEachCollapseTrigger = function(){ - setTimeout(function(){ - $('.list-group-item > .collapseTrigger').on('click', function() { - $('.glyphicon', this) - .toggleClass('glyphicon-chevron-right') - .toggleClass('glyphicon-chevron-down'); - - // manage uncollapsed entries - // var clickedTopicId = $(this).attr('id'); - // if ($scope.unCollapsedTopicIds.includes(clickedTopicId)){ - // var index = $scope.unCollapsedTopicIds.indexOf(clickedTopicId); - // $scope.unCollapsedTopicIds.splice(index, 1); - // } - // else{ - // $scope.unCollapsedTopicIds.push(clickedTopicId); - // } - }); - }, 500); - }; - - $(document).ready(function() { - - addClickListenerToEachCollapseTrigger(); - }); - - $scope.onChangeShowPOI = function(){ - if ($scope.showPOI){ - $scope.showPOI = false; - } - else{ - $scope.showPOI = true; - } - - setTimeout(() => { - $scope.$digest(); - }, 500); - }; - - $scope.onChangeShowLOI = function(){ - if ($scope.showLOI){ - $scope.showLOI = false; - } - else{ - $scope.showLOI = true; - } - - setTimeout(() => { - $scope.$digest(); - }, 500); - }; - - $scope.onChangeShowAOI = function(){ - if ($scope.showAOI){ - $scope.showAOI = false; - } - else{ - $scope.showAOI = true; - } - - setTimeout(() => { - $scope.$digest(); - }, 500); - }; - - $scope.onChangeShowWMS = function(){ - if ($scope.showWMS){ - $scope.showWMS = false; - } - else{ - $scope.showWMS = true; - } - - setTimeout(() => { - $scope.$digest(); - }, 500); - }; - - $scope.onChangeShowWFS = function(){ - if ($scope.showWFS){ - $scope.showWFS = false; - } - else{ - $scope.showWFS = true; - } - - setTimeout(() => { - $scope.$digest(); - }, 500); - }; - - $scope.filterByNoTopic = function(){ - return function( item ) { - - try{ - if (! item.topicReference || item.topicReference === ""){ - return true; - } - if(! kommonitorDataExchangeService.referencedTopicIdExists(item.topicReference)){ - return true; - } - return false; - } - catch(error){ - return false; - } - }; - }; - - $scope.handleShowAllOnTopic = function(topic){ - // if (topic.isSelected){ - // topic.isSelected = false; - // } - // else{ - // topic.isSelected = true; - // } - - var relevantDatasets = kommonitorDataExchangeService.getGeoresourceDatasets(topic, $scope.georesourceNameFilter.value, $scope.showPOI, $scope.showLOI, $scope.showAOI, $scope.showWMS, $scope.showWFS); - - if(topic === null){ - // if ($scope.showAllForTopic_null){ - // $scope.showAllForTopic_null = false; - // } - // else{ - // $scope.showAllForTopic_null = true; - // } - if($scope.showAllForTopic_null){ - relevantDatasets.forEach(element => { - if(! element.isSelected){ - element.isSelected = true; - - if (element.isPOI){ - $scope.handlePoiOnMap(element); - } - else if (element.isLOI){ - $scope.handleLoiOnMap(element); - } - else if (element.isAOI){ - $scope.handleAoiOnMap(element); - } - else if (element.layerName){ - $scope.handleWmsOnMap(element); - } - else if (element.featureTypeName){ - $scope.handleWfsOnMap(element); - } - else{ - console.error("unknown dataset: " + element); - } - } - - }); - } - else{ - relevantDatasets.forEach(element => { - if(element.isSelected){ - element.isSelected = true; - - if (element.isPOI){ - $scope.handlePoiOnMap(element); - } - else if (element.isLOI){ - $scope.handleLoiOnMap(element); - } - else if (element.isAOI){ - $scope.handleAoiOnMap(element); - } - else if (element.layerName){ - $scope.handleWmsOnMap(element); - } - else if (element.featureTypeName){ - $scope.handleWfsOnMap(element); - } - else{ - console.error("unknown dataset: " + element); - } - } - - }); - } - } - - else if(topic.isSelected){ - relevantDatasets.forEach(element => { - if(! element.isSelected){ - element.isSelected = true; - - if (element.isPOI){ - $scope.handlePoiOnMap(element); - } - else if (element.isLOI){ - $scope.handleLoiOnMap(element); - } - else if (element.isAOI){ - $scope.handleAoiOnMap(element); - } - else if (element.layerName){ - $scope.handleWmsOnMap(element); - } - else if (element.featureTypeName){ - $scope.handleWfsOnMap(element); - } - else{ - console.error("unknown dataset: " + element); - } - } - - }); - } - else if(! topic.isSelected){ - relevantDatasets.forEach(element => { - if(element.isSelected){ - element.isSelected = false; - - if (element.isPOI){ - $scope.handlePoiOnMap(element); - } - else if (element.isLOI){ - $scope.handleLoiOnMap(element); - } - else if (element.isAOI){ - $scope.handleAoiOnMap(element); - } - else if (element.layerName){ - $scope.handleWmsOnMap(element); - } - else if (element.featureTypeName){ - $scope.handleWfsOnMap(element); - } - else{ - console.error("unknown dataset: " + element); - } - } - - }); - } - - }; - - $scope.onClickUseIndicatorTimestamp = function(){ - $scope.dateSelectionType.selectedDateType = $scope.dateSelectionType_valueIndicator; - - $scope.refreshSelectedGeoresources(); - }; - - $scope.timeout_manualdate; - - function isNoValidDate(dateCandidate){ - var dateComps = dateCandidate.split("-"); - - if(dateComps.length < 3){ - return true; - } - else if(! dateComps[0] || ! dateComps[1] || ! dateComps[2]){ - return true; - } - else if(isNaN(dateComps[0]) || isNaN(dateComps[1]) || isNaN(dateComps[2])){ - return true; - } - else if(Number(dateComps[1]) > 12 || Number(dateComps[2]) > 31){ - return true; - } - - return false; - } - - $scope.onChangeManualDate = function(){ - // check if date is an actual date - // if so then refresh selected layers - - // Clear the timeout if it has already been set. - // This will prevent the previous task from executing - // if it has been less than - clearTimeout($scope.timeout_manualdate); - - // Make a new timeout set to go off in 1000ms (1 second) - $scope.timeout_manualdate = setTimeout(function () { - var dateCandidate = $scope.selectedDate_manual; - - if(isNoValidDate(dateCandidate)){ - return; - } - - $timeout(function(){ - - $scope.loadingData = true; - $rootScope.$broadcast("showLoadingIconOnMap"); - }); - - $timeout(function(){ - - $scope.refreshSelectedGeoresources(); - }, 250); - }, 1000); - - }; - - $scope.$on("selectedIndicatorDateHasChanged", function (event) { - - console.log("refresh selected georesource layers according to new date"); - - // only refresh georesources if sync with indicator timestamp is selected - if(! $scope.dateSelectionType.selectedDateType.includes($scope.dateSelectionType_valueIndicator)){ - return; - } - - $timeout(function(){ - - $scope.loadingData = true; - $rootScope.$broadcast("showLoadingIconOnMap"); - }); - - $timeout(function(){ - - $scope.refreshSelectedGeoresources(); - }, 250); - }); - - $scope.refreshSelectedGeoresources = function(){ - for (const georesource of kommonitorDataExchangeService.displayableGeoresources_keywordFiltered) { - if (georesource.isSelected){ - - if(georesource.isPOI){ - georesource.isSelected = false; - $scope.handlePoiOnMap(georesource); - georesource.isSelected = true; - $scope.handlePoiOnMap(georesource); - } - else if(georesource.isLOI){ - georesource.isSelected = false; - $scope.handleLoiOnMap(georesource); - georesource.isSelected = true; - $scope.handleLoiOnMap(georesource); - } - else if(georesource.isAOI){ - georesource.isSelected = false; - $scope.handleAoiOnMap(georesource); - georesource.isSelected = true; - $scope.handleAoiOnMap(georesource); - } - - } - } - - $scope.loadingData = false; - $rootScope.$broadcast("hideLoadingIconOnMap"); - }; - - $scope.onChangeSelectedDate = function(georesourceDataset){ - // only if it s already selected, we must modify the shown dataset - - - if(georesourceDataset.isSelected){ - // depending on type we must call different methods - if (georesourceDataset.isPOI){ - $scope.removePoiLayerFromMap(georesourceDataset); - $scope.addPoiLayerToMap(georesourceDataset, $scope.useCluster); - } - else if (georesourceDataset.isLOI){ - $scope.removeLoiLayerFromMap(georesourceDataset); - $scope.addLoiLayerToMap(georesourceDataset); - } - else if (georesourceDataset.isAOI){ - $scope.removeAoiLayerFromMap(georesourceDataset); - $scope.addAoiLayerToMap(georesourceDataset); - } - else{ - console.error("unknown dataset: " + georesourceDataset); - } - } - }; - - $scope.getQueryDate = function(resource){ - if ($scope.dateSelectionType.selectedDateType === $scope.dateSelectionType_valueIndicator){ - return kommonitorDataExchangeService.selectedDate; - } - else if($scope.dateSelectionType.selectedDateType === $scope.dateSelectionType_valueManual){ - return $scope.selectedDate_manual; - } - else if($scope.dateSelectionType.selectedDateType === $scope.dateSelectionType_valuePerDataset){ - return resource.selectedDate.startDate; - } - else{ - return kommonitorDataExchangeService.selectedDate; - } - }; - - $scope.handlePoiOnMap = function(poi){ - - if(poi.isSelected){ - //display on Map - $scope.addPoiLayerToMap(poi, $scope.useCluster); - } - else{ - //remove POI layer from map - $scope.removePoiLayerFromMap(poi); - } - - }; - - $scope.addPoiLayerToMap = async function(poiGeoresource, useCluster) { - $scope.loadingData = true; - $rootScope.$broadcast("showLoadingIconOnMap"); - - var id = poiGeoresource.georesourceId; - - var date = $scope.getQueryDate(poiGeoresource); - - var dateComps = date.split("-"); - - var year = dateComps[0]; - var month = dateComps[1]; - var day = dateComps[2]; - - await $http({ - url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + id + "/" + year + "/" + month + "/" + day, - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - var geoJSON = response.data; - - poiGeoresource.geoJSON = geoJSON; - - kommonitorMapService.addPoiGeoresourceGeoJSON(poiGeoresource, date, useCluster); - $scope.loadingData = false; - $rootScope.$broadcast("hideLoadingIconOnMap"); - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - $scope.loadingData = false; - kommonitorDataExchangeService.displayMapApplicationError(error); - $rootScope.$broadcast("hideLoadingIconOnMap"); - }); - - }; - - $scope.removePoiLayerFromMap = function(poiGeoresource) { - $scope.loadingData = true; - $rootScope.$broadcast("showLoadingIconOnMap"); - - poiGeoresource = poiGeoresource; - - kommonitorMapService.removePoiGeoresource(poiGeoresource); - $scope.loadingData = false; - $rootScope.$broadcast("hideLoadingIconOnMap"); - - }; - - $scope.refreshPoiLayers = async function(){ - for (var poi of kommonitorDataExchangeService.displayableGeoresources_keywordFiltered){ - if (poi.isSelected){ - //remove POI layer from map - $scope.removePoiLayerFromMap(poi); - - // remove layer and add layer again - await $scope.addPoiLayerToMap(poi, $scope.useCluster); - } - } - - for (var wfs of kommonitorDataExchangeService.wfsDatasets){ - if (wfs.geometryType == 'POI' && wfs.isSelected){ - //remove POI layer from map - kommonitorMapService.removeWfsLayerFromMap(wfs); - - // remove layer and add layer again - var opacity = 1 - wfs.transparency; - await kommonitorMapService.addWfsLayerToMap(wfs, opacity, $scope.useCluster); - } - } - }; - - $scope.getExportLinkForPoi = function(poi){ - var date = $scope.getQueryDate(poi); - - var dateComps = date.split("-"); - - var year = dateComps[0]; - var month = dateComps[1]; - var day = dateComps[2]; - - var url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + poi.georesourceId + "/" + year + "/" + month + "/" + day; - var fileName = poi.datasetName + "-" + year + "-" + month + "-" + day; - - $http({ - url: url, - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - var geoJSON_string = JSON.stringify(response.data); - - kommonitorDataExchangeService.generateAndDownloadGeoresourceZIP(poi, geoJSON_string, fileName, ".geojson", {}); - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - $scope.loadingData = false; - kommonitorDataExchangeService.displayMapApplicationError(error); - $rootScope.$broadcast("hideLoadingIconOnMap"); - }); - - }; - - - - - ////////// AOI - $scope.handleAoiOnMap = function(aoi){ - - if(aoi.isSelected){ - //display on Map - $scope.addAoiLayerToMap(aoi); - } - else{ - //remove POI layer from map - $scope.removeAoiLayerFromMap(aoi); - } - - }; - - $scope.addAoiLayerToMap = async function(aoiGeoresource) { - $scope.loadingData = true; - $rootScope.$broadcast("showLoadingIconOnMap"); - - var id = aoiGeoresource.georesourceId; - - var date = $scope.getQueryDate(aoiGeoresource); - - var dateComps = date.split("-"); - - var year = dateComps[0]; - var month = dateComps[1]; - var day = dateComps[2]; - - await $http({ - url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + id + "/" + year + "/" + month + "/" + day, - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - var geoJSON = response.data; - - aoiGeoresource.geoJSON = geoJSON; - - kommonitorMapService.addAoiGeoresourceGeoJSON(aoiGeoresource, date); - $scope.loadingData = false; - $rootScope.$broadcast("hideLoadingIconOnMap"); - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - $scope.loadingData = false; - kommonitorDataExchangeService.displayMapApplicationError(error); - $rootScope.$broadcast("hideLoadingIconOnMap"); - }); - - }; - - $scope.removeAoiLayerFromMap = function(aoiGeoresource) { - $scope.loadingData = true; - $rootScope.$broadcast("showLoadingIconOnMap"); - - aoiGeoresource = aoiGeoresource; - - kommonitorMapService.removeAoiGeoresource(aoiGeoresource); - $scope.loadingData = false; - $rootScope.$broadcast("hideLoadingIconOnMap"); - - }; - - $scope.getExportLinkForAoi = function(aoi){ - var date = $scope.getQueryDate(aoi); - - var dateComps = date.split("-"); - - var year = dateComps[0]; - var month = dateComps[1]; - var day = dateComps[2]; - - var url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + aoi.georesourceId + "/" + year + "/" + month + "/" + day; - var fileName = aoi.datasetName + "-" + year + "-" + month + "-" + day; - - $http({ - url: url, - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - var geoJSON = response.data; - - var element = document.createElement('a'); - element.setAttribute('href', 'data:application/json;charset=utf-8,' + encodeURIComponent(JSON.stringify(geoJSON))); - element.setAttribute('download', fileName); - - element.style.display = 'none'; - document.body.appendChild(element); - - element.click(); - - document.body.removeChild(element); - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - $scope.loadingData = false; - kommonitorDataExchangeService.displayMapApplicationError(error); - $rootScope.$broadcast("hideLoadingIconOnMap"); - }); - - }; - - ////////// LOI - $scope.handleLoiOnMap = function(loi){ - - if(loi.isSelected){ - //display on Map - $scope.addLoiLayerToMap(loi); - } - else{ - //remove POI layer from map - $scope.removeLoiLayerFromMap(loi); - } - - }; - - $scope.addLoiLayerToMap = async function(loiGeoresource) { - $scope.loadingData = true; - $rootScope.$broadcast("showLoadingIconOnMap"); - - var id = loiGeoresource.georesourceId; - - var date = $scope.getQueryDate(loiGeoresource); - - var dateComps = date.split("-"); - - var year = dateComps[0]; - var month = dateComps[1]; - var day = dateComps[2]; - - await $http({ - url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + id + "/" + year + "/" + month + "/" + day, - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - var geoJSON = response.data; - - loiGeoresource.geoJSON = geoJSON; - - kommonitorMapService.addLoiGeoresourceGeoJSON(loiGeoresource, date); - $scope.loadingData = false; - $rootScope.$broadcast("hideLoadingIconOnMap"); - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - $scope.loadingData = false; - kommonitorDataExchangeService.displayMapApplicationError(error); - $rootScope.$broadcast("hideLoadingIconOnMap"); - }); - - }; - - $scope.removeLoiLayerFromMap = function(loiGeoresource) { - $scope.loadingData = true; - $rootScope.$broadcast("showLoadingIconOnMap"); - - loiGeoresource = loiGeoresource; - - kommonitorMapService.removeLoiGeoresource(loiGeoresource); - $scope.loadingData = false; - $rootScope.$broadcast("hideLoadingIconOnMap"); - - }; - - $scope.getExportLinkForLoi = function(aoi){ - var date = $scope.getQueryDate(aoi); - - var dateComps = date.split("-"); - - var year = dateComps[0]; - var month = dateComps[1]; - var day = dateComps[2]; - - var url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + aoi.georesourceId + "/" + year + "/" + month + "/" + day; - var fileName = aoi.datasetName + "-" + year + "-" + month + "-" + day; - - $http({ - url: url, - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - var geoJSON = response.data; - - var element = document.createElement('a'); - element.setAttribute('href', 'data:application/json;charset=utf-8,' + encodeURIComponent(JSON.stringify(geoJSON))); - element.setAttribute('download', fileName); - - element.style.display = 'none'; - document.body.appendChild(element); - - element.click(); - - document.body.removeChild(element); - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - $scope.loadingData = false; - kommonitorDataExchangeService.displayMapApplicationError(error); - $rootScope.$broadcast("hideLoadingIconOnMap"); - }); - - }; - - - $scope.handleWmsOnMap = function(dataset){ - kommonitorDataExchangeService.wmsLegendImage = undefined; - console.log("Toggle WMS: " + dataset.title); - - if(dataset.isSelected){ - //display on Map - var opacity = 1 - dataset.transparency; - kommonitorMapService.addWmsLayerToMap(dataset, opacity); - - } - else{ - //remove WMS layer from map - kommonitorMapService.removeWmsLayerFromMap(dataset); - - } - }; - - $scope.adjustWMSLayerTransparency = function(dataset){ - - var opacity = 1 - dataset.transparency; - - kommonitorMapService.adjustOpacityForWmsLayer(dataset, opacity); - }; - - $scope.adjustAOILayerTransparency = function(dataset){ - - var opacity = 1 - dataset.transparency; - - kommonitorMapService.adjustOpacityForAoiLayer(dataset, opacity); - }; - - $scope.adjustPOILayerTransparency = function(dataset){ - - var opacity = 1 - dataset.transparency; - - kommonitorMapService.adjustOpacityForPoiLayer(dataset, opacity); - }; - - $scope.adjustLOILayerTransparency = function(dataset){ - - var opacity = 1 - dataset.transparency; - - kommonitorMapService.adjustOpacityForLoiLayer(dataset, opacity); - }; - - $scope.handleWfsOnMap = function(dataset){ - console.log("Toggle WFS: " + dataset.title); - - if(dataset.isSelected){ - //display on Map - var opacity = 1 - dataset.transparency; - kommonitorMapService.addWfsLayerToMap(dataset, opacity, $scope.useCluster); - - } - else{ - //remove WMS layer from map - kommonitorMapService.removeWfsLayerFromMap(dataset); - - } - }; - - $scope.adjustWFSLayerTransparency = function(dataset){ - - var opacity = 1 - dataset.transparency; - - kommonitorMapService.adjustOpacityForWfsLayer(dataset, opacity); - }; - - $scope.adjustWfsLayerColor = function(dataset){ - - var opacity = 1 - dataset.transparency; - - kommonitorMapService.adjustColorForWfsLayer(dataset, opacity); - }; - - $scope.zoomToLayer = function(georesourceMetadata){ - $rootScope.$broadcast("zoomToGeoresourceLayer", georesourceMetadata); - }; - - - } ] - }); + .module('poi') + .component('poi', { + templateUrl: "components/kommonitorUserInterface/kommonitorControls/poi/poi.template.html", + controller: [ + 'kommonitorDataExchangeService', 'kommonitorMapService', '$scope', '$rootScope', '$http', '__env', '$timeout', + function indicatorRadarController(kommonitorDataExchangeService, kommonitorMapService, $scope, $rootScope, $http, __env, $timeout) { + /* + * reference to kommonitorDataExchangeService instances + */ + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorMapServiceInstance = kommonitorMapService; + $scope.useCluster = true; + $scope.loadingData = false; + $scope.date; + $scope.poiNameFilter = undefined; + $scope.loiNameFilter = undefined; + $scope.aoiNameFilter = undefined; + $scope.georesourceNameFilter = { value: undefined }; + $scope.dateSelectionType_valueIndicator = "date_indicator"; + $scope.dateSelectionType_valueManual = "date_manual"; + $scope.dateSelectionType_valuePerDataset = "date_perDataset"; + $scope.dateSelectionType = { + selectedDateType: $scope.dateSelectionType_valuePerDataset + }; + $scope.selectedDate_manual = undefined; + $('#manualDateDatepicker').datepicker(kommonitorDataExchangeService.datePickerOptions); + $scope.showPOI = true; + $scope.showLOI = true; + $scope.showAOI = true; + $scope.showWMS = true; + $scope.showWFS = true; + $scope.showAllForTopic_null = false; + // initialize any adminLTE box widgets + $timeout(function () { + $('.box').boxWidget(); + }, 750); + const DATE_PREFIX = __env.indicatorDatePrefix; + var numberOfDecimals = __env.numberOfDecimals; + // initialize colorpicker after some time + // wait to ensure that elements ar available on DOM + setTimeout(function () { + var colorPickerInputs = $('.input-group.colorpicker-component'); + colorPickerInputs.colorpicker(); + // $('.input-group.colorpicker-component').each(function (index, value){ + // $(this).colorpicker(); + // }); + }, 3000); + var addClickListenerToEachCollapseTrigger = function () { + setTimeout(function () { + $('.list-group-item > .collapseTrigger').on('click', function () { + $('.glyphicon', this) + .toggleClass('glyphicon-chevron-right') + .toggleClass('glyphicon-chevron-down'); + // manage uncollapsed entries + // var clickedTopicId = $(this).attr('id'); + // if ($scope.unCollapsedTopicIds.includes(clickedTopicId)){ + // var index = $scope.unCollapsedTopicIds.indexOf(clickedTopicId); + // $scope.unCollapsedTopicIds.splice(index, 1); + // } + // else{ + // $scope.unCollapsedTopicIds.push(clickedTopicId); + // } + }); + }, 500); + }; + $(document).ready(function () { + addClickListenerToEachCollapseTrigger(); + }); + $scope.onChangeShowPOI = function () { + if ($scope.showPOI) { + $scope.showPOI = false; + } + else { + $scope.showPOI = true; + } + setTimeout(() => { + $scope.$digest(); + }, 500); + }; + $scope.onChangeShowLOI = function () { + if ($scope.showLOI) { + $scope.showLOI = false; + } + else { + $scope.showLOI = true; + } + setTimeout(() => { + $scope.$digest(); + }, 500); + }; + $scope.onChangeShowAOI = function () { + if ($scope.showAOI) { + $scope.showAOI = false; + } + else { + $scope.showAOI = true; + } + setTimeout(() => { + $scope.$digest(); + }, 500); + }; + $scope.onChangeShowWMS = function () { + if ($scope.showWMS) { + $scope.showWMS = false; + } + else { + $scope.showWMS = true; + } + setTimeout(() => { + $scope.$digest(); + }, 500); + }; + $scope.onChangeShowWFS = function () { + if ($scope.showWFS) { + $scope.showWFS = false; + } + else { + $scope.showWFS = true; + } + setTimeout(() => { + $scope.$digest(); + }, 500); + }; + $scope.filterByNoTopic = function () { + return function (item) { + try { + if (!item.topicReference || item.topicReference === "") { + return true; + } + if (!kommonitorDataExchangeService.referencedTopicIdExists(item.topicReference)) { + return true; + } + return false; + } + catch (error) { + return false; + } + }; + }; + $scope.handleShowAllOnTopic = function (topic) { + // if (topic.isSelected){ + // topic.isSelected = false; + // } + // else{ + // topic.isSelected = true; + // } + var relevantDatasets = kommonitorDataExchangeService.getGeoresourceDatasets(topic, $scope.georesourceNameFilter.value, $scope.showPOI, $scope.showLOI, $scope.showAOI, $scope.showWMS, $scope.showWFS); + if (topic === null) { + // if ($scope.showAllForTopic_null){ + // $scope.showAllForTopic_null = false; + // } + // else{ + // $scope.showAllForTopic_null = true; + // } + if ($scope.showAllForTopic_null) { + relevantDatasets.forEach(element => { + if (!element.isSelected) { + element.isSelected = true; + if (element.isPOI) { + $scope.handlePoiOnMap(element); + } + else if (element.isLOI) { + $scope.handleLoiOnMap(element); + } + else if (element.isAOI) { + $scope.handleAoiOnMap(element); + } + else if (element.layerName) { + $scope.handleWmsOnMap(element); + } + else if (element.featureTypeName) { + $scope.handleWfsOnMap(element); + } + else { + console.error("unknown dataset: " + element); + } + } + }); + } + else { + relevantDatasets.forEach(element => { + if (element.isSelected) { + element.isSelected = true; + if (element.isPOI) { + $scope.handlePoiOnMap(element); + } + else if (element.isLOI) { + $scope.handleLoiOnMap(element); + } + else if (element.isAOI) { + $scope.handleAoiOnMap(element); + } + else if (element.layerName) { + $scope.handleWmsOnMap(element); + } + else if (element.featureTypeName) { + $scope.handleWfsOnMap(element); + } + else { + console.error("unknown dataset: " + element); + } + } + }); + } + } + else if (topic.isSelected) { + relevantDatasets.forEach(element => { + if (!element.isSelected) { + element.isSelected = true; + if (element.isPOI) { + $scope.handlePoiOnMap(element); + } + else if (element.isLOI) { + $scope.handleLoiOnMap(element); + } + else if (element.isAOI) { + $scope.handleAoiOnMap(element); + } + else if (element.layerName) { + $scope.handleWmsOnMap(element); + } + else if (element.featureTypeName) { + $scope.handleWfsOnMap(element); + } + else { + console.error("unknown dataset: " + element); + } + } + }); + } + else if (!topic.isSelected) { + relevantDatasets.forEach(element => { + if (element.isSelected) { + element.isSelected = false; + if (element.isPOI) { + $scope.handlePoiOnMap(element); + } + else if (element.isLOI) { + $scope.handleLoiOnMap(element); + } + else if (element.isAOI) { + $scope.handleAoiOnMap(element); + } + else if (element.layerName) { + $scope.handleWmsOnMap(element); + } + else if (element.featureTypeName) { + $scope.handleWfsOnMap(element); + } + else { + console.error("unknown dataset: " + element); + } + } + }); + } + }; + $scope.onClickUseIndicatorTimestamp = function () { + $scope.dateSelectionType.selectedDateType = $scope.dateSelectionType_valueIndicator; + $scope.refreshSelectedGeoresources(); + }; + $scope.timeout_manualdate; + function isNoValidDate(dateCandidate) { + var dateComps = dateCandidate.split("-"); + if (dateComps.length < 3) { + return true; + } + else if (!dateComps[0] || !dateComps[1] || !dateComps[2]) { + return true; + } + else if (isNaN(dateComps[0]) || isNaN(dateComps[1]) || isNaN(dateComps[2])) { + return true; + } + else if (Number(dateComps[1]) > 12 || Number(dateComps[2]) > 31) { + return true; + } + return false; + } + $scope.onChangeManualDate = function () { + // check if date is an actual date + // if so then refresh selected layers + // Clear the timeout if it has already been set. + // This will prevent the previous task from executing + // if it has been less than + clearTimeout($scope.timeout_manualdate); + // Make a new timeout set to go off in 1000ms (1 second) + $scope.timeout_manualdate = setTimeout(function () { + var dateCandidate = $scope.selectedDate_manual; + if (isNoValidDate(dateCandidate)) { + return; + } + $timeout(function () { + $scope.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + }); + $timeout(function () { + $scope.refreshSelectedGeoresources(); + }, 250); + }, 1000); + }; + $scope.$on("selectedIndicatorDateHasChanged", function (event) { + console.log("refresh selected georesource layers according to new date"); + // only refresh georesources if sync with indicator timestamp is selected + if (!$scope.dateSelectionType.selectedDateType.includes($scope.dateSelectionType_valueIndicator)) { + return; + } + $timeout(function () { + $scope.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + }); + $timeout(function () { + $scope.refreshSelectedGeoresources(); + }, 250); + }); + $scope.refreshSelectedGeoresources = function () { + for (const georesource of kommonitorDataExchangeService.displayableGeoresources_keywordFiltered) { + if (georesource.isSelected) { + if (georesource.isPOI) { + georesource.isSelected = false; + $scope.handlePoiOnMap(georesource); + georesource.isSelected = true; + $scope.handlePoiOnMap(georesource); + } + else if (georesource.isLOI) { + georesource.isSelected = false; + $scope.handleLoiOnMap(georesource); + georesource.isSelected = true; + $scope.handleLoiOnMap(georesource); + } + else if (georesource.isAOI) { + georesource.isSelected = false; + $scope.handleAoiOnMap(georesource); + georesource.isSelected = true; + $scope.handleAoiOnMap(georesource); + } + } + } + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + }; + $scope.onChangeSelectedDate = function (georesourceDataset) { + // only if it s already selected, we must modify the shown dataset + if (georesourceDataset.isSelected) { + // depending on type we must call different methods + if (georesourceDataset.isPOI) { + $scope.removePoiLayerFromMap(georesourceDataset); + $scope.addPoiLayerToMap(georesourceDataset, $scope.useCluster); + } + else if (georesourceDataset.isLOI) { + $scope.removeLoiLayerFromMap(georesourceDataset); + $scope.addLoiLayerToMap(georesourceDataset); + } + else if (georesourceDataset.isAOI) { + $scope.removeAoiLayerFromMap(georesourceDataset); + $scope.addAoiLayerToMap(georesourceDataset); + } + else { + console.error("unknown dataset: " + georesourceDataset); + } + } + }; + $scope.getQueryDate = function (resource) { + if ($scope.dateSelectionType.selectedDateType === $scope.dateSelectionType_valueIndicator) { + return kommonitorDataExchangeService.selectedDate; + } + else if ($scope.dateSelectionType.selectedDateType === $scope.dateSelectionType_valueManual) { + return $scope.selectedDate_manual; + } + else if ($scope.dateSelectionType.selectedDateType === $scope.dateSelectionType_valuePerDataset) { + return resource.selectedDate.startDate; + } + else { + return kommonitorDataExchangeService.selectedDate; + } + }; + $scope.handlePoiOnMap = function (poi) { + if (poi.isSelected) { + //display on Map + $scope.addPoiLayerToMap(poi, $scope.useCluster); + } + else { + //remove POI layer from map + $scope.removePoiLayerFromMap(poi); + } + }; + $scope.addPoiLayerToMap = async function (poiGeoresource, useCluster) { + $scope.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + var id = poiGeoresource.georesourceId; + var date = $scope.getQueryDate(poiGeoresource); + var dateComps = date.split("-"); + var year = dateComps[0]; + var month = dateComps[1]; + var day = dateComps[2]; + await $http({ + url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + id + "/" + year + "/" + month + "/" + day, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + var geoJSON = response.data; + poiGeoresource.geoJSON = geoJSON; + kommonitorMapService.addPoiGeoresourceGeoJSON(poiGeoresource, date, useCluster); + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + $rootScope.$broadcast("hideLoadingIconOnMap"); + }); + }; + $scope.removePoiLayerFromMap = function (poiGeoresource) { + $scope.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + poiGeoresource = poiGeoresource; + kommonitorMapService.removePoiGeoresource(poiGeoresource); + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + }; + $scope.refreshPoiLayers = async function () { + for (var poi of kommonitorDataExchangeService.displayableGeoresources_keywordFiltered) { + if (poi.isSelected) { + //remove POI layer from map + $scope.removePoiLayerFromMap(poi); + // remove layer and add layer again + await $scope.addPoiLayerToMap(poi, $scope.useCluster); + } + } + for (var wfs of kommonitorDataExchangeService.wfsDatasets) { + if (wfs.geometryType == 'POI' && wfs.isSelected) { + //remove POI layer from map + kommonitorMapService.removeWfsLayerFromMap(wfs); + // remove layer and add layer again + var opacity = 1 - wfs.transparency; + await kommonitorMapService.addWfsLayerToMap(wfs, opacity, $scope.useCluster); + } + } + }; + $scope.getExportLinkForPoi = function (poi) { + var date = $scope.getQueryDate(poi); + var dateComps = date.split("-"); + var year = dateComps[0]; + var month = dateComps[1]; + var day = dateComps[2]; + var url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + poi.georesourceId + "/" + year + "/" + month + "/" + day; + var fileName = poi.datasetName + "-" + year + "-" + month + "-" + day; + $http({ + url: url, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + var geoJSON_string = JSON.stringify(response.data); + kommonitorDataExchangeService.generateAndDownloadGeoresourceZIP(poi, geoJSON_string, fileName, ".geojson", {}); + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + $rootScope.$broadcast("hideLoadingIconOnMap"); + }); + }; + ////////// AOI + $scope.handleAoiOnMap = function (aoi) { + if (aoi.isSelected) { + //display on Map + $scope.addAoiLayerToMap(aoi); + } + else { + //remove POI layer from map + $scope.removeAoiLayerFromMap(aoi); + } + }; + $scope.addAoiLayerToMap = async function (aoiGeoresource) { + $scope.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + var id = aoiGeoresource.georesourceId; + var date = $scope.getQueryDate(aoiGeoresource); + var dateComps = date.split("-"); + var year = dateComps[0]; + var month = dateComps[1]; + var day = dateComps[2]; + await $http({ + url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + id + "/" + year + "/" + month + "/" + day, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + var geoJSON = response.data; + aoiGeoresource.geoJSON = geoJSON; + kommonitorMapService.addAoiGeoresourceGeoJSON(aoiGeoresource, date); + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + $rootScope.$broadcast("hideLoadingIconOnMap"); + }); + }; + $scope.removeAoiLayerFromMap = function (aoiGeoresource) { + $scope.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + aoiGeoresource = aoiGeoresource; + kommonitorMapService.removeAoiGeoresource(aoiGeoresource); + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + }; + $scope.getExportLinkForAoi = function (aoi) { + var date = $scope.getQueryDate(aoi); + var dateComps = date.split("-"); + var year = dateComps[0]; + var month = dateComps[1]; + var day = dateComps[2]; + var url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + aoi.georesourceId + "/" + year + "/" + month + "/" + day; + var fileName = aoi.datasetName + "-" + year + "-" + month + "-" + day; + $http({ + url: url, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + var geoJSON = response.data; + var element = document.createElement('a'); + element.setAttribute('href', 'data:application/json;charset=utf-8,' + encodeURIComponent(JSON.stringify(geoJSON))); + element.setAttribute('download', fileName); + element.style.display = 'none'; + document.body.appendChild(element); + element.click(); + document.body.removeChild(element); + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + $rootScope.$broadcast("hideLoadingIconOnMap"); + }); + }; + ////////// LOI + $scope.handleLoiOnMap = function (loi) { + if (loi.isSelected) { + //display on Map + $scope.addLoiLayerToMap(loi); + } + else { + //remove POI layer from map + $scope.removeLoiLayerFromMap(loi); + } + }; + $scope.addLoiLayerToMap = async function (loiGeoresource) { + $scope.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + var id = loiGeoresource.georesourceId; + var date = $scope.getQueryDate(loiGeoresource); + var dateComps = date.split("-"); + var year = dateComps[0]; + var month = dateComps[1]; + var day = dateComps[2]; + await $http({ + url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + id + "/" + year + "/" + month + "/" + day, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + var geoJSON = response.data; + loiGeoresource.geoJSON = geoJSON; + kommonitorMapService.addLoiGeoresourceGeoJSON(loiGeoresource, date); + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + $rootScope.$broadcast("hideLoadingIconOnMap"); + }); + }; + $scope.removeLoiLayerFromMap = function (loiGeoresource) { + $scope.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + loiGeoresource = loiGeoresource; + kommonitorMapService.removeLoiGeoresource(loiGeoresource); + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + }; + $scope.getExportLinkForLoi = function (aoi) { + var date = $scope.getQueryDate(aoi); + var dateComps = date.split("-"); + var year = dateComps[0]; + var month = dateComps[1]; + var day = dateComps[2]; + var url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + aoi.georesourceId + "/" + year + "/" + month + "/" + day; + var fileName = aoi.datasetName + "-" + year + "-" + month + "-" + day; + $http({ + url: url, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + var geoJSON = response.data; + var element = document.createElement('a'); + element.setAttribute('href', 'data:application/json;charset=utf-8,' + encodeURIComponent(JSON.stringify(geoJSON))); + element.setAttribute('download', fileName); + element.style.display = 'none'; + document.body.appendChild(element); + element.click(); + document.body.removeChild(element); + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + $rootScope.$broadcast("hideLoadingIconOnMap"); + }); + }; + $scope.handleWmsOnMap = function (dataset) { + kommonitorDataExchangeService.wmsLegendImage = undefined; + console.log("Toggle WMS: " + dataset.title); + if (dataset.isSelected) { + //display on Map + var opacity = 1 - dataset.transparency; + kommonitorMapService.addWmsLayerToMap(dataset, opacity); + } + else { + //remove WMS layer from map + kommonitorMapService.removeWmsLayerFromMap(dataset); + } + }; + $scope.adjustWMSLayerTransparency = function (dataset) { + var opacity = 1 - dataset.transparency; + kommonitorMapService.adjustOpacityForWmsLayer(dataset, opacity); + }; + $scope.adjustAOILayerTransparency = function (dataset) { + var opacity = 1 - dataset.transparency; + kommonitorMapService.adjustOpacityForAoiLayer(dataset, opacity); + }; + $scope.adjustPOILayerTransparency = function (dataset) { + var opacity = 1 - dataset.transparency; + kommonitorMapService.adjustOpacityForPoiLayer(dataset, opacity); + }; + $scope.adjustLOILayerTransparency = function (dataset) { + var opacity = 1 - dataset.transparency; + kommonitorMapService.adjustOpacityForLoiLayer(dataset, opacity); + }; + $scope.handleWfsOnMap = function (dataset) { + console.log("Toggle WFS: " + dataset.title); + if (dataset.isSelected) { + //display on Map + var opacity = 1 - dataset.transparency; + kommonitorMapService.addWfsLayerToMap(dataset, opacity, $scope.useCluster); + } + else { + //remove WMS layer from map + kommonitorMapService.removeWfsLayerFromMap(dataset); + } + }; + $scope.adjustWFSLayerTransparency = function (dataset) { + var opacity = 1 - dataset.transparency; + kommonitorMapService.adjustOpacityForWfsLayer(dataset, opacity); + }; + $scope.adjustWfsLayerColor = function (dataset) { + var opacity = 1 - dataset.transparency; + kommonitorMapService.adjustColorForWfsLayer(dataset, opacity); + }; + $scope.zoomToLayer = function (georesourceMetadata) { + $rootScope.$broadcast("zoomToGeoresourceLayer", georesourceMetadata); + }; + } + ] +}); +//# sourceMappingURL=poi.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/poi/poi.component.js.map b/app/components/kommonitorUserInterface/kommonitorControls/poi/poi.component.js.map new file mode 100644 index 000000000..1e1a8f143 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/poi/poi.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"poi.component.js","sourceRoot":"","sources":["poi.component.ts"],"names":[],"mappings":";AAAA,OAAO;KACJ,MAAM,CAAC,KAAK,CAAC;KACb,SAAS,CACR,KAAK,EACL;IACC,WAAW,EAAG,6EAA6E;IAE3F,UAAU,EAAG;QACX,+BAA+B,EAAE,sBAAsB,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU;QAC7G,SAAS,wBAAwB,CAC/B,6BAA6B,EAAE,oBAAoB,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ;YAChG;;eAEG;YACH,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAC3E,IAAI,CAAC,4BAA4B,GAAG,oBAAoB,CAAC;YACzD,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC;YACzB,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;YAC3B,MAAM,CAAC,IAAI,CAAC;YAEZ,MAAM,CAAC,aAAa,GAAG,SAAS,CAAC;YACjC,MAAM,CAAC,aAAa,GAAG,SA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ommonitorUserInterface/kommonitorControls/poi/poi.component.ts b/app/components/kommonitorUserInterface/kommonitorControls/poi/poi.component.ts new file mode 100644 index 000000000..f36b97055 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/poi/poi.component.ts @@ -0,0 +1,867 @@ +angular + .module('poi') + .component( + 'poi', + { + templateUrl : "components/kommonitorUserInterface/kommonitorControls/poi/poi.template.html", + + controller : [ + 'kommonitorDataExchangeService', 'kommonitorMapService', '$scope', '$rootScope', '$http', '__env', '$timeout', + function indicatorRadarController( + kommonitorDataExchangeService, kommonitorMapService, $scope, $rootScope, $http, __env, $timeout) { + /* + * reference to kommonitorDataExchangeService instances + */ + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorMapServiceInstance = kommonitorMapService; + $scope.useCluster = true; + $scope.loadingData = false; + $scope.date; + + $scope.poiNameFilter = undefined; + $scope.loiNameFilter = undefined; + $scope.aoiNameFilter = undefined; + + $scope.georesourceNameFilter = {value: undefined}; + + $scope.dateSelectionType_valueIndicator = "date_indicator"; + $scope.dateSelectionType_valueManual = "date_manual"; + $scope.dateSelectionType_valuePerDataset = "date_perDataset"; + $scope.dateSelectionType = { + selectedDateType: $scope.dateSelectionType_valuePerDataset + }; + + $scope.selectedDate_manual = undefined; + $('#manualDateDatepicker').datepicker(kommonitorDataExchangeService.datePickerOptions); + + $scope.showPOI = true; + $scope.showLOI = true; + $scope.showAOI = true; + $scope.showWMS = true; + $scope.showWFS = true; + + $scope.showAllForTopic_null = false; + + + // initialize any adminLTE box widgets + $timeout(function(){ + $('.box').boxWidget(); + }, 750); + + + const DATE_PREFIX = __env.indicatorDatePrefix; + + var numberOfDecimals = __env.numberOfDecimals; + + // initialize colorpicker after some time + // wait to ensure that elements ar available on DOM + setTimeout(function() { + + var colorPickerInputs = $('.input-group.colorpicker-component') + colorPickerInputs.colorpicker(); + + // $('.input-group.colorpicker-component').each(function (index, value){ + // $(this).colorpicker(); + // }); + }, 3000); + + var addClickListenerToEachCollapseTrigger = function(){ + setTimeout(function(){ + $('.list-group-item > .collapseTrigger').on('click', function() { + $('.glyphicon', this) + .toggleClass('glyphicon-chevron-right') + .toggleClass('glyphicon-chevron-down'); + + // manage uncollapsed entries + // var clickedTopicId = $(this).attr('id'); + // if ($scope.unCollapsedTopicIds.includes(clickedTopicId)){ + // var index = $scope.unCollapsedTopicIds.indexOf(clickedTopicId); + // $scope.unCollapsedTopicIds.splice(index, 1); + // } + // else{ + // $scope.unCollapsedTopicIds.push(clickedTopicId); + // } + }); + }, 500); + }; + + $(document).ready(function() { + + addClickListenerToEachCollapseTrigger(); + }); + + $scope.onChangeShowPOI = function(){ + if ($scope.showPOI){ + $scope.showPOI = false; + } + else{ + $scope.showPOI = true; + } + + setTimeout(() => { + $scope.$digest(); + }, 500); + }; + + $scope.onChangeShowLOI = function(){ + if ($scope.showLOI){ + $scope.showLOI = false; + } + else{ + $scope.showLOI = true; + } + + setTimeout(() => { + $scope.$digest(); + }, 500); + }; + + $scope.onChangeShowAOI = function(){ + if ($scope.showAOI){ + $scope.showAOI = false; + } + else{ + $scope.showAOI = true; + } + + setTimeout(() => { + $scope.$digest(); + }, 500); + }; + + $scope.onChangeShowWMS = function(){ + if ($scope.showWMS){ + $scope.showWMS = false; + } + else{ + $scope.showWMS = true; + } + + setTimeout(() => { + $scope.$digest(); + }, 500); + }; + + $scope.onChangeShowWFS = function(){ + if ($scope.showWFS){ + $scope.showWFS = false; + } + else{ + $scope.showWFS = true; + } + + setTimeout(() => { + $scope.$digest(); + }, 500); + }; + + $scope.filterByNoTopic = function(){ + return function( item ) { + + try{ + if (! item.topicReference || item.topicReference === ""){ + return true; + } + if(! kommonitorDataExchangeService.referencedTopicIdExists(item.topicReference)){ + return true; + } + return false; + } + catch(error){ + return false; + } + }; + }; + + $scope.handleShowAllOnTopic = function(topic){ + // if (topic.isSelected){ + // topic.isSelected = false; + // } + // else{ + // topic.isSelected = true; + // } + + var relevantDatasets = kommonitorDataExchangeService.getGeoresourceDatasets(topic, $scope.georesourceNameFilter.value, $scope.showPOI, $scope.showLOI, $scope.showAOI, $scope.showWMS, $scope.showWFS); + + if(topic === null){ + // if ($scope.showAllForTopic_null){ + // $scope.showAllForTopic_null = false; + // } + // else{ + // $scope.showAllForTopic_null = true; + // } + if($scope.showAllForTopic_null){ + relevantDatasets.forEach(element => { + if(! element.isSelected){ + element.isSelected = true; + + if (element.isPOI){ + $scope.handlePoiOnMap(element); + } + else if (element.isLOI){ + $scope.handleLoiOnMap(element); + } + else if (element.isAOI){ + $scope.handleAoiOnMap(element); + } + else if (element.layerName){ + $scope.handleWmsOnMap(element); + } + else if (element.featureTypeName){ + $scope.handleWfsOnMap(element); + } + else{ + console.error("unknown dataset: " + element); + } + } + + }); + } + else{ + relevantDatasets.forEach(element => { + if(element.isSelected){ + element.isSelected = true; + + if (element.isPOI){ + $scope.handlePoiOnMap(element); + } + else if (element.isLOI){ + $scope.handleLoiOnMap(element); + } + else if (element.isAOI){ + $scope.handleAoiOnMap(element); + } + else if (element.layerName){ + $scope.handleWmsOnMap(element); + } + else if (element.featureTypeName){ + $scope.handleWfsOnMap(element); + } + else{ + console.error("unknown dataset: " + element); + } + } + + }); + } + } + + else if(topic.isSelected){ + relevantDatasets.forEach(element => { + if(! element.isSelected){ + element.isSelected = true; + + if (element.isPOI){ + $scope.handlePoiOnMap(element); + } + else if (element.isLOI){ + $scope.handleLoiOnMap(element); + } + else if (element.isAOI){ + $scope.handleAoiOnMap(element); + } + else if (element.layerName){ + $scope.handleWmsOnMap(element); + } + else if (element.featureTypeName){ + $scope.handleWfsOnMap(element); + } + else{ + console.error("unknown dataset: " + element); + } + } + + }); + } + else if(! topic.isSelected){ + relevantDatasets.forEach(element => { + if(element.isSelected){ + element.isSelected = false; + + if (element.isPOI){ + $scope.handlePoiOnMap(element); + } + else if (element.isLOI){ + $scope.handleLoiOnMap(element); + } + else if (element.isAOI){ + $scope.handleAoiOnMap(element); + } + else if (element.layerName){ + $scope.handleWmsOnMap(element); + } + else if (element.featureTypeName){ + $scope.handleWfsOnMap(element); + } + else{ + console.error("unknown dataset: " + element); + } + } + + }); + } + + }; + + $scope.onClickUseIndicatorTimestamp = function(){ + $scope.dateSelectionType.selectedDateType = $scope.dateSelectionType_valueIndicator; + + $scope.refreshSelectedGeoresources(); + }; + + $scope.timeout_manualdate; + + function isNoValidDate(dateCandidate){ + var dateComps = dateCandidate.split("-"); + + if(dateComps.length < 3){ + return true; + } + else if(! dateComps[0] || ! dateComps[1] || ! dateComps[2]){ + return true; + } + else if(isNaN(dateComps[0]) || isNaN(dateComps[1]) || isNaN(dateComps[2])){ + return true; + } + else if(Number(dateComps[1]) > 12 || Number(dateComps[2]) > 31){ + return true; + } + + return false; + } + + $scope.onChangeManualDate = function(){ + // check if date is an actual date + // if so then refresh selected layers + + // Clear the timeout if it has already been set. + // This will prevent the previous task from executing + // if it has been less than + clearTimeout($scope.timeout_manualdate); + + // Make a new timeout set to go off in 1000ms (1 second) + $scope.timeout_manualdate = setTimeout(function () { + var dateCandidate = $scope.selectedDate_manual; + + if(isNoValidDate(dateCandidate)){ + return; + } + + $timeout(function(){ + + $scope.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + }); + + $timeout(function(){ + + $scope.refreshSelectedGeoresources(); + }, 250); + }, 1000); + + }; + + $scope.$on("selectedIndicatorDateHasChanged", function (event) { + + console.log("refresh selected georesource layers according to new date"); + + // only refresh georesources if sync with indicator timestamp is selected + if(! $scope.dateSelectionType.selectedDateType.includes($scope.dateSelectionType_valueIndicator)){ + return; + } + + $timeout(function(){ + + $scope.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + }); + + $timeout(function(){ + + $scope.refreshSelectedGeoresources(); + }, 250); + }); + + $scope.refreshSelectedGeoresources = function(){ + for (const georesource of kommonitorDataExchangeService.displayableGeoresources_keywordFiltered) { + if (georesource.isSelected){ + + if(georesource.isPOI){ + georesource.isSelected = false; + $scope.handlePoiOnMap(georesource); + georesource.isSelected = true; + $scope.handlePoiOnMap(georesource); + } + else if(georesource.isLOI){ + georesource.isSelected = false; + $scope.handleLoiOnMap(georesource); + georesource.isSelected = true; + $scope.handleLoiOnMap(georesource); + } + else if(georesource.isAOI){ + georesource.isSelected = false; + $scope.handleAoiOnMap(georesource); + georesource.isSelected = true; + $scope.handleAoiOnMap(georesource); + } + + } + } + + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + }; + + $scope.onChangeSelectedDate = function(georesourceDataset){ + // only if it s already selected, we must modify the shown dataset + + + if(georesourceDataset.isSelected){ + // depending on type we must call different methods + if (georesourceDataset.isPOI){ + $scope.removePoiLayerFromMap(georesourceDataset); + $scope.addPoiLayerToMap(georesourceDataset, $scope.useCluster); + } + else if (georesourceDataset.isLOI){ + $scope.removeLoiLayerFromMap(georesourceDataset); + $scope.addLoiLayerToMap(georesourceDataset); + } + else if (georesourceDataset.isAOI){ + $scope.removeAoiLayerFromMap(georesourceDataset); + $scope.addAoiLayerToMap(georesourceDataset); + } + else{ + console.error("unknown dataset: " + georesourceDataset); + } + } + }; + + $scope.getQueryDate = function(resource){ + if ($scope.dateSelectionType.selectedDateType === $scope.dateSelectionType_valueIndicator){ + return kommonitorDataExchangeService.selectedDate; + } + else if($scope.dateSelectionType.selectedDateType === $scope.dateSelectionType_valueManual){ + return $scope.selectedDate_manual; + } + else if($scope.dateSelectionType.selectedDateType === $scope.dateSelectionType_valuePerDataset){ + return resource.selectedDate.startDate; + } + else{ + return kommonitorDataExchangeService.selectedDate; + } + }; + + $scope.handlePoiOnMap = function(poi){ + + if(poi.isSelected){ + //display on Map + $scope.addPoiLayerToMap(poi, $scope.useCluster); + } + else{ + //remove POI layer from map + $scope.removePoiLayerFromMap(poi); + } + + }; + + $scope.addPoiLayerToMap = async function(poiGeoresource, useCluster) { + $scope.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + + var id = poiGeoresource.georesourceId; + + var date = $scope.getQueryDate(poiGeoresource); + + var dateComps = date.split("-"); + + var year = dateComps[0]; + var month = dateComps[1]; + var day = dateComps[2]; + + await $http({ + url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + id + "/" + year + "/" + month + "/" + day, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + var geoJSON = response.data; + + poiGeoresource.geoJSON = geoJSON; + + kommonitorMapService.addPoiGeoresourceGeoJSON(poiGeoresource, date, useCluster); + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + $rootScope.$broadcast("hideLoadingIconOnMap"); + }); + + }; + + $scope.removePoiLayerFromMap = function(poiGeoresource) { + $scope.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + + poiGeoresource = poiGeoresource; + + kommonitorMapService.removePoiGeoresource(poiGeoresource); + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + + }; + + $scope.refreshPoiLayers = async function(){ + for (var poi of kommonitorDataExchangeService.displayableGeoresources_keywordFiltered){ + if (poi.isSelected){ + //remove POI layer from map + $scope.removePoiLayerFromMap(poi); + + // remove layer and add layer again + await $scope.addPoiLayerToMap(poi, $scope.useCluster); + } + } + + for (var wfs of kommonitorDataExchangeService.wfsDatasets){ + if (wfs.geometryType == 'POI' && wfs.isSelected){ + //remove POI layer from map + kommonitorMapService.removeWfsLayerFromMap(wfs); + + // remove layer and add layer again + var opacity = 1 - wfs.transparency; + await kommonitorMapService.addWfsLayerToMap(wfs, opacity, $scope.useCluster); + } + } + }; + + $scope.getExportLinkForPoi = function(poi){ + var date = $scope.getQueryDate(poi); + + var dateComps = date.split("-"); + + var year = dateComps[0]; + var month = dateComps[1]; + var day = dateComps[2]; + + var url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + poi.georesourceId + "/" + year + "/" + month + "/" + day; + var fileName = poi.datasetName + "-" + year + "-" + month + "-" + day; + + $http({ + url: url, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + var geoJSON_string = JSON.stringify(response.data); + + kommonitorDataExchangeService.generateAndDownloadGeoresourceZIP(poi, geoJSON_string, fileName, ".geojson", {}); + + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + $rootScope.$broadcast("hideLoadingIconOnMap"); + }); + + }; + + + + + ////////// AOI + $scope.handleAoiOnMap = function(aoi){ + + if(aoi.isSelected){ + //display on Map + $scope.addAoiLayerToMap(aoi); + } + else{ + //remove POI layer from map + $scope.removeAoiLayerFromMap(aoi); + } + + }; + + $scope.addAoiLayerToMap = async function(aoiGeoresource) { + $scope.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + + var id = aoiGeoresource.georesourceId; + + var date = $scope.getQueryDate(aoiGeoresource); + + var dateComps = date.split("-"); + + var year = dateComps[0]; + var month = dateComps[1]; + var day = dateComps[2]; + + await $http({ + url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + id + "/" + year + "/" + month + "/" + day, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + var geoJSON = response.data; + + aoiGeoresource.geoJSON = geoJSON; + + kommonitorMapService.addAoiGeoresourceGeoJSON(aoiGeoresource, date); + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + $rootScope.$broadcast("hideLoadingIconOnMap"); + }); + + }; + + $scope.removeAoiLayerFromMap = function(aoiGeoresource) { + $scope.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + + aoiGeoresource = aoiGeoresource; + + kommonitorMapService.removeAoiGeoresource(aoiGeoresource); + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + + }; + + $scope.getExportLinkForAoi = function(aoi){ + var date = $scope.getQueryDate(aoi); + + var dateComps = date.split("-"); + + var year = dateComps[0]; + var month = dateComps[1]; + var day = dateComps[2]; + + var url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + aoi.georesourceId + "/" + year + "/" + month + "/" + day; + var fileName = aoi.datasetName + "-" + year + "-" + month + "-" + day; + + $http({ + url: url, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + var geoJSON = response.data; + + var element = document.createElement('a'); + element.setAttribute('href', 'data:application/json;charset=utf-8,' + encodeURIComponent(JSON.stringify(geoJSON))); + element.setAttribute('download', fileName); + + element.style.display = 'none'; + document.body.appendChild(element); + + element.click(); + + document.body.removeChild(element); + + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + $rootScope.$broadcast("hideLoadingIconOnMap"); + }); + + }; + + ////////// LOI + $scope.handleLoiOnMap = function(loi){ + + if(loi.isSelected){ + //display on Map + $scope.addLoiLayerToMap(loi); + } + else{ + //remove POI layer from map + $scope.removeLoiLayerFromMap(loi); + } + + }; + + $scope.addLoiLayerToMap = async function(loiGeoresource) { + $scope.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + + var id = loiGeoresource.georesourceId; + + var date = $scope.getQueryDate(loiGeoresource); + + var dateComps = date.split("-"); + + var year = dateComps[0]; + var month = dateComps[1]; + var day = dateComps[2]; + + await $http({ + url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + id + "/" + year + "/" + month + "/" + day, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + var geoJSON = response.data; + + loiGeoresource.geoJSON = geoJSON; + + kommonitorMapService.addLoiGeoresourceGeoJSON(loiGeoresource, date); + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + $rootScope.$broadcast("hideLoadingIconOnMap"); + }); + + }; + + $scope.removeLoiLayerFromMap = function(loiGeoresource) { + $scope.loadingData = true; + $rootScope.$broadcast("showLoadingIconOnMap"); + + loiGeoresource = loiGeoresource; + + kommonitorMapService.removeLoiGeoresource(loiGeoresource); + $scope.loadingData = false; + $rootScope.$broadcast("hideLoadingIconOnMap"); + + }; + + $scope.getExportLinkForLoi = function(aoi){ + var date = $scope.getQueryDate(aoi); + + var dateComps = date.split("-"); + + var year = dateComps[0]; + var month = dateComps[1]; + var day = dateComps[2]; + + var url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources/" + aoi.georesourceId + "/" + year + "/" + month + "/" + day; + var fileName = aoi.datasetName + "-" + year + "-" + month + "-" + day; + + $http({ + url: url, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + var geoJSON = response.data; + + var element = document.createElement('a'); + element.setAttribute('href', 'data:application/json;charset=utf-8,' + encodeURIComponent(JSON.stringify(geoJSON))); + element.setAttribute('download', fileName); + + element.style.display = 'none'; + document.body.appendChild(element); + + element.click(); + + document.body.removeChild(element); + + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + $rootScope.$broadcast("hideLoadingIconOnMap"); + }); + + }; + + + $scope.handleWmsOnMap = function(dataset){ + kommonitorDataExchangeService.wmsLegendImage = undefined; + console.log("Toggle WMS: " + dataset.title); + + if(dataset.isSelected){ + //display on Map + var opacity = 1 - dataset.transparency; + kommonitorMapService.addWmsLayerToMap(dataset, opacity); + + } + else{ + //remove WMS layer from map + kommonitorMapService.removeWmsLayerFromMap(dataset); + + } + }; + + $scope.adjustWMSLayerTransparency = function(dataset){ + + var opacity = 1 - dataset.transparency; + + kommonitorMapService.adjustOpacityForWmsLayer(dataset, opacity); + }; + + $scope.adjustAOILayerTransparency = function(dataset){ + + var opacity = 1 - dataset.transparency; + + kommonitorMapService.adjustOpacityForAoiLayer(dataset, opacity); + }; + + $scope.adjustPOILayerTransparency = function(dataset){ + + var opacity = 1 - dataset.transparency; + + kommonitorMapService.adjustOpacityForPoiLayer(dataset, opacity); + }; + + $scope.adjustLOILayerTransparency = function(dataset){ + + var opacity = 1 - dataset.transparency; + + kommonitorMapService.adjustOpacityForLoiLayer(dataset, opacity); + }; + + $scope.handleWfsOnMap = function(dataset){ + console.log("Toggle WFS: " + dataset.title); + + if(dataset.isSelected){ + //display on Map + var opacity = 1 - dataset.transparency; + kommonitorMapService.addWfsLayerToMap(dataset, opacity, $scope.useCluster); + + } + else{ + //remove WMS layer from map + kommonitorMapService.removeWfsLayerFromMap(dataset); + + } + }; + + $scope.adjustWFSLayerTransparency = function(dataset){ + + var opacity = 1 - dataset.transparency; + + kommonitorMapService.adjustOpacityForWfsLayer(dataset, opacity); + }; + + $scope.adjustWfsLayerColor = function(dataset){ + + var opacity = 1 - dataset.transparency; + + kommonitorMapService.adjustColorForWfsLayer(dataset, opacity); + }; + + $scope.zoomToLayer = function(georesourceMetadata){ + $rootScope.$broadcast("zoomToGeoresourceLayer", georesourceMetadata); + }; + + + } ] + }); diff --git a/app/components/kommonitorUserInterface/kommonitorControls/poi/poi.module.js b/app/components/kommonitorUserInterface/kommonitorControls/poi/poi.module.js index a69fa9d73..e19fc7fe6 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/poi/poi.module.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/poi/poi.module.js @@ -1 +1,3 @@ -angular.module('poi', [ 'kommonitorDataExchange', 'kommonitorMap', 'ngSanitize']); +"use strict"; +angular.module('poi', ['kommonitorDataExchange', 'kommonitorMap', 'ngSanitize']); +//# sourceMappingURL=poi.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/poi/poi.module.js.map b/app/components/kommonitorUserInterface/kommonitorControls/poi/poi.module.js.map new file mode 100644 index 000000000..1f7afb36d --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/poi/poi.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"poi.module.js","sourceRoot":"","sources":["poi.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,CAAE,wBAAwB,EAAE,eAAe,EAAE,YAAY,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/poi/poi.module.ts b/app/components/kommonitorUserInterface/kommonitorControls/poi/poi.module.ts new file mode 100644 index 000000000..a69fa9d73 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/poi/poi.module.ts @@ -0,0 +1 @@ +angular.module('poi', [ 'kommonitorDataExchange', 'kommonitorMap', 'ngSanitize']); diff --git a/app/components/kommonitorUserInterface/kommonitorControls/poi/wfsModal/wfs-modal.component.js b/app/components/kommonitorUserInterface/kommonitorControls/poi/wfsModal/wfs-modal.component.js index df9a88b12..c7ccd3d9f 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/poi/wfsModal/wfs-modal.component.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/poi/wfsModal/wfs-modal.component.js @@ -1,67 +1,54 @@ +"use strict"; angular.module('wfsModal').component('wfsModal', { - templateUrl : "components/kommonitorUserInterface/kommonitorControls/poi/wfsModal/wfs-modal.template.html", - controller : ['kommonitorDataExchangeService', '$scope', '$rootScope', function WfsModalController(kommonitorDataExchangeService, $scope, $rootScope) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - - // initialize colorpicker - $('#wfsLegendColorPicker').colorpicker(); - - $scope.customWfsTitle = undefined; - $scope.customWfsDescription = undefined; - $scope.customWfsUrl = undefined; - $scope.customWfsFeatureTypeName = undefined; - $scope.customWfsFeatureTypeNamespace = undefined; - $scope.customWfsFeatureTypeGeometryAttributeName = undefined; - $scope.customWfsLegendColor = `#00AABB`; - $scope.useBBOXFilter = true; - - - $scope.resetCustomTempWFSForm = function(){ - $scope.customWfsTitle = undefined; - $scope.customWfsDescription = undefined; - $scope.customWfsUrl = undefined; - $scope.customWfsFeatureTypeName = undefined; - $scope.customWfsFeatureTypeNamespace = undefined; - $scope.customWfsFeatureTypeGeometryAttributeName = undefined; - $scope.customWfsLegendColor = `#00AABB`; - $scope.useBBOXFilter = true; - }; - - $scope.addCustomTempWFS = function(){ - var wfsObject = { - title: $scope.customWfsTitle, - description: $scope.customWfsDescription, - url: $scope.customWfsUrl, - featureTypeNamespace: $scope.customWfsFeatureTypeNamespace, - featureTypeName: $scope.customWfsFeatureTypeName, - featureTypeGeometryName: $scope.customWfsFeatureTypeGeometryAttributeName, - displayColor: $scope.customWfsLegendColor, - filterFeaturesToMapBBOX: $scope.useBBOXFilter - - }; - - // TODO verify input - - kommonitorDataExchangeService.wfsDatasets.push(wfsObject); - - $("#wfsSucessAlert").show(); - - $scope.resetCustomTempWFSForm(); - - setTimeout(function() { - $("#wfsSucessAlert").hide(); - }, 3000); - - setTimeout(function() { - // initialize colorpicker - $('.input-group.colorpicker-component').colorpicker(); - }, 1000); - - // initialize colorpicker - $('.colorpicker-component').colorpicker(); - - }; - - } -]}); + templateUrl: "components/kommonitorUserInterface/kommonitorControls/poi/wfsModal/wfs-modal.template.html", + controller: ['kommonitorDataExchangeService', '$scope', '$rootScope', function WfsModalController(kommonitorDataExchangeService, $scope, $rootScope) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + // initialize colorpicker + $('#wfsLegendColorPicker').colorpicker(); + $scope.customWfsTitle = undefined; + $scope.customWfsDescription = undefined; + $scope.customWfsUrl = undefined; + $scope.customWfsFeatureTypeName = undefined; + $scope.customWfsFeatureTypeNamespace = undefined; + $scope.customWfsFeatureTypeGeometryAttributeName = undefined; + $scope.customWfsLegendColor = `#00AABB`; + $scope.useBBOXFilter = true; + $scope.resetCustomTempWFSForm = function () { + $scope.customWfsTitle = undefined; + $scope.customWfsDescription = undefined; + $scope.customWfsUrl = undefined; + $scope.customWfsFeatureTypeName = undefined; + $scope.customWfsFeatureTypeNamespace = undefined; + $scope.customWfsFeatureTypeGeometryAttributeName = undefined; + $scope.customWfsLegendColor = `#00AABB`; + $scope.useBBOXFilter = true; + }; + $scope.addCustomTempWFS = function () { + var wfsObject = { + title: $scope.customWfsTitle, + description: $scope.customWfsDescription, + url: $scope.customWfsUrl, + featureTypeNamespace: $scope.customWfsFeatureTypeNamespace, + featureTypeName: $scope.customWfsFeatureTypeName, + featureTypeGeometryName: $scope.customWfsFeatureTypeGeometryAttributeName, + displayColor: $scope.customWfsLegendColor, + filterFeaturesToMapBBOX: $scope.useBBOXFilter + }; + // TODO verify input + kommonitorDataExchangeService.wfsDatasets.push(wfsObject); + $("#wfsSucessAlert").show(); + $scope.resetCustomTempWFSForm(); + setTimeout(function () { + $("#wfsSucessAlert").hide(); + }, 3000); + setTimeout(function () { + // initialize colorpicker + $('.input-group.colorpicker-component').colorpicker(); + }, 1000); + // initialize colorpicker + $('.colorpicker-component').colorpicker(); + }; + } + ] +}); +//# sourceMappingURL=wfs-modal.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/poi/wfsModal/wfs-modal.component.js.map b/app/components/kommonitorUserInterface/kommonitorControls/poi/wfsModal/wfs-modal.component.js.map new file mode 100644 index 000000000..f803cf3b7 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/poi/wfsModal/wfs-modal.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"wfs-modal.component.js","sourceRoot":"","sources":["wfs-modal.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,UAAU,EAAE;IAChD,WAAW,EAAG,4FAA4F;IAC1G,UAAU,EAAG,CAAC,+BAA+B,EAAE,QAAQ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EAAE,MAAM,CAAC,yCAAyC;oBACzE,YAAY,EAAE,MAAM,CAAC,oBAAoB;oBAC5C,uBAAuB,EAAE,MAAM,CAAC,aAAa;iBAE7C,CAAC;gBAEF,oBAAoB;gBAEpB,6BAA6B,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;gBAE1D,CAAC,CAAC,iBAAiB,CAAC,CAAC,IAAI,EAAE,CAAC;gBAE5B,MAAM,CAAC,sBAAsB,EAAE,CAAC;gBAEhC,UAAU,CAAC;oBACT,CAAC,CAAC,iBAAiB,CAAC,CAAC,IAAI,EAAE,CAAC;gBAC9B,CAAC,EAAE,IAAI,CAAC,CAAC;gBAET,UAAU,CAAC;oBACT,yBAAyB;oBACzB,CAAC,CAAC,oCAAoC,CAAC,CAAC,WAAW,EAAE,CAAC;gBACxD,CAAC,EAAE,IAAI,CAAC,CAAC;gBAET,yBAAyB;gBACzB,CAAC,CAAC,wBAAwB,CAAC,CAAC,WAAW,EAAE,CAAC;YAE3C,CAAC,CAAC;QAEH,CAAC;KACD;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/poi/wfsModal/wfs-modal.component.ts b/app/components/kommonitorUserInterface/kommonitorControls/poi/wfsModal/wfs-modal.component.ts new file mode 100644 index 000000000..df9a88b12 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/poi/wfsModal/wfs-modal.component.ts @@ -0,0 +1,67 @@ +angular.module('wfsModal').component('wfsModal', { + templateUrl : "components/kommonitorUserInterface/kommonitorControls/poi/wfsModal/wfs-modal.template.html", + controller : ['kommonitorDataExchangeService', '$scope', '$rootScope', function WfsModalController(kommonitorDataExchangeService, $scope, $rootScope) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + + // initialize colorpicker + $('#wfsLegendColorPicker').colorpicker(); + + $scope.customWfsTitle = undefined; + $scope.customWfsDescription = undefined; + $scope.customWfsUrl = undefined; + $scope.customWfsFeatureTypeName = undefined; + $scope.customWfsFeatureTypeNamespace = undefined; + $scope.customWfsFeatureTypeGeometryAttributeName = undefined; + $scope.customWfsLegendColor = `#00AABB`; + $scope.useBBOXFilter = true; + + + $scope.resetCustomTempWFSForm = function(){ + $scope.customWfsTitle = undefined; + $scope.customWfsDescription = undefined; + $scope.customWfsUrl = undefined; + $scope.customWfsFeatureTypeName = undefined; + $scope.customWfsFeatureTypeNamespace = undefined; + $scope.customWfsFeatureTypeGeometryAttributeName = undefined; + $scope.customWfsLegendColor = `#00AABB`; + $scope.useBBOXFilter = true; + }; + + $scope.addCustomTempWFS = function(){ + var wfsObject = { + title: $scope.customWfsTitle, + description: $scope.customWfsDescription, + url: $scope.customWfsUrl, + featureTypeNamespace: $scope.customWfsFeatureTypeNamespace, + featureTypeName: $scope.customWfsFeatureTypeName, + featureTypeGeometryName: $scope.customWfsFeatureTypeGeometryAttributeName, + displayColor: $scope.customWfsLegendColor, + filterFeaturesToMapBBOX: $scope.useBBOXFilter + + }; + + // TODO verify input + + kommonitorDataExchangeService.wfsDatasets.push(wfsObject); + + $("#wfsSucessAlert").show(); + + $scope.resetCustomTempWFSForm(); + + setTimeout(function() { + $("#wfsSucessAlert").hide(); + }, 3000); + + setTimeout(function() { + // initialize colorpicker + $('.input-group.colorpicker-component').colorpicker(); + }, 1000); + + // initialize colorpicker + $('.colorpicker-component').colorpicker(); + + }; + + } +]}); diff --git a/app/components/kommonitorUserInterface/kommonitorControls/poi/wfsModal/wfs-modal.module.js b/app/components/kommonitorUserInterface/kommonitorControls/poi/wfsModal/wfs-modal.module.js index a7a871447..425366491 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/poi/wfsModal/wfs-modal.module.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/poi/wfsModal/wfs-modal.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('wfsModal', []); +//# sourceMappingURL=wfs-modal.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/poi/wfsModal/wfs-modal.module.js.map b/app/components/kommonitorUserInterface/kommonitorControls/poi/wfsModal/wfs-modal.module.js.map new file mode 100644 index 000000000..81382d37c --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/poi/wfsModal/wfs-modal.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"wfs-modal.module.js","sourceRoot":"","sources":["wfs-modal.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/poi/wfsModal/wfs-modal.module.ts b/app/components/kommonitorUserInterface/kommonitorControls/poi/wfsModal/wfs-modal.module.ts new file mode 100644 index 000000000..a7a871447 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/poi/wfsModal/wfs-modal.module.ts @@ -0,0 +1 @@ +angular.module('wfsModal', []); diff --git a/app/components/kommonitorUserInterface/kommonitorControls/poi/wmsModal/wms-modal.component.js b/app/components/kommonitorUserInterface/kommonitorControls/poi/wmsModal/wms-modal.component.js index bd9e02e8a..7d9580db9 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/poi/wmsModal/wms-modal.component.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/poi/wmsModal/wms-modal.component.js @@ -1,42 +1,34 @@ +"use strict"; angular.module('wmsModal').component('wmsModal', { - templateUrl : "components/kommonitorUserInterface/kommonitorControls/poi/wmsModal/wms-modal.template.html", - controller : ['kommonitorDataExchangeService', '$scope', '$rootScope', function WmsModalController(kommonitorDataExchangeService, $scope, $rootScope) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - - $scope.customWmsTitle = undefined; - $scope.customWmsDescription = undefined; - $scope.customWmsUrl = undefined; - $scope.customWmsLayerName = undefined; - - $scope.resetCustomTempWMSForm = function(){ - $scope.customWmsTitle = undefined; - $scope.customWmsDescription = undefined; - $scope.customWmsUrl = undefined; - $scope.customWmsLayerName = undefined; - }; - - $scope.addCustomTempWMS = function(){ - var wmsObject = { - title: $scope.customWmsTitle, - description: $scope.customWmsDescription, - url: $scope.customWmsUrl, - layerName: $scope.customWmsLayerName - }; - - // TODO verify input - - kommonitorDataExchangeService.wmsDatasets.push(wmsObject); - - $("#wmsSucessAlert").show(); - - $scope.resetCustomTempWMSForm(); - - setTimeout(function() { - $("#wmsSucessAlert").hide(); - }, 3000); - - }; - - } -]}); + templateUrl: "components/kommonitorUserInterface/kommonitorControls/poi/wmsModal/wms-modal.template.html", + controller: ['kommonitorDataExchangeService', '$scope', '$rootScope', function WmsModalController(kommonitorDataExchangeService, $scope, $rootScope) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + $scope.customWmsTitle = undefined; + $scope.customWmsDescription = undefined; + $scope.customWmsUrl = undefined; + $scope.customWmsLayerName = undefined; + $scope.resetCustomTempWMSForm = function () { + $scope.customWmsTitle = undefined; + $scope.customWmsDescription = undefined; + $scope.customWmsUrl = undefined; + $scope.customWmsLayerName = undefined; + }; + $scope.addCustomTempWMS = function () { + var wmsObject = { + title: $scope.customWmsTitle, + description: $scope.customWmsDescription, + url: $scope.customWmsUrl, + layerName: $scope.customWmsLayerName + }; + // TODO verify input + kommonitorDataExchangeService.wmsDatasets.push(wmsObject); + $("#wmsSucessAlert").show(); + $scope.resetCustomTempWMSForm(); + setTimeout(function () { + $("#wmsSucessAlert").hide(); + }, 3000); + }; + } + ] +}); +//# sourceMappingURL=wms-modal.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/poi/wmsModal/wms-modal.component.js.map b/app/components/kommonitorUserInterface/kommonitorControls/poi/wmsModal/wms-modal.component.js.map new file mode 100644 index 000000000..289ea864b --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/poi/wmsModal/wms-modal.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"wms-modal.component.js","sourceRoot":"","sources":["wms-modal.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CA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ff --git a/app/components/kommonitorUserInterface/kommonitorControls/poi/wmsModal/wms-modal.component.ts b/app/components/kommonitorUserInterface/kommonitorControls/poi/wmsModal/wms-modal.component.ts new file mode 100644 index 000000000..bd9e02e8a --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/poi/wmsModal/wms-modal.component.ts @@ -0,0 +1,42 @@ +angular.module('wmsModal').component('wmsModal', { + templateUrl : "components/kommonitorUserInterface/kommonitorControls/poi/wmsModal/wms-modal.template.html", + controller : ['kommonitorDataExchangeService', '$scope', '$rootScope', function WmsModalController(kommonitorDataExchangeService, $scope, $rootScope) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + + $scope.customWmsTitle = undefined; + $scope.customWmsDescription = undefined; + $scope.customWmsUrl = undefined; + $scope.customWmsLayerName = undefined; + + $scope.resetCustomTempWMSForm = function(){ + $scope.customWmsTitle = undefined; + $scope.customWmsDescription = undefined; + $scope.customWmsUrl = undefined; + $scope.customWmsLayerName = undefined; + }; + + $scope.addCustomTempWMS = function(){ + var wmsObject = { + title: $scope.customWmsTitle, + description: $scope.customWmsDescription, + url: $scope.customWmsUrl, + layerName: $scope.customWmsLayerName + }; + + // TODO verify input + + kommonitorDataExchangeService.wmsDatasets.push(wmsObject); + + $("#wmsSucessAlert").show(); + + $scope.resetCustomTempWMSForm(); + + setTimeout(function() { + $("#wmsSucessAlert").hide(); + }, 3000); + + }; + + } +]}); diff --git a/app/components/kommonitorUserInterface/kommonitorControls/poi/wmsModal/wms-modal.module.js b/app/components/kommonitorUserInterface/kommonitorControls/poi/wmsModal/wms-modal.module.js index fdcf39c8c..d0c80a171 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/poi/wmsModal/wms-modal.module.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/poi/wmsModal/wms-modal.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('wmsModal', []); +//# sourceMappingURL=wms-modal.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/poi/wmsModal/wms-modal.module.js.map b/app/components/kommonitorUserInterface/kommonitorControls/poi/wmsModal/wms-modal.module.js.map new file mode 100644 index 000000000..f765a1300 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/poi/wmsModal/wms-modal.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"wms-modal.module.js","sourceRoot":"","sources":["wms-modal.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/poi/wmsModal/wms-modal.module.ts b/app/components/kommonitorUserInterface/kommonitorControls/poi/wmsModal/wms-modal.module.ts new file mode 100644 index 000000000..fdcf39c8c --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/poi/wmsModal/wms-modal.module.ts @@ -0,0 +1 @@ +angular.module('wmsModal', []); diff --git a/app/components/kommonitorUserInterface/kommonitorControls/regressionDiagram/regression-diagram.component.js b/app/components/kommonitorUserInterface/kommonitorControls/regressionDiagram/regression-diagram.component.js index 7418e3107..7660a9257 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/regressionDiagram/regression-diagram.component.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/regressionDiagram/regression-diagram.component.js @@ -1,774 +1,635 @@ +"use strict"; angular - .module('regressionDiagram') - .component( - 'regressionDiagram', - { - templateUrl : "components/kommonitorUserInterface/kommonitorControls/regressionDiagram/regression-diagram.template.html", - - controller : [ - 'kommonitorDataExchangeService', 'kommonitorDiagramHelperService', 'kommonitorFilterHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', - function indicatorRadarController( - kommonitorDataExchangeService, kommonitorDiagramHelperService, kommonitorFilterHelperService, $scope, $rootScope, $http, __env, $timeout) { - /* - * reference to kommonitorDataExchangeService instances - */ - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - this.kommonitorDiagramHelperServiceInstance = kommonitorDiagramHelperService; - - var self = this; - - $scope.activeTab = 0; - - // initialize any adminLTE box widgets - $('.box').boxWidget(); - - $(window).on('resize', function(){ - if($scope.regressionChart != null && $scope.regressionChart != undefined){ - $scope.regressionChart.resize(); - } - }); - - $scope.$on("resizeDiagrams", function (event) { - - setTimeout(function(){ - if($scope.regressionChart != null && $scope.regressionChart != undefined){ - $scope.regressionChart.resize(); - } - }, 350); - }); - - $scope.selection = {}; - $scope.selection.indicatorNameFilterForXAxis = undefined; - $scope.selection.indicatorNameFilterForYAxis = undefined; - - const DATE_PREFIX = __env.indicatorDatePrefix; - var numberOfDecimals = __env.numberOfDecimals; - const defaultColorForFilteredValues = __env.defaultColorForFilteredValues; - const defaultColorForZeroValues = __env.defaultColorForZeroValues; - const defaultColorForNoDataValues = __env.defaultColorForNoDataValues; - const defaultColorForHoveredFeatures = __env.defaultColorForHoveredFeatures; - const defaultColorForClickedFeatures = __env.defaultColorForClickedFeatures; - - const defaultColorForOutliers_high = __env.defaultColorForOutliers_high; - const defaultBorderColorForOutliers_high = __env.defaultBorderColorForOutliers_high; - const defaultFillOpacityForOutliers_high = __env.defaultFillOpacityForOutliers_high; - const defaultColorForOutliers_low = __env.defaultColorForOutliers_low; - const defaultBorderColorForOutliers_low = __env.defaultBorderColorForOutliers_low; - const defaultFillOpacityForOutliers_low = __env.defaultFillOpacityForOutliers_low; - - $scope.setupCompleted = true; - - //$scope.allIndicatorProperties; - $scope.selection.selectedIndicatorForXAxis; - $scope.selection.selectedIndicatorForXAxis_backup; - $scope.selection.selectedIndicatorForYAxis; - $scope.selection.selectedIndicatorForYAxis_backup; - $scope.correlation; - $scope.linearRegression; - $scope.regressionOption; - $scope.regressionChart; - $scope.data; - $scope.dataWithLabels; - $scope.eventsRegistered = false; - // $scope.userHoveresOverItem = false; - - $scope.sortedIndicatorProps; - $scope.spatialUnitName; - $scope.date; - - $scope.filterIndicators = function() { - - return kommonitorDataExchangeService.filterIndicators(); - }; - - $scope.filterIndicatorsBySpatialUnitAndDate = function() { - return async function( item ) { - // - // await wait(2000); - - if(item.applicableSpatialUnits.some(o => o.spatialUnitName == kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel)){ - return item.applicableDates.includes(kommonitorDataExchangeService.selectedDate); - } - else{ - return false; - } - - }; - }; - - var wait = ms => new Promise((r, j)=>setTimeout(r, ms)); - - $scope.$on("allIndicatorPropertiesForCurrentSpatialUnitAndTime setup begin", async function (event) { - - await wait(130); - $scope.setupCompleted = false; - - - $timeout(function(){ - $scope.$digest(); - }, 500); - - }); - - $scope.$on("allIndicatorPropertiesForCurrentSpatialUnitAndTime setup completed", async function (event) { - - await wait(100); - - $timeout(function(){ - $scope.setupCompleted = true; - $scope.$digest(); - $scope.onChangeSelectedIndicators(); - }, 500); - - }); - - $scope.onChangeSelectedDate = function(input){ - $scope.onChangeSelectedIndicators(); - }; - - $scope.onChangeFilterSameUnitAndSameTime = function(){ - if($scope.regressionChart){ - $scope.regressionChart.dispose(); - $scope.regressionChart = echarts.init(document.getElementById('regressionDiagram')); - } - kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime = []; - - kommonitorDiagramHelperService.setupIndicatorPropertiesForCurrentSpatialUnitAndTime(kommonitorDiagramHelperService.filterSameUnitAndSameTime); - }; - - $scope.$on("updateDiagrams", function (event, indicatorMetadataAndGeoJSON, spatialUnitName, spatialUnitId, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue, justRestyling) { - - $scope.correlation = undefined; - $scope.linearRegression = undefined; - $scope.regressionOption = undefined; - $scope.sortedIndicatorProps = undefined; - $scope.data = undefined; - $scope.dataWithLabels = undefined; - $scope.eventsRegistered = false; - // $scope.userHoveresOverItem = false; - $scope.indicatorPropertyName = DATE_PREFIX + kommonitorDataExchangeService.selectedDate; - $scope.spatialUnitName = spatialUnitName; - $scope.date = date; - $scope.indicatorMetadataAndGeoJSON = indicatorMetadataAndGeoJSON; - $scope.defaultBrew = defaultBrew; - $scope.gtMeasureOfValueBrew = gtMeasureOfValueBrew; - $scope.ltMeasureOfValueBrew = ltMeasureOfValueBrew; - $scope.dynamicIncreaseBrew = dynamicIncreaseBrew; - $scope.dynamicDecreaseBrew = dynamicDecreaseBrew; - $scope.isMeasureOfValueChecked = isMeasureOfValueChecked; - $scope.measureOfValue = measureOfValue; - - if(justRestyling){ - $scope.onChangeSelectedIndicators(); - } - else{ - if($scope.regressionChart){ - $scope.regressionChart.dispose(); - $scope.regressionChart = undefined; - } - - $scope.setupCompleted = false; - - $scope.selection.selectedIndicatorForXAxis = undefined; - $scope.selection.selectedIndicatorForYAxis = undefined; - - $timeout(function () { - $("option").each(function (index, element) { - var text = $(element).text(); - $(element).attr("title", text); - }); - }); - - } - - $scope.activeTab = 0; - if(kommonitorDataExchangeService.selectedIndicator.creationType == "COMPUTATION"){ - $scope.activeTab = 1; - } - if(kommonitorDataExchangeService.selectedIndicator.isHeadlineIndicator){ - $scope.activeTab = 2; - } - $timeout(function(){ - $scope.onChangeSelectedIndicators(); - }, 500); - - }); - - $scope.$on("updateDiagramsForHoveredFeature", function (event, featureProperties) { - - if(!$scope.regressionChart){ - return; - } - - // if($scope.userHoveresOverItem){ - // return; - // } - - var index = -1; - for(var i=0; i<$scope.regressionOption.series[0].data.length; i++){ - if($scope.regressionOption.series[0].data[i].name == featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]){ - index = i; - break; - } - } - - if(index > -1){ - $scope.regressionChart.dispatchAction({ - type: 'highlight', - seriesIndex: 0, - dataIndex: index - }); - // tooltip - $scope.regressionChart.dispatchAction({ - type: 'showTip', - seriesIndex: 0, - dataIndex: index - }); - } - }); - - $scope.$on("updateDiagramsForUnhoveredFeature", function (event, featureProperties) { - - if(!$scope.regressionChart){ - return; - } - - if(! kommonitorFilterHelperService.featureIsCurrentlySelected(featureProperties[__env.FEATURE_ID_PROPERTY_NAME])){ - // highlight the corresponding bar diagram item - var index = -1; - for(var i=0; i<$scope.regressionOption.series[0].data.length; i++){ - if($scope.regressionOption.series[0].data[i].name == featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]){ - index = i; - break; - } - } - - if(index > -1){ - $scope.regressionChart.dispatchAction({ - type: 'downplay', - seriesIndex: 0, - dataIndex: index - }); - // tooltip - $scope.regressionChart.dispatchAction({ - type: 'hideTip', - seriesIndex: 0, - dataIndex: index - }); - } - } - }); - - - - $scope.getAllIndicatorPropertiesSortedBySpatialUnitFeatureName = function(){ - for(var i=0; i nameB) { - return 1; - } - - // names are equal - return 0; - }); - } - - return kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime; - }; - - $scope.getPropertiesForIndicatorName = async function(indicatorName){ - for (var [index, indicator] of kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime.entries()){ - if(indicator.indicatorMetadata.indicatorName == indicatorName){ - await kommonitorDiagramHelperService.fetchIndicatorPropertiesIfNotExists(index); - - // var closestApplicableTimestamp = kommonitorDiagramHelperService.findClostestTimestamForTargetDate(indicator, kommonitorDataExchangeService.selectedDate); - // indicator.closestTimestamp = closestApplicableTimestamp; - - return indicator.indicatorProperties; - } - } - }; - - var getColor = function(featureName){ - - var color; - - for (var index=0; index<$scope.indicatorMetadataAndGeoJSON.geoJSON.features.length; index++){ - var feature = $scope.indicatorMetadataAndGeoJSON.geoJSON.features[index]; - if (feature.properties[__env.FEATURE_NAME_PROPERTY_NAME] == featureName){ - color = kommonitorDiagramHelperService.getColorForFeature(feature, $scope.indicatorMetadataAndGeoJSON, $scope.indicatorPropertyName, $scope.defaultBrew, $scope.gtMeasureOfValueBrew, $scope.ltMeasureOfValueBrew, $scope.dynamicIncreaseBrew, $scope.dynamicDecreaseBrew, $scope.isMeasureOfValueChecked, $scope.measureOfValue); - break; - } - } - - return color; - }; - - function mapRegressionData(indicatorPropertiesArray, timestamp, map, axisValueName){ - - for (const indicatorPropertiesEntry of indicatorPropertiesArray) { - let featureName = indicatorPropertiesEntry[__env.FEATURE_NAME_PROPERTY_NAME]; - let indicatorValue; - - if (kommonitorDataExchangeService.indicatorValueIsNoData(indicatorPropertiesEntry[DATE_PREFIX + timestamp])){ - indicatorValue = null; - } - else{ - indicatorValue = kommonitorDataExchangeService.getIndicatorValue_asNumber(indicatorPropertiesEntry[DATE_PREFIX + timestamp]); - } - - if(map.has(featureName)){ - let oldObject = map.get(featureName); - oldObject[axisValueName] = indicatorValue; - map.set(featureName, oldObject); - } - else{ - let color = getColor(featureName); - let regressionObject = { - name: featureName, - itemStyle: { - color: color - } - }; - - regressionObject[axisValueName] = indicatorValue; - map.set(featureName, regressionObject); - } - - } - - return map; - } - - $scope.buildDataArrayForSelectedIndicators = async function(){ - $scope.data = new Array(); - $scope.dataWithLabels = new Array(); - - var indicatorPropertiesArrayForXAxis = await $scope.getPropertiesForIndicatorName($scope.selection.selectedIndicatorForXAxis.indicatorMetadata.indicatorName); - var indicatorPropertiesArrayForYAxis = await $scope.getPropertiesForIndicatorName($scope.selection.selectedIndicatorForYAxis.indicatorMetadata.indicatorName); - - if(kommonitorFilterHelperService.completelyRemoveFilteredFeaturesFromDisplay && kommonitorFilterHelperService.filteredIndicatorFeatureIds.size > 0){ - indicatorPropertiesArrayForXAxis = indicatorPropertiesArrayForXAxis.filter(featureProperties => ! kommonitorFilterHelperService.featureIsCurrentlyFiltered(featureProperties[__env.FEATURE_ID_PROPERTY_NAME])); - indicatorPropertiesArrayForYAxis = indicatorPropertiesArrayForYAxis.filter(featureProperties => ! kommonitorFilterHelperService.featureIsCurrentlyFiltered(featureProperties[__env.FEATURE_ID_PROPERTY_NAME])); - } - - - var timestamp_xAxis = $scope.selection.selectedIndicatorForXAxis.selectedDate; - var timestamp_yAxis = $scope.selection.selectedIndicatorForYAxis.selectedDate; - - /* - consider several cases - across data timestamps or whole features might not exist - --> cope with that and only preserve those result objects that have both timestamp values - for x and y axis - */ - - // store data in a map to check above prerequesits - // key = ID, - // value = regressionObject = { - // name: featureName, - // itemStyle: { - // color: color - // }, - // xAxisName: indicatorValue_x, - // yAxisName: indicatorValue_y - //} - let xAxisName = "xValue"; - let yAxisName = "yValue"; - let dataCandidateMap = mapRegressionData(indicatorPropertiesArrayForXAxis, timestamp_xAxis, new Map(), xAxisName); - dataCandidateMap = mapRegressionData(indicatorPropertiesArrayForYAxis, timestamp_yAxis, dataCandidateMap, yAxisName); - - // now iterate over map and identify those objects that have both indicator axis values set - // put those into resulting lists - - dataCandidateMap.forEach(function(regressionObject, key, map){ - // $scope.data.push([xAxisDataElement, yAxisDataElement]) - if (regressionObject[xAxisName] && regressionObject[yAxisName]){ - $scope.data.push([regressionObject[xAxisName], regressionObject[yAxisName]]); - - regressionObject.value = [regressionObject[xAxisName], regressionObject[yAxisName]]; - - $scope.dataWithLabels.push( - regressionObject - ); - } - }); - - return $scope.data; - }; - - /* - * Source: http://stevegardner.net/2012/06/11/javascript-code-to-calculate-the-pearson-correlation-coefficient/ - */ - function getPearsonCorrelation(x, y) { - var shortestArrayLength = 0; - - if(x.length == y.length) { - shortestArrayLength = x.length; - } else if(x.length > y.length) { - shortestArrayLength = y.length; - console.error('x has more items in it, the last ' + (x.length - shortestArrayLength) + ' item(s) will be ignored'); - } else { - shortestArrayLength = x.length; - console.error('y has more items in it, the last ' + (y.length - shortestArrayLength) + ' item(s) will be ignored'); - } - - var x_numeric = []; - var y_numeric = []; - var xy = []; - var x2 = []; - var y2 = []; - - for(var i=0; i"; - - string += $scope.selection.selectedIndicatorForXAxis.indicatorMetadata.indicatorName + ": " + kommonitorDataExchangeService.getIndicatorValue_asFormattedText(params.value[0]) + " [" + $scope.selection.selectedIndicatorForXAxis.indicatorMetadata.unit + "]
        "; - string += $scope.selection.selectedIndicatorForYAxis.indicatorMetadata.indicatorName + ": " + kommonitorDataExchangeService.getIndicatorValue_asFormattedText(params.value[1]) + " [" + $scope.selection.selectedIndicatorForYAxis.indicatorMetadata.unit + "]
        "; - return string; - } - }, - xAxis: { - name: kommonitorDataExchangeService.formatIndicatorNameForLabel($scope.selection.selectedIndicatorForXAxis.indicatorMetadata.indicatorName + " - " + $scope.selection.selectedIndicatorForXAxis.selectedDate + " [" + $scope.selection.selectedIndicatorForXAxis.indicatorMetadata.unit + "]", 100), - nameLocation: 'center', - nameGap: 22, - scale: true, - type: 'value', - splitLine: { - lineStyle: { - type: 'dashed' - } - }, - }, - yAxis: { - name: kommonitorDataExchangeService.formatIndicatorNameForLabel($scope.selection.selectedIndicatorForYAxis.indicatorMetadata.indicatorName + " - " + $scope.selection.selectedIndicatorForYAxis.selectedDate + " [" + $scope.selection.selectedIndicatorForYAxis.indicatorMetadata.unit + "]", 75), - nameLocation: 'center', - nameGap: 50, - type: 'value', - splitLine: { - lineStyle: { - type: 'dashed' - } - }, - }, - toolbox: { - show : true, - right: '15', - feature : { - // mark : {show: true}, - dataView : {show: kommonitorDataExchangeService.showDiagramExportButtons, readOnly: true, title: "Datenansicht", lang: ['Datenansicht - lineare Regression', 'schließen', 'refresh'], optionToContent: function(opt){ - - // - // - // - // - // - // - // - // - // - // - // - // - // - //
        Indikator-NameBeschreibung der Verknüpfung
        {{indicator.referencedIndicatorName}}{{indicator.referencedIndicatorDescription}}
        - - // has properties "name" and "value" - // value: [Number(xAxisDataElement.toFixed(4)), Number(yAxisDataElement.toFixed(4))] - var scatterSeries = opt.series[0].data; - var lineSeries = opt.series[1].data; - - var dataTableId = "regressionDataTable"; - var tableExportName = opt.title[0].text + " - Scatter Table"; - - var htmlString = "

        Data View enthält zwei nachstehende Tabellen, die Tabelle des Scatter Plots und die Tabelle der Punkte der Regressionsgeraden.


        "; - htmlString += '

        Scatter Plot Tabelle

        '; - htmlString += ''; - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - - htmlString += ""; - htmlString += ""; - - htmlString += ""; - - for (var j=0; j"; - - htmlString += ""; - htmlString += ""; - htmlString += ""; - } - - htmlString += ""; - htmlString += "
        Feature-Name" + opt.xAxis[0].name + "" + opt.yAxis[0].name + "
        " + kommonitorDataExchangeService.getIndicatorValue_asNumber(scatterSeries[j].value[0]) + "" + kommonitorDataExchangeService.getIndicatorValue_asNumber(scatterSeries[j].value[1]) + "
        "; - - var lineTableId = "lineDataTable"; - var lineTableExportName = opt.title[0].text + " - Line Table"; - - htmlString += "

        Referenzpunkte der Regressionsgraden '" + $scope.linearRegression.expression + "'

        "; - - htmlString += ''; - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - - htmlString += ""; - - for (var j=0; j"; - htmlString += ""; - htmlString += ""; - } - - htmlString += ""; - htmlString += "
        XY
        " + kommonitorDataExchangeService.getIndicatorValue_asNumber(lineSeries[j][1]) + "
        "; - - $rootScope.$broadcast("AppendExportButtonsForTable", dataTableId, tableExportName); - $rootScope.$broadcast("AppendExportButtonsForTable", lineTableId, lineTableExportName); - - return htmlString; - }}, - restore : {show: false, title: "Erneuern"}, - saveAsImage : {show: true, title: "Export", pixelRatio: 4} - } - }, - series: [{ - name: "scatter", - type: 'scatter', - // label: { - // emphasis: { - // show: false, - // position: 'left', - // textStyle: { - // color: 'blue', - // fontSize: 16 - // } - // } - // }, - itemStyle: { - borderWidth: 1, - borderColor: 'black' - }, - emphasis: { - itemStyle: { - borderWidth: 4, - borderColor: defaultColorForClickedFeatures - } - }, - data: $scope.dataWithLabels - }, { - name: 'line', - type: 'line', - showSymbol: false, - data: $scope.linearRegression.points, - markPoint: { - itemStyle: { - normal: { - color: 'transparent' - } - }, - label: { - normal: { - show: true, - position: 'left', - formatter: $scope.linearRegression.expression, - textStyle: { - color: '#333', - fontSize: 14 - } - } - }, - data: [{ - coord: $scope.linearRegression.points[$scope.linearRegression.points.length - 1] - }] - } - }] - }; - - - $scope.regressionChart.setOption($scope.regressionOption); - - await $scope.regressionChart.hideLoading(); - setTimeout(function(){ - $scope.regressionChart.resize(); - }, 350); - - registerEventsIfNecessary(); - - $rootScope.$broadcast("preserveHighlightedFeatures"); - - $timeout(function(){ - $scope.$digest(); - }, 500); - } - }; - - function registerEventsIfNecessary(){ - if(!$scope.eventsRegistered){ - // when hovering over elements of the chart then highlight them in the map. - $scope.regressionChart.on('mouseOver', function(params){ - // $scope.userHoveresOverItem = true; - var spatialFeatureName = params.data.name; - // console.log(spatialFeatureName); - if(spatialFeatureName){ - $rootScope.$broadcast("highlightFeatureOnMap", spatialFeatureName); - } - - }); - - $scope.regressionChart.on('mouseOut', function(params){ - // $scope.userHoveresOverItem = false; - - var spatialFeatureName = params.data.name; - // console.log(spatialFeatureName); - if(spatialFeatureName){ - $rootScope.$broadcast("unhighlightFeatureOnMap", spatialFeatureName); - } - }); - - $scope.regressionChart.on('click', function(params){ - var spatialFeatureName = params.data.name; - // console.log(spatialFeatureName); - if(spatialFeatureName){ - $rootScope.$broadcast("switchHighlightFeatureOnMap", spatialFeatureName); - } - - }); - - $scope.eventsRegistered = true; - } - }; - - - } ] - }); + .module('regressionDiagram') + .component('regressionDiagram', { + templateUrl: "components/kommonitorUserInterface/kommonitorControls/regressionDiagram/regression-diagram.template.html", + controller: [ + 'kommonitorDataExchangeService', 'kommonitorDiagramHelperService', 'kommonitorFilterHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + function indicatorRadarController(kommonitorDataExchangeService, kommonitorDiagramHelperService, kommonitorFilterHelperService, $scope, $rootScope, $http, __env, $timeout) { + /* + * reference to kommonitorDataExchangeService instances + */ + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorDiagramHelperServiceInstance = kommonitorDiagramHelperService; + var self = this; + $scope.activeTab = 0; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + $(window).on('resize', function () { + if ($scope.regressionChart != null && $scope.regressionChart != undefined) { + $scope.regressionChart.resize(); + } + }); + $scope.$on("resizeDiagrams", function (event) { + setTimeout(function () { + if ($scope.regressionChart != null && $scope.regressionChart != undefined) { + $scope.regressionChart.resize(); + } + }, 350); + }); + $scope.selection = {}; + $scope.selection.indicatorNameFilterForXAxis = undefined; + $scope.selection.indicatorNameFilterForYAxis = undefined; + const DATE_PREFIX = __env.indicatorDatePrefix; + var numberOfDecimals = __env.numberOfDecimals; + const defaultColorForFilteredValues = __env.defaultColorForFilteredValues; + const defaultColorForZeroValues = __env.defaultColorForZeroValues; + const defaultColorForNoDataValues = __env.defaultColorForNoDataValues; + const defaultColorForHoveredFeatures = __env.defaultColorForHoveredFeatures; + const defaultColorForClickedFeatures = __env.defaultColorForClickedFeatures; + const defaultColorForOutliers_high = __env.defaultColorForOutliers_high; + const defaultBorderColorForOutliers_high = __env.defaultBorderColorForOutliers_high; + const defaultFillOpacityForOutliers_high = __env.defaultFillOpacityForOutliers_high; + const defaultColorForOutliers_low = __env.defaultColorForOutliers_low; + const defaultBorderColorForOutliers_low = __env.defaultBorderColorForOutliers_low; + const defaultFillOpacityForOutliers_low = __env.defaultFillOpacityForOutliers_low; + $scope.setupCompleted = true; + //$scope.allIndicatorProperties; + $scope.selection.selectedIndicatorForXAxis; + $scope.selection.selectedIndicatorForXAxis_backup; + $scope.selection.selectedIndicatorForYAxis; + $scope.selection.selectedIndicatorForYAxis_backup; + $scope.correlation; + $scope.linearRegression; + $scope.regressionOption; + $scope.regressionChart; + $scope.data; + $scope.dataWithLabels; + $scope.eventsRegistered = false; + // $scope.userHoveresOverItem = false; + $scope.sortedIndicatorProps; + $scope.spatialUnitName; + $scope.date; + $scope.filterIndicators = function () { + return kommonitorDataExchangeService.filterIndicators(); + }; + $scope.filterIndicatorsBySpatialUnitAndDate = function () { + return async function (item) { + // + // await wait(2000); + if (item.applicableSpatialUnits.some(o => o.spatialUnitName == kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel)) { + return item.applicableDates.includes(kommonitorDataExchangeService.selectedDate); + } + else { + return false; + } + }; + }; + var wait = ms => new Promise((r, j) => setTimeout(r, ms)); + $scope.$on("allIndicatorPropertiesForCurrentSpatialUnitAndTime setup begin", async function (event) { + await wait(130); + $scope.setupCompleted = false; + $timeout(function () { + $scope.$digest(); + }, 500); + }); + $scope.$on("allIndicatorPropertiesForCurrentSpatialUnitAndTime setup completed", async function (event) { + await wait(100); + $timeout(function () { + $scope.setupCompleted = true; + $scope.$digest(); + $scope.onChangeSelectedIndicators(); + }, 500); + }); + $scope.onChangeSelectedDate = function (input) { + $scope.onChangeSelectedIndicators(); + }; + $scope.onChangeFilterSameUnitAndSameTime = function () { + if ($scope.regressionChart) { + $scope.regressionChart.dispose(); + $scope.regressionChart = echarts.init(document.getElementById('regressionDiagram')); + } + kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime = []; + kommonitorDiagramHelperService.setupIndicatorPropertiesForCurrentSpatialUnitAndTime(kommonitorDiagramHelperService.filterSameUnitAndSameTime); + }; + $scope.$on("updateDiagrams", function (event, indicatorMetadataAndGeoJSON, spatialUnitName, spatialUnitId, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue, justRestyling) { + $scope.correlation = undefined; + $scope.linearRegression = undefined; + $scope.regressionOption = undefined; + $scope.sortedIndicatorProps = undefined; + $scope.data = undefined; + $scope.dataWithLabels = undefined; + $scope.eventsRegistered = false; + // $scope.userHoveresOverItem = false; + $scope.indicatorPropertyName = DATE_PREFIX + kommonitorDataExchangeService.selectedDate; + $scope.spatialUnitName = spatialUnitName; + $scope.date = date; + $scope.indicatorMetadataAndGeoJSON = indicatorMetadataAndGeoJSON; + $scope.defaultBrew = defaultBrew; + $scope.gtMeasureOfValueBrew = gtMeasureOfValueBrew; + $scope.ltMeasureOfValueBrew = ltMeasureOfValueBrew; + $scope.dynamicIncreaseBrew = dynamicIncreaseBrew; + $scope.dynamicDecreaseBrew = dynamicDecreaseBrew; + $scope.isMeasureOfValueChecked = isMeasureOfValueChecked; + $scope.measureOfValue = measureOfValue; + if (justRestyling) { + $scope.onChangeSelectedIndicators(); + } + else { + if ($scope.regressionChart) { + $scope.regressionChart.dispose(); + $scope.regressionChart = undefined; + } + $scope.setupCompleted = false; + $scope.selection.selectedIndicatorForXAxis = undefined; + $scope.selection.selectedIndicatorForYAxis = undefined; + $timeout(function () { + $("option").each(function (index, element) { + var text = $(element).text(); + $(element).attr("title", text); + }); + }); + } + $scope.activeTab = 0; + if (kommonitorDataExchangeService.selectedIndicator.creationType == "COMPUTATION") { + $scope.activeTab = 1; + } + if (kommonitorDataExchangeService.selectedIndicator.isHeadlineIndicator) { + $scope.activeTab = 2; + } + $timeout(function () { + $scope.onChangeSelectedIndicators(); + }, 500); + }); + $scope.$on("updateDiagramsForHoveredFeature", function (event, featureProperties) { + if (!$scope.regressionChart) { + return; + } + // if($scope.userHoveresOverItem){ + // return; + // } + var index = -1; + for (var i = 0; i < $scope.regressionOption.series[0].data.length; i++) { + if ($scope.regressionOption.series[0].data[i].name == featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]) { + index = i; + break; + } + } + if (index > -1) { + $scope.regressionChart.dispatchAction({ + type: 'highlight', + seriesIndex: 0, + dataIndex: index + }); + // tooltip + $scope.regressionChart.dispatchAction({ + type: 'showTip', + seriesIndex: 0, + dataIndex: index + }); + } + }); + $scope.$on("updateDiagramsForUnhoveredFeature", function (event, featureProperties) { + if (!$scope.regressionChart) { + return; + } + if (!kommonitorFilterHelperService.featureIsCurrentlySelected(featureProperties[__env.FEATURE_ID_PROPERTY_NAME])) { + // highlight the corresponding bar diagram item + var index = -1; + for (var i = 0; i < $scope.regressionOption.series[0].data.length; i++) { + if ($scope.regressionOption.series[0].data[i].name == featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]) { + index = i; + break; + } + } + if (index > -1) { + $scope.regressionChart.dispatchAction({ + type: 'downplay', + seriesIndex: 0, + dataIndex: index + }); + // tooltip + $scope.regressionChart.dispatchAction({ + type: 'hideTip', + seriesIndex: 0, + dataIndex: index + }); + } + } + }); + $scope.getAllIndicatorPropertiesSortedBySpatialUnitFeatureName = function () { + for (var i = 0; i < kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime.length; i++) { + // make object to hold indicatorName, max value and average value + kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime[i].indicatorProperties.sort(function (a, b) { + // a and b are arrays of indicatorProperties for all features of the selected spatialUnit. We sort them by their property "spatialUnitFeatureName" + var nameA = a[__env.FEATURE_NAME_PROPERTY_NAME].toUpperCase(); // ignore upper and lowercase + var nameB = b[__env.FEATURE_NAME_PROPERTY_NAME].toUpperCase(); // ignore upper and lowercase + if (nameA < nameB) { + return -1; + } + if (nameA > nameB) { + return 1; + } + // names are equal + return 0; + }); + } + return kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime; + }; + $scope.getPropertiesForIndicatorName = async function (indicatorName) { + for (var [index, indicator] of kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime.entries()) { + if (indicator.indicatorMetadata.indicatorName == indicatorName) { + await kommonitorDiagramHelperService.fetchIndicatorPropertiesIfNotExists(index); + // var closestApplicableTimestamp = kommonitorDiagramHelperService.findClostestTimestamForTargetDate(indicator, kommonitorDataExchangeService.selectedDate); + // indicator.closestTimestamp = closestApplicableTimestamp; + return indicator.indicatorProperties; + } + } + }; + var getColor = function (featureName) { + var color; + for (var index = 0; index < $scope.indicatorMetadataAndGeoJSON.geoJSON.features.length; index++) { + var feature = $scope.indicatorMetadataAndGeoJSON.geoJSON.features[index]; + if (feature.properties[__env.FEATURE_NAME_PROPERTY_NAME] == featureName) { + color = kommonitorDiagramHelperService.getColorForFeature(feature, $scope.indicatorMetadataAndGeoJSON, $scope.indicatorPropertyName, $scope.defaultBrew, $scope.gtMeasureOfValueBrew, $scope.ltMeasureOfValueBrew, $scope.dynamicIncreaseBrew, $scope.dynamicDecreaseBrew, $scope.isMeasureOfValueChecked, $scope.measureOfValue); + break; + } + } + return color; + }; + function mapRegressionData(indicatorPropertiesArray, timestamp, map, axisValueName) { + for (const indicatorPropertiesEntry of indicatorPropertiesArray) { + let featureName = indicatorPropertiesEntry[__env.FEATURE_NAME_PROPERTY_NAME]; + let indicatorValue; + if (kommonitorDataExchangeService.indicatorValueIsNoData(indicatorPropertiesEntry[DATE_PREFIX + timestamp])) { + indicatorValue = null; + } + else { + indicatorValue = kommonitorDataExchangeService.getIndicatorValue_asNumber(indicatorPropertiesEntry[DATE_PREFIX + timestamp]); + } + if (map.has(featureName)) { + let oldObject = map.get(featureName); + oldObject[axisValueName] = indicatorValue; + map.set(featureName, oldObject); + } + else { + let color = getColor(featureName); + let regressionObject = { + name: featureName, + itemStyle: { + color: color + } + }; + regressionObject[axisValueName] = indicatorValue; + map.set(featureName, regressionObject); + } + } + return map; + } + $scope.buildDataArrayForSelectedIndicators = async function () { + $scope.data = new Array(); + $scope.dataWithLabels = new Array(); + var indicatorPropertiesArrayForXAxis = await $scope.getPropertiesForIndicatorName($scope.selection.selectedIndicatorForXAxis.indicatorMetadata.indicatorName); + var indicatorPropertiesArrayForYAxis = await $scope.getPropertiesForIndicatorName($scope.selection.selectedIndicatorForYAxis.indicatorMetadata.indicatorName); + if (kommonitorFilterHelperService.completelyRemoveFilteredFeaturesFromDisplay && kommonitorFilterHelperService.filteredIndicatorFeatureIds.size > 0) { + indicatorPropertiesArrayForXAxis = indicatorPropertiesArrayForXAxis.filter(featureProperties => !kommonitorFilterHelperService.featureIsCurrentlyFiltered(featureProperties[__env.FEATURE_ID_PROPERTY_NAME])); + indicatorPropertiesArrayForYAxis = indicatorPropertiesArrayForYAxis.filter(featureProperties => !kommonitorFilterHelperService.featureIsCurrentlyFiltered(featureProperties[__env.FEATURE_ID_PROPERTY_NAME])); + } + var timestamp_xAxis = $scope.selection.selectedIndicatorForXAxis.selectedDate; + var timestamp_yAxis = $scope.selection.selectedIndicatorForYAxis.selectedDate; + /* + consider several cases + across data timestamps or whole features might not exist + --> cope with that and only preserve those result objects that have both timestamp values + for x and y axis + */ + // store data in a map to check above prerequesits + // key = ID, + // value = regressionObject = { + // name: featureName, + // itemStyle: { + // color: color + // }, + // xAxisName: indicatorValue_x, + // yAxisName: indicatorValue_y + //} + let xAxisName = "xValue"; + let yAxisName = "yValue"; + let dataCandidateMap = mapRegressionData(indicatorPropertiesArrayForXAxis, timestamp_xAxis, new Map(), xAxisName); + dataCandidateMap = mapRegressionData(indicatorPropertiesArrayForYAxis, timestamp_yAxis, dataCandidateMap, yAxisName); + // now iterate over map and identify those objects that have both indicator axis values set + // put those into resulting lists + dataCandidateMap.forEach(function (regressionObject, key, map) { + // $scope.data.push([xAxisDataElement, yAxisDataElement]) + if (regressionObject[xAxisName] && regressionObject[yAxisName]) { + $scope.data.push([regressionObject[xAxisName], regressionObject[yAxisName]]); + regressionObject.value = [regressionObject[xAxisName], regressionObject[yAxisName]]; + $scope.dataWithLabels.push(regressionObject); + } + }); + return $scope.data; + }; + /* + * Source: http://stevegardner.net/2012/06/11/javascript-code-to-calculate-the-pearson-correlation-coefficient/ + */ + function getPearsonCorrelation(x, y) { + var shortestArrayLength = 0; + if (x.length == y.length) { + shortestArrayLength = x.length; + } + else if (x.length > y.length) { + shortestArrayLength = y.length; + console.error('x has more items in it, the last ' + (x.length - shortestArrayLength) + ' item(s) will be ignored'); + } + else { + shortestArrayLength = x.length; + console.error('y has more items in it, the last ' + (y.length - shortestArrayLength) + ' item(s) will be ignored'); + } + var x_numeric = []; + var y_numeric = []; + var xy = []; + var x2 = []; + var y2 = []; + for (var i = 0; i < shortestArrayLength; i++) { + if (x[i] && y[i]) { + x_numeric.push(x[i]); + y_numeric.push(y[i]); + xy.push(x[i] * y[i]); + x2.push(x[i] * x[i]); + y2.push(y[i] * y[i]); + } + } + var sum_x = 0; + var sum_y = 0; + var sum_xy = 0; + var sum_x2 = 0; + var sum_y2 = 0; + for (var i = 0; i < x_numeric.length; i++) { + sum_x += x_numeric[i]; + sum_y += y_numeric[i]; + sum_xy += xy[i]; + sum_x2 += x2[i]; + sum_y2 += y2[i]; + } + var step1 = (shortestArrayLength * sum_xy) - (sum_x * sum_y); + var step2 = (shortestArrayLength * sum_x2) - (sum_x * sum_x); + var step3 = (shortestArrayLength * sum_y2) - (sum_y * sum_y); + var step4 = Math.sqrt(step2 * step3); + var answer = step1 / step4; + return Number(+answer.toFixed(2)); + } + $scope.calculatePearsonCorrelation = function (data) { + // data is an array of arrays containing the pairs of [x, y] + var xArray = new Array(); + var yArray = new Array(); + data.forEach(function (xyPair) { + xArray.push(xyPair[0]); + yArray.push(xyPair[1]); + }); + return getPearsonCorrelation(xArray, yArray); + }; + $scope.onChangeSelectedIndicators = async function () { + if ($scope.selection.selectedIndicatorForXAxis) { + $scope.selection.selectedIndicatorForXAxis_backup = $scope.selection.selectedIndicatorForXAxis; + } + else if ($scope.selection.selectedIndicatorForXAxis_backup) { + $scope.selection.selectedIndicatorForXAxis = $scope.selection.selectedIndicatorForXAxis_backup; + } + if ($scope.selection.selectedIndicatorForYAxis) { + $scope.selection.selectedIndicatorForYAxis_backup = $scope.selection.selectedIndicatorForYAxis; + } + else if ($scope.selection.selectedIndicatorForYAxis_backup) { + $scope.selection.selectedIndicatorForYAxis = $scope.selection.selectedIndicatorForYAxis_backup; + } + if ($scope.selection.selectedIndicatorForXAxis && $scope.selection.selectedIndicatorForYAxis) { + $scope.eventsRegistered = false; + if (!$scope.regressionChart) + $scope.regressionChart = echarts.init(document.getElementById('regressionDiagram')); + else { + // explicitly kill and reinstantiate histogram diagram to avoid zombie states on spatial unit change + $scope.regressionChart.dispose(); + $scope.regressionChart = echarts.init(document.getElementById('regressionDiagram')); + } + await $scope.regressionChart.showLoading(); + // if(!$scope.sortedIndicatorProps){ + // $scope.sortedIndicatorProps = $scope.getAllIndicatorPropertiesSortedBySpatialUnitFeatureName(); + // } + var data = await $scope.buildDataArrayForSelectedIndicators(); + data.sort(function (a, b) { + return a[0] - b[0]; + }); + $scope.correlation = $scope.calculatePearsonCorrelation(data); + $scope.linearRegression = ecStat.regression('linear', data); + $scope.regressionOption = { + grid: { + left: '10%', + top: 10, + right: '5%', + bottom: 55, + containLabel: true + }, + title: { + text: 'Lineare Regression - ' + $scope.spatialUnitName + ' - ' + $scope.date, + left: 'center', + show: false + }, + tooltip: { + trigger: 'item', + confine: 'true', + axisPointer: { + type: 'cross' + }, + formatter: function (params) { + if (!(params && params.value && params.value[0] && params.value[1])) { + return ""; + } + var string = "" + params.name + "
        "; + string += $scope.selection.selectedIndicatorForXAxis.indicatorMetadata.indicatorName + ": " + kommonitorDataExchangeService.getIndicatorValue_asFormattedText(params.value[0]) + " [" + $scope.selection.selectedIndicatorForXAxis.indicatorMetadata.unit + "]
        "; + string += $scope.selection.selectedIndicatorForYAxis.indicatorMetadata.indicatorName + ": " + kommonitorDataExchangeService.getIndicatorValue_asFormattedText(params.value[1]) + " [" + $scope.selection.selectedIndicatorForYAxis.indicatorMetadata.unit + "]
        "; + return string; + } + }, + xAxis: { + name: kommonitorDataExchangeService.formatIndicatorNameForLabel($scope.selection.selectedIndicatorForXAxis.indicatorMetadata.indicatorName + " - " + $scope.selection.selectedIndicatorForXAxis.selectedDate + " [" + $scope.selection.selectedIndicatorForXAxis.indicatorMetadata.unit + "]", 100), + nameLocation: 'center', + nameGap: 22, + scale: true, + type: 'value', + splitLine: { + lineStyle: { + type: 'dashed' + } + }, + }, + yAxis: { + name: kommonitorDataExchangeService.formatIndicatorNameForLabel($scope.selection.selectedIndicatorForYAxis.indicatorMetadata.indicatorName + " - " + $scope.selection.selectedIndicatorForYAxis.selectedDate + " [" + $scope.selection.selectedIndicatorForYAxis.indicatorMetadata.unit + "]", 75), + nameLocation: 'center', + nameGap: 50, + type: 'value', + splitLine: { + lineStyle: { + type: 'dashed' + } + }, + }, + toolbox: { + show: true, + right: '15', + feature: { + // mark : {show: true}, + dataView: { show: kommonitorDataExchangeService.showDiagramExportButtons, readOnly: true, title: "Datenansicht", lang: ['Datenansicht - lineare Regression', 'schließen', 'refresh'], optionToContent: function (opt) { + // + // + // + // + // + // + // + // + // + // + // + // + // + //
        Indikator-NameBeschreibung der Verknüpfung
        {{indicator.referencedIndicatorName}}{{indicator.referencedIndicatorDescription}}
        + // has properties "name" and "value" + // value: [Number(xAxisDataElement.toFixed(4)), Number(yAxisDataElement.toFixed(4))] + var scatterSeries = opt.series[0].data; + var lineSeries = opt.series[1].data; + var dataTableId = "regressionDataTable"; + var tableExportName = opt.title[0].text + " - Scatter Table"; + var htmlString = "

        Data View enthält zwei nachstehende Tabellen, die Tabelle des Scatter Plots und die Tabelle der Punkte der Regressionsgeraden.


        "; + htmlString += '

        Scatter Plot Tabelle

        '; + htmlString += ''; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + for (var j = 0; j < scatterSeries.length; j++) { + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + } + htmlString += ""; + htmlString += "
        Feature-Name" + opt.xAxis[0].name + "" + opt.yAxis[0].name + "
        " + scatterSeries[j].name + "" + kommonitorDataExchangeService.getIndicatorValue_asNumber(scatterSeries[j].value[0]) + "" + kommonitorDataExchangeService.getIndicatorValue_asNumber(scatterSeries[j].value[1]) + "
        "; + var lineTableId = "lineDataTable"; + var lineTableExportName = opt.title[0].text + " - Line Table"; + htmlString += "

        Referenzpunkte der Regressionsgraden '" + $scope.linearRegression.expression + "'

        "; + htmlString += ''; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + for (var j = 0; j < lineSeries.length; j++) { + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + } + htmlString += ""; + htmlString += "
        XY
        " + kommonitorDataExchangeService.getIndicatorValue_asNumber(lineSeries[j][0]) + "" + kommonitorDataExchangeService.getIndicatorValue_asNumber(lineSeries[j][1]) + "
        "; + $rootScope.$broadcast("AppendExportButtonsForTable", dataTableId, tableExportName); + $rootScope.$broadcast("AppendExportButtonsForTable", lineTableId, lineTableExportName); + return htmlString; + } }, + restore: { show: false, title: "Erneuern" }, + saveAsImage: { show: true, title: "Export", pixelRatio: 4 } + } + }, + series: [{ + name: "scatter", + type: 'scatter', + // label: { + // emphasis: { + // show: false, + // position: 'left', + // textStyle: { + // color: 'blue', + // fontSize: 16 + // } + // } + // }, + itemStyle: { + borderWidth: 1, + borderColor: 'black' + }, + emphasis: { + itemStyle: { + borderWidth: 4, + borderColor: defaultColorForClickedFeatures + } + }, + data: $scope.dataWithLabels + }, { + name: 'line', + type: 'line', + showSymbol: false, + data: $scope.linearRegression.points, + markPoint: { + itemStyle: { + normal: { + color: 'transparent' + } + }, + label: { + normal: { + show: true, + position: 'left', + formatter: $scope.linearRegression.expression, + textStyle: { + color: '#333', + fontSize: 14 + } + } + }, + data: [{ + coord: $scope.linearRegression.points[$scope.linearRegression.points.length - 1] + }] + } + }] + }; + $scope.regressionChart.setOption($scope.regressionOption); + await $scope.regressionChart.hideLoading(); + setTimeout(function () { + $scope.regressionChart.resize(); + }, 350); + registerEventsIfNecessary(); + $rootScope.$broadcast("preserveHighlightedFeatures"); + $timeout(function () { + $scope.$digest(); + }, 500); + } + }; + function registerEventsIfNecessary() { + if (!$scope.eventsRegistered) { + // when hovering over elements of the chart then highlight them in the map. + $scope.regressionChart.on('mouseOver', function (params) { + // $scope.userHoveresOverItem = true; + var spatialFeatureName = params.data.name; + // console.log(spatialFeatureName); + if (spatialFeatureName) { + $rootScope.$broadcast("highlightFeatureOnMap", spatialFeatureName); + } + }); + $scope.regressionChart.on('mouseOut', function (params) { + // $scope.userHoveresOverItem = false; + var spatialFeatureName = params.data.name; + // console.log(spatialFeatureName); + if (spatialFeatureName) { + $rootScope.$broadcast("unhighlightFeatureOnMap", spatialFeatureName); + } + }); + $scope.regressionChart.on('click', function (params) { + var spatialFeatureName = params.data.name; + // console.log(spatialFeatureName); + if (spatialFeatureName) { + $rootScope.$broadcast("switchHighlightFeatureOnMap", spatialFeatureName); + } + }); + $scope.eventsRegistered = true; + } + } + ; + } + ] +}); +//# sourceMappingURL=regression-diagram.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/regressionDiagram/regression-diagram.component.js.map b/app/components/kommonitorUserInterface/kommonitorControls/regressionDiagram/regression-diagram.component.js.map new file mode 100644 index 000000000..a9c0b3a17 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/regressionDiagram/regression-diagram.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"regression-diagram.component.js","sourceRoot":"","sources":["regression-diagram.component.ts"],"names":[],"mappings":";AAAA,OAAO;KACJ,MAAM,CAAC,mBAAmB,CAAC;KAC3B,SAAS,CACR,mBAAmB,EACnB;IACC,WAAW,EAAG,0GAA0G;IAExH,UAAU,EAAG;QACX,+BAA+B,EAAE,gCAAgC,EAAE,+BAA+B,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU;QACxJ,SAAS,wBAAwB,CAC/B,6BAA6B,EAAE,8BAA8B,EAAE,6BAA6B,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ;YACzI;;eAEG;YACH,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAC3E,IAAI,CAAC,sCAAsC,GAAG,8BAA8B,CAAC;YAE7E,IAAI,IAAI,GAAG,IAAI,CAAC;YAEhB,MAAM,CAAC,SAAS,GAAG,CAAC,CAAC;YAErB,sCAAsC;YACtC,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,CAAC;YAEtB,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE;gBACjB,IAAG,MAAM,CAAC,eAAe,IAAI,IAAI,IAAI,MAAM,CAAC,eAAe,IAAI,SAAS,EAAC;oBACrE,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC;iBACnC;YACL,CAAC,CAAC,CAAC;YAEL,MAAM,CAAC,GAAG,CAAC,gBAAgB,EAAE,UAAU,KAAK;gBAE3C,UAAU,CAAC;oBACV,IAAG,MAAM,CAAC,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C,CAAC;oBAEH,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,UAAS,MAAM;wBACjD,IAAI,kBAAkB,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;wBAC1C,mCAAmC;wBACnC,IAAG,kBAAkB,EAAC;4BACrB,UAAU,CAAC,UAAU,CAAC,6BAA6B,EAAE,kBAAkB,CAAC,CAAC;yBACzE;oBAEF,CAAC,CAAC,CAAC;oBAEH,MAAM,CAAC,gBAAgB,GAAG,IAAI,CAAC;iBAC/B;YACF,CAAC;YAAA,CAAC;QAGH,CAAC;KAAE;CACL,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/regressionDiagram/regression-diagram.component.ts b/app/components/kommonitorUserInterface/kommonitorControls/regressionDiagram/regression-diagram.component.ts new file mode 100644 index 000000000..7418e3107 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/regressionDiagram/regression-diagram.component.ts @@ -0,0 +1,774 @@ +angular + .module('regressionDiagram') + .component( + 'regressionDiagram', + { + templateUrl : "components/kommonitorUserInterface/kommonitorControls/regressionDiagram/regression-diagram.template.html", + + controller : [ + 'kommonitorDataExchangeService', 'kommonitorDiagramHelperService', 'kommonitorFilterHelperService', '$scope', '$rootScope', '$http', '__env', '$timeout', + function indicatorRadarController( + kommonitorDataExchangeService, kommonitorDiagramHelperService, kommonitorFilterHelperService, $scope, $rootScope, $http, __env, $timeout) { + /* + * reference to kommonitorDataExchangeService instances + */ + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.kommonitorDiagramHelperServiceInstance = kommonitorDiagramHelperService; + + var self = this; + + $scope.activeTab = 0; + + // initialize any adminLTE box widgets + $('.box').boxWidget(); + + $(window).on('resize', function(){ + if($scope.regressionChart != null && $scope.regressionChart != undefined){ + $scope.regressionChart.resize(); + } + }); + + $scope.$on("resizeDiagrams", function (event) { + + setTimeout(function(){ + if($scope.regressionChart != null && $scope.regressionChart != undefined){ + $scope.regressionChart.resize(); + } + }, 350); + }); + + $scope.selection = {}; + $scope.selection.indicatorNameFilterForXAxis = undefined; + $scope.selection.indicatorNameFilterForYAxis = undefined; + + const DATE_PREFIX = __env.indicatorDatePrefix; + var numberOfDecimals = __env.numberOfDecimals; + const defaultColorForFilteredValues = __env.defaultColorForFilteredValues; + const defaultColorForZeroValues = __env.defaultColorForZeroValues; + const defaultColorForNoDataValues = __env.defaultColorForNoDataValues; + const defaultColorForHoveredFeatures = __env.defaultColorForHoveredFeatures; + const defaultColorForClickedFeatures = __env.defaultColorForClickedFeatures; + + const defaultColorForOutliers_high = __env.defaultColorForOutliers_high; + const defaultBorderColorForOutliers_high = __env.defaultBorderColorForOutliers_high; + const defaultFillOpacityForOutliers_high = __env.defaultFillOpacityForOutliers_high; + const defaultColorForOutliers_low = __env.defaultColorForOutliers_low; + const defaultBorderColorForOutliers_low = __env.defaultBorderColorForOutliers_low; + const defaultFillOpacityForOutliers_low = __env.defaultFillOpacityForOutliers_low; + + $scope.setupCompleted = true; + + //$scope.allIndicatorProperties; + $scope.selection.selectedIndicatorForXAxis; + $scope.selection.selectedIndicatorForXAxis_backup; + $scope.selection.selectedIndicatorForYAxis; + $scope.selection.selectedIndicatorForYAxis_backup; + $scope.correlation; + $scope.linearRegression; + $scope.regressionOption; + $scope.regressionChart; + $scope.data; + $scope.dataWithLabels; + $scope.eventsRegistered = false; + // $scope.userHoveresOverItem = false; + + $scope.sortedIndicatorProps; + $scope.spatialUnitName; + $scope.date; + + $scope.filterIndicators = function() { + + return kommonitorDataExchangeService.filterIndicators(); + }; + + $scope.filterIndicatorsBySpatialUnitAndDate = function() { + return async function( item ) { + // + // await wait(2000); + + if(item.applicableSpatialUnits.some(o => o.spatialUnitName == kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel)){ + return item.applicableDates.includes(kommonitorDataExchangeService.selectedDate); + } + else{ + return false; + } + + }; + }; + + var wait = ms => new Promise((r, j)=>setTimeout(r, ms)); + + $scope.$on("allIndicatorPropertiesForCurrentSpatialUnitAndTime setup begin", async function (event) { + + await wait(130); + $scope.setupCompleted = false; + + + $timeout(function(){ + $scope.$digest(); + }, 500); + + }); + + $scope.$on("allIndicatorPropertiesForCurrentSpatialUnitAndTime setup completed", async function (event) { + + await wait(100); + + $timeout(function(){ + $scope.setupCompleted = true; + $scope.$digest(); + $scope.onChangeSelectedIndicators(); + }, 500); + + }); + + $scope.onChangeSelectedDate = function(input){ + $scope.onChangeSelectedIndicators(); + }; + + $scope.onChangeFilterSameUnitAndSameTime = function(){ + if($scope.regressionChart){ + $scope.regressionChart.dispose(); + $scope.regressionChart = echarts.init(document.getElementById('regressionDiagram')); + } + kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime = []; + + kommonitorDiagramHelperService.setupIndicatorPropertiesForCurrentSpatialUnitAndTime(kommonitorDiagramHelperService.filterSameUnitAndSameTime); + }; + + $scope.$on("updateDiagrams", function (event, indicatorMetadataAndGeoJSON, spatialUnitName, spatialUnitId, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue, justRestyling) { + + $scope.correlation = undefined; + $scope.linearRegression = undefined; + $scope.regressionOption = undefined; + $scope.sortedIndicatorProps = undefined; + $scope.data = undefined; + $scope.dataWithLabels = undefined; + $scope.eventsRegistered = false; + // $scope.userHoveresOverItem = false; + $scope.indicatorPropertyName = DATE_PREFIX + kommonitorDataExchangeService.selectedDate; + $scope.spatialUnitName = spatialUnitName; + $scope.date = date; + $scope.indicatorMetadataAndGeoJSON = indicatorMetadataAndGeoJSON; + $scope.defaultBrew = defaultBrew; + $scope.gtMeasureOfValueBrew = gtMeasureOfValueBrew; + $scope.ltMeasureOfValueBrew = ltMeasureOfValueBrew; + $scope.dynamicIncreaseBrew = dynamicIncreaseBrew; + $scope.dynamicDecreaseBrew = dynamicDecreaseBrew; + $scope.isMeasureOfValueChecked = isMeasureOfValueChecked; + $scope.measureOfValue = measureOfValue; + + if(justRestyling){ + $scope.onChangeSelectedIndicators(); + } + else{ + if($scope.regressionChart){ + $scope.regressionChart.dispose(); + $scope.regressionChart = undefined; + } + + $scope.setupCompleted = false; + + $scope.selection.selectedIndicatorForXAxis = undefined; + $scope.selection.selectedIndicatorForYAxis = undefined; + + $timeout(function () { + $("option").each(function (index, element) { + var text = $(element).text(); + $(element).attr("title", text); + }); + }); + + } + + $scope.activeTab = 0; + if(kommonitorDataExchangeService.selectedIndicator.creationType == "COMPUTATION"){ + $scope.activeTab = 1; + } + if(kommonitorDataExchangeService.selectedIndicator.isHeadlineIndicator){ + $scope.activeTab = 2; + } + $timeout(function(){ + $scope.onChangeSelectedIndicators(); + }, 500); + + }); + + $scope.$on("updateDiagramsForHoveredFeature", function (event, featureProperties) { + + if(!$scope.regressionChart){ + return; + } + + // if($scope.userHoveresOverItem){ + // return; + // } + + var index = -1; + for(var i=0; i<$scope.regressionOption.series[0].data.length; i++){ + if($scope.regressionOption.series[0].data[i].name == featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]){ + index = i; + break; + } + } + + if(index > -1){ + $scope.regressionChart.dispatchAction({ + type: 'highlight', + seriesIndex: 0, + dataIndex: index + }); + // tooltip + $scope.regressionChart.dispatchAction({ + type: 'showTip', + seriesIndex: 0, + dataIndex: index + }); + } + }); + + $scope.$on("updateDiagramsForUnhoveredFeature", function (event, featureProperties) { + + if(!$scope.regressionChart){ + return; + } + + if(! kommonitorFilterHelperService.featureIsCurrentlySelected(featureProperties[__env.FEATURE_ID_PROPERTY_NAME])){ + // highlight the corresponding bar diagram item + var index = -1; + for(var i=0; i<$scope.regressionOption.series[0].data.length; i++){ + if($scope.regressionOption.series[0].data[i].name == featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]){ + index = i; + break; + } + } + + if(index > -1){ + $scope.regressionChart.dispatchAction({ + type: 'downplay', + seriesIndex: 0, + dataIndex: index + }); + // tooltip + $scope.regressionChart.dispatchAction({ + type: 'hideTip', + seriesIndex: 0, + dataIndex: index + }); + } + } + }); + + + + $scope.getAllIndicatorPropertiesSortedBySpatialUnitFeatureName = function(){ + for(var i=0; i nameB) { + return 1; + } + + // names are equal + return 0; + }); + } + + return kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime; + }; + + $scope.getPropertiesForIndicatorName = async function(indicatorName){ + for (var [index, indicator] of kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime.entries()){ + if(indicator.indicatorMetadata.indicatorName == indicatorName){ + await kommonitorDiagramHelperService.fetchIndicatorPropertiesIfNotExists(index); + + // var closestApplicableTimestamp = kommonitorDiagramHelperService.findClostestTimestamForTargetDate(indicator, kommonitorDataExchangeService.selectedDate); + // indicator.closestTimestamp = closestApplicableTimestamp; + + return indicator.indicatorProperties; + } + } + }; + + var getColor = function(featureName){ + + var color; + + for (var index=0; index<$scope.indicatorMetadataAndGeoJSON.geoJSON.features.length; index++){ + var feature = $scope.indicatorMetadataAndGeoJSON.geoJSON.features[index]; + if (feature.properties[__env.FEATURE_NAME_PROPERTY_NAME] == featureName){ + color = kommonitorDiagramHelperService.getColorForFeature(feature, $scope.indicatorMetadataAndGeoJSON, $scope.indicatorPropertyName, $scope.defaultBrew, $scope.gtMeasureOfValueBrew, $scope.ltMeasureOfValueBrew, $scope.dynamicIncreaseBrew, $scope.dynamicDecreaseBrew, $scope.isMeasureOfValueChecked, $scope.measureOfValue); + break; + } + } + + return color; + }; + + function mapRegressionData(indicatorPropertiesArray, timestamp, map, axisValueName){ + + for (const indicatorPropertiesEntry of indicatorPropertiesArray) { + let featureName = indicatorPropertiesEntry[__env.FEATURE_NAME_PROPERTY_NAME]; + let indicatorValue; + + if (kommonitorDataExchangeService.indicatorValueIsNoData(indicatorPropertiesEntry[DATE_PREFIX + timestamp])){ + indicatorValue = null; + } + else{ + indicatorValue = kommonitorDataExchangeService.getIndicatorValue_asNumber(indicatorPropertiesEntry[DATE_PREFIX + timestamp]); + } + + if(map.has(featureName)){ + let oldObject = map.get(featureName); + oldObject[axisValueName] = indicatorValue; + map.set(featureName, oldObject); + } + else{ + let color = getColor(featureName); + let regressionObject = { + name: featureName, + itemStyle: { + color: color + } + }; + + regressionObject[axisValueName] = indicatorValue; + map.set(featureName, regressionObject); + } + + } + + return map; + } + + $scope.buildDataArrayForSelectedIndicators = async function(){ + $scope.data = new Array(); + $scope.dataWithLabels = new Array(); + + var indicatorPropertiesArrayForXAxis = await $scope.getPropertiesForIndicatorName($scope.selection.selectedIndicatorForXAxis.indicatorMetadata.indicatorName); + var indicatorPropertiesArrayForYAxis = await $scope.getPropertiesForIndicatorName($scope.selection.selectedIndicatorForYAxis.indicatorMetadata.indicatorName); + + if(kommonitorFilterHelperService.completelyRemoveFilteredFeaturesFromDisplay && kommonitorFilterHelperService.filteredIndicatorFeatureIds.size > 0){ + indicatorPropertiesArrayForXAxis = indicatorPropertiesArrayForXAxis.filter(featureProperties => ! kommonitorFilterHelperService.featureIsCurrentlyFiltered(featureProperties[__env.FEATURE_ID_PROPERTY_NAME])); + indicatorPropertiesArrayForYAxis = indicatorPropertiesArrayForYAxis.filter(featureProperties => ! kommonitorFilterHelperService.featureIsCurrentlyFiltered(featureProperties[__env.FEATURE_ID_PROPERTY_NAME])); + } + + + var timestamp_xAxis = $scope.selection.selectedIndicatorForXAxis.selectedDate; + var timestamp_yAxis = $scope.selection.selectedIndicatorForYAxis.selectedDate; + + /* + consider several cases + across data timestamps or whole features might not exist + --> cope with that and only preserve those result objects that have both timestamp values + for x and y axis + */ + + // store data in a map to check above prerequesits + // key = ID, + // value = regressionObject = { + // name: featureName, + // itemStyle: { + // color: color + // }, + // xAxisName: indicatorValue_x, + // yAxisName: indicatorValue_y + //} + let xAxisName = "xValue"; + let yAxisName = "yValue"; + let dataCandidateMap = mapRegressionData(indicatorPropertiesArrayForXAxis, timestamp_xAxis, new Map(), xAxisName); + dataCandidateMap = mapRegressionData(indicatorPropertiesArrayForYAxis, timestamp_yAxis, dataCandidateMap, yAxisName); + + // now iterate over map and identify those objects that have both indicator axis values set + // put those into resulting lists + + dataCandidateMap.forEach(function(regressionObject, key, map){ + // $scope.data.push([xAxisDataElement, yAxisDataElement]) + if (regressionObject[xAxisName] && regressionObject[yAxisName]){ + $scope.data.push([regressionObject[xAxisName], regressionObject[yAxisName]]); + + regressionObject.value = [regressionObject[xAxisName], regressionObject[yAxisName]]; + + $scope.dataWithLabels.push( + regressionObject + ); + } + }); + + return $scope.data; + }; + + /* + * Source: http://stevegardner.net/2012/06/11/javascript-code-to-calculate-the-pearson-correlation-coefficient/ + */ + function getPearsonCorrelation(x, y) { + var shortestArrayLength = 0; + + if(x.length == y.length) { + shortestArrayLength = x.length; + } else if(x.length > y.length) { + shortestArrayLength = y.length; + console.error('x has more items in it, the last ' + (x.length - shortestArrayLength) + ' item(s) will be ignored'); + } else { + shortestArrayLength = x.length; + console.error('y has more items in it, the last ' + (y.length - shortestArrayLength) + ' item(s) will be ignored'); + } + + var x_numeric = []; + var y_numeric = []; + var xy = []; + var x2 = []; + var y2 = []; + + for(var i=0; i"; + + string += $scope.selection.selectedIndicatorForXAxis.indicatorMetadata.indicatorName + ": " + kommonitorDataExchangeService.getIndicatorValue_asFormattedText(params.value[0]) + " [" + $scope.selection.selectedIndicatorForXAxis.indicatorMetadata.unit + "]
        "; + string += $scope.selection.selectedIndicatorForYAxis.indicatorMetadata.indicatorName + ": " + kommonitorDataExchangeService.getIndicatorValue_asFormattedText(params.value[1]) + " [" + $scope.selection.selectedIndicatorForYAxis.indicatorMetadata.unit + "]
        "; + return string; + } + }, + xAxis: { + name: kommonitorDataExchangeService.formatIndicatorNameForLabel($scope.selection.selectedIndicatorForXAxis.indicatorMetadata.indicatorName + " - " + $scope.selection.selectedIndicatorForXAxis.selectedDate + " [" + $scope.selection.selectedIndicatorForXAxis.indicatorMetadata.unit + "]", 100), + nameLocation: 'center', + nameGap: 22, + scale: true, + type: 'value', + splitLine: { + lineStyle: { + type: 'dashed' + } + }, + }, + yAxis: { + name: kommonitorDataExchangeService.formatIndicatorNameForLabel($scope.selection.selectedIndicatorForYAxis.indicatorMetadata.indicatorName + " - " + $scope.selection.selectedIndicatorForYAxis.selectedDate + " [" + $scope.selection.selectedIndicatorForYAxis.indicatorMetadata.unit + "]", 75), + nameLocation: 'center', + nameGap: 50, + type: 'value', + splitLine: { + lineStyle: { + type: 'dashed' + } + }, + }, + toolbox: { + show : true, + right: '15', + feature : { + // mark : {show: true}, + dataView : {show: kommonitorDataExchangeService.showDiagramExportButtons, readOnly: true, title: "Datenansicht", lang: ['Datenansicht - lineare Regression', 'schließen', 'refresh'], optionToContent: function(opt){ + + // + // + // + // + // + // + // + // + // + // + // + // + // + //
        Indikator-NameBeschreibung der Verknüpfung
        {{indicator.referencedIndicatorName}}{{indicator.referencedIndicatorDescription}}
        + + // has properties "name" and "value" + // value: [Number(xAxisDataElement.toFixed(4)), Number(yAxisDataElement.toFixed(4))] + var scatterSeries = opt.series[0].data; + var lineSeries = opt.series[1].data; + + var dataTableId = "regressionDataTable"; + var tableExportName = opt.title[0].text + " - Scatter Table"; + + var htmlString = "

        Data View enthält zwei nachstehende Tabellen, die Tabelle des Scatter Plots und die Tabelle der Punkte der Regressionsgeraden.


        "; + htmlString += '

        Scatter Plot Tabelle

        '; + htmlString += ''; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + + htmlString += ""; + htmlString += ""; + + htmlString += ""; + + for (var j=0; j"; + + htmlString += ""; + htmlString += ""; + htmlString += ""; + } + + htmlString += ""; + htmlString += "
        Feature-Name" + opt.xAxis[0].name + "" + opt.yAxis[0].name + "
        " + kommonitorDataExchangeService.getIndicatorValue_asNumber(scatterSeries[j].value[0]) + "" + kommonitorDataExchangeService.getIndicatorValue_asNumber(scatterSeries[j].value[1]) + "
        "; + + var lineTableId = "lineDataTable"; + var lineTableExportName = opt.title[0].text + " - Line Table"; + + htmlString += "

        Referenzpunkte der Regressionsgraden '" + $scope.linearRegression.expression + "'

        "; + + htmlString += ''; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + + htmlString += ""; + + for (var j=0; j"; + htmlString += ""; + htmlString += ""; + } + + htmlString += ""; + htmlString += "
        XY
        " + kommonitorDataExchangeService.getIndicatorValue_asNumber(lineSeries[j][1]) + "
        "; + + $rootScope.$broadcast("AppendExportButtonsForTable", dataTableId, tableExportName); + $rootScope.$broadcast("AppendExportButtonsForTable", lineTableId, lineTableExportName); + + return htmlString; + }}, + restore : {show: false, title: "Erneuern"}, + saveAsImage : {show: true, title: "Export", pixelRatio: 4} + } + }, + series: [{ + name: "scatter", + type: 'scatter', + // label: { + // emphasis: { + // show: false, + // position: 'left', + // textStyle: { + // color: 'blue', + // fontSize: 16 + // } + // } + // }, + itemStyle: { + borderWidth: 1, + borderColor: 'black' + }, + emphasis: { + itemStyle: { + borderWidth: 4, + borderColor: defaultColorForClickedFeatures + } + }, + data: $scope.dataWithLabels + }, { + name: 'line', + type: 'line', + showSymbol: false, + data: $scope.linearRegression.points, + markPoint: { + itemStyle: { + normal: { + color: 'transparent' + } + }, + label: { + normal: { + show: true, + position: 'left', + formatter: $scope.linearRegression.expression, + textStyle: { + color: '#333', + fontSize: 14 + } + } + }, + data: [{ + coord: $scope.linearRegression.points[$scope.linearRegression.points.length - 1] + }] + } + }] + }; + + + $scope.regressionChart.setOption($scope.regressionOption); + + await $scope.regressionChart.hideLoading(); + setTimeout(function(){ + $scope.regressionChart.resize(); + }, 350); + + registerEventsIfNecessary(); + + $rootScope.$broadcast("preserveHighlightedFeatures"); + + $timeout(function(){ + $scope.$digest(); + }, 500); + } + }; + + function registerEventsIfNecessary(){ + if(!$scope.eventsRegistered){ + // when hovering over elements of the chart then highlight them in the map. + $scope.regressionChart.on('mouseOver', function(params){ + // $scope.userHoveresOverItem = true; + var spatialFeatureName = params.data.name; + // console.log(spatialFeatureName); + if(spatialFeatureName){ + $rootScope.$broadcast("highlightFeatureOnMap", spatialFeatureName); + } + + }); + + $scope.regressionChart.on('mouseOut', function(params){ + // $scope.userHoveresOverItem = false; + + var spatialFeatureName = params.data.name; + // console.log(spatialFeatureName); + if(spatialFeatureName){ + $rootScope.$broadcast("unhighlightFeatureOnMap", spatialFeatureName); + } + }); + + $scope.regressionChart.on('click', function(params){ + var spatialFeatureName = params.data.name; + // console.log(spatialFeatureName); + if(spatialFeatureName){ + $rootScope.$broadcast("switchHighlightFeatureOnMap", spatialFeatureName); + } + + }); + + $scope.eventsRegistered = true; + } + }; + + + } ] + }); diff --git a/app/components/kommonitorUserInterface/kommonitorControls/regressionDiagram/regression-diagram.module.js b/app/components/kommonitorUserInterface/kommonitorControls/regressionDiagram/regression-diagram.module.js index 771d2f50a..f9adc4fc6 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/regressionDiagram/regression-diagram.module.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/regressionDiagram/regression-diagram.module.js @@ -1 +1,3 @@ -angular.module('regressionDiagram', [ 'kommonitorDataExchange', 'kommonitorDiagramHelper']); +"use strict"; +angular.module('regressionDiagram', ['kommonitorDataExchange', 'kommonitorDiagramHelper']); +//# sourceMappingURL=regression-diagram.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/regressionDiagram/regression-diagram.module.js.map b/app/components/kommonitorUserInterface/kommonitorControls/regressionDiagram/regression-diagram.module.js.map new file mode 100644 index 000000000..b2bb00e65 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/regressionDiagram/regression-diagram.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"regression-diagram.module.js","sourceRoot":"","sources":["regression-diagram.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,mBAAmB,EAAE,CAAE,wBAAwB,EAAE,yBAAyB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/regressionDiagram/regression-diagram.module.ts b/app/components/kommonitorUserInterface/kommonitorControls/regressionDiagram/regression-diagram.module.ts new file mode 100644 index 000000000..771d2f50a --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/regressionDiagram/regression-diagram.module.ts @@ -0,0 +1 @@ +angular.module('regressionDiagram', [ 'kommonitorDataExchange', 'kommonitorDiagramHelper']); diff --git a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reporting-modal.component.js b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reporting-modal.component.js index 2e6e1eb2d..6fab45299 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reporting-modal.component.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reporting-modal.component.js @@ -1,108 +1,91 @@ +"use strict"; angular.module('reportingModal').component('reportingModal', { - templateUrl : "components/kommonitorUserInterface/kommonitorControls/reportingModal/reporting-modal.template.html", - controller : ['$scope', '__env', '$timeout', - function ReportingModalController($scope, __env, $timeout) { - - $scope.workflowSelected = false; - $scope.templateSelected = false; - $scope.addingNewIndicator = false; - let modalDialog = document.querySelector("#reporting-modal .modal-dialog"); - - $scope.$on('reportingWorkflowSelected', function(event, data) { - // make modal wide - modalDialog.classList.add("modal-xl"); - - $scope.workflowSelected = true; // go to template select - // if an existing config should be imported - if(data) { - // skip template selection, directly go to overview - $scope.templateSelected = true; - $scope.$broadcast("reportingInitializeOverview", [true, data]) // data: [config] - } else { - // TODO only for debugging, remove later - $scope.$broadcast('reportingInitializeTemplateSelect'); - } - - // for some reason angular won't register the change if a config file was selected - $timeout(function(){ - $scope.$digest(); - }); - }); - - $scope.$on('reportingTemplateSelected', function(event, data) { - $scope.templateSelected = true; // go to overview - $scope.$broadcast("reportingInitializeOverview", [false, data]) - }); - - $scope.$on('reportingConfigureNewIndicatorClicked', function(event, data) { - $scope.addingNewIndicator = true; // show add indicator process - // tell indicator-add component it is shown - $scope.$broadcast("reportingConfigureNewIndicatorShown", data) - }); - - $scope.$on('reportingConfigureNewPoiLayerClicked', function(event, data) { - $scope.addingNewIndicator = true; // show add indicator process - // tell indicator-add component it is shown - $scope.$broadcast("reportingConfigureNewPoiLayerShown", data) - }); - - $scope.$on('reportingAddNewIndicatorClicked', function(event, data) { - $scope.addingNewIndicator = false; // return to overview - $scope.$broadcast('reportingIndicatorConfigurationCompleted', data) - }); - - $scope.$on('reportingAddNewPoiLayerClicked', function(event, data) { - $scope.addingNewIndicator = false; // return to overview - $scope.$broadcast('reportingPoiLayerConfigurationCompleted', data) - }); - - $scope.$on('reportingBackToOverviewClicked', function() { - $scope.addingNewIndicator = false; // return to overview, no data added - }); - - $scope.$on('reportingBackToTemplateSelectionClicked', function() { - $scope.templateSelected = false; - }); - - $scope.$on('reportingBackToWorkflowSelectionClicked', function() { - $scope.workflowSelected = false; - modalDialog.classList.remove("modal-xl") - }); - - $scope.generateReport = function(format) { - $('#reporting-report-formats-selection').modal('hide') - $scope.$broadcast("reportingGenerateReport", format) - } - - // $scope.$on("reportingPageGenerated", function(event, data) { - // let currentPageNumber = data[0]; - // let totalPageNumber = data[1]; - // if(currentPageNumber === 1) { - // $('#reporting-report-progress').modal('show'); - // } - // let node = document.querySelector("#reporting-report-progress-counter"); - // node.innerHTML = "Erzeugte Seiten: " + currentPageNumber + " von " + totalPageNumber; - - // if(currentPageNumber === totalPageNumber) { - // $('#reporting-report-progress').modal('hide'); - // } - - // }); - - - - $scope.makeIndicatorsDraggable = function() { - $timeout( function() { - $(".draggable").draggable({ - revert: "invalid", - revertDuration: 0, - appendTo: $('#reporting-modal .modal-content'), - scroll: false, - helper: "clone" - }); - }, 500); - } - } -]}); - - + templateUrl: "components/kommonitorUserInterface/kommonitorControls/reportingModal/reporting-modal.template.html", + controller: ['$scope', '__env', '$timeout', + function ReportingModalController($scope, __env, $timeout) { + $scope.workflowSelected = false; + $scope.templateSelected = false; + $scope.addingNewIndicator = false; + let modalDialog = document.querySelector("#reporting-modal .modal-dialog"); + $scope.$on('reportingWorkflowSelected', function (event, data) { + // make modal wide + modalDialog.classList.add("modal-xl"); + $scope.workflowSelected = true; // go to template select + // if an existing config should be imported + if (data) { + // skip template selection, directly go to overview + $scope.templateSelected = true; + $scope.$broadcast("reportingInitializeOverview", [true, data]); // data: [config] + } + else { + // TODO only for debugging, remove later + $scope.$broadcast('reportingInitializeTemplateSelect'); + } + // for some reason angular won't register the change if a config file was selected + $timeout(function () { + $scope.$digest(); + }); + }); + $scope.$on('reportingTemplateSelected', function (event, data) { + $scope.templateSelected = true; // go to overview + $scope.$broadcast("reportingInitializeOverview", [false, data]); + }); + $scope.$on('reportingConfigureNewIndicatorClicked', function (event, data) { + $scope.addingNewIndicator = true; // show add indicator process + // tell indicator-add component it is shown + $scope.$broadcast("reportingConfigureNewIndicatorShown", data); + }); + $scope.$on('reportingConfigureNewPoiLayerClicked', function (event, data) { + $scope.addingNewIndicator = true; // show add indicator process + // tell indicator-add component it is shown + $scope.$broadcast("reportingConfigureNewPoiLayerShown", data); + }); + $scope.$on('reportingAddNewIndicatorClicked', function (event, data) { + $scope.addingNewIndicator = false; // return to overview + $scope.$broadcast('reportingIndicatorConfigurationCompleted', data); + }); + $scope.$on('reportingAddNewPoiLayerClicked', function (event, data) { + $scope.addingNewIndicator = false; // return to overview + $scope.$broadcast('reportingPoiLayerConfigurationCompleted', data); + }); + $scope.$on('reportingBackToOverviewClicked', function () { + $scope.addingNewIndicator = false; // return to overview, no data added + }); + $scope.$on('reportingBackToTemplateSelectionClicked', function () { + $scope.templateSelected = false; + }); + $scope.$on('reportingBackToWorkflowSelectionClicked', function () { + $scope.workflowSelected = false; + modalDialog.classList.remove("modal-xl"); + }); + $scope.generateReport = function (format) { + $('#reporting-report-formats-selection').modal('hide'); + $scope.$broadcast("reportingGenerateReport", format); + }; + // $scope.$on("reportingPageGenerated", function(event, data) { + // let currentPageNumber = data[0]; + // let totalPageNumber = data[1]; + // if(currentPageNumber === 1) { + // $('#reporting-report-progress').modal('show'); + // } + // let node = document.querySelector("#reporting-report-progress-counter"); + // node.innerHTML = "Erzeugte Seiten: " + currentPageNumber + " von " + totalPageNumber; + // if(currentPageNumber === totalPageNumber) { + // $('#reporting-report-progress').modal('hide'); + // } + // }); + $scope.makeIndicatorsDraggable = function () { + $timeout(function () { + $(".draggable").draggable({ + revert: "invalid", + revertDuration: 0, + appendTo: $('#reporting-modal .modal-content'), + scroll: false, + helper: "clone" + }); + }, 500); + }; + } + ] +}); +//# sourceMappingURL=reporting-modal.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reporting-modal.component.js.map b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reporting-modal.component.js.map new file mode 100644 index 000000000..e329ed847 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reporting-modal.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"reporting-modal.component.js","sourceRoot":"","sources":["reporting-modal.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,SAAS,CAAC,gBAAgB,EAAE;IAC5D,WAAW,EAAG,oGAAoG;IAClH,UAAU,EAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU;QAC3C,SAAS,wBAAwB,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ;YAExD,MAAM,CAAC,gBAAgB,GAAG,KAAK,CAAC;YAChC,MAAM,CAAC,gBAAgB,GAAG,KAAK,CAAC;YAChC,MAAM,CAAC,kBAAkB,GAAG,KAAK,CAAC;YAClC,IAAI,WAAW,GAAG,QAAQ,CAAC,aAAa,CAAC,gCAAgC,CAAC,CAAC;YAE3E,MAAM,CAAC,GAAG,CAAC,2BAA2B,EAAE,UAAS,KAAK,EAAE,IAAI;gBAC3D,kBAAkB;gBAClB,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;gBAEtC,MAAM,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC,wBAAwB;gBACxD,2CAA2C;gBAC3C,IAAG,IAAI,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,QAAQ,EAAE,CAAC,CAAC,iCAAiC,CAAC;wBAC9C,MAAM,EAAE,KAAK;wBACb,MAAM,EAAE,OAAO;qBACf,CAAC,CAAC;gBACJ,CAAC,EAAE,GAAG,CAAC,CAAC;YACT,CAAC,CAAA;QACF,CAAC;KACD;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reporting-modal.component.ts b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reporting-modal.component.ts new file mode 100644 index 000000000..2e6e1eb2d --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reporting-modal.component.ts @@ -0,0 +1,108 @@ +angular.module('reportingModal').component('reportingModal', { + templateUrl : "components/kommonitorUserInterface/kommonitorControls/reportingModal/reporting-modal.template.html", + controller : ['$scope', '__env', '$timeout', + function ReportingModalController($scope, __env, $timeout) { + + $scope.workflowSelected = false; + $scope.templateSelected = false; + $scope.addingNewIndicator = false; + let modalDialog = document.querySelector("#reporting-modal .modal-dialog"); + + $scope.$on('reportingWorkflowSelected', function(event, data) { + // make modal wide + modalDialog.classList.add("modal-xl"); + + $scope.workflowSelected = true; // go to template select + // if an existing config should be imported + if(data) { + // skip template selection, directly go to overview + $scope.templateSelected = true; + $scope.$broadcast("reportingInitializeOverview", [true, data]) // data: [config] + } else { + // TODO only for debugging, remove later + $scope.$broadcast('reportingInitializeTemplateSelect'); + } + + // for some reason angular won't register the change if a config file was selected + $timeout(function(){ + $scope.$digest(); + }); + }); + + $scope.$on('reportingTemplateSelected', function(event, data) { + $scope.templateSelected = true; // go to overview + $scope.$broadcast("reportingInitializeOverview", [false, data]) + }); + + $scope.$on('reportingConfigureNewIndicatorClicked', function(event, data) { + $scope.addingNewIndicator = true; // show add indicator process + // tell indicator-add component it is shown + $scope.$broadcast("reportingConfigureNewIndicatorShown", data) + }); + + $scope.$on('reportingConfigureNewPoiLayerClicked', function(event, data) { + $scope.addingNewIndicator = true; // show add indicator process + // tell indicator-add component it is shown + $scope.$broadcast("reportingConfigureNewPoiLayerShown", data) + }); + + $scope.$on('reportingAddNewIndicatorClicked', function(event, data) { + $scope.addingNewIndicator = false; // return to overview + $scope.$broadcast('reportingIndicatorConfigurationCompleted', data) + }); + + $scope.$on('reportingAddNewPoiLayerClicked', function(event, data) { + $scope.addingNewIndicator = false; // return to overview + $scope.$broadcast('reportingPoiLayerConfigurationCompleted', data) + }); + + $scope.$on('reportingBackToOverviewClicked', function() { + $scope.addingNewIndicator = false; // return to overview, no data added + }); + + $scope.$on('reportingBackToTemplateSelectionClicked', function() { + $scope.templateSelected = false; + }); + + $scope.$on('reportingBackToWorkflowSelectionClicked', function() { + $scope.workflowSelected = false; + modalDialog.classList.remove("modal-xl") + }); + + $scope.generateReport = function(format) { + $('#reporting-report-formats-selection').modal('hide') + $scope.$broadcast("reportingGenerateReport", format) + } + + // $scope.$on("reportingPageGenerated", function(event, data) { + // let currentPageNumber = data[0]; + // let totalPageNumber = data[1]; + // if(currentPageNumber === 1) { + // $('#reporting-report-progress').modal('show'); + // } + // let node = document.querySelector("#reporting-report-progress-counter"); + // node.innerHTML = "Erzeugte Seiten: " + currentPageNumber + " von " + totalPageNumber; + + // if(currentPageNumber === totalPageNumber) { + // $('#reporting-report-progress').modal('hide'); + // } + + // }); + + + + $scope.makeIndicatorsDraggable = function() { + $timeout( function() { + $(".draggable").draggable({ + revert: "invalid", + revertDuration: 0, + appendTo: $('#reporting-modal .modal-content'), + scroll: false, + helper: "clone" + }); + }, 500); + } + } +]}); + + diff --git a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reporting-modal.module.js b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reporting-modal.module.js index f72412e3f..a01d43812 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reporting-modal.module.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reporting-modal.module.js @@ -1 +1,3 @@ -angular.module('reportingModal', ['reportingWorkflowSelect', 'reportingTemplateSelect', 'reportingOverview', 'reportingIndicatorAdd']); \ No newline at end of file +"use strict"; +angular.module('reportingModal', ['reportingWorkflowSelect', 'reportingTemplateSelect', 'reportingOverview', 'reportingIndicatorAdd']); +//# sourceMappingURL=reporting-modal.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reporting-modal.module.js.map b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reporting-modal.module.js.map new file mode 100644 index 000000000..6c80bf8d6 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reporting-modal.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"reporting-modal.module.js","sourceRoot":"","sources":["reporting-modal.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC,yBAAyB,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,uBAAuB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reporting-modal.module.ts b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reporting-modal.module.ts new file mode 100644 index 000000000..f72412e3f --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reporting-modal.module.ts @@ -0,0 +1 @@ +angular.module('reportingModal', ['reportingWorkflowSelect', 'reportingTemplateSelect', 'reportingOverview', 'reportingIndicatorAdd']); \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingIndicatorAdd/reporting-indicator-add.component.js b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingIndicatorAdd/reporting-indicator-add.component.js index 9d6e37113..ca85b6053 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingIndicatorAdd/reporting-indicator-add.component.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingIndicatorAdd/reporting-indicator-add.component.js @@ -1,3452 +1,3099 @@ +"use strict"; angular.module('reportingIndicatorAdd').component('reportingIndicatorAdd', { - templateUrl : "components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingIndicatorAdd/reporting-indicator-add.template.html", - controller : ['$scope', '$http', '$timeout', '$interval', '__env', 'kommonitorDataExchangeService', 'kommonitorDiagramHelperService', 'kommonitorVisualStyleHelperService', - function ReportingIndicatorAddController($scope, $http, $timeout, $interval, __env, kommonitorDataExchangeService, kommonitorDiagramHelperService, kommonitorVisualStyleHelperService) { - - $scope.template = undefined; - $scope.untouchedTemplateAsString = ""; - - $scope.indicatorNameFilter = ""; - $scope.poiNameFilter = ""; - $scope.availableIndicators = []; - $scope.selectedIndicator = undefined; - $scope.selectedPoiLayer = undefined; - - $scope.availableFeaturesBySpatialUnit = {}; - $scope.selectedSpatialUnit = undefined; - $scope.selectedAreas = []; - - $scope.selectedTimestamps = []; - $scope.indexOfFirstAreaSpecificPage = undefined; - $scope.dateSlider = undefined; - $scope.absoluteLabelPositions = []; - $scope.showMapLabels = true; - $scope.echartsOptions = { - map: { - // "2017-12-31": ... - // "2018-12-31": ... - }, - bar: { - // "2017-12-31": ... - // "2018-12-31": ... - }, - line: {}, // no timestamp needed here - } - $scope.echartsRegisteredMapNames = []; - - $scope.loadingData = false; - $scope.diagramsPrepared = false; - $scope.isFirstUpdateOnIndicatorOrPoiLayerSelection = true; - $scope.showResetIsochronesBtn = false; - - $scope.isochronesTypeOfMovementMapping = { - "foot-walking": "Fußgänger", - "driving-car": "Auto", - "cycling-regular": "Fahrrad", - "wheelchair": "Barrierefrei", - "buffer": "Puffer" - } - - // used to track template pages instead of using $$hashkey - $scope.templatePageIdCounter = 1; - - $scope.filterTimeseriesIndicator = function(indicator) { - // must have more than one applicable date - return indicator.applicableDates && indicator.applicableDates.length > 1; - }; - - // internal array changes do not work with ng-change - $scope.$watchCollection('selectedAreas', function(newVal) { - $scope.onSelectedAreasChanged(newVal) - }); - - $scope.onSelectedAreasChanged = function(newVal) { - if( typeof($scope.template) === "undefined") return; - $scope.loadingData = true; - // to make things easier we remove all area-specific pages and recreate them using newVal - // this approach is not optimized for performance and might have to change in the future - - // remove all area-specific pages - $scope.template.pages = $scope.template.pages.filter( page => { - return !page.hasOwnProperty("area") - }); - - if($scope.template.name === "A4-landscape-timestamp") - $scope.updateAreasForTimestampTemplates(newVal) - if($scope.template.name === "A4-landscape-timeseries") - $scope.updateAreasForTimeseriesTemplates(newVal) - if($scope.template.name === "A4-landscape-reachability") - $scope.updateAreasForReachabilityTemplates(newVal) - - let updateDiagramsInterval_areas; - - async function updateDiagrams() { - - if($scope.diagramsPrepared) { - $interval.cancel(updateDiagramsInterval_areas); // code below still executes once - } else { - return; - } - - // diagrams are prepared, but dom has to be updated first, too - // we could filter the geoJson here to only include selected areas - // but for now we get all areas and filter them out after - let justChanged = false; - if($scope.isFirstUpdateOnIndicatorOrPoiLayerSelection) { - // Skip the update but set variable to false, so diagrams get updated on time update - // (relevant for indicator selection only) - $scope.isFirstUpdateOnIndicatorOrPoiLayerSelection = false; - justChanged = true; - } - if($scope.template.name == "A4-landscape-reachability" || ($scope.isFirstUpdateOnIndicatorOrPoiLayerSelection == false && justChanged == false)) { - await $scope.initializeAllDiagrams(); - if($scope.template.name !== "A4-landscape-reachability") { - // in reachability template we have to update leaflet maps, too - $scope.loadingData = false; - } - } - } - updateDiagramsInterval_areas = $interval(updateDiagrams, 0, 100) - - } - - - $scope.updateAreasForTimestampTemplates = function(newVal) { - let pagesToInsertPerTimestamp = []; - for(let area of newVal) { - // get page to insert from untouched template - let pageToInsert = angular.fromJson($scope.untouchedTemplateAsString).pages[ $scope.indexOfFirstAreaSpecificPage ]; - pageToInsert.area = area.name; - pageToInsert.id = $scope.templatePageIdCounter++; - pagesToInsertPerTimestamp.push(pageToInsert); - } - - // sort alphabetically by area name - pagesToInsertPerTimestamp.sort( (a, b) => { - let textA = a.area.toLowerCase(); - let textB = b.area.toLowerCase(); - return (textA < textB) ? -1 : (textA > textB) ? 1 : 0; - }) - - // insert area-specific pages for each timestamp - // right now the area-specific part is missing and we have to figure out where it was. - // get pages per timestamp -> insert new ones starting at indexOfFirstAreaSpecificPage -> replace per timestamp in $scope.template.pages - if($scope.selectedTimestamps.length) { - let idx = 0 - for(let timestamp of $scope.selectedTimestamps) { - - // pagesForTimestamp is the template-section for that timestamp - let pagesForTimestamp = $scope.template.pages.filter( page => { - let dateEl = page.pageElements.find( el => { - return el.type === "dataTimestamp-landscape" - }); - - return dateEl.text === timestamp.name - }); - // set index to first page of that timestamp - // this is where we want to start replacing pages later - idx = $scope.template.pages.indexOf( pagesForTimestamp[0] ) - // create a deep copy so we can assign new ids - pagesForTimestamp = JSON.parse(JSON.stringify(pagesForTimestamp)); - - // setup pages before inserting - for(let pageToInsert of pagesToInsertPerTimestamp) { - - let titleEl = pageToInsert.pageElements.find( el => { - return el.type === "indicatorTitle-landscape" - }); - titleEl.text = $scope.selectedIndicator.indicatorName + " [" + $scope.selectedIndicator.unit + "]"; - if(pageToInsert.area) { - titleEl.text += ", " + pageToInsert.area - } - titleEl.isPlaceholder = false; - - let dateEl = pageToInsert.pageElements.find( el => { - return el.type === "dataTimestamp-landscape" - }); - - dateEl.text = timestamp.name; - dateEl.isPlaceholder = false; - - // diagrams have to be inserted later because the div element does not yet exist - } - - let numberOfPagesToReplace = pagesForTimestamp.length; - // insert area-specific pages - pagesToInsertPerTimestamp = JSON.parse(JSON.stringify(pagesToInsertPerTimestamp)); - for(let page of pagesToInsertPerTimestamp) - page.id = $scope.templatePageIdCounter++; - pagesForTimestamp.splice($scope.indexOfFirstAreaSpecificPage, 0, ...pagesToInsertPerTimestamp) - // assign new ids - for(let page of pagesForTimestamp) - page.id = $scope.templatePageIdCounter++; - // then replace the whole timstamp-section with the new pages - $scope.template.pages.splice(idx, numberOfPagesToReplace, ...pagesForTimestamp) - } - } else { - pagesToInsertPerTimestamp = JSON.parse(JSON.stringify(pagesToInsertPerTimestamp)); - for(let page of pagesToInsertPerTimestamp) - page.id = $scope.templatePageIdCounter++; - // no timestamp selected, which makes inserting easier - $scope.template.pages.splice($scope.indexOfFirstAreaSpecificPage, 0, ...pagesToInsertPerTimestamp) - } - } - - $scope.updateAreasForTimeseriesTemplates = function(newVal) { - let pagesToInsert = []; - for(let area of newVal) { - // get page to insert from untouched template - let pageToInsert = angular.fromJson($scope.untouchedTemplateAsString).pages[ $scope.indexOfFirstAreaSpecificPage ]; - pageToInsert.area = area.name; - pageToInsert.id = $scope.templatePageIdCounter++; - pagesToInsert.push(pageToInsert); - } - - // sort alphabetically by area name - pagesToInsert.sort( (a, b) => { - let textA = a.area.toLowerCase(); - let textB = b.area.toLowerCase(); - return (textA < textB) ? -1 : (textA > textB) ? 1 : 0; - }); - - // since we are dealing with a timeseries we don't have to care about inserting area-pages multiple times for different timestamps - // we do it only once - - // setup pages before inserting - for(let pageToInsert of pagesToInsert) { - - let titleEl = pageToInsert.pageElements.find( el => { - return el.type === "indicatorTitle-landscape" - }); - titleEl.text = $scope.selectedIndicator.indicatorName + " [" + $scope.selectedIndicator.unit + "]"; - if(pageToInsert.area) { - titleEl.text += ", " + pageToInsert.area - } - titleEl.isPlaceholder = false; - - let dateEl = pageToInsert.pageElements.find( el => { - return el.type === "dataTimeseries-landscape" - }); - let includeInBetweenValues = false - let dsValues = $scope.getFormattedDateSliderValues(includeInBetweenValues); - dateEl.text = dsValues.from + " - " + dsValues.to; - dateEl.isPlaceholder = false; - - // diagrams have to be inserted later because the div element does not yet exist - } - - // insert area-specific pages - pagesToInsert= JSON.parse(JSON.stringify(pagesToInsert)); - for(let page of pagesToInsert) - page.id = $scope.templatePageIdCounter++; - $scope.template.pages.splice($scope.indexOfFirstAreaSpecificPage, 0, ...pagesToInsert) - } - - $scope.updateAreasForReachabilityTemplates = function(newVal) { - // we only have one timestamp here (the most recent one) - let pagesToInsert = []; - for(let area of newVal) { - // get page to insert from untouched template - let pageToInsert = angular.fromJson($scope.untouchedTemplateAsString).pages[ $scope.indexOfFirstAreaSpecificPage ]; - pageToInsert.area = area.name; - pageToInsert.id = $scope.templatePageIdCounter++; - pagesToInsert.push(pageToInsert); - } - - // sort alphabetically by area name - pagesToInsert.sort( (a, b) => { - let textA = a.area.toLowerCase(); - let textB = b.area.toLowerCase(); - return (textA < textB) ? -1 : (textA > textB) ? 1 : 0; - }); - - // we select the most recent timestamp programmatically and don't allow user to change it, so this should be 1 here - if($scope.selectedTimestamps.length === 1) { - - // setup pages before inserting - for(let pageToInsert of pagesToInsert) { - - let titleEl = pageToInsert.pageElements.find( el => { - return el.type === "indicatorTitle-landscape" - }); - titleEl.text = "Entfernungen für " + $scope.selectedPoiLayer.datasetName; - if(pageToInsert.area) { - titleEl.text += ", " + pageToInsert.area - } - titleEl.isPlaceholder = false; - - let subtitleEl = pageToInsert.pageElements.find( el => { - return el.type === "reachability-subtitle-landscape" - }); - subtitleEl.text = $scope.selectedTimestamps[0].name; - if($scope.isochrones) - subtitleEl.text += ", " + $scope.isochronesTypeOfMovementMapping[$scope.typeOfMovement]; - if($scope.selectedIndicator) - subtitleEl.text += ", " + $scope.selectedIndicator.indicatorName; - subtitleEl.isPlaceholder = false; - - // diagrams have to be inserted later because the div element does not yet exist - } - - // create a deep copy so we can assign new ids - pagesToInsert = JSON.parse(JSON.stringify(pagesToInsert)); - let numberOfPagesToReplace = $scope.template.pages.length-2 // basically everything until the end of the template (-2 because we start at second page) - // insert area-specific pages - for(let page of pagesToInsert) - page.id = $scope.templatePageIdCounter++; - - $scope.template.pages.splice($scope.indexOfFirstAreaSpecificPage, numberOfPagesToReplace, ...pagesToInsert) - } - } - - - - // internal array changes do not work with ng-change - $scope.$watchCollection('selectedTimestamps', function(newVal, oldVal) { - - if( typeof($scope.template) === "undefined") return; - $scope.loadingData = true; - - // get difference between old and new value (the timestamps selected / deselected) - let difference = oldVal - .filter(x => !newVal.includes(x)) - .concat(newVal.filter(x => !oldVal.includes(x))); - - // if selected - if(newVal.length > oldVal.length) { - // if this was the first timestamp - if(newVal.length === 1) { - // no need to insert pages, we just replace the placeholder timestamp - for(let page of $scope.template.pages) { - for(let pageElement of page.pageElements) { - if(pageElement.type === "dataTimestamp-landscape") { - pageElement.text = difference[0].name; - pageElement.isPlaceholder = false; - } - } - } - } - - if(newVal.length > 1) { - for(let timestampToInsert of difference) { - - // setup pages to insert first - let pagesToInsert = angular.fromJson($scope.untouchedTemplateAsString).pages; - for(let page of pagesToInsert) { - page.id = $scope.templatePageIdCounter++; - } - // insert additional page for each selected area, replace the placeholder page - let areaSpecificPages = []; - // copy placeholder page for each selected area - for(let area of $scope.selectedAreas) { - let page = angular.fromJson($scope.untouchedTemplateAsString).pages[ $scope.indexOfFirstAreaSpecificPage ]; - page.area = area.name; - page.id = $scope.templatePageIdCounter++; - areaSpecificPages.push(page); - } - - // sort alphabetically by area name - areaSpecificPages.sort( (a, b) => { - let textA = a.area.toLowerCase(); - let textB = b.area.toLowerCase(); - return (textA < textB) ? -1 : (textA > textB) ? 1 : 0; - }) - - pagesToInsert.splice($scope.indexOfFirstAreaSpecificPage, 1, ...areaSpecificPages) - - // setup pages before inserting them - for(let pageToInsert of pagesToInsert) { - for(let pageElement of pageToInsert.pageElements) { - - if(pageElement.type === "indicatorTitle-landscape") { - pageElement.text = $scope.selectedIndicator.indicatorName + " [" + $scope.selectedIndicator.unit + "]"; - if(pageToInsert.area) { - pageElement.text += ", " + pageToInsert.area - } - pageElement.isPlaceholder = false; - } - - if(pageElement.type === "dataTimestamp-landscape") { - pageElement.text = timestampToInsert.name; - pageElement.isPlaceholder = false; - } - } - } - - // determine position to insert pages (ascending timestamps) and insert them - // iterate pages and check timestamp for each one - let pagesInserted = false; - for(let i=$scope.template.pages.length-1; i>=0; i--) { //iterate in reverse because we might extend the array while iterating - let page = $scope.template.pages[i]; - - for(let pElement of page.pageElements) { - if(pElement.type === "dataTimestamp-landscape") { - // compare timestamps - let date1 = timestampToInsert.name; - let date2 = pElement.text; - let date1Updated = new Date(date1.replace(/-/g,'/')); - let date2Updated = new Date(date2.replace(/-/g,'/')); - - // if page timestamp is newer than difference timestamp - if(date1Updated > date2Updated) { - // insert pages before pages with that timestamp - // i+1 because we want to insert after the page that has the older timestamp - $scope.template.pages.splice(i+1, 0, ...pagesToInsert); - - pagesInserted = true; - } - } - } - - if(pagesInserted) { - break; - } - } - - if( !pagesInserted ) { // happens if the timestamp to insert is the oldest one - $scope.template.pages.splice(0, 0, ...pagesToInsert); //prepend pages - } - } - - // in case all timestamps were added at once and none was present before we still have placeholder pages at this point - // all other pages got prepended since we compared against an invalid date. - // remove those pages - for(let i=$scope.template.pages.length-1; i>=0; i--) { //iterate in reverse because we might extend the array while iterating - let page = $scope.template.pages[i]; - for(let pElement of page.pageElements) { - if(pElement.type === "dataTimestamp-landscape") { - if(pElement.isPlaceholder) { - $scope.template.pages.splice(i, 1); - } - } - } - } - } - } - - // if deselected - if(newVal.length < oldVal.length) { - // if it was the last one - if(newVal.length === 0) { - let cleanTemplate = angular.fromJson($scope.untouchedTemplateAsString); - for(let page of cleanTemplate.pages) { - page.id = $scope.templatePageIdCounter++; - } - $scope.template = cleanTemplate; - } else { - // remove all pages that belong to removed timestamps - for(let timestampToRemove of difference) { - $scope.template.pages = $scope.template.pages.filter( page => { - let timestampEl = page.pageElements.find( el => { - return el.type === "dataTimestamp-landscape" - }) - - return timestampEl.text != timestampToRemove.name; - }); - } - } - } - - // There is one more special case for the reachbility template, where we only have one timestamp set at all times, - // but that one might change if we change the spatial unit - if(newVal.length === oldVal.length && newVal.length === 1 && newVal[0].name != oldVal[0].name) { - // simply update the timestamp on all pages - for(let page of $scope.template.pages) { - for(let pageElement of page.pageElements) { - if(pageElement.type === "reachability-subtitle-landscape") { - pageElement.text = newVal[0].name; - if($scope.isochrones) - pageElement.text += ", " + $scope.isochronesTypeOfMovementMapping[$scope.typeOfMovement]; - if($scope.selectedIndicator) - pageElement.text += ", " + $scope.selectedIndicator.indicatorName; - } - break; - } - } - } - - function updateDiagrams() { - if($scope.diagramsPrepared) { - $interval.cancel(updateDiagramsInterval); // code below still executes once - } else { - return; - } - - $timeout(async function() { - if($scope.isFirstUpdateOnIndicatorOrPoiLayerSelection) { - // Skip the update but set variable to false, so diagrams get updated on time update - // (relevant for indicator selection only) - $scope.isFirstUpdateOnIndicatorOrPoiLayerSelection = false; - } else { - // indicator selection is optional in reachability template only - if($scope.selectedIndicator) { - for(let timestamp of $scope.selectedTimestamps) { - let classifyUsingWholeTimeseries = false; - let isTimeseries = false; - $scope.prepareDiagrams($scope.selectedIndicator, $scope.selectedSpatialUnit, timestamp.name, classifyUsingWholeTimeseries, isTimeseries, undefined, undefined); - } - } else { - $scope.reachabilityTemplateGeoMapOptions = $scope.prepareReachabilityEchartsMap(); - } - - await $scope.initializeAllDiagrams(); - if($scope.template.name !== "A4-landscape-reachability") { - // in reachability template we have to update leaflet maps, too - $scope.loadingData = false; - } - } - }); - - } - - let updateDiagramsInterval = $interval(updateDiagrams, 0, 100) - }); - - $scope.$on("reportingConfigureNewIndicatorShown", function(event, data) { - $scope.initialize(data); - }); - - $scope.$on("reportingConfigureNewPoiLayerShown", function(event, data) { - $scope.initialize(data); - }); - - $scope.initialize = async function(data) { - $scope.loadingData = true; - let template = data[0]; - // deep copy template before any changes are made. - // this is needed when additional timestamps are inserted. - $scope.untouchedTemplateAsString = angular.toJson(template) - // give each page a unique id to track it by in ng-repeat - for(let page of template.pages) { - page.id = $scope.templatePageIdCounter++; - } - $scope.template = template; - - if($scope.template.name === "A4-landscape-timestamp") - $scope.indexOfFirstAreaSpecificPage = 3; - if($scope.template.name === "A4-landscape-timeseries") - $scope.indexOfFirstAreaSpecificPage = 4; - if($scope.template.name === "A4-landscape-reachability") - $scope.indexOfFirstAreaSpecificPage = 1; - - // disable tabs to force user to pick a poi-layer / indicator first - let tabList = document.querySelector("#reporting-add-indicator-tab-list"); - let tabPanes = document.querySelectorAll("#reporting-add-indicator-tab-content > .tab-pane"); - let tabChildren = Array.from(tabList.children) - for(let [idx, tab] of tabChildren.entries()) { - let id = tab.id.at(-1); - if( ($scope.template.name === "A4-landscape-reachability" && id==1) || // pois - ($scope.template.name !== "A4-landscape-reachability" && id==3) ) { // indicators - tab.classList.add("active"); - tabPanes[idx].classList.add("active"); - } else { - tab.classList.remove("active"); - tabPanes[idx].classList.remove("active"); - } - } - - $scope.initializeDualLists(); - - if($scope.template.name === "A4-landscape-reachability") { - $scope.resetIsochrones(); - Promise.all([ - $scope.queryGeoresources(), - $scope.queryIndicators() - ]).then( () => { - $scope.loadingData = false; - $timeout( () => { - $timeout(function(){ - $scope.$digest(); - }); - }); - }) - } else { - await $scope.queryIndicators(); - $scope.loadingData = false; - $timeout( () => { - $timeout(function(){ - $scope.$digest(); - }); - }) - - } - } - - $scope.initializeDualLists = function() { - $scope.dualListAreasOptions = { - label: 'Bereiche', - boxItemsHeight: 'md', - items: [], - button: {leftText: "Alle auswählen" , rightText: "Alle entfernen"}, - selectedItems: [] - }; - - $scope.dualListTimestampsOptions = { - label: 'Zeitpunkte', - boxItemsHeight: 'md', - items: [], - button: {leftText: "Alle auswählen" , rightText: "Alle entfernen"}, - selectedItems: [] - }; - - $scope.dualListSpatialUnitsOptions = { - label: 'Raumebenen', - boxItemsHeight: 'md', - items: [], - button: {leftText: "Alle auswählen" , rightText: "Alle entfernen"}, - selectedItems: [] - }; - } - - /** - * Queries DataManagement API to get all available indicators - */ - $scope.queryIndicators = async function() { - - // build request - // query public endpoint for now, this might change once user role administration is added to reporting - let url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/indicators" - - // send request - await $http({ - url: url, - method: "GET" - }).then(function successCallback(response) { - // save to scope - $scope.availableIndicators = response.data; - }, function errorCallback(error) { - $scope.loadingData = false; - kommonitorDataExchangeService.displayMapApplicationError(error); - console.error(error); - }); - return Promise.resolve(); - }; - - $scope.queryGeoresources = async function() { - - // build request - // query public endpoint for now, this might change once user role administration is added to reporting - let url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources" - // send request - await $http({ - url: url, - method: "GET" - }).then(function successCallback(response) { - // save to scope - $scope.availablePoiLayers = response.data.filter( georesource => { - return georesource.isPOI; - }); - }, function errorCallback(error) { - $scope.loadingData = false; - kommonitorDataExchangeService.displayMapApplicationError(error); - console.error(error); - }); - return Promise.resolve(); - }; - - $scope.queryMostRecentGeoresourceFeatures = async function(georesource) { - // Most likely this is only a temporary method - // It checks the availablePeriodsOfValidity and takes the most recent one to query features. - - let timestamp = georesource.availablePeriodsOfValidity.at(-1).startDate; - let timestampSplit = timestamp.split("-") - let year = timestampSplit[0]; - let month = timestampSplit[1]; - let day = timestampSplit[2]; - - let url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() - url += "/georesources/" + georesource.georesourceId + "/" + year + "/" + month + "/" + day - // send request - return await $http({ - url: url, - method: "GET" - }).then(function successCallback(response) { - return response.data; - }, function errorCallback(error) { - $scope.loadingData = false; - kommonitorDataExchangeService.displayMapApplicationError(error); - console.error(error); - }); - } - - $scope.queryAllSpatialUnits = async function() { - // build request - // query public endpoint for now, this might change once user role administration is added to reporting - let url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/spatial-units" - - // send request - return await $http({ - url: url, - method: "GET" - }).then(function successCallback(response) { - // save to scope - return response.data; - }, function errorCallback(error) { - $scope.loadingData = false; - kommonitorDataExchangeService.displayMapApplicationError(error); - console.error(error); - }); - } - - - $scope.onSpatialUnitChanged = async function(selectedSpatialUnit) { - $scope.loadingData = true; - $("#reporting-spatialUnitChangeWarning").hide(); - $scope.timeseriesAdjustedOnSpatialUnitChange = false; - await $scope.updateAreasInDualList() - let validTimestamps = [] - // There might be different valid timestamps for the new spatial unit. - if($scope.selectedIndicator) { - validTimestamps = getValidTimestampsForSpatialUnit( selectedSpatialUnit ); - - // Check if the currently selected timestamps are also available for the new spatial unit. - // If one is not, deselect is and show an info to user - let selectedTimestamps_old = [...$scope.selectedTimestamps]; - $scope.selectedTimestamps = $scope.selectedTimestamps.filter( el => { - return validTimestamps.includes(el.name); - }); - // if any timestamp was deselected show a warning alert - // except for reachability template, it doesn't matter there - if(selectedTimestamps_old.length > $scope.selectedTimestamps.length && $scope.template.name != "A4-landscape-reachability") { - $("#reporting-spatialUnitChangeWarning").show(); - } - } else { - // without selected indicator we have to fall back to the last update of the new spatial unit - let mostRecentTimestampName = $scope.selectedSpatialUnit.metadata.lastUpdate; - validTimestamps.push(mostRecentTimestampName) - } - - if($scope.template.name === "A4-landscape-timeseries") { - // Similar procedure as with timestamps - let oldTimeseries = $scope.getFormattedDateSliderValues(true); - - let from = new Date($scope.dateSlider.result.from_value); - let to = new Date($scope.dateSlider.result.to_value); - let filteredTimeseries = validTimestamps.filter( el => { - let date = new Date(el); - date.setHours(0); // remove time-offset...TODO is there a better way? - return from <= date && date <= to; - }); - - let isEqualTimeseries = (oldTimeseries.dates.length == filteredTimeseries.length) && oldTimeseries.dates.every(function(element, index) { - return element === filteredTimeseries[index]; - }); - - if( !isEqualTimeseries) { - // timeseries changed - $("#reporting-spatialUnitChangeWarning").show(); - // try to set slider to previously selected timestamps - if(validTimestamps.includes(oldTimeseries.from) && validTimestamps.includes(oldTimeseries.to)) { - $scope.dateSlider = $scope.initializeDateRangeSlider( validTimestamps, filteredTimeseries[0], filteredTimeseries.at(-1)); - } else { - $scope.dateSlider = $scope.initializeDateRangeSlider( validTimestamps ); - $scope.timeseriesAdjustedOnSpatialUnitChange = true; // show additional text in warning alert - } - } else { - // the selected part of the timeseries has the same dates so we don't have to show a warning - // but the timeseries could still include older or newer dates - $scope.dateSlider = $scope.initializeDateRangeSlider( validTimestamps, filteredTimeseries[0], filteredTimeseries.at(-1)); - } - } - - // prepare arrays for updateDualList - validTimestamps = validTimestamps.map( el => { - return { - properties: { - NAME: el - } - } - }); - let timestampsToSelect = $scope.selectedTimestamps.map( el => { - return { - properties: { - NAME: el.name - } - } - }); - - $scope.updateDualList($scope.dualListTimestampsOptions, validTimestamps, timestampsToSelect); - - - - // fire $watch('selectedAreas') function manually to remove pages - $scope.selectedAreas = []; - $scope.onSelectedAreasChanged( $scope.selectedAreas , undefined) - // updateAreasInDualList does not trigger diagram updates - // we have the wrong geometries set at this point, causing area selection to fail. - // echarts requires properties.name to be present, create it from properties.NAME unless it exists - let features; - if($scope.template.name == "A4-landscape-reachability") { - if($scope.selectedIndicator) { - features = $scope.availableFeaturesBySpatialUnit[ $scope.selectedSpatialUnit.spatialUnitName ]; - } else { - features = $scope.availableFeaturesBySpatialUnit[ $scope.selectedSpatialUnit.spatialUnitLevel ]; - } - features = $scope.createLowerCaseNameProperty(features); - $scope.geoJsonForReachability = { features: features } - } else { - features = $scope.availableFeaturesBySpatialUnit[ $scope.selectedSpatialUnit.spatialUnitName ]; - features = $scope.createLowerCaseNameProperty(features); - let geoJSON = { features: features } - $scope.selectedIndicator.geoJSON = geoJSON; - } - - - // no need to check if diagrams are prepared here since we have to prepare them again anyway - $timeout(async function() { - // prepare diagrams for all selected timestamps with all features - // Preparing all diagrams is not possible without an indicator, which might happen in the reachability template - // User selects a poi layer first and we set the most recent timestamp programmatically, triggering this function without selected Indicator - // We only need an echarts geoMap to show isochrones, POIs and spatial unit borders - if($scope.selectedIndicator) { - if($scope.template.name === "A4-landscape-reachability") { - $scope.reachabilityTemplateGeoMapOptions = $scope.prepareReachabilityEchartsMap(); - } else if ($scope.template.name === "A4-landscape-timeseries") { - let values = $scope.getFormattedDateSliderValues(true); - let classifyUsingWholeTimeseries = false; - let isTimeseries = true; - $scope.prepareDiagrams($scope.selectedIndicator, $scope.selectedSpatialUnit, values.to, classifyUsingWholeTimeseries, isTimeseries, values.from, values.to); - // prepare diagrams again for most recent timestamp of slider and for whole timeseries (changes). - classifyUsingWholeTimeseries = true; - isTimeseries = false; - $scope.prepareDiagrams($scope.selectedIndicator, $scope.selectedSpatialUnit, values.to, classifyUsingWholeTimeseries, isTimeseries, undefined, undefined); - } else { - for(let timestamp of $scope.selectedTimestamps) { - let classifyUsingWholeTimeseries = false; - let isTimeseries = false; - $scope.prepareDiagrams($scope.selectedIndicator, selectedSpatialUnit, timestamp.name, classifyUsingWholeTimeseries, isTimeseries, undefined, undefined); - } - } - } else { - $scope.reachabilityTemplateGeoMapOptions = $scope.prepareReachabilityEchartsMap(); - } - - await $scope.initializeAllDiagrams(); - if($scope.template.name !== "A4-landscape-reachability") { - // in reachability template we have to update leaflet maps, too - $scope.loadingData = false; - } - }); - } - - /** - * Updates the areas dual list data - * Queries DataManagement API if needed. - */ - $scope.updateAreasInDualList = async function() { - // this happens for the reachability template on poi selection - if(typeof($scope.selectedIndicator) === "undefined") { - let spatialUnit = $scope.selectedSpatialUnit ? - $scope.selectedSpatialUnit : - $scope.selectedIndicator.applicableSpatialUnits[0] - // query spatial unit features using the most recent date - let data = await $scope.queryFeatures(undefined, $scope.selectedSpatialUnit); - $scope.availableFeaturesBySpatialUnit[spatialUnit.spatialUnitLevel] = data.features - let allAreas = $scope.availableFeaturesBySpatialUnit[spatialUnit.spatialUnitLevel] - $scope.updateDualList($scope.dualListAreasOptions, allAreas, undefined) // don't select any areas - } else { - let indicator = $scope.selectedIndicator; - - let spatialUnit = $scope.selectedSpatialUnit ? - $scope.selectedSpatialUnit : - $scope.selectedIndicator.applicableSpatialUnits[0] - let indicatorId = indicator.indicatorId; - - // on indicator change - if($scope.availableFeaturesBySpatialUnit.indicatorId != indicator.indicatorId) { - // clear all cached features - $scope.availableFeaturesBySpatialUnit = {}; - $scope.availableFeaturesBySpatialUnit.indicatorId = indicatorId; - - let data = await $scope.queryFeatures(indicatorId, spatialUnit) - // save response to scope to avoid further requests - $scope.availableFeaturesBySpatialUnit[spatialUnit.spatialUnitName] = data.features - } else { - // same indicator - if (!$scope.availableFeaturesBySpatialUnit[spatialUnit.spatialUnitName]) { - let data = await $scope.queryFeatures(indicatorId, spatialUnit) - // save response to scope to avoid further requests - $scope.availableFeaturesBySpatialUnit[spatialUnit.spatialUnitName] = data.features - } - } - - let allAreas = $scope.availableFeaturesBySpatialUnit[spatialUnit.spatialUnitName] - $scope.updateDualList($scope.dualListAreasOptions, allAreas, undefined) // don't select any areas - - } - - $timeout(function(){ - $scope.$digest(); - }); - } - - /** - * Queries DataManagement API to get features of given indicator. - * If no indicator id is provided the spatial unit endpoint is queried - * Result is stored to scope to avoid further requests. - * @param {*} indicator | selected indicator - */ - $scope.queryFeatures = async function(indicatorId, spatialUnit) { - // build request - // query different endpoints depending on if we have an indicator or not - let url; - if(!indicatorId) { - let date = spatialUnit.metadata.lastUpdate.split("-") - let year = date[0] - let month = date[1] - let day = date[2] - url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + - "/spatial-units/" + spatialUnit.spatialUnitId + "/" + year + "/" + month + "/" + day; - } else { - url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + - "/indicators/" + indicatorId + "/" + spatialUnit.spatialUnitId; - } - // send request - return await $http({ - url: url, - method: "GET" - }).then(function successCallback(response) { - return response.data; - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - $scope.loadingData = false; - kommonitorDataExchangeService.displayMapApplicationError(error); - console.error(error); - }); - } - - /** - * - * @param {*} options | scope options obj for dualList to update - * @param {*} data | new data (all data, including entries that get selected and removed from left side), format like: - * - * [ - * { - * properties: { - * NAME: ... - * } - * }, { - * ... - * }] - * @param {*} selectedItems | optional, the items that should be selected after the update - */ - $scope.updateDualList = function(options, data, selectedItems) { - options.selectedItems = []; - - let dualListInput = data.map( el => { - return {"name": el.properties.NAME} // we need this as an object for kommonitorDataExchangeService.createDualListInputArray - }); - dualListInput = kommonitorDataExchangeService.createDualListInputArray(dualListInput, "name"); - options.items = dualListInput; - - // $timeout is needed because we want to click on an element to select it. - // therefore we have to wait until the dual list is updated and the dom node exists - $timeout( function() { - // if there are items to select - if(selectedItems && selectedItems.length > 0) { - // if all items should be selected we can use the "select all" button for better performance - if(data.length === selectedItems.length) { - let dualListBtnElement = undefined; - switch(options.label) { - case "Zeitpunkte": - dualListBtnElement = document.querySelectorAll("#reporting-indicator-add-timestamps-dual-list .duallistButton")[0]; - break; - case "Bereiche": - dualListBtnElement = document.querySelectorAll("#reporting-indicator-add-areas-dual-list .duallistButton")[0]; - break; - case "Raumebenen": - dualListBtnElement = document.querySelectorAll("#reporting-indicator-add-spatialUnits-dual-list .duallistButton")[0]; - break; - } - dualListBtnElement.click(); - } else { - for(let item of selectedItems) { - if(item.hasOwnProperty("properties")) { - if(item.properties.hasOwnProperty("NAME")) { - let name = item.properties.NAME - // remove item to select from left side and add to right side - // we can't filter programmatically here because the changes won't get applied to scope variables - // not even with $scope.$digest in a $timeout - // instead we click on the elements - // get dom element by name - let arr = []; - switch(options.label) { - case "Zeitpunkte": - arr = Array.from(document.querySelectorAll("#reporting-indicator-add-timestamps-dual-list a")); - break; - case "Bereiche": - arr = Array.from(document.querySelectorAll("#reporting-indicator-add-areas-dual-list a")); - break; - case "Raumebenen": - arr = Array.from(document.querySelectorAll("#reporting-indicator-add-spatialUnits-dual-list a")); - break; - } - let el = arr.find(el => { - return el.textContent.includes(name) - }); - el.click(); - } - } - } - } - } - }, 500); - } - - // availableFeaturesBySpatialUnit has to be populated before this method is called. - // Also it is only called in situations where an indicator is selected. - function getValidTimestampsForSpatialUnit(spatialUnit) { - - let validTimestamps = []; // result - // Iterate all features and add all properties that start with "DATE_" to 'validTimestamps' - let features = $scope.availableFeaturesBySpatialUnit[ spatialUnit.spatialUnitName ]; - if(!features) { - let error = new Error("Tried to get valid timestamps but no features were cached.") - kommonitorDataExchangeService.displayMapApplicationError(error.message) - } - for(let feature of features) { - let props = Object.keys(feature.properties) - props = props.filter( prop => { - return prop.startsWith("DATE_"); - }) - - for(let prop of props) { - let timestamp = prop.replace("DATE_", "") - if( !validTimestamps.includes(timestamp) ) { - validTimestamps.push(timestamp) - } - } - } - return validTimestamps; - } - - $scope.addIsochronesBboxProperties = function() { - // Calculates and adds a bbox property for each feature and for overall layer - // These do not exist if the type of movement is "buffer" ( = isochrones not generated by ors) - - let overallBbox = []; - let features = $scope.isochrones.features; - for(var i=0; i<$scope.isochrones.features.length; i++) { - - // calculate bbox for feature - if(!features[i].bbox || !features[i].bbox.length) { - features[i].properties.bbox = turf.bbox(features[i]); - } - - // check if we have to adjust overall bbox - if(overallBbox.length === 0) { - overallBbox.push(...features[i].properties.bbox) - } else { - let bbox = features[i].properties.bbox; - overallBbox[0] = (bbox[0] < overallBbox[0]) ? bbox[0] : overallBbox[0]; - overallBbox[1] = (bbox[1] < overallBbox[1]) ? bbox[1] : overallBbox[1]; - overallBbox[2] = (bbox[2] > overallBbox[2]) ? bbox[2] : overallBbox[2]; - overallBbox[3] = (bbox[3] > overallBbox[3]) ? bbox[3] : overallBbox[3]; - } - } - - $scope.isochrones.bbox = overallBbox; - } - - $scope.addIsochronesCenterLocationProperty = function() { - $scope.isochrones.centerLocations = []; - // We probably have multiple isochrones with the same center. - // Keep track of the value property and only calculate center coords once per isochrones group. - let firstIsochroneRangeValue = $scope.isochrones.features[0].properties.value; - for(let feature of $scope.isochrones.features) { - if(feature.properties.value === firstIsochroneRangeValue) { - // bbox format: [lower left lon, lower left lat, upper right lon, upper right lat] - if(! feature.properties.bbox){ - let bbox = turf.bbox(feature); // calculate bbox for each feature - feature.properties.bbox = bbox; - } - let bbox = feature.properties.bbox; - let centerLon = bbox[0] + ((bbox[2] - bbox[0]) / 2); - let centerLat = bbox[1] + ((bbox[3] - bbox[1]) / 2); - $scope.isochrones.centerLocations.push([centerLon, centerLat]) - } - - } - } - - $scope.$on("reportingIsochronesCalculationStarted", function(event) { - $scope.loadingData = true; - }); - - $scope.$on("reportingIsochronesCalculationFinished", function(event, isochrones) { - $scope.isochrones = isochrones; - if(checkNestedPropExists($scope.isochrones, 'info', 'query', 'profile')) - $scope.typeOfMovement = $scope.isochrones.info.query.profile; - else - $scope.typeOfMovement = "buffer"; - - if($scope.typeOfMovement === "buffer") { - $scope.isochronesRangeType = "distance"; - $scope.isochronesRangeUnits = "m"; - } else { - $scope.isochronesRangeType = $scope.isochrones.info.query.range_type; - $scope.isochronesRangeUnits = $scope.isochrones.info.query.units; - } - - // for type buffer the bbox field doesn't exist, so we have to create it. - $scope.addIsochronesBboxProperties() - if(!$scope.isochrones.centerLocations) - $scope.addIsochronesCenterLocationProperty() - - // Add a new property that is used as a unique id and can be used by echarts - // For buffer there is no group_index, so we use the ID - if($scope.typeOfMovement === "buffer") { - for(let feature of $scope.isochrones.features) { - feature.properties.echartsId = feature.properties.ID + "-" + feature.properties.value - } - } else { - for(let feature of $scope.isochrones.features) { - feature.properties.echartsId = feature.properties.group_index + "-" + feature.properties.value - } - } - - $scope.isochronesSeriesData = $scope.convertIsochronesToSeriesData($scope.isochrones); - - $scope.showResetIsochronesBtn =true; - - // TODO performance could be improved if we just iterate pages and update echarts - $scope.initializeAllDiagrams(); - $scope.loadingData = false; - }); - - $scope.resetIsochrones = function() { - $scope.isochrones = undefined; - $scope.typeOfMovement = undefined; - $scope.isochronesRangeType = undefined, - $scope.isochronesRangeUnits = undefined, - $scope.isochronesSeriesData = undefined - // TODO performance could be improved if we just iterate pages and update echarts - if($scope.diagramsPrepared) { - $scope.initializeAllDiagrams(); - } - $scope.showResetIsochronesBtn = false; - } - - - - $scope.onPoiLayerSelected = async function(poiLayer) { - - try { - $scope.absoluteLabelPositions = []; - $scope.diagramsPrepared = false; - $scope.isFirstUpdateOnIndicatorOrPoiLayerSelection = true; - $scope.selectedPoiLayer = poiLayer; - $scope.selectedPoiLayer.geoJSON = await $scope.queryMostRecentGeoresourceFeatures($scope.selectedPoiLayer) - - $scope.$broadcast("reportingPoiLayerSelected", $scope.selectedPoiLayer); - - // get a new template (in case another poi layer was selected previously) - $scope.template = $scope.getCleanTemplate(); - - // Indicator might not be selected at this point - // We get information about all available spatial units (instead of applicable ones) - // Then we select the highest one by default - let spatialUnits = await $scope.queryAllSpatialUnits(); - $scope.allSpatialUnitsForReachability = spatialUnits; // needed for spatial unit selection in 3rd tab - let highestSpatialUnit = spatialUnits.filter( unit => { - return unit.nextUpperHierarchyLevel === null; - }); - if( !$scope.selectedSpatialUnit) { - $scope.selectedSpatialUnit = highestSpatialUnit[0]; - } - let mostRecentTimestampName - if($scope.selectedSpatialUnit.metadata) { - mostRecentTimestampName = $scope.selectedSpatialUnit.metadata.lastUpdate; - } else { - // Happens when poiLayer is changed after an indicator was selected - // ( = spatial unit is the one from the indicator endpoint, not the spatial unit endpoint) - mostRecentTimestampName = $scope.allSpatialUnitsForReachability.filter( spatialUnit => { - return spatialUnit.spatialUnitId === $scope.selectedSpatialUnit.spatialUnitId - })[0].metadata.lastUpdate - } - $scope.selectedTimestamps = [{ - category: mostRecentTimestampName, - name: mostRecentTimestampName - }]; - - await $scope.updateAreasInDualList(); // this populates $scope.availableFeaturesBySpatialUnit - - - // update information in preview - for(let page of $scope.template.pages) { - for(let el of page.pageElements) { - if(el.type === "indicatorTitle-landscape") { - el.text = "Entfernungen für " + $scope.selectedPoiLayer.datasetName; - el.isPlaceholder = false; - // no area-specific pages in template since diagrams are not prepared yet - // and area/timestamp/timeseries changes are done after that - } - - if(el.type === "reachability-subtitle-landscape") { - el.text = $scope.selectedTimestamps[0].name; - if($scope.isochrones) - el.text += ", " + $scope.isochronesTypeOfMovementMapping[$scope.typeOfMovement]; - if($scope.selectedIndicator) - el.text += ", " + $scope.selectedIndicator.indicatorName; - el.isPlaceholder = false - } - } - } - - // get all features of largest spatial unit - let features; - if($scope.selectedIndicator) { - features = $scope.availableFeaturesBySpatialUnit[ $scope.selectedSpatialUnit.spatialUnitName ] - } else { - features = $scope.availableFeaturesBySpatialUnit[ $scope.selectedSpatialUnit.spatialUnitLevel ] - } - features = $scope.createLowerCaseNameProperty(features); - // we might have no indicator so we store the geometries directly on the scope - $scope.geoJsonForReachability = { - features: features - } - - // Preparing all diagrams is not possible without an indicator - // We only need an echarts geoMap to show isochrones, POIs and spatial unit borders - $scope.reachabilityTemplateGeoMapOptions = $scope.prepareReachabilityEchartsMap(); - - // select all areas by default - let allAreas; - if($scope.selectedSpatialUnit.spatialUnitName) { - allAreas = $scope.availableFeaturesBySpatialUnit[$scope.selectedSpatialUnit.spatialUnitName]; - } else { - allAreas = $scope.availableFeaturesBySpatialUnit[$scope.selectedSpatialUnit.spatialUnitLevel]; - } - $scope.updateDualList($scope.dualListAreasOptions, allAreas, allAreas); - - let allTabs = document.querySelectorAll("#reporting-add-indicator-tab-list li") - for(let tab of allTabs) { - $scope.enableTab(tab); - } - } catch (error) { - console.error(error); - kommonitorDataExchangeService.displayMapApplicationError(error); - $scope.loadingData = false; - } - - - } - - - function calculateOverallBoundingBoxFromGeoJSON(features) { - let result = []; - for(var i=0; i result[2]) ? bbox[2] : result[2]; - result[3] = (bbox[3] > result[3]) ? bbox[3] : result[3]; - } - } - return result; - }; - - - $scope.setMostRecentIndicatorDataToReachabilityMap = function(seriesOptions) { - let mostRecentTimestampName = $scope.selectedIndicator.applicableDates.at(-1); - let features; - if($scope.selectedSpatialUnit.spatialUnitName) { - features = $scope.availableFeaturesBySpatialUnit[$scope.selectedSpatialUnit.spatialUnitName] - } else { - features = $scope.availableFeaturesBySpatialUnit[$scope.selectedSpatialUnit.spatialUnitLevel] - } - let newSeriesData = features.map( feature => { - let name = feature.properties.NAME - let value = feature.properties["DATE_" + mostRecentTimestampName] - value = Math.round(value * 100) / 100; - return { - name: name, - value: value - } - }); - seriesOptions.data = newSeriesData; - return seriesOptions; - } - - $scope.resetOptionalIndicator = function() { - - if(!$scope.selectedIndicator) { - return; - } - - $scope.selectedIndicator = undefined; - // since we don't have an indicator selected anymore we reset the spatial unit - $scope.selectedSpatialUnit = $scope.allSpatialUnitsForReachability.filter( spatialUnit => { - return spatialUnit.spatialUnitLevel === $scope.selectedSpatialUnit.spatialUnitName; - })[0]; - - - // let filter = $scope.selectedIndicator.applicableSpatialUnits.filter( spatialUnit => { - // return spatialUnit.spatialUnitName === $scope.selectedSpatialUnit.spatialUnitLevel; - // }) - // $scope.selectedSpatialUnit = filter[0]; - - for(let page of $scope.template.pages) { - for(let pageElement of page.pageElements) { - if(pageElement.type === "map") { - let domNode = document.querySelector("#reporting-addIndicator-page-" + $scope.template.pages.indexOf(page) + "-map") - let map = echarts.getInstanceByDom(domNode) - let options = map.getOption(); - // remove indicator data - options.series[0].data = []; - options.series[0].label.formatter = '{b}'; - map.setOption(options, { - replaceMerge: ['series'] - }); - } - - if(pageElement.type === "reachability-subtitle-landscape") { - pageElement.text = $scope.selectedTimestamps[0].name; - if($scope.isochrones) { - pageElement.text += ", " + $scope.isochronesTypeOfMovementMapping[$scope.typeOfMovement]; - } - - pageElement.isPlaceholder = false - } - } - } - } - - $scope.handleIndicatorSelectForReachability = async function(indicator) { - $scope.selectedIndicator = indicator; - let indicatorId = $scope.selectedIndicator.indicatorId; - let featureCollection = await $scope.queryFeatures(indicatorId, $scope.selectedSpatialUnit); - if(!$scope.selectedSpatialUnit.spatialUnitName) { - // set the applicable spatial unit from the indicator as selected spatial unit - let filter = $scope.selectedIndicator.applicableSpatialUnits.filter( spatialUnit => { - return spatialUnit.spatialUnitName === $scope.selectedSpatialUnit.spatialUnitLevel; - }) - if(filter && filter.length) { - $scope.selectedSpatialUnit = filter[0]; - } - } - - $scope.availableFeaturesBySpatialUnit[$scope.selectedSpatialUnit.spatialUnitName] = featureCollection.features; - $scope.selectedIndicator.geoJSON = featureCollection; - $scope.selectedIndicator.geoJSON.features = $scope.createLowerCaseNameProperty($scope.selectedIndicator.geoJSON.features); - for(let feature of $scope.selectedIndicator.geoJSON.features) { - let bbox = turf.bbox(feature); // calculate bbox for each feature - feature.properties.bbox = bbox; - } - - for(let page of $scope.template.pages) { - for(let pageElement of page.pageElements) { - if(pageElement.type === "map") { - let domNode = document.querySelector("#reporting-addIndicator-page-" + $scope.template.pages.indexOf(page) + "-map") - let map = echarts.getInstanceByDom(domNode) - let options = map.getOption(); - let seriesOptions = $scope.setMostRecentIndicatorDataToReachabilityMap(options.series[0]) - options.series[0] = seriesOptions; - options.series[0].label.formatter = '{b}\n{c}'; - map.setOption(options, { - replaceMerge: ['series'] - }); - } - - if(pageElement.type === "reachability-subtitle-landscape") { - pageElement.text = $scope.selectedTimestamps[0].name; - if($scope.isochrones) { - pageElement.text += ", " + $scope.isochronesTypeOfMovementMapping[$scope.typeOfMovement]; - } - pageElement.text += ", " + indicator.indicatorName; - pageElement.isPlaceholder = false; - } - } - } - $scope.loadingData = false; - $timeout(function(){ - $scope.$digest(); - }); - - } - - $scope.onIndicatorSelected = async function(indicator) { - try { - $scope.loadingData = true; - if($scope.template.name === "A4-landscape-reachability") { - $scope.handleIndicatorSelectForReachability(indicator); - return; - } - - $scope.selectedIndicator = undefined; - $scope.selectedTimestamps = []; - $scope.selectedAreas = []; - $scope.selectedSpatialUnit = undefined; - $scope.availableFeaturesBySpatialUnit = {}; - $scope.absoluteLabelPositions = []; - $scope.echartsOptions = { - map: {}, - bar: {}, - line: {} - } - $scope.diagramsPrepared = false; - // set indicator manually. - // if we use ng-model it gets converted to string instead of an object - $scope.selectedIndicator = indicator; - - // get a new template (in case another indicator was selected previously) - $scope.template = $scope.getCleanTemplate(); - - // set spatial unit to highest available one - let spatialUnits = await $scope.queryAllSpatialUnits(); - // go from highest to lowest spatial unit and check if it is available. - for(let spatialUnit of spatialUnits) { - let applicableSpatialUnitsFiltered = $scope.selectedIndicator.applicableSpatialUnits.filter( (unit) => { - return unit.spatialUnitId === spatialUnit.spatialUnitId; - }) - - if(applicableSpatialUnitsFiltered.length === 1) { - $scope.selectedSpatialUnit = applicableSpatialUnitsFiltered[0]; - break; - } - } - - if(!$scope.selectedSpatialUnit) { - throw new Error("No applicable spatial unit found.") - } - - await $scope.updateAreasInDualList(); // this populates $scope.availableFeaturesBySpatialUnit - - // select most recent timestamp that is valid for the largest spatial unit - let dates = $scope.selectedIndicator.applicableDates; - let timestampsForSelectedSpatialUnit = getValidTimestampsForSpatialUnit( $scope.selectedSpatialUnit); - timestampsForSelectedSpatialUnit.sort(); - - let availableTimestamps = dates - .filter( name => { // filter dates to only show the ones valid for selected spatial unit - return timestampsForSelectedSpatialUnit.includes( name ) - }).map( name => { // then convert all timestamps to required format ("feature") - return { "properties": { "NAME": name } } - }) - - let mostRecentTimestampName = timestampsForSelectedSpatialUnit.at(-1); - let mostRecentTimestamp = availableTimestamps.filter( el => { - return el.properties.NAME === mostRecentTimestampName; - }) - - if($scope.template.name === "A4-landscape-timeseries") { - $scope.dateSlider = $scope.initializeDateRangeSlider( timestampsForSelectedSpatialUnit ); - } - // update information in preview - for(let page of $scope.template.pages) { - for(let el of page.pageElements) { - if(el.type === "indicatorTitle-landscape") { - el.text = indicator.indicatorName + " [" + indicator.unit + "]"; - el.isPlaceholder = false; - // no area-specific pages in template since diagrams are not prepared yet - // and area/timestamp/timeseries changes are done after that - } - - if(el.type === "dataTimestamp-landscape") { - el.text = mostRecentTimestampName; - el.isPlaceholder = false - } - - if(el.type === "dataTimeseries-landscape") { - let dsValues = $scope.getFormattedDateSliderValues() - el.text = dsValues.from + " - " + dsValues.to - el.isPlaceholder = false - } - } - } - - // get all features of largest spatial unit - let features = $scope.availableFeaturesBySpatialUnit[ $scope.selectedSpatialUnit.spatialUnitName ] - features = $scope.createLowerCaseNameProperty(features); - let geoJson = { - features: features - } - - // add new prop to indicator metadata, because it is expected that way by kommonitorVisualStyleHelperService - // used in prepareDiagrams - $scope.selectedIndicator.geoJSON = geoJson; - let classifyUsingWholeTimeseries = false; - let isTimeseries = false; - $scope.prepareDiagrams($scope.selectedIndicator, $scope.selectedSpatialUnit, mostRecentTimestampName, classifyUsingWholeTimeseries, isTimeseries, undefined, undefined); - // We have to update time and areas. Usually both of these would result in a diagram update. - // We want to skip the first one and only update diagrams once everything is ready for better performance. - $scope.isFirstUpdateOnIndicatorOrPoiLayerSelection = true; - if($scope.template.name === "A4-landscape-timeseries") { - // This is an exception from the process above - $scope.isFirstUpdateOnIndicatorOrPoiLayerSelection = false; - classifyUsingWholeTimeseries = false; - let values = $scope.getFormattedDateSliderValues(); - let isTimeseries = true; - $scope.prepareDiagrams($scope.selectedIndicator, $scope.selectedSpatialUnit, mostRecentTimestampName, classifyUsingWholeTimeseries, isTimeseries, values.from, values.to); - } else { - $scope.updateDualList($scope.dualListTimestampsOptions, availableTimestamps, mostRecentTimestamp) - } - - // select all areas by default - let allAreas = $scope.availableFeaturesBySpatialUnit[$scope.selectedSpatialUnit.spatialUnitName]; - $scope.updateDualList($scope.dualListAreasOptions, allAreas, allAreas); - - let allTabs = document.querySelectorAll("#reporting-add-indicator-tab-list li") - for(let tab of allTabs) { - $scope.enableTab(tab); - } - } catch (error) { - console.error(error); - kommonitorDataExchangeService.displayMapApplicationError(error); - $scope.loadingData = false; - } - } - - $scope.getCleanTemplate = function() { - let result = angular.fromJson($scope.untouchedTemplateAsString); - for(let page of result.pages) { - page.id = $scope.templatePageIdCounter++; - } - return result; - } - - $scope.onBackToOverviewClicked = function() { - $scope.reset(); - $scope.$emit('reportingBackToOverviewClicked') - - } - - $scope.reset = function() { - $scope.template = undefined; - $scope.untouchedTemplateAsString = ""; - $scope.indicatorNameFilter = ""; - $scope.poiNameFilter = ""; - $scope.availableIndicators = []; - $scope.selectedIndicator = undefined; - $scope.availableFeaturesBySpatialUnit = {}; - $scope.selectedSpatialUnit = undefined; - $scope.selectedAreas = []; - $scope.selectedTimestamps = []; - $scope.indexOfFirstAreaSpecificPage = undefined; - $scope.echartsOptions = { - map: {}, - bar: {}, - line: {}, - } - $scope.loadingData = false; - $scope.templatePageIdCounter = 1; - $scope.dateSlider = undefined; - $scope.echartsRegisteredMapNames = []; - - for(let i=2;i<7;i++) { - let tab = document.querySelector("#reporting-add-indicator-tab" + i); - $scope.disableTab(tab); - } - } - - $scope.onAddBtnClicked = function() { - // for each page: add echarts configuration objects to the template - for(let [idx, page] of $scope.template.pages.entries()) { - let pageDom = document.querySelector("#reporting-addIndicator-page-" + idx); - - for(let pageElement of page.pageElements) { - - let pElementDom; - if(pageElement.type === "linechart") { - let arr = pageDom.querySelectorAll(".type-linechart"); - if(pageElement.showPercentageChangeToPrevTimestamp) { - pElementDom = arr[1]; - } else { - pElementDom = arr[0]; - } - } else { - pElementDom = pageDom.querySelector("#reporting-addIndicator-page-" + idx + "-" + pageElement.type) - } - - if(pageElement.type === "map" || pageElement.type === "barchart" || pageElement.type === "linechart") { - let instance = echarts.getInstanceByDom( pElementDom ); - let options = JSON.parse(JSON.stringify( instance.getOption() )); - pageElement.echartsOptions = options; - - // for reachability we also have the leaflet bbox stored already - // store legend for first page - } - - if(pageElement.type === "datatable") { - // add some properties so we can recreate the table later - let columnHeaders = pageDom.querySelectorAll("th"); - let columnNames = []; - for(let header of columnHeaders) { - columnNames.push(header.innerText); - } - pageElement.columnNames = columnNames; - let tableData = []; - let rows = pageDom.querySelectorAll("tbody tr"); - for(let row of rows) { - let rowData = []; - let fields = row.querySelectorAll("td"); - for(let field of fields) { - rowData.push(field.innerText); - } - tableData.push(rowData); - } - pageElement.tableData = tableData; // [ [...], [...], [...] ] - } - } - } - if($scope.selectedSpatialUnit.spatialUnitName) { - $scope.template.spatialUnitName = $scope.selectedSpatialUnit.spatialUnitName; - }else { - $scope.template.spatialUnitName = $scope.selectedSpatialUnit.spatialUnitLevel; - } - $scope.template.absoluteLabelPositions = $scope.absoluteLabelPositions; - $scope.template.echartsRegisteredMapNames = [...new Set($scope.echartsRegisteredMapNames)]; - $scope.template.isochronesRangeType = $scope.isochronesRangeType; - $scope.template.isochronesRangeUnits = $scope.isochronesRangeUnits; - if($scope.template.name !== "A4-landscape-reachability") { - $scope.$emit('reportingAddNewIndicatorClicked', [$scope.selectedIndicator, $scope.template]) - } else { - $scope.$emit('reportingAddNewPoiLayerClicked', [$scope.selectedPoiLayer, $scope.selectedIndicator, $scope.template]) - } - $scope.reset(); - } - - $scope.enableTab = function(tab) { - tab.classList.remove("tab-disabled") - tab.firstElementChild.removeAttribute("tabindex") - } - - $scope.disableTab = function(tab) { - tab.classList.add("tab-disabled") - tab.firstElementChild.setAttribute("tabindex", "1") - } - - // creates and returns a series data array for each range threshold - $scope.convertIsochronesToSeriesData = function(isochrones) { - let result = [] // array of series data config objects - let ranges = [] - if( checkNestedPropExists(isochrones, "info", "query", "profile") ) { - ranges = isochrones.info.query.ranges.split(",") - } else if( isochrones.hasOwnProperty("features")) { // for buffer - for(let feature of isochrones.features) { - if(checkNestedPropExists(feature, "properties", "value") && typeof(feature.properties.value) === "number" ) { - ranges.push(feature.properties.value) - } - } - ranges = [...new Set(ranges)] // remove dupes - } - if(!ranges || ranges.length === 0) { - throw new Error("Could not determine ranges from isochrones. Is the format correct?") - } - let rangesInt = ranges.map( e => parseInt(e)); // assuming we only get integer values as input here - let colorArr = []; - if(ranges.length === 1) colorArr.push("green"); - if(ranges.length === 2) colorArr.push( ...["green", "yellow"] ) - if(ranges.length === 3) colorArr.push( ...["green", "yellow", "red"] ) - if(ranges.length === 4) colorArr.push( ...["green", "yellow", "orange", "red"] ) - // If we have more than five ranges the last color is used again for now. Can be extended if there is need for it. - if(ranges.length >= 5) colorArr.push( ...["green", "yellow", "orange", "red", "brown"] ) - - // one series per range value, so we can control the z value and legend display more easily. - for(let [idx, range] of rangesInt.entries()) { - if(idx >= colorArr.length) idx = colorArr.length-1; - let seriesData = []; - let data = isochrones.features.filter( feature => { - return feature.properties.value === range; // get features for this range threshold - }).map( feature => { - - return { - name: feature.properties.echartsId, - value: feature.properties.value, - itemStyle: { - areaColor: colorArr[idx], - color: colorArr[idx], - opacity: 0.3 - }, - label: { - show: false - }, - emphasis: { - disabled: true - } - } - }) - seriesData.push(...data) - result.push(seriesData); - } - - return result; - } - - $scope.createMapForReachability = async function(wrapper, page, pageElement) { - - let options = JSON.parse(JSON.stringify( $scope.reachabilityTemplateGeoMapOptions )); - // add indictor data if it is available - if($scope.selectedIndicator) { - options.series[0] = $scope.setMostRecentIndicatorDataToReachabilityMap(options.series[0]) - options.series[0].label.formatter = '{b}\n{c}'; - } - - // register a new echarts map with a unique name (needed when filtering by area) - // check if there is a map registered for this combination, if not register one with all features - let mapName = $scope.selectedPoiLayer.datasetName + "_" + $scope.selectedSpatialUnit.spatialUnitId; - if(page.area && page.area.length) - mapName += "_" + page.area - if(!$scope.echartsRegisteredMapNames.includes(mapName)) { - echarts.registerMap(mapName, $scope.geoJsonForReachability) - $scope.echartsRegisteredMapNames.push(mapName) - } - - options.series[0].map = mapName; - options.geo.map = mapName - - // Add isochrones if possible - // In echarts one map can only handle one series - // But we need the isochrones in different series to control their z-indexes (show smaller isochrones above larger ones) - // That's why we need to register one map per range threshold, that only contains a subset of isochrones. - if($scope.isochrones) { - for(let seriesData of $scope.isochronesSeriesData) { - let range = seriesData[0].value; - let registeredMap = echarts.getMap($scope.selectedPoiLayer.datasetName + "_isochrones-" + range) - if( !registeredMap ) { - let isochrones = $scope.isochrones.features.filter( feature => { - return feature.properties.value === range; - }) - let featureCollection = { - features: isochrones - } - echarts.registerMap($scope.selectedPoiLayer.datasetName + "_isochrones-" + range, featureCollection) - $scope.echartsRegisteredMapNames.push($scope.selectedPoiLayer.datasetName + "_isochrones-" + range) - } - } - - let bbox = $scope.isochrones.bbox; // [left, bottom, right, top] - let isochronesBboxForEcharts = [[bbox[0], bbox[3]], [bbox[2], bbox[1]]] // [left, top], [right, bottom] - - - for(let [idx, seriesData] of $scope.isochronesSeriesData.entries()) { - let series = { - name: "isochrones-" + seriesData[0].value, - type: 'map', - roam: false, - left: 0, top: 0, right: 0, bottom: 0, - boundingCoords: isochronesBboxForEcharts, - map: $scope.selectedPoiLayer.datasetName + "_isochrones-" + seriesData[0].value, - nameProperty: 'echartsId', - cursor: "default", - select: { - disabled: true - }, - z: 90 - idx, // first one has smallest threshold and gets highest index - data: seriesData - } - options.series.push(series) - } - } - - // Add poi markers as additional series - let centerPointSeriesData = $scope.selectedPoiLayer.geoJSON.features.map( feature => { - return feature.geometry.coordinates; - }); - - let centerPointSeries = { - name: 'centerPoints', - type: 'scatter', - coordinateSystem: 'geo', - symbol: "image://icons/marker-icon.png", - symbolSize: [17, 26], - symbolOffset: [0, '-50%'], - itemStyle: { - opacity: 1 - }, - cursor: "default", - data: centerPointSeriesData, - label: { - show: false, - }, - emphasis: { - disabled: true - }, - z: 200 - } - options.series.push(centerPointSeries) - - let map = echarts.init( wrapper ) - - // label positioning - options = enableManualLabelPositioningAcrossPages(page, options, map) - - map.setOption( options, { - replaceMerge: ['series', 'geo'] - }) - - // initialize the leaflet map beneath the transparent-background echarts map - await $timeout(async function(page, pageElement, echartsMap) { - let pageIdx = $scope.template.pages.indexOf(page); - let id = "reporting-addPoiLayer-reachability-leaflet-map-container-" + pageIdx; - let pageDom = document.getElementById("reporting-addIndicator-page-" + pageIdx); - let pageElementDom = document.getElementById("reporting-addIndicator-page-" + pageIdx + "-map"); - let oldMapNode = document.getElementById(id); - if(oldMapNode) { - oldMapNode.remove(); - } - let div = document.createElement("div"); - div.id = id; - div.style.position = "absolute"; - div.style.left = pageElement.dimensions.left; - div.style.top = pageElement.dimensions.top; - div.style.width = pageElement.dimensions.width; - div.style.height = pageElement.dimensions.height; - div.style.zIndex = 10; - pageDom.appendChild(div); - let echartsOptions = echartsMap.getOption(); - - let leafletMap = L.map(div.id, { - zoomControl: false, - dragging: false, - doubleClickZoom: false, - boxZoom: false, - trackResize: false, - attributionControl: false, - // prevents leaflet form snapping to closest pre-defined zoom level. - // In other words, it allows us to set exact map extend by a (echarts) bounding box - zoomSnap: 0 - }); - // manually create a field for attribution so we can control the z-index. - let prevAttributionDiv = pageDom.querySelector(".map-attribution") - if(prevAttributionDiv) prevAttributionDiv.remove(); - let attrDiv = document.createElement("div") - attrDiv.classList.add("map-attribution") - attrDiv.style.position = "absolute"; - attrDiv.style.bottom = 0; - attrDiv.style.left = 0; - attrDiv.style.zIndex = 800; - let attrImg = await kommonitorDiagramHelperService.createReportingReachabilityMapAttribution(); - attrDiv.appendChild(attrImg); - pageElementDom.appendChild(attrDiv); - // also create the legend manually - let prevLegendDiv = pageDom.querySelector(".map-legend") - if(prevLegendDiv) prevLegendDiv.remove(); - let legendDiv = document.createElement("div") - legendDiv.classList.add("map-legend") - legendDiv.style.position = "absolute"; - legendDiv.style.bottom = 0; - legendDiv.style.right = 0; - legendDiv.style.zIndex = 800; - let legendImg = await kommonitorDiagramHelperService.createReportingReachabilityMapLegend(echartsOptions, $scope.selectedSpatialUnit, $scope.isochronesRangeType, $scope.isochronesRangeUnits); - legendDiv.appendChild(legendImg); - pageElementDom.appendChild(legendDiv) - - // echarts uses [lon, lat], leaflet uses [lat, lon] - let boundingCoords = echartsOptions.series[0].boundingCoords; - let westLon = boundingCoords[0][0]; - let southLat = boundingCoords[1][1]; - let eastLon = boundingCoords[1][0]; - let northLat = boundingCoords[0][1]; - - if(page.area && page.area.length) { - for(let feature of $scope.geoJsonForReachability.features) { - if(feature.properties.NAME === page.area) { - // set bounding box to this feature - let featureBbox = feature.properties.bbox; - westLon = featureBbox[0]; - southLat = featureBbox[1]; - eastLon = featureBbox[2]; - northLat = featureBbox[3]; - break; - } - } - } - - // Add 2% space on all sides - let divisor = 50; - let bboxHeight = northLat - southLat; - let bboxWidth = eastLon - westLon; - northLat += bboxHeight/divisor; - southLat -= bboxHeight/divisor; - eastLon += bboxWidth/divisor; - westLon -= bboxWidth/divisor; - - leafletMap.fitBounds( [[southLat, westLon], [northLat, eastLon]] ); - let bounds = leafletMap.getBounds() - // now update every echarts series - boundingCoords = [ [bounds.getWest(), bounds.getNorth()], [bounds.getEast(), bounds.getSouth()]] - for(let series of echartsOptions.series) { - series.top = 0; - series.bottom = 0; - series.aspectScale = 0.625 - series.boundingCoords = boundingCoords - } - // also for the invisible geo component to update pois - echartsOptions.geo[0].top = 0; - echartsOptions.geo[0].bottom = 0; - echartsOptions.geo[0].aspectScale = 0.625 - echartsOptions.geo[0].boundingCoords = boundingCoords - - echartsMap.setOption(echartsOptions, { - notMerge: true - }); - - // Attribution is handled in a custom element - let osmLayer = new L.TileLayer.Grayscale("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"); - osmLayer.addTo(leafletMap); - - // add leaflet map to pageElement in case we need it again later - pageElement.leafletMap = leafletMap; - - // can be used to check if positioning in echarts matches the one from leaflet - // let geoJsonLayer = L.geoJSON( $scope.geoJsonForReachability.features ) - // geoJsonLayer.addTo(leafletMap) - // let isochronesLayer = L.geoJSON( $scope.isochrones.features ) - // isochronesLayer.addTo(leafletMap); - // let poiMarkerLSource = { - // "type": "FeatureCollection", - // "features": [] - // } - // for(let lonLatArr of centers) { - // poiMarkerLSource.features.push({ - // "type": "Feature", - // "geometry": { - // "type": "Point", - // "coordinates": [ - // lonLatArr[0], - // lonLatArr[1] - // ] - // } - // }) - // } - // poiMarkerLayer = L.geoJSON( poiMarkerLSource ) - // poiMarkerLayer.addTo(leafletMap); - - pageElement.leafletBbox = bounds; - - if(pageIdx === $scope.template.pages.length-1) { - $scope.loadingData = false; - } - }, 0, true, page, pageElement, map) - - return map; - } - - /** - * Creates and returns an echarts geoMap object. - * @param {*} wrapper | the dom element (most likely a div) where the map should be inserted - * @param {*} pageElement - * @returns - */ - $scope.createPageElement_Map = async function(wrapper, page, pageElement) { - - if($scope.template.name === "A4-landscape-reachability") { - let map = await $scope.createMapForReachability(wrapper, page, pageElement); - return map; - } - - // check if there is a map registered for this combination, if not register one with all features - let mapName = undefined; - let timestamp = undefined; - - // get the timestamp from pageElement, not from dom because dom might not be up to date yet - let dateElement; - if($scope.template.name === "A4-landscape-reachability") { - dateElement = page.pageElements.find( el => { - return el.type === "reachability-subtitle-landscape"; - }); - timestamp = dateElement.text.split(",")[0]; - } else { - // the other two templates - dateElement = page.pageElements.find( el => { - // pageElement references the map here - // do the comparison like this because we have maps with dataTimestamp and dataTimeseries in the timeseries template - return el.type === (pageElement.isTimeseries ? "dataTimeseries-landscape" : "dataTimestamp-landscape"); - }) - - if(pageElement.isTimeseries) { - timestamp = dateElement.text.split(" - ")[1]; // get the recent timestamp - } else { - timestamp = dateElement.text; - } - } - - if($scope.template.name === "A4-landscape-reachability") { - mapName = $scope.selectedIndicator.indicatorId + "_" + timestamp + "_" + $scope.selectedSpatialUnit.spatialUnitName; - } else { - mapName = $scope.selectedIndicator.indicatorId + "_" + dateElement.text + "_" + $scope.selectedSpatialUnit.spatialUnitName; - } - - if(pageElement.classify) - mapName += "_classified"; - if(pageElement.isTimeseries) - mapName += "_timeseries" - if(page.area && page.area.length) - mapName += "_" + page.area - - if(!$scope.echartsRegisteredMapNames.includes(mapName)) { - echarts.registerMap(mapName, $scope.selectedIndicator.geoJSON) - $scope.echartsRegisteredMapNames.push(mapName) - } - - - let map = echarts.init( wrapper ); - if(pageElement.isTimeseries) { - timestamp += "_relative" - } - let options = JSON.parse(JSON.stringify( $scope.echartsOptions.map[timestamp] )); - - // default changes for all reporting maps - options.title.show = false; - options.grid = undefined; - options.visualMap.axisLabel = { "fontSize": 10 }; - options.toolbox.show = false; - options.visualMap.left = "right"; - let series = options.series[0]; - series.roam = false; - series.selectedMode = false; - - - - if(pageElement.isTimeseries) { - let includeInBetweenDates = true; - let timeseries = $scope.getFormattedDateSliderValues(includeInBetweenDates) - series.data = $scope.calculateSeriesDataForTimeseries($scope.selectedIndicator.geoJSON.features, timeseries) - } - - series.map = mapName; // update the map with the one registered above - series.name = mapName; - - let areaNames = $scope.selectedAreas.map( el => { - return el.name; - }); - - if(pageElement.classify === true) { - options.visualMap.show = true; - } else { - options.visualMap.show = false; - } - - series.data.forEach( el => { - el.itemStyle = el.itemStyle ? el.itemStyle : {}; - el.emphasis = el.emphasis ? el.emphasis : {}; - el.emphasis.itemStyle = el.emphasis.itemStyle ? el.emphasis.itemStyle : {}; - el.label = el.label ? el.label : {}; - el.visualMap = false; - - if(pageElement.classify === false) { - if( areaNames.includes(el.name) ) { - // show selected areas (don't classify color by value) - el.label.formatter = '{b}\n{c}'; - el.label.show = true; - el.label.textShadowColor = '#ffffff'; - el.label.textShadowBlur = 2; - el.itemStyle.areaColor = "rgb(255, 153, 51, 0.6)"; - el.itemStyle.color = "rgb(255, 153, 51, 0.6)"; - el.emphasis.itemStyle.areaColor = "rgb(255, 153, 51, 0.6)"; - el.emphasis.itemStyle.color = "rgb(255, 153, 51, 0.6)"; - } else { - // Only show borders for any other areas - el.itemStyle.color = "rgba(255, 255, 255, 0)"; - el.itemStyle.areaColor = "rgba(255, 255, 255, 0)"; - el.emphasis.itemStyle.color = "rgba(255, 255, 255, 0)"; - el.emphasis.itemStyle.areaColor = "rgba(255, 255, 255, 0)"; - el.label.show = false; - } - } - - if(pageElement.classify === true) { - - if( areaNames.includes(el.name) ) { - el.visualMap = true; - el.label.formatter = '{b}\n{c}'; - // get color from visual map to overwrite yellow color - let color = "rgba(0, 0, 0, 0.5)"; - let opacity = 1; - for(let [idx, piece] of options.visualMap.pieces.entries()) { - // for the last index (highest value) value can equal the upper boundary - if(idx === (options.visualMap.pieces.length-1)) { - if(piece.min <= el.value && el.value <= piece.max) { - color = piece.color; - opacity = piece.opacity; - break; - } - } - - // for all other pieces check if it is withing the boundaries, (including lower one, excluding upper one) - if(piece.min <= el.value && el.value < piece.max) { - color = piece.color; - opacity = piece.opacity; - break; - } - } - el.label.show = true; - el.itemStyle.color = color; - el.itemStyle.areaColor = color; - el.itemStyle.opacity = opacity; - el.emphasis.itemStyle.color = color; - el.emphasis.itemStyle.areaColor = color; - el.emphasis.itemStyle.opacity = opacity; - el.label.textShadowColor = '#ffffff'; - el.label.textShadowBlur = 2; - } else { - el.visualMap = false; - el.itemStyle.color = "rgb(255, 255, 255)"; - el.itemStyle.areaColor = "rgb(255, 255, 255)"; - el.emphasis.itemStyle.color = "rgb(255, 255, 255)"; - el.emphasis.itemStyle.areaColor = "rgb(255, 255, 255)"; - el.label.show = false; - } - } - }) - - - // label positioning - options = enableManualLabelPositioningAcrossPages(page, options, map) - - map.setOption(options); - return map; - } - - function enableManualLabelPositioningAcrossPages(page, options, map) { - if(!page.area) { - options.labelLayout = function(feature) { - if(feature.seriesIndex != 0) { // index 0 are the borders / indicator - return; - } - // Set fixed position for labels that were previously dragged by user - // For all other labels try to avoid overlaps - let names = $scope.absoluteLabelPositions.map(el=>el.name) - let text = feature.text.split("\n")[0] // area name is the first line - if(names.includes(text)) { - let idx = names.indexOf(text) - return { - x: $scope.absoluteLabelPositions[idx].x, - y: $scope.absoluteLabelPositions[idx].y, - draggable: true - } - } else { - return { - moveOverlap: 'shiftY', - x: feature.rect.x + feature.rect.width / 2, - draggable: true - } - } - - } - - options.labelLine = { - show: true, - showAbove: false, - lineStyle: { - color: '#555' - } - } - - map.getZr().on('mousedown', function(event) { - // on label drag - if(event.target) { - let target = event.target; - if(target.parent && target.parent.type === "text") { - // get the feature which this label belongs to - // When user clicks on the label, one of the child elements is clicked - // Child elements can be something like: first line of text, second line of text, (white) label background - // These elements all have the same parent, which we can use to navigate to the parent and then find the correct child (area name) - let parent = target.parent; - let areaNameChild; - for(let child of parent._children) { - // we assume that the area name is the first child with text ("the first line") - if(child.style.text && child.style.text.length > 0) { - areaNameChild = child; - break; - } - } - $scope.draggingLabelForFeature = areaNameChild.style.text; - } - } - }); - - map.getZr().on('mouseup', function(event) { - if(event.target) { - let target = event.target; - if(target.parent && target.parent.type === "text") { - // for all other maps, that are not area-specific, do the exact same label drag - let newX = target.parent.x; - let newY = target.parent.y; - let names = $scope.absoluteLabelPositions.map(el=>el.name) - if(names.includes($scope.draggingLabelForFeature)) { - let idx = names.indexOf($scope.draggingLabelForFeature); - $scope.absoluteLabelPositions[idx].x = newX; - $scope.absoluteLabelPositions[idx].y = newY; - } else { - $scope.absoluteLabelPositions.push({ - name: $scope.draggingLabelForFeature, - x: newX, - y: newY - }) - } - - for(let [idx, page] of $scope.template.pages.entries()) { - for(let pageElement of page.pageElements) { - if(pageElement.type === "map" && !page.area) { - let domNode = document.getElementById("reporting-addIndicator-page-" + idx + "-map"); - let map = echarts.getInstanceByDom(domNode); - map.setOption(map.getOption()); // this calls the labelLayout function defined above - } - } - } - } - } - }); - } - return options; - } - - $scope.createPageElement_Average = function(page, pageElement, calcForSelection) { - // get the timestamp from pageElement, not from dom because dom might not be up to date yet - // no timeseries possible for this type of element - let dateElement = page.pageElements.find( el => { - return el.type === "dataTimestamp-landscape"; - }); - let timestamp = dateElement.text; - - let avg = $scope.calculateAvg( $scope.selectedIndicator, timestamp, calcForSelection ); - pageElement.text = avg; - pageElement.css = "border: solid 1px lightgray; padding: 2px;" - pageElement.isPlaceholder = false; - } - - - $scope.createPageElement_Change = function(page, pageElement, calcForSelection) { - // get the timeseries from slider, not from dom because dom might not be up to date yet - let timeseries = $scope.getFormattedDateSliderValues(true); - - let change = $scope.calculateChange( $scope.selectedIndicator, timeseries, calcForSelection ); - pageElement.text = change; - pageElement.css = "border: solid 1px lightgray; padding: 2px;"; - pageElement.isPlaceholder = false; - } - - $scope.createPageElement_BarChartDiagram = function(wrapper, page) { - - // get timestamp from pageElement, not from dom because dom might not be up to date yet - // barcharts are only used in timestamp templates so we don't have to check for timeseries for now - let dateElement = page.pageElements.find( el => { - return el.type === "dataTimestamp-landscape"; - }); - let timestamp = dateElement.text; - - let barChart = echarts.init( wrapper ); - let options = JSON.parse(JSON.stringify( $scope.echartsOptions.bar[timestamp] )); - - // default changes - options.xAxis.name = ""; - options.title.textStyle.fontSize = 12; - options.title.text = ""; - options.yAxis.axisLabel = { "fontSize": 10 }; - options.title.show = true; - options.grid.top = 35; - options.grid.bottom = 5; - options.toolbox.show = false; - options.visualMap[0].show = false; // only needed to set the color for avg - options.xAxis.axisLabel.show = true; - options.yAxis.name = ""; // included in header of each page - options.xAxis.name = ""; // always timestamps - // black text with halo effect for better visibility - if(!options.textStyle) options.textStyle = {}; - options.textStyle.color = "black"; - options.textStyle.textShadowColor = '#ffffff'; - options.textStyle.textShadowBlur = 2; - - // filter series data and xAxis labels - if(page.area && page.area.length) { - options.series[0].data = options.series[0].data.filter( el => { - return el.name === page.area; - }); - let areaNames = options.series[0].data.map( obj => obj.name) - options.xAxis.data = areaNames; - } else { - // only show selected areas in the "overview" diagram - let areaNames = $scope.selectedAreas.map( obj => obj.name ); - options.series[0].data = options.series[0].data.filter( el => { - return areaNames.includes(el.name); - }); - areaNames = options.series[0].data.map( obj => obj.name); - options.xAxis.data = areaNames; - } - - options.series[0].data.sort(function(a, b) { - if(typeof(a.value) == 'number' && typeof(b.value) == 'number') { - return a.value - b.value; - } else { - return -1 - } - }); - - // add data element for the overall average - let overallAvgValue = $scope.calculateAvg($scope.selectedIndicator, timestamp, false); - let overallAvgElementName = (page.area && page.area.length) ? "Durchschnitt\nder\nRaumeinheit" : "Durchschnitt der Raumeinheit"; - let dataObjOverallAvg = { - name: overallAvgElementName, - value: overallAvgValue, - opacity: 1 - } - // get color for avg from visual map and disable opacity - let colorOverallAvg = ""; - for(let piece of options.visualMap[0].pieces) { - if(piece.min <= dataObjOverallAvg.value && dataObjOverallAvg.value < piece.max) { - colorOverallAvg = piece.color; - } - piece.opacity = 1; - } - dataObjOverallAvg.color = colorOverallAvg; - options.series[0].data.push(dataObjOverallAvg); - options.xAxis.data.push( dataObjOverallAvg.name ); - - // same for selection average - // add more data elements for the overall and selection average - let selectionAvgValue = $scope.calculateAvg($scope.selectedIndicator, timestamp, true); - let selectionAvgElementName = (page.area && page.area.length) ? "Durchschnitt\nder\nSelektion" : "Durchschnitt der Selektion"; - let dataObjSelectionAvg = { - name: selectionAvgElementName, - value: selectionAvgValue, - opacity: 1 - } - // get color for avg from visual map and disable opacity - let colorSelectionAvg = ""; - for(let piece of options.visualMap[0].pieces) { - if(piece.min <= dataObjSelectionAvg.value && dataObjSelectionAvg.value < piece.max) { - colorSelectionAvg = piece.color; - } - piece.opacity = 1; - } - dataObjSelectionAvg.color = colorSelectionAvg; - options.series[0].data.push(dataObjSelectionAvg); - options.xAxis.data.push( dataObjSelectionAvg.name ) - - options.series[0].emphasis.itemStyle = {}; // don't show border on hover - - barChart.setOption(options, { - replaceMerge: ['series'] // take the new series data, don't update part of the old one - }); - return barChart; - } - - $scope.createPageElement_TimelineDiagram = function(wrapper, page, pageElement) { - // no need to get a timestamp here - - let lineChart = echarts.init( wrapper ); - let timeline = $scope.getFormattedDateSliderValues(true).dates; - // get standard options, create a copy of the options to not change anything in the service - let options = JSON.parse(JSON.stringify( $scope.echartsOptions.line )); - options.title.textStyle.fontSize = 12; - options.title.text = "Zeitreihe"; - options.yAxis.axisLabel = { "fontSize": 10 }; - options.xAxis.axisLabel = { "fontSize": 10 }; - options.legend.show = false; - options.grid.top = 35; - options.grid.bottom = 5; - options.title.show = true; - options.toolbox.show = false; - options.yAxis.name = ""; // included in header of each page - options.xAxis.name = ""; // always timestamps - - // diagram contains avg series by default - // if it should be shown we adjust it to our timeseries - // future dates (compared to max slider value) were already filtered in prepareDiagrams - // we have to remove dates older than min slider value here - // we also have to filter xAxis labels accordingly - let timeseries = $scope.getFormattedDateSliderValues(true); - let oldestSelectedTimestamp = timeseries.from; - let timestampsToRemoveCounter = 0; - // use the axis labels to find out how many data points have to be removed later - let timestampReached = false; - while(!timestampReached) { - if(oldestSelectedTimestamp === options.xAxis.data[0]) { - timestampReached = true; - } else { - options.xAxis.data.shift(); - timestampsToRemoveCounter += 1; - } - } - - if(pageElement.showAverage) { - options.series = options.series.filter( series => { - return series.name === "Arithmetisches Mittel" - }); - - for(let i=0; i { - return el.name; - }); - } - - for(let areaName of areaNames) { - let data = []; - let filtered = $scope.selectedIndicator.geoJSON.features.filter( feature => { - return feature.properties.NAME === areaName; - }); - - for(let timestamp of timeline) { - let value = filtered[0].properties["DATE_" + timestamp]; - data.push(value) - } - - let series = {}; - series.name = areaName; - series.type = "line"; - series.data = data; - series.lineStyle = { - normal: { - width: 2, - type: "solid" - } - } - series.itemStyle = { - normal: { - borderWidth: 3 - } - } - - options.series.push(series) - } - } - - if(pageElement.showPercentageChangeToPrevTimestamp) { - for(let series of options.series) { - series.data = $scope.transformSeriesDataToPercentageChange(series.data) - - - } - options.xAxis.data.shift(); - options.title.text = "Veränderung zum Vorjahr"; - } - - if(pageElement.showBoxplots) { - // we assume that boxplots are only shown when showAreas is false (might change in the future). - // so we have to get the data of all areas first - let areaNames = []; - areaNames = $scope.selectedAreas.map( el => { - return el.name; - }); - - // create a nested array with each inner array containing all area-values for one timestamp - let datasetSource = []; - for(let timestamp of timeline) { - let valuesForTimestamp = []; - // filter features to selected areas - let selectedAreasFeatures = $scope.selectedIndicator.geoJSON.features.filter( feature => { - return areaNames.includes( feature.properties.NAME ); - }); - // get values for each feature - for(let feature of selectedAreasFeatures) { - let value = feature.properties["DATE_" + timestamp] - valuesForTimestamp.push(value); - } - - datasetSource.push(valuesForTimestamp) - } - - let xAxisLabels = options.xAxis.data; - options.dataset = [ - { - source: datasetSource - }, - { - transform: { - type: 'boxplot', - config: { - // params is 0, 1, 2, ... - // we can use this as an index to get the actual label and return it - itemNameFormatter: function (params) { - return xAxisLabels[params.value]; - } - } - } - }, - { - fromDatasetIndex: 1, - fromTransformResult: 1 - } - ] - - // add a new series that references the boxplots - options.series.push({ - name: 'boxplot', - type: 'boxplot', - datasetIndex: 1 // overlap boxplots and avg. line - }) - } - - lineChart.setOption(options, { - replaceMerge: ['series'] // take the new series data, don't update part of the old one - }); - return lineChart; - } - - $scope.createPageElement_Datatable = function(wrapper, page) { - - // table looks different depending on template type - // for single timestamps it is added at the end of each timestamp-section, so each area is inserted once - // for timeseries it is added once at the end of the template and contains an extra column for timestamps. - // Each area is inserted for multiple timestamps. - - // our wrapper is 440px high. - // 440 - 25 (header) = 415 - // we set each row to be 25px high, so we can fit 415 / 25 --> 16 rows on one page. - let wrapperHeight = parseInt(wrapper.style.height, 10); - let maxRows = Math.floor( (wrapperHeight - 25) / 25); - let rowsData = []; - let timestamp = undefined; - let timeseries = undefined; - - if($scope.template.name === "A4-landscape-timestamp") { - // get the timestamp from pageElement, not from dom because dom might not be up to date yet - let dateElement = page.pageElements.find( el => { - return el.type === "dataTimestamp-landscape"; - }); - timestamp = dateElement.text; - } - - if($scope.template.name === "A4-landscape-timeseries") { - let inBetweenValues = true; - timeseries = $scope.getFormattedDateSliderValues(inBetweenValues); - } - - // see how many pages need to be added. Rows are added later - for(let feature of $scope.selectedIndicator.geoJSON.features) { - // don't add row if feature not selected - let isSelected = false; - for(let area of $scope.selectedAreas) { - if(area.name === feature.properties.NAME) { - isSelected = true; - } - } - if( !isSelected ) - continue; - - if($scope.template.name === "A4-landscape-timestamp") { - // get the timestamp from pageElement, not from dom because dom might not be up to date yet - let dateElement = page.pageElements.find( el => { - return el.type === "dataTimestamp-landscape"; - }); - let timestamp = dateElement.text; - // prepare data to insert later - let value = feature.properties["DATE_" + timestamp]; - if(typeof(value) == 'number') - value = Math.round( value * 100) / 100; - - rowsData.push( { - name: feature.properties.NAME, - value: value - }); - } - - if($scope.template.name === "A4-landscape-timeseries") { - for(let timestamp of timeseries.dates) { - let value = feature.properties["DATE_" + timestamp]; - if(typeof(value) == 'number') - value = Math.round( value * 100) / 100; - rowsData.push( { - name: feature.properties.NAME, - timestamp: timestamp, - value: value - }); - } - } - } - - // sort by area name - rowsData.sort((a, b) => a.name.localeCompare(b.name)) - - // append average as last row if needed - if($scope.template.name === "A4-landscape-timestamp") { - rowsData.push({ - name: "Durchschnitt Selektion", - value: $scope.calculateAvg($scope.selectedIndicator, timestamp, true) - }); - rowsData.push({ - name: "Durchschnitt Gesamtstadt", - value: $scope.calculateAvg($scope.selectedIndicator, timestamp, false) - }); - - } - - // the length of rowsData is the number of rows we have to add - for(let i=0;i 0 && i % maxRows == 0) { - // add a new page - let newPage = angular.fromJson($scope.untouchedTemplateAsString).pages.at(-1); - newPage.id = $scope.templatePageIdCounter++; - // setup new page - for(let pageElement of newPage.pageElements) { - - if(pageElement.type === "indicatorTitle-landscape") { - pageElement.text = $scope.selectedIndicator.indicatorName + " [" + $scope.selectedIndicator.unit + "]" - pageElement.isPlaceholder = false; - } - - if(pageElement.type === "dataTimestamp-landscape") { - pageElement.text = timestamp; - pageElement.isPlaceholder = false; - } - - // exists only on timeseries template (instead of dataTimestamp-landscape), so we don't need another if...else here - if(pageElement.type === "dataTimeseries-landscape") { - pageElement.text = timeseries.from + " - " + timeseries.to; - pageElement.isPlaceholder = false; - } - - if(pageElement.type === "datatable") { - pageElement.isPlaceholder = false; - } - } - - // insert after current one - let currentPageIndex = $scope.template.pages.indexOf(page) - $scope.template.pages.splice(currentPageIndex + 1, 0, newPage); - } - } - - - // create table rows once the pages exist - function insertDatatableRows(rowsData, page, maxRows) { - // get current index of page (might have changed in the meantime) - let idx = $scope.template.pages.indexOf(page) - let wrapper = document.querySelector("#reporting-addIndicator-page-" + idx + "-datatable"); - if(wrapper) { - $interval.cancel(insertDatatableRowsInterval); // code below still executes once - } else { - return; - } - - wrapper.innerHTML = ""; - wrapper.style.border = "none"; // hide dotted border from outer dom element - wrapper.style.justifyContent = "flex-start"; // align table at top instead of center - - let columnNames; - if($scope.template.name === "A4-landscape-timeseries") { - columnNames = ["Bereich", "Zeitpunkt", "Wert"] - } else { - columnNames = ["Bereich", "Wert"] - } - - let table = $scope.createDatatableSkeleton(columnNames); - wrapper.appendChild(table); - let tbody = table.querySelector("tbody"); - let pageElement = $scope.template.pages[idx].pageElements.find( el => el.type === "datatable"); - pageElement.isPlaceholder = false; - - for(let i=0;i 0) idx++ - const idx_save = idx; - const i_save = i; - intervalArr[idx_save] = $interval(insertDatatableRowsPerPage, 0, 100, true, pageElement, idx_save, columnNames, maxRows, rowsData, i_save) - - function insertDatatableRowsPerPage(pageElement, idx, columnNames, maxRows, rowsData, i) { - // check if page exists already in dom, if not try again later - wrapper = document.querySelector("#reporting-addIndicator-page-" + idx + "-datatable"); - if(wrapper) { - $interval.cancel(intervalArr[idx]); // code below still executes once - } else { - return; - } - // page exists - wrapper.innerHTML = ""; - wrapper.style.border = "none"; // hide dotted border from outer dom element - wrapper.style.justifyContent = "flex-start"; // align table at top instead of center - table = $scope.createDatatableSkeleton(columnNames); - wrapper.appendChild(table); - tbody = table.querySelector("tbody"); - pageElement = $scope.template.pages[idx].pageElements.find( el => el.type === "datatable"); - pageElement.isPlaceholder = false; - - for(let j=i; j<(i + maxRows); j++) { - if(!rowsData[j]) - break; // on last page - - let row = document.createElement("tr"); - row.style.height = "25px"; - - for(let colName of columnNames) { - let td = document.createElement("td"); - if(colName === "Bereich") { - td.innerText = rowsData[j].name; - td.classList.add("text-left"); - } - - if(colName === "Zeitpunkt") { - td.innerText = rowsData[j].timestamp; - } - - if(colName === "Wert") { - td.innerText = rowsData[j].value; - td.classList.add("text-right"); - } - - row.appendChild(td); - } - - tbody.appendChild(row) - } - } - } - } - } - - let insertDatatableRowsInterval = $interval(insertDatatableRows, 0, 100, true, rowsData, page, maxRows) - } - - - $scope.filterMapByAreaName = function(echartsInstance, areaName, allFeatures) { - let options = echartsInstance.getOption(); - let mapName = options.series[0].map; - // filter shown areas if we are in the area-specific part of the template - // removing areas form the series doesn't work. We have to filter the geojson of the registered map. - let features = allFeatures.filter ( el => { - return el.properties.name === areaName - }); - - echarts.registerMap(mapName, { features: features } ) - - // echart map bounds are defined by a bounding box, which has to be updated as well. - if(!features[0].properties.bbox){ - features[0].properties.bbox = turf.bbox(features[0]); - } - let bbox = features[0].properties.bbox; // [east, south, west, north] - - let newBounds = [[bbox[2], bbox[3]], [bbox[0], bbox[1]]] // [[west, north], [east, south]] - options.series[0].boundingCoords = newBounds; - echartsInstance.setOption(options, { - replaceMerge: ['series'] - }); - } - - $scope.calculateAvg = function(indicator, timestamp, calcForSelection) { - // calculate avg from geoJSON property, which should be the currently selected spatial unit - let features = indicator.geoJSON.features; - if(calcForSelection) { - features = features.filter( el => { - return $scope.selectedAreas.map(area=>area.name).includes( el.properties.NAME ) - }); - } - - let data = features.map( feature => { - return feature.properties["DATE_" + timestamp]; - }) - - let noDataCounter = 0 - let sum = 0; - for(let i=0; i { - return $scope.selectedAreas.map(area=>area.name).includes( el.name ) - }); - } - data = data.map(obj => obj.value) - let noDataCounter = 0 - let sum = 0; - for(let i=0; i1 ? $scope.template.pages[i-1] : undefined; - let pageIncludesDatatable = page.pageElements.map(el => el.type).includes("datatable") - - if(prevPage) { - let prevPageIncludesDatatable = prevPage.pageElements.map(el => el.type).includes("datatable") - if(pageIncludesDatatable && prevPageIncludesDatatable) { - // get corresponding pages in the dom and check if they are datatable-pages - let prevDomPageEl = document.querySelector("#reporting-addIndicator-page-" + (i-1) + "-datatable") - let domPageEl = document.querySelector("#reporting-addIndicator-page-" + i + "-datatable") - if(!prevDomPageEl || !domPageEl) { // if this page does not exist in the dom - pageIdx--; // don't increase index in this iteration so it stays in sync with the pages that exist in the dom - } - continue; // don't do anything for additional datatable pages. They are added in createPageElement_Datatable - } - } - - - let pageDom = document.querySelector("#reporting-addIndicator-page-" + pageIdx); - - for(let pageElement of page.pageElements) { - - // usually each type is included only once per page, but there is an exception for linecharts in area specific part of timeseries template - // for now we more or less hardcode this, but it might have to change in the future - let pElementDom; - if(pageElement.type === "linechart") { - let arr = pageDom.querySelectorAll(".type-linechart"); - if(pageElement.showPercentageChangeToPrevTimestamp) { - pElementDom = arr[1]; - } else { - pElementDom = arr[0]; - } - } else { - pElementDom = pageDom.querySelector("#reporting-addIndicator-page-" + pageIdx + "-" + pageElement.type) - } - - switch(pageElement.type) { - case "map": { - // initialize with all areas - let map = await $scope.createPageElement_Map(pElementDom, page, pageElement); - // filter visible areas if needed - if(page.area && page.area.length) { - if($scope.selectedIndicator) { - $scope.filterMapByAreaName(map, page.area, $scope.selectedIndicator.geoJSON.features); - } else { - $scope.filterMapByAreaName(map, page.area, $scope.geoJsonForReachability.features); - } - - } - pageElement.isPlaceholder = false; - break; - } - case "mapLegend": { - pageElement.isPlaceholder = false; // hide the placeholder, legend is part of map - pageDom.querySelector(".type-mapLegend").style.display = "none"; - break; - } - - case "overallAverage": { - $scope.createPageElement_Average(page, pageElement, false); - pageDom.querySelector(".type-overallAverage").style.border = "none"; - break; - } - case "selectionAverage": { - $scope.createPageElement_Average(page, pageElement, true); - pageDom.querySelector(".type-selectionAverage").style.border = "none"; - break; - } - case "overallChange": { - $scope.createPageElement_Change(page, pageElement, false); - let wrapper = pageDom.querySelector(".type-overallChange") - wrapper.style.border = "none"; - wrapper.style.left = "670px"; - wrapper.style.width = "130px"; - wrapper.style.height = "100px"; - break; - } - case "selectionChange": { - $scope.createPageElement_Change(page, pageElement, true); - let wrapper = pageDom.querySelector(".type-selectionChange") - wrapper.style.border = "none"; - wrapper.style.left = "670px"; - wrapper.style.width = "130px"; - wrapper.style.height = "100px"; - break; - } - case "barchart": { - $scope.createPageElement_BarChartDiagram(pElementDom, page); - pageElement.isPlaceholder = false; - break; - } - case "linechart": { - $scope.createPageElement_TimelineDiagram(pElementDom, page, pageElement); - pageElement.isPlaceholder = false; - break; - } - case "datatable": { - // remove all following datatable pages first so we don't add too many. - // this might happen because we initialize page elements from $watch(selectedAreas) and $watch(selectedTimestamps) on indicator selection - let nextPage = i<$scope.template.pages.length-1 ? $scope.template.pages[i+1] : undefined; - if(nextPage) { - let nextPageIncludesDatatable = nextPage.pageElements.map(el => el.type).includes("datatable") - while(nextPageIncludesDatatable) { - $scope.template.pages.splice(i+1, 1) //remove page - //update next page - nextPage = i<$scope.template.pages.length-1 ? $scope.template.pages[i+1] : undefined; - nextPageIncludesDatatable = nextPage ? nextPage.pageElements.map(el => el.type).includes("datatable") : false; - } - } - $scope.createPageElement_Datatable(pElementDom, page); - break; - } - } - } - } - } - - /** - * - * @param {*} geoJsonFeatures - * @param {*} timestamp - * @param {*} seriesData | Must have a property "name"; - * @returns - */ - $scope.getSeriesDataForTimestamp = function(geoJsonFeatures, timestamp, seriesData) { - // if parameter is present we want to keep it's properties - if(seriesData && seriesData.length) { - for(let dataEntry of seriesData) { - // just replace the value property - let feature = geoJsonFeatures.find( feature => { - return feature.properties.NAME === dataEntry.name; - }); - dataEntry.value = feature.properties["DATE_" + timestamp] - if(typeof(dataEntry.value) == 'number') { - dataEntry.value = Math.round( dataEntry.value * 100) / 100; - } - } - return seriesData; - - } else { - // seriesData is undefined, meaning we can create a new array - let result = []; - for(let feature of geoJsonFeatures) { - let obj = {}; - obj.name = feature.properties.NAME; - let value = feature.properties["DATE_" + timestamp] - if(typeof(value) == 'number') { - value = Math.round( value * 100) / 100; - } - obj.value = value; - - result.push(obj) - } - return result; - } - } - - function calculateAndSetSeriesDataForTimeseries(features, fromDate, toDate){ - - for(let feature of features) { - let value = feature.properties["DATE_" + toDate] - feature.properties["DATE_" + fromDate]; - if(typeof(value) == 'number') { - value = Math.round( value * 100) / 100; - } - feature.properties["DATE_" + toDate] = value; - } - - return features; - } - - $scope.calculateSeriesDataForTimeseries = function(features, timeseries) { - let result = []; - let mostRecentDate = timeseries.to; - let oldestDate = timeseries.from - - for(let feature of features) { - let obj = {}; - obj.name = feature.properties.name; - let value = feature.properties["DATE_" + mostRecentDate] - feature.properties["DATE_" + oldestDate]; - if(typeof(value) == 'number') { - value = Math.round( value * 100) / 100; - } - obj.value = value; - - result.push(obj); - } - return result; - } - - /** - * - * @param {*} features | features array in geojson - */ - $scope.createLowerCaseNameProperty = function(features) { - for(let feature of features) { - if(feature.hasOwnProperty("properties")) { - if(!feature.properties.hasOwnProperty("name")) { - let featureName = feature.properties.NAME; - feature.properties.name = featureName; - } - } - } - return features; - } - - - $scope.createDatatableSkeleton = function(colNamesArr) { - - let table = document.createElement("table"); - table.classList.add("table-striped") - table.classList.add("table-bordered") - - let thead = document.createElement("thead"); - let tbody = document.createElement("tbody"); - table.appendChild(thead); - table.appendChild(tbody); - - let headerRow = document.createElement("tr"); - - for(let colName of colNamesArr) { - let col = document.createElement("th"); - col.classList.add("text-center"); - col.innerText = colName; - headerRow.appendChild(col); - } - - headerRow.style.height = "25px"; - thead.appendChild(headerRow); - - return table; - } - - $scope.createDatesFromIndicatorDates = function(indicatorDates) { - let datesAsMs = []; - for (let i=0; i < indicatorDates.length; i++){ - // year-month-day - var dateComponents = indicatorDates[i].split("-"); - datesAsMs.push(kommonitorDataExchangeService.dateToTS(new Date(Number(dateComponents[0]), Number(dateComponents[1]) - 1, Number(dateComponents[2])))); - } - return datesAsMs; - } - - function prettifyDateSliderLabels (dateAsMs) { - return kommonitorDataExchangeService.tsToDate_withOptionalUpdateInterval(dateAsMs, $scope.selectedIndicator.metadata.updateInterval); - } - - $scope.onChangeDateSliderInterval = function() { - $scope.loadingData = true; - // needed to tell angular something has changed - $timeout(function(){ - $scope.$digest(); - }); - // setup all pages with the new timeseries - let values = $scope.getFormattedDateSliderValues(true); - // prepare diagrams again for most recent timestamp of slider and for whole timeseries (changes). - let classifyUsingWholeTimeseries = false; - let isTimeseries = true; - $scope.prepareDiagrams($scope.selectedIndicator, $scope.selectedSpatialUnit, values.to, classifyUsingWholeTimeseries, isTimeseries, values.from, values.to); - isTimeseries = false; - classifyUsingWholeTimeseries = true; - $scope.prepareDiagrams($scope.selectedIndicator, $scope.selectedSpatialUnit, values.to, classifyUsingWholeTimeseries, isTimeseries, undefined, undefined); - - // set dates on all pages according to new slider values - for(let page of $scope.template.pages) { - let dateEl = page.pageElements.find( el => { - return el.type === "dataTimestamp-landscape" || el.type === "dataTimeseries-landscape" - }); - - if(dateEl.type === "dataTimestamp-landscape") { - dateEl.text = values.to; - } - if(dateEl.type === "dataTimeseries-landscape") { - dateEl.text = values.from + " - " + values.to; - } - } - - function updateDiagrams() { - if($scope.diagramsPrepared) { - $interval.cancel(updateDiagramsInterval); // code below still executes once - } else { - return; - } - // diagrams are prepared, but dom has to be updated first, too - $timeout(async function() { - await $scope.initializeAllDiagrams(); - $scope.loadingData = false; - }) - - } - - let updateDiagramsInterval = $interval(updateDiagrams, 0, 100) - } - - $scope.getFormattedDateSliderValues = function(includeInBetweenValues) { - if(!$scope.dateSlider) - throw new Error("Tried to get dateslider values but dateslider was not defined."); - - let slider = $scope.dateSlider - let from = new Date(slider.result.from_value); - let to = new Date(slider.result.to_value); - - let inBetweenDates; - if(includeInBetweenValues) { - // get all valid timestamps for this spatial unit that lie in between from and to - let validTimestamps = getValidTimestampsForSpatialUnit( $scope.selectedSpatialUnit ); - inBetweenDates = validTimestamps.filter( el => { - let date = new Date(el); - date.setHours(0); // remove time-offset...TODO is there a better way? - return from < date && date < to; - }); - } - // append zeros to month and year if needed - let month = (from.getMonth()+1) // months start with 0 - let day = from.getDate(); - from = from.getFullYear() + "-"; - if( month < 10) from += "0"; - from += month + "-"; - if( day < 10) from += "0"; - from += day; - - month = (to.getMonth()+1) // months start with 0 - day = to.getDate(); - to = to.getFullYear() + "-"; - if( month < 10) to += "0"; - to += month + "-"; - if( day < 10) to += "0"; - to += day; - - let result = { - from: from, - to: to, - dates: includeInBetweenValues ? [from, ...inBetweenDates, to] : [] // all dates in the interval, including "from" and "to" - } - - return result; - } - - - $scope.initializeDateRangeSlider = function(availableDates, min, max) { - - if($scope.dateSlider){ - $scope.dateSlider.destroy(); - } - - let domNode = document.getElementById("reporting-dateSlider"); - - while (domNode.hasChildNodes()) { - domNode.removeChild(domNode.lastChild); - } - - //let mostRecentDate = availableDates[availableDates.length - 1]; - //let selectedDate = availableDates[availableDates.length - 1]; - - let datesAsMs = $scope.createDatesFromIndicatorDates(availableDates); - - // new Date() uses month between 0-11! - $("#reporting-dateSlider").ionRangeSlider({ - skin: "big", - type: "double", - grid: true, - values: datesAsMs, - from: 0, - to: availableDates.length-1, // index - force_edges: true, - prettify: prettifyDateSliderLabels, - onFinish: $scope.onChangeDateSliderInterval - }); - - let dateSlider = $("#reporting-dateSlider").data("ionRangeSlider"); - // make sure that the handles are properly set - let minIdx = 0; - let maxIdx = availableDates.length-1; - if(typeof(min) !== "undefined") - minIdx = availableDates.indexOf(min) - if(typeof(max) !== "undefined") - maxIdx = availableDates.indexOf(max); - - dateSlider.update({ - from: minIdx, - to: maxIdx - }); - return dateSlider; - } - - $scope.onChangeShowMapLabels = function() { - - for(let i=0; i<$scope.template.pages.length; i++) { - let map = document.querySelector("#reporting-addIndicator-page-" + i +"-map") - if(!map) { - continue; // no map on current page - } - - let instance = echarts.getInstanceByDom(map); - let options = instance.getOption(); - options.series[0].label.show = $scope.showMapLabels; - options.series[0].select.label.show = $scope.showMapLabels; - for(let item of options.series[0].data) { - if(typeof item.label === "undefined") { - item.label = {}; - } - item.label.show = $scope.showMapLabels; - } - instance.setOption(options, { - replaceMerge: ['series'] - }); - } - } - - $scope.validateConfiguration = function() { - // indicator has to be selected (unless template is reachability) - // at least one area has to be selected (unless template is reachability) - // for timestamps: - // at least one timestamp has to be selected - // for timeseries - // slider position must include at least two timestamps - let isIndicatorSelected = false; - let isAreaSelected = false; - let isTimestampSelected = false; - - if(!$scope.template) { - return false; - } - - if($scope.selectedIndicator || $scope.template.name === "A4-landscape-reachability") { - isIndicatorSelected = true; - } - if($scope.selectedAreas.length >= 1 || $scope.template.name === "A4-landscape-reachability") { - isAreaSelected = true; - } - - if( ($scope.template.name === "A4-landscape-timestamp" || $scope.template.name === "A4-landscape-reachability" ) && - $scope.selectedTimestamps.length >= 1) { - isTimestampSelected = true; - } - - if($scope.template.name === "A4-landscape-timeseries") { - if(!$scope.dateSlider) { - return false; - } - if( !$scope.availableFeaturesBySpatialUnit[ $scope.selectedSpatialUnit.spatialUnitName]) { - return false; - } - let timeseries = $scope.getFormattedDateSliderValues(true).dates; - if(timeseries.length >= 1) { - isTimestampSelected = true; // reuse variable here - } - } - - if(isIndicatorSelected && isAreaSelected && isTimestampSelected && !$scope.loadingData) { - return true; - } else { - return false; - } - - } - - $scope.transformSeriesDataToPercentageChange = function(dataArr) { - // we need at least two timestamps - if(dataArr.length <= 1) { - let error = new Error("Can not calculate percentage change from a single timestamp.") - kommonitorDataExchangeService.displayMapApplicationError(error.message); - } - let result = []; - for(let i=1; i obj && obj[level], obj) - } - } -]}) \ No newline at end of file + templateUrl: "components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingIndicatorAdd/reporting-indicator-add.template.html", + controller: ['$scope', '$http', '$timeout', '$interval', '__env', 'kommonitorDataExchangeService', 'kommonitorDiagramHelperService', 'kommonitorVisualStyleHelperService', + function ReportingIndicatorAddController($scope, $http, $timeout, $interval, __env, kommonitorDataExchangeService, kommonitorDiagramHelperService, kommonitorVisualStyleHelperService) { + $scope.template = undefined; + $scope.untouchedTemplateAsString = ""; + $scope.indicatorNameFilter = ""; + $scope.poiNameFilter = ""; + $scope.availableIndicators = []; + $scope.selectedIndicator = undefined; + $scope.selectedPoiLayer = undefined; + $scope.availableFeaturesBySpatialUnit = {}; + $scope.selectedSpatialUnit = undefined; + $scope.selectedAreas = []; + $scope.selectedTimestamps = []; + $scope.indexOfFirstAreaSpecificPage = undefined; + $scope.dateSlider = undefined; + $scope.absoluteLabelPositions = []; + $scope.showMapLabels = true; + $scope.echartsOptions = { + map: { + // "2017-12-31": ... + // "2018-12-31": ... + }, + bar: { + // "2017-12-31": ... + // "2018-12-31": ... + }, + line: {}, // no timestamp needed here + }; + $scope.echartsRegisteredMapNames = []; + $scope.loadingData = false; + $scope.diagramsPrepared = false; + $scope.isFirstUpdateOnIndicatorOrPoiLayerSelection = true; + $scope.showResetIsochronesBtn = false; + $scope.isochronesTypeOfMovementMapping = { + "foot-walking": "Fußgänger", + "driving-car": "Auto", + "cycling-regular": "Fahrrad", + "wheelchair": "Barrierefrei", + "buffer": "Puffer" + }; + // used to track template pages instead of using $$hashkey + $scope.templatePageIdCounter = 1; + $scope.filterTimeseriesIndicator = function (indicator) { + // must have more than one applicable date + return indicator.applicableDates && indicator.applicableDates.length > 1; + }; + // internal array changes do not work with ng-change + $scope.$watchCollection('selectedAreas', function (newVal) { + $scope.onSelectedAreasChanged(newVal); + }); + $scope.onSelectedAreasChanged = function (newVal) { + if (typeof ($scope.template) === "undefined") + return; + $scope.loadingData = true; + // to make things easier we remove all area-specific pages and recreate them using newVal + // this approach is not optimized for performance and might have to change in the future + // remove all area-specific pages + $scope.template.pages = $scope.template.pages.filter(page => { + return !page.hasOwnProperty("area"); + }); + if ($scope.template.name === "A4-landscape-timestamp") + $scope.updateAreasForTimestampTemplates(newVal); + if ($scope.template.name === "A4-landscape-timeseries") + $scope.updateAreasForTimeseriesTemplates(newVal); + if ($scope.template.name === "A4-landscape-reachability") + $scope.updateAreasForReachabilityTemplates(newVal); + let updateDiagramsInterval_areas; + async function updateDiagrams() { + if ($scope.diagramsPrepared) { + $interval.cancel(updateDiagramsInterval_areas); // code below still executes once + } + else { + return; + } + // diagrams are prepared, but dom has to be updated first, too + // we could filter the geoJson here to only include selected areas + // but for now we get all areas and filter them out after + let justChanged = false; + if ($scope.isFirstUpdateOnIndicatorOrPoiLayerSelection) { + // Skip the update but set variable to false, so diagrams get updated on time update + // (relevant for indicator selection only) + $scope.isFirstUpdateOnIndicatorOrPoiLayerSelection = false; + justChanged = true; + } + if ($scope.template.name == "A4-landscape-reachability" || ($scope.isFirstUpdateOnIndicatorOrPoiLayerSelection == false && justChanged == false)) { + await $scope.initializeAllDiagrams(); + if ($scope.template.name !== "A4-landscape-reachability") { + // in reachability template we have to update leaflet maps, too + $scope.loadingData = false; + } + } + } + updateDiagramsInterval_areas = $interval(updateDiagrams, 0, 100); + }; + $scope.updateAreasForTimestampTemplates = function (newVal) { + let pagesToInsertPerTimestamp = []; + for (let area of newVal) { + // get page to insert from untouched template + let pageToInsert = angular.fromJson($scope.untouchedTemplateAsString).pages[$scope.indexOfFirstAreaSpecificPage]; + pageToInsert.area = area.name; + pageToInsert.id = $scope.templatePageIdCounter++; + pagesToInsertPerTimestamp.push(pageToInsert); + } + // sort alphabetically by area name + pagesToInsertPerTimestamp.sort((a, b) => { + let textA = a.area.toLowerCase(); + let textB = b.area.toLowerCase(); + return (textA < textB) ? -1 : (textA > textB) ? 1 : 0; + }); + // insert area-specific pages for each timestamp + // right now the area-specific part is missing and we have to figure out where it was. + // get pages per timestamp -> insert new ones starting at indexOfFirstAreaSpecificPage -> replace per timestamp in $scope.template.pages + if ($scope.selectedTimestamps.length) { + let idx = 0; + for (let timestamp of $scope.selectedTimestamps) { + // pagesForTimestamp is the template-section for that timestamp + let pagesForTimestamp = $scope.template.pages.filter(page => { + let dateEl = page.pageElements.find(el => { + return el.type === "dataTimestamp-landscape"; + }); + return dateEl.text === timestamp.name; + }); + // set index to first page of that timestamp + // this is where we want to start replacing pages later + idx = $scope.template.pages.indexOf(pagesForTimestamp[0]); + // create a deep copy so we can assign new ids + pagesForTimestamp = JSON.parse(JSON.stringify(pagesForTimestamp)); + // setup pages before inserting + for (let pageToInsert of pagesToInsertPerTimestamp) { + let titleEl = pageToInsert.pageElements.find(el => { + return el.type === "indicatorTitle-landscape"; + }); + titleEl.text = $scope.selectedIndicator.indicatorName + " [" + $scope.selectedIndicator.unit + "]"; + if (pageToInsert.area) { + titleEl.text += ", " + pageToInsert.area; + } + titleEl.isPlaceholder = false; + let dateEl = pageToInsert.pageElements.find(el => { + return el.type === "dataTimestamp-landscape"; + }); + dateEl.text = timestamp.name; + dateEl.isPlaceholder = false; + // diagrams have to be inserted later because the div element does not yet exist + } + let numberOfPagesToReplace = pagesForTimestamp.length; + // insert area-specific pages + pagesToInsertPerTimestamp = JSON.parse(JSON.stringify(pagesToInsertPerTimestamp)); + for (let page of pagesToInsertPerTimestamp) + page.id = $scope.templatePageIdCounter++; + pagesForTimestamp.splice($scope.indexOfFirstAreaSpecificPage, 0, ...pagesToInsertPerTimestamp); + // assign new ids + for (let page of pagesForTimestamp) + page.id = $scope.templatePageIdCounter++; + // then replace the whole timstamp-section with the new pages + $scope.template.pages.splice(idx, numberOfPagesToReplace, ...pagesForTimestamp); + } + } + else { + pagesToInsertPerTimestamp = JSON.parse(JSON.stringify(pagesToInsertPerTimestamp)); + for (let page of pagesToInsertPerTimestamp) + page.id = $scope.templatePageIdCounter++; + // no timestamp selected, which makes inserting easier + $scope.template.pages.splice($scope.indexOfFirstAreaSpecificPage, 0, ...pagesToInsertPerTimestamp); + } + }; + $scope.updateAreasForTimeseriesTemplates = function (newVal) { + let pagesToInsert = []; + for (let area of newVal) { + // get page to insert from untouched template + let pageToInsert = angular.fromJson($scope.untouchedTemplateAsString).pages[$scope.indexOfFirstAreaSpecificPage]; + pageToInsert.area = area.name; + pageToInsert.id = $scope.templatePageIdCounter++; + pagesToInsert.push(pageToInsert); + } + // sort alphabetically by area name + pagesToInsert.sort((a, b) => { + let textA = a.area.toLowerCase(); + let textB = b.area.toLowerCase(); + return (textA < textB) ? -1 : (textA > textB) ? 1 : 0; + }); + // since we are dealing with a timeseries we don't have to care about inserting area-pages multiple times for different timestamps + // we do it only once + // setup pages before inserting + for (let pageToInsert of pagesToInsert) { + let titleEl = pageToInsert.pageElements.find(el => { + return el.type === "indicatorTitle-landscape"; + }); + titleEl.text = $scope.selectedIndicator.indicatorName + " [" + $scope.selectedIndicator.unit + "]"; + if (pageToInsert.area) { + titleEl.text += ", " + pageToInsert.area; + } + titleEl.isPlaceholder = false; + let dateEl = pageToInsert.pageElements.find(el => { + return el.type === "dataTimeseries-landscape"; + }); + let includeInBetweenValues = false; + let dsValues = $scope.getFormattedDateSliderValues(includeInBetweenValues); + dateEl.text = dsValues.from + " - " + dsValues.to; + dateEl.isPlaceholder = false; + // diagrams have to be inserted later because the div element does not yet exist + } + // insert area-specific pages + pagesToInsert = JSON.parse(JSON.stringify(pagesToInsert)); + for (let page of pagesToInsert) + page.id = $scope.templatePageIdCounter++; + $scope.template.pages.splice($scope.indexOfFirstAreaSpecificPage, 0, ...pagesToInsert); + }; + $scope.updateAreasForReachabilityTemplates = function (newVal) { + // we only have one timestamp here (the most recent one) + let pagesToInsert = []; + for (let area of newVal) { + // get page to insert from untouched template + let pageToInsert = angular.fromJson($scope.untouchedTemplateAsString).pages[$scope.indexOfFirstAreaSpecificPage]; + pageToInsert.area = area.name; + pageToInsert.id = $scope.templatePageIdCounter++; + pagesToInsert.push(pageToInsert); + } + // sort alphabetically by area name + pagesToInsert.sort((a, b) => { + let textA = a.area.toLowerCase(); + let textB = b.area.toLowerCase(); + return (textA < textB) ? -1 : (textA > textB) ? 1 : 0; + }); + // we select the most recent timestamp programmatically and don't allow user to change it, so this should be 1 here + if ($scope.selectedTimestamps.length === 1) { + // setup pages before inserting + for (let pageToInsert of pagesToInsert) { + let titleEl = pageToInsert.pageElements.find(el => { + return el.type === "indicatorTitle-landscape"; + }); + titleEl.text = "Entfernungen für " + $scope.selectedPoiLayer.datasetName; + if (pageToInsert.area) { + titleEl.text += ", " + pageToInsert.area; + } + titleEl.isPlaceholder = false; + let subtitleEl = pageToInsert.pageElements.find(el => { + return el.type === "reachability-subtitle-landscape"; + }); + subtitleEl.text = $scope.selectedTimestamps[0].name; + if ($scope.isochrones) + subtitleEl.text += ", " + $scope.isochronesTypeOfMovementMapping[$scope.typeOfMovement]; + if ($scope.selectedIndicator) + subtitleEl.text += ", " + $scope.selectedIndicator.indicatorName; + subtitleEl.isPlaceholder = false; + // diagrams have to be inserted later because the div element does not yet exist + } + // create a deep copy so we can assign new ids + pagesToInsert = JSON.parse(JSON.stringify(pagesToInsert)); + let numberOfPagesToReplace = $scope.template.pages.length - 2; // basically everything until the end of the template (-2 because we start at second page) + // insert area-specific pages + for (let page of pagesToInsert) + page.id = $scope.templatePageIdCounter++; + $scope.template.pages.splice($scope.indexOfFirstAreaSpecificPage, numberOfPagesToReplace, ...pagesToInsert); + } + }; + // internal array changes do not work with ng-change + $scope.$watchCollection('selectedTimestamps', function (newVal, oldVal) { + if (typeof ($scope.template) === "undefined") + return; + $scope.loadingData = true; + // get difference between old and new value (the timestamps selected / deselected) + let difference = oldVal + .filter(x => !newVal.includes(x)) + .concat(newVal.filter(x => !oldVal.includes(x))); + // if selected + if (newVal.length > oldVal.length) { + // if this was the first timestamp + if (newVal.length === 1) { + // no need to insert pages, we just replace the placeholder timestamp + for (let page of $scope.template.pages) { + for (let pageElement of page.pageElements) { + if (pageElement.type === "dataTimestamp-landscape") { + pageElement.text = difference[0].name; + pageElement.isPlaceholder = false; + } + } + } + } + if (newVal.length > 1) { + for (let timestampToInsert of difference) { + // setup pages to insert first + let pagesToInsert = angular.fromJson($scope.untouchedTemplateAsString).pages; + for (let page of pagesToInsert) { + page.id = $scope.templatePageIdCounter++; + } + // insert additional page for each selected area, replace the placeholder page + let areaSpecificPages = []; + // copy placeholder page for each selected area + for (let area of $scope.selectedAreas) { + let page = angular.fromJson($scope.untouchedTemplateAsString).pages[$scope.indexOfFirstAreaSpecificPage]; + page.area = area.name; + page.id = $scope.templatePageIdCounter++; + areaSpecificPages.push(page); + } + // sort alphabetically by area name + areaSpecificPages.sort((a, b) => { + let textA = a.area.toLowerCase(); + let textB = b.area.toLowerCase(); + return (textA < textB) ? -1 : (textA > textB) ? 1 : 0; + }); + pagesToInsert.splice($scope.indexOfFirstAreaSpecificPage, 1, ...areaSpecificPages); + // setup pages before inserting them + for (let pageToInsert of pagesToInsert) { + for (let pageElement of pageToInsert.pageElements) { + if (pageElement.type === "indicatorTitle-landscape") { + pageElement.text = $scope.selectedIndicator.indicatorName + " [" + $scope.selectedIndicator.unit + "]"; + if (pageToInsert.area) { + pageElement.text += ", " + pageToInsert.area; + } + pageElement.isPlaceholder = false; + } + if (pageElement.type === "dataTimestamp-landscape") { + pageElement.text = timestampToInsert.name; + pageElement.isPlaceholder = false; + } + } + } + // determine position to insert pages (ascending timestamps) and insert them + // iterate pages and check timestamp for each one + let pagesInserted = false; + for (let i = $scope.template.pages.length - 1; i >= 0; i--) { //iterate in reverse because we might extend the array while iterating + let page = $scope.template.pages[i]; + for (let pElement of page.pageElements) { + if (pElement.type === "dataTimestamp-landscape") { + // compare timestamps + let date1 = timestampToInsert.name; + let date2 = pElement.text; + let date1Updated = new Date(date1.replace(/-/g, '/')); + let date2Updated = new Date(date2.replace(/-/g, '/')); + // if page timestamp is newer than difference timestamp + if (date1Updated > date2Updated) { + // insert pages before pages with that timestamp + // i+1 because we want to insert after the page that has the older timestamp + $scope.template.pages.splice(i + 1, 0, ...pagesToInsert); + pagesInserted = true; + } + } + } + if (pagesInserted) { + break; + } + } + if (!pagesInserted) { // happens if the timestamp to insert is the oldest one + $scope.template.pages.splice(0, 0, ...pagesToInsert); //prepend pages + } + } + // in case all timestamps were added at once and none was present before we still have placeholder pages at this point + // all other pages got prepended since we compared against an invalid date. + // remove those pages + for (let i = $scope.template.pages.length - 1; i >= 0; i--) { //iterate in reverse because we might extend the array while iterating + let page = $scope.template.pages[i]; + for (let pElement of page.pageElements) { + if (pElement.type === "dataTimestamp-landscape") { + if (pElement.isPlaceholder) { + $scope.template.pages.splice(i, 1); + } + } + } + } + } + } + // if deselected + if (newVal.length < oldVal.length) { + // if it was the last one + if (newVal.length === 0) { + let cleanTemplate = angular.fromJson($scope.untouchedTemplateAsString); + for (let page of cleanTemplate.pages) { + page.id = $scope.templatePageIdCounter++; + } + $scope.template = cleanTemplate; + } + else { + // remove all pages that belong to removed timestamps + for (let timestampToRemove of difference) { + $scope.template.pages = $scope.template.pages.filter(page => { + let timestampEl = page.pageElements.find(el => { + return el.type === "dataTimestamp-landscape"; + }); + return timestampEl.text != timestampToRemove.name; + }); + } + } + } + // There is one more special case for the reachbility template, where we only have one timestamp set at all times, + // but that one might change if we change the spatial unit + if (newVal.length === oldVal.length && newVal.length === 1 && newVal[0].name != oldVal[0].name) { + // simply update the timestamp on all pages + for (let page of $scope.template.pages) { + for (let pageElement of page.pageElements) { + if (pageElement.type === "reachability-subtitle-landscape") { + pageElement.text = newVal[0].name; + if ($scope.isochrones) + pageElement.text += ", " + $scope.isochronesTypeOfMovementMapping[$scope.typeOfMovement]; + if ($scope.selectedIndicator) + pageElement.text += ", " + $scope.selectedIndicator.indicatorName; + } + break; + } + } + } + function updateDiagrams() { + if ($scope.diagramsPrepared) { + $interval.cancel(updateDiagramsInterval); // code below still executes once + } + else { + return; + } + $timeout(async function () { + if ($scope.isFirstUpdateOnIndicatorOrPoiLayerSelection) { + // Skip the update but set variable to false, so diagrams get updated on time update + // (relevant for indicator selection only) + $scope.isFirstUpdateOnIndicatorOrPoiLayerSelection = false; + } + else { + // indicator selection is optional in reachability template only + if ($scope.selectedIndicator) { + for (let timestamp of $scope.selectedTimestamps) { + let classifyUsingWholeTimeseries = false; + let isTimeseries = false; + $scope.prepareDiagrams($scope.selectedIndicator, $scope.selectedSpatialUnit, timestamp.name, classifyUsingWholeTimeseries, isTimeseries, undefined, undefined); + } + } + else { + $scope.reachabilityTemplateGeoMapOptions = $scope.prepareReachabilityEchartsMap(); + } + await $scope.initializeAllDiagrams(); + if ($scope.template.name !== "A4-landscape-reachability") { + // in reachability template we have to update leaflet maps, too + $scope.loadingData = false; + } + } + }); + } + let updateDiagramsInterval = $interval(updateDiagrams, 0, 100); + }); + $scope.$on("reportingConfigureNewIndicatorShown", function (event, data) { + $scope.initialize(data); + }); + $scope.$on("reportingConfigureNewPoiLayerShown", function (event, data) { + $scope.initialize(data); + }); + $scope.initialize = async function (data) { + $scope.loadingData = true; + let template = data[0]; + // deep copy template before any changes are made. + // this is needed when additional timestamps are inserted. + $scope.untouchedTemplateAsString = angular.toJson(template); + // give each page a unique id to track it by in ng-repeat + for (let page of template.pages) { + page.id = $scope.templatePageIdCounter++; + } + $scope.template = template; + if ($scope.template.name === "A4-landscape-timestamp") + $scope.indexOfFirstAreaSpecificPage = 3; + if ($scope.template.name === "A4-landscape-timeseries") + $scope.indexOfFirstAreaSpecificPage = 4; + if ($scope.template.name === "A4-landscape-reachability") + $scope.indexOfFirstAreaSpecificPage = 1; + // disable tabs to force user to pick a poi-layer / indicator first + let tabList = document.querySelector("#reporting-add-indicator-tab-list"); + let tabPanes = document.querySelectorAll("#reporting-add-indicator-tab-content > .tab-pane"); + let tabChildren = Array.from(tabList.children); + for (let [idx, tab] of tabChildren.entries()) { + let id = tab.id.at(-1); + if (($scope.template.name === "A4-landscape-reachability" && id == 1) || // pois + ($scope.template.name !== "A4-landscape-reachability" && id == 3)) { // indicators + tab.classList.add("active"); + tabPanes[idx].classList.add("active"); + } + else { + tab.classList.remove("active"); + tabPanes[idx].classList.remove("active"); + } + } + $scope.initializeDualLists(); + if ($scope.template.name === "A4-landscape-reachability") { + $scope.resetIsochrones(); + Promise.all([ + $scope.queryGeoresources(), + $scope.queryIndicators() + ]).then(() => { + $scope.loadingData = false; + $timeout(() => { + $timeout(function () { + $scope.$digest(); + }); + }); + }); + } + else { + await $scope.queryIndicators(); + $scope.loadingData = false; + $timeout(() => { + $timeout(function () { + $scope.$digest(); + }); + }); + } + }; + $scope.initializeDualLists = function () { + $scope.dualListAreasOptions = { + label: 'Bereiche', + boxItemsHeight: 'md', + items: [], + button: { leftText: "Alle auswählen", rightText: "Alle entfernen" }, + selectedItems: [] + }; + $scope.dualListTimestampsOptions = { + label: 'Zeitpunkte', + boxItemsHeight: 'md', + items: [], + button: { leftText: "Alle auswählen", rightText: "Alle entfernen" }, + selectedItems: [] + }; + $scope.dualListSpatialUnitsOptions = { + label: 'Raumebenen', + boxItemsHeight: 'md', + items: [], + button: { leftText: "Alle auswählen", rightText: "Alle entfernen" }, + selectedItems: [] + }; + }; + /** + * Queries DataManagement API to get all available indicators + */ + $scope.queryIndicators = async function () { + // build request + // query public endpoint for now, this might change once user role administration is added to reporting + let url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/indicators"; + // send request + await $http({ + url: url, + method: "GET" + }).then(function successCallback(response) { + // save to scope + $scope.availableIndicators = response.data; + }, function errorCallback(error) { + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + console.error(error); + }); + return Promise.resolve(); + }; + $scope.queryGeoresources = async function () { + // build request + // query public endpoint for now, this might change once user role administration is added to reporting + let url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources"; + // send request + await $http({ + url: url, + method: "GET" + }).then(function successCallback(response) { + // save to scope + $scope.availablePoiLayers = response.data.filter(georesource => { + return georesource.isPOI; + }); + }, function errorCallback(error) { + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + console.error(error); + }); + return Promise.resolve(); + }; + $scope.queryMostRecentGeoresourceFeatures = async function (georesource) { + // Most likely this is only a temporary method + // It checks the availablePeriodsOfValidity and takes the most recent one to query features. + let timestamp = georesource.availablePeriodsOfValidity.at(-1).startDate; + let timestampSplit = timestamp.split("-"); + let year = timestampSplit[0]; + let month = timestampSplit[1]; + let day = timestampSplit[2]; + let url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource(); + url += "/georesources/" + georesource.georesourceId + "/" + year + "/" + month + "/" + day; + // send request + return await $http({ + url: url, + method: "GET" + }).then(function successCallback(response) { + return response.data; + }, function errorCallback(error) { + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + console.error(error); + }); + }; + $scope.queryAllSpatialUnits = async function () { + // build request + // query public endpoint for now, this might change once user role administration is added to reporting + let url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/spatial-units"; + // send request + return await $http({ + url: url, + method: "GET" + }).then(function successCallback(response) { + // save to scope + return response.data; + }, function errorCallback(error) { + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + console.error(error); + }); + }; + $scope.onSpatialUnitChanged = async function (selectedSpatialUnit) { + $scope.loadingData = true; + $("#reporting-spatialUnitChangeWarning").hide(); + $scope.timeseriesAdjustedOnSpatialUnitChange = false; + await $scope.updateAreasInDualList(); + let validTimestamps = []; + // There might be different valid timestamps for the new spatial unit. + if ($scope.selectedIndicator) { + validTimestamps = getValidTimestampsForSpatialUnit(selectedSpatialUnit); + // Check if the currently selected timestamps are also available for the new spatial unit. + // If one is not, deselect is and show an info to user + let selectedTimestamps_old = [...$scope.selectedTimestamps]; + $scope.selectedTimestamps = $scope.selectedTimestamps.filter(el => { + return validTimestamps.includes(el.name); + }); + // if any timestamp was deselected show a warning alert + // except for reachability template, it doesn't matter there + if (selectedTimestamps_old.length > $scope.selectedTimestamps.length && $scope.template.name != "A4-landscape-reachability") { + $("#reporting-spatialUnitChangeWarning").show(); + } + } + else { + // without selected indicator we have to fall back to the last update of the new spatial unit + let mostRecentTimestampName = $scope.selectedSpatialUnit.metadata.lastUpdate; + validTimestamps.push(mostRecentTimestampName); + } + if ($scope.template.name === "A4-landscape-timeseries") { + // Similar procedure as with timestamps + let oldTimeseries = $scope.getFormattedDateSliderValues(true); + let from = new Date($scope.dateSlider.result.from_value); + let to = new Date($scope.dateSlider.result.to_value); + let filteredTimeseries = validTimestamps.filter(el => { + let date = new Date(el); + date.setHours(0); // remove time-offset...TODO is there a better way? + return from <= date && date <= to; + }); + let isEqualTimeseries = (oldTimeseries.dates.length == filteredTimeseries.length) && oldTimeseries.dates.every(function (element, index) { + return element === filteredTimeseries[index]; + }); + if (!isEqualTimeseries) { + // timeseries changed + $("#reporting-spatialUnitChangeWarning").show(); + // try to set slider to previously selected timestamps + if (validTimestamps.includes(oldTimeseries.from) && validTimestamps.includes(oldTimeseries.to)) { + $scope.dateSlider = $scope.initializeDateRangeSlider(validTimestamps, filteredTimeseries[0], filteredTimeseries.at(-1)); + } + else { + $scope.dateSlider = $scope.initializeDateRangeSlider(validTimestamps); + $scope.timeseriesAdjustedOnSpatialUnitChange = true; // show additional text in warning alert + } + } + else { + // the selected part of the timeseries has the same dates so we don't have to show a warning + // but the timeseries could still include older or newer dates + $scope.dateSlider = $scope.initializeDateRangeSlider(validTimestamps, filteredTimeseries[0], filteredTimeseries.at(-1)); + } + } + // prepare arrays for updateDualList + validTimestamps = validTimestamps.map(el => { + return { + properties: { + NAME: el + } + }; + }); + let timestampsToSelect = $scope.selectedTimestamps.map(el => { + return { + properties: { + NAME: el.name + } + }; + }); + $scope.updateDualList($scope.dualListTimestampsOptions, validTimestamps, timestampsToSelect); + // fire $watch('selectedAreas') function manually to remove pages + $scope.selectedAreas = []; + $scope.onSelectedAreasChanged($scope.selectedAreas, undefined); + // updateAreasInDualList does not trigger diagram updates + // we have the wrong geometries set at this point, causing area selection to fail. + // echarts requires properties.name to be present, create it from properties.NAME unless it exists + let features; + if ($scope.template.name == "A4-landscape-reachability") { + if ($scope.selectedIndicator) { + features = $scope.availableFeaturesBySpatialUnit[$scope.selectedSpatialUnit.spatialUnitName]; + } + else { + features = $scope.availableFeaturesBySpatialUnit[$scope.selectedSpatialUnit.spatialUnitLevel]; + } + features = $scope.createLowerCaseNameProperty(features); + $scope.geoJsonForReachability = { features: features }; + } + else { + features = $scope.availableFeaturesBySpatialUnit[$scope.selectedSpatialUnit.spatialUnitName]; + features = $scope.createLowerCaseNameProperty(features); + let geoJSON = { features: features }; + $scope.selectedIndicator.geoJSON = geoJSON; + } + // no need to check if diagrams are prepared here since we have to prepare them again anyway + $timeout(async function () { + // prepare diagrams for all selected timestamps with all features + // Preparing all diagrams is not possible without an indicator, which might happen in the reachability template + // User selects a poi layer first and we set the most recent timestamp programmatically, triggering this function without selected Indicator + // We only need an echarts geoMap to show isochrones, POIs and spatial unit borders + if ($scope.selectedIndicator) { + if ($scope.template.name === "A4-landscape-reachability") { + $scope.reachabilityTemplateGeoMapOptions = $scope.prepareReachabilityEchartsMap(); + } + else if ($scope.template.name === "A4-landscape-timeseries") { + let values = $scope.getFormattedDateSliderValues(true); + let classifyUsingWholeTimeseries = false; + let isTimeseries = true; + $scope.prepareDiagrams($scope.selectedIndicator, $scope.selectedSpatialUnit, values.to, classifyUsingWholeTimeseries, isTimeseries, values.from, values.to); + // prepare diagrams again for most recent timestamp of slider and for whole timeseries (changes). + classifyUsingWholeTimeseries = true; + isTimeseries = false; + $scope.prepareDiagrams($scope.selectedIndicator, $scope.selectedSpatialUnit, values.to, classifyUsingWholeTimeseries, isTimeseries, undefined, undefined); + } + else { + for (let timestamp of $scope.selectedTimestamps) { + let classifyUsingWholeTimeseries = false; + let isTimeseries = false; + $scope.prepareDiagrams($scope.selectedIndicator, selectedSpatialUnit, timestamp.name, classifyUsingWholeTimeseries, isTimeseries, undefined, undefined); + } + } + } + else { + $scope.reachabilityTemplateGeoMapOptions = $scope.prepareReachabilityEchartsMap(); + } + await $scope.initializeAllDiagrams(); + if ($scope.template.name !== "A4-landscape-reachability") { + // in reachability template we have to update leaflet maps, too + $scope.loadingData = false; + } + }); + }; + /** + * Updates the areas dual list data + * Queries DataManagement API if needed. + */ + $scope.updateAreasInDualList = async function () { + // this happens for the reachability template on poi selection + if (typeof ($scope.selectedIndicator) === "undefined") { + let spatialUnit = $scope.selectedSpatialUnit ? + $scope.selectedSpatialUnit : + $scope.selectedIndicator.applicableSpatialUnits[0]; + // query spatial unit features using the most recent date + let data = await $scope.queryFeatures(undefined, $scope.selectedSpatialUnit); + $scope.availableFeaturesBySpatialUnit[spatialUnit.spatialUnitLevel] = data.features; + let allAreas = $scope.availableFeaturesBySpatialUnit[spatialUnit.spatialUnitLevel]; + $scope.updateDualList($scope.dualListAreasOptions, allAreas, undefined); // don't select any areas + } + else { + let indicator = $scope.selectedIndicator; + let spatialUnit = $scope.selectedSpatialUnit ? + $scope.selectedSpatialUnit : + $scope.selectedIndicator.applicableSpatialUnits[0]; + let indicatorId = indicator.indicatorId; + // on indicator change + if ($scope.availableFeaturesBySpatialUnit.indicatorId != indicator.indicatorId) { + // clear all cached features + $scope.availableFeaturesBySpatialUnit = {}; + $scope.availableFeaturesBySpatialUnit.indicatorId = indicatorId; + let data = await $scope.queryFeatures(indicatorId, spatialUnit); + // save response to scope to avoid further requests + $scope.availableFeaturesBySpatialUnit[spatialUnit.spatialUnitName] = data.features; + } + else { + // same indicator + if (!$scope.availableFeaturesBySpatialUnit[spatialUnit.spatialUnitName]) { + let data = await $scope.queryFeatures(indicatorId, spatialUnit); + // save response to scope to avoid further requests + $scope.availableFeaturesBySpatialUnit[spatialUnit.spatialUnitName] = data.features; + } + } + let allAreas = $scope.availableFeaturesBySpatialUnit[spatialUnit.spatialUnitName]; + $scope.updateDualList($scope.dualListAreasOptions, allAreas, undefined); // don't select any areas + } + $timeout(function () { + $scope.$digest(); + }); + }; + /** + * Queries DataManagement API to get features of given indicator. + * If no indicator id is provided the spatial unit endpoint is queried + * Result is stored to scope to avoid further requests. + * @param {*} indicator | selected indicator + */ + $scope.queryFeatures = async function (indicatorId, spatialUnit) { + // build request + // query different endpoints depending on if we have an indicator or not + let url; + if (!indicatorId) { + let date = spatialUnit.metadata.lastUpdate.split("-"); + let year = date[0]; + let month = date[1]; + let day = date[2]; + url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + + "/spatial-units/" + spatialUnit.spatialUnitId + "/" + year + "/" + month + "/" + day; + } + else { + url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + + "/indicators/" + indicatorId + "/" + spatialUnit.spatialUnitId; + } + // send request + return await $http({ + url: url, + method: "GET" + }).then(function successCallback(response) { + return response.data; + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + console.error(error); + }); + }; + /** + * + * @param {*} options | scope options obj for dualList to update + * @param {*} data | new data (all data, including entries that get selected and removed from left side), format like: + * + * [ + * { + * properties: { + * NAME: ... + * } + * }, { + * ... + * }] + * @param {*} selectedItems | optional, the items that should be selected after the update + */ + $scope.updateDualList = function (options, data, selectedItems) { + options.selectedItems = []; + let dualListInput = data.map(el => { + return { "name": el.properties.NAME }; // we need this as an object for kommonitorDataExchangeService.createDualListInputArray + }); + dualListInput = kommonitorDataExchangeService.createDualListInputArray(dualListInput, "name"); + options.items = dualListInput; + // $timeout is needed because we want to click on an element to select it. + // therefore we have to wait until the dual list is updated and the dom node exists + $timeout(function () { + // if there are items to select + if (selectedItems && selectedItems.length > 0) { + // if all items should be selected we can use the "select all" button for better performance + if (data.length === selectedItems.length) { + let dualListBtnElement = undefined; + switch (options.label) { + case "Zeitpunkte": + dualListBtnElement = document.querySelectorAll("#reporting-indicator-add-timestamps-dual-list .duallistButton")[0]; + break; + case "Bereiche": + dualListBtnElement = document.querySelectorAll("#reporting-indicator-add-areas-dual-list .duallistButton")[0]; + break; + case "Raumebenen": + dualListBtnElement = document.querySelectorAll("#reporting-indicator-add-spatialUnits-dual-list .duallistButton")[0]; + break; + } + dualListBtnElement.click(); + } + else { + for (let item of selectedItems) { + if (item.hasOwnProperty("properties")) { + if (item.properties.hasOwnProperty("NAME")) { + let name = item.properties.NAME; + // remove item to select from left side and add to right side + // we can't filter programmatically here because the changes won't get applied to scope variables + // not even with $scope.$digest in a $timeout + // instead we click on the elements + // get dom element by name + let arr = []; + switch (options.label) { + case "Zeitpunkte": + arr = Array.from(document.querySelectorAll("#reporting-indicator-add-timestamps-dual-list a")); + break; + case "Bereiche": + arr = Array.from(document.querySelectorAll("#reporting-indicator-add-areas-dual-list a")); + break; + case "Raumebenen": + arr = Array.from(document.querySelectorAll("#reporting-indicator-add-spatialUnits-dual-list a")); + break; + } + let el = arr.find(el => { + return el.textContent.includes(name); + }); + el.click(); + } + } + } + } + } + }, 500); + }; + // availableFeaturesBySpatialUnit has to be populated before this method is called. + // Also it is only called in situations where an indicator is selected. + function getValidTimestampsForSpatialUnit(spatialUnit) { + let validTimestamps = []; // result + // Iterate all features and add all properties that start with "DATE_" to 'validTimestamps' + let features = $scope.availableFeaturesBySpatialUnit[spatialUnit.spatialUnitName]; + if (!features) { + let error = new Error("Tried to get valid timestamps but no features were cached."); + kommonitorDataExchangeService.displayMapApplicationError(error.message); + } + for (let feature of features) { + let props = Object.keys(feature.properties); + props = props.filter(prop => { + return prop.startsWith("DATE_"); + }); + for (let prop of props) { + let timestamp = prop.replace("DATE_", ""); + if (!validTimestamps.includes(timestamp)) { + validTimestamps.push(timestamp); + } + } + } + return validTimestamps; + } + $scope.addIsochronesBboxProperties = function () { + // Calculates and adds a bbox property for each feature and for overall layer + // These do not exist if the type of movement is "buffer" ( = isochrones not generated by ors) + let overallBbox = []; + let features = $scope.isochrones.features; + for (var i = 0; i < $scope.isochrones.features.length; i++) { + // calculate bbox for feature + if (!features[i].bbox || !features[i].bbox.length) { + features[i].properties.bbox = turf.bbox(features[i]); + } + // check if we have to adjust overall bbox + if (overallBbox.length === 0) { + overallBbox.push(...features[i].properties.bbox); + } + else { + let bbox = features[i].properties.bbox; + overallBbox[0] = (bbox[0] < overallBbox[0]) ? bbox[0] : overallBbox[0]; + overallBbox[1] = (bbox[1] < overallBbox[1]) ? bbox[1] : overallBbox[1]; + overallBbox[2] = (bbox[2] > overallBbox[2]) ? bbox[2] : overallBbox[2]; + overallBbox[3] = (bbox[3] > overallBbox[3]) ? bbox[3] : overallBbox[3]; + } + } + $scope.isochrones.bbox = overallBbox; + }; + $scope.addIsochronesCenterLocationProperty = function () { + $scope.isochrones.centerLocations = []; + // We probably have multiple isochrones with the same center. + // Keep track of the value property and only calculate center coords once per isochrones group. + let firstIsochroneRangeValue = $scope.isochrones.features[0].properties.value; + for (let feature of $scope.isochrones.features) { + if (feature.properties.value === firstIsochroneRangeValue) { + // bbox format: [lower left lon, lower left lat, upper right lon, upper right lat] + if (!feature.properties.bbox) { + let bbox = turf.bbox(feature); // calculate bbox for each feature + feature.properties.bbox = bbox; + } + let bbox = feature.properties.bbox; + let centerLon = bbox[0] + ((bbox[2] - bbox[0]) / 2); + let centerLat = bbox[1] + ((bbox[3] - bbox[1]) / 2); + $scope.isochrones.centerLocations.push([centerLon, centerLat]); + } + } + }; + $scope.$on("reportingIsochronesCalculationStarted", function (event) { + $scope.loadingData = true; + }); + $scope.$on("reportingIsochronesCalculationFinished", function (event, isochrones) { + $scope.isochrones = isochrones; + if (checkNestedPropExists($scope.isochrones, 'info', 'query', 'profile')) + $scope.typeOfMovement = $scope.isochrones.info.query.profile; + else + $scope.typeOfMovement = "buffer"; + if ($scope.typeOfMovement === "buffer") { + $scope.isochronesRangeType = "distance"; + $scope.isochronesRangeUnits = "m"; + } + else { + $scope.isochronesRangeType = $scope.isochrones.info.query.range_type; + $scope.isochronesRangeUnits = $scope.isochrones.info.query.units; + } + // for type buffer the bbox field doesn't exist, so we have to create it. + $scope.addIsochronesBboxProperties(); + if (!$scope.isochrones.centerLocations) + $scope.addIsochronesCenterLocationProperty(); + // Add a new property that is used as a unique id and can be used by echarts + // For buffer there is no group_index, so we use the ID + if ($scope.typeOfMovement === "buffer") { + for (let feature of $scope.isochrones.features) { + feature.properties.echartsId = feature.properties.ID + "-" + feature.properties.value; + } + } + else { + for (let feature of $scope.isochrones.features) { + feature.properties.echartsId = feature.properties.group_index + "-" + feature.properties.value; + } + } + $scope.isochronesSeriesData = $scope.convertIsochronesToSeriesData($scope.isochrones); + $scope.showResetIsochronesBtn = true; + // TODO performance could be improved if we just iterate pages and update echarts + $scope.initializeAllDiagrams(); + $scope.loadingData = false; + }); + $scope.resetIsochrones = function () { + $scope.isochrones = undefined; + $scope.typeOfMovement = undefined; + $scope.isochronesRangeType = undefined, + $scope.isochronesRangeUnits = undefined, + $scope.isochronesSeriesData = undefined; + // TODO performance could be improved if we just iterate pages and update echarts + if ($scope.diagramsPrepared) { + $scope.initializeAllDiagrams(); + } + $scope.showResetIsochronesBtn = false; + }; + $scope.onPoiLayerSelected = async function (poiLayer) { + try { + $scope.absoluteLabelPositions = []; + $scope.diagramsPrepared = false; + $scope.isFirstUpdateOnIndicatorOrPoiLayerSelection = true; + $scope.selectedPoiLayer = poiLayer; + $scope.selectedPoiLayer.geoJSON = await $scope.queryMostRecentGeoresourceFeatures($scope.selectedPoiLayer); + $scope.$broadcast("reportingPoiLayerSelected", $scope.selectedPoiLayer); + // get a new template (in case another poi layer was selected previously) + $scope.template = $scope.getCleanTemplate(); + // Indicator might not be selected at this point + // We get information about all available spatial units (instead of applicable ones) + // Then we select the highest one by default + let spatialUnits = await $scope.queryAllSpatialUnits(); + $scope.allSpatialUnitsForReachability = spatialUnits; // needed for spatial unit selection in 3rd tab + let highestSpatialUnit = spatialUnits.filter(unit => { + return unit.nextUpperHierarchyLevel === null; + }); + if (!$scope.selectedSpatialUnit) { + $scope.selectedSpatialUnit = highestSpatialUnit[0]; + } + let mostRecentTimestampName; + if ($scope.selectedSpatialUnit.metadata) { + mostRecentTimestampName = $scope.selectedSpatialUnit.metadata.lastUpdate; + } + else { + // Happens when poiLayer is changed after an indicator was selected + // ( = spatial unit is the one from the indicator endpoint, not the spatial unit endpoint) + mostRecentTimestampName = $scope.allSpatialUnitsForReachability.filter(spatialUnit => { + return spatialUnit.spatialUnitId === $scope.selectedSpatialUnit.spatialUnitId; + })[0].metadata.lastUpdate; + } + $scope.selectedTimestamps = [{ + category: mostRecentTimestampName, + name: mostRecentTimestampName + }]; + await $scope.updateAreasInDualList(); // this populates $scope.availableFeaturesBySpatialUnit + // update information in preview + for (let page of $scope.template.pages) { + for (let el of page.pageElements) { + if (el.type === "indicatorTitle-landscape") { + el.text = "Entfernungen für " + $scope.selectedPoiLayer.datasetName; + el.isPlaceholder = false; + // no area-specific pages in template since diagrams are not prepared yet + // and area/timestamp/timeseries changes are done after that + } + if (el.type === "reachability-subtitle-landscape") { + el.text = $scope.selectedTimestamps[0].name; + if ($scope.isochrones) + el.text += ", " + $scope.isochronesTypeOfMovementMapping[$scope.typeOfMovement]; + if ($scope.selectedIndicator) + el.text += ", " + $scope.selectedIndicator.indicatorName; + el.isPlaceholder = false; + } + } + } + // get all features of largest spatial unit + let features; + if ($scope.selectedIndicator) { + features = $scope.availableFeaturesBySpatialUnit[$scope.selectedSpatialUnit.spatialUnitName]; + } + else { + features = $scope.availableFeaturesBySpatialUnit[$scope.selectedSpatialUnit.spatialUnitLevel]; + } + features = $scope.createLowerCaseNameProperty(features); + // we might have no indicator so we store the geometries directly on the scope + $scope.geoJsonForReachability = { + features: features + }; + // Preparing all diagrams is not possible without an indicator + // We only need an echarts geoMap to show isochrones, POIs and spatial unit borders + $scope.reachabilityTemplateGeoMapOptions = $scope.prepareReachabilityEchartsMap(); + // select all areas by default + let allAreas; + if ($scope.selectedSpatialUnit.spatialUnitName) { + allAreas = $scope.availableFeaturesBySpatialUnit[$scope.selectedSpatialUnit.spatialUnitName]; + } + else { + allAreas = $scope.availableFeaturesBySpatialUnit[$scope.selectedSpatialUnit.spatialUnitLevel]; + } + $scope.updateDualList($scope.dualListAreasOptions, allAreas, allAreas); + let allTabs = document.querySelectorAll("#reporting-add-indicator-tab-list li"); + for (let tab of allTabs) { + $scope.enableTab(tab); + } + } + catch (error) { + console.error(error); + kommonitorDataExchangeService.displayMapApplicationError(error); + $scope.loadingData = false; + } + }; + function calculateOverallBoundingBoxFromGeoJSON(features) { + let result = []; + for (var i = 0; i < features.length; i++) { + // check if we have to modify our overall bbox (result) + if (result.length === 0) { // for first feature + result.push(...features[i].properties.bbox); + continue; + } + else { + // all other features + let bbox = features[i].properties.bbox; + result[0] = (bbox[0] < result[0]) ? bbox[0] : result[0]; + result[1] = (bbox[1] < result[1]) ? bbox[1] : result[1]; + result[2] = (bbox[2] > result[2]) ? bbox[2] : result[2]; + result[3] = (bbox[3] > result[3]) ? bbox[3] : result[3]; + } + } + return result; + } + ; + $scope.setMostRecentIndicatorDataToReachabilityMap = function (seriesOptions) { + let mostRecentTimestampName = $scope.selectedIndicator.applicableDates.at(-1); + let features; + if ($scope.selectedSpatialUnit.spatialUnitName) { + features = $scope.availableFeaturesBySpatialUnit[$scope.selectedSpatialUnit.spatialUnitName]; + } + else { + features = $scope.availableFeaturesBySpatialUnit[$scope.selectedSpatialUnit.spatialUnitLevel]; + } + let newSeriesData = features.map(feature => { + let name = feature.properties.NAME; + let value = feature.properties["DATE_" + mostRecentTimestampName]; + value = Math.round(value * 100) / 100; + return { + name: name, + value: value + }; + }); + seriesOptions.data = newSeriesData; + return seriesOptions; + }; + $scope.resetOptionalIndicator = function () { + if (!$scope.selectedIndicator) { + return; + } + $scope.selectedIndicator = undefined; + // since we don't have an indicator selected anymore we reset the spatial unit + $scope.selectedSpatialUnit = $scope.allSpatialUnitsForReachability.filter(spatialUnit => { + return spatialUnit.spatialUnitLevel === $scope.selectedSpatialUnit.spatialUnitName; + })[0]; + // let filter = $scope.selectedIndicator.applicableSpatialUnits.filter( spatialUnit => { + // return spatialUnit.spatialUnitName === $scope.selectedSpatialUnit.spatialUnitLevel; + // }) + // $scope.selectedSpatialUnit = filter[0]; + for (let page of $scope.template.pages) { + for (let pageElement of page.pageElements) { + if (pageElement.type === "map") { + let domNode = document.querySelector("#reporting-addIndicator-page-" + $scope.template.pages.indexOf(page) + "-map"); + let map = echarts.getInstanceByDom(domNode); + let options = map.getOption(); + // remove indicator data + options.series[0].data = []; + options.series[0].label.formatter = '{b}'; + map.setOption(options, { + replaceMerge: ['series'] + }); + } + if (pageElement.type === "reachability-subtitle-landscape") { + pageElement.text = $scope.selectedTimestamps[0].name; + if ($scope.isochrones) { + pageElement.text += ", " + $scope.isochronesTypeOfMovementMapping[$scope.typeOfMovement]; + } + pageElement.isPlaceholder = false; + } + } + } + }; + $scope.handleIndicatorSelectForReachability = async function (indicator) { + $scope.selectedIndicator = indicator; + let indicatorId = $scope.selectedIndicator.indicatorId; + let featureCollection = await $scope.queryFeatures(indicatorId, $scope.selectedSpatialUnit); + if (!$scope.selectedSpatialUnit.spatialUnitName) { + // set the applicable spatial unit from the indicator as selected spatial unit + let filter = $scope.selectedIndicator.applicableSpatialUnits.filter(spatialUnit => { + return spatialUnit.spatialUnitName === $scope.selectedSpatialUnit.spatialUnitLevel; + }); + if (filter && filter.length) { + $scope.selectedSpatialUnit = filter[0]; + } + } + $scope.availableFeaturesBySpatialUnit[$scope.selectedSpatialUnit.spatialUnitName] = featureCollection.features; + $scope.selectedIndicator.geoJSON = featureCollection; + $scope.selectedIndicator.geoJSON.features = $scope.createLowerCaseNameProperty($scope.selectedIndicator.geoJSON.features); + for (let feature of $scope.selectedIndicator.geoJSON.features) { + let bbox = turf.bbox(feature); // calculate bbox for each feature + feature.properties.bbox = bbox; + } + for (let page of $scope.template.pages) { + for (let pageElement of page.pageElements) { + if (pageElement.type === "map") { + let domNode = document.querySelector("#reporting-addIndicator-page-" + $scope.template.pages.indexOf(page) + "-map"); + let map = echarts.getInstanceByDom(domNode); + let options = map.getOption(); + let seriesOptions = $scope.setMostRecentIndicatorDataToReachabilityMap(options.series[0]); + options.series[0] = seriesOptions; + options.series[0].label.formatter = '{b}\n{c}'; + map.setOption(options, { + replaceMerge: ['series'] + }); + } + if (pageElement.type === "reachability-subtitle-landscape") { + pageElement.text = $scope.selectedTimestamps[0].name; + if ($scope.isochrones) { + pageElement.text += ", " + $scope.isochronesTypeOfMovementMapping[$scope.typeOfMovement]; + } + pageElement.text += ", " + indicator.indicatorName; + pageElement.isPlaceholder = false; + } + } + } + $scope.loadingData = false; + $timeout(function () { + $scope.$digest(); + }); + }; + $scope.onIndicatorSelected = async function (indicator) { + try { + $scope.loadingData = true; + if ($scope.template.name === "A4-landscape-reachability") { + $scope.handleIndicatorSelectForReachability(indicator); + return; + } + $scope.selectedIndicator = undefined; + $scope.selectedTimestamps = []; + $scope.selectedAreas = []; + $scope.selectedSpatialUnit = undefined; + $scope.availableFeaturesBySpatialUnit = {}; + $scope.absoluteLabelPositions = []; + $scope.echartsOptions = { + map: {}, + bar: {}, + line: {} + }; + $scope.diagramsPrepared = false; + // set indicator manually. + // if we use ng-model it gets converted to string instead of an object + $scope.selectedIndicator = indicator; + // get a new template (in case another indicator was selected previously) + $scope.template = $scope.getCleanTemplate(); + // set spatial unit to highest available one + let spatialUnits = await $scope.queryAllSpatialUnits(); + // go from highest to lowest spatial unit and check if it is available. + for (let spatialUnit of spatialUnits) { + let applicableSpatialUnitsFiltered = $scope.selectedIndicator.applicableSpatialUnits.filter((unit) => { + return unit.spatialUnitId === spatialUnit.spatialUnitId; + }); + if (applicableSpatialUnitsFiltered.length === 1) { + $scope.selectedSpatialUnit = applicableSpatialUnitsFiltered[0]; + break; + } + } + if (!$scope.selectedSpatialUnit) { + throw new Error("No applicable spatial unit found."); + } + await $scope.updateAreasInDualList(); // this populates $scope.availableFeaturesBySpatialUnit + // select most recent timestamp that is valid for the largest spatial unit + let dates = $scope.selectedIndicator.applicableDates; + let timestampsForSelectedSpatialUnit = getValidTimestampsForSpatialUnit($scope.selectedSpatialUnit); + timestampsForSelectedSpatialUnit.sort(); + let availableTimestamps = dates + .filter(name => { + return timestampsForSelectedSpatialUnit.includes(name); + }).map(name => { + return { "properties": { "NAME": name } }; + }); + let mostRecentTimestampName = timestampsForSelectedSpatialUnit.at(-1); + let mostRecentTimestamp = availableTimestamps.filter(el => { + return el.properties.NAME === mostRecentTimestampName; + }); + if ($scope.template.name === "A4-landscape-timeseries") { + $scope.dateSlider = $scope.initializeDateRangeSlider(timestampsForSelectedSpatialUnit); + } + // update information in preview + for (let page of $scope.template.pages) { + for (let el of page.pageElements) { + if (el.type === "indicatorTitle-landscape") { + el.text = indicator.indicatorName + " [" + indicator.unit + "]"; + el.isPlaceholder = false; + // no area-specific pages in template since diagrams are not prepared yet + // and area/timestamp/timeseries changes are done after that + } + if (el.type === "dataTimestamp-landscape") { + el.text = mostRecentTimestampName; + el.isPlaceholder = false; + } + if (el.type === "dataTimeseries-landscape") { + let dsValues = $scope.getFormattedDateSliderValues(); + el.text = dsValues.from + " - " + dsValues.to; + el.isPlaceholder = false; + } + } + } + // get all features of largest spatial unit + let features = $scope.availableFeaturesBySpatialUnit[$scope.selectedSpatialUnit.spatialUnitName]; + features = $scope.createLowerCaseNameProperty(features); + let geoJson = { + features: features + }; + // add new prop to indicator metadata, because it is expected that way by kommonitorVisualStyleHelperService + // used in prepareDiagrams + $scope.selectedIndicator.geoJSON = geoJson; + let classifyUsingWholeTimeseries = false; + let isTimeseries = false; + $scope.prepareDiagrams($scope.selectedIndicator, $scope.selectedSpatialUnit, mostRecentTimestampName, classifyUsingWholeTimeseries, isTimeseries, undefined, undefined); + // We have to update time and areas. Usually both of these would result in a diagram update. + // We want to skip the first one and only update diagrams once everything is ready for better performance. + $scope.isFirstUpdateOnIndicatorOrPoiLayerSelection = true; + if ($scope.template.name === "A4-landscape-timeseries") { + // This is an exception from the process above + $scope.isFirstUpdateOnIndicatorOrPoiLayerSelection = false; + classifyUsingWholeTimeseries = false; + let values = $scope.getFormattedDateSliderValues(); + let isTimeseries = true; + $scope.prepareDiagrams($scope.selectedIndicator, $scope.selectedSpatialUnit, mostRecentTimestampName, classifyUsingWholeTimeseries, isTimeseries, values.from, values.to); + } + else { + $scope.updateDualList($scope.dualListTimestampsOptions, availableTimestamps, mostRecentTimestamp); + } + // select all areas by default + let allAreas = $scope.availableFeaturesBySpatialUnit[$scope.selectedSpatialUnit.spatialUnitName]; + $scope.updateDualList($scope.dualListAreasOptions, allAreas, allAreas); + let allTabs = document.querySelectorAll("#reporting-add-indicator-tab-list li"); + for (let tab of allTabs) { + $scope.enableTab(tab); + } + } + catch (error) { + console.error(error); + kommonitorDataExchangeService.displayMapApplicationError(error); + $scope.loadingData = false; + } + }; + $scope.getCleanTemplate = function () { + let result = angular.fromJson($scope.untouchedTemplateAsString); + for (let page of result.pages) { + page.id = $scope.templatePageIdCounter++; + } + return result; + }; + $scope.onBackToOverviewClicked = function () { + $scope.reset(); + $scope.$emit('reportingBackToOverviewClicked'); + }; + $scope.reset = function () { + $scope.template = undefined; + $scope.untouchedTemplateAsString = ""; + $scope.indicatorNameFilter = ""; + $scope.poiNameFilter = ""; + $scope.availableIndicators = []; + $scope.selectedIndicator = undefined; + $scope.availableFeaturesBySpatialUnit = {}; + $scope.selectedSpatialUnit = undefined; + $scope.selectedAreas = []; + $scope.selectedTimestamps = []; + $scope.indexOfFirstAreaSpecificPage = undefined; + $scope.echartsOptions = { + map: {}, + bar: {}, + line: {}, + }; + $scope.loadingData = false; + $scope.templatePageIdCounter = 1; + $scope.dateSlider = undefined; + $scope.echartsRegisteredMapNames = []; + for (let i = 2; i < 7; i++) { + let tab = document.querySelector("#reporting-add-indicator-tab" + i); + $scope.disableTab(tab); + } + }; + $scope.onAddBtnClicked = function () { + // for each page: add echarts configuration objects to the template + for (let [idx, page] of $scope.template.pages.entries()) { + let pageDom = document.querySelector("#reporting-addIndicator-page-" + idx); + for (let pageElement of page.pageElements) { + let pElementDom; + if (pageElement.type === "linechart") { + let arr = pageDom.querySelectorAll(".type-linechart"); + if (pageElement.showPercentageChangeToPrevTimestamp) { + pElementDom = arr[1]; + } + else { + pElementDom = arr[0]; + } + } + else { + pElementDom = pageDom.querySelector("#reporting-addIndicator-page-" + idx + "-" + pageElement.type); + } + if (pageElement.type === "map" || pageElement.type === "barchart" || pageElement.type === "linechart") { + let instance = echarts.getInstanceByDom(pElementDom); + let options = JSON.parse(JSON.stringify(instance.getOption())); + pageElement.echartsOptions = options; + // for reachability we also have the leaflet bbox stored already + // store legend for first page + } + if (pageElement.type === "datatable") { + // add some properties so we can recreate the table later + let columnHeaders = pageDom.querySelectorAll("th"); + let columnNames = []; + for (let header of columnHeaders) { + columnNames.push(header.innerText); + } + pageElement.columnNames = columnNames; + let tableData = []; + let rows = pageDom.querySelectorAll("tbody tr"); + for (let row of rows) { + let rowData = []; + let fields = row.querySelectorAll("td"); + for (let field of fields) { + rowData.push(field.innerText); + } + tableData.push(rowData); + } + pageElement.tableData = tableData; // [ [...], [...], [...] ] + } + } + } + if ($scope.selectedSpatialUnit.spatialUnitName) { + $scope.template.spatialUnitName = $scope.selectedSpatialUnit.spatialUnitName; + } + else { + $scope.template.spatialUnitName = $scope.selectedSpatialUnit.spatialUnitLevel; + } + $scope.template.absoluteLabelPositions = $scope.absoluteLabelPositions; + $scope.template.echartsRegisteredMapNames = [...new Set($scope.echartsRegisteredMapNames)]; + $scope.template.isochronesRangeType = $scope.isochronesRangeType; + $scope.template.isochronesRangeUnits = $scope.isochronesRangeUnits; + if ($scope.template.name !== "A4-landscape-reachability") { + $scope.$emit('reportingAddNewIndicatorClicked', [$scope.selectedIndicator, $scope.template]); + } + else { + $scope.$emit('reportingAddNewPoiLayerClicked', [$scope.selectedPoiLayer, $scope.selectedIndicator, $scope.template]); + } + $scope.reset(); + }; + $scope.enableTab = function (tab) { + tab.classList.remove("tab-disabled"); + tab.firstElementChild.removeAttribute("tabindex"); + }; + $scope.disableTab = function (tab) { + tab.classList.add("tab-disabled"); + tab.firstElementChild.setAttribute("tabindex", "1"); + }; + // creates and returns a series data array for each range threshold + $scope.convertIsochronesToSeriesData = function (isochrones) { + let result = []; // array of series data config objects + let ranges = []; + if (checkNestedPropExists(isochrones, "info", "query", "profile")) { + ranges = isochrones.info.query.ranges.split(","); + } + else if (isochrones.hasOwnProperty("features")) { // for buffer + for (let feature of isochrones.features) { + if (checkNestedPropExists(feature, "properties", "value") && typeof (feature.properties.value) === "number") { + ranges.push(feature.properties.value); + } + } + ranges = [...new Set(ranges)]; // remove dupes + } + if (!ranges || ranges.length === 0) { + throw new Error("Could not determine ranges from isochrones. Is the format correct?"); + } + let rangesInt = ranges.map(e => parseInt(e)); // assuming we only get integer values as input here + let colorArr = []; + if (ranges.length === 1) + colorArr.push("green"); + if (ranges.length === 2) + colorArr.push(...["green", "yellow"]); + if (ranges.length === 3) + colorArr.push(...["green", "yellow", "red"]); + if (ranges.length === 4) + colorArr.push(...["green", "yellow", "orange", "red"]); + // If we have more than five ranges the last color is used again for now. Can be extended if there is need for it. + if (ranges.length >= 5) + colorArr.push(...["green", "yellow", "orange", "red", "brown"]); + // one series per range value, so we can control the z value and legend display more easily. + for (let [idx, range] of rangesInt.entries()) { + if (idx >= colorArr.length) + idx = colorArr.length - 1; + let seriesData = []; + let data = isochrones.features.filter(feature => { + return feature.properties.value === range; // get features for this range threshold + }).map(feature => { + return { + name: feature.properties.echartsId, + value: feature.properties.value, + itemStyle: { + areaColor: colorArr[idx], + color: colorArr[idx], + opacity: 0.3 + }, + label: { + show: false + }, + emphasis: { + disabled: true + } + }; + }); + seriesData.push(...data); + result.push(seriesData); + } + return result; + }; + $scope.createMapForReachability = async function (wrapper, page, pageElement) { + let options = JSON.parse(JSON.stringify($scope.reachabilityTemplateGeoMapOptions)); + // add indictor data if it is available + if ($scope.selectedIndicator) { + options.series[0] = $scope.setMostRecentIndicatorDataToReachabilityMap(options.series[0]); + options.series[0].label.formatter = '{b}\n{c}'; + } + // register a new echarts map with a unique name (needed when filtering by area) + // check if there is a map registered for this combination, if not register one with all features + let mapName = $scope.selectedPoiLayer.datasetName + "_" + $scope.selectedSpatialUnit.spatialUnitId; + if (page.area && page.area.length) + mapName += "_" + page.area; + if (!$scope.echartsRegisteredMapNames.includes(mapName)) { + echarts.registerMap(mapName, $scope.geoJsonForReachability); + $scope.echartsRegisteredMapNames.push(mapName); + } + options.series[0].map = mapName; + options.geo.map = mapName; + // Add isochrones if possible + // In echarts one map can only handle one series + // But we need the isochrones in different series to control their z-indexes (show smaller isochrones above larger ones) + // That's why we need to register one map per range threshold, that only contains a subset of isochrones. + if ($scope.isochrones) { + for (let seriesData of $scope.isochronesSeriesData) { + let range = seriesData[0].value; + let registeredMap = echarts.getMap($scope.selectedPoiLayer.datasetName + "_isochrones-" + range); + if (!registeredMap) { + let isochrones = $scope.isochrones.features.filter(feature => { + return feature.properties.value === range; + }); + let featureCollection = { + features: isochrones + }; + echarts.registerMap($scope.selectedPoiLayer.datasetName + "_isochrones-" + range, featureCollection); + $scope.echartsRegisteredMapNames.push($scope.selectedPoiLayer.datasetName + "_isochrones-" + range); + } + } + let bbox = $scope.isochrones.bbox; // [left, bottom, right, top] + let isochronesBboxForEcharts = [[bbox[0], bbox[3]], [bbox[2], bbox[1]]]; // [left, top], [right, bottom] + for (let [idx, seriesData] of $scope.isochronesSeriesData.entries()) { + let series = { + name: "isochrones-" + seriesData[0].value, + type: 'map', + roam: false, + left: 0, top: 0, right: 0, bottom: 0, + boundingCoords: isochronesBboxForEcharts, + map: $scope.selectedPoiLayer.datasetName + "_isochrones-" + seriesData[0].value, + nameProperty: 'echartsId', + cursor: "default", + select: { + disabled: true + }, + z: 90 - idx, + data: seriesData + }; + options.series.push(series); + } + } + // Add poi markers as additional series + let centerPointSeriesData = $scope.selectedPoiLayer.geoJSON.features.map(feature => { + return feature.geometry.coordinates; + }); + let centerPointSeries = { + name: 'centerPoints', + type: 'scatter', + coordinateSystem: 'geo', + symbol: "image://icons/marker-icon.png", + symbolSize: [17, 26], + symbolOffset: [0, '-50%'], + itemStyle: { + opacity: 1 + }, + cursor: "default", + data: centerPointSeriesData, + label: { + show: false, + }, + emphasis: { + disabled: true + }, + z: 200 + }; + options.series.push(centerPointSeries); + let map = echarts.init(wrapper); + // label positioning + options = enableManualLabelPositioningAcrossPages(page, options, map); + map.setOption(options, { + replaceMerge: ['series', 'geo'] + }); + // initialize the leaflet map beneath the transparent-background echarts map + await $timeout(async function (page, pageElement, echartsMap) { + let pageIdx = $scope.template.pages.indexOf(page); + let id = "reporting-addPoiLayer-reachability-leaflet-map-container-" + pageIdx; + let pageDom = document.getElementById("reporting-addIndicator-page-" + pageIdx); + let pageElementDom = document.getElementById("reporting-addIndicator-page-" + pageIdx + "-map"); + let oldMapNode = document.getElementById(id); + if (oldMapNode) { + oldMapNode.remove(); + } + let div = document.createElement("div"); + div.id = id; + div.style.position = "absolute"; + div.style.left = pageElement.dimensions.left; + div.style.top = pageElement.dimensions.top; + div.style.width = pageElement.dimensions.width; + div.style.height = pageElement.dimensions.height; + div.style.zIndex = 10; + pageDom.appendChild(div); + let echartsOptions = echartsMap.getOption(); + let leafletMap = L.map(div.id, { + zoomControl: false, + dragging: false, + doubleClickZoom: false, + boxZoom: false, + trackResize: false, + attributionControl: false, + // prevents leaflet form snapping to closest pre-defined zoom level. + // In other words, it allows us to set exact map extend by a (echarts) bounding box + zoomSnap: 0 + }); + // manually create a field for attribution so we can control the z-index. + let prevAttributionDiv = pageDom.querySelector(".map-attribution"); + if (prevAttributionDiv) + prevAttributionDiv.remove(); + let attrDiv = document.createElement("div"); + attrDiv.classList.add("map-attribution"); + attrDiv.style.position = "absolute"; + attrDiv.style.bottom = 0; + attrDiv.style.left = 0; + attrDiv.style.zIndex = 800; + let attrImg = await kommonitorDiagramHelperService.createReportingReachabilityMapAttribution(); + attrDiv.appendChild(attrImg); + pageElementDom.appendChild(attrDiv); + // also create the legend manually + let prevLegendDiv = pageDom.querySelector(".map-legend"); + if (prevLegendDiv) + prevLegendDiv.remove(); + let legendDiv = document.createElement("div"); + legendDiv.classList.add("map-legend"); + legendDiv.style.position = "absolute"; + legendDiv.style.bottom = 0; + legendDiv.style.right = 0; + legendDiv.style.zIndex = 800; + let legendImg = await kommonitorDiagramHelperService.createReportingReachabilityMapLegend(echartsOptions, $scope.selectedSpatialUnit, $scope.isochronesRangeType, $scope.isochronesRangeUnits); + legendDiv.appendChild(legendImg); + pageElementDom.appendChild(legendDiv); + // echarts uses [lon, lat], leaflet uses [lat, lon] + let boundingCoords = echartsOptions.series[0].boundingCoords; + let westLon = boundingCoords[0][0]; + let southLat = boundingCoords[1][1]; + let eastLon = boundingCoords[1][0]; + let northLat = boundingCoords[0][1]; + if (page.area && page.area.length) { + for (let feature of $scope.geoJsonForReachability.features) { + if (feature.properties.NAME === page.area) { + // set bounding box to this feature + let featureBbox = feature.properties.bbox; + westLon = featureBbox[0]; + southLat = featureBbox[1]; + eastLon = featureBbox[2]; + northLat = featureBbox[3]; + break; + } + } + } + // Add 2% space on all sides + let divisor = 50; + let bboxHeight = northLat - southLat; + let bboxWidth = eastLon - westLon; + northLat += bboxHeight / divisor; + southLat -= bboxHeight / divisor; + eastLon += bboxWidth / divisor; + westLon -= bboxWidth / divisor; + leafletMap.fitBounds([[southLat, westLon], [northLat, eastLon]]); + let bounds = leafletMap.getBounds(); + // now update every echarts series + boundingCoords = [[bounds.getWest(), bounds.getNorth()], [bounds.getEast(), bounds.getSouth()]]; + for (let series of echartsOptions.series) { + series.top = 0; + series.bottom = 0; + series.aspectScale = 0.625; + series.boundingCoords = boundingCoords; + } + // also for the invisible geo component to update pois + echartsOptions.geo[0].top = 0; + echartsOptions.geo[0].bottom = 0; + echartsOptions.geo[0].aspectScale = 0.625; + echartsOptions.geo[0].boundingCoords = boundingCoords; + echartsMap.setOption(echartsOptions, { + notMerge: true + }); + // Attribution is handled in a custom element + let osmLayer = new L.TileLayer.Grayscale("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"); + osmLayer.addTo(leafletMap); + // add leaflet map to pageElement in case we need it again later + pageElement.leafletMap = leafletMap; + // can be used to check if positioning in echarts matches the one from leaflet + // let geoJsonLayer = L.geoJSON( $scope.geoJsonForReachability.features ) + // geoJsonLayer.addTo(leafletMap) + // let isochronesLayer = L.geoJSON( $scope.isochrones.features ) + // isochronesLayer.addTo(leafletMap); + // let poiMarkerLSource = { + // "type": "FeatureCollection", + // "features": [] + // } + // for(let lonLatArr of centers) { + // poiMarkerLSource.features.push({ + // "type": "Feature", + // "geometry": { + // "type": "Point", + // "coordinates": [ + // lonLatArr[0], + // lonLatArr[1] + // ] + // } + // }) + // } + // poiMarkerLayer = L.geoJSON( poiMarkerLSource ) + // poiMarkerLayer.addTo(leafletMap); + pageElement.leafletBbox = bounds; + if (pageIdx === $scope.template.pages.length - 1) { + $scope.loadingData = false; + } + }, 0, true, page, pageElement, map); + return map; + }; + /** + * Creates and returns an echarts geoMap object. + * @param {*} wrapper | the dom element (most likely a div) where the map should be inserted + * @param {*} pageElement + * @returns + */ + $scope.createPageElement_Map = async function (wrapper, page, pageElement) { + if ($scope.template.name === "A4-landscape-reachability") { + let map = await $scope.createMapForReachability(wrapper, page, pageElement); + return map; + } + // check if there is a map registered for this combination, if not register one with all features + let mapName = undefined; + let timestamp = undefined; + // get the timestamp from pageElement, not from dom because dom might not be up to date yet + let dateElement; + if ($scope.template.name === "A4-landscape-reachability") { + dateElement = page.pageElements.find(el => { + return el.type === "reachability-subtitle-landscape"; + }); + timestamp = dateElement.text.split(",")[0]; + } + else { + // the other two templates + dateElement = page.pageElements.find(el => { + // pageElement references the map here + // do the comparison like this because we have maps with dataTimestamp and dataTimeseries in the timeseries template + return el.type === (pageElement.isTimeseries ? "dataTimeseries-landscape" : "dataTimestamp-landscape"); + }); + if (pageElement.isTimeseries) { + timestamp = dateElement.text.split(" - ")[1]; // get the recent timestamp + } + else { + timestamp = dateElement.text; + } + } + if ($scope.template.name === "A4-landscape-reachability") { + mapName = $scope.selectedIndicator.indicatorId + "_" + timestamp + "_" + $scope.selectedSpatialUnit.spatialUnitName; + } + else { + mapName = $scope.selectedIndicator.indicatorId + "_" + dateElement.text + "_" + $scope.selectedSpatialUnit.spatialUnitName; + } + if (pageElement.classify) + mapName += "_classified"; + if (pageElement.isTimeseries) + mapName += "_timeseries"; + if (page.area && page.area.length) + mapName += "_" + page.area; + if (!$scope.echartsRegisteredMapNames.includes(mapName)) { + echarts.registerMap(mapName, $scope.selectedIndicator.geoJSON); + $scope.echartsRegisteredMapNames.push(mapName); + } + let map = echarts.init(wrapper); + if (pageElement.isTimeseries) { + timestamp += "_relative"; + } + let options = JSON.parse(JSON.stringify($scope.echartsOptions.map[timestamp])); + // default changes for all reporting maps + options.title.show = false; + options.grid = undefined; + options.visualMap.axisLabel = { "fontSize": 10 }; + options.toolbox.show = false; + options.visualMap.left = "right"; + let series = options.series[0]; + series.roam = false; + series.selectedMode = false; + if (pageElement.isTimeseries) { + let includeInBetweenDates = true; + let timeseries = $scope.getFormattedDateSliderValues(includeInBetweenDates); + series.data = $scope.calculateSeriesDataForTimeseries($scope.selectedIndicator.geoJSON.features, timeseries); + } + series.map = mapName; // update the map with the one registered above + series.name = mapName; + let areaNames = $scope.selectedAreas.map(el => { + return el.name; + }); + if (pageElement.classify === true) { + options.visualMap.show = true; + } + else { + options.visualMap.show = false; + } + series.data.forEach(el => { + el.itemStyle = el.itemStyle ? el.itemStyle : {}; + el.emphasis = el.emphasis ? el.emphasis : {}; + el.emphasis.itemStyle = el.emphasis.itemStyle ? el.emphasis.itemStyle : {}; + el.label = el.label ? el.label : {}; + el.visualMap = false; + if (pageElement.classify === false) { + if (areaNames.includes(el.name)) { + // show selected areas (don't classify color by value) + el.label.formatter = '{b}\n{c}'; + el.label.show = true; + el.label.textShadowColor = '#ffffff'; + el.label.textShadowBlur = 2; + el.itemStyle.areaColor = "rgb(255, 153, 51, 0.6)"; + el.itemStyle.color = "rgb(255, 153, 51, 0.6)"; + el.emphasis.itemStyle.areaColor = "rgb(255, 153, 51, 0.6)"; + el.emphasis.itemStyle.color = "rgb(255, 153, 51, 0.6)"; + } + else { + // Only show borders for any other areas + el.itemStyle.color = "rgba(255, 255, 255, 0)"; + el.itemStyle.areaColor = "rgba(255, 255, 255, 0)"; + el.emphasis.itemStyle.color = "rgba(255, 255, 255, 0)"; + el.emphasis.itemStyle.areaColor = "rgba(255, 255, 255, 0)"; + el.label.show = false; + } + } + if (pageElement.classify === true) { + if (areaNames.includes(el.name)) { + el.visualMap = true; + el.label.formatter = '{b}\n{c}'; + // get color from visual map to overwrite yellow color + let color = "rgba(0, 0, 0, 0.5)"; + let opacity = 1; + for (let [idx, piece] of options.visualMap.pieces.entries()) { + // for the last index (highest value) value can equal the upper boundary + if (idx === (options.visualMap.pieces.length - 1)) { + if (piece.min <= el.value && el.value <= piece.max) { + color = piece.color; + opacity = piece.opacity; + break; + } + } + // for all other pieces check if it is withing the boundaries, (including lower one, excluding upper one) + if (piece.min <= el.value && el.value < piece.max) { + color = piece.color; + opacity = piece.opacity; + break; + } + } + el.label.show = true; + el.itemStyle.color = color; + el.itemStyle.areaColor = color; + el.itemStyle.opacity = opacity; + el.emphasis.itemStyle.color = color; + el.emphasis.itemStyle.areaColor = color; + el.emphasis.itemStyle.opacity = opacity; + el.label.textShadowColor = '#ffffff'; + el.label.textShadowBlur = 2; + } + else { + el.visualMap = false; + el.itemStyle.color = "rgb(255, 255, 255)"; + el.itemStyle.areaColor = "rgb(255, 255, 255)"; + el.emphasis.itemStyle.color = "rgb(255, 255, 255)"; + el.emphasis.itemStyle.areaColor = "rgb(255, 255, 255)"; + el.label.show = false; + } + } + }); + // label positioning + options = enableManualLabelPositioningAcrossPages(page, options, map); + map.setOption(options); + return map; + }; + function enableManualLabelPositioningAcrossPages(page, options, map) { + if (!page.area) { + options.labelLayout = function (feature) { + if (feature.seriesIndex != 0) { // index 0 are the borders / indicator + return; + } + // Set fixed position for labels that were previously dragged by user + // For all other labels try to avoid overlaps + let names = $scope.absoluteLabelPositions.map(el => el.name); + let text = feature.text.split("\n")[0]; // area name is the first line + if (names.includes(text)) { + let idx = names.indexOf(text); + return { + x: $scope.absoluteLabelPositions[idx].x, + y: $scope.absoluteLabelPositions[idx].y, + draggable: true + }; + } + else { + return { + moveOverlap: 'shiftY', + x: feature.rect.x + feature.rect.width / 2, + draggable: true + }; + } + }; + options.labelLine = { + show: true, + showAbove: false, + lineStyle: { + color: '#555' + } + }; + map.getZr().on('mousedown', function (event) { + // on label drag + if (event.target) { + let target = event.target; + if (target.parent && target.parent.type === "text") { + // get the feature which this label belongs to + // When user clicks on the label, one of the child elements is clicked + // Child elements can be something like: first line of text, second line of text, (white) label background + // These elements all have the same parent, which we can use to navigate to the parent and then find the correct child (area name) + let parent = target.parent; + let areaNameChild; + for (let child of parent._children) { + // we assume that the area name is the first child with text ("the first line") + if (child.style.text && child.style.text.length > 0) { + areaNameChild = child; + break; + } + } + $scope.draggingLabelForFeature = areaNameChild.style.text; + } + } + }); + map.getZr().on('mouseup', function (event) { + if (event.target) { + let target = event.target; + if (target.parent && target.parent.type === "text") { + // for all other maps, that are not area-specific, do the exact same label drag + let newX = target.parent.x; + let newY = target.parent.y; + let names = $scope.absoluteLabelPositions.map(el => el.name); + if (names.includes($scope.draggingLabelForFeature)) { + let idx = names.indexOf($scope.draggingLabelForFeature); + $scope.absoluteLabelPositions[idx].x = newX; + $scope.absoluteLabelPositions[idx].y = newY; + } + else { + $scope.absoluteLabelPositions.push({ + name: $scope.draggingLabelForFeature, + x: newX, + y: newY + }); + } + for (let [idx, page] of $scope.template.pages.entries()) { + for (let pageElement of page.pageElements) { + if (pageElement.type === "map" && !page.area) { + let domNode = document.getElementById("reporting-addIndicator-page-" + idx + "-map"); + let map = echarts.getInstanceByDom(domNode); + map.setOption(map.getOption()); // this calls the labelLayout function defined above + } + } + } + } + } + }); + } + return options; + } + $scope.createPageElement_Average = function (page, pageElement, calcForSelection) { + // get the timestamp from pageElement, not from dom because dom might not be up to date yet + // no timeseries possible for this type of element + let dateElement = page.pageElements.find(el => { + return el.type === "dataTimestamp-landscape"; + }); + let timestamp = dateElement.text; + let avg = $scope.calculateAvg($scope.selectedIndicator, timestamp, calcForSelection); + pageElement.text = avg; + pageElement.css = "border: solid 1px lightgray; padding: 2px;"; + pageElement.isPlaceholder = false; + }; + $scope.createPageElement_Change = function (page, pageElement, calcForSelection) { + // get the timeseries from slider, not from dom because dom might not be up to date yet + let timeseries = $scope.getFormattedDateSliderValues(true); + let change = $scope.calculateChange($scope.selectedIndicator, timeseries, calcForSelection); + pageElement.text = change; + pageElement.css = "border: solid 1px lightgray; padding: 2px;"; + pageElement.isPlaceholder = false; + }; + $scope.createPageElement_BarChartDiagram = function (wrapper, page) { + // get timestamp from pageElement, not from dom because dom might not be up to date yet + // barcharts are only used in timestamp templates so we don't have to check for timeseries for now + let dateElement = page.pageElements.find(el => { + return el.type === "dataTimestamp-landscape"; + }); + let timestamp = dateElement.text; + let barChart = echarts.init(wrapper); + let options = JSON.parse(JSON.stringify($scope.echartsOptions.bar[timestamp])); + // default changes + options.xAxis.name = ""; + options.title.textStyle.fontSize = 12; + options.title.text = ""; + options.yAxis.axisLabel = { "fontSize": 10 }; + options.title.show = true; + options.grid.top = 35; + options.grid.bottom = 5; + options.toolbox.show = false; + options.visualMap[0].show = false; // only needed to set the color for avg + options.xAxis.axisLabel.show = true; + options.yAxis.name = ""; // included in header of each page + options.xAxis.name = ""; // always timestamps + // black text with halo effect for better visibility + if (!options.textStyle) + options.textStyle = {}; + options.textStyle.color = "black"; + options.textStyle.textShadowColor = '#ffffff'; + options.textStyle.textShadowBlur = 2; + // filter series data and xAxis labels + if (page.area && page.area.length) { + options.series[0].data = options.series[0].data.filter(el => { + return el.name === page.area; + }); + let areaNames = options.series[0].data.map(obj => obj.name); + options.xAxis.data = areaNames; + } + else { + // only show selected areas in the "overview" diagram + let areaNames = $scope.selectedAreas.map(obj => obj.name); + options.series[0].data = options.series[0].data.filter(el => { + return areaNames.includes(el.name); + }); + areaNames = options.series[0].data.map(obj => obj.name); + options.xAxis.data = areaNames; + } + options.series[0].data.sort(function (a, b) { + if (typeof (a.value) == 'number' && typeof (b.value) == 'number') { + return a.value - b.value; + } + else { + return -1; + } + }); + // add data element for the overall average + let overallAvgValue = $scope.calculateAvg($scope.selectedIndicator, timestamp, false); + let overallAvgElementName = (page.area && page.area.length) ? "Durchschnitt\nder\nRaumeinheit" : "Durchschnitt der Raumeinheit"; + let dataObjOverallAvg = { + name: overallAvgElementName, + value: overallAvgValue, + opacity: 1 + }; + // get color for avg from visual map and disable opacity + let colorOverallAvg = ""; + for (let piece of options.visualMap[0].pieces) { + if (piece.min <= dataObjOverallAvg.value && dataObjOverallAvg.value < piece.max) { + colorOverallAvg = piece.color; + } + piece.opacity = 1; + } + dataObjOverallAvg.color = colorOverallAvg; + options.series[0].data.push(dataObjOverallAvg); + options.xAxis.data.push(dataObjOverallAvg.name); + // same for selection average + // add more data elements for the overall and selection average + let selectionAvgValue = $scope.calculateAvg($scope.selectedIndicator, timestamp, true); + let selectionAvgElementName = (page.area && page.area.length) ? "Durchschnitt\nder\nSelektion" : "Durchschnitt der Selektion"; + let dataObjSelectionAvg = { + name: selectionAvgElementName, + value: selectionAvgValue, + opacity: 1 + }; + // get color for avg from visual map and disable opacity + let colorSelectionAvg = ""; + for (let piece of options.visualMap[0].pieces) { + if (piece.min <= dataObjSelectionAvg.value && dataObjSelectionAvg.value < piece.max) { + colorSelectionAvg = piece.color; + } + piece.opacity = 1; + } + dataObjSelectionAvg.color = colorSelectionAvg; + options.series[0].data.push(dataObjSelectionAvg); + options.xAxis.data.push(dataObjSelectionAvg.name); + options.series[0].emphasis.itemStyle = {}; // don't show border on hover + barChart.setOption(options, { + replaceMerge: ['series'] // take the new series data, don't update part of the old one + }); + return barChart; + }; + $scope.createPageElement_TimelineDiagram = function (wrapper, page, pageElement) { + // no need to get a timestamp here + let lineChart = echarts.init(wrapper); + let timeline = $scope.getFormattedDateSliderValues(true).dates; + // get standard options, create a copy of the options to not change anything in the service + let options = JSON.parse(JSON.stringify($scope.echartsOptions.line)); + options.title.textStyle.fontSize = 12; + options.title.text = "Zeitreihe"; + options.yAxis.axisLabel = { "fontSize": 10 }; + options.xAxis.axisLabel = { "fontSize": 10 }; + options.legend.show = false; + options.grid.top = 35; + options.grid.bottom = 5; + options.title.show = true; + options.toolbox.show = false; + options.yAxis.name = ""; // included in header of each page + options.xAxis.name = ""; // always timestamps + // diagram contains avg series by default + // if it should be shown we adjust it to our timeseries + // future dates (compared to max slider value) were already filtered in prepareDiagrams + // we have to remove dates older than min slider value here + // we also have to filter xAxis labels accordingly + let timeseries = $scope.getFormattedDateSliderValues(true); + let oldestSelectedTimestamp = timeseries.from; + let timestampsToRemoveCounter = 0; + // use the axis labels to find out how many data points have to be removed later + let timestampReached = false; + while (!timestampReached) { + if (oldestSelectedTimestamp === options.xAxis.data[0]) { + timestampReached = true; + } + else { + options.xAxis.data.shift(); + timestampsToRemoveCounter += 1; + } + } + if (pageElement.showAverage) { + options.series = options.series.filter(series => { + return series.name === "Arithmetisches Mittel"; + }); + for (let i = 0; i < timestampsToRemoveCounter; i++) { + options.series[0].data.shift(); + } + } + else { + options.series = []; + } + if (pageElement.showAreas) { + let areaNames = []; + // in area specific part only add one line + if (page.area && page.area.length) { + areaNames.push(page.area); + } + else { + // else add one line for each selected area + areaNames = $scope.selectedAreas.map(el => { + return el.name; + }); + } + for (let areaName of areaNames) { + let data = []; + let filtered = $scope.selectedIndicator.geoJSON.features.filter(feature => { + return feature.properties.NAME === areaName; + }); + for (let timestamp of timeline) { + let value = filtered[0].properties["DATE_" + timestamp]; + data.push(value); + } + let series = {}; + series.name = areaName; + series.type = "line"; + series.data = data; + series.lineStyle = { + normal: { + width: 2, + type: "solid" + } + }; + series.itemStyle = { + normal: { + borderWidth: 3 + } + }; + options.series.push(series); + } + } + if (pageElement.showPercentageChangeToPrevTimestamp) { + for (let series of options.series) { + series.data = $scope.transformSeriesDataToPercentageChange(series.data); + } + options.xAxis.data.shift(); + options.title.text = "Veränderung zum Vorjahr"; + } + if (pageElement.showBoxplots) { + // we assume that boxplots are only shown when showAreas is false (might change in the future). + // so we have to get the data of all areas first + let areaNames = []; + areaNames = $scope.selectedAreas.map(el => { + return el.name; + }); + // create a nested array with each inner array containing all area-values for one timestamp + let datasetSource = []; + for (let timestamp of timeline) { + let valuesForTimestamp = []; + // filter features to selected areas + let selectedAreasFeatures = $scope.selectedIndicator.geoJSON.features.filter(feature => { + return areaNames.includes(feature.properties.NAME); + }); + // get values for each feature + for (let feature of selectedAreasFeatures) { + let value = feature.properties["DATE_" + timestamp]; + valuesForTimestamp.push(value); + } + datasetSource.push(valuesForTimestamp); + } + let xAxisLabels = options.xAxis.data; + options.dataset = [ + { + source: datasetSource + }, + { + transform: { + type: 'boxplot', + config: { + // params is 0, 1, 2, ... + // we can use this as an index to get the actual label and return it + itemNameFormatter: function (params) { + return xAxisLabels[params.value]; + } + } + } + }, + { + fromDatasetIndex: 1, + fromTransformResult: 1 + } + ]; + // add a new series that references the boxplots + options.series.push({ + name: 'boxplot', + type: 'boxplot', + datasetIndex: 1 // overlap boxplots and avg. line + }); + } + lineChart.setOption(options, { + replaceMerge: ['series'] // take the new series data, don't update part of the old one + }); + return lineChart; + }; + $scope.createPageElement_Datatable = function (wrapper, page) { + // table looks different depending on template type + // for single timestamps it is added at the end of each timestamp-section, so each area is inserted once + // for timeseries it is added once at the end of the template and contains an extra column for timestamps. + // Each area is inserted for multiple timestamps. + // our wrapper is 440px high. + // 440 - 25 (header) = 415 + // we set each row to be 25px high, so we can fit 415 / 25 --> 16 rows on one page. + let wrapperHeight = parseInt(wrapper.style.height, 10); + let maxRows = Math.floor((wrapperHeight - 25) / 25); + let rowsData = []; + let timestamp = undefined; + let timeseries = undefined; + if ($scope.template.name === "A4-landscape-timestamp") { + // get the timestamp from pageElement, not from dom because dom might not be up to date yet + let dateElement = page.pageElements.find(el => { + return el.type === "dataTimestamp-landscape"; + }); + timestamp = dateElement.text; + } + if ($scope.template.name === "A4-landscape-timeseries") { + let inBetweenValues = true; + timeseries = $scope.getFormattedDateSliderValues(inBetweenValues); + } + // see how many pages need to be added. Rows are added later + for (let feature of $scope.selectedIndicator.geoJSON.features) { + // don't add row if feature not selected + let isSelected = false; + for (let area of $scope.selectedAreas) { + if (area.name === feature.properties.NAME) { + isSelected = true; + } + } + if (!isSelected) + continue; + if ($scope.template.name === "A4-landscape-timestamp") { + // get the timestamp from pageElement, not from dom because dom might not be up to date yet + let dateElement = page.pageElements.find(el => { + return el.type === "dataTimestamp-landscape"; + }); + let timestamp = dateElement.text; + // prepare data to insert later + let value = feature.properties["DATE_" + timestamp]; + if (typeof (value) == 'number') + value = Math.round(value * 100) / 100; + rowsData.push({ + name: feature.properties.NAME, + value: value + }); + } + if ($scope.template.name === "A4-landscape-timeseries") { + for (let timestamp of timeseries.dates) { + let value = feature.properties["DATE_" + timestamp]; + if (typeof (value) == 'number') + value = Math.round(value * 100) / 100; + rowsData.push({ + name: feature.properties.NAME, + timestamp: timestamp, + value: value + }); + } + } + } + // sort by area name + rowsData.sort((a, b) => a.name.localeCompare(b.name)); + // append average as last row if needed + if ($scope.template.name === "A4-landscape-timestamp") { + rowsData.push({ + name: "Durchschnitt Selektion", + value: $scope.calculateAvg($scope.selectedIndicator, timestamp, true) + }); + rowsData.push({ + name: "Durchschnitt Gesamtstadt", + value: $scope.calculateAvg($scope.selectedIndicator, timestamp, false) + }); + } + // the length of rowsData is the number of rows we have to add + for (let i = 0; i < rowsData.length; i++) { + // each time we hit the page breakpoint we add a new page + // at this point we are not actually adding any rows to the table + if (i > 0 && i % maxRows == 0) { + // add a new page + let newPage = angular.fromJson($scope.untouchedTemplateAsString).pages.at(-1); + newPage.id = $scope.templatePageIdCounter++; + // setup new page + for (let pageElement of newPage.pageElements) { + if (pageElement.type === "indicatorTitle-landscape") { + pageElement.text = $scope.selectedIndicator.indicatorName + " [" + $scope.selectedIndicator.unit + "]"; + pageElement.isPlaceholder = false; + } + if (pageElement.type === "dataTimestamp-landscape") { + pageElement.text = timestamp; + pageElement.isPlaceholder = false; + } + // exists only on timeseries template (instead of dataTimestamp-landscape), so we don't need another if...else here + if (pageElement.type === "dataTimeseries-landscape") { + pageElement.text = timeseries.from + " - " + timeseries.to; + pageElement.isPlaceholder = false; + } + if (pageElement.type === "datatable") { + pageElement.isPlaceholder = false; + } + } + // insert after current one + let currentPageIndex = $scope.template.pages.indexOf(page); + $scope.template.pages.splice(currentPageIndex + 1, 0, newPage); + } + } + // create table rows once the pages exist + function insertDatatableRows(rowsData, page, maxRows) { + // get current index of page (might have changed in the meantime) + let idx = $scope.template.pages.indexOf(page); + let wrapper = document.querySelector("#reporting-addIndicator-page-" + idx + "-datatable"); + if (wrapper) { + $interval.cancel(insertDatatableRowsInterval); // code below still executes once + } + else { + return; + } + wrapper.innerHTML = ""; + wrapper.style.border = "none"; // hide dotted border from outer dom element + wrapper.style.justifyContent = "flex-start"; // align table at top instead of center + let columnNames; + if ($scope.template.name === "A4-landscape-timeseries") { + columnNames = ["Bereich", "Zeitpunkt", "Wert"]; + } + else { + columnNames = ["Bereich", "Wert"]; + } + let table = $scope.createDatatableSkeleton(columnNames); + wrapper.appendChild(table); + let tbody = table.querySelector("tbody"); + let pageElement = $scope.template.pages[idx].pageElements.find(el => el.type === "datatable"); + pageElement.isPlaceholder = false; + for (let i = 0; i < rowsData.length; i++) { + // see which page we have to add the row to + // switch to next page if necessary + let intervalArr = []; + if ((i % maxRows) == 0) { + if (i > 0) + idx++; + const idx_save = idx; + const i_save = i; + intervalArr[idx_save] = $interval(insertDatatableRowsPerPage, 0, 100, true, pageElement, idx_save, columnNames, maxRows, rowsData, i_save); + function insertDatatableRowsPerPage(pageElement, idx, columnNames, maxRows, rowsData, i) { + // check if page exists already in dom, if not try again later + wrapper = document.querySelector("#reporting-addIndicator-page-" + idx + "-datatable"); + if (wrapper) { + $interval.cancel(intervalArr[idx]); // code below still executes once + } + else { + return; + } + // page exists + wrapper.innerHTML = ""; + wrapper.style.border = "none"; // hide dotted border from outer dom element + wrapper.style.justifyContent = "flex-start"; // align table at top instead of center + table = $scope.createDatatableSkeleton(columnNames); + wrapper.appendChild(table); + tbody = table.querySelector("tbody"); + pageElement = $scope.template.pages[idx].pageElements.find(el => el.type === "datatable"); + pageElement.isPlaceholder = false; + for (let j = i; j < (i + maxRows); j++) { + if (!rowsData[j]) + break; // on last page + let row = document.createElement("tr"); + row.style.height = "25px"; + for (let colName of columnNames) { + let td = document.createElement("td"); + if (colName === "Bereich") { + td.innerText = rowsData[j].name; + td.classList.add("text-left"); + } + if (colName === "Zeitpunkt") { + td.innerText = rowsData[j].timestamp; + } + if (colName === "Wert") { + td.innerText = rowsData[j].value; + td.classList.add("text-right"); + } + row.appendChild(td); + } + tbody.appendChild(row); + } + } + } + } + } + let insertDatatableRowsInterval = $interval(insertDatatableRows, 0, 100, true, rowsData, page, maxRows); + }; + $scope.filterMapByAreaName = function (echartsInstance, areaName, allFeatures) { + let options = echartsInstance.getOption(); + let mapName = options.series[0].map; + // filter shown areas if we are in the area-specific part of the template + // removing areas form the series doesn't work. We have to filter the geojson of the registered map. + let features = allFeatures.filter(el => { + return el.properties.name === areaName; + }); + echarts.registerMap(mapName, { features: features }); + // echart map bounds are defined by a bounding box, which has to be updated as well. + if (!features[0].properties.bbox) { + features[0].properties.bbox = turf.bbox(features[0]); + } + let bbox = features[0].properties.bbox; // [east, south, west, north] + let newBounds = [[bbox[2], bbox[3]], [bbox[0], bbox[1]]]; // [[west, north], [east, south]] + options.series[0].boundingCoords = newBounds; + echartsInstance.setOption(options, { + replaceMerge: ['series'] + }); + }; + $scope.calculateAvg = function (indicator, timestamp, calcForSelection) { + // calculate avg from geoJSON property, which should be the currently selected spatial unit + let features = indicator.geoJSON.features; + if (calcForSelection) { + features = features.filter(el => { + return $scope.selectedAreas.map(area => area.name).includes(el.properties.NAME); + }); + } + let data = features.map(feature => { + return feature.properties["DATE_" + timestamp]; + }); + let noDataCounter = 0; + let sum = 0; + for (let i = 0; i < data.length; i++) { + if (typeof (data[i]) === "number" && !isNaN(data[i])) { + sum += data[i]; + } + else { + noDataCounter++; + } + } + let avg = sum / data.length - noDataCounter; + avg = Math.round(avg * 100) / 100; // 2 decimal places + return avg; + }; + $scope.calculateChange = function (indicator, timeseries, calcForSelection) { + let data = $scope.calculateSeriesDataForTimeseries(indicator.geoJSON.features, timeseries); + if (calcForSelection) { + data = data.filter(el => { + return $scope.selectedAreas.map(area => area.name).includes(el.name); + }); + } + data = data.map(obj => obj.value); + let noDataCounter = 0; + let sum = 0; + for (let i = 0; i < data.length; i++) { + if (typeof (data[i]) === "number" && !isNaN(data[i])) { + sum += data[i]; + } + else { + noDataCounter++; + } + } + let avgChange = sum / data.length - noDataCounter; + avgChange = Math.round(avgChange * 100) / 100; // 2 decimal places + return avgChange; + }; + $scope.prepareDiagrams = function (selectedIndicator, selectedSpatialUnit, timestampName, classifyUsingWholeTimeseries, isTimeseries, fromDate, toDate) { + // if is timeseries we must modify the indicator type of the given indicator, since it should display changes over time and hence + // must be treated as dynamic indicator + let indicator = JSON.parse(JSON.stringify(selectedIndicator)); + let targetTimestamp = timestampName; + if (isTimeseries) { + var indicatorType = indicator.indicatorType; + if (indicatorType.includes("ABSOLUTE")) { + indicator.indicatorType = "DYNAMIC_ABSOLUTE"; + } + else if (indicatorType.includes("RELATIVE")) { + indicator.indicatorType = "DYNAMIC_RELATIVE"; + } + else if (indicatorType.includes("STANDARDIZED")) { + indicator.indicatorType = "DYNAMIC_STANDARDIZED"; + } + // compute and set actual change values to perform correct colorization of features + indicator.geoJSON.features = calculateAndSetSeriesDataForTimeseries(indicator.geoJSON.features, fromDate, toDate); + } + // set settings useOutlierDetectionOnIndicator and classifyUsingWholeTimeseries to false to have consistent reporting setup + // we need to undo these changes afterwards, so we store the current values in a backup first + const useOutlierDetectionOnIndicator_backup = kommonitorDataExchangeService.useOutlierDetectionOnIndicator; + const classifyUsingWholeTimeseries_backup = kommonitorDataExchangeService.classifyUsingWholeTimeseries; + const classifyZeroSeparately_backup = kommonitorDataExchangeService.classifyZeroSeparately; + kommonitorDataExchangeService.useOutlierDetectionOnIndicator = false; + kommonitorDataExchangeService.classifyUsingWholeTimeseries = false; + if (classifyUsingWholeTimeseries) { + kommonitorDataExchangeService.classifyUsingWholeTimeseries = true; + } + let timestampPrefix = __env.indicatorDatePrefix + timestampName; + let numClasses = indicator.defaultClassificationMapping.items.length; + let colorCodeStandard = indicator.defaultClassificationMapping.colorBrewerSchemeName; + let colorCodePositiveValues = __env.defaultColorBrewerPaletteForBalanceIncreasingValues; + let colorCodeNegativeValues = __env.defaultColorBrewerPaletteForBalanceDecreasingValues; + let classifyMethod = __env.defaultClassifyMethod; + // setup brew + let defaultBrew = kommonitorVisualStyleHelperService.setupDefaultBrew(indicator.geoJSON, timestampPrefix, numClasses, colorCodeStandard, classifyMethod, true, selectedIndicator); + let dynamicBrewsArray = kommonitorVisualStyleHelperService.setupDynamicIndicatorBrew(indicator.geoJSON, timestampPrefix, colorCodePositiveValues, colorCodeNegativeValues, classifyMethod); + let dynamicIncreaseBrew = dynamicBrewsArray[0]; + let dynamicDecreaseBrew = dynamicBrewsArray[1]; + // setup diagram resources + kommonitorDiagramHelperService.prepareAllDiagramResources_forReportingIndicator(indicator, selectedSpatialUnit.spatialUnitName, timestampName, defaultBrew, undefined, undefined, dynamicIncreaseBrew, dynamicDecreaseBrew, false, 0, true); + // at this point the echarts instance has one map registered (geoMapChart). + // that is the "default" map, which can be used to create individual maps for indicator + date + spatialUnit (+ area) combinations later + // set settings classifyUsingWholeTimeseries and useOutlierDetectionOnIndicator and classifyZeroSeparately back to their prior values + kommonitorDataExchangeService.useOutlierDetectionOnIndicator = useOutlierDetectionOnIndicator_backup; + kommonitorDataExchangeService.classifyUsingWholeTimeseries = classifyUsingWholeTimeseries_backup; + kommonitorDataExchangeService.classifyZeroSeparately = classifyZeroSeparately_backup; + // copy and save echarts options so we can re-use them later + if (isTimeseries) { + timestampName += "_relative"; // save relative indicator separately + } + $scope.echartsOptions.map[timestampName] = JSON.parse(JSON.stringify(kommonitorDiagramHelperService.getGeoMapChartOptions())); + $scope.echartsOptions.bar[timestampName] = JSON.parse(JSON.stringify(kommonitorDiagramHelperService.getBarChartOptions())); + $scope.echartsOptions.bar[timestampName].visualMap.show = true; + // no timestamp needed here + $scope.echartsOptions.line = JSON.parse(JSON.stringify(kommonitorDiagramHelperService.getLineChartOptions())); + // if is timeseries then the original value for the toDate timestamp must be used instead of the computed change value above + if (isTimeseries) { + // series[0] is average line + // replace the value for same index same toDate + let originalFeatures = selectedIndicator.geoJSON.features; + let sumToDate = 0; + let counter = 0; + for (const feature of originalFeatures) { + if (!kommonitorDataExchangeService.indicatorValueIsNoData(feature.properties[timestampPrefix])) { + sumToDate += feature.properties[timestampPrefix]; + counter++; + } + } + let toDateIndex = selectedIndicator.applicableDates.indexOf(targetTimestamp); + $scope.echartsOptions.line.series[0].data[toDateIndex] = kommonitorDataExchangeService.getIndicatorValue_asNumber(sumToDate / counter); + } + $scope.diagramsPrepared = true; + }; + $scope.prepareReachabilityEchartsMap = function () { + for (let feature of $scope.geoJsonForReachability.features) { + let bbox = turf.bbox(feature); // calculate bbox for each feature + feature.properties.bbox = bbox; + } + let overallBbox = calculateOverallBoundingBoxFromGeoJSON($scope.geoJsonForReachability.features); + // change format of bbox to match the format needed for echarts + overallBbox = [ + [overallBbox[0], overallBbox[3]], + [overallBbox[2], overallBbox[1]] // south-east lon lat + ]; + let mapName = "reachabilityMap"; // gets overwritten later anyway + echarts.registerMap(mapName, $scope.geoJsonForReachability); + let geoMapOptions = { + // geo component is only needed for isochrone center markers to work + geo: { + map: mapName, + z: 1, + itemStyle: { + opacity: 0 + }, + roam: false, + boundingCoords: overallBbox, + }, + backgroundColor: "rgba(255,255,255,0)", + series: [{ + name: "spatialUnitBoundaries", + type: 'map', + roam: false, + boundingCoords: overallBbox, + map: mapName, + cursor: "default", + itemStyle: { + areaColor: "rgb(255, 255, 255, 0)", + borderColor: "rgb(50, 50, 50)", + borderWidth: 3, + color: "rgb(255, 255, 255, 0)", + }, + label: { + show: true, + backgroundColor: 'white', + padding: [1, 2, 1, 2] // [top, right, bottom, left] + }, + emphasis: { + disabled: true + }, + z: 100, + data: [] + }] + }; + // We can set this here because this function is only relevant for reachability. + // The other diagrams don't have to be prepared since they are not used. + $scope.diagramsPrepared = true; + return geoMapOptions; + }; + $scope.initializeAllDiagrams = async function () { + if (!$scope.template) + return; + if ($scope.template.name === "A4-landscape-timestamp" && $scope.selectedTimestamps.length === 0) { + return; + } + if (!$scope.diagramsPrepared) { + throw new Error("Diagrams can't be initialized since they were not prepared previously."); + } + // We need a separate counter for page index because we iterate over the pages array. + // This array might include additional datatable pages, which are not inserted in the dom + // Even though we do nothing for these pages, the index gets out of sync with the page ids (which we use to get the dom elements) + let pageIdx = -1; + for (let i = 0; i < $scope.template.pages.length; i++) { + pageIdx++; + let page = $scope.template.pages[i]; + let prevPage = i > 1 ? $scope.template.pages[i - 1] : undefined; + let pageIncludesDatatable = page.pageElements.map(el => el.type).includes("datatable"); + if (prevPage) { + let prevPageIncludesDatatable = prevPage.pageElements.map(el => el.type).includes("datatable"); + if (pageIncludesDatatable && prevPageIncludesDatatable) { + // get corresponding pages in the dom and check if they are datatable-pages + let prevDomPageEl = document.querySelector("#reporting-addIndicator-page-" + (i - 1) + "-datatable"); + let domPageEl = document.querySelector("#reporting-addIndicator-page-" + i + "-datatable"); + if (!prevDomPageEl || !domPageEl) { // if this page does not exist in the dom + pageIdx--; // don't increase index in this iteration so it stays in sync with the pages that exist in the dom + } + continue; // don't do anything for additional datatable pages. They are added in createPageElement_Datatable + } + } + let pageDom = document.querySelector("#reporting-addIndicator-page-" + pageIdx); + for (let pageElement of page.pageElements) { + // usually each type is included only once per page, but there is an exception for linecharts in area specific part of timeseries template + // for now we more or less hardcode this, but it might have to change in the future + let pElementDom; + if (pageElement.type === "linechart") { + let arr = pageDom.querySelectorAll(".type-linechart"); + if (pageElement.showPercentageChangeToPrevTimestamp) { + pElementDom = arr[1]; + } + else { + pElementDom = arr[0]; + } + } + else { + pElementDom = pageDom.querySelector("#reporting-addIndicator-page-" + pageIdx + "-" + pageElement.type); + } + switch (pageElement.type) { + case "map": { + // initialize with all areas + let map = await $scope.createPageElement_Map(pElementDom, page, pageElement); + // filter visible areas if needed + if (page.area && page.area.length) { + if ($scope.selectedIndicator) { + $scope.filterMapByAreaName(map, page.area, $scope.selectedIndicator.geoJSON.features); + } + else { + $scope.filterMapByAreaName(map, page.area, $scope.geoJsonForReachability.features); + } + } + pageElement.isPlaceholder = false; + break; + } + case "mapLegend": { + pageElement.isPlaceholder = false; // hide the placeholder, legend is part of map + pageDom.querySelector(".type-mapLegend").style.display = "none"; + break; + } + case "overallAverage": { + $scope.createPageElement_Average(page, pageElement, false); + pageDom.querySelector(".type-overallAverage").style.border = "none"; + break; + } + case "selectionAverage": { + $scope.createPageElement_Average(page, pageElement, true); + pageDom.querySelector(".type-selectionAverage").style.border = "none"; + break; + } + case "overallChange": { + $scope.createPageElement_Change(page, pageElement, false); + let wrapper = pageDom.querySelector(".type-overallChange"); + wrapper.style.border = "none"; + wrapper.style.left = "670px"; + wrapper.style.width = "130px"; + wrapper.style.height = "100px"; + break; + } + case "selectionChange": { + $scope.createPageElement_Change(page, pageElement, true); + let wrapper = pageDom.querySelector(".type-selectionChange"); + wrapper.style.border = "none"; + wrapper.style.left = "670px"; + wrapper.style.width = "130px"; + wrapper.style.height = "100px"; + break; + } + case "barchart": { + $scope.createPageElement_BarChartDiagram(pElementDom, page); + pageElement.isPlaceholder = false; + break; + } + case "linechart": { + $scope.createPageElement_TimelineDiagram(pElementDom, page, pageElement); + pageElement.isPlaceholder = false; + break; + } + case "datatable": { + // remove all following datatable pages first so we don't add too many. + // this might happen because we initialize page elements from $watch(selectedAreas) and $watch(selectedTimestamps) on indicator selection + let nextPage = i < $scope.template.pages.length - 1 ? $scope.template.pages[i + 1] : undefined; + if (nextPage) { + let nextPageIncludesDatatable = nextPage.pageElements.map(el => el.type).includes("datatable"); + while (nextPageIncludesDatatable) { + $scope.template.pages.splice(i + 1, 1); //remove page + //update next page + nextPage = i < $scope.template.pages.length - 1 ? $scope.template.pages[i + 1] : undefined; + nextPageIncludesDatatable = nextPage ? nextPage.pageElements.map(el => el.type).includes("datatable") : false; + } + } + $scope.createPageElement_Datatable(pElementDom, page); + break; + } + } + } + } + }; + /** + * + * @param {*} geoJsonFeatures + * @param {*} timestamp + * @param {*} seriesData | Must have a property "name"; + * @returns + */ + $scope.getSeriesDataForTimestamp = function (geoJsonFeatures, timestamp, seriesData) { + // if parameter is present we want to keep it's properties + if (seriesData && seriesData.length) { + for (let dataEntry of seriesData) { + // just replace the value property + let feature = geoJsonFeatures.find(feature => { + return feature.properties.NAME === dataEntry.name; + }); + dataEntry.value = feature.properties["DATE_" + timestamp]; + if (typeof (dataEntry.value) == 'number') { + dataEntry.value = Math.round(dataEntry.value * 100) / 100; + } + } + return seriesData; + } + else { + // seriesData is undefined, meaning we can create a new array + let result = []; + for (let feature of geoJsonFeatures) { + let obj = {}; + obj.name = feature.properties.NAME; + let value = feature.properties["DATE_" + timestamp]; + if (typeof (value) == 'number') { + value = Math.round(value * 100) / 100; + } + obj.value = value; + result.push(obj); + } + return result; + } + }; + function calculateAndSetSeriesDataForTimeseries(features, fromDate, toDate) { + for (let feature of features) { + let value = feature.properties["DATE_" + toDate] - feature.properties["DATE_" + fromDate]; + if (typeof (value) == 'number') { + value = Math.round(value * 100) / 100; + } + feature.properties["DATE_" + toDate] = value; + } + return features; + } + $scope.calculateSeriesDataForTimeseries = function (features, timeseries) { + let result = []; + let mostRecentDate = timeseries.to; + let oldestDate = timeseries.from; + for (let feature of features) { + let obj = {}; + obj.name = feature.properties.name; + let value = feature.properties["DATE_" + mostRecentDate] - feature.properties["DATE_" + oldestDate]; + if (typeof (value) == 'number') { + value = Math.round(value * 100) / 100; + } + obj.value = value; + result.push(obj); + } + return result; + }; + /** + * + * @param {*} features | features array in geojson + */ + $scope.createLowerCaseNameProperty = function (features) { + for (let feature of features) { + if (feature.hasOwnProperty("properties")) { + if (!feature.properties.hasOwnProperty("name")) { + let featureName = feature.properties.NAME; + feature.properties.name = featureName; + } + } + } + return features; + }; + $scope.createDatatableSkeleton = function (colNamesArr) { + let table = document.createElement("table"); + table.classList.add("table-striped"); + table.classList.add("table-bordered"); + let thead = document.createElement("thead"); + let tbody = document.createElement("tbody"); + table.appendChild(thead); + table.appendChild(tbody); + let headerRow = document.createElement("tr"); + for (let colName of colNamesArr) { + let col = document.createElement("th"); + col.classList.add("text-center"); + col.innerText = colName; + headerRow.appendChild(col); + } + headerRow.style.height = "25px"; + thead.appendChild(headerRow); + return table; + }; + $scope.createDatesFromIndicatorDates = function (indicatorDates) { + let datesAsMs = []; + for (let i = 0; i < indicatorDates.length; i++) { + // year-month-day + var dateComponents = indicatorDates[i].split("-"); + datesAsMs.push(kommonitorDataExchangeService.dateToTS(new Date(Number(dateComponents[0]), Number(dateComponents[1]) - 1, Number(dateComponents[2])))); + } + return datesAsMs; + }; + function prettifyDateSliderLabels(dateAsMs) { + return kommonitorDataExchangeService.tsToDate_withOptionalUpdateInterval(dateAsMs, $scope.selectedIndicator.metadata.updateInterval); + } + $scope.onChangeDateSliderInterval = function () { + $scope.loadingData = true; + // needed to tell angular something has changed + $timeout(function () { + $scope.$digest(); + }); + // setup all pages with the new timeseries + let values = $scope.getFormattedDateSliderValues(true); + // prepare diagrams again for most recent timestamp of slider and for whole timeseries (changes). + let classifyUsingWholeTimeseries = false; + let isTimeseries = true; + $scope.prepareDiagrams($scope.selectedIndicator, $scope.selectedSpatialUnit, values.to, classifyUsingWholeTimeseries, isTimeseries, values.from, values.to); + isTimeseries = false; + classifyUsingWholeTimeseries = true; + $scope.prepareDiagrams($scope.selectedIndicator, $scope.selectedSpatialUnit, values.to, classifyUsingWholeTimeseries, isTimeseries, undefined, undefined); + // set dates on all pages according to new slider values + for (let page of $scope.template.pages) { + let dateEl = page.pageElements.find(el => { + return el.type === "dataTimestamp-landscape" || el.type === "dataTimeseries-landscape"; + }); + if (dateEl.type === "dataTimestamp-landscape") { + dateEl.text = values.to; + } + if (dateEl.type === "dataTimeseries-landscape") { + dateEl.text = values.from + " - " + values.to; + } + } + function updateDiagrams() { + if ($scope.diagramsPrepared) { + $interval.cancel(updateDiagramsInterval); // code below still executes once + } + else { + return; + } + // diagrams are prepared, but dom has to be updated first, too + $timeout(async function () { + await $scope.initializeAllDiagrams(); + $scope.loadingData = false; + }); + } + let updateDiagramsInterval = $interval(updateDiagrams, 0, 100); + }; + $scope.getFormattedDateSliderValues = function (includeInBetweenValues) { + if (!$scope.dateSlider) + throw new Error("Tried to get dateslider values but dateslider was not defined."); + let slider = $scope.dateSlider; + let from = new Date(slider.result.from_value); + let to = new Date(slider.result.to_value); + let inBetweenDates; + if (includeInBetweenValues) { + // get all valid timestamps for this spatial unit that lie in between from and to + let validTimestamps = getValidTimestampsForSpatialUnit($scope.selectedSpatialUnit); + inBetweenDates = validTimestamps.filter(el => { + let date = new Date(el); + date.setHours(0); // remove time-offset...TODO is there a better way? + return from < date && date < to; + }); + } + // append zeros to month and year if needed + let month = (from.getMonth() + 1); // months start with 0 + let day = from.getDate(); + from = from.getFullYear() + "-"; + if (month < 10) + from += "0"; + from += month + "-"; + if (day < 10) + from += "0"; + from += day; + month = (to.getMonth() + 1); // months start with 0 + day = to.getDate(); + to = to.getFullYear() + "-"; + if (month < 10) + to += "0"; + to += month + "-"; + if (day < 10) + to += "0"; + to += day; + let result = { + from: from, + to: to, + dates: includeInBetweenValues ? [from, ...inBetweenDates, to] : [] // all dates in the interval, including "from" and "to" + }; + return result; + }; + $scope.initializeDateRangeSlider = function (availableDates, min, max) { + if ($scope.dateSlider) { + $scope.dateSlider.destroy(); + } + let domNode = document.getElementById("reporting-dateSlider"); + while (domNode.hasChildNodes()) { + domNode.removeChild(domNode.lastChild); + } + //let mostRecentDate = availableDates[availableDates.length - 1]; + //let selectedDate = availableDates[availableDates.length - 1]; + let datesAsMs = $scope.createDatesFromIndicatorDates(availableDates); + // new Date() uses month between 0-11! + $("#reporting-dateSlider").ionRangeSlider({ + skin: "big", + type: "double", + grid: true, + values: datesAsMs, + from: 0, + to: availableDates.length - 1, + force_edges: true, + prettify: prettifyDateSliderLabels, + onFinish: $scope.onChangeDateSliderInterval + }); + let dateSlider = $("#reporting-dateSlider").data("ionRangeSlider"); + // make sure that the handles are properly set + let minIdx = 0; + let maxIdx = availableDates.length - 1; + if (typeof (min) !== "undefined") + minIdx = availableDates.indexOf(min); + if (typeof (max) !== "undefined") + maxIdx = availableDates.indexOf(max); + dateSlider.update({ + from: minIdx, + to: maxIdx + }); + return dateSlider; + }; + $scope.onChangeShowMapLabels = function () { + for (let i = 0; i < $scope.template.pages.length; i++) { + let map = document.querySelector("#reporting-addIndicator-page-" + i + "-map"); + if (!map) { + continue; // no map on current page + } + let instance = echarts.getInstanceByDom(map); + let options = instance.getOption(); + options.series[0].label.show = $scope.showMapLabels; + options.series[0].select.label.show = $scope.showMapLabels; + for (let item of options.series[0].data) { + if (typeof item.label === "undefined") { + item.label = {}; + } + item.label.show = $scope.showMapLabels; + } + instance.setOption(options, { + replaceMerge: ['series'] + }); + } + }; + $scope.validateConfiguration = function () { + // indicator has to be selected (unless template is reachability) + // at least one area has to be selected (unless template is reachability) + // for timestamps: + // at least one timestamp has to be selected + // for timeseries + // slider position must include at least two timestamps + let isIndicatorSelected = false; + let isAreaSelected = false; + let isTimestampSelected = false; + if (!$scope.template) { + return false; + } + if ($scope.selectedIndicator || $scope.template.name === "A4-landscape-reachability") { + isIndicatorSelected = true; + } + if ($scope.selectedAreas.length >= 1 || $scope.template.name === "A4-landscape-reachability") { + isAreaSelected = true; + } + if (($scope.template.name === "A4-landscape-timestamp" || $scope.template.name === "A4-landscape-reachability") && + $scope.selectedTimestamps.length >= 1) { + isTimestampSelected = true; + } + if ($scope.template.name === "A4-landscape-timeseries") { + if (!$scope.dateSlider) { + return false; + } + if (!$scope.availableFeaturesBySpatialUnit[$scope.selectedSpatialUnit.spatialUnitName]) { + return false; + } + let timeseries = $scope.getFormattedDateSliderValues(true).dates; + if (timeseries.length >= 1) { + isTimestampSelected = true; // reuse variable here + } + } + if (isIndicatorSelected && isAreaSelected && isTimestampSelected && !$scope.loadingData) { + return true; + } + else { + return false; + } + }; + $scope.transformSeriesDataToPercentageChange = function (dataArr) { + // we need at least two timestamps + if (dataArr.length <= 1) { + let error = new Error("Can not calculate percentage change from a single timestamp."); + kommonitorDataExchangeService.displayMapApplicationError(error.message); + } + let result = []; + for (let i = 1; i < dataArr.length; i++) { + let datapoint = dataArr[i]; + let prevDatapoint = dataArr[i - 1]; + let value = (datapoint - prevDatapoint) / prevDatapoint; + value *= 100; + value = Math.round(value * 100) / 100; + result.push(value); + } + return result; + }; + // https://stackoverflow.com/a/2631198/18450475 + function checkNestedPropExists(obj, level, ...rest) { + if (obj === undefined) + return false; + if (rest.length == 0 && obj.hasOwnProperty(level)) + return true; + return checkNestedPropExists(obj[level], ...rest); + } + // https://stackoverflow.com/a/2631198/18450475 + function getNestedProp(obj, ...args) { + return args.reduce((obj, level) => obj && obj[level], obj); + } + } + ] +}); +//# sourceMappingURL=reporting-indicator-add.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingIndicatorAdd/reporting-indicator-add.component.js.map b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingIndicatorAdd/reporting-indicator-add.component.js.map new file mode 100644 index 000000000..2373ecb5d --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingIndicatorAdd/reporting-indicator-add.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"reporting-indicator-add.component.js","sourceRoot":"","sources":["reporting-indicator-add.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,SAAS,CAAC,uBAAuB,EAAE;IAC1E,WAAW,EAAG,kIAAkI;IAChJ,UAAU,EAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,+BAA+B,EAAE,gCAAgC,EAAE,oCAAoC;QAC1K,SAAS,+BAA+B,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,6BAA6B,EAAE,8BAA8B,EAAE,kCAAkC;YAEpL,MAAM,CAAC,QAAQ,GAAG,SAAS,CAAC;YAC5B,MAAM,CAAC,yBAAyB,GAAG,EAAE,CAAC;YAEtC,MAAM,CAAC,mBAAmB,GAAG,EAAE,CAAC;YAChC,MAAM,CAAC,aAAa,GAAG,EAAE,CAAC;YAC1B,MAAM,CAAC,mBAAmB,GAAG,EA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,KAAK,CAAA;gBACnC,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,GAAG,CAAC,cAAc,CAAC,KAAK,CAAC;oBAAE,OAAO,IAAI,CAAA;gBAC9D,OAAO,qBAAqB,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,CAAA;YAClD,CAAC;YAED,+CAA+C;YAC/C,SAAS,aAAa,CAAC,GAAG,EAAE,GAAG,IAAI;gBAClC,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAA;YAC3D,CAAC;QACF,CAAC;KACD;CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingIndicatorAdd/reporting-indicator-add.component.ts b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingIndicatorAdd/reporting-indicator-add.component.ts new file mode 100644 index 000000000..9d6e37113 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingIndicatorAdd/reporting-indicator-add.component.ts @@ -0,0 +1,3452 @@ +angular.module('reportingIndicatorAdd').component('reportingIndicatorAdd', { + templateUrl : "components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingIndicatorAdd/reporting-indicator-add.template.html", + controller : ['$scope', '$http', '$timeout', '$interval', '__env', 'kommonitorDataExchangeService', 'kommonitorDiagramHelperService', 'kommonitorVisualStyleHelperService', + function ReportingIndicatorAddController($scope, $http, $timeout, $interval, __env, kommonitorDataExchangeService, kommonitorDiagramHelperService, kommonitorVisualStyleHelperService) { + + $scope.template = undefined; + $scope.untouchedTemplateAsString = ""; + + $scope.indicatorNameFilter = ""; + $scope.poiNameFilter = ""; + $scope.availableIndicators = []; + $scope.selectedIndicator = undefined; + $scope.selectedPoiLayer = undefined; + + $scope.availableFeaturesBySpatialUnit = {}; + $scope.selectedSpatialUnit = undefined; + $scope.selectedAreas = []; + + $scope.selectedTimestamps = []; + $scope.indexOfFirstAreaSpecificPage = undefined; + $scope.dateSlider = undefined; + $scope.absoluteLabelPositions = []; + $scope.showMapLabels = true; + $scope.echartsOptions = { + map: { + // "2017-12-31": ... + // "2018-12-31": ... + }, + bar: { + // "2017-12-31": ... + // "2018-12-31": ... + }, + line: {}, // no timestamp needed here + } + $scope.echartsRegisteredMapNames = []; + + $scope.loadingData = false; + $scope.diagramsPrepared = false; + $scope.isFirstUpdateOnIndicatorOrPoiLayerSelection = true; + $scope.showResetIsochronesBtn = false; + + $scope.isochronesTypeOfMovementMapping = { + "foot-walking": "Fußgänger", + "driving-car": "Auto", + "cycling-regular": "Fahrrad", + "wheelchair": "Barrierefrei", + "buffer": "Puffer" + } + + // used to track template pages instead of using $$hashkey + $scope.templatePageIdCounter = 1; + + $scope.filterTimeseriesIndicator = function(indicator) { + // must have more than one applicable date + return indicator.applicableDates && indicator.applicableDates.length > 1; + }; + + // internal array changes do not work with ng-change + $scope.$watchCollection('selectedAreas', function(newVal) { + $scope.onSelectedAreasChanged(newVal) + }); + + $scope.onSelectedAreasChanged = function(newVal) { + if( typeof($scope.template) === "undefined") return; + $scope.loadingData = true; + // to make things easier we remove all area-specific pages and recreate them using newVal + // this approach is not optimized for performance and might have to change in the future + + // remove all area-specific pages + $scope.template.pages = $scope.template.pages.filter( page => { + return !page.hasOwnProperty("area") + }); + + if($scope.template.name === "A4-landscape-timestamp") + $scope.updateAreasForTimestampTemplates(newVal) + if($scope.template.name === "A4-landscape-timeseries") + $scope.updateAreasForTimeseriesTemplates(newVal) + if($scope.template.name === "A4-landscape-reachability") + $scope.updateAreasForReachabilityTemplates(newVal) + + let updateDiagramsInterval_areas; + + async function updateDiagrams() { + + if($scope.diagramsPrepared) { + $interval.cancel(updateDiagramsInterval_areas); // code below still executes once + } else { + return; + } + + // diagrams are prepared, but dom has to be updated first, too + // we could filter the geoJson here to only include selected areas + // but for now we get all areas and filter them out after + let justChanged = false; + if($scope.isFirstUpdateOnIndicatorOrPoiLayerSelection) { + // Skip the update but set variable to false, so diagrams get updated on time update + // (relevant for indicator selection only) + $scope.isFirstUpdateOnIndicatorOrPoiLayerSelection = false; + justChanged = true; + } + if($scope.template.name == "A4-landscape-reachability" || ($scope.isFirstUpdateOnIndicatorOrPoiLayerSelection == false && justChanged == false)) { + await $scope.initializeAllDiagrams(); + if($scope.template.name !== "A4-landscape-reachability") { + // in reachability template we have to update leaflet maps, too + $scope.loadingData = false; + } + } + } + updateDiagramsInterval_areas = $interval(updateDiagrams, 0, 100) + + } + + + $scope.updateAreasForTimestampTemplates = function(newVal) { + let pagesToInsertPerTimestamp = []; + for(let area of newVal) { + // get page to insert from untouched template + let pageToInsert = angular.fromJson($scope.untouchedTemplateAsString).pages[ $scope.indexOfFirstAreaSpecificPage ]; + pageToInsert.area = area.name; + pageToInsert.id = $scope.templatePageIdCounter++; + pagesToInsertPerTimestamp.push(pageToInsert); + } + + // sort alphabetically by area name + pagesToInsertPerTimestamp.sort( (a, b) => { + let textA = a.area.toLowerCase(); + let textB = b.area.toLowerCase(); + return (textA < textB) ? -1 : (textA > textB) ? 1 : 0; + }) + + // insert area-specific pages for each timestamp + // right now the area-specific part is missing and we have to figure out where it was. + // get pages per timestamp -> insert new ones starting at indexOfFirstAreaSpecificPage -> replace per timestamp in $scope.template.pages + if($scope.selectedTimestamps.length) { + let idx = 0 + for(let timestamp of $scope.selectedTimestamps) { + + // pagesForTimestamp is the template-section for that timestamp + let pagesForTimestamp = $scope.template.pages.filter( page => { + let dateEl = page.pageElements.find( el => { + return el.type === "dataTimestamp-landscape" + }); + + return dateEl.text === timestamp.name + }); + // set index to first page of that timestamp + // this is where we want to start replacing pages later + idx = $scope.template.pages.indexOf( pagesForTimestamp[0] ) + // create a deep copy so we can assign new ids + pagesForTimestamp = JSON.parse(JSON.stringify(pagesForTimestamp)); + + // setup pages before inserting + for(let pageToInsert of pagesToInsertPerTimestamp) { + + let titleEl = pageToInsert.pageElements.find( el => { + return el.type === "indicatorTitle-landscape" + }); + titleEl.text = $scope.selectedIndicator.indicatorName + " [" + $scope.selectedIndicator.unit + "]"; + if(pageToInsert.area) { + titleEl.text += ", " + pageToInsert.area + } + titleEl.isPlaceholder = false; + + let dateEl = pageToInsert.pageElements.find( el => { + return el.type === "dataTimestamp-landscape" + }); + + dateEl.text = timestamp.name; + dateEl.isPlaceholder = false; + + // diagrams have to be inserted later because the div element does not yet exist + } + + let numberOfPagesToReplace = pagesForTimestamp.length; + // insert area-specific pages + pagesToInsertPerTimestamp = JSON.parse(JSON.stringify(pagesToInsertPerTimestamp)); + for(let page of pagesToInsertPerTimestamp) + page.id = $scope.templatePageIdCounter++; + pagesForTimestamp.splice($scope.indexOfFirstAreaSpecificPage, 0, ...pagesToInsertPerTimestamp) + // assign new ids + for(let page of pagesForTimestamp) + page.id = $scope.templatePageIdCounter++; + // then replace the whole timstamp-section with the new pages + $scope.template.pages.splice(idx, numberOfPagesToReplace, ...pagesForTimestamp) + } + } else { + pagesToInsertPerTimestamp = JSON.parse(JSON.stringify(pagesToInsertPerTimestamp)); + for(let page of pagesToInsertPerTimestamp) + page.id = $scope.templatePageIdCounter++; + // no timestamp selected, which makes inserting easier + $scope.template.pages.splice($scope.indexOfFirstAreaSpecificPage, 0, ...pagesToInsertPerTimestamp) + } + } + + $scope.updateAreasForTimeseriesTemplates = function(newVal) { + let pagesToInsert = []; + for(let area of newVal) { + // get page to insert from untouched template + let pageToInsert = angular.fromJson($scope.untouchedTemplateAsString).pages[ $scope.indexOfFirstAreaSpecificPage ]; + pageToInsert.area = area.name; + pageToInsert.id = $scope.templatePageIdCounter++; + pagesToInsert.push(pageToInsert); + } + + // sort alphabetically by area name + pagesToInsert.sort( (a, b) => { + let textA = a.area.toLowerCase(); + let textB = b.area.toLowerCase(); + return (textA < textB) ? -1 : (textA > textB) ? 1 : 0; + }); + + // since we are dealing with a timeseries we don't have to care about inserting area-pages multiple times for different timestamps + // we do it only once + + // setup pages before inserting + for(let pageToInsert of pagesToInsert) { + + let titleEl = pageToInsert.pageElements.find( el => { + return el.type === "indicatorTitle-landscape" + }); + titleEl.text = $scope.selectedIndicator.indicatorName + " [" + $scope.selectedIndicator.unit + "]"; + if(pageToInsert.area) { + titleEl.text += ", " + pageToInsert.area + } + titleEl.isPlaceholder = false; + + let dateEl = pageToInsert.pageElements.find( el => { + return el.type === "dataTimeseries-landscape" + }); + let includeInBetweenValues = false + let dsValues = $scope.getFormattedDateSliderValues(includeInBetweenValues); + dateEl.text = dsValues.from + " - " + dsValues.to; + dateEl.isPlaceholder = false; + + // diagrams have to be inserted later because the div element does not yet exist + } + + // insert area-specific pages + pagesToInsert= JSON.parse(JSON.stringify(pagesToInsert)); + for(let page of pagesToInsert) + page.id = $scope.templatePageIdCounter++; + $scope.template.pages.splice($scope.indexOfFirstAreaSpecificPage, 0, ...pagesToInsert) + } + + $scope.updateAreasForReachabilityTemplates = function(newVal) { + // we only have one timestamp here (the most recent one) + let pagesToInsert = []; + for(let area of newVal) { + // get page to insert from untouched template + let pageToInsert = angular.fromJson($scope.untouchedTemplateAsString).pages[ $scope.indexOfFirstAreaSpecificPage ]; + pageToInsert.area = area.name; + pageToInsert.id = $scope.templatePageIdCounter++; + pagesToInsert.push(pageToInsert); + } + + // sort alphabetically by area name + pagesToInsert.sort( (a, b) => { + let textA = a.area.toLowerCase(); + let textB = b.area.toLowerCase(); + return (textA < textB) ? -1 : (textA > textB) ? 1 : 0; + }); + + // we select the most recent timestamp programmatically and don't allow user to change it, so this should be 1 here + if($scope.selectedTimestamps.length === 1) { + + // setup pages before inserting + for(let pageToInsert of pagesToInsert) { + + let titleEl = pageToInsert.pageElements.find( el => { + return el.type === "indicatorTitle-landscape" + }); + titleEl.text = "Entfernungen für " + $scope.selectedPoiLayer.datasetName; + if(pageToInsert.area) { + titleEl.text += ", " + pageToInsert.area + } + titleEl.isPlaceholder = false; + + let subtitleEl = pageToInsert.pageElements.find( el => { + return el.type === "reachability-subtitle-landscape" + }); + subtitleEl.text = $scope.selectedTimestamps[0].name; + if($scope.isochrones) + subtitleEl.text += ", " + $scope.isochronesTypeOfMovementMapping[$scope.typeOfMovement]; + if($scope.selectedIndicator) + subtitleEl.text += ", " + $scope.selectedIndicator.indicatorName; + subtitleEl.isPlaceholder = false; + + // diagrams have to be inserted later because the div element does not yet exist + } + + // create a deep copy so we can assign new ids + pagesToInsert = JSON.parse(JSON.stringify(pagesToInsert)); + let numberOfPagesToReplace = $scope.template.pages.length-2 // basically everything until the end of the template (-2 because we start at second page) + // insert area-specific pages + for(let page of pagesToInsert) + page.id = $scope.templatePageIdCounter++; + + $scope.template.pages.splice($scope.indexOfFirstAreaSpecificPage, numberOfPagesToReplace, ...pagesToInsert) + } + } + + + + // internal array changes do not work with ng-change + $scope.$watchCollection('selectedTimestamps', function(newVal, oldVal) { + + if( typeof($scope.template) === "undefined") return; + $scope.loadingData = true; + + // get difference between old and new value (the timestamps selected / deselected) + let difference = oldVal + .filter(x => !newVal.includes(x)) + .concat(newVal.filter(x => !oldVal.includes(x))); + + // if selected + if(newVal.length > oldVal.length) { + // if this was the first timestamp + if(newVal.length === 1) { + // no need to insert pages, we just replace the placeholder timestamp + for(let page of $scope.template.pages) { + for(let pageElement of page.pageElements) { + if(pageElement.type === "dataTimestamp-landscape") { + pageElement.text = difference[0].name; + pageElement.isPlaceholder = false; + } + } + } + } + + if(newVal.length > 1) { + for(let timestampToInsert of difference) { + + // setup pages to insert first + let pagesToInsert = angular.fromJson($scope.untouchedTemplateAsString).pages; + for(let page of pagesToInsert) { + page.id = $scope.templatePageIdCounter++; + } + // insert additional page for each selected area, replace the placeholder page + let areaSpecificPages = []; + // copy placeholder page for each selected area + for(let area of $scope.selectedAreas) { + let page = angular.fromJson($scope.untouchedTemplateAsString).pages[ $scope.indexOfFirstAreaSpecificPage ]; + page.area = area.name; + page.id = $scope.templatePageIdCounter++; + areaSpecificPages.push(page); + } + + // sort alphabetically by area name + areaSpecificPages.sort( (a, b) => { + let textA = a.area.toLowerCase(); + let textB = b.area.toLowerCase(); + return (textA < textB) ? -1 : (textA > textB) ? 1 : 0; + }) + + pagesToInsert.splice($scope.indexOfFirstAreaSpecificPage, 1, ...areaSpecificPages) + + // setup pages before inserting them + for(let pageToInsert of pagesToInsert) { + for(let pageElement of pageToInsert.pageElements) { + + if(pageElement.type === "indicatorTitle-landscape") { + pageElement.text = $scope.selectedIndicator.indicatorName + " [" + $scope.selectedIndicator.unit + "]"; + if(pageToInsert.area) { + pageElement.text += ", " + pageToInsert.area + } + pageElement.isPlaceholder = false; + } + + if(pageElement.type === "dataTimestamp-landscape") { + pageElement.text = timestampToInsert.name; + pageElement.isPlaceholder = false; + } + } + } + + // determine position to insert pages (ascending timestamps) and insert them + // iterate pages and check timestamp for each one + let pagesInserted = false; + for(let i=$scope.template.pages.length-1; i>=0; i--) { //iterate in reverse because we might extend the array while iterating + let page = $scope.template.pages[i]; + + for(let pElement of page.pageElements) { + if(pElement.type === "dataTimestamp-landscape") { + // compare timestamps + let date1 = timestampToInsert.name; + let date2 = pElement.text; + let date1Updated = new Date(date1.replace(/-/g,'/')); + let date2Updated = new Date(date2.replace(/-/g,'/')); + + // if page timestamp is newer than difference timestamp + if(date1Updated > date2Updated) { + // insert pages before pages with that timestamp + // i+1 because we want to insert after the page that has the older timestamp + $scope.template.pages.splice(i+1, 0, ...pagesToInsert); + + pagesInserted = true; + } + } + } + + if(pagesInserted) { + break; + } + } + + if( !pagesInserted ) { // happens if the timestamp to insert is the oldest one + $scope.template.pages.splice(0, 0, ...pagesToInsert); //prepend pages + } + } + + // in case all timestamps were added at once and none was present before we still have placeholder pages at this point + // all other pages got prepended since we compared against an invalid date. + // remove those pages + for(let i=$scope.template.pages.length-1; i>=0; i--) { //iterate in reverse because we might extend the array while iterating + let page = $scope.template.pages[i]; + for(let pElement of page.pageElements) { + if(pElement.type === "dataTimestamp-landscape") { + if(pElement.isPlaceholder) { + $scope.template.pages.splice(i, 1); + } + } + } + } + } + } + + // if deselected + if(newVal.length < oldVal.length) { + // if it was the last one + if(newVal.length === 0) { + let cleanTemplate = angular.fromJson($scope.untouchedTemplateAsString); + for(let page of cleanTemplate.pages) { + page.id = $scope.templatePageIdCounter++; + } + $scope.template = cleanTemplate; + } else { + // remove all pages that belong to removed timestamps + for(let timestampToRemove of difference) { + $scope.template.pages = $scope.template.pages.filter( page => { + let timestampEl = page.pageElements.find( el => { + return el.type === "dataTimestamp-landscape" + }) + + return timestampEl.text != timestampToRemove.name; + }); + } + } + } + + // There is one more special case for the reachbility template, where we only have one timestamp set at all times, + // but that one might change if we change the spatial unit + if(newVal.length === oldVal.length && newVal.length === 1 && newVal[0].name != oldVal[0].name) { + // simply update the timestamp on all pages + for(let page of $scope.template.pages) { + for(let pageElement of page.pageElements) { + if(pageElement.type === "reachability-subtitle-landscape") { + pageElement.text = newVal[0].name; + if($scope.isochrones) + pageElement.text += ", " + $scope.isochronesTypeOfMovementMapping[$scope.typeOfMovement]; + if($scope.selectedIndicator) + pageElement.text += ", " + $scope.selectedIndicator.indicatorName; + } + break; + } + } + } + + function updateDiagrams() { + if($scope.diagramsPrepared) { + $interval.cancel(updateDiagramsInterval); // code below still executes once + } else { + return; + } + + $timeout(async function() { + if($scope.isFirstUpdateOnIndicatorOrPoiLayerSelection) { + // Skip the update but set variable to false, so diagrams get updated on time update + // (relevant for indicator selection only) + $scope.isFirstUpdateOnIndicatorOrPoiLayerSelection = false; + } else { + // indicator selection is optional in reachability template only + if($scope.selectedIndicator) { + for(let timestamp of $scope.selectedTimestamps) { + let classifyUsingWholeTimeseries = false; + let isTimeseries = false; + $scope.prepareDiagrams($scope.selectedIndicator, $scope.selectedSpatialUnit, timestamp.name, classifyUsingWholeTimeseries, isTimeseries, undefined, undefined); + } + } else { + $scope.reachabilityTemplateGeoMapOptions = $scope.prepareReachabilityEchartsMap(); + } + + await $scope.initializeAllDiagrams(); + if($scope.template.name !== "A4-landscape-reachability") { + // in reachability template we have to update leaflet maps, too + $scope.loadingData = false; + } + } + }); + + } + + let updateDiagramsInterval = $interval(updateDiagrams, 0, 100) + }); + + $scope.$on("reportingConfigureNewIndicatorShown", function(event, data) { + $scope.initialize(data); + }); + + $scope.$on("reportingConfigureNewPoiLayerShown", function(event, data) { + $scope.initialize(data); + }); + + $scope.initialize = async function(data) { + $scope.loadingData = true; + let template = data[0]; + // deep copy template before any changes are made. + // this is needed when additional timestamps are inserted. + $scope.untouchedTemplateAsString = angular.toJson(template) + // give each page a unique id to track it by in ng-repeat + for(let page of template.pages) { + page.id = $scope.templatePageIdCounter++; + } + $scope.template = template; + + if($scope.template.name === "A4-landscape-timestamp") + $scope.indexOfFirstAreaSpecificPage = 3; + if($scope.template.name === "A4-landscape-timeseries") + $scope.indexOfFirstAreaSpecificPage = 4; + if($scope.template.name === "A4-landscape-reachability") + $scope.indexOfFirstAreaSpecificPage = 1; + + // disable tabs to force user to pick a poi-layer / indicator first + let tabList = document.querySelector("#reporting-add-indicator-tab-list"); + let tabPanes = document.querySelectorAll("#reporting-add-indicator-tab-content > .tab-pane"); + let tabChildren = Array.from(tabList.children) + for(let [idx, tab] of tabChildren.entries()) { + let id = tab.id.at(-1); + if( ($scope.template.name === "A4-landscape-reachability" && id==1) || // pois + ($scope.template.name !== "A4-landscape-reachability" && id==3) ) { // indicators + tab.classList.add("active"); + tabPanes[idx].classList.add("active"); + } else { + tab.classList.remove("active"); + tabPanes[idx].classList.remove("active"); + } + } + + $scope.initializeDualLists(); + + if($scope.template.name === "A4-landscape-reachability") { + $scope.resetIsochrones(); + Promise.all([ + $scope.queryGeoresources(), + $scope.queryIndicators() + ]).then( () => { + $scope.loadingData = false; + $timeout( () => { + $timeout(function(){ + $scope.$digest(); + }); + }); + }) + } else { + await $scope.queryIndicators(); + $scope.loadingData = false; + $timeout( () => { + $timeout(function(){ + $scope.$digest(); + }); + }) + + } + } + + $scope.initializeDualLists = function() { + $scope.dualListAreasOptions = { + label: 'Bereiche', + boxItemsHeight: 'md', + items: [], + button: {leftText: "Alle auswählen" , rightText: "Alle entfernen"}, + selectedItems: [] + }; + + $scope.dualListTimestampsOptions = { + label: 'Zeitpunkte', + boxItemsHeight: 'md', + items: [], + button: {leftText: "Alle auswählen" , rightText: "Alle entfernen"}, + selectedItems: [] + }; + + $scope.dualListSpatialUnitsOptions = { + label: 'Raumebenen', + boxItemsHeight: 'md', + items: [], + button: {leftText: "Alle auswählen" , rightText: "Alle entfernen"}, + selectedItems: [] + }; + } + + /** + * Queries DataManagement API to get all available indicators + */ + $scope.queryIndicators = async function() { + + // build request + // query public endpoint for now, this might change once user role administration is added to reporting + let url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/indicators" + + // send request + await $http({ + url: url, + method: "GET" + }).then(function successCallback(response) { + // save to scope + $scope.availableIndicators = response.data; + }, function errorCallback(error) { + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + console.error(error); + }); + return Promise.resolve(); + }; + + $scope.queryGeoresources = async function() { + + // build request + // query public endpoint for now, this might change once user role administration is added to reporting + let url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/georesources" + // send request + await $http({ + url: url, + method: "GET" + }).then(function successCallback(response) { + // save to scope + $scope.availablePoiLayers = response.data.filter( georesource => { + return georesource.isPOI; + }); + }, function errorCallback(error) { + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + console.error(error); + }); + return Promise.resolve(); + }; + + $scope.queryMostRecentGeoresourceFeatures = async function(georesource) { + // Most likely this is only a temporary method + // It checks the availablePeriodsOfValidity and takes the most recent one to query features. + + let timestamp = georesource.availablePeriodsOfValidity.at(-1).startDate; + let timestampSplit = timestamp.split("-") + let year = timestampSplit[0]; + let month = timestampSplit[1]; + let day = timestampSplit[2]; + + let url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + url += "/georesources/" + georesource.georesourceId + "/" + year + "/" + month + "/" + day + // send request + return await $http({ + url: url, + method: "GET" + }).then(function successCallback(response) { + return response.data; + }, function errorCallback(error) { + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + console.error(error); + }); + } + + $scope.queryAllSpatialUnits = async function() { + // build request + // query public endpoint for now, this might change once user role administration is added to reporting + let url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/spatial-units" + + // send request + return await $http({ + url: url, + method: "GET" + }).then(function successCallback(response) { + // save to scope + return response.data; + }, function errorCallback(error) { + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + console.error(error); + }); + } + + + $scope.onSpatialUnitChanged = async function(selectedSpatialUnit) { + $scope.loadingData = true; + $("#reporting-spatialUnitChangeWarning").hide(); + $scope.timeseriesAdjustedOnSpatialUnitChange = false; + await $scope.updateAreasInDualList() + let validTimestamps = [] + // There might be different valid timestamps for the new spatial unit. + if($scope.selectedIndicator) { + validTimestamps = getValidTimestampsForSpatialUnit( selectedSpatialUnit ); + + // Check if the currently selected timestamps are also available for the new spatial unit. + // If one is not, deselect is and show an info to user + let selectedTimestamps_old = [...$scope.selectedTimestamps]; + $scope.selectedTimestamps = $scope.selectedTimestamps.filter( el => { + return validTimestamps.includes(el.name); + }); + // if any timestamp was deselected show a warning alert + // except for reachability template, it doesn't matter there + if(selectedTimestamps_old.length > $scope.selectedTimestamps.length && $scope.template.name != "A4-landscape-reachability") { + $("#reporting-spatialUnitChangeWarning").show(); + } + } else { + // without selected indicator we have to fall back to the last update of the new spatial unit + let mostRecentTimestampName = $scope.selectedSpatialUnit.metadata.lastUpdate; + validTimestamps.push(mostRecentTimestampName) + } + + if($scope.template.name === "A4-landscape-timeseries") { + // Similar procedure as with timestamps + let oldTimeseries = $scope.getFormattedDateSliderValues(true); + + let from = new Date($scope.dateSlider.result.from_value); + let to = new Date($scope.dateSlider.result.to_value); + let filteredTimeseries = validTimestamps.filter( el => { + let date = new Date(el); + date.setHours(0); // remove time-offset...TODO is there a better way? + return from <= date && date <= to; + }); + + let isEqualTimeseries = (oldTimeseries.dates.length == filteredTimeseries.length) && oldTimeseries.dates.every(function(element, index) { + return element === filteredTimeseries[index]; + }); + + if( !isEqualTimeseries) { + // timeseries changed + $("#reporting-spatialUnitChangeWarning").show(); + // try to set slider to previously selected timestamps + if(validTimestamps.includes(oldTimeseries.from) && validTimestamps.includes(oldTimeseries.to)) { + $scope.dateSlider = $scope.initializeDateRangeSlider( validTimestamps, filteredTimeseries[0], filteredTimeseries.at(-1)); + } else { + $scope.dateSlider = $scope.initializeDateRangeSlider( validTimestamps ); + $scope.timeseriesAdjustedOnSpatialUnitChange = true; // show additional text in warning alert + } + } else { + // the selected part of the timeseries has the same dates so we don't have to show a warning + // but the timeseries could still include older or newer dates + $scope.dateSlider = $scope.initializeDateRangeSlider( validTimestamps, filteredTimeseries[0], filteredTimeseries.at(-1)); + } + } + + // prepare arrays for updateDualList + validTimestamps = validTimestamps.map( el => { + return { + properties: { + NAME: el + } + } + }); + let timestampsToSelect = $scope.selectedTimestamps.map( el => { + return { + properties: { + NAME: el.name + } + } + }); + + $scope.updateDualList($scope.dualListTimestampsOptions, validTimestamps, timestampsToSelect); + + + + // fire $watch('selectedAreas') function manually to remove pages + $scope.selectedAreas = []; + $scope.onSelectedAreasChanged( $scope.selectedAreas , undefined) + // updateAreasInDualList does not trigger diagram updates + // we have the wrong geometries set at this point, causing area selection to fail. + // echarts requires properties.name to be present, create it from properties.NAME unless it exists + let features; + if($scope.template.name == "A4-landscape-reachability") { + if($scope.selectedIndicator) { + features = $scope.availableFeaturesBySpatialUnit[ $scope.selectedSpatialUnit.spatialUnitName ]; + } else { + features = $scope.availableFeaturesBySpatialUnit[ $scope.selectedSpatialUnit.spatialUnitLevel ]; + } + features = $scope.createLowerCaseNameProperty(features); + $scope.geoJsonForReachability = { features: features } + } else { + features = $scope.availableFeaturesBySpatialUnit[ $scope.selectedSpatialUnit.spatialUnitName ]; + features = $scope.createLowerCaseNameProperty(features); + let geoJSON = { features: features } + $scope.selectedIndicator.geoJSON = geoJSON; + } + + + // no need to check if diagrams are prepared here since we have to prepare them again anyway + $timeout(async function() { + // prepare diagrams for all selected timestamps with all features + // Preparing all diagrams is not possible without an indicator, which might happen in the reachability template + // User selects a poi layer first and we set the most recent timestamp programmatically, triggering this function without selected Indicator + // We only need an echarts geoMap to show isochrones, POIs and spatial unit borders + if($scope.selectedIndicator) { + if($scope.template.name === "A4-landscape-reachability") { + $scope.reachabilityTemplateGeoMapOptions = $scope.prepareReachabilityEchartsMap(); + } else if ($scope.template.name === "A4-landscape-timeseries") { + let values = $scope.getFormattedDateSliderValues(true); + let classifyUsingWholeTimeseries = false; + let isTimeseries = true; + $scope.prepareDiagrams($scope.selectedIndicator, $scope.selectedSpatialUnit, values.to, classifyUsingWholeTimeseries, isTimeseries, values.from, values.to); + // prepare diagrams again for most recent timestamp of slider and for whole timeseries (changes). + classifyUsingWholeTimeseries = true; + isTimeseries = false; + $scope.prepareDiagrams($scope.selectedIndicator, $scope.selectedSpatialUnit, values.to, classifyUsingWholeTimeseries, isTimeseries, undefined, undefined); + } else { + for(let timestamp of $scope.selectedTimestamps) { + let classifyUsingWholeTimeseries = false; + let isTimeseries = false; + $scope.prepareDiagrams($scope.selectedIndicator, selectedSpatialUnit, timestamp.name, classifyUsingWholeTimeseries, isTimeseries, undefined, undefined); + } + } + } else { + $scope.reachabilityTemplateGeoMapOptions = $scope.prepareReachabilityEchartsMap(); + } + + await $scope.initializeAllDiagrams(); + if($scope.template.name !== "A4-landscape-reachability") { + // in reachability template we have to update leaflet maps, too + $scope.loadingData = false; + } + }); + } + + /** + * Updates the areas dual list data + * Queries DataManagement API if needed. + */ + $scope.updateAreasInDualList = async function() { + // this happens for the reachability template on poi selection + if(typeof($scope.selectedIndicator) === "undefined") { + let spatialUnit = $scope.selectedSpatialUnit ? + $scope.selectedSpatialUnit : + $scope.selectedIndicator.applicableSpatialUnits[0] + // query spatial unit features using the most recent date + let data = await $scope.queryFeatures(undefined, $scope.selectedSpatialUnit); + $scope.availableFeaturesBySpatialUnit[spatialUnit.spatialUnitLevel] = data.features + let allAreas = $scope.availableFeaturesBySpatialUnit[spatialUnit.spatialUnitLevel] + $scope.updateDualList($scope.dualListAreasOptions, allAreas, undefined) // don't select any areas + } else { + let indicator = $scope.selectedIndicator; + + let spatialUnit = $scope.selectedSpatialUnit ? + $scope.selectedSpatialUnit : + $scope.selectedIndicator.applicableSpatialUnits[0] + let indicatorId = indicator.indicatorId; + + // on indicator change + if($scope.availableFeaturesBySpatialUnit.indicatorId != indicator.indicatorId) { + // clear all cached features + $scope.availableFeaturesBySpatialUnit = {}; + $scope.availableFeaturesBySpatialUnit.indicatorId = indicatorId; + + let data = await $scope.queryFeatures(indicatorId, spatialUnit) + // save response to scope to avoid further requests + $scope.availableFeaturesBySpatialUnit[spatialUnit.spatialUnitName] = data.features + } else { + // same indicator + if (!$scope.availableFeaturesBySpatialUnit[spatialUnit.spatialUnitName]) { + let data = await $scope.queryFeatures(indicatorId, spatialUnit) + // save response to scope to avoid further requests + $scope.availableFeaturesBySpatialUnit[spatialUnit.spatialUnitName] = data.features + } + } + + let allAreas = $scope.availableFeaturesBySpatialUnit[spatialUnit.spatialUnitName] + $scope.updateDualList($scope.dualListAreasOptions, allAreas, undefined) // don't select any areas + + } + + $timeout(function(){ + $scope.$digest(); + }); + } + + /** + * Queries DataManagement API to get features of given indicator. + * If no indicator id is provided the spatial unit endpoint is queried + * Result is stored to scope to avoid further requests. + * @param {*} indicator | selected indicator + */ + $scope.queryFeatures = async function(indicatorId, spatialUnit) { + // build request + // query different endpoints depending on if we have an indicator or not + let url; + if(!indicatorId) { + let date = spatialUnit.metadata.lastUpdate.split("-") + let year = date[0] + let month = date[1] + let day = date[2] + url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + + "/spatial-units/" + spatialUnit.spatialUnitId + "/" + year + "/" + month + "/" + day; + } else { + url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + + "/indicators/" + indicatorId + "/" + spatialUnit.spatialUnitId; + } + // send request + return await $http({ + url: url, + method: "GET" + }).then(function successCallback(response) { + return response.data; + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + console.error(error); + }); + } + + /** + * + * @param {*} options | scope options obj for dualList to update + * @param {*} data | new data (all data, including entries that get selected and removed from left side), format like: + * + * [ + * { + * properties: { + * NAME: ... + * } + * }, { + * ... + * }] + * @param {*} selectedItems | optional, the items that should be selected after the update + */ + $scope.updateDualList = function(options, data, selectedItems) { + options.selectedItems = []; + + let dualListInput = data.map( el => { + return {"name": el.properties.NAME} // we need this as an object for kommonitorDataExchangeService.createDualListInputArray + }); + dualListInput = kommonitorDataExchangeService.createDualListInputArray(dualListInput, "name"); + options.items = dualListInput; + + // $timeout is needed because we want to click on an element to select it. + // therefore we have to wait until the dual list is updated and the dom node exists + $timeout( function() { + // if there are items to select + if(selectedItems && selectedItems.length > 0) { + // if all items should be selected we can use the "select all" button for better performance + if(data.length === selectedItems.length) { + let dualListBtnElement = undefined; + switch(options.label) { + case "Zeitpunkte": + dualListBtnElement = document.querySelectorAll("#reporting-indicator-add-timestamps-dual-list .duallistButton")[0]; + break; + case "Bereiche": + dualListBtnElement = document.querySelectorAll("#reporting-indicator-add-areas-dual-list .duallistButton")[0]; + break; + case "Raumebenen": + dualListBtnElement = document.querySelectorAll("#reporting-indicator-add-spatialUnits-dual-list .duallistButton")[0]; + break; + } + dualListBtnElement.click(); + } else { + for(let item of selectedItems) { + if(item.hasOwnProperty("properties")) { + if(item.properties.hasOwnProperty("NAME")) { + let name = item.properties.NAME + // remove item to select from left side and add to right side + // we can't filter programmatically here because the changes won't get applied to scope variables + // not even with $scope.$digest in a $timeout + // instead we click on the elements + // get dom element by name + let arr = []; + switch(options.label) { + case "Zeitpunkte": + arr = Array.from(document.querySelectorAll("#reporting-indicator-add-timestamps-dual-list a")); + break; + case "Bereiche": + arr = Array.from(document.querySelectorAll("#reporting-indicator-add-areas-dual-list a")); + break; + case "Raumebenen": + arr = Array.from(document.querySelectorAll("#reporting-indicator-add-spatialUnits-dual-list a")); + break; + } + let el = arr.find(el => { + return el.textContent.includes(name) + }); + el.click(); + } + } + } + } + } + }, 500); + } + + // availableFeaturesBySpatialUnit has to be populated before this method is called. + // Also it is only called in situations where an indicator is selected. + function getValidTimestampsForSpatialUnit(spatialUnit) { + + let validTimestamps = []; // result + // Iterate all features and add all properties that start with "DATE_" to 'validTimestamps' + let features = $scope.availableFeaturesBySpatialUnit[ spatialUnit.spatialUnitName ]; + if(!features) { + let error = new Error("Tried to get valid timestamps but no features were cached.") + kommonitorDataExchangeService.displayMapApplicationError(error.message) + } + for(let feature of features) { + let props = Object.keys(feature.properties) + props = props.filter( prop => { + return prop.startsWith("DATE_"); + }) + + for(let prop of props) { + let timestamp = prop.replace("DATE_", "") + if( !validTimestamps.includes(timestamp) ) { + validTimestamps.push(timestamp) + } + } + } + return validTimestamps; + } + + $scope.addIsochronesBboxProperties = function() { + // Calculates and adds a bbox property for each feature and for overall layer + // These do not exist if the type of movement is "buffer" ( = isochrones not generated by ors) + + let overallBbox = []; + let features = $scope.isochrones.features; + for(var i=0; i<$scope.isochrones.features.length; i++) { + + // calculate bbox for feature + if(!features[i].bbox || !features[i].bbox.length) { + features[i].properties.bbox = turf.bbox(features[i]); + } + + // check if we have to adjust overall bbox + if(overallBbox.length === 0) { + overallBbox.push(...features[i].properties.bbox) + } else { + let bbox = features[i].properties.bbox; + overallBbox[0] = (bbox[0] < overallBbox[0]) ? bbox[0] : overallBbox[0]; + overallBbox[1] = (bbox[1] < overallBbox[1]) ? bbox[1] : overallBbox[1]; + overallBbox[2] = (bbox[2] > overallBbox[2]) ? bbox[2] : overallBbox[2]; + overallBbox[3] = (bbox[3] > overallBbox[3]) ? bbox[3] : overallBbox[3]; + } + } + + $scope.isochrones.bbox = overallBbox; + } + + $scope.addIsochronesCenterLocationProperty = function() { + $scope.isochrones.centerLocations = []; + // We probably have multiple isochrones with the same center. + // Keep track of the value property and only calculate center coords once per isochrones group. + let firstIsochroneRangeValue = $scope.isochrones.features[0].properties.value; + for(let feature of $scope.isochrones.features) { + if(feature.properties.value === firstIsochroneRangeValue) { + // bbox format: [lower left lon, lower left lat, upper right lon, upper right lat] + if(! feature.properties.bbox){ + let bbox = turf.bbox(feature); // calculate bbox for each feature + feature.properties.bbox = bbox; + } + let bbox = feature.properties.bbox; + let centerLon = bbox[0] + ((bbox[2] - bbox[0]) / 2); + let centerLat = bbox[1] + ((bbox[3] - bbox[1]) / 2); + $scope.isochrones.centerLocations.push([centerLon, centerLat]) + } + + } + } + + $scope.$on("reportingIsochronesCalculationStarted", function(event) { + $scope.loadingData = true; + }); + + $scope.$on("reportingIsochronesCalculationFinished", function(event, isochrones) { + $scope.isochrones = isochrones; + if(checkNestedPropExists($scope.isochrones, 'info', 'query', 'profile')) + $scope.typeOfMovement = $scope.isochrones.info.query.profile; + else + $scope.typeOfMovement = "buffer"; + + if($scope.typeOfMovement === "buffer") { + $scope.isochronesRangeType = "distance"; + $scope.isochronesRangeUnits = "m"; + } else { + $scope.isochronesRangeType = $scope.isochrones.info.query.range_type; + $scope.isochronesRangeUnits = $scope.isochrones.info.query.units; + } + + // for type buffer the bbox field doesn't exist, so we have to create it. + $scope.addIsochronesBboxProperties() + if(!$scope.isochrones.centerLocations) + $scope.addIsochronesCenterLocationProperty() + + // Add a new property that is used as a unique id and can be used by echarts + // For buffer there is no group_index, so we use the ID + if($scope.typeOfMovement === "buffer") { + for(let feature of $scope.isochrones.features) { + feature.properties.echartsId = feature.properties.ID + "-" + feature.properties.value + } + } else { + for(let feature of $scope.isochrones.features) { + feature.properties.echartsId = feature.properties.group_index + "-" + feature.properties.value + } + } + + $scope.isochronesSeriesData = $scope.convertIsochronesToSeriesData($scope.isochrones); + + $scope.showResetIsochronesBtn =true; + + // TODO performance could be improved if we just iterate pages and update echarts + $scope.initializeAllDiagrams(); + $scope.loadingData = false; + }); + + $scope.resetIsochrones = function() { + $scope.isochrones = undefined; + $scope.typeOfMovement = undefined; + $scope.isochronesRangeType = undefined, + $scope.isochronesRangeUnits = undefined, + $scope.isochronesSeriesData = undefined + // TODO performance could be improved if we just iterate pages and update echarts + if($scope.diagramsPrepared) { + $scope.initializeAllDiagrams(); + } + $scope.showResetIsochronesBtn = false; + } + + + + $scope.onPoiLayerSelected = async function(poiLayer) { + + try { + $scope.absoluteLabelPositions = []; + $scope.diagramsPrepared = false; + $scope.isFirstUpdateOnIndicatorOrPoiLayerSelection = true; + $scope.selectedPoiLayer = poiLayer; + $scope.selectedPoiLayer.geoJSON = await $scope.queryMostRecentGeoresourceFeatures($scope.selectedPoiLayer) + + $scope.$broadcast("reportingPoiLayerSelected", $scope.selectedPoiLayer); + + // get a new template (in case another poi layer was selected previously) + $scope.template = $scope.getCleanTemplate(); + + // Indicator might not be selected at this point + // We get information about all available spatial units (instead of applicable ones) + // Then we select the highest one by default + let spatialUnits = await $scope.queryAllSpatialUnits(); + $scope.allSpatialUnitsForReachability = spatialUnits; // needed for spatial unit selection in 3rd tab + let highestSpatialUnit = spatialUnits.filter( unit => { + return unit.nextUpperHierarchyLevel === null; + }); + if( !$scope.selectedSpatialUnit) { + $scope.selectedSpatialUnit = highestSpatialUnit[0]; + } + let mostRecentTimestampName + if($scope.selectedSpatialUnit.metadata) { + mostRecentTimestampName = $scope.selectedSpatialUnit.metadata.lastUpdate; + } else { + // Happens when poiLayer is changed after an indicator was selected + // ( = spatial unit is the one from the indicator endpoint, not the spatial unit endpoint) + mostRecentTimestampName = $scope.allSpatialUnitsForReachability.filter( spatialUnit => { + return spatialUnit.spatialUnitId === $scope.selectedSpatialUnit.spatialUnitId + })[0].metadata.lastUpdate + } + $scope.selectedTimestamps = [{ + category: mostRecentTimestampName, + name: mostRecentTimestampName + }]; + + await $scope.updateAreasInDualList(); // this populates $scope.availableFeaturesBySpatialUnit + + + // update information in preview + for(let page of $scope.template.pages) { + for(let el of page.pageElements) { + if(el.type === "indicatorTitle-landscape") { + el.text = "Entfernungen für " + $scope.selectedPoiLayer.datasetName; + el.isPlaceholder = false; + // no area-specific pages in template since diagrams are not prepared yet + // and area/timestamp/timeseries changes are done after that + } + + if(el.type === "reachability-subtitle-landscape") { + el.text = $scope.selectedTimestamps[0].name; + if($scope.isochrones) + el.text += ", " + $scope.isochronesTypeOfMovementMapping[$scope.typeOfMovement]; + if($scope.selectedIndicator) + el.text += ", " + $scope.selectedIndicator.indicatorName; + el.isPlaceholder = false + } + } + } + + // get all features of largest spatial unit + let features; + if($scope.selectedIndicator) { + features = $scope.availableFeaturesBySpatialUnit[ $scope.selectedSpatialUnit.spatialUnitName ] + } else { + features = $scope.availableFeaturesBySpatialUnit[ $scope.selectedSpatialUnit.spatialUnitLevel ] + } + features = $scope.createLowerCaseNameProperty(features); + // we might have no indicator so we store the geometries directly on the scope + $scope.geoJsonForReachability = { + features: features + } + + // Preparing all diagrams is not possible without an indicator + // We only need an echarts geoMap to show isochrones, POIs and spatial unit borders + $scope.reachabilityTemplateGeoMapOptions = $scope.prepareReachabilityEchartsMap(); + + // select all areas by default + let allAreas; + if($scope.selectedSpatialUnit.spatialUnitName) { + allAreas = $scope.availableFeaturesBySpatialUnit[$scope.selectedSpatialUnit.spatialUnitName]; + } else { + allAreas = $scope.availableFeaturesBySpatialUnit[$scope.selectedSpatialUnit.spatialUnitLevel]; + } + $scope.updateDualList($scope.dualListAreasOptions, allAreas, allAreas); + + let allTabs = document.querySelectorAll("#reporting-add-indicator-tab-list li") + for(let tab of allTabs) { + $scope.enableTab(tab); + } + } catch (error) { + console.error(error); + kommonitorDataExchangeService.displayMapApplicationError(error); + $scope.loadingData = false; + } + + + } + + + function calculateOverallBoundingBoxFromGeoJSON(features) { + let result = []; + for(var i=0; i result[2]) ? bbox[2] : result[2]; + result[3] = (bbox[3] > result[3]) ? bbox[3] : result[3]; + } + } + return result; + }; + + + $scope.setMostRecentIndicatorDataToReachabilityMap = function(seriesOptions) { + let mostRecentTimestampName = $scope.selectedIndicator.applicableDates.at(-1); + let features; + if($scope.selectedSpatialUnit.spatialUnitName) { + features = $scope.availableFeaturesBySpatialUnit[$scope.selectedSpatialUnit.spatialUnitName] + } else { + features = $scope.availableFeaturesBySpatialUnit[$scope.selectedSpatialUnit.spatialUnitLevel] + } + let newSeriesData = features.map( feature => { + let name = feature.properties.NAME + let value = feature.properties["DATE_" + mostRecentTimestampName] + value = Math.round(value * 100) / 100; + return { + name: name, + value: value + } + }); + seriesOptions.data = newSeriesData; + return seriesOptions; + } + + $scope.resetOptionalIndicator = function() { + + if(!$scope.selectedIndicator) { + return; + } + + $scope.selectedIndicator = undefined; + // since we don't have an indicator selected anymore we reset the spatial unit + $scope.selectedSpatialUnit = $scope.allSpatialUnitsForReachability.filter( spatialUnit => { + return spatialUnit.spatialUnitLevel === $scope.selectedSpatialUnit.spatialUnitName; + })[0]; + + + // let filter = $scope.selectedIndicator.applicableSpatialUnits.filter( spatialUnit => { + // return spatialUnit.spatialUnitName === $scope.selectedSpatialUnit.spatialUnitLevel; + // }) + // $scope.selectedSpatialUnit = filter[0]; + + for(let page of $scope.template.pages) { + for(let pageElement of page.pageElements) { + if(pageElement.type === "map") { + let domNode = document.querySelector("#reporting-addIndicator-page-" + $scope.template.pages.indexOf(page) + "-map") + let map = echarts.getInstanceByDom(domNode) + let options = map.getOption(); + // remove indicator data + options.series[0].data = []; + options.series[0].label.formatter = '{b}'; + map.setOption(options, { + replaceMerge: ['series'] + }); + } + + if(pageElement.type === "reachability-subtitle-landscape") { + pageElement.text = $scope.selectedTimestamps[0].name; + if($scope.isochrones) { + pageElement.text += ", " + $scope.isochronesTypeOfMovementMapping[$scope.typeOfMovement]; + } + + pageElement.isPlaceholder = false + } + } + } + } + + $scope.handleIndicatorSelectForReachability = async function(indicator) { + $scope.selectedIndicator = indicator; + let indicatorId = $scope.selectedIndicator.indicatorId; + let featureCollection = await $scope.queryFeatures(indicatorId, $scope.selectedSpatialUnit); + if(!$scope.selectedSpatialUnit.spatialUnitName) { + // set the applicable spatial unit from the indicator as selected spatial unit + let filter = $scope.selectedIndicator.applicableSpatialUnits.filter( spatialUnit => { + return spatialUnit.spatialUnitName === $scope.selectedSpatialUnit.spatialUnitLevel; + }) + if(filter && filter.length) { + $scope.selectedSpatialUnit = filter[0]; + } + } + + $scope.availableFeaturesBySpatialUnit[$scope.selectedSpatialUnit.spatialUnitName] = featureCollection.features; + $scope.selectedIndicator.geoJSON = featureCollection; + $scope.selectedIndicator.geoJSON.features = $scope.createLowerCaseNameProperty($scope.selectedIndicator.geoJSON.features); + for(let feature of $scope.selectedIndicator.geoJSON.features) { + let bbox = turf.bbox(feature); // calculate bbox for each feature + feature.properties.bbox = bbox; + } + + for(let page of $scope.template.pages) { + for(let pageElement of page.pageElements) { + if(pageElement.type === "map") { + let domNode = document.querySelector("#reporting-addIndicator-page-" + $scope.template.pages.indexOf(page) + "-map") + let map = echarts.getInstanceByDom(domNode) + let options = map.getOption(); + let seriesOptions = $scope.setMostRecentIndicatorDataToReachabilityMap(options.series[0]) + options.series[0] = seriesOptions; + options.series[0].label.formatter = '{b}\n{c}'; + map.setOption(options, { + replaceMerge: ['series'] + }); + } + + if(pageElement.type === "reachability-subtitle-landscape") { + pageElement.text = $scope.selectedTimestamps[0].name; + if($scope.isochrones) { + pageElement.text += ", " + $scope.isochronesTypeOfMovementMapping[$scope.typeOfMovement]; + } + pageElement.text += ", " + indicator.indicatorName; + pageElement.isPlaceholder = false; + } + } + } + $scope.loadingData = false; + $timeout(function(){ + $scope.$digest(); + }); + + } + + $scope.onIndicatorSelected = async function(indicator) { + try { + $scope.loadingData = true; + if($scope.template.name === "A4-landscape-reachability") { + $scope.handleIndicatorSelectForReachability(indicator); + return; + } + + $scope.selectedIndicator = undefined; + $scope.selectedTimestamps = []; + $scope.selectedAreas = []; + $scope.selectedSpatialUnit = undefined; + $scope.availableFeaturesBySpatialUnit = {}; + $scope.absoluteLabelPositions = []; + $scope.echartsOptions = { + map: {}, + bar: {}, + line: {} + } + $scope.diagramsPrepared = false; + // set indicator manually. + // if we use ng-model it gets converted to string instead of an object + $scope.selectedIndicator = indicator; + + // get a new template (in case another indicator was selected previously) + $scope.template = $scope.getCleanTemplate(); + + // set spatial unit to highest available one + let spatialUnits = await $scope.queryAllSpatialUnits(); + // go from highest to lowest spatial unit and check if it is available. + for(let spatialUnit of spatialUnits) { + let applicableSpatialUnitsFiltered = $scope.selectedIndicator.applicableSpatialUnits.filter( (unit) => { + return unit.spatialUnitId === spatialUnit.spatialUnitId; + }) + + if(applicableSpatialUnitsFiltered.length === 1) { + $scope.selectedSpatialUnit = applicableSpatialUnitsFiltered[0]; + break; + } + } + + if(!$scope.selectedSpatialUnit) { + throw new Error("No applicable spatial unit found.") + } + + await $scope.updateAreasInDualList(); // this populates $scope.availableFeaturesBySpatialUnit + + // select most recent timestamp that is valid for the largest spatial unit + let dates = $scope.selectedIndicator.applicableDates; + let timestampsForSelectedSpatialUnit = getValidTimestampsForSpatialUnit( $scope.selectedSpatialUnit); + timestampsForSelectedSpatialUnit.sort(); + + let availableTimestamps = dates + .filter( name => { // filter dates to only show the ones valid for selected spatial unit + return timestampsForSelectedSpatialUnit.includes( name ) + }).map( name => { // then convert all timestamps to required format ("feature") + return { "properties": { "NAME": name } } + }) + + let mostRecentTimestampName = timestampsForSelectedSpatialUnit.at(-1); + let mostRecentTimestamp = availableTimestamps.filter( el => { + return el.properties.NAME === mostRecentTimestampName; + }) + + if($scope.template.name === "A4-landscape-timeseries") { + $scope.dateSlider = $scope.initializeDateRangeSlider( timestampsForSelectedSpatialUnit ); + } + // update information in preview + for(let page of $scope.template.pages) { + for(let el of page.pageElements) { + if(el.type === "indicatorTitle-landscape") { + el.text = indicator.indicatorName + " [" + indicator.unit + "]"; + el.isPlaceholder = false; + // no area-specific pages in template since diagrams are not prepared yet + // and area/timestamp/timeseries changes are done after that + } + + if(el.type === "dataTimestamp-landscape") { + el.text = mostRecentTimestampName; + el.isPlaceholder = false + } + + if(el.type === "dataTimeseries-landscape") { + let dsValues = $scope.getFormattedDateSliderValues() + el.text = dsValues.from + " - " + dsValues.to + el.isPlaceholder = false + } + } + } + + // get all features of largest spatial unit + let features = $scope.availableFeaturesBySpatialUnit[ $scope.selectedSpatialUnit.spatialUnitName ] + features = $scope.createLowerCaseNameProperty(features); + let geoJson = { + features: features + } + + // add new prop to indicator metadata, because it is expected that way by kommonitorVisualStyleHelperService + // used in prepareDiagrams + $scope.selectedIndicator.geoJSON = geoJson; + let classifyUsingWholeTimeseries = false; + let isTimeseries = false; + $scope.prepareDiagrams($scope.selectedIndicator, $scope.selectedSpatialUnit, mostRecentTimestampName, classifyUsingWholeTimeseries, isTimeseries, undefined, undefined); + // We have to update time and areas. Usually both of these would result in a diagram update. + // We want to skip the first one and only update diagrams once everything is ready for better performance. + $scope.isFirstUpdateOnIndicatorOrPoiLayerSelection = true; + if($scope.template.name === "A4-landscape-timeseries") { + // This is an exception from the process above + $scope.isFirstUpdateOnIndicatorOrPoiLayerSelection = false; + classifyUsingWholeTimeseries = false; + let values = $scope.getFormattedDateSliderValues(); + let isTimeseries = true; + $scope.prepareDiagrams($scope.selectedIndicator, $scope.selectedSpatialUnit, mostRecentTimestampName, classifyUsingWholeTimeseries, isTimeseries, values.from, values.to); + } else { + $scope.updateDualList($scope.dualListTimestampsOptions, availableTimestamps, mostRecentTimestamp) + } + + // select all areas by default + let allAreas = $scope.availableFeaturesBySpatialUnit[$scope.selectedSpatialUnit.spatialUnitName]; + $scope.updateDualList($scope.dualListAreasOptions, allAreas, allAreas); + + let allTabs = document.querySelectorAll("#reporting-add-indicator-tab-list li") + for(let tab of allTabs) { + $scope.enableTab(tab); + } + } catch (error) { + console.error(error); + kommonitorDataExchangeService.displayMapApplicationError(error); + $scope.loadingData = false; + } + } + + $scope.getCleanTemplate = function() { + let result = angular.fromJson($scope.untouchedTemplateAsString); + for(let page of result.pages) { + page.id = $scope.templatePageIdCounter++; + } + return result; + } + + $scope.onBackToOverviewClicked = function() { + $scope.reset(); + $scope.$emit('reportingBackToOverviewClicked') + + } + + $scope.reset = function() { + $scope.template = undefined; + $scope.untouchedTemplateAsString = ""; + $scope.indicatorNameFilter = ""; + $scope.poiNameFilter = ""; + $scope.availableIndicators = []; + $scope.selectedIndicator = undefined; + $scope.availableFeaturesBySpatialUnit = {}; + $scope.selectedSpatialUnit = undefined; + $scope.selectedAreas = []; + $scope.selectedTimestamps = []; + $scope.indexOfFirstAreaSpecificPage = undefined; + $scope.echartsOptions = { + map: {}, + bar: {}, + line: {}, + } + $scope.loadingData = false; + $scope.templatePageIdCounter = 1; + $scope.dateSlider = undefined; + $scope.echartsRegisteredMapNames = []; + + for(let i=2;i<7;i++) { + let tab = document.querySelector("#reporting-add-indicator-tab" + i); + $scope.disableTab(tab); + } + } + + $scope.onAddBtnClicked = function() { + // for each page: add echarts configuration objects to the template + for(let [idx, page] of $scope.template.pages.entries()) { + let pageDom = document.querySelector("#reporting-addIndicator-page-" + idx); + + for(let pageElement of page.pageElements) { + + let pElementDom; + if(pageElement.type === "linechart") { + let arr = pageDom.querySelectorAll(".type-linechart"); + if(pageElement.showPercentageChangeToPrevTimestamp) { + pElementDom = arr[1]; + } else { + pElementDom = arr[0]; + } + } else { + pElementDom = pageDom.querySelector("#reporting-addIndicator-page-" + idx + "-" + pageElement.type) + } + + if(pageElement.type === "map" || pageElement.type === "barchart" || pageElement.type === "linechart") { + let instance = echarts.getInstanceByDom( pElementDom ); + let options = JSON.parse(JSON.stringify( instance.getOption() )); + pageElement.echartsOptions = options; + + // for reachability we also have the leaflet bbox stored already + // store legend for first page + } + + if(pageElement.type === "datatable") { + // add some properties so we can recreate the table later + let columnHeaders = pageDom.querySelectorAll("th"); + let columnNames = []; + for(let header of columnHeaders) { + columnNames.push(header.innerText); + } + pageElement.columnNames = columnNames; + let tableData = []; + let rows = pageDom.querySelectorAll("tbody tr"); + for(let row of rows) { + let rowData = []; + let fields = row.querySelectorAll("td"); + for(let field of fields) { + rowData.push(field.innerText); + } + tableData.push(rowData); + } + pageElement.tableData = tableData; // [ [...], [...], [...] ] + } + } + } + if($scope.selectedSpatialUnit.spatialUnitName) { + $scope.template.spatialUnitName = $scope.selectedSpatialUnit.spatialUnitName; + }else { + $scope.template.spatialUnitName = $scope.selectedSpatialUnit.spatialUnitLevel; + } + $scope.template.absoluteLabelPositions = $scope.absoluteLabelPositions; + $scope.template.echartsRegisteredMapNames = [...new Set($scope.echartsRegisteredMapNames)]; + $scope.template.isochronesRangeType = $scope.isochronesRangeType; + $scope.template.isochronesRangeUnits = $scope.isochronesRangeUnits; + if($scope.template.name !== "A4-landscape-reachability") { + $scope.$emit('reportingAddNewIndicatorClicked', [$scope.selectedIndicator, $scope.template]) + } else { + $scope.$emit('reportingAddNewPoiLayerClicked', [$scope.selectedPoiLayer, $scope.selectedIndicator, $scope.template]) + } + $scope.reset(); + } + + $scope.enableTab = function(tab) { + tab.classList.remove("tab-disabled") + tab.firstElementChild.removeAttribute("tabindex") + } + + $scope.disableTab = function(tab) { + tab.classList.add("tab-disabled") + tab.firstElementChild.setAttribute("tabindex", "1") + } + + // creates and returns a series data array for each range threshold + $scope.convertIsochronesToSeriesData = function(isochrones) { + let result = [] // array of series data config objects + let ranges = [] + if( checkNestedPropExists(isochrones, "info", "query", "profile") ) { + ranges = isochrones.info.query.ranges.split(",") + } else if( isochrones.hasOwnProperty("features")) { // for buffer + for(let feature of isochrones.features) { + if(checkNestedPropExists(feature, "properties", "value") && typeof(feature.properties.value) === "number" ) { + ranges.push(feature.properties.value) + } + } + ranges = [...new Set(ranges)] // remove dupes + } + if(!ranges || ranges.length === 0) { + throw new Error("Could not determine ranges from isochrones. Is the format correct?") + } + let rangesInt = ranges.map( e => parseInt(e)); // assuming we only get integer values as input here + let colorArr = []; + if(ranges.length === 1) colorArr.push("green"); + if(ranges.length === 2) colorArr.push( ...["green", "yellow"] ) + if(ranges.length === 3) colorArr.push( ...["green", "yellow", "red"] ) + if(ranges.length === 4) colorArr.push( ...["green", "yellow", "orange", "red"] ) + // If we have more than five ranges the last color is used again for now. Can be extended if there is need for it. + if(ranges.length >= 5) colorArr.push( ...["green", "yellow", "orange", "red", "brown"] ) + + // one series per range value, so we can control the z value and legend display more easily. + for(let [idx, range] of rangesInt.entries()) { + if(idx >= colorArr.length) idx = colorArr.length-1; + let seriesData = []; + let data = isochrones.features.filter( feature => { + return feature.properties.value === range; // get features for this range threshold + }).map( feature => { + + return { + name: feature.properties.echartsId, + value: feature.properties.value, + itemStyle: { + areaColor: colorArr[idx], + color: colorArr[idx], + opacity: 0.3 + }, + label: { + show: false + }, + emphasis: { + disabled: true + } + } + }) + seriesData.push(...data) + result.push(seriesData); + } + + return result; + } + + $scope.createMapForReachability = async function(wrapper, page, pageElement) { + + let options = JSON.parse(JSON.stringify( $scope.reachabilityTemplateGeoMapOptions )); + // add indictor data if it is available + if($scope.selectedIndicator) { + options.series[0] = $scope.setMostRecentIndicatorDataToReachabilityMap(options.series[0]) + options.series[0].label.formatter = '{b}\n{c}'; + } + + // register a new echarts map with a unique name (needed when filtering by area) + // check if there is a map registered for this combination, if not register one with all features + let mapName = $scope.selectedPoiLayer.datasetName + "_" + $scope.selectedSpatialUnit.spatialUnitId; + if(page.area && page.area.length) + mapName += "_" + page.area + if(!$scope.echartsRegisteredMapNames.includes(mapName)) { + echarts.registerMap(mapName, $scope.geoJsonForReachability) + $scope.echartsRegisteredMapNames.push(mapName) + } + + options.series[0].map = mapName; + options.geo.map = mapName + + // Add isochrones if possible + // In echarts one map can only handle one series + // But we need the isochrones in different series to control their z-indexes (show smaller isochrones above larger ones) + // That's why we need to register one map per range threshold, that only contains a subset of isochrones. + if($scope.isochrones) { + for(let seriesData of $scope.isochronesSeriesData) { + let range = seriesData[0].value; + let registeredMap = echarts.getMap($scope.selectedPoiLayer.datasetName + "_isochrones-" + range) + if( !registeredMap ) { + let isochrones = $scope.isochrones.features.filter( feature => { + return feature.properties.value === range; + }) + let featureCollection = { + features: isochrones + } + echarts.registerMap($scope.selectedPoiLayer.datasetName + "_isochrones-" + range, featureCollection) + $scope.echartsRegisteredMapNames.push($scope.selectedPoiLayer.datasetName + "_isochrones-" + range) + } + } + + let bbox = $scope.isochrones.bbox; // [left, bottom, right, top] + let isochronesBboxForEcharts = [[bbox[0], bbox[3]], [bbox[2], bbox[1]]] // [left, top], [right, bottom] + + + for(let [idx, seriesData] of $scope.isochronesSeriesData.entries()) { + let series = { + name: "isochrones-" + seriesData[0].value, + type: 'map', + roam: false, + left: 0, top: 0, right: 0, bottom: 0, + boundingCoords: isochronesBboxForEcharts, + map: $scope.selectedPoiLayer.datasetName + "_isochrones-" + seriesData[0].value, + nameProperty: 'echartsId', + cursor: "default", + select: { + disabled: true + }, + z: 90 - idx, // first one has smallest threshold and gets highest index + data: seriesData + } + options.series.push(series) + } + } + + // Add poi markers as additional series + let centerPointSeriesData = $scope.selectedPoiLayer.geoJSON.features.map( feature => { + return feature.geometry.coordinates; + }); + + let centerPointSeries = { + name: 'centerPoints', + type: 'scatter', + coordinateSystem: 'geo', + symbol: "image://icons/marker-icon.png", + symbolSize: [17, 26], + symbolOffset: [0, '-50%'], + itemStyle: { + opacity: 1 + }, + cursor: "default", + data: centerPointSeriesData, + label: { + show: false, + }, + emphasis: { + disabled: true + }, + z: 200 + } + options.series.push(centerPointSeries) + + let map = echarts.init( wrapper ) + + // label positioning + options = enableManualLabelPositioningAcrossPages(page, options, map) + + map.setOption( options, { + replaceMerge: ['series', 'geo'] + }) + + // initialize the leaflet map beneath the transparent-background echarts map + await $timeout(async function(page, pageElement, echartsMap) { + let pageIdx = $scope.template.pages.indexOf(page); + let id = "reporting-addPoiLayer-reachability-leaflet-map-container-" + pageIdx; + let pageDom = document.getElementById("reporting-addIndicator-page-" + pageIdx); + let pageElementDom = document.getElementById("reporting-addIndicator-page-" + pageIdx + "-map"); + let oldMapNode = document.getElementById(id); + if(oldMapNode) { + oldMapNode.remove(); + } + let div = document.createElement("div"); + div.id = id; + div.style.position = "absolute"; + div.style.left = pageElement.dimensions.left; + div.style.top = pageElement.dimensions.top; + div.style.width = pageElement.dimensions.width; + div.style.height = pageElement.dimensions.height; + div.style.zIndex = 10; + pageDom.appendChild(div); + let echartsOptions = echartsMap.getOption(); + + let leafletMap = L.map(div.id, { + zoomControl: false, + dragging: false, + doubleClickZoom: false, + boxZoom: false, + trackResize: false, + attributionControl: false, + // prevents leaflet form snapping to closest pre-defined zoom level. + // In other words, it allows us to set exact map extend by a (echarts) bounding box + zoomSnap: 0 + }); + // manually create a field for attribution so we can control the z-index. + let prevAttributionDiv = pageDom.querySelector(".map-attribution") + if(prevAttributionDiv) prevAttributionDiv.remove(); + let attrDiv = document.createElement("div") + attrDiv.classList.add("map-attribution") + attrDiv.style.position = "absolute"; + attrDiv.style.bottom = 0; + attrDiv.style.left = 0; + attrDiv.style.zIndex = 800; + let attrImg = await kommonitorDiagramHelperService.createReportingReachabilityMapAttribution(); + attrDiv.appendChild(attrImg); + pageElementDom.appendChild(attrDiv); + // also create the legend manually + let prevLegendDiv = pageDom.querySelector(".map-legend") + if(prevLegendDiv) prevLegendDiv.remove(); + let legendDiv = document.createElement("div") + legendDiv.classList.add("map-legend") + legendDiv.style.position = "absolute"; + legendDiv.style.bottom = 0; + legendDiv.style.right = 0; + legendDiv.style.zIndex = 800; + let legendImg = await kommonitorDiagramHelperService.createReportingReachabilityMapLegend(echartsOptions, $scope.selectedSpatialUnit, $scope.isochronesRangeType, $scope.isochronesRangeUnits); + legendDiv.appendChild(legendImg); + pageElementDom.appendChild(legendDiv) + + // echarts uses [lon, lat], leaflet uses [lat, lon] + let boundingCoords = echartsOptions.series[0].boundingCoords; + let westLon = boundingCoords[0][0]; + let southLat = boundingCoords[1][1]; + let eastLon = boundingCoords[1][0]; + let northLat = boundingCoords[0][1]; + + if(page.area && page.area.length) { + for(let feature of $scope.geoJsonForReachability.features) { + if(feature.properties.NAME === page.area) { + // set bounding box to this feature + let featureBbox = feature.properties.bbox; + westLon = featureBbox[0]; + southLat = featureBbox[1]; + eastLon = featureBbox[2]; + northLat = featureBbox[3]; + break; + } + } + } + + // Add 2% space on all sides + let divisor = 50; + let bboxHeight = northLat - southLat; + let bboxWidth = eastLon - westLon; + northLat += bboxHeight/divisor; + southLat -= bboxHeight/divisor; + eastLon += bboxWidth/divisor; + westLon -= bboxWidth/divisor; + + leafletMap.fitBounds( [[southLat, westLon], [northLat, eastLon]] ); + let bounds = leafletMap.getBounds() + // now update every echarts series + boundingCoords = [ [bounds.getWest(), bounds.getNorth()], [bounds.getEast(), bounds.getSouth()]] + for(let series of echartsOptions.series) { + series.top = 0; + series.bottom = 0; + series.aspectScale = 0.625 + series.boundingCoords = boundingCoords + } + // also for the invisible geo component to update pois + echartsOptions.geo[0].top = 0; + echartsOptions.geo[0].bottom = 0; + echartsOptions.geo[0].aspectScale = 0.625 + echartsOptions.geo[0].boundingCoords = boundingCoords + + echartsMap.setOption(echartsOptions, { + notMerge: true + }); + + // Attribution is handled in a custom element + let osmLayer = new L.TileLayer.Grayscale("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"); + osmLayer.addTo(leafletMap); + + // add leaflet map to pageElement in case we need it again later + pageElement.leafletMap = leafletMap; + + // can be used to check if positioning in echarts matches the one from leaflet + // let geoJsonLayer = L.geoJSON( $scope.geoJsonForReachability.features ) + // geoJsonLayer.addTo(leafletMap) + // let isochronesLayer = L.geoJSON( $scope.isochrones.features ) + // isochronesLayer.addTo(leafletMap); + // let poiMarkerLSource = { + // "type": "FeatureCollection", + // "features": [] + // } + // for(let lonLatArr of centers) { + // poiMarkerLSource.features.push({ + // "type": "Feature", + // "geometry": { + // "type": "Point", + // "coordinates": [ + // lonLatArr[0], + // lonLatArr[1] + // ] + // } + // }) + // } + // poiMarkerLayer = L.geoJSON( poiMarkerLSource ) + // poiMarkerLayer.addTo(leafletMap); + + pageElement.leafletBbox = bounds; + + if(pageIdx === $scope.template.pages.length-1) { + $scope.loadingData = false; + } + }, 0, true, page, pageElement, map) + + return map; + } + + /** + * Creates and returns an echarts geoMap object. + * @param {*} wrapper | the dom element (most likely a div) where the map should be inserted + * @param {*} pageElement + * @returns + */ + $scope.createPageElement_Map = async function(wrapper, page, pageElement) { + + if($scope.template.name === "A4-landscape-reachability") { + let map = await $scope.createMapForReachability(wrapper, page, pageElement); + return map; + } + + // check if there is a map registered for this combination, if not register one with all features + let mapName = undefined; + let timestamp = undefined; + + // get the timestamp from pageElement, not from dom because dom might not be up to date yet + let dateElement; + if($scope.template.name === "A4-landscape-reachability") { + dateElement = page.pageElements.find( el => { + return el.type === "reachability-subtitle-landscape"; + }); + timestamp = dateElement.text.split(",")[0]; + } else { + // the other two templates + dateElement = page.pageElements.find( el => { + // pageElement references the map here + // do the comparison like this because we have maps with dataTimestamp and dataTimeseries in the timeseries template + return el.type === (pageElement.isTimeseries ? "dataTimeseries-landscape" : "dataTimestamp-landscape"); + }) + + if(pageElement.isTimeseries) { + timestamp = dateElement.text.split(" - ")[1]; // get the recent timestamp + } else { + timestamp = dateElement.text; + } + } + + if($scope.template.name === "A4-landscape-reachability") { + mapName = $scope.selectedIndicator.indicatorId + "_" + timestamp + "_" + $scope.selectedSpatialUnit.spatialUnitName; + } else { + mapName = $scope.selectedIndicator.indicatorId + "_" + dateElement.text + "_" + $scope.selectedSpatialUnit.spatialUnitName; + } + + if(pageElement.classify) + mapName += "_classified"; + if(pageElement.isTimeseries) + mapName += "_timeseries" + if(page.area && page.area.length) + mapName += "_" + page.area + + if(!$scope.echartsRegisteredMapNames.includes(mapName)) { + echarts.registerMap(mapName, $scope.selectedIndicator.geoJSON) + $scope.echartsRegisteredMapNames.push(mapName) + } + + + let map = echarts.init( wrapper ); + if(pageElement.isTimeseries) { + timestamp += "_relative" + } + let options = JSON.parse(JSON.stringify( $scope.echartsOptions.map[timestamp] )); + + // default changes for all reporting maps + options.title.show = false; + options.grid = undefined; + options.visualMap.axisLabel = { "fontSize": 10 }; + options.toolbox.show = false; + options.visualMap.left = "right"; + let series = options.series[0]; + series.roam = false; + series.selectedMode = false; + + + + if(pageElement.isTimeseries) { + let includeInBetweenDates = true; + let timeseries = $scope.getFormattedDateSliderValues(includeInBetweenDates) + series.data = $scope.calculateSeriesDataForTimeseries($scope.selectedIndicator.geoJSON.features, timeseries) + } + + series.map = mapName; // update the map with the one registered above + series.name = mapName; + + let areaNames = $scope.selectedAreas.map( el => { + return el.name; + }); + + if(pageElement.classify === true) { + options.visualMap.show = true; + } else { + options.visualMap.show = false; + } + + series.data.forEach( el => { + el.itemStyle = el.itemStyle ? el.itemStyle : {}; + el.emphasis = el.emphasis ? el.emphasis : {}; + el.emphasis.itemStyle = el.emphasis.itemStyle ? el.emphasis.itemStyle : {}; + el.label = el.label ? el.label : {}; + el.visualMap = false; + + if(pageElement.classify === false) { + if( areaNames.includes(el.name) ) { + // show selected areas (don't classify color by value) + el.label.formatter = '{b}\n{c}'; + el.label.show = true; + el.label.textShadowColor = '#ffffff'; + el.label.textShadowBlur = 2; + el.itemStyle.areaColor = "rgb(255, 153, 51, 0.6)"; + el.itemStyle.color = "rgb(255, 153, 51, 0.6)"; + el.emphasis.itemStyle.areaColor = "rgb(255, 153, 51, 0.6)"; + el.emphasis.itemStyle.color = "rgb(255, 153, 51, 0.6)"; + } else { + // Only show borders for any other areas + el.itemStyle.color = "rgba(255, 255, 255, 0)"; + el.itemStyle.areaColor = "rgba(255, 255, 255, 0)"; + el.emphasis.itemStyle.color = "rgba(255, 255, 255, 0)"; + el.emphasis.itemStyle.areaColor = "rgba(255, 255, 255, 0)"; + el.label.show = false; + } + } + + if(pageElement.classify === true) { + + if( areaNames.includes(el.name) ) { + el.visualMap = true; + el.label.formatter = '{b}\n{c}'; + // get color from visual map to overwrite yellow color + let color = "rgba(0, 0, 0, 0.5)"; + let opacity = 1; + for(let [idx, piece] of options.visualMap.pieces.entries()) { + // for the last index (highest value) value can equal the upper boundary + if(idx === (options.visualMap.pieces.length-1)) { + if(piece.min <= el.value && el.value <= piece.max) { + color = piece.color; + opacity = piece.opacity; + break; + } + } + + // for all other pieces check if it is withing the boundaries, (including lower one, excluding upper one) + if(piece.min <= el.value && el.value < piece.max) { + color = piece.color; + opacity = piece.opacity; + break; + } + } + el.label.show = true; + el.itemStyle.color = color; + el.itemStyle.areaColor = color; + el.itemStyle.opacity = opacity; + el.emphasis.itemStyle.color = color; + el.emphasis.itemStyle.areaColor = color; + el.emphasis.itemStyle.opacity = opacity; + el.label.textShadowColor = '#ffffff'; + el.label.textShadowBlur = 2; + } else { + el.visualMap = false; + el.itemStyle.color = "rgb(255, 255, 255)"; + el.itemStyle.areaColor = "rgb(255, 255, 255)"; + el.emphasis.itemStyle.color = "rgb(255, 255, 255)"; + el.emphasis.itemStyle.areaColor = "rgb(255, 255, 255)"; + el.label.show = false; + } + } + }) + + + // label positioning + options = enableManualLabelPositioningAcrossPages(page, options, map) + + map.setOption(options); + return map; + } + + function enableManualLabelPositioningAcrossPages(page, options, map) { + if(!page.area) { + options.labelLayout = function(feature) { + if(feature.seriesIndex != 0) { // index 0 are the borders / indicator + return; + } + // Set fixed position for labels that were previously dragged by user + // For all other labels try to avoid overlaps + let names = $scope.absoluteLabelPositions.map(el=>el.name) + let text = feature.text.split("\n")[0] // area name is the first line + if(names.includes(text)) { + let idx = names.indexOf(text) + return { + x: $scope.absoluteLabelPositions[idx].x, + y: $scope.absoluteLabelPositions[idx].y, + draggable: true + } + } else { + return { + moveOverlap: 'shiftY', + x: feature.rect.x + feature.rect.width / 2, + draggable: true + } + } + + } + + options.labelLine = { + show: true, + showAbove: false, + lineStyle: { + color: '#555' + } + } + + map.getZr().on('mousedown', function(event) { + // on label drag + if(event.target) { + let target = event.target; + if(target.parent && target.parent.type === "text") { + // get the feature which this label belongs to + // When user clicks on the label, one of the child elements is clicked + // Child elements can be something like: first line of text, second line of text, (white) label background + // These elements all have the same parent, which we can use to navigate to the parent and then find the correct child (area name) + let parent = target.parent; + let areaNameChild; + for(let child of parent._children) { + // we assume that the area name is the first child with text ("the first line") + if(child.style.text && child.style.text.length > 0) { + areaNameChild = child; + break; + } + } + $scope.draggingLabelForFeature = areaNameChild.style.text; + } + } + }); + + map.getZr().on('mouseup', function(event) { + if(event.target) { + let target = event.target; + if(target.parent && target.parent.type === "text") { + // for all other maps, that are not area-specific, do the exact same label drag + let newX = target.parent.x; + let newY = target.parent.y; + let names = $scope.absoluteLabelPositions.map(el=>el.name) + if(names.includes($scope.draggingLabelForFeature)) { + let idx = names.indexOf($scope.draggingLabelForFeature); + $scope.absoluteLabelPositions[idx].x = newX; + $scope.absoluteLabelPositions[idx].y = newY; + } else { + $scope.absoluteLabelPositions.push({ + name: $scope.draggingLabelForFeature, + x: newX, + y: newY + }) + } + + for(let [idx, page] of $scope.template.pages.entries()) { + for(let pageElement of page.pageElements) { + if(pageElement.type === "map" && !page.area) { + let domNode = document.getElementById("reporting-addIndicator-page-" + idx + "-map"); + let map = echarts.getInstanceByDom(domNode); + map.setOption(map.getOption()); // this calls the labelLayout function defined above + } + } + } + } + } + }); + } + return options; + } + + $scope.createPageElement_Average = function(page, pageElement, calcForSelection) { + // get the timestamp from pageElement, not from dom because dom might not be up to date yet + // no timeseries possible for this type of element + let dateElement = page.pageElements.find( el => { + return el.type === "dataTimestamp-landscape"; + }); + let timestamp = dateElement.text; + + let avg = $scope.calculateAvg( $scope.selectedIndicator, timestamp, calcForSelection ); + pageElement.text = avg; + pageElement.css = "border: solid 1px lightgray; padding: 2px;" + pageElement.isPlaceholder = false; + } + + + $scope.createPageElement_Change = function(page, pageElement, calcForSelection) { + // get the timeseries from slider, not from dom because dom might not be up to date yet + let timeseries = $scope.getFormattedDateSliderValues(true); + + let change = $scope.calculateChange( $scope.selectedIndicator, timeseries, calcForSelection ); + pageElement.text = change; + pageElement.css = "border: solid 1px lightgray; padding: 2px;"; + pageElement.isPlaceholder = false; + } + + $scope.createPageElement_BarChartDiagram = function(wrapper, page) { + + // get timestamp from pageElement, not from dom because dom might not be up to date yet + // barcharts are only used in timestamp templates so we don't have to check for timeseries for now + let dateElement = page.pageElements.find( el => { + return el.type === "dataTimestamp-landscape"; + }); + let timestamp = dateElement.text; + + let barChart = echarts.init( wrapper ); + let options = JSON.parse(JSON.stringify( $scope.echartsOptions.bar[timestamp] )); + + // default changes + options.xAxis.name = ""; + options.title.textStyle.fontSize = 12; + options.title.text = ""; + options.yAxis.axisLabel = { "fontSize": 10 }; + options.title.show = true; + options.grid.top = 35; + options.grid.bottom = 5; + options.toolbox.show = false; + options.visualMap[0].show = false; // only needed to set the color for avg + options.xAxis.axisLabel.show = true; + options.yAxis.name = ""; // included in header of each page + options.xAxis.name = ""; // always timestamps + // black text with halo effect for better visibility + if(!options.textStyle) options.textStyle = {}; + options.textStyle.color = "black"; + options.textStyle.textShadowColor = '#ffffff'; + options.textStyle.textShadowBlur = 2; + + // filter series data and xAxis labels + if(page.area && page.area.length) { + options.series[0].data = options.series[0].data.filter( el => { + return el.name === page.area; + }); + let areaNames = options.series[0].data.map( obj => obj.name) + options.xAxis.data = areaNames; + } else { + // only show selected areas in the "overview" diagram + let areaNames = $scope.selectedAreas.map( obj => obj.name ); + options.series[0].data = options.series[0].data.filter( el => { + return areaNames.includes(el.name); + }); + areaNames = options.series[0].data.map( obj => obj.name); + options.xAxis.data = areaNames; + } + + options.series[0].data.sort(function(a, b) { + if(typeof(a.value) == 'number' && typeof(b.value) == 'number') { + return a.value - b.value; + } else { + return -1 + } + }); + + // add data element for the overall average + let overallAvgValue = $scope.calculateAvg($scope.selectedIndicator, timestamp, false); + let overallAvgElementName = (page.area && page.area.length) ? "Durchschnitt\nder\nRaumeinheit" : "Durchschnitt der Raumeinheit"; + let dataObjOverallAvg = { + name: overallAvgElementName, + value: overallAvgValue, + opacity: 1 + } + // get color for avg from visual map and disable opacity + let colorOverallAvg = ""; + for(let piece of options.visualMap[0].pieces) { + if(piece.min <= dataObjOverallAvg.value && dataObjOverallAvg.value < piece.max) { + colorOverallAvg = piece.color; + } + piece.opacity = 1; + } + dataObjOverallAvg.color = colorOverallAvg; + options.series[0].data.push(dataObjOverallAvg); + options.xAxis.data.push( dataObjOverallAvg.name ); + + // same for selection average + // add more data elements for the overall and selection average + let selectionAvgValue = $scope.calculateAvg($scope.selectedIndicator, timestamp, true); + let selectionAvgElementName = (page.area && page.area.length) ? "Durchschnitt\nder\nSelektion" : "Durchschnitt der Selektion"; + let dataObjSelectionAvg = { + name: selectionAvgElementName, + value: selectionAvgValue, + opacity: 1 + } + // get color for avg from visual map and disable opacity + let colorSelectionAvg = ""; + for(let piece of options.visualMap[0].pieces) { + if(piece.min <= dataObjSelectionAvg.value && dataObjSelectionAvg.value < piece.max) { + colorSelectionAvg = piece.color; + } + piece.opacity = 1; + } + dataObjSelectionAvg.color = colorSelectionAvg; + options.series[0].data.push(dataObjSelectionAvg); + options.xAxis.data.push( dataObjSelectionAvg.name ) + + options.series[0].emphasis.itemStyle = {}; // don't show border on hover + + barChart.setOption(options, { + replaceMerge: ['series'] // take the new series data, don't update part of the old one + }); + return barChart; + } + + $scope.createPageElement_TimelineDiagram = function(wrapper, page, pageElement) { + // no need to get a timestamp here + + let lineChart = echarts.init( wrapper ); + let timeline = $scope.getFormattedDateSliderValues(true).dates; + // get standard options, create a copy of the options to not change anything in the service + let options = JSON.parse(JSON.stringify( $scope.echartsOptions.line )); + options.title.textStyle.fontSize = 12; + options.title.text = "Zeitreihe"; + options.yAxis.axisLabel = { "fontSize": 10 }; + options.xAxis.axisLabel = { "fontSize": 10 }; + options.legend.show = false; + options.grid.top = 35; + options.grid.bottom = 5; + options.title.show = true; + options.toolbox.show = false; + options.yAxis.name = ""; // included in header of each page + options.xAxis.name = ""; // always timestamps + + // diagram contains avg series by default + // if it should be shown we adjust it to our timeseries + // future dates (compared to max slider value) were already filtered in prepareDiagrams + // we have to remove dates older than min slider value here + // we also have to filter xAxis labels accordingly + let timeseries = $scope.getFormattedDateSliderValues(true); + let oldestSelectedTimestamp = timeseries.from; + let timestampsToRemoveCounter = 0; + // use the axis labels to find out how many data points have to be removed later + let timestampReached = false; + while(!timestampReached) { + if(oldestSelectedTimestamp === options.xAxis.data[0]) { + timestampReached = true; + } else { + options.xAxis.data.shift(); + timestampsToRemoveCounter += 1; + } + } + + if(pageElement.showAverage) { + options.series = options.series.filter( series => { + return series.name === "Arithmetisches Mittel" + }); + + for(let i=0; i { + return el.name; + }); + } + + for(let areaName of areaNames) { + let data = []; + let filtered = $scope.selectedIndicator.geoJSON.features.filter( feature => { + return feature.properties.NAME === areaName; + }); + + for(let timestamp of timeline) { + let value = filtered[0].properties["DATE_" + timestamp]; + data.push(value) + } + + let series = {}; + series.name = areaName; + series.type = "line"; + series.data = data; + series.lineStyle = { + normal: { + width: 2, + type: "solid" + } + } + series.itemStyle = { + normal: { + borderWidth: 3 + } + } + + options.series.push(series) + } + } + + if(pageElement.showPercentageChangeToPrevTimestamp) { + for(let series of options.series) { + series.data = $scope.transformSeriesDataToPercentageChange(series.data) + + + } + options.xAxis.data.shift(); + options.title.text = "Veränderung zum Vorjahr"; + } + + if(pageElement.showBoxplots) { + // we assume that boxplots are only shown when showAreas is false (might change in the future). + // so we have to get the data of all areas first + let areaNames = []; + areaNames = $scope.selectedAreas.map( el => { + return el.name; + }); + + // create a nested array with each inner array containing all area-values for one timestamp + let datasetSource = []; + for(let timestamp of timeline) { + let valuesForTimestamp = []; + // filter features to selected areas + let selectedAreasFeatures = $scope.selectedIndicator.geoJSON.features.filter( feature => { + return areaNames.includes( feature.properties.NAME ); + }); + // get values for each feature + for(let feature of selectedAreasFeatures) { + let value = feature.properties["DATE_" + timestamp] + valuesForTimestamp.push(value); + } + + datasetSource.push(valuesForTimestamp) + } + + let xAxisLabels = options.xAxis.data; + options.dataset = [ + { + source: datasetSource + }, + { + transform: { + type: 'boxplot', + config: { + // params is 0, 1, 2, ... + // we can use this as an index to get the actual label and return it + itemNameFormatter: function (params) { + return xAxisLabels[params.value]; + } + } + } + }, + { + fromDatasetIndex: 1, + fromTransformResult: 1 + } + ] + + // add a new series that references the boxplots + options.series.push({ + name: 'boxplot', + type: 'boxplot', + datasetIndex: 1 // overlap boxplots and avg. line + }) + } + + lineChart.setOption(options, { + replaceMerge: ['series'] // take the new series data, don't update part of the old one + }); + return lineChart; + } + + $scope.createPageElement_Datatable = function(wrapper, page) { + + // table looks different depending on template type + // for single timestamps it is added at the end of each timestamp-section, so each area is inserted once + // for timeseries it is added once at the end of the template and contains an extra column for timestamps. + // Each area is inserted for multiple timestamps. + + // our wrapper is 440px high. + // 440 - 25 (header) = 415 + // we set each row to be 25px high, so we can fit 415 / 25 --> 16 rows on one page. + let wrapperHeight = parseInt(wrapper.style.height, 10); + let maxRows = Math.floor( (wrapperHeight - 25) / 25); + let rowsData = []; + let timestamp = undefined; + let timeseries = undefined; + + if($scope.template.name === "A4-landscape-timestamp") { + // get the timestamp from pageElement, not from dom because dom might not be up to date yet + let dateElement = page.pageElements.find( el => { + return el.type === "dataTimestamp-landscape"; + }); + timestamp = dateElement.text; + } + + if($scope.template.name === "A4-landscape-timeseries") { + let inBetweenValues = true; + timeseries = $scope.getFormattedDateSliderValues(inBetweenValues); + } + + // see how many pages need to be added. Rows are added later + for(let feature of $scope.selectedIndicator.geoJSON.features) { + // don't add row if feature not selected + let isSelected = false; + for(let area of $scope.selectedAreas) { + if(area.name === feature.properties.NAME) { + isSelected = true; + } + } + if( !isSelected ) + continue; + + if($scope.template.name === "A4-landscape-timestamp") { + // get the timestamp from pageElement, not from dom because dom might not be up to date yet + let dateElement = page.pageElements.find( el => { + return el.type === "dataTimestamp-landscape"; + }); + let timestamp = dateElement.text; + // prepare data to insert later + let value = feature.properties["DATE_" + timestamp]; + if(typeof(value) == 'number') + value = Math.round( value * 100) / 100; + + rowsData.push( { + name: feature.properties.NAME, + value: value + }); + } + + if($scope.template.name === "A4-landscape-timeseries") { + for(let timestamp of timeseries.dates) { + let value = feature.properties["DATE_" + timestamp]; + if(typeof(value) == 'number') + value = Math.round( value * 100) / 100; + rowsData.push( { + name: feature.properties.NAME, + timestamp: timestamp, + value: value + }); + } + } + } + + // sort by area name + rowsData.sort((a, b) => a.name.localeCompare(b.name)) + + // append average as last row if needed + if($scope.template.name === "A4-landscape-timestamp") { + rowsData.push({ + name: "Durchschnitt Selektion", + value: $scope.calculateAvg($scope.selectedIndicator, timestamp, true) + }); + rowsData.push({ + name: "Durchschnitt Gesamtstadt", + value: $scope.calculateAvg($scope.selectedIndicator, timestamp, false) + }); + + } + + // the length of rowsData is the number of rows we have to add + for(let i=0;i 0 && i % maxRows == 0) { + // add a new page + let newPage = angular.fromJson($scope.untouchedTemplateAsString).pages.at(-1); + newPage.id = $scope.templatePageIdCounter++; + // setup new page + for(let pageElement of newPage.pageElements) { + + if(pageElement.type === "indicatorTitle-landscape") { + pageElement.text = $scope.selectedIndicator.indicatorName + " [" + $scope.selectedIndicator.unit + "]" + pageElement.isPlaceholder = false; + } + + if(pageElement.type === "dataTimestamp-landscape") { + pageElement.text = timestamp; + pageElement.isPlaceholder = false; + } + + // exists only on timeseries template (instead of dataTimestamp-landscape), so we don't need another if...else here + if(pageElement.type === "dataTimeseries-landscape") { + pageElement.text = timeseries.from + " - " + timeseries.to; + pageElement.isPlaceholder = false; + } + + if(pageElement.type === "datatable") { + pageElement.isPlaceholder = false; + } + } + + // insert after current one + let currentPageIndex = $scope.template.pages.indexOf(page) + $scope.template.pages.splice(currentPageIndex + 1, 0, newPage); + } + } + + + // create table rows once the pages exist + function insertDatatableRows(rowsData, page, maxRows) { + // get current index of page (might have changed in the meantime) + let idx = $scope.template.pages.indexOf(page) + let wrapper = document.querySelector("#reporting-addIndicator-page-" + idx + "-datatable"); + if(wrapper) { + $interval.cancel(insertDatatableRowsInterval); // code below still executes once + } else { + return; + } + + wrapper.innerHTML = ""; + wrapper.style.border = "none"; // hide dotted border from outer dom element + wrapper.style.justifyContent = "flex-start"; // align table at top instead of center + + let columnNames; + if($scope.template.name === "A4-landscape-timeseries") { + columnNames = ["Bereich", "Zeitpunkt", "Wert"] + } else { + columnNames = ["Bereich", "Wert"] + } + + let table = $scope.createDatatableSkeleton(columnNames); + wrapper.appendChild(table); + let tbody = table.querySelector("tbody"); + let pageElement = $scope.template.pages[idx].pageElements.find( el => el.type === "datatable"); + pageElement.isPlaceholder = false; + + for(let i=0;i 0) idx++ + const idx_save = idx; + const i_save = i; + intervalArr[idx_save] = $interval(insertDatatableRowsPerPage, 0, 100, true, pageElement, idx_save, columnNames, maxRows, rowsData, i_save) + + function insertDatatableRowsPerPage(pageElement, idx, columnNames, maxRows, rowsData, i) { + // check if page exists already in dom, if not try again later + wrapper = document.querySelector("#reporting-addIndicator-page-" + idx + "-datatable"); + if(wrapper) { + $interval.cancel(intervalArr[idx]); // code below still executes once + } else { + return; + } + // page exists + wrapper.innerHTML = ""; + wrapper.style.border = "none"; // hide dotted border from outer dom element + wrapper.style.justifyContent = "flex-start"; // align table at top instead of center + table = $scope.createDatatableSkeleton(columnNames); + wrapper.appendChild(table); + tbody = table.querySelector("tbody"); + pageElement = $scope.template.pages[idx].pageElements.find( el => el.type === "datatable"); + pageElement.isPlaceholder = false; + + for(let j=i; j<(i + maxRows); j++) { + if(!rowsData[j]) + break; // on last page + + let row = document.createElement("tr"); + row.style.height = "25px"; + + for(let colName of columnNames) { + let td = document.createElement("td"); + if(colName === "Bereich") { + td.innerText = rowsData[j].name; + td.classList.add("text-left"); + } + + if(colName === "Zeitpunkt") { + td.innerText = rowsData[j].timestamp; + } + + if(colName === "Wert") { + td.innerText = rowsData[j].value; + td.classList.add("text-right"); + } + + row.appendChild(td); + } + + tbody.appendChild(row) + } + } + } + } + } + + let insertDatatableRowsInterval = $interval(insertDatatableRows, 0, 100, true, rowsData, page, maxRows) + } + + + $scope.filterMapByAreaName = function(echartsInstance, areaName, allFeatures) { + let options = echartsInstance.getOption(); + let mapName = options.series[0].map; + // filter shown areas if we are in the area-specific part of the template + // removing areas form the series doesn't work. We have to filter the geojson of the registered map. + let features = allFeatures.filter ( el => { + return el.properties.name === areaName + }); + + echarts.registerMap(mapName, { features: features } ) + + // echart map bounds are defined by a bounding box, which has to be updated as well. + if(!features[0].properties.bbox){ + features[0].properties.bbox = turf.bbox(features[0]); + } + let bbox = features[0].properties.bbox; // [east, south, west, north] + + let newBounds = [[bbox[2], bbox[3]], [bbox[0], bbox[1]]] // [[west, north], [east, south]] + options.series[0].boundingCoords = newBounds; + echartsInstance.setOption(options, { + replaceMerge: ['series'] + }); + } + + $scope.calculateAvg = function(indicator, timestamp, calcForSelection) { + // calculate avg from geoJSON property, which should be the currently selected spatial unit + let features = indicator.geoJSON.features; + if(calcForSelection) { + features = features.filter( el => { + return $scope.selectedAreas.map(area=>area.name).includes( el.properties.NAME ) + }); + } + + let data = features.map( feature => { + return feature.properties["DATE_" + timestamp]; + }) + + let noDataCounter = 0 + let sum = 0; + for(let i=0; i { + return $scope.selectedAreas.map(area=>area.name).includes( el.name ) + }); + } + data = data.map(obj => obj.value) + let noDataCounter = 0 + let sum = 0; + for(let i=0; i1 ? $scope.template.pages[i-1] : undefined; + let pageIncludesDatatable = page.pageElements.map(el => el.type).includes("datatable") + + if(prevPage) { + let prevPageIncludesDatatable = prevPage.pageElements.map(el => el.type).includes("datatable") + if(pageIncludesDatatable && prevPageIncludesDatatable) { + // get corresponding pages in the dom and check if they are datatable-pages + let prevDomPageEl = document.querySelector("#reporting-addIndicator-page-" + (i-1) + "-datatable") + let domPageEl = document.querySelector("#reporting-addIndicator-page-" + i + "-datatable") + if(!prevDomPageEl || !domPageEl) { // if this page does not exist in the dom + pageIdx--; // don't increase index in this iteration so it stays in sync with the pages that exist in the dom + } + continue; // don't do anything for additional datatable pages. They are added in createPageElement_Datatable + } + } + + + let pageDom = document.querySelector("#reporting-addIndicator-page-" + pageIdx); + + for(let pageElement of page.pageElements) { + + // usually each type is included only once per page, but there is an exception for linecharts in area specific part of timeseries template + // for now we more or less hardcode this, but it might have to change in the future + let pElementDom; + if(pageElement.type === "linechart") { + let arr = pageDom.querySelectorAll(".type-linechart"); + if(pageElement.showPercentageChangeToPrevTimestamp) { + pElementDom = arr[1]; + } else { + pElementDom = arr[0]; + } + } else { + pElementDom = pageDom.querySelector("#reporting-addIndicator-page-" + pageIdx + "-" + pageElement.type) + } + + switch(pageElement.type) { + case "map": { + // initialize with all areas + let map = await $scope.createPageElement_Map(pElementDom, page, pageElement); + // filter visible areas if needed + if(page.area && page.area.length) { + if($scope.selectedIndicator) { + $scope.filterMapByAreaName(map, page.area, $scope.selectedIndicator.geoJSON.features); + } else { + $scope.filterMapByAreaName(map, page.area, $scope.geoJsonForReachability.features); + } + + } + pageElement.isPlaceholder = false; + break; + } + case "mapLegend": { + pageElement.isPlaceholder = false; // hide the placeholder, legend is part of map + pageDom.querySelector(".type-mapLegend").style.display = "none"; + break; + } + + case "overallAverage": { + $scope.createPageElement_Average(page, pageElement, false); + pageDom.querySelector(".type-overallAverage").style.border = "none"; + break; + } + case "selectionAverage": { + $scope.createPageElement_Average(page, pageElement, true); + pageDom.querySelector(".type-selectionAverage").style.border = "none"; + break; + } + case "overallChange": { + $scope.createPageElement_Change(page, pageElement, false); + let wrapper = pageDom.querySelector(".type-overallChange") + wrapper.style.border = "none"; + wrapper.style.left = "670px"; + wrapper.style.width = "130px"; + wrapper.style.height = "100px"; + break; + } + case "selectionChange": { + $scope.createPageElement_Change(page, pageElement, true); + let wrapper = pageDom.querySelector(".type-selectionChange") + wrapper.style.border = "none"; + wrapper.style.left = "670px"; + wrapper.style.width = "130px"; + wrapper.style.height = "100px"; + break; + } + case "barchart": { + $scope.createPageElement_BarChartDiagram(pElementDom, page); + pageElement.isPlaceholder = false; + break; + } + case "linechart": { + $scope.createPageElement_TimelineDiagram(pElementDom, page, pageElement); + pageElement.isPlaceholder = false; + break; + } + case "datatable": { + // remove all following datatable pages first so we don't add too many. + // this might happen because we initialize page elements from $watch(selectedAreas) and $watch(selectedTimestamps) on indicator selection + let nextPage = i<$scope.template.pages.length-1 ? $scope.template.pages[i+1] : undefined; + if(nextPage) { + let nextPageIncludesDatatable = nextPage.pageElements.map(el => el.type).includes("datatable") + while(nextPageIncludesDatatable) { + $scope.template.pages.splice(i+1, 1) //remove page + //update next page + nextPage = i<$scope.template.pages.length-1 ? $scope.template.pages[i+1] : undefined; + nextPageIncludesDatatable = nextPage ? nextPage.pageElements.map(el => el.type).includes("datatable") : false; + } + } + $scope.createPageElement_Datatable(pElementDom, page); + break; + } + } + } + } + } + + /** + * + * @param {*} geoJsonFeatures + * @param {*} timestamp + * @param {*} seriesData | Must have a property "name"; + * @returns + */ + $scope.getSeriesDataForTimestamp = function(geoJsonFeatures, timestamp, seriesData) { + // if parameter is present we want to keep it's properties + if(seriesData && seriesData.length) { + for(let dataEntry of seriesData) { + // just replace the value property + let feature = geoJsonFeatures.find( feature => { + return feature.properties.NAME === dataEntry.name; + }); + dataEntry.value = feature.properties["DATE_" + timestamp] + if(typeof(dataEntry.value) == 'number') { + dataEntry.value = Math.round( dataEntry.value * 100) / 100; + } + } + return seriesData; + + } else { + // seriesData is undefined, meaning we can create a new array + let result = []; + for(let feature of geoJsonFeatures) { + let obj = {}; + obj.name = feature.properties.NAME; + let value = feature.properties["DATE_" + timestamp] + if(typeof(value) == 'number') { + value = Math.round( value * 100) / 100; + } + obj.value = value; + + result.push(obj) + } + return result; + } + } + + function calculateAndSetSeriesDataForTimeseries(features, fromDate, toDate){ + + for(let feature of features) { + let value = feature.properties["DATE_" + toDate] - feature.properties["DATE_" + fromDate]; + if(typeof(value) == 'number') { + value = Math.round( value * 100) / 100; + } + feature.properties["DATE_" + toDate] = value; + } + + return features; + } + + $scope.calculateSeriesDataForTimeseries = function(features, timeseries) { + let result = []; + let mostRecentDate = timeseries.to; + let oldestDate = timeseries.from + + for(let feature of features) { + let obj = {}; + obj.name = feature.properties.name; + let value = feature.properties["DATE_" + mostRecentDate] - feature.properties["DATE_" + oldestDate]; + if(typeof(value) == 'number') { + value = Math.round( value * 100) / 100; + } + obj.value = value; + + result.push(obj); + } + return result; + } + + /** + * + * @param {*} features | features array in geojson + */ + $scope.createLowerCaseNameProperty = function(features) { + for(let feature of features) { + if(feature.hasOwnProperty("properties")) { + if(!feature.properties.hasOwnProperty("name")) { + let featureName = feature.properties.NAME; + feature.properties.name = featureName; + } + } + } + return features; + } + + + $scope.createDatatableSkeleton = function(colNamesArr) { + + let table = document.createElement("table"); + table.classList.add("table-striped") + table.classList.add("table-bordered") + + let thead = document.createElement("thead"); + let tbody = document.createElement("tbody"); + table.appendChild(thead); + table.appendChild(tbody); + + let headerRow = document.createElement("tr"); + + for(let colName of colNamesArr) { + let col = document.createElement("th"); + col.classList.add("text-center"); + col.innerText = colName; + headerRow.appendChild(col); + } + + headerRow.style.height = "25px"; + thead.appendChild(headerRow); + + return table; + } + + $scope.createDatesFromIndicatorDates = function(indicatorDates) { + let datesAsMs = []; + for (let i=0; i < indicatorDates.length; i++){ + // year-month-day + var dateComponents = indicatorDates[i].split("-"); + datesAsMs.push(kommonitorDataExchangeService.dateToTS(new Date(Number(dateComponents[0]), Number(dateComponents[1]) - 1, Number(dateComponents[2])))); + } + return datesAsMs; + } + + function prettifyDateSliderLabels (dateAsMs) { + return kommonitorDataExchangeService.tsToDate_withOptionalUpdateInterval(dateAsMs, $scope.selectedIndicator.metadata.updateInterval); + } + + $scope.onChangeDateSliderInterval = function() { + $scope.loadingData = true; + // needed to tell angular something has changed + $timeout(function(){ + $scope.$digest(); + }); + // setup all pages with the new timeseries + let values = $scope.getFormattedDateSliderValues(true); + // prepare diagrams again for most recent timestamp of slider and for whole timeseries (changes). + let classifyUsingWholeTimeseries = false; + let isTimeseries = true; + $scope.prepareDiagrams($scope.selectedIndicator, $scope.selectedSpatialUnit, values.to, classifyUsingWholeTimeseries, isTimeseries, values.from, values.to); + isTimeseries = false; + classifyUsingWholeTimeseries = true; + $scope.prepareDiagrams($scope.selectedIndicator, $scope.selectedSpatialUnit, values.to, classifyUsingWholeTimeseries, isTimeseries, undefined, undefined); + + // set dates on all pages according to new slider values + for(let page of $scope.template.pages) { + let dateEl = page.pageElements.find( el => { + return el.type === "dataTimestamp-landscape" || el.type === "dataTimeseries-landscape" + }); + + if(dateEl.type === "dataTimestamp-landscape") { + dateEl.text = values.to; + } + if(dateEl.type === "dataTimeseries-landscape") { + dateEl.text = values.from + " - " + values.to; + } + } + + function updateDiagrams() { + if($scope.diagramsPrepared) { + $interval.cancel(updateDiagramsInterval); // code below still executes once + } else { + return; + } + // diagrams are prepared, but dom has to be updated first, too + $timeout(async function() { + await $scope.initializeAllDiagrams(); + $scope.loadingData = false; + }) + + } + + let updateDiagramsInterval = $interval(updateDiagrams, 0, 100) + } + + $scope.getFormattedDateSliderValues = function(includeInBetweenValues) { + if(!$scope.dateSlider) + throw new Error("Tried to get dateslider values but dateslider was not defined."); + + let slider = $scope.dateSlider + let from = new Date(slider.result.from_value); + let to = new Date(slider.result.to_value); + + let inBetweenDates; + if(includeInBetweenValues) { + // get all valid timestamps for this spatial unit that lie in between from and to + let validTimestamps = getValidTimestampsForSpatialUnit( $scope.selectedSpatialUnit ); + inBetweenDates = validTimestamps.filter( el => { + let date = new Date(el); + date.setHours(0); // remove time-offset...TODO is there a better way? + return from < date && date < to; + }); + } + // append zeros to month and year if needed + let month = (from.getMonth()+1) // months start with 0 + let day = from.getDate(); + from = from.getFullYear() + "-"; + if( month < 10) from += "0"; + from += month + "-"; + if( day < 10) from += "0"; + from += day; + + month = (to.getMonth()+1) // months start with 0 + day = to.getDate(); + to = to.getFullYear() + "-"; + if( month < 10) to += "0"; + to += month + "-"; + if( day < 10) to += "0"; + to += day; + + let result = { + from: from, + to: to, + dates: includeInBetweenValues ? [from, ...inBetweenDates, to] : [] // all dates in the interval, including "from" and "to" + } + + return result; + } + + + $scope.initializeDateRangeSlider = function(availableDates, min, max) { + + if($scope.dateSlider){ + $scope.dateSlider.destroy(); + } + + let domNode = document.getElementById("reporting-dateSlider"); + + while (domNode.hasChildNodes()) { + domNode.removeChild(domNode.lastChild); + } + + //let mostRecentDate = availableDates[availableDates.length - 1]; + //let selectedDate = availableDates[availableDates.length - 1]; + + let datesAsMs = $scope.createDatesFromIndicatorDates(availableDates); + + // new Date() uses month between 0-11! + $("#reporting-dateSlider").ionRangeSlider({ + skin: "big", + type: "double", + grid: true, + values: datesAsMs, + from: 0, + to: availableDates.length-1, // index + force_edges: true, + prettify: prettifyDateSliderLabels, + onFinish: $scope.onChangeDateSliderInterval + }); + + let dateSlider = $("#reporting-dateSlider").data("ionRangeSlider"); + // make sure that the handles are properly set + let minIdx = 0; + let maxIdx = availableDates.length-1; + if(typeof(min) !== "undefined") + minIdx = availableDates.indexOf(min) + if(typeof(max) !== "undefined") + maxIdx = availableDates.indexOf(max); + + dateSlider.update({ + from: minIdx, + to: maxIdx + }); + return dateSlider; + } + + $scope.onChangeShowMapLabels = function() { + + for(let i=0; i<$scope.template.pages.length; i++) { + let map = document.querySelector("#reporting-addIndicator-page-" + i +"-map") + if(!map) { + continue; // no map on current page + } + + let instance = echarts.getInstanceByDom(map); + let options = instance.getOption(); + options.series[0].label.show = $scope.showMapLabels; + options.series[0].select.label.show = $scope.showMapLabels; + for(let item of options.series[0].data) { + if(typeof item.label === "undefined") { + item.label = {}; + } + item.label.show = $scope.showMapLabels; + } + instance.setOption(options, { + replaceMerge: ['series'] + }); + } + } + + $scope.validateConfiguration = function() { + // indicator has to be selected (unless template is reachability) + // at least one area has to be selected (unless template is reachability) + // for timestamps: + // at least one timestamp has to be selected + // for timeseries + // slider position must include at least two timestamps + let isIndicatorSelected = false; + let isAreaSelected = false; + let isTimestampSelected = false; + + if(!$scope.template) { + return false; + } + + if($scope.selectedIndicator || $scope.template.name === "A4-landscape-reachability") { + isIndicatorSelected = true; + } + if($scope.selectedAreas.length >= 1 || $scope.template.name === "A4-landscape-reachability") { + isAreaSelected = true; + } + + if( ($scope.template.name === "A4-landscape-timestamp" || $scope.template.name === "A4-landscape-reachability" ) && + $scope.selectedTimestamps.length >= 1) { + isTimestampSelected = true; + } + + if($scope.template.name === "A4-landscape-timeseries") { + if(!$scope.dateSlider) { + return false; + } + if( !$scope.availableFeaturesBySpatialUnit[ $scope.selectedSpatialUnit.spatialUnitName]) { + return false; + } + let timeseries = $scope.getFormattedDateSliderValues(true).dates; + if(timeseries.length >= 1) { + isTimestampSelected = true; // reuse variable here + } + } + + if(isIndicatorSelected && isAreaSelected && isTimestampSelected && !$scope.loadingData) { + return true; + } else { + return false; + } + + } + + $scope.transformSeriesDataToPercentageChange = function(dataArr) { + // we need at least two timestamps + if(dataArr.length <= 1) { + let error = new Error("Can not calculate percentage change from a single timestamp.") + kommonitorDataExchangeService.displayMapApplicationError(error.message); + } + let result = []; + for(let i=1; i obj && obj[level], obj) + } + } +]}) \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingIndicatorAdd/reporting-indicator-add.module.js b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingIndicatorAdd/reporting-indicator-add.module.js index d0e943e71..f341b1ce1 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingIndicatorAdd/reporting-indicator-add.module.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingIndicatorAdd/reporting-indicator-add.module.js @@ -1 +1,3 @@ -angular.module('reportingIndicatorAdd', ['excaliburDualList', 'ngSanitize']); \ No newline at end of file +"use strict"; +angular.module('reportingIndicatorAdd', ['excaliburDualList', 'ngSanitize']); +//# sourceMappingURL=reporting-indicator-add.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingIndicatorAdd/reporting-indicator-add.module.js.map b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingIndicatorAdd/reporting-indicator-add.module.js.map new file mode 100644 index 000000000..62698fc16 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingIndicatorAdd/reporting-indicator-add.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"reporting-indicator-add.module.js","sourceRoot":"","sources":["reporting-indicator-add.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,uBAAuB,EAAE,CAAC,mBAAmB,EAAE,YAAY,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingIndicatorAdd/reporting-indicator-add.module.ts b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingIndicatorAdd/reporting-indicator-add.module.ts new file mode 100644 index 000000000..d0e943e71 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingIndicatorAdd/reporting-indicator-add.module.ts @@ -0,0 +1 @@ +angular.module('reportingIndicatorAdd', ['excaliburDualList', 'ngSanitize']); \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingOverview/reporting-overview.component.js b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingOverview/reporting-overview.component.js index 7d2946af2..8e95e7c88 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingOverview/reporting-overview.component.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingOverview/reporting-overview.component.js @@ -1,1840 +1,1708 @@ +"use strict"; angular.module('reportingOverview').component('reportingOverview', { - templateUrl : "components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingOverview/reporting-overview.template.html", - controller : ['$scope', '__env', '$timeout', '$http', 'kommonitorDataExchangeService', 'kommonitorDiagramHelperService', - function ReportingOverviewController($scope, __env, $timeout, $http, kommonitorDataExchangeService, kommonitorDiagramHelperService) { - - /* - { - indicators: [ - {...}, - {...}, - ... - ], - pages: [ - { - indicatorName: ... // e.g for sorting pages - spatialUnitName: .... - pageElements: [...] - }, - {...}, - ... - ], - template: {...} // clean version of the template, without indicator data - } - */ - $scope.config = { - templateSections: [ - // { - // indicator: "", - // poiLayer: "" - // } - ], - pages: [], - template: {} - }; - $scope.loadingData = false; - $scope.echartsImgPixelRatio = 2; - - $scope.initialize = function(data) { - let configFileSelected = data[0]; - data = data[1]; - if(configFileSelected) { - $scope.importConfig(data); - } else { - $scope.config.template = JSON.parse(JSON.stringify(data)); - $scope.config.pages = $scope.config.template.pages; - } - let deviceScreenDpi = calculateScreenDpi(); - $scope.pxPerMilli = deviceScreenDpi / 25.4 // /2.54 --> cm, /10 --> mm - } - - $scope.sortableConfig = { - onEnd: function (e) { - // nothing for now, config elements get reordered automatically - } - }; - - $scope.$on("reportingInitializeOverview", function(event, data) { - // data is a nested array at this point [ [ { template object } ] ] - $scope.initialize(data); - }) - - $scope.onConfigureNewIndicatorClicked = function() { - $scope.$emit('reportingConfigureNewIndicatorClicked', [$scope.config.template]); - } - - $scope.onConfigureNewPoiLayerClicked = function() { - $scope.$emit('reportingConfigureNewPoiLayerClicked', [$scope.config.template]); - } - - $scope.onBackToTemplateSelectionClicked = function() { - $scope.$emit('reportingBackToTemplateSelectionClicked') - } - - $scope.$on("reportingIndicatorConfigurationCompleted", function(event, data) { - $scope.loadingData = true; - let [indicator, template] = data; - - let templateSection = { - indicatorName: indicator ? indicator.indicatorName : "", - indicatorId: indicator ? indicator.indicatorId : "", - poiLayerName: "", - spatialUnitName: template.spatialUnitName, - absoluteLabelPositions: template.absoluteLabelPositions, - echartsRegisteredMapNames: template.echartsRegisteredMapNames, - echartsMaps: [] - } - for(let page of template.pages) { - page.templateSection = templateSection; - } - // remove the placeholder template if this is the first section that gets added) - $scope.config.pages = $scope.config.pages.filter( page => { - if(page.hasOwnProperty("templateSection")) { - return page.templateSection.hasOwnProperty("indicatorName"); - } else { - return false; - } - }); - // append to array - $scope.config.pages.push(...template.pages); - - $scope.config.templateSections.push(templateSection); - - // setup pages after dom exists - // at this point we still have all the echarts maps registered - $scope.setupNewPages($scope.config.templateSections.at(-1)); - }); - - $scope.$on("reportingPoiLayerConfigurationCompleted", function(event, data) { - $scope.loadingData = true; - // add indicator to 'added indicators' - let [poiLayer, indicator, template] = data; - - let templateSection = { - indicatorName: indicator ? indicator.indicatorName : "", - indicatorId: indicator ? indicator.indicatorId : "", - poiLayerName: poiLayer.datasetName, - spatialUnitName: template.spatialUnitName, - absoluteLabelPositions: template.absoluteLabelPositions, - echartsRegisteredMapNames: template.echartsRegisteredMapNames, - echartsMaps: [], - isochronesRangeType: template.isochronesRangeType, - isochronesRangeUnits: template.isochronesRangeUnits - } - for(let page of template.pages) { - page.templateSection = templateSection; - } - // remove all pages without property poiLayerName (clean template) - $scope.config.pages = $scope.config.pages.filter( page => { - if(page.hasOwnProperty("templateSection")) { - return page.templateSection.hasOwnProperty("poiLayerName"); - } else { - return false; - } - }); - // append to array - $scope.config.pages.push(...template.pages); - $scope.config.templateSections.push(templateSection); - - // setup pages after dom exists - // at this point we still have all the echarts maps registered - $scope.setupNewPages($scope.config.templateSections.at(-1)); - }); - - $scope.removeTemplateSection = function(idx) { - $scope.config.templateSections.splice(idx, 1) - - // show empty template if this was the last indicator - if($scope.config.templateSections.length === 0) { - $scope.config.pages = $scope.config.template.pages; - } - } - - - $scope.$watchCollection('config.templateSections', function(newVal, oldVal) { - - if(newVal.length < oldVal.length) { // removed - // find removed section - let difference = oldVal - .filter(x => !newVal.includes(x)) - .concat(newVal.filter(x => !oldVal.includes(x))); - - let removedSection = difference[0]; - // remove all pages for that section - $scope.config.pages = $scope.config.pages.filter( page => { - if(!page.hasOwnProperty("templateSection")) return true; // for placeholder - - return page.templateSection.indicatorId !== removedSection.indicatorId || - page.templateSection.spatialUnitId !== removedSection.spatialUnitId || - page.templateSection.poiLayerName !== removedSection.poiLayerName - }); - } - if(newVal.length === oldVal.length) { // order changed - // sort pages according to newVal - let sorted = []; - for(let section of newVal) { - for(let page of $scope.config.pages) { - if(page.templateSection.indicatorId === section.indicatorId && - page.templateSection.spatialUnitId === section.spatialUnitId && - page.templateSection.poiLayerName === section.poiLayerName) { - - sorted.push(page); - } - } - } - $scope.config.pages = sorted; - } - }); - - - - - $scope.setupNewPages = function(templateSection) { - - $timeout(async function(templateSection) { - if(!templateSection.poiLayerName) { - - // for indicator without poi layer - let indicatorId = templateSection.indicatorId; - let spatialUnit, featureCollection, features, geoJSON; - let isFirstPageToAdd = true; - for(let [idx, page] of $scope.config.pages.entries()) { - - if(page.templateSection.indicatorId !== indicatorId) { - continue; // only do changes to new pages - } else { - // Indicator and spatial unit are the same for all added pages - // We only need to query features on the first page that we add - if(isFirstPageToAdd) { - isFirstPageToAdd = false; - spatialUnit = await $scope.getSpatialUnitByIndicator(indicatorId, page.templateSection.spatialUnitName) - featureCollection = await $scope.queryFeatures(indicatorId, spatialUnit); - features = $scope.createLowerCaseNameProperty(featureCollection.features); - geoJSON = { features: features }; - - } - } - - let pageDom = document.querySelector("#reporting-overview-page-" + idx); - for(let pageElement of page.pageElements) { - // usually each type is included only once per page, but there is an exception for linecharts in area specific part of timeseries template - // for now we more or less hardcode this, but it might have to change in the future - let pElementDom; - if(pageElement.type === "linechart") { - let arr = pageDom.querySelectorAll(".type-linechart"); - if(pageElement.showPercentageChangeToPrevTimestamp) { - pElementDom = arr[1]; - } else { - pElementDom = arr[0]; - } - } else { - pElementDom = pageDom.querySelector("#reporting-overview-page-" + idx + "-" + pageElement.type) - } - - // recreate boxplots, itemNameFormatter did not get transferred - if(pageElement.type === "linechart" && pageElement.showBoxplots) { - let xAxisLabels = pageElement.echartsOptions.xAxis[0].data; - pageElement.echartsOptions.dataset[1].transform.config = { - itemNameFormatter: function (params) { - return xAxisLabels[params.value]; - } - } - } - - if(pageElement.type === "map" || pageElement.type === "barchart" || pageElement.type === "linechart") { - let instance = echarts.init( pElementDom ); - - - if(pageElement.type === "map") { - - if(page.area && page.area.length) { - // at this point we have not yet set echarts options, so we provide them as an extra parameter - $scope.filterMapByArea(instance, pageElement.echartsOptions, page.area, geoJSON.features) - } else { - // recreate label positions - pageElement.echartsOptions.labelLayout = function(feature) { - // Set fixed position for labels that were previously dragged by user - // For all other labels try to avoid overlaps - let names = page.templateSection.absoluteLabelPositions.map(el=>el.name) - let text = feature.text.split("\n")[0] // area name is the first line - if(names.includes(text)) { - let idx = names.indexOf(text) - return { - x: page.templateSection.absoluteLabelPositions[idx].x, - y: page.templateSection.absoluteLabelPositions[idx].y, - draggable: false // Don't allow label dragging in overview, we could have different spatial units here - } - } else { - return { - moveOverlap: 'shiftY', - x: feature.rect.x + feature.rect.width / 2, - draggable: false - } - } - } - } - } - instance.setOption(pageElement.echartsOptions) - } - - if(pageElement.type === "overallAverage") { - pageDom.querySelector(".type-overallAverage").style.border = "none"; - } - - if(pageElement.type === "selectionAverage") { - pageDom.querySelector(".type-selectionAverage").style.border = "none"; - } - - if(pageElement.type === "mapLegend") { - pageElement.isPlaceholder = false; - pageDom.querySelector(".type-mapLegend").style.display = "none"; - } - - if(pageElement.type === "overallChange") { - let wrapper = pageDom.querySelector(".type-overallChange") - wrapper.style.border = "none"; - wrapper.style.left = "670px"; - wrapper.style.width = "130px"; - wrapper.style.height = "100px"; - } - - if(pageElement.type === "selectionChange") { - let wrapper = pageDom.querySelector(".type-selectionChange") - wrapper.style.border = "none"; - wrapper.style.left = "670px"; - wrapper.style.width = "130px"; - wrapper.style.height = "100px"; - } - - if(pageElement.type === "datatable") { - $scope.createDatatablePage(pElementDom, pageElement); - } - } - } - $scope.loadingData = false; - $timeout(function(){ - $scope.$digest(); - }); - } else { - $scope.handleSetupNewPagesForReachability(templateSection) - } - }, 0, false, templateSection); - } - - - - $scope.handleSetupNewPagesForReachability = async function(templateSection) { - let poiLayerName = templateSection.poiLayerName; - let spatialUnit, featureCollection, features, geoJSON, indicatorId; - // if indicator was chosen - if( templateSection.indicatorId) { - indicatorId = templateSection.indicatorId; - } - let isFirstPageToAdd = true; - for(let [idx, page] of $scope.config.pages.entries()) { - - if(page.templateSection.poiLayerName !== poiLayerName) { - continue; // only do changes to new pages - } else { - // PoiLayer, Indicator and spatial unit are the same for all added pages - // We only need to query features on the first page that we add - if(isFirstPageToAdd) { - isFirstPageToAdd = false; - if(indicatorId) { - spatialUnit = await $scope.getSpatialUnitByIndicator(indicatorId, page.templateSection.spatialUnitName); - featureCollection = await $scope.queryFeatures(indicatorId, spatialUnit); - } else { - spatialUnit = await $scope.getSpatialUnitByName(page.templateSection.spatialUnitName); - featureCollection = await $scope.queryFeatures(undefined, spatialUnit); - } - - features = $scope.createLowerCaseNameProperty(featureCollection.features); - geoJSON = { features: features }; - - } - } - - let pageDom = document.querySelector("#reporting-overview-page-" + idx); - for(let pageElement of page.pageElements) { - let pElementDom = pageDom.querySelector("#reporting-overview-page-" + idx + "-" + pageElement.type) - - if(pageElement.type === "map") { - let instance = echarts.init( pElementDom ); - - if(page.area && page.area.length) { - // at this point we have not yet set echarts options, so we provide them as an extra parameter - $scope.filterMapByArea(instance, pageElement.echartsOptions, page.area, geoJSON.features) - } else { - // recreate label positions - pageElement.echartsOptions.labelLayout = function(feature) { - // Set fixed position for labels that were previously dragged by user - // For all other labels try to avoid overlaps - let names = page.templateSection.absoluteLabelPositions.map(el=>el.name) - let text = feature.text.split("\n")[0] // area name is the first line - if(names.includes(text)) { - let idx = names.indexOf(text) - return { - x: page.templateSection.absoluteLabelPositions[idx].x, - y: page.templateSection.absoluteLabelPositions[idx].y, - draggable: false // Don't allow label dragging in overview, we could have different spatial units here - } - } else { - return { - moveOverlap: 'shiftY', - x: feature.rect.x + feature.rect.width / 2, - draggable: false - } - } - } - } - - instance.setOption( pageElement.echartsOptions ) - - await $scope.initializeLeafletMap(page, pageElement, instance, spatialUnit) - } - } - } - $scope.loadingData = false; - $timeout(function(){ - $scope.$digest(); - }); - } - - $scope.initializeLeafletMap = async function(page, pageElement, map, spatialUnit) { - await $timeout(async function(page, pageElement, echartsMap, spatialUnit) { - let pageIdx = $scope.config.pages.indexOf(page); - let id = "reporting-overview-reachability-leaflet-map-container-" + pageIdx; - let pageDom = document.getElementById("reporting-overview-page-" + pageIdx); - let pageElementDom = document.getElementById("reporting-overview-page-" + pageIdx + "-map"); - let oldMapNode = document.getElementById(id); - if(oldMapNode) { - oldMapNode.remove(); - } - let div = document.createElement("div"); - div.id = id; - div.style.position = "absolute"; - div.style.left = pageElement.dimensions.left; - div.style.top = pageElement.dimensions.top; - div.style.width = pageElement.dimensions.width; - div.style.height = pageElement.dimensions.height; - div.style.zIndex = 10; - pageDom.appendChild(div); - let echartsOptions = echartsMap.getOption(); - - let leafletMap = L.map(div.id, { - zoomControl: false, - dragging: false, - doubleClickZoom: false, - boxZoom: false, - trackResize: false, - attributionControl: false, - // prevents leaflet form snapping to closest pre-defined zoom level. - // In other words, it allows us to set exact map extend by a (echarts) bounding box - zoomSnap: 0 - }); - - // from the docs, most of it is probably not needed - let screenshotterOptions = { - cropImageByInnerWH: true, // crop blank opacity from image borders - hidden: true, // hide screen icon - preventDownload: true, // prevent download on button click - domtoimageOptions: {}, // see options for dom-to-image - position: 'topleft', // position of take screen icon - screenName: 'screen', // string or function - hideElementsWithSelectors: ['.leaflet-control-container'], // by default hide map controls All els must be child of _map._container - mimeType: 'image/png', // used if format == image, - caption: null, // string or function, added caption to bottom of screen - captionFontSize: 15, - captionFont: 'Arial', - captionColor: 'black', - captionBgColor: 'white', - captionOffset: 5, - // callback for manually edit map if have warn: "May be map size very big on that zoom level, we have error" - // and screenshot not created - onPixelDataFail: async function({ node, plugin, error, mapPane, domtoimageOptions }) { - // Solutions: - // decrease size of map - // or decrease zoom level - // or remove elements with big distanses - // and after that return image in Promise - plugin._getPixelDataOfNormalMap - return plugin._getPixelDataOfNormalMap(domtoimageOptions) - } - } - - leafletMap.simpleMapScreenshoter = L.simpleMapScreenshoter(screenshotterOptions).addTo(leafletMap) - - // manually create a field for attribution so we can control the z-index. - let prevAttributionDiv = pageDom.querySelector(".map-attribution") - if(prevAttributionDiv) prevAttributionDiv.remove(); - let attrDiv = document.createElement("div") - attrDiv.classList.add("map-attribution") - attrDiv.style.position = "absolute"; - attrDiv.style.bottom = 0; - attrDiv.style.left = 0; - attrDiv.style.zIndex = 800; - let attrImg = await kommonitorDiagramHelperService.createReportingReachabilityMapAttribution(); - attrDiv.appendChild(attrImg); - pageElementDom.appendChild(attrDiv); - // also create the legend manually - let prevLegendDiv = pageDom.querySelector(".map-legend") - if(prevLegendDiv) prevLegendDiv.remove(); - let legendDiv = document.createElement("div") - legendDiv.classList.add("map-legend") - legendDiv.style.position = "absolute"; - legendDiv.style.bottom = 0; - legendDiv.style.right = 0; - legendDiv.style.zIndex = 800; - let isochronesRangeType = page.templateSection.isochronesRangeType; - let isochronesRangeUnits = page.templateSection.isochronesRangeUnits; - let legendImg = await kommonitorDiagramHelperService.createReportingReachabilityMapLegend(echartsOptions, spatialUnit, isochronesRangeType, isochronesRangeUnits); - legendDiv.appendChild(legendImg); - pageElementDom.appendChild(legendDiv) - - // we have the bbox stored in config - // pageElement.leafletBbox is invalid after export and import. Maybe because the prototype object gets removed... - // We create a new bounds object from the stored data - let bounds = L.latLngBounds(pageElement.leafletBbox._southWest, pageElement.leafletBbox._northEast); - leafletMap.fitBounds( bounds ); - - let osmLayer = new L.TileLayer.Grayscale("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", { - attribution: "Map data © OpenStreetMap contributors", - }); - osmLayer.addTo(leafletMap); - - // add leaflet map to pageElement in case we need it again later - pageElement.leafletMap = leafletMap; - - // can be used to check if positioning in echarts matches the one from leaflet - //let geoJsonLayer = L.geoJSON( $scope.geoJsonForReachability.features ) - //geoJsonLayer.addTo(leafletMap) - //let isochronesLayer = L.geoJSON( $scope.isochrones.features ) - //isochronesLayer.addTo(leafletMap); - - }, 0, true, page, pageElement, map, spatialUnit) - } - - $scope.getSpatialUnitByName = async function(spatialUnitName) { - let url; - url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/spatial-units" - // send request - return await $http({ - url: url, - method: "GET" - }).then(function successCallback(response) { - let spatialUnit = response.data.filter( el => { - return el.spatialUnitLevel === spatialUnitName; - }) - - if(spatialUnit.length === 1) - return spatialUnit[0] - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - $scope.loadingData = false; - kommonitorDataExchangeService.displayMapApplicationError(error); - console.error(error); - }); - } - - $scope.getSpatialUnitByIndicator = async function(indicatorId, spatialUnitName) { - let url; - url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/indicators/" + indicatorId; - // send request - return await $http({ - url: url, - method: "GET" - }).then(function successCallback(response) { - let spatialUnit = response.data.applicableSpatialUnits.filter( el => { - return el.spatialUnitName === spatialUnitName; - }) - if(spatialUnit.length === 1) return spatialUnit[0]; - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - $scope.loadingData = false; - kommonitorDataExchangeService.displayMapApplicationError(error); - console.error(error); - }); - } - - - $scope.filterMapByArea = function(echartsInstance, echartsInstanceOptions, areaName, allFeatures) { - let mapName = echartsInstanceOptions.series[0].map; - // filter shown areas if we are in the area-specific part of the template - let features = allFeatures.filter ( el => { - return el.properties.name === areaName - }); - - echarts.registerMap(mapName, { features: features } ) - echartsInstance.setOption(echartsInstanceOptions) // set same options, but this updates the map - } - - - $scope.createDatatableSkeleton = function(colNamesArr) { - - let table = document.createElement("table"); - table.classList.add("table-striped") - table.classList.add("table-bordered") - - let thead = document.createElement("thead"); - let tbody = document.createElement("tbody"); - table.appendChild(thead); - table.appendChild(tbody); - - let headerRow = document.createElement("tr"); - - for(let colName of colNamesArr) { - let col = document.createElement("th"); - col.classList.add("text-center"); - col.innerText = colName; - headerRow.appendChild(col); - } - - headerRow.style.height = "25px"; - thead.appendChild(headerRow); - - return table; - } - - - $scope.createDatatablePage = function(pElementDom, pageElement) { - pElementDom.innerHTML = ""; - pElementDom.style.border = "none"; // hide dotted border from outer dom element - pElementDom.style.justifyContent = "flex-start"; // align table at top instead of center - // add data - let table = $scope.createDatatableSkeleton(pageElement.columnNames); - let tbody = table.querySelector("tbody") - // tabledata is a nested array with one sub-array per row - for(let row of pageElement.tableData) { - let tr = document.createElement("tr"); - tr.style.height = "25px"; - for(let i=0; i 0) { - pageElement.src = communeLogoSrc; - } - } - } - - $scope.config.template = config.template; - $scope.config.pages = config.pages; - $scope.config.templateSections = config.templateSections; - - // register echarts maps - for(let section of $scope.config.templateSections) { - for(let mapName of section.echartsRegisteredMapNames) { - if($scope.config.template.name === "A4-landscape-reachability") { - if(!mapName.includes(section.spatialUnitName)) { - continue; - } - if(!mapName.includes("_isochrones")) { - let geoJson = section.echartsMaps.filter( map => map.name === section.poiLayerName)[0].geoJson - echarts.registerMap(mapName, geoJson) - } else { - let geoJson = section.echartsMaps.filter( map => map.name === mapName)[0].geoJson - echarts.registerMap(mapName, geoJson) - } - } else { - if(!mapName.includes(section.spatialUnitName)) { - continue; - } - let geoJson = section.echartsMaps[0].geoJson - echarts.registerMap(mapName, geoJson) - } - } - } - for(let page of $scope.config.pages) { - for(let pageElement of page.pageElements) { - if(pageElement.type === "map" && pageElement.hasOwnProperty("echartsMaps")) { - for(let map of pageElement.echartsMaps) { - echarts.registerMap(map.name, map.geoJson) - } - } - } - } - $timeout(function(){ - $scope.$digest(); - }); - - for(let section of $scope.config.templateSections) { - $scope.setupNewPages(section); - } - } catch (error) { - console.error(error); - $scope.loadingData = false; - kommonitorDataExchangeService.displayMapApplicationError(error.message); - } - } - - $scope.exportConfig = function() { - try { - let jsonToExport = {}; - - let temp = JSON.stringify( $scope.config.pages, function(key, value) { - // Leaflet map contains cyclic object references so we have to remove it. - // We have to initialize the map again on import based on the stored boundingbox - if(key === "leafletMap") { - return undefined; - } else { - return value; - } - }) - - jsonToExport.pages = JSON.parse( temp ) - jsonToExport.template = angular.fromJson(angular.toJson( $scope.config.template )); - jsonToExport.templateSections = $scope.config.templateSections; - - // Only store commune logo once (in first page) - // It is base64 encoded and adds quite a bit to the file size - for(let [idx, page] of jsonToExport.pages.entries()) { - for(let pageElement of page.pageElements) { - if(pageElement.type === "communeLogo-landscape" && idx > 0) { - pageElement.src = ""; - } - } - } - - for(let section of jsonToExport.templateSections) { - let mapNames = [...new Set(section.echartsRegisteredMapNames)] - if($scope.config.template.name === "A4-landscape-reachability") { - let mapAdded = false; - for(let [idx, name] of mapNames.entries()) { - if(!name.includes(section.spatialUnitName)) { - continue; - } - // store all isochrones - if(name.includes("_isochrones")) { - let map = echarts.getMap(name) - section.echartsMaps.push({ - name: name, - geoJson: map.geoJson - }) - } - // First map with the correct spatial unit - // All other maps have the same geojson, so we only store them once - if(!mapAdded && name.includes(section.poiLayerName)) { - let map = echarts.getMap(mapNames[idx]) - section.echartsMaps.push({ - name: section.poiLayerName, - geoJson: map.geoJson - }) - mapAdded = true; - } - - } - } else { - for(let [idx, name] of mapNames.entries()) { - if(!name.includes(section.spatialUnitName)) { - continue; - } else { - // First map with the correct spatial unit - let map = echarts.getMap(mapNames[idx]) - section.echartsMaps.push({ - name: mapNames[idx], - geoJson: map.geoJson - }); - } - } - } - } - - let jsonString = "data:text/json;charset=utf-8," + encodeURIComponent( angular.toJson(jsonToExport) ); - // to download json, a DOM element is created, clicked and removed - let downloadAnchorNode = document.createElement('a'); - downloadAnchorNode.setAttribute("href", jsonString); - downloadAnchorNode.setAttribute("download", getCurrentDateAndTime() + "_KomMonitor-Reporting-Konfiguration.json"); - document.body.appendChild(downloadAnchorNode); // required for firefox - downloadAnchorNode.click(); - downloadAnchorNode.remove(); - } catch (error) { - kommonitorDataExchangeService.displayMapApplicationError(error.message); - console.error(error) - } - - } - - function getCurrentDateAndTime() { - let date = new Date(); - let year = date.getFullYear().toString(); - let month = date.getMonth() + 1; - let day = date.getDate(); - let time = date.getHours(); - let minutes = date.getMinutes(); - let seconds = date.getSeconds(); - let now = "".concat(year, "-", month, "-", day, "_", time, "-", minutes, "-", seconds); - return now; - } - - - function getIndicatorByName(indicatorName) { - let result; - for(let indicator of kommonitorDataExchangeService.availableIndicators) { - if(indicator.indicatorName === indicatorName) { - result = indicator; - break; - } - } - if(result) { - return result - } else { - throw new Error("No indicator could be found for name: " + indicatorName) - } - } - - $scope.queryFeatures = async function(indicatorId, spatialUnit) { - // build request - // query different endpoints depending on if we have an indicator or not - let url; - if(!indicatorId) { - let date = spatialUnit.metadata.lastUpdate.split("-") - let year = date[0] - let month = date[1] - let day = date[2] - url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + - "/spatial-units/" + spatialUnit.spatialUnitId + "/" + year + "/" + month + "/" + day; - } else { - url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + - "/indicators/" + indicatorId + "/" + spatialUnit.spatialUnitId; - } - // send request - $scope.loadingData = true; - return await $http({ - url: url, - method: "GET" - }).then(function successCallback(response) { - $scope.loadingData = false; - return response.data; - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - $scope.loadingData = false; - kommonitorDataExchangeService.displayMapApplicationError(error); - console.error(error); - }); - } - - $scope.createLowerCaseNameProperty = function(features) { - for(let feature of features) { - if(feature.hasOwnProperty("properties")) { - if(!feature.properties.hasOwnProperty("name")) { - let featureName = feature.properties.NAME; - feature.properties.name = featureName; - } - } - } - return features; - } - - $scope.$on("reportingGenerateReport", function(event, format) { - $scope.generateReport(format); - }); - - $scope.generateReport = async function(format) { - $scope.loadingData = true; - - - - try { - format === "pdf" && await $scope.generatePdfReport(); - format === "docx" && await $scope.generateWordReport(); - format === "zip" && await $scope.generateZipFolder(); - } catch (error) { - $scope.loadingData = false; - console.error(error); - kommonitorDataExchangeService.displayMapApplicationError(error.message); - } - } - - $scope.generatePdfReport = async function() { - - // create pdf document - let doc = new jsPDF({ - margin: 0, - unit: 'mm', - format: 'a4', - orientation: "landscape" - }); - - // general settings - let fontName = "Helvetica"; - doc.setDrawColor(148, 148, 148); - doc.setFont(fontName, "normal", "normal"); // name, normal/italic, fontweight - - for(let [idx, page] of $scope.config.pages.entries()) { - - if(idx > 0) { - doc.addPage(); - } - - let pageDom = document.querySelector("#reporting-overview-page-" + idx); - for(let pageElement of page.pageElements) { - - let pElementDom; - if(pageElement.type === "linechart") { - let arr = pageDom.querySelectorAll(".type-linechart"); - if(pageElement.showPercentageChangeToPrevTimestamp) { - pElementDom = arr[1]; - } else { - pElementDom = arr[0]; - } - } else { - pElementDom = pageDom.querySelector("#reporting-overview-page-" + idx + "-" + pageElement.type) - } - // convert dimensions to millimeters here - // that way we don't have to use pxToMilli everywhere we use coordinates in the pdf - let pageElementDimensions = {} - pageElementDimensions.top = pageElement.dimensions.top && pxToMilli(pageElement.dimensions.top); - pageElementDimensions.bottom = pageElement.dimensions.bottom && pxToMilli(pageElement.dimensions.bottom); - pageElementDimensions.left = pageElement.dimensions.left && pxToMilli(pageElement.dimensions.left); - pageElementDimensions.right = pageElement.dimensions.right && pxToMilli(pageElement.dimensions.right); - pageElementDimensions.width = pageElement.dimensions.width && pxToMilli(pageElement.dimensions.width); - pageElementDimensions.height = pageElement.dimensions.height && pxToMilli(pageElement.dimensions.height); - - // TODO some cases could be merged, but it's better to do that later when stuff works - switch(pageElement.type) { - case "indicatorTitle-landscape": { - // Css takes the top-left edge of the element by default. - // doc.text takes left-bottom, so we ass baseline "top" to achieve the same behavior in jspdf. - doc.setFont(fontName, "Bold") - doc.text(pageElement.text, pageElementDimensions.left, pageElementDimensions.top, { baseline: "top" }); - doc.setFont(fontName, "normal", "normal") - break; - } - case "communeLogo-landscape": { - // only add logo if one was selected - if(pageElement.src && pageElement.src.length) { - doc.addImage(pageElement.src, "JPEG", pageElementDimensions.left, pageElementDimensions.top, - pageElementDimensions.width, pageElementDimensions.height, "", 'MEDIUM'); - } - break; - } - case "dataTimestamp-landscape": { - doc.text(pageElement.text, pageElementDimensions.left, pageElementDimensions.top, { baseline: "top" }) - break; - } - case "dataTimeseries-landscape": { - doc.text(pageElement.text, pageElementDimensions.left, pageElementDimensions.top, { baseline: "top" }) - break; - } - case "reachability-subtitle-landscape": { - doc.text(pageElement.text, pageElementDimensions.left, pageElementDimensions.top, { baseline: "top" }) - break; - } - case "footerHorizontalSpacer-landscape": { - let x1, x2, y1, y2; - x1 = pageElementDimensions.left; - x2 = pageElementDimensions.left + pageElementDimensions.width; - y1 = pageElementDimensions.top; - y2 = pageElementDimensions.top; - doc.line(x1, y1, x2, y2); - break; - } - case "footerCreationInfo-landscape": { - doc.text(pageElement.text, pageElementDimensions.left, pageElementDimensions.top, { baseline: "top" }) - break; - } - case "pageNumber-landscape": { - let text = "Seite " + (idx+1); - doc.text(text, pageElementDimensions.left, pageElementDimensions.top, { baseline: "top" }) - break; - } - // template-specific elements - case "map": { - let instance = echarts.getInstanceByDom(pElementDom) - let imageDataUrl = instance.getDataURL( {pixelRatio: $scope.echartsImgPixelRatio} ) - - if($scope.config.template.name === "A4-landscape-reachability") { - try { - imageDataUrl = await $scope.createReachabilityMapImage(pageDom, pageElement, imageDataUrl) - } catch(error) { - $scope.loadingData = false; - kommonitorDataExchangeService.displayMapApplicationError(error); - console.error(error); - } - } - doc.addImage(imageDataUrl, "PNG", pageElementDimensions.left, pageElementDimensions.top, - pageElementDimensions.width, pageElementDimensions.height, "", 'MEDIUM'); - break; - } - // case "mapLegend" can be ignored since it is included in the map if needed - case "overallAverage": - case "selectionAverage": { - let x, y, width, height; - x = pageElementDimensions.left; - y = pageElementDimensions.top; - width = pageElementDimensions.width; - height = pageElementDimensions.height; - doc.rect(x, y, width, height); - let avgType = pageElement.type === "overallAverage" ? "Gesamtstadt" : "Selektion" - let text = "Durchschnitt\n" + avgType + ":\n" + pageElement.text.toString() - doc.text(text, pageElementDimensions.left + pxToMilli(5), pageElementDimensions.top + pxToMilli(5), { baseline: "top" }); - break; - } - case "overallChange": - case "selectionChange": { - let x = pxToMilli(670); - let y = pageElementDimensions.top; - let width = pxToMilli(130); - let height = pxToMilli(80); - doc.rect(x, y, width, height); - let changeType = pageElement.type === "overallChange" ? "Gesamtstadt" : "Selektion" - let text = "Durchschnittliche\nVeränderung\n" + changeType + ":\n" + pageElement.text.toString() - doc.text(text, x + pxToMilli(5), y + pxToMilli(5), { baseline: "top" }); - break; - } - case "barchart": { - let instance = echarts.getInstanceByDom(pElementDom) - let base64String = instance.getDataURL( {pixelRatio: $scope.echartsImgPixelRatio} ) - doc.addImage(base64String, "PNG", pageElementDimensions.left, pageElementDimensions.top, - pageElementDimensions.width, pageElementDimensions.height, "", 'MEDIUM'); - break; - } - case "linechart": { - let instance = echarts.getInstanceByDom(pElementDom) - let base64String = instance.getDataURL( {pixelRatio: $scope.echartsImgPixelRatio} ) - doc.addImage(base64String, "PNG", pageElementDimensions.left, pageElementDimensions.top, - pageElementDimensions.width, pageElementDimensions.height, "", 'MEDIUM'); - break; - } - case "textInput": { - doc.text(pageElement.text, pageElementDimensions.left, pageElementDimensions.top, { - baseline: "top", - maxWidth: pageElementDimensions.width - }) - break; - } - case "datatable": { - doc.autoTable({ - html: "#reporting-overview-page-" + idx + "-" + pageElement.type + " table", - startY: pageElementDimensions.top, - tableWidth: "wrap", - margin: {left: pageElementDimensions.left}, - theme: "grid", - //headStyles: { - // fillColor: false, // transparent - // textColor: [0, 0, 0], - //} - }) - break; - } - } - } - } - - //doc.output("dataurlnewwindow") - let now = getCurrentDateAndTime(); - doc.save(now + "_KomMonitor-Report.pdf"); - $scope.loadingData = false; - $timeout(function(){ - $scope.$digest(); - }); - } - - - $scope.generateZipFolder = async function() { - // creates a zip folder containing all echarts files - let zip = new JSZip(); - - // screenshot map attribution and legend only once per section - for(let [idx, page] of $scope.config.pages.entries()) { - - let pageDom = document.querySelector("#reporting-overview-page-" + idx); - for(let pageElement of page.pageElements) { - if(pageElement.type === "map" || pageElement.type === "barchart" || pageElement.type === "linechart") { - let pElementDom; - if(pageElement.type === "linechart") { - let arr = pageDom.querySelectorAll(".type-linechart"); - if(pageElement.showPercentageChangeToPrevTimestamp) { - pElementDom = arr[1]; - } else { - pElementDom = arr[0]; - } - } else { - pElementDom = pageDom.querySelector("#reporting-overview-page-" + idx + "-" + pageElement.type) - } - let instance = echarts.getInstanceByDom(pElementDom); - let imageDataUrl = instance.getDataURL({ - type: "png", - pixelRatio: $scope.echartsImgPixelRatio - }); - - if($scope.config.template.name === "A4-landscape-reachability") { - try { - imageDataUrl = await $scope.createReachabilityMapImage(pageDom, pageElement, imageDataUrl) - } catch(error) { - $scope.loadingData = false; - kommonitorDataExchangeService.displayMapApplicationError(error); - console.error(error); - } - } - - let filename = "Seite_" + (idx+1) + "_" + pageElement.type + ".png"; - if(pageElement.type === "linechart" && pageElement.showPercentageChangeToPrevTimestamp) { - // two elements with same type on one page - // use a different filename for one of them so we don't overwrite the other image - filename = filename.replace(".png", "-proz.Veraenderung.png"); - } - - zip.file(filename, dataURItoBlob(imageDataUrl), ""); - } - } - } - - let zipFileName = getCurrentDateAndTime() + "_Kommonitor-Report-Grafiken"; - zip.generateAsync({type:"blob"}).then(function(content) { - saveAs(content, zipFileName + ".zip"); - $scope.loadingData = false; - $timeout(function(){ - $scope.$digest(); - }); - }); - } - - let sections = []; // one section per page for now, since this is an easy way to create page breaks - - $scope.generateWordReport = async function() { - // see docx documentation for more info about the format: - // https://docx.js.org/#/?id=basic-usage - - let font = "Calibri"; - - for(let [idx, page] of $scope.config.pages.entries()) { - - let paragraphs = []; - let pageDom = document.querySelector("#reporting-overview-page-" + idx); - for(let pageElement of page.pageElements) { - - let pageElementDimensionsPx = calculateDimensions(pageElement.dimensions, "px"); - let pageElementDimensionsTwip = calculateDimensions(pageElement.dimensions, "twip"); - let pageElementDimensionsEmu = calculateDimensions(pageElement.dimensions, "emu"); - - switch(pageElement.type) { - case "indicatorTitle-landscape": { - let paragraph = new docx.Paragraph({ - children: [ - new docx.TextRun({ - text: pageElement.text, - bold: true, - font: font, - size: 32 // 16pt - }) - ], - frame: { - position: { - x: pageElementDimensionsTwip.left, - y: pageElementDimensionsTwip.top, - }, - width: pageElementDimensionsTwip.width, - height: pageElementDimensionsTwip.height, - anchor: { - horizontal: docx.FrameAnchorType.MARGIN, - vertical: docx.FrameAnchorType.MARGIN, - }, - alignment: { - x: docx.HorizontalPositionAlign.LEFT, - y: docx.VerticalPositionAlign.TOP, - } - } - }); - - paragraphs.push(paragraph); - break; - } - case "communeLogo-landscape": { - // only add logo if one was selected - if(pageElement.src && pageElement.src.length) { - let paragraph = new docx.Paragraph({ - children: [ - new docx.ImageRun({ - data: dataURItoBlob(pageElement.src), - transformation: { - width: pageElementDimensionsPx.width, - height: pageElementDimensionsPx.height - }, - floating: { - horizontalPosition: { - offset: pageElementDimensionsEmu.left, - }, - verticalPosition: { - offset: pageElementDimensionsEmu.top, - } - }, - }) - ] - }); - paragraphs.push(paragraph); - } - break; - } - case "dataTimestamp-landscape": - case "dataTimeseries-landscape": - case "reachability-subtitle-landscape": { - let paragraph = new docx.Paragraph({ - children: [ - new docx.TextRun({ - text: pageElement.text, - font: font, - size: 32 // 16pt - }) - ], - frame: { - position: { - x: pageElementDimensionsTwip.left, - y: pageElementDimensionsTwip.top, - }, - width: pageElementDimensionsTwip.width, - height: pageElementDimensionsTwip.height, - anchor: { - horizontal: docx.FrameAnchorType.MARGIN, - vertical: docx.FrameAnchorType.MARGIN, - }, - alignment: { - x: docx.HorizontalPositionAlign.LEFT, - y: docx.VerticalPositionAlign.TOP, - } - } - }); - - paragraphs.push(paragraph); - break; - } - - case "footerHorizontalSpacer-landscape": - // empty paragraph with border top - let paragraph = new docx.Paragraph({ - children: [], - frame: { - position: { - x: pageElementDimensionsTwip.left, - y: pageElementDimensionsTwip.top, - }, - width: pageElementDimensionsTwip.width, - height: pageElementDimensionsTwip.height, - anchor: { - horizontal: docx.FrameAnchorType.MARGIN, - vertical: docx.FrameAnchorType.MARGIN, - }, - alignment: { - x: docx.HorizontalPositionAlign.LEFT, - y: docx.VerticalPositionAlign.TOP, - } - }, - border: { - top: { - color: "#949494", // gray - space: 1, - style: docx.BorderStyle.SINGLE, - size: 6 - } - } - }); - paragraphs.push(paragraph); - break; - case "footerCreationInfo-landscape": { - let paragraph = new docx.Paragraph({ - children: [ - new docx.TextRun({ - text: pageElement.text, - font: font, - size: 32 // 16pt - }) - ], - frame: { - position: { - x: pageElementDimensionsTwip.left, - y: pageElementDimensionsTwip.top, - }, - width: pageElementDimensionsTwip.width, - height: pageElementDimensionsTwip.height, - anchor: { - horizontal: docx.FrameAnchorType.MARGIN, - vertical: docx.FrameAnchorType.MARGIN, - }, - alignment: { - x: docx.HorizontalPositionAlign.LEFT, - y: docx.VerticalPositionAlign.TOP, - } - } - }); - - paragraphs.push(paragraph); - break; - } - case "pageNumber-landscape": { - let paragraph = new docx.Paragraph({ - children: [ - new docx.TextRun({ - text: "Seite " + (idx+1), - font: font, - size: 32 // 16pt - }, - new docx.PageBreak()) - ], - frame: { - position: { - x: pageElementDimensionsTwip.left, - y: pageElementDimensionsTwip.top, - }, - width: pageElementDimensionsTwip.width, - height: pageElementDimensionsTwip.height, - anchor: { - horizontal: docx.FrameAnchorType.MARGIN, - vertical: docx.FrameAnchorType.MARGIN, - }, - alignment: { - x: docx.HorizontalPositionAlign.LEFT, - y: docx.VerticalPositionAlign.TOP, - } - } - }); - paragraphs.push(paragraph); - break; - } - case "map": - case "barchart": - case "linechart": { - let pElementDom; - if(pageElement.type === "linechart") { - let arr = pageDom.querySelectorAll(".type-linechart"); - if(pageElement.showPercentageChangeToPrevTimestamp) { - pElementDom = arr[1]; - } else { - pElementDom = arr[0]; - } - } else { - pElementDom = pageDom.querySelector("#reporting-overview-page-" + idx + "-" + pageElement.type) - } - let instance = echarts.getInstanceByDom(pElementDom); - let imageDataUrl = instance.getDataURL({ - type: "png", - pixelRatio: $scope.echartsImgPixelRatio - }); - - if($scope.config.template.name === "A4-landscape-reachability") { - try { - imageDataUrl = await $scope.createReachabilityMapImage(pageDom, pageElement, imageDataUrl) - } catch(error) { - $scope.loadingData = false; - kommonitorDataExchangeService.displayMapApplicationError(error); - console.error(error); - } - } - let blob = dataURItoBlob(imageDataUrl); - - let paragraph = new docx.Paragraph({ - children: [ - new docx.ImageRun({ - data: blob, - transformation: { - width: pageElementDimensionsPx.width, - height: pageElementDimensionsPx.height - }, - floating: { - horizontalPosition: { - offset: pageElementDimensionsEmu.left, - }, - verticalPosition: { - offset: pageElementDimensionsEmu.top, - }, - behindDocument: true - }, - }) - ] - }); - paragraphs.push(paragraph); - break; - } - case "overallAverage": - case "selectionAverage": { - let paragraph = new docx.Paragraph({ - children: [ - new docx.TextRun({ - text: "Durchschnitt", - font: font, - size: 28 // 14pt - }), - new docx.TextRun({ - text: pageElement.type === "overallAverage" ? "Gesamtstadt" : "Selektion", - size: 28, - font: font, - break: 1, // 14pt - }), - new docx.TextRun({ - text: pageElement.text.toString(), - size: 28, - font: font, - break: 1 // 14pt - }) - ], - frame: { - position: { - x: pageElementDimensionsTwip.left, - y: pageElementDimensionsTwip.top, - }, - width: pageElementDimensionsTwip.width, - height: pageElementDimensionsTwip.height, - anchor: { - horizontal: docx.FrameAnchorType.MARGIN, - vertical: docx.FrameAnchorType.MARGIN, - }, - alignment: { - x: docx.HorizontalPositionAlign.LEFT, - y: docx.VerticalPositionAlign.TOP, - } - }, - border: { - top: { - color: "#949494", // gray - space: 1, - style: docx.BorderStyle.SINGLE, - size: 6 - }, - right: { - color: "#949494", - space: 1, - style: docx.BorderStyle.SINGLE, - size: 6 - }, - bottom: { - color: "#949494", - space: 1, - style: docx.BorderStyle.SINGLE, - size: 6 - }, - left: { - color: "#949494", - space: 1, - style: docx.BorderStyle.SINGLE, - size: 6 - }, - } - }); - - paragraphs.push(paragraph); - break; - } - case "overallChange": - case "selectionChange": { - let paragraph = new docx.Paragraph({ - children: [ - new docx.TextRun({ - text: "Durchschnittliche", - font: font, - size: 28 // 14pt - }), - new docx.TextRun({ - text: "Veränderung", - font: font, - break: 1, - size: 28 // 14pt - }), - new docx.TextRun({ - text: pageElement.type === "overallChange" ? "Gesamtstadt" : "Selektion", - break: 1, - font: font, - size: 28 // 14pt - }), - new docx.TextRun({ - text: pageElement.text.toString(), - break: 1, - font: font, - size: 28 // 14pt - - }) - ], - frame: { - position: { - x: pageElementDimensionsTwip.left, - y: pageElementDimensionsTwip.top, - }, - width: pageElementDimensionsTwip.width, - height: pageElementDimensionsTwip.height, - anchor: { - horizontal: docx.FrameAnchorType.MARGIN, - vertical: docx.FrameAnchorType.MARGIN, - }, - alignment: { - x: docx.HorizontalPositionAlign.LEFT, - y: docx.VerticalPositionAlign.TOP, - } - }, - border: { - top: { - color: "#949494", // gray - space: 1, - style: docx.BorderStyle.SINGLE, - size: 6 - }, - right: { - color: "#949494", - space: 1, - style: docx.BorderStyle.SINGLE, - size: 6 - }, - bottom: { - color: "#949494", - space: 1, - style: docx.BorderStyle.SINGLE, - size: 6 - }, - left: { - color: "#949494", - space: 1, - style: docx.BorderStyle.SINGLE, - size: 6 - }, - } - }); - - paragraphs.push(paragraph); - break; - } - case "textInput": { - let paragraph = new docx.Paragraph({ - children: [ - new docx.TextRun({ - text: pageElement.text, - font: font, - size: 24 // 12pt - }) - ], - frame: { - position: { - x: pageElementDimensionsTwip.left, - y: pageElementDimensionsTwip.top, - }, - width: pageElementDimensionsTwip.width, - height: pageElementDimensionsTwip.height, - anchor: { - horizontal: docx.FrameAnchorType.MARGIN, - vertical: docx.FrameAnchorType.MARGIN, - }, - alignment: { - x: docx.HorizontalPositionAlign.LEFT, - y: docx.VerticalPositionAlign.TOP, - } - } - }); - - paragraphs.push(paragraph); - break; - } - case "datatable": { - let tableDom = document.querySelector("#reporting-overview-page-" + idx + "-" + pageElement.type + " table"); - let headerFieldsDom = tableDom.querySelectorAll("thead th") - let tableRowsDom = tableDom.querySelectorAll("tbody tr"); - - // table to create - let table = { - columnWidths: [], - rows: [], - float: { - absoluteHorizontalPosition: pageElementDimensionsTwip.left, - absoluteVerticalPosition: pageElementDimensionsTwip.top, - overlap: docx.OverlapType.NEVER, - }, - }; - let headerFields = []; - let headerFieldNames = []; - for(let fieldDom of headerFieldsDom) { - let widthInTwip = pxToTwip(fieldDom.offsetWidth); - let fieldContent = fieldDom.innerText; - headerFieldNames.push(fieldContent) - let field = new docx.TableCell({ - width: { - size: widthInTwip, - type: docx.WidthType.DXA, - }, - verticalAlign: docx.VerticalAlign.CENTER, - children: [new docx.Paragraph({ - alignment: docx.AlignmentType.CENTER, - children: [new docx.TextRun({ - text: fieldContent, - font: font, - bold: true - })] - })], - }) - headerFields.push(field); - table.columnWidths.push(widthInTwip) - } - - let headerRow = new docx.TableRow({ - children: headerFields, - }); - - table.rows.push(headerRow); - - for(let rowDom of tableRowsDom) { // excluding header - let fieldsDom = rowDom.querySelectorAll("td"); - let fields = []; - for(let [idx, fieldDom] of fieldsDom.entries()) { - let fieldContent = fieldDom.innerText; - let paragraph = new docx.Paragraph({ - text: fieldContent, - alignment: - headerFieldNames[idx] === "Wert" ? - docx.AlignmentType.RIGHT : - headerFieldNames[idx] === "Zeitpunkt" ? - docx.AlignmentType.CENTER : - docx.AlignmentType.LEFT, // "Bereich" - }); - let field = new docx.TableCell({ - width: { - size: table.columnWidths[idx], - type: docx.WidthType.DXA, - }, - verticalAlign: docx.VerticalAlign.CENTER, - children: [paragraph], - }) - fields.push(field) - } - let row = new docx.TableRow({ - children: fields, - }); - table.rows.push(row); - } - - paragraphs.push(new docx.Table(table)) // technically this is not a paragraph, but we only add it as a child of section below - break; - } - } - } - - let section = { - properties: { - type: docx.SectionType.NEXT_PAGE, - page: { - margin: { - top: 0, - right: 0, - bottom: 0, - left: 0, - }, - pageNumbers: { - start: (idx+1), - formatType: docx.NumberFormat.DECIMAL, - }, - size: { - orientation: docx.PageOrientation.LANDSCAPE, - }, - }, - }, - children: [...paragraphs], - } - - sections.push(section) - } - - let docxConfig = { - sections: [...sections] - } - - let doc = new docx.Document(docxConfig); - - let filename = getCurrentDateAndTime() + "_KomMonitor-Report" - // Used to export the file into a .docx file - docx.Packer.toBlob(doc).then((blob) => { - saveAs(blob, filename + ".docx"); - $scope.loadingData = false; - $timeout(function(){ - $scope.$digest(); - }); - }); - } - - $scope.createReachabilityMapImage = async function(pageDom, pageElement, echartsImgSrc) { - let result; - // screenshot leaflet map and merge it with echarts image - // remove page offset temporarily - pageElement.leafletMap.getContainer().style.top = "0px" - pageElement.leafletMap.getContainer().style.left = "0px" - - // wait for print process to finish - let format = 'image' - let overridedPluginOptions = { - mimeType: 'image/jpeg' - } - let leafletMapScreenshot = await pageElement.leafletMap.simpleMapScreenshoter.takeScreen(format, overridedPluginOptions) - pageElement.leafletMap.getContainer().style.top = "90px" - pageElement.leafletMap.getContainer().style.left = "15px" - - // combine images - let canvas = document.createElement('canvas'); - let ctx = canvas.getContext('2d'); - let pageElementDimensionsPx = calculateDimensions(pageElement.dimensions, "px"); - canvas.width = pageElementDimensionsPx.width; - canvas.height = pageElementDimensionsPx.height; - // we have to draw layers in order - let leafletMapImg = new Image(); - // leafletMapImg.crossOrigin = "anonymous"; - leafletMapImg.width = canvas.width; - leafletMapImg.height = canvas.height; - let leafletMapImgDrawn = new Promise( (resolve, reject) => { - leafletMapImg.onload = function() { - ctx.drawImage(leafletMapImg, 0, 0, canvas.width, canvas.height); - resolve(); - } - }) - leafletMapImg.src = leafletMapScreenshot; - await leafletMapImgDrawn - - let echartsImg = new Image(); - // echartsImg.crossOrigin = "anonymous"; - let echartsImgDrawn = new Promise( (resolve, reject) => { - echartsImg.onload = function() { - ctx.drawImage(echartsImg, 0, 0, canvas.width, canvas.height); - resolve(); - } - }); - echartsImg.src = echartsImgSrc; - await echartsImgDrawn - - let mapAttributionImg = pageDom.querySelector(".map-attribution > img"); - ctx.fillStyle = "white"; - ctx.fillRect(0, canvas.height - mapAttributionImg.height, mapAttributionImg.width, mapAttributionImg.height) - ctx.drawImage(mapAttributionImg, 0, canvas.height - mapAttributionImg.height); - let mapLegendImg = pageDom.querySelector(".map-legend > img") - ctx.fillRect(canvas.width - mapLegendImg.width, canvas.height - mapLegendImg.height, mapLegendImg.width, mapLegendImg.height) - ctx.drawImage(mapLegendImg, canvas.width - mapLegendImg.width, canvas.height - mapLegendImg.height); - result = canvas.toDataURL(); - return result; - } - - function pxToMilli(px) { - // our preview is 830px wide - // px / 830 gives us the percentage from the left edge, which can then be stretched to fit the A4 page - // This is the short version of: - // px / pxPerMillimeter * pxPerMillimeter * 297 / 830, where pxPerMillimeter = (deviceScreenPpi / 2.54) * 10 - // pxPerMillimeter cancels out there, so it doesn't matter. - let result = parseInt(px, 10) / 830 * 297; - result = Math.round(result * 100) / 100; - return result; - } - - function pxToTwip(px) { - let result = parseInt(px, 10) * 15; // 1px = 0.75pt = 15twip - return result * $scope.pxPerMilli*297 / 830 // scale from 830px to A4 page - } - - function twipToEmus(value) { - // see: https://startbigthinksmall.wordpress.com/2010/01/04/points-inches-and-emus-measuring-units-in-office-open-xml/ - return value * 635; - } - - // from: https://stackoverflow.com/a/46406124 - function dataURItoBlob(dataURI) { - // convert base64 to raw binary data held in a string - // doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this - var byteString = atob(dataURI.split(',')[1]); - - // separate out the mime component - var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0] - - // write the bytes of the string to an ArrayBuffer - var ab = new ArrayBuffer(byteString.length); - - // create a view into the buffer - var ia = new Uint8Array(ab); - - // set the bytes of the buffer to the correct values - for (var i = 0; i < byteString.length; i++) { - ia[i] = byteString.charCodeAt(i); - } - - // write the ArrayBuffer to a blob, and you're done - var blob = new Blob([ab], {type: mimeString}); - return blob; - } - - function calculateDimensions(dimensions, unit) { - let result = {}; - if(unit === "px") { - // also scale our 830px preview up to A4 here - let scalefactor = $scope.pxPerMilli*297 / 830 - result.top = dimensions.top && parseInt(dimensions.top, 10) * scalefactor; - result.bottom = dimensions.bottom && parseInt(dimensions.bottom, 10) * scalefactor; - result.left = dimensions.left && parseInt(dimensions.left, 10) * scalefactor; - result.right = dimensions.right && parseInt(dimensions.right, 10) * scalefactor; - result.width = dimensions.width && parseInt(dimensions.width, 10) * scalefactor; - result.height = dimensions.height && parseInt(dimensions.height, 10) * scalefactor; - } - if(unit === "milli") { - result.top = dimensions.top && pxToMilli(dimensions.top); - result.bottom = dimensions.bottom && pxToMilli(dimensions.bottom); - result.left = dimensions.left && pxToMilli(dimensions.left); - result.right = dimensions.right && pxToMilli(dimensions.right); - result.width = dimensions.width && pxToMilli(dimensions.width, 10);; - result.height = dimensions.height && pxToMilli(dimensions.height, 10); - } - if(unit === "twip") { - result.top = dimensions.top && docx.convertMillimetersToTwip(pxToMilli(dimensions.top)); - result.bottom = dimensions.bottom && docx.convertMillimetersToTwip(pxToMilli(dimensions.bottom)); - result.left = dimensions.left && docx.convertMillimetersToTwip(pxToMilli(dimensions.left)); - result.right = dimensions.right && docx.convertMillimetersToTwip(pxToMilli(dimensions.right)); - result.width = dimensions.width && docx.convertMillimetersToTwip(pxToMilli(dimensions.width, 10)); - result.height = dimensions.height && docx.convertMillimetersToTwip(pxToMilli(dimensions.height, 10)); - } - if(unit === "emu") { - result.top = dimensions.top && twipToEmus(docx.convertMillimetersToTwip(pxToMilli(dimensions.top))); - result.bottom = dimensions.bottom && twipToEmus(docx.convertMillimetersToTwip(pxToMilli(dimensions.bottom))); - result.left = dimensions.left && twipToEmus(docx.convertMillimetersToTwip(pxToMilli(dimensions.left))); - result.right = dimensions.right && twipToEmus(docx.convertMillimetersToTwip(pxToMilli(dimensions.right))); - result.width = dimensions.width && twipToEmus(docx.convertMillimetersToTwip(pxToMilli(dimensions.width, 10))); - result.height = dimensions.height && twipToEmus(docx.convertMillimetersToTwip(pxToMilli(dimensions.height, 10))); - } - return result; - } - - - function calculateScreenDpi() { - // create a hidden div that is one inch high - let div = document.createElement("div") - div.style.height = "1in"; - div.style.position = "absolute"; - div.style.left = "-100%"; - div.style.top = "-100%"; - document.getElementsByTagName("body")[0].append(div); - const dpi = div.offsetHeight - div.style.display = "none"; - return dpi - } - } -]}); \ No newline at end of file + templateUrl: "components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingOverview/reporting-overview.template.html", + controller: ['$scope', '__env', '$timeout', '$http', 'kommonitorDataExchangeService', 'kommonitorDiagramHelperService', + function ReportingOverviewController($scope, __env, $timeout, $http, kommonitorDataExchangeService, kommonitorDiagramHelperService) { + /* + { + indicators: [ + {...}, + {...}, + ... + ], + pages: [ + { + indicatorName: ... // e.g for sorting pages + spatialUnitName: .... + pageElements: [...] + }, + {...}, + ... + ], + template: {...} // clean version of the template, without indicator data + } + */ + $scope.config = { + templateSections: [ + // { + // indicator: "", + // poiLayer: "" + // } + ], + pages: [], + template: {} + }; + $scope.loadingData = false; + $scope.echartsImgPixelRatio = 2; + $scope.initialize = function (data) { + let configFileSelected = data[0]; + data = data[1]; + if (configFileSelected) { + $scope.importConfig(data); + } + else { + $scope.config.template = JSON.parse(JSON.stringify(data)); + $scope.config.pages = $scope.config.template.pages; + } + let deviceScreenDpi = calculateScreenDpi(); + $scope.pxPerMilli = deviceScreenDpi / 25.4; // /2.54 --> cm, /10 --> mm + }; + $scope.sortableConfig = { + onEnd: function (e) { + // nothing for now, config elements get reordered automatically + } + }; + $scope.$on("reportingInitializeOverview", function (event, data) { + // data is a nested array at this point [ [ { template object } ] ] + $scope.initialize(data); + }); + $scope.onConfigureNewIndicatorClicked = function () { + $scope.$emit('reportingConfigureNewIndicatorClicked', [$scope.config.template]); + }; + $scope.onConfigureNewPoiLayerClicked = function () { + $scope.$emit('reportingConfigureNewPoiLayerClicked', [$scope.config.template]); + }; + $scope.onBackToTemplateSelectionClicked = function () { + $scope.$emit('reportingBackToTemplateSelectionClicked'); + }; + $scope.$on("reportingIndicatorConfigurationCompleted", function (event, data) { + $scope.loadingData = true; + let [indicator, template] = data; + let templateSection = { + indicatorName: indicator ? indicator.indicatorName : "", + indicatorId: indicator ? indicator.indicatorId : "", + poiLayerName: "", + spatialUnitName: template.spatialUnitName, + absoluteLabelPositions: template.absoluteLabelPositions, + echartsRegisteredMapNames: template.echartsRegisteredMapNames, + echartsMaps: [] + }; + for (let page of template.pages) { + page.templateSection = templateSection; + } + // remove the placeholder template if this is the first section that gets added) + $scope.config.pages = $scope.config.pages.filter(page => { + if (page.hasOwnProperty("templateSection")) { + return page.templateSection.hasOwnProperty("indicatorName"); + } + else { + return false; + } + }); + // append to array + $scope.config.pages.push(...template.pages); + $scope.config.templateSections.push(templateSection); + // setup pages after dom exists + // at this point we still have all the echarts maps registered + $scope.setupNewPages($scope.config.templateSections.at(-1)); + }); + $scope.$on("reportingPoiLayerConfigurationCompleted", function (event, data) { + $scope.loadingData = true; + // add indicator to 'added indicators' + let [poiLayer, indicator, template] = data; + let templateSection = { + indicatorName: indicator ? indicator.indicatorName : "", + indicatorId: indicator ? indicator.indicatorId : "", + poiLayerName: poiLayer.datasetName, + spatialUnitName: template.spatialUnitName, + absoluteLabelPositions: template.absoluteLabelPositions, + echartsRegisteredMapNames: template.echartsRegisteredMapNames, + echartsMaps: [], + isochronesRangeType: template.isochronesRangeType, + isochronesRangeUnits: template.isochronesRangeUnits + }; + for (let page of template.pages) { + page.templateSection = templateSection; + } + // remove all pages without property poiLayerName (clean template) + $scope.config.pages = $scope.config.pages.filter(page => { + if (page.hasOwnProperty("templateSection")) { + return page.templateSection.hasOwnProperty("poiLayerName"); + } + else { + return false; + } + }); + // append to array + $scope.config.pages.push(...template.pages); + $scope.config.templateSections.push(templateSection); + // setup pages after dom exists + // at this point we still have all the echarts maps registered + $scope.setupNewPages($scope.config.templateSections.at(-1)); + }); + $scope.removeTemplateSection = function (idx) { + $scope.config.templateSections.splice(idx, 1); + // show empty template if this was the last indicator + if ($scope.config.templateSections.length === 0) { + $scope.config.pages = $scope.config.template.pages; + } + }; + $scope.$watchCollection('config.templateSections', function (newVal, oldVal) { + if (newVal.length < oldVal.length) { // removed + // find removed section + let difference = oldVal + .filter(x => !newVal.includes(x)) + .concat(newVal.filter(x => !oldVal.includes(x))); + let removedSection = difference[0]; + // remove all pages for that section + $scope.config.pages = $scope.config.pages.filter(page => { + if (!page.hasOwnProperty("templateSection")) + return true; // for placeholder + return page.templateSection.indicatorId !== removedSection.indicatorId || + page.templateSection.spatialUnitId !== removedSection.spatialUnitId || + page.templateSection.poiLayerName !== removedSection.poiLayerName; + }); + } + if (newVal.length === oldVal.length) { // order changed + // sort pages according to newVal + let sorted = []; + for (let section of newVal) { + for (let page of $scope.config.pages) { + if (page.templateSection.indicatorId === section.indicatorId && + page.templateSection.spatialUnitId === section.spatialUnitId && + page.templateSection.poiLayerName === section.poiLayerName) { + sorted.push(page); + } + } + } + $scope.config.pages = sorted; + } + }); + $scope.setupNewPages = function (templateSection) { + $timeout(async function (templateSection) { + if (!templateSection.poiLayerName) { + // for indicator without poi layer + let indicatorId = templateSection.indicatorId; + let spatialUnit, featureCollection, features, geoJSON; + let isFirstPageToAdd = true; + for (let [idx, page] of $scope.config.pages.entries()) { + if (page.templateSection.indicatorId !== indicatorId) { + continue; // only do changes to new pages + } + else { + // Indicator and spatial unit are the same for all added pages + // We only need to query features on the first page that we add + if (isFirstPageToAdd) { + isFirstPageToAdd = false; + spatialUnit = await $scope.getSpatialUnitByIndicator(indicatorId, page.templateSection.spatialUnitName); + featureCollection = await $scope.queryFeatures(indicatorId, spatialUnit); + features = $scope.createLowerCaseNameProperty(featureCollection.features); + geoJSON = { features: features }; + } + } + let pageDom = document.querySelector("#reporting-overview-page-" + idx); + for (let pageElement of page.pageElements) { + // usually each type is included only once per page, but there is an exception for linecharts in area specific part of timeseries template + // for now we more or less hardcode this, but it might have to change in the future + let pElementDom; + if (pageElement.type === "linechart") { + let arr = pageDom.querySelectorAll(".type-linechart"); + if (pageElement.showPercentageChangeToPrevTimestamp) { + pElementDom = arr[1]; + } + else { + pElementDom = arr[0]; + } + } + else { + pElementDom = pageDom.querySelector("#reporting-overview-page-" + idx + "-" + pageElement.type); + } + // recreate boxplots, itemNameFormatter did not get transferred + if (pageElement.type === "linechart" && pageElement.showBoxplots) { + let xAxisLabels = pageElement.echartsOptions.xAxis[0].data; + pageElement.echartsOptions.dataset[1].transform.config = { + itemNameFormatter: function (params) { + return xAxisLabels[params.value]; + } + }; + } + if (pageElement.type === "map" || pageElement.type === "barchart" || pageElement.type === "linechart") { + let instance = echarts.init(pElementDom); + if (pageElement.type === "map") { + if (page.area && page.area.length) { + // at this point we have not yet set echarts options, so we provide them as an extra parameter + $scope.filterMapByArea(instance, pageElement.echartsOptions, page.area, geoJSON.features); + } + else { + // recreate label positions + pageElement.echartsOptions.labelLayout = function (feature) { + // Set fixed position for labels that were previously dragged by user + // For all other labels try to avoid overlaps + let names = page.templateSection.absoluteLabelPositions.map(el => el.name); + let text = feature.text.split("\n")[0]; // area name is the first line + if (names.includes(text)) { + let idx = names.indexOf(text); + return { + x: page.templateSection.absoluteLabelPositions[idx].x, + y: page.templateSection.absoluteLabelPositions[idx].y, + draggable: false // Don't allow label dragging in overview, we could have different spatial units here + }; + } + else { + return { + moveOverlap: 'shiftY', + x: feature.rect.x + feature.rect.width / 2, + draggable: false + }; + } + }; + } + } + instance.setOption(pageElement.echartsOptions); + } + if (pageElement.type === "overallAverage") { + pageDom.querySelector(".type-overallAverage").style.border = "none"; + } + if (pageElement.type === "selectionAverage") { + pageDom.querySelector(".type-selectionAverage").style.border = "none"; + } + if (pageElement.type === "mapLegend") { + pageElement.isPlaceholder = false; + pageDom.querySelector(".type-mapLegend").style.display = "none"; + } + if (pageElement.type === "overallChange") { + let wrapper = pageDom.querySelector(".type-overallChange"); + wrapper.style.border = "none"; + wrapper.style.left = "670px"; + wrapper.style.width = "130px"; + wrapper.style.height = "100px"; + } + if (pageElement.type === "selectionChange") { + let wrapper = pageDom.querySelector(".type-selectionChange"); + wrapper.style.border = "none"; + wrapper.style.left = "670px"; + wrapper.style.width = "130px"; + wrapper.style.height = "100px"; + } + if (pageElement.type === "datatable") { + $scope.createDatatablePage(pElementDom, pageElement); + } + } + } + $scope.loadingData = false; + $timeout(function () { + $scope.$digest(); + }); + } + else { + $scope.handleSetupNewPagesForReachability(templateSection); + } + }, 0, false, templateSection); + }; + $scope.handleSetupNewPagesForReachability = async function (templateSection) { + let poiLayerName = templateSection.poiLayerName; + let spatialUnit, featureCollection, features, geoJSON, indicatorId; + // if indicator was chosen + if (templateSection.indicatorId) { + indicatorId = templateSection.indicatorId; + } + let isFirstPageToAdd = true; + for (let [idx, page] of $scope.config.pages.entries()) { + if (page.templateSection.poiLayerName !== poiLayerName) { + continue; // only do changes to new pages + } + else { + // PoiLayer, Indicator and spatial unit are the same for all added pages + // We only need to query features on the first page that we add + if (isFirstPageToAdd) { + isFirstPageToAdd = false; + if (indicatorId) { + spatialUnit = await $scope.getSpatialUnitByIndicator(indicatorId, page.templateSection.spatialUnitName); + featureCollection = await $scope.queryFeatures(indicatorId, spatialUnit); + } + else { + spatialUnit = await $scope.getSpatialUnitByName(page.templateSection.spatialUnitName); + featureCollection = await $scope.queryFeatures(undefined, spatialUnit); + } + features = $scope.createLowerCaseNameProperty(featureCollection.features); + geoJSON = { features: features }; + } + } + let pageDom = document.querySelector("#reporting-overview-page-" + idx); + for (let pageElement of page.pageElements) { + let pElementDom = pageDom.querySelector("#reporting-overview-page-" + idx + "-" + pageElement.type); + if (pageElement.type === "map") { + let instance = echarts.init(pElementDom); + if (page.area && page.area.length) { + // at this point we have not yet set echarts options, so we provide them as an extra parameter + $scope.filterMapByArea(instance, pageElement.echartsOptions, page.area, geoJSON.features); + } + else { + // recreate label positions + pageElement.echartsOptions.labelLayout = function (feature) { + // Set fixed position for labels that were previously dragged by user + // For all other labels try to avoid overlaps + let names = page.templateSection.absoluteLabelPositions.map(el => el.name); + let text = feature.text.split("\n")[0]; // area name is the first line + if (names.includes(text)) { + let idx = names.indexOf(text); + return { + x: page.templateSection.absoluteLabelPositions[idx].x, + y: page.templateSection.absoluteLabelPositions[idx].y, + draggable: false // Don't allow label dragging in overview, we could have different spatial units here + }; + } + else { + return { + moveOverlap: 'shiftY', + x: feature.rect.x + feature.rect.width / 2, + draggable: false + }; + } + }; + } + instance.setOption(pageElement.echartsOptions); + await $scope.initializeLeafletMap(page, pageElement, instance, spatialUnit); + } + } + } + $scope.loadingData = false; + $timeout(function () { + $scope.$digest(); + }); + }; + $scope.initializeLeafletMap = async function (page, pageElement, map, spatialUnit) { + await $timeout(async function (page, pageElement, echartsMap, spatialUnit) { + let pageIdx = $scope.config.pages.indexOf(page); + let id = "reporting-overview-reachability-leaflet-map-container-" + pageIdx; + let pageDom = document.getElementById("reporting-overview-page-" + pageIdx); + let pageElementDom = document.getElementById("reporting-overview-page-" + pageIdx + "-map"); + let oldMapNode = document.getElementById(id); + if (oldMapNode) { + oldMapNode.remove(); + } + let div = document.createElement("div"); + div.id = id; + div.style.position = "absolute"; + div.style.left = pageElement.dimensions.left; + div.style.top = pageElement.dimensions.top; + div.style.width = pageElement.dimensions.width; + div.style.height = pageElement.dimensions.height; + div.style.zIndex = 10; + pageDom.appendChild(div); + let echartsOptions = echartsMap.getOption(); + let leafletMap = L.map(div.id, { + zoomControl: false, + dragging: false, + doubleClickZoom: false, + boxZoom: false, + trackResize: false, + attributionControl: false, + // prevents leaflet form snapping to closest pre-defined zoom level. + // In other words, it allows us to set exact map extend by a (echarts) bounding box + zoomSnap: 0 + }); + // from the docs, most of it is probably not needed + let screenshotterOptions = { + cropImageByInnerWH: true, + hidden: true, + preventDownload: true, + domtoimageOptions: {}, + position: 'topleft', + screenName: 'screen', + hideElementsWithSelectors: ['.leaflet-control-container'], + mimeType: 'image/png', + caption: null, + captionFontSize: 15, + captionFont: 'Arial', + captionColor: 'black', + captionBgColor: 'white', + captionOffset: 5, + // callback for manually edit map if have warn: "May be map size very big on that zoom level, we have error" + // and screenshot not created + onPixelDataFail: async function ({ node, plugin, error, mapPane, domtoimageOptions }) { + // Solutions: + // decrease size of map + // or decrease zoom level + // or remove elements with big distanses + // and after that return image in Promise - plugin._getPixelDataOfNormalMap + return plugin._getPixelDataOfNormalMap(domtoimageOptions); + } + }; + leafletMap.simpleMapScreenshoter = L.simpleMapScreenshoter(screenshotterOptions).addTo(leafletMap); + // manually create a field for attribution so we can control the z-index. + let prevAttributionDiv = pageDom.querySelector(".map-attribution"); + if (prevAttributionDiv) + prevAttributionDiv.remove(); + let attrDiv = document.createElement("div"); + attrDiv.classList.add("map-attribution"); + attrDiv.style.position = "absolute"; + attrDiv.style.bottom = 0; + attrDiv.style.left = 0; + attrDiv.style.zIndex = 800; + let attrImg = await kommonitorDiagramHelperService.createReportingReachabilityMapAttribution(); + attrDiv.appendChild(attrImg); + pageElementDom.appendChild(attrDiv); + // also create the legend manually + let prevLegendDiv = pageDom.querySelector(".map-legend"); + if (prevLegendDiv) + prevLegendDiv.remove(); + let legendDiv = document.createElement("div"); + legendDiv.classList.add("map-legend"); + legendDiv.style.position = "absolute"; + legendDiv.style.bottom = 0; + legendDiv.style.right = 0; + legendDiv.style.zIndex = 800; + let isochronesRangeType = page.templateSection.isochronesRangeType; + let isochronesRangeUnits = page.templateSection.isochronesRangeUnits; + let legendImg = await kommonitorDiagramHelperService.createReportingReachabilityMapLegend(echartsOptions, spatialUnit, isochronesRangeType, isochronesRangeUnits); + legendDiv.appendChild(legendImg); + pageElementDom.appendChild(legendDiv); + // we have the bbox stored in config + // pageElement.leafletBbox is invalid after export and import. Maybe because the prototype object gets removed... + // We create a new bounds object from the stored data + let bounds = L.latLngBounds(pageElement.leafletBbox._southWest, pageElement.leafletBbox._northEast); + leafletMap.fitBounds(bounds); + let osmLayer = new L.TileLayer.Grayscale("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", { + attribution: "Map data © OpenStreetMap contributors", + }); + osmLayer.addTo(leafletMap); + // add leaflet map to pageElement in case we need it again later + pageElement.leafletMap = leafletMap; + // can be used to check if positioning in echarts matches the one from leaflet + //let geoJsonLayer = L.geoJSON( $scope.geoJsonForReachability.features ) + //geoJsonLayer.addTo(leafletMap) + //let isochronesLayer = L.geoJSON( $scope.isochrones.features ) + //isochronesLayer.addTo(leafletMap); + }, 0, true, page, pageElement, map, spatialUnit); + }; + $scope.getSpatialUnitByName = async function (spatialUnitName) { + let url; + url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/spatial-units"; + // send request + return await $http({ + url: url, + method: "GET" + }).then(function successCallback(response) { + let spatialUnit = response.data.filter(el => { + return el.spatialUnitLevel === spatialUnitName; + }); + if (spatialUnit.length === 1) + return spatialUnit[0]; + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + console.error(error); + }); + }; + $scope.getSpatialUnitByIndicator = async function (indicatorId, spatialUnitName) { + let url; + url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/indicators/" + indicatorId; + // send request + return await $http({ + url: url, + method: "GET" + }).then(function successCallback(response) { + let spatialUnit = response.data.applicableSpatialUnits.filter(el => { + return el.spatialUnitName === spatialUnitName; + }); + if (spatialUnit.length === 1) + return spatialUnit[0]; + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + console.error(error); + }); + }; + $scope.filterMapByArea = function (echartsInstance, echartsInstanceOptions, areaName, allFeatures) { + let mapName = echartsInstanceOptions.series[0].map; + // filter shown areas if we are in the area-specific part of the template + let features = allFeatures.filter(el => { + return el.properties.name === areaName; + }); + echarts.registerMap(mapName, { features: features }); + echartsInstance.setOption(echartsInstanceOptions); // set same options, but this updates the map + }; + $scope.createDatatableSkeleton = function (colNamesArr) { + let table = document.createElement("table"); + table.classList.add("table-striped"); + table.classList.add("table-bordered"); + let thead = document.createElement("thead"); + let tbody = document.createElement("tbody"); + table.appendChild(thead); + table.appendChild(tbody); + let headerRow = document.createElement("tr"); + for (let colName of colNamesArr) { + let col = document.createElement("th"); + col.classList.add("text-center"); + col.innerText = colName; + headerRow.appendChild(col); + } + headerRow.style.height = "25px"; + thead.appendChild(headerRow); + return table; + }; + $scope.createDatatablePage = function (pElementDom, pageElement) { + pElementDom.innerHTML = ""; + pElementDom.style.border = "none"; // hide dotted border from outer dom element + pElementDom.style.justifyContent = "flex-start"; // align table at top instead of center + // add data + let table = $scope.createDatatableSkeleton(pageElement.columnNames); + let tbody = table.querySelector("tbody"); + // tabledata is a nested array with one sub-array per row + for (let row of pageElement.tableData) { + let tr = document.createElement("tr"); + tr.style.height = "25px"; + for (let i = 0; i < row.length; i++) { + let td = document.createElement("td"); + td.innerText = row[i]; + // get corresponding column name for styling + let colName = pageElement.columnNames[i]; + if (colName === "Bereich") { + td.classList.add("text-left"); + } + if (colName === "Wert") { + td.classList.add("text-right"); + } + tr.appendChild(td); + } + tbody.appendChild(tr); + } + pElementDom.appendChild(table); + }; + $scope.importConfig = function (config) { + $scope.loadingData = true; + $timeout(function () { + $scope.$digest(); + }); + try { + // restore commune logo for every page, starting at the second + let communeLogoSrc = ""; // base64 string + for (let [idx, page] of config.pages.entries()) { + for (let pageElement of page.pageElements) { + if (pageElement.type === "communeLogo-landscape" && idx === 0) { + if (pageElement.src && pageElement.src.length) { + communeLogoSrc = pageElement.src; + } + else { + break; // no logo was exported + } + } + if (pageElement.type === "communeLogo-landscape" && idx > 0) { + pageElement.src = communeLogoSrc; + } + } + } + $scope.config.template = config.template; + $scope.config.pages = config.pages; + $scope.config.templateSections = config.templateSections; + // register echarts maps + for (let section of $scope.config.templateSections) { + for (let mapName of section.echartsRegisteredMapNames) { + if ($scope.config.template.name === "A4-landscape-reachability") { + if (!mapName.includes(section.spatialUnitName)) { + continue; + } + if (!mapName.includes("_isochrones")) { + let geoJson = section.echartsMaps.filter(map => map.name === section.poiLayerName)[0].geoJson; + echarts.registerMap(mapName, geoJson); + } + else { + let geoJson = section.echartsMaps.filter(map => map.name === mapName)[0].geoJson; + echarts.registerMap(mapName, geoJson); + } + } + else { + if (!mapName.includes(section.spatialUnitName)) { + continue; + } + let geoJson = section.echartsMaps[0].geoJson; + echarts.registerMap(mapName, geoJson); + } + } + } + for (let page of $scope.config.pages) { + for (let pageElement of page.pageElements) { + if (pageElement.type === "map" && pageElement.hasOwnProperty("echartsMaps")) { + for (let map of pageElement.echartsMaps) { + echarts.registerMap(map.name, map.geoJson); + } + } + } + } + $timeout(function () { + $scope.$digest(); + }); + for (let section of $scope.config.templateSections) { + $scope.setupNewPages(section); + } + } + catch (error) { + console.error(error); + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error.message); + } + }; + $scope.exportConfig = function () { + try { + let jsonToExport = {}; + let temp = JSON.stringify($scope.config.pages, function (key, value) { + // Leaflet map contains cyclic object references so we have to remove it. + // We have to initialize the map again on import based on the stored boundingbox + if (key === "leafletMap") { + return undefined; + } + else { + return value; + } + }); + jsonToExport.pages = JSON.parse(temp); + jsonToExport.template = angular.fromJson(angular.toJson($scope.config.template)); + jsonToExport.templateSections = $scope.config.templateSections; + // Only store commune logo once (in first page) + // It is base64 encoded and adds quite a bit to the file size + for (let [idx, page] of jsonToExport.pages.entries()) { + for (let pageElement of page.pageElements) { + if (pageElement.type === "communeLogo-landscape" && idx > 0) { + pageElement.src = ""; + } + } + } + for (let section of jsonToExport.templateSections) { + let mapNames = [...new Set(section.echartsRegisteredMapNames)]; + if ($scope.config.template.name === "A4-landscape-reachability") { + let mapAdded = false; + for (let [idx, name] of mapNames.entries()) { + if (!name.includes(section.spatialUnitName)) { + continue; + } + // store all isochrones + if (name.includes("_isochrones")) { + let map = echarts.getMap(name); + section.echartsMaps.push({ + name: name, + geoJson: map.geoJson + }); + } + // First map with the correct spatial unit + // All other maps have the same geojson, so we only store them once + if (!mapAdded && name.includes(section.poiLayerName)) { + let map = echarts.getMap(mapNames[idx]); + section.echartsMaps.push({ + name: section.poiLayerName, + geoJson: map.geoJson + }); + mapAdded = true; + } + } + } + else { + for (let [idx, name] of mapNames.entries()) { + if (!name.includes(section.spatialUnitName)) { + continue; + } + else { + // First map with the correct spatial unit + let map = echarts.getMap(mapNames[idx]); + section.echartsMaps.push({ + name: mapNames[idx], + geoJson: map.geoJson + }); + } + } + } + } + let jsonString = "data:text/json;charset=utf-8," + encodeURIComponent(angular.toJson(jsonToExport)); + // to download json, a DOM element is created, clicked and removed + let downloadAnchorNode = document.createElement('a'); + downloadAnchorNode.setAttribute("href", jsonString); + downloadAnchorNode.setAttribute("download", getCurrentDateAndTime() + "_KomMonitor-Reporting-Konfiguration.json"); + document.body.appendChild(downloadAnchorNode); // required for firefox + downloadAnchorNode.click(); + downloadAnchorNode.remove(); + } + catch (error) { + kommonitorDataExchangeService.displayMapApplicationError(error.message); + console.error(error); + } + }; + function getCurrentDateAndTime() { + let date = new Date(); + let year = date.getFullYear().toString(); + let month = date.getMonth() + 1; + let day = date.getDate(); + let time = date.getHours(); + let minutes = date.getMinutes(); + let seconds = date.getSeconds(); + let now = "".concat(year, "-", month, "-", day, "_", time, "-", minutes, "-", seconds); + return now; + } + function getIndicatorByName(indicatorName) { + let result; + for (let indicator of kommonitorDataExchangeService.availableIndicators) { + if (indicator.indicatorName === indicatorName) { + result = indicator; + break; + } + } + if (result) { + return result; + } + else { + throw new Error("No indicator could be found for name: " + indicatorName); + } + } + $scope.queryFeatures = async function (indicatorId, spatialUnit) { + // build request + // query different endpoints depending on if we have an indicator or not + let url; + if (!indicatorId) { + let date = spatialUnit.metadata.lastUpdate.split("-"); + let year = date[0]; + let month = date[1]; + let day = date[2]; + url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + + "/spatial-units/" + spatialUnit.spatialUnitId + "/" + year + "/" + month + "/" + day; + } + else { + url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + + "/indicators/" + indicatorId + "/" + spatialUnit.spatialUnitId; + } + // send request + $scope.loadingData = true; + return await $http({ + url: url, + method: "GET" + }).then(function successCallback(response) { + $scope.loadingData = false; + return response.data; + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + console.error(error); + }); + }; + $scope.createLowerCaseNameProperty = function (features) { + for (let feature of features) { + if (feature.hasOwnProperty("properties")) { + if (!feature.properties.hasOwnProperty("name")) { + let featureName = feature.properties.NAME; + feature.properties.name = featureName; + } + } + } + return features; + }; + $scope.$on("reportingGenerateReport", function (event, format) { + $scope.generateReport(format); + }); + $scope.generateReport = async function (format) { + $scope.loadingData = true; + try { + format === "pdf" && await $scope.generatePdfReport(); + format === "docx" && await $scope.generateWordReport(); + format === "zip" && await $scope.generateZipFolder(); + } + catch (error) { + $scope.loadingData = false; + console.error(error); + kommonitorDataExchangeService.displayMapApplicationError(error.message); + } + }; + $scope.generatePdfReport = async function () { + // create pdf document + let doc = new jsPDF({ + margin: 0, + unit: 'mm', + format: 'a4', + orientation: "landscape" + }); + // general settings + let fontName = "Helvetica"; + doc.setDrawColor(148, 148, 148); + doc.setFont(fontName, "normal", "normal"); // name, normal/italic, fontweight + for (let [idx, page] of $scope.config.pages.entries()) { + if (idx > 0) { + doc.addPage(); + } + let pageDom = document.querySelector("#reporting-overview-page-" + idx); + for (let pageElement of page.pageElements) { + let pElementDom; + if (pageElement.type === "linechart") { + let arr = pageDom.querySelectorAll(".type-linechart"); + if (pageElement.showPercentageChangeToPrevTimestamp) { + pElementDom = arr[1]; + } + else { + pElementDom = arr[0]; + } + } + else { + pElementDom = pageDom.querySelector("#reporting-overview-page-" + idx + "-" + pageElement.type); + } + // convert dimensions to millimeters here + // that way we don't have to use pxToMilli everywhere we use coordinates in the pdf + let pageElementDimensions = {}; + pageElementDimensions.top = pageElement.dimensions.top && pxToMilli(pageElement.dimensions.top); + pageElementDimensions.bottom = pageElement.dimensions.bottom && pxToMilli(pageElement.dimensions.bottom); + pageElementDimensions.left = pageElement.dimensions.left && pxToMilli(pageElement.dimensions.left); + pageElementDimensions.right = pageElement.dimensions.right && pxToMilli(pageElement.dimensions.right); + pageElementDimensions.width = pageElement.dimensions.width && pxToMilli(pageElement.dimensions.width); + pageElementDimensions.height = pageElement.dimensions.height && pxToMilli(pageElement.dimensions.height); + // TODO some cases could be merged, but it's better to do that later when stuff works + switch (pageElement.type) { + case "indicatorTitle-landscape": { + // Css takes the top-left edge of the element by default. + // doc.text takes left-bottom, so we ass baseline "top" to achieve the same behavior in jspdf. + doc.setFont(fontName, "Bold"); + doc.text(pageElement.text, pageElementDimensions.left, pageElementDimensions.top, { baseline: "top" }); + doc.setFont(fontName, "normal", "normal"); + break; + } + case "communeLogo-landscape": { + // only add logo if one was selected + if (pageElement.src && pageElement.src.length) { + doc.addImage(pageElement.src, "JPEG", pageElementDimensions.left, pageElementDimensions.top, pageElementDimensions.width, pageElementDimensions.height, "", 'MEDIUM'); + } + break; + } + case "dataTimestamp-landscape": { + doc.text(pageElement.text, pageElementDimensions.left, pageElementDimensions.top, { baseline: "top" }); + break; + } + case "dataTimeseries-landscape": { + doc.text(pageElement.text, pageElementDimensions.left, pageElementDimensions.top, { baseline: "top" }); + break; + } + case "reachability-subtitle-landscape": { + doc.text(pageElement.text, pageElementDimensions.left, pageElementDimensions.top, { baseline: "top" }); + break; + } + case "footerHorizontalSpacer-landscape": { + let x1, x2, y1, y2; + x1 = pageElementDimensions.left; + x2 = pageElementDimensions.left + pageElementDimensions.width; + y1 = pageElementDimensions.top; + y2 = pageElementDimensions.top; + doc.line(x1, y1, x2, y2); + break; + } + case "footerCreationInfo-landscape": { + doc.text(pageElement.text, pageElementDimensions.left, pageElementDimensions.top, { baseline: "top" }); + break; + } + case "pageNumber-landscape": { + let text = "Seite " + (idx + 1); + doc.text(text, pageElementDimensions.left, pageElementDimensions.top, { baseline: "top" }); + break; + } + // template-specific elements + case "map": { + let instance = echarts.getInstanceByDom(pElementDom); + let imageDataUrl = instance.getDataURL({ pixelRatio: $scope.echartsImgPixelRatio }); + if ($scope.config.template.name === "A4-landscape-reachability") { + try { + imageDataUrl = await $scope.createReachabilityMapImage(pageDom, pageElement, imageDataUrl); + } + catch (error) { + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + console.error(error); + } + } + doc.addImage(imageDataUrl, "PNG", pageElementDimensions.left, pageElementDimensions.top, pageElementDimensions.width, pageElementDimensions.height, "", 'MEDIUM'); + break; + } + // case "mapLegend" can be ignored since it is included in the map if needed + case "overallAverage": + case "selectionAverage": { + let x, y, width, height; + x = pageElementDimensions.left; + y = pageElementDimensions.top; + width = pageElementDimensions.width; + height = pageElementDimensions.height; + doc.rect(x, y, width, height); + let avgType = pageElement.type === "overallAverage" ? "Gesamtstadt" : "Selektion"; + let text = "Durchschnitt\n" + avgType + ":\n" + pageElement.text.toString(); + doc.text(text, pageElementDimensions.left + pxToMilli(5), pageElementDimensions.top + pxToMilli(5), { baseline: "top" }); + break; + } + case "overallChange": + case "selectionChange": { + let x = pxToMilli(670); + let y = pageElementDimensions.top; + let width = pxToMilli(130); + let height = pxToMilli(80); + doc.rect(x, y, width, height); + let changeType = pageElement.type === "overallChange" ? "Gesamtstadt" : "Selektion"; + let text = "Durchschnittliche\nVeränderung\n" + changeType + ":\n" + pageElement.text.toString(); + doc.text(text, x + pxToMilli(5), y + pxToMilli(5), { baseline: "top" }); + break; + } + case "barchart": { + let instance = echarts.getInstanceByDom(pElementDom); + let base64String = instance.getDataURL({ pixelRatio: $scope.echartsImgPixelRatio }); + doc.addImage(base64String, "PNG", pageElementDimensions.left, pageElementDimensions.top, pageElementDimensions.width, pageElementDimensions.height, "", 'MEDIUM'); + break; + } + case "linechart": { + let instance = echarts.getInstanceByDom(pElementDom); + let base64String = instance.getDataURL({ pixelRatio: $scope.echartsImgPixelRatio }); + doc.addImage(base64String, "PNG", pageElementDimensions.left, pageElementDimensions.top, pageElementDimensions.width, pageElementDimensions.height, "", 'MEDIUM'); + break; + } + case "textInput": { + doc.text(pageElement.text, pageElementDimensions.left, pageElementDimensions.top, { + baseline: "top", + maxWidth: pageElementDimensions.width + }); + break; + } + case "datatable": { + doc.autoTable({ + html: "#reporting-overview-page-" + idx + "-" + pageElement.type + " table", + startY: pageElementDimensions.top, + tableWidth: "wrap", + margin: { left: pageElementDimensions.left }, + theme: "grid", + //headStyles: { + // fillColor: false, // transparent + // textColor: [0, 0, 0], + //} + }); + break; + } + } + } + } + //doc.output("dataurlnewwindow") + let now = getCurrentDateAndTime(); + doc.save(now + "_KomMonitor-Report.pdf"); + $scope.loadingData = false; + $timeout(function () { + $scope.$digest(); + }); + }; + $scope.generateZipFolder = async function () { + // creates a zip folder containing all echarts files + let zip = new JSZip(); + // screenshot map attribution and legend only once per section + for (let [idx, page] of $scope.config.pages.entries()) { + let pageDom = document.querySelector("#reporting-overview-page-" + idx); + for (let pageElement of page.pageElements) { + if (pageElement.type === "map" || pageElement.type === "barchart" || pageElement.type === "linechart") { + let pElementDom; + if (pageElement.type === "linechart") { + let arr = pageDom.querySelectorAll(".type-linechart"); + if (pageElement.showPercentageChangeToPrevTimestamp) { + pElementDom = arr[1]; + } + else { + pElementDom = arr[0]; + } + } + else { + pElementDom = pageDom.querySelector("#reporting-overview-page-" + idx + "-" + pageElement.type); + } + let instance = echarts.getInstanceByDom(pElementDom); + let imageDataUrl = instance.getDataURL({ + type: "png", + pixelRatio: $scope.echartsImgPixelRatio + }); + if ($scope.config.template.name === "A4-landscape-reachability") { + try { + imageDataUrl = await $scope.createReachabilityMapImage(pageDom, pageElement, imageDataUrl); + } + catch (error) { + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + console.error(error); + } + } + let filename = "Seite_" + (idx + 1) + "_" + pageElement.type + ".png"; + if (pageElement.type === "linechart" && pageElement.showPercentageChangeToPrevTimestamp) { + // two elements with same type on one page + // use a different filename for one of them so we don't overwrite the other image + filename = filename.replace(".png", "-proz.Veraenderung.png"); + } + zip.file(filename, dataURItoBlob(imageDataUrl), ""); + } + } + } + let zipFileName = getCurrentDateAndTime() + "_Kommonitor-Report-Grafiken"; + zip.generateAsync({ type: "blob" }).then(function (content) { + saveAs(content, zipFileName + ".zip"); + $scope.loadingData = false; + $timeout(function () { + $scope.$digest(); + }); + }); + }; + let sections = []; // one section per page for now, since this is an easy way to create page breaks + $scope.generateWordReport = async function () { + // see docx documentation for more info about the format: + // https://docx.js.org/#/?id=basic-usage + let font = "Calibri"; + for (let [idx, page] of $scope.config.pages.entries()) { + let paragraphs = []; + let pageDom = document.querySelector("#reporting-overview-page-" + idx); + for (let pageElement of page.pageElements) { + let pageElementDimensionsPx = calculateDimensions(pageElement.dimensions, "px"); + let pageElementDimensionsTwip = calculateDimensions(pageElement.dimensions, "twip"); + let pageElementDimensionsEmu = calculateDimensions(pageElement.dimensions, "emu"); + switch (pageElement.type) { + case "indicatorTitle-landscape": { + let paragraph = new docx.Paragraph({ + children: [ + new docx.TextRun({ + text: pageElement.text, + bold: true, + font: font, + size: 32 // 16pt + }) + ], + frame: { + position: { + x: pageElementDimensionsTwip.left, + y: pageElementDimensionsTwip.top, + }, + width: pageElementDimensionsTwip.width, + height: pageElementDimensionsTwip.height, + anchor: { + horizontal: docx.FrameAnchorType.MARGIN, + vertical: docx.FrameAnchorType.MARGIN, + }, + alignment: { + x: docx.HorizontalPositionAlign.LEFT, + y: docx.VerticalPositionAlign.TOP, + } + } + }); + paragraphs.push(paragraph); + break; + } + case "communeLogo-landscape": { + // only add logo if one was selected + if (pageElement.src && pageElement.src.length) { + let paragraph = new docx.Paragraph({ + children: [ + new docx.ImageRun({ + data: dataURItoBlob(pageElement.src), + transformation: { + width: pageElementDimensionsPx.width, + height: pageElementDimensionsPx.height + }, + floating: { + horizontalPosition: { + offset: pageElementDimensionsEmu.left, + }, + verticalPosition: { + offset: pageElementDimensionsEmu.top, + } + }, + }) + ] + }); + paragraphs.push(paragraph); + } + break; + } + case "dataTimestamp-landscape": + case "dataTimeseries-landscape": + case "reachability-subtitle-landscape": { + let paragraph = new docx.Paragraph({ + children: [ + new docx.TextRun({ + text: pageElement.text, + font: font, + size: 32 // 16pt + }) + ], + frame: { + position: { + x: pageElementDimensionsTwip.left, + y: pageElementDimensionsTwip.top, + }, + width: pageElementDimensionsTwip.width, + height: pageElementDimensionsTwip.height, + anchor: { + horizontal: docx.FrameAnchorType.MARGIN, + vertical: docx.FrameAnchorType.MARGIN, + }, + alignment: { + x: docx.HorizontalPositionAlign.LEFT, + y: docx.VerticalPositionAlign.TOP, + } + } + }); + paragraphs.push(paragraph); + break; + } + case "footerHorizontalSpacer-landscape": + // empty paragraph with border top + let paragraph = new docx.Paragraph({ + children: [], + frame: { + position: { + x: pageElementDimensionsTwip.left, + y: pageElementDimensionsTwip.top, + }, + width: pageElementDimensionsTwip.width, + height: pageElementDimensionsTwip.height, + anchor: { + horizontal: docx.FrameAnchorType.MARGIN, + vertical: docx.FrameAnchorType.MARGIN, + }, + alignment: { + x: docx.HorizontalPositionAlign.LEFT, + y: docx.VerticalPositionAlign.TOP, + } + }, + border: { + top: { + color: "#949494", + space: 1, + style: docx.BorderStyle.SINGLE, + size: 6 + } + } + }); + paragraphs.push(paragraph); + break; + case "footerCreationInfo-landscape": { + let paragraph = new docx.Paragraph({ + children: [ + new docx.TextRun({ + text: pageElement.text, + font: font, + size: 32 // 16pt + }) + ], + frame: { + position: { + x: pageElementDimensionsTwip.left, + y: pageElementDimensionsTwip.top, + }, + width: pageElementDimensionsTwip.width, + height: pageElementDimensionsTwip.height, + anchor: { + horizontal: docx.FrameAnchorType.MARGIN, + vertical: docx.FrameAnchorType.MARGIN, + }, + alignment: { + x: docx.HorizontalPositionAlign.LEFT, + y: docx.VerticalPositionAlign.TOP, + } + } + }); + paragraphs.push(paragraph); + break; + } + case "pageNumber-landscape": { + let paragraph = new docx.Paragraph({ + children: [ + new docx.TextRun({ + text: "Seite " + (idx + 1), + font: font, + size: 32 // 16pt + }, new docx.PageBreak()) + ], + frame: { + position: { + x: pageElementDimensionsTwip.left, + y: pageElementDimensionsTwip.top, + }, + width: pageElementDimensionsTwip.width, + height: pageElementDimensionsTwip.height, + anchor: { + horizontal: docx.FrameAnchorType.MARGIN, + vertical: docx.FrameAnchorType.MARGIN, + }, + alignment: { + x: docx.HorizontalPositionAlign.LEFT, + y: docx.VerticalPositionAlign.TOP, + } + } + }); + paragraphs.push(paragraph); + break; + } + case "map": + case "barchart": + case "linechart": { + let pElementDom; + if (pageElement.type === "linechart") { + let arr = pageDom.querySelectorAll(".type-linechart"); + if (pageElement.showPercentageChangeToPrevTimestamp) { + pElementDom = arr[1]; + } + else { + pElementDom = arr[0]; + } + } + else { + pElementDom = pageDom.querySelector("#reporting-overview-page-" + idx + "-" + pageElement.type); + } + let instance = echarts.getInstanceByDom(pElementDom); + let imageDataUrl = instance.getDataURL({ + type: "png", + pixelRatio: $scope.echartsImgPixelRatio + }); + if ($scope.config.template.name === "A4-landscape-reachability") { + try { + imageDataUrl = await $scope.createReachabilityMapImage(pageDom, pageElement, imageDataUrl); + } + catch (error) { + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + console.error(error); + } + } + let blob = dataURItoBlob(imageDataUrl); + let paragraph = new docx.Paragraph({ + children: [ + new docx.ImageRun({ + data: blob, + transformation: { + width: pageElementDimensionsPx.width, + height: pageElementDimensionsPx.height + }, + floating: { + horizontalPosition: { + offset: pageElementDimensionsEmu.left, + }, + verticalPosition: { + offset: pageElementDimensionsEmu.top, + }, + behindDocument: true + }, + }) + ] + }); + paragraphs.push(paragraph); + break; + } + case "overallAverage": + case "selectionAverage": { + let paragraph = new docx.Paragraph({ + children: [ + new docx.TextRun({ + text: "Durchschnitt", + font: font, + size: 28 // 14pt + }), + new docx.TextRun({ + text: pageElement.type === "overallAverage" ? "Gesamtstadt" : "Selektion", + size: 28, + font: font, + break: 1, // 14pt + }), + new docx.TextRun({ + text: pageElement.text.toString(), + size: 28, + font: font, + break: 1 // 14pt + }) + ], + frame: { + position: { + x: pageElementDimensionsTwip.left, + y: pageElementDimensionsTwip.top, + }, + width: pageElementDimensionsTwip.width, + height: pageElementDimensionsTwip.height, + anchor: { + horizontal: docx.FrameAnchorType.MARGIN, + vertical: docx.FrameAnchorType.MARGIN, + }, + alignment: { + x: docx.HorizontalPositionAlign.LEFT, + y: docx.VerticalPositionAlign.TOP, + } + }, + border: { + top: { + color: "#949494", + space: 1, + style: docx.BorderStyle.SINGLE, + size: 6 + }, + right: { + color: "#949494", + space: 1, + style: docx.BorderStyle.SINGLE, + size: 6 + }, + bottom: { + color: "#949494", + space: 1, + style: docx.BorderStyle.SINGLE, + size: 6 + }, + left: { + color: "#949494", + space: 1, + style: docx.BorderStyle.SINGLE, + size: 6 + }, + } + }); + paragraphs.push(paragraph); + break; + } + case "overallChange": + case "selectionChange": { + let paragraph = new docx.Paragraph({ + children: [ + new docx.TextRun({ + text: "Durchschnittliche", + font: font, + size: 28 // 14pt + }), + new docx.TextRun({ + text: "Veränderung", + font: font, + break: 1, + size: 28 // 14pt + }), + new docx.TextRun({ + text: pageElement.type === "overallChange" ? "Gesamtstadt" : "Selektion", + break: 1, + font: font, + size: 28 // 14pt + }), + new docx.TextRun({ + text: pageElement.text.toString(), + break: 1, + font: font, + size: 28 // 14pt + }) + ], + frame: { + position: { + x: pageElementDimensionsTwip.left, + y: pageElementDimensionsTwip.top, + }, + width: pageElementDimensionsTwip.width, + height: pageElementDimensionsTwip.height, + anchor: { + horizontal: docx.FrameAnchorType.MARGIN, + vertical: docx.FrameAnchorType.MARGIN, + }, + alignment: { + x: docx.HorizontalPositionAlign.LEFT, + y: docx.VerticalPositionAlign.TOP, + } + }, + border: { + top: { + color: "#949494", + space: 1, + style: docx.BorderStyle.SINGLE, + size: 6 + }, + right: { + color: "#949494", + space: 1, + style: docx.BorderStyle.SINGLE, + size: 6 + }, + bottom: { + color: "#949494", + space: 1, + style: docx.BorderStyle.SINGLE, + size: 6 + }, + left: { + color: "#949494", + space: 1, + style: docx.BorderStyle.SINGLE, + size: 6 + }, + } + }); + paragraphs.push(paragraph); + break; + } + case "textInput": { + let paragraph = new docx.Paragraph({ + children: [ + new docx.TextRun({ + text: pageElement.text, + font: font, + size: 24 // 12pt + }) + ], + frame: { + position: { + x: pageElementDimensionsTwip.left, + y: pageElementDimensionsTwip.top, + }, + width: pageElementDimensionsTwip.width, + height: pageElementDimensionsTwip.height, + anchor: { + horizontal: docx.FrameAnchorType.MARGIN, + vertical: docx.FrameAnchorType.MARGIN, + }, + alignment: { + x: docx.HorizontalPositionAlign.LEFT, + y: docx.VerticalPositionAlign.TOP, + } + } + }); + paragraphs.push(paragraph); + break; + } + case "datatable": { + let tableDom = document.querySelector("#reporting-overview-page-" + idx + "-" + pageElement.type + " table"); + let headerFieldsDom = tableDom.querySelectorAll("thead th"); + let tableRowsDom = tableDom.querySelectorAll("tbody tr"); + // table to create + let table = { + columnWidths: [], + rows: [], + float: { + absoluteHorizontalPosition: pageElementDimensionsTwip.left, + absoluteVerticalPosition: pageElementDimensionsTwip.top, + overlap: docx.OverlapType.NEVER, + }, + }; + let headerFields = []; + let headerFieldNames = []; + for (let fieldDom of headerFieldsDom) { + let widthInTwip = pxToTwip(fieldDom.offsetWidth); + let fieldContent = fieldDom.innerText; + headerFieldNames.push(fieldContent); + let field = new docx.TableCell({ + width: { + size: widthInTwip, + type: docx.WidthType.DXA, + }, + verticalAlign: docx.VerticalAlign.CENTER, + children: [new docx.Paragraph({ + alignment: docx.AlignmentType.CENTER, + children: [new docx.TextRun({ + text: fieldContent, + font: font, + bold: true + })] + })], + }); + headerFields.push(field); + table.columnWidths.push(widthInTwip); + } + let headerRow = new docx.TableRow({ + children: headerFields, + }); + table.rows.push(headerRow); + for (let rowDom of tableRowsDom) { // excluding header + let fieldsDom = rowDom.querySelectorAll("td"); + let fields = []; + for (let [idx, fieldDom] of fieldsDom.entries()) { + let fieldContent = fieldDom.innerText; + let paragraph = new docx.Paragraph({ + text: fieldContent, + alignment: headerFieldNames[idx] === "Wert" ? + docx.AlignmentType.RIGHT : + headerFieldNames[idx] === "Zeitpunkt" ? + docx.AlignmentType.CENTER : + docx.AlignmentType.LEFT, // "Bereich" + }); + let field = new docx.TableCell({ + width: { + size: table.columnWidths[idx], + type: docx.WidthType.DXA, + }, + verticalAlign: docx.VerticalAlign.CENTER, + children: [paragraph], + }); + fields.push(field); + } + let row = new docx.TableRow({ + children: fields, + }); + table.rows.push(row); + } + paragraphs.push(new docx.Table(table)); // technically this is not a paragraph, but we only add it as a child of section below + break; + } + } + } + let section = { + properties: { + type: docx.SectionType.NEXT_PAGE, + page: { + margin: { + top: 0, + right: 0, + bottom: 0, + left: 0, + }, + pageNumbers: { + start: (idx + 1), + formatType: docx.NumberFormat.DECIMAL, + }, + size: { + orientation: docx.PageOrientation.LANDSCAPE, + }, + }, + }, + children: [...paragraphs], + }; + sections.push(section); + } + let docxConfig = { + sections: [...sections] + }; + let doc = new docx.Document(docxConfig); + let filename = getCurrentDateAndTime() + "_KomMonitor-Report"; + // Used to export the file into a .docx file + docx.Packer.toBlob(doc).then((blob) => { + saveAs(blob, filename + ".docx"); + $scope.loadingData = false; + $timeout(function () { + $scope.$digest(); + }); + }); + }; + $scope.createReachabilityMapImage = async function (pageDom, pageElement, echartsImgSrc) { + let result; + // screenshot leaflet map and merge it with echarts image + // remove page offset temporarily + pageElement.leafletMap.getContainer().style.top = "0px"; + pageElement.leafletMap.getContainer().style.left = "0px"; + // wait for print process to finish + let format = 'image'; + let overridedPluginOptions = { + mimeType: 'image/jpeg' + }; + let leafletMapScreenshot = await pageElement.leafletMap.simpleMapScreenshoter.takeScreen(format, overridedPluginOptions); + pageElement.leafletMap.getContainer().style.top = "90px"; + pageElement.leafletMap.getContainer().style.left = "15px"; + // combine images + let canvas = document.createElement('canvas'); + let ctx = canvas.getContext('2d'); + let pageElementDimensionsPx = calculateDimensions(pageElement.dimensions, "px"); + canvas.width = pageElementDimensionsPx.width; + canvas.height = pageElementDimensionsPx.height; + // we have to draw layers in order + let leafletMapImg = new Image(); + // leafletMapImg.crossOrigin = "anonymous"; + leafletMapImg.width = canvas.width; + leafletMapImg.height = canvas.height; + let leafletMapImgDrawn = new Promise((resolve, reject) => { + leafletMapImg.onload = function () { + ctx.drawImage(leafletMapImg, 0, 0, canvas.width, canvas.height); + resolve(); + }; + }); + leafletMapImg.src = leafletMapScreenshot; + await leafletMapImgDrawn; + let echartsImg = new Image(); + // echartsImg.crossOrigin = "anonymous"; + let echartsImgDrawn = new Promise((resolve, reject) => { + echartsImg.onload = function () { + ctx.drawImage(echartsImg, 0, 0, canvas.width, canvas.height); + resolve(); + }; + }); + echartsImg.src = echartsImgSrc; + await echartsImgDrawn; + let mapAttributionImg = pageDom.querySelector(".map-attribution > img"); + ctx.fillStyle = "white"; + ctx.fillRect(0, canvas.height - mapAttributionImg.height, mapAttributionImg.width, mapAttributionImg.height); + ctx.drawImage(mapAttributionImg, 0, canvas.height - mapAttributionImg.height); + let mapLegendImg = pageDom.querySelector(".map-legend > img"); + ctx.fillRect(canvas.width - mapLegendImg.width, canvas.height - mapLegendImg.height, mapLegendImg.width, mapLegendImg.height); + ctx.drawImage(mapLegendImg, canvas.width - mapLegendImg.width, canvas.height - mapLegendImg.height); + result = canvas.toDataURL(); + return result; + }; + function pxToMilli(px) { + // our preview is 830px wide + // px / 830 gives us the percentage from the left edge, which can then be stretched to fit the A4 page + // This is the short version of: + // px / pxPerMillimeter * pxPerMillimeter * 297 / 830, where pxPerMillimeter = (deviceScreenPpi / 2.54) * 10 + // pxPerMillimeter cancels out there, so it doesn't matter. + let result = parseInt(px, 10) / 830 * 297; + result = Math.round(result * 100) / 100; + return result; + } + function pxToTwip(px) { + let result = parseInt(px, 10) * 15; // 1px = 0.75pt = 15twip + return result * $scope.pxPerMilli * 297 / 830; // scale from 830px to A4 page + } + function twipToEmus(value) { + // see: https://startbigthinksmall.wordpress.com/2010/01/04/points-inches-and-emus-measuring-units-in-office-open-xml/ + return value * 635; + } + // from: https://stackoverflow.com/a/46406124 + function dataURItoBlob(dataURI) { + // convert base64 to raw binary data held in a string + // doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this + var byteString = atob(dataURI.split(',')[1]); + // separate out the mime component + var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]; + // write the bytes of the string to an ArrayBuffer + var ab = new ArrayBuffer(byteString.length); + // create a view into the buffer + var ia = new Uint8Array(ab); + // set the bytes of the buffer to the correct values + for (var i = 0; i < byteString.length; i++) { + ia[i] = byteString.charCodeAt(i); + } + // write the ArrayBuffer to a blob, and you're done + var blob = new Blob([ab], { type: mimeString }); + return blob; + } + function calculateDimensions(dimensions, unit) { + let result = {}; + if (unit === "px") { + // also scale our 830px preview up to A4 here + let scalefactor = $scope.pxPerMilli * 297 / 830; + result.top = dimensions.top && parseInt(dimensions.top, 10) * scalefactor; + result.bottom = dimensions.bottom && parseInt(dimensions.bottom, 10) * scalefactor; + result.left = dimensions.left && parseInt(dimensions.left, 10) * scalefactor; + result.right = dimensions.right && parseInt(dimensions.right, 10) * scalefactor; + result.width = dimensions.width && parseInt(dimensions.width, 10) * scalefactor; + result.height = dimensions.height && parseInt(dimensions.height, 10) * scalefactor; + } + if (unit === "milli") { + result.top = dimensions.top && pxToMilli(dimensions.top); + result.bottom = dimensions.bottom && pxToMilli(dimensions.bottom); + result.left = dimensions.left && pxToMilli(dimensions.left); + result.right = dimensions.right && pxToMilli(dimensions.right); + result.width = dimensions.width && pxToMilli(dimensions.width, 10); + ; + result.height = dimensions.height && pxToMilli(dimensions.height, 10); + } + if (unit === "twip") { + result.top = dimensions.top && docx.convertMillimetersToTwip(pxToMilli(dimensions.top)); + result.bottom = dimensions.bottom && docx.convertMillimetersToTwip(pxToMilli(dimensions.bottom)); + result.left = dimensions.left && docx.convertMillimetersToTwip(pxToMilli(dimensions.left)); + result.right = dimensions.right && docx.convertMillimetersToTwip(pxToMilli(dimensions.right)); + result.width = dimensions.width && docx.convertMillimetersToTwip(pxToMilli(dimensions.width, 10)); + result.height = dimensions.height && docx.convertMillimetersToTwip(pxToMilli(dimensions.height, 10)); + } + if (unit === "emu") { + result.top = dimensions.top && twipToEmus(docx.convertMillimetersToTwip(pxToMilli(dimensions.top))); + result.bottom = dimensions.bottom && twipToEmus(docx.convertMillimetersToTwip(pxToMilli(dimensions.bottom))); + result.left = dimensions.left && twipToEmus(docx.convertMillimetersToTwip(pxToMilli(dimensions.left))); + result.right = dimensions.right && twipToEmus(docx.convertMillimetersToTwip(pxToMilli(dimensions.right))); + result.width = dimensions.width && twipToEmus(docx.convertMillimetersToTwip(pxToMilli(dimensions.width, 10))); + result.height = dimensions.height && twipToEmus(docx.convertMillimetersToTwip(pxToMilli(dimensions.height, 10))); + } + return result; + } + function calculateScreenDpi() { + // create a hidden div that is one inch high + let div = document.createElement("div"); + div.style.height = "1in"; + div.style.position = "absolute"; + div.style.left = "-100%"; + div.style.top = "-100%"; + document.getElementsByTagName("body")[0].append(div); + const dpi = div.offsetHeight; + div.style.display = "none"; + return dpi; + } + } + ] +}); +//# sourceMappingURL=reporting-overview.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingOverview/reporting-overview.component.js.map b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingOverview/reporting-overview.component.js.map new file mode 100644 index 000000000..74603611d --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingOverview/reporting-overview.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"reporting-overview.component.js","sourceRoot":"","sources":["reporting-overview.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,SAAS,CAAC,mBAAmB,EAAE;IAClE,WAAW,EAAG,yHAAyH;IACvI,UAAU,EAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,+BAA+B,EAAE,gCAAgC;QACvH,SAAS,2BAA2B,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,6BAA6B,EAAE,8BAA8B;YAEjI;;;;;;;;;;;;;;;;;;cAkBE;YACF,MAAM,CAAC,MAAM,GAAG;gBACf,gBAAgB,EAAE;gBACjB,IAAI;gBACJ,kBAAkB;gBAClB,gBAAgB;gBAChB,IAAI;iBACJ;gBACD,KAAK,EAAE,EAAE;gBACT,QAAQ,EAAE,EAAE;aACZ,CAAC;YACF,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;YAC3B,MAAM,CAAC,oBAAoB,GAAG,CAAC,CAAC;YAEhC,MAAM,CAAC,UAAU,GAAG,UAAS,IAAI;gBAChC,IAAI,kBAAkB,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;gBACjC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;gBACf,IAAG,kBAAkB,EAAE;oBACtB,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;iBAC1B;qBAAM;oBACN,MAAM,CAAC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAA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IAAI,CAAC,CAAC,CAAC,CAAC;oBACvG,MAAM,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,IAAI,UAAU,CAAC,IAAI,CAAC,wBAAwB,CAAC,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;oBAC1G,MAAM,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,IAAI,UAAU,CAAC,IAAI,CAAC,wBAAwB,CAAC,SAAS,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;oBAC9G,MAAM,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,IAAI,UAAU,CAAC,IAAI,CAAC,wBAAwB,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;iBACjH;gBACD,OAAO,MAAM,CAAC;YACf,CAAC;YAGD,SAAS,kBAAkB;gBAC1B,4CAA4C;gBAC5C,IAAI,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;gBACvC,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC;gBACzB,GAAG,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAC;gBAChC,GAAG,CAAC,KAAK,CAAC,IAAI,GAAG,OAAO,CAAC;gBACzB,GAAG,CAAC,KAAK,CAAC,GAAG,GAAG,OAAO,CAAC;gBACxB,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gBACrD,MAAM,GAAG,GAAG,GAAG,CAAC,YAAY,CAAA;gBAC5B,GAAG,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;gBAC3B,OAAO,GAAG,CAAA;YACX,CAAC;QACF,CAAC;KACD;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingOverview/reporting-overview.component.ts b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingOverview/reporting-overview.component.ts new file mode 100644 index 000000000..7d2946af2 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingOverview/reporting-overview.component.ts @@ -0,0 +1,1840 @@ +angular.module('reportingOverview').component('reportingOverview', { + templateUrl : "components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingOverview/reporting-overview.template.html", + controller : ['$scope', '__env', '$timeout', '$http', 'kommonitorDataExchangeService', 'kommonitorDiagramHelperService', + function ReportingOverviewController($scope, __env, $timeout, $http, kommonitorDataExchangeService, kommonitorDiagramHelperService) { + + /* + { + indicators: [ + {...}, + {...}, + ... + ], + pages: [ + { + indicatorName: ... // e.g for sorting pages + spatialUnitName: .... + pageElements: [...] + }, + {...}, + ... + ], + template: {...} // clean version of the template, without indicator data + } + */ + $scope.config = { + templateSections: [ + // { + // indicator: "", + // poiLayer: "" + // } + ], + pages: [], + template: {} + }; + $scope.loadingData = false; + $scope.echartsImgPixelRatio = 2; + + $scope.initialize = function(data) { + let configFileSelected = data[0]; + data = data[1]; + if(configFileSelected) { + $scope.importConfig(data); + } else { + $scope.config.template = JSON.parse(JSON.stringify(data)); + $scope.config.pages = $scope.config.template.pages; + } + let deviceScreenDpi = calculateScreenDpi(); + $scope.pxPerMilli = deviceScreenDpi / 25.4 // /2.54 --> cm, /10 --> mm + } + + $scope.sortableConfig = { + onEnd: function (e) { + // nothing for now, config elements get reordered automatically + } + }; + + $scope.$on("reportingInitializeOverview", function(event, data) { + // data is a nested array at this point [ [ { template object } ] ] + $scope.initialize(data); + }) + + $scope.onConfigureNewIndicatorClicked = function() { + $scope.$emit('reportingConfigureNewIndicatorClicked', [$scope.config.template]); + } + + $scope.onConfigureNewPoiLayerClicked = function() { + $scope.$emit('reportingConfigureNewPoiLayerClicked', [$scope.config.template]); + } + + $scope.onBackToTemplateSelectionClicked = function() { + $scope.$emit('reportingBackToTemplateSelectionClicked') + } + + $scope.$on("reportingIndicatorConfigurationCompleted", function(event, data) { + $scope.loadingData = true; + let [indicator, template] = data; + + let templateSection = { + indicatorName: indicator ? indicator.indicatorName : "", + indicatorId: indicator ? indicator.indicatorId : "", + poiLayerName: "", + spatialUnitName: template.spatialUnitName, + absoluteLabelPositions: template.absoluteLabelPositions, + echartsRegisteredMapNames: template.echartsRegisteredMapNames, + echartsMaps: [] + } + for(let page of template.pages) { + page.templateSection = templateSection; + } + // remove the placeholder template if this is the first section that gets added) + $scope.config.pages = $scope.config.pages.filter( page => { + if(page.hasOwnProperty("templateSection")) { + return page.templateSection.hasOwnProperty("indicatorName"); + } else { + return false; + } + }); + // append to array + $scope.config.pages.push(...template.pages); + + $scope.config.templateSections.push(templateSection); + + // setup pages after dom exists + // at this point we still have all the echarts maps registered + $scope.setupNewPages($scope.config.templateSections.at(-1)); + }); + + $scope.$on("reportingPoiLayerConfigurationCompleted", function(event, data) { + $scope.loadingData = true; + // add indicator to 'added indicators' + let [poiLayer, indicator, template] = data; + + let templateSection = { + indicatorName: indicator ? indicator.indicatorName : "", + indicatorId: indicator ? indicator.indicatorId : "", + poiLayerName: poiLayer.datasetName, + spatialUnitName: template.spatialUnitName, + absoluteLabelPositions: template.absoluteLabelPositions, + echartsRegisteredMapNames: template.echartsRegisteredMapNames, + echartsMaps: [], + isochronesRangeType: template.isochronesRangeType, + isochronesRangeUnits: template.isochronesRangeUnits + } + for(let page of template.pages) { + page.templateSection = templateSection; + } + // remove all pages without property poiLayerName (clean template) + $scope.config.pages = $scope.config.pages.filter( page => { + if(page.hasOwnProperty("templateSection")) { + return page.templateSection.hasOwnProperty("poiLayerName"); + } else { + return false; + } + }); + // append to array + $scope.config.pages.push(...template.pages); + $scope.config.templateSections.push(templateSection); + + // setup pages after dom exists + // at this point we still have all the echarts maps registered + $scope.setupNewPages($scope.config.templateSections.at(-1)); + }); + + $scope.removeTemplateSection = function(idx) { + $scope.config.templateSections.splice(idx, 1) + + // show empty template if this was the last indicator + if($scope.config.templateSections.length === 0) { + $scope.config.pages = $scope.config.template.pages; + } + } + + + $scope.$watchCollection('config.templateSections', function(newVal, oldVal) { + + if(newVal.length < oldVal.length) { // removed + // find removed section + let difference = oldVal + .filter(x => !newVal.includes(x)) + .concat(newVal.filter(x => !oldVal.includes(x))); + + let removedSection = difference[0]; + // remove all pages for that section + $scope.config.pages = $scope.config.pages.filter( page => { + if(!page.hasOwnProperty("templateSection")) return true; // for placeholder + + return page.templateSection.indicatorId !== removedSection.indicatorId || + page.templateSection.spatialUnitId !== removedSection.spatialUnitId || + page.templateSection.poiLayerName !== removedSection.poiLayerName + }); + } + if(newVal.length === oldVal.length) { // order changed + // sort pages according to newVal + let sorted = []; + for(let section of newVal) { + for(let page of $scope.config.pages) { + if(page.templateSection.indicatorId === section.indicatorId && + page.templateSection.spatialUnitId === section.spatialUnitId && + page.templateSection.poiLayerName === section.poiLayerName) { + + sorted.push(page); + } + } + } + $scope.config.pages = sorted; + } + }); + + + + + $scope.setupNewPages = function(templateSection) { + + $timeout(async function(templateSection) { + if(!templateSection.poiLayerName) { + + // for indicator without poi layer + let indicatorId = templateSection.indicatorId; + let spatialUnit, featureCollection, features, geoJSON; + let isFirstPageToAdd = true; + for(let [idx, page] of $scope.config.pages.entries()) { + + if(page.templateSection.indicatorId !== indicatorId) { + continue; // only do changes to new pages + } else { + // Indicator and spatial unit are the same for all added pages + // We only need to query features on the first page that we add + if(isFirstPageToAdd) { + isFirstPageToAdd = false; + spatialUnit = await $scope.getSpatialUnitByIndicator(indicatorId, page.templateSection.spatialUnitName) + featureCollection = await $scope.queryFeatures(indicatorId, spatialUnit); + features = $scope.createLowerCaseNameProperty(featureCollection.features); + geoJSON = { features: features }; + + } + } + + let pageDom = document.querySelector("#reporting-overview-page-" + idx); + for(let pageElement of page.pageElements) { + // usually each type is included only once per page, but there is an exception for linecharts in area specific part of timeseries template + // for now we more or less hardcode this, but it might have to change in the future + let pElementDom; + if(pageElement.type === "linechart") { + let arr = pageDom.querySelectorAll(".type-linechart"); + if(pageElement.showPercentageChangeToPrevTimestamp) { + pElementDom = arr[1]; + } else { + pElementDom = arr[0]; + } + } else { + pElementDom = pageDom.querySelector("#reporting-overview-page-" + idx + "-" + pageElement.type) + } + + // recreate boxplots, itemNameFormatter did not get transferred + if(pageElement.type === "linechart" && pageElement.showBoxplots) { + let xAxisLabels = pageElement.echartsOptions.xAxis[0].data; + pageElement.echartsOptions.dataset[1].transform.config = { + itemNameFormatter: function (params) { + return xAxisLabels[params.value]; + } + } + } + + if(pageElement.type === "map" || pageElement.type === "barchart" || pageElement.type === "linechart") { + let instance = echarts.init( pElementDom ); + + + if(pageElement.type === "map") { + + if(page.area && page.area.length) { + // at this point we have not yet set echarts options, so we provide them as an extra parameter + $scope.filterMapByArea(instance, pageElement.echartsOptions, page.area, geoJSON.features) + } else { + // recreate label positions + pageElement.echartsOptions.labelLayout = function(feature) { + // Set fixed position for labels that were previously dragged by user + // For all other labels try to avoid overlaps + let names = page.templateSection.absoluteLabelPositions.map(el=>el.name) + let text = feature.text.split("\n")[0] // area name is the first line + if(names.includes(text)) { + let idx = names.indexOf(text) + return { + x: page.templateSection.absoluteLabelPositions[idx].x, + y: page.templateSection.absoluteLabelPositions[idx].y, + draggable: false // Don't allow label dragging in overview, we could have different spatial units here + } + } else { + return { + moveOverlap: 'shiftY', + x: feature.rect.x + feature.rect.width / 2, + draggable: false + } + } + } + } + } + instance.setOption(pageElement.echartsOptions) + } + + if(pageElement.type === "overallAverage") { + pageDom.querySelector(".type-overallAverage").style.border = "none"; + } + + if(pageElement.type === "selectionAverage") { + pageDom.querySelector(".type-selectionAverage").style.border = "none"; + } + + if(pageElement.type === "mapLegend") { + pageElement.isPlaceholder = false; + pageDom.querySelector(".type-mapLegend").style.display = "none"; + } + + if(pageElement.type === "overallChange") { + let wrapper = pageDom.querySelector(".type-overallChange") + wrapper.style.border = "none"; + wrapper.style.left = "670px"; + wrapper.style.width = "130px"; + wrapper.style.height = "100px"; + } + + if(pageElement.type === "selectionChange") { + let wrapper = pageDom.querySelector(".type-selectionChange") + wrapper.style.border = "none"; + wrapper.style.left = "670px"; + wrapper.style.width = "130px"; + wrapper.style.height = "100px"; + } + + if(pageElement.type === "datatable") { + $scope.createDatatablePage(pElementDom, pageElement); + } + } + } + $scope.loadingData = false; + $timeout(function(){ + $scope.$digest(); + }); + } else { + $scope.handleSetupNewPagesForReachability(templateSection) + } + }, 0, false, templateSection); + } + + + + $scope.handleSetupNewPagesForReachability = async function(templateSection) { + let poiLayerName = templateSection.poiLayerName; + let spatialUnit, featureCollection, features, geoJSON, indicatorId; + // if indicator was chosen + if( templateSection.indicatorId) { + indicatorId = templateSection.indicatorId; + } + let isFirstPageToAdd = true; + for(let [idx, page] of $scope.config.pages.entries()) { + + if(page.templateSection.poiLayerName !== poiLayerName) { + continue; // only do changes to new pages + } else { + // PoiLayer, Indicator and spatial unit are the same for all added pages + // We only need to query features on the first page that we add + if(isFirstPageToAdd) { + isFirstPageToAdd = false; + if(indicatorId) { + spatialUnit = await $scope.getSpatialUnitByIndicator(indicatorId, page.templateSection.spatialUnitName); + featureCollection = await $scope.queryFeatures(indicatorId, spatialUnit); + } else { + spatialUnit = await $scope.getSpatialUnitByName(page.templateSection.spatialUnitName); + featureCollection = await $scope.queryFeatures(undefined, spatialUnit); + } + + features = $scope.createLowerCaseNameProperty(featureCollection.features); + geoJSON = { features: features }; + + } + } + + let pageDom = document.querySelector("#reporting-overview-page-" + idx); + for(let pageElement of page.pageElements) { + let pElementDom = pageDom.querySelector("#reporting-overview-page-" + idx + "-" + pageElement.type) + + if(pageElement.type === "map") { + let instance = echarts.init( pElementDom ); + + if(page.area && page.area.length) { + // at this point we have not yet set echarts options, so we provide them as an extra parameter + $scope.filterMapByArea(instance, pageElement.echartsOptions, page.area, geoJSON.features) + } else { + // recreate label positions + pageElement.echartsOptions.labelLayout = function(feature) { + // Set fixed position for labels that were previously dragged by user + // For all other labels try to avoid overlaps + let names = page.templateSection.absoluteLabelPositions.map(el=>el.name) + let text = feature.text.split("\n")[0] // area name is the first line + if(names.includes(text)) { + let idx = names.indexOf(text) + return { + x: page.templateSection.absoluteLabelPositions[idx].x, + y: page.templateSection.absoluteLabelPositions[idx].y, + draggable: false // Don't allow label dragging in overview, we could have different spatial units here + } + } else { + return { + moveOverlap: 'shiftY', + x: feature.rect.x + feature.rect.width / 2, + draggable: false + } + } + } + } + + instance.setOption( pageElement.echartsOptions ) + + await $scope.initializeLeafletMap(page, pageElement, instance, spatialUnit) + } + } + } + $scope.loadingData = false; + $timeout(function(){ + $scope.$digest(); + }); + } + + $scope.initializeLeafletMap = async function(page, pageElement, map, spatialUnit) { + await $timeout(async function(page, pageElement, echartsMap, spatialUnit) { + let pageIdx = $scope.config.pages.indexOf(page); + let id = "reporting-overview-reachability-leaflet-map-container-" + pageIdx; + let pageDom = document.getElementById("reporting-overview-page-" + pageIdx); + let pageElementDom = document.getElementById("reporting-overview-page-" + pageIdx + "-map"); + let oldMapNode = document.getElementById(id); + if(oldMapNode) { + oldMapNode.remove(); + } + let div = document.createElement("div"); + div.id = id; + div.style.position = "absolute"; + div.style.left = pageElement.dimensions.left; + div.style.top = pageElement.dimensions.top; + div.style.width = pageElement.dimensions.width; + div.style.height = pageElement.dimensions.height; + div.style.zIndex = 10; + pageDom.appendChild(div); + let echartsOptions = echartsMap.getOption(); + + let leafletMap = L.map(div.id, { + zoomControl: false, + dragging: false, + doubleClickZoom: false, + boxZoom: false, + trackResize: false, + attributionControl: false, + // prevents leaflet form snapping to closest pre-defined zoom level. + // In other words, it allows us to set exact map extend by a (echarts) bounding box + zoomSnap: 0 + }); + + // from the docs, most of it is probably not needed + let screenshotterOptions = { + cropImageByInnerWH: true, // crop blank opacity from image borders + hidden: true, // hide screen icon + preventDownload: true, // prevent download on button click + domtoimageOptions: {}, // see options for dom-to-image + position: 'topleft', // position of take screen icon + screenName: 'screen', // string or function + hideElementsWithSelectors: ['.leaflet-control-container'], // by default hide map controls All els must be child of _map._container + mimeType: 'image/png', // used if format == image, + caption: null, // string or function, added caption to bottom of screen + captionFontSize: 15, + captionFont: 'Arial', + captionColor: 'black', + captionBgColor: 'white', + captionOffset: 5, + // callback for manually edit map if have warn: "May be map size very big on that zoom level, we have error" + // and screenshot not created + onPixelDataFail: async function({ node, plugin, error, mapPane, domtoimageOptions }) { + // Solutions: + // decrease size of map + // or decrease zoom level + // or remove elements with big distanses + // and after that return image in Promise - plugin._getPixelDataOfNormalMap + return plugin._getPixelDataOfNormalMap(domtoimageOptions) + } + } + + leafletMap.simpleMapScreenshoter = L.simpleMapScreenshoter(screenshotterOptions).addTo(leafletMap) + + // manually create a field for attribution so we can control the z-index. + let prevAttributionDiv = pageDom.querySelector(".map-attribution") + if(prevAttributionDiv) prevAttributionDiv.remove(); + let attrDiv = document.createElement("div") + attrDiv.classList.add("map-attribution") + attrDiv.style.position = "absolute"; + attrDiv.style.bottom = 0; + attrDiv.style.left = 0; + attrDiv.style.zIndex = 800; + let attrImg = await kommonitorDiagramHelperService.createReportingReachabilityMapAttribution(); + attrDiv.appendChild(attrImg); + pageElementDom.appendChild(attrDiv); + // also create the legend manually + let prevLegendDiv = pageDom.querySelector(".map-legend") + if(prevLegendDiv) prevLegendDiv.remove(); + let legendDiv = document.createElement("div") + legendDiv.classList.add("map-legend") + legendDiv.style.position = "absolute"; + legendDiv.style.bottom = 0; + legendDiv.style.right = 0; + legendDiv.style.zIndex = 800; + let isochronesRangeType = page.templateSection.isochronesRangeType; + let isochronesRangeUnits = page.templateSection.isochronesRangeUnits; + let legendImg = await kommonitorDiagramHelperService.createReportingReachabilityMapLegend(echartsOptions, spatialUnit, isochronesRangeType, isochronesRangeUnits); + legendDiv.appendChild(legendImg); + pageElementDom.appendChild(legendDiv) + + // we have the bbox stored in config + // pageElement.leafletBbox is invalid after export and import. Maybe because the prototype object gets removed... + // We create a new bounds object from the stored data + let bounds = L.latLngBounds(pageElement.leafletBbox._southWest, pageElement.leafletBbox._northEast); + leafletMap.fitBounds( bounds ); + + let osmLayer = new L.TileLayer.Grayscale("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", { + attribution: "Map data © OpenStreetMap contributors", + }); + osmLayer.addTo(leafletMap); + + // add leaflet map to pageElement in case we need it again later + pageElement.leafletMap = leafletMap; + + // can be used to check if positioning in echarts matches the one from leaflet + //let geoJsonLayer = L.geoJSON( $scope.geoJsonForReachability.features ) + //geoJsonLayer.addTo(leafletMap) + //let isochronesLayer = L.geoJSON( $scope.isochrones.features ) + //isochronesLayer.addTo(leafletMap); + + }, 0, true, page, pageElement, map, spatialUnit) + } + + $scope.getSpatialUnitByName = async function(spatialUnitName) { + let url; + url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/spatial-units" + // send request + return await $http({ + url: url, + method: "GET" + }).then(function successCallback(response) { + let spatialUnit = response.data.filter( el => { + return el.spatialUnitLevel === spatialUnitName; + }) + + if(spatialUnit.length === 1) + return spatialUnit[0] + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + console.error(error); + }); + } + + $scope.getSpatialUnitByIndicator = async function(indicatorId, spatialUnitName) { + let url; + url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/indicators/" + indicatorId; + // send request + return await $http({ + url: url, + method: "GET" + }).then(function successCallback(response) { + let spatialUnit = response.data.applicableSpatialUnits.filter( el => { + return el.spatialUnitName === spatialUnitName; + }) + if(spatialUnit.length === 1) return spatialUnit[0]; + + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + console.error(error); + }); + } + + + $scope.filterMapByArea = function(echartsInstance, echartsInstanceOptions, areaName, allFeatures) { + let mapName = echartsInstanceOptions.series[0].map; + // filter shown areas if we are in the area-specific part of the template + let features = allFeatures.filter ( el => { + return el.properties.name === areaName + }); + + echarts.registerMap(mapName, { features: features } ) + echartsInstance.setOption(echartsInstanceOptions) // set same options, but this updates the map + } + + + $scope.createDatatableSkeleton = function(colNamesArr) { + + let table = document.createElement("table"); + table.classList.add("table-striped") + table.classList.add("table-bordered") + + let thead = document.createElement("thead"); + let tbody = document.createElement("tbody"); + table.appendChild(thead); + table.appendChild(tbody); + + let headerRow = document.createElement("tr"); + + for(let colName of colNamesArr) { + let col = document.createElement("th"); + col.classList.add("text-center"); + col.innerText = colName; + headerRow.appendChild(col); + } + + headerRow.style.height = "25px"; + thead.appendChild(headerRow); + + return table; + } + + + $scope.createDatatablePage = function(pElementDom, pageElement) { + pElementDom.innerHTML = ""; + pElementDom.style.border = "none"; // hide dotted border from outer dom element + pElementDom.style.justifyContent = "flex-start"; // align table at top instead of center + // add data + let table = $scope.createDatatableSkeleton(pageElement.columnNames); + let tbody = table.querySelector("tbody") + // tabledata is a nested array with one sub-array per row + for(let row of pageElement.tableData) { + let tr = document.createElement("tr"); + tr.style.height = "25px"; + for(let i=0; i 0) { + pageElement.src = communeLogoSrc; + } + } + } + + $scope.config.template = config.template; + $scope.config.pages = config.pages; + $scope.config.templateSections = config.templateSections; + + // register echarts maps + for(let section of $scope.config.templateSections) { + for(let mapName of section.echartsRegisteredMapNames) { + if($scope.config.template.name === "A4-landscape-reachability") { + if(!mapName.includes(section.spatialUnitName)) { + continue; + } + if(!mapName.includes("_isochrones")) { + let geoJson = section.echartsMaps.filter( map => map.name === section.poiLayerName)[0].geoJson + echarts.registerMap(mapName, geoJson) + } else { + let geoJson = section.echartsMaps.filter( map => map.name === mapName)[0].geoJson + echarts.registerMap(mapName, geoJson) + } + } else { + if(!mapName.includes(section.spatialUnitName)) { + continue; + } + let geoJson = section.echartsMaps[0].geoJson + echarts.registerMap(mapName, geoJson) + } + } + } + for(let page of $scope.config.pages) { + for(let pageElement of page.pageElements) { + if(pageElement.type === "map" && pageElement.hasOwnProperty("echartsMaps")) { + for(let map of pageElement.echartsMaps) { + echarts.registerMap(map.name, map.geoJson) + } + } + } + } + $timeout(function(){ + $scope.$digest(); + }); + + for(let section of $scope.config.templateSections) { + $scope.setupNewPages(section); + } + } catch (error) { + console.error(error); + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error.message); + } + } + + $scope.exportConfig = function() { + try { + let jsonToExport = {}; + + let temp = JSON.stringify( $scope.config.pages, function(key, value) { + // Leaflet map contains cyclic object references so we have to remove it. + // We have to initialize the map again on import based on the stored boundingbox + if(key === "leafletMap") { + return undefined; + } else { + return value; + } + }) + + jsonToExport.pages = JSON.parse( temp ) + jsonToExport.template = angular.fromJson(angular.toJson( $scope.config.template )); + jsonToExport.templateSections = $scope.config.templateSections; + + // Only store commune logo once (in first page) + // It is base64 encoded and adds quite a bit to the file size + for(let [idx, page] of jsonToExport.pages.entries()) { + for(let pageElement of page.pageElements) { + if(pageElement.type === "communeLogo-landscape" && idx > 0) { + pageElement.src = ""; + } + } + } + + for(let section of jsonToExport.templateSections) { + let mapNames = [...new Set(section.echartsRegisteredMapNames)] + if($scope.config.template.name === "A4-landscape-reachability") { + let mapAdded = false; + for(let [idx, name] of mapNames.entries()) { + if(!name.includes(section.spatialUnitName)) { + continue; + } + // store all isochrones + if(name.includes("_isochrones")) { + let map = echarts.getMap(name) + section.echartsMaps.push({ + name: name, + geoJson: map.geoJson + }) + } + // First map with the correct spatial unit + // All other maps have the same geojson, so we only store them once + if(!mapAdded && name.includes(section.poiLayerName)) { + let map = echarts.getMap(mapNames[idx]) + section.echartsMaps.push({ + name: section.poiLayerName, + geoJson: map.geoJson + }) + mapAdded = true; + } + + } + } else { + for(let [idx, name] of mapNames.entries()) { + if(!name.includes(section.spatialUnitName)) { + continue; + } else { + // First map with the correct spatial unit + let map = echarts.getMap(mapNames[idx]) + section.echartsMaps.push({ + name: mapNames[idx], + geoJson: map.geoJson + }); + } + } + } + } + + let jsonString = "data:text/json;charset=utf-8," + encodeURIComponent( angular.toJson(jsonToExport) ); + // to download json, a DOM element is created, clicked and removed + let downloadAnchorNode = document.createElement('a'); + downloadAnchorNode.setAttribute("href", jsonString); + downloadAnchorNode.setAttribute("download", getCurrentDateAndTime() + "_KomMonitor-Reporting-Konfiguration.json"); + document.body.appendChild(downloadAnchorNode); // required for firefox + downloadAnchorNode.click(); + downloadAnchorNode.remove(); + } catch (error) { + kommonitorDataExchangeService.displayMapApplicationError(error.message); + console.error(error) + } + + } + + function getCurrentDateAndTime() { + let date = new Date(); + let year = date.getFullYear().toString(); + let month = date.getMonth() + 1; + let day = date.getDate(); + let time = date.getHours(); + let minutes = date.getMinutes(); + let seconds = date.getSeconds(); + let now = "".concat(year, "-", month, "-", day, "_", time, "-", minutes, "-", seconds); + return now; + } + + + function getIndicatorByName(indicatorName) { + let result; + for(let indicator of kommonitorDataExchangeService.availableIndicators) { + if(indicator.indicatorName === indicatorName) { + result = indicator; + break; + } + } + if(result) { + return result + } else { + throw new Error("No indicator could be found for name: " + indicatorName) + } + } + + $scope.queryFeatures = async function(indicatorId, spatialUnit) { + // build request + // query different endpoints depending on if we have an indicator or not + let url; + if(!indicatorId) { + let date = spatialUnit.metadata.lastUpdate.split("-") + let year = date[0] + let month = date[1] + let day = date[2] + url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + + "/spatial-units/" + spatialUnit.spatialUnitId + "/" + year + "/" + month + "/" + day; + } else { + url = kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + + "/indicators/" + indicatorId + "/" + spatialUnit.spatialUnitId; + } + // send request + $scope.loadingData = true; + return await $http({ + url: url, + method: "GET" + }).then(function successCallback(response) { + $scope.loadingData = false; + return response.data; + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + console.error(error); + }); + } + + $scope.createLowerCaseNameProperty = function(features) { + for(let feature of features) { + if(feature.hasOwnProperty("properties")) { + if(!feature.properties.hasOwnProperty("name")) { + let featureName = feature.properties.NAME; + feature.properties.name = featureName; + } + } + } + return features; + } + + $scope.$on("reportingGenerateReport", function(event, format) { + $scope.generateReport(format); + }); + + $scope.generateReport = async function(format) { + $scope.loadingData = true; + + + + try { + format === "pdf" && await $scope.generatePdfReport(); + format === "docx" && await $scope.generateWordReport(); + format === "zip" && await $scope.generateZipFolder(); + } catch (error) { + $scope.loadingData = false; + console.error(error); + kommonitorDataExchangeService.displayMapApplicationError(error.message); + } + } + + $scope.generatePdfReport = async function() { + + // create pdf document + let doc = new jsPDF({ + margin: 0, + unit: 'mm', + format: 'a4', + orientation: "landscape" + }); + + // general settings + let fontName = "Helvetica"; + doc.setDrawColor(148, 148, 148); + doc.setFont(fontName, "normal", "normal"); // name, normal/italic, fontweight + + for(let [idx, page] of $scope.config.pages.entries()) { + + if(idx > 0) { + doc.addPage(); + } + + let pageDom = document.querySelector("#reporting-overview-page-" + idx); + for(let pageElement of page.pageElements) { + + let pElementDom; + if(pageElement.type === "linechart") { + let arr = pageDom.querySelectorAll(".type-linechart"); + if(pageElement.showPercentageChangeToPrevTimestamp) { + pElementDom = arr[1]; + } else { + pElementDom = arr[0]; + } + } else { + pElementDom = pageDom.querySelector("#reporting-overview-page-" + idx + "-" + pageElement.type) + } + // convert dimensions to millimeters here + // that way we don't have to use pxToMilli everywhere we use coordinates in the pdf + let pageElementDimensions = {} + pageElementDimensions.top = pageElement.dimensions.top && pxToMilli(pageElement.dimensions.top); + pageElementDimensions.bottom = pageElement.dimensions.bottom && pxToMilli(pageElement.dimensions.bottom); + pageElementDimensions.left = pageElement.dimensions.left && pxToMilli(pageElement.dimensions.left); + pageElementDimensions.right = pageElement.dimensions.right && pxToMilli(pageElement.dimensions.right); + pageElementDimensions.width = pageElement.dimensions.width && pxToMilli(pageElement.dimensions.width); + pageElementDimensions.height = pageElement.dimensions.height && pxToMilli(pageElement.dimensions.height); + + // TODO some cases could be merged, but it's better to do that later when stuff works + switch(pageElement.type) { + case "indicatorTitle-landscape": { + // Css takes the top-left edge of the element by default. + // doc.text takes left-bottom, so we ass baseline "top" to achieve the same behavior in jspdf. + doc.setFont(fontName, "Bold") + doc.text(pageElement.text, pageElementDimensions.left, pageElementDimensions.top, { baseline: "top" }); + doc.setFont(fontName, "normal", "normal") + break; + } + case "communeLogo-landscape": { + // only add logo if one was selected + if(pageElement.src && pageElement.src.length) { + doc.addImage(pageElement.src, "JPEG", pageElementDimensions.left, pageElementDimensions.top, + pageElementDimensions.width, pageElementDimensions.height, "", 'MEDIUM'); + } + break; + } + case "dataTimestamp-landscape": { + doc.text(pageElement.text, pageElementDimensions.left, pageElementDimensions.top, { baseline: "top" }) + break; + } + case "dataTimeseries-landscape": { + doc.text(pageElement.text, pageElementDimensions.left, pageElementDimensions.top, { baseline: "top" }) + break; + } + case "reachability-subtitle-landscape": { + doc.text(pageElement.text, pageElementDimensions.left, pageElementDimensions.top, { baseline: "top" }) + break; + } + case "footerHorizontalSpacer-landscape": { + let x1, x2, y1, y2; + x1 = pageElementDimensions.left; + x2 = pageElementDimensions.left + pageElementDimensions.width; + y1 = pageElementDimensions.top; + y2 = pageElementDimensions.top; + doc.line(x1, y1, x2, y2); + break; + } + case "footerCreationInfo-landscape": { + doc.text(pageElement.text, pageElementDimensions.left, pageElementDimensions.top, { baseline: "top" }) + break; + } + case "pageNumber-landscape": { + let text = "Seite " + (idx+1); + doc.text(text, pageElementDimensions.left, pageElementDimensions.top, { baseline: "top" }) + break; + } + // template-specific elements + case "map": { + let instance = echarts.getInstanceByDom(pElementDom) + let imageDataUrl = instance.getDataURL( {pixelRatio: $scope.echartsImgPixelRatio} ) + + if($scope.config.template.name === "A4-landscape-reachability") { + try { + imageDataUrl = await $scope.createReachabilityMapImage(pageDom, pageElement, imageDataUrl) + } catch(error) { + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + console.error(error); + } + } + doc.addImage(imageDataUrl, "PNG", pageElementDimensions.left, pageElementDimensions.top, + pageElementDimensions.width, pageElementDimensions.height, "", 'MEDIUM'); + break; + } + // case "mapLegend" can be ignored since it is included in the map if needed + case "overallAverage": + case "selectionAverage": { + let x, y, width, height; + x = pageElementDimensions.left; + y = pageElementDimensions.top; + width = pageElementDimensions.width; + height = pageElementDimensions.height; + doc.rect(x, y, width, height); + let avgType = pageElement.type === "overallAverage" ? "Gesamtstadt" : "Selektion" + let text = "Durchschnitt\n" + avgType + ":\n" + pageElement.text.toString() + doc.text(text, pageElementDimensions.left + pxToMilli(5), pageElementDimensions.top + pxToMilli(5), { baseline: "top" }); + break; + } + case "overallChange": + case "selectionChange": { + let x = pxToMilli(670); + let y = pageElementDimensions.top; + let width = pxToMilli(130); + let height = pxToMilli(80); + doc.rect(x, y, width, height); + let changeType = pageElement.type === "overallChange" ? "Gesamtstadt" : "Selektion" + let text = "Durchschnittliche\nVeränderung\n" + changeType + ":\n" + pageElement.text.toString() + doc.text(text, x + pxToMilli(5), y + pxToMilli(5), { baseline: "top" }); + break; + } + case "barchart": { + let instance = echarts.getInstanceByDom(pElementDom) + let base64String = instance.getDataURL( {pixelRatio: $scope.echartsImgPixelRatio} ) + doc.addImage(base64String, "PNG", pageElementDimensions.left, pageElementDimensions.top, + pageElementDimensions.width, pageElementDimensions.height, "", 'MEDIUM'); + break; + } + case "linechart": { + let instance = echarts.getInstanceByDom(pElementDom) + let base64String = instance.getDataURL( {pixelRatio: $scope.echartsImgPixelRatio} ) + doc.addImage(base64String, "PNG", pageElementDimensions.left, pageElementDimensions.top, + pageElementDimensions.width, pageElementDimensions.height, "", 'MEDIUM'); + break; + } + case "textInput": { + doc.text(pageElement.text, pageElementDimensions.left, pageElementDimensions.top, { + baseline: "top", + maxWidth: pageElementDimensions.width + }) + break; + } + case "datatable": { + doc.autoTable({ + html: "#reporting-overview-page-" + idx + "-" + pageElement.type + " table", + startY: pageElementDimensions.top, + tableWidth: "wrap", + margin: {left: pageElementDimensions.left}, + theme: "grid", + //headStyles: { + // fillColor: false, // transparent + // textColor: [0, 0, 0], + //} + }) + break; + } + } + } + } + + //doc.output("dataurlnewwindow") + let now = getCurrentDateAndTime(); + doc.save(now + "_KomMonitor-Report.pdf"); + $scope.loadingData = false; + $timeout(function(){ + $scope.$digest(); + }); + } + + + $scope.generateZipFolder = async function() { + // creates a zip folder containing all echarts files + let zip = new JSZip(); + + // screenshot map attribution and legend only once per section + for(let [idx, page] of $scope.config.pages.entries()) { + + let pageDom = document.querySelector("#reporting-overview-page-" + idx); + for(let pageElement of page.pageElements) { + if(pageElement.type === "map" || pageElement.type === "barchart" || pageElement.type === "linechart") { + let pElementDom; + if(pageElement.type === "linechart") { + let arr = pageDom.querySelectorAll(".type-linechart"); + if(pageElement.showPercentageChangeToPrevTimestamp) { + pElementDom = arr[1]; + } else { + pElementDom = arr[0]; + } + } else { + pElementDom = pageDom.querySelector("#reporting-overview-page-" + idx + "-" + pageElement.type) + } + let instance = echarts.getInstanceByDom(pElementDom); + let imageDataUrl = instance.getDataURL({ + type: "png", + pixelRatio: $scope.echartsImgPixelRatio + }); + + if($scope.config.template.name === "A4-landscape-reachability") { + try { + imageDataUrl = await $scope.createReachabilityMapImage(pageDom, pageElement, imageDataUrl) + } catch(error) { + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + console.error(error); + } + } + + let filename = "Seite_" + (idx+1) + "_" + pageElement.type + ".png"; + if(pageElement.type === "linechart" && pageElement.showPercentageChangeToPrevTimestamp) { + // two elements with same type on one page + // use a different filename for one of them so we don't overwrite the other image + filename = filename.replace(".png", "-proz.Veraenderung.png"); + } + + zip.file(filename, dataURItoBlob(imageDataUrl), ""); + } + } + } + + let zipFileName = getCurrentDateAndTime() + "_Kommonitor-Report-Grafiken"; + zip.generateAsync({type:"blob"}).then(function(content) { + saveAs(content, zipFileName + ".zip"); + $scope.loadingData = false; + $timeout(function(){ + $scope.$digest(); + }); + }); + } + + let sections = []; // one section per page for now, since this is an easy way to create page breaks + + $scope.generateWordReport = async function() { + // see docx documentation for more info about the format: + // https://docx.js.org/#/?id=basic-usage + + let font = "Calibri"; + + for(let [idx, page] of $scope.config.pages.entries()) { + + let paragraphs = []; + let pageDom = document.querySelector("#reporting-overview-page-" + idx); + for(let pageElement of page.pageElements) { + + let pageElementDimensionsPx = calculateDimensions(pageElement.dimensions, "px"); + let pageElementDimensionsTwip = calculateDimensions(pageElement.dimensions, "twip"); + let pageElementDimensionsEmu = calculateDimensions(pageElement.dimensions, "emu"); + + switch(pageElement.type) { + case "indicatorTitle-landscape": { + let paragraph = new docx.Paragraph({ + children: [ + new docx.TextRun({ + text: pageElement.text, + bold: true, + font: font, + size: 32 // 16pt + }) + ], + frame: { + position: { + x: pageElementDimensionsTwip.left, + y: pageElementDimensionsTwip.top, + }, + width: pageElementDimensionsTwip.width, + height: pageElementDimensionsTwip.height, + anchor: { + horizontal: docx.FrameAnchorType.MARGIN, + vertical: docx.FrameAnchorType.MARGIN, + }, + alignment: { + x: docx.HorizontalPositionAlign.LEFT, + y: docx.VerticalPositionAlign.TOP, + } + } + }); + + paragraphs.push(paragraph); + break; + } + case "communeLogo-landscape": { + // only add logo if one was selected + if(pageElement.src && pageElement.src.length) { + let paragraph = new docx.Paragraph({ + children: [ + new docx.ImageRun({ + data: dataURItoBlob(pageElement.src), + transformation: { + width: pageElementDimensionsPx.width, + height: pageElementDimensionsPx.height + }, + floating: { + horizontalPosition: { + offset: pageElementDimensionsEmu.left, + }, + verticalPosition: { + offset: pageElementDimensionsEmu.top, + } + }, + }) + ] + }); + paragraphs.push(paragraph); + } + break; + } + case "dataTimestamp-landscape": + case "dataTimeseries-landscape": + case "reachability-subtitle-landscape": { + let paragraph = new docx.Paragraph({ + children: [ + new docx.TextRun({ + text: pageElement.text, + font: font, + size: 32 // 16pt + }) + ], + frame: { + position: { + x: pageElementDimensionsTwip.left, + y: pageElementDimensionsTwip.top, + }, + width: pageElementDimensionsTwip.width, + height: pageElementDimensionsTwip.height, + anchor: { + horizontal: docx.FrameAnchorType.MARGIN, + vertical: docx.FrameAnchorType.MARGIN, + }, + alignment: { + x: docx.HorizontalPositionAlign.LEFT, + y: docx.VerticalPositionAlign.TOP, + } + } + }); + + paragraphs.push(paragraph); + break; + } + + case "footerHorizontalSpacer-landscape": + // empty paragraph with border top + let paragraph = new docx.Paragraph({ + children: [], + frame: { + position: { + x: pageElementDimensionsTwip.left, + y: pageElementDimensionsTwip.top, + }, + width: pageElementDimensionsTwip.width, + height: pageElementDimensionsTwip.height, + anchor: { + horizontal: docx.FrameAnchorType.MARGIN, + vertical: docx.FrameAnchorType.MARGIN, + }, + alignment: { + x: docx.HorizontalPositionAlign.LEFT, + y: docx.VerticalPositionAlign.TOP, + } + }, + border: { + top: { + color: "#949494", // gray + space: 1, + style: docx.BorderStyle.SINGLE, + size: 6 + } + } + }); + paragraphs.push(paragraph); + break; + case "footerCreationInfo-landscape": { + let paragraph = new docx.Paragraph({ + children: [ + new docx.TextRun({ + text: pageElement.text, + font: font, + size: 32 // 16pt + }) + ], + frame: { + position: { + x: pageElementDimensionsTwip.left, + y: pageElementDimensionsTwip.top, + }, + width: pageElementDimensionsTwip.width, + height: pageElementDimensionsTwip.height, + anchor: { + horizontal: docx.FrameAnchorType.MARGIN, + vertical: docx.FrameAnchorType.MARGIN, + }, + alignment: { + x: docx.HorizontalPositionAlign.LEFT, + y: docx.VerticalPositionAlign.TOP, + } + } + }); + + paragraphs.push(paragraph); + break; + } + case "pageNumber-landscape": { + let paragraph = new docx.Paragraph({ + children: [ + new docx.TextRun({ + text: "Seite " + (idx+1), + font: font, + size: 32 // 16pt + }, + new docx.PageBreak()) + ], + frame: { + position: { + x: pageElementDimensionsTwip.left, + y: pageElementDimensionsTwip.top, + }, + width: pageElementDimensionsTwip.width, + height: pageElementDimensionsTwip.height, + anchor: { + horizontal: docx.FrameAnchorType.MARGIN, + vertical: docx.FrameAnchorType.MARGIN, + }, + alignment: { + x: docx.HorizontalPositionAlign.LEFT, + y: docx.VerticalPositionAlign.TOP, + } + } + }); + paragraphs.push(paragraph); + break; + } + case "map": + case "barchart": + case "linechart": { + let pElementDom; + if(pageElement.type === "linechart") { + let arr = pageDom.querySelectorAll(".type-linechart"); + if(pageElement.showPercentageChangeToPrevTimestamp) { + pElementDom = arr[1]; + } else { + pElementDom = arr[0]; + } + } else { + pElementDom = pageDom.querySelector("#reporting-overview-page-" + idx + "-" + pageElement.type) + } + let instance = echarts.getInstanceByDom(pElementDom); + let imageDataUrl = instance.getDataURL({ + type: "png", + pixelRatio: $scope.echartsImgPixelRatio + }); + + if($scope.config.template.name === "A4-landscape-reachability") { + try { + imageDataUrl = await $scope.createReachabilityMapImage(pageDom, pageElement, imageDataUrl) + } catch(error) { + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + console.error(error); + } + } + let blob = dataURItoBlob(imageDataUrl); + + let paragraph = new docx.Paragraph({ + children: [ + new docx.ImageRun({ + data: blob, + transformation: { + width: pageElementDimensionsPx.width, + height: pageElementDimensionsPx.height + }, + floating: { + horizontalPosition: { + offset: pageElementDimensionsEmu.left, + }, + verticalPosition: { + offset: pageElementDimensionsEmu.top, + }, + behindDocument: true + }, + }) + ] + }); + paragraphs.push(paragraph); + break; + } + case "overallAverage": + case "selectionAverage": { + let paragraph = new docx.Paragraph({ + children: [ + new docx.TextRun({ + text: "Durchschnitt", + font: font, + size: 28 // 14pt + }), + new docx.TextRun({ + text: pageElement.type === "overallAverage" ? "Gesamtstadt" : "Selektion", + size: 28, + font: font, + break: 1, // 14pt + }), + new docx.TextRun({ + text: pageElement.text.toString(), + size: 28, + font: font, + break: 1 // 14pt + }) + ], + frame: { + position: { + x: pageElementDimensionsTwip.left, + y: pageElementDimensionsTwip.top, + }, + width: pageElementDimensionsTwip.width, + height: pageElementDimensionsTwip.height, + anchor: { + horizontal: docx.FrameAnchorType.MARGIN, + vertical: docx.FrameAnchorType.MARGIN, + }, + alignment: { + x: docx.HorizontalPositionAlign.LEFT, + y: docx.VerticalPositionAlign.TOP, + } + }, + border: { + top: { + color: "#949494", // gray + space: 1, + style: docx.BorderStyle.SINGLE, + size: 6 + }, + right: { + color: "#949494", + space: 1, + style: docx.BorderStyle.SINGLE, + size: 6 + }, + bottom: { + color: "#949494", + space: 1, + style: docx.BorderStyle.SINGLE, + size: 6 + }, + left: { + color: "#949494", + space: 1, + style: docx.BorderStyle.SINGLE, + size: 6 + }, + } + }); + + paragraphs.push(paragraph); + break; + } + case "overallChange": + case "selectionChange": { + let paragraph = new docx.Paragraph({ + children: [ + new docx.TextRun({ + text: "Durchschnittliche", + font: font, + size: 28 // 14pt + }), + new docx.TextRun({ + text: "Veränderung", + font: font, + break: 1, + size: 28 // 14pt + }), + new docx.TextRun({ + text: pageElement.type === "overallChange" ? "Gesamtstadt" : "Selektion", + break: 1, + font: font, + size: 28 // 14pt + }), + new docx.TextRun({ + text: pageElement.text.toString(), + break: 1, + font: font, + size: 28 // 14pt + + }) + ], + frame: { + position: { + x: pageElementDimensionsTwip.left, + y: pageElementDimensionsTwip.top, + }, + width: pageElementDimensionsTwip.width, + height: pageElementDimensionsTwip.height, + anchor: { + horizontal: docx.FrameAnchorType.MARGIN, + vertical: docx.FrameAnchorType.MARGIN, + }, + alignment: { + x: docx.HorizontalPositionAlign.LEFT, + y: docx.VerticalPositionAlign.TOP, + } + }, + border: { + top: { + color: "#949494", // gray + space: 1, + style: docx.BorderStyle.SINGLE, + size: 6 + }, + right: { + color: "#949494", + space: 1, + style: docx.BorderStyle.SINGLE, + size: 6 + }, + bottom: { + color: "#949494", + space: 1, + style: docx.BorderStyle.SINGLE, + size: 6 + }, + left: { + color: "#949494", + space: 1, + style: docx.BorderStyle.SINGLE, + size: 6 + }, + } + }); + + paragraphs.push(paragraph); + break; + } + case "textInput": { + let paragraph = new docx.Paragraph({ + children: [ + new docx.TextRun({ + text: pageElement.text, + font: font, + size: 24 // 12pt + }) + ], + frame: { + position: { + x: pageElementDimensionsTwip.left, + y: pageElementDimensionsTwip.top, + }, + width: pageElementDimensionsTwip.width, + height: pageElementDimensionsTwip.height, + anchor: { + horizontal: docx.FrameAnchorType.MARGIN, + vertical: docx.FrameAnchorType.MARGIN, + }, + alignment: { + x: docx.HorizontalPositionAlign.LEFT, + y: docx.VerticalPositionAlign.TOP, + } + } + }); + + paragraphs.push(paragraph); + break; + } + case "datatable": { + let tableDom = document.querySelector("#reporting-overview-page-" + idx + "-" + pageElement.type + " table"); + let headerFieldsDom = tableDom.querySelectorAll("thead th") + let tableRowsDom = tableDom.querySelectorAll("tbody tr"); + + // table to create + let table = { + columnWidths: [], + rows: [], + float: { + absoluteHorizontalPosition: pageElementDimensionsTwip.left, + absoluteVerticalPosition: pageElementDimensionsTwip.top, + overlap: docx.OverlapType.NEVER, + }, + }; + let headerFields = []; + let headerFieldNames = []; + for(let fieldDom of headerFieldsDom) { + let widthInTwip = pxToTwip(fieldDom.offsetWidth); + let fieldContent = fieldDom.innerText; + headerFieldNames.push(fieldContent) + let field = new docx.TableCell({ + width: { + size: widthInTwip, + type: docx.WidthType.DXA, + }, + verticalAlign: docx.VerticalAlign.CENTER, + children: [new docx.Paragraph({ + alignment: docx.AlignmentType.CENTER, + children: [new docx.TextRun({ + text: fieldContent, + font: font, + bold: true + })] + })], + }) + headerFields.push(field); + table.columnWidths.push(widthInTwip) + } + + let headerRow = new docx.TableRow({ + children: headerFields, + }); + + table.rows.push(headerRow); + + for(let rowDom of tableRowsDom) { // excluding header + let fieldsDom = rowDom.querySelectorAll("td"); + let fields = []; + for(let [idx, fieldDom] of fieldsDom.entries()) { + let fieldContent = fieldDom.innerText; + let paragraph = new docx.Paragraph({ + text: fieldContent, + alignment: + headerFieldNames[idx] === "Wert" ? + docx.AlignmentType.RIGHT : + headerFieldNames[idx] === "Zeitpunkt" ? + docx.AlignmentType.CENTER : + docx.AlignmentType.LEFT, // "Bereich" + }); + let field = new docx.TableCell({ + width: { + size: table.columnWidths[idx], + type: docx.WidthType.DXA, + }, + verticalAlign: docx.VerticalAlign.CENTER, + children: [paragraph], + }) + fields.push(field) + } + let row = new docx.TableRow({ + children: fields, + }); + table.rows.push(row); + } + + paragraphs.push(new docx.Table(table)) // technically this is not a paragraph, but we only add it as a child of section below + break; + } + } + } + + let section = { + properties: { + type: docx.SectionType.NEXT_PAGE, + page: { + margin: { + top: 0, + right: 0, + bottom: 0, + left: 0, + }, + pageNumbers: { + start: (idx+1), + formatType: docx.NumberFormat.DECIMAL, + }, + size: { + orientation: docx.PageOrientation.LANDSCAPE, + }, + }, + }, + children: [...paragraphs], + } + + sections.push(section) + } + + let docxConfig = { + sections: [...sections] + } + + let doc = new docx.Document(docxConfig); + + let filename = getCurrentDateAndTime() + "_KomMonitor-Report" + // Used to export the file into a .docx file + docx.Packer.toBlob(doc).then((blob) => { + saveAs(blob, filename + ".docx"); + $scope.loadingData = false; + $timeout(function(){ + $scope.$digest(); + }); + }); + } + + $scope.createReachabilityMapImage = async function(pageDom, pageElement, echartsImgSrc) { + let result; + // screenshot leaflet map and merge it with echarts image + // remove page offset temporarily + pageElement.leafletMap.getContainer().style.top = "0px" + pageElement.leafletMap.getContainer().style.left = "0px" + + // wait for print process to finish + let format = 'image' + let overridedPluginOptions = { + mimeType: 'image/jpeg' + } + let leafletMapScreenshot = await pageElement.leafletMap.simpleMapScreenshoter.takeScreen(format, overridedPluginOptions) + pageElement.leafletMap.getContainer().style.top = "90px" + pageElement.leafletMap.getContainer().style.left = "15px" + + // combine images + let canvas = document.createElement('canvas'); + let ctx = canvas.getContext('2d'); + let pageElementDimensionsPx = calculateDimensions(pageElement.dimensions, "px"); + canvas.width = pageElementDimensionsPx.width; + canvas.height = pageElementDimensionsPx.height; + // we have to draw layers in order + let leafletMapImg = new Image(); + // leafletMapImg.crossOrigin = "anonymous"; + leafletMapImg.width = canvas.width; + leafletMapImg.height = canvas.height; + let leafletMapImgDrawn = new Promise( (resolve, reject) => { + leafletMapImg.onload = function() { + ctx.drawImage(leafletMapImg, 0, 0, canvas.width, canvas.height); + resolve(); + } + }) + leafletMapImg.src = leafletMapScreenshot; + await leafletMapImgDrawn + + let echartsImg = new Image(); + // echartsImg.crossOrigin = "anonymous"; + let echartsImgDrawn = new Promise( (resolve, reject) => { + echartsImg.onload = function() { + ctx.drawImage(echartsImg, 0, 0, canvas.width, canvas.height); + resolve(); + } + }); + echartsImg.src = echartsImgSrc; + await echartsImgDrawn + + let mapAttributionImg = pageDom.querySelector(".map-attribution > img"); + ctx.fillStyle = "white"; + ctx.fillRect(0, canvas.height - mapAttributionImg.height, mapAttributionImg.width, mapAttributionImg.height) + ctx.drawImage(mapAttributionImg, 0, canvas.height - mapAttributionImg.height); + let mapLegendImg = pageDom.querySelector(".map-legend > img") + ctx.fillRect(canvas.width - mapLegendImg.width, canvas.height - mapLegendImg.height, mapLegendImg.width, mapLegendImg.height) + ctx.drawImage(mapLegendImg, canvas.width - mapLegendImg.width, canvas.height - mapLegendImg.height); + result = canvas.toDataURL(); + return result; + } + + function pxToMilli(px) { + // our preview is 830px wide + // px / 830 gives us the percentage from the left edge, which can then be stretched to fit the A4 page + // This is the short version of: + // px / pxPerMillimeter * pxPerMillimeter * 297 / 830, where pxPerMillimeter = (deviceScreenPpi / 2.54) * 10 + // pxPerMillimeter cancels out there, so it doesn't matter. + let result = parseInt(px, 10) / 830 * 297; + result = Math.round(result * 100) / 100; + return result; + } + + function pxToTwip(px) { + let result = parseInt(px, 10) * 15; // 1px = 0.75pt = 15twip + return result * $scope.pxPerMilli*297 / 830 // scale from 830px to A4 page + } + + function twipToEmus(value) { + // see: https://startbigthinksmall.wordpress.com/2010/01/04/points-inches-and-emus-measuring-units-in-office-open-xml/ + return value * 635; + } + + // from: https://stackoverflow.com/a/46406124 + function dataURItoBlob(dataURI) { + // convert base64 to raw binary data held in a string + // doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this + var byteString = atob(dataURI.split(',')[1]); + + // separate out the mime component + var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0] + + // write the bytes of the string to an ArrayBuffer + var ab = new ArrayBuffer(byteString.length); + + // create a view into the buffer + var ia = new Uint8Array(ab); + + // set the bytes of the buffer to the correct values + for (var i = 0; i < byteString.length; i++) { + ia[i] = byteString.charCodeAt(i); + } + + // write the ArrayBuffer to a blob, and you're done + var blob = new Blob([ab], {type: mimeString}); + return blob; + } + + function calculateDimensions(dimensions, unit) { + let result = {}; + if(unit === "px") { + // also scale our 830px preview up to A4 here + let scalefactor = $scope.pxPerMilli*297 / 830 + result.top = dimensions.top && parseInt(dimensions.top, 10) * scalefactor; + result.bottom = dimensions.bottom && parseInt(dimensions.bottom, 10) * scalefactor; + result.left = dimensions.left && parseInt(dimensions.left, 10) * scalefactor; + result.right = dimensions.right && parseInt(dimensions.right, 10) * scalefactor; + result.width = dimensions.width && parseInt(dimensions.width, 10) * scalefactor; + result.height = dimensions.height && parseInt(dimensions.height, 10) * scalefactor; + } + if(unit === "milli") { + result.top = dimensions.top && pxToMilli(dimensions.top); + result.bottom = dimensions.bottom && pxToMilli(dimensions.bottom); + result.left = dimensions.left && pxToMilli(dimensions.left); + result.right = dimensions.right && pxToMilli(dimensions.right); + result.width = dimensions.width && pxToMilli(dimensions.width, 10);; + result.height = dimensions.height && pxToMilli(dimensions.height, 10); + } + if(unit === "twip") { + result.top = dimensions.top && docx.convertMillimetersToTwip(pxToMilli(dimensions.top)); + result.bottom = dimensions.bottom && docx.convertMillimetersToTwip(pxToMilli(dimensions.bottom)); + result.left = dimensions.left && docx.convertMillimetersToTwip(pxToMilli(dimensions.left)); + result.right = dimensions.right && docx.convertMillimetersToTwip(pxToMilli(dimensions.right)); + result.width = dimensions.width && docx.convertMillimetersToTwip(pxToMilli(dimensions.width, 10)); + result.height = dimensions.height && docx.convertMillimetersToTwip(pxToMilli(dimensions.height, 10)); + } + if(unit === "emu") { + result.top = dimensions.top && twipToEmus(docx.convertMillimetersToTwip(pxToMilli(dimensions.top))); + result.bottom = dimensions.bottom && twipToEmus(docx.convertMillimetersToTwip(pxToMilli(dimensions.bottom))); + result.left = dimensions.left && twipToEmus(docx.convertMillimetersToTwip(pxToMilli(dimensions.left))); + result.right = dimensions.right && twipToEmus(docx.convertMillimetersToTwip(pxToMilli(dimensions.right))); + result.width = dimensions.width && twipToEmus(docx.convertMillimetersToTwip(pxToMilli(dimensions.width, 10))); + result.height = dimensions.height && twipToEmus(docx.convertMillimetersToTwip(pxToMilli(dimensions.height, 10))); + } + return result; + } + + + function calculateScreenDpi() { + // create a hidden div that is one inch high + let div = document.createElement("div") + div.style.height = "1in"; + div.style.position = "absolute"; + div.style.left = "-100%"; + div.style.top = "-100%"; + document.getElementsByTagName("body")[0].append(div); + const dpi = div.offsetHeight + div.style.display = "none"; + return dpi + } + } +]}); \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingOverview/reporting-overview.module.js b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingOverview/reporting-overview.module.js index 969a9c74f..5101cdd9b 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingOverview/reporting-overview.module.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingOverview/reporting-overview.module.js @@ -1 +1,3 @@ -angular.module('reportingOverview', ['ng-sortable', 'ngSanitize']); \ No newline at end of file +"use strict"; +angular.module('reportingOverview', ['ng-sortable', 'ngSanitize']); +//# sourceMappingURL=reporting-overview.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingOverview/reporting-overview.module.js.map b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingOverview/reporting-overview.module.js.map new file mode 100644 index 000000000..687f04245 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingOverview/reporting-overview.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"reporting-overview.module.js","sourceRoot":"","sources":["reporting-overview.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,mBAAmB,EAAE,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingOverview/reporting-overview.module.ts b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingOverview/reporting-overview.module.ts new file mode 100644 index 000000000..969a9c74f --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingOverview/reporting-overview.module.ts @@ -0,0 +1 @@ +angular.module('reportingOverview', ['ng-sortable', 'ngSanitize']); \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingTemplateSelect/reporting-template-select.component.js b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingTemplateSelect/reporting-template-select.component.js index 536e8cc7f..5f23b414f 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingTemplateSelect/reporting-template-select.component.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingTemplateSelect/reporting-template-select.component.js @@ -1,918 +1,851 @@ +"use strict"; angular.module('reportingTemplateSelect').component('reportingTemplateSelect', { - templateUrl : "components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingTemplateSelect/reporting-template-select.template.html", - controller : ['$scope', '$rootScope', '__env', '$timeout', 'kommonitorDataExchangeService', - function ReportingTemplateSelectController($scope, $rootScope, __env, $timeout, kommonitorDataExchangeService) { - - $scope.generalSettings = { - creator: "M. Mustermann", - commune: "Testkommune", - communeLogo: "", - creationDate: getCurrentDate(), - freeText: "Text", - } - $scope.availableTemplateCategories = [ - { - "id": 1, - "displayName": "Zeitpunkt", - }, - { - "id": 2, - "displayName": "Zeitserie", - }, - { - "id": 3, - "displayName": "Erreichbarkeit", - } - ] - - // A basic version of the templates. - // These are not full-fledged templates yet, but they can serve as a starting point and are adjusted according to user choices dynamically. - $scope.availableTemplates = [ - { - "name": "A4-landscape-timestamp", - "displayName": "DIN A4, Querformat", - "categoryId": 1, - "pages": [ - { - "orientation": "landscape", - "pageElements": [ - - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("indicatorTitle-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("dataTimestamp-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), - - { - "type": "map", - "dimensions": { - "top": "90px", - "left": "15px", - "width": "800px", - "height": "440px" - }, - "isPlaceholder": true, - "placeholderText": - "Übersichtskarte ohne Klassifizierung.\ + templateUrl: "components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingTemplateSelect/reporting-template-select.template.html", + controller: ['$scope', '$rootScope', '__env', '$timeout', 'kommonitorDataExchangeService', + function ReportingTemplateSelectController($scope, $rootScope, __env, $timeout, kommonitorDataExchangeService) { + $scope.generalSettings = { + creator: "M. Mustermann", + commune: "Testkommune", + communeLogo: "", + creationDate: getCurrentDate(), + freeText: "Text", + }; + $scope.availableTemplateCategories = [ + { + "id": 1, + "displayName": "Zeitpunkt", + }, + { + "id": 2, + "displayName": "Zeitserie", + }, + { + "id": 3, + "displayName": "Erreichbarkeit", + } + ]; + // A basic version of the templates. + // These are not full-fledged templates yet, but they can serve as a starting point and are adjusted according to user choices dynamically. + $scope.availableTemplates = [ + { + "name": "A4-landscape-timestamp", + "displayName": "DIN A4, Querformat", + "categoryId": 1, + "pages": [ + { + "orientation": "landscape", + "pageElements": [ + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("indicatorTitle-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("dataTimestamp-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), + { + "type": "map", + "dimensions": { + "top": "90px", + "left": "15px", + "width": "800px", + "height": "440px" + }, + "isPlaceholder": true, + "placeholderText": "Übersichtskarte ohne Klassifizierung.\ Selektierte Bereiche farblich markiert.\ Beschriftung: Quote/Anzahl pro Bereich.\ Keine Hintergrundkarte.", - "colorScheme": undefined, - "classify": false, - - }, - { - "type": "overallAverage", - "dimensions": { - "top": "100px", - "left": "700px", - "width": "100px", - "height": "60px" - }, - "isPlaceholder": true, - "placeholderText": "Durchschnitt Gesamtstadt" - }, - { - "type": "selectionAverage", - "dimensions": { - "top": "180px", - "left": "700px", - "width": "100px", - "height": "60px" - }, - "isPlaceholder": true, - "placeholderText": "Durchschnitt Selektion" - } - ] - }, - { - "orientation": "landscape", - "pageElements": [ - - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("indicatorTitle-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("dataTimestamp-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), - - { - "type": "map", - "dimensions": { - "top": "90px", - "left": "15px", - "width": "800px", - "height": "440px" - }, - "isPlaceholder": true, - "placeholderText": - "Übersichtskarte klassifiziert.\ + "colorScheme": undefined, + "classify": false, + }, + { + "type": "overallAverage", + "dimensions": { + "top": "100px", + "left": "700px", + "width": "100px", + "height": "60px" + }, + "isPlaceholder": true, + "placeholderText": "Durchschnitt Gesamtstadt" + }, + { + "type": "selectionAverage", + "dimensions": { + "top": "180px", + "left": "700px", + "width": "100px", + "height": "60px" + }, + "isPlaceholder": true, + "placeholderText": "Durchschnitt Selektion" + } + ] + }, + { + "orientation": "landscape", + "pageElements": [ + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("indicatorTitle-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("dataTimestamp-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), + { + "type": "map", + "dimensions": { + "top": "90px", + "left": "15px", + "width": "800px", + "height": "440px" + }, + "isPlaceholder": true, + "placeholderText": "Übersichtskarte klassifiziert.\ Beschriftung: Quote/Anzahl pro Bereich.\ Keine Hintergrundkarte.", - "colorScheme": undefined, - "classify": true, - }, - { - "type": "overallAverage", - "dimensions": { - "top": "100px", - "left": "700px", - "width": "100px", - "height": "60px" - }, - "isPlaceholder": true, - "placeholderText": "Durchschnitt Gesamtstadt" - }, - { - "type": "selectionAverage", - "dimensions": { - "top": "180px", - "left": "700px", - "width": "100px", - "height": "60px" - }, - "isPlaceholder": true, - "placeholderText": "Durchschnitt Selektion" - }, - { - "type": "mapLegend", - "dimensions": { - "top": "400px", - "left": "700px", - "width": "100px", - "height": "120px" - }, - "isPlaceholder": true, - "placeholderText": "Legende" - } - ] - }, - { - "orientation": "landscape", - "pageElements": [ - - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("indicatorTitle-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("dataTimestamp-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), - - { - "type": "barchart", - "dimensions": { - "top": "90px", - "left": "15px", - "width": "800px", - "height": "440px" - }, - "isPlaceholder": true, - "placeholderText": "Säulendiagramm. Eine Säule pro selektiertem Bereich + Durchschnitt der Gesamtstadt" - } - ] - }, - // one page for each selected area - { - "orientation": "landscape", - "area": "", // the area shown on this page or an empty string if it is a placeholder page - "pageElements": [ - - - // different placeholder so we don't use the default here - { - "type": "indicatorTitle-landscape", - "dimensions": { - "top": "15px", - "left": "15px", - "width": "720px", - "height": "30px" - }, - "isPlaceholder": true, - "placeholderText": "Titel des Indikators [Einheit], Bereich (Diese Seite wird für jeden Bereich wiederholt)", - "text": "", - "css": "text-align: left; padding-left: 5px; font-weight: bold;" - }, - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("dataTimestamp-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), - - { - "type": "map", - "dimensions": { - "top": "90px", - "left": "15px", - "width": "400px", - "height": "440px" - }, - "isPlaceholder": true, - "placeholderText": - "Karte.\ + "colorScheme": undefined, + "classify": true, + }, + { + "type": "overallAverage", + "dimensions": { + "top": "100px", + "left": "700px", + "width": "100px", + "height": "60px" + }, + "isPlaceholder": true, + "placeholderText": "Durchschnitt Gesamtstadt" + }, + { + "type": "selectionAverage", + "dimensions": { + "top": "180px", + "left": "700px", + "width": "100px", + "height": "60px" + }, + "isPlaceholder": true, + "placeholderText": "Durchschnitt Selektion" + }, + { + "type": "mapLegend", + "dimensions": { + "top": "400px", + "left": "700px", + "width": "100px", + "height": "120px" + }, + "isPlaceholder": true, + "placeholderText": "Legende" + } + ] + }, + { + "orientation": "landscape", + "pageElements": [ + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("indicatorTitle-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("dataTimestamp-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), + { + "type": "barchart", + "dimensions": { + "top": "90px", + "left": "15px", + "width": "800px", + "height": "440px" + }, + "isPlaceholder": true, + "placeholderText": "Säulendiagramm. Eine Säule pro selektiertem Bereich + Durchschnitt der Gesamtstadt" + } + ] + }, + // one page for each selected area + { + "orientation": "landscape", + "area": "", + "pageElements": [ + // different placeholder so we don't use the default here + { + "type": "indicatorTitle-landscape", + "dimensions": { + "top": "15px", + "left": "15px", + "width": "720px", + "height": "30px" + }, + "isPlaceholder": true, + "placeholderText": "Titel des Indikators [Einheit], Bereich (Diese Seite wird für jeden Bereich wiederholt)", + "text": "", + "css": "text-align: left; padding-left: 5px; font-weight: bold;" + }, + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("dataTimestamp-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), + { + "type": "map", + "dimensions": { + "top": "90px", + "left": "15px", + "width": "400px", + "height": "440px" + }, + "isPlaceholder": true, + "placeholderText": "Karte.\ Detailansicht des Bereichs.\ Keine Hintergrundkarte.", - "colorScheme": undefined, - "classify": true, - }, - { - "type": "barchart", - "dimensions": { - "top": "90px", - "left": "425px", - "width": "390px", - "height": "140px" - }, - "isPlaceholder": true, - "placeholderText": "Säulendiagramm. Vergleich des Bereichs mit dem Durchschnitt 1. aller selektierten Bereiche und 2. der Gesamtstadt." - }, - { - "type": "textInput", - "dimensions": { - "top": "390px", - "left": "425px", - "width": "390px", - "height": "140px" - }, - "isPlaceholder": true, - "placeholderText": "Freitext", - "css": "align-self: self-start; margin-bottom: auto; text-align: left;" - } - ] - }, - // end of area-specific part - // datatable might need multiple pages - { - "orientation": "landscape", - "pageElements": [ - - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("indicatorTitle-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("dataTimestamp-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), - - { - "type": "datatable", - "dimensions": { - "top": "90px", - "left": "15px", - "width": "300px", - "height": "440px" - }, - "isPlaceholder": true, - "placeholderText": - "Datentabelle (Spalten: Bereich, Wert).\ + "colorScheme": undefined, + "classify": true, + }, + { + "type": "barchart", + "dimensions": { + "top": "90px", + "left": "425px", + "width": "390px", + "height": "140px" + }, + "isPlaceholder": true, + "placeholderText": "Säulendiagramm. Vergleich des Bereichs mit dem Durchschnitt 1. aller selektierten Bereiche und 2. der Gesamtstadt." + }, + { + "type": "textInput", + "dimensions": { + "top": "390px", + "left": "425px", + "width": "390px", + "height": "140px" + }, + "isPlaceholder": true, + "placeholderText": "Freitext", + "css": "align-self: self-start; margin-bottom: auto; text-align: left;" + } + ] + }, + // end of area-specific part + // datatable might need multiple pages + { + "orientation": "landscape", + "pageElements": [ + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("indicatorTitle-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("dataTimestamp-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), + { + "type": "datatable", + "dimensions": { + "top": "90px", + "left": "15px", + "width": "300px", + "height": "440px" + }, + "isPlaceholder": true, + "placeholderText": "Datentabelle (Spalten: Bereich, Wert).\ Ggf. über mehrere Seiten.", - "columnNames": [], - "tableData": [] - } - ] - } - ] - }, - { - "name": "A4-landscape-timeseries", - "displayName": "DIN A4, Querformat", - "categoryId": 2, - "pages": [ - { - "orientation": "landscape", - "pageElements": [ - - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("indicatorTitle-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("dataTimestamp-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), - - { - "type": "map", - "dimensions": { - "top": "90px", - "left": "15px", - "width": "800px", - "height": "440px" - }, - "isPlaceholder": true, - "placeholderText": - "Übersichtskarte ohne Klassifizierung.\ + "columnNames": [], + "tableData": [] + } + ] + } + ] + }, + { + "name": "A4-landscape-timeseries", + "displayName": "DIN A4, Querformat", + "categoryId": 2, + "pages": [ + { + "orientation": "landscape", + "pageElements": [ + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("indicatorTitle-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("dataTimestamp-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), + { + "type": "map", + "dimensions": { + "top": "90px", + "left": "15px", + "width": "800px", + "height": "440px" + }, + "isPlaceholder": true, + "placeholderText": "Übersichtskarte ohne Klassifizierung.\ Selektierte Bereiche farblich markiert.\ Beschriftung: Quote/Anzahl pro Bereich (aktuellster Wert).\ Keine Hintergrundkarte.", - "colorScheme": undefined, - "classify": false, - }, - { - "type": "overallAverage", - "dimensions": { - "top": "100px", - "left": "700px", - "width": "100px", - "height": "60px" - }, - "isPlaceholder": true, - "placeholderText": "Durchschnitt Gesamtstadt (aktuellster Wert)" - }, - { - "type": "selectionAverage", - "dimensions": { - "top": "180px", - "left": "700px", - "width": "100px", - "height": "60px" - }, - "isPlaceholder": true, - "placeholderText": "Durchschnitt Selektion (aktuellster Wert)" - } - ] - }, - { - "orientation": "landscape", - "pageElements": [ - - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("indicatorTitle-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("dataTimeseries-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), - - { - "type": "map", - "dimensions": { - "top": "90px", - "left": "15px", - "width": "800px", - "height": "440px" - }, - "isPlaceholder": true, - "placeholderText": - "Übersichtskarte, klassifiziert.\ + "colorScheme": undefined, + "classify": false, + }, + { + "type": "overallAverage", + "dimensions": { + "top": "100px", + "left": "700px", + "width": "100px", + "height": "60px" + }, + "isPlaceholder": true, + "placeholderText": "Durchschnitt Gesamtstadt (aktuellster Wert)" + }, + { + "type": "selectionAverage", + "dimensions": { + "top": "180px", + "left": "700px", + "width": "100px", + "height": "60px" + }, + "isPlaceholder": true, + "placeholderText": "Durchschnitt Selektion (aktuellster Wert)" + } + ] + }, + { + "orientation": "landscape", + "pageElements": [ + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("indicatorTitle-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("dataTimeseries-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), + { + "type": "map", + "dimensions": { + "top": "90px", + "left": "15px", + "width": "800px", + "height": "440px" + }, + "isPlaceholder": true, + "placeholderText": "Übersichtskarte, klassifiziert.\ Veränderung ältester Wert --> aktuellster Wert.\ Beschriftung: Veränderung in Einheit des Indikators.\ Keine Hintergrundkarte.", - "colorScheme": undefined, - "classify": true, - "isTimeseries": true - }, - { - "type": "overallChange", - "dimensions": { - "top": "100px", - "left": "700px", - "width": "100px", - "height": "60px" - }, - "isPlaceholder": true, - "placeholderText": "Veränderung Gesamtstadt" - }, - { - "type": "selectionChange", - "dimensions": { - "top": "180px", - "left": "700px", - "width": "100px", - "height": "60px" - }, - "isPlaceholder": true, - "placeholderText": "Veränderung Selektion" - }, - { - "type": "mapLegend", - "dimensions": { - "top": "400px", - "left": "700px", - "width": "100px", - "height": "120px" - }, - "isPlaceholder": true, - "placeholderText": "Legende" - } - ] - }, - { - "orientation": "landscape", - "pageElements": [ - - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("indicatorTitle-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("dataTimeseries-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), - - { - "type": "linechart", - "dimensions": { - "top": "90px", - "left": "15px", - "width": "800px", - "height": "440px" - }, - "isPlaceholder": true, - "placeholderText": "Zeitreihendiagramm. Eine Linie pro ausgewähltem Bereich + Durchschnitt Gesamtstadt.", - "showAverage": true, - "showAreas": true, - "showBoxplots": false - } - ] - }, - { - "orientation": "landscape", - "pageElements": [ - - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("indicatorTitle-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("dataTimeseries-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), - - { - // with boxplot at each data point - "type": "linechart", - "dimensions": { - "top": "90px", - "left": "15px", - "width": "800px", - "height": "440px" - }, - "isPlaceholder": true, - "placeholderText": "Zeitreihendiagramm. Durchschnitt Gesamtstadt + Boxplot pro Zeitpunkt", - "showAverage": true, - "showAreas": false, - "showBoxplots": true - - } - ] - }, - // one page for each selected area - { - "orientation": "landscape", - "area": "", - "pageElements": [ - - // different placeholder so we don't use the default here - { - "type": "indicatorTitle-landscape", - "dimensions": { - "top": "15px", - "left": "15px", - "width": "720px", - "height": "30px" - }, - "isPlaceholder": true, - "placeholderText": "Titel des Indikators [Einheit], Bereich (Diese Seite wird für jeden Bereich wiederholt)", - "text": "", - "css": "text-align: left; padding-left: 5px; font-weight: bold;" - }, - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("dataTimeseries-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), - - { - "type": "map", - "dimensions": { - "top": "90px", - "left": "15px", - "width": "400px", - "height": "440px" - }, - "isPlaceholder": true, - "placeholderText": - "Karte.\ + "colorScheme": undefined, + "classify": true, + "isTimeseries": true + }, + { + "type": "overallChange", + "dimensions": { + "top": "100px", + "left": "700px", + "width": "100px", + "height": "60px" + }, + "isPlaceholder": true, + "placeholderText": "Veränderung Gesamtstadt" + }, + { + "type": "selectionChange", + "dimensions": { + "top": "180px", + "left": "700px", + "width": "100px", + "height": "60px" + }, + "isPlaceholder": true, + "placeholderText": "Veränderung Selektion" + }, + { + "type": "mapLegend", + "dimensions": { + "top": "400px", + "left": "700px", + "width": "100px", + "height": "120px" + }, + "isPlaceholder": true, + "placeholderText": "Legende" + } + ] + }, + { + "orientation": "landscape", + "pageElements": [ + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("indicatorTitle-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("dataTimeseries-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), + { + "type": "linechart", + "dimensions": { + "top": "90px", + "left": "15px", + "width": "800px", + "height": "440px" + }, + "isPlaceholder": true, + "placeholderText": "Zeitreihendiagramm. Eine Linie pro ausgewähltem Bereich + Durchschnitt Gesamtstadt.", + "showAverage": true, + "showAreas": true, + "showBoxplots": false + } + ] + }, + { + "orientation": "landscape", + "pageElements": [ + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("indicatorTitle-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("dataTimeseries-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), + { + // with boxplot at each data point + "type": "linechart", + "dimensions": { + "top": "90px", + "left": "15px", + "width": "800px", + "height": "440px" + }, + "isPlaceholder": true, + "placeholderText": "Zeitreihendiagramm. Durchschnitt Gesamtstadt + Boxplot pro Zeitpunkt", + "showAverage": true, + "showAreas": false, + "showBoxplots": true + } + ] + }, + // one page for each selected area + { + "orientation": "landscape", + "area": "", + "pageElements": [ + // different placeholder so we don't use the default here + { + "type": "indicatorTitle-landscape", + "dimensions": { + "top": "15px", + "left": "15px", + "width": "720px", + "height": "30px" + }, + "isPlaceholder": true, + "placeholderText": "Titel des Indikators [Einheit], Bereich (Diese Seite wird für jeden Bereich wiederholt)", + "text": "", + "css": "text-align: left; padding-left: 5px; font-weight: bold;" + }, + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("dataTimeseries-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), + { + "type": "map", + "dimensions": { + "top": "90px", + "left": "15px", + "width": "400px", + "height": "440px" + }, + "isPlaceholder": true, + "placeholderText": "Karte.\ Detailansicht des Bereichs.\ Keine Hintergrundkarte.", - "colorScheme": undefined, - "classify": true, - "isTimeseries": true - }, - { - "type": "linechart", - "dimensions": { - "top": "90px", - "left": "425px", - "width": "390px", - "height": "140px" - }, - "isPlaceholder": true, - "placeholderText": "Zeitreihendiagramm. Vergleich des Bereichs mit dem Durchschnitt der Gesamtstadt.", - "showAverage": true, - "showAreas": true, - "showBoxplots": false - }, - { - - "type": "linechart", - "dimensions": { - "top": "240px", - "left": "425px", - "width": "390px", - "height": "140px" - }, - "isPlaceholder": true, - "placeholderText": "Liniendiagramm. Veränderung zum Vorjahr in Prozent", - "showAverage": true, - "showAreas": true, - "showAverage": true, - "showPercentageChangeToPrevTimestamp": true - }, - { - "type": "textInput", - "dimensions": { - "top": "390px", - "left": "425px", - "width": "390px", - "height": "140px" - }, - "isPlaceholder": true, - "placeholderText": "Freitext", - "css": "align-self: self-start; margin-bottom: auto; text-align: left;" - } - ] - }, - // end of area-specific part - // datatable might need multiple pages - { - "orientation": "landscape", - "pageElements": [ - - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("indicatorTitle-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("dataTimeseries-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), - - { - // should include data for different timestamps - "type": "datatable", - "dimensions": { - "top": "90px", - "left": "15px", - "width": "300px", - "height": "440px" - }, - "isPlaceholder": true, - "placeholderText": - "Datentabelle (Spalten: Bereich, Zeitpunkt, Wert).\ + "colorScheme": undefined, + "classify": true, + "isTimeseries": true + }, + { + "type": "linechart", + "dimensions": { + "top": "90px", + "left": "425px", + "width": "390px", + "height": "140px" + }, + "isPlaceholder": true, + "placeholderText": "Zeitreihendiagramm. Vergleich des Bereichs mit dem Durchschnitt der Gesamtstadt.", + "showAverage": true, + "showAreas": true, + "showBoxplots": false + }, + { + "type": "linechart", + "dimensions": { + "top": "240px", + "left": "425px", + "width": "390px", + "height": "140px" + }, + "isPlaceholder": true, + "placeholderText": "Liniendiagramm. Veränderung zum Vorjahr in Prozent", + "showAverage": true, + "showAreas": true, + "showAverage": true, + "showPercentageChangeToPrevTimestamp": true + }, + { + "type": "textInput", + "dimensions": { + "top": "390px", + "left": "425px", + "width": "390px", + "height": "140px" + }, + "isPlaceholder": true, + "placeholderText": "Freitext", + "css": "align-self: self-start; margin-bottom: auto; text-align: left;" + } + ] + }, + // end of area-specific part + // datatable might need multiple pages + { + "orientation": "landscape", + "pageElements": [ + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("indicatorTitle-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("dataTimeseries-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), + { + // should include data for different timestamps + "type": "datatable", + "dimensions": { + "top": "90px", + "left": "15px", + "width": "300px", + "height": "440px" + }, + "isPlaceholder": true, + "placeholderText": "Datentabelle (Spalten: Bereich, Zeitpunkt, Wert).\ Ggf. über mehrere Seiten.", - "columnNames": [], - "tableData": [] - }, - ] - } - ] - }, - { - "name": "A4-landscape-reachability", - "displayName": "DIN A4, Querformat", - "categoryId": 3, - "pages": [ - { - "orientation": "landscape", - "pageElements": [ - - // different placeholder so we don't use the default here - { - "type": "indicatorTitle-landscape", - "dimensions": { - "top": "15px", - "left": "15px", - "width": "720px", - "height": "30px" - }, - "isPlaceholder": true, - "placeholderText": "Entfernungen für [Name POI]", - "text": "", - "css": "text-align: left; padding-left: 5px; font-weight: bold;" - }, - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("reachability-subtitle-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), - - { - // isochrones, only show main roads if possible - "type": "map", - "dimensions": { - "top": "90px", - "left": "15px", - "width": "800px", - "height": "440px" - }, - "isPlaceholder": true, - "placeholderText": "Karte Gesamtstadt mit Isochronen, Grenzen der gewählten Bereiche farblich hervorgehoben. Kartenhintergrund: nur Hauptstraßen.", - "colorScheme": undefined, - "classify": false, - }, - { - "type": "mapLegend", - "dimensions": { - // used for the placeholder only - "top": "400px", - "left": "700px", - "width": "100px", - "height": "120px" - }, - "isPlaceholder": true, - "placeholderText": "Legende" - }, - { - "type": "mapAttribution", - "dimensions": { - // used for the placeholder only - "top": "495px", - "left": "25px", - "width": "125px", - "height": "25px" - }, - "isPlaceholder": true, - "placeholderText": "Copyrightvermerk" - } - - ] - }, - // one page for each selected area - { - "orientation": "landscape", - "area": "", - "pageElements": [ - - - // different placeholder so we don't use the default here - { - "type": "indicatorTitle-landscape", - "dimensions": { - "top": "15px", - "left": "15px", - "width": "720px", - "height": "30px" - }, - "isPlaceholder": true, - "placeholderText": "Entfernungen für [Name POI], Bereich (Diese Seite wird für jeden Bereich wiederholt)", - "text": "", - "css": "text-align: left; padding-left: 5px; font-weight: bold;" - }, - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("reachability-subtitle-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), - kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), - - { - // isochrones, background map in grayscale - "type": "map", - "dimensions": { - "top": "90px", - "left": "15px", - "width": "800px", - "height": "440px" - }, - "isPlaceholder": true, - "placeholderText": "Karte Detailansicht Bereich mit Isochronen, Hintergrund OSM-Karte in Graustufen", - "colorScheme": undefined, - "classify": false, - }, - { - "type": "mapLegend", - "dimensions": { - // used for the placeholder only - "top": "400px", - "left": "700px", - "width": "100px", - "height": "120px" - }, - "isPlaceholder": true, - "placeholderText": "Legende" - }, - { - "type": "mapAttribution", - "dimensions": { - // used for the placeholder only - "top": "495px", - "left": "25px", - "width": "125px", - "height": "25px" - }, - "isPlaceholder": true, - "placeholderText": "Copyrightvermerk" - } - ] - } - // end of area-specific part - ] - } - ] - - $scope.selectedTemplate = undefined; - - $scope.$on('reportingInitializeTemplateSelect', function(event, data) { - $scope.initialize(); - }); - - $scope.initialize = function() { - // open first category - let collapsible = document.querySelector("#reporting-template-category-accordion #collapse1") - collapsible.classList.add("in"); - // select first template - collapsible.querySelector("#collapse1-template0").click(); - - $scope.datePicker = $('#reporting-general-settings-datefield').datepicker({ - autoclose: true, - language: 'de', - format: 'yyyy-mm-dd' - }); - document.getElementById("reporting-load-commune-logo-button").addEventListener('change', readSingleFile, false); - - // set the property "isPlaceholder" to false for specific page elements since their content should be replaced right away - for(let template of $scope.availableTemplates) { - $scope.iteratePageElements( template, function(page, pageElement) { - pageElement.isPlaceholder = ( - pageElement.type === "footerCreationInfo-landscape" || - pageElement.type === "pageNumber-landscape" || - pageElement.type === "textInput" - ) ? false : true; - }) - } - - for(let template of $scope.availableTemplates) { - for(let page of template.pages) { - for(let el of page.pageElements) { - el.isPlaceholder = ( - el.type === "footerCreationInfo-landscape" || - el.type === "pageNumber-landscape" || - el.type === "textInput" - ) ? false : true; - } - } - } - - } - - - - /** - * filters templates to only show the ones matching the given category. - * @param {*} categoryId - * @returns - */ - $scope.templateFilter = function(categoryId) { - return function(value) { - return categoryId === value.categoryId; - } - } - - $scope.onTemplateElementClicked = function($event, template) { - let el = $event.target; - el.style.backgroundColor = "#0078D7"; - el.style.color = "white"; - document.querySelectorAll(".reporting-selectable-template").forEach( (element) => { - if( el !== element) { - element.style.backgroundColor = "white"; - element.style.color = "black"; - } - }); - // set scope variable manually each time - if($scope.selectedTemplate !== template) { - $scope.selectedTemplate = template; - } - } - - /** - * converts a base64 encoded data url SVG image to a PNG image - * @param originalBase64 data url of svg image - * @param width target width in pixel of PNG image - * @return {Promise} resolves to png data url of the image - */ - async function base64SvgToBase64Png (originalBase64, width) { - return await new Promise(resolve => { - let img = document.createElement('img'); - img.onload = function () { - document.body.appendChild(img); - let canvas = document.createElement("canvas"); - let ratio = (img.clientWidth / img.clientHeight) || 1; - document.body.removeChild(img); - canvas.width = width; - canvas.height = width / ratio; - let ctx = canvas.getContext("2d"); - ctx.drawImage(img, 0, 0, canvas.width, canvas.height); - try { - let data = canvas.toDataURL('image/png'); - resolve(data); - } catch (e) { - resolve(null); - } - }; - img.src = originalBase64; - }); - } - - /** - * reads a file chosen by the user - * @returns {string} file content - */ - function readSingleFile(e) { - let content = ""; - let srcElement = e.srcElement; - let file = e.target.files[0]; - if (!file) { - return; - } - var reader = new FileReader(); - reader.onload = async function(e) { - content = e.target.result; - - // if content is SVG base64 string then convert that to png image - // as svg is porblemativ when perfirming PDF export later with jsPDF - if(content.includes("svg")){ - content = await base64SvgToBase64Png(content, 250); - } - - if(srcElement.id === "reporting-load-commune-logo-button") { - $scope.generalSettings.communeLogo = content; - // set isPlaceholder to false - for(let template of $scope.availableTemplates) { - $scope.iteratePageElements( template, function(page, pageElement) { - if(pageElement.type === "communeLogo-landscape") { - pageElement.isPlaceholder = false; - pageElement.src = content; - } - }) - } - - $timeout(function(){ - $scope.$digest(); - }); - } - }; - reader.readAsDataURL(file); - } - - $scope.templateSupportsFreeText = function() { - if(typeof($scope.selectedTemplate) === "undefined") - return false; - - if(!$scope.selectedTemplate.pages) { - return false; - } - - for(let page of $scope.selectedTemplate.pages) { - for(let pageElement of page.pageElements) { - if (pageElement.type === "textInput") { - return true; - } - } - } - return false; - } - - - $scope.onTemplateSelected = function() { - // update selected template with general settings - for(let [idx, page] of $scope.selectedTemplate.pages.entries()) { - for(let el of page.pageElements) { - if(el.type === "footerCreationInfo-landscape") { - el.text = "Erstellt am " + $scope.generalSettings.creationDate + " von " + $scope.generalSettings.creator + ", " + $scope.generalSettings.commune - } - if(el.type === "textInput") { - el.text = $scope.generalSettings.freeText; - } - - // page number is generated by html expression, but we update if anyway for consistency - if(el.type === "pageNumber-landscape") { - el.placeholderText = "Seite " + (idx+1) - } - } - } - $scope.$emit('reportingTemplateSelected', $scope.selectedTemplate) - } - - $scope.onBackToWorkflowSelectionClicked = function() { - $scope.selectedTemplate = {}; - $scope.$emit('reportingBackToWorkflowSelectionClicked') - } - - $scope.iteratePageElements = function(template, functionToExecute) { - for(let page of template.pages) { - for(let pageElement of page.pageElements) { - functionToExecute(page, pageElement); - } - } - } - - // Format: YYYY-MM-DD - function getCurrentDate() { - let now = new Date(); - const offset = now.getTimezoneOffset() - now = new Date(now.getTime() - (offset*60*1000)) - return now.toISOString().split('T')[0] - } - } -]}); \ No newline at end of file + "columnNames": [], + "tableData": [] + }, + ] + } + ] + }, + { + "name": "A4-landscape-reachability", + "displayName": "DIN A4, Querformat", + "categoryId": 3, + "pages": [ + { + "orientation": "landscape", + "pageElements": [ + // different placeholder so we don't use the default here + { + "type": "indicatorTitle-landscape", + "dimensions": { + "top": "15px", + "left": "15px", + "width": "720px", + "height": "30px" + }, + "isPlaceholder": true, + "placeholderText": "Entfernungen für [Name POI]", + "text": "", + "css": "text-align: left; padding-left: 5px; font-weight: bold;" + }, + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("reachability-subtitle-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), + { + // isochrones, only show main roads if possible + "type": "map", + "dimensions": { + "top": "90px", + "left": "15px", + "width": "800px", + "height": "440px" + }, + "isPlaceholder": true, + "placeholderText": "Karte Gesamtstadt mit Isochronen, Grenzen der gewählten Bereiche farblich hervorgehoben. Kartenhintergrund: nur Hauptstraßen.", + "colorScheme": undefined, + "classify": false, + }, + { + "type": "mapLegend", + "dimensions": { + // used for the placeholder only + "top": "400px", + "left": "700px", + "width": "100px", + "height": "120px" + }, + "isPlaceholder": true, + "placeholderText": "Legende" + }, + { + "type": "mapAttribution", + "dimensions": { + // used for the placeholder only + "top": "495px", + "left": "25px", + "width": "125px", + "height": "25px" + }, + "isPlaceholder": true, + "placeholderText": "Copyrightvermerk" + } + ] + }, + // one page for each selected area + { + "orientation": "landscape", + "area": "", + "pageElements": [ + // different placeholder so we don't use the default here + { + "type": "indicatorTitle-landscape", + "dimensions": { + "top": "15px", + "left": "15px", + "width": "720px", + "height": "30px" + }, + "isPlaceholder": true, + "placeholderText": "Entfernungen für [Name POI], Bereich (Diese Seite wird für jeden Bereich wiederholt)", + "text": "", + "css": "text-align: left; padding-left: 5px; font-weight: bold;" + }, + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("reachability-subtitle-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), + { + // isochrones, background map in grayscale + "type": "map", + "dimensions": { + "top": "90px", + "left": "15px", + "width": "800px", + "height": "440px" + }, + "isPlaceholder": true, + "placeholderText": "Karte Detailansicht Bereich mit Isochronen, Hintergrund OSM-Karte in Graustufen", + "colorScheme": undefined, + "classify": false, + }, + { + "type": "mapLegend", + "dimensions": { + // used for the placeholder only + "top": "400px", + "left": "700px", + "width": "100px", + "height": "120px" + }, + "isPlaceholder": true, + "placeholderText": "Legende" + }, + { + "type": "mapAttribution", + "dimensions": { + // used for the placeholder only + "top": "495px", + "left": "25px", + "width": "125px", + "height": "25px" + }, + "isPlaceholder": true, + "placeholderText": "Copyrightvermerk" + } + ] + } + // end of area-specific part + ] + } + ]; + $scope.selectedTemplate = undefined; + $scope.$on('reportingInitializeTemplateSelect', function (event, data) { + $scope.initialize(); + }); + $scope.initialize = function () { + // open first category + let collapsible = document.querySelector("#reporting-template-category-accordion #collapse1"); + collapsible.classList.add("in"); + // select first template + collapsible.querySelector("#collapse1-template0").click(); + $scope.datePicker = $('#reporting-general-settings-datefield').datepicker({ + autoclose: true, + language: 'de', + format: 'yyyy-mm-dd' + }); + document.getElementById("reporting-load-commune-logo-button").addEventListener('change', readSingleFile, false); + // set the property "isPlaceholder" to false for specific page elements since their content should be replaced right away + for (let template of $scope.availableTemplates) { + $scope.iteratePageElements(template, function (page, pageElement) { + pageElement.isPlaceholder = (pageElement.type === "footerCreationInfo-landscape" || + pageElement.type === "pageNumber-landscape" || + pageElement.type === "textInput") ? false : true; + }); + } + for (let template of $scope.availableTemplates) { + for (let page of template.pages) { + for (let el of page.pageElements) { + el.isPlaceholder = (el.type === "footerCreationInfo-landscape" || + el.type === "pageNumber-landscape" || + el.type === "textInput") ? false : true; + } + } + } + }; + /** + * filters templates to only show the ones matching the given category. + * @param {*} categoryId + * @returns + */ + $scope.templateFilter = function (categoryId) { + return function (value) { + return categoryId === value.categoryId; + }; + }; + $scope.onTemplateElementClicked = function ($event, template) { + let el = $event.target; + el.style.backgroundColor = "#0078D7"; + el.style.color = "white"; + document.querySelectorAll(".reporting-selectable-template").forEach((element) => { + if (el !== element) { + element.style.backgroundColor = "white"; + element.style.color = "black"; + } + }); + // set scope variable manually each time + if ($scope.selectedTemplate !== template) { + $scope.selectedTemplate = template; + } + }; + /** + * converts a base64 encoded data url SVG image to a PNG image + * @param originalBase64 data url of svg image + * @param width target width in pixel of PNG image + * @return {Promise} resolves to png data url of the image + */ + async function base64SvgToBase64Png(originalBase64, width) { + return await new Promise(resolve => { + let img = document.createElement('img'); + img.onload = function () { + document.body.appendChild(img); + let canvas = document.createElement("canvas"); + let ratio = (img.clientWidth / img.clientHeight) || 1; + document.body.removeChild(img); + canvas.width = width; + canvas.height = width / ratio; + let ctx = canvas.getContext("2d"); + ctx.drawImage(img, 0, 0, canvas.width, canvas.height); + try { + let data = canvas.toDataURL('image/png'); + resolve(data); + } + catch (e) { + resolve(null); + } + }; + img.src = originalBase64; + }); + } + /** + * reads a file chosen by the user + * @returns {string} file content + */ + function readSingleFile(e) { + let content = ""; + let srcElement = e.srcElement; + let file = e.target.files[0]; + if (!file) { + return; + } + var reader = new FileReader(); + reader.onload = async function (e) { + content = e.target.result; + // if content is SVG base64 string then convert that to png image + // as svg is porblemativ when perfirming PDF export later with jsPDF + if (content.includes("svg")) { + content = await base64SvgToBase64Png(content, 250); + } + if (srcElement.id === "reporting-load-commune-logo-button") { + $scope.generalSettings.communeLogo = content; + // set isPlaceholder to false + for (let template of $scope.availableTemplates) { + $scope.iteratePageElements(template, function (page, pageElement) { + if (pageElement.type === "communeLogo-landscape") { + pageElement.isPlaceholder = false; + pageElement.src = content; + } + }); + } + $timeout(function () { + $scope.$digest(); + }); + } + }; + reader.readAsDataURL(file); + } + $scope.templateSupportsFreeText = function () { + if (typeof ($scope.selectedTemplate) === "undefined") + return false; + if (!$scope.selectedTemplate.pages) { + return false; + } + for (let page of $scope.selectedTemplate.pages) { + for (let pageElement of page.pageElements) { + if (pageElement.type === "textInput") { + return true; + } + } + } + return false; + }; + $scope.onTemplateSelected = function () { + // update selected template with general settings + for (let [idx, page] of $scope.selectedTemplate.pages.entries()) { + for (let el of page.pageElements) { + if (el.type === "footerCreationInfo-landscape") { + el.text = "Erstellt am " + $scope.generalSettings.creationDate + " von " + $scope.generalSettings.creator + ", " + $scope.generalSettings.commune; + } + if (el.type === "textInput") { + el.text = $scope.generalSettings.freeText; + } + // page number is generated by html expression, but we update if anyway for consistency + if (el.type === "pageNumber-landscape") { + el.placeholderText = "Seite " + (idx + 1); + } + } + } + $scope.$emit('reportingTemplateSelected', $scope.selectedTemplate); + }; + $scope.onBackToWorkflowSelectionClicked = function () { + $scope.selectedTemplate = {}; + $scope.$emit('reportingBackToWorkflowSelectionClicked'); + }; + $scope.iteratePageElements = function (template, functionToExecute) { + for (let page of template.pages) { + for (let pageElement of page.pageElements) { + functionToExecute(page, pageElement); + } + } + }; + // Format: YYYY-MM-DD + function getCurrentDate() { + let now = new Date(); + const offset = now.getTimezoneOffset(); + now = new Date(now.getTime() - (offset * 60 * 1000)); + return now.toISOString().split('T')[0]; + } + } + ] +}); +//# sourceMappingURL=reporting-template-select.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingTemplateSelect/reporting-template-select.component.js.map b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingTemplateSelect/reporting-template-select.component.js.map new file mode 100644 index 000000000..9309f7112 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingTemplateSelect/reporting-template-select.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"reporting-template-select.component.js","sourceRoot":"","sources":["reporting-template-select.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC,SAAS,CAAC,yBAAyB,EAAE;IAC9E,WAAW,EAAG,sIAAsI;IACpJ,UAAU,EAAG,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,+BAA+B;QAC1F,SAAS,iCAAiC,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,6BAA6B;YAE5G,MAAM,CAAC,eAAe,GAAG;gBACxB,OAAO,EAAE,eAAe;gBACxB,OAAO,EAAE,aAAa;gBACtB,WAAW,EAAE,EAAE;gBACf,YAAY,EAAE,cAAc,EAAE;gBAC9B,QAAQ,EAAE,MAAM;aAChB,CAAA;YACD,MAAM,CAAC,2BAA2B,GAAG;gBACpC;oBACC,IAAI,EAAE,CAAC;oBACP,aAAa,EAAE,WAAW;iBAC1B;gBACD;oBACC,IAAI,EAAE,CAAC;oBACP,aAAa,EAAE,WAAW;iBAC1B;gBACD;oBACC,IAAI,EAAE,CAAC;oBACP,aAAa,EAAE,gBAAgB;iBAC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AAG,CAAC,MAAM,GAAC,EAAE,GAAC,IAAI,CAAC,CAAC,CAAA;gBAChD,OAAO,GAAG,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;YACvC,CAAC;QACF,CAAC;KACD;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingTemplateSelect/reporting-template-select.component.ts b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingTemplateSelect/reporting-template-select.component.ts new file mode 100644 index 000000000..536e8cc7f --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingTemplateSelect/reporting-template-select.component.ts @@ -0,0 +1,918 @@ +angular.module('reportingTemplateSelect').component('reportingTemplateSelect', { + templateUrl : "components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingTemplateSelect/reporting-template-select.template.html", + controller : ['$scope', '$rootScope', '__env', '$timeout', 'kommonitorDataExchangeService', + function ReportingTemplateSelectController($scope, $rootScope, __env, $timeout, kommonitorDataExchangeService) { + + $scope.generalSettings = { + creator: "M. Mustermann", + commune: "Testkommune", + communeLogo: "", + creationDate: getCurrentDate(), + freeText: "Text", + } + $scope.availableTemplateCategories = [ + { + "id": 1, + "displayName": "Zeitpunkt", + }, + { + "id": 2, + "displayName": "Zeitserie", + }, + { + "id": 3, + "displayName": "Erreichbarkeit", + } + ] + + // A basic version of the templates. + // These are not full-fledged templates yet, but they can serve as a starting point and are adjusted according to user choices dynamically. + $scope.availableTemplates = [ + { + "name": "A4-landscape-timestamp", + "displayName": "DIN A4, Querformat", + "categoryId": 1, + "pages": [ + { + "orientation": "landscape", + "pageElements": [ + + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("indicatorTitle-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("dataTimestamp-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), + + { + "type": "map", + "dimensions": { + "top": "90px", + "left": "15px", + "width": "800px", + "height": "440px" + }, + "isPlaceholder": true, + "placeholderText": + "Übersichtskarte ohne Klassifizierung.\ + Selektierte Bereiche farblich markiert.\ + Beschriftung: Quote/Anzahl pro Bereich.\ + Keine Hintergrundkarte.", + "colorScheme": undefined, + "classify": false, + + }, + { + "type": "overallAverage", + "dimensions": { + "top": "100px", + "left": "700px", + "width": "100px", + "height": "60px" + }, + "isPlaceholder": true, + "placeholderText": "Durchschnitt Gesamtstadt" + }, + { + "type": "selectionAverage", + "dimensions": { + "top": "180px", + "left": "700px", + "width": "100px", + "height": "60px" + }, + "isPlaceholder": true, + "placeholderText": "Durchschnitt Selektion" + } + ] + }, + { + "orientation": "landscape", + "pageElements": [ + + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("indicatorTitle-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("dataTimestamp-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), + + { + "type": "map", + "dimensions": { + "top": "90px", + "left": "15px", + "width": "800px", + "height": "440px" + }, + "isPlaceholder": true, + "placeholderText": + "Übersichtskarte klassifiziert.\ + Beschriftung: Quote/Anzahl pro Bereich.\ + Keine Hintergrundkarte.", + "colorScheme": undefined, + "classify": true, + }, + { + "type": "overallAverage", + "dimensions": { + "top": "100px", + "left": "700px", + "width": "100px", + "height": "60px" + }, + "isPlaceholder": true, + "placeholderText": "Durchschnitt Gesamtstadt" + }, + { + "type": "selectionAverage", + "dimensions": { + "top": "180px", + "left": "700px", + "width": "100px", + "height": "60px" + }, + "isPlaceholder": true, + "placeholderText": "Durchschnitt Selektion" + }, + { + "type": "mapLegend", + "dimensions": { + "top": "400px", + "left": "700px", + "width": "100px", + "height": "120px" + }, + "isPlaceholder": true, + "placeholderText": "Legende" + } + ] + }, + { + "orientation": "landscape", + "pageElements": [ + + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("indicatorTitle-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("dataTimestamp-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), + + { + "type": "barchart", + "dimensions": { + "top": "90px", + "left": "15px", + "width": "800px", + "height": "440px" + }, + "isPlaceholder": true, + "placeholderText": "Säulendiagramm. Eine Säule pro selektiertem Bereich + Durchschnitt der Gesamtstadt" + } + ] + }, + // one page for each selected area + { + "orientation": "landscape", + "area": "", // the area shown on this page or an empty string if it is a placeholder page + "pageElements": [ + + + // different placeholder so we don't use the default here + { + "type": "indicatorTitle-landscape", + "dimensions": { + "top": "15px", + "left": "15px", + "width": "720px", + "height": "30px" + }, + "isPlaceholder": true, + "placeholderText": "Titel des Indikators [Einheit], Bereich (Diese Seite wird für jeden Bereich wiederholt)", + "text": "", + "css": "text-align: left; padding-left: 5px; font-weight: bold;" + }, + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("dataTimestamp-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), + + { + "type": "map", + "dimensions": { + "top": "90px", + "left": "15px", + "width": "400px", + "height": "440px" + }, + "isPlaceholder": true, + "placeholderText": + "Karte.\ + Detailansicht des Bereichs.\ + Keine Hintergrundkarte.", + "colorScheme": undefined, + "classify": true, + }, + { + "type": "barchart", + "dimensions": { + "top": "90px", + "left": "425px", + "width": "390px", + "height": "140px" + }, + "isPlaceholder": true, + "placeholderText": "Säulendiagramm. Vergleich des Bereichs mit dem Durchschnitt 1. aller selektierten Bereiche und 2. der Gesamtstadt." + }, + { + "type": "textInput", + "dimensions": { + "top": "390px", + "left": "425px", + "width": "390px", + "height": "140px" + }, + "isPlaceholder": true, + "placeholderText": "Freitext", + "css": "align-self: self-start; margin-bottom: auto; text-align: left;" + } + ] + }, + // end of area-specific part + // datatable might need multiple pages + { + "orientation": "landscape", + "pageElements": [ + + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("indicatorTitle-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("dataTimestamp-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), + + { + "type": "datatable", + "dimensions": { + "top": "90px", + "left": "15px", + "width": "300px", + "height": "440px" + }, + "isPlaceholder": true, + "placeholderText": + "Datentabelle (Spalten: Bereich, Wert).\ + Ggf. über mehrere Seiten.", + "columnNames": [], + "tableData": [] + } + ] + } + ] + }, + { + "name": "A4-landscape-timeseries", + "displayName": "DIN A4, Querformat", + "categoryId": 2, + "pages": [ + { + "orientation": "landscape", + "pageElements": [ + + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("indicatorTitle-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("dataTimestamp-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), + + { + "type": "map", + "dimensions": { + "top": "90px", + "left": "15px", + "width": "800px", + "height": "440px" + }, + "isPlaceholder": true, + "placeholderText": + "Übersichtskarte ohne Klassifizierung.\ + Selektierte Bereiche farblich markiert.\ + Beschriftung: Quote/Anzahl pro Bereich (aktuellster Wert).\ + Keine Hintergrundkarte.", + "colorScheme": undefined, + "classify": false, + }, + { + "type": "overallAverage", + "dimensions": { + "top": "100px", + "left": "700px", + "width": "100px", + "height": "60px" + }, + "isPlaceholder": true, + "placeholderText": "Durchschnitt Gesamtstadt (aktuellster Wert)" + }, + { + "type": "selectionAverage", + "dimensions": { + "top": "180px", + "left": "700px", + "width": "100px", + "height": "60px" + }, + "isPlaceholder": true, + "placeholderText": "Durchschnitt Selektion (aktuellster Wert)" + } + ] + }, + { + "orientation": "landscape", + "pageElements": [ + + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("indicatorTitle-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("dataTimeseries-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), + + { + "type": "map", + "dimensions": { + "top": "90px", + "left": "15px", + "width": "800px", + "height": "440px" + }, + "isPlaceholder": true, + "placeholderText": + "Übersichtskarte, klassifiziert.\ + Veränderung ältester Wert --> aktuellster Wert.\ + Beschriftung: Veränderung in Einheit des Indikators.\ + Keine Hintergrundkarte.", + "colorScheme": undefined, + "classify": true, + "isTimeseries": true + }, + { + "type": "overallChange", + "dimensions": { + "top": "100px", + "left": "700px", + "width": "100px", + "height": "60px" + }, + "isPlaceholder": true, + "placeholderText": "Veränderung Gesamtstadt" + }, + { + "type": "selectionChange", + "dimensions": { + "top": "180px", + "left": "700px", + "width": "100px", + "height": "60px" + }, + "isPlaceholder": true, + "placeholderText": "Veränderung Selektion" + }, + { + "type": "mapLegend", + "dimensions": { + "top": "400px", + "left": "700px", + "width": "100px", + "height": "120px" + }, + "isPlaceholder": true, + "placeholderText": "Legende" + } + ] + }, + { + "orientation": "landscape", + "pageElements": [ + + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("indicatorTitle-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("dataTimeseries-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), + + { + "type": "linechart", + "dimensions": { + "top": "90px", + "left": "15px", + "width": "800px", + "height": "440px" + }, + "isPlaceholder": true, + "placeholderText": "Zeitreihendiagramm. Eine Linie pro ausgewähltem Bereich + Durchschnitt Gesamtstadt.", + "showAverage": true, + "showAreas": true, + "showBoxplots": false + } + ] + }, + { + "orientation": "landscape", + "pageElements": [ + + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("indicatorTitle-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("dataTimeseries-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), + + { + // with boxplot at each data point + "type": "linechart", + "dimensions": { + "top": "90px", + "left": "15px", + "width": "800px", + "height": "440px" + }, + "isPlaceholder": true, + "placeholderText": "Zeitreihendiagramm. Durchschnitt Gesamtstadt + Boxplot pro Zeitpunkt", + "showAverage": true, + "showAreas": false, + "showBoxplots": true + + } + ] + }, + // one page for each selected area + { + "orientation": "landscape", + "area": "", + "pageElements": [ + + // different placeholder so we don't use the default here + { + "type": "indicatorTitle-landscape", + "dimensions": { + "top": "15px", + "left": "15px", + "width": "720px", + "height": "30px" + }, + "isPlaceholder": true, + "placeholderText": "Titel des Indikators [Einheit], Bereich (Diese Seite wird für jeden Bereich wiederholt)", + "text": "", + "css": "text-align: left; padding-left: 5px; font-weight: bold;" + }, + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("dataTimeseries-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), + + { + "type": "map", + "dimensions": { + "top": "90px", + "left": "15px", + "width": "400px", + "height": "440px" + }, + "isPlaceholder": true, + "placeholderText": + "Karte.\ + Detailansicht des Bereichs.\ + Keine Hintergrundkarte.", + "colorScheme": undefined, + "classify": true, + "isTimeseries": true + }, + { + "type": "linechart", + "dimensions": { + "top": "90px", + "left": "425px", + "width": "390px", + "height": "140px" + }, + "isPlaceholder": true, + "placeholderText": "Zeitreihendiagramm. Vergleich des Bereichs mit dem Durchschnitt der Gesamtstadt.", + "showAverage": true, + "showAreas": true, + "showBoxplots": false + }, + { + + "type": "linechart", + "dimensions": { + "top": "240px", + "left": "425px", + "width": "390px", + "height": "140px" + }, + "isPlaceholder": true, + "placeholderText": "Liniendiagramm. Veränderung zum Vorjahr in Prozent", + "showAverage": true, + "showAreas": true, + "showAverage": true, + "showPercentageChangeToPrevTimestamp": true + }, + { + "type": "textInput", + "dimensions": { + "top": "390px", + "left": "425px", + "width": "390px", + "height": "140px" + }, + "isPlaceholder": true, + "placeholderText": "Freitext", + "css": "align-self: self-start; margin-bottom: auto; text-align: left;" + } + ] + }, + // end of area-specific part + // datatable might need multiple pages + { + "orientation": "landscape", + "pageElements": [ + + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("indicatorTitle-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("dataTimeseries-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), + + { + // should include data for different timestamps + "type": "datatable", + "dimensions": { + "top": "90px", + "left": "15px", + "width": "300px", + "height": "440px" + }, + "isPlaceholder": true, + "placeholderText": + "Datentabelle (Spalten: Bereich, Zeitpunkt, Wert).\ + Ggf. über mehrere Seiten.", + "columnNames": [], + "tableData": [] + }, + ] + } + ] + }, + { + "name": "A4-landscape-reachability", + "displayName": "DIN A4, Querformat", + "categoryId": 3, + "pages": [ + { + "orientation": "landscape", + "pageElements": [ + + // different placeholder so we don't use the default here + { + "type": "indicatorTitle-landscape", + "dimensions": { + "top": "15px", + "left": "15px", + "width": "720px", + "height": "30px" + }, + "isPlaceholder": true, + "placeholderText": "Entfernungen für [Name POI]", + "text": "", + "css": "text-align: left; padding-left: 5px; font-weight: bold;" + }, + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("reachability-subtitle-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), + + { + // isochrones, only show main roads if possible + "type": "map", + "dimensions": { + "top": "90px", + "left": "15px", + "width": "800px", + "height": "440px" + }, + "isPlaceholder": true, + "placeholderText": "Karte Gesamtstadt mit Isochronen, Grenzen der gewählten Bereiche farblich hervorgehoben. Kartenhintergrund: nur Hauptstraßen.", + "colorScheme": undefined, + "classify": false, + }, + { + "type": "mapLegend", + "dimensions": { + // used for the placeholder only + "top": "400px", + "left": "700px", + "width": "100px", + "height": "120px" + }, + "isPlaceholder": true, + "placeholderText": "Legende" + }, + { + "type": "mapAttribution", + "dimensions": { + // used for the placeholder only + "top": "495px", + "left": "25px", + "width": "125px", + "height": "25px" + }, + "isPlaceholder": true, + "placeholderText": "Copyrightvermerk" + } + + ] + }, + // one page for each selected area + { + "orientation": "landscape", + "area": "", + "pageElements": [ + + + // different placeholder so we don't use the default here + { + "type": "indicatorTitle-landscape", + "dimensions": { + "top": "15px", + "left": "15px", + "width": "720px", + "height": "30px" + }, + "isPlaceholder": true, + "placeholderText": "Entfernungen für [Name POI], Bereich (Diese Seite wird für jeden Bereich wiederholt)", + "text": "", + "css": "text-align: left; padding-left: 5px; font-weight: bold;" + }, + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("communeLogo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("reachability-subtitle-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerHorizontalSpacer-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("footerCreationInfo-landscape"), + kommonitorDataExchangeService.getDefaultReportingTemplatePageElement("pageNumber-landscape"), + + { + // isochrones, background map in grayscale + "type": "map", + "dimensions": { + "top": "90px", + "left": "15px", + "width": "800px", + "height": "440px" + }, + "isPlaceholder": true, + "placeholderText": "Karte Detailansicht Bereich mit Isochronen, Hintergrund OSM-Karte in Graustufen", + "colorScheme": undefined, + "classify": false, + }, + { + "type": "mapLegend", + "dimensions": { + // used for the placeholder only + "top": "400px", + "left": "700px", + "width": "100px", + "height": "120px" + }, + "isPlaceholder": true, + "placeholderText": "Legende" + }, + { + "type": "mapAttribution", + "dimensions": { + // used for the placeholder only + "top": "495px", + "left": "25px", + "width": "125px", + "height": "25px" + }, + "isPlaceholder": true, + "placeholderText": "Copyrightvermerk" + } + ] + } + // end of area-specific part + ] + } + ] + + $scope.selectedTemplate = undefined; + + $scope.$on('reportingInitializeTemplateSelect', function(event, data) { + $scope.initialize(); + }); + + $scope.initialize = function() { + // open first category + let collapsible = document.querySelector("#reporting-template-category-accordion #collapse1") + collapsible.classList.add("in"); + // select first template + collapsible.querySelector("#collapse1-template0").click(); + + $scope.datePicker = $('#reporting-general-settings-datefield').datepicker({ + autoclose: true, + language: 'de', + format: 'yyyy-mm-dd' + }); + document.getElementById("reporting-load-commune-logo-button").addEventListener('change', readSingleFile, false); + + // set the property "isPlaceholder" to false for specific page elements since their content should be replaced right away + for(let template of $scope.availableTemplates) { + $scope.iteratePageElements( template, function(page, pageElement) { + pageElement.isPlaceholder = ( + pageElement.type === "footerCreationInfo-landscape" || + pageElement.type === "pageNumber-landscape" || + pageElement.type === "textInput" + ) ? false : true; + }) + } + + for(let template of $scope.availableTemplates) { + for(let page of template.pages) { + for(let el of page.pageElements) { + el.isPlaceholder = ( + el.type === "footerCreationInfo-landscape" || + el.type === "pageNumber-landscape" || + el.type === "textInput" + ) ? false : true; + } + } + } + + } + + + + /** + * filters templates to only show the ones matching the given category. + * @param {*} categoryId + * @returns + */ + $scope.templateFilter = function(categoryId) { + return function(value) { + return categoryId === value.categoryId; + } + } + + $scope.onTemplateElementClicked = function($event, template) { + let el = $event.target; + el.style.backgroundColor = "#0078D7"; + el.style.color = "white"; + document.querySelectorAll(".reporting-selectable-template").forEach( (element) => { + if( el !== element) { + element.style.backgroundColor = "white"; + element.style.color = "black"; + } + }); + // set scope variable manually each time + if($scope.selectedTemplate !== template) { + $scope.selectedTemplate = template; + } + } + + /** + * converts a base64 encoded data url SVG image to a PNG image + * @param originalBase64 data url of svg image + * @param width target width in pixel of PNG image + * @return {Promise} resolves to png data url of the image + */ + async function base64SvgToBase64Png (originalBase64, width) { + return await new Promise(resolve => { + let img = document.createElement('img'); + img.onload = function () { + document.body.appendChild(img); + let canvas = document.createElement("canvas"); + let ratio = (img.clientWidth / img.clientHeight) || 1; + document.body.removeChild(img); + canvas.width = width; + canvas.height = width / ratio; + let ctx = canvas.getContext("2d"); + ctx.drawImage(img, 0, 0, canvas.width, canvas.height); + try { + let data = canvas.toDataURL('image/png'); + resolve(data); + } catch (e) { + resolve(null); + } + }; + img.src = originalBase64; + }); + } + + /** + * reads a file chosen by the user + * @returns {string} file content + */ + function readSingleFile(e) { + let content = ""; + let srcElement = e.srcElement; + let file = e.target.files[0]; + if (!file) { + return; + } + var reader = new FileReader(); + reader.onload = async function(e) { + content = e.target.result; + + // if content is SVG base64 string then convert that to png image + // as svg is porblemativ when perfirming PDF export later with jsPDF + if(content.includes("svg")){ + content = await base64SvgToBase64Png(content, 250); + } + + if(srcElement.id === "reporting-load-commune-logo-button") { + $scope.generalSettings.communeLogo = content; + // set isPlaceholder to false + for(let template of $scope.availableTemplates) { + $scope.iteratePageElements( template, function(page, pageElement) { + if(pageElement.type === "communeLogo-landscape") { + pageElement.isPlaceholder = false; + pageElement.src = content; + } + }) + } + + $timeout(function(){ + $scope.$digest(); + }); + } + }; + reader.readAsDataURL(file); + } + + $scope.templateSupportsFreeText = function() { + if(typeof($scope.selectedTemplate) === "undefined") + return false; + + if(!$scope.selectedTemplate.pages) { + return false; + } + + for(let page of $scope.selectedTemplate.pages) { + for(let pageElement of page.pageElements) { + if (pageElement.type === "textInput") { + return true; + } + } + } + return false; + } + + + $scope.onTemplateSelected = function() { + // update selected template with general settings + for(let [idx, page] of $scope.selectedTemplate.pages.entries()) { + for(let el of page.pageElements) { + if(el.type === "footerCreationInfo-landscape") { + el.text = "Erstellt am " + $scope.generalSettings.creationDate + " von " + $scope.generalSettings.creator + ", " + $scope.generalSettings.commune + } + if(el.type === "textInput") { + el.text = $scope.generalSettings.freeText; + } + + // page number is generated by html expression, but we update if anyway for consistency + if(el.type === "pageNumber-landscape") { + el.placeholderText = "Seite " + (idx+1) + } + } + } + $scope.$emit('reportingTemplateSelected', $scope.selectedTemplate) + } + + $scope.onBackToWorkflowSelectionClicked = function() { + $scope.selectedTemplate = {}; + $scope.$emit('reportingBackToWorkflowSelectionClicked') + } + + $scope.iteratePageElements = function(template, functionToExecute) { + for(let page of template.pages) { + for(let pageElement of page.pageElements) { + functionToExecute(page, pageElement); + } + } + } + + // Format: YYYY-MM-DD + function getCurrentDate() { + let now = new Date(); + const offset = now.getTimezoneOffset() + now = new Date(now.getTime() - (offset*60*1000)) + return now.toISOString().split('T')[0] + } + } +]}); \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingTemplateSelect/reporting-template-select.module.js b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingTemplateSelect/reporting-template-select.module.js index 28e14efb7..9bda3520a 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingTemplateSelect/reporting-template-select.module.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingTemplateSelect/reporting-template-select.module.js @@ -1 +1,3 @@ -angular.module('reportingTemplateSelect', ['ngSanitize']); \ No newline at end of file +"use strict"; +angular.module('reportingTemplateSelect', ['ngSanitize']); +//# sourceMappingURL=reporting-template-select.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingTemplateSelect/reporting-template-select.module.js.map b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingTemplateSelect/reporting-template-select.module.js.map new file mode 100644 index 000000000..db0b7f71e --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingTemplateSelect/reporting-template-select.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"reporting-template-select.module.js","sourceRoot":"","sources":["reporting-template-select.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,yBAAyB,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingTemplateSelect/reporting-template-select.module.ts b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingTemplateSelect/reporting-template-select.module.ts new file mode 100644 index 000000000..28e14efb7 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingTemplateSelect/reporting-template-select.module.ts @@ -0,0 +1 @@ +angular.module('reportingTemplateSelect', ['ngSanitize']); \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingWorkflowSelect/reporting-workflow-select.component.js b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingWorkflowSelect/reporting-workflow-select.component.js index 15d06a56f..48779c60e 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingWorkflowSelect/reporting-workflow-select.component.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingWorkflowSelect/reporting-workflow-select.component.js @@ -1,61 +1,53 @@ +"use strict"; angular.module('reportingWorkflowSelect').component('reportingWorkflowSelect', { - templateUrl : "components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingWorkflowSelect/reporting-workflow-select.template.html", - controller : ['$scope', function ReportingWorkflowSelectController($scope) { - - - // on modal opened - $('#reporting-modal').on('shown.bs.modal', function () { - $scope.initialize(); - }); - - $scope.initialize = function() { - - document.getElementById("reporting-load-settings-button").addEventListener('change', function(e) { - $scope.readFile(e) - }, false); - - } - - - $scope.onWorkflowSelected = function(type, config=undefined) { - if(type === "new") { - $scope.$emit('reportingWorkflowSelected') - } else if(type === "existing") { - $scope.$emit('reportingWorkflowSelected', config) - } else { - throw new Error("Workflow type was neither 'new' nor 'existing'") - } - } - - /** - * helper function to read a file from disk - * @param {*} e | the event that triggered the function - * @returns - */ - $scope.readFile = function(e) { - let content = ""; - let file = e.target.files[0]; - if (!file) - return; - - let reader = new FileReader(); - reader.onload = function(e) { - content = e.target.result; - let config = undefined; - try { - config = JSON.parse(content); - } catch(e) { - console.error("Configuration is no valid JSON.") - } - - //TODO check if json has correct structure, can be done once config structure is defined - - $scope.onWorkflowSelected("existing", config) - - }; - reader.readAsText(file); - } - - - } -]}); \ No newline at end of file + templateUrl: "components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingWorkflowSelect/reporting-workflow-select.template.html", + controller: ['$scope', function ReportingWorkflowSelectController($scope) { + // on modal opened + $('#reporting-modal').on('shown.bs.modal', function () { + $scope.initialize(); + }); + $scope.initialize = function () { + document.getElementById("reporting-load-settings-button").addEventListener('change', function (e) { + $scope.readFile(e); + }, false); + }; + $scope.onWorkflowSelected = function (type, config = undefined) { + if (type === "new") { + $scope.$emit('reportingWorkflowSelected'); + } + else if (type === "existing") { + $scope.$emit('reportingWorkflowSelected', config); + } + else { + throw new Error("Workflow type was neither 'new' nor 'existing'"); + } + }; + /** + * helper function to read a file from disk + * @param {*} e | the event that triggered the function + * @returns + */ + $scope.readFile = function (e) { + let content = ""; + let file = e.target.files[0]; + if (!file) + return; + let reader = new FileReader(); + reader.onload = function (e) { + content = e.target.result; + let config = undefined; + try { + config = JSON.parse(content); + } + catch (e) { + console.error("Configuration is no valid JSON."); + } + //TODO check if json has correct structure, can be done once config structure is defined + $scope.onWorkflowSelected("existing", config); + }; + reader.readAsText(file); + }; + } + ] +}); +//# sourceMappingURL=reporting-workflow-select.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingWorkflowSelect/reporting-workflow-select.component.js.map b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingWorkflowSelect/reporting-workflow-select.component.js.map new file mode 100644 index 000000000..3f2fc0fa3 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingWorkflowSelect/reporting-workflow-select.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"reporting-workflow-select.component.js","sourceRoot":"","sources":["reporting-workflow-select.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC,SAAS,CAAC,yBAAyB,EAAE;IAC9E,WAAW,EAAG,sIAAsI;IACpJ,UAAU,EAAG,CAAC,QAAQ,EAAG,SAAS,iCAAiC,CAAC,MAAM;YAGzE,kBAAkB;YAClB,CAAC,CAAC,kBAAkB,CAAC,CAAC,EAAE,CAAC,gBAAgB,EAAE;gBAC1C,MAAM,CAAC,UAAU,EAAE,CAAC;YACrB,CAAC,CAAC,CAAC;YAEH,MAAM,CAAC,UAAU,GAAG;gBAEnB,QAAQ,CAAC,cAAc,CAAC,gCAAgC,CAAC,CAAC,gBAAgB,CAAC,QAAQ,EAAE,UAAS,CAAC;oBAC9F,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;gBACnB,CAAC,EAAE,KAAK,CAAC,CAAC;YAEX,CAAC,CAAA;YAGD,MAAM,CAAC,kBAAkB,GAAG,UAAS,IAAI,EAAE,MAAM,GAAC,SAAS;gBAC1D,IAAG,IAAI,KAAK,KAAK,EAAE;oBAClB,MAAM,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAA;iBACzC;qBAAM,IAAG,IAAI,KAAK,UAAU,EAAE;oBAC9B,MAAM,CAAC,KAAK,CAAC,2BAA2B,EAAE,MAAM,CAAC,CAAA;iBACjD;qBAAM;oBACN,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAA;iBACjE;YACF,CAAC,CAAA;YAED;;;;eAIG;YACH,MAAM,CAAC,QAAQ,GAAG,UAAS,CAAC;gBAC3B,IAAI,OAAO,GAAG,EAAE,CAAC;gBACjB,IAAI,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBAC7B,IAAI,CAAC,IAAI;oBACR,OAAO;gBAER,IAAI,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;gBAC9B,MAAM,CAAC,MAAM,GAAG,UAAS,CAAC;oBACzB,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;oBAC1B,IAAI,MAAM,GAAG,SAAS,CAAC;oBACvB,IAAI;wBACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;qBAC7B;oBAAC,OAAM,CAAC,EAAE;wBACV,OAAO,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAA;qBAChD;oBAED,wFAAwF;oBAExF,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAA;gBAE7C,CAAC,CAAC;gBACH,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YACzB,CAAC,CAAA;QAGC,CAAC;KACJ;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingWorkflowSelect/reporting-workflow-select.component.ts b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingWorkflowSelect/reporting-workflow-select.component.ts new file mode 100644 index 000000000..15d06a56f --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingWorkflowSelect/reporting-workflow-select.component.ts @@ -0,0 +1,61 @@ +angular.module('reportingWorkflowSelect').component('reportingWorkflowSelect', { + templateUrl : "components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingWorkflowSelect/reporting-workflow-select.template.html", + controller : ['$scope', function ReportingWorkflowSelectController($scope) { + + + // on modal opened + $('#reporting-modal').on('shown.bs.modal', function () { + $scope.initialize(); + }); + + $scope.initialize = function() { + + document.getElementById("reporting-load-settings-button").addEventListener('change', function(e) { + $scope.readFile(e) + }, false); + + } + + + $scope.onWorkflowSelected = function(type, config=undefined) { + if(type === "new") { + $scope.$emit('reportingWorkflowSelected') + } else if(type === "existing") { + $scope.$emit('reportingWorkflowSelected', config) + } else { + throw new Error("Workflow type was neither 'new' nor 'existing'") + } + } + + /** + * helper function to read a file from disk + * @param {*} e | the event that triggered the function + * @returns + */ + $scope.readFile = function(e) { + let content = ""; + let file = e.target.files[0]; + if (!file) + return; + + let reader = new FileReader(); + reader.onload = function(e) { + content = e.target.result; + let config = undefined; + try { + config = JSON.parse(content); + } catch(e) { + console.error("Configuration is no valid JSON.") + } + + //TODO check if json has correct structure, can be done once config structure is defined + + $scope.onWorkflowSelected("existing", config) + + }; + reader.readAsText(file); + } + + + } +]}); \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingWorkflowSelect/reporting-workflow-select.module.js b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingWorkflowSelect/reporting-workflow-select.module.js index 282ef53d2..6f3722290 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingWorkflowSelect/reporting-workflow-select.module.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingWorkflowSelect/reporting-workflow-select.module.js @@ -1 +1,3 @@ -angular.module('reportingWorkflowSelect', []); \ No newline at end of file +"use strict"; +angular.module('reportingWorkflowSelect', []); +//# sourceMappingURL=reporting-workflow-select.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingWorkflowSelect/reporting-workflow-select.module.js.map b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingWorkflowSelect/reporting-workflow-select.module.js.map new file mode 100644 index 000000000..0e2f975bf --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingWorkflowSelect/reporting-workflow-select.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"reporting-workflow-select.module.js","sourceRoot":"","sources":["reporting-workflow-select.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,yBAAyB,EAAE,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingWorkflowSelect/reporting-workflow-select.module.ts b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingWorkflowSelect/reporting-workflow-select.module.ts new file mode 100644 index 000000000..282ef53d2 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/reportingModal/reportingWorkflowSelect/reporting-workflow-select.module.ts @@ -0,0 +1 @@ +angular.module('reportingWorkflowSelect', []); \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/spatialUnitNotificationModal/spatial-unit-notification-modal.component.js b/app/components/kommonitorUserInterface/kommonitorControls/spatialUnitNotificationModal/spatial-unit-notification-modal.component.js index de3abdecf..2dfadbc18 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/spatialUnitNotificationModal/spatial-unit-notification-modal.component.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/spatialUnitNotificationModal/spatial-unit-notification-modal.component.js @@ -1,60 +1,44 @@ +"use strict"; angular.module('spatialUnitNotificationModal').component('spatialUnitNotificationModal', { - templateUrl : "components/kommonitorUserInterface/kommonitorControls/spatialUnitNotificationModal/spatial-unit-notification-modal.template.html", - controller : ['kommonitorDataExchangeService', '$scope', '$rootScope', '$timeout', '__env', function spatialUnitNotificationModalController(kommonitorDataExchangeService, $scope, $rootScope, $timeout, __env) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - - $scope.isHideNotification = false; - - $scope.init = function(){ - document.getElementById("spatialUnitNotificationModalTitle").innerHTML = __env.spatialUnitNotificationTitle; - document.getElementById("spatialUnitNotificationModalMessage").innerHTML = __env.spatialUnitNotificationMessage; - - if(! (localStorage.getItem("hideKomMonitorSpatialUnitNotification") === "true")) { - - $scope.isHideNotification = false; - - - } - else{ - $scope.isHideNotification = true; - $("#changeHideSpatialUnitNotificationInput").prop('checked', true); - } - - $timeout(function(){ - $scope.$digest(); - }, 250); - }; - - $scope.init(); - - - - var onChangeHideSpatialUnitNotification = function(){ - if($scope.isHideNotification){ - localStorage.setItem("hideKomMonitorSpatialUnitNotification", "true"); - } - else{ - localStorage.setItem("hideKomMonitorSpatialUnitNotification", "false"); - } - }; - - $('#changeHideSpatialUnitNotificationInput').on('click', function(event) { - - if($scope.isHideNotification){ - $scope.isHideNotification = false; - } - else { - $scope.isHideNotification = true; - } - onChangeHideSpatialUnitNotification(); - event.stopPropagation(); - }); - - - - - - // $scope.init(); - } -]}); + templateUrl: "components/kommonitorUserInterface/kommonitorControls/spatialUnitNotificationModal/spatial-unit-notification-modal.template.html", + controller: ['kommonitorDataExchangeService', '$scope', '$rootScope', '$timeout', '__env', function spatialUnitNotificationModalController(kommonitorDataExchangeService, $scope, $rootScope, $timeout, __env) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + $scope.isHideNotification = false; + $scope.init = function () { + document.getElementById("spatialUnitNotificationModalTitle").innerHTML = __env.spatialUnitNotificationTitle; + document.getElementById("spatialUnitNotificationModalMessage").innerHTML = __env.spatialUnitNotificationMessage; + if (!(localStorage.getItem("hideKomMonitorSpatialUnitNotification") === "true")) { + $scope.isHideNotification = false; + } + else { + $scope.isHideNotification = true; + $("#changeHideSpatialUnitNotificationInput").prop('checked', true); + } + $timeout(function () { + $scope.$digest(); + }, 250); + }; + $scope.init(); + var onChangeHideSpatialUnitNotification = function () { + if ($scope.isHideNotification) { + localStorage.setItem("hideKomMonitorSpatialUnitNotification", "true"); + } + else { + localStorage.setItem("hideKomMonitorSpatialUnitNotification", "false"); + } + }; + $('#changeHideSpatialUnitNotificationInput').on('click', function (event) { + if ($scope.isHideNotification) { + $scope.isHideNotification = false; + } + else { + $scope.isHideNotification = true; + } + onChangeHideSpatialUnitNotification(); + event.stopPropagation(); + }); + // $scope.init(); + } + ] +}); +//# sourceMappingURL=spatial-unit-notification-modal.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/spatialUnitNotificationModal/spatial-unit-notification-modal.component.js.map b/app/components/kommonitorUserInterface/kommonitorControls/spatialUnitNotificationModal/spatial-unit-notification-modal.component.js.map new file mode 100644 index 000000000..571dece93 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/spatialUnitNotificationModal/spatial-unit-notification-modal.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"spatial-unit-notification-modal.component.js","sourceRoot":"","sources":["spatial-unit-notification-modal.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,8BAA8B,CAAC,CAAC,SAAS,CAAC,8BAA8B,EAAE;IACxF,WAAW,EAAG,kIAAkI;IAChJ,UAAU,EAAG,CAAC,+BAA+B,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,sCAAsC,CAAC,6BAA6B,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK;YAE7M,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAE3E,MAAM,CAAC,kBAAkB,GAAG,KAAK,CAAC;YAElC,MAAM,CAAC,IAAI,GAAG;gBACb,QAAQ,CAAC,cAAc,CAAC,mCAAmC,CAAC,CAAC,SAAS,GAAG,KAAK,CAAC,4BAA4B,CAAC;gBAC5G,QAAQ,CAAC,cAAc,CAAC,qCAAqC,CAAC,CAAC,SAAS,GAAG,KAAK,CAAC,8BAA8B,CAAC;gBAEhH,IAAG,CAAE,CAAC,YAAY,CAAC,OAAO,CAAC,uCAAuC,CAAC,KAAK,MAAM,CAAC,EAAE;oBAEhF,MAAM,CAAC,kBAAkB,GAAG,KAAK,CAAC;iBAGlC;qBACG;oBACH,MAAM,CAAC,kBAAkB,GAAG,IAAI,CAAC;oBACjC,CAAC,CAAC,yCAAyC,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;iBACnE;gBAED,QAAQ,CAAC;oBACR,MAAM,CAAC,OAAO,EAAE,CAAC;gBAClB,CAAC,EAAE,GAAG,CAAC,CAAC;YACT,CAAC,CAAC;YAEF,MAAM,CAAC,IAAI,EAAE,CAAC;YAId,IAAI,mCAAmC,GAAG;gBACzC,IAAG,MAAM,CAAC,kBAAkB,EAAC;oBAC5B,YAAY,CAAC,OAAO,CAAC,uCAAuC,EAAE,MAAM,CAAC,CAAC;iBACtE;qBACG;oBACH,YAAY,CAAC,OAAO,CAAC,uCAAuC,EAAE,OAAO,CAAC,CAAC;iBACvE;YACF,CAAC,CAAC;YAEF,CAAC,CAAC,yCAAyC,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,UAAS,KAAK;gBAEtE,IAAG,MAAM,CAAC,kBAAkB,EAAC;oBAC5B,MAAM,CAAC,kBAAkB,GAAG,KAAK,CAAC;iBAClC;qBACI;oBACJ,MAAM,CAAC,kBAAkB,GAAG,IAAI,CAAC;iBACjC;gBACD,mCAAmC,EAAE,CAAC;gBACtC,KAAK,CAAC,eAAe,EAAE,CAAC;YACvB,CAAC,CAAC,CAAC;YAMN,kBAAkB;QAClB,CAAC;KACD;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/spatialUnitNotificationModal/spatial-unit-notification-modal.component.ts b/app/components/kommonitorUserInterface/kommonitorControls/spatialUnitNotificationModal/spatial-unit-notification-modal.component.ts new file mode 100644 index 000000000..de3abdecf --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/spatialUnitNotificationModal/spatial-unit-notification-modal.component.ts @@ -0,0 +1,60 @@ +angular.module('spatialUnitNotificationModal').component('spatialUnitNotificationModal', { + templateUrl : "components/kommonitorUserInterface/kommonitorControls/spatialUnitNotificationModal/spatial-unit-notification-modal.template.html", + controller : ['kommonitorDataExchangeService', '$scope', '$rootScope', '$timeout', '__env', function spatialUnitNotificationModalController(kommonitorDataExchangeService, $scope, $rootScope, $timeout, __env) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + + $scope.isHideNotification = false; + + $scope.init = function(){ + document.getElementById("spatialUnitNotificationModalTitle").innerHTML = __env.spatialUnitNotificationTitle; + document.getElementById("spatialUnitNotificationModalMessage").innerHTML = __env.spatialUnitNotificationMessage; + + if(! (localStorage.getItem("hideKomMonitorSpatialUnitNotification") === "true")) { + + $scope.isHideNotification = false; + + + } + else{ + $scope.isHideNotification = true; + $("#changeHideSpatialUnitNotificationInput").prop('checked', true); + } + + $timeout(function(){ + $scope.$digest(); + }, 250); + }; + + $scope.init(); + + + + var onChangeHideSpatialUnitNotification = function(){ + if($scope.isHideNotification){ + localStorage.setItem("hideKomMonitorSpatialUnitNotification", "true"); + } + else{ + localStorage.setItem("hideKomMonitorSpatialUnitNotification", "false"); + } + }; + + $('#changeHideSpatialUnitNotificationInput').on('click', function(event) { + + if($scope.isHideNotification){ + $scope.isHideNotification = false; + } + else { + $scope.isHideNotification = true; + } + onChangeHideSpatialUnitNotification(); + event.stopPropagation(); + }); + + + + + + // $scope.init(); + } +]}); diff --git a/app/components/kommonitorUserInterface/kommonitorControls/spatialUnitNotificationModal/spatial-unit-notification-modal.module.js b/app/components/kommonitorUserInterface/kommonitorControls/spatialUnitNotificationModal/spatial-unit-notification-modal.module.js index bdb1fe214..bc97de1b0 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/spatialUnitNotificationModal/spatial-unit-notification-modal.module.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/spatialUnitNotificationModal/spatial-unit-notification-modal.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('spatialUnitNotificationModal', []); +//# sourceMappingURL=spatial-unit-notification-modal.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/spatialUnitNotificationModal/spatial-unit-notification-modal.module.js.map b/app/components/kommonitorUserInterface/kommonitorControls/spatialUnitNotificationModal/spatial-unit-notification-modal.module.js.map new file mode 100644 index 000000000..b7ae6536d --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/spatialUnitNotificationModal/spatial-unit-notification-modal.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"spatial-unit-notification-modal.module.js","sourceRoot":"","sources":["spatial-unit-notification-modal.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,8BAA8B,EAAE,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/spatialUnitNotificationModal/spatial-unit-notification-modal.module.ts b/app/components/kommonitorUserInterface/kommonitorControls/spatialUnitNotificationModal/spatial-unit-notification-modal.module.ts new file mode 100644 index 000000000..bdb1fe214 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/spatialUnitNotificationModal/spatial-unit-notification-modal.module.ts @@ -0,0 +1 @@ +angular.module('spatialUnitNotificationModal', []); diff --git a/app/components/kommonitorUserInterface/kommonitorControls/versionInfo/version-info.component.js b/app/components/kommonitorUserInterface/kommonitorControls/versionInfo/version-info.component.js index 693a4c96d..15eed0c58 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/versionInfo/version-info.component.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/versionInfo/version-info.component.js @@ -1,12 +1,13 @@ +"use strict"; angular.module('versionInfo').component('versionInfo', { - templateUrl : "components/kommonitorUserInterface/kommonitorControls/versionInfo/version-info.template.html", - controller : [ - 'kommonitorDataExchangeService', '$scope', '$rootScope', '__env', '$timeout', - function VersionInfoController(kommonitorDataExchangeService, $scope, $rootScope, __env, $timeout) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - - // initialize any adminLTE box widgets - $('.box').boxWidget(); - } -]}); + templateUrl: "components/kommonitorUserInterface/kommonitorControls/versionInfo/version-info.template.html", + controller: [ + 'kommonitorDataExchangeService', '$scope', '$rootScope', '__env', '$timeout', + function VersionInfoController(kommonitorDataExchangeService, $scope, $rootScope, __env, $timeout) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + // initialize any adminLTE box widgets + $('.box').boxWidget(); + } + ] +}); +//# sourceMappingURL=version-info.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/versionInfo/version-info.component.js.map b/app/components/kommonitorUserInterface/kommonitorControls/versionInfo/version-info.component.js.map new file mode 100644 index 000000000..2c22e2df7 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/versionInfo/version-info.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"version-info.component.js","sourceRoot":"","sources":["version-info.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,SAAS,CAAC,aAAa,EAAE;IACtD,WAAW,EAAG,8FAA8F;IAC5G,UAAU,EAAG;QACZ,+BAA+B,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU;QAC5E,SAAS,qBAAqB,CAAC,6BAA6B,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ;YAEjG,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAE3E,sCAAsC;YACtC,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,CAAC;QACvB,CAAC;KACD;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/versionInfo/version-info.component.ts b/app/components/kommonitorUserInterface/kommonitorControls/versionInfo/version-info.component.ts new file mode 100644 index 000000000..693a4c96d --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/versionInfo/version-info.component.ts @@ -0,0 +1,12 @@ +angular.module('versionInfo').component('versionInfo', { + templateUrl : "components/kommonitorUserInterface/kommonitorControls/versionInfo/version-info.template.html", + controller : [ + 'kommonitorDataExchangeService', '$scope', '$rootScope', '__env', '$timeout', + function VersionInfoController(kommonitorDataExchangeService, $scope, $rootScope, __env, $timeout) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + + // initialize any adminLTE box widgets + $('.box').boxWidget(); + } +]}); diff --git a/app/components/kommonitorUserInterface/kommonitorControls/versionInfo/version-info.module.js b/app/components/kommonitorUserInterface/kommonitorControls/versionInfo/version-info.module.js index 8903e23e8..0e1ffa5fc 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/versionInfo/version-info.module.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/versionInfo/version-info.module.js @@ -1 +1,3 @@ +"use strict"; angular.module('versionInfo', []); +//# sourceMappingURL=version-info.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/versionInfo/version-info.module.js.map b/app/components/kommonitorUserInterface/kommonitorControls/versionInfo/version-info.module.js.map new file mode 100644 index 000000000..b1710da42 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/versionInfo/version-info.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"version-info.module.js","sourceRoot":"","sources":["version-info.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/versionInfo/version-info.module.ts b/app/components/kommonitorUserInterface/kommonitorControls/versionInfo/version-info.module.ts new file mode 100644 index 000000000..8903e23e8 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/versionInfo/version-info.module.ts @@ -0,0 +1 @@ +angular.module('versionInfo', []); diff --git a/app/components/kommonitorUserInterface/kommonitorMap/kommonitor-map.component.js b/app/components/kommonitorUserInterface/kommonitorMap/kommonitor-map.component.js index 518355fc5..62414b88b 100644 --- a/app/components/kommonitorUserInterface/kommonitorMap/kommonitor-map.component.js +++ b/app/components/kommonitorUserInterface/kommonitorMap/kommonitor-map.component.js @@ -1,3484 +1,2844 @@ -angular.module('kommonitorMap').component( - 'kommonitorMap', - { +"use strict"; +angular.module('kommonitorMap').component('kommonitorMap', { templateUrl: "components/kommonitorUserInterface/kommonitorMap/kommonitor-map.template.html", controller: [ - '$rootScope', - '$http', - '$scope', - '$timeout', - 'kommonitorMapService', - 'kommonitorDataExchangeService', - 'kommonitorVisualStyleHelperService', - 'kommonitorInfoLegendHelperService', - 'kommonitorFilterHelperService', - '__env', - function MapController($rootScope, $http, $scope, $timeout, kommonitorMapService, kommonitorDataExchangeService, kommonitorVisualStyleHelperService, - kommonitorInfoLegendHelperService, kommonitorFilterHelperService, __env) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - - const INDICATOR_DATE_PREFIX = __env.indicatorDatePrefix; - const numberOfDecimals = __env.numberOfDecimals; - var defaultColorForFilteredValues = __env.defaultColorForFilteredValues; - var defaultBorderColorForFilteredValues = __env.defaultBorderColorForFilteredValues; - var defaultBorderColor = __env.defaultBorderColor; - var defaultFillOpacity = __env.defaultFillOpacity; - var defaultFillOpacityForFilteredFeatures = __env.defaultFillOpacityForFilteredFeatures; - var defaultFillOpacityForHighlightedFeatures = __env.defaultFillOpacityForHighlightedFeatures; - var defaultFillOpacityForZeroFeatures = __env.defaultFillOpacityForZeroFeatures; - var defaultColorBrewerPaletteForBalanceIncreasingValues = __env.defaultColorBrewerPaletteForBalanceIncreasingValues; - var defaultColorBrewerPaletteForBalanceDecreasingValues = __env.defaultColorBrewerPaletteForBalanceDecreasingValues; - var defaultColorBrewerPaletteForGtMovValues = __env.defaultColorBrewerPaletteForGtMovValues; - var defaultColorBrewerPaletteForLtMovValues = __env.defaultColorBrewerPaletteForLtMovValues; - var defaultColorForHoveredFeatures = __env.defaultColorForHoveredFeatures; - var defaultColorForClickedFeatures = __env.defaultColorForClickedFeatures; - var defaultBorderColorForNoDataValues = __env.defaultBorderColorForNoDataValues; - var defaultColorForNoDataValues = __env.defaultColorForNoDataValues; - var defaultFillOpacityForNoDataValues = __env.defaultFillOpacityForNoDataValues; - - - var defaultColorForOutliers_high = __env.defaultColorForOutliers_high; - var defaultBorderColorForOutliers_high = __env.defaultBorderColorForOutliers_high; - var defaultFillOpacityForOutliers_high = __env.defaultFillOpacityForOutliers_high; - var defaultColorForOutliers_low = __env.defaultColorForOutliers_low; - var defaultBorderColorForOutliers_low = __env.defaultBorderColorForOutliers_low; - var defaultFillOpacityForOutliers_low = __env.defaultFillOpacityForOutliers_low; - var useOutlierDetectionOnIndicator = __env.useOutlierDetectionOnIndicator; - - const outlierPropertyName = "outlier"; - const outlierPropertyValue_high_soft = "high-soft"; - const outlierPropertyValue_low_soft = "low-soft"; - const outlierPropertyValue_high_extreme = "high-extreme"; - const outlierPropertyValue_low_extreme = "low-extreme"; - const outlierPropertyValue_no = "no"; - - $scope.containsOutliers_high = false; - $scope.containsOutliers_low = false; - $scope.outliers_high = undefined; - $scope.outliers_low = undefined; - kommonitorDataExchangeService.useOutlierDetectionOnIndicator = useOutlierDetectionOnIndicator; - - $scope.svgString_outlierLow = 'Sorry, your browser does not support inline SVG.'; - $scope.svgString_outlierHigh = 'Sorry, your browser does not support inline SVG.'; - - $scope.showOutlierInfoAlert = false; - - - - $scope.drawnPointFeatures = undefined; - $scope.drawPointControl = undefined; - - $scope.featuresWithValues = []; - $scope.featuresWithoutValues = []; - - - const MultipleResultsLeafletSearch = L.Control.Search.extend({ - - _makeUniqueKey: function (featureName, featureId) { - return featureName + " (Name) - " + featureId + " (ID)"; - }, - - _searchInLayer: function (layer, retRecords, propName) { - var self = this, loc; - var key_withUniqueID; - - if (layer instanceof L.Control.Search.Marker) return; - - if (layer instanceof L.Marker || layer instanceof L.CircleMarker) { - if (self._getPath(layer.options, propName)) { - loc = layer.getLatLng(); - loc.layer = layer; - retRecords[self._getPath(layer.options, propName)] = loc; - } - else if (self._getPath(layer.feature.properties, propName)) { - loc = layer.getLatLng(); - loc.layer = layer; - key_withUniqueID = this._makeUniqueKey(self._getPath(layer.feature.properties, propName), layer.feature.properties.ID); - retRecords[key_withUniqueID] = loc; - } - else { - //throw new Error("propertyName '"+propName+"' not found in marker"); - console.warn("propertyName '" + propName + "' not found in marker"); - } - } - else if (layer instanceof L.Path || layer instanceof L.Polyline || layer instanceof L.Polygon) { - if (self._getPath(layer.options, propName)) { - loc = layer.getBounds().getCenter(); - loc.layer = layer; - retRecords[self._getPath(layer.options, propName)] = loc; - } - else if (self._getPath(layer.feature.properties, propName)) { - loc = layer.getBounds().getCenter(); - loc.layer = layer; - key_withUniqueID = this._makeUniqueKey(self._getPath(layer.feature.properties, propName), layer.feature.properties.ID); - retRecords[key_withUniqueID] = loc; - } - else { - //throw new Error("propertyName '"+propName+"' not found in shape"); - console.warn("propertyName '" + propName + "' not found in shape"); - } - } - else if (layer.hasOwnProperty('feature'))//GeoJSON - { - if (layer.feature.properties.hasOwnProperty(propName)) { - - key_withUniqueID = this._makeUniqueKey(self._getPath(layer.feature.properties, propName), layer.feature.properties.ID); - if (layer.getLatLng && typeof layer.getLatLng === 'function') { - loc = layer.getLatLng(); - loc.layer = layer; - retRecords[key_withUniqueID] = loc; - } else if (layer.getBounds && typeof layer.getBounds === 'function') { - loc = layer.getBounds().getCenter(); - loc.layer = layer; - retRecords[key_withUniqueID] = loc; - } else { - console.warn("Unknown type of Layer"); - } - } - else { - //throw new Error("propertyName '"+propName+"' not found in feature"); - console.warn("propertyName '" + propName + "' not found in feature"); - } - } - else if (layer instanceof L.LayerGroup) { - layer.eachLayer(function (layer) { - self._searchInLayer(layer, retRecords, propName); - }); - } - }, - _defaultMoveToLocation: function (latlng, title, map) { - if (this.options.zoom) - this._map.setView(latlng, this.options.zoom); - else - this._map.panTo(latlng); - - // add collapse after click on item - this.collapse(); - }, - _handleAutoresize: function () { - var maxWidth; - - if (!this._map) { - this._map = $scope.map; - } - - if (this._input.style.maxWidth !== this._map._container.offsetWidth) { - maxWidth = this._map._container.clientWidth; - - // other side margin + padding + width border + width search-button + width search-cancel - maxWidth -= 10 + 20 + 1 + 30 + 22; - - this._input.style.maxWidth = maxWidth.toString() + 'px'; - } - - if (this.options.autoResize && (this._container.offsetWidth + 20 < this._map._container.offsetWidth)) { - this._input.size = this._input.value.length < this._inputMinSize ? this._inputMinSize : this._input.value.length; - } - } - }); - - $scope.onCloseOutlierAlert = function () { - // $("#outlierInfo").hide(); - $scope.showOutlierInfoAlert = false; - }; - - - var refreshNoDataStyle = function () { - - $scope.currentIndicatorContainsNoDataValues = false; - $scope.svgString_noData = '' + - '' + - '' + - '' + - '' + - 'Sorry, your browser does not support inline SVG.'; - - $scope.noDataStyle = kommonitorVisualStyleHelperService.noDataStyle; - }; - - var refreshOutliersStyle = function () { - - $scope.containsOutliers_high = false; - $scope.containsOutliers_low = false; - $scope.outlierMinValue = undefined; - $scope.outlierMaxValue = undefined; - $scope.showOutlierInfoAlert = false; - - $scope.svgString_outlierLow = 'Sorry, your browser does not support inline SVG.'; - $scope.svgString_outlierHigh = 'Sorry, your browser does not support inline SVG.'; - - // if ($scope.useTransparencyOnIndicator) { - // fillOpacity_high = defaultFillOpacityForOutliers_high; - // fillOpacity_low = defaultFillOpacityForOutliers_low; - // } - - $scope.outlierStyle_high = kommonitorVisualStyleHelperService.outlierStyle_high; - - $scope.outlierStyle_low = kommonitorVisualStyleHelperService.outlierStyle_low; - }; - - $scope.useTransparencyOnIndicator = __env.useTransparencyOnIndicator; - - $scope.filteredStyle = kommonitorVisualStyleHelperService.filteredStyle; - - var refreshFilteredStyle = function () { - - $scope.filteredStyle = kommonitorVisualStyleHelperService.filteredStyle; - }; - - this.kommonitorMapServiceInstance = kommonitorMapService; - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - $scope.inputLayerCounter = 0; - - $scope.latCenter = __env.initialLatitude; - $scope.lonCenter = __env.initialLongitude; - $scope.zoomLevel = __env.initialZoomLevel; - - $scope.loadingData = true; - - $scope.drawnItems = new L.FeatureGroup(); - $scope.drawControl = undefined; - - $scope.allDrawingToolsEnabled = false; - $scope.date = undefined; - - // central map object - $scope.map = undefined; - $scope.scaleBar = undefined; - $scope.layerControl = undefined; - $scope.showInfoControl = true; - $scope.showLegendControl = true; - $scope.showLegend = true; - $scope.overlays = new Array(); - $scope.baseMaps = new Array(); - const spatialUnitLayerGroupName = "Raumeinheiten"; - const georesourceLayerGroupName = "Georessourcen"; - const poiLayerGroupName = "Points of Interest"; - const loiLayerGroupName = "Lines of Interest"; - const aoiLayerGroupName = "Areas of Interest"; - const indicatorLayerGroupName = "Indikatoren"; - const reachabilityLayerGroupName = "Erreichbarkeiten"; - const wmsLayerGroupName = "Web Map Services (WMS)"; - const wfsLayerGroupName = "Web Feature Services (WFS)"; - const fileLayerGroupName = "Dateilayer"; - - // create classyBrew object - $scope.defaultBrew = new classyBrew(); - $scope.gtMeasureOfValueBrew = new classyBrew(); - $scope.ltMeasureOfValueBrew = new classyBrew(); - - $scope.currentIndicatorMetadataAndGeoJSON; - $scope.currentGeoJSONOfCurrentLayer; - $scope.currentIndicatorContainsZeroValues = false; - $scope.currentIndicatorContainsNoDataValues = false; - $scope.indicatorTypeOfCurrentLayer; - $scope.defaultColorForZeroValues = __env.defaultColorForZeroValues; - - $scope.customIndicatorPropertyName; - $scope.customIndicatorName; - $scope.customIndicatorUnit; - - $scope.currentCustomIndicatorLayerOfCurrentLayer; - $scope.customPropertyName; - - $scope.currentCustomIndicatorLayer; - $scope.isochronesLayer = undefined; - $scope.isochroneMarkerLayer = undefined; - - /* - * L.TileLayer.Grayscale is a regular tilelayer with grayscale makeover. - */ - - L.TileLayer.Grayscale = L.TileLayer.extend({ - options: { - quotaRed: 21, - quotaGreen: 71, - quotaBlue: 8, - quotaDividerTune: 0, - quotaDivider: function () { - return this.quotaRed + this.quotaGreen + this.quotaBlue + this.quotaDividerTune; - } - }, - - initialize: function (url, options) { - options = options || {}; - options.crossOrigin = true; - L.TileLayer.prototype.initialize.call(this, url, options); - - this.on('tileload', function (e) { - this._makeGrayscale(e.tile); - }); - }, - - _createTile: function () { - var tile = L.TileLayer.prototype._createTile.call(this); - tile.crossOrigin = "Anonymous"; - return tile; - }, - - _makeGrayscale: function (img) { - if (img.getAttribute('data-grayscaled')) - return; - - img.crossOrigin = ''; - var canvas = document.createElement("canvas"); - canvas.width = img.width; - canvas.height = img.height; - var ctx = canvas.getContext("2d"); - ctx.drawImage(img, 0, 0); - - var imgd = ctx.getImageData(0, 0, canvas.width, canvas.height); - var pix = imgd.data; - for (var i = 0, n = pix.length; i < n; i += 4) { - pix[i] = pix[i + 1] = pix[i + 2] = (this.options.quotaRed * pix[i] + this.options.quotaGreen * pix[i + 1] + this.options.quotaBlue * pix[i + 2]) / this.options.quotaDivider(); - } - ctx.putImageData(imgd, 0, 0); - img.setAttribute('data-grayscaled', true); - img.src = canvas.toDataURL(); - } - }); - - L.tileLayer.grayscale = function (url, options) { - return new L.TileLayer.Grayscale(url, options); - }; - - this.initializeMap = function () { - - $scope.loadingData = true; - - // initialize map referring to div element with id="map" - - var baseLayerDefinitionsMap = new Map(); - - for (const baseMapEntry of __env.baseLayers) { - - if (baseMapEntry.layerType === "TILE_LAYER_GRAYSCALE"){ - var grayscaleLayer = new L.tileLayer.grayscale(baseMapEntry.url, { minZoom: baseMapEntry.minZoomLevel, maxZoom: baseMapEntry.maxZoomLevel, attribution: baseMapEntry.attribution_html }); - baseLayerDefinitionsMap.set(baseMapEntry.name, grayscaleLayer); - } - else if (baseMapEntry.layerType === "TILE_LAYER"){ - var tileLayer = new L.tileLayer(baseMapEntry.url, { minZoom: baseMapEntry.minZoomLevel, maxZoom: baseMapEntry.maxZoomLevel, attribution: baseMapEntry.attribution_html }); - baseLayerDefinitionsMap.set(baseMapEntry.name, tileLayer); - } - else if (baseMapEntry.layerType === "WMS"){ - var wmsLayer = new L.tileLayer.wms(baseMapEntry.url, { minZoom: baseMapEntry.minZoomLevel, maxZoom: baseMapEntry.maxZoomLevel, attribution: baseMapEntry.attribution_html, layers: baseMapEntry.layerName_WMS, format: 'image/png' }); - baseLayerDefinitionsMap.set(baseMapEntry.name, wmsLayer); - } - } - - $scope.map = L.map('map', { - center: [$scope.latCenter, $scope.lonCenter], - zoom: $scope.zoomLevel, - zoomDelta: 0.5, - zoomSnap: 0.5, - layers: [baseLayerDefinitionsMap.get(__env.baseLayers[0].name)] - }); - - // execute update search control on layer add and remove - $scope.map.on('overlayadd', function (eo) { - $scope.updateSearchControl(); - }); - $scope.map.on('overlayremove', function (eo) { - $scope.updateSearchControl(); - }); - - // update zoom and extent - $scope.map.on('zoomend', function (eo) { - let latLng = $scope.map.getCenter(); - __env.currentLatitude = latLng.lat; - __env.currentLongitude = latLng.lng; - __env.currentZoomLevel = $scope.map.getZoom(); - }); - $scope.map.on('moveend', function (eo) { - let latLng = $scope.map.getCenter(); - __env.currentLatitude = latLng.lat; - __env.currentLongitude = latLng.lng; - __env.currentZoomLevel = $scope.map.getZoom(); - }); - - $scope.baseMaps = { - }; - - baseLayerDefinitionsMap.forEach(function(value, key, map){ - $scope.baseMaps[key] = value; - }); - - $scope.groupedOverlays = { - indicatorLayerGroupName: { - - }, - poiLayerGroupName: { - - }, - loiLayerGroupName: { - - }, - aoiLayerGroupName: { - - }, - wmsLayerGroupName: { - - }, - wfsLayerGroupName: { - - }, - fileLayerGroupName: { - - }, - reachabilityLayerGroupName: { - - } - }; - - $scope.layerControl = L.control.groupedLayers($scope.baseMaps, $scope.groupedOverlays, { position: 'topleft' }); - $scope.map.addControl($scope.layerControl); - - // Disable dragging when user's cursor enters the element - $scope.layerControl.getContainer().addEventListener('mouseover', function () { - $scope.map.dragging.disable(); - $scope.map.touchZoom.disable(); - $scope.map.doubleClickZoom.disable(); - $scope.map.scrollWheelZoom.disable(); - }); - - // Re-enable dragging when user's cursor leaves the element - $scope.layerControl.getContainer().addEventListener('mouseout', function () { - $scope.map.dragging.enable(); - $scope.map.touchZoom.enable(); - $scope.map.doubleClickZoom.enable(); - $scope.map.scrollWheelZoom.enable(); - }); - - $scope.scaleBar = L.control.scale(); - $scope.scaleBar.addTo($scope.map); - - - - // hatch patterns - // var diagonalPattern = new L.PatternPath({ d: "M-1,1 l2,-2 M0,4 l4,-4 M3,5 l2,-2" , fill: true }); - - // $scope.outlierFillPattern_high = new L.Pattern(); - // $scope.outlierFillPattern_high.addShape(diagonalPattern); - // $scope.outlierFillPattern_high.addTo($scope.map); - - $scope.outlierFillPattern_low = kommonitorVisualStyleHelperService.outlierFillPattern_low; - $scope.outlierFillPattern_low.addTo($scope.map); - - $scope.outlierFillPattern_high = kommonitorVisualStyleHelperService.outlierFillPattern_high; - $scope.outlierFillPattern_high.addTo($scope.map); - - $scope.noDataFillPattern = kommonitorVisualStyleHelperService.noDataFillPattern; - $scope.noDataFillPattern.addTo($scope.map); - - // $scope.loadingData = false; - - ///////////////////////////////////////////////////// - ///// LEAFLET GEOSEARCH SETUP - ///////////////////////////////////////////////////// - var GeoSearchControl = window.GeoSearch.GeoSearchControl; - var OpenStreetMapProvider = window.GeoSearch.OpenStreetMapProvider; - - // remaining is the same as in the docs, accept for the var instead of const declarations - var provider = new OpenStreetMapProvider( - { - params: { - 'accept-language': 'de', // render results in Dutch - countrycodes: 'de', // limit search results to the Netherlands - addressdetails: 1, // include additional address detail parts - viewbox: "" + (Number(__env.initialLongitude) - 0.001) + "," + (Number(__env.initialLatitude) - 0.001) + "," + (Number(__env.initialLongitude) + 0.001) + "," + (Number(__env.initialLatitude) + 0.001) - }, - searchUrl: __env.targetUrlToGeocoderService + '/search', - reverseUrl: __env.targetUrlToGeocoderService + '/reverse' - } - ); - - $scope.geosearchControl = new GeoSearchControl({ - position: "topleft", - provider: provider, - style: 'button', - autoComplete: true, - autoCompleteDelay: 250, - showMarker: true, // optional: true|false - default true - showPopup: false, // optional: true|false - default false - marker: { // optional: L.Marker - default L.Icon.Default - icon: new L.Icon.Default(), - draggable: false, - }, - popupFormat: ({ query, result }) => result.label, // optional: function - default returns result label - maxMarkers: 1, // optional: number - default 1 - retainZoomLevel: false, // optional: true|false - default false - animateZoom: true, // optional: true|false - default true - autoClose: false, // optional: true|false - default false - searchLabel: 'Suche nach Adressen ...', // optional: string - default 'Enter address' - keepResult: false // optional: true|false - default false - }); - - $scope.map.addControl($scope.geosearchControl); - - - ///////////////////////////////////////////////////// - ///// LEAFLET SEARCH SETUP - ///////////////////////////////////////////////////// - // will be updated once example indicator layer is loaded - $scope.searchControl = new MultipleResultsLeafletSearch({ - }); - $scope.searchControl.addTo($scope.map); - - - ///////////////////////////////////////////////////// - ///// LEAFLET MEASURE SETUP - ///////////////////////////////////////////////////// - var measureOptions = { - position: 'topleft', - primaryLengthUnit: 'meters', - secondaryLengthUnit: 'kilometers', - primaryAreaUnit: 'sqmeters', - activeColor: "#d15c54", - completedColor: "#d15c54", - decPoint: ',', - thousandsSep: '.' - }; - - $scope.measureControl = new L.Control.Measure(measureOptions); - $scope.measureControl.addTo($scope.map); - - ///////////////////////////////////////////////////// - ///// LEAFLET SCREENSHOTER SETUP - ///////////////////////////////////////////////////// - - // from the docs, most of it is probably not needed - let screenshotterOptions = { - cropImageByInnerWH: true, // crop blank opacity from image borders - hidden: true, // hide screen icon - preventDownload: false, // prevent download on button click - domtoimageOptions: {}, // see options for dom-to-image - position: 'topleft', // position of take screen icon - screenName: 'screen', // string or function - hideElementsWithSelectors: ['.leaflet-control-container'], // by default hide map controls All els must be child of _map._container - mimeType: 'image/png', // used if format == image, - caption: null, // string or function, added caption to bottom of screen - captionFontSize: 15, - captionFont: 'Arial', - captionColor: 'black', - captionBgColor: 'white', - captionOffset: 5, - // callback for manually edit map if have warn: "May be map size very big on that zoom level, we have error" - // and screenshot not created - onPixelDataFail: async function({ node, plugin, error, mapPane, domtoimageOptions }) { - // Solutions: - // decrease size of map - // or decrease zoom level - // or remove elements with big distanses - // and after that return image in Promise - plugin._getPixelDataOfNormalMap - return plugin._getPixelDataOfNormalMap(domtoimageOptions) - } - } - - $scope.simpleMapScreenshoter = L.simpleMapScreenshoter(screenshotterOptions).addTo($scope.map); - $scope.map.simpleMapScreenshoter = $scope.simpleMapScreenshoter; - - }; // end initialize map - - - $scope.$on("exportMap", function (event) { - - // wait for print process to finish - let format = 'blob'; // 'image' - return base64, 'canvas' - return canvas - let overridedPluginOptions = { - mimeType: 'image/png' - }; - $scope.simpleMapScreenshoter.takeScreen(format, overridedPluginOptions); - $scope.simpleMapScreenshoter.takeScreen(format, overridedPluginOptions).then(blob => { - // FileSaver saveAs method - saveAs(blob, 'KomMonitor-Screenshot.png'); - }).catch(error => { - console.log("Error while exporting map view."); - console.error(error); - - kommonitorDataExchangeService.displayMapApplicationError(error); - }); - - }); - - function isKomMonitorSpecificProperty(propertyKey){ - let isKomMonitorSpecificProperty = false; - - if(propertyKey == "outlier"){ - isKomMonitorSpecificProperty = true; - } - else if(propertyKey == __env.VALID_START_DATE_PROPERTY_NAME){ - isKomMonitorSpecificProperty = true; - } - else if(propertyKey == __env.VALID_END_DATE_PROPERTY_NAME){ - isKomMonitorSpecificProperty = true; - } - else if(propertyKey == "bbox"){ - isKomMonitorSpecificProperty = true; - } - else if(propertyKey.includes(__env.indicatorDatePrefix)){ - isKomMonitorSpecificProperty = true; - } - - return isKomMonitorSpecificProperty; - } - - $scope.updateSearchControl = function () { - - setTimeout(function () { - if ($scope.searchControl) { - try { - $scope.map.removeControl($scope.searchControl); - $scope.searchControl = undefined; - } - catch (error) { - kommonitorDataExchangeService.displayMapApplicationError(error); - } - } - - // build L.layerGroup of available POI layers - var featureLayers = []; - - for (var layerEntry of $scope.layerControl._layers) { - if (layerEntry) { - if (layerEntry.overlay) { - if ($scope.map.hasLayer(layerEntry.layer)) { - if (layerEntry.group.name === poiLayerGroupName || layerEntry.group.name === loiLayerGroupName || layerEntry.group.name === aoiLayerGroupName || layerEntry.group.name === indicatorLayerGroupName || layerEntry.group.name === wfsLayerGroupName || layerEntry.group.name === fileLayerGroupName) { - featureLayers.push(layerEntry.layer); - } - } - - } - } - } - - var layerGroup; - // if no relevant layers are currently displayed, then - if (featureLayers.length === 0) { - $scope.searchControl = new MultipleResultsLeafletSearch({ - }); - $scope.searchControl.addTo($scope.map); - } - else { - layerGroup = L.featureGroup(featureLayers); - - $scope.searchControl = new MultipleResultsLeafletSearch({ - position: "topleft", - layer: layerGroup, - initial: false, - propertyName: __env.FEATURE_NAME_PROPERTY_NAME, - textPlaceholder: "Layer-Objekte nach Name und/oder ID filtern", - textCancel: "Abbrechen", - textErr: "Position nicht gefunden", - hideMarkerOnCollapse: true, - zoom: 15, - autoResize: true, - autoCollapse: false, - autoType: true, - formatData: function (json) { //adds coordinates to name. - var propName = this.options.propertyName, - propLoc = this.options.propertyLoc, - i, jsonret = {}; - if (L.Util.isArray(propLoc)) - for (i in json) { - if (!this._getPath(json[i], propName)) continue; - jsonret[this._getPath(json[i], propName) + " (" + json[i][propLoc[0]] + "," + json[i][propLoc[1]] + ")"] = L.latLng(json[i][propLoc[0]], json[i][propLoc[1]]); - } - else - for (i in json) { - if (!this._getPath(json[i], propName)) continue; - jsonret[this._getPath(json[i], propName) + " (" + json[i][propLoc][0] + "," + json[i][propLoc][1] + ")"] = L.latLng(this._getPath(json[i], propLoc)); - } - return jsonret; + '$rootScope', + '$http', + '$scope', + '$timeout', + 'kommonitorMapService', + 'kommonitorDataExchangeService', + 'kommonitorVisualStyleHelperService', + 'kommonitorInfoLegendHelperService', + 'kommonitorFilterHelperService', + '__env', + function MapController($rootScope, $http, $scope, $timeout, kommonitorMapService, kommonitorDataExchangeService, kommonitorVisualStyleHelperService, kommonitorInfoLegendHelperService, kommonitorFilterHelperService, __env) { + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + const INDICATOR_DATE_PREFIX = __env.indicatorDatePrefix; + const numberOfDecimals = __env.numberOfDecimals; + var defaultColorForFilteredValues = __env.defaultColorForFilteredValues; + var defaultBorderColorForFilteredValues = __env.defaultBorderColorForFilteredValues; + var defaultBorderColor = __env.defaultBorderColor; + var defaultFillOpacity = __env.defaultFillOpacity; + var defaultFillOpacityForFilteredFeatures = __env.defaultFillOpacityForFilteredFeatures; + var defaultFillOpacityForHighlightedFeatures = __env.defaultFillOpacityForHighlightedFeatures; + var defaultFillOpacityForZeroFeatures = __env.defaultFillOpacityForZeroFeatures; + var defaultColorBrewerPaletteForBalanceIncreasingValues = __env.defaultColorBrewerPaletteForBalanceIncreasingValues; + var defaultColorBrewerPaletteForBalanceDecreasingValues = __env.defaultColorBrewerPaletteForBalanceDecreasingValues; + var defaultColorBrewerPaletteForGtMovValues = __env.defaultColorBrewerPaletteForGtMovValues; + var defaultColorBrewerPaletteForLtMovValues = __env.defaultColorBrewerPaletteForLtMovValues; + var defaultColorForHoveredFeatures = __env.defaultColorForHoveredFeatures; + var defaultColorForClickedFeatures = __env.defaultColorForClickedFeatures; + var defaultBorderColorForNoDataValues = __env.defaultBorderColorForNoDataValues; + var defaultColorForNoDataValues = __env.defaultColorForNoDataValues; + var defaultFillOpacityForNoDataValues = __env.defaultFillOpacityForNoDataValues; + var defaultColorForOutliers_high = __env.defaultColorForOutliers_high; + var defaultBorderColorForOutliers_high = __env.defaultBorderColorForOutliers_high; + var defaultFillOpacityForOutliers_high = __env.defaultFillOpacityForOutliers_high; + var defaultColorForOutliers_low = __env.defaultColorForOutliers_low; + var defaultBorderColorForOutliers_low = __env.defaultBorderColorForOutliers_low; + var defaultFillOpacityForOutliers_low = __env.defaultFillOpacityForOutliers_low; + var useOutlierDetectionOnIndicator = __env.useOutlierDetectionOnIndicator; + const outlierPropertyName = "outlier"; + const outlierPropertyValue_high_soft = "high-soft"; + const outlierPropertyValue_low_soft = "low-soft"; + const outlierPropertyValue_high_extreme = "high-extreme"; + const outlierPropertyValue_low_extreme = "low-extreme"; + const outlierPropertyValue_no = "no"; + $scope.containsOutliers_high = false; + $scope.containsOutliers_low = false; + $scope.outliers_high = undefined; + $scope.outliers_low = undefined; + kommonitorDataExchangeService.useOutlierDetectionOnIndicator = useOutlierDetectionOnIndicator; + $scope.svgString_outlierLow = 'Sorry, your browser does not support inline SVG.'; + $scope.svgString_outlierHigh = 'Sorry, your browser does not support inline SVG.'; + $scope.showOutlierInfoAlert = false; + $scope.drawnPointFeatures = undefined; + $scope.drawPointControl = undefined; + $scope.featuresWithValues = []; + $scope.featuresWithoutValues = []; + const MultipleResultsLeafletSearch = L.Control.Search.extend({ + _makeUniqueKey: function (featureName, featureId) { + return featureName + " (Name) - " + featureId + " (ID)"; }, - filterData: function (text, records) { - var I, icase, regSearch, frecords = {}; - - text = text.replace(/[.*+?^${}()|[\]\\]/g, ''); //sanitize remove all special characters - if (text === '') - return []; - - I = this.options.initial ? '^' : ''; //search only initial text - icase = !this.options.casesensitive ? 'i' : undefined; - - regSearch = new RegExp(I + text, icase); - - for (var key in records) { - - // make a searchable string from all relevant feature properties - let recordString = ""; - let record = records[key]; - let recordProperties = record.layer.feature.properties; - - for (const propertyKey in recordProperties) { - if(recordProperties[propertyKey] && !isKomMonitorSpecificProperty(propertyKey)){ - recordString += recordProperties[propertyKey]; - } - } - - if (regSearch.test(recordString)) - frecords[key] = records[key]; - } - - return frecords; + _searchInLayer: function (layer, retRecords, propName) { + var self = this, loc; + var key_withUniqueID; + if (layer instanceof L.Control.Search.Marker) + return; + if (layer instanceof L.Marker || layer instanceof L.CircleMarker) { + if (self._getPath(layer.options, propName)) { + loc = layer.getLatLng(); + loc.layer = layer; + retRecords[self._getPath(layer.options, propName)] = loc; + } + else if (self._getPath(layer.feature.properties, propName)) { + loc = layer.getLatLng(); + loc.layer = layer; + key_withUniqueID = this._makeUniqueKey(self._getPath(layer.feature.properties, propName), layer.feature.properties.ID); + retRecords[key_withUniqueID] = loc; + } + else { + //throw new Error("propertyName '"+propName+"' not found in marker"); + console.warn("propertyName '" + propName + "' not found in marker"); + } + } + else if (layer instanceof L.Path || layer instanceof L.Polyline || layer instanceof L.Polygon) { + if (self._getPath(layer.options, propName)) { + loc = layer.getBounds().getCenter(); + loc.layer = layer; + retRecords[self._getPath(layer.options, propName)] = loc; + } + else if (self._getPath(layer.feature.properties, propName)) { + loc = layer.getBounds().getCenter(); + loc.layer = layer; + key_withUniqueID = this._makeUniqueKey(self._getPath(layer.feature.properties, propName), layer.feature.properties.ID); + retRecords[key_withUniqueID] = loc; + } + else { + //throw new Error("propertyName '"+propName+"' not found in shape"); + console.warn("propertyName '" + propName + "' not found in shape"); + } + } + else if (layer.hasOwnProperty('feature')) //GeoJSON + { + if (layer.feature.properties.hasOwnProperty(propName)) { + key_withUniqueID = this._makeUniqueKey(self._getPath(layer.feature.properties, propName), layer.feature.properties.ID); + if (layer.getLatLng && typeof layer.getLatLng === 'function') { + loc = layer.getLatLng(); + loc.layer = layer; + retRecords[key_withUniqueID] = loc; + } + else if (layer.getBounds && typeof layer.getBounds === 'function') { + loc = layer.getBounds().getCenter(); + loc.layer = layer; + retRecords[key_withUniqueID] = loc; + } + else { + console.warn("Unknown type of Layer"); + } + } + else { + //throw new Error("propertyName '"+propName+"' not found in feature"); + console.warn("propertyName '" + propName + "' not found in feature"); + } + } + else if (layer instanceof L.LayerGroup) { + layer.eachLayer(function (layer) { + self._searchInLayer(layer, retRecords, propName); + }); + } }, - buildTip: function (text, val) { - var emString = ""; - - if (val.layer.metadataObject) { - if (val.layer.metadataObject.isPOI) { - emString += ''; - emString += ""; - emString += ''; - } - } - else { - emString += ""; - } - return '' + emString + '  ' + text + ''; - } - }); - - $scope.searchControl.addTo($scope.map); - } - }, 200); - }; - - $scope.$on("showLoadingIconOnMap", function (event) { - // console.log("Show loading icon on map"); - $scope.loadingData = true; - }); - - $scope.$on("hideLoadingIconOnMap", function (event) { - // console.log("Hide loading icon on map"); - $timeout(function(){ - $scope.loadingData = false; - }, 250); - - }); - - $(document).on('click', '#selectSpatialUnitViaInfoControl li p', function () { - var spatialUnitName = $(this).text(); - $('#selectSpatialUnitViaInfoControl_text').text(spatialUnitName); - - $rootScope.$broadcast("changeSpatialUnitViaInfoControl", spatialUnitName); - }); - - // $(document).on('change','#selectSimplifyGeometriesViaInfoControl',function(){ - // var selector = document.getElementById('selectSimplifyGeometriesViaInfoControl'); - // var simplifyGeometries = selector[selector.selectedIndex].value; - // - // kommonitorDataExchangeService.simplifyGeometries = simplifyGeometries; - // - // $rootScope.$broadcast("changeSpatialUnit"); - // }); - - $scope.$on("changeSpatialUnitViaInfoControl", function (event, spatialUnitLevel) { - - $rootScope.$broadcast("changeSpatialUnit"); - - }); - - - $scope.appendSpatialUnitOptions = function () { - - //
        - // - //
        - - // var innerHTMLString = "
        "; - // innerHTMLString += ""; - // innerHTMLString += "
        "; - // // innerHTMLString += "
        "; - - // - - var innerHTMLString = '
        '; - innerHTMLString += "
        "; - innerHTMLString += "
        "; - innerHTMLString += "
        "; - - return innerHTMLString; - }; - - // $scope.appendSimplifyGeometriesOptions = function(){ - // - // //
        - // // - // //
        - // - // var innerHTMLString = "
        "; - // innerHTMLString += ""; - // innerHTMLString += "
        "; - // // innerHTMLString += "
        "; - // - // return innerHTMLString; - // }; - - var toggleInfoControl = function () { - if ($scope.showInfoControl === true) { - /* use jquery to select your DOM elements that has the class 'legend' */ - $('.info').hide(); - $scope.showInfoControl = false; - - $('#toggleInfoControlButton').show(); - } else { - $('.info').show(); + _defaultMoveToLocation: function (latlng, title, map) { + if (this.options.zoom) + this._map.setView(latlng, this.options.zoom); + else + this._map.panTo(latlng); + // add collapse after click on item + this.collapse(); + }, + _handleAutoresize: function () { + var maxWidth; + if (!this._map) { + this._map = $scope.map; + } + if (this._input.style.maxWidth !== this._map._container.offsetWidth) { + maxWidth = this._map._container.clientWidth; + // other side margin + padding + width border + width search-button + width search-cancel + maxWidth -= 10 + 20 + 1 + 30 + 22; + this._input.style.maxWidth = maxWidth.toString() + 'px'; + } + if (this.options.autoResize && (this._container.offsetWidth + 20 < this._map._container.offsetWidth)) { + this._input.size = this._input.value.length < this._inputMinSize ? this._inputMinSize : this._input.value.length; + } + } + }); + $scope.onCloseOutlierAlert = function () { + // $("#outlierInfo").hide(); + $scope.showOutlierInfoAlert = false; + }; + var refreshNoDataStyle = function () { + $scope.currentIndicatorContainsNoDataValues = false; + $scope.svgString_noData = '' + + '' + + '' + + '' + + '' + + 'Sorry, your browser does not support inline SVG.'; + $scope.noDataStyle = kommonitorVisualStyleHelperService.noDataStyle; + }; + var refreshOutliersStyle = function () { + $scope.containsOutliers_high = false; + $scope.containsOutliers_low = false; + $scope.outlierMinValue = undefined; + $scope.outlierMaxValue = undefined; + $scope.showOutlierInfoAlert = false; + $scope.svgString_outlierLow = 'Sorry, your browser does not support inline SVG.'; + $scope.svgString_outlierHigh = 'Sorry, your browser does not support inline SVG.'; + // if ($scope.useTransparencyOnIndicator) { + // fillOpacity_high = defaultFillOpacityForOutliers_high; + // fillOpacity_low = defaultFillOpacityForOutliers_low; + // } + $scope.outlierStyle_high = kommonitorVisualStyleHelperService.outlierStyle_high; + $scope.outlierStyle_low = kommonitorVisualStyleHelperService.outlierStyle_low; + }; + $scope.useTransparencyOnIndicator = __env.useTransparencyOnIndicator; + $scope.filteredStyle = kommonitorVisualStyleHelperService.filteredStyle; + var refreshFilteredStyle = function () { + $scope.filteredStyle = kommonitorVisualStyleHelperService.filteredStyle; + }; + this.kommonitorMapServiceInstance = kommonitorMapService; + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + $scope.inputLayerCounter = 0; + $scope.latCenter = __env.initialLatitude; + $scope.lonCenter = __env.initialLongitude; + $scope.zoomLevel = __env.initialZoomLevel; + $scope.loadingData = true; + $scope.drawnItems = new L.FeatureGroup(); + $scope.drawControl = undefined; + $scope.allDrawingToolsEnabled = false; + $scope.date = undefined; + // central map object + $scope.map = undefined; + $scope.scaleBar = undefined; + $scope.layerControl = undefined; $scope.showInfoControl = true; - - // button is defined in kommonitor-user-interface component - $('#toggleInfoControlButton').hide(); - } - }; - - var toggleLegendControl = function () { - if ($scope.showLegendControl === true) { - /* use jquery to select your DOM elements that has the class 'legend' */ - $('.legendMap').hide(); - $scope.showLegendControl = false; - - $('#toggleLegendControlButton').show(); - } else { - $('.legendMap').show(); $scope.showLegendControl = true; - - // button is defined in kommonitor-user-interface component - $('#toggleLegendControlButton').hide(); - } - }; - - $scope.$on("toggleInfoControl", function (event) { - toggleInfoControl(); - }); - - $scope.$on("toggleLegendControl", function (event) { - toggleLegendControl(); - }); - - $scope.appendInfoCloseButton = function () { - return ''; - }; - - $scope.appendLegendCloseButton = function () { - return ''; - }; - - $scope.appendIndicatorInformation = function(isCustomComputation){ - var indicatorInfoHTML = '
        '; - var titel = $scope.indicatorName; - - if (isCustomComputation) { - titel += " - individuelles Berechnungsergebnis"; - } - - indicatorInfoHTML += '

        ' + titel + '


        '; - indicatorInfoHTML += 'Beschreibung: ' + $scope.indicatorDescription + '
        '; - indicatorInfoHTML += 'Datenquelle: ' + $scope.currentIndicatorMetadataAndGeoJSON.metadata.datasource + '
        '; - indicatorInfoHTML += $scope.appendSpatialUnitOptions(); - - var transparencyDomString = ""; - transparencyDomString += '
        '; - transparencyDomString += '
        '; - transparencyDomString += '
        '; - transparencyDomString += ''; - transparencyDomString += '
        '; - transparencyDomString += '
        '; - transparencyDomString += '
        '; - transparencyDomString += '
        '; - transparencyDomString += ''; - transparencyDomString += '
        '; - transparencyDomString += '
        '; - transparencyDomString += '
        '; - transparencyDomString += '
        '; - transparencyDomString += ''; - transparencyDomString += '
        '; - transparencyDomString += '
        '; - transparencyDomString += '
        '; - - indicatorInfoHTML += transparencyDomString; - - var exportDomString = '
        '; - exportDomString += ""; - exportDomString += '
        '; - exportDomString += ''; - exportDomString += ''; - // temporarily disable WMS and WFS export - exportDomString += 'WMS'; - exportDomString += 'WFS'; - exportDomString += "
        "; - - indicatorInfoHTML += exportDomString; - - indicatorInfoHTML += "



        "; - - // indicatorInfoHTML += $scope.appendSimplifyGeometriesOptions(); - return indicatorInfoHTML; - }; - - - $(document).on('click', '#controlIndicatorTransparency', function (e) { - var indicatorTransparencyCheckbox = document.getElementById('controlIndicatorTransparency'); - if (indicatorTransparencyCheckbox.checked) { - $scope.useTransparencyOnIndicator = true; - } - else { - $scope.useTransparencyOnIndicator = false; - } - $rootScope.$broadcast("restyleCurrentLayer", false); - - // ensure that highlighted features remain highlighted - preserveHighlightedFeatures(); - }); - - $(document).on('click', '#controlIndicatorOutlierDetection', function (e) { - var indicatorOutlierCheckbox = document.getElementById('controlIndicatorOutlierDetection'); - if (indicatorOutlierCheckbox.checked) { - kommonitorDataExchangeService.useOutlierDetectionOnIndicator = true; - } - else { - kommonitorDataExchangeService.useOutlierDetectionOnIndicator = false; - } - $rootScope.$broadcast("restyleCurrentLayer", false); - - // ensure that highlighted features remain highlighted - preserveHighlightedFeatures(); - }); - - $(document).on('click', '#controlIndicatorZeroClassifyOption', function (e) { - var zeroClassifyCheckbox = document.getElementById('controlIndicatorZeroClassifyOption'); - if (zeroClassifyCheckbox.checked) { - kommonitorDataExchangeService.classifyZeroSeparately = true; - } - else { - kommonitorDataExchangeService.classifyZeroSeparately = false; - } - $rootScope.$broadcast("restyleCurrentLayer", false); - - // ensure that highlighted features remain highlighted - preserveHighlightedFeatures(); - }); - - $scope.$on("changeClassifyMethod", function (event, method) { - kommonitorVisualStyleHelperService.classifyMethod = method; - - $timeout(function(){ - kommonitorVisualStyleHelperService.classifyMethod = method; - $rootScope.$apply(); - }, 350); - - $rootScope.$broadcast("restyleCurrentLayer", false); - }); - - $(document).on('click', '#controlNoDataDisplay', function (e) { - var controlNoDataDisplayCheckbox = document.getElementById('controlNoDataDisplay'); - - if (controlNoDataDisplayCheckbox.checked) { - $scope.applyNoDataDisplay(); - } else { - $scope.resetNoDataDisplay(); - } - - $rootScope.$broadcast("restyleCurrentLayer", false); - - // ensure that highlighted features remain highlighted - preserveHighlightedFeatures(); - }); - - - $scope.$on("applyNoDataDisplay", function() { - $scope.applyNoDataDisplay(); - }); - - - $scope.applyNoDataDisplay = function() { - kommonitorDataExchangeService.useNoDataToggle = true; - $scope.featuresWithValues = []; - for (var i = 0; i < $scope.currentIndicatorMetadataAndGeoJSON.geoJSON.features.length; i++) { - if (!kommonitorDataExchangeService.indicatorValueIsNoData($scope.currentIndicatorMetadataAndGeoJSON.geoJSON.features[i].properties[$scope.indicatorPropertyName])) { - $scope.featuresWithValues.push($scope.currentIndicatorMetadataAndGeoJSON.geoJSON.features[i]) - } else { - $scope.featuresWithoutValues.push($scope.currentIndicatorMetadataAndGeoJSON.geoJSON.features[i]) - } - } - - // get feature names array - let featuresWithValuesNames = []; - for (var i = 0; i < $scope.featuresWithValues.length; i++) { - featuresWithValuesNames.push( $scope.featuresWithValues[i].properties["name"]); - } - - // store checkbox state - let completelyRemoveFilteredFeaturesFromDisplayChbState = kommonitorFilterHelperService.completelyRemoveFilteredFeaturesFromDisplay; - kommonitorFilterHelperService.completelyRemoveFilteredFeaturesFromDisplay = true; // set checkbox true - // perform spatial filter - kommonitorFilterHelperService.applySpatialFilter_currentSpatialUnitFeatures(featuresWithValuesNames); - // set checkbox to previous state - kommonitorFilterHelperService.completelyRemoveFilteredFeaturesFromDisplay = completelyRemoveFilteredFeaturesFromDisplayChbState; - } - - - $scope.$on("resetNoDataDisplay", function() { - $scope.resetNoDataDisplay(); - }); - - $scope.resetNoDataDisplay = function() { - kommonitorDataExchangeService.useNoDataToggle = false; - let visibleFeatures = $scope.currentIndicatorMetadataAndGeoJSON.geoJSON.features; - let visibleAndNoDataFeatures = visibleFeatures.concat($scope.featuresWithoutValues); - - // get feature names array - let visibleAndNoDataFeaturesNames = []; - for (var i = 0; i < visibleAndNoDataFeatures.length; i++) { - visibleAndNoDataFeaturesNames.push( visibleAndNoDataFeatures[i].properties["name"]); + $scope.showLegend = true; + $scope.overlays = new Array(); + $scope.baseMaps = new Array(); + const spatialUnitLayerGroupName = "Raumeinheiten"; + const georesourceLayerGroupName = "Georessourcen"; + const poiLayerGroupName = "Points of Interest"; + const loiLayerGroupName = "Lines of Interest"; + const aoiLayerGroupName = "Areas of Interest"; + const indicatorLayerGroupName = "Indikatoren"; + const reachabilityLayerGroupName = "Erreichbarkeiten"; + const wmsLayerGroupName = "Web Map Services (WMS)"; + const wfsLayerGroupName = "Web Feature Services (WFS)"; + const fileLayerGroupName = "Dateilayer"; + // create classyBrew object + $scope.defaultBrew = new classyBrew(); + $scope.gtMeasureOfValueBrew = new classyBrew(); + $scope.ltMeasureOfValueBrew = new classyBrew(); + $scope.currentIndicatorMetadataAndGeoJSON; + $scope.currentGeoJSONOfCurrentLayer; + $scope.currentIndicatorContainsZeroValues = false; + $scope.currentIndicatorContainsNoDataValues = false; + $scope.indicatorTypeOfCurrentLayer; + $scope.defaultColorForZeroValues = __env.defaultColorForZeroValues; + $scope.customIndicatorPropertyName; + $scope.customIndicatorName; + $scope.customIndicatorUnit; + $scope.currentCustomIndicatorLayerOfCurrentLayer; + $scope.customPropertyName; + $scope.currentCustomIndicatorLayer; + $scope.isochronesLayer = undefined; + $scope.isochroneMarkerLayer = undefined; + /* + * L.TileLayer.Grayscale is a regular tilelayer with grayscale makeover. + */ + L.TileLayer.Grayscale = L.TileLayer.extend({ + options: { + quotaRed: 21, + quotaGreen: 71, + quotaBlue: 8, + quotaDividerTune: 0, + quotaDivider: function () { + return this.quotaRed + this.quotaGreen + this.quotaBlue + this.quotaDividerTune; + } + }, + initialize: function (url, options) { + options = options || {}; + options.crossOrigin = true; + L.TileLayer.prototype.initialize.call(this, url, options); + this.on('tileload', function (e) { + this._makeGrayscale(e.tile); + }); + }, + _createTile: function () { + var tile = L.TileLayer.prototype._createTile.call(this); + tile.crossOrigin = "Anonymous"; + return tile; + }, + _makeGrayscale: function (img) { + if (img.getAttribute('data-grayscaled')) + return; + img.crossOrigin = ''; + var canvas = document.createElement("canvas"); + canvas.width = img.width; + canvas.height = img.height; + var ctx = canvas.getContext("2d"); + ctx.drawImage(img, 0, 0); + var imgd = ctx.getImageData(0, 0, canvas.width, canvas.height); + var pix = imgd.data; + for (var i = 0, n = pix.length; i < n; i += 4) { + pix[i] = pix[i + 1] = pix[i + 2] = (this.options.quotaRed * pix[i] + this.options.quotaGreen * pix[i + 1] + this.options.quotaBlue * pix[i + 2]) / this.options.quotaDivider(); + } + ctx.putImageData(imgd, 0, 0); + img.setAttribute('data-grayscaled', true); + img.src = canvas.toDataURL(); + } + }); + L.tileLayer.grayscale = function (url, options) { + return new L.TileLayer.Grayscale(url, options); + }; + this.initializeMap = function () { + $scope.loadingData = true; + // initialize map referring to div element with id="map" + var baseLayerDefinitionsMap = new Map(); + for (const baseMapEntry of __env.baseLayers) { + if (baseMapEntry.layerType === "TILE_LAYER_GRAYSCALE") { + var grayscaleLayer = new L.tileLayer.grayscale(baseMapEntry.url, { minZoom: baseMapEntry.minZoomLevel, maxZoom: baseMapEntry.maxZoomLevel, attribution: baseMapEntry.attribution_html }); + baseLayerDefinitionsMap.set(baseMapEntry.name, grayscaleLayer); + } + else if (baseMapEntry.layerType === "TILE_LAYER") { + var tileLayer = new L.tileLayer(baseMapEntry.url, { minZoom: baseMapEntry.minZoomLevel, maxZoom: baseMapEntry.maxZoomLevel, attribution: baseMapEntry.attribution_html }); + baseLayerDefinitionsMap.set(baseMapEntry.name, tileLayer); + } + else if (baseMapEntry.layerType === "WMS") { + var wmsLayer = new L.tileLayer.wms(baseMapEntry.url, { minZoom: baseMapEntry.minZoomLevel, maxZoom: baseMapEntry.maxZoomLevel, attribution: baseMapEntry.attribution_html, layers: baseMapEntry.layerName_WMS, format: 'image/png' }); + baseLayerDefinitionsMap.set(baseMapEntry.name, wmsLayer); + } + } + $scope.map = L.map('map', { + center: [$scope.latCenter, $scope.lonCenter], + zoom: $scope.zoomLevel, + zoomDelta: 0.5, + zoomSnap: 0.5, + layers: [baseLayerDefinitionsMap.get(__env.baseLayers[0].name)] + }); + // execute update search control on layer add and remove + $scope.map.on('overlayadd', function (eo) { + $scope.updateSearchControl(); + }); + $scope.map.on('overlayremove', function (eo) { + $scope.updateSearchControl(); + }); + // update zoom and extent + $scope.map.on('zoomend', function (eo) { + let latLng = $scope.map.getCenter(); + __env.currentLatitude = latLng.lat; + __env.currentLongitude = latLng.lng; + __env.currentZoomLevel = $scope.map.getZoom(); + }); + $scope.map.on('moveend', function (eo) { + let latLng = $scope.map.getCenter(); + __env.currentLatitude = latLng.lat; + __env.currentLongitude = latLng.lng; + __env.currentZoomLevel = $scope.map.getZoom(); + }); + $scope.baseMaps = {}; + baseLayerDefinitionsMap.forEach(function (value, key, map) { + $scope.baseMaps[key] = value; + }); + $scope.groupedOverlays = { + indicatorLayerGroupName: {}, + poiLayerGroupName: {}, + loiLayerGroupName: {}, + aoiLayerGroupName: {}, + wmsLayerGroupName: {}, + wfsLayerGroupName: {}, + fileLayerGroupName: {}, + reachabilityLayerGroupName: {} + }; + $scope.layerControl = L.control.groupedLayers($scope.baseMaps, $scope.groupedOverlays, { position: 'topleft' }); + $scope.map.addControl($scope.layerControl); + // Disable dragging when user's cursor enters the element + $scope.layerControl.getContainer().addEventListener('mouseover', function () { + $scope.map.dragging.disable(); + $scope.map.touchZoom.disable(); + $scope.map.doubleClickZoom.disable(); + $scope.map.scrollWheelZoom.disable(); + }); + // Re-enable dragging when user's cursor leaves the element + $scope.layerControl.getContainer().addEventListener('mouseout', function () { + $scope.map.dragging.enable(); + $scope.map.touchZoom.enable(); + $scope.map.doubleClickZoom.enable(); + $scope.map.scrollWheelZoom.enable(); + }); + $scope.scaleBar = L.control.scale(); + $scope.scaleBar.addTo($scope.map); + // hatch patterns + // var diagonalPattern = new L.PatternPath({ d: "M-1,1 l2,-2 M0,4 l4,-4 M3,5 l2,-2" , fill: true }); + // $scope.outlierFillPattern_high = new L.Pattern(); + // $scope.outlierFillPattern_high.addShape(diagonalPattern); + // $scope.outlierFillPattern_high.addTo($scope.map); + $scope.outlierFillPattern_low = kommonitorVisualStyleHelperService.outlierFillPattern_low; + $scope.outlierFillPattern_low.addTo($scope.map); + $scope.outlierFillPattern_high = kommonitorVisualStyleHelperService.outlierFillPattern_high; + $scope.outlierFillPattern_high.addTo($scope.map); + $scope.noDataFillPattern = kommonitorVisualStyleHelperService.noDataFillPattern; + $scope.noDataFillPattern.addTo($scope.map); + // $scope.loadingData = false; + ///////////////////////////////////////////////////// + ///// LEAFLET GEOSEARCH SETUP + ///////////////////////////////////////////////////// + var GeoSearchControl = window.GeoSearch.GeoSearchControl; + var OpenStreetMapProvider = window.GeoSearch.OpenStreetMapProvider; + // remaining is the same as in the docs, accept for the var instead of const declarations + var provider = new OpenStreetMapProvider({ + params: { + 'accept-language': 'de', + countrycodes: 'de', + addressdetails: 1, + viewbox: "" + (Number(__env.initialLongitude) - 0.001) + "," + (Number(__env.initialLatitude) - 0.001) + "," + (Number(__env.initialLongitude) + 0.001) + "," + (Number(__env.initialLatitude) + 0.001) + }, + searchUrl: __env.targetUrlToGeocoderService + '/search', + reverseUrl: __env.targetUrlToGeocoderService + '/reverse' + }); + $scope.geosearchControl = new GeoSearchControl({ + position: "topleft", + provider: provider, + style: 'button', + autoComplete: true, + autoCompleteDelay: 250, + showMarker: true, + showPopup: false, + marker: { + icon: new L.Icon.Default(), + draggable: false, + }, + popupFormat: ({ query, result }) => result.label, + maxMarkers: 1, + retainZoomLevel: false, + animateZoom: true, + autoClose: false, + searchLabel: 'Suche nach Adressen ...', + keepResult: false // optional: true|false - default false + }); + $scope.map.addControl($scope.geosearchControl); + ///////////////////////////////////////////////////// + ///// LEAFLET SEARCH SETUP + ///////////////////////////////////////////////////// + // will be updated once example indicator layer is loaded + $scope.searchControl = new MultipleResultsLeafletSearch({}); + $scope.searchControl.addTo($scope.map); + ///////////////////////////////////////////////////// + ///// LEAFLET MEASURE SETUP + ///////////////////////////////////////////////////// + var measureOptions = { + position: 'topleft', + primaryLengthUnit: 'meters', + secondaryLengthUnit: 'kilometers', + primaryAreaUnit: 'sqmeters', + activeColor: "#d15c54", + completedColor: "#d15c54", + decPoint: ',', + thousandsSep: '.' + }; + $scope.measureControl = new L.Control.Measure(measureOptions); + $scope.measureControl.addTo($scope.map); + ///////////////////////////////////////////////////// + ///// LEAFLET SCREENSHOTER SETUP + ///////////////////////////////////////////////////// + // from the docs, most of it is probably not needed + let screenshotterOptions = { + cropImageByInnerWH: true, + hidden: true, + preventDownload: false, + domtoimageOptions: {}, + position: 'topleft', + screenName: 'screen', + hideElementsWithSelectors: ['.leaflet-control-container'], + mimeType: 'image/png', + caption: null, + captionFontSize: 15, + captionFont: 'Arial', + captionColor: 'black', + captionBgColor: 'white', + captionOffset: 5, + // callback for manually edit map if have warn: "May be map size very big on that zoom level, we have error" + // and screenshot not created + onPixelDataFail: async function ({ node, plugin, error, mapPane, domtoimageOptions }) { + // Solutions: + // decrease size of map + // or decrease zoom level + // or remove elements with big distanses + // and after that return image in Promise - plugin._getPixelDataOfNormalMap + return plugin._getPixelDataOfNormalMap(domtoimageOptions); + } + }; + $scope.simpleMapScreenshoter = L.simpleMapScreenshoter(screenshotterOptions).addTo($scope.map); + $scope.map.simpleMapScreenshoter = $scope.simpleMapScreenshoter; + }; // end initialize map + $scope.$on("exportMap", function (event) { + // wait for print process to finish + let format = 'blob'; // 'image' - return base64, 'canvas' - return canvas + let overridedPluginOptions = { + mimeType: 'image/png' + }; + $scope.simpleMapScreenshoter.takeScreen(format, overridedPluginOptions); + $scope.simpleMapScreenshoter.takeScreen(format, overridedPluginOptions).then(blob => { + // FileSaver saveAs method + saveAs(blob, 'KomMonitor-Screenshot.png'); + }).catch(error => { + console.log("Error while exporting map view."); + console.error(error); + kommonitorDataExchangeService.displayMapApplicationError(error); + }); + }); + function isKomMonitorSpecificProperty(propertyKey) { + let isKomMonitorSpecificProperty = false; + if (propertyKey == "outlier") { + isKomMonitorSpecificProperty = true; + } + else if (propertyKey == __env.VALID_START_DATE_PROPERTY_NAME) { + isKomMonitorSpecificProperty = true; + } + else if (propertyKey == __env.VALID_END_DATE_PROPERTY_NAME) { + isKomMonitorSpecificProperty = true; + } + else if (propertyKey == "bbox") { + isKomMonitorSpecificProperty = true; + } + else if (propertyKey.includes(__env.indicatorDatePrefix)) { + isKomMonitorSpecificProperty = true; + } + return isKomMonitorSpecificProperty; + } + $scope.updateSearchControl = function () { + setTimeout(function () { + if ($scope.searchControl) { + try { + $scope.map.removeControl($scope.searchControl); + $scope.searchControl = undefined; + } + catch (error) { + kommonitorDataExchangeService.displayMapApplicationError(error); + } + } + // build L.layerGroup of available POI layers + var featureLayers = []; + for (var layerEntry of $scope.layerControl._layers) { + if (layerEntry) { + if (layerEntry.overlay) { + if ($scope.map.hasLayer(layerEntry.layer)) { + if (layerEntry.group.name === poiLayerGroupName || layerEntry.group.name === loiLayerGroupName || layerEntry.group.name === aoiLayerGroupName || layerEntry.group.name === indicatorLayerGroupName || layerEntry.group.name === wfsLayerGroupName || layerEntry.group.name === fileLayerGroupName) { + featureLayers.push(layerEntry.layer); + } + } + } + } + } + var layerGroup; + // if no relevant layers are currently displayed, then + if (featureLayers.length === 0) { + $scope.searchControl = new MultipleResultsLeafletSearch({}); + $scope.searchControl.addTo($scope.map); + } + else { + layerGroup = L.featureGroup(featureLayers); + $scope.searchControl = new MultipleResultsLeafletSearch({ + position: "topleft", + layer: layerGroup, + initial: false, + propertyName: __env.FEATURE_NAME_PROPERTY_NAME, + textPlaceholder: "Layer-Objekte nach Name und/oder ID filtern", + textCancel: "Abbrechen", + textErr: "Position nicht gefunden", + hideMarkerOnCollapse: true, + zoom: 15, + autoResize: true, + autoCollapse: false, + autoType: true, + formatData: function (json) { + var propName = this.options.propertyName, propLoc = this.options.propertyLoc, i, jsonret = {}; + if (L.Util.isArray(propLoc)) + for (i in json) { + if (!this._getPath(json[i], propName)) + continue; + jsonret[this._getPath(json[i], propName) + " (" + json[i][propLoc[0]] + "," + json[i][propLoc[1]] + ")"] = L.latLng(json[i][propLoc[0]], json[i][propLoc[1]]); + } + else + for (i in json) { + if (!this._getPath(json[i], propName)) + continue; + jsonret[this._getPath(json[i], propName) + " (" + json[i][propLoc][0] + "," + json[i][propLoc][1] + ")"] = L.latLng(this._getPath(json[i], propLoc)); + } + return jsonret; + }, + filterData: function (text, records) { + var I, icase, regSearch, frecords = {}; + text = text.replace(/[.*+?^${}()|[\]\\]/g, ''); //sanitize remove all special characters + if (text === '') + return []; + I = this.options.initial ? '^' : ''; //search only initial text + icase = !this.options.casesensitive ? 'i' : undefined; + regSearch = new RegExp(I + text, icase); + for (var key in records) { + // make a searchable string from all relevant feature properties + let recordString = ""; + let record = records[key]; + let recordProperties = record.layer.feature.properties; + for (const propertyKey in recordProperties) { + if (recordProperties[propertyKey] && !isKomMonitorSpecificProperty(propertyKey)) { + recordString += recordProperties[propertyKey]; + } + } + if (regSearch.test(recordString)) + frecords[key] = records[key]; + } + return frecords; + }, + buildTip: function (text, val) { + var emString = ""; + if (val.layer.metadataObject) { + if (val.layer.metadataObject.isPOI) { + emString += ''; + emString += ""; + emString += ''; + } + } + else { + emString += ""; + } + return '' + emString + '  ' + text + ''; + } + }); + $scope.searchControl.addTo($scope.map); + } + }, 200); + }; + $scope.$on("showLoadingIconOnMap", function (event) { + // console.log("Show loading icon on map"); + $scope.loadingData = true; + }); + $scope.$on("hideLoadingIconOnMap", function (event) { + // console.log("Hide loading icon on map"); + $timeout(function () { + $scope.loadingData = false; + }, 250); + }); + $(document).on('click', '#selectSpatialUnitViaInfoControl li p', function () { + var spatialUnitName = $(this).text(); + $('#selectSpatialUnitViaInfoControl_text').text(spatialUnitName); + $rootScope.$broadcast("changeSpatialUnitViaInfoControl", spatialUnitName); + }); + // $(document).on('change','#selectSimplifyGeometriesViaInfoControl',function(){ + // var selector = document.getElementById('selectSimplifyGeometriesViaInfoControl'); + // var simplifyGeometries = selector[selector.selectedIndex].value; + // + // kommonitorDataExchangeService.simplifyGeometries = simplifyGeometries; + // + // $rootScope.$broadcast("changeSpatialUnit"); + // }); + $scope.$on("changeSpatialUnitViaInfoControl", function (event, spatialUnitLevel) { + $rootScope.$broadcast("changeSpatialUnit"); + }); + $scope.appendSpatialUnitOptions = function () { + //
        + // + //
        + // var innerHTMLString = "
        "; + // innerHTMLString += ""; + // innerHTMLString += "
        "; + // // innerHTMLString += "
        "; + // + var innerHTMLString = '
        '; + innerHTMLString += "
        "; + innerHTMLString += "
        "; + innerHTMLString += "
        "; + return innerHTMLString; + }; + // $scope.appendSimplifyGeometriesOptions = function(){ + // + // //
        + // // + // //
        + // + // var innerHTMLString = "
        "; + // innerHTMLString += ""; + // innerHTMLString += "
        "; + // // innerHTMLString += "
        "; + // + // return innerHTMLString; + // }; + var toggleInfoControl = function () { + if ($scope.showInfoControl === true) { + /* use jquery to select your DOM elements that has the class 'legend' */ + $('.info').hide(); + $scope.showInfoControl = false; + $('#toggleInfoControlButton').show(); + } + else { + $('.info').show(); + $scope.showInfoControl = true; + // button is defined in kommonitor-user-interface component + $('#toggleInfoControlButton').hide(); + } + }; + var toggleLegendControl = function () { + if ($scope.showLegendControl === true) { + /* use jquery to select your DOM elements that has the class 'legend' */ + $('.legendMap').hide(); + $scope.showLegendControl = false; + $('#toggleLegendControlButton').show(); + } + else { + $('.legendMap').show(); + $scope.showLegendControl = true; + // button is defined in kommonitor-user-interface component + $('#toggleLegendControlButton').hide(); + } + }; + $scope.$on("toggleInfoControl", function (event) { + toggleInfoControl(); + }); + $scope.$on("toggleLegendControl", function (event) { + toggleLegendControl(); + }); + $scope.appendInfoCloseButton = function () { + return ''; + }; + $scope.appendLegendCloseButton = function () { + return ''; + }; + $scope.appendIndicatorInformation = function (isCustomComputation) { + var indicatorInfoHTML = '
        '; + var titel = $scope.indicatorName; + if (isCustomComputation) { + titel += " - individuelles Berechnungsergebnis"; + } + indicatorInfoHTML += '

        ' + titel + '


        '; + indicatorInfoHTML += 'Beschreibung: ' + $scope.indicatorDescription + '
        '; + indicatorInfoHTML += 'Datenquelle: ' + $scope.currentIndicatorMetadataAndGeoJSON.metadata.datasource + '
        '; + indicatorInfoHTML += $scope.appendSpatialUnitOptions(); + var transparencyDomString = ""; + transparencyDomString += '
        '; + transparencyDomString += '
        '; + transparencyDomString += '
        '; + transparencyDomString += ''; + transparencyDomString += '
        '; + transparencyDomString += '
        '; + transparencyDomString += '
        '; + transparencyDomString += '
        '; + transparencyDomString += ''; + transparencyDomString += '
        '; + transparencyDomString += '
        '; + transparencyDomString += '
        '; + transparencyDomString += '
        '; + transparencyDomString += ''; + transparencyDomString += '
        '; + transparencyDomString += '
        '; + transparencyDomString += '
        '; + indicatorInfoHTML += transparencyDomString; + var exportDomString = '
        '; + exportDomString += ""; + exportDomString += '
        '; + exportDomString += ''; + exportDomString += ''; + // temporarily disable WMS and WFS export + exportDomString += 'WMS'; + exportDomString += 'WFS'; + exportDomString += "
        "; + indicatorInfoHTML += exportDomString; + indicatorInfoHTML += "



        "; + // indicatorInfoHTML += $scope.appendSimplifyGeometriesOptions(); + return indicatorInfoHTML; + }; + $(document).on('click', '#controlIndicatorTransparency', function (e) { + var indicatorTransparencyCheckbox = document.getElementById('controlIndicatorTransparency'); + if (indicatorTransparencyCheckbox.checked) { + $scope.useTransparencyOnIndicator = true; + } + else { + $scope.useTransparencyOnIndicator = false; + } + $rootScope.$broadcast("restyleCurrentLayer", false); + // ensure that highlighted features remain highlighted + preserveHighlightedFeatures(); + }); + $(document).on('click', '#controlIndicatorOutlierDetection', function (e) { + var indicatorOutlierCheckbox = document.getElementById('controlIndicatorOutlierDetection'); + if (indicatorOutlierCheckbox.checked) { + kommonitorDataExchangeService.useOutlierDetectionOnIndicator = true; + } + else { + kommonitorDataExchangeService.useOutlierDetectionOnIndicator = false; + } + $rootScope.$broadcast("restyleCurrentLayer", false); + // ensure that highlighted features remain highlighted + preserveHighlightedFeatures(); + }); + $(document).on('click', '#controlIndicatorZeroClassifyOption', function (e) { + var zeroClassifyCheckbox = document.getElementById('controlIndicatorZeroClassifyOption'); + if (zeroClassifyCheckbox.checked) { + kommonitorDataExchangeService.classifyZeroSeparately = true; + } + else { + kommonitorDataExchangeService.classifyZeroSeparately = false; + } + $rootScope.$broadcast("restyleCurrentLayer", false); + // ensure that highlighted features remain highlighted + preserveHighlightedFeatures(); + }); + $scope.$on("changeClassifyMethod", function (event, method) { + kommonitorVisualStyleHelperService.classifyMethod = method; + $timeout(function () { + kommonitorVisualStyleHelperService.classifyMethod = method; + $rootScope.$apply(); + }, 350); + $rootScope.$broadcast("restyleCurrentLayer", false); + }); + $(document).on('click', '#controlNoDataDisplay', function (e) { + var controlNoDataDisplayCheckbox = document.getElementById('controlNoDataDisplay'); + if (controlNoDataDisplayCheckbox.checked) { + $scope.applyNoDataDisplay(); + } + else { + $scope.resetNoDataDisplay(); + } + $rootScope.$broadcast("restyleCurrentLayer", false); + // ensure that highlighted features remain highlighted + preserveHighlightedFeatures(); + }); + $scope.$on("applyNoDataDisplay", function () { + $scope.applyNoDataDisplay(); + }); + $scope.applyNoDataDisplay = function () { + kommonitorDataExchangeService.useNoDataToggle = true; + $scope.featuresWithValues = []; + for (var i = 0; i < $scope.currentIndicatorMetadataAndGeoJSON.geoJSON.features.length; i++) { + if (!kommonitorDataExchangeService.indicatorValueIsNoData($scope.currentIndicatorMetadataAndGeoJSON.geoJSON.features[i].properties[$scope.indicatorPropertyName])) { + $scope.featuresWithValues.push($scope.currentIndicatorMetadataAndGeoJSON.geoJSON.features[i]); + } + else { + $scope.featuresWithoutValues.push($scope.currentIndicatorMetadataAndGeoJSON.geoJSON.features[i]); + } + } + // get feature names array + let featuresWithValuesNames = []; + for (var i = 0; i < $scope.featuresWithValues.length; i++) { + featuresWithValuesNames.push($scope.featuresWithValues[i].properties["name"]); + } + // store checkbox state + let completelyRemoveFilteredFeaturesFromDisplayChbState = kommonitorFilterHelperService.completelyRemoveFilteredFeaturesFromDisplay; + kommonitorFilterHelperService.completelyRemoveFilteredFeaturesFromDisplay = true; // set checkbox true + // perform spatial filter + kommonitorFilterHelperService.applySpatialFilter_currentSpatialUnitFeatures(featuresWithValuesNames); + // set checkbox to previous state + kommonitorFilterHelperService.completelyRemoveFilteredFeaturesFromDisplay = completelyRemoveFilteredFeaturesFromDisplayChbState; + }; + $scope.$on("resetNoDataDisplay", function () { + $scope.resetNoDataDisplay(); + }); + $scope.resetNoDataDisplay = function () { + kommonitorDataExchangeService.useNoDataToggle = false; + let visibleFeatures = $scope.currentIndicatorMetadataAndGeoJSON.geoJSON.features; + let visibleAndNoDataFeatures = visibleFeatures.concat($scope.featuresWithoutValues); + // get feature names array + let visibleAndNoDataFeaturesNames = []; + for (var i = 0; i < visibleAndNoDataFeatures.length; i++) { + visibleAndNoDataFeaturesNames.push(visibleAndNoDataFeatures[i].properties["name"]); + } + // store checkbox state + let completelyRemoveFilteredFeaturesFromDisplayChbState = kommonitorFilterHelperService.completelyRemoveFilteredFeaturesFromDisplay; + kommonitorFilterHelperService.completelyRemoveFilteredFeaturesFromDisplay = true; // set checkbox true + // perform spatial filter + kommonitorFilterHelperService.applySpatialFilter_currentSpatialUnitFeatures(visibleAndNoDataFeaturesNames); + // set checkbox to previous state + kommonitorFilterHelperService.completelyRemoveFilteredFeaturesFromDisplay = completelyRemoveFilteredFeaturesFromDisplayChbState; + $scope.featuresWithoutValues = []; + }; + /** + * binds the popup of a clicked output + * to layer.feature.properties.popupContent + */ + function onEachFeatureSpatialUnit(feature, layer) { + // does this feature have a property named popupContent? + layer.on({ + click: function () { + // var propertiesString = "
        " + JSON.stringify(feature.properties, null, ' ').replace(/[\{\}"]/g, '') + "
        "; + var popupContent = '
        '; + for (var p in feature.properties) { + popupContent += ''; + } + popupContent += '
        ' + p + '' + feature.properties[p] + '
        '; + layer.bindPopup(popupContent); + // if (propertiesString) + // layer.bindPopup(propertiesString); + } + }); } - - // store checkbox state - let completelyRemoveFilteredFeaturesFromDisplayChbState = kommonitorFilterHelperService.completelyRemoveFilteredFeaturesFromDisplay; - kommonitorFilterHelperService.completelyRemoveFilteredFeaturesFromDisplay = true; // set checkbox true - // perform spatial filter - kommonitorFilterHelperService.applySpatialFilter_currentSpatialUnitFeatures(visibleAndNoDataFeaturesNames); - // set checkbox to previous state - kommonitorFilterHelperService.completelyRemoveFilteredFeaturesFromDisplay = completelyRemoveFilteredFeaturesFromDisplayChbState; - - $scope.featuresWithoutValues = []; - } - - - /** - * binds the popup of a clicked output - * to layer.feature.properties.popupContent - */ - function onEachFeatureSpatialUnit(feature, layer) { - // does this feature have a property named popupContent? - layer.on({ - click: function () { - - // var propertiesString = "
        " + JSON.stringify(feature.properties, null, ' ').replace(/[\{\}"]/g, '') + "
        "; - - var popupContent = '
        '; - for (var p in feature.properties) { - popupContent += ''; - } - popupContent += '
        ' + p + ''+ feature.properties[p] + '
        '; - - layer.bindPopup(popupContent); - - // if (propertiesString) - // layer.bindPopup(propertiesString); + /** + * binds the popup of a clicked output + * to layer.feature.properties.popupContent + */ + function onEachFeatureGeoresource(feature, layer) { + // does this feature have a property named popupContent? + layer.on({ + click: function () { + var popupContent = '
        '; + for (var p in feature.properties) { + popupContent += ''; + } + popupContent += '
        ' + p + '' + feature.properties[p] + '
        '; + layer.bindPopup(popupContent); + // var propertiesString = "
        " + JSON.stringify(feature.properties, null, ' ').replace(/[\{\}"]/g, '') + "
        "; + // if (propertiesString) + // layer.bindPopup(propertiesString); + } + }); } - }); - } - - /** - * binds the popup of a clicked output - * to layer.feature.properties.popupContent - */ - function onEachFeatureGeoresource(feature, layer) { - // does this feature have a property named popupContent? - layer.on({ - click: function () { - - var popupContent = '
        '; - for (var p in feature.properties) { - popupContent += ''; - } - popupContent += '
        ' + p + ''+ feature.properties[p] + '
        '; - - layer.bindPopup(popupContent); - - // var propertiesString = "
        " + JSON.stringify(feature.properties, null, ' ').replace(/[\{\}"]/g, '') + "
        "; - - // if (propertiesString) - // layer.bindPopup(propertiesString); + /** + * binds the popup of a clicked output + * to layer.feature.properties.popupContent + */ + function onEachFeatureIndicator(feature, layer) { + var indicatorValue = feature.properties[INDICATOR_DATE_PREFIX + $scope.date]; + var indicatorValueText; + if (kommonitorDataExchangeService.indicatorValueIsNoData(indicatorValue)) { + indicatorValueText = "NoData"; + } + else { + indicatorValueText = kommonitorDataExchangeService.getIndicatorValue_asFormattedText(indicatorValue); + } + var tooltipHtml = "" + feature.properties[__env.FEATURE_NAME_PROPERTY_NAME] + "
        " + indicatorValueText + " [" + kommonitorDataExchangeService.selectedIndicator.unit + "]"; + layer.bindTooltip(tooltipHtml, { + sticky: false // If true, the tooltip will follow the mouse instead of being fixed at the feature center. + }); + layer.on({ + mouseover: highlightFeature, + mouseout: resetHighlight, + click: function () { + switchHighlightFeature(layer); + } + }); } - }); - } - - /** - * binds the popup of a clicked output - * to layer.feature.properties.popupContent - */ - function onEachFeatureIndicator(feature, layer) { - var indicatorValue = feature.properties[INDICATOR_DATE_PREFIX + $scope.date]; - var indicatorValueText; - if (kommonitorDataExchangeService.indicatorValueIsNoData(indicatorValue)) { - indicatorValueText = "NoData"; - } - else { - indicatorValueText = kommonitorDataExchangeService.getIndicatorValue_asFormattedText(indicatorValue); - } - var tooltipHtml = "" + feature.properties[__env.FEATURE_NAME_PROPERTY_NAME] + "
        " + indicatorValueText + " [" + kommonitorDataExchangeService.selectedIndicator.unit + "]"; - layer.bindTooltip(tooltipHtml, { - sticky: false // If true, the tooltip will follow the mouse instead of being fixed at the feature center. - }); - layer.on({ - mouseover: highlightFeature, - mouseout: resetHighlight, - click: function () { - switchHighlightFeature(layer); + function switchHighlightFeature(layer) { + // add or remove feature within a list of "clicked features" + // those shall be treated specially, i.e. keep being highlighted + if (!kommonitorFilterHelperService.featureIsCurrentlySelected(layer.feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { + kommonitorFilterHelperService.addFeatureToSelection(layer.feature); + highlightClickedFeature(layer); + } + else { + //remove from array + kommonitorFilterHelperService.removeFeatureFromSelection(layer.feature.properties[__env.FEATURE_ID_PROPERTY_NAME]); + resetHighlightClickedFeature(layer); + } } - }); - } - - - - function switchHighlightFeature(layer) { - // add or remove feature within a list of "clicked features" - // those shall be treated specially, i.e. keep being highlighted - if (!kommonitorFilterHelperService.featureIsCurrentlySelected(layer.feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { - kommonitorFilterHelperService.addFeatureToSelection(layer.feature); - highlightClickedFeature(layer); - } - - else { - //remove from array - kommonitorFilterHelperService.removeFeatureFromSelection(layer.feature.properties[__env.FEATURE_ID_PROPERTY_NAME]); - resetHighlightClickedFeature(layer); - } - } - - function onEachFeatureCustomIndicator(feature, layer) { - // does this feature have a property named popupContent? - layer.on({ - mouseover: highlightFeature, - mouseout: resetHighlightCustom, - click: function () { - - var popupContent = layer.feature.properties; - - if (popupContent) - layer.bindPopup("Indicator: " + JSON.stringify(popupContent)); + function onEachFeatureCustomIndicator(feature, layer) { + // does this feature have a property named popupContent? + layer.on({ + mouseover: highlightFeature, + mouseout: resetHighlightCustom, + click: function () { + var popupContent = layer.feature.properties; + if (popupContent) + layer.bindPopup("Indicator: " + JSON.stringify(popupContent)); + } + }); } - }); - } - - - $scope.$on("addSpatialUnitAsGeopackage", function (event) { - - console.log('addSpatialUnitAsGeopackage was called'); - - var layer = L.geoPackageFeatureLayer([], { - geoPackageUrl: './test1234.gpkg', - layerName: 'test1234', - style: function (feature) { - return { - color: "#F00", - weight: 1, - opacity: 1 - }; - }, - onEachFeature: onEachFeatureSpatialUnit - }); - - // layer.StyledLayerControl = { - // removable : true, - // visible : true - // }; - - $scope.layerControl.addOverlay(layer, "GeoPackage", { groupName: spatialUnitLayerGroupName }); - layer.addTo($scope.map); - $scope.updateSearchControl(); - - - }); - - $scope.$on("addSpatialUnitAsGeoJSON", function (event, spatialUnitMetadataAndGeoJSON, date) { - - console.log('addSpatialUnitAsGeoJSON was called'); - - // if ($scope.layers.overlays[spatialUnitMetadataAndGeoJSON.spatialUnitLevel]) { - // delete $scope.layers.overlays[spatialUnitMetadataAndGeoJSON.spatialUnitLevel]; - // - // console.log($scope.layers.overlays); - // } - - var layer = L.geoJSON(spatialUnitMetadataAndGeoJSON.geoJSON, { - style: function (feature) { - return { - color: "blue", - weight: 1, - opacity: 1 - }; - }, - onEachFeature: onEachFeatureSpatialUnit - }); - - // layer.StyledLayerControl = { - // removable : true, - // visible : true - // }; - - $scope.layerControl.addOverlay(layer, spatialUnitMetadataAndGeoJSON.spatialUnitLevel + "_" + date, spatialUnitLayerGroupName); - layer.addTo($scope.map); - $scope.updateSearchControl(); - - }); - - $scope.$on("addGeoresourceAsGeoJSON", function (event, georesourceMetadataAndGeoJSON, date) { - - var layer = L.geoJSON(georesourceMetadataAndGeoJSON.geoJSON, { - style: function (feature) { - return { - color: "red", - weight: 1, - opacity: 1 - }; - }, - onEachFeature: onEachFeatureGeoresource - }); - - // layer.StyledLayerControl = { - // removable : false, - // visible : true - // }; - - $scope.layerControl.addOverlay(layer, georesourceMetadataAndGeoJSON.datasetName + "_" + date, georesourceLayerGroupName); - layer.addTo($scope.map); - $scope.updateSearchControl(); - - $scope.map.invalidateSize(true); - }); - - $scope.$on("replaceIsochronesAsGeoJSON", function (event, geoJSON, transitMode, reachMode, cutOffValues, useMultipleStartPoints, dissolveIsochrones, speedInKilometersPerHour) { - - if ($scope.isochronesLayer) { - $scope.layerControl.removeLayer($scope.isochronesLayer); - $scope.map.removeLayer($scope.isochronesLayer); - } - - $scope.isochronesLayer = L.featureGroup(); - - $scope.isochroneReachMode = reachMode; - var cutOffUnitValue = "Meter"; - var reachModeValue = "Distanz"; - if (reachMode === "time") { - cutOffUnitValue = "Minuten"; - reachModeValue = "Zeit"; - } - - var transitModeValue = "Passant"; - switch (transitMode) { - case "buffer": - transitModeValue = "Puffer (Luftlinie)"; - break; - case "cycling-regular": - transitModeValue = "Fahrrad"; - break; - case "driving-car": - transitModeValue = "PKW"; - break; - case "wheelchair": - transitModeValue = "Barrierefrei"; - break; - default: - transitModeValue = "Passant"; - } - - kommonitorDataExchangeService.isochroneLegend = { - transitMode: transitModeValue, - reachMode: reachModeValue, - speedInKilometersPerHour: speedInKilometersPerHour, - colorValueEntries: [], - cutOffValues: cutOffValues, - cutOffUnit: cutOffUnitValue - }; - - if (cutOffValues.length === 0) { - return; - } - else if (cutOffValues.length === 1) { - kommonitorDataExchangeService.isochroneLegend.colorValueEntries = [{ - color: "green", - value: cutOffValues[0] - }]; - } - else if (cutOffValues.length === 2) { - kommonitorDataExchangeService.isochroneLegend.colorValueEntries = [{ - color: "yellow", - value: cutOffValues[1] - }, - { - color: "green", - value: cutOffValues[0] - }]; - } - else if (cutOffValues.length === 3) { - kommonitorDataExchangeService.isochroneLegend.colorValueEntries = [{ - color: "red", - value: cutOffValues[2] - }, - { - color: "yellow", - value: cutOffValues[1] - }, - { - color: "green", - value: cutOffValues[0] - }]; - } - else if (cutOffValues.length === 4) { - kommonitorDataExchangeService.isochroneLegend.colorValueEntries = [{ - color: "red", - value: cutOffValues[3] - }, - { - color: "orange", - value: cutOffValues[2] - }, - { - color: "yellow", - value: cutOffValues[1] - }, - { - color: "green", - value: cutOffValues[0] - }]; - } - else if (cutOffValues.length === 5) { - kommonitorDataExchangeService.isochroneLegend.colorValueEntries = [{ - color: "brown", - value: cutOffValues[4] - }, { - color: "red", - value: cutOffValues[3] - }, - { - color: "orange", - value: cutOffValues[2] - }, - { - color: "yellow", - value: cutOffValues[1] - }, - { - color: "green", - value: cutOffValues[0] - }]; - } - else { - kommonitorDataExchangeService.isochroneLegend.colorValueEntries = [{ - color: "brown", - value: cutOffValues[4] - }, { - color: "red", - value: cutOffValues[3] - }, - { - color: "orange", - value: cutOffValues[2] - }, - { - color: "yellow", - value: cutOffValues[1] - }, - { - color: "green", - value: cutOffValues[0] - }]; - } - - if (useMultipleStartPoints && dissolveIsochrones) { - // merge intersecting isochrones of same cutOffValue - - // execute it 3 times in order to dissolve multiple intersections - geoJSON = mergeIntersectingIsochrones(geoJSON); - geoJSON = mergeIntersectingIsochrones(geoJSON); - geoJSON = mergeIntersectingIsochrones(geoJSON); - } - - // sort features to ensure correct z-order of layers (begin with smallest isochrones) - geoJSON.features.sort((a, b) => a.properties.value - b.properties.value); - - for (var index = geoJSON.features.length - 1; index >= 0; index--) { - - var styleIndex = getStyleIndexForFeature(geoJSON.features[index], kommonitorDataExchangeService.isochroneLegend.colorValueEntries, reachMode); - - var style = { - color: kommonitorDataExchangeService.isochroneLegend.colorValueEntries[styleIndex].color, - weight: 1, - opacity: 0.4, - fillOpacity: 0.3 + $scope.$on("addSpatialUnitAsGeopackage", function (event) { + console.log('addSpatialUnitAsGeopackage was called'); + var layer = L.geoPackageFeatureLayer([], { + geoPackageUrl: './test1234.gpkg', + layerName: 'test1234', + style: function (feature) { + return { + color: "#F00", + weight: 1, + opacity: 1 + }; + }, + onEachFeature: onEachFeatureSpatialUnit + }); + // layer.StyledLayerControl = { + // removable : true, + // visible : true + // }; + $scope.layerControl.addOverlay(layer, "GeoPackage", { groupName: spatialUnitLayerGroupName }); + layer.addTo($scope.map); + $scope.updateSearchControl(); + }); + $scope.$on("addSpatialUnitAsGeoJSON", function (event, spatialUnitMetadataAndGeoJSON, date) { + console.log('addSpatialUnitAsGeoJSON was called'); + // if ($scope.layers.overlays[spatialUnitMetadataAndGeoJSON.spatialUnitLevel]) { + // delete $scope.layers.overlays[spatialUnitMetadataAndGeoJSON.spatialUnitLevel]; + // + // console.log($scope.layers.overlays); + // } + var layer = L.geoJSON(spatialUnitMetadataAndGeoJSON.geoJSON, { + style: function (feature) { + return { + color: "blue", + weight: 1, + opacity: 1 + }; + }, + onEachFeature: onEachFeatureSpatialUnit + }); + // layer.StyledLayerControl = { + // removable : true, + // visible : true + // }; + $scope.layerControl.addOverlay(layer, spatialUnitMetadataAndGeoJSON.spatialUnitLevel + "_" + date, spatialUnitLayerGroupName); + layer.addTo($scope.map); + $scope.updateSearchControl(); + }); + $scope.$on("addGeoresourceAsGeoJSON", function (event, georesourceMetadataAndGeoJSON, date) { + var layer = L.geoJSON(georesourceMetadataAndGeoJSON.geoJSON, { + style: function (feature) { + return { + color: "red", + weight: 1, + opacity: 1 + }; + }, + onEachFeature: onEachFeatureGeoresource + }); + // layer.StyledLayerControl = { + // removable : false, + // visible : true + // }; + $scope.layerControl.addOverlay(layer, georesourceMetadataAndGeoJSON.datasetName + "_" + date, georesourceLayerGroupName); + layer.addTo($scope.map); + $scope.updateSearchControl(); + $scope.map.invalidateSize(true); + }); + $scope.$on("replaceIsochronesAsGeoJSON", function (event, geoJSON, transitMode, reachMode, cutOffValues, useMultipleStartPoints, dissolveIsochrones, speedInKilometersPerHour) { + if ($scope.isochronesLayer) { + $scope.layerControl.removeLayer($scope.isochronesLayer); + $scope.map.removeLayer($scope.isochronesLayer); + } + $scope.isochronesLayer = L.featureGroup(); + $scope.isochroneReachMode = reachMode; + var cutOffUnitValue = "Meter"; + var reachModeValue = "Distanz"; + if (reachMode === "time") { + cutOffUnitValue = "Minuten"; + reachModeValue = "Zeit"; + } + var transitModeValue = "Passant"; + switch (transitMode) { + case "buffer": + transitModeValue = "Puffer (Luftlinie)"; + break; + case "cycling-regular": + transitModeValue = "Fahrrad"; + break; + case "driving-car": + transitModeValue = "PKW"; + break; + case "wheelchair": + transitModeValue = "Barrierefrei"; + break; + default: + transitModeValue = "Passant"; + } + kommonitorDataExchangeService.isochroneLegend = { + transitMode: transitModeValue, + reachMode: reachModeValue, + speedInKilometersPerHour: speedInKilometersPerHour, + colorValueEntries: [], + cutOffValues: cutOffValues, + cutOffUnit: cutOffUnitValue + }; + if (cutOffValues.length === 0) { + return; + } + else if (cutOffValues.length === 1) { + kommonitorDataExchangeService.isochroneLegend.colorValueEntries = [{ + color: "green", + value: cutOffValues[0] + }]; + } + else if (cutOffValues.length === 2) { + kommonitorDataExchangeService.isochroneLegend.colorValueEntries = [{ + color: "yellow", + value: cutOffValues[1] + }, + { + color: "green", + value: cutOffValues[0] + }]; + } + else if (cutOffValues.length === 3) { + kommonitorDataExchangeService.isochroneLegend.colorValueEntries = [{ + color: "red", + value: cutOffValues[2] + }, + { + color: "yellow", + value: cutOffValues[1] + }, + { + color: "green", + value: cutOffValues[0] + }]; + } + else if (cutOffValues.length === 4) { + kommonitorDataExchangeService.isochroneLegend.colorValueEntries = [{ + color: "red", + value: cutOffValues[3] + }, + { + color: "orange", + value: cutOffValues[2] + }, + { + color: "yellow", + value: cutOffValues[1] + }, + { + color: "green", + value: cutOffValues[0] + }]; + } + else if (cutOffValues.length === 5) { + kommonitorDataExchangeService.isochroneLegend.colorValueEntries = [{ + color: "brown", + value: cutOffValues[4] + }, { + color: "red", + value: cutOffValues[3] + }, + { + color: "orange", + value: cutOffValues[2] + }, + { + color: "yellow", + value: cutOffValues[1] + }, + { + color: "green", + value: cutOffValues[0] + }]; + } + else { + kommonitorDataExchangeService.isochroneLegend.colorValueEntries = [{ + color: "brown", + value: cutOffValues[4] + }, { + color: "red", + value: cutOffValues[3] + }, + { + color: "orange", + value: cutOffValues[2] + }, + { + color: "yellow", + value: cutOffValues[1] + }, + { + color: "green", + value: cutOffValues[0] + }]; + } + if (useMultipleStartPoints && dissolveIsochrones) { + // merge intersecting isochrones of same cutOffValue + // execute it 3 times in order to dissolve multiple intersections + geoJSON = mergeIntersectingIsochrones(geoJSON); + geoJSON = mergeIntersectingIsochrones(geoJSON); + geoJSON = mergeIntersectingIsochrones(geoJSON); + } + // sort features to ensure correct z-order of layers (begin with smallest isochrones) + geoJSON.features.sort((a, b) => a.properties.value - b.properties.value); + for (var index = geoJSON.features.length - 1; index >= 0; index--) { + var styleIndex = getStyleIndexForFeature(geoJSON.features[index], kommonitorDataExchangeService.isochroneLegend.colorValueEntries, reachMode); + var style = { + color: kommonitorDataExchangeService.isochroneLegend.colorValueEntries[styleIndex].color, + weight: 1, + opacity: 0.4, + fillOpacity: 0.3 + }; + L.geoJSON(geoJSON.features[index], { + style: style, + onEachFeature: function (feature, layer) { + layer.on({ + click: function () { + var isochroneValue = layer.feature.properties.value; + if ($scope.isochroneReachMode === "time") { + //transform seconds to minutes + isochroneValue = isochroneValue / 60; + } + var popupContent = "" + isochroneValue + " " + cutOffUnitValue; + // var popupContent = "TestValue"; + if (popupContent) + layer.bindPopup("Isochrone: " + JSON.stringify(popupContent)); + } + }); + } + }).addTo($scope.isochronesLayer); + } + // $scope.isochronesLayer.StyledLayerControl = { + // removable : false, + // visible : true + // }; + $scope.layerControl.addOverlay($scope.isochronesLayer, "Erreichbarkeits-Isochronen_" + transitModeValue, reachabilityLayerGroupName); + $scope.isochronesLayer.addTo($scope.map); + $scope.updateSearchControl(); + $scope.map.invalidateSize(true); + }); + $scope.$on("replaceRouteAsGeoJSON", function (event, geoJSON, transitMode, preference, routingStartPoint, routingEndPoint, routeDistance_km, routeDuration_minutes) { + if ($scope.routingLayer) { + $scope.layerControl.removeLayer($scope.routingLayer); + $scope.map.removeLayer($scope.routingLayer); + } + var preferenceValue = "Schnellste"; + if (preference === "recommended") { + preferenceValue = "Empfohlen"; + } + else if (preference === "shortest") { + preferenceValue = "Kürzeste"; + } + var transitModeValue = "Passant"; + switch (transitMode) { + case "cycling-regular": + transitModeValue = "Fahrrad"; + break; + case "driving-car": + transitModeValue = "PKW"; + break; + case "wheelchair": + transitModeValue = "Barrierefrei"; + break; + default: + transitModeValue = "Passant"; + } + /* + routeDistance_km, routeDuration_minutes, routeAvgSpeed_kmh, + routeTotalAscent, routeTotalDescent + */ + kommonitorDataExchangeService.routingLegend = { + transitMode: transitModeValue, + preference: preferenceValue, + routingStartPoint: routingStartPoint, + routingEndPoint: routingEndPoint, + routeDistance_km: routeDistance_km, + routeDuration_minutes: routeDuration_minutes + }; + var style = { + color: "#ed561a", + weight: 5, + opacity: 0.7 + }; + $scope.routingLayer = L.featureGroup(); + // start and end point + var customStartMarker = L.AwesomeMarkers.icon({ + icon: "home", + iconColor: "white", + markerColor: "green" + }); + var customEndMarker = L.AwesomeMarkers.icon({ + icon: "screenshot", + iconColor: "white", + markerColor: "red" + }); + var numPoints = geoJSON.features[0].geometry.coordinates.length; + var startPoint = geoJSON.features[0].geometry.coordinates[0]; + var endPoint = geoJSON.features[0].geometry.coordinates[numPoints - 1]; + L.marker([startPoint[1], startPoint[0]], { icon: customStartMarker }).bindPopup(routingStartPoint.label).addTo($scope.routingLayer); + L.marker([endPoint[1], endPoint[0]], { icon: customEndMarker }).bindPopup(routingEndPoint.label).addTo($scope.routingLayer); + L.geoJSON(geoJSON, { + style: style, + onEachFeature: function (feature, layer) { + layer.on({ + click: function () { + var popupContent = "Routing Ergebnis - " + transitModeValue + " - " + preferenceValue; + // var popupContent = "TestValue"; + if (popupContent) + layer.bindPopup(JSON.stringify(popupContent)); + } + }); + } + }).addTo($scope.routingLayer); + // $scope.isochronesLayer.StyledLayerControl = { + // removable : false, + // visible : true + // }; + $scope.layerControl.addOverlay($scope.routingLayer, "Routing-Ergebnis_" + transitModeValue + "_" + preferenceValue, reachabilityLayerGroupName); + $scope.routingLayer.addTo($scope.map); + $scope.map.fitBounds($scope.routingLayer.getBounds()); + $scope.updateSearchControl(); + $scope.map.invalidateSize(true); + }); + var getStyleIndexForFeature = function (feature, colorValueEntries, reachMode) { + var index = 0; + var featureCutOffValue = feature.properties.value; + if (reachMode === "time") { + // answe has time in seconds - we expect minutes! + featureCutOffValue = featureCutOffValue / 60; + } + for (var i = 0; i < colorValueEntries.length; i++) { + if (featureCutOffValue === colorValueEntries[i].value) { + index = i; + break; + } + } + return index; }; - - L.geoJSON(geoJSON.features[index], { - style: style, - onEachFeature: function (feature, layer) { - layer.on({ - click: function () { - - var isochroneValue = layer.feature.properties.value; - - if ($scope.isochroneReachMode === "time") { - //transform seconds to minutes - isochroneValue = isochroneValue / 60; - } - var popupContent = "" + isochroneValue + " " + cutOffUnitValue; - // var popupContent = "TestValue"; - - if (popupContent) - layer.bindPopup("Isochrone: " + JSON.stringify(popupContent)); - } + var mergeIntersectingIsochrones = function (geoJSON) { + // use turf to dissolve any overlapping/intersecting isochrones that have the same cutOffValue! + try { + var dissolved = turf.dissolve(geoJSON, { propertyName: 'value' }); + return dissolved; + } + catch (e) { + console.error("Dissolving Isochrones failed with error: " + e); + console.error("Will return undissolved isochrones"); + return geoJSON; + } + finally { + } + }; + $scope.$on("replaceIsochroneMarker", function (event, lonLatArray) { + if ($scope.isochroneMarkerLayer) { + $scope.layerControl.removeLayer($scope.isochroneMarkerLayer); + $scope.map.removeLayer($scope.isochroneMarkerLayer); + } + $scope.isochroneMarkerLayer = L.featureGroup(); + lonLatArray.forEach(function (lonLat) { + var layer = L.marker([lonLat[1], lonLat[0]]); + layer.bindPopup("Startpunkt der Isochronenberechnung"); + layer.addTo($scope.isochroneMarkerLayer); + }); + $scope.layerControl.addOverlay($scope.isochroneMarkerLayer, "Startpunkte für Isochronenberechnung", reachabilityLayerGroupName); + $scope.isochroneMarkerLayer.addTo($scope.map); + $scope.updateSearchControl(); + $scope.map.invalidateSize(true); + }); + var createCustomMarkersFromWfsPoints = function (wfsLayer, poiMarkerLayer, dataset) { + for (var layerPropName in wfsLayer._layers) { + var geoJSONFeature = wfsLayer._layers[layerPropName].feature; + var latlng = wfsLayer._layers[layerPropName]._latlng; + geoJSONFeature.geometry = { + type: "Point", + coordinates: [latlng.lng, latlng.lat] + }; + var customMarker = createCustomMarker(geoJSONFeature, dataset.poiSymbolColor, dataset.poiMarkerColor, dataset.poiSymbolBootstrap3Name, dataset); + poiMarkerLayer = addPoiMarker(poiMarkerLayer, customMarker); + } + return poiMarkerLayer; + }; + var createCustomMarker = function (poiFeature, poiSymbolColor, poiMarkerColor, poiSymbolBootstrap3Name, metadataObject) { + var customMarker; + try { + customMarker = L.AwesomeMarkers.icon({ + icon: poiSymbolBootstrap3Name, + iconColor: poiSymbolColor, + markerColor: poiMarkerColor + }); + } + catch (err) { + customMarker = L.AwesomeMarkers.icon({ + icon: 'home', + iconColor: poiSymbolColor, + markerColor: poiMarkerColor + }); + } + var newMarker; + if (poiFeature.geometry.type === "Point") { + // LAT LON order + newMarker = L.marker([Number(poiFeature.geometry.coordinates[1]), Number(poiFeature.geometry.coordinates[0])], { icon: customMarker }); + //populate the original geoJSOn feature to the marker layer! + newMarker.feature = poiFeature; + newMarker.metadataObject = metadataObject; + } + else if (poiFeature.geometry.type === "MultiPoint") { + // simply take the first point as feature reference POI + // LAT LON order + newMarker = L.marker([Number(poiFeature.geometry.coordinates[0][1]), Number(poiFeature.geometry.coordinates[0][0])], { icon: customMarker }); + //populate the original geoJSOn feature to the marker layer! + newMarker.feature = poiFeature; + newMarker.metadataObject = metadataObject; + } + else { + console.error("NO POI object: instead got feature of type " + poiFeature.geometry.type); + } + return newMarker; + }; + $scope.$on("addPoiGeoresourceAsGeoJSON", function (event, georesourceMetadataAndGeoJSON, date, useCluster) { + // use leaflet.markercluster to cluster markers! + var markers; + if (useCluster) { + markers = L.markerClusterGroup({ + iconCreateFunction: function (cluster) { + var childCount = cluster.getChildCount(); + var c = 'cluster-'; + if (childCount < 10) { + c += 'small'; + } + else if (childCount < 30) { + c += 'medium'; + } + else { + c += 'large'; + } + var className = "marker-cluster " + c + " awesome-marker-legend-TransparentIcon-" + georesourceMetadataAndGeoJSON.poiMarkerColor; + //'marker-cluster' + c + ' ' + + return new L.DivIcon({ html: '
        ' + childCount + '
        ', className: className, iconSize: new L.Point(40, 40) }); + } + }); + } + else { + markers = L.layerGroup(); + } + georesourceMetadataAndGeoJSON.geoJSON.features.forEach(function (poiFeature) { + // index 0 should be longitude and index 1 should be latitude + //.bindPopup( poiFeature.properties.name ) + var newMarker = createCustomMarker(poiFeature, georesourceMetadataAndGeoJSON.poiSymbolColor, georesourceMetadataAndGeoJSON.poiMarkerColor, georesourceMetadataAndGeoJSON.poiSymbolBootstrap3Name, georesourceMetadataAndGeoJSON); + markers = addPoiMarker(markers, newMarker); + }); + // markers.StyledLayerControl = { + // removable : false, + // visible : true + // }; + $scope.layerControl.addOverlay(markers, georesourceMetadataAndGeoJSON.datasetName + "_" + date, poiLayerGroupName); + markers.addTo($scope.map); + $scope.updateSearchControl(); + // $scope.map.addLayer( markers ); + $scope.map.invalidateSize(true); + }); + $scope.$on("addPoiGeoresourceAsGeoJSON_reachabilityAnalysis", function (event, georesourceMetadataAndGeoJSON, date, useCluster) { + // use leaflet.markercluster to cluster markers! + var markers; + if (useCluster) { + markers = L.markerClusterGroup({ + iconCreateFunction: function (cluster) { + var childCount = cluster.getChildCount(); + var c = 'cluster-'; + if (childCount < 10) { + c += 'small'; + } + else if (childCount < 30) { + c += 'medium'; + } + else { + c += 'large'; + } + var className = "marker-cluster " + c + " awesome-marker-legend-TransparentIcon-" + georesourceMetadataAndGeoJSON.poiMarkerColor; + //'marker-cluster' + c + ' ' + + return new L.DivIcon({ html: '
        ' + childCount + '
        ', className: className, iconSize: new L.Point(40, 40) }); + } + }); + } + else { + markers = L.layerGroup(); + } + georesourceMetadataAndGeoJSON.geoJSON.features.forEach(function (poiFeature) { + // index 0 should be longitude and index 1 should be latitude + //.bindPopup( poiFeature.properties.name ) + var newMarker = createCustomMarker(poiFeature, georesourceMetadataAndGeoJSON.poiSymbolColor, georesourceMetadataAndGeoJSON.poiMarkerColor, georesourceMetadataAndGeoJSON.poiSymbolBootstrap3Name, georesourceMetadataAndGeoJSON); + markers = addPoiMarker(markers, newMarker); + }); + // markers.StyledLayerControl = { + // removable : false, + // visible : true + // }; + $scope.layerControl.addOverlay(markers, georesourceMetadataAndGeoJSON.datasetName + "_" + date + "_inEinzugsgebiet", reachabilityLayerGroupName); + markers.addTo($scope.map); + $scope.updateSearchControl(); + // $scope.map.addLayer( markers ); + $scope.map.invalidateSize(true); + }); + var addPoiMarker = function (markers, poiMarker) { + // var propertiesString = "
        " + JSON.stringify(poiMarker.feature.properties, null, ' ').replace(/[\{\}"]/g, '') + "
        "; + var popupContent = '
        '; + for (var p in poiMarker.feature.properties) { + popupContent += ''; + } + popupContent += '
        ' + p + '' + poiMarker.feature.properties[p] + '
        '; + if (poiMarker.feature.properties.name) { + poiMarker.bindPopup(poiMarker.feature.properties.name + "\n\n" + popupContent); + } + else if (poiMarker.feature.properties.NAME) { + poiMarker.bindPopup(poiMarker.feature.properties.NAME + "\n\n" + popupContent); + } + else if (poiMarker.feature.properties[__env.FEATURE_NAME_PROPERTY_NAME]) { + poiMarker.bindPopup(poiMarker.feature.properties[__env.FEATURE_NAME_PROPERTY_NAME] + "\n\n" + popupContent); + } + else { + // poiMarker.bindPopup(propertiesString); + poiMarker.bindPopup(popupContent); + } + markers.addLayer(poiMarker); + return markers; + }; + $scope.$on("removePoiGeoresource", function (event, georesourceMetadataAndGeoJSON) { + var layerName = georesourceMetadataAndGeoJSON.datasetName; + $scope.layerControl._layers.forEach(function (layer) { + if (layer.group.name === poiLayerGroupName && layer.name.includes(layerName + "_")) { + $scope.layerControl.removeLayer(layer.layer); + $scope.map.removeLayer(layer.layer); + $scope.updateSearchControl(); + } + }); + }); + $scope.$on("removePoiGeoresource_reachabilityAnalysis", function (event, georesourceMetadataAndGeoJSON) { + var layerName = georesourceMetadataAndGeoJSON.datasetName; + $scope.layerControl._layers.forEach(function (layer) { + if (layer.group.name === reachabilityLayerGroupName && layer.name.includes(layerName + "_")) { + $scope.layerControl.removeLayer(layer.layer); + $scope.map.removeLayer(layer.layer); + $scope.updateSearchControl(); + } + }); + }); + $scope.$on("addAoiGeoresourceAsGeoJSON", function (event, georesourceMetadataAndGeoJSON, date) { + var color = georesourceMetadataAndGeoJSON.aoiColor; + var layer = L.geoJSON(georesourceMetadataAndGeoJSON.geoJSON, { + style: function (feature) { + return { + fillColor: color, + color: "black", + weight: 1, + opacity: 1, + fillOpacity: 0.7 + }; + }, + onEachFeature: onEachFeatureGeoresource + }); + // layer.StyledLayerControl = { + // removable : false, + // visible : true + // }; + $scope.layerControl.addOverlay(layer, georesourceMetadataAndGeoJSON.datasetName + "_" + date, aoiLayerGroupName); + layer.addTo($scope.map); + $scope.updateSearchControl(); + $scope.map.invalidateSize(true); + }); + $scope.$on("removeAoiGeoresource", function (event, georesourceMetadataAndGeoJSON) { + var layerName = georesourceMetadataAndGeoJSON.datasetName; + $scope.layerControl._layers.forEach(function (layer) { + if (layer.group.name === aoiLayerGroupName && layer.name.includes(layerName + "_")) { + $scope.layerControl.removeLayer(layer.layer); + $scope.map.removeLayer(layer.layer); + $scope.updateSearchControl(); + } + }); + }); + $scope.$on("addLoiGeoresourceAsGeoJSON", function (event, georesourceMetadataAndGeoJSON, date) { + var color = georesourceMetadataAndGeoJSON.aoiColor; + var featureGroup = L.featureGroup(); + var style = { + color: georesourceMetadataAndGeoJSON.loiColor, + dashArray: georesourceMetadataAndGeoJSON.loiDashArrayString, + weight: georesourceMetadataAndGeoJSON.loiWidth || 3, + opacity: 1 + }; + georesourceMetadataAndGeoJSON.geoJSON.features.forEach((item, i) => { + var type = item.geometry.type; + if (type === "Polygon" || type === "MultiPolygon") { + var lines = turf.polygonToLine(item); + L.geoJSON(lines, { + style: style, + onEachFeature: onEachFeatureGeoresource + }).addTo(featureGroup); + } + else { + L.geoJSON(item, { + style: style, + onEachFeature: onEachFeatureGeoresource + }).addTo(featureGroup); + } + }); + // georesourceMetadataAndGeoJSON.geoJSON.features.forEach((loiFeature, i) => { + // var latLngs = + // var polyline = L.polyline(loiFeature.geometry.coordinates); + // + // var geoJSON = polyline.toGeoJSON(); + // + // var geoJSON_line = L.geoJSON(geoJSON, { + // style: style, + // onEachFeature: onEachFeatureGeoresource + // }) + // + // geoJSON_line.addTo(featureGroup); + // }); + // layer.StyledLayerControl = { + // removable : false, + // visible : true + // }; + $scope.layerControl.addOverlay(featureGroup, georesourceMetadataAndGeoJSON.datasetName + "_" + date, loiLayerGroupName); + featureGroup.addTo($scope.map); + $scope.updateSearchControl(); + $scope.map.invalidateSize(true); + }); + $scope.$on("removeLoiGeoresource", function (event, georesourceMetadataAndGeoJSON) { + var layerName = georesourceMetadataAndGeoJSON.datasetName; + $scope.layerControl._layers.forEach(function (layer) { + if (layer.group.name === loiLayerGroupName && layer.name.includes(layerName + "_")) { + $scope.layerControl.removeLayer(layer.layer); + $scope.map.removeLayer(layer.layer); + $scope.updateSearchControl(); + } + }); + }); + $scope.$on("adjustOpacityForIndicatorLayer", function (event, indicatorMetadata, opacity) { + // var layerName = indicatorMetadataAndGeoJSON.indicatorName; + // + // $scope.layerControl._layers.forEach(function(layer){ + // if(layer.group.name === indicatorLayerGroupName && layer.name.includes(layerName)){ + // layer.layer.setOpacity(opacity); + // layer.layer.setStyle({ + // opacity: opacity + // }); + // } + // }); + opacity = opacity.toFixed(numberOfDecimals); + kommonitorVisualStyleHelperService.setOpacity(opacity); + $rootScope.$broadcast("restyleCurrentLayer", true); + }); + $scope.$on("addWmsLayerToMap", function (event, dataset, opacity) { + var wmsLayer = L.tileLayer.betterWms(dataset.url, { + layers: dataset.layerName, + transparent: true, + format: 'image/png', + minZoom: __env.minZoomLevel, + maxZoom: __env.maxZoomLevel, + opacity: opacity + }); + $scope.layerControl.addOverlay(wmsLayer, dataset.title, wmsLayerGroupName); + wmsLayer.addTo($scope.map); + $scope.updateSearchControl(); + $scope.map.invalidateSize(true); + }); + $scope.$on("adjustOpacityForWmsLayer", function (event, dataset, opacity) { + var layerName = dataset.title; + $scope.layerControl._layers.forEach(function (layer) { + if (layer.group.name === wmsLayerGroupName && layer.name.includes(layerName)) { + layer.layer.setOpacity(opacity); + } + }); + }); + $scope.$on("adjustOpacityForAoiLayer", function (event, dataset, opacity) { + var layerName = dataset.datasetName; + $scope.layerControl._layers.forEach(function (layer) { + if (layer.group.name === aoiLayerGroupName && layer.name.includes(layerName)) { + layer.layer.setStyle({ + fillOpacity: opacity, + opacity: opacity + }); + } + }); + }); + $scope.$on("adjustOpacityForLoiLayer", function (event, dataset, opacity) { + var layerName = dataset.datasetName; + $scope.layerControl._layers.forEach(function (layer) { + if (layer.group.name === loiLayerGroupName && layer.name.includes(layerName)) { + layer.layer.setStyle({ + fillOpacity: opacity, + opacity: opacity + }); + } + }); + }); + $scope.$on("adjustOpacityForPoiLayer", function (event, dataset, opacity) { + var layerName = dataset.datasetName; + $scope.layerControl._layers.forEach(function (layer) { + if (layer.group.name === poiLayerGroupName && layer.name.includes(layerName)) { + if (layer.layer._layers) { + for (var layerId in layer.layer._layers) { + layer.layer._layers[layerId].setOpacity(opacity); + } + } + else if (layer.layer._featureGroup) { + for (var layerId in layer.layer._featureGroup._layers) { + layer.layer._featureGroup._layers[layerId].setOpacity(opacity); + } + } + else { + layer.layer.setOpacity(opacity); + } + } + }); + }); + $scope.$on("removeWmsLayerFromMap", function (event, dataset) { + var layerName = dataset.title; + $scope.layerControl._layers.forEach(function (layer) { + if (layer.group.name === wmsLayerGroupName && layer.name.includes(layerName)) { + $scope.layerControl.removeLayer(layer.layer); + $scope.map.removeLayer(layer.layer); + } + }); + }); + var getWfsStyle = function (dataset, opacity) { + if (dataset.geometryType === "POI") { + return { + weight: 1, + opacity: opacity, + color: dataset.poiMarkerColor, + dashArray: '', + fillOpacity: opacity, + fillColor: dataset.poiMarkerColor + }; + } + else if (dataset.geometryType === "LOI") { + return { + weight: dataset.loiWidth, + opacity: opacity, + color: dataset.loiColor, + dashArray: dataset.loiDashArrayString, + fillOpacity: opacity, + fillColor: dataset.loiColor + }; + } + else { + return { + weight: 1, + opacity: opacity, + color: dataset.aoiColor, + dashArray: '', + fillOpacity: opacity, + fillColor: dataset.aoiColor + }; + } + }; + $scope.getFilterEncoding = function (dataset) { + var filterExpressions = []; + if (dataset.filterEncoding.PropertyIsEqualTo && dataset.filterEncoding.PropertyIsEqualTo.propertyName && dataset.filterEncoding.PropertyIsEqualTo.propertyValue) { + filterExpressions.push(new L.Filter.EQ(dataset.filterEncoding.PropertyIsEqualTo.propertyName, dataset.filterEncoding.PropertyIsEqualTo.propertyValue)); + } + if (dataset.filterFeaturesToMapBBOX) { + filterExpressions.push(new L.Filter.BBox(dataset.featureTypeGeometryName, $scope.map.getBounds(), L.CRS.EPSG3857)); + } + if (filterExpressions.length == 0) { + return undefined; + } + if (filterExpressions.length < 2) { + return filterExpressions; + } + else { + // var stringifiedFilterExpressions = []; + // for (const filterExpr of filterExpressions) { + // stringifiedFilterExpressions.push(L.XmlUtil.serializeXmlDocumentString(filterExpr.toGml())); + // } + // return new L.Filter.And(...stringifiedFilterExpressions); + return new L.Filter.And(...filterExpressions); + } + }; + $scope.$on("addWfsLayerToMap", function (event, dataset, opacity, useCluster) { + var wfsLayerOptions = { + url: dataset.url, + typeNS: dataset.featureTypeNamespace, + namespaceUri: "http://mapserver.gis.umn.edu/mapserver", + typeName: dataset.featureTypeName, + geometryField: dataset.featureTypeGeometryName, + // maxFeatures: null, + style: getWfsStyle(dataset, opacity) + }; + var filterEncoding = $scope.getFilterEncoding(dataset); + if (filterEncoding) { + wfsLayerOptions.filter = filterEncoding; + } + var wfsLayer; + var poiMarkerLayer; + if (dataset.geometryType === "POI") { + if (useCluster) { + poiMarkerLayer = L.markerClusterGroup({ + iconCreateFunction: function (cluster) { + var childCount = cluster.getChildCount(); + var c = 'cluster-'; + if (childCount < 10) { + c += 'small'; + } + else if (childCount < 30) { + c += 'medium'; + } + else { + c += 'large'; + } + var className = "marker-cluster " + c + " awesome-marker-legend-TransparentIcon-" + dataset.poiMarkerColor; + //'marker-cluster' + c + ' ' + + return new L.DivIcon({ html: '
        ' + childCount + '
        ', className: className, iconSize: new L.Point(40, 40) }); + } + }); + } + else { + poiMarkerLayer = L.layerGroup(); + } + wfsLayer = new L.WFS(wfsLayerOptions); + } + else { + wfsLayer = new L.WFS(wfsLayerOptions); + } + try { + wfsLayer.once('load', function () { + if (dataset.geometryType === "POI") { + poiMarkerLayer = createCustomMarkersFromWfsPoints(wfsLayer, poiMarkerLayer, dataset); + } + console.log("Try to fit bounds on wfsLayer"); + $scope.map.fitBounds(wfsLayer.getBounds()); + console.log("Tried fit bounds on wfsLayer"); + $scope.map.invalidateSize(true); + // $scope.loadingData = false; + }); + wfsLayer.on('click', function (event) { + // var propertiesString = "
        " + JSON.stringify(event.layer.feature.properties, null, ' ').replace(/[\{\}"]/g, '') + "
        "; + var popupContent = '
        '; + for (var p in event.layer.feature.properties) { + popupContent += ''; + } + popupContent += '
        ' + p + '' + event.layer.feature.properties[p] + '
        '; + var popup = L.popup(); + popup + .setLatLng(event.latlng) + .setContent(popupContent) + .openOn($scope.map); + }); + if (poiMarkerLayer) { + $scope.layerControl.addOverlay(poiMarkerLayer, dataset.title, wfsLayerGroupName); + poiMarkerLayer.addTo($scope.map); + } + else { + $scope.layerControl.addOverlay(wfsLayer, dataset.title, wfsLayerGroupName); + wfsLayer.addTo($scope.map); + } + $scope.updateSearchControl(); + } + catch (error) { + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + } + }); + $scope.$on("adjustOpacityForWfsLayer", function (event, dataset, opacity) { + var layerName = dataset.title; + $scope.layerControl._layers.forEach(function (layer) { + if (layer.group.name === wfsLayerGroupName && layer.name.includes(layerName)) { + // layer.layer.setOpacity(opacity); + var newStyle = getWfsStyle(dataset, opacity); + // layer.layer.options.style = newStyle; + if (layer.layer._layers) { + for (var layerId in layer.layer._layers) { + if (dataset.geometryType === "POI") { + layer.layer._layers[layerId].setOpacity(opacity); + } + else { + layer.layer._layers[layerId].setStyle(newStyle); + } + } + } + else { + if (dataset.geometryType === "POI") { + layer.layer.setOpacity(opacity); + } + else { + layer.layer.setStyle(newStyle); + } + } + } }); - } - }).addTo($scope.isochronesLayer); - } - - // $scope.isochronesLayer.StyledLayerControl = { - // removable : false, - // visible : true - // }; - - $scope.layerControl.addOverlay($scope.isochronesLayer, "Erreichbarkeits-Isochronen_" + transitModeValue, reachabilityLayerGroupName); - $scope.isochronesLayer.addTo($scope.map); - $scope.updateSearchControl(); - - $scope.map.invalidateSize(true); - }); - - $scope.$on("replaceRouteAsGeoJSON", function (event, geoJSON, transitMode, preference, routingStartPoint, routingEndPoint, - routeDistance_km, routeDuration_minutes) { - - if ($scope.routingLayer) { - $scope.layerControl.removeLayer($scope.routingLayer); - $scope.map.removeLayer($scope.routingLayer); - } - - var preferenceValue = "Schnellste"; - if (preference === "recommended") { - preferenceValue = "Empfohlen"; - } - else if (preference === "shortest") { - preferenceValue = "Kürzeste"; - } - - var transitModeValue = "Passant"; - switch (transitMode) { - case "cycling-regular": - transitModeValue = "Fahrrad"; - break; - case "driving-car": - transitModeValue = "PKW"; - break; - case "wheelchair": - transitModeValue = "Barrierefrei"; - break; - default: - transitModeValue = "Passant"; - } - - /* - routeDistance_km, routeDuration_minutes, routeAvgSpeed_kmh, - routeTotalAscent, routeTotalDescent - */ - - kommonitorDataExchangeService.routingLegend = { - transitMode: transitModeValue, - preference: preferenceValue, - routingStartPoint: routingStartPoint, - routingEndPoint: routingEndPoint, - routeDistance_km: routeDistance_km, - routeDuration_minutes: routeDuration_minutes - }; - - var style = { - color: "#ed561a", - weight: 5, - opacity: 0.7 - }; - - $scope.routingLayer = L.featureGroup(); - - // start and end point - var customStartMarker = L.AwesomeMarkers.icon({ - icon: "home", - iconColor: "white", - markerColor: "green" - }); - - var customEndMarker = L.AwesomeMarkers.icon({ - icon: "screenshot", - iconColor: "white", - markerColor: "red" - }); - - var numPoints = geoJSON.features[0].geometry.coordinates.length; - var startPoint = geoJSON.features[0].geometry.coordinates[0]; - var endPoint = geoJSON.features[0].geometry.coordinates[numPoints - 1]; - - L.marker([startPoint[1], startPoint[0]], { icon: customStartMarker }).bindPopup(routingStartPoint.label).addTo($scope.routingLayer); - L.marker([endPoint[1], endPoint[0]], { icon: customEndMarker }).bindPopup(routingEndPoint.label).addTo($scope.routingLayer); - - L.geoJSON(geoJSON, { - style: style, - onEachFeature: function (feature, layer) { - layer.on({ - click: function () { - var popupContent = "Routing Ergebnis - " + transitModeValue + " - " + preferenceValue; - // var popupContent = "TestValue"; - - if (popupContent) - layer.bindPopup(JSON.stringify(popupContent)); - } - }); - } - }).addTo($scope.routingLayer); - - // $scope.isochronesLayer.StyledLayerControl = { - // removable : false, - // visible : true - // }; - - $scope.layerControl.addOverlay($scope.routingLayer, "Routing-Ergebnis_" + transitModeValue + "_" + preferenceValue, reachabilityLayerGroupName); - $scope.routingLayer.addTo($scope.map); - $scope.map.fitBounds($scope.routingLayer.getBounds()); - $scope.updateSearchControl(); - - $scope.map.invalidateSize(true); - }); - - var getStyleIndexForFeature = function (feature, colorValueEntries, reachMode) { - var index = 0; - var featureCutOffValue = feature.properties.value; - - if (reachMode === "time") { - // answe has time in seconds - we expect minutes! - featureCutOffValue = featureCutOffValue / 60; - } - - for (var i = 0; i < colorValueEntries.length; i++) { - if (featureCutOffValue === colorValueEntries[i].value) { - index = i; - break; - } - } - - return index; - }; - - var mergeIntersectingIsochrones = function (geoJSON) { - // use turf to dissolve any overlapping/intersecting isochrones that have the same cutOffValue! - - try { - var dissolved = turf.dissolve(geoJSON, { propertyName: 'value' }); - - return dissolved; - } catch (e) { - console.error("Dissolving Isochrones failed with error: " + e); - console.error("Will return undissolved isochrones"); - return geoJSON; - } finally { - - } - - }; - - $scope.$on("replaceIsochroneMarker", function (event, lonLatArray) { - - if ($scope.isochroneMarkerLayer) { - $scope.layerControl.removeLayer($scope.isochroneMarkerLayer); - $scope.map.removeLayer($scope.isochroneMarkerLayer); - } - - $scope.isochroneMarkerLayer = L.featureGroup(); - - lonLatArray.forEach(function (lonLat) { - var layer = L.marker([lonLat[1], lonLat[0]]); - layer.bindPopup("Startpunkt der Isochronenberechnung"); - layer.addTo($scope.isochroneMarkerLayer); - }); - - $scope.layerControl.addOverlay($scope.isochroneMarkerLayer, "Startpunkte für Isochronenberechnung", reachabilityLayerGroupName); - $scope.isochroneMarkerLayer.addTo($scope.map); - $scope.updateSearchControl(); - - $scope.map.invalidateSize(true); - }); - - var createCustomMarkersFromWfsPoints = function(wfsLayer, poiMarkerLayer, dataset){ - for (var layerPropName in wfsLayer._layers){ - var geoJSONFeature = wfsLayer._layers[layerPropName].feature; - var latlng = wfsLayer._layers[layerPropName]._latlng; - - geoJSONFeature.geometry = { - type: "Point", - coordinates: [latlng.lng, latlng.lat] - }; - - var customMarker = createCustomMarker(geoJSONFeature, dataset.poiSymbolColor, dataset.poiMarkerColor, dataset.poiSymbolBootstrap3Name, dataset); - poiMarkerLayer = addPoiMarker(poiMarkerLayer, customMarker); - } - - return poiMarkerLayer; - }; - - var createCustomMarker = function(poiFeature, poiSymbolColor, poiMarkerColor, poiSymbolBootstrap3Name, metadataObject){ - var customMarker; - try { - customMarker = L.AwesomeMarkers.icon({ - icon: poiSymbolBootstrap3Name, - iconColor: poiSymbolColor, - markerColor: poiMarkerColor }); - } catch (err) { - customMarker = L.AwesomeMarkers.icon({ - icon: 'home', // default back to home - iconColor: poiSymbolColor, - markerColor: poiMarkerColor + $scope.$on("adjustColorForWfsLayer", function (event, dataset, opacity) { + var layerName = dataset.title; + $scope.layerControl._layers.forEach(function (layer) { + if (layer.group.name === wfsLayerGroupName && layer.name.includes(layerName)) { + var newStyle = getWfsStyle(dataset, opacity); + layer.layer.setStyle(newStyle); + } + }); }); - } - - var newMarker; - - if(poiFeature.geometry.type === "Point"){ - // LAT LON order - newMarker = L.marker([Number(poiFeature.geometry.coordinates[1]), Number(poiFeature.geometry.coordinates[0])], { icon: customMarker }); - - //populate the original geoJSOn feature to the marker layer! - newMarker.feature = poiFeature; - newMarker.metadataObject = metadataObject; - } - else if (poiFeature.geometry.type === "MultiPoint"){ - - // simply take the first point as feature reference POI - // LAT LON order - newMarker = L.marker([Number(poiFeature.geometry.coordinates[0][1]), Number(poiFeature.geometry.coordinates[0][0])], { icon: customMarker }); - - //populate the original geoJSOn feature to the marker layer! - newMarker.feature = poiFeature; - newMarker.metadataObject = metadataObject; - } - else{ - console.error("NO POI object: instead got feature of type " + poiFeature.geometry.type); - } - - return newMarker; - - }; - - $scope.$on("addPoiGeoresourceAsGeoJSON", function (event, georesourceMetadataAndGeoJSON, date, useCluster) { - - // use leaflet.markercluster to cluster markers! - var markers; - if (useCluster) { - markers = L.markerClusterGroup({ - iconCreateFunction: function (cluster) { - var childCount = cluster.getChildCount(); - - var c = 'cluster-'; - if (childCount < 10) { - c += 'small'; - } else if (childCount < 30) { - c += 'medium'; - } else { - c += 'large'; - } - - var className = "marker-cluster " + c + " awesome-marker-legend-TransparentIcon-" + georesourceMetadataAndGeoJSON.poiMarkerColor; - - //'marker-cluster' + c + ' ' + - return new L.DivIcon({ html: '
        ' + childCount + '
        ', className: className, iconSize: new L.Point(40, 40) }); - } + $scope.$on("removeWfsLayerFromMap", function (event, dataset) { + var layerName = dataset.title; + $scope.layerControl._layers.forEach(function (layer) { + if (layer.group.name === wfsLayerGroupName && layer.name.includes(layerName)) { + $scope.layerControl.removeLayer(layer.layer); + $scope.map.removeLayer(layer.layer); + } + }); }); - } - else { - markers = L.layerGroup(); - } - - georesourceMetadataAndGeoJSON.geoJSON.features.forEach(function (poiFeature) { - // index 0 should be longitude and index 1 should be latitude - //.bindPopup( poiFeature.properties.name ) - var newMarker = createCustomMarker(poiFeature, georesourceMetadataAndGeoJSON.poiSymbolColor, georesourceMetadataAndGeoJSON.poiMarkerColor, georesourceMetadataAndGeoJSON.poiSymbolBootstrap3Name, georesourceMetadataAndGeoJSON); - - markers = addPoiMarker(markers, newMarker); - }); - - // markers.StyledLayerControl = { - // removable : false, - // visible : true - // }; - - $scope.layerControl.addOverlay(markers, georesourceMetadataAndGeoJSON.datasetName + "_" + date, poiLayerGroupName); - markers.addTo($scope.map); - $scope.updateSearchControl(); - // $scope.map.addLayer( markers ); - $scope.map.invalidateSize(true); - }); - - $scope.$on("addPoiGeoresourceAsGeoJSON_reachabilityAnalysis", function (event, georesourceMetadataAndGeoJSON, date, useCluster) { - - // use leaflet.markercluster to cluster markers! - var markers; - if (useCluster) { - markers = L.markerClusterGroup({ - iconCreateFunction: function (cluster) { - var childCount = cluster.getChildCount(); - - var c = 'cluster-'; - if (childCount < 10) { - c += 'small'; - } else if (childCount < 30) { - c += 'medium'; - } else { - c += 'large'; - } - - var className = "marker-cluster " + c + " awesome-marker-legend-TransparentIcon-" + georesourceMetadataAndGeoJSON.poiMarkerColor; - - //'marker-cluster' + c + ' ' + - return new L.DivIcon({ html: '
        ' + childCount + '
        ', className: className, iconSize: new L.Point(40, 40) }); - } + $scope.$on("addFileLayerToMap", function (event, dataset, opacity) { + var fileLayer; + var style = { + weight: 1, + opacity: opacity, + color: defaultBorderColor, + dashArray: '', + fillOpacity: 1, + fillColor: dataset.displayColor + }; + var fileType = dataset.type; + if (fileType.toUpperCase() === "geojson".toUpperCase()) { + var geoJSON = dataset.content; + if (isLinearGeoJSON(geoJSON)) { + // when is line dataset then set the border color + style.color = dataset.displayColor; + } + fileLayer = L.geoJSON(geoJSON, { + style: style, + onEachFeature: function (feature, layer) { + layer.on({ + click: function () { + // var propertiesString = "
        " + JSON.stringify(feature.properties, null, ' ').replace(/[\{\}"]/g, '') + "
        "; + var popupContent = '
        '; + for (var p in feature.properties) { + popupContent += ''; + } + popupContent += '
        ' + p + '' + feature.properties[p] + '
        '; + if (popupContent) + layer.bindPopup(popupContent); + } + }); + } + }); + $scope.showFileLayer(fileLayer, dataset); + } + else if (fileType.toUpperCase() === "shp".toUpperCase()) { + // transform shape ZIP arrayBuffer to GeoJSON + // var geoJSON = await shp(dataset.content).then( + // var zip = shp.parseZip(dataset.content); + shp(dataset.content).then(function (geojson) { + console.log("Shapefile parsed successfully"); + if (isLinearGeoJSON(geojson)) { + // when is line dataset then set the border color + style.color = dataset.displayColor; + } + fileLayer = L.geoJSON(geojson, { + style: style, + onEachFeature: function (feature, layer) { + layer.on({ + click: function () { + // var propertiesString = "
        " + JSON.stringify(feature.properties, null, ' ').replace(/[\{\}"]/g, '') + "
        "; + var popupContent = '
        '; + for (var p in feature.properties) { + popupContent += ''; + } + popupContent += '
        ' + p + '' + feature.properties[p] + '
        '; + if (popupContent) + layer.bindPopup(popupContent); + } + }); + } + }); + $scope.showFileLayer(fileLayer, dataset); + }, function (reason) { + console.error("Error while parsing Shapefile"); + console.error(reason); + $rootScope.$broadcast("FileLayerError", reason, dataset); + throw reason; + }); + } }); - } - else { - markers = L.layerGroup(); - } - - georesourceMetadataAndGeoJSON.geoJSON.features.forEach(function (poiFeature) { - // index 0 should be longitude and index 1 should be latitude - //.bindPopup( poiFeature.properties.name ) - var newMarker = createCustomMarker(poiFeature, georesourceMetadataAndGeoJSON.poiSymbolColor, georesourceMetadataAndGeoJSON.poiMarkerColor, georesourceMetadataAndGeoJSON.poiSymbolBootstrap3Name, georesourceMetadataAndGeoJSON); - - markers = addPoiMarker(markers, newMarker); - }); - - // markers.StyledLayerControl = { - // removable : false, - // visible : true - // }; - - $scope.layerControl.addOverlay(markers, georesourceMetadataAndGeoJSON.datasetName + "_" + date + "_inEinzugsgebiet", reachabilityLayerGroupName); - markers.addTo($scope.map); - $scope.updateSearchControl(); - // $scope.map.addLayer( markers ); - $scope.map.invalidateSize(true); - }); - - var addPoiMarker = function(markers, poiMarker){ - - // var propertiesString = "
        " + JSON.stringify(poiMarker.feature.properties, null, ' ').replace(/[\{\}"]/g, '') + "
        "; - - var popupContent = '
        '; - for (var p in poiMarker.feature.properties) { - popupContent += ''; - } - popupContent += '
        ' + p + ''+ poiMarker.feature.properties[p] + '
        '; - - if (poiMarker.feature.properties.name) { - poiMarker.bindPopup(poiMarker.feature.properties.name + "\n\n" + popupContent); - } - else if (poiMarker.feature.properties.NAME) { - poiMarker.bindPopup(poiMarker.feature.properties.NAME + "\n\n" + popupContent); - } - else if (poiMarker.feature.properties[__env.FEATURE_NAME_PROPERTY_NAME]) { - poiMarker.bindPopup(poiMarker.feature.properties[__env.FEATURE_NAME_PROPERTY_NAME] + "\n\n" + popupContent); - } - else { - // poiMarker.bindPopup(propertiesString); - poiMarker.bindPopup(popupContent); - } - markers.addLayer(poiMarker); - - return markers; - }; - - $scope.$on("removePoiGeoresource", function (event, georesourceMetadataAndGeoJSON) { - - var layerName = georesourceMetadataAndGeoJSON.datasetName; - - $scope.layerControl._layers.forEach(function (layer) { - if (layer.group.name === poiLayerGroupName && layer.name.includes(layerName + "_")) { - $scope.layerControl.removeLayer(layer.layer); - $scope.map.removeLayer(layer.layer); - $scope.updateSearchControl(); - } - }); - }); - - $scope.$on("removePoiGeoresource_reachabilityAnalysis", function (event, georesourceMetadataAndGeoJSON) { - - var layerName = georesourceMetadataAndGeoJSON.datasetName; - - $scope.layerControl._layers.forEach(function (layer) { - if (layer.group.name === reachabilityLayerGroupName && layer.name.includes(layerName + "_")) { - $scope.layerControl.removeLayer(layer.layer); - $scope.map.removeLayer(layer.layer); - $scope.updateSearchControl(); - } - }); - }); - - $scope.$on("addAoiGeoresourceAsGeoJSON", function (event, georesourceMetadataAndGeoJSON, date) { - - var color = georesourceMetadataAndGeoJSON.aoiColor; - - var layer = L.geoJSON(georesourceMetadataAndGeoJSON.geoJSON, { - style: function (feature) { - return { - fillColor: color, - color: "black", - weight: 1, - opacity: 1, - fillOpacity: 0.7 - }; - }, - onEachFeature: onEachFeatureGeoresource - }); - - // layer.StyledLayerControl = { - // removable : false, - // visible : true - // }; - - $scope.layerControl.addOverlay(layer, georesourceMetadataAndGeoJSON.datasetName + "_" + date, aoiLayerGroupName); - layer.addTo($scope.map); - $scope.updateSearchControl(); - - $scope.map.invalidateSize(true); - }); - - $scope.$on("removeAoiGeoresource", function (event, georesourceMetadataAndGeoJSON) { - - var layerName = georesourceMetadataAndGeoJSON.datasetName; - - $scope.layerControl._layers.forEach(function (layer) { - if (layer.group.name === aoiLayerGroupName && layer.name.includes(layerName + "_")) { - $scope.layerControl.removeLayer(layer.layer); - $scope.map.removeLayer(layer.layer); - $scope.updateSearchControl(); - } - }); - }); - - $scope.$on("addLoiGeoresourceAsGeoJSON", function (event, georesourceMetadataAndGeoJSON, date) { - - var color = georesourceMetadataAndGeoJSON.aoiColor; - - var featureGroup = L.featureGroup(); - - var style = { - color: georesourceMetadataAndGeoJSON.loiColor, - dashArray: georesourceMetadataAndGeoJSON.loiDashArrayString, - weight: georesourceMetadataAndGeoJSON.loiWidth || 3, - opacity: 1 - }; - - - - georesourceMetadataAndGeoJSON.geoJSON.features.forEach((item, i) => { - var type = item.geometry.type; - - if (type === "Polygon" || type === "MultiPolygon"){ - var lines = turf.polygonToLine(item); - - L.geoJSON(lines, { - style: style, - onEachFeature: onEachFeatureGeoresource - }).addTo(featureGroup); - } - else{ - L.geoJSON(item, { - style: style, - onEachFeature: onEachFeatureGeoresource - }).addTo(featureGroup); - } - }); - - // georesourceMetadataAndGeoJSON.geoJSON.features.forEach((loiFeature, i) => { - // var latLngs = - // var polyline = L.polyline(loiFeature.geometry.coordinates); - // - // var geoJSON = polyline.toGeoJSON(); - // - // var geoJSON_line = L.geoJSON(geoJSON, { - // style: style, - // onEachFeature: onEachFeatureGeoresource - // }) - // - // geoJSON_line.addTo(featureGroup); - // }); - - // layer.StyledLayerControl = { - // removable : false, - // visible : true - // }; - - $scope.layerControl.addOverlay(featureGroup, georesourceMetadataAndGeoJSON.datasetName + "_" + date, loiLayerGroupName); - featureGroup.addTo($scope.map); - $scope.updateSearchControl(); - - $scope.map.invalidateSize(true); - }); - - $scope.$on("removeLoiGeoresource", function (event, georesourceMetadataAndGeoJSON) { - - var layerName = georesourceMetadataAndGeoJSON.datasetName; - - $scope.layerControl._layers.forEach(function (layer) { - if (layer.group.name === loiLayerGroupName && layer.name.includes(layerName + "_")) { - $scope.layerControl.removeLayer(layer.layer); - $scope.map.removeLayer(layer.layer); - $scope.updateSearchControl(); - } - }); - }); - - $scope.$on("adjustOpacityForIndicatorLayer", function (event, indicatorMetadata, opacity) { - // var layerName = indicatorMetadataAndGeoJSON.indicatorName; - // - // $scope.layerControl._layers.forEach(function(layer){ - // if(layer.group.name === indicatorLayerGroupName && layer.name.includes(layerName)){ - // layer.layer.setOpacity(opacity); - // layer.layer.setStyle({ - // opacity: opacity - // }); - // } - // }); - - opacity = opacity.toFixed(numberOfDecimals); - - kommonitorVisualStyleHelperService.setOpacity(opacity); - $rootScope.$broadcast("restyleCurrentLayer", true); - }); - - $scope.$on("addWmsLayerToMap", function (event, dataset, opacity) { - var wmsLayer = L.tileLayer.betterWms(dataset.url, { - layers: dataset.layerName, - transparent: true, - format: 'image/png', - minZoom: __env.minZoomLevel, - maxZoom: __env.maxZoomLevel, - opacity: opacity - }); - - $scope.layerControl.addOverlay(wmsLayer, dataset.title, wmsLayerGroupName); - wmsLayer.addTo($scope.map); - $scope.updateSearchControl(); - $scope.map.invalidateSize(true); - }); - - $scope.$on("adjustOpacityForWmsLayer", function (event, dataset, opacity) { - var layerName = dataset.title; - - $scope.layerControl._layers.forEach(function (layer) { - if (layer.group.name === wmsLayerGroupName && layer.name.includes(layerName)) { - layer.layer.setOpacity(opacity); - } - }); - }); - - $scope.$on("adjustOpacityForAoiLayer", function (event, dataset, opacity) { - var layerName = dataset.datasetName; - - $scope.layerControl._layers.forEach(function (layer) { - if (layer.group.name === aoiLayerGroupName && layer.name.includes(layerName)) { - layer.layer.setStyle({ - fillOpacity:opacity, - opacity:opacity - }); - } - }); - }); - - $scope.$on("adjustOpacityForLoiLayer", function (event, dataset, opacity) { - var layerName = dataset.datasetName; - - $scope.layerControl._layers.forEach(function (layer) { - if (layer.group.name === loiLayerGroupName && layer.name.includes(layerName)) { - layer.layer.setStyle({ - fillOpacity:opacity, - opacity:opacity - }); - } - }); - }); - - $scope.$on("adjustOpacityForPoiLayer", function (event, dataset, opacity) { - var layerName = dataset.datasetName; - - $scope.layerControl._layers.forEach(function (layer) { - if (layer.group.name === poiLayerGroupName && layer.name.includes(layerName)) { - - if(layer.layer._layers){ - for(var layerId in layer.layer._layers){ - layer.layer._layers[layerId].setOpacity(opacity); - } - } - else if(layer.layer._featureGroup){ - for(var layerId in layer.layer._featureGroup._layers){ - layer.layer._featureGroup._layers[layerId].setOpacity(opacity); - } - } - else{ - layer.layer.setOpacity(opacity); - } - } - }); - }); - - $scope.$on("removeWmsLayerFromMap", function (event, dataset) { - - var layerName = dataset.title; - - $scope.layerControl._layers.forEach(function (layer) { - if (layer.group.name === wmsLayerGroupName && layer.name.includes(layerName)) { - $scope.layerControl.removeLayer(layer.layer); - $scope.map.removeLayer(layer.layer); - } - }); - }); - - var getWfsStyle = function(dataset, opacity){ - - if(dataset.geometryType === "POI"){ - return { - weight: 1, - opacity: opacity, - color: dataset.poiMarkerColor, - dashArray: '', - fillOpacity: opacity, - fillColor: dataset.poiMarkerColor - }; - } - - else if (dataset.geometryType === "LOI"){ - return { - weight: dataset.loiWidth, - opacity: opacity, - color: dataset.loiColor, - dashArray: dataset.loiDashArrayString, - fillOpacity: opacity, - fillColor: dataset.loiColor + var isLinearGeoJSON = function (geoJSON) { + if (geoJSON.features) { + // featureCollection + if (geoJSON.features[0].geometry) { + if (geoJSON.features[0].geometry.type === "LineString" || geoJSON.features[0].geometry.type === "MultiLineString") { + return true; + } + } + } + else if (geoJSON.geometry) { + // single object + if (geoJSON.geometry.type === "LineString" || geoJSON.geometry.type === "MultiLineString") { + return true; + } + } + else if (geoJSON.geometries) { + // geometryCollection + if (geoJSON.geometries[0].type === "LineString" || geoJSON.geometries[0].type === "MultiLineString") { + return true; + } + } + return false; }; - } - - else{ - return { - weight: 1, - opacity: opacity, - color: dataset.aoiColor, - dashArray: '', - fillOpacity: opacity, - fillColor: dataset.aoiColor + $scope.showFileLayer = function (fileLayer, dataset) { + $scope.layerControl.addOverlay(fileLayer, dataset.title, fileLayerGroupName); + fileLayer.addTo($scope.map); + console.log("Try to fit bounds on fileLayer"); + $scope.map.fitBounds(fileLayer.getBounds()); + console.log("Tried fit bounds on fileLayer"); + $rootScope.$broadcast("FileLayerSuccess", dataset); + $scope.updateSearchControl(); + $scope.map.invalidateSize(true); }; - } - - }; - - $scope.getFilterEncoding = function(dataset){ - - var filterExpressions = []; - - if(dataset.filterEncoding.PropertyIsEqualTo && dataset.filterEncoding.PropertyIsEqualTo.propertyName && dataset.filterEncoding.PropertyIsEqualTo.propertyValue){ - filterExpressions.push(new L.Filter.EQ(dataset.filterEncoding.PropertyIsEqualTo.propertyName, dataset.filterEncoding.PropertyIsEqualTo.propertyValue)); - } - - if (dataset.filterFeaturesToMapBBOX) { - filterExpressions.push(new L.Filter.BBox(dataset.featureTypeGeometryName, $scope.map.getBounds(), L.CRS.EPSG3857)); - } - - if (filterExpressions.length == 0){ - return undefined; - } - - if (filterExpressions.length < 2){ - return filterExpressions; - } - else{ - // var stringifiedFilterExpressions = []; - - // for (const filterExpr of filterExpressions) { - // stringifiedFilterExpressions.push(L.XmlUtil.serializeXmlDocumentString(filterExpr.toGml())); - // } - - // return new L.Filter.And(...stringifiedFilterExpressions); - return new L.Filter.And(...filterExpressions); - } - - }; - - $scope.$on("addWfsLayerToMap", function (event, dataset, opacity, useCluster) { - var wfsLayerOptions = { - url: dataset.url, - typeNS: dataset.featureTypeNamespace, - namespaceUri: "http://mapserver.gis.umn.edu/mapserver", - typeName: dataset.featureTypeName, - geometryField: dataset.featureTypeGeometryName, - // maxFeatures: null, - style: getWfsStyle(dataset, opacity) - }; - - var filterEncoding = $scope.getFilterEncoding(dataset); - if (filterEncoding){ - wfsLayerOptions.filter = filterEncoding; - } - - - var wfsLayer; - var poiMarkerLayer; - - if(dataset.geometryType === "POI"){ - - if (useCluster) { - poiMarkerLayer = L.markerClusterGroup({ - iconCreateFunction: function (cluster) { - var childCount = cluster.getChildCount(); - - var c = 'cluster-'; - if (childCount < 10) { - c += 'small'; - } else if (childCount < 30) { - c += 'medium'; - } else { - c += 'large'; - } - - var className = "marker-cluster " + c + " awesome-marker-legend-TransparentIcon-" + dataset.poiMarkerColor; - - //'marker-cluster' + c + ' ' + - return new L.DivIcon({ html: '
        ' + childCount + '
        ', className: className, iconSize: new L.Point(40, 40) }); - } - }); - } - else { - poiMarkerLayer = L.layerGroup(); - } - - wfsLayer = new L.WFS(wfsLayerOptions); - } - else{ - wfsLayer = new L.WFS(wfsLayerOptions); - } - - try { - wfsLayer.once('load', function () { - - if(dataset.geometryType === "POI"){ - poiMarkerLayer = createCustomMarkersFromWfsPoints(wfsLayer, poiMarkerLayer, dataset); - } - - console.log("Try to fit bounds on wfsLayer"); - $scope.map.fitBounds(wfsLayer.getBounds()); - - console.log("Tried fit bounds on wfsLayer"); - - $scope.map.invalidateSize(true); - // $scope.loadingData = false; + $scope.$on("adjustOpacityForFileLayer", function (event, dataset, opacity) { + var layerName = dataset.title; + $scope.layerControl._layers.forEach(function (layer) { + if (layer.group.name === fileLayerGroupName && layer.name.includes(layerName)) { + var newStyle = { + weight: 1, + opacity: opacity, + color: defaultBorderColor, + dashArray: '', + fillOpacity: opacity, + fillColor: dataset.displayColor + }; + // layer.layer.options.style = newStyle; + layer.layer.setStyle(newStyle); + } + }); }); - - wfsLayer.on('click', function (event) { - // var propertiesString = "
        " + JSON.stringify(event.layer.feature.properties, null, ' ').replace(/[\{\}"]/g, '') + "
        "; - - var popupContent = '
        '; - for (var p in event.layer.feature.properties) { - popupContent += ''; - } - popupContent += '
        ' + p + ''+ event.layer.feature.properties[p] + '
        '; - - var popup = L.popup(); - popup - .setLatLng(event.latlng) - .setContent(popupContent) - .openOn($scope.map); + $scope.$on("adjustColorForFileLayer", function (event, dataset) { + var layerName = dataset.title; + $scope.layerControl._layers.forEach(function (layer) { + if (layer.group.name === fileLayerGroupName && layer.name.includes(layerName)) { + var newStyle = { + weight: 1, + color: defaultBorderColor, + dashArray: '', + fillColor: dataset.displayColor + }; + //var geoJSON = layer.layertoGeoJSON(); + var firstLayersPropertyName = Object.keys(layer.layer._layers)[0]; + if (firstLayersPropertyName) { + var geoJSON_exmaple = layer.layer._layers[firstLayersPropertyName].toGeoJSON(); + if (isLinearGeoJSON(geoJSON_exmaple)) { + newStyle.color = dataset.displayColor; + } + } + layer.layer.setStyle(newStyle); + } + }); }); - if(poiMarkerLayer){ - $scope.layerControl.addOverlay(poiMarkerLayer, dataset.title, wfsLayerGroupName); - poiMarkerLayer.addTo($scope.map); - } - else{ - $scope.layerControl.addOverlay(wfsLayer, dataset.title, wfsLayerGroupName); - wfsLayer.addTo($scope.map); - } - $scope.updateSearchControl(); - - } - catch (error) { - $scope.loadingData = false; - kommonitorDataExchangeService.displayMapApplicationError(error); - } - - }); - - $scope.$on("adjustOpacityForWfsLayer", function (event, dataset, opacity) { - var layerName = dataset.title; - - $scope.layerControl._layers.forEach(function (layer) { - if (layer.group.name === wfsLayerGroupName && layer.name.includes(layerName)) { - // layer.layer.setOpacity(opacity); - var newStyle = getWfsStyle(dataset, opacity); - // layer.layer.options.style = newStyle; - if(layer.layer._layers){ - for(var layerId in layer.layer._layers){ - - - if(dataset.geometryType === "POI"){ - layer.layer._layers[layerId].setOpacity(opacity); - } - else{ - layer.layer._layers[layerId].setStyle(newStyle); - } - } - } - else{ - - if(dataset.geometryType === "POI"){ - layer.layer.setOpacity(opacity); - } - else{ - layer.layer.setStyle(newStyle); - } - } - - } - }); - }); - - $scope.$on("adjustColorForWfsLayer", function (event, dataset, opacity) { - var layerName = dataset.title; - - $scope.layerControl._layers.forEach(function (layer) { - if (layer.group.name === wfsLayerGroupName && layer.name.includes(layerName)) { - var newStyle = getWfsStyle(dataset, opacity); - - layer.layer.setStyle(newStyle); - } - }); - }); - - $scope.$on("removeWfsLayerFromMap", function (event, dataset) { - - var layerName = dataset.title; - - $scope.layerControl._layers.forEach(function (layer) { - if (layer.group.name === wfsLayerGroupName && layer.name.includes(layerName)) { - $scope.layerControl.removeLayer(layer.layer); - $scope.map.removeLayer(layer.layer); - } - }); - }); - - $scope.$on("addFileLayerToMap", function (event, dataset, opacity) { - var fileLayer; - - var style = { - weight: 1, - opacity: opacity, - color: defaultBorderColor, - dashArray: '', - fillOpacity: 1, - fillColor: dataset.displayColor - }; - - var fileType = dataset.type; - if (fileType.toUpperCase() === "geojson".toUpperCase()) { - var geoJSON = dataset.content; - - if (isLinearGeoJSON(geoJSON)) { - // when is line dataset then set the border color - style.color = dataset.displayColor; - } - - fileLayer = L.geoJSON(geoJSON, { - style: style, - onEachFeature: function (feature, layer) { - layer.on({ - click: function () { - - // var propertiesString = "
        " + JSON.stringify(feature.properties, null, ' ').replace(/[\{\}"]/g, '') + "
        "; - - var popupContent = '
        '; - for (var p in feature.properties) { - popupContent += ''; - } - popupContent += '
        ' + p + ''+ feature.properties[p] + '
        '; - - if (popupContent) - layer.bindPopup(popupContent); - } + $scope.$on("removeFileLayerFromMap", function (event, dataset) { + var layerName = dataset.title; + $scope.layerControl._layers.forEach(function (layer) { + if (layer.group.name === fileLayerGroupName && layer.name.includes(layerName)) { + $scope.layerControl.removeLayer(layer.layer); + $scope.map.removeLayer(layer.layer); + } }); - } }); - $scope.showFileLayer(fileLayer, dataset); - } - else if (fileType.toUpperCase() === "shp".toUpperCase()) { - // transform shape ZIP arrayBuffer to GeoJSON - // var geoJSON = await shp(dataset.content).then( - // var zip = shp.parseZip(dataset.content); - shp(dataset.content).then( - function (geojson) { - console.log("Shapefile parsed successfully"); - - if (isLinearGeoJSON(geojson)) { - // when is line dataset then set the border color - style.color = dataset.displayColor; - } - - fileLayer = L.geoJSON(geojson, { - style: style, - onEachFeature: function (feature, layer) { - layer.on({ - click: function () { - - // var propertiesString = "
        " + JSON.stringify(feature.properties, null, ' ').replace(/[\{\}"]/g, '') + "
        "; - - var popupContent = '
        '; - for (var p in feature.properties) { - popupContent += ''; - } - popupContent += '
        ' + p + ''+ feature.properties[p] + '
        '; - - if (popupContent) - layer.bindPopup(popupContent); - } - }); - } + $scope.$on("removeReachabilityLayers", function (event) { + var layerNamePartly = "Isochrone"; + $scope.layerControl._layers.forEach(function (layer) { + if (layer.group.name === reachabilityLayerGroupName && layer.name.includes(layerNamePartly)) { + $scope.layerControl.removeLayer(layer.layer); + $scope.map.removeLayer(layer.layer); + } }); - - - $scope.showFileLayer(fileLayer, dataset); - }, - function (reason) { - console.error("Error while parsing Shapefile"); - console.error(reason); - $rootScope.$broadcast("FileLayerError", reason, dataset); - throw reason; - } - ); - } - - }); - - var isLinearGeoJSON = function (geoJSON) { - if (geoJSON.features) { - // featureCollection - if (geoJSON.features[0].geometry) { - if (geoJSON.features[0].geometry.type === "LineString" || geoJSON.features[0].geometry.type === "MultiLineString") { - return true; - } - } - } - else if (geoJSON.geometry) { - // single object - if (geoJSON.geometry.type === "LineString" || geoJSON.geometry.type === "MultiLineString") { - return true; - } - } - else if (geoJSON.geometries) { - // geometryCollection - if (geoJSON.geometries[0].type === "LineString" || geoJSON.geometries[0].type === "MultiLineString") { - return true; - } - } - - return false; - }; - - $scope.showFileLayer = function (fileLayer, dataset) { - $scope.layerControl.addOverlay(fileLayer, dataset.title, fileLayerGroupName); - fileLayer.addTo($scope.map); - - console.log("Try to fit bounds on fileLayer"); - $scope.map.fitBounds(fileLayer.getBounds()); - - console.log("Tried fit bounds on fileLayer"); - - $rootScope.$broadcast("FileLayerSuccess", dataset); - - $scope.updateSearchControl(); - - $scope.map.invalidateSize(true); - }; - - $scope.$on("adjustOpacityForFileLayer", function (event, dataset, opacity) { - var layerName = dataset.title; - - $scope.layerControl._layers.forEach(function (layer) { - if (layer.group.name === fileLayerGroupName && layer.name.includes(layerName)) { - var newStyle = { - weight: 1, - opacity: opacity, - color: defaultBorderColor, - dashArray: '', - fillOpacity: opacity, - fillColor: dataset.displayColor - }; - - // layer.layer.options.style = newStyle; - layer.layer.setStyle(newStyle); - } - }); - }); - - $scope.$on("adjustColorForFileLayer", function (event, dataset) { - var layerName = dataset.title; - - $scope.layerControl._layers.forEach(function (layer) { - if (layer.group.name === fileLayerGroupName && layer.name.includes(layerName)) { - var newStyle = { - weight: 1, - color: defaultBorderColor, - dashArray: '', - fillColor: dataset.displayColor - }; - - //var geoJSON = layer.layertoGeoJSON(); - var firstLayersPropertyName = Object.keys(layer.layer._layers)[0]; - if (firstLayersPropertyName) { - var geoJSON_exmaple = layer.layer._layers[firstLayersPropertyName].toGeoJSON(); - if (isLinearGeoJSON(geoJSON_exmaple)) { - newStyle.color = dataset.displayColor; - } - } - - layer.layer.setStyle(newStyle); - } - }); - }); - - $scope.$on("removeFileLayerFromMap", function (event, dataset) { - - var layerName = dataset.title; - - $scope.layerControl._layers.forEach(function (layer) { - if (layer.group.name === fileLayerGroupName && layer.name.includes(layerName)) { - $scope.layerControl.removeLayer(layer.layer); - $scope.map.removeLayer(layer.layer); - } - }); - }); - - $scope.$on("removeReachabilityLayers", function (event) { - - var layerNamePartly = "Isochrone"; - - $scope.layerControl._layers.forEach(function (layer) { - if (layer.group.name === reachabilityLayerGroupName && layer.name.includes(layerNamePartly)) { - $scope.layerControl.removeLayer(layer.layer); - $scope.map.removeLayer(layer.layer); - } - }); - }); - - $scope.$on("removeRoutingLayers", function (event) { - - var layerNamePartly = "Routing"; - - $scope.layerControl._layers.forEach(function (layer) { - if (layer.group.name === reachabilityLayerGroupName && layer.name.includes(layerNamePartly)) { - $scope.layerControl.removeLayer(layer.layer); - $scope.map.removeLayer(layer.layer); - } - }); - }); - - function highlightFeature(e) { - var layer = e.target; - - highlightFeatureForLayer(layer); - } - - function highlightFeatureForLayer(layer) { - - setTemporarilyHighlightedStyle(layer); - - // update diagrams for hovered feature - $rootScope.$broadcast("updateDiagramsForHoveredFeature", layer.feature.properties); - - } - - function highlightClickedFeature(layer) { - - setPermanentlyHighlightedStyle(layer); - - // update diagrams for hovered feature - $rootScope.$broadcast("updateDiagramsForHoveredFeature", layer.feature.properties); - } - - function setPermanentlyHighlightedStyle(layer) { - var fillOpacity = 1; - if ($scope.useTransparencyOnIndicator) { - fillOpacity = defaultFillOpacityForHighlightedFeatures; - } - - layer.setStyle({ - weight: 3, - color: defaultColorForClickedFeatures, - dashArray: '', - fillOpacity: fillOpacity - }); - - if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) { - layer.bringToFront(); - // also bring possible isochrone layer to front - // so it will not disapper behing indicator layer - if ($scope.isochronesLayer) { - $scope.isochronesLayer.bringToFront(); + }); + $scope.$on("removeRoutingLayers", function (event) { + var layerNamePartly = "Routing"; + $scope.layerControl._layers.forEach(function (layer) { + if (layer.group.name === reachabilityLayerGroupName && layer.name.includes(layerNamePartly)) { + $scope.layerControl.removeLayer(layer.layer); + $scope.map.removeLayer(layer.layer); + } + }); + }); + function highlightFeature(e) { + var layer = e.target; + highlightFeatureForLayer(layer); } - } - } - - function setTemporarilyHighlightedStyle(layer) { - var fillOpacity = 1; - if ($scope.useTransparencyOnIndicator) { - fillOpacity = defaultFillOpacity; - } - - layer.setStyle({ - weight: 3, - color: defaultColorForHoveredFeatures, - dashArray: '', - fillOpacity: fillOpacity - }); - - if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) { - layer.bringToFront(); - // also bring possible isochrone layer to front - // so it will not disapper behing indicator layer - if ($scope.isochronesLayer) { - $scope.isochronesLayer.bringToFront(); + function highlightFeatureForLayer(layer) { + setTemporarilyHighlightedStyle(layer); + // update diagrams for hovered feature + $rootScope.$broadcast("updateDiagramsForHoveredFeature", layer.feature.properties); } - } - } - - function preserveHighlightedFeatures() { - $scope.map.eachLayer(function (layer) { - if (layer.feature) { - if (kommonitorFilterHelperService.featureIsCurrentlySelected(layer.feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { + function highlightClickedFeature(layer) { setPermanentlyHighlightedStyle(layer); + // update diagrams for hovered feature $rootScope.$broadcast("updateDiagramsForHoveredFeature", layer.feature.properties); - } - } - }); - } - - $scope.$on("preserveHighlightedFeatures", function (event) { - preserveHighlightedFeatures(); - }); - - function resetHighlight(e) { - var layer = e.target; - resetHighlightForLayer(layer); - - if (!kommonitorFilterHelperService.featureIsCurrentlySelected(layer.feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { - layer.bringToBack(); - } - //layer.bringToBack(); - } - - function resetHighlightForLayer(layer) { - - var style; - - // only restyle feature when not in list of clicked features - if (!kommonitorFilterHelperService.featureIsCurrentlySelected(layer.feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { - if (kommonitorFilterHelperService.featureIsCurrentlyFiltered(layer.feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { - layer.setStyle($scope.filteredStyle); - } - else if (!kommonitorDataExchangeService.isMeasureOfValueChecked) { - //$scope.currentIndicatorLayer.resetStyle(layer); - if ($scope.indicatorTypeOfCurrentLayer.includes('DYNAMIC')) { - style = kommonitorVisualStyleHelperService.styleDynamicIndicator(layer.feature, $scope.dynamicIncreaseBrew, $scope.dynamicDecreaseBrew, $scope.propertyName, $scope.useTransparencyOnIndicator); - - layer.setStyle(style); - } - else { - style = kommonitorVisualStyleHelperService.styleDefault(layer.feature, $scope.defaultBrew, $scope.dynamicIncreaseBrew, $scope.dynamicDecreaseBrew, $scope.propertyName, $scope.useTransparencyOnIndicator, $scope.datasetContainsNegativeValues); - layer.setStyle(style); - } - } - else { - style = kommonitorVisualStyleHelperService.styleMeasureOfValue(layer.feature, $scope.gtMeasureOfValueBrew, $scope.ltMeasureOfValueBrew, $scope.propertyName, $scope.useTransparencyOnIndicator); - layer.setStyle(style); - } - } - else { - setPermanentlyHighlightedStyle(layer); - } - - //update diagrams for unhoveredFeature - $rootScope.$broadcast("updateDiagramsForUnhoveredFeature", layer.feature.properties); - } - - function resetHighlightClickedFeature(layer) { - var style; - //$scope.currentIndicatorLayer.resetStyle(layer); - if (kommonitorFilterHelperService.featureIsCurrentlyFiltered(layer.feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { - layer.setStyle($scope.filteredStyle); - } - else if (!kommonitorDataExchangeService.isMeasureOfValueChecked) { - //$scope.currentIndicatorLayer.resetStyle(layer); - if ($scope.indicatorTypeOfCurrentLayer.includes('DYNAMIC')) { - style = kommonitorVisualStyleHelperService.styleDynamicIndicator(layer.feature, $scope.dynamicIncreaseBrew, $scope.dynamicDecreaseBrew, $scope.propertyName, $scope.useTransparencyOnIndicator); - - layer.setStyle(style); - } - else { - style = kommonitorVisualStyleHelperService.styleDefault(layer.feature, $scope.defaultBrew, $scope.dynamicIncreaseBrew, $scope.dynamicDecreaseBrew, $scope.propertyName, $scope.useTransparencyOnIndicator, $scope.datasetContainsNegativeValues); - - layer.setStyle(style); } - } - else { - style = kommonitorVisualStyleHelperService.styleMeasureOfValue(layer.feature, $scope.gtMeasureOfValueBrew, $scope.ltMeasureOfValueBrew, $scope.propertyName, $scope.useTransparencyOnIndicator); - - layer.setStyle(style); - } - } - - function resetHighlightCustom(e) { - $scope.currentCustomIndicatorLayer.resetStyle(e.target); - if (!kommonitorFilterHelperService.featureIsCurrentlySelected(e.target.feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { - e.target.bringToBack(); - } - } - - var wait = ms => new Promise((r, j) => setTimeout(r, ms)) - - $scope.recenterMap = function () { - $scope.map.invalidateSize(true); - - fitBounds(); - - }; - - $scope.$on("recenterMapContent", function (event) { - $scope.recenterMap(); - }); - - $scope.$on("invalidateMapSize", function (event) { - $timeout(function(){ - $scope.map.invalidateSize(true); - }, 500); - }); - - $scope.$on("recenterMapOnHideSideBar", async function (event) { - //wait due to animation of the sidebar - - // make animation in 30 steps - // var waitForInMs = 30; - // for(var i=0; i<=300; i++){ - // - // i += waitForInMs; - // - // await wait(waitForInMs); - // - // $scope.map.invalidateSize(true); - // - // panToCenterOnInActiveMenue(500); - // // $scope.recenterMap(); - // } - - var waitForInMs = 100; - await wait(waitForInMs); - panToCenterOnInActiveMenue(500); - }); - - $scope.$on("recenterMapOnShowSideBar", async function (event) { - //wait due to animation of the sidebar - - // make animation in 30 steps - // var waitForInMs = 30; - // for(var i=0; i<=300; i++){ - // - // i += waitForInMs; - // - // await wait(waitForInMs); - // - // $scope.map.invalidateSize(true); - // - // panToCenterOnActiveMenue(500); - // // $scope.recenterMap(); - // } - - var waitForInMs = 100; - await wait(waitForInMs); - panToCenterOnActiveMenue(500); - - }); - - function panToCenterOnActiveMenue(numPixels) { - if ($scope.map) { - $scope.map.invalidateSize(true); - $scope.map.panBy(L.point(numPixels, 0)); - - $scope.map.invalidateSize(true); - } - }; - - function panToCenterOnInActiveMenue(numPixels) { - if ($scope.map) { - $scope.map.invalidateSize(true); - $scope.map.panBy(L.point(-numPixels, 0)); - - $scope.map.invalidateSize(true); - } - }; - - - function fitBounds() { - if ($scope.map && $scope.currentIndicatorLayer) { - - $scope.map.invalidateSize(true); - // $scope.map.setView(L.latLng($scope.latCenter, $scope.lonCenter), $scope.zoomLevel); - $scope.map.fitBounds($scope.currentIndicatorLayer.getBounds()); - } - - } - - function zoomToFeature(e) { - map.fitBounds(e.target.getBounds()); - } - - function markOutliers(indicatorMetadataAndGeoJSON, indicatorPropertyName) { - // identify possible data outliers - // mark them using a dedicated property - - $scope.outliers_high = []; - $scope.outliers_low = []; - - var valueArray = new Array(); - - indicatorMetadataAndGeoJSON.geoJSON.features.forEach(function (feature) { - if (!kommonitorDataExchangeService.indicatorValueIsNoData(feature.properties[indicatorPropertyName])) { - if (!valueArray.includes(feature.properties[indicatorPropertyName])) { - valueArray.push(feature.properties[indicatorPropertyName]); - } + function setPermanentlyHighlightedStyle(layer) { + var fillOpacity = 1; + if ($scope.useTransparencyOnIndicator) { + fillOpacity = defaultFillOpacityForHighlightedFeatures; + } + layer.setStyle({ + weight: 3, + color: defaultColorForClickedFeatures, + dashArray: '', + fillOpacity: fillOpacity + }); + if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) { + layer.bringToFront(); + // also bring possible isochrone layer to front + // so it will not disapper behing indicator layer + if ($scope.isochronesLayer) { + $scope.isochronesLayer.bringToFront(); + } + } } - }); - - // https://jstat.github.io/all.html#quartiles - var quartiles = jStat.quartiles(valueArray); - var quartile_25 = quartiles[0]; - var quartile_75 = quartiles[2]; - - var diff = quartile_75 - quartile_25; - var whiskerRange_outliers_soft = diff * 1.5; - var whiskerRange_outliers_extreme = diff * 3; - - var whisker_low_soft = quartile_25 - whiskerRange_outliers_soft; - var whisker_high_soft = quartile_75 + whiskerRange_outliers_soft; - - var whisker_low_extreme = quartile_25 - whiskerRange_outliers_extreme; - var whisker_high_extreme = quartile_75 + whiskerRange_outliers_extreme; - - // for now only mark extreme outliers! - - indicatorMetadataAndGeoJSON.geoJSON.features.forEach(function (feature) { - // compare feature value to whiskers and set property - if (kommonitorDataExchangeService.indicatorValueIsNoData(feature.properties[indicatorPropertyName])) { - feature.properties[outlierPropertyName] = outlierPropertyValue_no; + function setTemporarilyHighlightedStyle(layer) { + var fillOpacity = 1; + if ($scope.useTransparencyOnIndicator) { + fillOpacity = defaultFillOpacity; + } + layer.setStyle({ + weight: 3, + color: defaultColorForHoveredFeatures, + dashArray: '', + fillOpacity: fillOpacity + }); + if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) { + layer.bringToFront(); + // also bring possible isochrone layer to front + // so it will not disapper behing indicator layer + if ($scope.isochronesLayer) { + $scope.isochronesLayer.bringToFront(); + } + } } - else if (feature.properties[indicatorPropertyName] < whisker_low_extreme) { - feature.properties[outlierPropertyName] = outlierPropertyValue_low_extreme; - $scope.containsOutliers_low = true; - $scope.outliers_low.push(feature.properties[indicatorPropertyName]); + function preserveHighlightedFeatures() { + $scope.map.eachLayer(function (layer) { + if (layer.feature) { + if (kommonitorFilterHelperService.featureIsCurrentlySelected(layer.feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { + setPermanentlyHighlightedStyle(layer); + $rootScope.$broadcast("updateDiagramsForHoveredFeature", layer.feature.properties); + } + } + }); } - // else if (feature.properties[indicatorPropertyName] < whisker_low_soft){ - // feature.properties[outlierPropertyName] = outlierPropertyValue_low_soft; - // $scope.containsOutliers_low = true; - // $scope.outliers_low.push(feature.properties[indicatorPropertyName]); - // } - else if (feature.properties[indicatorPropertyName] > whisker_high_extreme) { - feature.properties[outlierPropertyName] = outlierPropertyValue_high_extreme; - $scope.containsOutliers_high = true; - $scope.outliers_high.push(feature.properties[indicatorPropertyName]); + $scope.$on("preserveHighlightedFeatures", function (event) { + preserveHighlightedFeatures(); + }); + function resetHighlight(e) { + var layer = e.target; + resetHighlightForLayer(layer); + if (!kommonitorFilterHelperService.featureIsCurrentlySelected(layer.feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { + layer.bringToBack(); + } + //layer.bringToBack(); + } + function resetHighlightForLayer(layer) { + var style; + // only restyle feature when not in list of clicked features + if (!kommonitorFilterHelperService.featureIsCurrentlySelected(layer.feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { + if (kommonitorFilterHelperService.featureIsCurrentlyFiltered(layer.feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { + layer.setStyle($scope.filteredStyle); + } + else if (!kommonitorDataExchangeService.isMeasureOfValueChecked) { + //$scope.currentIndicatorLayer.resetStyle(layer); + if ($scope.indicatorTypeOfCurrentLayer.includes('DYNAMIC')) { + style = kommonitorVisualStyleHelperService.styleDynamicIndicator(layer.feature, $scope.dynamicIncreaseBrew, $scope.dynamicDecreaseBrew, $scope.propertyName, $scope.useTransparencyOnIndicator); + layer.setStyle(style); + } + else { + style = kommonitorVisualStyleHelperService.styleDefault(layer.feature, $scope.defaultBrew, $scope.dynamicIncreaseBrew, $scope.dynamicDecreaseBrew, $scope.propertyName, $scope.useTransparencyOnIndicator, $scope.datasetContainsNegativeValues); + layer.setStyle(style); + } + } + else { + style = kommonitorVisualStyleHelperService.styleMeasureOfValue(layer.feature, $scope.gtMeasureOfValueBrew, $scope.ltMeasureOfValueBrew, $scope.propertyName, $scope.useTransparencyOnIndicator); + layer.setStyle(style); + } + } + else { + setPermanentlyHighlightedStyle(layer); + } + //update diagrams for unhoveredFeature + $rootScope.$broadcast("updateDiagramsForUnhoveredFeature", layer.feature.properties); } - // else if (feature.properties[indicatorPropertyName] > whisker_high_soft){ - // feature.properties[outlierPropertyName] = outlierPropertyValue_high_soft; - // $scope.containsOutliers_high = true; - // $scope.outliers_high.push(feature.properties[indicatorPropertyName]); - // } - else { - feature.properties[outlierPropertyName] = outlierPropertyValue_no; + function resetHighlightClickedFeature(layer) { + var style; + //$scope.currentIndicatorLayer.resetStyle(layer); + if (kommonitorFilterHelperService.featureIsCurrentlyFiltered(layer.feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { + layer.setStyle($scope.filteredStyle); + } + else if (!kommonitorDataExchangeService.isMeasureOfValueChecked) { + //$scope.currentIndicatorLayer.resetStyle(layer); + if ($scope.indicatorTypeOfCurrentLayer.includes('DYNAMIC')) { + style = kommonitorVisualStyleHelperService.styleDynamicIndicator(layer.feature, $scope.dynamicIncreaseBrew, $scope.dynamicDecreaseBrew, $scope.propertyName, $scope.useTransparencyOnIndicator); + layer.setStyle(style); + } + else { + style = kommonitorVisualStyleHelperService.styleDefault(layer.feature, $scope.defaultBrew, $scope.dynamicIncreaseBrew, $scope.dynamicDecreaseBrew, $scope.propertyName, $scope.useTransparencyOnIndicator, $scope.datasetContainsNegativeValues); + layer.setStyle(style); + } + } + else { + style = kommonitorVisualStyleHelperService.styleMeasureOfValue(layer.feature, $scope.gtMeasureOfValueBrew, $scope.ltMeasureOfValueBrew, $scope.propertyName, $scope.useTransparencyOnIndicator); + layer.setStyle(style); + } } - }); - - // sort outliers arrays - $scope.outliers_high.sort(function (a, b) { - return a - b; - }); - $scope.outliers_low.sort(function (a, b) { - return a - b; - }); - - return indicatorMetadataAndGeoJSON; - } - - $scope.setNoDataValuesAsNull = function (indicatorMetadataAndGeoJSON) { - indicatorMetadataAndGeoJSON.geoJSON.features.forEach(function (feature) { - if (kommonitorDataExchangeService.indicatorValueIsNoData(feature.properties[$scope.indicatorPropertyName])) { - feature.properties[$scope.indicatorPropertyName] = null; + function resetHighlightCustom(e) { + $scope.currentCustomIndicatorLayer.resetStyle(e.target); + if (!kommonitorFilterHelperService.featureIsCurrentlySelected(e.target.feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { + e.target.bringToBack(); + } } - }); - - return indicatorMetadataAndGeoJSON; - } - - $scope.$on("replaceIndicatorAsGeoJSON", function (event, indicatorMetadataAndGeoJSON, spatialUnitName, date, justRestyling, isCustomComputation) { - - console.log('replaceIndicatorAsGeoJSON was called'); - - kommonitorVisualStyleHelperService.isCustomComputation = false; - if (isCustomComputation){ - kommonitorVisualStyleHelperService.isCustomComputation = true; - } - - //reset opacity - kommonitorVisualStyleHelperService.setOpacity(__env.defaultFillOpacity); - - refreshFilteredStyle(); - refreshOutliersStyle(); - refreshNoDataStyle(); - - $scope.defaultBrew = new classyBrew(); - $scope.gtMeasureOfValueBrew = new classyBrew(); - $scope.ltMeasureOfValueBrew = new classyBrew(); - - $scope.currentIndicatorMetadataAndGeoJSON = indicatorMetadataAndGeoJSON; - - if (!justRestyling) { - // empty layer of possibly selected features - // kommonitorFilterHelperService.clearSelectedFeatures(); - // kommonitorFilterHelperService.clearFilteredFeatures(); - - $rootScope.$broadcast("checkBalanceMenueAndButton"); - } - - console.log("Remove old indicatorLayer if exists"); - if ($scope.currentIndicatorLayer) { - $scope.layerControl.removeLayer($scope.currentIndicatorLayer); - $scope.map.removeLayer($scope.currentIndicatorLayer); - } - - $scope.currentIndicatorContainsZeroValues = false; - - $scope.date = date; - - $scope.indicatorPropertyName = INDICATOR_DATE_PREFIX + date; - $scope.indicatorName = indicatorMetadataAndGeoJSON.indicatorName; - $scope.indicatorDescription = indicatorMetadataAndGeoJSON.metadata.description; - $scope.indicatorUnit = indicatorMetadataAndGeoJSON.unit; - - $scope.currentIndicatorMetadataAndGeoJSON = $scope.setNoDataValuesAsNull($scope.currentIndicatorMetadataAndGeoJSON); - - // identify and mark outliers prior to setting up of styling - // in styling methods, outliers should be removed from classification! - $scope.currentIndicatorMetadataAndGeoJSON = markOutliers($scope.currentIndicatorMetadataAndGeoJSON, $scope.indicatorPropertyName); - - kommonitorDataExchangeService.setAllFeaturesProperty(indicatorMetadataAndGeoJSON, $scope.indicatorPropertyName); - kommonitorDataExchangeService.setSelectedFeatureProperty(kommonitorFilterHelperService.selectedIndicatorFeatureIds, $scope.indicatorPropertyName); - - $scope.currentGeoJSONOfCurrentLayer = $scope.currentIndicatorMetadataAndGeoJSON.geoJSON; - - for (var i = 0; i < indicatorMetadataAndGeoJSON.geoJSON.features.length; i++) { - var containsZero = false; - var containsNoData = false; - if (indicatorMetadataAndGeoJSON.geoJSON.features[i].properties[$scope.indicatorPropertyName] === 0 || indicatorMetadataAndGeoJSON.geoJSON.features[i].properties[$scope.indicatorPropertyName] === "0") { - $scope.currentIndicatorContainsZeroValues = true; - containsZero = true; + var wait = ms => new Promise((r, j) => setTimeout(r, ms)); + $scope.recenterMap = function () { + $scope.map.invalidateSize(true); + fitBounds(); }; - - if (kommonitorDataExchangeService.indicatorValueIsNoData(indicatorMetadataAndGeoJSON.geoJSON.features[i].properties[$scope.indicatorPropertyName])) { - $scope.currentIndicatorContainsNoDataValues = true; - containsNoData = true; - }; - - if (containsZero && containsNoData) { - break; - } - } - - /* ///////////////////////////////// RASTER SPECIAL TREATMENT - // improve Raster display by eliminiating NoData cells and - // omitting display border in style - */ - - if(kommonitorDataExchangeService.selectedSpatialUnitIsRaster()){ - indicatorMetadataAndGeoJSON.geoJSON.features = indicatorMetadataAndGeoJSON.geoJSON.features.filter(feature => { - if (kommonitorDataExchangeService.indicatorValueIsNoData(feature.properties[$scope.indicatorPropertyName])) { - return false; - } - return true; + $scope.$on("recenterMapContent", function (event) { + $scope.recenterMap(); }); - } - - var layer; - - $scope.indicatorTypeOfCurrentLayer = indicatorMetadataAndGeoJSON.indicatorType; - - if (kommonitorDataExchangeService.isMeasureOfValueChecked) { - var measureOfValueBrewArray = kommonitorVisualStyleHelperService.setupMeasureOfValueBrew($scope.currentGeoJSONOfCurrentLayer, $scope.indicatorPropertyName, defaultColorBrewerPaletteForGtMovValues, defaultColorBrewerPaletteForLtMovValues, kommonitorVisualStyleHelperService.classifyMethod, kommonitorDataExchangeService.measureOfValue); - $scope.gtMeasureOfValueBrew = measureOfValueBrewArray[0]; - $scope.ltMeasureOfValueBrew = measureOfValueBrewArray[1]; - - $scope.propertyName = INDICATOR_DATE_PREFIX + date; - - layer = L.geoJSON(indicatorMetadataAndGeoJSON.geoJSON, { - style: function (feature) { - if (kommonitorFilterHelperService.featureIsCurrentlyFiltered(feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { - return $scope.filteredStyle; - } - return kommonitorVisualStyleHelperService.styleMeasureOfValue(feature, $scope.gtMeasureOfValueBrew, $scope.ltMeasureOfValueBrew, $scope.propertyName, $scope.useTransparencyOnIndicator); - }, - onEachFeature: onEachFeatureIndicator + $scope.$on("invalidateMapSize", function (event) { + $timeout(function () { + $scope.map.invalidateSize(true); + }, 500); }); - - // $scope.makeMeasureOfValueLegend(isCustomComputation); - - } - else { - - if (indicatorMetadataAndGeoJSON.indicatorType.includes("STATUS")) { - $scope.datasetContainsNegativeValues = $scope.containsNegativeValues(indicatorMetadataAndGeoJSON.geoJSON); - if ($scope.datasetContainsNegativeValues) { - var dynamicIndicatorBrewArray = kommonitorVisualStyleHelperService.setupDynamicIndicatorBrew(indicatorMetadataAndGeoJSON.geoJSON, $scope.indicatorPropertyName, defaultColorBrewerPaletteForBalanceIncreasingValues, defaultColorBrewerPaletteForBalanceDecreasingValues, kommonitorVisualStyleHelperService.classifyMethod); - $scope.dynamicIncreaseBrew = dynamicIndicatorBrewArray[0]; - $scope.dynamicDecreaseBrew = dynamicIndicatorBrewArray[1]; - - } - else { - $scope.defaultBrew = kommonitorVisualStyleHelperService.setupDefaultBrew(indicatorMetadataAndGeoJSON.geoJSON, $scope.indicatorPropertyName, indicatorMetadataAndGeoJSON.defaultClassificationMapping.items.length, indicatorMetadataAndGeoJSON.defaultClassificationMapping.colorBrewerSchemeName, kommonitorVisualStyleHelperService.classifyMethod); - } - $scope.propertyName = INDICATOR_DATE_PREFIX + date; - - layer = L.geoJSON(indicatorMetadataAndGeoJSON.geoJSON, { - style: function (feature) { - if (kommonitorFilterHelperService.featureIsCurrentlyFiltered(feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { - return $scope.filteredStyle; - } - return kommonitorVisualStyleHelperService.styleDefault(feature, $scope.defaultBrew, $scope.dynamicIncreaseBrew, $scope.dynamicDecreaseBrew, $scope.propertyName, $scope.useTransparencyOnIndicator, $scope.datasetContainsNegativeValues); - }, - onEachFeature: onEachFeatureIndicator - }); - // $scope.makeDefaultLegend(indicatorMetadataAndGeoJSON.defaultClassificationMapping, $scope.datasetContainsNegativeValues, isCustomComputation); + $scope.$on("recenterMapOnHideSideBar", async function (event) { + //wait due to animation of the sidebar + // make animation in 30 steps + // var waitForInMs = 30; + // for(var i=0; i<=300; i++){ + // + // i += waitForInMs; + // + // await wait(waitForInMs); + // + // $scope.map.invalidateSize(true); + // + // panToCenterOnInActiveMenue(500); + // // $scope.recenterMap(); + // } + var waitForInMs = 100; + await wait(waitForInMs); + panToCenterOnInActiveMenue(500); + }); + $scope.$on("recenterMapOnShowSideBar", async function (event) { + //wait due to animation of the sidebar + // make animation in 30 steps + // var waitForInMs = 30; + // for(var i=0; i<=300; i++){ + // + // i += waitForInMs; + // + // await wait(waitForInMs); + // + // $scope.map.invalidateSize(true); + // + // panToCenterOnActiveMenue(500); + // // $scope.recenterMap(); + // } + var waitForInMs = 100; + await wait(waitForInMs); + panToCenterOnActiveMenue(500); + }); + function panToCenterOnActiveMenue(numPixels) { + if ($scope.map) { + $scope.map.invalidateSize(true); + $scope.map.panBy(L.point(numPixels, 0)); + $scope.map.invalidateSize(true); + } } - else if (indicatorMetadataAndGeoJSON.indicatorType.includes("DYNAMIC")) { - var dynamicIndicatorBrewArray = kommonitorVisualStyleHelperService.setupDynamicIndicatorBrew(indicatorMetadataAndGeoJSON.geoJSON, $scope.indicatorPropertyName, defaultColorBrewerPaletteForBalanceIncreasingValues, defaultColorBrewerPaletteForBalanceDecreasingValues, kommonitorVisualStyleHelperService.classifyMethod); - $scope.dynamicIncreaseBrew = dynamicIndicatorBrewArray[0]; - $scope.dynamicDecreaseBrew = dynamicIndicatorBrewArray[1]; - - $scope.propertyName = INDICATOR_DATE_PREFIX + date; - - layer = L.geoJSON(indicatorMetadataAndGeoJSON.geoJSON, { - style: function(feature){ - if (kommonitorFilterHelperService.featureIsCurrentlyFiltered(feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { - return $scope.filteredStyle; - } - return kommonitorVisualStyleHelperService.styleDynamicIndicator(feature, $scope.dynamicIncreaseBrew, $scope.dynamicDecreaseBrew, $scope.propertyName, $scope.useTransparencyOnIndicator); - }, - onEachFeature: onEachFeatureIndicator - }); - // $scope.makeDynamicIndicatorLegend(isCustomComputation); + ; + function panToCenterOnInActiveMenue(numPixels) { + if ($scope.map) { + $scope.map.invalidateSize(true); + $scope.map.panBy(L.point(-numPixels, 0)); + $scope.map.invalidateSize(true); + } } - - - } - - $scope.currentIndicatorLayer = layer; - - $rootScope.$broadcast("updateLegendDisplay", $scope.currentIndicatorContainsZeroValues, $scope.datasetContainsNegativeValues, $scope.currentIndicatorContainsNoDataValues, $scope.containsOutliers_high, $scope.containsOutliers_low, $scope.outliers_low, $scope.outliers_high, kommonitorDataExchangeService.selectedDate); - - // if(spatialUnitName.includes("raster") || spatialUnitName.includes("Raster") || spatialUnitName.includes("grid") || spatialUnitName.includes("Grid")){ - // layer.style.color = undefined; - // } - - - - // layer.StyledLayerControl = { - // removable : false, - // visible : true - // }; - - var layerName = indicatorMetadataAndGeoJSON.indicatorName + "_" + spatialUnitName + "_" + date; - - if (isCustomComputation) { - layerName += " - individuelles Berechnungsergebnis"; - } - $scope.layerControl.addOverlay(layer, layerName, indicatorLayerGroupName); - layer.addTo($scope.map); - $scope.updateSearchControl(); - - // var justRestyling = false; - - // fitBounds(); - - if ($scope.containsOutliers_low || $scope.containsOutliers_high) { - $scope.showOutlierInfoAlert = true; - } - - $rootScope.$broadcast("updateDiagrams", $scope.currentIndicatorMetadataAndGeoJSON, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitId, date, $scope.defaultBrew, $scope.gtMeasureOfValueBrew, $scope.ltMeasureOfValueBrew, $scope.dynamicIncreaseBrew, $scope.dynamicDecreaseBrew, kommonitorDataExchangeService.isMeasureOfValueChecked, kommonitorDataExchangeService.measureOfValue, justRestyling); - $rootScope.$broadcast("indicatortMapDisplayFinished"); - - $scope.map.invalidateSize(true); - }); - - $scope.containsNegativeValues = function (geoJSON) { - - var containsNegativeValues = false; - $scope.datasetContainsNegativeValues = false; - for (var i = 0; i < geoJSON.features.length; i++) { - if (geoJSON.features[i].properties[$scope.indicatorPropertyName] < 0) { - containsNegativeValues = true; - break; + ; + function fitBounds() { + if ($scope.map && $scope.currentIndicatorLayer) { + $scope.map.invalidateSize(true); + // $scope.map.setView(L.latLng($scope.latCenter, $scope.lonCenter), $scope.zoomLevel); + $scope.map.fitBounds($scope.currentIndicatorLayer.getBounds()); + } } - } - - return containsNegativeValues; - }; - - $scope.$on("restyleCurrentLayer", function (event, skipDiagramRefresh) { - - // var transparency = document.getElementById("indicatorTransparencyInput").value; - // var opacity = 1 - transparency; - // - // kommonitorVisualStyleHelperService.setOpacity(opacity); - - refreshFilteredStyle(); - refreshOutliersStyle(); - refreshNoDataStyle(); - - $scope.defaultBrew = new classyBrew(); - $scope.gtMeasureOfValueBrew = new classyBrew(); - $scope.ltMeasureOfValueBrew = new classyBrew(); - - var style; - if ($scope.currentIndicatorLayer) { - - $scope.currentIndicatorMetadataAndGeoJSON = markOutliers($scope.currentIndicatorMetadataAndGeoJSON, $scope.indicatorPropertyName); - $scope.currentGeoJSONOfCurrentLayer = $scope.currentIndicatorMetadataAndGeoJSON.geoJSON; - - $scope.currentIndicatorContainsZeroValues = false; - - for (var i = 0; i < $scope.currentIndicatorMetadataAndGeoJSON.geoJSON.features.length; i++) { - var containsZero = false; - var containsNoData = false; - if ($scope.currentIndicatorMetadataAndGeoJSON.geoJSON.features[i].properties[$scope.indicatorPropertyName] === 0 || $scope.currentIndicatorMetadataAndGeoJSON.geoJSON.features[i].properties[$scope.indicatorPropertyName] === "0") { - $scope.currentIndicatorContainsZeroValues = true; - containsZero = true; - }; - - if (kommonitorDataExchangeService.indicatorValueIsNoData($scope.currentIndicatorMetadataAndGeoJSON.geoJSON.features[i].properties[$scope.indicatorPropertyName])) { - $scope.currentIndicatorContainsNoDataValues = true; - containsNoData = true; - }; - - if (containsZero && containsNoData) { - break; - } + function zoomToFeature(e) { + map.fitBounds(e.target.getBounds()); + } + function markOutliers(indicatorMetadataAndGeoJSON, indicatorPropertyName) { + // identify possible data outliers + // mark them using a dedicated property + $scope.outliers_high = []; + $scope.outliers_low = []; + var valueArray = new Array(); + indicatorMetadataAndGeoJSON.geoJSON.features.forEach(function (feature) { + if (!kommonitorDataExchangeService.indicatorValueIsNoData(feature.properties[indicatorPropertyName])) { + if (!valueArray.includes(feature.properties[indicatorPropertyName])) { + valueArray.push(feature.properties[indicatorPropertyName]); + } + } + }); + // https://jstat.github.io/all.html#quartiles + var quartiles = jStat.quartiles(valueArray); + var quartile_25 = quartiles[0]; + var quartile_75 = quartiles[2]; + var diff = quartile_75 - quartile_25; + var whiskerRange_outliers_soft = diff * 1.5; + var whiskerRange_outliers_extreme = diff * 3; + var whisker_low_soft = quartile_25 - whiskerRange_outliers_soft; + var whisker_high_soft = quartile_75 + whiskerRange_outliers_soft; + var whisker_low_extreme = quartile_25 - whiskerRange_outliers_extreme; + var whisker_high_extreme = quartile_75 + whiskerRange_outliers_extreme; + // for now only mark extreme outliers! + indicatorMetadataAndGeoJSON.geoJSON.features.forEach(function (feature) { + // compare feature value to whiskers and set property + if (kommonitorDataExchangeService.indicatorValueIsNoData(feature.properties[indicatorPropertyName])) { + feature.properties[outlierPropertyName] = outlierPropertyValue_no; + } + else if (feature.properties[indicatorPropertyName] < whisker_low_extreme) { + feature.properties[outlierPropertyName] = outlierPropertyValue_low_extreme; + $scope.containsOutliers_low = true; + $scope.outliers_low.push(feature.properties[indicatorPropertyName]); + } + // else if (feature.properties[indicatorPropertyName] < whisker_low_soft){ + // feature.properties[outlierPropertyName] = outlierPropertyValue_low_soft; + // $scope.containsOutliers_low = true; + // $scope.outliers_low.push(feature.properties[indicatorPropertyName]); + // } + else if (feature.properties[indicatorPropertyName] > whisker_high_extreme) { + feature.properties[outlierPropertyName] = outlierPropertyValue_high_extreme; + $scope.containsOutliers_high = true; + $scope.outliers_high.push(feature.properties[indicatorPropertyName]); + } + // else if (feature.properties[indicatorPropertyName] > whisker_high_soft){ + // feature.properties[outlierPropertyName] = outlierPropertyValue_high_soft; + // $scope.containsOutliers_high = true; + // $scope.outliers_high.push(feature.properties[indicatorPropertyName]); + // } + else { + feature.properties[outlierPropertyName] = outlierPropertyValue_no; + } + }); + // sort outliers arrays + $scope.outliers_high.sort(function (a, b) { + return a - b; + }); + $scope.outliers_low.sort(function (a, b) { + return a - b; + }); + return indicatorMetadataAndGeoJSON; } - - if (kommonitorDataExchangeService.isMeasureOfValueChecked) { - var measureOfValueBrewArray = kommonitorVisualStyleHelperService.setupMeasureOfValueBrew($scope.currentGeoJSONOfCurrentLayer, $scope.indicatorPropertyName, defaultColorBrewerPaletteForGtMovValues, defaultColorBrewerPaletteForLtMovValues, kommonitorVisualStyleHelperService.classifyMethod, kommonitorDataExchangeService.measureOfValue); - $scope.gtMeasureOfValueBrew = measureOfValueBrewArray[0]; - $scope.ltMeasureOfValueBrew = measureOfValueBrewArray[1]; - - $scope.currentIndicatorLayer.eachLayer(function (layer) { - if (kommonitorFilterHelperService.featureIsCurrentlyFiltered(layer.feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { - layer.setStyle($scope.filteredStyle); + $scope.setNoDataValuesAsNull = function (indicatorMetadataAndGeoJSON) { + indicatorMetadataAndGeoJSON.geoJSON.features.forEach(function (feature) { + if (kommonitorDataExchangeService.indicatorValueIsNoData(feature.properties[$scope.indicatorPropertyName])) { + feature.properties[$scope.indicatorPropertyName] = null; + } + }); + return indicatorMetadataAndGeoJSON; + }; + $scope.$on("replaceIndicatorAsGeoJSON", function (event, indicatorMetadataAndGeoJSON, spatialUnitName, date, justRestyling, isCustomComputation) { + console.log('replaceIndicatorAsGeoJSON was called'); + kommonitorVisualStyleHelperService.isCustomComputation = false; + if (isCustomComputation) { + kommonitorVisualStyleHelperService.isCustomComputation = true; + } + //reset opacity + kommonitorVisualStyleHelperService.setOpacity(__env.defaultFillOpacity); + refreshFilteredStyle(); + refreshOutliersStyle(); + refreshNoDataStyle(); + $scope.defaultBrew = new classyBrew(); + $scope.gtMeasureOfValueBrew = new classyBrew(); + $scope.ltMeasureOfValueBrew = new classyBrew(); + $scope.currentIndicatorMetadataAndGeoJSON = indicatorMetadataAndGeoJSON; + if (!justRestyling) { + // empty layer of possibly selected features + // kommonitorFilterHelperService.clearSelectedFeatures(); + // kommonitorFilterHelperService.clearFilteredFeatures(); + $rootScope.$broadcast("checkBalanceMenueAndButton"); + } + console.log("Remove old indicatorLayer if exists"); + if ($scope.currentIndicatorLayer) { + $scope.layerControl.removeLayer($scope.currentIndicatorLayer); + $scope.map.removeLayer($scope.currentIndicatorLayer); + } + $scope.currentIndicatorContainsZeroValues = false; + $scope.date = date; + $scope.indicatorPropertyName = INDICATOR_DATE_PREFIX + date; + $scope.indicatorName = indicatorMetadataAndGeoJSON.indicatorName; + $scope.indicatorDescription = indicatorMetadataAndGeoJSON.metadata.description; + $scope.indicatorUnit = indicatorMetadataAndGeoJSON.unit; + $scope.currentIndicatorMetadataAndGeoJSON = $scope.setNoDataValuesAsNull($scope.currentIndicatorMetadataAndGeoJSON); + // identify and mark outliers prior to setting up of styling + // in styling methods, outliers should be removed from classification! + $scope.currentIndicatorMetadataAndGeoJSON = markOutliers($scope.currentIndicatorMetadataAndGeoJSON, $scope.indicatorPropertyName); + kommonitorDataExchangeService.setAllFeaturesProperty(indicatorMetadataAndGeoJSON, $scope.indicatorPropertyName); + kommonitorDataExchangeService.setSelectedFeatureProperty(kommonitorFilterHelperService.selectedIndicatorFeatureIds, $scope.indicatorPropertyName); + $scope.currentGeoJSONOfCurrentLayer = $scope.currentIndicatorMetadataAndGeoJSON.geoJSON; + for (var i = 0; i < indicatorMetadataAndGeoJSON.geoJSON.features.length; i++) { + var containsZero = false; + var containsNoData = false; + if (indicatorMetadataAndGeoJSON.geoJSON.features[i].properties[$scope.indicatorPropertyName] === 0 || indicatorMetadataAndGeoJSON.geoJSON.features[i].properties[$scope.indicatorPropertyName] === "0") { + $scope.currentIndicatorContainsZeroValues = true; + containsZero = true; + } + ; + if (kommonitorDataExchangeService.indicatorValueIsNoData(indicatorMetadataAndGeoJSON.geoJSON.features[i].properties[$scope.indicatorPropertyName])) { + $scope.currentIndicatorContainsNoDataValues = true; + containsNoData = true; + } + ; + if (containsZero && containsNoData) { + break; + } + } + /* ///////////////////////////////// RASTER SPECIAL TREATMENT + // improve Raster display by eliminiating NoData cells and + // omitting display border in style + */ + if (kommonitorDataExchangeService.selectedSpatialUnitIsRaster()) { + indicatorMetadataAndGeoJSON.geoJSON.features = indicatorMetadataAndGeoJSON.geoJSON.features.filter(feature => { + if (kommonitorDataExchangeService.indicatorValueIsNoData(feature.properties[$scope.indicatorPropertyName])) { + return false; + } + return true; + }); + } + var layer; + $scope.indicatorTypeOfCurrentLayer = indicatorMetadataAndGeoJSON.indicatorType; + if (kommonitorDataExchangeService.isMeasureOfValueChecked) { + var measureOfValueBrewArray = kommonitorVisualStyleHelperService.setupMeasureOfValueBrew($scope.currentGeoJSONOfCurrentLayer, $scope.indicatorPropertyName, defaultColorBrewerPaletteForGtMovValues, defaultColorBrewerPaletteForLtMovValues, kommonitorVisualStyleHelperService.classifyMethod, kommonitorDataExchangeService.measureOfValue); + $scope.gtMeasureOfValueBrew = measureOfValueBrewArray[0]; + $scope.ltMeasureOfValueBrew = measureOfValueBrewArray[1]; + $scope.propertyName = INDICATOR_DATE_PREFIX + date; + layer = L.geoJSON(indicatorMetadataAndGeoJSON.geoJSON, { + style: function (feature) { + if (kommonitorFilterHelperService.featureIsCurrentlyFiltered(feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { + return $scope.filteredStyle; + } + return kommonitorVisualStyleHelperService.styleMeasureOfValue(feature, $scope.gtMeasureOfValueBrew, $scope.ltMeasureOfValueBrew, $scope.propertyName, $scope.useTransparencyOnIndicator); + }, + onEachFeature: onEachFeatureIndicator + }); + // $scope.makeMeasureOfValueLegend(isCustomComputation); } else { - style = kommonitorVisualStyleHelperService.styleMeasureOfValue(layer.feature, $scope.gtMeasureOfValueBrew, $scope.ltMeasureOfValueBrew, $scope.propertyName, $scope.useTransparencyOnIndicator); - - layer.setStyle(style); - } - - }); - - // $scope.makeMeasureOfValueLegend(); - } - else { - - if ($scope.indicatorTypeOfCurrentLayer.includes('DYNAMIC')) { - var dynamicIndicatorBrewArray = kommonitorVisualStyleHelperService.setupDynamicIndicatorBrew($scope.currentIndicatorMetadataAndGeoJSON.geoJSON, $scope.indicatorPropertyName, defaultColorBrewerPaletteForBalanceIncreasingValues, defaultColorBrewerPaletteForBalanceDecreasingValues, kommonitorVisualStyleHelperService.classifyMethod); - $scope.dynamicIncreaseBrew = dynamicIndicatorBrewArray[0]; - $scope.dynamicDecreaseBrew = dynamicIndicatorBrewArray[1]; - - $scope.currentIndicatorLayer.eachLayer(function (layer) { - if (kommonitorFilterHelperService.featureIsCurrentlyFiltered(layer.feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { - layer.setStyle($scope.filteredStyle); - } - else { - style = kommonitorVisualStyleHelperService.styleDynamicIndicator(layer.feature, $scope.dynamicIncreaseBrew, $scope.dynamicDecreaseBrew, $scope.propertyName, $scope.useTransparencyOnIndicator); - - layer.setStyle(style); - } - + if (indicatorMetadataAndGeoJSON.indicatorType.includes("STATUS")) { + $scope.datasetContainsNegativeValues = $scope.containsNegativeValues(indicatorMetadataAndGeoJSON.geoJSON); + if ($scope.datasetContainsNegativeValues) { + var dynamicIndicatorBrewArray = kommonitorVisualStyleHelperService.setupDynamicIndicatorBrew(indicatorMetadataAndGeoJSON.geoJSON, $scope.indicatorPropertyName, defaultColorBrewerPaletteForBalanceIncreasingValues, defaultColorBrewerPaletteForBalanceDecreasingValues, kommonitorVisualStyleHelperService.classifyMethod); + $scope.dynamicIncreaseBrew = dynamicIndicatorBrewArray[0]; + $scope.dynamicDecreaseBrew = dynamicIndicatorBrewArray[1]; + } + else { + $scope.defaultBrew = kommonitorVisualStyleHelperService.setupDefaultBrew(indicatorMetadataAndGeoJSON.geoJSON, $scope.indicatorPropertyName, indicatorMetadataAndGeoJSON.defaultClassificationMapping.items.length, indicatorMetadataAndGeoJSON.defaultClassificationMapping.colorBrewerSchemeName, kommonitorVisualStyleHelperService.classifyMethod); + } + $scope.propertyName = INDICATOR_DATE_PREFIX + date; + layer = L.geoJSON(indicatorMetadataAndGeoJSON.geoJSON, { + style: function (feature) { + if (kommonitorFilterHelperService.featureIsCurrentlyFiltered(feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { + return $scope.filteredStyle; + } + return kommonitorVisualStyleHelperService.styleDefault(feature, $scope.defaultBrew, $scope.dynamicIncreaseBrew, $scope.dynamicDecreaseBrew, $scope.propertyName, $scope.useTransparencyOnIndicator, $scope.datasetContainsNegativeValues); + }, + onEachFeature: onEachFeatureIndicator + }); + // $scope.makeDefaultLegend(indicatorMetadataAndGeoJSON.defaultClassificationMapping, $scope.datasetContainsNegativeValues, isCustomComputation); + } + else if (indicatorMetadataAndGeoJSON.indicatorType.includes("DYNAMIC")) { + var dynamicIndicatorBrewArray = kommonitorVisualStyleHelperService.setupDynamicIndicatorBrew(indicatorMetadataAndGeoJSON.geoJSON, $scope.indicatorPropertyName, defaultColorBrewerPaletteForBalanceIncreasingValues, defaultColorBrewerPaletteForBalanceDecreasingValues, kommonitorVisualStyleHelperService.classifyMethod); + $scope.dynamicIncreaseBrew = dynamicIndicatorBrewArray[0]; + $scope.dynamicDecreaseBrew = dynamicIndicatorBrewArray[1]; + $scope.propertyName = INDICATOR_DATE_PREFIX + date; + layer = L.geoJSON(indicatorMetadataAndGeoJSON.geoJSON, { + style: function (feature) { + if (kommonitorFilterHelperService.featureIsCurrentlyFiltered(feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { + return $scope.filteredStyle; + } + return kommonitorVisualStyleHelperService.styleDynamicIndicator(feature, $scope.dynamicIncreaseBrew, $scope.dynamicDecreaseBrew, $scope.propertyName, $scope.useTransparencyOnIndicator); + }, + onEachFeature: onEachFeatureIndicator + }); + // $scope.makeDynamicIndicatorLegend(isCustomComputation); + } + } + $scope.currentIndicatorLayer = layer; + $rootScope.$broadcast("updateLegendDisplay", $scope.currentIndicatorContainsZeroValues, $scope.datasetContainsNegativeValues, $scope.currentIndicatorContainsNoDataValues, $scope.containsOutliers_high, $scope.containsOutliers_low, $scope.outliers_low, $scope.outliers_high, kommonitorDataExchangeService.selectedDate); + // if(spatialUnitName.includes("raster") || spatialUnitName.includes("Raster") || spatialUnitName.includes("grid") || spatialUnitName.includes("Grid")){ + // layer.style.color = undefined; + // } + // layer.StyledLayerControl = { + // removable : false, + // visible : true + // }; + var layerName = indicatorMetadataAndGeoJSON.indicatorName + "_" + spatialUnitName + "_" + date; + if (isCustomComputation) { + layerName += " - individuelles Berechnungsergebnis"; + } + $scope.layerControl.addOverlay(layer, layerName, indicatorLayerGroupName); + layer.addTo($scope.map); + $scope.updateSearchControl(); + // var justRestyling = false; + // fitBounds(); + if ($scope.containsOutliers_low || $scope.containsOutliers_high) { + $scope.showOutlierInfoAlert = true; + } + $rootScope.$broadcast("updateDiagrams", $scope.currentIndicatorMetadataAndGeoJSON, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitId, date, $scope.defaultBrew, $scope.gtMeasureOfValueBrew, $scope.ltMeasureOfValueBrew, $scope.dynamicIncreaseBrew, $scope.dynamicDecreaseBrew, kommonitorDataExchangeService.isMeasureOfValueChecked, kommonitorDataExchangeService.measureOfValue, justRestyling); + $rootScope.$broadcast("indicatortMapDisplayFinished"); + $scope.map.invalidateSize(true); + }); + $scope.containsNegativeValues = function (geoJSON) { + var containsNegativeValues = false; + $scope.datasetContainsNegativeValues = false; + for (var i = 0; i < geoJSON.features.length; i++) { + if (geoJSON.features[i].properties[$scope.indicatorPropertyName] < 0) { + containsNegativeValues = true; + break; + } + } + return containsNegativeValues; + }; + $scope.$on("restyleCurrentLayer", function (event, skipDiagramRefresh) { + // var transparency = document.getElementById("indicatorTransparencyInput").value; + // var opacity = 1 - transparency; + // + // kommonitorVisualStyleHelperService.setOpacity(opacity); + refreshFilteredStyle(); + refreshOutliersStyle(); + refreshNoDataStyle(); + $scope.defaultBrew = new classyBrew(); + $scope.gtMeasureOfValueBrew = new classyBrew(); + $scope.ltMeasureOfValueBrew = new classyBrew(); + var style; + if ($scope.currentIndicatorLayer) { + $scope.currentIndicatorMetadataAndGeoJSON = markOutliers($scope.currentIndicatorMetadataAndGeoJSON, $scope.indicatorPropertyName); + $scope.currentGeoJSONOfCurrentLayer = $scope.currentIndicatorMetadataAndGeoJSON.geoJSON; + $scope.currentIndicatorContainsZeroValues = false; + for (var i = 0; i < $scope.currentIndicatorMetadataAndGeoJSON.geoJSON.features.length; i++) { + var containsZero = false; + var containsNoData = false; + if ($scope.currentIndicatorMetadataAndGeoJSON.geoJSON.features[i].properties[$scope.indicatorPropertyName] === 0 || $scope.currentIndicatorMetadataAndGeoJSON.geoJSON.features[i].properties[$scope.indicatorPropertyName] === "0") { + $scope.currentIndicatorContainsZeroValues = true; + containsZero = true; + } + ; + if (kommonitorDataExchangeService.indicatorValueIsNoData($scope.currentIndicatorMetadataAndGeoJSON.geoJSON.features[i].properties[$scope.indicatorPropertyName])) { + $scope.currentIndicatorContainsNoDataValues = true; + containsNoData = true; + } + ; + if (containsZero && containsNoData) { + break; + } + } + if (kommonitorDataExchangeService.isMeasureOfValueChecked) { + var measureOfValueBrewArray = kommonitorVisualStyleHelperService.setupMeasureOfValueBrew($scope.currentGeoJSONOfCurrentLayer, $scope.indicatorPropertyName, defaultColorBrewerPaletteForGtMovValues, defaultColorBrewerPaletteForLtMovValues, kommonitorVisualStyleHelperService.classifyMethod, kommonitorDataExchangeService.measureOfValue); + $scope.gtMeasureOfValueBrew = measureOfValueBrewArray[0]; + $scope.ltMeasureOfValueBrew = measureOfValueBrewArray[1]; + $scope.currentIndicatorLayer.eachLayer(function (layer) { + if (kommonitorFilterHelperService.featureIsCurrentlyFiltered(layer.feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { + layer.setStyle($scope.filteredStyle); + } + else { + style = kommonitorVisualStyleHelperService.styleMeasureOfValue(layer.feature, $scope.gtMeasureOfValueBrew, $scope.ltMeasureOfValueBrew, $scope.propertyName, $scope.useTransparencyOnIndicator); + layer.setStyle(style); + } + }); + // $scope.makeMeasureOfValueLegend(); + } + else { + if ($scope.indicatorTypeOfCurrentLayer.includes('DYNAMIC')) { + var dynamicIndicatorBrewArray = kommonitorVisualStyleHelperService.setupDynamicIndicatorBrew($scope.currentIndicatorMetadataAndGeoJSON.geoJSON, $scope.indicatorPropertyName, defaultColorBrewerPaletteForBalanceIncreasingValues, defaultColorBrewerPaletteForBalanceDecreasingValues, kommonitorVisualStyleHelperService.classifyMethod); + $scope.dynamicIncreaseBrew = dynamicIndicatorBrewArray[0]; + $scope.dynamicDecreaseBrew = dynamicIndicatorBrewArray[1]; + $scope.currentIndicatorLayer.eachLayer(function (layer) { + if (kommonitorFilterHelperService.featureIsCurrentlyFiltered(layer.feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { + layer.setStyle($scope.filteredStyle); + } + else { + style = kommonitorVisualStyleHelperService.styleDynamicIndicator(layer.feature, $scope.dynamicIncreaseBrew, $scope.dynamicDecreaseBrew, $scope.propertyName, $scope.useTransparencyOnIndicator); + layer.setStyle(style); + } + }); + // $scope.makeDynamicIndicatorLegend(); + } + else { + $scope.datasetContainsNegativeValues = $scope.containsNegativeValues($scope.currentGeoJSONOfCurrentLayer); + if ($scope.datasetContainsNegativeValues) { + var dynamicIndicatorBrewArray = kommonitorVisualStyleHelperService.setupDynamicIndicatorBrew($scope.currentIndicatorMetadataAndGeoJSON.geoJSON, $scope.indicatorPropertyName, defaultColorBrewerPaletteForBalanceIncreasingValues, defaultColorBrewerPaletteForBalanceDecreasingValues, kommonitorVisualStyleHelperService.classifyMethod); + $scope.dynamicIncreaseBrew = dynamicIndicatorBrewArray[0]; + $scope.dynamicDecreaseBrew = dynamicIndicatorBrewArray[1]; + } + else { + $scope.defaultBrew = kommonitorVisualStyleHelperService.setupDefaultBrew($scope.currentGeoJSONOfCurrentLayer, $scope.indicatorPropertyName, $scope.currentIndicatorMetadataAndGeoJSON.defaultClassificationMapping.items.length, $scope.currentIndicatorMetadataAndGeoJSON.defaultClassificationMapping.colorBrewerSchemeName, kommonitorVisualStyleHelperService.classifyMethod); + } + $scope.currentIndicatorLayer.eachLayer(function (layer) { + if (kommonitorFilterHelperService.featureIsCurrentlyFiltered(layer.feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { + layer.setStyle($scope.filteredStyle); + } + else { + style = kommonitorVisualStyleHelperService.styleDefault(layer.feature, $scope.defaultBrew, $scope.dynamicIncreaseBrew, $scope.dynamicDecreaseBrew, $scope.propertyName, $scope.useTransparencyOnIndicator, $scope.datasetContainsNegativeValues); + layer.setStyle(style); + } + }); + // $scope.makeDefaultLegend(kommonitorDataExchangeService.selectedIndicator.defaultClassificationMapping, $scope.datasetContainsNegativeValues); + } + } + $rootScope.$broadcast("updateLegendDisplay", $scope.currentIndicatorContainsZeroValues, $scope.datasetContainsNegativeValues, $scope.currentIndicatorContainsNoDataValues, $scope.containsOutliers_high, $scope.containsOutliers_low, $scope.outliers_low, $scope.outliers_high, kommonitorDataExchangeService.selectedDate); + if (!skipDiagramRefresh) { + var justRestyling = true; + $rootScope.$broadcast("updateDiagrams", $scope.currentIndicatorMetadataAndGeoJSON, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitId, $scope.date, $scope.defaultBrew, $scope.gtMeasureOfValueBrew, $scope.ltMeasureOfValueBrew, $scope.dynamicIncreaseBrew, $scope.dynamicDecreaseBrew, kommonitorDataExchangeService.isMeasureOfValueChecked, kommonitorDataExchangeService.measureOfValue, justRestyling); + } + //ensure that highlighted feature remain highlighted + preserveHighlightedFeatures(); + } + $scope.map.invalidateSize(true); + }); + $scope.$on("highlightFeatureOnMap", function (event, spatialFeatureName) { + // console.log("highlight feature on map for featureName " + spatialFeatureName); + if (!spatialFeatureName) { + return; + } + var done = false; + $scope.map.eachLayer(function (layer) { + if (!done && layer.feature) { + if (layer.feature.properties[__env.FEATURE_NAME_PROPERTY_NAME] == spatialFeatureName) { + highlightFeatureForLayer(layer); + done = true; + } + } }); - // $scope.makeDynamicIndicatorLegend(); - } - else { - $scope.datasetContainsNegativeValues = $scope.containsNegativeValues($scope.currentGeoJSONOfCurrentLayer); - if ($scope.datasetContainsNegativeValues) { - var dynamicIndicatorBrewArray = kommonitorVisualStyleHelperService.setupDynamicIndicatorBrew($scope.currentIndicatorMetadataAndGeoJSON.geoJSON, $scope.indicatorPropertyName, defaultColorBrewerPaletteForBalanceIncreasingValues, defaultColorBrewerPaletteForBalanceDecreasingValues, kommonitorVisualStyleHelperService.classifyMethod); - $scope.dynamicIncreaseBrew = dynamicIndicatorBrewArray[0]; - $scope.dynamicDecreaseBrew = dynamicIndicatorBrewArray[1]; + }); + $scope.$on("unhighlightFeatureOnMap", function (event, spatialFeatureName) { + if (!spatialFeatureName) { + return; } - else { - $scope.defaultBrew = kommonitorVisualStyleHelperService.setupDefaultBrew($scope.currentGeoJSONOfCurrentLayer, $scope.indicatorPropertyName, $scope.currentIndicatorMetadataAndGeoJSON.defaultClassificationMapping.items.length, $scope.currentIndicatorMetadataAndGeoJSON.defaultClassificationMapping.colorBrewerSchemeName, kommonitorVisualStyleHelperService.classifyMethod); + // console.log("unhighlight feature on map for featureName " + spatialFeatureName); + var done = false; + $scope.map.eachLayer(function (layer) { + if (!done && layer.feature) { + if (layer.feature.properties[__env.FEATURE_NAME_PROPERTY_NAME] == spatialFeatureName) { + resetHighlightForLayer(layer); + done = true; + } + } + }); + }); + $scope.$on("switchHighlightFeatureOnMap", function (event, spatialFeatureName) { + if (!spatialFeatureName) { + return; } - - $scope.currentIndicatorLayer.eachLayer(function (layer) { - if (kommonitorFilterHelperService.featureIsCurrentlyFiltered(layer.feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { - layer.setStyle($scope.filteredStyle); - } - else { - style = kommonitorVisualStyleHelperService.styleDefault(layer.feature, $scope.defaultBrew, $scope.dynamicIncreaseBrew, $scope.dynamicDecreaseBrew, $scope.propertyName, $scope.useTransparencyOnIndicator, $scope.datasetContainsNegativeValues); - layer.setStyle(style); - } + // console.log("switch highlight feature on map for featureName " + spatialFeatureName); + var done = false; + $scope.map.eachLayer(function (layer) { + if (!done && layer.feature) { + if (layer.feature.properties[__env.FEATURE_NAME_PROPERTY_NAME] == spatialFeatureName) { + switchHighlightFeature(layer); + done = true; + } + } }); - // $scope.makeDefaultLegend(kommonitorDataExchangeService.selectedIndicator.defaultClassificationMapping, $scope.datasetContainsNegativeValues); - } - - } - - $rootScope.$broadcast("updateLegendDisplay", $scope.currentIndicatorContainsZeroValues, $scope.datasetContainsNegativeValues, $scope.currentIndicatorContainsNoDataValues, $scope.containsOutliers_high, $scope.containsOutliers_low, $scope.outliers_low, $scope.outliers_high, kommonitorDataExchangeService.selectedDate); - - if (!skipDiagramRefresh) { - var justRestyling = true; - - $rootScope.$broadcast("updateDiagrams", $scope.currentIndicatorMetadataAndGeoJSON, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitId, $scope.date, $scope.defaultBrew, $scope.gtMeasureOfValueBrew, $scope.ltMeasureOfValueBrew, $scope.dynamicIncreaseBrew, $scope.dynamicDecreaseBrew, kommonitorDataExchangeService.isMeasureOfValueChecked, kommonitorDataExchangeService.measureOfValue, justRestyling); - } - - //ensure that highlighted feature remain highlighted - preserveHighlightedFeatures(); - } - - $scope.map.invalidateSize(true); - - }); - - $scope.$on("highlightFeatureOnMap", function (event, spatialFeatureName) { - - // console.log("highlight feature on map for featureName " + spatialFeatureName); - - if(!spatialFeatureName){ - return; - } - var done = false; - - $scope.map.eachLayer(function (layer) { - if (!done && layer.feature) { - if (layer.feature.properties[__env.FEATURE_NAME_PROPERTY_NAME] == spatialFeatureName) { - highlightFeatureForLayer(layer); - done = true; - } - } - - }); - - }); - - $scope.$on("unhighlightFeatureOnMap", function (event, spatialFeatureName) { - if(!spatialFeatureName){ - return; - } - - // console.log("unhighlight feature on map for featureName " + spatialFeatureName); - - var done = false; - - $scope.map.eachLayer(function (layer) { - if (!done && layer.feature) { - if (layer.feature.properties[__env.FEATURE_NAME_PROPERTY_NAME] == spatialFeatureName) { - resetHighlightForLayer(layer); - done = true; - } - } - - }); - - }); - - $scope.$on("switchHighlightFeatureOnMap", function (event, spatialFeatureName) { - if(!spatialFeatureName){ - return; - } - - // console.log("switch highlight feature on map for featureName " + spatialFeatureName); - - var done = false; - - $scope.map.eachLayer(function (layer) { - if (!done && layer.feature) { - if (layer.feature.properties[__env.FEATURE_NAME_PROPERTY_NAME] == spatialFeatureName) { - switchHighlightFeature(layer); - done = true; - } - } - - }); - - }); - - $scope.$on("unselectAllFeatures", function (event) { - - kommonitorFilterHelperService.clearSelectedFeatures(); - $rootScope.$broadcast("restyleCurrentLayer", false); - }); - - $scope.$on("removeAllDrawnPoints", function (event) { - - if ($scope.drawnPointFeatures) { - $scope.drawnPointFeatures.clearLayers(); - $rootScope.$broadcast("onUpdateDrawnPointFeatures"); - } - }); - - $scope.$on("enablePointDrawTool", function (event) { - - // FeatureGroup is to store editable layers - if (!$scope.drawnPointFeatures) { - $scope.drawnPointFeatures = new L.FeatureGroup(); - } - - L.drawLocal = { - edit: { - toolbar: { - actions: { - save: { - title: "Bearbeitung speichern.", - text: "Speichern", - }, - cancel: { - title: "Bearbeitung verwerfen.", - text: "Abbrechen", - }, - clearAll: { - title: "Alle Features entfernen.", - text: "Alle Features entfernen", - }, - }, - buttons: { - edit: "Layer editieren.", - editDisabled: "Keine Layer zum editieren vorhanden.", - remove: "Layer entfernen.", - removeDisabled: "Keine Layer zum entfernen vorhanden.", - }, - }, - handlers: { - edit: { - tooltip: { - text: "Bearbeitungspunkte oder Punktmarker ziehen, um Feature zu editieren.", - subtext: "Abbrechen klicken, um Bearbeitung zu verwefen.", - }, - }, - remove: { - tooltip: { - text: "Feature anklicken, um es zu entfernen", - }, - }, - } - }, - draw: { - toolbar: { - actions: { - title: "Zeichnen abbrechen", - text: "Abbrechen", - }, - finish: { - title: "Zeichnen beenden", - text: "Beenden", - }, - undo: { - title: "Zuletzt gezeichneten Punkt entfernen", - text: "Letzten Punkt entfernen", - }, - buttons: { - polyline: "Polylinie zeichnen", - polygon: "Polygon zeichnen", - rectangle: "Rechteck zeichnen", - circle: "Kreis zeichnen", - marker: "Punkt zeichnen", - circlemarker: "Kreispunkt zeichnen", - }, - }, - handlers: { - circle: { - tooltip: { - start: "Klicken und halten, um Kreis zu zeichnen.", - }, - radius: "Radius", - }, - circlemarker: { - tooltip: { - start: "Klicken, um einen Punkt zu markieren.", - }, - }, - marker: { - tooltip: { - start: "Klicken, um einen Punkt zu markieren.", - }, - }, - polygon: { - tooltip: { - start: "Klicken, um ein Polygon zu beginnen.", - cont: "Klicken, um das Polygon weiter zu zeichnen.", - end: "Ersten Punkt anklicken, um Polygon zu beenden.", - }, - }, - polyline: { - error: "Fehler: Selbstueberschneidung!", - tooltip: { - start: "Klicken, um eine Polylinie zu beginnen.", - cont: "Klicken, um die Polylinie weiter zu zeichnen.", - end: "Letzten Punkt erneut anklicken, um Polylinie zu beenden.", - }, - }, - rectangle: { - tooltip: { - start: "Klicken und halten, um Rechteck zu zeichnen.", - }, - }, - simpleshape: { - tooltip: { - end: "Maus loslassen, um Zeichnung zu beenden.", - }, - }, - } - } - - }; - - $scope.map.addLayer($scope.drawnPointFeatures); - $scope.drawPointControl = new L.Control.Draw({ - edit: { - featureGroup: $scope.drawnPointFeatures - }, - draw: { - polyline: false, - polygon: false, - rectangle: false, - circle: false, - circlemarker: false - }, - position: 'bottomleft' - - }); - - $scope.map.addControl($scope.drawPointControl); - - $scope.map.on(L.Draw.Event.CREATED, function (event) { - var layer = event.layer; - - $scope.drawnPointFeatures.addLayer(layer); - - $rootScope.$broadcast("onUpdateDrawnPointFeatures", $scope.drawnPointFeatures); - }); - - $scope.map.on(L.Draw.Event.EDITED, function (event) { - - $rootScope.$broadcast("onUpdateDrawnPointFeatures", $scope.drawnPointFeatures); - }); - - $scope.map.on(L.Draw.Event.DELETED, function (event) { - - $rootScope.$broadcast("onUpdateDrawnPointFeatures", $scope.drawnPointFeatures); - }); - - }); - - $scope.$on("disablePointDrawTool", function (event) { - - try { - $scope.drawPointControl = undefined; - $scope.map.removeLayer($scope.drawnPointFeatures); - $scope.map.removeControl($scope.drawPointControl); - } - catch (error) { - // kommonitorDataExchangeService.displayMapApplicationError(error); - } - - }); - - $scope.$on("zoomToGeoresourceLayer", async function (event, georesourceMetadata) { - - let layerName = georesourceMetadata.datasetName; - - let layerGroupName = undefined; - - if (georesourceMetadata.isPOI){ - layerGroupName = poiLayerGroupName; - } - else if(georesourceMetadata.isLOI){ - layerGroupName = loiLayerGroupName; - } - else if(georesourceMetadata.isAOI){ - layerGroupName = aoiLayerGroupName; - } - - $scope.layerControl._layers.forEach(function (layer) { - if (layerGroupName && layer.group.name === layerGroupName && layer.name.includes(layerName + "_")) { - $scope.map.fitBounds(layer.layer.getBounds()); - } - else if (layer.name.includes(layerName + "_")){ - $scope.map.fitBounds(layer.layer.getBounds()); - } - }); - }); - - } + }); + $scope.$on("unselectAllFeatures", function (event) { + kommonitorFilterHelperService.clearSelectedFeatures(); + $rootScope.$broadcast("restyleCurrentLayer", false); + }); + $scope.$on("removeAllDrawnPoints", function (event) { + if ($scope.drawnPointFeatures) { + $scope.drawnPointFeatures.clearLayers(); + $rootScope.$broadcast("onUpdateDrawnPointFeatures"); + } + }); + $scope.$on("enablePointDrawTool", function (event) { + // FeatureGroup is to store editable layers + if (!$scope.drawnPointFeatures) { + $scope.drawnPointFeatures = new L.FeatureGroup(); + } + L.drawLocal = { + edit: { + toolbar: { + actions: { + save: { + title: "Bearbeitung speichern.", + text: "Speichern", + }, + cancel: { + title: "Bearbeitung verwerfen.", + text: "Abbrechen", + }, + clearAll: { + title: "Alle Features entfernen.", + text: "Alle Features entfernen", + }, + }, + buttons: { + edit: "Layer editieren.", + editDisabled: "Keine Layer zum editieren vorhanden.", + remove: "Layer entfernen.", + removeDisabled: "Keine Layer zum entfernen vorhanden.", + }, + }, + handlers: { + edit: { + tooltip: { + text: "Bearbeitungspunkte oder Punktmarker ziehen, um Feature zu editieren.", + subtext: "Abbrechen klicken, um Bearbeitung zu verwefen.", + }, + }, + remove: { + tooltip: { + text: "Feature anklicken, um es zu entfernen", + }, + }, + } + }, + draw: { + toolbar: { + actions: { + title: "Zeichnen abbrechen", + text: "Abbrechen", + }, + finish: { + title: "Zeichnen beenden", + text: "Beenden", + }, + undo: { + title: "Zuletzt gezeichneten Punkt entfernen", + text: "Letzten Punkt entfernen", + }, + buttons: { + polyline: "Polylinie zeichnen", + polygon: "Polygon zeichnen", + rectangle: "Rechteck zeichnen", + circle: "Kreis zeichnen", + marker: "Punkt zeichnen", + circlemarker: "Kreispunkt zeichnen", + }, + }, + handlers: { + circle: { + tooltip: { + start: "Klicken und halten, um Kreis zu zeichnen.", + }, + radius: "Radius", + }, + circlemarker: { + tooltip: { + start: "Klicken, um einen Punkt zu markieren.", + }, + }, + marker: { + tooltip: { + start: "Klicken, um einen Punkt zu markieren.", + }, + }, + polygon: { + tooltip: { + start: "Klicken, um ein Polygon zu beginnen.", + cont: "Klicken, um das Polygon weiter zu zeichnen.", + end: "Ersten Punkt anklicken, um Polygon zu beenden.", + }, + }, + polyline: { + error: "Fehler: Selbstueberschneidung!", + tooltip: { + start: "Klicken, um eine Polylinie zu beginnen.", + cont: "Klicken, um die Polylinie weiter zu zeichnen.", + end: "Letzten Punkt erneut anklicken, um Polylinie zu beenden.", + }, + }, + rectangle: { + tooltip: { + start: "Klicken und halten, um Rechteck zu zeichnen.", + }, + }, + simpleshape: { + tooltip: { + end: "Maus loslassen, um Zeichnung zu beenden.", + }, + }, + } + } + }; + $scope.map.addLayer($scope.drawnPointFeatures); + $scope.drawPointControl = new L.Control.Draw({ + edit: { + featureGroup: $scope.drawnPointFeatures + }, + draw: { + polyline: false, + polygon: false, + rectangle: false, + circle: false, + circlemarker: false + }, + position: 'bottomleft' + }); + $scope.map.addControl($scope.drawPointControl); + $scope.map.on(L.Draw.Event.CREATED, function (event) { + var layer = event.layer; + $scope.drawnPointFeatures.addLayer(layer); + $rootScope.$broadcast("onUpdateDrawnPointFeatures", $scope.drawnPointFeatures); + }); + $scope.map.on(L.Draw.Event.EDITED, function (event) { + $rootScope.$broadcast("onUpdateDrawnPointFeatures", $scope.drawnPointFeatures); + }); + $scope.map.on(L.Draw.Event.DELETED, function (event) { + $rootScope.$broadcast("onUpdateDrawnPointFeatures", $scope.drawnPointFeatures); + }); + }); + $scope.$on("disablePointDrawTool", function (event) { + try { + $scope.drawPointControl = undefined; + $scope.map.removeLayer($scope.drawnPointFeatures); + $scope.map.removeControl($scope.drawPointControl); + } + catch (error) { + // kommonitorDataExchangeService.displayMapApplicationError(error); + } + }); + $scope.$on("zoomToGeoresourceLayer", async function (event, georesourceMetadata) { + let layerName = georesourceMetadata.datasetName; + let layerGroupName = undefined; + if (georesourceMetadata.isPOI) { + layerGroupName = poiLayerGroupName; + } + else if (georesourceMetadata.isLOI) { + layerGroupName = loiLayerGroupName; + } + else if (georesourceMetadata.isAOI) { + layerGroupName = aoiLayerGroupName; + } + $scope.layerControl._layers.forEach(function (layer) { + if (layerGroupName && layer.group.name === layerGroupName && layer.name.includes(layerName + "_")) { + $scope.map.fitBounds(layer.layer.getBounds()); + } + else if (layer.name.includes(layerName + "_")) { + $scope.map.fitBounds(layer.layer.getBounds()); + } + }); + }); + } ] - }); +}); +//# sourceMappingURL=kommonitor-map.component.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorMap/kommonitor-map.component.js.map b/app/components/kommonitorUserInterface/kommonitorMap/kommonitor-map.component.js.map new file mode 100644 index 000000000..4306fbc6f --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorMap/kommonitor-map.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-map.component.js","sourceRoot":"","sources":["kommonitor-map.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,SAAS,CACvC,eAAe,EACf;IACE,WAAW,EAAE,+EAA+E;IAC5F,UAAU,EAAE;QACV,YAAY;QACZ,OAAO;QACP,QAAQ;QACR,UAAU;QACV,sBAAsB;QACtB,+BAA+B;QAC/B,oCAAoC;QACpC,mCAAmC;QACnC,+BAA+B;QAC/B,OAAO;QACP,SAAS,aAAa,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,oBAAoB,EAAE,6BAA6B,EAAE,kCAAkC,EACjJ,iCAAiC,EAAE,6BAA6B,EAAE,KAAK;YAEvE,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAE3E,MAAM,qBAAqB,GAAG,KAAK,CAAC,mBAAmB,CAAC;YACxD,MAAM,gBAAgB,GAAG,KAAK,CAAC,gBAAgB,CAAC;YAChD,IAAI,6BAA6B,GAAG,KAAK,CAAC,6BAA6B,CAAC;YACxE,IAAI,mCAAmC,GAAG,KAAK,CAAC,mCAAmC,CAAC;YACpF,IAAI,kBAAkB,GAAG,KAAK,CAAC,kBAAkB,CAAC;YAClD,IAAI,kBAAkB,GAAG,KAAK,CAAC,kBAAkB,CAAC;YAClD,I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MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC;qBAC/C;yBACI,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,GAAG,GAAG,CAAC,EAAC;wBAC5C,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC;qBAC/C;gBACH,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QAEL,CAAC;KACF;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorMap/kommonitor-map.component.ts b/app/components/kommonitorUserInterface/kommonitorMap/kommonitor-map.component.ts new file mode 100644 index 000000000..518355fc5 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorMap/kommonitor-map.component.ts @@ -0,0 +1,3484 @@ +angular.module('kommonitorMap').component( + 'kommonitorMap', + { + templateUrl: "components/kommonitorUserInterface/kommonitorMap/kommonitor-map.template.html", + controller: [ + '$rootScope', + '$http', + '$scope', + '$timeout', + 'kommonitorMapService', + 'kommonitorDataExchangeService', + 'kommonitorVisualStyleHelperService', + 'kommonitorInfoLegendHelperService', + 'kommonitorFilterHelperService', + '__env', + function MapController($rootScope, $http, $scope, $timeout, kommonitorMapService, kommonitorDataExchangeService, kommonitorVisualStyleHelperService, + kommonitorInfoLegendHelperService, kommonitorFilterHelperService, __env) { + + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + + const INDICATOR_DATE_PREFIX = __env.indicatorDatePrefix; + const numberOfDecimals = __env.numberOfDecimals; + var defaultColorForFilteredValues = __env.defaultColorForFilteredValues; + var defaultBorderColorForFilteredValues = __env.defaultBorderColorForFilteredValues; + var defaultBorderColor = __env.defaultBorderColor; + var defaultFillOpacity = __env.defaultFillOpacity; + var defaultFillOpacityForFilteredFeatures = __env.defaultFillOpacityForFilteredFeatures; + var defaultFillOpacityForHighlightedFeatures = __env.defaultFillOpacityForHighlightedFeatures; + var defaultFillOpacityForZeroFeatures = __env.defaultFillOpacityForZeroFeatures; + var defaultColorBrewerPaletteForBalanceIncreasingValues = __env.defaultColorBrewerPaletteForBalanceIncreasingValues; + var defaultColorBrewerPaletteForBalanceDecreasingValues = __env.defaultColorBrewerPaletteForBalanceDecreasingValues; + var defaultColorBrewerPaletteForGtMovValues = __env.defaultColorBrewerPaletteForGtMovValues; + var defaultColorBrewerPaletteForLtMovValues = __env.defaultColorBrewerPaletteForLtMovValues; + var defaultColorForHoveredFeatures = __env.defaultColorForHoveredFeatures; + var defaultColorForClickedFeatures = __env.defaultColorForClickedFeatures; + var defaultBorderColorForNoDataValues = __env.defaultBorderColorForNoDataValues; + var defaultColorForNoDataValues = __env.defaultColorForNoDataValues; + var defaultFillOpacityForNoDataValues = __env.defaultFillOpacityForNoDataValues; + + + var defaultColorForOutliers_high = __env.defaultColorForOutliers_high; + var defaultBorderColorForOutliers_high = __env.defaultBorderColorForOutliers_high; + var defaultFillOpacityForOutliers_high = __env.defaultFillOpacityForOutliers_high; + var defaultColorForOutliers_low = __env.defaultColorForOutliers_low; + var defaultBorderColorForOutliers_low = __env.defaultBorderColorForOutliers_low; + var defaultFillOpacityForOutliers_low = __env.defaultFillOpacityForOutliers_low; + var useOutlierDetectionOnIndicator = __env.useOutlierDetectionOnIndicator; + + const outlierPropertyName = "outlier"; + const outlierPropertyValue_high_soft = "high-soft"; + const outlierPropertyValue_low_soft = "low-soft"; + const outlierPropertyValue_high_extreme = "high-extreme"; + const outlierPropertyValue_low_extreme = "low-extreme"; + const outlierPropertyValue_no = "no"; + + $scope.containsOutliers_high = false; + $scope.containsOutliers_low = false; + $scope.outliers_high = undefined; + $scope.outliers_low = undefined; + kommonitorDataExchangeService.useOutlierDetectionOnIndicator = useOutlierDetectionOnIndicator; + + $scope.svgString_outlierLow = 'Sorry, your browser does not support inline SVG.'; + $scope.svgString_outlierHigh = 'Sorry, your browser does not support inline SVG.'; + + $scope.showOutlierInfoAlert = false; + + + + $scope.drawnPointFeatures = undefined; + $scope.drawPointControl = undefined; + + $scope.featuresWithValues = []; + $scope.featuresWithoutValues = []; + + + const MultipleResultsLeafletSearch = L.Control.Search.extend({ + + _makeUniqueKey: function (featureName, featureId) { + return featureName + " (Name) - " + featureId + " (ID)"; + }, + + _searchInLayer: function (layer, retRecords, propName) { + var self = this, loc; + var key_withUniqueID; + + if (layer instanceof L.Control.Search.Marker) return; + + if (layer instanceof L.Marker || layer instanceof L.CircleMarker) { + if (self._getPath(layer.options, propName)) { + loc = layer.getLatLng(); + loc.layer = layer; + retRecords[self._getPath(layer.options, propName)] = loc; + } + else if (self._getPath(layer.feature.properties, propName)) { + loc = layer.getLatLng(); + loc.layer = layer; + key_withUniqueID = this._makeUniqueKey(self._getPath(layer.feature.properties, propName), layer.feature.properties.ID); + retRecords[key_withUniqueID] = loc; + } + else { + //throw new Error("propertyName '"+propName+"' not found in marker"); + console.warn("propertyName '" + propName + "' not found in marker"); + } + } + else if (layer instanceof L.Path || layer instanceof L.Polyline || layer instanceof L.Polygon) { + if (self._getPath(layer.options, propName)) { + loc = layer.getBounds().getCenter(); + loc.layer = layer; + retRecords[self._getPath(layer.options, propName)] = loc; + } + else if (self._getPath(layer.feature.properties, propName)) { + loc = layer.getBounds().getCenter(); + loc.layer = layer; + key_withUniqueID = this._makeUniqueKey(self._getPath(layer.feature.properties, propName), layer.feature.properties.ID); + retRecords[key_withUniqueID] = loc; + } + else { + //throw new Error("propertyName '"+propName+"' not found in shape"); + console.warn("propertyName '" + propName + "' not found in shape"); + } + } + else if (layer.hasOwnProperty('feature'))//GeoJSON + { + if (layer.feature.properties.hasOwnProperty(propName)) { + + key_withUniqueID = this._makeUniqueKey(self._getPath(layer.feature.properties, propName), layer.feature.properties.ID); + if (layer.getLatLng && typeof layer.getLatLng === 'function') { + loc = layer.getLatLng(); + loc.layer = layer; + retRecords[key_withUniqueID] = loc; + } else if (layer.getBounds && typeof layer.getBounds === 'function') { + loc = layer.getBounds().getCenter(); + loc.layer = layer; + retRecords[key_withUniqueID] = loc; + } else { + console.warn("Unknown type of Layer"); + } + } + else { + //throw new Error("propertyName '"+propName+"' not found in feature"); + console.warn("propertyName '" + propName + "' not found in feature"); + } + } + else if (layer instanceof L.LayerGroup) { + layer.eachLayer(function (layer) { + self._searchInLayer(layer, retRecords, propName); + }); + } + }, + _defaultMoveToLocation: function (latlng, title, map) { + if (this.options.zoom) + this._map.setView(latlng, this.options.zoom); + else + this._map.panTo(latlng); + + // add collapse after click on item + this.collapse(); + }, + _handleAutoresize: function () { + var maxWidth; + + if (!this._map) { + this._map = $scope.map; + } + + if (this._input.style.maxWidth !== this._map._container.offsetWidth) { + maxWidth = this._map._container.clientWidth; + + // other side margin + padding + width border + width search-button + width search-cancel + maxWidth -= 10 + 20 + 1 + 30 + 22; + + this._input.style.maxWidth = maxWidth.toString() + 'px'; + } + + if (this.options.autoResize && (this._container.offsetWidth + 20 < this._map._container.offsetWidth)) { + this._input.size = this._input.value.length < this._inputMinSize ? this._inputMinSize : this._input.value.length; + } + } + }); + + $scope.onCloseOutlierAlert = function () { + // $("#outlierInfo").hide(); + $scope.showOutlierInfoAlert = false; + }; + + + var refreshNoDataStyle = function () { + + $scope.currentIndicatorContainsNoDataValues = false; + $scope.svgString_noData = '' + + '' + + '' + + '' + + '' + + 'Sorry, your browser does not support inline SVG.'; + + $scope.noDataStyle = kommonitorVisualStyleHelperService.noDataStyle; + }; + + var refreshOutliersStyle = function () { + + $scope.containsOutliers_high = false; + $scope.containsOutliers_low = false; + $scope.outlierMinValue = undefined; + $scope.outlierMaxValue = undefined; + $scope.showOutlierInfoAlert = false; + + $scope.svgString_outlierLow = 'Sorry, your browser does not support inline SVG.'; + $scope.svgString_outlierHigh = 'Sorry, your browser does not support inline SVG.'; + + // if ($scope.useTransparencyOnIndicator) { + // fillOpacity_high = defaultFillOpacityForOutliers_high; + // fillOpacity_low = defaultFillOpacityForOutliers_low; + // } + + $scope.outlierStyle_high = kommonitorVisualStyleHelperService.outlierStyle_high; + + $scope.outlierStyle_low = kommonitorVisualStyleHelperService.outlierStyle_low; + }; + + $scope.useTransparencyOnIndicator = __env.useTransparencyOnIndicator; + + $scope.filteredStyle = kommonitorVisualStyleHelperService.filteredStyle; + + var refreshFilteredStyle = function () { + + $scope.filteredStyle = kommonitorVisualStyleHelperService.filteredStyle; + }; + + this.kommonitorMapServiceInstance = kommonitorMapService; + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + $scope.inputLayerCounter = 0; + + $scope.latCenter = __env.initialLatitude; + $scope.lonCenter = __env.initialLongitude; + $scope.zoomLevel = __env.initialZoomLevel; + + $scope.loadingData = true; + + $scope.drawnItems = new L.FeatureGroup(); + $scope.drawControl = undefined; + + $scope.allDrawingToolsEnabled = false; + $scope.date = undefined; + + // central map object + $scope.map = undefined; + $scope.scaleBar = undefined; + $scope.layerControl = undefined; + $scope.showInfoControl = true; + $scope.showLegendControl = true; + $scope.showLegend = true; + $scope.overlays = new Array(); + $scope.baseMaps = new Array(); + const spatialUnitLayerGroupName = "Raumeinheiten"; + const georesourceLayerGroupName = "Georessourcen"; + const poiLayerGroupName = "Points of Interest"; + const loiLayerGroupName = "Lines of Interest"; + const aoiLayerGroupName = "Areas of Interest"; + const indicatorLayerGroupName = "Indikatoren"; + const reachabilityLayerGroupName = "Erreichbarkeiten"; + const wmsLayerGroupName = "Web Map Services (WMS)"; + const wfsLayerGroupName = "Web Feature Services (WFS)"; + const fileLayerGroupName = "Dateilayer"; + + // create classyBrew object + $scope.defaultBrew = new classyBrew(); + $scope.gtMeasureOfValueBrew = new classyBrew(); + $scope.ltMeasureOfValueBrew = new classyBrew(); + + $scope.currentIndicatorMetadataAndGeoJSON; + $scope.currentGeoJSONOfCurrentLayer; + $scope.currentIndicatorContainsZeroValues = false; + $scope.currentIndicatorContainsNoDataValues = false; + $scope.indicatorTypeOfCurrentLayer; + $scope.defaultColorForZeroValues = __env.defaultColorForZeroValues; + + $scope.customIndicatorPropertyName; + $scope.customIndicatorName; + $scope.customIndicatorUnit; + + $scope.currentCustomIndicatorLayerOfCurrentLayer; + $scope.customPropertyName; + + $scope.currentCustomIndicatorLayer; + $scope.isochronesLayer = undefined; + $scope.isochroneMarkerLayer = undefined; + + /* + * L.TileLayer.Grayscale is a regular tilelayer with grayscale makeover. + */ + + L.TileLayer.Grayscale = L.TileLayer.extend({ + options: { + quotaRed: 21, + quotaGreen: 71, + quotaBlue: 8, + quotaDividerTune: 0, + quotaDivider: function () { + return this.quotaRed + this.quotaGreen + this.quotaBlue + this.quotaDividerTune; + } + }, + + initialize: function (url, options) { + options = options || {}; + options.crossOrigin = true; + L.TileLayer.prototype.initialize.call(this, url, options); + + this.on('tileload', function (e) { + this._makeGrayscale(e.tile); + }); + }, + + _createTile: function () { + var tile = L.TileLayer.prototype._createTile.call(this); + tile.crossOrigin = "Anonymous"; + return tile; + }, + + _makeGrayscale: function (img) { + if (img.getAttribute('data-grayscaled')) + return; + + img.crossOrigin = ''; + var canvas = document.createElement("canvas"); + canvas.width = img.width; + canvas.height = img.height; + var ctx = canvas.getContext("2d"); + ctx.drawImage(img, 0, 0); + + var imgd = ctx.getImageData(0, 0, canvas.width, canvas.height); + var pix = imgd.data; + for (var i = 0, n = pix.length; i < n; i += 4) { + pix[i] = pix[i + 1] = pix[i + 2] = (this.options.quotaRed * pix[i] + this.options.quotaGreen * pix[i + 1] + this.options.quotaBlue * pix[i + 2]) / this.options.quotaDivider(); + } + ctx.putImageData(imgd, 0, 0); + img.setAttribute('data-grayscaled', true); + img.src = canvas.toDataURL(); + } + }); + + L.tileLayer.grayscale = function (url, options) { + return new L.TileLayer.Grayscale(url, options); + }; + + this.initializeMap = function () { + + $scope.loadingData = true; + + // initialize map referring to div element with id="map" + + var baseLayerDefinitionsMap = new Map(); + + for (const baseMapEntry of __env.baseLayers) { + + if (baseMapEntry.layerType === "TILE_LAYER_GRAYSCALE"){ + var grayscaleLayer = new L.tileLayer.grayscale(baseMapEntry.url, { minZoom: baseMapEntry.minZoomLevel, maxZoom: baseMapEntry.maxZoomLevel, attribution: baseMapEntry.attribution_html }); + baseLayerDefinitionsMap.set(baseMapEntry.name, grayscaleLayer); + } + else if (baseMapEntry.layerType === "TILE_LAYER"){ + var tileLayer = new L.tileLayer(baseMapEntry.url, { minZoom: baseMapEntry.minZoomLevel, maxZoom: baseMapEntry.maxZoomLevel, attribution: baseMapEntry.attribution_html }); + baseLayerDefinitionsMap.set(baseMapEntry.name, tileLayer); + } + else if (baseMapEntry.layerType === "WMS"){ + var wmsLayer = new L.tileLayer.wms(baseMapEntry.url, { minZoom: baseMapEntry.minZoomLevel, maxZoom: baseMapEntry.maxZoomLevel, attribution: baseMapEntry.attribution_html, layers: baseMapEntry.layerName_WMS, format: 'image/png' }); + baseLayerDefinitionsMap.set(baseMapEntry.name, wmsLayer); + } + } + + $scope.map = L.map('map', { + center: [$scope.latCenter, $scope.lonCenter], + zoom: $scope.zoomLevel, + zoomDelta: 0.5, + zoomSnap: 0.5, + layers: [baseLayerDefinitionsMap.get(__env.baseLayers[0].name)] + }); + + // execute update search control on layer add and remove + $scope.map.on('overlayadd', function (eo) { + $scope.updateSearchControl(); + }); + $scope.map.on('overlayremove', function (eo) { + $scope.updateSearchControl(); + }); + + // update zoom and extent + $scope.map.on('zoomend', function (eo) { + let latLng = $scope.map.getCenter(); + __env.currentLatitude = latLng.lat; + __env.currentLongitude = latLng.lng; + __env.currentZoomLevel = $scope.map.getZoom(); + }); + $scope.map.on('moveend', function (eo) { + let latLng = $scope.map.getCenter(); + __env.currentLatitude = latLng.lat; + __env.currentLongitude = latLng.lng; + __env.currentZoomLevel = $scope.map.getZoom(); + }); + + $scope.baseMaps = { + }; + + baseLayerDefinitionsMap.forEach(function(value, key, map){ + $scope.baseMaps[key] = value; + }); + + $scope.groupedOverlays = { + indicatorLayerGroupName: { + + }, + poiLayerGroupName: { + + }, + loiLayerGroupName: { + + }, + aoiLayerGroupName: { + + }, + wmsLayerGroupName: { + + }, + wfsLayerGroupName: { + + }, + fileLayerGroupName: { + + }, + reachabilityLayerGroupName: { + + } + }; + + $scope.layerControl = L.control.groupedLayers($scope.baseMaps, $scope.groupedOverlays, { position: 'topleft' }); + $scope.map.addControl($scope.layerControl); + + // Disable dragging when user's cursor enters the element + $scope.layerControl.getContainer().addEventListener('mouseover', function () { + $scope.map.dragging.disable(); + $scope.map.touchZoom.disable(); + $scope.map.doubleClickZoom.disable(); + $scope.map.scrollWheelZoom.disable(); + }); + + // Re-enable dragging when user's cursor leaves the element + $scope.layerControl.getContainer().addEventListener('mouseout', function () { + $scope.map.dragging.enable(); + $scope.map.touchZoom.enable(); + $scope.map.doubleClickZoom.enable(); + $scope.map.scrollWheelZoom.enable(); + }); + + $scope.scaleBar = L.control.scale(); + $scope.scaleBar.addTo($scope.map); + + + + // hatch patterns + // var diagonalPattern = new L.PatternPath({ d: "M-1,1 l2,-2 M0,4 l4,-4 M3,5 l2,-2" , fill: true }); + + // $scope.outlierFillPattern_high = new L.Pattern(); + // $scope.outlierFillPattern_high.addShape(diagonalPattern); + // $scope.outlierFillPattern_high.addTo($scope.map); + + $scope.outlierFillPattern_low = kommonitorVisualStyleHelperService.outlierFillPattern_low; + $scope.outlierFillPattern_low.addTo($scope.map); + + $scope.outlierFillPattern_high = kommonitorVisualStyleHelperService.outlierFillPattern_high; + $scope.outlierFillPattern_high.addTo($scope.map); + + $scope.noDataFillPattern = kommonitorVisualStyleHelperService.noDataFillPattern; + $scope.noDataFillPattern.addTo($scope.map); + + // $scope.loadingData = false; + + ///////////////////////////////////////////////////// + ///// LEAFLET GEOSEARCH SETUP + ///////////////////////////////////////////////////// + var GeoSearchControl = window.GeoSearch.GeoSearchControl; + var OpenStreetMapProvider = window.GeoSearch.OpenStreetMapProvider; + + // remaining is the same as in the docs, accept for the var instead of const declarations + var provider = new OpenStreetMapProvider( + { + params: { + 'accept-language': 'de', // render results in Dutch + countrycodes: 'de', // limit search results to the Netherlands + addressdetails: 1, // include additional address detail parts + viewbox: "" + (Number(__env.initialLongitude) - 0.001) + "," + (Number(__env.initialLatitude) - 0.001) + "," + (Number(__env.initialLongitude) + 0.001) + "," + (Number(__env.initialLatitude) + 0.001) + }, + searchUrl: __env.targetUrlToGeocoderService + '/search', + reverseUrl: __env.targetUrlToGeocoderService + '/reverse' + } + ); + + $scope.geosearchControl = new GeoSearchControl({ + position: "topleft", + provider: provider, + style: 'button', + autoComplete: true, + autoCompleteDelay: 250, + showMarker: true, // optional: true|false - default true + showPopup: false, // optional: true|false - default false + marker: { // optional: L.Marker - default L.Icon.Default + icon: new L.Icon.Default(), + draggable: false, + }, + popupFormat: ({ query, result }) => result.label, // optional: function - default returns result label + maxMarkers: 1, // optional: number - default 1 + retainZoomLevel: false, // optional: true|false - default false + animateZoom: true, // optional: true|false - default true + autoClose: false, // optional: true|false - default false + searchLabel: 'Suche nach Adressen ...', // optional: string - default 'Enter address' + keepResult: false // optional: true|false - default false + }); + + $scope.map.addControl($scope.geosearchControl); + + + ///////////////////////////////////////////////////// + ///// LEAFLET SEARCH SETUP + ///////////////////////////////////////////////////// + // will be updated once example indicator layer is loaded + $scope.searchControl = new MultipleResultsLeafletSearch({ + }); + $scope.searchControl.addTo($scope.map); + + + ///////////////////////////////////////////////////// + ///// LEAFLET MEASURE SETUP + ///////////////////////////////////////////////////// + var measureOptions = { + position: 'topleft', + primaryLengthUnit: 'meters', + secondaryLengthUnit: 'kilometers', + primaryAreaUnit: 'sqmeters', + activeColor: "#d15c54", + completedColor: "#d15c54", + decPoint: ',', + thousandsSep: '.' + }; + + $scope.measureControl = new L.Control.Measure(measureOptions); + $scope.measureControl.addTo($scope.map); + + ///////////////////////////////////////////////////// + ///// LEAFLET SCREENSHOTER SETUP + ///////////////////////////////////////////////////// + + // from the docs, most of it is probably not needed + let screenshotterOptions = { + cropImageByInnerWH: true, // crop blank opacity from image borders + hidden: true, // hide screen icon + preventDownload: false, // prevent download on button click + domtoimageOptions: {}, // see options for dom-to-image + position: 'topleft', // position of take screen icon + screenName: 'screen', // string or function + hideElementsWithSelectors: ['.leaflet-control-container'], // by default hide map controls All els must be child of _map._container + mimeType: 'image/png', // used if format == image, + caption: null, // string or function, added caption to bottom of screen + captionFontSize: 15, + captionFont: 'Arial', + captionColor: 'black', + captionBgColor: 'white', + captionOffset: 5, + // callback for manually edit map if have warn: "May be map size very big on that zoom level, we have error" + // and screenshot not created + onPixelDataFail: async function({ node, plugin, error, mapPane, domtoimageOptions }) { + // Solutions: + // decrease size of map + // or decrease zoom level + // or remove elements with big distanses + // and after that return image in Promise - plugin._getPixelDataOfNormalMap + return plugin._getPixelDataOfNormalMap(domtoimageOptions) + } + } + + $scope.simpleMapScreenshoter = L.simpleMapScreenshoter(screenshotterOptions).addTo($scope.map); + $scope.map.simpleMapScreenshoter = $scope.simpleMapScreenshoter; + + }; // end initialize map + + + $scope.$on("exportMap", function (event) { + + // wait for print process to finish + let format = 'blob'; // 'image' - return base64, 'canvas' - return canvas + let overridedPluginOptions = { + mimeType: 'image/png' + }; + $scope.simpleMapScreenshoter.takeScreen(format, overridedPluginOptions); + $scope.simpleMapScreenshoter.takeScreen(format, overridedPluginOptions).then(blob => { + // FileSaver saveAs method + saveAs(blob, 'KomMonitor-Screenshot.png'); + }).catch(error => { + console.log("Error while exporting map view."); + console.error(error); + + kommonitorDataExchangeService.displayMapApplicationError(error); + }); + + }); + + function isKomMonitorSpecificProperty(propertyKey){ + let isKomMonitorSpecificProperty = false; + + if(propertyKey == "outlier"){ + isKomMonitorSpecificProperty = true; + } + else if(propertyKey == __env.VALID_START_DATE_PROPERTY_NAME){ + isKomMonitorSpecificProperty = true; + } + else if(propertyKey == __env.VALID_END_DATE_PROPERTY_NAME){ + isKomMonitorSpecificProperty = true; + } + else if(propertyKey == "bbox"){ + isKomMonitorSpecificProperty = true; + } + else if(propertyKey.includes(__env.indicatorDatePrefix)){ + isKomMonitorSpecificProperty = true; + } + + return isKomMonitorSpecificProperty; + } + + $scope.updateSearchControl = function () { + + setTimeout(function () { + if ($scope.searchControl) { + try { + $scope.map.removeControl($scope.searchControl); + $scope.searchControl = undefined; + } + catch (error) { + kommonitorDataExchangeService.displayMapApplicationError(error); + } + } + + // build L.layerGroup of available POI layers + var featureLayers = []; + + for (var layerEntry of $scope.layerControl._layers) { + if (layerEntry) { + if (layerEntry.overlay) { + if ($scope.map.hasLayer(layerEntry.layer)) { + if (layerEntry.group.name === poiLayerGroupName || layerEntry.group.name === loiLayerGroupName || layerEntry.group.name === aoiLayerGroupName || layerEntry.group.name === indicatorLayerGroupName || layerEntry.group.name === wfsLayerGroupName || layerEntry.group.name === fileLayerGroupName) { + featureLayers.push(layerEntry.layer); + } + } + + } + } + } + + var layerGroup; + // if no relevant layers are currently displayed, then + if (featureLayers.length === 0) { + $scope.searchControl = new MultipleResultsLeafletSearch({ + }); + $scope.searchControl.addTo($scope.map); + } + else { + layerGroup = L.featureGroup(featureLayers); + + $scope.searchControl = new MultipleResultsLeafletSearch({ + position: "topleft", + layer: layerGroup, + initial: false, + propertyName: __env.FEATURE_NAME_PROPERTY_NAME, + textPlaceholder: "Layer-Objekte nach Name und/oder ID filtern", + textCancel: "Abbrechen", + textErr: "Position nicht gefunden", + hideMarkerOnCollapse: true, + zoom: 15, + autoResize: true, + autoCollapse: false, + autoType: true, + formatData: function (json) { //adds coordinates to name. + var propName = this.options.propertyName, + propLoc = this.options.propertyLoc, + i, jsonret = {}; + if (L.Util.isArray(propLoc)) + for (i in json) { + if (!this._getPath(json[i], propName)) continue; + jsonret[this._getPath(json[i], propName) + " (" + json[i][propLoc[0]] + "," + json[i][propLoc[1]] + ")"] = L.latLng(json[i][propLoc[0]], json[i][propLoc[1]]); + } + else + for (i in json) { + if (!this._getPath(json[i], propName)) continue; + jsonret[this._getPath(json[i], propName) + " (" + json[i][propLoc][0] + "," + json[i][propLoc][1] + ")"] = L.latLng(this._getPath(json[i], propLoc)); + } + return jsonret; + }, + filterData: function (text, records) { + var I, icase, regSearch, frecords = {}; + + text = text.replace(/[.*+?^${}()|[\]\\]/g, ''); //sanitize remove all special characters + if (text === '') + return []; + + I = this.options.initial ? '^' : ''; //search only initial text + icase = !this.options.casesensitive ? 'i' : undefined; + + regSearch = new RegExp(I + text, icase); + + for (var key in records) { + + // make a searchable string from all relevant feature properties + let recordString = ""; + let record = records[key]; + let recordProperties = record.layer.feature.properties; + + for (const propertyKey in recordProperties) { + if(recordProperties[propertyKey] && !isKomMonitorSpecificProperty(propertyKey)){ + recordString += recordProperties[propertyKey]; + } + } + + if (regSearch.test(recordString)) + frecords[key] = records[key]; + } + + return frecords; + }, + buildTip: function (text, val) { + var emString = ""; + + if (val.layer.metadataObject) { + if (val.layer.metadataObject.isPOI) { + emString += ''; + emString += ""; + emString += ''; + } + } + else { + emString += ""; + } + return '' + emString + '  ' + text + ''; + } + }); + + $scope.searchControl.addTo($scope.map); + } + }, 200); + }; + + $scope.$on("showLoadingIconOnMap", function (event) { + // console.log("Show loading icon on map"); + $scope.loadingData = true; + }); + + $scope.$on("hideLoadingIconOnMap", function (event) { + // console.log("Hide loading icon on map"); + $timeout(function(){ + $scope.loadingData = false; + }, 250); + + }); + + $(document).on('click', '#selectSpatialUnitViaInfoControl li p', function () { + var spatialUnitName = $(this).text(); + $('#selectSpatialUnitViaInfoControl_text').text(spatialUnitName); + + $rootScope.$broadcast("changeSpatialUnitViaInfoControl", spatialUnitName); + }); + + // $(document).on('change','#selectSimplifyGeometriesViaInfoControl',function(){ + // var selector = document.getElementById('selectSimplifyGeometriesViaInfoControl'); + // var simplifyGeometries = selector[selector.selectedIndex].value; + // + // kommonitorDataExchangeService.simplifyGeometries = simplifyGeometries; + // + // $rootScope.$broadcast("changeSpatialUnit"); + // }); + + $scope.$on("changeSpatialUnitViaInfoControl", function (event, spatialUnitLevel) { + + $rootScope.$broadcast("changeSpatialUnit"); + + }); + + + $scope.appendSpatialUnitOptions = function () { + + //
        + // + //
        + + // var innerHTMLString = "
        "; + // innerHTMLString += ""; + // innerHTMLString += "
        "; + // // innerHTMLString += "
        "; + + // + + var innerHTMLString = '
        '; + innerHTMLString += "
        "; + innerHTMLString += "
        "; + innerHTMLString += "
        "; + + return innerHTMLString; + }; + + // $scope.appendSimplifyGeometriesOptions = function(){ + // + // //
        + // // + // //
        + // + // var innerHTMLString = "
        "; + // innerHTMLString += ""; + // innerHTMLString += "
        "; + // // innerHTMLString += "
        "; + // + // return innerHTMLString; + // }; + + var toggleInfoControl = function () { + if ($scope.showInfoControl === true) { + /* use jquery to select your DOM elements that has the class 'legend' */ + $('.info').hide(); + $scope.showInfoControl = false; + + $('#toggleInfoControlButton').show(); + } else { + $('.info').show(); + $scope.showInfoControl = true; + + // button is defined in kommonitor-user-interface component + $('#toggleInfoControlButton').hide(); + } + }; + + var toggleLegendControl = function () { + if ($scope.showLegendControl === true) { + /* use jquery to select your DOM elements that has the class 'legend' */ + $('.legendMap').hide(); + $scope.showLegendControl = false; + + $('#toggleLegendControlButton').show(); + } else { + $('.legendMap').show(); + $scope.showLegendControl = true; + + // button is defined in kommonitor-user-interface component + $('#toggleLegendControlButton').hide(); + } + }; + + $scope.$on("toggleInfoControl", function (event) { + toggleInfoControl(); + }); + + $scope.$on("toggleLegendControl", function (event) { + toggleLegendControl(); + }); + + $scope.appendInfoCloseButton = function () { + return ''; + }; + + $scope.appendLegendCloseButton = function () { + return ''; + }; + + $scope.appendIndicatorInformation = function(isCustomComputation){ + var indicatorInfoHTML = '
        '; + var titel = $scope.indicatorName; + + if (isCustomComputation) { + titel += " - individuelles Berechnungsergebnis"; + } + + indicatorInfoHTML += '

        ' + titel + '


        '; + indicatorInfoHTML += 'Beschreibung: ' + $scope.indicatorDescription + '
        '; + indicatorInfoHTML += 'Datenquelle: ' + $scope.currentIndicatorMetadataAndGeoJSON.metadata.datasource + '
        '; + indicatorInfoHTML += $scope.appendSpatialUnitOptions(); + + var transparencyDomString = ""; + transparencyDomString += '
        '; + transparencyDomString += '
        '; + transparencyDomString += '
        '; + transparencyDomString += ''; + transparencyDomString += '
        '; + transparencyDomString += '
        '; + transparencyDomString += '
        '; + transparencyDomString += '
        '; + transparencyDomString += ''; + transparencyDomString += '
        '; + transparencyDomString += '
        '; + transparencyDomString += '
        '; + transparencyDomString += '
        '; + transparencyDomString += ''; + transparencyDomString += '
        '; + transparencyDomString += '
        '; + transparencyDomString += '
        '; + + indicatorInfoHTML += transparencyDomString; + + var exportDomString = '
        '; + exportDomString += ""; + exportDomString += '
        '; + exportDomString += ''; + exportDomString += ''; + // temporarily disable WMS and WFS export + exportDomString += 'WMS'; + exportDomString += 'WFS'; + exportDomString += "
        "; + + indicatorInfoHTML += exportDomString; + + indicatorInfoHTML += "



        "; + + // indicatorInfoHTML += $scope.appendSimplifyGeometriesOptions(); + return indicatorInfoHTML; + }; + + + $(document).on('click', '#controlIndicatorTransparency', function (e) { + var indicatorTransparencyCheckbox = document.getElementById('controlIndicatorTransparency'); + if (indicatorTransparencyCheckbox.checked) { + $scope.useTransparencyOnIndicator = true; + } + else { + $scope.useTransparencyOnIndicator = false; + } + $rootScope.$broadcast("restyleCurrentLayer", false); + + // ensure that highlighted features remain highlighted + preserveHighlightedFeatures(); + }); + + $(document).on('click', '#controlIndicatorOutlierDetection', function (e) { + var indicatorOutlierCheckbox = document.getElementById('controlIndicatorOutlierDetection'); + if (indicatorOutlierCheckbox.checked) { + kommonitorDataExchangeService.useOutlierDetectionOnIndicator = true; + } + else { + kommonitorDataExchangeService.useOutlierDetectionOnIndicator = false; + } + $rootScope.$broadcast("restyleCurrentLayer", false); + + // ensure that highlighted features remain highlighted + preserveHighlightedFeatures(); + }); + + $(document).on('click', '#controlIndicatorZeroClassifyOption', function (e) { + var zeroClassifyCheckbox = document.getElementById('controlIndicatorZeroClassifyOption'); + if (zeroClassifyCheckbox.checked) { + kommonitorDataExchangeService.classifyZeroSeparately = true; + } + else { + kommonitorDataExchangeService.classifyZeroSeparately = false; + } + $rootScope.$broadcast("restyleCurrentLayer", false); + + // ensure that highlighted features remain highlighted + preserveHighlightedFeatures(); + }); + + $scope.$on("changeClassifyMethod", function (event, method) { + kommonitorVisualStyleHelperService.classifyMethod = method; + + $timeout(function(){ + kommonitorVisualStyleHelperService.classifyMethod = method; + $rootScope.$apply(); + }, 350); + + $rootScope.$broadcast("restyleCurrentLayer", false); + }); + + $(document).on('click', '#controlNoDataDisplay', function (e) { + var controlNoDataDisplayCheckbox = document.getElementById('controlNoDataDisplay'); + + if (controlNoDataDisplayCheckbox.checked) { + $scope.applyNoDataDisplay(); + } else { + $scope.resetNoDataDisplay(); + } + + $rootScope.$broadcast("restyleCurrentLayer", false); + + // ensure that highlighted features remain highlighted + preserveHighlightedFeatures(); + }); + + + $scope.$on("applyNoDataDisplay", function() { + $scope.applyNoDataDisplay(); + }); + + + $scope.applyNoDataDisplay = function() { + kommonitorDataExchangeService.useNoDataToggle = true; + $scope.featuresWithValues = []; + for (var i = 0; i < $scope.currentIndicatorMetadataAndGeoJSON.geoJSON.features.length; i++) { + if (!kommonitorDataExchangeService.indicatorValueIsNoData($scope.currentIndicatorMetadataAndGeoJSON.geoJSON.features[i].properties[$scope.indicatorPropertyName])) { + $scope.featuresWithValues.push($scope.currentIndicatorMetadataAndGeoJSON.geoJSON.features[i]) + } else { + $scope.featuresWithoutValues.push($scope.currentIndicatorMetadataAndGeoJSON.geoJSON.features[i]) + } + } + + // get feature names array + let featuresWithValuesNames = []; + for (var i = 0; i < $scope.featuresWithValues.length; i++) { + featuresWithValuesNames.push( $scope.featuresWithValues[i].properties["name"]); + } + + // store checkbox state + let completelyRemoveFilteredFeaturesFromDisplayChbState = kommonitorFilterHelperService.completelyRemoveFilteredFeaturesFromDisplay; + kommonitorFilterHelperService.completelyRemoveFilteredFeaturesFromDisplay = true; // set checkbox true + // perform spatial filter + kommonitorFilterHelperService.applySpatialFilter_currentSpatialUnitFeatures(featuresWithValuesNames); + // set checkbox to previous state + kommonitorFilterHelperService.completelyRemoveFilteredFeaturesFromDisplay = completelyRemoveFilteredFeaturesFromDisplayChbState; + } + + + $scope.$on("resetNoDataDisplay", function() { + $scope.resetNoDataDisplay(); + }); + + $scope.resetNoDataDisplay = function() { + kommonitorDataExchangeService.useNoDataToggle = false; + let visibleFeatures = $scope.currentIndicatorMetadataAndGeoJSON.geoJSON.features; + let visibleAndNoDataFeatures = visibleFeatures.concat($scope.featuresWithoutValues); + + // get feature names array + let visibleAndNoDataFeaturesNames = []; + for (var i = 0; i < visibleAndNoDataFeatures.length; i++) { + visibleAndNoDataFeaturesNames.push( visibleAndNoDataFeatures[i].properties["name"]); + } + + // store checkbox state + let completelyRemoveFilteredFeaturesFromDisplayChbState = kommonitorFilterHelperService.completelyRemoveFilteredFeaturesFromDisplay; + kommonitorFilterHelperService.completelyRemoveFilteredFeaturesFromDisplay = true; // set checkbox true + // perform spatial filter + kommonitorFilterHelperService.applySpatialFilter_currentSpatialUnitFeatures(visibleAndNoDataFeaturesNames); + // set checkbox to previous state + kommonitorFilterHelperService.completelyRemoveFilteredFeaturesFromDisplay = completelyRemoveFilteredFeaturesFromDisplayChbState; + + $scope.featuresWithoutValues = []; + } + + + /** + * binds the popup of a clicked output + * to layer.feature.properties.popupContent + */ + function onEachFeatureSpatialUnit(feature, layer) { + // does this feature have a property named popupContent? + layer.on({ + click: function () { + + // var propertiesString = "
        " + JSON.stringify(feature.properties, null, ' ').replace(/[\{\}"]/g, '') + "
        "; + + var popupContent = '
        '; + for (var p in feature.properties) { + popupContent += ''; + } + popupContent += '
        ' + p + ''+ feature.properties[p] + '
        '; + + layer.bindPopup(popupContent); + + // if (propertiesString) + // layer.bindPopup(propertiesString); + } + }); + } + + /** + * binds the popup of a clicked output + * to layer.feature.properties.popupContent + */ + function onEachFeatureGeoresource(feature, layer) { + // does this feature have a property named popupContent? + layer.on({ + click: function () { + + var popupContent = '
        '; + for (var p in feature.properties) { + popupContent += ''; + } + popupContent += '
        ' + p + ''+ feature.properties[p] + '
        '; + + layer.bindPopup(popupContent); + + // var propertiesString = "
        " + JSON.stringify(feature.properties, null, ' ').replace(/[\{\}"]/g, '') + "
        "; + + // if (propertiesString) + // layer.bindPopup(propertiesString); + } + }); + } + + /** + * binds the popup of a clicked output + * to layer.feature.properties.popupContent + */ + function onEachFeatureIndicator(feature, layer) { + var indicatorValue = feature.properties[INDICATOR_DATE_PREFIX + $scope.date]; + var indicatorValueText; + if (kommonitorDataExchangeService.indicatorValueIsNoData(indicatorValue)) { + indicatorValueText = "NoData"; + } + else { + indicatorValueText = kommonitorDataExchangeService.getIndicatorValue_asFormattedText(indicatorValue); + } + var tooltipHtml = "" + feature.properties[__env.FEATURE_NAME_PROPERTY_NAME] + "
        " + indicatorValueText + " [" + kommonitorDataExchangeService.selectedIndicator.unit + "]"; + layer.bindTooltip(tooltipHtml, { + sticky: false // If true, the tooltip will follow the mouse instead of being fixed at the feature center. + }); + layer.on({ + mouseover: highlightFeature, + mouseout: resetHighlight, + click: function () { + switchHighlightFeature(layer); + } + }); + } + + + + function switchHighlightFeature(layer) { + // add or remove feature within a list of "clicked features" + // those shall be treated specially, i.e. keep being highlighted + if (!kommonitorFilterHelperService.featureIsCurrentlySelected(layer.feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { + kommonitorFilterHelperService.addFeatureToSelection(layer.feature); + highlightClickedFeature(layer); + } + + else { + //remove from array + kommonitorFilterHelperService.removeFeatureFromSelection(layer.feature.properties[__env.FEATURE_ID_PROPERTY_NAME]); + resetHighlightClickedFeature(layer); + } + } + + function onEachFeatureCustomIndicator(feature, layer) { + // does this feature have a property named popupContent? + layer.on({ + mouseover: highlightFeature, + mouseout: resetHighlightCustom, + click: function () { + + var popupContent = layer.feature.properties; + + if (popupContent) + layer.bindPopup("Indicator: " + JSON.stringify(popupContent)); + } + }); + } + + + $scope.$on("addSpatialUnitAsGeopackage", function (event) { + + console.log('addSpatialUnitAsGeopackage was called'); + + var layer = L.geoPackageFeatureLayer([], { + geoPackageUrl: './test1234.gpkg', + layerName: 'test1234', + style: function (feature) { + return { + color: "#F00", + weight: 1, + opacity: 1 + }; + }, + onEachFeature: onEachFeatureSpatialUnit + }); + + // layer.StyledLayerControl = { + // removable : true, + // visible : true + // }; + + $scope.layerControl.addOverlay(layer, "GeoPackage", { groupName: spatialUnitLayerGroupName }); + layer.addTo($scope.map); + $scope.updateSearchControl(); + + + }); + + $scope.$on("addSpatialUnitAsGeoJSON", function (event, spatialUnitMetadataAndGeoJSON, date) { + + console.log('addSpatialUnitAsGeoJSON was called'); + + // if ($scope.layers.overlays[spatialUnitMetadataAndGeoJSON.spatialUnitLevel]) { + // delete $scope.layers.overlays[spatialUnitMetadataAndGeoJSON.spatialUnitLevel]; + // + // console.log($scope.layers.overlays); + // } + + var layer = L.geoJSON(spatialUnitMetadataAndGeoJSON.geoJSON, { + style: function (feature) { + return { + color: "blue", + weight: 1, + opacity: 1 + }; + }, + onEachFeature: onEachFeatureSpatialUnit + }); + + // layer.StyledLayerControl = { + // removable : true, + // visible : true + // }; + + $scope.layerControl.addOverlay(layer, spatialUnitMetadataAndGeoJSON.spatialUnitLevel + "_" + date, spatialUnitLayerGroupName); + layer.addTo($scope.map); + $scope.updateSearchControl(); + + }); + + $scope.$on("addGeoresourceAsGeoJSON", function (event, georesourceMetadataAndGeoJSON, date) { + + var layer = L.geoJSON(georesourceMetadataAndGeoJSON.geoJSON, { + style: function (feature) { + return { + color: "red", + weight: 1, + opacity: 1 + }; + }, + onEachFeature: onEachFeatureGeoresource + }); + + // layer.StyledLayerControl = { + // removable : false, + // visible : true + // }; + + $scope.layerControl.addOverlay(layer, georesourceMetadataAndGeoJSON.datasetName + "_" + date, georesourceLayerGroupName); + layer.addTo($scope.map); + $scope.updateSearchControl(); + + $scope.map.invalidateSize(true); + }); + + $scope.$on("replaceIsochronesAsGeoJSON", function (event, geoJSON, transitMode, reachMode, cutOffValues, useMultipleStartPoints, dissolveIsochrones, speedInKilometersPerHour) { + + if ($scope.isochronesLayer) { + $scope.layerControl.removeLayer($scope.isochronesLayer); + $scope.map.removeLayer($scope.isochronesLayer); + } + + $scope.isochronesLayer = L.featureGroup(); + + $scope.isochroneReachMode = reachMode; + var cutOffUnitValue = "Meter"; + var reachModeValue = "Distanz"; + if (reachMode === "time") { + cutOffUnitValue = "Minuten"; + reachModeValue = "Zeit"; + } + + var transitModeValue = "Passant"; + switch (transitMode) { + case "buffer": + transitModeValue = "Puffer (Luftlinie)"; + break; + case "cycling-regular": + transitModeValue = "Fahrrad"; + break; + case "driving-car": + transitModeValue = "PKW"; + break; + case "wheelchair": + transitModeValue = "Barrierefrei"; + break; + default: + transitModeValue = "Passant"; + } + + kommonitorDataExchangeService.isochroneLegend = { + transitMode: transitModeValue, + reachMode: reachModeValue, + speedInKilometersPerHour: speedInKilometersPerHour, + colorValueEntries: [], + cutOffValues: cutOffValues, + cutOffUnit: cutOffUnitValue + }; + + if (cutOffValues.length === 0) { + return; + } + else if (cutOffValues.length === 1) { + kommonitorDataExchangeService.isochroneLegend.colorValueEntries = [{ + color: "green", + value: cutOffValues[0] + }]; + } + else if (cutOffValues.length === 2) { + kommonitorDataExchangeService.isochroneLegend.colorValueEntries = [{ + color: "yellow", + value: cutOffValues[1] + }, + { + color: "green", + value: cutOffValues[0] + }]; + } + else if (cutOffValues.length === 3) { + kommonitorDataExchangeService.isochroneLegend.colorValueEntries = [{ + color: "red", + value: cutOffValues[2] + }, + { + color: "yellow", + value: cutOffValues[1] + }, + { + color: "green", + value: cutOffValues[0] + }]; + } + else if (cutOffValues.length === 4) { + kommonitorDataExchangeService.isochroneLegend.colorValueEntries = [{ + color: "red", + value: cutOffValues[3] + }, + { + color: "orange", + value: cutOffValues[2] + }, + { + color: "yellow", + value: cutOffValues[1] + }, + { + color: "green", + value: cutOffValues[0] + }]; + } + else if (cutOffValues.length === 5) { + kommonitorDataExchangeService.isochroneLegend.colorValueEntries = [{ + color: "brown", + value: cutOffValues[4] + }, { + color: "red", + value: cutOffValues[3] + }, + { + color: "orange", + value: cutOffValues[2] + }, + { + color: "yellow", + value: cutOffValues[1] + }, + { + color: "green", + value: cutOffValues[0] + }]; + } + else { + kommonitorDataExchangeService.isochroneLegend.colorValueEntries = [{ + color: "brown", + value: cutOffValues[4] + }, { + color: "red", + value: cutOffValues[3] + }, + { + color: "orange", + value: cutOffValues[2] + }, + { + color: "yellow", + value: cutOffValues[1] + }, + { + color: "green", + value: cutOffValues[0] + }]; + } + + if (useMultipleStartPoints && dissolveIsochrones) { + // merge intersecting isochrones of same cutOffValue + + // execute it 3 times in order to dissolve multiple intersections + geoJSON = mergeIntersectingIsochrones(geoJSON); + geoJSON = mergeIntersectingIsochrones(geoJSON); + geoJSON = mergeIntersectingIsochrones(geoJSON); + } + + // sort features to ensure correct z-order of layers (begin with smallest isochrones) + geoJSON.features.sort((a, b) => a.properties.value - b.properties.value); + + for (var index = geoJSON.features.length - 1; index >= 0; index--) { + + var styleIndex = getStyleIndexForFeature(geoJSON.features[index], kommonitorDataExchangeService.isochroneLegend.colorValueEntries, reachMode); + + var style = { + color: kommonitorDataExchangeService.isochroneLegend.colorValueEntries[styleIndex].color, + weight: 1, + opacity: 0.4, + fillOpacity: 0.3 + }; + + L.geoJSON(geoJSON.features[index], { + style: style, + onEachFeature: function (feature, layer) { + layer.on({ + click: function () { + + var isochroneValue = layer.feature.properties.value; + + if ($scope.isochroneReachMode === "time") { + //transform seconds to minutes + isochroneValue = isochroneValue / 60; + } + var popupContent = "" + isochroneValue + " " + cutOffUnitValue; + // var popupContent = "TestValue"; + + if (popupContent) + layer.bindPopup("Isochrone: " + JSON.stringify(popupContent)); + } + }); + } + }).addTo($scope.isochronesLayer); + } + + // $scope.isochronesLayer.StyledLayerControl = { + // removable : false, + // visible : true + // }; + + $scope.layerControl.addOverlay($scope.isochronesLayer, "Erreichbarkeits-Isochronen_" + transitModeValue, reachabilityLayerGroupName); + $scope.isochronesLayer.addTo($scope.map); + $scope.updateSearchControl(); + + $scope.map.invalidateSize(true); + }); + + $scope.$on("replaceRouteAsGeoJSON", function (event, geoJSON, transitMode, preference, routingStartPoint, routingEndPoint, + routeDistance_km, routeDuration_minutes) { + + if ($scope.routingLayer) { + $scope.layerControl.removeLayer($scope.routingLayer); + $scope.map.removeLayer($scope.routingLayer); + } + + var preferenceValue = "Schnellste"; + if (preference === "recommended") { + preferenceValue = "Empfohlen"; + } + else if (preference === "shortest") { + preferenceValue = "Kürzeste"; + } + + var transitModeValue = "Passant"; + switch (transitMode) { + case "cycling-regular": + transitModeValue = "Fahrrad"; + break; + case "driving-car": + transitModeValue = "PKW"; + break; + case "wheelchair": + transitModeValue = "Barrierefrei"; + break; + default: + transitModeValue = "Passant"; + } + + /* + routeDistance_km, routeDuration_minutes, routeAvgSpeed_kmh, + routeTotalAscent, routeTotalDescent + */ + + kommonitorDataExchangeService.routingLegend = { + transitMode: transitModeValue, + preference: preferenceValue, + routingStartPoint: routingStartPoint, + routingEndPoint: routingEndPoint, + routeDistance_km: routeDistance_km, + routeDuration_minutes: routeDuration_minutes + }; + + var style = { + color: "#ed561a", + weight: 5, + opacity: 0.7 + }; + + $scope.routingLayer = L.featureGroup(); + + // start and end point + var customStartMarker = L.AwesomeMarkers.icon({ + icon: "home", + iconColor: "white", + markerColor: "green" + }); + + var customEndMarker = L.AwesomeMarkers.icon({ + icon: "screenshot", + iconColor: "white", + markerColor: "red" + }); + + var numPoints = geoJSON.features[0].geometry.coordinates.length; + var startPoint = geoJSON.features[0].geometry.coordinates[0]; + var endPoint = geoJSON.features[0].geometry.coordinates[numPoints - 1]; + + L.marker([startPoint[1], startPoint[0]], { icon: customStartMarker }).bindPopup(routingStartPoint.label).addTo($scope.routingLayer); + L.marker([endPoint[1], endPoint[0]], { icon: customEndMarker }).bindPopup(routingEndPoint.label).addTo($scope.routingLayer); + + L.geoJSON(geoJSON, { + style: style, + onEachFeature: function (feature, layer) { + layer.on({ + click: function () { + var popupContent = "Routing Ergebnis - " + transitModeValue + " - " + preferenceValue; + // var popupContent = "TestValue"; + + if (popupContent) + layer.bindPopup(JSON.stringify(popupContent)); + } + }); + } + }).addTo($scope.routingLayer); + + // $scope.isochronesLayer.StyledLayerControl = { + // removable : false, + // visible : true + // }; + + $scope.layerControl.addOverlay($scope.routingLayer, "Routing-Ergebnis_" + transitModeValue + "_" + preferenceValue, reachabilityLayerGroupName); + $scope.routingLayer.addTo($scope.map); + $scope.map.fitBounds($scope.routingLayer.getBounds()); + $scope.updateSearchControl(); + + $scope.map.invalidateSize(true); + }); + + var getStyleIndexForFeature = function (feature, colorValueEntries, reachMode) { + var index = 0; + var featureCutOffValue = feature.properties.value; + + if (reachMode === "time") { + // answe has time in seconds - we expect minutes! + featureCutOffValue = featureCutOffValue / 60; + } + + for (var i = 0; i < colorValueEntries.length; i++) { + if (featureCutOffValue === colorValueEntries[i].value) { + index = i; + break; + } + } + + return index; + }; + + var mergeIntersectingIsochrones = function (geoJSON) { + // use turf to dissolve any overlapping/intersecting isochrones that have the same cutOffValue! + + try { + var dissolved = turf.dissolve(geoJSON, { propertyName: 'value' }); + + return dissolved; + } catch (e) { + console.error("Dissolving Isochrones failed with error: " + e); + console.error("Will return undissolved isochrones"); + return geoJSON; + } finally { + + } + + }; + + $scope.$on("replaceIsochroneMarker", function (event, lonLatArray) { + + if ($scope.isochroneMarkerLayer) { + $scope.layerControl.removeLayer($scope.isochroneMarkerLayer); + $scope.map.removeLayer($scope.isochroneMarkerLayer); + } + + $scope.isochroneMarkerLayer = L.featureGroup(); + + lonLatArray.forEach(function (lonLat) { + var layer = L.marker([lonLat[1], lonLat[0]]); + layer.bindPopup("Startpunkt der Isochronenberechnung"); + layer.addTo($scope.isochroneMarkerLayer); + }); + + $scope.layerControl.addOverlay($scope.isochroneMarkerLayer, "Startpunkte für Isochronenberechnung", reachabilityLayerGroupName); + $scope.isochroneMarkerLayer.addTo($scope.map); + $scope.updateSearchControl(); + + $scope.map.invalidateSize(true); + }); + + var createCustomMarkersFromWfsPoints = function(wfsLayer, poiMarkerLayer, dataset){ + for (var layerPropName in wfsLayer._layers){ + var geoJSONFeature = wfsLayer._layers[layerPropName].feature; + var latlng = wfsLayer._layers[layerPropName]._latlng; + + geoJSONFeature.geometry = { + type: "Point", + coordinates: [latlng.lng, latlng.lat] + }; + + var customMarker = createCustomMarker(geoJSONFeature, dataset.poiSymbolColor, dataset.poiMarkerColor, dataset.poiSymbolBootstrap3Name, dataset); + poiMarkerLayer = addPoiMarker(poiMarkerLayer, customMarker); + } + + return poiMarkerLayer; + }; + + var createCustomMarker = function(poiFeature, poiSymbolColor, poiMarkerColor, poiSymbolBootstrap3Name, metadataObject){ + var customMarker; + try { + customMarker = L.AwesomeMarkers.icon({ + icon: poiSymbolBootstrap3Name, + iconColor: poiSymbolColor, + markerColor: poiMarkerColor + }); + } catch (err) { + customMarker = L.AwesomeMarkers.icon({ + icon: 'home', // default back to home + iconColor: poiSymbolColor, + markerColor: poiMarkerColor + }); + } + + var newMarker; + + if(poiFeature.geometry.type === "Point"){ + // LAT LON order + newMarker = L.marker([Number(poiFeature.geometry.coordinates[1]), Number(poiFeature.geometry.coordinates[0])], { icon: customMarker }); + + //populate the original geoJSOn feature to the marker layer! + newMarker.feature = poiFeature; + newMarker.metadataObject = metadataObject; + } + else if (poiFeature.geometry.type === "MultiPoint"){ + + // simply take the first point as feature reference POI + // LAT LON order + newMarker = L.marker([Number(poiFeature.geometry.coordinates[0][1]), Number(poiFeature.geometry.coordinates[0][0])], { icon: customMarker }); + + //populate the original geoJSOn feature to the marker layer! + newMarker.feature = poiFeature; + newMarker.metadataObject = metadataObject; + } + else{ + console.error("NO POI object: instead got feature of type " + poiFeature.geometry.type); + } + + return newMarker; + + }; + + $scope.$on("addPoiGeoresourceAsGeoJSON", function (event, georesourceMetadataAndGeoJSON, date, useCluster) { + + // use leaflet.markercluster to cluster markers! + var markers; + if (useCluster) { + markers = L.markerClusterGroup({ + iconCreateFunction: function (cluster) { + var childCount = cluster.getChildCount(); + + var c = 'cluster-'; + if (childCount < 10) { + c += 'small'; + } else if (childCount < 30) { + c += 'medium'; + } else { + c += 'large'; + } + + var className = "marker-cluster " + c + " awesome-marker-legend-TransparentIcon-" + georesourceMetadataAndGeoJSON.poiMarkerColor; + + //'marker-cluster' + c + ' ' + + return new L.DivIcon({ html: '
        ' + childCount + '
        ', className: className, iconSize: new L.Point(40, 40) }); + } + }); + } + else { + markers = L.layerGroup(); + } + + georesourceMetadataAndGeoJSON.geoJSON.features.forEach(function (poiFeature) { + // index 0 should be longitude and index 1 should be latitude + //.bindPopup( poiFeature.properties.name ) + var newMarker = createCustomMarker(poiFeature, georesourceMetadataAndGeoJSON.poiSymbolColor, georesourceMetadataAndGeoJSON.poiMarkerColor, georesourceMetadataAndGeoJSON.poiSymbolBootstrap3Name, georesourceMetadataAndGeoJSON); + + markers = addPoiMarker(markers, newMarker); + }); + + // markers.StyledLayerControl = { + // removable : false, + // visible : true + // }; + + $scope.layerControl.addOverlay(markers, georesourceMetadataAndGeoJSON.datasetName + "_" + date, poiLayerGroupName); + markers.addTo($scope.map); + $scope.updateSearchControl(); + // $scope.map.addLayer( markers ); + $scope.map.invalidateSize(true); + }); + + $scope.$on("addPoiGeoresourceAsGeoJSON_reachabilityAnalysis", function (event, georesourceMetadataAndGeoJSON, date, useCluster) { + + // use leaflet.markercluster to cluster markers! + var markers; + if (useCluster) { + markers = L.markerClusterGroup({ + iconCreateFunction: function (cluster) { + var childCount = cluster.getChildCount(); + + var c = 'cluster-'; + if (childCount < 10) { + c += 'small'; + } else if (childCount < 30) { + c += 'medium'; + } else { + c += 'large'; + } + + var className = "marker-cluster " + c + " awesome-marker-legend-TransparentIcon-" + georesourceMetadataAndGeoJSON.poiMarkerColor; + + //'marker-cluster' + c + ' ' + + return new L.DivIcon({ html: '
        ' + childCount + '
        ', className: className, iconSize: new L.Point(40, 40) }); + } + }); + } + else { + markers = L.layerGroup(); + } + + georesourceMetadataAndGeoJSON.geoJSON.features.forEach(function (poiFeature) { + // index 0 should be longitude and index 1 should be latitude + //.bindPopup( poiFeature.properties.name ) + var newMarker = createCustomMarker(poiFeature, georesourceMetadataAndGeoJSON.poiSymbolColor, georesourceMetadataAndGeoJSON.poiMarkerColor, georesourceMetadataAndGeoJSON.poiSymbolBootstrap3Name, georesourceMetadataAndGeoJSON); + + markers = addPoiMarker(markers, newMarker); + }); + + // markers.StyledLayerControl = { + // removable : false, + // visible : true + // }; + + $scope.layerControl.addOverlay(markers, georesourceMetadataAndGeoJSON.datasetName + "_" + date + "_inEinzugsgebiet", reachabilityLayerGroupName); + markers.addTo($scope.map); + $scope.updateSearchControl(); + // $scope.map.addLayer( markers ); + $scope.map.invalidateSize(true); + }); + + var addPoiMarker = function(markers, poiMarker){ + + // var propertiesString = "
        " + JSON.stringify(poiMarker.feature.properties, null, ' ').replace(/[\{\}"]/g, '') + "
        "; + + var popupContent = '
        '; + for (var p in poiMarker.feature.properties) { + popupContent += ''; + } + popupContent += '
        ' + p + ''+ poiMarker.feature.properties[p] + '
        '; + + if (poiMarker.feature.properties.name) { + poiMarker.bindPopup(poiMarker.feature.properties.name + "\n\n" + popupContent); + } + else if (poiMarker.feature.properties.NAME) { + poiMarker.bindPopup(poiMarker.feature.properties.NAME + "\n\n" + popupContent); + } + else if (poiMarker.feature.properties[__env.FEATURE_NAME_PROPERTY_NAME]) { + poiMarker.bindPopup(poiMarker.feature.properties[__env.FEATURE_NAME_PROPERTY_NAME] + "\n\n" + popupContent); + } + else { + // poiMarker.bindPopup(propertiesString); + poiMarker.bindPopup(popupContent); + } + markers.addLayer(poiMarker); + + return markers; + }; + + $scope.$on("removePoiGeoresource", function (event, georesourceMetadataAndGeoJSON) { + + var layerName = georesourceMetadataAndGeoJSON.datasetName; + + $scope.layerControl._layers.forEach(function (layer) { + if (layer.group.name === poiLayerGroupName && layer.name.includes(layerName + "_")) { + $scope.layerControl.removeLayer(layer.layer); + $scope.map.removeLayer(layer.layer); + $scope.updateSearchControl(); + } + }); + }); + + $scope.$on("removePoiGeoresource_reachabilityAnalysis", function (event, georesourceMetadataAndGeoJSON) { + + var layerName = georesourceMetadataAndGeoJSON.datasetName; + + $scope.layerControl._layers.forEach(function (layer) { + if (layer.group.name === reachabilityLayerGroupName && layer.name.includes(layerName + "_")) { + $scope.layerControl.removeLayer(layer.layer); + $scope.map.removeLayer(layer.layer); + $scope.updateSearchControl(); + } + }); + }); + + $scope.$on("addAoiGeoresourceAsGeoJSON", function (event, georesourceMetadataAndGeoJSON, date) { + + var color = georesourceMetadataAndGeoJSON.aoiColor; + + var layer = L.geoJSON(georesourceMetadataAndGeoJSON.geoJSON, { + style: function (feature) { + return { + fillColor: color, + color: "black", + weight: 1, + opacity: 1, + fillOpacity: 0.7 + }; + }, + onEachFeature: onEachFeatureGeoresource + }); + + // layer.StyledLayerControl = { + // removable : false, + // visible : true + // }; + + $scope.layerControl.addOverlay(layer, georesourceMetadataAndGeoJSON.datasetName + "_" + date, aoiLayerGroupName); + layer.addTo($scope.map); + $scope.updateSearchControl(); + + $scope.map.invalidateSize(true); + }); + + $scope.$on("removeAoiGeoresource", function (event, georesourceMetadataAndGeoJSON) { + + var layerName = georesourceMetadataAndGeoJSON.datasetName; + + $scope.layerControl._layers.forEach(function (layer) { + if (layer.group.name === aoiLayerGroupName && layer.name.includes(layerName + "_")) { + $scope.layerControl.removeLayer(layer.layer); + $scope.map.removeLayer(layer.layer); + $scope.updateSearchControl(); + } + }); + }); + + $scope.$on("addLoiGeoresourceAsGeoJSON", function (event, georesourceMetadataAndGeoJSON, date) { + + var color = georesourceMetadataAndGeoJSON.aoiColor; + + var featureGroup = L.featureGroup(); + + var style = { + color: georesourceMetadataAndGeoJSON.loiColor, + dashArray: georesourceMetadataAndGeoJSON.loiDashArrayString, + weight: georesourceMetadataAndGeoJSON.loiWidth || 3, + opacity: 1 + }; + + + + georesourceMetadataAndGeoJSON.geoJSON.features.forEach((item, i) => { + var type = item.geometry.type; + + if (type === "Polygon" || type === "MultiPolygon"){ + var lines = turf.polygonToLine(item); + + L.geoJSON(lines, { + style: style, + onEachFeature: onEachFeatureGeoresource + }).addTo(featureGroup); + } + else{ + L.geoJSON(item, { + style: style, + onEachFeature: onEachFeatureGeoresource + }).addTo(featureGroup); + } + }); + + // georesourceMetadataAndGeoJSON.geoJSON.features.forEach((loiFeature, i) => { + // var latLngs = + // var polyline = L.polyline(loiFeature.geometry.coordinates); + // + // var geoJSON = polyline.toGeoJSON(); + // + // var geoJSON_line = L.geoJSON(geoJSON, { + // style: style, + // onEachFeature: onEachFeatureGeoresource + // }) + // + // geoJSON_line.addTo(featureGroup); + // }); + + // layer.StyledLayerControl = { + // removable : false, + // visible : true + // }; + + $scope.layerControl.addOverlay(featureGroup, georesourceMetadataAndGeoJSON.datasetName + "_" + date, loiLayerGroupName); + featureGroup.addTo($scope.map); + $scope.updateSearchControl(); + + $scope.map.invalidateSize(true); + }); + + $scope.$on("removeLoiGeoresource", function (event, georesourceMetadataAndGeoJSON) { + + var layerName = georesourceMetadataAndGeoJSON.datasetName; + + $scope.layerControl._layers.forEach(function (layer) { + if (layer.group.name === loiLayerGroupName && layer.name.includes(layerName + "_")) { + $scope.layerControl.removeLayer(layer.layer); + $scope.map.removeLayer(layer.layer); + $scope.updateSearchControl(); + } + }); + }); + + $scope.$on("adjustOpacityForIndicatorLayer", function (event, indicatorMetadata, opacity) { + // var layerName = indicatorMetadataAndGeoJSON.indicatorName; + // + // $scope.layerControl._layers.forEach(function(layer){ + // if(layer.group.name === indicatorLayerGroupName && layer.name.includes(layerName)){ + // layer.layer.setOpacity(opacity); + // layer.layer.setStyle({ + // opacity: opacity + // }); + // } + // }); + + opacity = opacity.toFixed(numberOfDecimals); + + kommonitorVisualStyleHelperService.setOpacity(opacity); + $rootScope.$broadcast("restyleCurrentLayer", true); + }); + + $scope.$on("addWmsLayerToMap", function (event, dataset, opacity) { + var wmsLayer = L.tileLayer.betterWms(dataset.url, { + layers: dataset.layerName, + transparent: true, + format: 'image/png', + minZoom: __env.minZoomLevel, + maxZoom: __env.maxZoomLevel, + opacity: opacity + }); + + $scope.layerControl.addOverlay(wmsLayer, dataset.title, wmsLayerGroupName); + wmsLayer.addTo($scope.map); + $scope.updateSearchControl(); + $scope.map.invalidateSize(true); + }); + + $scope.$on("adjustOpacityForWmsLayer", function (event, dataset, opacity) { + var layerName = dataset.title; + + $scope.layerControl._layers.forEach(function (layer) { + if (layer.group.name === wmsLayerGroupName && layer.name.includes(layerName)) { + layer.layer.setOpacity(opacity); + } + }); + }); + + $scope.$on("adjustOpacityForAoiLayer", function (event, dataset, opacity) { + var layerName = dataset.datasetName; + + $scope.layerControl._layers.forEach(function (layer) { + if (layer.group.name === aoiLayerGroupName && layer.name.includes(layerName)) { + layer.layer.setStyle({ + fillOpacity:opacity, + opacity:opacity + }); + } + }); + }); + + $scope.$on("adjustOpacityForLoiLayer", function (event, dataset, opacity) { + var layerName = dataset.datasetName; + + $scope.layerControl._layers.forEach(function (layer) { + if (layer.group.name === loiLayerGroupName && layer.name.includes(layerName)) { + layer.layer.setStyle({ + fillOpacity:opacity, + opacity:opacity + }); + } + }); + }); + + $scope.$on("adjustOpacityForPoiLayer", function (event, dataset, opacity) { + var layerName = dataset.datasetName; + + $scope.layerControl._layers.forEach(function (layer) { + if (layer.group.name === poiLayerGroupName && layer.name.includes(layerName)) { + + if(layer.layer._layers){ + for(var layerId in layer.layer._layers){ + layer.layer._layers[layerId].setOpacity(opacity); + } + } + else if(layer.layer._featureGroup){ + for(var layerId in layer.layer._featureGroup._layers){ + layer.layer._featureGroup._layers[layerId].setOpacity(opacity); + } + } + else{ + layer.layer.setOpacity(opacity); + } + } + }); + }); + + $scope.$on("removeWmsLayerFromMap", function (event, dataset) { + + var layerName = dataset.title; + + $scope.layerControl._layers.forEach(function (layer) { + if (layer.group.name === wmsLayerGroupName && layer.name.includes(layerName)) { + $scope.layerControl.removeLayer(layer.layer); + $scope.map.removeLayer(layer.layer); + } + }); + }); + + var getWfsStyle = function(dataset, opacity){ + + if(dataset.geometryType === "POI"){ + return { + weight: 1, + opacity: opacity, + color: dataset.poiMarkerColor, + dashArray: '', + fillOpacity: opacity, + fillColor: dataset.poiMarkerColor + }; + } + + else if (dataset.geometryType === "LOI"){ + return { + weight: dataset.loiWidth, + opacity: opacity, + color: dataset.loiColor, + dashArray: dataset.loiDashArrayString, + fillOpacity: opacity, + fillColor: dataset.loiColor + }; + } + + else{ + return { + weight: 1, + opacity: opacity, + color: dataset.aoiColor, + dashArray: '', + fillOpacity: opacity, + fillColor: dataset.aoiColor + }; + } + + }; + + $scope.getFilterEncoding = function(dataset){ + + var filterExpressions = []; + + if(dataset.filterEncoding.PropertyIsEqualTo && dataset.filterEncoding.PropertyIsEqualTo.propertyName && dataset.filterEncoding.PropertyIsEqualTo.propertyValue){ + filterExpressions.push(new L.Filter.EQ(dataset.filterEncoding.PropertyIsEqualTo.propertyName, dataset.filterEncoding.PropertyIsEqualTo.propertyValue)); + } + + if (dataset.filterFeaturesToMapBBOX) { + filterExpressions.push(new L.Filter.BBox(dataset.featureTypeGeometryName, $scope.map.getBounds(), L.CRS.EPSG3857)); + } + + if (filterExpressions.length == 0){ + return undefined; + } + + if (filterExpressions.length < 2){ + return filterExpressions; + } + else{ + // var stringifiedFilterExpressions = []; + + // for (const filterExpr of filterExpressions) { + // stringifiedFilterExpressions.push(L.XmlUtil.serializeXmlDocumentString(filterExpr.toGml())); + // } + + // return new L.Filter.And(...stringifiedFilterExpressions); + return new L.Filter.And(...filterExpressions); + } + + }; + + $scope.$on("addWfsLayerToMap", function (event, dataset, opacity, useCluster) { + var wfsLayerOptions = { + url: dataset.url, + typeNS: dataset.featureTypeNamespace, + namespaceUri: "http://mapserver.gis.umn.edu/mapserver", + typeName: dataset.featureTypeName, + geometryField: dataset.featureTypeGeometryName, + // maxFeatures: null, + style: getWfsStyle(dataset, opacity) + }; + + var filterEncoding = $scope.getFilterEncoding(dataset); + if (filterEncoding){ + wfsLayerOptions.filter = filterEncoding; + } + + + var wfsLayer; + var poiMarkerLayer; + + if(dataset.geometryType === "POI"){ + + if (useCluster) { + poiMarkerLayer = L.markerClusterGroup({ + iconCreateFunction: function (cluster) { + var childCount = cluster.getChildCount(); + + var c = 'cluster-'; + if (childCount < 10) { + c += 'small'; + } else if (childCount < 30) { + c += 'medium'; + } else { + c += 'large'; + } + + var className = "marker-cluster " + c + " awesome-marker-legend-TransparentIcon-" + dataset.poiMarkerColor; + + //'marker-cluster' + c + ' ' + + return new L.DivIcon({ html: '
        ' + childCount + '
        ', className: className, iconSize: new L.Point(40, 40) }); + } + }); + } + else { + poiMarkerLayer = L.layerGroup(); + } + + wfsLayer = new L.WFS(wfsLayerOptions); + } + else{ + wfsLayer = new L.WFS(wfsLayerOptions); + } + + try { + wfsLayer.once('load', function () { + + if(dataset.geometryType === "POI"){ + poiMarkerLayer = createCustomMarkersFromWfsPoints(wfsLayer, poiMarkerLayer, dataset); + } + + console.log("Try to fit bounds on wfsLayer"); + $scope.map.fitBounds(wfsLayer.getBounds()); + + console.log("Tried fit bounds on wfsLayer"); + + $scope.map.invalidateSize(true); + // $scope.loadingData = false; + }); + + wfsLayer.on('click', function (event) { + // var propertiesString = "
        " + JSON.stringify(event.layer.feature.properties, null, ' ').replace(/[\{\}"]/g, '') + "
        "; + + var popupContent = '
        '; + for (var p in event.layer.feature.properties) { + popupContent += ''; + } + popupContent += '
        ' + p + ''+ event.layer.feature.properties[p] + '
        '; + + var popup = L.popup(); + popup + .setLatLng(event.latlng) + .setContent(popupContent) + .openOn($scope.map); + }); + if(poiMarkerLayer){ + $scope.layerControl.addOverlay(poiMarkerLayer, dataset.title, wfsLayerGroupName); + poiMarkerLayer.addTo($scope.map); + } + else{ + $scope.layerControl.addOverlay(wfsLayer, dataset.title, wfsLayerGroupName); + wfsLayer.addTo($scope.map); + } + $scope.updateSearchControl(); + + } + catch (error) { + $scope.loadingData = false; + kommonitorDataExchangeService.displayMapApplicationError(error); + } + + }); + + $scope.$on("adjustOpacityForWfsLayer", function (event, dataset, opacity) { + var layerName = dataset.title; + + $scope.layerControl._layers.forEach(function (layer) { + if (layer.group.name === wfsLayerGroupName && layer.name.includes(layerName)) { + // layer.layer.setOpacity(opacity); + var newStyle = getWfsStyle(dataset, opacity); + // layer.layer.options.style = newStyle; + if(layer.layer._layers){ + for(var layerId in layer.layer._layers){ + + + if(dataset.geometryType === "POI"){ + layer.layer._layers[layerId].setOpacity(opacity); + } + else{ + layer.layer._layers[layerId].setStyle(newStyle); + } + } + } + else{ + + if(dataset.geometryType === "POI"){ + layer.layer.setOpacity(opacity); + } + else{ + layer.layer.setStyle(newStyle); + } + } + + } + }); + }); + + $scope.$on("adjustColorForWfsLayer", function (event, dataset, opacity) { + var layerName = dataset.title; + + $scope.layerControl._layers.forEach(function (layer) { + if (layer.group.name === wfsLayerGroupName && layer.name.includes(layerName)) { + var newStyle = getWfsStyle(dataset, opacity); + + layer.layer.setStyle(newStyle); + } + }); + }); + + $scope.$on("removeWfsLayerFromMap", function (event, dataset) { + + var layerName = dataset.title; + + $scope.layerControl._layers.forEach(function (layer) { + if (layer.group.name === wfsLayerGroupName && layer.name.includes(layerName)) { + $scope.layerControl.removeLayer(layer.layer); + $scope.map.removeLayer(layer.layer); + } + }); + }); + + $scope.$on("addFileLayerToMap", function (event, dataset, opacity) { + var fileLayer; + + var style = { + weight: 1, + opacity: opacity, + color: defaultBorderColor, + dashArray: '', + fillOpacity: 1, + fillColor: dataset.displayColor + }; + + var fileType = dataset.type; + if (fileType.toUpperCase() === "geojson".toUpperCase()) { + var geoJSON = dataset.content; + + if (isLinearGeoJSON(geoJSON)) { + // when is line dataset then set the border color + style.color = dataset.displayColor; + } + + fileLayer = L.geoJSON(geoJSON, { + style: style, + onEachFeature: function (feature, layer) { + layer.on({ + click: function () { + + // var propertiesString = "
        " + JSON.stringify(feature.properties, null, ' ').replace(/[\{\}"]/g, '') + "
        "; + + var popupContent = '
        '; + for (var p in feature.properties) { + popupContent += ''; + } + popupContent += '
        ' + p + ''+ feature.properties[p] + '
        '; + + if (popupContent) + layer.bindPopup(popupContent); + } + }); + } + }); + $scope.showFileLayer(fileLayer, dataset); + } + else if (fileType.toUpperCase() === "shp".toUpperCase()) { + // transform shape ZIP arrayBuffer to GeoJSON + // var geoJSON = await shp(dataset.content).then( + // var zip = shp.parseZip(dataset.content); + shp(dataset.content).then( + function (geojson) { + console.log("Shapefile parsed successfully"); + + if (isLinearGeoJSON(geojson)) { + // when is line dataset then set the border color + style.color = dataset.displayColor; + } + + fileLayer = L.geoJSON(geojson, { + style: style, + onEachFeature: function (feature, layer) { + layer.on({ + click: function () { + + // var propertiesString = "
        " + JSON.stringify(feature.properties, null, ' ').replace(/[\{\}"]/g, '') + "
        "; + + var popupContent = '
        '; + for (var p in feature.properties) { + popupContent += ''; + } + popupContent += '
        ' + p + ''+ feature.properties[p] + '
        '; + + if (popupContent) + layer.bindPopup(popupContent); + } + }); + } + }); + + + $scope.showFileLayer(fileLayer, dataset); + }, + function (reason) { + console.error("Error while parsing Shapefile"); + console.error(reason); + $rootScope.$broadcast("FileLayerError", reason, dataset); + throw reason; + } + ); + } + + }); + + var isLinearGeoJSON = function (geoJSON) { + if (geoJSON.features) { + // featureCollection + if (geoJSON.features[0].geometry) { + if (geoJSON.features[0].geometry.type === "LineString" || geoJSON.features[0].geometry.type === "MultiLineString") { + return true; + } + } + } + else if (geoJSON.geometry) { + // single object + if (geoJSON.geometry.type === "LineString" || geoJSON.geometry.type === "MultiLineString") { + return true; + } + } + else if (geoJSON.geometries) { + // geometryCollection + if (geoJSON.geometries[0].type === "LineString" || geoJSON.geometries[0].type === "MultiLineString") { + return true; + } + } + + return false; + }; + + $scope.showFileLayer = function (fileLayer, dataset) { + $scope.layerControl.addOverlay(fileLayer, dataset.title, fileLayerGroupName); + fileLayer.addTo($scope.map); + + console.log("Try to fit bounds on fileLayer"); + $scope.map.fitBounds(fileLayer.getBounds()); + + console.log("Tried fit bounds on fileLayer"); + + $rootScope.$broadcast("FileLayerSuccess", dataset); + + $scope.updateSearchControl(); + + $scope.map.invalidateSize(true); + }; + + $scope.$on("adjustOpacityForFileLayer", function (event, dataset, opacity) { + var layerName = dataset.title; + + $scope.layerControl._layers.forEach(function (layer) { + if (layer.group.name === fileLayerGroupName && layer.name.includes(layerName)) { + var newStyle = { + weight: 1, + opacity: opacity, + color: defaultBorderColor, + dashArray: '', + fillOpacity: opacity, + fillColor: dataset.displayColor + }; + + // layer.layer.options.style = newStyle; + layer.layer.setStyle(newStyle); + } + }); + }); + + $scope.$on("adjustColorForFileLayer", function (event, dataset) { + var layerName = dataset.title; + + $scope.layerControl._layers.forEach(function (layer) { + if (layer.group.name === fileLayerGroupName && layer.name.includes(layerName)) { + var newStyle = { + weight: 1, + color: defaultBorderColor, + dashArray: '', + fillColor: dataset.displayColor + }; + + //var geoJSON = layer.layertoGeoJSON(); + var firstLayersPropertyName = Object.keys(layer.layer._layers)[0]; + if (firstLayersPropertyName) { + var geoJSON_exmaple = layer.layer._layers[firstLayersPropertyName].toGeoJSON(); + if (isLinearGeoJSON(geoJSON_exmaple)) { + newStyle.color = dataset.displayColor; + } + } + + layer.layer.setStyle(newStyle); + } + }); + }); + + $scope.$on("removeFileLayerFromMap", function (event, dataset) { + + var layerName = dataset.title; + + $scope.layerControl._layers.forEach(function (layer) { + if (layer.group.name === fileLayerGroupName && layer.name.includes(layerName)) { + $scope.layerControl.removeLayer(layer.layer); + $scope.map.removeLayer(layer.layer); + } + }); + }); + + $scope.$on("removeReachabilityLayers", function (event) { + + var layerNamePartly = "Isochrone"; + + $scope.layerControl._layers.forEach(function (layer) { + if (layer.group.name === reachabilityLayerGroupName && layer.name.includes(layerNamePartly)) { + $scope.layerControl.removeLayer(layer.layer); + $scope.map.removeLayer(layer.layer); + } + }); + }); + + $scope.$on("removeRoutingLayers", function (event) { + + var layerNamePartly = "Routing"; + + $scope.layerControl._layers.forEach(function (layer) { + if (layer.group.name === reachabilityLayerGroupName && layer.name.includes(layerNamePartly)) { + $scope.layerControl.removeLayer(layer.layer); + $scope.map.removeLayer(layer.layer); + } + }); + }); + + function highlightFeature(e) { + var layer = e.target; + + highlightFeatureForLayer(layer); + } + + function highlightFeatureForLayer(layer) { + + setTemporarilyHighlightedStyle(layer); + + // update diagrams for hovered feature + $rootScope.$broadcast("updateDiagramsForHoveredFeature", layer.feature.properties); + + } + + function highlightClickedFeature(layer) { + + setPermanentlyHighlightedStyle(layer); + + // update diagrams for hovered feature + $rootScope.$broadcast("updateDiagramsForHoveredFeature", layer.feature.properties); + } + + function setPermanentlyHighlightedStyle(layer) { + var fillOpacity = 1; + if ($scope.useTransparencyOnIndicator) { + fillOpacity = defaultFillOpacityForHighlightedFeatures; + } + + layer.setStyle({ + weight: 3, + color: defaultColorForClickedFeatures, + dashArray: '', + fillOpacity: fillOpacity + }); + + if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) { + layer.bringToFront(); + // also bring possible isochrone layer to front + // so it will not disapper behing indicator layer + if ($scope.isochronesLayer) { + $scope.isochronesLayer.bringToFront(); + } + } + } + + function setTemporarilyHighlightedStyle(layer) { + var fillOpacity = 1; + if ($scope.useTransparencyOnIndicator) { + fillOpacity = defaultFillOpacity; + } + + layer.setStyle({ + weight: 3, + color: defaultColorForHoveredFeatures, + dashArray: '', + fillOpacity: fillOpacity + }); + + if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) { + layer.bringToFront(); + // also bring possible isochrone layer to front + // so it will not disapper behing indicator layer + if ($scope.isochronesLayer) { + $scope.isochronesLayer.bringToFront(); + } + } + } + + function preserveHighlightedFeatures() { + $scope.map.eachLayer(function (layer) { + if (layer.feature) { + if (kommonitorFilterHelperService.featureIsCurrentlySelected(layer.feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { + setPermanentlyHighlightedStyle(layer); + $rootScope.$broadcast("updateDiagramsForHoveredFeature", layer.feature.properties); + } + } + }); + } + + $scope.$on("preserveHighlightedFeatures", function (event) { + preserveHighlightedFeatures(); + }); + + function resetHighlight(e) { + var layer = e.target; + resetHighlightForLayer(layer); + + if (!kommonitorFilterHelperService.featureIsCurrentlySelected(layer.feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { + layer.bringToBack(); + } + //layer.bringToBack(); + } + + function resetHighlightForLayer(layer) { + + var style; + + // only restyle feature when not in list of clicked features + if (!kommonitorFilterHelperService.featureIsCurrentlySelected(layer.feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { + if (kommonitorFilterHelperService.featureIsCurrentlyFiltered(layer.feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { + layer.setStyle($scope.filteredStyle); + } + else if (!kommonitorDataExchangeService.isMeasureOfValueChecked) { + //$scope.currentIndicatorLayer.resetStyle(layer); + if ($scope.indicatorTypeOfCurrentLayer.includes('DYNAMIC')) { + style = kommonitorVisualStyleHelperService.styleDynamicIndicator(layer.feature, $scope.dynamicIncreaseBrew, $scope.dynamicDecreaseBrew, $scope.propertyName, $scope.useTransparencyOnIndicator); + + layer.setStyle(style); + } + else { + style = kommonitorVisualStyleHelperService.styleDefault(layer.feature, $scope.defaultBrew, $scope.dynamicIncreaseBrew, $scope.dynamicDecreaseBrew, $scope.propertyName, $scope.useTransparencyOnIndicator, $scope.datasetContainsNegativeValues); + layer.setStyle(style); + } + } + else { + style = kommonitorVisualStyleHelperService.styleMeasureOfValue(layer.feature, $scope.gtMeasureOfValueBrew, $scope.ltMeasureOfValueBrew, $scope.propertyName, $scope.useTransparencyOnIndicator); + layer.setStyle(style); + } + } + else { + setPermanentlyHighlightedStyle(layer); + } + + //update diagrams for unhoveredFeature + $rootScope.$broadcast("updateDiagramsForUnhoveredFeature", layer.feature.properties); + } + + function resetHighlightClickedFeature(layer) { + var style; + //$scope.currentIndicatorLayer.resetStyle(layer); + if (kommonitorFilterHelperService.featureIsCurrentlyFiltered(layer.feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { + layer.setStyle($scope.filteredStyle); + } + else if (!kommonitorDataExchangeService.isMeasureOfValueChecked) { + //$scope.currentIndicatorLayer.resetStyle(layer); + if ($scope.indicatorTypeOfCurrentLayer.includes('DYNAMIC')) { + style = kommonitorVisualStyleHelperService.styleDynamicIndicator(layer.feature, $scope.dynamicIncreaseBrew, $scope.dynamicDecreaseBrew, $scope.propertyName, $scope.useTransparencyOnIndicator); + + layer.setStyle(style); + } + else { + style = kommonitorVisualStyleHelperService.styleDefault(layer.feature, $scope.defaultBrew, $scope.dynamicIncreaseBrew, $scope.dynamicDecreaseBrew, $scope.propertyName, $scope.useTransparencyOnIndicator, $scope.datasetContainsNegativeValues); + + layer.setStyle(style); + } + } + else { + style = kommonitorVisualStyleHelperService.styleMeasureOfValue(layer.feature, $scope.gtMeasureOfValueBrew, $scope.ltMeasureOfValueBrew, $scope.propertyName, $scope.useTransparencyOnIndicator); + + layer.setStyle(style); + } + } + + function resetHighlightCustom(e) { + $scope.currentCustomIndicatorLayer.resetStyle(e.target); + if (!kommonitorFilterHelperService.featureIsCurrentlySelected(e.target.feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { + e.target.bringToBack(); + } + } + + var wait = ms => new Promise((r, j) => setTimeout(r, ms)) + + $scope.recenterMap = function () { + $scope.map.invalidateSize(true); + + fitBounds(); + + }; + + $scope.$on("recenterMapContent", function (event) { + $scope.recenterMap(); + }); + + $scope.$on("invalidateMapSize", function (event) { + $timeout(function(){ + $scope.map.invalidateSize(true); + }, 500); + }); + + $scope.$on("recenterMapOnHideSideBar", async function (event) { + //wait due to animation of the sidebar + + // make animation in 30 steps + // var waitForInMs = 30; + // for(var i=0; i<=300; i++){ + // + // i += waitForInMs; + // + // await wait(waitForInMs); + // + // $scope.map.invalidateSize(true); + // + // panToCenterOnInActiveMenue(500); + // // $scope.recenterMap(); + // } + + var waitForInMs = 100; + await wait(waitForInMs); + panToCenterOnInActiveMenue(500); + }); + + $scope.$on("recenterMapOnShowSideBar", async function (event) { + //wait due to animation of the sidebar + + // make animation in 30 steps + // var waitForInMs = 30; + // for(var i=0; i<=300; i++){ + // + // i += waitForInMs; + // + // await wait(waitForInMs); + // + // $scope.map.invalidateSize(true); + // + // panToCenterOnActiveMenue(500); + // // $scope.recenterMap(); + // } + + var waitForInMs = 100; + await wait(waitForInMs); + panToCenterOnActiveMenue(500); + + }); + + function panToCenterOnActiveMenue(numPixels) { + if ($scope.map) { + $scope.map.invalidateSize(true); + $scope.map.panBy(L.point(numPixels, 0)); + + $scope.map.invalidateSize(true); + } + }; + + function panToCenterOnInActiveMenue(numPixels) { + if ($scope.map) { + $scope.map.invalidateSize(true); + $scope.map.panBy(L.point(-numPixels, 0)); + + $scope.map.invalidateSize(true); + } + }; + + + function fitBounds() { + if ($scope.map && $scope.currentIndicatorLayer) { + + $scope.map.invalidateSize(true); + // $scope.map.setView(L.latLng($scope.latCenter, $scope.lonCenter), $scope.zoomLevel); + $scope.map.fitBounds($scope.currentIndicatorLayer.getBounds()); + } + + } + + function zoomToFeature(e) { + map.fitBounds(e.target.getBounds()); + } + + function markOutliers(indicatorMetadataAndGeoJSON, indicatorPropertyName) { + // identify possible data outliers + // mark them using a dedicated property + + $scope.outliers_high = []; + $scope.outliers_low = []; + + var valueArray = new Array(); + + indicatorMetadataAndGeoJSON.geoJSON.features.forEach(function (feature) { + if (!kommonitorDataExchangeService.indicatorValueIsNoData(feature.properties[indicatorPropertyName])) { + if (!valueArray.includes(feature.properties[indicatorPropertyName])) { + valueArray.push(feature.properties[indicatorPropertyName]); + } + } + }); + + // https://jstat.github.io/all.html#quartiles + var quartiles = jStat.quartiles(valueArray); + var quartile_25 = quartiles[0]; + var quartile_75 = quartiles[2]; + + var diff = quartile_75 - quartile_25; + var whiskerRange_outliers_soft = diff * 1.5; + var whiskerRange_outliers_extreme = diff * 3; + + var whisker_low_soft = quartile_25 - whiskerRange_outliers_soft; + var whisker_high_soft = quartile_75 + whiskerRange_outliers_soft; + + var whisker_low_extreme = quartile_25 - whiskerRange_outliers_extreme; + var whisker_high_extreme = quartile_75 + whiskerRange_outliers_extreme; + + // for now only mark extreme outliers! + + indicatorMetadataAndGeoJSON.geoJSON.features.forEach(function (feature) { + // compare feature value to whiskers and set property + if (kommonitorDataExchangeService.indicatorValueIsNoData(feature.properties[indicatorPropertyName])) { + feature.properties[outlierPropertyName] = outlierPropertyValue_no; + } + else if (feature.properties[indicatorPropertyName] < whisker_low_extreme) { + feature.properties[outlierPropertyName] = outlierPropertyValue_low_extreme; + $scope.containsOutliers_low = true; + $scope.outliers_low.push(feature.properties[indicatorPropertyName]); + } + // else if (feature.properties[indicatorPropertyName] < whisker_low_soft){ + // feature.properties[outlierPropertyName] = outlierPropertyValue_low_soft; + // $scope.containsOutliers_low = true; + // $scope.outliers_low.push(feature.properties[indicatorPropertyName]); + // } + else if (feature.properties[indicatorPropertyName] > whisker_high_extreme) { + feature.properties[outlierPropertyName] = outlierPropertyValue_high_extreme; + $scope.containsOutliers_high = true; + $scope.outliers_high.push(feature.properties[indicatorPropertyName]); + } + // else if (feature.properties[indicatorPropertyName] > whisker_high_soft){ + // feature.properties[outlierPropertyName] = outlierPropertyValue_high_soft; + // $scope.containsOutliers_high = true; + // $scope.outliers_high.push(feature.properties[indicatorPropertyName]); + // } + else { + feature.properties[outlierPropertyName] = outlierPropertyValue_no; + } + }); + + // sort outliers arrays + $scope.outliers_high.sort(function (a, b) { + return a - b; + }); + $scope.outliers_low.sort(function (a, b) { + return a - b; + }); + + return indicatorMetadataAndGeoJSON; + } + + $scope.setNoDataValuesAsNull = function (indicatorMetadataAndGeoJSON) { + indicatorMetadataAndGeoJSON.geoJSON.features.forEach(function (feature) { + if (kommonitorDataExchangeService.indicatorValueIsNoData(feature.properties[$scope.indicatorPropertyName])) { + feature.properties[$scope.indicatorPropertyName] = null; + } + }); + + return indicatorMetadataAndGeoJSON; + } + + $scope.$on("replaceIndicatorAsGeoJSON", function (event, indicatorMetadataAndGeoJSON, spatialUnitName, date, justRestyling, isCustomComputation) { + + console.log('replaceIndicatorAsGeoJSON was called'); + + kommonitorVisualStyleHelperService.isCustomComputation = false; + if (isCustomComputation){ + kommonitorVisualStyleHelperService.isCustomComputation = true; + } + + //reset opacity + kommonitorVisualStyleHelperService.setOpacity(__env.defaultFillOpacity); + + refreshFilteredStyle(); + refreshOutliersStyle(); + refreshNoDataStyle(); + + $scope.defaultBrew = new classyBrew(); + $scope.gtMeasureOfValueBrew = new classyBrew(); + $scope.ltMeasureOfValueBrew = new classyBrew(); + + $scope.currentIndicatorMetadataAndGeoJSON = indicatorMetadataAndGeoJSON; + + if (!justRestyling) { + // empty layer of possibly selected features + // kommonitorFilterHelperService.clearSelectedFeatures(); + // kommonitorFilterHelperService.clearFilteredFeatures(); + + $rootScope.$broadcast("checkBalanceMenueAndButton"); + } + + console.log("Remove old indicatorLayer if exists"); + if ($scope.currentIndicatorLayer) { + $scope.layerControl.removeLayer($scope.currentIndicatorLayer); + $scope.map.removeLayer($scope.currentIndicatorLayer); + } + + $scope.currentIndicatorContainsZeroValues = false; + + $scope.date = date; + + $scope.indicatorPropertyName = INDICATOR_DATE_PREFIX + date; + $scope.indicatorName = indicatorMetadataAndGeoJSON.indicatorName; + $scope.indicatorDescription = indicatorMetadataAndGeoJSON.metadata.description; + $scope.indicatorUnit = indicatorMetadataAndGeoJSON.unit; + + $scope.currentIndicatorMetadataAndGeoJSON = $scope.setNoDataValuesAsNull($scope.currentIndicatorMetadataAndGeoJSON); + + // identify and mark outliers prior to setting up of styling + // in styling methods, outliers should be removed from classification! + $scope.currentIndicatorMetadataAndGeoJSON = markOutliers($scope.currentIndicatorMetadataAndGeoJSON, $scope.indicatorPropertyName); + + kommonitorDataExchangeService.setAllFeaturesProperty(indicatorMetadataAndGeoJSON, $scope.indicatorPropertyName); + kommonitorDataExchangeService.setSelectedFeatureProperty(kommonitorFilterHelperService.selectedIndicatorFeatureIds, $scope.indicatorPropertyName); + + $scope.currentGeoJSONOfCurrentLayer = $scope.currentIndicatorMetadataAndGeoJSON.geoJSON; + + for (var i = 0; i < indicatorMetadataAndGeoJSON.geoJSON.features.length; i++) { + var containsZero = false; + var containsNoData = false; + if (indicatorMetadataAndGeoJSON.geoJSON.features[i].properties[$scope.indicatorPropertyName] === 0 || indicatorMetadataAndGeoJSON.geoJSON.features[i].properties[$scope.indicatorPropertyName] === "0") { + $scope.currentIndicatorContainsZeroValues = true; + containsZero = true; + }; + + if (kommonitorDataExchangeService.indicatorValueIsNoData(indicatorMetadataAndGeoJSON.geoJSON.features[i].properties[$scope.indicatorPropertyName])) { + $scope.currentIndicatorContainsNoDataValues = true; + containsNoData = true; + }; + + if (containsZero && containsNoData) { + break; + } + } + + /* ///////////////////////////////// RASTER SPECIAL TREATMENT + // improve Raster display by eliminiating NoData cells and + // omitting display border in style + */ + + if(kommonitorDataExchangeService.selectedSpatialUnitIsRaster()){ + indicatorMetadataAndGeoJSON.geoJSON.features = indicatorMetadataAndGeoJSON.geoJSON.features.filter(feature => { + if (kommonitorDataExchangeService.indicatorValueIsNoData(feature.properties[$scope.indicatorPropertyName])) { + return false; + } + return true; + }); + } + + var layer; + + $scope.indicatorTypeOfCurrentLayer = indicatorMetadataAndGeoJSON.indicatorType; + + if (kommonitorDataExchangeService.isMeasureOfValueChecked) { + var measureOfValueBrewArray = kommonitorVisualStyleHelperService.setupMeasureOfValueBrew($scope.currentGeoJSONOfCurrentLayer, $scope.indicatorPropertyName, defaultColorBrewerPaletteForGtMovValues, defaultColorBrewerPaletteForLtMovValues, kommonitorVisualStyleHelperService.classifyMethod, kommonitorDataExchangeService.measureOfValue); + $scope.gtMeasureOfValueBrew = measureOfValueBrewArray[0]; + $scope.ltMeasureOfValueBrew = measureOfValueBrewArray[1]; + + $scope.propertyName = INDICATOR_DATE_PREFIX + date; + + layer = L.geoJSON(indicatorMetadataAndGeoJSON.geoJSON, { + style: function (feature) { + if (kommonitorFilterHelperService.featureIsCurrentlyFiltered(feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { + return $scope.filteredStyle; + } + return kommonitorVisualStyleHelperService.styleMeasureOfValue(feature, $scope.gtMeasureOfValueBrew, $scope.ltMeasureOfValueBrew, $scope.propertyName, $scope.useTransparencyOnIndicator); + }, + onEachFeature: onEachFeatureIndicator + }); + + // $scope.makeMeasureOfValueLegend(isCustomComputation); + + } + else { + + if (indicatorMetadataAndGeoJSON.indicatorType.includes("STATUS")) { + $scope.datasetContainsNegativeValues = $scope.containsNegativeValues(indicatorMetadataAndGeoJSON.geoJSON); + if ($scope.datasetContainsNegativeValues) { + var dynamicIndicatorBrewArray = kommonitorVisualStyleHelperService.setupDynamicIndicatorBrew(indicatorMetadataAndGeoJSON.geoJSON, $scope.indicatorPropertyName, defaultColorBrewerPaletteForBalanceIncreasingValues, defaultColorBrewerPaletteForBalanceDecreasingValues, kommonitorVisualStyleHelperService.classifyMethod); + $scope.dynamicIncreaseBrew = dynamicIndicatorBrewArray[0]; + $scope.dynamicDecreaseBrew = dynamicIndicatorBrewArray[1]; + + } + else { + $scope.defaultBrew = kommonitorVisualStyleHelperService.setupDefaultBrew(indicatorMetadataAndGeoJSON.geoJSON, $scope.indicatorPropertyName, indicatorMetadataAndGeoJSON.defaultClassificationMapping.items.length, indicatorMetadataAndGeoJSON.defaultClassificationMapping.colorBrewerSchemeName, kommonitorVisualStyleHelperService.classifyMethod); + } + $scope.propertyName = INDICATOR_DATE_PREFIX + date; + + layer = L.geoJSON(indicatorMetadataAndGeoJSON.geoJSON, { + style: function (feature) { + if (kommonitorFilterHelperService.featureIsCurrentlyFiltered(feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { + return $scope.filteredStyle; + } + return kommonitorVisualStyleHelperService.styleDefault(feature, $scope.defaultBrew, $scope.dynamicIncreaseBrew, $scope.dynamicDecreaseBrew, $scope.propertyName, $scope.useTransparencyOnIndicator, $scope.datasetContainsNegativeValues); + }, + onEachFeature: onEachFeatureIndicator + }); + // $scope.makeDefaultLegend(indicatorMetadataAndGeoJSON.defaultClassificationMapping, $scope.datasetContainsNegativeValues, isCustomComputation); + } + else if (indicatorMetadataAndGeoJSON.indicatorType.includes("DYNAMIC")) { + var dynamicIndicatorBrewArray = kommonitorVisualStyleHelperService.setupDynamicIndicatorBrew(indicatorMetadataAndGeoJSON.geoJSON, $scope.indicatorPropertyName, defaultColorBrewerPaletteForBalanceIncreasingValues, defaultColorBrewerPaletteForBalanceDecreasingValues, kommonitorVisualStyleHelperService.classifyMethod); + $scope.dynamicIncreaseBrew = dynamicIndicatorBrewArray[0]; + $scope.dynamicDecreaseBrew = dynamicIndicatorBrewArray[1]; + + $scope.propertyName = INDICATOR_DATE_PREFIX + date; + + layer = L.geoJSON(indicatorMetadataAndGeoJSON.geoJSON, { + style: function(feature){ + if (kommonitorFilterHelperService.featureIsCurrentlyFiltered(feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { + return $scope.filteredStyle; + } + return kommonitorVisualStyleHelperService.styleDynamicIndicator(feature, $scope.dynamicIncreaseBrew, $scope.dynamicDecreaseBrew, $scope.propertyName, $scope.useTransparencyOnIndicator); + }, + onEachFeature: onEachFeatureIndicator + }); + // $scope.makeDynamicIndicatorLegend(isCustomComputation); + } + + + } + + $scope.currentIndicatorLayer = layer; + + $rootScope.$broadcast("updateLegendDisplay", $scope.currentIndicatorContainsZeroValues, $scope.datasetContainsNegativeValues, $scope.currentIndicatorContainsNoDataValues, $scope.containsOutliers_high, $scope.containsOutliers_low, $scope.outliers_low, $scope.outliers_high, kommonitorDataExchangeService.selectedDate); + + // if(spatialUnitName.includes("raster") || spatialUnitName.includes("Raster") || spatialUnitName.includes("grid") || spatialUnitName.includes("Grid")){ + // layer.style.color = undefined; + // } + + + + // layer.StyledLayerControl = { + // removable : false, + // visible : true + // }; + + var layerName = indicatorMetadataAndGeoJSON.indicatorName + "_" + spatialUnitName + "_" + date; + + if (isCustomComputation) { + layerName += " - individuelles Berechnungsergebnis"; + } + $scope.layerControl.addOverlay(layer, layerName, indicatorLayerGroupName); + layer.addTo($scope.map); + $scope.updateSearchControl(); + + // var justRestyling = false; + + // fitBounds(); + + if ($scope.containsOutliers_low || $scope.containsOutliers_high) { + $scope.showOutlierInfoAlert = true; + } + + $rootScope.$broadcast("updateDiagrams", $scope.currentIndicatorMetadataAndGeoJSON, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitId, date, $scope.defaultBrew, $scope.gtMeasureOfValueBrew, $scope.ltMeasureOfValueBrew, $scope.dynamicIncreaseBrew, $scope.dynamicDecreaseBrew, kommonitorDataExchangeService.isMeasureOfValueChecked, kommonitorDataExchangeService.measureOfValue, justRestyling); + $rootScope.$broadcast("indicatortMapDisplayFinished"); + + $scope.map.invalidateSize(true); + }); + + $scope.containsNegativeValues = function (geoJSON) { + + var containsNegativeValues = false; + $scope.datasetContainsNegativeValues = false; + for (var i = 0; i < geoJSON.features.length; i++) { + if (geoJSON.features[i].properties[$scope.indicatorPropertyName] < 0) { + containsNegativeValues = true; + break; + } + } + + return containsNegativeValues; + }; + + $scope.$on("restyleCurrentLayer", function (event, skipDiagramRefresh) { + + // var transparency = document.getElementById("indicatorTransparencyInput").value; + // var opacity = 1 - transparency; + // + // kommonitorVisualStyleHelperService.setOpacity(opacity); + + refreshFilteredStyle(); + refreshOutliersStyle(); + refreshNoDataStyle(); + + $scope.defaultBrew = new classyBrew(); + $scope.gtMeasureOfValueBrew = new classyBrew(); + $scope.ltMeasureOfValueBrew = new classyBrew(); + + var style; + if ($scope.currentIndicatorLayer) { + + $scope.currentIndicatorMetadataAndGeoJSON = markOutliers($scope.currentIndicatorMetadataAndGeoJSON, $scope.indicatorPropertyName); + $scope.currentGeoJSONOfCurrentLayer = $scope.currentIndicatorMetadataAndGeoJSON.geoJSON; + + $scope.currentIndicatorContainsZeroValues = false; + + for (var i = 0; i < $scope.currentIndicatorMetadataAndGeoJSON.geoJSON.features.length; i++) { + var containsZero = false; + var containsNoData = false; + if ($scope.currentIndicatorMetadataAndGeoJSON.geoJSON.features[i].properties[$scope.indicatorPropertyName] === 0 || $scope.currentIndicatorMetadataAndGeoJSON.geoJSON.features[i].properties[$scope.indicatorPropertyName] === "0") { + $scope.currentIndicatorContainsZeroValues = true; + containsZero = true; + }; + + if (kommonitorDataExchangeService.indicatorValueIsNoData($scope.currentIndicatorMetadataAndGeoJSON.geoJSON.features[i].properties[$scope.indicatorPropertyName])) { + $scope.currentIndicatorContainsNoDataValues = true; + containsNoData = true; + }; + + if (containsZero && containsNoData) { + break; + } + } + + if (kommonitorDataExchangeService.isMeasureOfValueChecked) { + var measureOfValueBrewArray = kommonitorVisualStyleHelperService.setupMeasureOfValueBrew($scope.currentGeoJSONOfCurrentLayer, $scope.indicatorPropertyName, defaultColorBrewerPaletteForGtMovValues, defaultColorBrewerPaletteForLtMovValues, kommonitorVisualStyleHelperService.classifyMethod, kommonitorDataExchangeService.measureOfValue); + $scope.gtMeasureOfValueBrew = measureOfValueBrewArray[0]; + $scope.ltMeasureOfValueBrew = measureOfValueBrewArray[1]; + + $scope.currentIndicatorLayer.eachLayer(function (layer) { + if (kommonitorFilterHelperService.featureIsCurrentlyFiltered(layer.feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { + layer.setStyle($scope.filteredStyle); + } + else { + style = kommonitorVisualStyleHelperService.styleMeasureOfValue(layer.feature, $scope.gtMeasureOfValueBrew, $scope.ltMeasureOfValueBrew, $scope.propertyName, $scope.useTransparencyOnIndicator); + + layer.setStyle(style); + } + + }); + + // $scope.makeMeasureOfValueLegend(); + } + else { + + if ($scope.indicatorTypeOfCurrentLayer.includes('DYNAMIC')) { + var dynamicIndicatorBrewArray = kommonitorVisualStyleHelperService.setupDynamicIndicatorBrew($scope.currentIndicatorMetadataAndGeoJSON.geoJSON, $scope.indicatorPropertyName, defaultColorBrewerPaletteForBalanceIncreasingValues, defaultColorBrewerPaletteForBalanceDecreasingValues, kommonitorVisualStyleHelperService.classifyMethod); + $scope.dynamicIncreaseBrew = dynamicIndicatorBrewArray[0]; + $scope.dynamicDecreaseBrew = dynamicIndicatorBrewArray[1]; + + $scope.currentIndicatorLayer.eachLayer(function (layer) { + if (kommonitorFilterHelperService.featureIsCurrentlyFiltered(layer.feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { + layer.setStyle($scope.filteredStyle); + } + else { + style = kommonitorVisualStyleHelperService.styleDynamicIndicator(layer.feature, $scope.dynamicIncreaseBrew, $scope.dynamicDecreaseBrew, $scope.propertyName, $scope.useTransparencyOnIndicator); + + layer.setStyle(style); + } + + }); + // $scope.makeDynamicIndicatorLegend(); + } + else { + $scope.datasetContainsNegativeValues = $scope.containsNegativeValues($scope.currentGeoJSONOfCurrentLayer); + if ($scope.datasetContainsNegativeValues) { + var dynamicIndicatorBrewArray = kommonitorVisualStyleHelperService.setupDynamicIndicatorBrew($scope.currentIndicatorMetadataAndGeoJSON.geoJSON, $scope.indicatorPropertyName, defaultColorBrewerPaletteForBalanceIncreasingValues, defaultColorBrewerPaletteForBalanceDecreasingValues, kommonitorVisualStyleHelperService.classifyMethod); + $scope.dynamicIncreaseBrew = dynamicIndicatorBrewArray[0]; + $scope.dynamicDecreaseBrew = dynamicIndicatorBrewArray[1]; + } + else { + $scope.defaultBrew = kommonitorVisualStyleHelperService.setupDefaultBrew($scope.currentGeoJSONOfCurrentLayer, $scope.indicatorPropertyName, $scope.currentIndicatorMetadataAndGeoJSON.defaultClassificationMapping.items.length, $scope.currentIndicatorMetadataAndGeoJSON.defaultClassificationMapping.colorBrewerSchemeName, kommonitorVisualStyleHelperService.classifyMethod); + } + + $scope.currentIndicatorLayer.eachLayer(function (layer) { + if (kommonitorFilterHelperService.featureIsCurrentlyFiltered(layer.feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { + layer.setStyle($scope.filteredStyle); + } + else { + style = kommonitorVisualStyleHelperService.styleDefault(layer.feature, $scope.defaultBrew, $scope.dynamicIncreaseBrew, $scope.dynamicDecreaseBrew, $scope.propertyName, $scope.useTransparencyOnIndicator, $scope.datasetContainsNegativeValues); + layer.setStyle(style); + } + }); + // $scope.makeDefaultLegend(kommonitorDataExchangeService.selectedIndicator.defaultClassificationMapping, $scope.datasetContainsNegativeValues); + } + + } + + $rootScope.$broadcast("updateLegendDisplay", $scope.currentIndicatorContainsZeroValues, $scope.datasetContainsNegativeValues, $scope.currentIndicatorContainsNoDataValues, $scope.containsOutliers_high, $scope.containsOutliers_low, $scope.outliers_low, $scope.outliers_high, kommonitorDataExchangeService.selectedDate); + + if (!skipDiagramRefresh) { + var justRestyling = true; + + $rootScope.$broadcast("updateDiagrams", $scope.currentIndicatorMetadataAndGeoJSON, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitId, $scope.date, $scope.defaultBrew, $scope.gtMeasureOfValueBrew, $scope.ltMeasureOfValueBrew, $scope.dynamicIncreaseBrew, $scope.dynamicDecreaseBrew, kommonitorDataExchangeService.isMeasureOfValueChecked, kommonitorDataExchangeService.measureOfValue, justRestyling); + } + + //ensure that highlighted feature remain highlighted + preserveHighlightedFeatures(); + } + + $scope.map.invalidateSize(true); + + }); + + $scope.$on("highlightFeatureOnMap", function (event, spatialFeatureName) { + + // console.log("highlight feature on map for featureName " + spatialFeatureName); + + if(!spatialFeatureName){ + return; + } + var done = false; + + $scope.map.eachLayer(function (layer) { + if (!done && layer.feature) { + if (layer.feature.properties[__env.FEATURE_NAME_PROPERTY_NAME] == spatialFeatureName) { + highlightFeatureForLayer(layer); + done = true; + } + } + + }); + + }); + + $scope.$on("unhighlightFeatureOnMap", function (event, spatialFeatureName) { + if(!spatialFeatureName){ + return; + } + + // console.log("unhighlight feature on map for featureName " + spatialFeatureName); + + var done = false; + + $scope.map.eachLayer(function (layer) { + if (!done && layer.feature) { + if (layer.feature.properties[__env.FEATURE_NAME_PROPERTY_NAME] == spatialFeatureName) { + resetHighlightForLayer(layer); + done = true; + } + } + + }); + + }); + + $scope.$on("switchHighlightFeatureOnMap", function (event, spatialFeatureName) { + if(!spatialFeatureName){ + return; + } + + // console.log("switch highlight feature on map for featureName " + spatialFeatureName); + + var done = false; + + $scope.map.eachLayer(function (layer) { + if (!done && layer.feature) { + if (layer.feature.properties[__env.FEATURE_NAME_PROPERTY_NAME] == spatialFeatureName) { + switchHighlightFeature(layer); + done = true; + } + } + + }); + + }); + + $scope.$on("unselectAllFeatures", function (event) { + + kommonitorFilterHelperService.clearSelectedFeatures(); + $rootScope.$broadcast("restyleCurrentLayer", false); + }); + + $scope.$on("removeAllDrawnPoints", function (event) { + + if ($scope.drawnPointFeatures) { + $scope.drawnPointFeatures.clearLayers(); + $rootScope.$broadcast("onUpdateDrawnPointFeatures"); + } + }); + + $scope.$on("enablePointDrawTool", function (event) { + + // FeatureGroup is to store editable layers + if (!$scope.drawnPointFeatures) { + $scope.drawnPointFeatures = new L.FeatureGroup(); + } + + L.drawLocal = { + edit: { + toolbar: { + actions: { + save: { + title: "Bearbeitung speichern.", + text: "Speichern", + }, + cancel: { + title: "Bearbeitung verwerfen.", + text: "Abbrechen", + }, + clearAll: { + title: "Alle Features entfernen.", + text: "Alle Features entfernen", + }, + }, + buttons: { + edit: "Layer editieren.", + editDisabled: "Keine Layer zum editieren vorhanden.", + remove: "Layer entfernen.", + removeDisabled: "Keine Layer zum entfernen vorhanden.", + }, + }, + handlers: { + edit: { + tooltip: { + text: "Bearbeitungspunkte oder Punktmarker ziehen, um Feature zu editieren.", + subtext: "Abbrechen klicken, um Bearbeitung zu verwefen.", + }, + }, + remove: { + tooltip: { + text: "Feature anklicken, um es zu entfernen", + }, + }, + } + }, + draw: { + toolbar: { + actions: { + title: "Zeichnen abbrechen", + text: "Abbrechen", + }, + finish: { + title: "Zeichnen beenden", + text: "Beenden", + }, + undo: { + title: "Zuletzt gezeichneten Punkt entfernen", + text: "Letzten Punkt entfernen", + }, + buttons: { + polyline: "Polylinie zeichnen", + polygon: "Polygon zeichnen", + rectangle: "Rechteck zeichnen", + circle: "Kreis zeichnen", + marker: "Punkt zeichnen", + circlemarker: "Kreispunkt zeichnen", + }, + }, + handlers: { + circle: { + tooltip: { + start: "Klicken und halten, um Kreis zu zeichnen.", + }, + radius: "Radius", + }, + circlemarker: { + tooltip: { + start: "Klicken, um einen Punkt zu markieren.", + }, + }, + marker: { + tooltip: { + start: "Klicken, um einen Punkt zu markieren.", + }, + }, + polygon: { + tooltip: { + start: "Klicken, um ein Polygon zu beginnen.", + cont: "Klicken, um das Polygon weiter zu zeichnen.", + end: "Ersten Punkt anklicken, um Polygon zu beenden.", + }, + }, + polyline: { + error: "Fehler: Selbstueberschneidung!", + tooltip: { + start: "Klicken, um eine Polylinie zu beginnen.", + cont: "Klicken, um die Polylinie weiter zu zeichnen.", + end: "Letzten Punkt erneut anklicken, um Polylinie zu beenden.", + }, + }, + rectangle: { + tooltip: { + start: "Klicken und halten, um Rechteck zu zeichnen.", + }, + }, + simpleshape: { + tooltip: { + end: "Maus loslassen, um Zeichnung zu beenden.", + }, + }, + } + } + + }; + + $scope.map.addLayer($scope.drawnPointFeatures); + $scope.drawPointControl = new L.Control.Draw({ + edit: { + featureGroup: $scope.drawnPointFeatures + }, + draw: { + polyline: false, + polygon: false, + rectangle: false, + circle: false, + circlemarker: false + }, + position: 'bottomleft' + + }); + + $scope.map.addControl($scope.drawPointControl); + + $scope.map.on(L.Draw.Event.CREATED, function (event) { + var layer = event.layer; + + $scope.drawnPointFeatures.addLayer(layer); + + $rootScope.$broadcast("onUpdateDrawnPointFeatures", $scope.drawnPointFeatures); + }); + + $scope.map.on(L.Draw.Event.EDITED, function (event) { + + $rootScope.$broadcast("onUpdateDrawnPointFeatures", $scope.drawnPointFeatures); + }); + + $scope.map.on(L.Draw.Event.DELETED, function (event) { + + $rootScope.$broadcast("onUpdateDrawnPointFeatures", $scope.drawnPointFeatures); + }); + + }); + + $scope.$on("disablePointDrawTool", function (event) { + + try { + $scope.drawPointControl = undefined; + $scope.map.removeLayer($scope.drawnPointFeatures); + $scope.map.removeControl($scope.drawPointControl); + } + catch (error) { + // kommonitorDataExchangeService.displayMapApplicationError(error); + } + + }); + + $scope.$on("zoomToGeoresourceLayer", async function (event, georesourceMetadata) { + + let layerName = georesourceMetadata.datasetName; + + let layerGroupName = undefined; + + if (georesourceMetadata.isPOI){ + layerGroupName = poiLayerGroupName; + } + else if(georesourceMetadata.isLOI){ + layerGroupName = loiLayerGroupName; + } + else if(georesourceMetadata.isAOI){ + layerGroupName = aoiLayerGroupName; + } + + $scope.layerControl._layers.forEach(function (layer) { + if (layerGroupName && layer.group.name === layerGroupName && layer.name.includes(layerName + "_")) { + $scope.map.fitBounds(layer.layer.getBounds()); + } + else if (layer.name.includes(layerName + "_")){ + $scope.map.fitBounds(layer.layer.getBounds()); + } + }); + }); + + } + ] + }); diff --git a/app/components/kommonitorUserInterface/kommonitorMap/kommonitor-map.module.js b/app/components/kommonitorUserInterface/kommonitorMap/kommonitor-map.module.js index 82c908fc0..42d3964de 100644 --- a/app/components/kommonitorUserInterface/kommonitorMap/kommonitor-map.module.js +++ b/app/components/kommonitorUserInterface/kommonitorMap/kommonitor-map.module.js @@ -1,533 +1,368 @@ +"use strict"; angular.module('kommonitorMap', ['kommonitorDataExchange', 'kommonitorVisualStyleHelper', 'kommonitorInfoLegendHelper', 'kommonitorFilterHelper']); /** * a common serviceInstance that holds all needed properties and methods for * interacting with a map (openlayers). */ -angular.module('kommonitorMap').service( - 'kommonitorMapService', - [ '$rootScope', '$http', function($rootScope, $http) { - - - // // central map object - // this.map; - // - // this.initializeMap = function() { - // - // // initialize map referring to div element with id="map" - // this.map = L.map('map').setView([51.4386432, 7.0115552], 12); - // - // // create OSM tile layer with correct attribution - // var osmUrl='http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; - // var osmAttrib='Map data © OpenStreetMap contributors'; - // var osm = new L.TileLayer(osmUrl, {minZoom: 1, maxZoom: 19, attribution: osmAttrib}).addTo(this.map); - // - // } - - this.addSpatialUnitGeopackage = function () { - - $rootScope.$broadcast("addSpatialUnitAsGeopackage"); - }; - - - this.addSpatialUnitGeoJSON = function (spatialUnitMetadataAndGeoJSON, date) { - - $rootScope.$broadcast("addSpatialUnitAsGeoJSON", - spatialUnitMetadataAndGeoJSON, date); - }; - - this.addSpatialUnitWFS = function (name, wfsUrl) { - - $rootScope.$broadcast("addSpatialUnitAsWFS", - name, wfsUrl); - }; - - this.addGeoresourceGeoJSON = function (georesourceMetadataAndGeoJSON, date) { - - $rootScope.$broadcast("addGeoresourceAsGeoJSON", - georesourceMetadataAndGeoJSON, date); - }; - - this.addPoiGeoresourceGeoJSON = function (georesourceMetadataAndGeoJSON, date, useCluster) { - - $rootScope.$broadcast("addPoiGeoresourceAsGeoJSON", - georesourceMetadataAndGeoJSON, date, useCluster); - }; - - this.addPoiGeoresourceGeoJSON_reachabilityAnalysis = function (georesourceMetadataAndGeoJSON, date, useCluster) { - - $rootScope.$broadcast("addPoiGeoresourceAsGeoJSON_reachabilityAnalysis", - georesourceMetadataAndGeoJSON, date, useCluster); - }; - - this.addLoiGeoresourceGeoJSON = function (georesourceMetadataAndGeoJSON, date) { - - $rootScope.$broadcast("addLoiGeoresourceAsGeoJSON", - georesourceMetadataAndGeoJSON, date); - }; - - this.addAoiGeoresourceGeoJSON = function (georesourceMetadataAndGeoJSON, date) { - - $rootScope.$broadcast("addAoiGeoresourceAsGeoJSON", - georesourceMetadataAndGeoJSON, date); - }; - - this.replaceIsochroneGeoJSON = function (geoJSON, transitMode, reachMode, cutOffValues, useMultipleStartPoints, dissolveIsochrones, speedInKilometersPerHour) { - - $rootScope.$broadcast("replaceIsochronesAsGeoJSON", - geoJSON, transitMode, reachMode, cutOffValues, useMultipleStartPoints, dissolveIsochrones, speedInKilometersPerHour); - }; - - this.replaceRouteGeoJSON = function (geoJSON, transitMode, preference, routingStartPoint, routingEndPoint, - routeDistance_km, routeDuration_minutes) { - - $rootScope.$broadcast("replaceRouteAsGeoJSON", geoJSON, transitMode, preference, routingStartPoint, routingEndPoint, - routeDistance_km, routeDuration_minutes); - }; - - this.replaceIsochroneMarker = function (lonLatArray) { - - $rootScope.$broadcast("replaceIsochroneMarker", - lonLatArray); - }; - - this.removePoiGeoresource = function (georesourceMetadataAndGeoJSON) { - - $rootScope.$broadcast("removePoiGeoresource", - georesourceMetadataAndGeoJSON); - }; - - this.removePoiGeoresource_reachabilityAnalysis = function (georesourceMetadataAndGeoJSON) { - - $rootScope.$broadcast("removePoiGeoresource_reachabilityAnalysis", - georesourceMetadataAndGeoJSON); - }; - - this.removeLoiGeoresource = function (georesourceMetadataAndGeoJSON) { - - $rootScope.$broadcast("removeLoiGeoresource", - georesourceMetadataAndGeoJSON); - }; - - this.removeAoiGeoresource = function (georesourceMetadataAndGeoJSON) { - - $rootScope.$broadcast("removeAoiGeoresource", - georesourceMetadataAndGeoJSON); - }; - - this.removeReachabilityLayers = function(){ - $rootScope.$broadcast("removeReachabilityLayers"); - } - - this.removeRoutingLayers = function(){ - $rootScope.$broadcast("removeRoutingLayers"); - } - - this.addIndicatorGeoJSON = function (indicatorMetadataAndGeoJSON, spatialUnitName, date) { - - $rootScope.$broadcast("addIndicatorAsGeoJSON", - indicatorMetadataAndGeoJSON, spatialUnitName, date); - }; - - this.replaceIndicatorGeoJSON = function (indicatorMetadataAndGeoJSON, spatialUnitName, date, justRestyling, isCustomComputation) { - - $rootScope.$broadcast("replaceIndicatorAsGeoJSON", - indicatorMetadataAndGeoJSON, spatialUnitName, date, justRestyling, isCustomComputation); - }; - - this.addCustomIndicatorGeoJSON = function (indicatorMetadataAndGeoJSON, spatialUnitName, date) { - - $rootScope.$broadcast("addCustomIndicatorAsGeoJSON", - indicatorMetadataAndGeoJSON, spatialUnitName, date); - }; - - this.restyleCurrentLayer = function () { - - $rootScope.$broadcast("restyleCurrentLayer"); - }; - - this.addWmsLayerToMap = function (dataset, opacity) { - $rootScope.$broadcast("addWmsLayerToMap", - dataset); - }; - - this.adjustOpacityForWmsLayer = function (dataset, opacity) { - $rootScope.$broadcast("adjustOpacityForWmsLayer", - dataset, opacity); - }; - - this.adjustOpacityForAoiLayer = function (dataset, opacity) { - $rootScope.$broadcast("adjustOpacityForAoiLayer", - dataset, opacity); - }; - - this.adjustOpacityForPoiLayer = function (dataset, opacity) { - $rootScope.$broadcast("adjustOpacityForPoiLayer", - dataset, opacity); - }; - - this.adjustOpacityForLoiLayer = function (dataset, opacity) { - $rootScope.$broadcast("adjustOpacityForLoiLayer", - dataset, opacity); - }; - - this.removeWmsLayerFromMap = function (dataset) { - $rootScope.$broadcast("removeWmsLayerFromMap", - dataset); - }; - - this.addWfsLayerToMap = function (dataset, opacity, useCluster) { - $rootScope.$broadcast("addWfsLayerToMap", - dataset, opacity, useCluster); - }; - - this.adjustOpacityForWfsLayer = function (dataset, opacity) { - $rootScope.$broadcast("adjustOpacityForWfsLayer", - dataset, opacity); - }; - - this.adjustColorForWfsLayer = function (dataset, opacity) { - $rootScope.$broadcast("adjustColorForWfsLayer", - dataset, opacity); - }; - - this.removeWfsLayerFromMap = function (dataset) { - $rootScope.$broadcast("removeWfsLayerFromMap", - dataset); - }; - - this.addFileLayerToMap = function (dataset, opacity) { - $rootScope.$broadcast("addFileLayerToMap", - dataset); - }; - - this.adjustOpacityForFileLayer = function (dataset, opacity) { - $rootScope.$broadcast("adjustOpacityForFileLayer", - dataset, opacity); - }; - - this.adjustColorForFileLayer = function (dataset, color) { - $rootScope.$broadcast("adjustColorForFileLayer", - dataset, color); - }; - - this.removeFileLayerFromMap = function (dataset) { - $rootScope.$broadcast("removeFileLayerFromMap", - dataset); - }; - - - - this.addBaseDataLayer = function (selectedBaseData) { - - $rootScope.$broadcast("addBaseDataLayerAsWMS", - selectedBaseData); - - }; - - this.addIndicatorLayer = function (selectedIndicator) { - - $rootScope.$broadcast("addIndicatorLayerAsWMS", - selectedIndicator); - - }; - - this.addIndicatorLayer_withNameAndStyle = function(selectedIndicator, layerName, sldName){ - $rootScope.$broadcast("addIndicatorLayerAsWMS_withNameAndStyle", - { - 'selectedIndicator':selectedIndicator, - 'layerName':layerName, - 'sldName':sldName - }); - } - - - - this.visualizeGeometricOutputs = function(geometricOutputs){ - - for (var i=0; i < geometricOutputs.length; i++){ - - var currentNameForLayerProperty = this.generateUniqueOutputLayerPropertyName(); - - /* - * if output is a "reference" output, then we will not display - * it on the map --> hence continue! - */ - if(geometricOutputs[i].reference) - continue; - else - this.addGeometricOutputToMap(geometricOutputs[i], currentNameForLayerProperty); - } - }; - - this.generateUniqueOutputLayerPropertyName = function(){ - - /* - * basic name for layer property - * - * important if we add multiple layers as overlays, - * since each layer has to be defined as unique property - */ - var baseNameForLayerProperty = 'Output'; - var min = 1; - var max = 1000; - - var randomNameExtension = (Math.random() * (max - min)) + min; - - return baseNameForLayerProperty + '_' + randomNameExtension; - }; - - this.generateUniqueInputLayerPropertyName = function(inputIdentifier){ - - /* - * basic name for layer property - * - * important if we add multiple layers as overlays, - * since each layer has to be defined as unique property - */ - var baseNameForLayerProperty = 'Input_' + inputIdentifier; - - return baseNameForLayerProperty; - -// var min = 1; -// var max = 1000; -// -// var randomNameExtension = (Math.random() * (max - min)) + min; -// -// return baseNameForLayerProperty + '_' + randomNameExtension; - }; - - this.addGeometricOutputToMap = function(geometricOutput, currentNameForLayerProperty){ - /* - * output may be complex output or bbox output - */ - - if(geometricOutput.data.complexData) - this.addComplexOutputToMap(geometricOutput, currentNameForLayerProperty); - - else if(geometricOutput.data.boundingBoxData) - this.addBboxOutputToMap(geometricOutput, currentNameForLayerProperty); - - else - // should never reach this line; error - return null; - }; - - this.addComplexOutputToMap = function(complexOutput, currentNameForLayerProperty){ - /* - * format will be GeoJSON or a WMS. Hence we must inspect its format/mimeType. - */ - - var format = complexOutput.data.complexData.mimeType; - - if(format === 'application/WMS'){ - /* - * it is a WMS data! - */ - this.processAsWMS(complexOutput, currentNameForLayerProperty); - } - else{ - /* - * it is GeoJSON data! - */ - this.processAsGeoJSON(complexOutput, currentNameForLayerProperty); - } - }; - - this.processAsGeoJSON = function(complexOutput, currentNameForLayerProperty){ - var geoJSONValue = complexOutput.data.complexData.value; - - /* - * geoJSONValue can either be a String or directly a GeoJSON object! - * - * if it it a GeoJSON object, it should have a "type" property! - */ - var geoJSONFeature; - if(geoJSONValue.type){ - /* - * is already GeoJSON object! - */ - geoJSONFeature = geoJSONValue; - } - else{ - /* - * it is a String, so we parse it as JSON - */ - geoJSONFeature = JSON.parse(geoJSONValue); - } - - var outputIdentifier = complexOutput.identifier; - - /* - * calls the associated event/method from wps-map controller! - */ - $rootScope.$broadcast("addGeoJSONOutput", - { geoJSONFeature: geoJSONFeature, - layerPropertyName: currentNameForLayerProperty, - outputIdentifier: outputIdentifier}); - }; - - this.processAsWMS = function(complexOutput, currentNameForLayerProperty){ - - /* - * the WMS URL is currently included as follows: - * - * - */ - var wmsURL_complexDataValue = complexOutput.data.complexData.value; - - var wmsURL_withQueryParameters = extract_WMS_URL(wmsURL_complexDataValue); - - /* - * comma-separated String of layerNames listed in WMS Capabilities - * - * retrieved from query parameter within wmsURL: - * Example: "layers=N52:primary3416203586858505312.tif_b5f8f00c-903c-477d-876b-86bfe1fe8788" - */ - var layerNamesString = getUrlQueryParameterValueByName("layers", wmsURL_withQueryParameters); - console.log("layers query parameter: " + layerNamesString); - - var outputIdentifier = complexOutput.identifier; - - //remove all query parameters to obtain base WMS URL - var wmsBaseURL = wmsURL_withQueryParameters.split("?")[0]; - //re-append "?" as required by Leaflet - wmsBaseURL = wmsBaseURL + "?"; - - /* - * TODO retrieve Capabilities of WMS and get layer names - * - * TODO maybe there is a JS library that can help us here! - * - * TODO simply use all layers??? - * - * TODO or similar to reference outputs: Change result forms to show available - * WMS Layers and let user choose the layer he/she intends to visualize! - */ - - /* - * calls the associated event/method from wps-map controller! - */ - $rootScope.$broadcast("addWMSOutput", - { wmsURL: wmsBaseURL, - layerNamesString: layerNamesString, - layerPropertyName: currentNameForLayerProperty, - outputIdentifier: outputIdentifier}); - }; - - var extract_WMS_URL = function(wmsURL_complexDataValue){ - - /* - * WMS URL value might look like this: - * "" - * - * Hence we must remove the leading "![CDATA[" and trailing "]]" - */ - - var leadingCdataString = ""; - - console.log(wmsURL_complexDataValue); - - if (wmsURL_complexDataValue.startsWith(leadingCdataString)){ - /* - * remove leading and trailing sections - */ - var wmsTargetURL = wmsURL_complexDataValue.replace(leadingCdataString, ""); - - wmsTargetURL = wmsTargetURL.replace(trailingBracketsString, ""); - - console.log(wmsTargetURL); - - return wmsTargetURL; - } - else if (wmsURL_complexDataValue.startsWith("http")){ - /* - * seems to be the target URL already, no extraction needed - */ - return wmsURL_complexDataValue; - } - else{ - /* - * TODO can this line be reached? Then, how to handle correctly? - */ - return wmsURL_complexDataValue; - } - - }; - - function getUrlQueryParameterValueByName(parameterName, url) { - - parameterName = parameterName.replace(/[\[\]]/g, "\\$&"); - var regex = new RegExp("[?&]" + parameterName + "(=([^&#]*)|&|#|$)"), - resultsArray = regex.exec(url); - if (!resultsArray) - return null; - if (!resultsArray[2]) - return ''; - - return decodeURIComponent(resultsArray[2].replace(/\+/g, " ")); - } - - this.addBboxOutputToMap = function(bboxOutput, currentNameForLayerProperty){ - - /* - * TODO check CRS --> GeoJSON requires WGS84 - * project if necessary! - */ - - var outputIdentifier = bboxOutput.identifier; - - var description = bboxOutput.abstractValue || bboxOutput.title; - - var crs = bboxOutput.data.boundingBoxData.crs; - - /* - * TODO check CRS --> WGS84 should be used for GeoJSON - */ - - var lowerCorner = bboxOutput.data.boundingBoxData.lowerCorner; - var upperCorner = bboxOutput.data.boundingBoxData.upperCorner; - - var coordinatesArray = this.createCoordinatesArrayFromBbox(lowerCorner, upperCorner); - - var geoJSONFeature = { - "type": "Feature", - "properties": {"popupContent": description}, - "geometry": { - "type": "Polygon", - "coordinates": coordinatesArray - } - }; - - /* - * calls the associated event/method from wps-map controller! - */ - $rootScope.$broadcast("addGeoJSONOutput", - { geoJSONFeature: geoJSONFeature, - layerPropertyName: currentNameForLayerProperty, - outputIdentifier: outputIdentifier}); - }; - - /** - * Creates a Coordinates Array for GeoJSON feature representing the - * Bounding Box - */ - this.createCoordinatesArrayFromBbox = function(lowerCorner, upperCorner){ - - var lat_lowerLeft = parseFloat(lowerCorner.split(" ")[0]); - var lat_upperRight = parseFloat(upperCorner.split(" ")[0]); - var lon_lowerLeft = parseFloat(lowerCorner.split(" ")[1]); - var lon_upperRight = parseFloat(upperCorner.split(" ")[1]); - - var coordinatesArray = [[ - [lon_lowerLeft, lat_lowerLeft], - [lon_lowerLeft, lat_upperRight], - [lon_upperRight, lat_upperRight], - [lon_upperRight, lat_lowerLeft], - [lon_lowerLeft, lat_lowerLeft] - ]]; - - return coordinatesArray; - }; - - }]); +angular.module('kommonitorMap').service('kommonitorMapService', ['$rootScope', '$http', function ($rootScope, $http) { + // // central map object + // this.map; + // + // this.initializeMap = function() { + // + // // initialize map referring to div element with id="map" + // this.map = L.map('map').setView([51.4386432, 7.0115552], 12); + // + // // create OSM tile layer with correct attribution + // var osmUrl='http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; + // var osmAttrib='Map data © OpenStreetMap contributors'; + // var osm = new L.TileLayer(osmUrl, {minZoom: 1, maxZoom: 19, attribution: osmAttrib}).addTo(this.map); + // + // } + this.addSpatialUnitGeopackage = function () { + $rootScope.$broadcast("addSpatialUnitAsGeopackage"); + }; + this.addSpatialUnitGeoJSON = function (spatialUnitMetadataAndGeoJSON, date) { + $rootScope.$broadcast("addSpatialUnitAsGeoJSON", spatialUnitMetadataAndGeoJSON, date); + }; + this.addSpatialUnitWFS = function (name, wfsUrl) { + $rootScope.$broadcast("addSpatialUnitAsWFS", name, wfsUrl); + }; + this.addGeoresourceGeoJSON = function (georesourceMetadataAndGeoJSON, date) { + $rootScope.$broadcast("addGeoresourceAsGeoJSON", georesourceMetadataAndGeoJSON, date); + }; + this.addPoiGeoresourceGeoJSON = function (georesourceMetadataAndGeoJSON, date, useCluster) { + $rootScope.$broadcast("addPoiGeoresourceAsGeoJSON", georesourceMetadataAndGeoJSON, date, useCluster); + }; + this.addPoiGeoresourceGeoJSON_reachabilityAnalysis = function (georesourceMetadataAndGeoJSON, date, useCluster) { + $rootScope.$broadcast("addPoiGeoresourceAsGeoJSON_reachabilityAnalysis", georesourceMetadataAndGeoJSON, date, useCluster); + }; + this.addLoiGeoresourceGeoJSON = function (georesourceMetadataAndGeoJSON, date) { + $rootScope.$broadcast("addLoiGeoresourceAsGeoJSON", georesourceMetadataAndGeoJSON, date); + }; + this.addAoiGeoresourceGeoJSON = function (georesourceMetadataAndGeoJSON, date) { + $rootScope.$broadcast("addAoiGeoresourceAsGeoJSON", georesourceMetadataAndGeoJSON, date); + }; + this.replaceIsochroneGeoJSON = function (geoJSON, transitMode, reachMode, cutOffValues, useMultipleStartPoints, dissolveIsochrones, speedInKilometersPerHour) { + $rootScope.$broadcast("replaceIsochronesAsGeoJSON", geoJSON, transitMode, reachMode, cutOffValues, useMultipleStartPoints, dissolveIsochrones, speedInKilometersPerHour); + }; + this.replaceRouteGeoJSON = function (geoJSON, transitMode, preference, routingStartPoint, routingEndPoint, routeDistance_km, routeDuration_minutes) { + $rootScope.$broadcast("replaceRouteAsGeoJSON", geoJSON, transitMode, preference, routingStartPoint, routingEndPoint, routeDistance_km, routeDuration_minutes); + }; + this.replaceIsochroneMarker = function (lonLatArray) { + $rootScope.$broadcast("replaceIsochroneMarker", lonLatArray); + }; + this.removePoiGeoresource = function (georesourceMetadataAndGeoJSON) { + $rootScope.$broadcast("removePoiGeoresource", georesourceMetadataAndGeoJSON); + }; + this.removePoiGeoresource_reachabilityAnalysis = function (georesourceMetadataAndGeoJSON) { + $rootScope.$broadcast("removePoiGeoresource_reachabilityAnalysis", georesourceMetadataAndGeoJSON); + }; + this.removeLoiGeoresource = function (georesourceMetadataAndGeoJSON) { + $rootScope.$broadcast("removeLoiGeoresource", georesourceMetadataAndGeoJSON); + }; + this.removeAoiGeoresource = function (georesourceMetadataAndGeoJSON) { + $rootScope.$broadcast("removeAoiGeoresource", georesourceMetadataAndGeoJSON); + }; + this.removeReachabilityLayers = function () { + $rootScope.$broadcast("removeReachabilityLayers"); + }; + this.removeRoutingLayers = function () { + $rootScope.$broadcast("removeRoutingLayers"); + }; + this.addIndicatorGeoJSON = function (indicatorMetadataAndGeoJSON, spatialUnitName, date) { + $rootScope.$broadcast("addIndicatorAsGeoJSON", indicatorMetadataAndGeoJSON, spatialUnitName, date); + }; + this.replaceIndicatorGeoJSON = function (indicatorMetadataAndGeoJSON, spatialUnitName, date, justRestyling, isCustomComputation) { + $rootScope.$broadcast("replaceIndicatorAsGeoJSON", indicatorMetadataAndGeoJSON, spatialUnitName, date, justRestyling, isCustomComputation); + }; + this.addCustomIndicatorGeoJSON = function (indicatorMetadataAndGeoJSON, spatialUnitName, date) { + $rootScope.$broadcast("addCustomIndicatorAsGeoJSON", indicatorMetadataAndGeoJSON, spatialUnitName, date); + }; + this.restyleCurrentLayer = function () { + $rootScope.$broadcast("restyleCurrentLayer"); + }; + this.addWmsLayerToMap = function (dataset, opacity) { + $rootScope.$broadcast("addWmsLayerToMap", dataset); + }; + this.adjustOpacityForWmsLayer = function (dataset, opacity) { + $rootScope.$broadcast("adjustOpacityForWmsLayer", dataset, opacity); + }; + this.adjustOpacityForAoiLayer = function (dataset, opacity) { + $rootScope.$broadcast("adjustOpacityForAoiLayer", dataset, opacity); + }; + this.adjustOpacityForPoiLayer = function (dataset, opacity) { + $rootScope.$broadcast("adjustOpacityForPoiLayer", dataset, opacity); + }; + this.adjustOpacityForLoiLayer = function (dataset, opacity) { + $rootScope.$broadcast("adjustOpacityForLoiLayer", dataset, opacity); + }; + this.removeWmsLayerFromMap = function (dataset) { + $rootScope.$broadcast("removeWmsLayerFromMap", dataset); + }; + this.addWfsLayerToMap = function (dataset, opacity, useCluster) { + $rootScope.$broadcast("addWfsLayerToMap", dataset, opacity, useCluster); + }; + this.adjustOpacityForWfsLayer = function (dataset, opacity) { + $rootScope.$broadcast("adjustOpacityForWfsLayer", dataset, opacity); + }; + this.adjustColorForWfsLayer = function (dataset, opacity) { + $rootScope.$broadcast("adjustColorForWfsLayer", dataset, opacity); + }; + this.removeWfsLayerFromMap = function (dataset) { + $rootScope.$broadcast("removeWfsLayerFromMap", dataset); + }; + this.addFileLayerToMap = function (dataset, opacity) { + $rootScope.$broadcast("addFileLayerToMap", dataset); + }; + this.adjustOpacityForFileLayer = function (dataset, opacity) { + $rootScope.$broadcast("adjustOpacityForFileLayer", dataset, opacity); + }; + this.adjustColorForFileLayer = function (dataset, color) { + $rootScope.$broadcast("adjustColorForFileLayer", dataset, color); + }; + this.removeFileLayerFromMap = function (dataset) { + $rootScope.$broadcast("removeFileLayerFromMap", dataset); + }; + this.addBaseDataLayer = function (selectedBaseData) { + $rootScope.$broadcast("addBaseDataLayerAsWMS", selectedBaseData); + }; + this.addIndicatorLayer = function (selectedIndicator) { + $rootScope.$broadcast("addIndicatorLayerAsWMS", selectedIndicator); + }; + this.addIndicatorLayer_withNameAndStyle = function (selectedIndicator, layerName, sldName) { + $rootScope.$broadcast("addIndicatorLayerAsWMS_withNameAndStyle", { + 'selectedIndicator': selectedIndicator, + 'layerName': layerName, + 'sldName': sldName + }); + }; + this.visualizeGeometricOutputs = function (geometricOutputs) { + for (var i = 0; i < geometricOutputs.length; i++) { + var currentNameForLayerProperty = this.generateUniqueOutputLayerPropertyName(); + /* + * if output is a "reference" output, then we will not display + * it on the map --> hence continue! + */ + if (geometricOutputs[i].reference) + continue; + else + this.addGeometricOutputToMap(geometricOutputs[i], currentNameForLayerProperty); + } + }; + this.generateUniqueOutputLayerPropertyName = function () { + /* + * basic name for layer property + * + * important if we add multiple layers as overlays, + * since each layer has to be defined as unique property + */ + var baseNameForLayerProperty = 'Output'; + var min = 1; + var max = 1000; + var randomNameExtension = (Math.random() * (max - min)) + min; + return baseNameForLayerProperty + '_' + randomNameExtension; + }; + this.generateUniqueInputLayerPropertyName = function (inputIdentifier) { + /* + * basic name for layer property + * + * important if we add multiple layers as overlays, + * since each layer has to be defined as unique property + */ + var baseNameForLayerProperty = 'Input_' + inputIdentifier; + return baseNameForLayerProperty; + // var min = 1; + // var max = 1000; + // + // var randomNameExtension = (Math.random() * (max - min)) + min; + // + // return baseNameForLayerProperty + '_' + randomNameExtension; + }; + this.addGeometricOutputToMap = function (geometricOutput, currentNameForLayerProperty) { + /* + * output may be complex output or bbox output + */ + if (geometricOutput.data.complexData) + this.addComplexOutputToMap(geometricOutput, currentNameForLayerProperty); + else if (geometricOutput.data.boundingBoxData) + this.addBboxOutputToMap(geometricOutput, currentNameForLayerProperty); + else + // should never reach this line; error + return null; + }; + this.addComplexOutputToMap = function (complexOutput, currentNameForLayerProperty) { + /* + * format will be GeoJSON or a WMS. Hence we must inspect its format/mimeType. + */ + var format = complexOutput.data.complexData.mimeType; + if (format === 'application/WMS') { + /* + * it is a WMS data! + */ + this.processAsWMS(complexOutput, currentNameForLayerProperty); + } + else { + /* + * it is GeoJSON data! + */ + this.processAsGeoJSON(complexOutput, currentNameForLayerProperty); + } + }; + this.processAsGeoJSON = function (complexOutput, currentNameForLayerProperty) { + var geoJSONValue = complexOutput.data.complexData.value; + /* + * geoJSONValue can either be a String or directly a GeoJSON object! + * + * if it it a GeoJSON object, it should have a "type" property! + */ + var geoJSONFeature; + if (geoJSONValue.type) { + /* + * is already GeoJSON object! + */ + geoJSONFeature = geoJSONValue; + } + else { + /* + * it is a String, so we parse it as JSON + */ + geoJSONFeature = JSON.parse(geoJSONValue); + } + var outputIdentifier = complexOutput.identifier; + /* + * calls the associated event/method from wps-map controller! + */ + $rootScope.$broadcast("addGeoJSONOutput", { geoJSONFeature: geoJSONFeature, + layerPropertyName: currentNameForLayerProperty, + outputIdentifier: outputIdentifier }); + }; + this.processAsWMS = function (complexOutput, currentNameForLayerProperty) { + /* + * the WMS URL is currently included as follows: + * + * + */ + var wmsURL_complexDataValue = complexOutput.data.complexData.value; + var wmsURL_withQueryParameters = extract_WMS_URL(wmsURL_complexDataValue); + /* + * comma-separated String of layerNames listed in WMS Capabilities + * + * retrieved from query parameter within wmsURL: + * Example: "layers=N52:primary3416203586858505312.tif_b5f8f00c-903c-477d-876b-86bfe1fe8788" + */ + var layerNamesString = getUrlQueryParameterValueByName("layers", wmsURL_withQueryParameters); + console.log("layers query parameter: " + layerNamesString); + var outputIdentifier = complexOutput.identifier; + //remove all query parameters to obtain base WMS URL + var wmsBaseURL = wmsURL_withQueryParameters.split("?")[0]; + //re-append "?" as required by Leaflet + wmsBaseURL = wmsBaseURL + "?"; + /* + * TODO retrieve Capabilities of WMS and get layer names + * + * TODO maybe there is a JS library that can help us here! + * + * TODO simply use all layers??? + * + * TODO or similar to reference outputs: Change result forms to show available + * WMS Layers and let user choose the layer he/she intends to visualize! + */ + /* + * calls the associated event/method from wps-map controller! + */ + $rootScope.$broadcast("addWMSOutput", { wmsURL: wmsBaseURL, + layerNamesString: layerNamesString, + layerPropertyName: currentNameForLayerProperty, + outputIdentifier: outputIdentifier }); + }; + var extract_WMS_URL = function (wmsURL_complexDataValue) { + /* + * WMS URL value might look like this: + * "" + * + * Hence we must remove the leading "![CDATA[" and trailing "]]" + */ + var leadingCdataString = ""; + console.log(wmsURL_complexDataValue); + if (wmsURL_complexDataValue.startsWith(leadingCdataString)) { + /* + * remove leading and trailing sections + */ + var wmsTargetURL = wmsURL_complexDataValue.replace(leadingCdataString, ""); + wmsTargetURL = wmsTargetURL.replace(trailingBracketsString, ""); + console.log(wmsTargetURL); + return wmsTargetURL; + } + else if (wmsURL_complexDataValue.startsWith("http")) { + /* + * seems to be the target URL already, no extraction needed + */ + return wmsURL_complexDataValue; + } + else { + /* + * TODO can this line be reached? Then, how to handle correctly? + */ + return wmsURL_complexDataValue; + } + }; + function getUrlQueryParameterValueByName(parameterName, url) { + parameterName = parameterName.replace(/[\[\]]/g, "\\$&"); + var regex = new RegExp("[?&]" + parameterName + "(=([^&#]*)|&|#|$)"), resultsArray = regex.exec(url); + if (!resultsArray) + return null; + if (!resultsArray[2]) + return ''; + return decodeURIComponent(resultsArray[2].replace(/\+/g, " ")); + } + this.addBboxOutputToMap = function (bboxOutput, currentNameForLayerProperty) { + /* + * TODO check CRS --> GeoJSON requires WGS84 + * project if necessary! + */ + var outputIdentifier = bboxOutput.identifier; + var description = bboxOutput.abstractValue || bboxOutput.title; + var crs = bboxOutput.data.boundingBoxData.crs; + /* + * TODO check CRS --> WGS84 should be used for GeoJSON + */ + var lowerCorner = bboxOutput.data.boundingBoxData.lowerCorner; + var upperCorner = bboxOutput.data.boundingBoxData.upperCorner; + var coordinatesArray = this.createCoordinatesArrayFromBbox(lowerCorner, upperCorner); + var geoJSONFeature = { + "type": "Feature", + "properties": { "popupContent": description }, + "geometry": { + "type": "Polygon", + "coordinates": coordinatesArray + } + }; + /* + * calls the associated event/method from wps-map controller! + */ + $rootScope.$broadcast("addGeoJSONOutput", { geoJSONFeature: geoJSONFeature, + layerPropertyName: currentNameForLayerProperty, + outputIdentifier: outputIdentifier }); + }; + /** + * Creates a Coordinates Array for GeoJSON feature representing the + * Bounding Box + */ + this.createCoordinatesArrayFromBbox = function (lowerCorner, upperCorner) { + var lat_lowerLeft = parseFloat(lowerCorner.split(" ")[0]); + var lat_upperRight = parseFloat(upperCorner.split(" ")[0]); + var lon_lowerLeft = parseFloat(lowerCorner.split(" ")[1]); + var lon_upperRight = parseFloat(upperCorner.split(" ")[1]); + var coordinatesArray = [[ + [lon_lowerLeft, lat_lowerLeft], + [lon_lowerLeft, lat_upperRight], + [lon_upperRight, lat_upperRight], + [lon_upperRight, lat_lowerLeft], + [lon_lowerLeft, lat_lowerLeft] + ]]; + return coordinatesArray; + }; + }]); +//# sourceMappingURL=kommonitor-map.module.js.map \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorMap/kommonitor-map.module.js.map b/app/components/kommonitorUserInterface/kommonitorMap/kommonitor-map.module.js.map new file mode 100644 index 000000000..e9e99d5bc --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorMap/kommonitor-map.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-map.module.js","sourceRoot":"","sources":["kommonitor-map.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC,wBAAwB,EAAE,6BAA6B,EAAE,4BAA4B,EAAE,wBAAwB,CAAC,CAAC,CAAC;AACnJ;;;GAGG;AACH,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,OAAO,CACrC,sBAAsB,EAC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BAAgB;iBAClC;aACJ,CAAC;YAEH;;eAEG;YACH,UAAU,CAAC,UAAU,CAAC,kBAAkB,EACtC,EAAE,cAAc,EAAE,cAAc;gBAC9B,iBAAiB,EAAE,2BAA2B;gBAC9C,gBAAgB,EAAE,gBAAgB,EAAC,CAAC,CAAC;QAC1C,CAAC,CAAC;QAEF;;;WAGG;QACH,IAAI,CAAC,8BAA8B,GAAG,UAAS,WAAW,EAAE,WAAW;YAEtE,IAAI,aAAa,GAAG,UAAU,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC1D,IAAI,cAAc,GAAG,UAAU,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC3D,IAAI,aAAa,GAAG,UAAU,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC1D,IAAI,cAAc,GAAG,UAAU,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAE3D,IAAI,gBAAgB,GAAG,CAAC;oBACX,CAAC,aAAa,EAAE,aAAa,CAAC;oBAC7B,CAAC,aAAa,EAAE,cAAc,CAAC;oBAC/B,CAAC,cAAc,EAAE,cAAc,CAAC;oBAChC,CAAC,cAAc,EAAE,aAAa,CAAC;oBAC/B,CAAC,aAAa,EAAE,aAAa,CAAC;iBAC/B,CAAC,CAAC;YAEf,OAAO,gBAAgB,CAAC;QACzB,CAAC,CAAC;IAEL,CAAC,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorMap/kommonitor-map.module.ts b/app/components/kommonitorUserInterface/kommonitorMap/kommonitor-map.module.ts new file mode 100644 index 000000000..82c908fc0 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorMap/kommonitor-map.module.ts @@ -0,0 +1,533 @@ +angular.module('kommonitorMap', ['kommonitorDataExchange', 'kommonitorVisualStyleHelper', 'kommonitorInfoLegendHelper', 'kommonitorFilterHelper']); +/** + * a common serviceInstance that holds all needed properties and methods for + * interacting with a map (openlayers). + */ +angular.module('kommonitorMap').service( + 'kommonitorMapService', + [ '$rootScope', '$http', function($rootScope, $http) { + + + // // central map object + // this.map; + // + // this.initializeMap = function() { + // + // // initialize map referring to div element with id="map" + // this.map = L.map('map').setView([51.4386432, 7.0115552], 12); + // + // // create OSM tile layer with correct attribution + // var osmUrl='http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; + // var osmAttrib='Map data © OpenStreetMap contributors'; + // var osm = new L.TileLayer(osmUrl, {minZoom: 1, maxZoom: 19, attribution: osmAttrib}).addTo(this.map); + // + // } + + this.addSpatialUnitGeopackage = function () { + + $rootScope.$broadcast("addSpatialUnitAsGeopackage"); + }; + + + this.addSpatialUnitGeoJSON = function (spatialUnitMetadataAndGeoJSON, date) { + + $rootScope.$broadcast("addSpatialUnitAsGeoJSON", + spatialUnitMetadataAndGeoJSON, date); + }; + + this.addSpatialUnitWFS = function (name, wfsUrl) { + + $rootScope.$broadcast("addSpatialUnitAsWFS", + name, wfsUrl); + }; + + this.addGeoresourceGeoJSON = function (georesourceMetadataAndGeoJSON, date) { + + $rootScope.$broadcast("addGeoresourceAsGeoJSON", + georesourceMetadataAndGeoJSON, date); + }; + + this.addPoiGeoresourceGeoJSON = function (georesourceMetadataAndGeoJSON, date, useCluster) { + + $rootScope.$broadcast("addPoiGeoresourceAsGeoJSON", + georesourceMetadataAndGeoJSON, date, useCluster); + }; + + this.addPoiGeoresourceGeoJSON_reachabilityAnalysis = function (georesourceMetadataAndGeoJSON, date, useCluster) { + + $rootScope.$broadcast("addPoiGeoresourceAsGeoJSON_reachabilityAnalysis", + georesourceMetadataAndGeoJSON, date, useCluster); + }; + + this.addLoiGeoresourceGeoJSON = function (georesourceMetadataAndGeoJSON, date) { + + $rootScope.$broadcast("addLoiGeoresourceAsGeoJSON", + georesourceMetadataAndGeoJSON, date); + }; + + this.addAoiGeoresourceGeoJSON = function (georesourceMetadataAndGeoJSON, date) { + + $rootScope.$broadcast("addAoiGeoresourceAsGeoJSON", + georesourceMetadataAndGeoJSON, date); + }; + + this.replaceIsochroneGeoJSON = function (geoJSON, transitMode, reachMode, cutOffValues, useMultipleStartPoints, dissolveIsochrones, speedInKilometersPerHour) { + + $rootScope.$broadcast("replaceIsochronesAsGeoJSON", + geoJSON, transitMode, reachMode, cutOffValues, useMultipleStartPoints, dissolveIsochrones, speedInKilometersPerHour); + }; + + this.replaceRouteGeoJSON = function (geoJSON, transitMode, preference, routingStartPoint, routingEndPoint, + routeDistance_km, routeDuration_minutes) { + + $rootScope.$broadcast("replaceRouteAsGeoJSON", geoJSON, transitMode, preference, routingStartPoint, routingEndPoint, + routeDistance_km, routeDuration_minutes); + }; + + this.replaceIsochroneMarker = function (lonLatArray) { + + $rootScope.$broadcast("replaceIsochroneMarker", + lonLatArray); + }; + + this.removePoiGeoresource = function (georesourceMetadataAndGeoJSON) { + + $rootScope.$broadcast("removePoiGeoresource", + georesourceMetadataAndGeoJSON); + }; + + this.removePoiGeoresource_reachabilityAnalysis = function (georesourceMetadataAndGeoJSON) { + + $rootScope.$broadcast("removePoiGeoresource_reachabilityAnalysis", + georesourceMetadataAndGeoJSON); + }; + + this.removeLoiGeoresource = function (georesourceMetadataAndGeoJSON) { + + $rootScope.$broadcast("removeLoiGeoresource", + georesourceMetadataAndGeoJSON); + }; + + this.removeAoiGeoresource = function (georesourceMetadataAndGeoJSON) { + + $rootScope.$broadcast("removeAoiGeoresource", + georesourceMetadataAndGeoJSON); + }; + + this.removeReachabilityLayers = function(){ + $rootScope.$broadcast("removeReachabilityLayers"); + } + + this.removeRoutingLayers = function(){ + $rootScope.$broadcast("removeRoutingLayers"); + } + + this.addIndicatorGeoJSON = function (indicatorMetadataAndGeoJSON, spatialUnitName, date) { + + $rootScope.$broadcast("addIndicatorAsGeoJSON", + indicatorMetadataAndGeoJSON, spatialUnitName, date); + }; + + this.replaceIndicatorGeoJSON = function (indicatorMetadataAndGeoJSON, spatialUnitName, date, justRestyling, isCustomComputation) { + + $rootScope.$broadcast("replaceIndicatorAsGeoJSON", + indicatorMetadataAndGeoJSON, spatialUnitName, date, justRestyling, isCustomComputation); + }; + + this.addCustomIndicatorGeoJSON = function (indicatorMetadataAndGeoJSON, spatialUnitName, date) { + + $rootScope.$broadcast("addCustomIndicatorAsGeoJSON", + indicatorMetadataAndGeoJSON, spatialUnitName, date); + }; + + this.restyleCurrentLayer = function () { + + $rootScope.$broadcast("restyleCurrentLayer"); + }; + + this.addWmsLayerToMap = function (dataset, opacity) { + $rootScope.$broadcast("addWmsLayerToMap", + dataset); + }; + + this.adjustOpacityForWmsLayer = function (dataset, opacity) { + $rootScope.$broadcast("adjustOpacityForWmsLayer", + dataset, opacity); + }; + + this.adjustOpacityForAoiLayer = function (dataset, opacity) { + $rootScope.$broadcast("adjustOpacityForAoiLayer", + dataset, opacity); + }; + + this.adjustOpacityForPoiLayer = function (dataset, opacity) { + $rootScope.$broadcast("adjustOpacityForPoiLayer", + dataset, opacity); + }; + + this.adjustOpacityForLoiLayer = function (dataset, opacity) { + $rootScope.$broadcast("adjustOpacityForLoiLayer", + dataset, opacity); + }; + + this.removeWmsLayerFromMap = function (dataset) { + $rootScope.$broadcast("removeWmsLayerFromMap", + dataset); + }; + + this.addWfsLayerToMap = function (dataset, opacity, useCluster) { + $rootScope.$broadcast("addWfsLayerToMap", + dataset, opacity, useCluster); + }; + + this.adjustOpacityForWfsLayer = function (dataset, opacity) { + $rootScope.$broadcast("adjustOpacityForWfsLayer", + dataset, opacity); + }; + + this.adjustColorForWfsLayer = function (dataset, opacity) { + $rootScope.$broadcast("adjustColorForWfsLayer", + dataset, opacity); + }; + + this.removeWfsLayerFromMap = function (dataset) { + $rootScope.$broadcast("removeWfsLayerFromMap", + dataset); + }; + + this.addFileLayerToMap = function (dataset, opacity) { + $rootScope.$broadcast("addFileLayerToMap", + dataset); + }; + + this.adjustOpacityForFileLayer = function (dataset, opacity) { + $rootScope.$broadcast("adjustOpacityForFileLayer", + dataset, opacity); + }; + + this.adjustColorForFileLayer = function (dataset, color) { + $rootScope.$broadcast("adjustColorForFileLayer", + dataset, color); + }; + + this.removeFileLayerFromMap = function (dataset) { + $rootScope.$broadcast("removeFileLayerFromMap", + dataset); + }; + + + + this.addBaseDataLayer = function (selectedBaseData) { + + $rootScope.$broadcast("addBaseDataLayerAsWMS", + selectedBaseData); + + }; + + this.addIndicatorLayer = function (selectedIndicator) { + + $rootScope.$broadcast("addIndicatorLayerAsWMS", + selectedIndicator); + + }; + + this.addIndicatorLayer_withNameAndStyle = function(selectedIndicator, layerName, sldName){ + $rootScope.$broadcast("addIndicatorLayerAsWMS_withNameAndStyle", + { + 'selectedIndicator':selectedIndicator, + 'layerName':layerName, + 'sldName':sldName + }); + } + + + + this.visualizeGeometricOutputs = function(geometricOutputs){ + + for (var i=0; i < geometricOutputs.length; i++){ + + var currentNameForLayerProperty = this.generateUniqueOutputLayerPropertyName(); + + /* + * if output is a "reference" output, then we will not display + * it on the map --> hence continue! + */ + if(geometricOutputs[i].reference) + continue; + else + this.addGeometricOutputToMap(geometricOutputs[i], currentNameForLayerProperty); + } + }; + + this.generateUniqueOutputLayerPropertyName = function(){ + + /* + * basic name for layer property + * + * important if we add multiple layers as overlays, + * since each layer has to be defined as unique property + */ + var baseNameForLayerProperty = 'Output'; + var min = 1; + var max = 1000; + + var randomNameExtension = (Math.random() * (max - min)) + min; + + return baseNameForLayerProperty + '_' + randomNameExtension; + }; + + this.generateUniqueInputLayerPropertyName = function(inputIdentifier){ + + /* + * basic name for layer property + * + * important if we add multiple layers as overlays, + * since each layer has to be defined as unique property + */ + var baseNameForLayerProperty = 'Input_' + inputIdentifier; + + return baseNameForLayerProperty; + +// var min = 1; +// var max = 1000; +// +// var randomNameExtension = (Math.random() * (max - min)) + min; +// +// return baseNameForLayerProperty + '_' + randomNameExtension; + }; + + this.addGeometricOutputToMap = function(geometricOutput, currentNameForLayerProperty){ + /* + * output may be complex output or bbox output + */ + + if(geometricOutput.data.complexData) + this.addComplexOutputToMap(geometricOutput, currentNameForLayerProperty); + + else if(geometricOutput.data.boundingBoxData) + this.addBboxOutputToMap(geometricOutput, currentNameForLayerProperty); + + else + // should never reach this line; error + return null; + }; + + this.addComplexOutputToMap = function(complexOutput, currentNameForLayerProperty){ + /* + * format will be GeoJSON or a WMS. Hence we must inspect its format/mimeType. + */ + + var format = complexOutput.data.complexData.mimeType; + + if(format === 'application/WMS'){ + /* + * it is a WMS data! + */ + this.processAsWMS(complexOutput, currentNameForLayerProperty); + } + else{ + /* + * it is GeoJSON data! + */ + this.processAsGeoJSON(complexOutput, currentNameForLayerProperty); + } + }; + + this.processAsGeoJSON = function(complexOutput, currentNameForLayerProperty){ + var geoJSONValue = complexOutput.data.complexData.value; + + /* + * geoJSONValue can either be a String or directly a GeoJSON object! + * + * if it it a GeoJSON object, it should have a "type" property! + */ + var geoJSONFeature; + if(geoJSONValue.type){ + /* + * is already GeoJSON object! + */ + geoJSONFeature = geoJSONValue; + } + else{ + /* + * it is a String, so we parse it as JSON + */ + geoJSONFeature = JSON.parse(geoJSONValue); + } + + var outputIdentifier = complexOutput.identifier; + + /* + * calls the associated event/method from wps-map controller! + */ + $rootScope.$broadcast("addGeoJSONOutput", + { geoJSONFeature: geoJSONFeature, + layerPropertyName: currentNameForLayerProperty, + outputIdentifier: outputIdentifier}); + }; + + this.processAsWMS = function(complexOutput, currentNameForLayerProperty){ + + /* + * the WMS URL is currently included as follows: + * + * + */ + var wmsURL_complexDataValue = complexOutput.data.complexData.value; + + var wmsURL_withQueryParameters = extract_WMS_URL(wmsURL_complexDataValue); + + /* + * comma-separated String of layerNames listed in WMS Capabilities + * + * retrieved from query parameter within wmsURL: + * Example: "layers=N52:primary3416203586858505312.tif_b5f8f00c-903c-477d-876b-86bfe1fe8788" + */ + var layerNamesString = getUrlQueryParameterValueByName("layers", wmsURL_withQueryParameters); + console.log("layers query parameter: " + layerNamesString); + + var outputIdentifier = complexOutput.identifier; + + //remove all query parameters to obtain base WMS URL + var wmsBaseURL = wmsURL_withQueryParameters.split("?")[0]; + //re-append "?" as required by Leaflet + wmsBaseURL = wmsBaseURL + "?"; + + /* + * TODO retrieve Capabilities of WMS and get layer names + * + * TODO maybe there is a JS library that can help us here! + * + * TODO simply use all layers??? + * + * TODO or similar to reference outputs: Change result forms to show available + * WMS Layers and let user choose the layer he/she intends to visualize! + */ + + /* + * calls the associated event/method from wps-map controller! + */ + $rootScope.$broadcast("addWMSOutput", + { wmsURL: wmsBaseURL, + layerNamesString: layerNamesString, + layerPropertyName: currentNameForLayerProperty, + outputIdentifier: outputIdentifier}); + }; + + var extract_WMS_URL = function(wmsURL_complexDataValue){ + + /* + * WMS URL value might look like this: + * "" + * + * Hence we must remove the leading "![CDATA[" and trailing "]]" + */ + + var leadingCdataString = ""; + + console.log(wmsURL_complexDataValue); + + if (wmsURL_complexDataValue.startsWith(leadingCdataString)){ + /* + * remove leading and trailing sections + */ + var wmsTargetURL = wmsURL_complexDataValue.replace(leadingCdataString, ""); + + wmsTargetURL = wmsTargetURL.replace(trailingBracketsString, ""); + + console.log(wmsTargetURL); + + return wmsTargetURL; + } + else if (wmsURL_complexDataValue.startsWith("http")){ + /* + * seems to be the target URL already, no extraction needed + */ + return wmsURL_complexDataValue; + } + else{ + /* + * TODO can this line be reached? Then, how to handle correctly? + */ + return wmsURL_complexDataValue; + } + + }; + + function getUrlQueryParameterValueByName(parameterName, url) { + + parameterName = parameterName.replace(/[\[\]]/g, "\\$&"); + var regex = new RegExp("[?&]" + parameterName + "(=([^&#]*)|&|#|$)"), + resultsArray = regex.exec(url); + if (!resultsArray) + return null; + if (!resultsArray[2]) + return ''; + + return decodeURIComponent(resultsArray[2].replace(/\+/g, " ")); + } + + this.addBboxOutputToMap = function(bboxOutput, currentNameForLayerProperty){ + + /* + * TODO check CRS --> GeoJSON requires WGS84 + * project if necessary! + */ + + var outputIdentifier = bboxOutput.identifier; + + var description = bboxOutput.abstractValue || bboxOutput.title; + + var crs = bboxOutput.data.boundingBoxData.crs; + + /* + * TODO check CRS --> WGS84 should be used for GeoJSON + */ + + var lowerCorner = bboxOutput.data.boundingBoxData.lowerCorner; + var upperCorner = bboxOutput.data.boundingBoxData.upperCorner; + + var coordinatesArray = this.createCoordinatesArrayFromBbox(lowerCorner, upperCorner); + + var geoJSONFeature = { + "type": "Feature", + "properties": {"popupContent": description}, + "geometry": { + "type": "Polygon", + "coordinates": coordinatesArray + } + }; + + /* + * calls the associated event/method from wps-map controller! + */ + $rootScope.$broadcast("addGeoJSONOutput", + { geoJSONFeature: geoJSONFeature, + layerPropertyName: currentNameForLayerProperty, + outputIdentifier: outputIdentifier}); + }; + + /** + * Creates a Coordinates Array for GeoJSON feature representing the + * Bounding Box + */ + this.createCoordinatesArrayFromBbox = function(lowerCorner, upperCorner){ + + var lat_lowerLeft = parseFloat(lowerCorner.split(" ")[0]); + var lat_upperRight = parseFloat(upperCorner.split(" ")[0]); + var lon_lowerLeft = parseFloat(lowerCorner.split(" ")[1]); + var lon_upperRight = parseFloat(upperCorner.split(" ")[1]); + + var coordinatesArray = [[ + [lon_lowerLeft, lat_lowerLeft], + [lon_lowerLeft, lat_upperRight], + [lon_upperRight, lat_upperRight], + [lon_upperRight, lat_lowerLeft], + [lon_lowerLeft, lat_lowerLeft] + ]]; + + return coordinatesArray; + }; + + }]); diff --git a/app/config/env_backup.js b/app/config/env_backup.js index 3a61216e8..046ce4101 100644 --- a/app/config/env_backup.js +++ b/app/config/env_backup.js @@ -1,576 +1,539 @@ +"use strict"; try { - - window.__env = window.__env || {}; - - window.__env.appTitle = "KomMonitor (Pilotversion)"; - - // a unique prefix for the respective KomMonitor instance - // it is used to distuingish between various KomMonitor instances in order to write/read data to/from browser cache - window.__env.localStoragePrefix = "kommonitor-develop"; - - // Whether or not to enable debug mode - // Setting this to false will disable console output - window.__env.enableDebug = true; - - // enable/disable role based access using keycloak - window.__env.enableKeycloakSecurity = true; - - // keycloak super admin role name - window.__env.keycloakKomMonitorAdminRoleName = "kommonitor-creator"; - - // enable and show/hide switch to toggle basic and advanced mode - // this feature can hide certain app elements via ID if in basic mode - // configure elements in admin page app settings via controls-config file - window.__env.isAdvancedMode = true; // controls if advanced mode is activated on startup - window.__env.showAdvancedModeSwitch = true; // controls if toggle switch is at all displayed for toggling basinc/advanced mode - - // encrypted data transfer from Data Management API settings - window.__env.encryption = { - enabled: false, - password: "password", // this is shared secret between all components (hence must be set to the exact same value for all participating components) - ivLength_byte: 16 - }; - - /* - PROPERTIES used within greetings window (infoModal component) - to insert custom LOGO by URL with custom width - and adjust individual information text - as well as contact information - */ - window.__env.customLogoURL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAAzFBMVEXjABv////hAAD//v/eAAD2wcLkABvjAAD9///iARniABHyr6/vjZP60Nb+5Oj9+fnwoaTmQ1L77/DwnKDjAArxp6nsgof3yM/oaHDmABnhAR7+//vyr675///jACDhAA7zrbTxtbXrk5TqXGboSE7naGvsZnPoRUboa3PnNUP73N/0t732wMb89vvndXnlPkniFin4z83nV1/rdHbnWGjtnZ3yoKzwjpvrhoXiLTX619rmWlvqkI/74OXiJjzmTVf/7vfne4H2wLrocm7o9VDtAAAK/ElEQVR4nO2dC1vbuBKGLVnoYgJhgwOVTEi49QCF0st2t7DL9nL+/386Ulocjew4dqItCWde2j48jq3403WkGalJgiAIgiAIgiAIgiAIgiAIgiAIgiAIgiAIgiAIgiAIgiAIgiAIgnQmF0w0QhOjjcrBJWr/GSue2D+NaMONUscqywMSY7KkcjWzKSqjVVyBB0eTydH2fI5OhFEmvzgJrp+e5UxkyjQlbtUpNRZsfH7x+pXH64vcqlD/uXwFuWJMJAsyrTN0izQjCbXlQHs1n1zvK5E1JW7LQ9CzNwMiJXy0YIZrelRN83p4xfK4CsUNSUfNGpnNb/o3VE1SIlNJ5IkRjamz0769y95tRXrc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O9D7tzQkQMw2EI0d4fRhFeF6wzM4rdRSmU5A5ND+6tJjHaBLsFUNLffpav/z8JqLCwE5VYcElBzOFfcnUfKWx09o41SieHgOFabphs0A1yIA4x5QBAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQZC14n9/oOVTqSdcxgAAAABJRU5ErkJggg=="; // image format allows all types usable within HTML tag - window.__env.customLogo_onClickURL = "https://www.hochschule-bochum.de/fbg/forschung-und-entwicklung/kommonitor/"; // uses tag to insert clickable link on logo - window.__env.customLogoWidth = "35px"; // height is fixed to 35px; so adjust your custom width to keep aspect ratio - window.__env.customGreetingsContact_name = "Christian Danowski-Buhren"; - window.__env.customGreetingsContact_organisation = "Hochschule Bochum, Fachbereich Geodäsie"; - window.__env.customGreetingsContact_mail = "christian.danowski-buhren@hs-bochum.de"; - window.__env.customGreetingsTextInfoMessage = ""; // as HTML; only set if you want to give users some extra hints; if empty will be ignored - - - - /* - PROPERTIES used within special modal (spatialUnitNotification component) - to show a customizable HTMLText only when user selects a certian spatial unit for any indicator - */ - window.__env.enableSpatialUnitNotificationSelection = false; // controls if a notification should be shown when selecting certain spatial units - window.__env.enableSpatialUnitNotificationButton = false; // enables button to manually open spatial unit notification - window.__env.spatialUnitNotificationSelection = ["Baublockebene"]; // unit(s) for which the notification is shown - window.__env.spatialUnitNotificationTitle = "Informationsverlust auf kleinräumigen Ebenen (Bau- und Mittelblock)"; // title of the notification window - window.__env.spatialUnitNotificationMessage = "Alle Daten, die im KomMonitor dargestellt werden, halten die statistische Geheimhaltung ein. Das bedeutet, dass Angaben zu einzelnen Personen nicht offengelegt werden, insbesondere auch, wenn aus aggregierten Werten Rückschlüsse zu Einzelangaben ermöglicht werden. Aus diesem Grund werden Indikatorenwerte, die in einem räumlichen Aggregat eine absolute Fallzahl von < 3 Einwohnern aufweisen, so behandelt, als hätten diese 0 Einwohner.\ + window.__env = window.__env || {}; + window.__env.appTitle = "KomMonitor (Pilotversion)"; + // a unique prefix for the respective KomMonitor instance + // it is used to distuingish between various KomMonitor instances in order to write/read data to/from browser cache + window.__env.localStoragePrefix = "kommonitor-develop"; + // Whether or not to enable debug mode + // Setting this to false will disable console output + window.__env.enableDebug = true; + // enable/disable role based access using keycloak + window.__env.enableKeycloakSecurity = true; + // keycloak super admin role name + window.__env.keycloakKomMonitorAdminRoleName = "kommonitor-creator"; + // enable and show/hide switch to toggle basic and advanced mode + // this feature can hide certain app elements via ID if in basic mode + // configure elements in admin page app settings via controls-config file + window.__env.isAdvancedMode = true; // controls if advanced mode is activated on startup + window.__env.showAdvancedModeSwitch = true; // controls if toggle switch is at all displayed for toggling basinc/advanced mode + // encrypted data transfer from Data Management API settings + window.__env.encryption = { + enabled: false, + password: "password", + ivLength_byte: 16 + }; + /* + PROPERTIES used within greetings window (infoModal component) + to insert custom LOGO by URL with custom width + and adjust individual information text + as well as contact information + */ + window.__env.customLogoURL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAAzFBMVEXjABv////hAAD//v/eAAD2wcLkABvjAAD9///iARniABHyr6/vjZP60Nb+5Oj9+fnwoaTmQ1L77/DwnKDjAArxp6nsgof3yM/oaHDmABnhAR7+//vyr675///jACDhAA7zrbTxtbXrk5TqXGboSE7naGvsZnPoRUboa3PnNUP73N/0t732wMb89vvndXnlPkniFin4z83nV1/rdHbnWGjtnZ3yoKzwjpvrhoXiLTX619rmWlvqkI/74OXiJjzmTVf/7vfne4H2wLrocm7o9VDtAAAK/ElEQVR4nO2dC1vbuBKGLVnoYgJhgwOVTEi49QCF0st2t7DL9nL+/386Ulocjew4dqItCWde2j48jq3403WkGalJgiAIgiAIgiAIgiAIgiAIgiAIgiAIgiAIgiAIgiAIgiAIgiAIgnQmF0w0QhOjjcrBJWr/GSue2D+NaMONUscqywMSY7KkcjWzKSqjVVyBB0eTydH2fI5OhFEmvzgJrp+e5UxkyjQlbtUpNRZsfH7x+pXH64vcqlD/uXwFuWJMJAsyrTN0izQj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tYjsfWeN/HODiUK+GX6tfcGtnjCY4lfAHD71cxBklSoWT3QW4KbrKD4Krj+/3LijN1UKbIxPs3eXp0dBnezi2E97sv9tDSO9D7tzQkQMw2EI0d4fRhFeF6wzM4rdRSmU5A5ND+6tJjHaBLsFUNLffpav/z8JqLCwE5VYcElBzOFfcnUfKWx09o41SieHgOFabphs0A1yIA4x5QBAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQZC14n9/oOVTqSdcxgAAAABJRU5ErkJggg=="; // image format allows all types usable within HTML tag + window.__env.customLogo_onClickURL = "https://www.hochschule-bochum.de/fbg/forschung-und-entwicklung/kommonitor/"; // uses tag to insert clickable link on logo + window.__env.customLogoWidth = "35px"; // height is fixed to 35px; so adjust your custom width to keep aspect ratio + window.__env.customGreetingsContact_name = "Christian Danowski-Buhren"; + window.__env.customGreetingsContact_organisation = "Hochschule Bochum, Fachbereich Geodäsie"; + window.__env.customGreetingsContact_mail = "christian.danowski-buhren@hs-bochum.de"; + window.__env.customGreetingsTextInfoMessage = ""; // as HTML; only set if you want to give users some extra hints; if empty will be ignored + /* + PROPERTIES used within special modal (spatialUnitNotification component) + to show a customizable HTMLText only when user selects a certian spatial unit for any indicator + */ + window.__env.enableSpatialUnitNotificationSelection = false; // controls if a notification should be shown when selecting certain spatial units + window.__env.enableSpatialUnitNotificationButton = false; // enables button to manually open spatial unit notification + window.__env.spatialUnitNotificationSelection = ["Baublockebene"]; // unit(s) for which the notification is shown + window.__env.spatialUnitNotificationTitle = "Informationsverlust auf kleinräumigen Ebenen (Bau- und Mittelblock)"; // title of the notification window + window.__env.spatialUnitNotificationMessage = "Alle Daten, die im KomMonitor dargestellt werden, halten die statistische Geheimhaltung ein. Das bedeutet, dass Angaben zu einzelnen Personen nicht offengelegt werden, insbesondere auch, wenn aus aggregierten Werten Rückschlüsse zu Einzelangaben ermöglicht werden. Aus diesem Grund werden Indikatorenwerte, die in einem räumlichen Aggregat eine absolute Fallzahl von < 3 Einwohnern aufweisen, so behandelt, als hätten diese 0 Einwohner.\ Diese Methode der statistischen Geheimhaltung kann zu einem teilweise hohen Informationsverlust auf kleinräumigen Ebenen führen. Stark differenzierte Indikatoren auf kleinräumigen Ebenen, die insgesamt nur wenige Fallzahlen aufweisen, könnten so an vielen Stellen entsprechend bereinigt worden seien und somit keine validen Werte liefern. \ Dies lässt sich daran erkennen, dass die Fallzahlen insgesamt niedrig sind und viele Gebiete 0-Werte haben. Eine flächendeckendes Bild ist somit nicht möglich. \ Dennoch bieten diese Indikatoren trotz ungenauer Wertedie Möglichkeit, „Hot-Spots“ und „Cluster“ der jeweiligen Indikatoren zu ermitteln. \ Zahlen auf kleinräumige Ebenen sollten vor diesem Hintergrund vorsichtig und sorgfältig interpretiert werden."; // message shown when previous spatial unit is selected - - /* - PROPERTIES used within extended info modal (second tab) to show a customizable HTMLText - */ - window.__env.enableExtendedInfoModal = false; // controls if an extra tab should be shown in the info modal. - window.__env.standardInfoModalTabTitle = "Informationen zu KomMonitor" // title of the first tab - window.__env.extendedInfoModalTabTitle = "Weitere Informationen" // title of the second tab - window.__env.extendedInfoModalHTMLMessage = ""; // message in the second tab as HTML - - // property names of feature id and name (relevant for all spatial features) - KomMonitor specific - // DO NOT CHANGE THEM - ONLY IF YOU REALLY KNOW WHAT YOU ARE DOING - window.__env.FEATURE_ID_PROPERTY_NAME = "ID"; - window.__env.FEATURE_NAME_PROPERTY_NAME = "NAME"; - window.__env.VALID_START_DATE_PROPERTY_NAME = "validStartDate"; - window.__env.VALID_END_DATE_PROPERTY_NAME = "validEndDate"; - window.__env.indicatorDatePrefix = "DATE_"; - - // Data Management API URL - // window.__env.apiUrl = 'http://kommonitor.fbg-hsbo.de/'; - window.__env.apiUrl = 'http://localhost:8085/'; - // Base url for Data Management API - window.__env.basePath = 'management'; - - // Processing Engine URL - window.__env.targetUrlToProcessingEngine = 'http://localhost:8086/processing/'; - - // Open Route Service URL - window.__env.targetUrlToReachabilityService_ORS = 'https://ors5.fbg-hsbo.de'; - - // Open Trip Planner URL - currently not integrated - window.__env.targetUrlToReachabilityService_OTP = 'http://localhost:8090/opentripplanner'; - - // Data Imporret URL - window.__env.targetUrlToImporterService = 'http://localhost:8087/importer/'; - - // KomMonitor Geocoder Proxy - window.__env.targetUrlToGeocoderService = 'https://geocoder.fbg-hsbo.de/nominatim/'; - - // optional geometry simplification (a feature of Data Management API) - window.__env.simplifyGeometriesParameterName = "simplifyGeometries"; - // allowed values and meaning: - // ["original" --> no simplification; "weak" --> weak simplification, - // "medium" --> medium simplification; "strong" --> string simplification] - window.__env.simplifyGeometriesOptions = [{"label": "nein", "value": "original"}, {"label": "schwach", "value": "weak"}, {"label": "mittel", "value": "medium"}, {"label": "stark", "value": "strong"}]; - // use strong as default to minimize size of queried features - // for display, strong simplification is okay - window.__env.simplifyGeometries = "original"; - - // number of decimals for display of numeric values in app - window.__env.numberOfDecimals = 2; - - // starting viewpoint parameters and zoom level - window.__env.initialLatitude = 51.4386432; - window.__env.initialLongitude = 7.0115552; - window.__env.initialZoomLevel = 12; - // window.__env.minZoomLevel = 11; - window.__env.minZoomLevel = 5; - window.__env.maxZoomLevel = 18; - - window.__env.baseLayers = [ // baseLayers of instance; first will be set as default starting layer - // { - // name: "", // display name - // url: "", // URL to layer - // layerType: "TILE_LAYER", // TILE_LAYER | TILE_LAYER_GRAYSCALE | WMS - // layerName_WMS: "", // only relevant for layers of type WMS - multiple layers comma-separated - // attribution_html: "", // attribution info displayed at the bottom of the map as HTML string - // minZoomLevel: window.__env.minZoomLevel, // min zoom level for this layer (number between 1-20) - // maxZoomLevel: window.__env.maxZoomLevel // max zoom level for this layer (number between 1-20, greater than minZoomLevel) - // }, - { - name: "Open Street Map - Graustufen", - url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", - layerType: "TILE_LAYER_GRAYSCALE", - layerName_WMS: "", - attribution_html: "Map data © OpenStreetMap contributors", - minZoomLevel: window.__env.minZoomLevel, - maxZoomLevel: window.__env.maxZoomLevel - }, - { - name: "Open Street Map - Farbe", - url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", - layerType: "TILE_LAYER", - layerName_WMS: "", - attribution_html: "Map data © OpenStreetMap contributors", - minZoomLevel: window.__env.minZoomLevel, - maxZoomLevel: window.__env.maxZoomLevel - }, - { - name: "RVR Stadtplan - Farbe", - url: "https://geodaten.metropoleruhr.de/spw2?", - layerType: "WMS", - layerName_WMS: "stadtplan_rvr", - attribution_html: "Map data © https://geodaten.metropoleruhr.de", - minZoomLevel: window.__env.minZoomLevel, - maxZoomLevel: window.__env.maxZoomLevel - }, - { - name: "RVR Stadtplan - Graublau", - url: "https://geodaten.metropoleruhr.de/spw2?", - layerType: "WMS", - layerName_WMS: "spw2_graublau", - attribution_html: "Map data © https://geodaten.metropoleruhr.de", - minZoomLevel: window.__env.minZoomLevel, - maxZoomLevel: window.__env.maxZoomLevel - }, - { - name: "NRW Digitale Topographische Karte", - url: "https://www.wms.nrw.de/geobasis/wms_nw_dtk?", - layerType: "WMS", - layerName_WMS: "nw_dtk_sw", - attribution_html: "Map data © Geobasis NRW", - minZoomLevel: window.__env.minZoomLevel, - maxZoomLevel: 20 - }, - { - name: "NRW Digitale Orthophotos (Luftbilder)", - url: "https://www.wms.nrw.de/geobasis/wms_nw_dop?", - layerType: "WMS", - layerName_WMS: "nw_dop_rgb", - attribution_html: "Map data © Geobasis NRW", - minZoomLevel: window.__env.minZoomLevel, - maxZoomLevel: window.__env.maxZoomLevel - }, - { - name: "Stadt Essen - Automatisierte Liegenschaftskarte", - url: "https://geo.essen.de/arcgis/services/basemap/Stadtplanpaket_ALK_grau/MapServer/WMSServer?", - layerType: "WMS", - layerName_WMS: "0,1,2,3", - attribution_html: "Stadt Essen: Amt für Geoinformation, Vermessung und Kataster", - minZoomLevel: window.__env.minZoomLevel, - maxZoomLevel: window.__env.maxZoomLevel - }, - { - name: "Stadt Essen - Amtliche Basiskarte", - url: "https://geo.essen.de/arcgis/services/basemap/Uebersicht_ABK_Stadtgrundkarte/MapServer/WMSServer?", - layerType: "WMS", - layerName_WMS: "nw_dop_rgb", - attribution_html: "Stadt Essen: Amt für Geoinformation, Vermessung und Kataster", - minZoomLevel: window.__env.minZoomLevel, - maxZoomLevel: window.__env.maxZoomLevel - } - ]; - - - // starting indicator and spatial unit - // if faulty values are provided, a random indicator will be displayed - window.__env.initialIndicatorId = "48a18455-6a52-4e74-bdbf-99237187fc5c"; - window.__env.initialSpatialUnitName = "Stadtteilebene"; - - // various color settings - window.__env.defaultColorForNoDataValues = "rgba(255,255,255,0)"; - window.__env.defaultBorderColorForNoDataValues = "black"; - window.__env.defaultColorForOutliers_high = "#191919"; - window.__env.defaultBorderColorForOutliers_high = "black"; - window.__env.defaultFillOpacityForOutliers_high = "0.7"; - window.__env.defaultColorForOutliers_low = "#4f4f4f"; - window.__env.defaultBorderColorForOutliers_low = "black"; - window.__env.defaultFillOpacityForOutliers_low = "0.7"; - window.__env.defaultColorForHoveredFeatures = "#e01414"; - window.__env.defaultColorForClickedFeatures = "#42e5f4"; - window.__env.defaultColorForZeroValues = "#bababa"; - window.__env.defaultBorderColor = "black"; - window.__env.defaultColorForFilteredValues = "rgba(255,255,255,0)"; - window.__env.defaultBorderColorForFilteredValues = "black"; - window.__env.defaultFillOpacity = "0.7"; - window.__env.defaultFillOpacityForFilteredFeatures = "0.7"; - window.__env.defaultFillOpacityForZeroFeatures = "0.7"; - window.__env.defaultFillOpacityForNoDataFeatures = "0.7"; - window.__env.defaultFillOpacityForHighlightedFeatures = "0.8"; - window.__env.useTransparencyOnIndicator = true; - window.__env.useOutlierDetectionOnIndicator = true; - window.__env.classifyZeroSeparately = true; - window.__env.classifyUsingWholeTimeseries = true; - window.__env.useNoDataToggle = false; // true = hide no data values, false = show no data values - - // default color for specific classification as ColorBrewer palette name - // i.e. balance mode - // i.e. measure of value classification (German: Schwellwertklassifizierung) - window.__env.defaultColorBrewerPaletteForBalanceIncreasingValues = "Purples"; - window.__env.defaultColorBrewerPaletteForBalanceDecreasingValues = "YlOrBr"; - window.__env.defaultColorBrewerPaletteForGtMovValues = "YlOrBr"; - window.__env.defaultColorBrewerPaletteForLtMovValues = "Blues"; - - // classification - //allowesValues: equal_interval, quantile, jenks - window.__env.defaultClassifyMethod = "equal_interval"; - - // array of indicator name substring that shal be used to filter out / hide certain indicators by their name - // e.g. set ["entwicklung"] to hide all indicators whose name contains the substring "entwicklung" - window.__env.arrayOfNameSubstringsForHidingIndicators = []; - // window.__env.arrayOfNameSubstringsForHidingIndicators = []; - - window.__env.arrayOfNameSubstringsForHidingGeoresources = []; - - // e-mail recipient for feedback mail - window.__env.feedbackMailRecipient = "christian.danowski-buhren@hochschule-bochum.de"; - // window.__env.feedbackMailRecipient = "christian.danowski-buhren@hs-bochum.de"; - - // config array of available options for choosing update interval of indicators - window.__env.updateIntervalOptions = [ - { - displayName: "jährlich", - apiName: "YEARLY" - }, - { - displayName: "halbjährlich", - apiName: "HALF_YEARLY" - }, - { - displayName: "vierteljährlich", - apiName: "QUARTERLY" - }, - { - displayName: "monatlich", - apiName: "MONTHLY" - }, - { - displayName: "wöchentlich", - apiName: "WEEKLY" - }, - { - displayName: "täglich", - apiName: "DAILY" - }, - { - displayName: "beliebig", - apiName: "ARBITRARY" - } - ]; - - // config array of available options for choosing creation type of indicators - window.__env.indicatorCreationTypeOptions = [ - { - displayName: "manuell", - apiName: "INSERTION" - }, - { - displayName: "automatisierte Berechnung durch KomMonitor", - apiName: "COMPUTATION" - } - ]; - - // config array of available options for choosing indicator's unit - window.__env.indicatorUnitOptions = [ "Anzahl", "Anteil", "Prozent", "Einwohner", "m", "m²", "km", "km²", "ha", "dimensionslos", "standardisiert", "z-transformierte Werte" - ]; - - // config array of available options for choosing indicator type of indicators - window.__env.indicatorTypeOptions = [ - { - displayName: "Status-Indikator (absolut)", - apiName: "STATUS_ABSOLUTE" - }, - { - displayName: "Status-Indikator (relativ)", - apiName: "STATUS_RELATIVE" - }, - { - displayName: "Dynamik-Indikator (absolut)", - apiName: "DYNAMIC_ABSOLUTE" - }, - { - displayName: "Dynamik-Indikator (relativ)", - apiName: "DYNAMIC_RELATIVE" - }, - { - displayName: "Status-Indikator (standardisiert)", - apiName: "STATUS_STANDARDIZED" - }, - { - displayName: "Dynamik-Indikator (standardisiert)", - apiName: "DYNAMIC_STANDARDIZED" - } - - ]; - - // array of available WMS datasets - window.__env.wmsDatasets = [ - // { - // title: "Title of WMS dataset", - // description: "Description as HTML code (HTML tags allowed)", - // url: "URL including '?' as last character (i.e. https://wms.example/myWMS)", - // topicReference: "3af3b65e-4792-4998-8531-54616564b5bc", // id of georesource topic to hang in the WMS entry - // layerName:"laerm" // name of WMS layer to display - // }, - { - title: "Lärmkartierung - Test", - description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", - url: "https://www.wms.nrw.de/umwelt/laerm?", - topicReference: "3af3b65e-4792-4998-8531-54616564b5bc", - layerName:"laerm" - }, - { - title: "Unfalldaten 2019", - description: "Unfalldaten des statistischen Bundesamtes
        ", - url: "https://www.wms.nrw.de/wms/unfallatlas?", - topicReference: "7255b83f-feb0-4f01-9dc1-6b355447206d", - layerName:"Unfallorte_2019" - }, - { - title: "Lärmkartierung - Flugverkehr 24h-Pegel LDEN", - description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", - url: "https://www.wms.nrw.de/umwelt/laerm?", - topicReference: "e94c8100-3790-4ddd-b977-fe48b4f93e26", - layerName: "FLG_DEN" - }, - { - title: "Lärmkartierung - Flugverkehr Nachtpegel LNight", - description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", - url: "https://www.wms.nrw.de/umwelt/laerm?", - topicReference: "e94c8100-3790-4ddd-b977-fe48b4f93e26", - layerName: "FLG_NGT" - }, - { - title: "Lärmkartierung - Industrie 24h-Pegel LDEN", - description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", - url: "https://www.wms.nrw.de/umwelt/laerm?", - topicReference: "e94c8100-3790-4ddd-b977-fe48b4f93e26", - layerName: "IND_DEN" - }, - { - title: "Lärmkartierung - Industrie Nachtpegel LNight", - description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", - url: "https://www.wms.nrw.de/umwelt/laerm?", - topicReference: "e94c8100-3790-4ddd-b977-fe48b4f93e26", - layerName: "IND_NGT" - }, - { - title: "Lärmkartierung - Straße 24h-Pegel LDEN", - description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", - url: "https://www.wms.nrw.de/umwelt/laerm?", - topicReference: "e94c8100-3790-4ddd-b977-fe48b4f93e26", - layerName: "STR_DEN" - }, - { - title: "Lärmkartierung - Straße Nachtpegel LNight", - description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", - url: "https://www.wms.nrw.de/umwelt/laerm?", - topicReference: "e94c8100-3790-4ddd-b977-fe48b4f93e26", - layerName: "STR_NGT" - }, - { - title: "Lärmkartierung - Schiene sonstige 24h-Pegel LDEN", - description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", - url: "https://www.wms.nrw.de/umwelt/laerm?", - topicReference: "e94c8100-3790-4ddd-b977-fe48b4f93e26", - layerName: "SCS_DEN" - }, - { - title: "Lärmkartierung - Schiene sonstige Nachtpegel LNight", - description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", - url: "https://www.wms.nrw.de/umwelt/laerm?", - topicReference: "e94c8100-3790-4ddd-b977-fe48b4f93e26", - layerName: "SCS_NGT" - }, - { - title: "Lärmkartierung - Schiene Bund 24h-Pegel LDEN", - description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", - url: "https://www.wms.nrw.de/umwelt/laerm?", - topicReference: "e94c8100-3790-4ddd-b977-fe48b4f93e26", - layerName: "SCB_DEN" - }, - { - title: "Lärmkartierung - Schiene Bund Nachtpegel LNight", - description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", - url: "https://www.wms.nrw.de/umwelt/laerm?", - topicReference: "e94c8100-3790-4ddd-b977-fe48b4f93e26", - layerName: "SCB_NGT" - }, - // { - // title: "Lärmkartierung - Gebaeude", - // description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", - // url: "https://www.wms.nrw.de/umwelt/laerm?", - // layerName: "Gebaeude" - // }, - // { - // title: "Lärmkartierung - Modell", - // description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", - // url: "https://www.wms.nrw.de/umwelt/laerm?", - // layerName: "Modell" - // }, - { - title: "Versiegelungsgrad - 2006 anhand von Copernicus Satellitendaten - 20m Rasterzellen", - description: "Mehr Informationen unter https://land.copernicus.eu/pan-european/high-resolution-layers/imperviousness", - url: "https://image.discomap.eea.europa.eu/arcgis/services/GioLandPublic/HRL_ImperviousnessDensity_2006/MapServer/WMSServer?", - topicReference: "c46ecf8b-3f77-4be6-9ec1-851dc48e3eb8", - layerName: "0" - }, - { - title: "Versiegelungsgrad - 2009 anhand von Copernicus Satellitendaten - 20m Rasterzellen", - description: "Mehr Informationen unter https://land.copernicus.eu/pan-european/high-resolution-layers/imperviousness", - url: "https://image.discomap.eea.europa.eu/arcgis/services/GioLandPublic/HRL_ImperviousnessDensity_2009/MapServer/WMSServer?", - topicReference: "c46ecf8b-3f77-4be6-9ec1-851dc48e3eb8", - layerName: "0" - }, - { - title: "Versiegelungsgrad - 2012 anhand von Copernicus Satellitendaten - 20m Rasterzellen", - description: "Mehr Informationen unter https://land.copernicus.eu/pan-european/high-resolution-layers/imperviousness", - url: "https://image.discomap.eea.europa.eu/arcgis/services/GioLandPublic/HRL_Imperviousness_Density_2012/MapServer/WMSServer?", - topicReference: "c46ecf8b-3f77-4be6-9ec1-851dc48e3eb8", - layerName: "Imperviousness density 2012 20m" - }, - { - title: "Versiegelungsgrad - 2015 anhand von Copernicus Satellitendaten - 20m Rasterzellen", - description: "Mehr Informationen unter https://land.copernicus.eu/pan-european/high-resolution-layers/imperviousness", - url: "https://image.discomap.eea.europa.eu/arcgis/services/GioLandPublic/HRL_ImperviousnessDensity_2015/MapServer/WMSServer?", - topicReference: "c46ecf8b-3f77-4be6-9ec1-851dc48e3eb8", - layerName: "0" - }, - { - title: "Versiegelungsgrad - Veränderung 2006-2009 anhand von Copernicus Satellitendaten - 20m Rasterzellen", - description: "Mehr Informationen unter https://land.copernicus.eu/pan-european/high-resolution-layers/imperviousness", - url: "https://image.discomap.eea.europa.eu/arcgis/services/GioLandPublic/HRL_ImperviousnessChange_06_09/MapServer/WMSServer?", - topicReference: "c46ecf8b-3f77-4be6-9ec1-851dc48e3eb8", - layerName: "0" - }, - { - title: "Versiegelungsgrad - Veränderung 2009-2012 anhand von Copernicus Satellitendaten - 20m Rasterzellen", - description: "Mehr Informationen unter https://land.copernicus.eu/pan-european/high-resolution-layers/imperviousness", - url: "https://image.discomap.eea.europa.eu/arcgis/services/GioLandPublic/HRL_ImperviousnessChange_09_12/MapServer/WMSServer?", - topicReference: "c46ecf8b-3f77-4be6-9ec1-851dc48e3eb8", - layerName: "Imperviousness density change 09-12 20m" - }, - { - title: "Versiegelungsgrad - Veränderung 2012-2015 anhand von Copernicus Satellitendaten - 20m Rasterzellen", - description: "Mehr Informationen unter https://land.copernicus.eu/pan-european/high-resolution-layers/imperviousness", - url: "https://image.discomap.eea.europa.eu/arcgis/services/GioLandPublic/HRL_ImperviousnessChange_12_15/MapServer/WMSServer?", - topicReference: "c46ecf8b-3f77-4be6-9ec1-851dc48e3eb8", - layerName: "0" - }, - { - title: "Versiegelungsgrad - Klassifizierte Veränderung 2006-2009 anhand von Copernicus Satellitendaten - 20m Rasterzellen", - description: "Mehr Informationen unter https://land.copernicus.eu/pan-european/high-resolution-layers/imperviousness", - url: "https://image.discomap.eea.europa.eu/arcgis/services/GioLandPublic/HRL_ImperviousnessClassifiedChange_06_09/MapServer/WMSServer?", - topicReference: "c46ecf8b-3f77-4be6-9ec1-851dc48e3eb8", - layerName: "0" - }, - { - title: "Versiegelungsgrad - Klassifizierte Veränderung 2009-2012 anhand von Copernicus Satellitendaten - 20m Rasterzellen", - description: "Mehr Informationen unter https://land.copernicus.eu/pan-european/high-resolution-layers/imperviousness", - url: "https://image.discomap.eea.europa.eu/arcgis/services/GioLandPublic/HRL_ImperviousnessClassifiedChange_09_12/MapServer/WMSServer?", - topicReference: "c46ecf8b-3f77-4be6-9ec1-851dc48e3eb8", - layerName: "0" - }, - { - title: "Versiegelungsgrad - Klassifizierte Veränderung 2012-2015 anhand von Copernicus Satellitendaten - 20m Rasterzellen", - description: "Mehr Informationen unter https://land.copernicus.eu/pan-european/high-resolution-layers/imperviousness", - url: "https://image.discomap.eea.europa.eu/arcgis/services/GioLandPublic/HRL_ImperviousnessChange_12_15/MapServer/WMSServer?", - topicReference: "c46ecf8b-3f77-4be6-9ec1-851dc48e3eb8", - layerName: "0" - }, - { - title: "Bodennutzung - Bebauungsplanumringe", - description: "Umringe der Bebauungspläne gemäß geodaten.metropoleruhr.de", - url: "https://geodaten.metropoleruhr.de/inspire/bodennutzung/metropoleruhr?", - topicReference: null, - layerName: "bplan" - } - ]; - - // array if available WFS datasets - window.__env.wfsDatasets = [ - // { - // title: "Title of dataset", - // description: "Description as HTML code (HTML tags allowed)", - // url: "URL of dataset including '?' as last character (i.e. https://wfs.example/myWfS?)", - // featureTypeNamespace: "namespace of featureType", - // featureTypeName: "name of featureType", // // check GetCapabilities Response - // featureTypeGeometryName: "name of geometry property of feature type", // check DescribeFeature Response - // geometryType: "AOI", // POI|LOI|AOI - // poiSymbolColor: "white", // ['white', 'red', 'orange', 'beige', 'green', 'blue', 'purple', 'pink', 'gray', 'black'] - // poiMarkerColor: "red", // ['white', 'red', 'orange', 'beige', 'green', 'blue', 'purple', 'pink', 'gray', 'black'] - // poiSymbolBootstrap3Name: "home", - // loiColor: "#00aabb", // color for LOI datasets - // loiWidth: 3, // 1 - 5 - // loiDashArrayString: "", // e.g. "20, 20" for equal dash/space visuals - // aoiColor: "#00aabb", // color for AOI datasets - // filterFeaturesToMapBBOX: false, // applies BBOX filter to WFS request - if not supported by WFS may lead to error - // filterEncoding: { // only one filter is currently implemented (PropertyIsEqualTo) - // // PropertyIsEqualTo: { - // // propertyName: undefined, // name of property - // // propertyValue: undefined // value of property - // // } - // }, - // topicReference: "c712af89-ff11-40ff-ad84-b3592901e085" // id of georesource topic entry which shall be used to display the WFS dataset entry - // }, - { - title: "Bodennutzung - Bebauungsplanumringe", - description: "Umringe der Bebauungspläne gemäß geodaten.metropoleruhr.de. WFS-Dienst unterstützt keine räumllichen Filter. Daher müssen zwingend alle Features abgerufen werden.", - url: "https://geodaten.metropoleruhr.de/inspire/bodennutzung/metropoleruhr?", - featureTypeNamespace: "ms", - featureTypeName: "bplan_stand", - featureTypeGeometryName: "geom", - geometryType: "AOI", // POI|LOI|AOI - poiSymbolColor: "white", // ['white', 'red', 'orange', 'beige', 'green', 'blue', 'purple', 'pink', 'gray', 'black'] - poiMarkerColor: "red", // ['white', 'red', 'orange', 'beige', 'green', 'blue', 'purple', 'pink', 'gray', 'black'] - poiSymbolBootstrap3Name: "home", - loiColor: "#00aabb", - loiWidth: 3, - loiDashArrayString: "", - aoiColor: "#00aabb", - filterFeaturesToMapBBOX: false, - filterEncoding: { - // PropertyIsEqualTo: { - // propertyName: undefined, - // propertyValue: undefined - // } - }, - topicReference: "c712af89-ff11-40ff-ad84-b3592901e085" - } - ]; - -} catch (error) { - console.error("Error while evaluating app config. Error is: \n" + error); -} \ No newline at end of file + /* + PROPERTIES used within extended info modal (second tab) to show a customizable HTMLText + */ + window.__env.enableExtendedInfoModal = false; // controls if an extra tab should be shown in the info modal. + window.__env.standardInfoModalTabTitle = "Informationen zu KomMonitor"; // title of the first tab + window.__env.extendedInfoModalTabTitle = "Weitere Informationen"; // title of the second tab + window.__env.extendedInfoModalHTMLMessage = ""; // message in the second tab as HTML + // property names of feature id and name (relevant for all spatial features) - KomMonitor specific + // DO NOT CHANGE THEM - ONLY IF YOU REALLY KNOW WHAT YOU ARE DOING + window.__env.FEATURE_ID_PROPERTY_NAME = "ID"; + window.__env.FEATURE_NAME_PROPERTY_NAME = "NAME"; + window.__env.VALID_START_DATE_PROPERTY_NAME = "validStartDate"; + window.__env.VALID_END_DATE_PROPERTY_NAME = "validEndDate"; + window.__env.indicatorDatePrefix = "DATE_"; + // Data Management API URL + // window.__env.apiUrl = 'http://kommonitor.fbg-hsbo.de/'; + window.__env.apiUrl = 'http://localhost:8085/'; + // Base url for Data Management API + window.__env.basePath = 'management'; + // Processing Engine URL + window.__env.targetUrlToProcessingEngine = 'http://localhost:8086/processing/'; + // Open Route Service URL + window.__env.targetUrlToReachabilityService_ORS = 'https://ors5.fbg-hsbo.de'; + // Open Trip Planner URL - currently not integrated + window.__env.targetUrlToReachabilityService_OTP = 'http://localhost:8090/opentripplanner'; + // Data Imporret URL + window.__env.targetUrlToImporterService = 'http://localhost:8087/importer/'; + // KomMonitor Geocoder Proxy + window.__env.targetUrlToGeocoderService = 'https://geocoder.fbg-hsbo.de/nominatim/'; + // optional geometry simplification (a feature of Data Management API) + window.__env.simplifyGeometriesParameterName = "simplifyGeometries"; + // allowed values and meaning: + // ["original" --> no simplification; "weak" --> weak simplification, + // "medium" --> medium simplification; "strong" --> string simplification] + window.__env.simplifyGeometriesOptions = [{ "label": "nein", "value": "original" }, { "label": "schwach", "value": "weak" }, { "label": "mittel", "value": "medium" }, { "label": "stark", "value": "strong" }]; + // use strong as default to minimize size of queried features + // for display, strong simplification is okay + window.__env.simplifyGeometries = "original"; + // number of decimals for display of numeric values in app + window.__env.numberOfDecimals = 2; + // starting viewpoint parameters and zoom level + window.__env.initialLatitude = 51.4386432; + window.__env.initialLongitude = 7.0115552; + window.__env.initialZoomLevel = 12; + // window.__env.minZoomLevel = 11; + window.__env.minZoomLevel = 5; + window.__env.maxZoomLevel = 18; + window.__env.baseLayers = [ + // { + // name: "", // display name + // url: "", // URL to layer + // layerType: "TILE_LAYER", // TILE_LAYER | TILE_LAYER_GRAYSCALE | WMS + // layerName_WMS: "", // only relevant for layers of type WMS - multiple layers comma-separated + // attribution_html: "", // attribution info displayed at the bottom of the map as HTML string + // minZoomLevel: window.__env.minZoomLevel, // min zoom level for this layer (number between 1-20) + // maxZoomLevel: window.__env.maxZoomLevel // max zoom level for this layer (number between 1-20, greater than minZoomLevel) + // }, + { + name: "Open Street Map - Graustufen", + url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", + layerType: "TILE_LAYER_GRAYSCALE", + layerName_WMS: "", + attribution_html: "Map data © OpenStreetMap contributors", + minZoomLevel: window.__env.minZoomLevel, + maxZoomLevel: window.__env.maxZoomLevel + }, + { + name: "Open Street Map - Farbe", + url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", + layerType: "TILE_LAYER", + layerName_WMS: "", + attribution_html: "Map data © OpenStreetMap contributors", + minZoomLevel: window.__env.minZoomLevel, + maxZoomLevel: window.__env.maxZoomLevel + }, + { + name: "RVR Stadtplan - Farbe", + url: "https://geodaten.metropoleruhr.de/spw2?", + layerType: "WMS", + layerName_WMS: "stadtplan_rvr", + attribution_html: "Map data © https://geodaten.metropoleruhr.de", + minZoomLevel: window.__env.minZoomLevel, + maxZoomLevel: window.__env.maxZoomLevel + }, + { + name: "RVR Stadtplan - Graublau", + url: "https://geodaten.metropoleruhr.de/spw2?", + layerType: "WMS", + layerName_WMS: "spw2_graublau", + attribution_html: "Map data © https://geodaten.metropoleruhr.de", + minZoomLevel: window.__env.minZoomLevel, + maxZoomLevel: window.__env.maxZoomLevel + }, + { + name: "NRW Digitale Topographische Karte", + url: "https://www.wms.nrw.de/geobasis/wms_nw_dtk?", + layerType: "WMS", + layerName_WMS: "nw_dtk_sw", + attribution_html: "Map data © Geobasis NRW", + minZoomLevel: window.__env.minZoomLevel, + maxZoomLevel: 20 + }, + { + name: "NRW Digitale Orthophotos (Luftbilder)", + url: "https://www.wms.nrw.de/geobasis/wms_nw_dop?", + layerType: "WMS", + layerName_WMS: "nw_dop_rgb", + attribution_html: "Map data © Geobasis NRW", + minZoomLevel: window.__env.minZoomLevel, + maxZoomLevel: window.__env.maxZoomLevel + }, + { + name: "Stadt Essen - Automatisierte Liegenschaftskarte", + url: "https://geo.essen.de/arcgis/services/basemap/Stadtplanpaket_ALK_grau/MapServer/WMSServer?", + layerType: "WMS", + layerName_WMS: "0,1,2,3", + attribution_html: "Stadt Essen: Amt für Geoinformation, Vermessung und Kataster", + minZoomLevel: window.__env.minZoomLevel, + maxZoomLevel: window.__env.maxZoomLevel + }, + { + name: "Stadt Essen - Amtliche Basiskarte", + url: "https://geo.essen.de/arcgis/services/basemap/Uebersicht_ABK_Stadtgrundkarte/MapServer/WMSServer?", + layerType: "WMS", + layerName_WMS: "nw_dop_rgb", + attribution_html: "Stadt Essen: Amt für Geoinformation, Vermessung und Kataster", + minZoomLevel: window.__env.minZoomLevel, + maxZoomLevel: window.__env.maxZoomLevel + } + ]; + // starting indicator and spatial unit + // if faulty values are provided, a random indicator will be displayed + window.__env.initialIndicatorId = "48a18455-6a52-4e74-bdbf-99237187fc5c"; + window.__env.initialSpatialUnitName = "Stadtteilebene"; + // various color settings + window.__env.defaultColorForNoDataValues = "rgba(255,255,255,0)"; + window.__env.defaultBorderColorForNoDataValues = "black"; + window.__env.defaultColorForOutliers_high = "#191919"; + window.__env.defaultBorderColorForOutliers_high = "black"; + window.__env.defaultFillOpacityForOutliers_high = "0.7"; + window.__env.defaultColorForOutliers_low = "#4f4f4f"; + window.__env.defaultBorderColorForOutliers_low = "black"; + window.__env.defaultFillOpacityForOutliers_low = "0.7"; + window.__env.defaultColorForHoveredFeatures = "#e01414"; + window.__env.defaultColorForClickedFeatures = "#42e5f4"; + window.__env.defaultColorForZeroValues = "#bababa"; + window.__env.defaultBorderColor = "black"; + window.__env.defaultColorForFilteredValues = "rgba(255,255,255,0)"; + window.__env.defaultBorderColorForFilteredValues = "black"; + window.__env.defaultFillOpacity = "0.7"; + window.__env.defaultFillOpacityForFilteredFeatures = "0.7"; + window.__env.defaultFillOpacityForZeroFeatures = "0.7"; + window.__env.defaultFillOpacityForNoDataFeatures = "0.7"; + window.__env.defaultFillOpacityForHighlightedFeatures = "0.8"; + window.__env.useTransparencyOnIndicator = true; + window.__env.useOutlierDetectionOnIndicator = true; + window.__env.classifyZeroSeparately = true; + window.__env.classifyUsingWholeTimeseries = true; + window.__env.useNoDataToggle = false; // true = hide no data values, false = show no data values + // default color for specific classification as ColorBrewer palette name + // i.e. balance mode + // i.e. measure of value classification (German: Schwellwertklassifizierung) + window.__env.defaultColorBrewerPaletteForBalanceIncreasingValues = "Purples"; + window.__env.defaultColorBrewerPaletteForBalanceDecreasingValues = "YlOrBr"; + window.__env.defaultColorBrewerPaletteForGtMovValues = "YlOrBr"; + window.__env.defaultColorBrewerPaletteForLtMovValues = "Blues"; + // classification + //allowesValues: equal_interval, quantile, jenks + window.__env.defaultClassifyMethod = "equal_interval"; + // array of indicator name substring that shal be used to filter out / hide certain indicators by their name + // e.g. set ["entwicklung"] to hide all indicators whose name contains the substring "entwicklung" + window.__env.arrayOfNameSubstringsForHidingIndicators = []; + // window.__env.arrayOfNameSubstringsForHidingIndicators = []; + window.__env.arrayOfNameSubstringsForHidingGeoresources = []; + // e-mail recipient for feedback mail + window.__env.feedbackMailRecipient = "christian.danowski-buhren@hochschule-bochum.de"; + // window.__env.feedbackMailRecipient = "christian.danowski-buhren@hs-bochum.de"; + // config array of available options for choosing update interval of indicators + window.__env.updateIntervalOptions = [ + { + displayName: "jährlich", + apiName: "YEARLY" + }, + { + displayName: "halbjährlich", + apiName: "HALF_YEARLY" + }, + { + displayName: "vierteljährlich", + apiName: "QUARTERLY" + }, + { + displayName: "monatlich", + apiName: "MONTHLY" + }, + { + displayName: "wöchentlich", + apiName: "WEEKLY" + }, + { + displayName: "täglich", + apiName: "DAILY" + }, + { + displayName: "beliebig", + apiName: "ARBITRARY" + } + ]; + // config array of available options for choosing creation type of indicators + window.__env.indicatorCreationTypeOptions = [ + { + displayName: "manuell", + apiName: "INSERTION" + }, + { + displayName: "automatisierte Berechnung durch KomMonitor", + apiName: "COMPUTATION" + } + ]; + // config array of available options for choosing indicator's unit + window.__env.indicatorUnitOptions = ["Anzahl", "Anteil", "Prozent", "Einwohner", "m", "m²", "km", "km²", "ha", "dimensionslos", "standardisiert", "z-transformierte Werte" + ]; + // config array of available options for choosing indicator type of indicators + window.__env.indicatorTypeOptions = [ + { + displayName: "Status-Indikator (absolut)", + apiName: "STATUS_ABSOLUTE" + }, + { + displayName: "Status-Indikator (relativ)", + apiName: "STATUS_RELATIVE" + }, + { + displayName: "Dynamik-Indikator (absolut)", + apiName: "DYNAMIC_ABSOLUTE" + }, + { + displayName: "Dynamik-Indikator (relativ)", + apiName: "DYNAMIC_RELATIVE" + }, + { + displayName: "Status-Indikator (standardisiert)", + apiName: "STATUS_STANDARDIZED" + }, + { + displayName: "Dynamik-Indikator (standardisiert)", + apiName: "DYNAMIC_STANDARDIZED" + } + ]; + // array of available WMS datasets + window.__env.wmsDatasets = [ + // { + // title: "Title of WMS dataset", + // description: "Description as HTML code (HTML tags allowed)", + // url: "URL including '?' as last character (i.e. https://wms.example/myWMS)", + // topicReference: "3af3b65e-4792-4998-8531-54616564b5bc", // id of georesource topic to hang in the WMS entry + // layerName:"laerm" // name of WMS layer to display + // }, + { + title: "Lärmkartierung - Test", + description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", + url: "https://www.wms.nrw.de/umwelt/laerm?", + topicReference: "3af3b65e-4792-4998-8531-54616564b5bc", + layerName: "laerm" + }, + { + title: "Unfalldaten 2019", + description: "Unfalldaten des statistischen Bundesamtes
        ", + url: "https://www.wms.nrw.de/wms/unfallatlas?", + topicReference: "7255b83f-feb0-4f01-9dc1-6b355447206d", + layerName: "Unfallorte_2019" + }, + { + title: "Lärmkartierung - Flugverkehr 24h-Pegel LDEN", + description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", + url: "https://www.wms.nrw.de/umwelt/laerm?", + topicReference: "e94c8100-3790-4ddd-b977-fe48b4f93e26", + layerName: "FLG_DEN" + }, + { + title: "Lärmkartierung - Flugverkehr Nachtpegel LNight", + description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", + url: "https://www.wms.nrw.de/umwelt/laerm?", + topicReference: "e94c8100-3790-4ddd-b977-fe48b4f93e26", + layerName: "FLG_NGT" + }, + { + title: "Lärmkartierung - Industrie 24h-Pegel LDEN", + description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", + url: "https://www.wms.nrw.de/umwelt/laerm?", + topicReference: "e94c8100-3790-4ddd-b977-fe48b4f93e26", + layerName: "IND_DEN" + }, + { + title: "Lärmkartierung - Industrie Nachtpegel LNight", + description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", + url: "https://www.wms.nrw.de/umwelt/laerm?", + topicReference: "e94c8100-3790-4ddd-b977-fe48b4f93e26", + layerName: "IND_NGT" + }, + { + title: "Lärmkartierung - Straße 24h-Pegel LDEN", + description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", + url: "https://www.wms.nrw.de/umwelt/laerm?", + topicReference: "e94c8100-3790-4ddd-b977-fe48b4f93e26", + layerName: "STR_DEN" + }, + { + title: "Lärmkartierung - Straße Nachtpegel LNight", + description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", + url: "https://www.wms.nrw.de/umwelt/laerm?", + topicReference: "e94c8100-3790-4ddd-b977-fe48b4f93e26", + layerName: "STR_NGT" + }, + { + title: "Lärmkartierung - Schiene sonstige 24h-Pegel LDEN", + description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", + url: "https://www.wms.nrw.de/umwelt/laerm?", + topicReference: "e94c8100-3790-4ddd-b977-fe48b4f93e26", + layerName: "SCS_DEN" + }, + { + title: "Lärmkartierung - Schiene sonstige Nachtpegel LNight", + description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", + url: "https://www.wms.nrw.de/umwelt/laerm?", + topicReference: "e94c8100-3790-4ddd-b977-fe48b4f93e26", + layerName: "SCS_NGT" + }, + { + title: "Lärmkartierung - Schiene Bund 24h-Pegel LDEN", + description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", + url: "https://www.wms.nrw.de/umwelt/laerm?", + topicReference: "e94c8100-3790-4ddd-b977-fe48b4f93e26", + layerName: "SCB_DEN" + }, + { + title: "Lärmkartierung - Schiene Bund Nachtpegel LNight", + description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", + url: "https://www.wms.nrw.de/umwelt/laerm?", + topicReference: "e94c8100-3790-4ddd-b977-fe48b4f93e26", + layerName: "SCB_NGT" + }, + // { + // title: "Lärmkartierung - Gebaeude", + // description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", + // url: "https://www.wms.nrw.de/umwelt/laerm?", + // layerName: "Gebaeude" + // }, + // { + // title: "Lärmkartierung - Modell", + // description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", + // url: "https://www.wms.nrw.de/umwelt/laerm?", + // layerName: "Modell" + // }, + { + title: "Versiegelungsgrad - 2006 anhand von Copernicus Satellitendaten - 20m Rasterzellen", + description: "Mehr Informationen unter https://land.copernicus.eu/pan-european/high-resolution-layers/imperviousness", + url: "https://image.discomap.eea.europa.eu/arcgis/services/GioLandPublic/HRL_ImperviousnessDensity_2006/MapServer/WMSServer?", + topicReference: "c46ecf8b-3f77-4be6-9ec1-851dc48e3eb8", + layerName: "0" + }, + { + title: "Versiegelungsgrad - 2009 anhand von Copernicus Satellitendaten - 20m Rasterzellen", + description: "Mehr Informationen unter https://land.copernicus.eu/pan-european/high-resolution-layers/imperviousness", + url: "https://image.discomap.eea.europa.eu/arcgis/services/GioLandPublic/HRL_ImperviousnessDensity_2009/MapServer/WMSServer?", + topicReference: "c46ecf8b-3f77-4be6-9ec1-851dc48e3eb8", + layerName: "0" + }, + { + title: "Versiegelungsgrad - 2012 anhand von Copernicus Satellitendaten - 20m Rasterzellen", + description: "Mehr Informationen unter https://land.copernicus.eu/pan-european/high-resolution-layers/imperviousness", + url: "https://image.discomap.eea.europa.eu/arcgis/services/GioLandPublic/HRL_Imperviousness_Density_2012/MapServer/WMSServer?", + topicReference: "c46ecf8b-3f77-4be6-9ec1-851dc48e3eb8", + layerName: "Imperviousness density 2012 20m" + }, + { + title: "Versiegelungsgrad - 2015 anhand von Copernicus Satellitendaten - 20m Rasterzellen", + description: "Mehr Informationen unter https://land.copernicus.eu/pan-european/high-resolution-layers/imperviousness", + url: "https://image.discomap.eea.europa.eu/arcgis/services/GioLandPublic/HRL_ImperviousnessDensity_2015/MapServer/WMSServer?", + topicReference: "c46ecf8b-3f77-4be6-9ec1-851dc48e3eb8", + layerName: "0" + }, + { + title: "Versiegelungsgrad - Veränderung 2006-2009 anhand von Copernicus Satellitendaten - 20m Rasterzellen", + description: "Mehr Informationen unter https://land.copernicus.eu/pan-european/high-resolution-layers/imperviousness", + url: "https://image.discomap.eea.europa.eu/arcgis/services/GioLandPublic/HRL_ImperviousnessChange_06_09/MapServer/WMSServer?", + topicReference: "c46ecf8b-3f77-4be6-9ec1-851dc48e3eb8", + layerName: "0" + }, + { + title: "Versiegelungsgrad - Veränderung 2009-2012 anhand von Copernicus Satellitendaten - 20m Rasterzellen", + description: "Mehr Informationen unter https://land.copernicus.eu/pan-european/high-resolution-layers/imperviousness", + url: "https://image.discomap.eea.europa.eu/arcgis/services/GioLandPublic/HRL_ImperviousnessChange_09_12/MapServer/WMSServer?", + topicReference: "c46ecf8b-3f77-4be6-9ec1-851dc48e3eb8", + layerName: "Imperviousness density change 09-12 20m" + }, + { + title: "Versiegelungsgrad - Veränderung 2012-2015 anhand von Copernicus Satellitendaten - 20m Rasterzellen", + description: "Mehr Informationen unter https://land.copernicus.eu/pan-european/high-resolution-layers/imperviousness", + url: "https://image.discomap.eea.europa.eu/arcgis/services/GioLandPublic/HRL_ImperviousnessChange_12_15/MapServer/WMSServer?", + topicReference: "c46ecf8b-3f77-4be6-9ec1-851dc48e3eb8", + layerName: "0" + }, + { + title: "Versiegelungsgrad - Klassifizierte Veränderung 2006-2009 anhand von Copernicus Satellitendaten - 20m Rasterzellen", + description: "Mehr Informationen unter https://land.copernicus.eu/pan-european/high-resolution-layers/imperviousness", + url: "https://image.discomap.eea.europa.eu/arcgis/services/GioLandPublic/HRL_ImperviousnessClassifiedChange_06_09/MapServer/WMSServer?", + topicReference: "c46ecf8b-3f77-4be6-9ec1-851dc48e3eb8", + layerName: "0" + }, + { + title: "Versiegelungsgrad - Klassifizierte Veränderung 2009-2012 anhand von Copernicus Satellitendaten - 20m Rasterzellen", + description: "Mehr Informationen unter https://land.copernicus.eu/pan-european/high-resolution-layers/imperviousness", + url: "https://image.discomap.eea.europa.eu/arcgis/services/GioLandPublic/HRL_ImperviousnessClassifiedChange_09_12/MapServer/WMSServer?", + topicReference: "c46ecf8b-3f77-4be6-9ec1-851dc48e3eb8", + layerName: "0" + }, + { + title: "Versiegelungsgrad - Klassifizierte Veränderung 2012-2015 anhand von Copernicus Satellitendaten - 20m Rasterzellen", + description: "Mehr Informationen unter https://land.copernicus.eu/pan-european/high-resolution-layers/imperviousness", + url: "https://image.discomap.eea.europa.eu/arcgis/services/GioLandPublic/HRL_ImperviousnessChange_12_15/MapServer/WMSServer?", + topicReference: "c46ecf8b-3f77-4be6-9ec1-851dc48e3eb8", + layerName: "0" + }, + { + title: "Bodennutzung - Bebauungsplanumringe", + description: "Umringe der Bebauungspläne gemäß geodaten.metropoleruhr.de", + url: "https://geodaten.metropoleruhr.de/inspire/bodennutzung/metropoleruhr?", + topicReference: null, + layerName: "bplan" + } + ]; + // array if available WFS datasets + window.__env.wfsDatasets = [ + // { + // title: "Title of dataset", + // description: "Description as HTML code (HTML tags allowed)", + // url: "URL of dataset including '?' as last character (i.e. https://wfs.example/myWfS?)", + // featureTypeNamespace: "namespace of featureType", + // featureTypeName: "name of featureType", // // check GetCapabilities Response + // featureTypeGeometryName: "name of geometry property of feature type", // check DescribeFeature Response + // geometryType: "AOI", // POI|LOI|AOI + // poiSymbolColor: "white", // ['white', 'red', 'orange', 'beige', 'green', 'blue', 'purple', 'pink', 'gray', 'black'] + // poiMarkerColor: "red", // ['white', 'red', 'orange', 'beige', 'green', 'blue', 'purple', 'pink', 'gray', 'black'] + // poiSymbolBootstrap3Name: "home", + // loiColor: "#00aabb", // color for LOI datasets + // loiWidth: 3, // 1 - 5 + // loiDashArrayString: "", // e.g. "20, 20" for equal dash/space visuals + // aoiColor: "#00aabb", // color for AOI datasets + // filterFeaturesToMapBBOX: false, // applies BBOX filter to WFS request - if not supported by WFS may lead to error + // filterEncoding: { // only one filter is currently implemented (PropertyIsEqualTo) + // // PropertyIsEqualTo: { + // // propertyName: undefined, // name of property + // // propertyValue: undefined // value of property + // // } + // }, + // topicReference: "c712af89-ff11-40ff-ad84-b3592901e085" // id of georesource topic entry which shall be used to display the WFS dataset entry + // }, + { + title: "Bodennutzung - Bebauungsplanumringe", + description: "Umringe der Bebauungspläne gemäß geodaten.metropoleruhr.de. WFS-Dienst unterstützt keine räumllichen Filter. Daher müssen zwingend alle Features abgerufen werden.", + url: "https://geodaten.metropoleruhr.de/inspire/bodennutzung/metropoleruhr?", + featureTypeNamespace: "ms", + featureTypeName: "bplan_stand", + featureTypeGeometryName: "geom", + geometryType: "AOI", + poiSymbolColor: "white", + poiMarkerColor: "red", + poiSymbolBootstrap3Name: "home", + loiColor: "#00aabb", + loiWidth: 3, + loiDashArrayString: "", + aoiColor: "#00aabb", + filterFeaturesToMapBBOX: false, + filterEncoding: { + // PropertyIsEqualTo: { + // propertyName: undefined, + // propertyValue: undefined + // } + }, + topicReference: "c712af89-ff11-40ff-ad84-b3592901e085" + } + ]; +} +catch (error) { + console.error("Error while evaluating app config. Error is: \n" + error); +} +//# sourceMappingURL=env_backup.js.map \ No newline at end of file diff --git a/app/config/env_backup.js.map b/app/config/env_backup.js.map new file mode 100644 index 000000000..af7217e11 --- /dev/null +++ b/app/config/env_backup.js.map @@ -0,0 +1 @@ +{"version":3,"file":"env_backup.js","sourceRoot":"","sources":["env_backup.ts"],"names":[],"mappings":";AAAA,IAAI;IAEF,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC;IAElC,MAAM,CAAC,KAAK,CAAC,QAAQ,GAAG,2BAA2B,CAAC;IAEpD,yDAAyD;IACzD,mHAAmH;IACnH,MAAM,CAAC,KAAK,CAAC,kBAAkB,GAAG,oBAAoB,CAAC;IAEvD,sCAAsC;IACtC,oDAAoD;IACpD,MAAM,CAAC,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC;IAEhC,kDAAkD;IAClD,MAAM,CAAC,KAAK,CAAC,sBAAsB,GAAG,IAAI,CAAC;IAE3C,iCAAiC;IACjC,MAAM,CAAC,KAAK,CAAC,+BAA+B,GAAG,oBAAoB,CAAC;IAEpE,gEAAgE;IAChE,qEAAqE;IACrE,yEAAyE;IACzE,MAAM,CAAC,KAAK,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC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IAClC,MAAM,CAAC,KAAK,CAAC,WAAW,GAAG;QACzB,IAAI;QACJ,+BAA+B;QAC/B,iEAAiE;QACjE,6FAA6F;QAC7F,sDAAsD;QACtD,kFAAkF;QAClF,4GAA4G;QAC5G,wCAAwC;QACxC,wHAAwH;QACxH,sHAAsH;QACtH,qCAAqC;QACrC,mDAAmD;QACnD,0BAA0B;QAC1B,0EAA0E;QAC1E,mDAAmD;QACnD,sHAAsH;QACtH,sFAAsF;QACtF,8BAA8B;QAC9B,yDAAyD;QACzD,0DAA0D;QAC1D,SAAS;QACT,OAAO;QACP,mJAAmJ;QACnJ,KAAK;QACL;YACE,KAAK,EAAE,qCAAqC;YAC5C,WAAW,EAAE,0MAA0M;YACvN,GAAG,EAAE,uEAAuE;YAC5E,oBAAoB,EAAE,IAAI;YAC1B,eAAe,EAAE,aAAa;YAC9B,uBAAuB,EAAE,MAAM;YAC/B,YAAY,EAAE,KAAK;YACnB,cAAc,EAAE,OAAO;YACvB,cAAc,EAAE,KAAK;YACrB,uBAAuB,EAAE,MAAM;YAC/B,QAAQ,EAAE,SAAS;YACnB,QAAQ,EAAE,CAAC;YACX,kBAAkB,EAAE,EAAE;YACtB,QAAQ,EAAE,SAAS;YACnB,uBAAuB,EAAE,KAAK;YAC9B,cAAc,EAAE;YACd,uBAAuB;YACvB,6BAA6B;YAC7B,6BAA6B;YAC/B,IAAI;aACH;YACD,cAAc,EAAE,sCAAsC;SACvD;KACF,CAAC;CAEH;AAAC,OAAO,KAAK,EAAE;IACd,OAAO,CAAC,KAAK,CAAC,iDAAiD,GAAG,KAAK,CAAC,CAAC;CAC1E"} \ No newline at end of file diff --git a/app/config/env_backup.ts b/app/config/env_backup.ts new file mode 100644 index 000000000..3a61216e8 --- /dev/null +++ b/app/config/env_backup.ts @@ -0,0 +1,576 @@ +try { + + window.__env = window.__env || {}; + + window.__env.appTitle = "KomMonitor (Pilotversion)"; + + // a unique prefix for the respective KomMonitor instance + // it is used to distuingish between various KomMonitor instances in order to write/read data to/from browser cache + window.__env.localStoragePrefix = "kommonitor-develop"; + + // Whether or not to enable debug mode + // Setting this to false will disable console output + window.__env.enableDebug = true; + + // enable/disable role based access using keycloak + window.__env.enableKeycloakSecurity = true; + + // keycloak super admin role name + window.__env.keycloakKomMonitorAdminRoleName = "kommonitor-creator"; + + // enable and show/hide switch to toggle basic and advanced mode + // this feature can hide certain app elements via ID if in basic mode + // configure elements in admin page app settings via controls-config file + window.__env.isAdvancedMode = true; // controls if advanced mode is activated on startup + window.__env.showAdvancedModeSwitch = true; // controls if toggle switch is at all displayed for toggling basinc/advanced mode + + // encrypted data transfer from Data Management API settings + window.__env.encryption = { + enabled: false, + password: "password", // this is shared secret between all components (hence must be set to the exact same value for all participating components) + ivLength_byte: 16 + }; + + /* + PROPERTIES used within greetings window (infoModal component) + to insert custom LOGO by URL with custom width + and adjust individual information text + as well as contact information + */ + window.__env.customLogoURL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAAzFBMVEXjABv////hAAD//v/eAAD2wcLkABvjAAD9///iARniABHyr6/vjZP60Nb+5Oj9+fnwoaTmQ1L77/DwnKDjAArxp6nsgof3yM/oaHDmABnhAR7+//vyr675///jACDhAA7zrbTxtbXrk5TqXGboSE7naGvsZnPoRUboa3PnNUP73N/0t732wMb89vvndXnlPkniFin4z83nV1/rdHbnWGjtnZ3yoKzwjpvrhoXiLTX619rmWlvqkI/74OXiJjzmTVf/7vfne4H2wLrocm7o9VDtAAAK/ElEQVR4nO2dC1vbuBKGLVnoYgJhgwOVTEi49QCF0st2t7DL9nL+/386Ulocjew4dqItCWde2j48jq3403WkGalJgiAIgiAIgiAIgiAIgiAIgiAIgiAIgiAIgiAIgiAIgiAIgiAIgnQmF0w0QhOjjcrBJWr/GSue2D+NaMONUscqywMSY7KkcjWzKSqjVVyBB0eTydH2fI5OhFEmvzgJrp+e5UxkyjQlbtUpNRZsfH7x+pXH64vcqlD/uXwFuWJMJAsyrTN0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2TVtYjsfWeN/HODiUK+GX6tfcGtnjCY4lfAHD71cxBklSoWT3QW4KbrKD4Krj+/3LijN1UKbIxPs3eXp0dBnezi2E97sv9tDSO9D7tzQkQMw2EI0d4fRhFeF6wzM4rdRSmU5A5ND+6tJjHaBLsFUNLffpav/z8JqLCwE5VYcElBzOFfcnUfKWx09o41SieHgOFabphs0A1yIA4x5QBAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQZC14n9/oOVTqSdcxgAAAABJRU5ErkJggg=="; // image format allows all types usable within HTML tag + window.__env.customLogo_onClickURL = "https://www.hochschule-bochum.de/fbg/forschung-und-entwicklung/kommonitor/"; // uses tag to insert clickable link on logo + window.__env.customLogoWidth = "35px"; // height is fixed to 35px; so adjust your custom width to keep aspect ratio + window.__env.customGreetingsContact_name = "Christian Danowski-Buhren"; + window.__env.customGreetingsContact_organisation = "Hochschule Bochum, Fachbereich Geodäsie"; + window.__env.customGreetingsContact_mail = "christian.danowski-buhren@hs-bochum.de"; + window.__env.customGreetingsTextInfoMessage = ""; // as HTML; only set if you want to give users some extra hints; if empty will be ignored + + + + /* + PROPERTIES used within special modal (spatialUnitNotification component) + to show a customizable HTMLText only when user selects a certian spatial unit for any indicator + */ + window.__env.enableSpatialUnitNotificationSelection = false; // controls if a notification should be shown when selecting certain spatial units + window.__env.enableSpatialUnitNotificationButton = false; // enables button to manually open spatial unit notification + window.__env.spatialUnitNotificationSelection = ["Baublockebene"]; // unit(s) for which the notification is shown + window.__env.spatialUnitNotificationTitle = "Informationsverlust auf kleinräumigen Ebenen (Bau- und Mittelblock)"; // title of the notification window + window.__env.spatialUnitNotificationMessage = "Alle Daten, die im KomMonitor dargestellt werden, halten die statistische Geheimhaltung ein. Das bedeutet, dass Angaben zu einzelnen Personen nicht offengelegt werden, insbesondere auch, wenn aus aggregierten Werten Rückschlüsse zu Einzelangaben ermöglicht werden. Aus diesem Grund werden Indikatorenwerte, die in einem räumlichen Aggregat eine absolute Fallzahl von < 3 Einwohnern aufweisen, so behandelt, als hätten diese 0 Einwohner.\ + Diese Methode der statistischen Geheimhaltung kann zu einem teilweise hohen Informationsverlust auf kleinräumigen Ebenen führen. Stark differenzierte Indikatoren auf kleinräumigen Ebenen, die insgesamt nur wenige Fallzahlen aufweisen, könnten so an vielen Stellen entsprechend bereinigt worden seien und somit keine validen Werte liefern. \ + Dies lässt sich daran erkennen, dass die Fallzahlen insgesamt niedrig sind und viele Gebiete 0-Werte haben. Eine flächendeckendes Bild ist somit nicht möglich. \ + Dennoch bieten diese Indikatoren trotz ungenauer Wertedie Möglichkeit, „Hot-Spots“ und „Cluster“ der jeweiligen Indikatoren zu ermitteln. \ + Zahlen auf kleinräumige Ebenen sollten vor diesem Hintergrund vorsichtig und sorgfältig interpretiert werden."; // message shown when previous spatial unit is selected + + /* + PROPERTIES used within extended info modal (second tab) to show a customizable HTMLText + */ + window.__env.enableExtendedInfoModal = false; // controls if an extra tab should be shown in the info modal. + window.__env.standardInfoModalTabTitle = "Informationen zu KomMonitor" // title of the first tab + window.__env.extendedInfoModalTabTitle = "Weitere Informationen" // title of the second tab + window.__env.extendedInfoModalHTMLMessage = ""; // message in the second tab as HTML + + // property names of feature id and name (relevant for all spatial features) - KomMonitor specific + // DO NOT CHANGE THEM - ONLY IF YOU REALLY KNOW WHAT YOU ARE DOING + window.__env.FEATURE_ID_PROPERTY_NAME = "ID"; + window.__env.FEATURE_NAME_PROPERTY_NAME = "NAME"; + window.__env.VALID_START_DATE_PROPERTY_NAME = "validStartDate"; + window.__env.VALID_END_DATE_PROPERTY_NAME = "validEndDate"; + window.__env.indicatorDatePrefix = "DATE_"; + + // Data Management API URL + // window.__env.apiUrl = 'http://kommonitor.fbg-hsbo.de/'; + window.__env.apiUrl = 'http://localhost:8085/'; + // Base url for Data Management API + window.__env.basePath = 'management'; + + // Processing Engine URL + window.__env.targetUrlToProcessingEngine = 'http://localhost:8086/processing/'; + + // Open Route Service URL + window.__env.targetUrlToReachabilityService_ORS = 'https://ors5.fbg-hsbo.de'; + + // Open Trip Planner URL - currently not integrated + window.__env.targetUrlToReachabilityService_OTP = 'http://localhost:8090/opentripplanner'; + + // Data Imporret URL + window.__env.targetUrlToImporterService = 'http://localhost:8087/importer/'; + + // KomMonitor Geocoder Proxy + window.__env.targetUrlToGeocoderService = 'https://geocoder.fbg-hsbo.de/nominatim/'; + + // optional geometry simplification (a feature of Data Management API) + window.__env.simplifyGeometriesParameterName = "simplifyGeometries"; + // allowed values and meaning: + // ["original" --> no simplification; "weak" --> weak simplification, + // "medium" --> medium simplification; "strong" --> string simplification] + window.__env.simplifyGeometriesOptions = [{"label": "nein", "value": "original"}, {"label": "schwach", "value": "weak"}, {"label": "mittel", "value": "medium"}, {"label": "stark", "value": "strong"}]; + // use strong as default to minimize size of queried features + // for display, strong simplification is okay + window.__env.simplifyGeometries = "original"; + + // number of decimals for display of numeric values in app + window.__env.numberOfDecimals = 2; + + // starting viewpoint parameters and zoom level + window.__env.initialLatitude = 51.4386432; + window.__env.initialLongitude = 7.0115552; + window.__env.initialZoomLevel = 12; + // window.__env.minZoomLevel = 11; + window.__env.minZoomLevel = 5; + window.__env.maxZoomLevel = 18; + + window.__env.baseLayers = [ // baseLayers of instance; first will be set as default starting layer + // { + // name: "", // display name + // url: "", // URL to layer + // layerType: "TILE_LAYER", // TILE_LAYER | TILE_LAYER_GRAYSCALE | WMS + // layerName_WMS: "", // only relevant for layers of type WMS - multiple layers comma-separated + // attribution_html: "", // attribution info displayed at the bottom of the map as HTML string + // minZoomLevel: window.__env.minZoomLevel, // min zoom level for this layer (number between 1-20) + // maxZoomLevel: window.__env.maxZoomLevel // max zoom level for this layer (number between 1-20, greater than minZoomLevel) + // }, + { + name: "Open Street Map - Graustufen", + url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", + layerType: "TILE_LAYER_GRAYSCALE", + layerName_WMS: "", + attribution_html: "Map data © OpenStreetMap contributors", + minZoomLevel: window.__env.minZoomLevel, + maxZoomLevel: window.__env.maxZoomLevel + }, + { + name: "Open Street Map - Farbe", + url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", + layerType: "TILE_LAYER", + layerName_WMS: "", + attribution_html: "Map data © OpenStreetMap contributors", + minZoomLevel: window.__env.minZoomLevel, + maxZoomLevel: window.__env.maxZoomLevel + }, + { + name: "RVR Stadtplan - Farbe", + url: "https://geodaten.metropoleruhr.de/spw2?", + layerType: "WMS", + layerName_WMS: "stadtplan_rvr", + attribution_html: "Map data © https://geodaten.metropoleruhr.de", + minZoomLevel: window.__env.minZoomLevel, + maxZoomLevel: window.__env.maxZoomLevel + }, + { + name: "RVR Stadtplan - Graublau", + url: "https://geodaten.metropoleruhr.de/spw2?", + layerType: "WMS", + layerName_WMS: "spw2_graublau", + attribution_html: "Map data © https://geodaten.metropoleruhr.de", + minZoomLevel: window.__env.minZoomLevel, + maxZoomLevel: window.__env.maxZoomLevel + }, + { + name: "NRW Digitale Topographische Karte", + url: "https://www.wms.nrw.de/geobasis/wms_nw_dtk?", + layerType: "WMS", + layerName_WMS: "nw_dtk_sw", + attribution_html: "Map data © Geobasis NRW", + minZoomLevel: window.__env.minZoomLevel, + maxZoomLevel: 20 + }, + { + name: "NRW Digitale Orthophotos (Luftbilder)", + url: "https://www.wms.nrw.de/geobasis/wms_nw_dop?", + layerType: "WMS", + layerName_WMS: "nw_dop_rgb", + attribution_html: "Map data © Geobasis NRW", + minZoomLevel: window.__env.minZoomLevel, + maxZoomLevel: window.__env.maxZoomLevel + }, + { + name: "Stadt Essen - Automatisierte Liegenschaftskarte", + url: "https://geo.essen.de/arcgis/services/basemap/Stadtplanpaket_ALK_grau/MapServer/WMSServer?", + layerType: "WMS", + layerName_WMS: "0,1,2,3", + attribution_html: "Stadt Essen: Amt für Geoinformation, Vermessung und Kataster", + minZoomLevel: window.__env.minZoomLevel, + maxZoomLevel: window.__env.maxZoomLevel + }, + { + name: "Stadt Essen - Amtliche Basiskarte", + url: "https://geo.essen.de/arcgis/services/basemap/Uebersicht_ABK_Stadtgrundkarte/MapServer/WMSServer?", + layerType: "WMS", + layerName_WMS: "nw_dop_rgb", + attribution_html: "Stadt Essen: Amt für Geoinformation, Vermessung und Kataster", + minZoomLevel: window.__env.minZoomLevel, + maxZoomLevel: window.__env.maxZoomLevel + } + ]; + + + // starting indicator and spatial unit + // if faulty values are provided, a random indicator will be displayed + window.__env.initialIndicatorId = "48a18455-6a52-4e74-bdbf-99237187fc5c"; + window.__env.initialSpatialUnitName = "Stadtteilebene"; + + // various color settings + window.__env.defaultColorForNoDataValues = "rgba(255,255,255,0)"; + window.__env.defaultBorderColorForNoDataValues = "black"; + window.__env.defaultColorForOutliers_high = "#191919"; + window.__env.defaultBorderColorForOutliers_high = "black"; + window.__env.defaultFillOpacityForOutliers_high = "0.7"; + window.__env.defaultColorForOutliers_low = "#4f4f4f"; + window.__env.defaultBorderColorForOutliers_low = "black"; + window.__env.defaultFillOpacityForOutliers_low = "0.7"; + window.__env.defaultColorForHoveredFeatures = "#e01414"; + window.__env.defaultColorForClickedFeatures = "#42e5f4"; + window.__env.defaultColorForZeroValues = "#bababa"; + window.__env.defaultBorderColor = "black"; + window.__env.defaultColorForFilteredValues = "rgba(255,255,255,0)"; + window.__env.defaultBorderColorForFilteredValues = "black"; + window.__env.defaultFillOpacity = "0.7"; + window.__env.defaultFillOpacityForFilteredFeatures = "0.7"; + window.__env.defaultFillOpacityForZeroFeatures = "0.7"; + window.__env.defaultFillOpacityForNoDataFeatures = "0.7"; + window.__env.defaultFillOpacityForHighlightedFeatures = "0.8"; + window.__env.useTransparencyOnIndicator = true; + window.__env.useOutlierDetectionOnIndicator = true; + window.__env.classifyZeroSeparately = true; + window.__env.classifyUsingWholeTimeseries = true; + window.__env.useNoDataToggle = false; // true = hide no data values, false = show no data values + + // default color for specific classification as ColorBrewer palette name + // i.e. balance mode + // i.e. measure of value classification (German: Schwellwertklassifizierung) + window.__env.defaultColorBrewerPaletteForBalanceIncreasingValues = "Purples"; + window.__env.defaultColorBrewerPaletteForBalanceDecreasingValues = "YlOrBr"; + window.__env.defaultColorBrewerPaletteForGtMovValues = "YlOrBr"; + window.__env.defaultColorBrewerPaletteForLtMovValues = "Blues"; + + // classification + //allowesValues: equal_interval, quantile, jenks + window.__env.defaultClassifyMethod = "equal_interval"; + + // array of indicator name substring that shal be used to filter out / hide certain indicators by their name + // e.g. set ["entwicklung"] to hide all indicators whose name contains the substring "entwicklung" + window.__env.arrayOfNameSubstringsForHidingIndicators = []; + // window.__env.arrayOfNameSubstringsForHidingIndicators = []; + + window.__env.arrayOfNameSubstringsForHidingGeoresources = []; + + // e-mail recipient for feedback mail + window.__env.feedbackMailRecipient = "christian.danowski-buhren@hochschule-bochum.de"; + // window.__env.feedbackMailRecipient = "christian.danowski-buhren@hs-bochum.de"; + + // config array of available options for choosing update interval of indicators + window.__env.updateIntervalOptions = [ + { + displayName: "jährlich", + apiName: "YEARLY" + }, + { + displayName: "halbjährlich", + apiName: "HALF_YEARLY" + }, + { + displayName: "vierteljährlich", + apiName: "QUARTERLY" + }, + { + displayName: "monatlich", + apiName: "MONTHLY" + }, + { + displayName: "wöchentlich", + apiName: "WEEKLY" + }, + { + displayName: "täglich", + apiName: "DAILY" + }, + { + displayName: "beliebig", + apiName: "ARBITRARY" + } + ]; + + // config array of available options for choosing creation type of indicators + window.__env.indicatorCreationTypeOptions = [ + { + displayName: "manuell", + apiName: "INSERTION" + }, + { + displayName: "automatisierte Berechnung durch KomMonitor", + apiName: "COMPUTATION" + } + ]; + + // config array of available options for choosing indicator's unit + window.__env.indicatorUnitOptions = [ "Anzahl", "Anteil", "Prozent", "Einwohner", "m", "m²", "km", "km²", "ha", "dimensionslos", "standardisiert", "z-transformierte Werte" + ]; + + // config array of available options for choosing indicator type of indicators + window.__env.indicatorTypeOptions = [ + { + displayName: "Status-Indikator (absolut)", + apiName: "STATUS_ABSOLUTE" + }, + { + displayName: "Status-Indikator (relativ)", + apiName: "STATUS_RELATIVE" + }, + { + displayName: "Dynamik-Indikator (absolut)", + apiName: "DYNAMIC_ABSOLUTE" + }, + { + displayName: "Dynamik-Indikator (relativ)", + apiName: "DYNAMIC_RELATIVE" + }, + { + displayName: "Status-Indikator (standardisiert)", + apiName: "STATUS_STANDARDIZED" + }, + { + displayName: "Dynamik-Indikator (standardisiert)", + apiName: "DYNAMIC_STANDARDIZED" + } + + ]; + + // array of available WMS datasets + window.__env.wmsDatasets = [ + // { + // title: "Title of WMS dataset", + // description: "Description as HTML code (HTML tags allowed)", + // url: "URL including '?' as last character (i.e. https://wms.example/myWMS)", + // topicReference: "3af3b65e-4792-4998-8531-54616564b5bc", // id of georesource topic to hang in the WMS entry + // layerName:"laerm" // name of WMS layer to display + // }, + { + title: "Lärmkartierung - Test", + description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", + url: "https://www.wms.nrw.de/umwelt/laerm?", + topicReference: "3af3b65e-4792-4998-8531-54616564b5bc", + layerName:"laerm" + }, + { + title: "Unfalldaten 2019", + description: "Unfalldaten des statistischen Bundesamtes", + url: "https://www.wms.nrw.de/wms/unfallatlas?", + topicReference: "7255b83f-feb0-4f01-9dc1-6b355447206d", + layerName:"Unfallorte_2019" + }, + { + title: "Lärmkartierung - Flugverkehr 24h-Pegel LDEN", + description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", + url: "https://www.wms.nrw.de/umwelt/laerm?", + topicReference: "e94c8100-3790-4ddd-b977-fe48b4f93e26", + layerName: "FLG_DEN" + }, + { + title: "Lärmkartierung - Flugverkehr Nachtpegel LNight", + description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", + url: "https://www.wms.nrw.de/umwelt/laerm?", + topicReference: "e94c8100-3790-4ddd-b977-fe48b4f93e26", + layerName: "FLG_NGT" + }, + { + title: "Lärmkartierung - Industrie 24h-Pegel LDEN", + description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", + url: "https://www.wms.nrw.de/umwelt/laerm?", + topicReference: "e94c8100-3790-4ddd-b977-fe48b4f93e26", + layerName: "IND_DEN" + }, + { + title: "Lärmkartierung - Industrie Nachtpegel LNight", + description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", + url: "https://www.wms.nrw.de/umwelt/laerm?", + topicReference: "e94c8100-3790-4ddd-b977-fe48b4f93e26", + layerName: "IND_NGT" + }, + { + title: "Lärmkartierung - Straße 24h-Pegel LDEN", + description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", + url: "https://www.wms.nrw.de/umwelt/laerm?", + topicReference: "e94c8100-3790-4ddd-b977-fe48b4f93e26", + layerName: "STR_DEN" + }, + { + title: "Lärmkartierung - Straße Nachtpegel LNight", + description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", + url: "https://www.wms.nrw.de/umwelt/laerm?", + topicReference: "e94c8100-3790-4ddd-b977-fe48b4f93e26", + layerName: "STR_NGT" + }, + { + title: "Lärmkartierung - Schiene sonstige 24h-Pegel LDEN", + description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", + url: "https://www.wms.nrw.de/umwelt/laerm?", + topicReference: "e94c8100-3790-4ddd-b977-fe48b4f93e26", + layerName: "SCS_DEN" + }, + { + title: "Lärmkartierung - Schiene sonstige Nachtpegel LNight", + description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", + url: "https://www.wms.nrw.de/umwelt/laerm?", + topicReference: "e94c8100-3790-4ddd-b977-fe48b4f93e26", + layerName: "SCS_NGT" + }, + { + title: "Lärmkartierung - Schiene Bund 24h-Pegel LDEN", + description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", + url: "https://www.wms.nrw.de/umwelt/laerm?", + topicReference: "e94c8100-3790-4ddd-b977-fe48b4f93e26", + layerName: "SCB_DEN" + }, + { + title: "Lärmkartierung - Schiene Bund Nachtpegel LNight", + description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", + url: "https://www.wms.nrw.de/umwelt/laerm?", + topicReference: "e94c8100-3790-4ddd-b977-fe48b4f93e26", + layerName: "SCB_NGT" + }, + // { + // title: "Lärmkartierung - Gebaeude", + // description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", + // url: "https://www.wms.nrw.de/umwelt/laerm?", + // layerName: "Gebaeude" + // }, + // { + // title: "Lärmkartierung - Modell", + // description: "Veröffentlichung der Lärmkarten gemäß Lärmkartierung nach Richtlinie 2002/49/EG - EU-Umgebungslärmrichtlinie

        Maßstabsabhängige Darstellung - ggf. zoomen erforderlich", + // url: "https://www.wms.nrw.de/umwelt/laerm?", + // layerName: "Modell" + // }, + { + title: "Versiegelungsgrad - 2006 anhand von Copernicus Satellitendaten - 20m Rasterzellen", + description: "Mehr Informationen unter https://land.copernicus.eu/pan-european/high-resolution-layers/imperviousness", + url: "https://image.discomap.eea.europa.eu/arcgis/services/GioLandPublic/HRL_ImperviousnessDensity_2006/MapServer/WMSServer?", + topicReference: "c46ecf8b-3f77-4be6-9ec1-851dc48e3eb8", + layerName: "0" + }, + { + title: "Versiegelungsgrad - 2009 anhand von Copernicus Satellitendaten - 20m Rasterzellen", + description: "Mehr Informationen unter https://land.copernicus.eu/pan-european/high-resolution-layers/imperviousness", + url: "https://image.discomap.eea.europa.eu/arcgis/services/GioLandPublic/HRL_ImperviousnessDensity_2009/MapServer/WMSServer?", + topicReference: "c46ecf8b-3f77-4be6-9ec1-851dc48e3eb8", + layerName: "0" + }, + { + title: "Versiegelungsgrad - 2012 anhand von Copernicus Satellitendaten - 20m Rasterzellen", + description: "Mehr Informationen unter https://land.copernicus.eu/pan-european/high-resolution-layers/imperviousness", + url: "https://image.discomap.eea.europa.eu/arcgis/services/GioLandPublic/HRL_Imperviousness_Density_2012/MapServer/WMSServer?", + topicReference: "c46ecf8b-3f77-4be6-9ec1-851dc48e3eb8", + layerName: "Imperviousness density 2012 20m" + }, + { + title: "Versiegelungsgrad - 2015 anhand von Copernicus Satellitendaten - 20m Rasterzellen", + description: "Mehr Informationen unter https://land.copernicus.eu/pan-european/high-resolution-layers/imperviousness", + url: "https://image.discomap.eea.europa.eu/arcgis/services/GioLandPublic/HRL_ImperviousnessDensity_2015/MapServer/WMSServer?", + topicReference: "c46ecf8b-3f77-4be6-9ec1-851dc48e3eb8", + layerName: "0" + }, + { + title: "Versiegelungsgrad - Veränderung 2006-2009 anhand von Copernicus Satellitendaten - 20m Rasterzellen", + description: "Mehr Informationen unter https://land.copernicus.eu/pan-european/high-resolution-layers/imperviousness", + url: "https://image.discomap.eea.europa.eu/arcgis/services/GioLandPublic/HRL_ImperviousnessChange_06_09/MapServer/WMSServer?", + topicReference: "c46ecf8b-3f77-4be6-9ec1-851dc48e3eb8", + layerName: "0" + }, + { + title: "Versiegelungsgrad - Veränderung 2009-2012 anhand von Copernicus Satellitendaten - 20m Rasterzellen", + description: "Mehr Informationen unter https://land.copernicus.eu/pan-european/high-resolution-layers/imperviousness", + url: "https://image.discomap.eea.europa.eu/arcgis/services/GioLandPublic/HRL_ImperviousnessChange_09_12/MapServer/WMSServer?", + topicReference: "c46ecf8b-3f77-4be6-9ec1-851dc48e3eb8", + layerName: "Imperviousness density change 09-12 20m" + }, + { + title: "Versiegelungsgrad - Veränderung 2012-2015 anhand von Copernicus Satellitendaten - 20m Rasterzellen", + description: "Mehr Informationen unter https://land.copernicus.eu/pan-european/high-resolution-layers/imperviousness", + url: "https://image.discomap.eea.europa.eu/arcgis/services/GioLandPublic/HRL_ImperviousnessChange_12_15/MapServer/WMSServer?", + topicReference: "c46ecf8b-3f77-4be6-9ec1-851dc48e3eb8", + layerName: "0" + }, + { + title: "Versiegelungsgrad - Klassifizierte Veränderung 2006-2009 anhand von Copernicus Satellitendaten - 20m Rasterzellen", + description: "Mehr Informationen unter https://land.copernicus.eu/pan-european/high-resolution-layers/imperviousness", + url: "https://image.discomap.eea.europa.eu/arcgis/services/GioLandPublic/HRL_ImperviousnessClassifiedChange_06_09/MapServer/WMSServer?", + topicReference: "c46ecf8b-3f77-4be6-9ec1-851dc48e3eb8", + layerName: "0" + }, + { + title: "Versiegelungsgrad - Klassifizierte Veränderung 2009-2012 anhand von Copernicus Satellitendaten - 20m Rasterzellen", + description: "Mehr Informationen unter https://land.copernicus.eu/pan-european/high-resolution-layers/imperviousness", + url: "https://image.discomap.eea.europa.eu/arcgis/services/GioLandPublic/HRL_ImperviousnessClassifiedChange_09_12/MapServer/WMSServer?", + topicReference: "c46ecf8b-3f77-4be6-9ec1-851dc48e3eb8", + layerName: "0" + }, + { + title: "Versiegelungsgrad - Klassifizierte Veränderung 2012-2015 anhand von Copernicus Satellitendaten - 20m Rasterzellen", + description: "Mehr Informationen unter https://land.copernicus.eu/pan-european/high-resolution-layers/imperviousness", + url: "https://image.discomap.eea.europa.eu/arcgis/services/GioLandPublic/HRL_ImperviousnessChange_12_15/MapServer/WMSServer?", + topicReference: "c46ecf8b-3f77-4be6-9ec1-851dc48e3eb8", + layerName: "0" + }, + { + title: "Bodennutzung - Bebauungsplanumringe", + description: "Umringe der Bebauungspläne gemäß geodaten.metropoleruhr.de", + url: "https://geodaten.metropoleruhr.de/inspire/bodennutzung/metropoleruhr?", + topicReference: null, + layerName: "bplan" + } + ]; + + // array if available WFS datasets + window.__env.wfsDatasets = [ + // { + // title: "Title of dataset", + // description: "Description as HTML code (HTML tags allowed)", + // url: "URL of dataset including '?' as last character (i.e. https://wfs.example/myWfS?)", + // featureTypeNamespace: "namespace of featureType", + // featureTypeName: "name of featureType", // // check GetCapabilities Response + // featureTypeGeometryName: "name of geometry property of feature type", // check DescribeFeature Response + // geometryType: "AOI", // POI|LOI|AOI + // poiSymbolColor: "white", // ['white', 'red', 'orange', 'beige', 'green', 'blue', 'purple', 'pink', 'gray', 'black'] + // poiMarkerColor: "red", // ['white', 'red', 'orange', 'beige', 'green', 'blue', 'purple', 'pink', 'gray', 'black'] + // poiSymbolBootstrap3Name: "home", + // loiColor: "#00aabb", // color for LOI datasets + // loiWidth: 3, // 1 - 5 + // loiDashArrayString: "", // e.g. "20, 20" for equal dash/space visuals + // aoiColor: "#00aabb", // color for AOI datasets + // filterFeaturesToMapBBOX: false, // applies BBOX filter to WFS request - if not supported by WFS may lead to error + // filterEncoding: { // only one filter is currently implemented (PropertyIsEqualTo) + // // PropertyIsEqualTo: { + // // propertyName: undefined, // name of property + // // propertyValue: undefined // value of property + // // } + // }, + // topicReference: "c712af89-ff11-40ff-ad84-b3592901e085" // id of georesource topic entry which shall be used to display the WFS dataset entry + // }, + { + title: "Bodennutzung - Bebauungsplanumringe", + description: "Umringe der Bebauungspläne gemäß geodaten.metropoleruhr.de. WFS-Dienst unterstützt keine räumllichen Filter. Daher müssen zwingend alle Features abgerufen werden.", + url: "https://geodaten.metropoleruhr.de/inspire/bodennutzung/metropoleruhr?", + featureTypeNamespace: "ms", + featureTypeName: "bplan_stand", + featureTypeGeometryName: "geom", + geometryType: "AOI", // POI|LOI|AOI + poiSymbolColor: "white", // ['white', 'red', 'orange', 'beige', 'green', 'blue', 'purple', 'pink', 'gray', 'black'] + poiMarkerColor: "red", // ['white', 'red', 'orange', 'beige', 'green', 'blue', 'purple', 'pink', 'gray', 'black'] + poiSymbolBootstrap3Name: "home", + loiColor: "#00aabb", + loiWidth: 3, + loiDashArrayString: "", + aoiColor: "#00aabb", + filterFeaturesToMapBBOX: false, + filterEncoding: { + // PropertyIsEqualTo: { + // propertyName: undefined, + // propertyValue: undefined + // } + }, + topicReference: "c712af89-ff11-40ff-ad84-b3592901e085" + } + ]; + +} catch (error) { + console.error("Error while evaluating app config. Error is: \n" + error); +} \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_georesource_miscStatistics.js b/app/kommonitor-script-resources/km_georesource_miscStatistics.js index 0e16c2f12..c7576431c 100644 --- a/app/kommonitor-script-resources/km_georesource_miscStatistics.js +++ b/app/kommonitor-script-resources/km_georesource_miscStatistics.js @@ -1,21 +1,18 @@ +"use strict"; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // NECESSARY NODE MODULE DEPENDENCIES // // // // // SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * Module that contains various helper methods (spatial GIS functions and statistical functions) * to simplify script writing */ const KmHelper = require("kmhelper"); - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // CONSTANTS DEFINITION // // here you may specify custom CONSTANTS used within the script. // // // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * This constant specifies allowed values to determine how the aggregation process will deal with indicator values. * I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. @@ -25,7 +22,6 @@ const KmHelper = require("kmhelper"); * @constant */ const aggregationTypeEnum = ["SUM", "AVERAGE"]; - /** * via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. * Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option @@ -37,7 +33,6 @@ const aggregationType = "SUM"; const computationGeoresourceId_name = "compGeoId"; const computationProperty_name = "compProp"; const computationMethod_name = "compMeth"; - /** * This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined * as method parameters that can be used within the method body. @@ -55,74 +50,62 @@ const computationMethod_name = "compMeth"; * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ - // compute indicator for targetDate and targetSpatialUnitFeatures - - // retrieve required georesource using its meaningful name - var computationGeoresourceId = KmHelper.getProcessParameterByName_asString(computationGeoresourceId_name, processParameters); - var computationGeoresource = KmHelper.getGeoresourceById(computationGeoresourceId, georesourcesMap); - var computationProperty = KmHelper.getProcessParameterByName_asString(computationProperty_name, processParameters); - var computationMethod = KmHelper.getProcessParameterByName_asString(computationMethod_name, processParameters); - - // create a clone in order to enable object manipulation such as deletion of features without deleting in origin dataset - computationGeoresource = JSON.parse(JSON.stringify(computationGeoresource)); - -KmHelper.log("calculating spatial within check between points and target spatial unit."); - -// create progress log after each 10th percent of features -var logProgressIndexSeparator = Math.round(targetSpatialUnit_geoJSON.features.length / 100 * 10); - - for (var featureIndex=0; featureIndex < targetSpatialUnit_geoJSON.features.length; featureIndex++){ - var spatialUnitFeat = targetSpatialUnit_geoJSON.features[featureIndex]; - // initialize indicatorValue - KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, 0); - - var pointsWithinFeature = KmHelper.pointsWithinPolygon(computationGeoresource, spatialUnitFeat); - if(pointsWithinFeature && pointsWithinFeature.features && pointsWithinFeature.features.length > 0){ - var valueArray = KmHelper.getPropertyValueArray(pointsWithinFeature, computationProperty); - - // make sure that each value of valueArray is numeric! - for (var k=0; k < valueArray.length; k++){ - valueArray[k] = Number(valueArray[k]); - } - switch (computationMethod) { - case ("SUM"): - KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, KmHelper.sum(valueArray)); - break; - case ("MIN"): - KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, KmHelper.min(valueArray)); - break; - case ("MAX"): - KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, KmHelper.max(valueArray)); - break; - case ("MEAN"): - KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, KmHelper.mean(valueArray)); - break; - case ("MEDIAN"): - KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, KmHelper.median(valueArray)); - break; - case ("STANDARD_DEVIATION"): - KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, KmHelper.standardDeviation(valueArray)); - break; - default: - KmHelper.log("Indicator was not computed from computation resources because no valid computation method was chosen. Indicator value is set to null."); - KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, null); - break; - } - } - - if(featureIndex % logProgressIndexSeparator === 0){ - KmHelper.log("PROGRESS: Compared '" + featureIndex + "' of total '" + targetSpatialUnit_geoJSON.features.length + "' spatial units to point features."); - } +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters) { + // compute indicator for targetDate and targetSpatialUnitFeatures + // retrieve required georesource using its meaningful name + var computationGeoresourceId = KmHelper.getProcessParameterByName_asString(computationGeoresourceId_name, processParameters); + var computationGeoresource = KmHelper.getGeoresourceById(computationGeoresourceId, georesourcesMap); + var computationProperty = KmHelper.getProcessParameterByName_asString(computationProperty_name, processParameters); + var computationMethod = KmHelper.getProcessParameterByName_asString(computationMethod_name, processParameters); + // create a clone in order to enable object manipulation such as deletion of features without deleting in origin dataset + computationGeoresource = JSON.parse(JSON.stringify(computationGeoresource)); + KmHelper.log("calculating spatial within check between points and target spatial unit."); + // create progress log after each 10th percent of features + var logProgressIndexSeparator = Math.round(targetSpatialUnit_geoJSON.features.length / 100 * 10); + for (var featureIndex = 0; featureIndex < targetSpatialUnit_geoJSON.features.length; featureIndex++) { + var spatialUnitFeat = targetSpatialUnit_geoJSON.features[featureIndex]; + // initialize indicatorValue + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, 0); + var pointsWithinFeature = KmHelper.pointsWithinPolygon(computationGeoresource, spatialUnitFeat); + if (pointsWithinFeature && pointsWithinFeature.features && pointsWithinFeature.features.length > 0) { + var valueArray = KmHelper.getPropertyValueArray(pointsWithinFeature, computationProperty); + // make sure that each value of valueArray is numeric! + for (var k = 0; k < valueArray.length; k++) { + valueArray[k] = Number(valueArray[k]); + } + switch (computationMethod) { + case ("SUM"): + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, KmHelper.sum(valueArray)); + break; + case ("MIN"): + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, KmHelper.min(valueArray)); + break; + case ("MAX"): + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, KmHelper.max(valueArray)); + break; + case ("MEAN"): + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, KmHelper.mean(valueArray)); + break; + case ("MEDIAN"): + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, KmHelper.median(valueArray)); + break; + case ("STANDARD_DEVIATION"): + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, KmHelper.standardDeviation(valueArray)); + break; + default: + KmHelper.log("Indicator was not computed from computation resources because no valid computation method was chosen. Indicator value is set to null."); + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, null); + break; + } + } + if (featureIndex % logProgressIndexSeparator === 0) { + KmHelper.log("PROGRESS: Compared '" + featureIndex + "' of total '" + targetSpatialUnit_geoJSON.features.length + "' spatial units to point features."); + } } - - KmHelper.log("Computation of indicator finished"); - - return targetSpatialUnit_geoJSON; -}; - - - + KmHelper.log("Computation of indicator finished"); + return targetSpatialUnit_geoJSON; +} +; /** * This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). * The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. @@ -138,22 +121,22 @@ var logProgressIndexSeparator = Math.round(targetSpatialUnit_geoJSON.features.le * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - if (!aggregationTypeEnum.includes(aggregationType)){ - console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + - "'. Allowed values are: " + aggregationTypeEnum); - console.log("Will fallback to using AVERAGE aggregation logic."); - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else if(aggregationType === "SUM"){ - return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else { - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } -}; - +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)) { + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if (aggregationType === "SUM") { + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +} +; /** * This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). * @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! @@ -164,12 +147,10 @@ function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geo * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // disaggregate indicator - -}; - - +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // disaggregate indicator +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. @@ -183,74 +164,60 @@ function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check to aggregate - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var baseIndicatorTotalWeight = 0; - var featureCounter = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - featureCounter++; - - // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number - if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ - // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method - // it "survives" until this aggregation logic within processing engine - var weight = KmHelper.getAggregationWeight(indicatorFeature); - - // use weight as weight for indicator value - baseIndicatorTotalWeight += weight; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; - } - } - } - - // compute average for share - if(baseIndicatorTotalWeight === 0){ - targetFeature.properties[targetDate] = Number.NaN; +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; } - else { - targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if (!Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined) { + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + // compute average for share + if (baseIndicatorTotalWeight === 0) { + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + KmHelper.log("Aggregation finished"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); } - // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); - }); - - KmHelper.log("Aggregation finished"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - + return targetSpatialUnit_geoJSON; +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} @@ -264,59 +231,47 @@ function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - var totalAggregatedIndicatorFeatures = 0; - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check for aggregation - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var numberOfIndicatorFeaturesWithinTargetFeature = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - numberOfIndicatorFeaturesWithinTargetFeature++; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); - } - } - totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; - }); - - KmHelper.log("Aggregation finished"); - KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - - +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + var totalAggregatedIndicatorFeatures = 0; + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; + } + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + return targetSpatialUnit_geoJSON; +} +; module.exports.computeIndicator = computeIndicator; module.exports.aggregateIndicator = aggregateIndicator; module.exports.disaggregateIndicator = disaggregateIndicator; +//# sourceMappingURL=km_georesource_miscStatistics.js.map \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_georesource_miscStatistics.js.map b/app/kommonitor-script-resources/km_georesource_miscStatistics.js.map new file mode 100644 index 000000000..b1cd769fc --- /dev/null +++ b/app/kommonitor-script-resources/km_georesource_miscStatistics.js.map @@ -0,0 +1 @@ +{"version":3,"file":"km_geores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MAAM,GAAG,CAAC,EAAC;QAC9B,OAAO,CAAC,KAAK,CAAC,mDAAmD,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAC9F,MAAM,KAAK,CAAC,6DAA6D,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;KACvG;IAED,OAAO,yBAAyB,CAAC;AACnC,CAAC;AAAA,CAAC;AAGF,MAAM,CAAC,OAAO,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;AACnD,MAAM,CAAC,OAAO,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;AACvD,MAAM,CAAC,OAAO,CAAC,qBAAqB,GAAG,qBAAqB,CAAC"} \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_georesource_miscStatistics.ts b/app/kommonitor-script-resources/km_georesource_miscStatistics.ts new file mode 100644 index 000000000..0e16c2f12 --- /dev/null +++ b/app/kommonitor-script-resources/km_georesource_miscStatistics.ts @@ -0,0 +1,322 @@ +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// NECESSARY NODE MODULE DEPENDENCIES // // +// // +// SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* Module that contains various helper methods (spatial GIS functions and statistical functions) +* to simplify script writing +*/ +const KmHelper = require("kmhelper"); + + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// CONSTANTS DEFINITION // +// here you may specify custom CONSTANTS used within the script. // // // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* This constant specifies allowed values to determine how the aggregation process will deal with indicator values. +* I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. +* Note that these values must not be changed by users! +* @type {Array.} +* @memberof CONSTANTS +* @constant +*/ +const aggregationTypeEnum = ["SUM", "AVERAGE"]; + +/** +* via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. +* Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option +* @type {string} +* @memberof CONSTANTS +* @constant +*/ +const aggregationType = "SUM"; +const computationGeoresourceId_name = "compGeoId"; +const computationProperty_name = "compProp"; +const computationMethod_name = "compMeth"; + +/** +* This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined +* as method parameters that can be used within the method body. +* +* NOTE: The function is async, so users may make use of keyword "await" to wait for results of other async helper API methods. +* (This is necessary when users want to wait for asynchronous method execution such as external API calls in a synchronous program) +* +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit as GeoJSON FeatureCollection object. +* @param {map.>} baseIndicatorsMap - Map containing all indicators, wheres key='meaningful name or id of the indicator' and value='indicator as GeoJSON object' (it contains duplicate entries, one for the indicator name and one for the indicator id) +* @param {map.>} georesourcesMap - Map containing all georesources, wheres key='meaningful name or id of the georesource' and value='georesource as GeoJSON object' (they are used to execute geometric/toptologic computations) (it contains duplicate entries, one for the georesource name and one for the georesource id) +* @param {Array.>} processParameters - an array containing objects representing variable additional process parameters that are required to perform the indicator computation. +* Each entry has properties Object.name and Object.value for name and value of the parameter. +* @returns {FeatureCollection} the computed indicator for submitted {@linkcode targetSpatialUnit_geoJSON} features as GeoJSON FeatureCollection +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ + // compute indicator for targetDate and targetSpatialUnitFeatures + + // retrieve required georesource using its meaningful name + var computationGeoresourceId = KmHelper.getProcessParameterByName_asString(computationGeoresourceId_name, processParameters); + var computationGeoresource = KmHelper.getGeoresourceById(computationGeoresourceId, georesourcesMap); + var computationProperty = KmHelper.getProcessParameterByName_asString(computationProperty_name, processParameters); + var computationMethod = KmHelper.getProcessParameterByName_asString(computationMethod_name, processParameters); + + // create a clone in order to enable object manipulation such as deletion of features without deleting in origin dataset + computationGeoresource = JSON.parse(JSON.stringify(computationGeoresource)); + +KmHelper.log("calculating spatial within check between points and target spatial unit."); + +// create progress log after each 10th percent of features +var logProgressIndexSeparator = Math.round(targetSpatialUnit_geoJSON.features.length / 100 * 10); + + for (var featureIndex=0; featureIndex < targetSpatialUnit_geoJSON.features.length; featureIndex++){ + var spatialUnitFeat = targetSpatialUnit_geoJSON.features[featureIndex]; + // initialize indicatorValue + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, 0); + + var pointsWithinFeature = KmHelper.pointsWithinPolygon(computationGeoresource, spatialUnitFeat); + if(pointsWithinFeature && pointsWithinFeature.features && pointsWithinFeature.features.length > 0){ + var valueArray = KmHelper.getPropertyValueArray(pointsWithinFeature, computationProperty); + + // make sure that each value of valueArray is numeric! + for (var k=0; k < valueArray.length; k++){ + valueArray[k] = Number(valueArray[k]); + } + switch (computationMethod) { + case ("SUM"): + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, KmHelper.sum(valueArray)); + break; + case ("MIN"): + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, KmHelper.min(valueArray)); + break; + case ("MAX"): + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, KmHelper.max(valueArray)); + break; + case ("MEAN"): + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, KmHelper.mean(valueArray)); + break; + case ("MEDIAN"): + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, KmHelper.median(valueArray)); + break; + case ("STANDARD_DEVIATION"): + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, KmHelper.standardDeviation(valueArray)); + break; + default: + KmHelper.log("Indicator was not computed from computation resources because no valid computation method was chosen. Indicator value is set to null."); + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, null); + break; + } + } + + if(featureIndex % logProgressIndexSeparator === 0){ + KmHelper.log("PROGRESS: Compared '" + featureIndex + "' of total '" + targetSpatialUnit_geoJSON.features.length + "' spatial units to point features."); + } + } + + KmHelper.log("Computation of indicator finished"); + + return targetSpatialUnit_geoJSON; +}; + + + +/** +* This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). +* The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. +* The aggrgation internally aggregates features of {@linkcode indicator_geoJSON} to features of {@linkcode targetSpatialUnit_geoJSON} by comparing their geometries. +* Each {@linkcode indicator_geoJSON} feature whose geometry lies within a certain geometry of a {@linkcode targetSpatialUnit_geoJSON} feature will be used to compute the aggregated indicator values. +* The within comparison is executed by method {@linkcode within_usingBBOX}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be aggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter targetSpatialUnit_geoJSON +* @see aggregationType +* @see within_usingBBOX +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the aggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)){ + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if(aggregationType === "SUM"){ + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +}; + +/** +* This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). +* @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be disaggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be disaggregated to the features of parameter targetSpatialUnit_geoJSON +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the disaggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // disaggregate indicator + +}; + + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. +* Also it uses the {@linkcode KmHelper.getAggregationWeight(feature)} method as weight during aggregtion. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + + // compute average for share + if(baseIndicatorTotalWeight === 0){ + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + + KmHelper.log("Aggregation finished"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} +* to determine which features of {@linkcode indicator_geoJSON} can be aggregated to which features of {@linkcode targetSpatialUnit_geoJSON}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + var totalAggregatedIndicatorFeatures = 0; + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + + +module.exports.computeIndicator = computeIndicator; +module.exports.aggregateIndicator = aggregateIndicator; +module.exports.disaggregateIndicator = disaggregateIndicator; diff --git a/app/kommonitor-script-resources/km_georesource_share_byPropertyValue.js b/app/kommonitor-script-resources/km_georesource_share_byPropertyValue.js index 71188f804..83e02d0aa 100644 --- a/app/kommonitor-script-resources/km_georesource_share_byPropertyValue.js +++ b/app/kommonitor-script-resources/km_georesource_share_byPropertyValue.js @@ -1,21 +1,18 @@ +"use strict"; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // NECESSARY NODE MODULE DEPENDENCIES // // // // // SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * Module that contains various helper methods (spatial GIS functions and statistical functions) * to simplify script writing */ const KmHelper = require("kmhelper"); - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // CONSTANTS DEFINITION // // here you may specify custom CONSTANTS used within the script. // // // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * This constant specifies allowed values to determine how the aggregation process will deal with indicator values. * I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. @@ -25,7 +22,6 @@ const KmHelper = require("kmhelper"); * @constant */ const aggregationTypeEnum = ["SUM", "AVERAGE"]; - /** * via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. * Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option @@ -37,8 +33,6 @@ const aggregationType = "SUM"; const computationFilterProperty_name = "compFilterProp"; const computationFilterOperator_name = "compFilterOperator"; const computationFilterPropertyValue_name = "compFilterPropVal"; - - /** * This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined * as method parameters that can be used within the method body. @@ -56,109 +50,97 @@ const computationFilterPropertyValue_name = "compFilterPropVal"; * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ - // compute indicator for targetDate and targetSpatialUnitFeatures - var computationGeoresourceId = KmHelper.getProcessParameterByName_asString(computationGeoresourceId_name, processParameters) - // retrieve required baseIndicator using its meaningful name - var computationGeoresource = KmHelper.getGeoresourceById(computationGeoresourceId, georesourcesMap); - // create a clone in order to enable object manipulation such as deletion of features without deleting in origin dataset - computationGeoresource = JSON.parse(JSON.stringify(computationGeoresource)); - // OPTIONAL retrieve a property and a respective property value which are then used to filter the georessource - var computationFilterProperty; - var computationFilterOperator; - var computationFilterPropertyValue; - var parameter = undefined; - - processParameters.forEach(function(property){ - if(property.name === computationFilterProperty_name){ - parameter = property.value; - } - }); - - if(parameter === undefined) { - computationFilterProperty = undefined; - computationFilterOperator = undefined; - computationFilterPropertyValue = undefined; - } - else { - computationFilterProperty = KmHelper.getProcessParameterByName_asString(computationFilterProperty_name, processParameters); - computationFilterOperator = KmHelper.getProcessParameterByName_asString(computationFilterOperator_name, processParameters); - computationFilterPropertyValue = KmHelper.getProcessParameterByName_asString(computationFilterPropertyValue_name, processParameters); - } - - KmHelper.log("calculating spatial within check between points and target spatial unit."); - - - // create progress log after each 10th percent of features - var logProgressIndexSeparator = Math.round(targetSpatialUnit_geoJSON.features.length / 100 * 10); - - for (var featureIndex=0; featureIndex < targetSpatialUnit_geoJSON.features.length; featureIndex++){ - var spatialUnitFeat = targetSpatialUnit_geoJSON.features[featureIndex]; - // initialize indicatorValue - KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, 0); - - var pointsWithinFeature = KmHelper.pointsWithinPolygon(computationGeoresource, spatialUnitFeat); - if(pointsWithinFeature && pointsWithinFeature.features && pointsWithinFeature.features.length > 0){ - if (computationFilterProperty !== undefined) { - var valueArray = KmHelper.getPropertyValueArray(pointsWithinFeature, computationFilterProperty); - var filteredArray = []; - switch (computationFilterOperator) { - case ("Equal"): - filteredArray = valueArray.filter(item => item === computationFilterPropertyValue); - break; - case ("Greater_than"): - filteredArray = valueArray.filter(item => item > computationFilterPropertyValue); - break; - case ("Greater_than_or_equal"): - filteredArray = valueArray.filter(item => item >= computationFilterPropertyValue); - break; - case ("Less_than"): - filteredArray = valueArray.filter(item => item < computationFilterPropertyValue); - break; - case ("Less_than_or_equal"): - filteredArray = valueArray.filter(item => item <= computationFilterPropertyValue); - break; - case ("Unequal"): - filteredArray = valueArray.filter(item => item !== computationFilterPropertyValue); - break; - case ("Contains"): - var computationFilterPropertyValueArray = computationFilterPropertyValue.split(","); - for (let i=0; i item === trimmedElement); - filteredArray = filteredArray.concat(tmp); - } - break; - case ("Range"): - var computationFilterPropertyValueArray = computationFilterPropertyValue.split("-").map(el => parseInt(el)); - filteredArray = valueArray.filter(item => item >= computationFilterPropertyValueArray[0] && item < computationFilterPropertyValueArray[1]); - break; - default: - KmHelper.log("Indicator was not computed from computation resources because no valid filter could be applied. Indicator value is set to null."); - KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, null); - break; - } - var share = filteredArray.length / valueArray.length * 100; - KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, share); - } - else { - KmHelper.log("Indicator was not computed from computation resources because no valid filter has been defined. Indicator value is set to null."); - KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, null); - } - } - - } - - if(featureIndex % logProgressIndexSeparator === 0){ - KmHelper.log("PROGRESS: Compared '" + featureIndex + "' of total '" + targetSpatialUnit_geoJSON.features.length + "' spatial units to point features."); - } +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters) { + // compute indicator for targetDate and targetSpatialUnitFeatures + var computationGeoresourceId = KmHelper.getProcessParameterByName_asString(computationGeoresourceId_name, processParameters); + // retrieve required baseIndicator using its meaningful name + var computationGeoresource = KmHelper.getGeoresourceById(computationGeoresourceId, georesourcesMap); + // create a clone in order to enable object manipulation such as deletion of features without deleting in origin dataset + computationGeoresource = JSON.parse(JSON.stringify(computationGeoresource)); + // OPTIONAL retrieve a property and a respective property value which are then used to filter the georessource + var computationFilterProperty; + var computationFilterOperator; + var computationFilterPropertyValue; + var parameter = undefined; + processParameters.forEach(function (property) { + if (property.name === computationFilterProperty_name) { + parameter = property.value; + } + }); + if (parameter === undefined) { + computationFilterProperty = undefined; + computationFilterOperator = undefined; + computationFilterPropertyValue = undefined; + } + else { + computationFilterProperty = KmHelper.getProcessParameterByName_asString(computationFilterProperty_name, processParameters); + computationFilterOperator = KmHelper.getProcessParameterByName_asString(computationFilterOperator_name, processParameters); + computationFilterPropertyValue = KmHelper.getProcessParameterByName_asString(computationFilterPropertyValue_name, processParameters); + } + KmHelper.log("calculating spatial within check between points and target spatial unit."); + // create progress log after each 10th percent of features + var logProgressIndexSeparator = Math.round(targetSpatialUnit_geoJSON.features.length / 100 * 10); + for (var featureIndex = 0; featureIndex < targetSpatialUnit_geoJSON.features.length; featureIndex++) { + var spatialUnitFeat = targetSpatialUnit_geoJSON.features[featureIndex]; + // initialize indicatorValue + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, 0); + var pointsWithinFeature = KmHelper.pointsWithinPolygon(computationGeoresource, spatialUnitFeat); + if (pointsWithinFeature && pointsWithinFeature.features && pointsWithinFeature.features.length > 0) { + if (computationFilterProperty !== undefined) { + var valueArray = KmHelper.getPropertyValueArray(pointsWithinFeature, computationFilterProperty); + var filteredArray = []; + switch (computationFilterOperator) { + case ("Equal"): + filteredArray = valueArray.filter(item => item === computationFilterPropertyValue); + break; + case ("Greater_than"): + filteredArray = valueArray.filter(item => item > computationFilterPropertyValue); + break; + case ("Greater_than_or_equal"): + filteredArray = valueArray.filter(item => item >= computationFilterPropertyValue); + break; + case ("Less_than"): + filteredArray = valueArray.filter(item => item < computationFilterPropertyValue); + break; + case ("Less_than_or_equal"): + filteredArray = valueArray.filter(item => item <= computationFilterPropertyValue); + break; + case ("Unequal"): + filteredArray = valueArray.filter(item => item !== computationFilterPropertyValue); + break; + case ("Contains"): + var computationFilterPropertyValueArray = computationFilterPropertyValue.split(","); + for (let i = 0; i < computationFilterPropertyValueArray.length; i++) { + let trimmedElement = computationFilterPropertyValueArray[i].trim(); + let tmp = valueArray.filter(item => item === trimmedElement); + filteredArray = filteredArray.concat(tmp); + } + break; + case ("Range"): + var computationFilterPropertyValueArray = computationFilterPropertyValue.split("-").map(el => parseInt(el)); + filteredArray = valueArray.filter(item => item >= computationFilterPropertyValueArray[0] && item < computationFilterPropertyValueArray[1]); + break; + default: + KmHelper.log("Indicator was not computed from computation resources because no valid filter could be applied. Indicator value is set to null."); + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, null); + break; + } + var share = filteredArray.length / valueArray.length * 100; + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, share); + } + else { + KmHelper.log("Indicator was not computed from computation resources because no valid filter has been defined. Indicator value is set to null."); + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, null); + } + } } - - KmHelper.log("Computation of indicator finished"); - - return targetSpatialUnit_geoJSON; -}; - + if (featureIndex % logProgressIndexSeparator === 0) { + KmHelper.log("PROGRESS: Compared '" + featureIndex + "' of total '" + targetSpatialUnit_geoJSON.features.length + "' spatial units to point features."); + } + KmHelper.log("Computation of indicator finished"); + return targetSpatialUnit_geoJSON; +} +; /** * This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). * The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. @@ -174,22 +156,22 @@ async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndic * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - if (!aggregationTypeEnum.includes(aggregationType)){ - console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + - "'. Allowed values are: " + aggregationTypeEnum); - console.log("Will fallback to using AVERAGE aggregation logic."); - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else if(aggregationType === "SUM"){ - return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else { - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } -}; - +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)) { + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if (aggregationType === "SUM") { + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +} +; /** * This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). * @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! @@ -200,12 +182,10 @@ function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geo * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // disaggregate indicator - -}; - - +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // disaggregate indicator +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. @@ -219,74 +199,60 @@ function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check to aggregate - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var baseIndicatorTotalWeight = 0; - var featureCounter = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - featureCounter++; - - // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number - if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ - // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method - // it "survives" until this aggregation logic within processing engine - var weight = KmHelper.getAggregationWeight(indicatorFeature); - - // use weight as weight for indicator value - baseIndicatorTotalWeight += weight; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; - } - } - } - - // compute average for share - if(baseIndicatorTotalWeight === 0){ - targetFeature.properties[targetDate] = Number.NaN; +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; } - else { - targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if (!Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined) { + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + // compute average for share + if (baseIndicatorTotalWeight === 0) { + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + KmHelper.log("Aggregation finished"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); } - // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); - }); - - KmHelper.log("Aggregation finished"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - + return targetSpatialUnit_geoJSON; +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} @@ -300,59 +266,47 @@ function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - var totalAggregatedIndicatorFeatures = 0; - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check for aggregation - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var numberOfIndicatorFeaturesWithinTargetFeature = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - numberOfIndicatorFeaturesWithinTargetFeature++; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); - } - } - totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; - }); - - KmHelper.log("Aggregation finished"); - KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - - +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + var totalAggregatedIndicatorFeatures = 0; + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; + } + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + return targetSpatialUnit_geoJSON; +} +; module.exports.computeIndicator = computeIndicator; module.exports.aggregateIndicator = aggregateIndicator; module.exports.disaggregateIndicator = disaggregateIndicator; +//# sourceMappingURL=km_georesource_share_byPropertyValue.js.map \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_georesource_share_byPropertyValue.js.map b/app/kommonitor-script-resources/km_georesource_share_byPropertyValue.js.map new file mode 100644 index 000000000..57582b968 --- /dev/null +++ b/app/kommonitor-script-resources/km_georesource_share_byPropertyValue.js.map @@ -0,0 +1 @@ +{"version":3,"file":"km_georesource_share_byPropertyValue.js","sourceRoot":"","sources":["km_georesource_share_byPropertyValue.ts"],"names":[],"mappings":";AAAA,8JAA8J;AAC9J,yRAAyR;AACzR,8JAA8J;AAC9J,4GAA4G;AAC5G,8JAA8J;AAE9J;;;EAGE;AACF,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAGrC,8JAA8J;AAC9J,8JAA8J;AAC9J,6OAA6O;AAC7O,8JAA8J;AAE9J;;;;;;;EAOE;AACF,MAAM,mBAAmB,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AAE/C;;;;;;EAME;AACF,MAAM,eAAe,GAAG,KAAK,CAAC;AAC9B,MAAM,8BAA8B,GAAG,gBAAgB,CAAC;AACxD,MAAM,8BAA8B,GAAG,oBAAoB,CAAC;AAC5D,MAAM,mCAAmC,GAAG,mBAAmB,CAAC;AAGhE;;;;;;;;;;;;;;;;EAgBE;AACF,KAAK,UAAU,gBAAgB,CAAC,UAAU,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,eAAe,EAAE,iBAAiB;IAC3H,iEAAiE;IACjE,IAAI,wBAAwB,GAAG,QAAQ,CAAC,kCAAkC,CAAC,6BAA6B,EAAE,iBAAiB,CAAC,CAAA;IAC5H,4DAA4D;IAC5D,IAAI,sBAAsB,GAAG,QAAQ,CAAC,kBAAkB,CAAC,wBAAwB,EAAE,eAAe,CAAC,CAAC;IACpG,wHAAwH;IACxH,sBA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AiB,CAAC,KAAK,CAAC,CAAC;YAC9C,IAAG,QAAQ,CAAC,MAAM,CAAC,gBAAgB,EAAE,aAAa,CAAC,EAAC;gBACrD,wCAAwC;gBACxC,iBAAiB,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;gBAChC,KAAK,EAAE,CAAC;gBACX,4CAA4C,EAAE,CAAC;gBAC/C,aAAa,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,gBAAgB,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;aACxF;SACD;QACA,gCAAgC,IAAI,4CAA4C,CAAC;IACnF,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;IACrC,QAAQ,CAAC,GAAG,CAAC,gCAAgC,GAAG,+BAA+B,GAAG,yBAAyB,CAAC,QAAQ,CAAC,MAAM,GAAG,iBAAiB,CAAC,CAAC;IAEjJ,IAAG,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAC;QAC9B,OAAO,CAAC,KAAK,CAAC,mDAAmD,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAC9F,MAAM,KAAK,CAAC,6DAA6D,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;KACvG;IAED,OAAO,yBAAyB,CAAC;AACnC,CAAC;AAAA,CAAC;AAGF,MAAM,CAAC,OAAO,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;AACnD,MAAM,CAAC,OAAO,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;AACvD,MAAM,CAAC,OAAO,CAAC,qBAAqB,GAAG,qBAAqB,CAAC"} \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_georesource_share_byPropertyValue.ts b/app/kommonitor-script-resources/km_georesource_share_byPropertyValue.ts new file mode 100644 index 000000000..fe2d4a312 --- /dev/null +++ b/app/kommonitor-script-resources/km_georesource_share_byPropertyValue.ts @@ -0,0 +1,358 @@ +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// NECESSARY NODE MODULE DEPENDENCIES // // +// // +// SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* Module that contains various helper methods (spatial GIS functions and statistical functions) +* to simplify script writing +*/ +const KmHelper = require("kmhelper"); + + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// CONSTANTS DEFINITION // +// here you may specify custom CONSTANTS used within the script. // // // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* This constant specifies allowed values to determine how the aggregation process will deal with indicator values. +* I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. +* Note that these values must not be changed by users! +* @type {Array.} +* @memberof CONSTANTS +* @constant +*/ +const aggregationTypeEnum = ["SUM", "AVERAGE"]; + +/** +* via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. +* Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option +* @type {string} +* @memberof CONSTANTS +* @constant +*/ +const aggregationType = "SUM"; +const computationFilterProperty_name = "compFilterProp"; +const computationFilterOperator_name = "compFilterOperator"; +const computationFilterPropertyValue_name = "compFilterPropVal"; + + +/** +* This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined +* as method parameters that can be used within the method body. +* +* NOTE: The function is async, so users may make use of keyword "await" to wait for results of other async helper API methods. +* (This is necessary when users want to wait for asynchronous method execution such as external API calls in a synchronous program) +* +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit as GeoJSON FeatureCollection object. +* @param {map.>} baseIndicatorsMap - Map containing all indicators, wheres key='meaningful name or id of the indicator' and value='indicator as GeoJSON object' (it contains duplicate entries, one for the indicator name and one for the indicator id) +* @param {map.>} georesourcesMap - Map containing all georesources, wheres key='meaningful name or id of the georesource' and value='georesource as GeoJSON object' (they are used to execute geometric/toptologic computations) (it contains duplicate entries, one for the georesource name and one for the georesource id) +* @param {Array.>} processParameters - an array containing objects representing variable additional process parameters that are required to perform the indicator computation. +* Each entry has properties Object.name and Object.value for name and value of the parameter. +* @returns {FeatureCollection} the computed indicator for submitted {@linkcode targetSpatialUnit_geoJSON} features as GeoJSON FeatureCollection +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ + // compute indicator for targetDate and targetSpatialUnitFeatures + var computationGeoresourceId = KmHelper.getProcessParameterByName_asString(computationGeoresourceId_name, processParameters) + // retrieve required baseIndicator using its meaningful name + var computationGeoresource = KmHelper.getGeoresourceById(computationGeoresourceId, georesourcesMap); + // create a clone in order to enable object manipulation such as deletion of features without deleting in origin dataset + computationGeoresource = JSON.parse(JSON.stringify(computationGeoresource)); + // OPTIONAL retrieve a property and a respective property value which are then used to filter the georessource + var computationFilterProperty; + var computationFilterOperator; + var computationFilterPropertyValue; + var parameter = undefined; + + processParameters.forEach(function(property){ + if(property.name === computationFilterProperty_name){ + parameter = property.value; + } + }); + + if(parameter === undefined) { + computationFilterProperty = undefined; + computationFilterOperator = undefined; + computationFilterPropertyValue = undefined; + } + else { + computationFilterProperty = KmHelper.getProcessParameterByName_asString(computationFilterProperty_name, processParameters); + computationFilterOperator = KmHelper.getProcessParameterByName_asString(computationFilterOperator_name, processParameters); + computationFilterPropertyValue = KmHelper.getProcessParameterByName_asString(computationFilterPropertyValue_name, processParameters); + } + + KmHelper.log("calculating spatial within check between points and target spatial unit."); + + + // create progress log after each 10th percent of features + var logProgressIndexSeparator = Math.round(targetSpatialUnit_geoJSON.features.length / 100 * 10); + + for (var featureIndex=0; featureIndex < targetSpatialUnit_geoJSON.features.length; featureIndex++){ + var spatialUnitFeat = targetSpatialUnit_geoJSON.features[featureIndex]; + // initialize indicatorValue + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, 0); + + var pointsWithinFeature = KmHelper.pointsWithinPolygon(computationGeoresource, spatialUnitFeat); + if(pointsWithinFeature && pointsWithinFeature.features && pointsWithinFeature.features.length > 0){ + if (computationFilterProperty !== undefined) { + var valueArray = KmHelper.getPropertyValueArray(pointsWithinFeature, computationFilterProperty); + var filteredArray = []; + switch (computationFilterOperator) { + case ("Equal"): + filteredArray = valueArray.filter(item => item === computationFilterPropertyValue); + break; + case ("Greater_than"): + filteredArray = valueArray.filter(item => item > computationFilterPropertyValue); + break; + case ("Greater_than_or_equal"): + filteredArray = valueArray.filter(item => item >= computationFilterPropertyValue); + break; + case ("Less_than"): + filteredArray = valueArray.filter(item => item < computationFilterPropertyValue); + break; + case ("Less_than_or_equal"): + filteredArray = valueArray.filter(item => item <= computationFilterPropertyValue); + break; + case ("Unequal"): + filteredArray = valueArray.filter(item => item !== computationFilterPropertyValue); + break; + case ("Contains"): + var computationFilterPropertyValueArray = computationFilterPropertyValue.split(","); + for (let i=0; i item === trimmedElement); + filteredArray = filteredArray.concat(tmp); + } + break; + case ("Range"): + var computationFilterPropertyValueArray = computationFilterPropertyValue.split("-").map(el => parseInt(el)); + filteredArray = valueArray.filter(item => item >= computationFilterPropertyValueArray[0] && item < computationFilterPropertyValueArray[1]); + break; + default: + KmHelper.log("Indicator was not computed from computation resources because no valid filter could be applied. Indicator value is set to null."); + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, null); + break; + } + var share = filteredArray.length / valueArray.length * 100; + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, share); + } + else { + KmHelper.log("Indicator was not computed from computation resources because no valid filter has been defined. Indicator value is set to null."); + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, null); + } + } + + + + if(featureIndex % logProgressIndexSeparator === 0){ + KmHelper.log("PROGRESS: Compared '" + featureIndex + "' of total '" + targetSpatialUnit_geoJSON.features.length + "' spatial units to point features."); + } + } + + KmHelper.log("Computation of indicator finished"); + + return targetSpatialUnit_geoJSON; +}; + +/** +* This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). +* The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. +* The aggrgation internally aggregates features of {@linkcode indicator_geoJSON} to features of {@linkcode targetSpatialUnit_geoJSON} by comparing their geometries. +* Each {@linkcode indicator_geoJSON} feature whose geometry lies within a certain geometry of a {@linkcode targetSpatialUnit_geoJSON} feature will be used to compute the aggregated indicator values. +* The within comparison is executed by method {@linkcode within_usingBBOX}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be aggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter targetSpatialUnit_geoJSON +* @see aggregationType +* @see within_usingBBOX +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the aggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)){ + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if(aggregationType === "SUM"){ + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +}; + +/** +* This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). +* @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be disaggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be disaggregated to the features of parameter targetSpatialUnit_geoJSON +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the disaggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // disaggregate indicator + +}; + + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. +* Also it uses the {@linkcode KmHelper.getAggregationWeight(feature)} method as weight during aggregtion. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + + // compute average for share + if(baseIndicatorTotalWeight === 0){ + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + + KmHelper.log("Aggregation finished"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} +* to determine which features of {@linkcode indicator_geoJSON} can be aggregated to which features of {@linkcode targetSpatialUnit_geoJSON}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + var totalAggregatedIndicatorFeatures = 0; + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + + +module.exports.computeIndicator = computeIndicator; +module.exports.aggregateIndicator = aggregateIndicator; +module.exports.disaggregateIndicator = disaggregateIndicator; diff --git a/app/kommonitor-script-resources/km_georessouce_count_pointsWithinPolygon.js b/app/kommonitor-script-resources/km_georessouce_count_pointsWithinPolygon.js index 9c6908178..c676cc9d0 100644 --- a/app/kommonitor-script-resources/km_georessouce_count_pointsWithinPolygon.js +++ b/app/kommonitor-script-resources/km_georessouce_count_pointsWithinPolygon.js @@ -1,21 +1,18 @@ +"use strict"; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // NECESSARY NODE MODULE DEPENDENCIES // // // // // SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * Module that contains various helper methods (spatial GIS functions and statistical functions) * to simplify script writing */ const KmHelper = require("kmhelper"); - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // CONSTANTS DEFINITION // // here you may specify custom CONSTANTS used within the script. // // // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * This constant specifies allowed values to determine how the aggregation process will deal with indicator values. * I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. @@ -25,7 +22,6 @@ const KmHelper = require("kmhelper"); * @constant */ const aggregationTypeEnum = ["SUM", "AVERAGE"]; - /** * via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. * Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option @@ -38,7 +34,6 @@ const computationGeoresourceId_name = "compGeoId"; const computationFilterProperty_name = "compFilterProp"; const computationFilterOperator_name = "compFilterOperator"; const computationFilterPropertyValue_name = "compFilterPropVal"; - /** * This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined * as method parameters that can be used within the method body. @@ -56,104 +51,95 @@ const computationFilterPropertyValue_name = "compFilterPropVal"; * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ - // compute indicator for targetDate and targetSpatialUnitFeatures - var computationGeoresourceId = KmHelper.getProcessParameterByName_asString(computationGeoresourceId_name, processParameters) - // retrieve required baseIndicator using its meaningful name - var computationGeoresource = KmHelper.getGeoresourceById(computationGeoresourceId, georesourcesMap); - // create a clone in order to enable object manipulation such as deletion of features without deleting in origin dataset - computationGeoresource = JSON.parse(JSON.stringify(computationGeoresource)); - // OPTIONAL retrieve a property and a respective property value which are then used to filter the georessource - var computationFilterProperty; - var computationFilterOperator; - var computationFilterPropertyValue; - var parameter = undefined; - - processParameters.forEach(function(property){ - if(property.name === computationFilterProperty_name){ - parameter = property.value; +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters) { + // compute indicator for targetDate and targetSpatialUnitFeatures + var computationGeoresourceId = KmHelper.getProcessParameterByName_asString(computationGeoresourceId_name, processParameters); + // retrieve required baseIndicator using its meaningful name + var computationGeoresource = KmHelper.getGeoresourceById(computationGeoresourceId, georesourcesMap); + // create a clone in order to enable object manipulation such as deletion of features without deleting in origin dataset + computationGeoresource = JSON.parse(JSON.stringify(computationGeoresource)); + // OPTIONAL retrieve a property and a respective property value which are then used to filter the georessource + var computationFilterProperty; + var computationFilterOperator; + var computationFilterPropertyValue; + var parameter = undefined; + processParameters.forEach(function (property) { + if (property.name === computationFilterProperty_name) { + parameter = property.value; + } + }); + if (parameter === undefined) { + computationFilterProperty = undefined; + computationFilterOperator = undefined; + computationFilterPropertyValue = undefined; + } + else { + computationFilterProperty = KmHelper.getProcessParameterByName_asString(computationFilterProperty_name, processParameters); + computationFilterOperator = KmHelper.getProcessParameterByName_asString(computationFilterOperator_name, processParameters); + computationFilterPropertyValue = KmHelper.getProcessParameterByName_asString(computationFilterPropertyValue_name, processParameters); } - }); - - if(parameter === undefined) { - computationFilterProperty = undefined; - computationFilterOperator = undefined; - computationFilterPropertyValue = undefined; - } - else { - computationFilterProperty = KmHelper.getProcessParameterByName_asString(computationFilterProperty_name, processParameters); - computationFilterOperator = KmHelper.getProcessParameterByName_asString(computationFilterOperator_name, processParameters); - computationFilterPropertyValue = KmHelper.getProcessParameterByName_asString(computationFilterPropertyValue_name, processParameters); - } - -KmHelper.log("calculating spatial within check between points and target spatial unit."); - -// create progress log after each 10th percent of features -var logProgressIndexSeparator = Math.round(targetSpatialUnit_geoJSON.features.length / 100 * 10); - - for (var featureIndex=0; featureIndex < targetSpatialUnit_geoJSON.features.length; featureIndex++){ - var spatialUnitFeat = targetSpatialUnit_geoJSON.features[featureIndex]; - // initialize indicatorValue - KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, 0); - - var pointsWithinFeature = KmHelper.pointsWithinPolygon(computationGeoresource, spatialUnitFeat); - if(pointsWithinFeature && pointsWithinFeature.features && pointsWithinFeature.features.length > 0){ - if (computationFilterProperty !== undefined) { - var valueArray = KmHelper.getPropertyValueArray(pointsWithinFeature, computationFilterProperty); - var filteredArray = []; - switch (computationFilterOperator) { - case ("Equal"): - filteredArray = valueArray.filter(item => item === computationFilterPropertyValue); - break; - case ("Greater_than"): - filteredArray = valueArray.filter(item => item > computationFilterPropertyValue); - break; - case ("Greater_than_or_equal"): - filteredArray = valueArray.filter(item => item >= computationFilterPropertyValue); - break; - case ("Less_than"): - filteredArray = valueArray.filter(item => item < computationFilterPropertyValue); - break; - case ("Less_than_or_equal"): - filteredArray = valueArray.filter(item => item <= computationFilterPropertyValue); - break; - case ("Unequal"): - filteredArray = valueArray.filter(item => item !== computationFilterPropertyValue); - break; - case ("Contains"): - var computationFilterPropertyValueArray = computationFilterPropertyValue.split(","); - for (let i=0; i item === trimmedElement); - filteredArray = filteredArray.concat(tmp); - } - break; - case ("Range"): - var computationFilterPropertyValueArray = computationFilterPropertyValue.split("-").map(el => parseInt(el)); - filteredArray = valueArray.filter(item => item >= computationFilterPropertyValueArray[0] && item < computationFilterPropertyValueArray[1]); - break; - default: - KmHelper.log("Indicator was not computed from computation resources because no valid filter could be applied. Indicator value is set to null."); - KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, null); - break; - } - KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, filteredArray.length); + KmHelper.log("calculating spatial within check between points and target spatial unit."); + // create progress log after each 10th percent of features + var logProgressIndexSeparator = Math.round(targetSpatialUnit_geoJSON.features.length / 100 * 10); + for (var featureIndex = 0; featureIndex < targetSpatialUnit_geoJSON.features.length; featureIndex++) { + var spatialUnitFeat = targetSpatialUnit_geoJSON.features[featureIndex]; + // initialize indicatorValue + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, 0); + var pointsWithinFeature = KmHelper.pointsWithinPolygon(computationGeoresource, spatialUnitFeat); + if (pointsWithinFeature && pointsWithinFeature.features && pointsWithinFeature.features.length > 0) { + if (computationFilterProperty !== undefined) { + var valueArray = KmHelper.getPropertyValueArray(pointsWithinFeature, computationFilterProperty); + var filteredArray = []; + switch (computationFilterOperator) { + case ("Equal"): + filteredArray = valueArray.filter(item => item === computationFilterPropertyValue); + break; + case ("Greater_than"): + filteredArray = valueArray.filter(item => item > computationFilterPropertyValue); + break; + case ("Greater_than_or_equal"): + filteredArray = valueArray.filter(item => item >= computationFilterPropertyValue); + break; + case ("Less_than"): + filteredArray = valueArray.filter(item => item < computationFilterPropertyValue); + break; + case ("Less_than_or_equal"): + filteredArray = valueArray.filter(item => item <= computationFilterPropertyValue); + break; + case ("Unequal"): + filteredArray = valueArray.filter(item => item !== computationFilterPropertyValue); + break; + case ("Contains"): + var computationFilterPropertyValueArray = computationFilterPropertyValue.split(","); + for (let i = 0; i < computationFilterPropertyValueArray.length; i++) { + let trimmedElement = computationFilterPropertyValueArray[i].trim(); + let tmp = valueArray.filter(item => item === trimmedElement); + filteredArray = filteredArray.concat(tmp); + } + break; + case ("Range"): + var computationFilterPropertyValueArray = computationFilterPropertyValue.split("-").map(el => parseInt(el)); + filteredArray = valueArray.filter(item => item >= computationFilterPropertyValueArray[0] && item < computationFilterPropertyValueArray[1]); + break; + default: + KmHelper.log("Indicator was not computed from computation resources because no valid filter could be applied. Indicator value is set to null."); + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, null); + break; + } + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, filteredArray.length); + } + else { + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, pointsWithinFeature.features.length); + } + } + if (featureIndex % logProgressIndexSeparator === 0) { + KmHelper.log("PROGRESS: Compared '" + featureIndex + "' of total '" + targetSpatialUnit_geoJSON.features.length + "' spatial units to point features."); } - else { - KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, pointsWithinFeature.features.length); - } - } - - if(featureIndex % logProgressIndexSeparator === 0){ - KmHelper.log("PROGRESS: Compared '" + featureIndex + "' of total '" + targetSpatialUnit_geoJSON.features.length + "' spatial units to point features."); - } } - - KmHelper.log("Computation of indicator finished"); - - return targetSpatialUnit_geoJSON; -}; - + KmHelper.log("Computation of indicator finished"); + return targetSpatialUnit_geoJSON; +} +; /** * This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). * The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. @@ -169,22 +155,22 @@ var logProgressIndexSeparator = Math.round(targetSpatialUnit_geoJSON.features.le * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - if (!aggregationTypeEnum.includes(aggregationType)){ - console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + - "'. Allowed values are: " + aggregationTypeEnum); - console.log("Will fallback to using AVERAGE aggregation logic."); - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else if(aggregationType === "SUM"){ - return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else { - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } -}; - +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)) { + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if (aggregationType === "SUM") { + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +} +; /** * This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). * @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! @@ -195,12 +181,10 @@ function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geo * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // disaggregate indicator - -}; - - +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // disaggregate indicator +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. @@ -214,74 +198,60 @@ function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check to aggregate - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var baseIndicatorTotalWeight = 0; - var featureCounter = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - featureCounter++; - - // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number - if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ - // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method - // it "survives" until this aggregation logic within processing engine - var weight = KmHelper.getAggregationWeight(indicatorFeature); - - // use weight as weight for indicator value - baseIndicatorTotalWeight += weight; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; - } - } - } - - // compute average for share - if(baseIndicatorTotalWeight === 0){ - targetFeature.properties[targetDate] = Number.NaN; +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; } - else { - targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if (!Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined) { + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + // compute average for share + if (baseIndicatorTotalWeight === 0) { + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + KmHelper.log("Aggregation finished"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); } - // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); - }); - - KmHelper.log("Aggregation finished"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - + return targetSpatialUnit_geoJSON; +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} @@ -295,59 +265,47 @@ function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - var totalAggregatedIndicatorFeatures = 0; - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check for aggregation - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var numberOfIndicatorFeaturesWithinTargetFeature = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - numberOfIndicatorFeaturesWithinTargetFeature++; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); - } - } - totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; - }); - - KmHelper.log("Aggregation finished"); - KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - - +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + var totalAggregatedIndicatorFeatures = 0; + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; + } + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + return targetSpatialUnit_geoJSON; +} +; module.exports.computeIndicator = computeIndicator; module.exports.aggregateIndicator = aggregateIndicator; module.exports.disaggregateIndicator = disaggregateIndicator; +//# sourceMappingURL=km_georessouce_count_pointsWithinPolygon.js.map \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_georessouce_count_pointsWithinPolygon.js.map b/app/kommonitor-script-resources/km_georessouce_count_pointsWithinPolygon.js.map new file mode 100644 index 000000000..7f0e6d42d --- /dev/null +++ b/app/kommonitor-script-resources/km_georessouce_count_pointsWithinPolygon.js.map @@ -0,0 +1 @@ +{"version":3,"file":"km_georessouce_count_pointsWithinPolygon.js","sourceRoot":"","sources":["km_georessouce_count_pointsWithinPolygon.ts"],"names":[],"mappings":";AAAA,8JAA8J;AAC9J,yRAAyR;AACzR,8JAA8J;AAC9J,4GAA4G;AAC5G,8JAA8J;AAE9J;;;EAGE;AACF,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAGrC,8JAA8J;AAC9J,8JAA8J;AAC9J,6OAA6O;AAC7O,8JAA8J;AAE9J;;;;;;;EAOE;AACF,MAAM,mBAAmB,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AAE/C;;;;;;EAME;AACF,MAAM,eAAe,GAAG,KAAK,CAAC;AAC9B,MAAM,6BAA6B,GAAG,WAAW,CAAC;AAClD,MAAM,8BAA8B,GAAG,gBAAgB,CAAC;AACxD,MAAM,8BAA8B,GAAG,oBAAoB,CAAC;AAC5D,MAAM,mCAAmC,GAAG,mBAAmB,CAAC;AAEhE;;;;;;;;;;;;;;;;EAgBE;AACF,KAAK,UAAU,gBAAgB,CAAC,UAAU,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,eAAe,EAAE,iBAAiB;IAC1H,iEAAiE;IACjE,IAAI,wBAAwB,GAAG,QAAQ,CAAC,kCAAkC,CAAC,6BAA6B,EAAE,iBAAiB,CAAC,CAAA;IAC5H,4DAA4D;IAC5D,IAAI,sBAAsB,GAAG,QAAQ,CAAC,kBAAkB,CAAC,wBAAwB,EAAE,eAAe,CAAC,CAAC;IACpG,wHAAwH;IACxH,sBAAsB,GAAG,IAAI,CAAC,KAAK,CAAC,IAA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M,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;gBAChC,KAAK,EAAE,CAAC;gBACX,4CAA4C,EAAE,CAAC;gBAC/C,aAAa,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,gBAAgB,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;aACxF;SACD;QACA,gCAAgC,IAAI,4CAA4C,CAAC;IACnF,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;IACrC,QAAQ,CAAC,GAAG,CAAC,gCAAgC,GAAG,+BAA+B,GAAG,yBAAyB,CAAC,QAAQ,CAAC,MAAM,GAAG,iBAAiB,CAAC,CAAC;IAEjJ,IAAG,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAC;QAC9B,OAAO,CAAC,KAAK,CAAC,mDAAmD,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAC9F,MAAM,KAAK,CAAC,6DAA6D,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;KACvG;IAED,OAAO,yBAAyB,CAAC;AACnC,CAAC;AAAA,CAAC;AAGF,MAAM,CAAC,OAAO,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;AACnD,MAAM,CAAC,OAAO,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;AACvD,MAAM,CAAC,OAAO,CAAC,qBAAqB,GAAG,qBAAqB,CAAC"} \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_georessouce_count_pointsWithinPolygon.ts b/app/kommonitor-script-resources/km_georessouce_count_pointsWithinPolygon.ts new file mode 100644 index 000000000..9c6908178 --- /dev/null +++ b/app/kommonitor-script-resources/km_georessouce_count_pointsWithinPolygon.ts @@ -0,0 +1,353 @@ +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// NECESSARY NODE MODULE DEPENDENCIES // // +// // +// SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* Module that contains various helper methods (spatial GIS functions and statistical functions) +* to simplify script writing +*/ +const KmHelper = require("kmhelper"); + + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// CONSTANTS DEFINITION // +// here you may specify custom CONSTANTS used within the script. // // // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* This constant specifies allowed values to determine how the aggregation process will deal with indicator values. +* I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. +* Note that these values must not be changed by users! +* @type {Array.} +* @memberof CONSTANTS +* @constant +*/ +const aggregationTypeEnum = ["SUM", "AVERAGE"]; + +/** +* via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. +* Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option +* @type {string} +* @memberof CONSTANTS +* @constant +*/ +const aggregationType = "SUM"; +const computationGeoresourceId_name = "compGeoId"; +const computationFilterProperty_name = "compFilterProp"; +const computationFilterOperator_name = "compFilterOperator"; +const computationFilterPropertyValue_name = "compFilterPropVal"; + +/** +* This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined +* as method parameters that can be used within the method body. +* +* NOTE: The function is async, so users may make use of keyword "await" to wait for results of other async helper API methods. +* (This is necessary when users want to wait for asynchronous method execution such as external API calls in a synchronous program) +* +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit as GeoJSON FeatureCollection object. +* @param {map.>} baseIndicatorsMap - Map containing all indicators, wheres key='meaningful name or id of the indicator' and value='indicator as GeoJSON object' (it contains duplicate entries, one for the indicator name and one for the indicator id) +* @param {map.>} georesourcesMap - Map containing all georesources, wheres key='meaningful name or id of the georesource' and value='georesource as GeoJSON object' (they are used to execute geometric/toptologic computations) (it contains duplicate entries, one for the georesource name and one for the georesource id) +* @param {Array.>} processParameters - an array containing objects representing variable additional process parameters that are required to perform the indicator computation. +* Each entry has properties Object.name and Object.value for name and value of the parameter. +* @returns {FeatureCollection} the computed indicator for submitted {@linkcode targetSpatialUnit_geoJSON} features as GeoJSON FeatureCollection +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ + // compute indicator for targetDate and targetSpatialUnitFeatures + var computationGeoresourceId = KmHelper.getProcessParameterByName_asString(computationGeoresourceId_name, processParameters) + // retrieve required baseIndicator using its meaningful name + var computationGeoresource = KmHelper.getGeoresourceById(computationGeoresourceId, georesourcesMap); + // create a clone in order to enable object manipulation such as deletion of features without deleting in origin dataset + computationGeoresource = JSON.parse(JSON.stringify(computationGeoresource)); + // OPTIONAL retrieve a property and a respective property value which are then used to filter the georessource + var computationFilterProperty; + var computationFilterOperator; + var computationFilterPropertyValue; + var parameter = undefined; + + processParameters.forEach(function(property){ + if(property.name === computationFilterProperty_name){ + parameter = property.value; + } + }); + + if(parameter === undefined) { + computationFilterProperty = undefined; + computationFilterOperator = undefined; + computationFilterPropertyValue = undefined; + } + else { + computationFilterProperty = KmHelper.getProcessParameterByName_asString(computationFilterProperty_name, processParameters); + computationFilterOperator = KmHelper.getProcessParameterByName_asString(computationFilterOperator_name, processParameters); + computationFilterPropertyValue = KmHelper.getProcessParameterByName_asString(computationFilterPropertyValue_name, processParameters); + } + +KmHelper.log("calculating spatial within check between points and target spatial unit."); + +// create progress log after each 10th percent of features +var logProgressIndexSeparator = Math.round(targetSpatialUnit_geoJSON.features.length / 100 * 10); + + for (var featureIndex=0; featureIndex < targetSpatialUnit_geoJSON.features.length; featureIndex++){ + var spatialUnitFeat = targetSpatialUnit_geoJSON.features[featureIndex]; + // initialize indicatorValue + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, 0); + + var pointsWithinFeature = KmHelper.pointsWithinPolygon(computationGeoresource, spatialUnitFeat); + if(pointsWithinFeature && pointsWithinFeature.features && pointsWithinFeature.features.length > 0){ + if (computationFilterProperty !== undefined) { + var valueArray = KmHelper.getPropertyValueArray(pointsWithinFeature, computationFilterProperty); + var filteredArray = []; + switch (computationFilterOperator) { + case ("Equal"): + filteredArray = valueArray.filter(item => item === computationFilterPropertyValue); + break; + case ("Greater_than"): + filteredArray = valueArray.filter(item => item > computationFilterPropertyValue); + break; + case ("Greater_than_or_equal"): + filteredArray = valueArray.filter(item => item >= computationFilterPropertyValue); + break; + case ("Less_than"): + filteredArray = valueArray.filter(item => item < computationFilterPropertyValue); + break; + case ("Less_than_or_equal"): + filteredArray = valueArray.filter(item => item <= computationFilterPropertyValue); + break; + case ("Unequal"): + filteredArray = valueArray.filter(item => item !== computationFilterPropertyValue); + break; + case ("Contains"): + var computationFilterPropertyValueArray = computationFilterPropertyValue.split(","); + for (let i=0; i item === trimmedElement); + filteredArray = filteredArray.concat(tmp); + } + break; + case ("Range"): + var computationFilterPropertyValueArray = computationFilterPropertyValue.split("-").map(el => parseInt(el)); + filteredArray = valueArray.filter(item => item >= computationFilterPropertyValueArray[0] && item < computationFilterPropertyValueArray[1]); + break; + default: + KmHelper.log("Indicator was not computed from computation resources because no valid filter could be applied. Indicator value is set to null."); + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, null); + break; + } + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, filteredArray.length); + } + else { + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, pointsWithinFeature.features.length); + } + } + + if(featureIndex % logProgressIndexSeparator === 0){ + KmHelper.log("PROGRESS: Compared '" + featureIndex + "' of total '" + targetSpatialUnit_geoJSON.features.length + "' spatial units to point features."); + } + } + + KmHelper.log("Computation of indicator finished"); + + return targetSpatialUnit_geoJSON; +}; + +/** +* This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). +* The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. +* The aggrgation internally aggregates features of {@linkcode indicator_geoJSON} to features of {@linkcode targetSpatialUnit_geoJSON} by comparing their geometries. +* Each {@linkcode indicator_geoJSON} feature whose geometry lies within a certain geometry of a {@linkcode targetSpatialUnit_geoJSON} feature will be used to compute the aggregated indicator values. +* The within comparison is executed by method {@linkcode within_usingBBOX}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be aggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter targetSpatialUnit_geoJSON +* @see aggregationType +* @see within_usingBBOX +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the aggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)){ + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if(aggregationType === "SUM"){ + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +}; + +/** +* This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). +* @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be disaggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be disaggregated to the features of parameter targetSpatialUnit_geoJSON +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the disaggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // disaggregate indicator + +}; + + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. +* Also it uses the {@linkcode KmHelper.getAggregationWeight(feature)} method as weight during aggregtion. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + + // compute average for share + if(baseIndicatorTotalWeight === 0){ + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + + KmHelper.log("Aggregation finished"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} +* to determine which features of {@linkcode indicator_geoJSON} can be aggregated to which features of {@linkcode targetSpatialUnit_geoJSON}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + var totalAggregatedIndicatorFeatures = 0; + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + + +module.exports.computeIndicator = computeIndicator; +module.exports.aggregateIndicator = aggregateIndicator; +module.exports.disaggregateIndicator = disaggregateIndicator; diff --git a/app/kommonitor-script-resources/km_georessouce_length_lineSegmentsWithinPolygon.js b/app/kommonitor-script-resources/km_georessouce_length_lineSegmentsWithinPolygon.js index 30310ada6..a125fabce 100644 --- a/app/kommonitor-script-resources/km_georessouce_length_lineSegmentsWithinPolygon.js +++ b/app/kommonitor-script-resources/km_georessouce_length_lineSegmentsWithinPolygon.js @@ -1,22 +1,19 @@ +"use strict"; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // NECESSARY NODE MODULE DEPENDENCIES // // // // // SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * Module that contains various helper methods (spatial GIS functions and statistical functions) * to simplify script writing */ const KmHelper = require("kmhelper"); const turf = require('@turf/turf'); - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // CONSTANTS DEFINITION // // here you may specify custom CONSTANTS used within the script. // // // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * This constant specifies allowed values to determine how the aggregation process will deal with indicator values. * I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. @@ -26,7 +23,6 @@ const turf = require('@turf/turf'); * @constant */ const aggregationTypeEnum = ["SUM", "AVERAGE"]; - /** * via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. * Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option @@ -39,8 +35,6 @@ const computationGeoresourceId_name = "compGeoId"; const computationFilterProperty_name = "compFilterProp"; const computationFilterOperator_name = "compFilterOperator"; const computationFilterPropertyValue_name = "compFilterPropVal"; - - /** * This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined * as method parameters that can be used within the method body. @@ -58,128 +52,120 @@ const computationFilterPropertyValue_name = "compFilterPropVal"; * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ - // compute indicator for targetDate and targetSpatialUnitFeatures - var computationGeoresourceId = KmHelper.getProcessParameterByName_asString(computationGeoresourceId_name, processParameters); - // retrieve required baseIndicator using its meaningful name - var computationGeoresource = KmHelper.getGeoresourceById(computationGeoresourceId, georesourcesMap); - // create a clone in order to enable object manipulation such as deletion of features without deleting in origin dataset - computationGeoresource = JSON.parse(JSON.stringify(computationGeoresource)); - // OPTIONAL retrieve a property and a respective property value which are then used to filter the georessource - var computationFilterProperty; - var computationFilterOperator; - var computationFilterPropertyValue; - var parameter = undefined; - - processParameters.forEach(function(property){ - if(property.name === computationFilterProperty_name){ - parameter = property.value; +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters) { + // compute indicator for targetDate and targetSpatialUnitFeatures + var computationGeoresourceId = KmHelper.getProcessParameterByName_asString(computationGeoresourceId_name, processParameters); + // retrieve required baseIndicator using its meaningful name + var computationGeoresource = KmHelper.getGeoresourceById(computationGeoresourceId, georesourcesMap); + // create a clone in order to enable object manipulation such as deletion of features without deleting in origin dataset + computationGeoresource = JSON.parse(JSON.stringify(computationGeoresource)); + // OPTIONAL retrieve a property and a respective property value which are then used to filter the georessource + var computationFilterProperty; + var computationFilterOperator; + var computationFilterPropertyValue; + var parameter = undefined; + processParameters.forEach(function (property) { + if (property.name === computationFilterProperty_name) { + parameter = property.value; + } + }); + if (parameter === undefined) { + computationFilterProperty = undefined; + computationFilterOperator = undefined; + computationFilterPropertyValue = undefined; } - }); - - if(parameter === undefined) { - computationFilterProperty = undefined; - computationFilterOperator = undefined; - computationFilterPropertyValue = undefined; - } - else { - computationFilterProperty = KmHelper.getProcessParameterByName_asString(computationFilterProperty_name, processParameters); - computationFilterOperator = KmHelper.getProcessParameterByName_asString(computationFilterOperator_name, processParameters); - computationFilterPropertyValue = KmHelper.getProcessParameterByName_asString(computationFilterPropertyValue_name, processParameters); - } - - KmHelper.log("calculating spatial intersection and within check between lines and target spatial unit."); - - // create progress log after each 10th percent of features - var logProgressIndexSeparator = Math.round(targetSpatialUnit_geoJSON.features.length / 100 * 10); - - for (var featureIndex=0; featureIndex < targetSpatialUnit_geoJSON.features.length; featureIndex++){ - var spatialUnitFeat = targetSpatialUnit_geoJSON.features[featureIndex]; - // initialize indicatorValue - KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, 0); - computationGeoresource = KmHelper.transformMultiLineStringToLineStrings(computationGeoresource); - var linesWithinFeature = KmHelper.intersectLineFeatureCollectionByPolygonFeature(computationGeoresource, spatialUnitFeat); - if(linesWithinFeature && linesWithinFeature.features && linesWithinFeature.features.length > 0){ - var lineSegmentsLengthSum; - if (computationFilterProperty !== undefined) { - var filteredLineFeatures = []; - linesWithinFeature.features.forEach(function (line) { - var computationFilterPropertyValueArray; - switch (computationFilterOperator) { - case ("Equal"): - if (line.properties[computationFilterProperty] === computationFilterPropertyValue) { - filteredLineFeatures.push(line); - } - break; - case ("Greater_than"): - if (line.properties[computationFilterProperty] > computationFilterPropertyValue) { - filteredLineFeatures.push(line); - } - break; - case ("Greater_than_or_equal"): - if (line.properties[computationFilterProperty] >= computationFilterPropertyValue) { - filteredLineFeatures.push(line); - } - break; - case ("Less_than"): - if (line.properties[computationFilterProperty] < computationFilterPropertyValue) { - filteredLineFeatures.push(line); - } - break; - case ("Less_than_or_equal"): - if (line.properties[computationFilterProperty] <= computationFilterPropertyValue) { - filteredLineFeatures.push(line); - } - break; - case ("Unequal"): - if (line.properties[computationFilterProperty] !== computationFilterPropertyValue) { - filteredLineFeatures.push(line); - } - break; - case ("Contains"): - computationFilterPropertyValueArray = computationFilterPropertyValue.split(","); - for (let i = 0; i < computationFilterPropertyValueArray.length; i++) { - let trimmedElement = computationFilterPropertyValueArray[i].trim(); - if (line.properties[computationFilterProperty] === trimmedElement) { - filteredLineFeatures.push(line); - } + else { + computationFilterProperty = KmHelper.getProcessParameterByName_asString(computationFilterProperty_name, processParameters); + computationFilterOperator = KmHelper.getProcessParameterByName_asString(computationFilterOperator_name, processParameters); + computationFilterPropertyValue = KmHelper.getProcessParameterByName_asString(computationFilterPropertyValue_name, processParameters); + } + KmHelper.log("calculating spatial intersection and within check between lines and target spatial unit."); + // create progress log after each 10th percent of features + var logProgressIndexSeparator = Math.round(targetSpatialUnit_geoJSON.features.length / 100 * 10); + for (var featureIndex = 0; featureIndex < targetSpatialUnit_geoJSON.features.length; featureIndex++) { + var spatialUnitFeat = targetSpatialUnit_geoJSON.features[featureIndex]; + // initialize indicatorValue + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, 0); + computationGeoresource = KmHelper.transformMultiLineStringToLineStrings(computationGeoresource); + var linesWithinFeature = KmHelper.intersectLineFeatureCollectionByPolygonFeature(computationGeoresource, spatialUnitFeat); + if (linesWithinFeature && linesWithinFeature.features && linesWithinFeature.features.length > 0) { + var lineSegmentsLengthSum; + if (computationFilterProperty !== undefined) { + var filteredLineFeatures = []; + linesWithinFeature.features.forEach(function (line) { + var computationFilterPropertyValueArray; + switch (computationFilterOperator) { + case ("Equal"): + if (line.properties[computationFilterProperty] === computationFilterPropertyValue) { + filteredLineFeatures.push(line); + } + break; + case ("Greater_than"): + if (line.properties[computationFilterProperty] > computationFilterPropertyValue) { + filteredLineFeatures.push(line); + } + break; + case ("Greater_than_or_equal"): + if (line.properties[computationFilterProperty] >= computationFilterPropertyValue) { + filteredLineFeatures.push(line); + } + break; + case ("Less_than"): + if (line.properties[computationFilterProperty] < computationFilterPropertyValue) { + filteredLineFeatures.push(line); + } + break; + case ("Less_than_or_equal"): + if (line.properties[computationFilterProperty] <= computationFilterPropertyValue) { + filteredLineFeatures.push(line); + } + break; + case ("Unequal"): + if (line.properties[computationFilterProperty] !== computationFilterPropertyValue) { + filteredLineFeatures.push(line); + } + break; + case ("Contains"): + computationFilterPropertyValueArray = computationFilterPropertyValue.split(","); + for (let i = 0; i < computationFilterPropertyValueArray.length; i++) { + let trimmedElement = computationFilterPropertyValueArray[i].trim(); + if (line.properties[computationFilterProperty] === trimmedElement) { + filteredLineFeatures.push(line); + } + } + break; + case ("Range"): + computationFilterPropertyValueArray = computationFilterPropertyValue.split("-").map(el => parseInt(el)); + if (line.properties[computationFilterProperty] >= computationFilterPropertyValueArray[0] && line.properties[computationFilterProperty] < computationFilterPropertyValueArray[1]) { + filteredLineFeatures.push(line); + } + break; + default: + KmHelper.log("Indicator was not computed from computation resources because no valid filter could be applied. Indicator value is set to null."); + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, null); + break; + } + }); + if (filteredLineFeatures.length === 0) { + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, 0); } - break; - case ("Range"): - computationFilterPropertyValueArray = computationFilterPropertyValue.split("-").map(el => parseInt(el)); - if (line.properties[computationFilterProperty] >= computationFilterPropertyValueArray[0] && line.properties[computationFilterProperty] < computationFilterPropertyValueArray[1]) { - filteredLineFeatures.push(line); + else { + lineSegmentsLengthSum = KmHelper.summarizeLineSegmentLengths(KmHelper.asFeatureCollection(filteredLineFeatures)); + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, lineSegmentsLengthSum); } - break; - default: - KmHelper.log("Indicator was not computed from computation resources because no valid filter could be applied. Indicator value is set to null."); - KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, null); - break; } - }); - if (filteredLineFeatures.length === 0) { - KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, 0); - } else { - lineSegmentsLengthSum = KmHelper.summarizeLineSegmentLengths(KmHelper.asFeatureCollection(filteredLineFeatures)); - KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, lineSegmentsLengthSum); - } - } - else { - lineSegmentsLengthSum = KmHelper.summarizeLineSegmentLengths(linesWithinFeature); - KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, lineSegmentsLengthSum); - } - } - - if(featureIndex % logProgressIndexSeparator === 0){ - KmHelper.log("PROGRESS: Compared '" + featureIndex + "' of total '" + targetSpatialUnit_geoJSON.features.length + "' spatial units to line features."); + else { + lineSegmentsLengthSum = KmHelper.summarizeLineSegmentLengths(linesWithinFeature); + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, lineSegmentsLengthSum); + } + } + if (featureIndex % logProgressIndexSeparator === 0) { + KmHelper.log("PROGRESS: Compared '" + featureIndex + "' of total '" + targetSpatialUnit_geoJSON.features.length + "' spatial units to line features."); + } } - } - - KmHelper.log("Computation of indicator finished"); - - return targetSpatialUnit_geoJSON; + KmHelper.log("Computation of indicator finished"); + return targetSpatialUnit_geoJSON; } - /** * This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). * The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. @@ -195,22 +181,22 @@ async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndic * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - if (!aggregationTypeEnum.includes(aggregationType)){ - console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + - "'. Allowed values are: " + aggregationTypeEnum); - console.log("Will fallback to using AVERAGE aggregation logic."); - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else if(aggregationType === "SUM"){ - return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else { - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } -}; - +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)) { + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if (aggregationType === "SUM") { + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +} +; /** * This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). * @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! @@ -221,12 +207,10 @@ function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geo * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // disaggregate indicator - -}; - - +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // disaggregate indicator +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. @@ -240,74 +224,60 @@ function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check to aggregate - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var baseIndicatorTotalWeight = 0; - var featureCounter = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - featureCounter++; - - // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number - if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ - // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method - // it "survives" until this aggregation logic within processing engine - var weight = KmHelper.getAggregationWeight(indicatorFeature); - - // use weight as weight for indicator value - baseIndicatorTotalWeight += weight; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; - } - } - } - - // compute average for share - if(baseIndicatorTotalWeight === 0){ - targetFeature.properties[targetDate] = Number.NaN; +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; } - else { - targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if (!Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined) { + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + // compute average for share + if (baseIndicatorTotalWeight === 0) { + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + KmHelper.log("Aggregation finished"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); } - // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); - }); - - KmHelper.log("Aggregation finished"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - + return targetSpatialUnit_geoJSON; +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} @@ -321,58 +291,47 @@ function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - var totalAggregatedIndicatorFeatures = 0; - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check for aggregation - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var numberOfIndicatorFeaturesWithinTargetFeature = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - numberOfIndicatorFeaturesWithinTargetFeature++; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); - } - } - totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; - }); - - KmHelper.log("Aggregation finished"); - KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + var totalAggregatedIndicatorFeatures = 0; + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; + } + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + return targetSpatialUnit_geoJSON; +} +; module.exports.computeIndicator = computeIndicator; module.exports.aggregateIndicator = aggregateIndicator; module.exports.disaggregateIndicator = disaggregateIndicator; +//# sourceMappingURL=km_georessouce_length_lineSegmentsWithinPolygon.js.map \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_georessouce_length_lineSegmentsWithinPolygon.js.map b/app/kommonitor-script-resources/km_georessouce_length_lineSegmentsWithinPolygon.js.map new file mode 100644 index 000000000..44155007f --- /dev/null +++ b/app/kommonitor-script-resources/km_georessouce_length_lineSegmentsWithinPolygon.js.map @@ -0,0 +1 @@ +{"version":3,"file":"km_georessouce_length_lineSegmentsWithinPolygon.js","sourceRoot":"","sources":["km_georessouce_length_lineSegmentsWithinPolygon.ts"],"names":[],"mappings":";AAAA,8JAA8J;AAC9J,yRAAyR;AACzR,8JAA8J;AAC9J,4GAA4G;AAC5G,8JAA8J;A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AE,KAAK,GAAG,iBAAiB,CAAC,MAAM,EAAE,KAAK,EAAE,EAAC;YAC7D,IAAI,gBAAgB,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAC9C,IAAG,QAAQ,CAAC,MAAM,CAAC,gBAAgB,EAAE,aAAa,CAAC,EAAC;gBACrD,wCAAwC;gBACxC,iBAAiB,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;gBAChC,KAAK,EAAE,CAAC;gBACX,4CAA4C,EAAE,CAAC;gBAC/C,aAAa,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,gBAAgB,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;aACxF;SACD;QACA,gCAAgC,IAAI,4CAA4C,CAAC;IACnF,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;IACrC,QAAQ,CAAC,GAAG,CAAC,gCAAgC,GAAG,+BAA+B,GAAG,yBAAyB,CAAC,QAAQ,CAAC,MAAM,GAAG,iBAAiB,CAAC,CAAC;IAEjJ,IAAG,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAC;QAC9B,OAAO,CAAC,KAAK,CAAC,mDAAmD,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAC9F,MAAM,KAAK,CAAC,6DAA6D,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;KACvG;IAED,OAAO,yBAAyB,CAAC;AACnC,CAAC;AAAA,CAAC;AAEF,MAAM,CAAC,OAAO,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;AACnD,MAAM,CAAC,OAAO,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;AACvD,MAAM,CAAC,OAAO,CAAC,qBAAqB,GAAG,qBAAqB,CAAC"} \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_georessouce_length_lineSegmentsWithinPolygon.ts b/app/kommonitor-script-resources/km_georessouce_length_lineSegmentsWithinPolygon.ts new file mode 100644 index 000000000..30310ada6 --- /dev/null +++ b/app/kommonitor-script-resources/km_georessouce_length_lineSegmentsWithinPolygon.ts @@ -0,0 +1,378 @@ +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// NECESSARY NODE MODULE DEPENDENCIES // // +// // +// SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* Module that contains various helper methods (spatial GIS functions and statistical functions) +* to simplify script writing +*/ +const KmHelper = require("kmhelper"); +const turf = require('@turf/turf'); + + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// CONSTANTS DEFINITION // +// here you may specify custom CONSTANTS used within the script. // // // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* This constant specifies allowed values to determine how the aggregation process will deal with indicator values. +* I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. +* Note that these values must not be changed by users! +* @type {Array.} +* @memberof CONSTANTS +* @constant +*/ +const aggregationTypeEnum = ["SUM", "AVERAGE"]; + +/** +* via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. +* Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option +* @type {string} +* @memberof CONSTANTS +* @constant +*/ +const aggregationType = "SUM"; +const computationGeoresourceId_name = "compGeoId"; +const computationFilterProperty_name = "compFilterProp"; +const computationFilterOperator_name = "compFilterOperator"; +const computationFilterPropertyValue_name = "compFilterPropVal"; + + +/** +* This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined +* as method parameters that can be used within the method body. +* +* NOTE: The function is async, so users may make use of keyword "await" to wait for results of other async helper API methods. +* (This is necessary when users want to wait for asynchronous method execution such as external API calls in a synchronous program) +* +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit as GeoJSON FeatureCollection object. +* @param {map.>} baseIndicatorsMap - Map containing all indicators, wheres key='meaningful name or id of the indicator' and value='indicator as GeoJSON object' (it contains duplicate entries, one for the indicator name and one for the indicator id) +* @param {map.>} georesourcesMap - Map containing all georesources, wheres key='meaningful name or id of the georesource' and value='georesource as GeoJSON object' (they are used to execute geometric/toptologic computations) (it contains duplicate entries, one for the georesource name and one for the georesource id) +* @param {Array.>} processParameters - an array containing objects representing variable additional process parameters that are required to perform the indicator computation. +* Each entry has properties Object.name and Object.value for name and value of the parameter. +* @returns {FeatureCollection} the computed indicator for submitted {@linkcode targetSpatialUnit_geoJSON} features as GeoJSON FeatureCollection +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ + // compute indicator for targetDate and targetSpatialUnitFeatures + var computationGeoresourceId = KmHelper.getProcessParameterByName_asString(computationGeoresourceId_name, processParameters); + // retrieve required baseIndicator using its meaningful name + var computationGeoresource = KmHelper.getGeoresourceById(computationGeoresourceId, georesourcesMap); + // create a clone in order to enable object manipulation such as deletion of features without deleting in origin dataset + computationGeoresource = JSON.parse(JSON.stringify(computationGeoresource)); + // OPTIONAL retrieve a property and a respective property value which are then used to filter the georessource + var computationFilterProperty; + var computationFilterOperator; + var computationFilterPropertyValue; + var parameter = undefined; + + processParameters.forEach(function(property){ + if(property.name === computationFilterProperty_name){ + parameter = property.value; + } + }); + + if(parameter === undefined) { + computationFilterProperty = undefined; + computationFilterOperator = undefined; + computationFilterPropertyValue = undefined; + } + else { + computationFilterProperty = KmHelper.getProcessParameterByName_asString(computationFilterProperty_name, processParameters); + computationFilterOperator = KmHelper.getProcessParameterByName_asString(computationFilterOperator_name, processParameters); + computationFilterPropertyValue = KmHelper.getProcessParameterByName_asString(computationFilterPropertyValue_name, processParameters); + } + + KmHelper.log("calculating spatial intersection and within check between lines and target spatial unit."); + + // create progress log after each 10th percent of features + var logProgressIndexSeparator = Math.round(targetSpatialUnit_geoJSON.features.length / 100 * 10); + + for (var featureIndex=0; featureIndex < targetSpatialUnit_geoJSON.features.length; featureIndex++){ + var spatialUnitFeat = targetSpatialUnit_geoJSON.features[featureIndex]; + // initialize indicatorValue + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, 0); + computationGeoresource = KmHelper.transformMultiLineStringToLineStrings(computationGeoresource); + var linesWithinFeature = KmHelper.intersectLineFeatureCollectionByPolygonFeature(computationGeoresource, spatialUnitFeat); + if(linesWithinFeature && linesWithinFeature.features && linesWithinFeature.features.length > 0){ + var lineSegmentsLengthSum; + if (computationFilterProperty !== undefined) { + var filteredLineFeatures = []; + linesWithinFeature.features.forEach(function (line) { + var computationFilterPropertyValueArray; + switch (computationFilterOperator) { + case ("Equal"): + if (line.properties[computationFilterProperty] === computationFilterPropertyValue) { + filteredLineFeatures.push(line); + } + break; + case ("Greater_than"): + if (line.properties[computationFilterProperty] > computationFilterPropertyValue) { + filteredLineFeatures.push(line); + } + break; + case ("Greater_than_or_equal"): + if (line.properties[computationFilterProperty] >= computationFilterPropertyValue) { + filteredLineFeatures.push(line); + } + break; + case ("Less_than"): + if (line.properties[computationFilterProperty] < computationFilterPropertyValue) { + filteredLineFeatures.push(line); + } + break; + case ("Less_than_or_equal"): + if (line.properties[computationFilterProperty] <= computationFilterPropertyValue) { + filteredLineFeatures.push(line); + } + break; + case ("Unequal"): + if (line.properties[computationFilterProperty] !== computationFilterPropertyValue) { + filteredLineFeatures.push(line); + } + break; + case ("Contains"): + computationFilterPropertyValueArray = computationFilterPropertyValue.split(","); + for (let i = 0; i < computationFilterPropertyValueArray.length; i++) { + let trimmedElement = computationFilterPropertyValueArray[i].trim(); + if (line.properties[computationFilterProperty] === trimmedElement) { + filteredLineFeatures.push(line); + } + } + break; + case ("Range"): + computationFilterPropertyValueArray = computationFilterPropertyValue.split("-").map(el => parseInt(el)); + if (line.properties[computationFilterProperty] >= computationFilterPropertyValueArray[0] && line.properties[computationFilterProperty] < computationFilterPropertyValueArray[1]) { + filteredLineFeatures.push(line); + } + break; + default: + KmHelper.log("Indicator was not computed from computation resources because no valid filter could be applied. Indicator value is set to null."); + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, null); + break; + } + }); + if (filteredLineFeatures.length === 0) { + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, 0); + } else { + lineSegmentsLengthSum = KmHelper.summarizeLineSegmentLengths(KmHelper.asFeatureCollection(filteredLineFeatures)); + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, lineSegmentsLengthSum); + } + } + else { + lineSegmentsLengthSum = KmHelper.summarizeLineSegmentLengths(linesWithinFeature); + KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, lineSegmentsLengthSum); + } + } + + if(featureIndex % logProgressIndexSeparator === 0){ + KmHelper.log("PROGRESS: Compared '" + featureIndex + "' of total '" + targetSpatialUnit_geoJSON.features.length + "' spatial units to line features."); + } + } + + KmHelper.log("Computation of indicator finished"); + + return targetSpatialUnit_geoJSON; +} + +/** +* This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). +* The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. +* The aggrgation internally aggregates features of {@linkcode indicator_geoJSON} to features of {@linkcode targetSpatialUnit_geoJSON} by comparing their geometries. +* Each {@linkcode indicator_geoJSON} feature whose geometry lies within a certain geometry of a {@linkcode targetSpatialUnit_geoJSON} feature will be used to compute the aggregated indicator values. +* The within comparison is executed by method {@linkcode within_usingBBOX}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be aggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter targetSpatialUnit_geoJSON +* @see aggregationType +* @see within_usingBBOX +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the aggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)){ + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if(aggregationType === "SUM"){ + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +}; + +/** +* This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). +* @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be disaggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be disaggregated to the features of parameter targetSpatialUnit_geoJSON +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the disaggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // disaggregate indicator + +}; + + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. +* Also it uses the {@linkcode KmHelper.getAggregationWeight(feature)} method as weight during aggregtion. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + + // compute average for share + if(baseIndicatorTotalWeight === 0){ + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + + KmHelper.log("Aggregation finished"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} +* to determine which features of {@linkcode indicator_geoJSON} can be aggregated to which features of {@linkcode targetSpatialUnit_geoJSON}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + var totalAggregatedIndicatorFeatures = 0; + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + +module.exports.computeIndicator = computeIndicator; +module.exports.aggregateIndicator = aggregateIndicator; +module.exports.disaggregateIndicator = disaggregateIndicator; diff --git a/app/kommonitor-script-resources/km_headline_indicator.js b/app/kommonitor-script-resources/km_headline_indicator.js index c78493303..6526eee52 100644 --- a/app/kommonitor-script-resources/km_headline_indicator.js +++ b/app/kommonitor-script-resources/km_headline_indicator.js @@ -1,21 +1,18 @@ +"use strict"; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // NECESSARY NODE MODULE DEPENDENCIES // // // // // SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * Module that contains various helper methods (spatial GIS functions and statistical functions) * to simplify script writing */ const KmHelper = require("kmhelper"); - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // CONSTANTS DEFINITION // // here you may specify custom CONSTANTS used within the script. // // // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * This constant specifies allowed values to determine how the aggregation process will deal with indicator values. * I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. @@ -25,7 +22,6 @@ const KmHelper = require("kmhelper"); * @constant */ const aggregationTypeEnum = ["SUM", "AVERAGE"]; - /** * via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. * Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option @@ -34,14 +30,10 @@ const aggregationTypeEnum = ["SUM", "AVERAGE"]; * @constant */ const aggregationType = "SUM"; - const parameterName_computationIndicatorIds = "COMPUTATION_ID_ARRAY"; const parameterName_computationPolarity = "COMPUTATION_POLARITY_ARRAY"; // supported methods: "geomean", "mean", "min" -const parameterName_aggregationMethod = "AGGREGATION_METHOD"; - - - +const parameterName_aggregationMethod = "AGGREGATION_METHOD"; /** * This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined * as method parameters that can be used within the method body. @@ -59,71 +51,64 @@ const parameterName_aggregationMethod = "AGGREGATION_METHOD"; * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ - +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters) { var computationIndicatorIds = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorIds, processParameters); var computationPolarity = KmHelper.getProcessParameterByName_asString(parameterName_computationPolarity, processParameters); var aggregationMethod = KmHelper.getProcessParameterByName_asString(parameterName_aggregationMethod, processParameters); - // get an array of the indicator ids - var computationIndicatorIds_array = computationIndicatorIds.split(','); + var computationIndicatorIds_array = computationIndicatorIds.split(','); // get an array of the same length including the polarity of each indicator, 'regular' or 'inverted' - var computationPolarity_array = computationPolarity.split(','); - + var computationPolarity_array = computationPolarity.split(','); // get an array of indicators using the indicator ids var geoJSON_array = []; for (const indicatorId of computationIndicatorIds_array) { - geoJSON_array.push(KmHelper.getBaseIndicatorById(indicatorId, baseIndicatorsMap)); - } + geoJSON_array.push(KmHelper.getBaseIndicatorById(indicatorId, baseIndicatorsMap)); + } KmHelper.log("Retrieved required baseIndicators successfully"); - // get an array of map objects with id-value pairs for each featureCollection in the array KmHelper.log("Iterate over array of baseIndicators and create an array of map objects with id-value pairs for each featureCollection"); var indicator_idValueMap_array = []; - geoJSON_array.forEach(function(geoJSON) { - indicator_idValueMap_array.push(KmHelper.getIndicatorIdValueMap(geoJSON, targetDate)); - }); + geoJSON_array.forEach(function (geoJSON) { + indicator_idValueMap_array.push(KmHelper.getIndicatorIdValueMap(geoJSON, targetDate)); + }); KmHelper.log("Retrieved required map objects successfully"); - // get an array of ranked map objects with id-value pairs for each baseIndicator map in the array KmHelper.log("Iterate over array of baseIndicator maps and create an array of ranked map objects"); var rankedIndicator_idValueMap_array = []; - indicator_idValueMap_array.forEach(function(idValueMap) { - rankedIndicator_idValueMap_array.push(KmHelper.rank_fromIdValueMap(idValueMap)); - }); + indicator_idValueMap_array.forEach(function (idValueMap) { + rankedIndicator_idValueMap_array.push(KmHelper.rank_fromIdValueMap(idValueMap)); + }); KmHelper.log("Retrieved ranked map objects successfully"); - // get an array of min-max normalized map objects with id-value pairs for each ranked indicator in the array considering the polarity of the indicator KmHelper.log("Iterate over array ranked map objects and create an array of min-max normalized map objects"); var index; var minMaxNormalizedIndicator_idValueMap_array = []; - for (index = 0; index < rankedIndicator_idValueMap_array.length; index++) { - var polarity = computationPolarity_array[index]; - if (polarity === "regular") { - minMaxNormalizedIndicator_idValueMap_array.push(KmHelper.minMaxNormalization_fromIdValueMap(rankedIndicator_idValueMap_array[index])); - } - else { - minMaxNormalizedIndicator_idValueMap_array.push(KmHelper.minMaxNormalization_inverted_fromIdValueMap(rankedIndicator_idValueMap_array[index])); - } + for (index = 0; index < rankedIndicator_idValueMap_array.length; index++) { + var polarity = computationPolarity_array[index]; + if (polarity === "regular") { + minMaxNormalizedIndicator_idValueMap_array.push(KmHelper.minMaxNormalization_fromIdValueMap(rankedIndicator_idValueMap_array[index])); + } + else { + minMaxNormalizedIndicator_idValueMap_array.push(KmHelper.minMaxNormalization_inverted_fromIdValueMap(rankedIndicator_idValueMap_array[index])); + } } KmHelper.log("Retrieved min-max-normalized map objects successfully"); - // now we compute the new indicator by applying the method chosen by the user var resultMap; if (aggregationMethod === "geomean") { - // apply geometric mean to an array of min-max-normalized map objects - KmHelper.log("Calculate geometric mean"); - resultMap = KmHelper.geomean_fromIdValueMap(minMaxNormalizedIndicator_idValueMap_array); + // apply geometric mean to an array of min-max-normalized map objects + KmHelper.log("Calculate geometric mean"); + resultMap = KmHelper.geomean_fromIdValueMap(minMaxNormalizedIndicator_idValueMap_array); } if (aggregationMethod === "mean") { - // apply mean to an array of min-max-normalized map objects - KmHelper.log("Calculate mean"); - resultMap = KmHelper.mean_fromIdValueMap(minMaxNormalizedIndicator_idValueMap_array); + // apply mean to an array of min-max-normalized map objects + KmHelper.log("Calculate mean"); + resultMap = KmHelper.mean_fromIdValueMap(minMaxNormalizedIndicator_idValueMap_array); } if (aggregationMethod === "min") { - // apply min to an array of min-max-normalized map objects - KmHelper.log("Calculate min"); - resultMap = KmHelper.min_fromIdValueMap(minMaxNormalizedIndicator_idValueMap_array); + // apply min to an array of min-max-normalized map objects + KmHelper.log("Calculate min"); + resultMap = KmHelper.min_fromIdValueMap(minMaxNormalizedIndicator_idValueMap_array); } var numFeatures = targetSpatialUnit_geoJSON.features.length; KmHelper.log("Computed headline indicator for a total amount of " + numFeatures + " features"); @@ -131,7 +116,6 @@ async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndic KmHelper.log("Computation of headline indicator finished"); return targetSpatialUnit_geoJSON; } - /** * This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). * The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. @@ -147,22 +131,22 @@ async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndic * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - if (!aggregationTypeEnum.includes(aggregationType)){ - console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + - "'. Allowed values are: " + aggregationTypeEnum); - console.log("Will fallback to using AVERAGE aggregation logic."); - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else if(aggregationType === "SUM"){ - return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else { - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } -}; - +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)) { + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if (aggregationType === "SUM") { + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +} +; /** * This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). * @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! @@ -173,12 +157,10 @@ function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geo * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // disaggregate indicator - -}; - - +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // disaggregate indicator +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. @@ -192,74 +174,60 @@ function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check to aggregate - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var baseIndicatorTotalWeight = 0; - var featureCounter = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - featureCounter++; - - // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number - if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ - // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method - // it "survives" until this aggregation logic within processing engine - var weight = KmHelper.getAggregationWeight(indicatorFeature); - - // use weight as weight for indicator value - baseIndicatorTotalWeight += weight; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; - } - } - } - - // compute average for share - if(baseIndicatorTotalWeight === 0){ - targetFeature.properties[targetDate] = Number.NaN; +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; } - else { - targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if (!Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined) { + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + // compute average for share + if (baseIndicatorTotalWeight === 0) { + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + KmHelper.log("Aggregation finished"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); } - // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); - }); - - KmHelper.log("Aggregation finished"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - + return targetSpatialUnit_geoJSON; +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} @@ -273,59 +241,47 @@ function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - var totalAggregatedIndicatorFeatures = 0; - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check for aggregation - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var numberOfIndicatorFeaturesWithinTargetFeature = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - numberOfIndicatorFeaturesWithinTargetFeature++; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); - } - } - totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; - }); - - KmHelper.log("Aggregation finished"); - KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - - +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + var totalAggregatedIndicatorFeatures = 0; + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; + } + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + return targetSpatialUnit_geoJSON; +} +; module.exports.computeIndicator = computeIndicator; module.exports.aggregateIndicator = aggregateIndicator; module.exports.disaggregateIndicator = disaggregateIndicator; +//# sourceMappingURL=km_headline_indicator.js.map \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_headline_indicator.js.map b/app/kommonitor-script-resources/km_headline_indicator.js.map new file mode 100644 index 000000000..24ae418a5 --- /dev/null +++ b/app/kommonitor-script-resources/km_headline_indicator.js.map @@ -0,0 +1 @@ +{"version":3,"file":"km_headline_indicator.js","sourceRoot":"","sources":["km_headline_indicator.ts"],"names":[],"mappings":";AAAA,8JAA8J;AAC9J,yRAAyR;AACzR,8JAA8J;AAC9J,4GAA4G;AAC5G,8JAA8J;AAE9J;;;EAGE;AACF,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAGrC,8JAA8J;AAC9J,8JAA8J;AAC9J,6OAA6O;AAC7O,8JAA8J;AAE9J;;;;;;;EAOE;AACF,MAAM,mBAAmB,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AAE/C;;;;;;EAME;AACF,MAAM,eAAe,GAAG,KAAK,CAAC;AAE9B,MAAM,qCAAqC,GAAG,sBAAsB,CAAC;AACrE,MAAM,iCAAiC,GAAG,4BAA4B,CAAC;AACvE,8CAA8C;AAC9C,MAAM,+BAA+B,GAAG,oBAAoB,CAAC;AAI7D;;;;;;;;;;;;;;;;EAgBE;AACF,KAAK,UAAU,gBAAgB,CAAC,UAAU,EAAE,yBA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C,KAAK,CAAC,CAAC;YAC9C,IAAG,QAAQ,CAAC,MAAM,CAAC,gBAAgB,EAAE,aAAa,CAAC,EAAC;gBACrD,wCAAwC;gBACxC,iBAAiB,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;gBAChC,KAAK,EAAE,CAAC;gBACX,4CAA4C,EAAE,CAAC;gBAC/C,aAAa,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,gBAAgB,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;aACxF;SACD;QACA,gCAAgC,IAAI,4CAA4C,CAAC;IACnF,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;IACrC,QAAQ,CAAC,GAAG,CAAC,gCAAgC,GAAG,+BAA+B,GAAG,yBAAyB,CAAC,QAAQ,CAAC,MAAM,GAAG,iBAAiB,CAAC,CAAC;IAEjJ,IAAG,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAC;QAC9B,OAAO,CAAC,KAAK,CAAC,mDAAmD,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAC9F,MAAM,KAAK,CAAC,6DAA6D,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;KACvG;IAED,OAAO,yBAAyB,CAAC;AACnC,CAAC;AAAA,CAAC;AAGF,MAAM,CAAC,OAAO,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;AACnD,MAAM,CAAC,OAAO,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;AACvD,MAAM,CAAC,OAAO,CAAC,qBAAqB,GAAG,qBAAqB,CAAC"} \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_headline_indicator.ts b/app/kommonitor-script-resources/km_headline_indicator.ts new file mode 100644 index 000000000..c78493303 --- /dev/null +++ b/app/kommonitor-script-resources/km_headline_indicator.ts @@ -0,0 +1,331 @@ +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// NECESSARY NODE MODULE DEPENDENCIES // // +// // +// SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* Module that contains various helper methods (spatial GIS functions and statistical functions) +* to simplify script writing +*/ +const KmHelper = require("kmhelper"); + + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// CONSTANTS DEFINITION // +// here you may specify custom CONSTANTS used within the script. // // // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* This constant specifies allowed values to determine how the aggregation process will deal with indicator values. +* I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. +* Note that these values must not be changed by users! +* @type {Array.} +* @memberof CONSTANTS +* @constant +*/ +const aggregationTypeEnum = ["SUM", "AVERAGE"]; + +/** +* via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. +* Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option +* @type {string} +* @memberof CONSTANTS +* @constant +*/ +const aggregationType = "SUM"; + +const parameterName_computationIndicatorIds = "COMPUTATION_ID_ARRAY"; +const parameterName_computationPolarity = "COMPUTATION_POLARITY_ARRAY"; +// supported methods: "geomean", "mean", "min" +const parameterName_aggregationMethod = "AGGREGATION_METHOD"; + + + +/** +* This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined +* as method parameters that can be used within the method body. +* +* NOTE: The function is async, so users may make use of keyword "await" to wait for results of other async helper API methods. +* (This is necessary when users want to wait for asynchronous method execution such as external API calls in a synchronous program) +* +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit as GeoJSON FeatureCollection object. +* @param {map.>} baseIndicatorsMap - Map containing all indicators, wheres key='meaningful name or id of the indicator' and value='indicator as GeoJSON object' (it contains duplicate entries, one for the indicator name and one for the indicator id) +* @param {map.>} georesourcesMap - Map containing all georesources, wheres key='meaningful name or id of the georesource' and value='georesource as GeoJSON object' (they are used to execute geometric/toptologic computations) (it contains duplicate entries, one for the georesource name and one for the georesource id) +* @param {Array.>} processParameters - an array containing objects representing variable additional process parameters that are required to perform the indicator computation. +* Each entry has properties Object.name and Object.value for name and value of the parameter. +* @returns {FeatureCollection} the computed indicator for submitted {@linkcode targetSpatialUnit_geoJSON} features as GeoJSON FeatureCollection +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ + + var computationIndicatorIds = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorIds, processParameters); + var computationPolarity = KmHelper.getProcessParameterByName_asString(parameterName_computationPolarity, processParameters); + var aggregationMethod = KmHelper.getProcessParameterByName_asString(parameterName_aggregationMethod, processParameters); + + // get an array of the indicator ids + var computationIndicatorIds_array = computationIndicatorIds.split(','); + // get an array of the same length including the polarity of each indicator, 'regular' or 'inverted' + var computationPolarity_array = computationPolarity.split(','); + + // get an array of indicators using the indicator ids + var geoJSON_array = []; + for (const indicatorId of computationIndicatorIds_array) { + geoJSON_array.push(KmHelper.getBaseIndicatorById(indicatorId, baseIndicatorsMap)); + } + KmHelper.log("Retrieved required baseIndicators successfully"); + + // get an array of map objects with id-value pairs for each featureCollection in the array + KmHelper.log("Iterate over array of baseIndicators and create an array of map objects with id-value pairs for each featureCollection"); + var indicator_idValueMap_array = []; + geoJSON_array.forEach(function(geoJSON) { + indicator_idValueMap_array.push(KmHelper.getIndicatorIdValueMap(geoJSON, targetDate)); + }); + KmHelper.log("Retrieved required map objects successfully"); + + // get an array of ranked map objects with id-value pairs for each baseIndicator map in the array + KmHelper.log("Iterate over array of baseIndicator maps and create an array of ranked map objects"); + var rankedIndicator_idValueMap_array = []; + indicator_idValueMap_array.forEach(function(idValueMap) { + rankedIndicator_idValueMap_array.push(KmHelper.rank_fromIdValueMap(idValueMap)); + }); + KmHelper.log("Retrieved ranked map objects successfully"); + + // get an array of min-max normalized map objects with id-value pairs for each ranked indicator in the array considering the polarity of the indicator + KmHelper.log("Iterate over array ranked map objects and create an array of min-max normalized map objects"); + var index; + var minMaxNormalizedIndicator_idValueMap_array = []; + for (index = 0; index < rankedIndicator_idValueMap_array.length; index++) { + var polarity = computationPolarity_array[index]; + if (polarity === "regular") { + minMaxNormalizedIndicator_idValueMap_array.push(KmHelper.minMaxNormalization_fromIdValueMap(rankedIndicator_idValueMap_array[index])); + } + else { + minMaxNormalizedIndicator_idValueMap_array.push(KmHelper.minMaxNormalization_inverted_fromIdValueMap(rankedIndicator_idValueMap_array[index])); + } + } + KmHelper.log("Retrieved min-max-normalized map objects successfully"); + + // now we compute the new indicator by applying the method chosen by the user + var resultMap; + if (aggregationMethod === "geomean") { + // apply geometric mean to an array of min-max-normalized map objects + KmHelper.log("Calculate geometric mean"); + resultMap = KmHelper.geomean_fromIdValueMap(minMaxNormalizedIndicator_idValueMap_array); + } + if (aggregationMethod === "mean") { + // apply mean to an array of min-max-normalized map objects + KmHelper.log("Calculate mean"); + resultMap = KmHelper.mean_fromIdValueMap(minMaxNormalizedIndicator_idValueMap_array); + } + if (aggregationMethod === "min") { + // apply min to an array of min-max-normalized map objects + KmHelper.log("Calculate min"); + resultMap = KmHelper.min_fromIdValueMap(minMaxNormalizedIndicator_idValueMap_array); + } + var numFeatures = targetSpatialUnit_geoJSON.features.length; + KmHelper.log("Computed headline indicator for a total amount of " + numFeatures + " features"); + targetSpatialUnit_geoJSON = KmHelper.setIndicatorValues_fromIdValueMap(targetSpatialUnit_geoJSON, targetDate, resultMap); + KmHelper.log("Computation of headline indicator finished"); + return targetSpatialUnit_geoJSON; +} + +/** +* This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). +* The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. +* The aggrgation internally aggregates features of {@linkcode indicator_geoJSON} to features of {@linkcode targetSpatialUnit_geoJSON} by comparing their geometries. +* Each {@linkcode indicator_geoJSON} feature whose geometry lies within a certain geometry of a {@linkcode targetSpatialUnit_geoJSON} feature will be used to compute the aggregated indicator values. +* The within comparison is executed by method {@linkcode within_usingBBOX}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be aggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter targetSpatialUnit_geoJSON +* @see aggregationType +* @see within_usingBBOX +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the aggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)){ + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if(aggregationType === "SUM"){ + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +}; + +/** +* This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). +* @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be disaggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be disaggregated to the features of parameter targetSpatialUnit_geoJSON +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the disaggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // disaggregate indicator + +}; + + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. +* Also it uses the {@linkcode KmHelper.getAggregationWeight(feature)} method as weight during aggregtion. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + + // compute average for share + if(baseIndicatorTotalWeight === 0){ + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + + KmHelper.log("Aggregation finished"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} +* to determine which features of {@linkcode indicator_geoJSON} can be aggregated to which features of {@linkcode targetSpatialUnit_geoJSON}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + var totalAggregatedIndicatorFeatures = 0; + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + + +module.exports.computeIndicator = computeIndicator; +module.exports.aggregateIndicator = aggregateIndicator; +module.exports.disaggregateIndicator = disaggregateIndicator; diff --git a/app/kommonitor-script-resources/km_indicator_absChange_nTemporalItems.js b/app/kommonitor-script-resources/km_indicator_absChange_nTemporalItems.js index 285acf85e..3eea917c9 100644 --- a/app/kommonitor-script-resources/km_indicator_absChange_nTemporalItems.js +++ b/app/kommonitor-script-resources/km_indicator_absChange_nTemporalItems.js @@ -1,21 +1,18 @@ +"use strict"; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // NECESSARY NODE MODULE DEPENDENCIES // // // // // SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * Module that contains various helper methods (spatial GIS functions and statistical functions) * to simplify script writing */ const KmHelper = require("kmhelper"); - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // CONSTANTS DEFINITION // // here you may specify custom CONSTANTS used within the script. // // // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * This constant specifies allowed values to determine how the aggregation process will deal with indicator values. * I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. @@ -25,7 +22,6 @@ const KmHelper = require("kmhelper"); * @constant */ const aggregationTypeEnum = ["SUM", "AVERAGE"]; - /** * via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. * Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option @@ -34,16 +30,10 @@ const aggregationTypeEnum = ["SUM", "AVERAGE"]; * @constant */ const aggregationType = "SUM"; - const parameterName_computationIndicatorId = "COMPUTATION_ID"; - const parameterName_numberOfTemporalItems = "NUMBER_OF_TEMPORAL_ITEMS"; - // allowed values ['YEARS', 'MONTHS', 'DAYS'] const parameterName_temporalType = "TEMPORAL_TYPE"; - - - /** * This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined * as method parameters that can be used within the method body. @@ -61,43 +51,36 @@ const parameterName_temporalType = "TEMPORAL_TYPE"; * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ - +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters) { // get the id to be used for calculations var computationIndicatorId = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId, processParameters); var temporalType = KmHelper.getProcessParameterByName_asString(parameterName_temporalType, processParameters); var numberOfTemporalItems = KmHelper.getProcessParameterByName_asNumber(parameterName_numberOfTemporalItems, processParameters); - - // get the indicator using the computationIndicatorId - var computationIndicator = KmHelper.getBaseIndicatorById(computationIndicatorId, baseIndicatorsMap) - KmHelper.log("Retrieved required computationIndicator successfully."); - + var computationIndicator = KmHelper.getBaseIndicatorById(computationIndicatorId, baseIndicatorsMap); + KmHelper.log("Retrieved required computationIndicator successfully."); // now we compute the new indicator for an absolute change compared to previous year // internally tests are run, e.g. if a previous year is available or not var resultMap = new Map(); - - if(temporalType === "YEARS"){ - resultMap = KmHelper.changeAbsolute_n_years(computationIndicator, targetDate, numberOfTemporalItems); - } - else if(temporalType === "MONTHS"){ - resultMap = KmHelper.changeAbsolute_n_months(computationIndicator, targetDate, numberOfTemporalItems); - } - else if(temporalType === "DAYS"){ - resultMap = KmHelper.changeAbsolute_n_days(computationIndicator, targetDate, numberOfTemporalItems); - } - else{ - KmHelper.log("WARNING: parameter '" + parameterName_temporalType + "' with allowed values ['YEARS', 'MONTHS', 'DAYS'] has unknown value '" + temporalType + "'. Will use YEARS as default"); - resultMap = KmHelper.changeAbsolute_n_years(computationIndicator, targetDate, numberOfTemporalItems); - } - + if (temporalType === "YEARS") { + resultMap = KmHelper.changeAbsolute_n_years(computationIndicator, targetDate, numberOfTemporalItems); + } + else if (temporalType === "MONTHS") { + resultMap = KmHelper.changeAbsolute_n_months(computationIndicator, targetDate, numberOfTemporalItems); + } + else if (temporalType === "DAYS") { + resultMap = KmHelper.changeAbsolute_n_days(computationIndicator, targetDate, numberOfTemporalItems); + } + else { + KmHelper.log("WARNING: parameter '" + parameterName_temporalType + "' with allowed values ['YEARS', 'MONTHS', 'DAYS'] has unknown value '" + temporalType + "'. Will use YEARS as default"); + resultMap = KmHelper.changeAbsolute_n_years(computationIndicator, targetDate, numberOfTemporalItems); + } var numFeatures = targetSpatialUnit_geoJSON.features.length; KmHelper.log("Computed change indicator for a total amount of " + numFeatures + " features"); targetSpatialUnit_geoJSON = KmHelper.setIndicatorValues_fromIdValueMap(targetSpatialUnit_geoJSON, targetDate, resultMap); KmHelper.log("Computation of absolute change compared to previous year finished"); return targetSpatialUnit_geoJSON; } - /** * This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). * The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. @@ -113,22 +96,22 @@ async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndic * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - if (!aggregationTypeEnum.includes(aggregationType)){ - console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + - "'. Allowed values are: " + aggregationTypeEnum); - console.log("Will fallback to using AVERAGE aggregation logic."); - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else if(aggregationType === "SUM"){ - return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else { - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } -}; - +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)) { + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if (aggregationType === "SUM") { + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +} +; /** * This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). * @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! @@ -139,12 +122,10 @@ function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geo * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // disaggregate indicator - -}; - - +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // disaggregate indicator +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. @@ -158,74 +139,60 @@ function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check to aggregate - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var baseIndicatorTotalWeight = 0; - var featureCounter = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - featureCounter++; - - // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number - if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ - // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method - // it "survives" until this aggregation logic within processing engine - var weight = KmHelper.getAggregationWeight(indicatorFeature); - - // use weight as weight for indicator value - baseIndicatorTotalWeight += weight; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; - } - } - } - - // compute average for share - if(baseIndicatorTotalWeight === 0){ - targetFeature.properties[targetDate] = Number.NaN; +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; } - else { - targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if (!Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined) { + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + // compute average for share + if (baseIndicatorTotalWeight === 0) { + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + KmHelper.log("Aggregation finished"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); } - // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); - }); - - KmHelper.log("Aggregation finished"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - + return targetSpatialUnit_geoJSON; +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} @@ -239,59 +206,47 @@ function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - var totalAggregatedIndicatorFeatures = 0; - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check for aggregation - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var numberOfIndicatorFeaturesWithinTargetFeature = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - numberOfIndicatorFeaturesWithinTargetFeature++; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); - } - } - totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; - }); - - KmHelper.log("Aggregation finished"); - KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - - +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + var totalAggregatedIndicatorFeatures = 0; + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; + } + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + return targetSpatialUnit_geoJSON; +} +; module.exports.computeIndicator = computeIndicator; module.exports.aggregateIndicator = aggregateIndicator; module.exports.disaggregateIndicator = disaggregateIndicator; +//# sourceMappingURL=km_indicator_absChange_nTemporalItems.js.map \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_indicator_absChange_nTemporalItems.js.map b/app/kommonitor-script-resources/km_indicator_absChange_nTemporalItems.js.map new file mode 100644 index 000000000..bedd63871 --- /dev/null +++ b/app/kommonitor-script-resources/km_indicator_absChange_nTemporalItems.js.map @@ -0,0 +1 @@ +{"version":3,"file":"km_indicator_absChange_nTemporalItems.js","sourceRoot":"","sources":["km_indicator_absChange_nTemporalItems.ts"],"names":[],"mappings":";AAAA,8JAA8J;AAC9J,yRAAyR;AACzR,8JAA8J;AAC9J,4GAA4G;A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AC,gBAAgB,GAAG,gBAAgB,CAAC;AACnD,MAAM,CAAC,OAAO,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;AACvD,MAAM,CAAC,OAAO,CAAC,qBAAqB,GAAG,qBAAqB,CAAC"} \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_indicator_absChange_nTemporalItems.ts b/app/kommonitor-script-resources/km_indicator_absChange_nTemporalItems.ts new file mode 100644 index 000000000..285acf85e --- /dev/null +++ b/app/kommonitor-script-resources/km_indicator_absChange_nTemporalItems.ts @@ -0,0 +1,297 @@ +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// NECESSARY NODE MODULE DEPENDENCIES // // +// // +// SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* Module that contains various helper methods (spatial GIS functions and statistical functions) +* to simplify script writing +*/ +const KmHelper = require("kmhelper"); + + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// CONSTANTS DEFINITION // +// here you may specify custom CONSTANTS used within the script. // // // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* This constant specifies allowed values to determine how the aggregation process will deal with indicator values. +* I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. +* Note that these values must not be changed by users! +* @type {Array.} +* @memberof CONSTANTS +* @constant +*/ +const aggregationTypeEnum = ["SUM", "AVERAGE"]; + +/** +* via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. +* Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option +* @type {string} +* @memberof CONSTANTS +* @constant +*/ +const aggregationType = "SUM"; + +const parameterName_computationIndicatorId = "COMPUTATION_ID"; + +const parameterName_numberOfTemporalItems = "NUMBER_OF_TEMPORAL_ITEMS"; + +// allowed values ['YEARS', 'MONTHS', 'DAYS'] +const parameterName_temporalType = "TEMPORAL_TYPE"; + + + +/** +* This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined +* as method parameters that can be used within the method body. +* +* NOTE: The function is async, so users may make use of keyword "await" to wait for results of other async helper API methods. +* (This is necessary when users want to wait for asynchronous method execution such as external API calls in a synchronous program) +* +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit as GeoJSON FeatureCollection object. +* @param {map.>} baseIndicatorsMap - Map containing all indicators, wheres key='meaningful name or id of the indicator' and value='indicator as GeoJSON object' (it contains duplicate entries, one for the indicator name and one for the indicator id) +* @param {map.>} georesourcesMap - Map containing all georesources, wheres key='meaningful name or id of the georesource' and value='georesource as GeoJSON object' (they are used to execute geometric/toptologic computations) (it contains duplicate entries, one for the georesource name and one for the georesource id) +* @param {Array.>} processParameters - an array containing objects representing variable additional process parameters that are required to perform the indicator computation. +* Each entry has properties Object.name and Object.value for name and value of the parameter. +* @returns {FeatureCollection} the computed indicator for submitted {@linkcode targetSpatialUnit_geoJSON} features as GeoJSON FeatureCollection +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ + + // get the id to be used for calculations + var computationIndicatorId = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId, processParameters); + var temporalType = KmHelper.getProcessParameterByName_asString(parameterName_temporalType, processParameters); + var numberOfTemporalItems = KmHelper.getProcessParameterByName_asNumber(parameterName_numberOfTemporalItems, processParameters); + + + // get the indicator using the computationIndicatorId + var computationIndicator = KmHelper.getBaseIndicatorById(computationIndicatorId, baseIndicatorsMap) + KmHelper.log("Retrieved required computationIndicator successfully."); + + // now we compute the new indicator for an absolute change compared to previous year + // internally tests are run, e.g. if a previous year is available or not + var resultMap = new Map(); + + if(temporalType === "YEARS"){ + resultMap = KmHelper.changeAbsolute_n_years(computationIndicator, targetDate, numberOfTemporalItems); + } + else if(temporalType === "MONTHS"){ + resultMap = KmHelper.changeAbsolute_n_months(computationIndicator, targetDate, numberOfTemporalItems); + } + else if(temporalType === "DAYS"){ + resultMap = KmHelper.changeAbsolute_n_days(computationIndicator, targetDate, numberOfTemporalItems); + } + else{ + KmHelper.log("WARNING: parameter '" + parameterName_temporalType + "' with allowed values ['YEARS', 'MONTHS', 'DAYS'] has unknown value '" + temporalType + "'. Will use YEARS as default"); + resultMap = KmHelper.changeAbsolute_n_years(computationIndicator, targetDate, numberOfTemporalItems); + } + + var numFeatures = targetSpatialUnit_geoJSON.features.length; + KmHelper.log("Computed change indicator for a total amount of " + numFeatures + " features"); + targetSpatialUnit_geoJSON = KmHelper.setIndicatorValues_fromIdValueMap(targetSpatialUnit_geoJSON, targetDate, resultMap); + KmHelper.log("Computation of absolute change compared to previous year finished"); + return targetSpatialUnit_geoJSON; +} + +/** +* This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). +* The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. +* The aggrgation internally aggregates features of {@linkcode indicator_geoJSON} to features of {@linkcode targetSpatialUnit_geoJSON} by comparing their geometries. +* Each {@linkcode indicator_geoJSON} feature whose geometry lies within a certain geometry of a {@linkcode targetSpatialUnit_geoJSON} feature will be used to compute the aggregated indicator values. +* The within comparison is executed by method {@linkcode within_usingBBOX}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be aggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter targetSpatialUnit_geoJSON +* @see aggregationType +* @see within_usingBBOX +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the aggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)){ + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if(aggregationType === "SUM"){ + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +}; + +/** +* This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). +* @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be disaggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be disaggregated to the features of parameter targetSpatialUnit_geoJSON +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the disaggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // disaggregate indicator + +}; + + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. +* Also it uses the {@linkcode KmHelper.getAggregationWeight(feature)} method as weight during aggregtion. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + + // compute average for share + if(baseIndicatorTotalWeight === 0){ + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + + KmHelper.log("Aggregation finished"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} +* to determine which features of {@linkcode indicator_geoJSON} can be aggregated to which features of {@linkcode targetSpatialUnit_geoJSON}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + var totalAggregatedIndicatorFeatures = 0; + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + + +module.exports.computeIndicator = computeIndicator; +module.exports.aggregateIndicator = aggregateIndicator; +module.exports.disaggregateIndicator = disaggregateIndicator; diff --git a/app/kommonitor-script-resources/km_indicator_absChange_refDate.js b/app/kommonitor-script-resources/km_indicator_absChange_refDate.js index 903449f12..59ffffc76 100644 --- a/app/kommonitor-script-resources/km_indicator_absChange_refDate.js +++ b/app/kommonitor-script-resources/km_indicator_absChange_refDate.js @@ -1,21 +1,18 @@ +"use strict"; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // NECESSARY NODE MODULE DEPENDENCIES // // // // // SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * Module that contains various helper methods (spatial GIS functions and statistical functions) * to simplify script writing */ const KmHelper = require("kmhelper"); - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // CONSTANTS DEFINITION // // here you may specify custom CONSTANTS used within the script. // // // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * This constant specifies allowed values to determine how the aggregation process will deal with indicator values. * I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. @@ -25,7 +22,6 @@ const KmHelper = require("kmhelper"); * @constant */ const aggregationTypeEnum = ["SUM", "AVERAGE"]; - /** * via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. * Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option @@ -34,13 +30,8 @@ const aggregationTypeEnum = ["SUM", "AVERAGE"]; * @constant */ const aggregationType = "SUM"; - const parameterName_computationIndicatorId = "COMPUTATION_ID"; - const parameterName_referenceDATE = "REFERENCE_DATE"; - - - /** * This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined * as method parameters that can be used within the method body. @@ -58,28 +49,23 @@ const parameterName_referenceDATE = "REFERENCE_DATE"; * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ - +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters) { // get the id to be used for calculations var computationIndicatorId = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId, processParameters); // get reference date var referenceDate = KmHelper.getProcessParameterByName_asString(parameterName_referenceDATE, processParameters); - // get the indicator using the computationIndicatorId - var computationIndicator = KmHelper.getBaseIndicatorById(computationIndicatorId, baseIndicatorsMap) - KmHelper.log("Retrieved required computationIndicator successfully."); - + var computationIndicator = KmHelper.getBaseIndicatorById(computationIndicatorId, baseIndicatorsMap); + KmHelper.log("Retrieved required computationIndicator successfully."); // now we compute the new indicator for an absolute change compared to previous year // internally tests are run, e.g. if a previous year is available or not var resultMap = KmHelper.changeAbsolute_referenceDate(computationIndicator, targetDate, referenceDate); - var numFeatures = targetSpatialUnit_geoJSON.features.length; KmHelper.log("Computed change indicator for a total amount of " + numFeatures + " features"); targetSpatialUnit_geoJSON = KmHelper.setIndicatorValues_fromIdValueMap(targetSpatialUnit_geoJSON, targetDate, resultMap); KmHelper.log("Computation of absolute change compared to previous year finished"); return targetSpatialUnit_geoJSON; } - /** * This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). * The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. @@ -95,22 +81,22 @@ async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndic * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - if (!aggregationTypeEnum.includes(aggregationType)){ - console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + - "'. Allowed values are: " + aggregationTypeEnum); - console.log("Will fallback to using AVERAGE aggregation logic."); - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else if(aggregationType === "SUM"){ - return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else { - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } -}; - +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)) { + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if (aggregationType === "SUM") { + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +} +; /** * This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). * @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! @@ -121,12 +107,10 @@ function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geo * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // disaggregate indicator - -}; - - +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // disaggregate indicator +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. @@ -140,74 +124,60 @@ function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check to aggregate - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var baseIndicatorTotalWeight = 0; - var featureCounter = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - featureCounter++; - - // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number - if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ - // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method - // it "survives" until this aggregation logic within processing engine - var weight = KmHelper.getAggregationWeight(indicatorFeature); - - // use weight as weight for indicator value - baseIndicatorTotalWeight += weight; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; - } - } - } - - // compute average for share - if(baseIndicatorTotalWeight === 0){ - targetFeature.properties[targetDate] = Number.NaN; +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; } - else { - targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if (!Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined) { + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + // compute average for share + if (baseIndicatorTotalWeight === 0) { + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + KmHelper.log("Aggregation finished"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); } - // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); - }); - - KmHelper.log("Aggregation finished"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - + return targetSpatialUnit_geoJSON; +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} @@ -221,59 +191,47 @@ function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - var totalAggregatedIndicatorFeatures = 0; - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check for aggregation - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var numberOfIndicatorFeaturesWithinTargetFeature = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - numberOfIndicatorFeaturesWithinTargetFeature++; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); - } - } - totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; - }); - - KmHelper.log("Aggregation finished"); - KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - - +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + var totalAggregatedIndicatorFeatures = 0; + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; + } + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + return targetSpatialUnit_geoJSON; +} +; module.exports.computeIndicator = computeIndicator; module.exports.aggregateIndicator = aggregateIndicator; module.exports.disaggregateIndicator = disaggregateIndicator; +//# sourceMappingURL=km_indicator_absChange_refDate.js.map \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_indicator_absChange_refDate.js.map b/app/kommonitor-script-resources/km_indicator_absChange_refDate.js.map new file mode 100644 index 000000000..71a03267d --- /dev/null +++ b/app/kommonitor-script-resources/km_indicator_absChange_refDate.js.map @@ -0,0 +1 @@ +{"version":3,"file":"km_indicator_absChange_refDate.js","sourceRoot":"","sources":["km_indicator_absChange_refDate.ts"],"names":[],"mappings":";AAAA,8JAA8J;AAC9J,yRAAyR;AACzR,8JAA8J;AAC9J,4GAA4G;AAC5G,8JAA8J;AAE9J;;;EAGE;AACF,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAGrC,8JAA8J;AAC9J,8JAA8J;AAC9J,6OAA6O;AAC7O,8JAA8J;AAE9J;;;;;;;EAOE;AACF,MAAM,mBAAmB,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AAE/C;;;;;;EAME;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C;IAEjJ,IAAG,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAC;QAC9B,OAAO,CAAC,KAAK,CAAC,mDAAmD,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAC9F,MAAM,KAAK,CAAC,6DAA6D,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;KACvG;IAED,OAAO,yBAAyB,CAAC;AACnC,CAAC;AAAA,CAAC;AAGF,MAAM,CAAC,OAAO,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;AACnD,MAAM,CAAC,OAAO,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;AACvD,MAAM,CAAC,OAAO,CAAC,qBAAqB,GAAG,qBAAqB,CAAC"} \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_indicator_absChange_refDate.ts b/app/kommonitor-script-resources/km_indicator_absChange_refDate.ts new file mode 100644 index 000000000..903449f12 --- /dev/null +++ b/app/kommonitor-script-resources/km_indicator_absChange_refDate.ts @@ -0,0 +1,279 @@ +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// NECESSARY NODE MODULE DEPENDENCIES // // +// // +// SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* Module that contains various helper methods (spatial GIS functions and statistical functions) +* to simplify script writing +*/ +const KmHelper = require("kmhelper"); + + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// CONSTANTS DEFINITION // +// here you may specify custom CONSTANTS used within the script. // // // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* This constant specifies allowed values to determine how the aggregation process will deal with indicator values. +* I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. +* Note that these values must not be changed by users! +* @type {Array.} +* @memberof CONSTANTS +* @constant +*/ +const aggregationTypeEnum = ["SUM", "AVERAGE"]; + +/** +* via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. +* Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option +* @type {string} +* @memberof CONSTANTS +* @constant +*/ +const aggregationType = "SUM"; + +const parameterName_computationIndicatorId = "COMPUTATION_ID"; + +const parameterName_referenceDATE = "REFERENCE_DATE"; + + + +/** +* This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined +* as method parameters that can be used within the method body. +* +* NOTE: The function is async, so users may make use of keyword "await" to wait for results of other async helper API methods. +* (This is necessary when users want to wait for asynchronous method execution such as external API calls in a synchronous program) +* +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit as GeoJSON FeatureCollection object. +* @param {map.>} baseIndicatorsMap - Map containing all indicators, wheres key='meaningful name or id of the indicator' and value='indicator as GeoJSON object' (it contains duplicate entries, one for the indicator name and one for the indicator id) +* @param {map.>} georesourcesMap - Map containing all georesources, wheres key='meaningful name or id of the georesource' and value='georesource as GeoJSON object' (they are used to execute geometric/toptologic computations) (it contains duplicate entries, one for the georesource name and one for the georesource id) +* @param {Array.>} processParameters - an array containing objects representing variable additional process parameters that are required to perform the indicator computation. +* Each entry has properties Object.name and Object.value for name and value of the parameter. +* @returns {FeatureCollection} the computed indicator for submitted {@linkcode targetSpatialUnit_geoJSON} features as GeoJSON FeatureCollection +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ + + // get the id to be used for calculations + var computationIndicatorId = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId, processParameters); + // get reference date + var referenceDate = KmHelper.getProcessParameterByName_asString(parameterName_referenceDATE, processParameters); + + // get the indicator using the computationIndicatorId + var computationIndicator = KmHelper.getBaseIndicatorById(computationIndicatorId, baseIndicatorsMap) + KmHelper.log("Retrieved required computationIndicator successfully."); + + // now we compute the new indicator for an absolute change compared to previous year + // internally tests are run, e.g. if a previous year is available or not + var resultMap = KmHelper.changeAbsolute_referenceDate(computationIndicator, targetDate, referenceDate); + + var numFeatures = targetSpatialUnit_geoJSON.features.length; + KmHelper.log("Computed change indicator for a total amount of " + numFeatures + " features"); + targetSpatialUnit_geoJSON = KmHelper.setIndicatorValues_fromIdValueMap(targetSpatialUnit_geoJSON, targetDate, resultMap); + KmHelper.log("Computation of absolute change compared to previous year finished"); + return targetSpatialUnit_geoJSON; +} + +/** +* This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). +* The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. +* The aggrgation internally aggregates features of {@linkcode indicator_geoJSON} to features of {@linkcode targetSpatialUnit_geoJSON} by comparing their geometries. +* Each {@linkcode indicator_geoJSON} feature whose geometry lies within a certain geometry of a {@linkcode targetSpatialUnit_geoJSON} feature will be used to compute the aggregated indicator values. +* The within comparison is executed by method {@linkcode within_usingBBOX}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be aggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter targetSpatialUnit_geoJSON +* @see aggregationType +* @see within_usingBBOX +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the aggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)){ + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if(aggregationType === "SUM"){ + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +}; + +/** +* This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). +* @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be disaggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be disaggregated to the features of parameter targetSpatialUnit_geoJSON +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the disaggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // disaggregate indicator + +}; + + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. +* Also it uses the {@linkcode KmHelper.getAggregationWeight(feature)} method as weight during aggregtion. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + + // compute average for share + if(baseIndicatorTotalWeight === 0){ + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + + KmHelper.log("Aggregation finished"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} +* to determine which features of {@linkcode indicator_geoJSON} can be aggregated to which features of {@linkcode targetSpatialUnit_geoJSON}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + var totalAggregatedIndicatorFeatures = 0; + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + + +module.exports.computeIndicator = computeIndicator; +module.exports.aggregateIndicator = aggregateIndicator; +module.exports.disaggregateIndicator = disaggregateIndicator; diff --git a/app/kommonitor-script-resources/km_indicator_continuity_nTemporalItems.js b/app/kommonitor-script-resources/km_indicator_continuity_nTemporalItems.js index 7cb82eabd..0133417ec 100644 --- a/app/kommonitor-script-resources/km_indicator_continuity_nTemporalItems.js +++ b/app/kommonitor-script-resources/km_indicator_continuity_nTemporalItems.js @@ -1,21 +1,18 @@ +"use strict"; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // NECESSARY NODE MODULE DEPENDENCIES // // // // // SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * Module that contains various helper methods (spatial GIS functions and statistical functions) * to simplify script writing */ const KmHelper = require("kmhelper"); - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // CONSTANTS DEFINITION // // here you may specify custom CONSTANTS used within the script. // // // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * This constant specifies allowed values to determine how the aggregation process will deal with indicator values. * I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. @@ -25,7 +22,6 @@ const KmHelper = require("kmhelper"); * @constant */ const aggregationTypeEnum = ["SUM", "AVERAGE"]; - /** * via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. * Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option @@ -34,15 +30,10 @@ const aggregationTypeEnum = ["SUM", "AVERAGE"]; * @constant */ const aggregationType = "SUM"; - const parameterName_computationIndicatorId = "COMPUTATION_ID"; - const parameterName_numberOfTemporalItems = "NUMBER_OF_TEMPORAL_ITEMS"; - // allowed values ['YEARS', 'MONTHS', 'DAYS'] -const parameterName_temporalType = "TEMPORAL_TYPE" - - +const parameterName_temporalType = "TEMPORAL_TYPE"; /** * This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined * as method parameters that can be used within the method body. @@ -60,43 +51,36 @@ const parameterName_temporalType = "TEMPORAL_TYPE" * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ - +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters) { // get the id to be used for calculations var computationIndicatorId = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId, processParameters); - var temporalType = KmHelper.getProcessParameterByName_asString(parameterName_temporalType, processParameters); + var temporalType = KmHelper.getProcessParameterByName_asString(parameterName_temporalType, processParameters); var numberOfTemporalItems = KmHelper.getProcessParameterByName_asNumber(parameterName_numberOfTemporalItems, processParameters); - // get the indicator using the computationIndicatorId var computationIndicator = KmHelper.getBaseIndicatorById(computationIndicatorId, baseIndicatorsMap); - KmHelper.log("Retrieved required computationIndicator successfully."); - + KmHelper.log("Retrieved required computationIndicator successfully."); // now we compute the new indicator for the continuity within n consecutive years // internally tests are run, e.g. if n previous years are available or not - - var resultMap = new Map(); - - if(temporalType === "YEARS"){ - resultMap = KmHelper.continuity_consecutive_n_years(computationIndicator, targetDate, numberOfTemporalItems); - } - else if(temporalType === "MONTHS"){ - resultMap = KmHelper.continuity_consecutive_n_months(computationIndicator, targetDate, numberOfTemporalItems); - } - else if(temporalType === "DAYS"){ - resultMap = KmHelper.continuity_consecutive_n_days(computationIndicator, targetDate, numberOfTemporalItems); - } - else{ - KmHelper.log("WARNING: parameter '" + parameterName_temporalType + "' with allowed values ['YEARS', 'MONTHS', 'DAYS'] has unknown value '" + temporalType + "'. Will use YEARS as default"); - resultMap = KmHelper.continuity_consecutive_n_years(computationIndicator, targetDate, numberOfTemporalItems); - } - + var resultMap = new Map(); + if (temporalType === "YEARS") { + resultMap = KmHelper.continuity_consecutive_n_years(computationIndicator, targetDate, numberOfTemporalItems); + } + else if (temporalType === "MONTHS") { + resultMap = KmHelper.continuity_consecutive_n_months(computationIndicator, targetDate, numberOfTemporalItems); + } + else if (temporalType === "DAYS") { + resultMap = KmHelper.continuity_consecutive_n_days(computationIndicator, targetDate, numberOfTemporalItems); + } + else { + KmHelper.log("WARNING: parameter '" + parameterName_temporalType + "' with allowed values ['YEARS', 'MONTHS', 'DAYS'] has unknown value '" + temporalType + "'. Will use YEARS as default"); + resultMap = KmHelper.continuity_consecutive_n_years(computationIndicator, targetDate, numberOfTemporalItems); + } var numFeatures = targetSpatialUnit_geoJSON.features.length; KmHelper.log("Computed continuity indicator for a total amount of " + numFeatures + " features"); targetSpatialUnit_geoJSON = KmHelper.setIndicatorValues_fromIdValueMap(targetSpatialUnit_geoJSON, targetDate, resultMap); KmHelper.log("Computation of the continuity finished"); return targetSpatialUnit_geoJSON; } - /** * This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). * The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. @@ -112,22 +96,22 @@ async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndic * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - if (!aggregationTypeEnum.includes(aggregationType)){ - console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + - "'. Allowed values are: " + aggregationTypeEnum); - console.log("Will fallback to using AVERAGE aggregation logic."); - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else if(aggregationType === "SUM"){ - return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else { - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } -}; - +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)) { + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if (aggregationType === "SUM") { + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +} +; /** * This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). * @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! @@ -138,12 +122,10 @@ function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geo * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // disaggregate indicator - -}; - - +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // disaggregate indicator +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. @@ -157,74 +139,60 @@ function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check to aggregate - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var baseIndicatorTotalWeight = 0; - var featureCounter = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - featureCounter++; - - // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number - if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ - // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method - // it "survives" until this aggregation logic within processing engine - var weight = KmHelper.getAggregationWeight(indicatorFeature); - - // use weight as weight for indicator value - baseIndicatorTotalWeight += weight; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; - } - } - } - - // compute average for share - if(baseIndicatorTotalWeight === 0){ - targetFeature.properties[targetDate] = Number.NaN; +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; } - else { - targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if (!Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined) { + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + // compute average for share + if (baseIndicatorTotalWeight === 0) { + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + KmHelper.log("Aggregation finished"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); } - // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); - }); - - KmHelper.log("Aggregation finished"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - + return targetSpatialUnit_geoJSON; +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} @@ -238,59 +206,47 @@ function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - var totalAggregatedIndicatorFeatures = 0; - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check for aggregation - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var numberOfIndicatorFeaturesWithinTargetFeature = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - numberOfIndicatorFeaturesWithinTargetFeature++; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); - } - } - totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; - }); - - KmHelper.log("Aggregation finished"); - KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - - +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + var totalAggregatedIndicatorFeatures = 0; + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; + } + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + return targetSpatialUnit_geoJSON; +} +; module.exports.computeIndicator = computeIndicator; module.exports.aggregateIndicator = aggregateIndicator; module.exports.disaggregateIndicator = disaggregateIndicator; +//# sourceMappingURL=km_indicator_continuity_nTemporalItems.js.map \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_indicator_continuity_nTemporalItems.js.map b/app/kommonitor-script-resources/km_indicator_continuity_nTemporalItems.js.map new file mode 100644 index 000000000..3b9d617be --- /dev/null +++ b/app/kommonitor-script-resources/km_indicator_continuity_nTemporalItems.js.map @@ -0,0 +1 @@ +{"version":3,"file":"km_indicator_continuity_nTemporalItems.js","sourceRoot":"","sources":["km_indicator_continuity_nTemporalItems.ts"],"names":[],"mappings":";AAAA,8JAA8J;AAC9J,yRAAyR;AACzR,8JAA8J;AAC9J,4GAA4G;AAC5G,8JAA8J;AAE9J;;;EAGE;AACF,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAGrC,8JAA8J;AAC9J,8JAA8J;AAC9J,6OAA6O;AAC7O,8JAA8J;AAE9J;;;;;;;EAOE;AACF,MAAM,mBAAmB,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AAE/C;;;;;;EAME;AACF,MAAM,eAAe,GAAG,KAAK,CAAC;AAE9B,MAAM,oCAAoC,GAAG,gBAAgB,CAAC;AAE9D,MAAM,mCAAmC,GAAG,0BAA0B,CAAC;AAEvE,6CAA6C;AAC7C,MAAM,0BAA0B,GAAG,eAAe,CAAA;AAGlD;;;;;;;;;;;;;;;;EAgBE;AACF,KAAK,UAAU,gBAAgB,CAAC,UAAU,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,eAAe,EAAE,iBAAiB;IAExH,yCAAyC;IACzC,IAAI,sBAAsB,GAAG,QAAQ,CAAC,kCAAkC,CAAC,oCAAoC,EAAE,iBAAiB,CAAC,CAAC;IACrI,IAAI,YAAY,GAAG,QAAQ,CAAC,kCAAkC,CAAC,0BAA0B,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C;aACxF;SACD;QACA,gCAAgC,IAAI,4CAA4C,CAAC;IACnF,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;IACrC,QAAQ,CAAC,GAAG,CAAC,gCAAgC,GAAG,+BAA+B,GAAG,yBAAyB,CAAC,QAAQ,CAAC,MAAM,GAAG,iBAAiB,CAAC,CAAC;IAEjJ,IAAG,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAC;QAC9B,OAAO,CAAC,KAAK,CAAC,mDAAmD,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAC9F,MAAM,KAAK,CAAC,6DAA6D,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;KACvG;IAED,OAAO,yBAAyB,CAAC;AACnC,CAAC;AAAA,CAAC;AAGF,MAAM,CAAC,OAAO,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;AACnD,MAAM,CAAC,OAAO,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;AACvD,MAAM,CAAC,OAAO,CAAC,qBAAqB,GAAG,qBAAqB,CAAC"} \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_indicator_continuity_nTemporalItems.ts b/app/kommonitor-script-resources/km_indicator_continuity_nTemporalItems.ts new file mode 100644 index 000000000..7cb82eabd --- /dev/null +++ b/app/kommonitor-script-resources/km_indicator_continuity_nTemporalItems.ts @@ -0,0 +1,296 @@ +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// NECESSARY NODE MODULE DEPENDENCIES // // +// // +// SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* Module that contains various helper methods (spatial GIS functions and statistical functions) +* to simplify script writing +*/ +const KmHelper = require("kmhelper"); + + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// CONSTANTS DEFINITION // +// here you may specify custom CONSTANTS used within the script. // // // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* This constant specifies allowed values to determine how the aggregation process will deal with indicator values. +* I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. +* Note that these values must not be changed by users! +* @type {Array.} +* @memberof CONSTANTS +* @constant +*/ +const aggregationTypeEnum = ["SUM", "AVERAGE"]; + +/** +* via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. +* Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option +* @type {string} +* @memberof CONSTANTS +* @constant +*/ +const aggregationType = "SUM"; + +const parameterName_computationIndicatorId = "COMPUTATION_ID"; + +const parameterName_numberOfTemporalItems = "NUMBER_OF_TEMPORAL_ITEMS"; + +// allowed values ['YEARS', 'MONTHS', 'DAYS'] +const parameterName_temporalType = "TEMPORAL_TYPE" + + +/** +* This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined +* as method parameters that can be used within the method body. +* +* NOTE: The function is async, so users may make use of keyword "await" to wait for results of other async helper API methods. +* (This is necessary when users want to wait for asynchronous method execution such as external API calls in a synchronous program) +* +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit as GeoJSON FeatureCollection object. +* @param {map.>} baseIndicatorsMap - Map containing all indicators, wheres key='meaningful name or id of the indicator' and value='indicator as GeoJSON object' (it contains duplicate entries, one for the indicator name and one for the indicator id) +* @param {map.>} georesourcesMap - Map containing all georesources, wheres key='meaningful name or id of the georesource' and value='georesource as GeoJSON object' (they are used to execute geometric/toptologic computations) (it contains duplicate entries, one for the georesource name and one for the georesource id) +* @param {Array.>} processParameters - an array containing objects representing variable additional process parameters that are required to perform the indicator computation. +* Each entry has properties Object.name and Object.value for name and value of the parameter. +* @returns {FeatureCollection} the computed indicator for submitted {@linkcode targetSpatialUnit_geoJSON} features as GeoJSON FeatureCollection +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ + + // get the id to be used for calculations + var computationIndicatorId = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId, processParameters); + var temporalType = KmHelper.getProcessParameterByName_asString(parameterName_temporalType, processParameters); + var numberOfTemporalItems = KmHelper.getProcessParameterByName_asNumber(parameterName_numberOfTemporalItems, processParameters); + + // get the indicator using the computationIndicatorId + var computationIndicator = KmHelper.getBaseIndicatorById(computationIndicatorId, baseIndicatorsMap); + KmHelper.log("Retrieved required computationIndicator successfully."); + + // now we compute the new indicator for the continuity within n consecutive years + // internally tests are run, e.g. if n previous years are available or not + + var resultMap = new Map(); + + if(temporalType === "YEARS"){ + resultMap = KmHelper.continuity_consecutive_n_years(computationIndicator, targetDate, numberOfTemporalItems); + } + else if(temporalType === "MONTHS"){ + resultMap = KmHelper.continuity_consecutive_n_months(computationIndicator, targetDate, numberOfTemporalItems); + } + else if(temporalType === "DAYS"){ + resultMap = KmHelper.continuity_consecutive_n_days(computationIndicator, targetDate, numberOfTemporalItems); + } + else{ + KmHelper.log("WARNING: parameter '" + parameterName_temporalType + "' with allowed values ['YEARS', 'MONTHS', 'DAYS'] has unknown value '" + temporalType + "'. Will use YEARS as default"); + resultMap = KmHelper.continuity_consecutive_n_years(computationIndicator, targetDate, numberOfTemporalItems); + } + + var numFeatures = targetSpatialUnit_geoJSON.features.length; + KmHelper.log("Computed continuity indicator for a total amount of " + numFeatures + " features"); + targetSpatialUnit_geoJSON = KmHelper.setIndicatorValues_fromIdValueMap(targetSpatialUnit_geoJSON, targetDate, resultMap); + KmHelper.log("Computation of the continuity finished"); + return targetSpatialUnit_geoJSON; +} + +/** +* This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). +* The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. +* The aggrgation internally aggregates features of {@linkcode indicator_geoJSON} to features of {@linkcode targetSpatialUnit_geoJSON} by comparing their geometries. +* Each {@linkcode indicator_geoJSON} feature whose geometry lies within a certain geometry of a {@linkcode targetSpatialUnit_geoJSON} feature will be used to compute the aggregated indicator values. +* The within comparison is executed by method {@linkcode within_usingBBOX}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be aggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter targetSpatialUnit_geoJSON +* @see aggregationType +* @see within_usingBBOX +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the aggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)){ + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if(aggregationType === "SUM"){ + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +}; + +/** +* This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). +* @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be disaggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be disaggregated to the features of parameter targetSpatialUnit_geoJSON +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the disaggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // disaggregate indicator + +}; + + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. +* Also it uses the {@linkcode KmHelper.getAggregationWeight(feature)} method as weight during aggregtion. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + + // compute average for share + if(baseIndicatorTotalWeight === 0){ + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + + KmHelper.log("Aggregation finished"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} +* to determine which features of {@linkcode indicator_geoJSON} can be aggregated to which features of {@linkcode targetSpatialUnit_geoJSON}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + var totalAggregatedIndicatorFeatures = 0; + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + + +module.exports.computeIndicator = computeIndicator; +module.exports.aggregateIndicator = aggregateIndicator; +module.exports.disaggregateIndicator = disaggregateIndicator; diff --git a/app/kommonitor-script-resources/km_indicator_divide.js b/app/kommonitor-script-resources/km_indicator_divide.js index 0d94429c0..060166ec5 100644 --- a/app/kommonitor-script-resources/km_indicator_divide.js +++ b/app/kommonitor-script-resources/km_indicator_divide.js @@ -1,22 +1,19 @@ +"use strict"; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // NECESSARY NODE MODULE DEPENDENCIES // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // NECESSARY NODE MODULE DEPENDENCIES // // // // // SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * Module that contains various helper methods (spatial GIS functions and statistical functions) * to simplify script writing */ const KmHelper = require("kmhelper"); - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // CONSTANTS DEFINITION // // here you may specify custom CONSTANTS used within the script. // // // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * This constant specifies allowed values to determine how the aggregation process will deal with indicator values. * I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. @@ -26,7 +23,6 @@ const KmHelper = require("kmhelper"); * @constant */ const aggregationTypeEnum = ["SUM", "AVERAGE"]; - /** * via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. * Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option @@ -35,10 +31,8 @@ const aggregationTypeEnum = ["SUM", "AVERAGE"]; * @constant */ const aggregationType = "MEAN"; - const parameterName_computationIndicatorId_numerator = "COMPUTATION_ID_numerator"; const parameterName_computationIndicatorId_denominator = "COMPUTATION_ID_denominator"; - /** * This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined * as method parameters that can be used within the method body. @@ -56,156 +50,128 @@ const parameterName_computationIndicatorId_denominator = "COMPUTATION_ID_denomin * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ - - var computationIndicatorId_numerator = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId_numerator, processParameters); - var numeratorGeoJSON = KmHelper.getBaseIndicatorById(computationIndicatorId_numerator, baseIndicatorsMap); - - var computationIndicatorId_denominator = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId_denominator, processParameters); - var denominatorGeoJSON = KmHelper.getBaseIndicatorById(computationIndicatorId_denominator, baseIndicatorsMap); - - - KmHelper.log("Retrieved required baseIndicators successfully"); - - // now we compute the new indicator - KmHelper.log("Iterate over base indicators and save intermediate values within a map object"); - - /** - * create a map to store indicator values for each feature of the target spatial unit - * by using such a map object, we can ensure, that we only iterate ONCE over each bease indicator - * and also can only iterate ONCE over each target spatial unit feature at the end to compute the indicator - */ - var map = new Map(); - - KmHelper.log("Process numerator indicator '" + computationIndicatorId_numerator + "'"); - - /** - * iterate over each feature of the baseIndicator and use its indicator value to modify map object - * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! - */ - numeratorGeoJSON.features.forEach(function(feature) { +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters) { + var computationIndicatorId_numerator = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId_numerator, processParameters); + var numeratorGeoJSON = KmHelper.getBaseIndicatorById(computationIndicatorId_numerator, baseIndicatorsMap); + var computationIndicatorId_denominator = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId_denominator, processParameters); + var denominatorGeoJSON = KmHelper.getBaseIndicatorById(computationIndicatorId_denominator, baseIndicatorsMap); + KmHelper.log("Retrieved required baseIndicators successfully"); + // now we compute the new indicator + KmHelper.log("Iterate over base indicators and save intermediate values within a map object"); + /** + * create a map to store indicator values for each feature of the target spatial unit + * by using such a map object, we can ensure, that we only iterate ONCE over each bease indicator + * and also can only iterate ONCE over each target spatial unit feature at the end to compute the indicator + */ + var map = new Map(); + KmHelper.log("Process numerator indicator '" + computationIndicatorId_numerator + "'"); + /** + * iterate over each feature of the baseIndicator and use its indicator value to modify map object + * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! + */ + numeratorGeoJSON.features.forEach(function (feature) { // get the unique featureID of the spatial unit feature as String var featureId = KmHelper.getSpatialUnitFeatureIdValue(feature); // get the time series value of the base indicator feature for the requested target date (with its required prefix!) var numeratorValue = KmHelper.getIndicatorValue(feature, targetDate); - - if(numeratorValue === undefined || numeratorValue === null){ - KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); - KmHelper.log("WARNING: the feature value will thus be set to '0' and computation will continue"); - numeratorValue = 0; - } - // modify map object (i.e. set value initially, or perform calculations and store modified value) + if (numeratorValue === undefined || numeratorValue === null) { + KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); + KmHelper.log("WARNING: the feature value will thus be set to '0' and computation will continue"); + numeratorValue = 0; + } + // modify map object (i.e. set value initially, or perform calculations and store modified value) // key should be unique featureId of the spatial unit feature - if (! map.has(featureId)){ + if (!map.has(featureId)) { var mapObject = { featureId: featureId, indicatorValue: undefined, numeratorValue: 0, - denominatorValue: 0 - }; - - map.set(featureId, mapObject); - } + denominatorValue: 0 + }; + map.set(featureId, mapObject); + } var mapEntry = map.get(featureId); - mapEntry.numeratorValue = numeratorValue; + mapEntry.numeratorValue = numeratorValue; map.set(featureId, mapEntry); - }); - - KmHelper.log("Process denominator indicator"); - - /** - * iterate over each feature of the baseIndicator and use its indicator value to modify map object - * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! - */ - denominatorGeoJSON.features.forEach(function(feature) { + }); + KmHelper.log("Process denominator indicator"); + /** + * iterate over each feature of the baseIndicator and use its indicator value to modify map object + * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! + */ + denominatorGeoJSON.features.forEach(function (feature) { // get the unique featureID of the spatial unit feature as String var featureId = KmHelper.getSpatialUnitFeatureIdValue(feature); // get the time series value of the base indicator feature for the requested target date (with its required prefix!) var denominatorValue = KmHelper.getIndicatorValue(feature, targetDate); - - // modify map object (i.e. set value initially, or perform calculations and store modified value) + // modify map object (i.e. set value initially, or perform calculations and store modified value) // key should be unique featureId of the spatial unit feature - if(denominatorValue === undefined || denominatorValue === null){ - KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); - KmHelper.log("WARNING: the feature value will thus be set to '0' and computation will continue"); - denominatorValue = 0; - } - - if (! map.has(featureId)){ - KmHelper.log("numeratorValue Indicator feature with id '" + featureId + "' was not computed from computation resources. Will set denominatorValue to null."); - var mapObject = { - featureId: featureId, - indicatorValue: undefined, - numeratorValue: 0, - denominatorValue: 0 - }; - - map.set(featureId, mapObject); + if (denominatorValue === undefined || denominatorValue === null) { + KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); + KmHelper.log("WARNING: the feature value will thus be set to '0' and computation will continue"); + denominatorValue = 0; + } + if (!map.has(featureId)) { + KmHelper.log("numeratorValue Indicator feature with id '" + featureId + "' was not computed from computation resources. Will set denominatorValue to null."); + var mapObject = { + featureId: featureId, + indicatorValue: undefined, + numeratorValue: 0, + denominatorValue: 0 + }; + map.set(featureId, mapObject); } - - var mapEntry = map.get(featureId); - mapEntry.denominatorValue = denominatorValue; - + var mapEntry = map.get(featureId); + mapEntry.denominatorValue = denominatorValue; map.set(featureId, mapEntry); - }); - - var numFeatures = targetSpatialUnit_geoJSON.features.length; - - // now we compute the new indicator - KmHelper.log("Compute indicator for a total amount of " + numFeatures + " features"); - - // iterate once over target spatial unit features and compute indicator utilizing map entries - var spatialUnitIndex = 0; - // create progress log after each 10th percent of features - var logProgressIndexSeparator = Math.round(numFeatures / 100 * 10); - targetSpatialUnit_geoJSON.features.forEach(function(spatialUnitFeature) { - + }); + var numFeatures = targetSpatialUnit_geoJSON.features.length; + // now we compute the new indicator + KmHelper.log("Compute indicator for a total amount of " + numFeatures + " features"); + // iterate once over target spatial unit features and compute indicator utilizing map entries + var spatialUnitIndex = 0; + // create progress log after each 10th percent of features + var logProgressIndexSeparator = Math.round(numFeatures / 100 * 10); + targetSpatialUnit_geoJSON.features.forEach(function (spatialUnitFeature) { // get spatialUnit feature id as string --> use it to get associated map entry var spatialUnitFeatureId = KmHelper.getSpatialUnitFeatureIdValue(spatialUnitFeature); - - if (! map.has(spatialUnitFeatureId)){ - KmHelper.log("Target spatial unit feature with id '" + spatialUnitFeatureId + "' was not computed from computation resources. Will set nominator and denominator values to null."); - var mapObject = { - featureId: spatialUnitFeatureId, - indicatorValue: undefined, - numeratorValue: null, - denominatorValue: null + if (!map.has(spatialUnitFeatureId)) { + KmHelper.log("Target spatial unit feature with id '" + spatialUnitFeatureId + "' was not computed from computation resources. Will set nominator and denominator values to null."); + var mapObject = { + featureId: spatialUnitFeatureId, + indicatorValue: undefined, + numeratorValue: null, + denominatorValue: null }; - - map.set(spatialUnitFeatureId, mapObject); - } - + map.set(spatialUnitFeatureId, mapObject); + } var mapEntry = map.get(spatialUnitFeatureId); - var indicatorValue = null; - - if(mapEntry.numeratorValue === undefined || mapEntry.numeratorValue === null || mapEntry.denominatorValue === undefined || mapEntry.denominatorValue === null){ - KmHelper.log("WARNING: the feature with featureID '" + spatialUnitFeatureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); - KmHelper.log("INFO: indicator value is set to null"); - indicatorValue = null; - } else if(mapEntry.denominatorValue === 0) { - indicatorValue = 0; - KmHelper.log("WARNING: the feature with featureID '" + spatialUnitFeatureId + "' cotains a '0' as numerator value for targetDate '" + targetDate + "'"); - KmHelper.log("INFO: indicator value is set to 0"); - } else { - indicatorValue = mapEntry.numeratorValue / mapEntry.denominatorValue; - } - + var indicatorValue = null; + if (mapEntry.numeratorValue === undefined || mapEntry.numeratorValue === null || mapEntry.denominatorValue === undefined || mapEntry.denominatorValue === null) { + KmHelper.log("WARNING: the feature with featureID '" + spatialUnitFeatureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); + KmHelper.log("INFO: indicator value is set to null"); + indicatorValue = null; + } + else if (mapEntry.denominatorValue === 0) { + indicatorValue = 0; + KmHelper.log("WARNING: the feature with featureID '" + spatialUnitFeatureId + "' cotains a '0' as numerator value for targetDate '" + targetDate + "'"); + KmHelper.log("INFO: indicator value is set to 0"); + } + else { + indicatorValue = mapEntry.numeratorValue / mapEntry.denominatorValue; + } // set indicator value for spatialUnitFeature spatialUnitFeature = KmHelper.setIndicatorValue(spatialUnitFeature, targetDate, indicatorValue); - - spatialUnitIndex ++; - + spatialUnitIndex++; // only log after certain progress - if(spatialUnitIndex % logProgressIndexSeparator === 0){ + if (spatialUnitIndex % logProgressIndexSeparator === 0) { KmHelper.log("PROGRESS: Computed '" + spatialUnitIndex + "' of total '" + numFeatures + "' features."); } - }); - - KmHelper.log("Computation of indicator finished"); - - return targetSpatialUnit_geoJSON; -}; - + }); + KmHelper.log("Computation of indicator finished"); + return targetSpatialUnit_geoJSON; +} +; /** * This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). * The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. @@ -221,22 +187,22 @@ async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndic * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - if (!aggregationTypeEnum.includes(aggregationType)){ - console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + - "'. Allowed values are: " + aggregationTypeEnum); - console.log("Will fallback to using AVERAGE aggregation logic."); - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else if(aggregationType === "SUM"){ - return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else { - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } -}; - +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)) { + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if (aggregationType === "SUM") { + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +} +; /** * This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). * @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! @@ -247,12 +213,10 @@ function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geo * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // disaggregate indicator - -}; - - +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // disaggregate indicator +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. @@ -266,74 +230,60 @@ function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check to aggregate - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var baseIndicatorTotalWeight = 0; - var featureCounter = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - featureCounter++; - - // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number - if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ - // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method - // it "survives" until this aggregation logic within processing engine - var weight = KmHelper.getAggregationWeight(indicatorFeature); - - // use weight as weight for indicator value - baseIndicatorTotalWeight += weight; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; - } - } - } - - // compute average for share - if(baseIndicatorTotalWeight === 0){ - targetFeature.properties[targetDate] = Number.NaN; +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; } - else { - targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if (!Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined) { + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + // compute average for share + if (baseIndicatorTotalWeight === 0) { + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + KmHelper.log("Aggregation finished"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); } - // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); - }); - - KmHelper.log("Aggregation finished"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - + return targetSpatialUnit_geoJSON; +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} @@ -347,60 +297,48 @@ function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - var totalAggregatedIndicatorFeatures = 0; - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check for aggregation - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var numberOfIndicatorFeaturesWithinTargetFeature = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - numberOfIndicatorFeaturesWithinTargetFeature++; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); - } - } - totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; - }); - - KmHelper.log("Aggregation finished"); - KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - - +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + var totalAggregatedIndicatorFeatures = 0; + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; + } + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + return targetSpatialUnit_geoJSON; +} +; module.exports.computeIndicator = computeIndicator; module.exports.aggregateIndicator = aggregateIndicator; module.exports.disaggregateIndicator = disaggregateIndicator; - // \ No newline at end of file +// +//# sourceMappingURL=km_indicator_divide.js.map \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_indicator_divide.js.map b/app/kommonitor-script-resources/km_indicator_divide.js.map new file mode 100644 index 000000000..14108f9aa --- /dev/null +++ b/app/kommonitor-script-resources/km_indicator_divide.js.map @@ -0,0 +1 @@ +{"version":3,"file":"km_indicator_divide.js","sourceRoot":"","sources":["km_indicator_divide.ts"],"names":[],"mappings":";AAAA,8JAA8J;AAC9J,+WAA+W;AAC/W,yRAAyR;AACzR,8JAA8J;AAC9J,4GAA4G;AAC5G,8JAA8J;AAE9J;;;EAGE;AACF,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAGrC,8JAA8J;AAC9J,8JAA8J;AAC9J,6OAA6O;AAC7O,8JAA8J;AAE9J;;;;;;;EAOE;AACF,MAAM,mBAAmB,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AAE/C;;;;;;EAME;AACF,MAAM,eAAe,GAAG,MAAM,CAAC;AAE/B,MAAM,8CAA8C,GAAG,0BAA0B,CAAC;AAClF,MAAM,gDAAgD,GAAG,4BAA4B,CAAC;AAEtF;;;;;;;;;;;;;;;;EAgBE;AACF,KAAK,UAAU,gBAAgB,CAAC,UAAU,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,eAAe,EAAE,iBAAiB;IAEtH,IAAI,gCAAgC,GAAG,QAAQ,CAAC,kCAAkC,CAAC,8CAA8C,EAAE,iBAAiB,CAAC,CAAC;IACzJ,IAAI,gBAAgB,GAAG,QAAQ,CAAC,oBAAoB,CAAC,gCAAgC,EAAE,iBAAiB,CAAC,CAAC;IAE1G,IAAI,kCAAkC,GAAG,QAAQ,CAAC,kCAAkC,CAAC,gDAAgD,EAAE,iBAAiB,CAAC,CAAC;IAC1J,IAAI,kBAAkB,GAAG,QAAQ,CAAC,oBAAoB,CAAC,kCAAkC,EAAE,iBAAiB,CAAC,CAAC;IAG3G,QAAQ,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;IAE/D,mCAAmC;IACnC,QAAQ,CAAC,GAAG,CAAC,+EAA+E,CAAC,C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OAAO,CAAC,qBAAqB,GAAG,qBAAqB,CAAC;AACS,EAAE"} \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_indicator_divide.ts b/app/kommonitor-script-resources/km_indicator_divide.ts new file mode 100644 index 000000000..0d94429c0 --- /dev/null +++ b/app/kommonitor-script-resources/km_indicator_divide.ts @@ -0,0 +1,406 @@ +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// NECESSARY NODE MODULE DEPENDENCIES // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// NECESSARY NODE MODULE DEPENDENCIES // // +// // +// SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* Module that contains various helper methods (spatial GIS functions and statistical functions) +* to simplify script writing +*/ +const KmHelper = require("kmhelper"); + + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// CONSTANTS DEFINITION // +// here you may specify custom CONSTANTS used within the script. // // // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* This constant specifies allowed values to determine how the aggregation process will deal with indicator values. +* I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. +* Note that these values must not be changed by users! +* @type {Array.} +* @memberof CONSTANTS +* @constant +*/ +const aggregationTypeEnum = ["SUM", "AVERAGE"]; + +/** +* via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. +* Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option +* @type {string} +* @memberof CONSTANTS +* @constant +*/ +const aggregationType = "MEAN"; + +const parameterName_computationIndicatorId_numerator = "COMPUTATION_ID_numerator"; +const parameterName_computationIndicatorId_denominator = "COMPUTATION_ID_denominator"; + +/** +* This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined +* as method parameters that can be used within the method body. +* +* NOTE: The function is async, so users may make use of keyword "await" to wait for results of other async helper API methods. +* (This is necessary when users want to wait for asynchronous method execution such as external API calls in a synchronous program) +* +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit as GeoJSON FeatureCollection object. +* @param {map.>} baseIndicatorsMap - Map containing all indicators, wheres key='meaningful name or id of the indicator' and value='indicator as GeoJSON object' (it contains duplicate entries, one for the indicator name and one for the indicator id) +* @param {map.>} georesourcesMap - Map containing all georesources, wheres key='meaningful name or id of the georesource' and value='georesource as GeoJSON object' (they are used to execute geometric/toptologic computations) (it contains duplicate entries, one for the georesource name and one for the georesource id) +* @param {Array.>} processParameters - an array containing objects representing variable additional process parameters that are required to perform the indicator computation. +* Each entry has properties Object.name and Object.value for name and value of the parameter. +* @returns {FeatureCollection} the computed indicator for submitted {@linkcode targetSpatialUnit_geoJSON} features as GeoJSON FeatureCollection +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ + + var computationIndicatorId_numerator = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId_numerator, processParameters); + var numeratorGeoJSON = KmHelper.getBaseIndicatorById(computationIndicatorId_numerator, baseIndicatorsMap); + + var computationIndicatorId_denominator = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId_denominator, processParameters); + var denominatorGeoJSON = KmHelper.getBaseIndicatorById(computationIndicatorId_denominator, baseIndicatorsMap); + + + KmHelper.log("Retrieved required baseIndicators successfully"); + + // now we compute the new indicator + KmHelper.log("Iterate over base indicators and save intermediate values within a map object"); + + /** + * create a map to store indicator values for each feature of the target spatial unit + * by using such a map object, we can ensure, that we only iterate ONCE over each bease indicator + * and also can only iterate ONCE over each target spatial unit feature at the end to compute the indicator + */ + var map = new Map(); + + KmHelper.log("Process numerator indicator '" + computationIndicatorId_numerator + "'"); + + /** + * iterate over each feature of the baseIndicator and use its indicator value to modify map object + * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! + */ + numeratorGeoJSON.features.forEach(function(feature) { + // get the unique featureID of the spatial unit feature as String + var featureId = KmHelper.getSpatialUnitFeatureIdValue(feature); + // get the time series value of the base indicator feature for the requested target date (with its required prefix!) + var numeratorValue = KmHelper.getIndicatorValue(feature, targetDate); + + if(numeratorValue === undefined || numeratorValue === null){ + KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); + KmHelper.log("WARNING: the feature value will thus be set to '0' and computation will continue"); + numeratorValue = 0; + } + // modify map object (i.e. set value initially, or perform calculations and store modified value) + // key should be unique featureId of the spatial unit feature + if (! map.has(featureId)){ + var mapObject = { + featureId: featureId, + indicatorValue: undefined, + numeratorValue: 0, + denominatorValue: 0 + }; + + map.set(featureId, mapObject); + } + var mapEntry = map.get(featureId); + mapEntry.numeratorValue = numeratorValue; + map.set(featureId, mapEntry); + }); + + KmHelper.log("Process denominator indicator"); + + /** + * iterate over each feature of the baseIndicator and use its indicator value to modify map object + * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! + */ + denominatorGeoJSON.features.forEach(function(feature) { + // get the unique featureID of the spatial unit feature as String + var featureId = KmHelper.getSpatialUnitFeatureIdValue(feature); + // get the time series value of the base indicator feature for the requested target date (with its required prefix!) + var denominatorValue = KmHelper.getIndicatorValue(feature, targetDate); + + // modify map object (i.e. set value initially, or perform calculations and store modified value) + // key should be unique featureId of the spatial unit feature + if(denominatorValue === undefined || denominatorValue === null){ + KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); + KmHelper.log("WARNING: the feature value will thus be set to '0' and computation will continue"); + denominatorValue = 0; + } + + if (! map.has(featureId)){ + KmHelper.log("numeratorValue Indicator feature with id '" + featureId + "' was not computed from computation resources. Will set denominatorValue to null."); + var mapObject = { + featureId: featureId, + indicatorValue: undefined, + numeratorValue: 0, + denominatorValue: 0 + }; + + map.set(featureId, mapObject); + } + + var mapEntry = map.get(featureId); + mapEntry.denominatorValue = denominatorValue; + + map.set(featureId, mapEntry); + }); + + var numFeatures = targetSpatialUnit_geoJSON.features.length; + + // now we compute the new indicator + KmHelper.log("Compute indicator for a total amount of " + numFeatures + " features"); + + // iterate once over target spatial unit features and compute indicator utilizing map entries + var spatialUnitIndex = 0; + // create progress log after each 10th percent of features + var logProgressIndexSeparator = Math.round(numFeatures / 100 * 10); + targetSpatialUnit_geoJSON.features.forEach(function(spatialUnitFeature) { + + // get spatialUnit feature id as string --> use it to get associated map entry + var spatialUnitFeatureId = KmHelper.getSpatialUnitFeatureIdValue(spatialUnitFeature); + + if (! map.has(spatialUnitFeatureId)){ + KmHelper.log("Target spatial unit feature with id '" + spatialUnitFeatureId + "' was not computed from computation resources. Will set nominator and denominator values to null."); + var mapObject = { + featureId: spatialUnitFeatureId, + indicatorValue: undefined, + numeratorValue: null, + denominatorValue: null + }; + + map.set(spatialUnitFeatureId, mapObject); + } + + var mapEntry = map.get(spatialUnitFeatureId); + var indicatorValue = null; + + if(mapEntry.numeratorValue === undefined || mapEntry.numeratorValue === null || mapEntry.denominatorValue === undefined || mapEntry.denominatorValue === null){ + KmHelper.log("WARNING: the feature with featureID '" + spatialUnitFeatureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); + KmHelper.log("INFO: indicator value is set to null"); + indicatorValue = null; + } else if(mapEntry.denominatorValue === 0) { + indicatorValue = 0; + KmHelper.log("WARNING: the feature with featureID '" + spatialUnitFeatureId + "' cotains a '0' as numerator value for targetDate '" + targetDate + "'"); + KmHelper.log("INFO: indicator value is set to 0"); + } else { + indicatorValue = mapEntry.numeratorValue / mapEntry.denominatorValue; + } + + // set indicator value for spatialUnitFeature + spatialUnitFeature = KmHelper.setIndicatorValue(spatialUnitFeature, targetDate, indicatorValue); + + spatialUnitIndex ++; + + // only log after certain progress + if(spatialUnitIndex % logProgressIndexSeparator === 0){ + KmHelper.log("PROGRESS: Computed '" + spatialUnitIndex + "' of total '" + numFeatures + "' features."); + } + }); + + KmHelper.log("Computation of indicator finished"); + + return targetSpatialUnit_geoJSON; +}; + +/** +* This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). +* The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. +* The aggrgation internally aggregates features of {@linkcode indicator_geoJSON} to features of {@linkcode targetSpatialUnit_geoJSON} by comparing their geometries. +* Each {@linkcode indicator_geoJSON} feature whose geometry lies within a certain geometry of a {@linkcode targetSpatialUnit_geoJSON} feature will be used to compute the aggregated indicator values. +* The within comparison is executed by method {@linkcode within_usingBBOX}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be aggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter targetSpatialUnit_geoJSON +* @see aggregationType +* @see within_usingBBOX +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the aggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)){ + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if(aggregationType === "SUM"){ + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +}; + +/** +* This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). +* @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be disaggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be disaggregated to the features of parameter targetSpatialUnit_geoJSON +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the disaggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // disaggregate indicator + +}; + + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. +* Also it uses the {@linkcode KmHelper.getAggregationWeight(feature)} method as weight during aggregtion. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + + // compute average for share + if(baseIndicatorTotalWeight === 0){ + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + + KmHelper.log("Aggregation finished"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} +* to determine which features of {@linkcode indicator_geoJSON} can be aggregated to which features of {@linkcode targetSpatialUnit_geoJSON}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + var totalAggregatedIndicatorFeatures = 0; + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + + +module.exports.computeIndicator = computeIndicator; +module.exports.aggregateIndicator = aggregateIndicator; +module.exports.disaggregateIndicator = disaggregateIndicator; + // \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_indicator_multiply.js b/app/kommonitor-script-resources/km_indicator_multiply.js index d9bbc461a..d0b8b9aff 100644 --- a/app/kommonitor-script-resources/km_indicator_multiply.js +++ b/app/kommonitor-script-resources/km_indicator_multiply.js @@ -1,21 +1,18 @@ +"use strict"; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // NECESSARY NODE MODULE DEPENDENCIES // // // // // SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * Module that contains various helper methods (spatial GIS functions and statistical functions) * to simplify script writing */ const KmHelper = require("kmhelper"); - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // CONSTANTS DEFINITION // // here you may specify custom CONSTANTS used within the script. // // // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * This constant specifies allowed values to determine how the aggregation process will deal with indicator values. * I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. @@ -25,7 +22,6 @@ const KmHelper = require("kmhelper"); * @constant */ const aggregationTypeEnum = ["SUM", "AVERAGE"]; - /** * via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. * Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option @@ -34,9 +30,7 @@ const aggregationTypeEnum = ["SUM", "AVERAGE"]; * @constant */ const aggregationType = "SUM"; - const parameterName_computationIndicatorId = "COMPUTATION_ID"; - /** * This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined * as method parameters that can be used within the method body. @@ -54,108 +48,89 @@ const parameterName_computationIndicatorId = "COMPUTATION_ID"; * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ - - var computationIndicatorIds = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId, processParameters); - var computationIndicatorIds_array = computationIndicatorIds.split(','); - var computationGeoJSON_array = []; - for (const indicatorID of computationIndicatorIds_array){ - computationGeoJSON_array.push(KmHelper.getBaseIndicatorById(indicatorID, baseIndicatorsMap))}; - - KmHelper.log("Retrieved required baseIndicators successfully"); - - // now we compute the new indicator - KmHelper.log("Iterate over base indicators and save intermediate values within a map object"); - - /** - * create a map to store indicator values for each feature of the target spatial unit - * by using such a map object, we can ensure, that we only iterate ONCE over each bease indicator - * and also can only iterate ONCE over each target spatial unit feature at the end to compute the indicator - */ - var map = new Map(); - - KmHelper.log("Process computation indicator"); - - /** - * iterate over each feature of the baseIndicator and use its indicator value to modify map object - * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! - */ - computationGeoJSON_array.forEach(function(geoJSON) { - - geoJSON.features.forEach(function(feature) { - // get the unique featureID of the spatial unit feature as String - var featureId = KmHelper.getSpatialUnitFeatureIdValue(feature); - // get the time series value of the base indicator feature for the requested target date (with its required prefix!) - var partValue = KmHelper.getIndicatorValue(feature, targetDate); - if(partValue === undefined || partValue === null){ - KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); - KmHelper.log("WARNING: the feature value will thus be set to '0' and computation will continue"); - partValue = 0; - } - // modify map object (i.e. set value initially, or perform calculations and store modified value) - // key should be unique featureId of the spatial unit feature - if (! map.has(featureId)){ - var mapObject = { - featureId: featureId, - indicatorValue: undefined, - intermediateValue: 1 - }; - map.set(featureId, mapObject); - } - var mapEntry = map.get(featureId); - mapEntry.intermediateValue = mapEntry.intermediateValue * partValue; - map.set(featureId, mapEntry); - }); - }); - - var numFeatures = targetSpatialUnit_geoJSON.features.length; - - // now we compute the new indicator - KmHelper.log("Compute indicator for a total amount of " + numFeatures + " features"); - - // iterate once over target spatial unit features and compute indicator utilizing map entries - var spatialUnitIndex = 0; - // create progress log after each 10th percent of features - var logProgressIndexSeparator = Math.round(numFeatures / 100 * 10); - targetSpatialUnit_geoJSON.features.forEach(function(spatialUnitFeature) { - +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters) { + var computationIndicatorIds = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId, processParameters); + var computationIndicatorIds_array = computationIndicatorIds.split(','); + var computationGeoJSON_array = []; + for (const indicatorID of computationIndicatorIds_array) { + computationGeoJSON_array.push(KmHelper.getBaseIndicatorById(indicatorID, baseIndicatorsMap)); + } + ; + KmHelper.log("Retrieved required baseIndicators successfully"); + // now we compute the new indicator + KmHelper.log("Iterate over base indicators and save intermediate values within a map object"); + /** + * create a map to store indicator values for each feature of the target spatial unit + * by using such a map object, we can ensure, that we only iterate ONCE over each bease indicator + * and also can only iterate ONCE over each target spatial unit feature at the end to compute the indicator + */ + var map = new Map(); + KmHelper.log("Process computation indicator"); + /** + * iterate over each feature of the baseIndicator and use its indicator value to modify map object + * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! + */ + computationGeoJSON_array.forEach(function (geoJSON) { + geoJSON.features.forEach(function (feature) { + // get the unique featureID of the spatial unit feature as String + var featureId = KmHelper.getSpatialUnitFeatureIdValue(feature); + // get the time series value of the base indicator feature for the requested target date (with its required prefix!) + var partValue = KmHelper.getIndicatorValue(feature, targetDate); + if (partValue === undefined || partValue === null) { + KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); + KmHelper.log("WARNING: the feature value will thus be set to '0' and computation will continue"); + partValue = 0; + } + // modify map object (i.e. set value initially, or perform calculations and store modified value) + // key should be unique featureId of the spatial unit feature + if (!map.has(featureId)) { + var mapObject = { + featureId: featureId, + indicatorValue: undefined, + intermediateValue: 1 + }; + map.set(featureId, mapObject); + } + var mapEntry = map.get(featureId); + mapEntry.intermediateValue = mapEntry.intermediateValue * partValue; + map.set(featureId, mapEntry); + }); + }); + var numFeatures = targetSpatialUnit_geoJSON.features.length; + // now we compute the new indicator + KmHelper.log("Compute indicator for a total amount of " + numFeatures + " features"); + // iterate once over target spatial unit features and compute indicator utilizing map entries + var spatialUnitIndex = 0; + // create progress log after each 10th percent of features + var logProgressIndexSeparator = Math.round(numFeatures / 100 * 10); + targetSpatialUnit_geoJSON.features.forEach(function (spatialUnitFeature) { // get spatialUnit feature id as string --> use it to get associated map entry var spatialUnitFeatureId = KmHelper.getSpatialUnitFeatureIdValue(spatialUnitFeature); - - if (! map.has(spatialUnitFeatureId)){ - KmHelper.log("Target spatial unit feature with id '" + spatialUnitFeatureId + "' was not computed from computation resources. Will set indicator value to null."); - var mapObject = { - featureId: spatialUnitFeatureId, - indicatorValue: null, - intermediateValue: null - }; - map.set(spatialUnitFeatureId, mapObject); - } - + if (!map.has(spatialUnitFeatureId)) { + KmHelper.log("Target spatial unit feature with id '" + spatialUnitFeatureId + "' was not computed from computation resources. Will set indicator value to null."); + var mapObject = { + featureId: spatialUnitFeatureId, + indicatorValue: null, + intermediateValue: null + }; + map.set(spatialUnitFeatureId, mapObject); + } var mapEntry = map.get(spatialUnitFeatureId); - - var indicatorValue = mapEntry.intermediateValue; - // set aggregationWeight as number of citizens KmHelper.setAggregationWeight(spatialUnitFeature, indicatorValue); - // set indicator value for spatialUnitFeature spatialUnitFeature = KmHelper.setIndicatorValue(spatialUnitFeature, targetDate, indicatorValue); - - spatialUnitIndex ++; - + spatialUnitIndex++; // only log after certain progress - if(spatialUnitIndex % logProgressIndexSeparator === 0){ + if (spatialUnitIndex % logProgressIndexSeparator === 0) { KmHelper.log("PROGRESS: Computed '" + spatialUnitIndex + "' of total '" + numFeatures + "' features."); } - }); - - KmHelper.log("Computation of indicator finished"); - - return targetSpatialUnit_geoJSON; -}; - + }); + KmHelper.log("Computation of indicator finished"); + return targetSpatialUnit_geoJSON; +} +; /** * This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). * The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. @@ -171,22 +146,22 @@ async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndic * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - if (!aggregationTypeEnum.includes(aggregationType)){ - console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + - "'. Allowed values are: " + aggregationTypeEnum); - console.log("Will fallback to using AVERAGE aggregation logic."); - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else if(aggregationType === "SUM"){ - return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else { - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } -}; - +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)) { + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if (aggregationType === "SUM") { + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +} +; /** * This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). * @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! @@ -197,12 +172,10 @@ function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geo * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // disaggregate indicator - -}; - - +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // disaggregate indicator +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. @@ -216,74 +189,60 @@ function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check to aggregate - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var baseIndicatorTotalWeight = 0; - var featureCounter = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - featureCounter++; - - // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number - if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ - // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method - // it "survives" until this aggregation logic within processing engine - var weight = KmHelper.getAggregationWeight(indicatorFeature); - - // use weight as weight for indicator value - baseIndicatorTotalWeight += weight; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; - } - } - } - - // compute average for share - if(baseIndicatorTotalWeight === 0){ - targetFeature.properties[targetDate] = Number.NaN; +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; } - else { - targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if (!Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined) { + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + // compute average for share + if (baseIndicatorTotalWeight === 0) { + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + KmHelper.log("Aggregation finished"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); } - // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); - }); - - KmHelper.log("Aggregation finished"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - + return targetSpatialUnit_geoJSON; +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} @@ -297,59 +256,47 @@ function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - var totalAggregatedIndicatorFeatures = 0; - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check for aggregation - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var numberOfIndicatorFeaturesWithinTargetFeature = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - numberOfIndicatorFeaturesWithinTargetFeature++; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); - } - } - totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; - }); - - KmHelper.log("Aggregation finished"); - KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - - +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + var totalAggregatedIndicatorFeatures = 0; + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; + } + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + return targetSpatialUnit_geoJSON; +} +; module.exports.computeIndicator = computeIndicator; module.exports.aggregateIndicator = aggregateIndicator; module.exports.disaggregateIndicator = disaggregateIndicator; +//# sourceMappingURL=km_indicator_multiply.js.map \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_indicator_multiply.js.map b/app/kommonitor-script-resources/km_indicator_multiply.js.map new file mode 100644 index 000000000..428af5582 --- /dev/null +++ b/app/kommonitor-script-resources/km_indicator_multiply.js.map @@ -0,0 +1 @@ +{"version":3,"file":"km_indicator_multiply.js","sourceRoot":"","sources":["km_indicator_multiply.ts"],"names":[],"mappings":";AAAA,8JAA8J;AAC9J,yRAAyR;AACzR,8JAA8J;AAC9J,4GAA4G;AAC5G,8JAA8J;AAE9J;;;EAGE;AACF,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAGrC,8JAA8J;AAC9J,8JAA8J;AAC9J,6OAA6O;AAC7O,8JAA8J;AAE9J;;;;;;;EAOE;AACF,MAAM,mBAAmB,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AAE/C;;;;;;EAME;AACF,MAAM,eAAe,GAAG,KAAK,CAAC;AAE9B,MAAM,oCAAoC,GAAG,gBAAgB,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AC,OAAO,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;AACnD,MAAM,CAAC,OAAO,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;AACvD,MAAM,CAAC,OAAO,CAAC,qBAAqB,GAAG,qBAAqB,CAAC"} \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_indicator_multiply.ts b/app/kommonitor-script-resources/km_indicator_multiply.ts new file mode 100644 index 000000000..d9bbc461a --- /dev/null +++ b/app/kommonitor-script-resources/km_indicator_multiply.ts @@ -0,0 +1,355 @@ +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// NECESSARY NODE MODULE DEPENDENCIES // // +// // +// SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* Module that contains various helper methods (spatial GIS functions and statistical functions) +* to simplify script writing +*/ +const KmHelper = require("kmhelper"); + + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// CONSTANTS DEFINITION // +// here you may specify custom CONSTANTS used within the script. // // // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* This constant specifies allowed values to determine how the aggregation process will deal with indicator values. +* I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. +* Note that these values must not be changed by users! +* @type {Array.} +* @memberof CONSTANTS +* @constant +*/ +const aggregationTypeEnum = ["SUM", "AVERAGE"]; + +/** +* via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. +* Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option +* @type {string} +* @memberof CONSTANTS +* @constant +*/ +const aggregationType = "SUM"; + +const parameterName_computationIndicatorId = "COMPUTATION_ID"; + +/** +* This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined +* as method parameters that can be used within the method body. +* +* NOTE: The function is async, so users may make use of keyword "await" to wait for results of other async helper API methods. +* (This is necessary when users want to wait for asynchronous method execution such as external API calls in a synchronous program) +* +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit as GeoJSON FeatureCollection object. +* @param {map.>} baseIndicatorsMap - Map containing all indicators, wheres key='meaningful name or id of the indicator' and value='indicator as GeoJSON object' (it contains duplicate entries, one for the indicator name and one for the indicator id) +* @param {map.>} georesourcesMap - Map containing all georesources, wheres key='meaningful name or id of the georesource' and value='georesource as GeoJSON object' (they are used to execute geometric/toptologic computations) (it contains duplicate entries, one for the georesource name and one for the georesource id) +* @param {Array.>} processParameters - an array containing objects representing variable additional process parameters that are required to perform the indicator computation. +* Each entry has properties Object.name and Object.value for name and value of the parameter. +* @returns {FeatureCollection} the computed indicator for submitted {@linkcode targetSpatialUnit_geoJSON} features as GeoJSON FeatureCollection +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ + + var computationIndicatorIds = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId, processParameters); + var computationIndicatorIds_array = computationIndicatorIds.split(','); + var computationGeoJSON_array = []; + for (const indicatorID of computationIndicatorIds_array){ + computationGeoJSON_array.push(KmHelper.getBaseIndicatorById(indicatorID, baseIndicatorsMap))}; + + KmHelper.log("Retrieved required baseIndicators successfully"); + + // now we compute the new indicator + KmHelper.log("Iterate over base indicators and save intermediate values within a map object"); + + /** + * create a map to store indicator values for each feature of the target spatial unit + * by using such a map object, we can ensure, that we only iterate ONCE over each bease indicator + * and also can only iterate ONCE over each target spatial unit feature at the end to compute the indicator + */ + var map = new Map(); + + KmHelper.log("Process computation indicator"); + + /** + * iterate over each feature of the baseIndicator and use its indicator value to modify map object + * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! + */ + computationGeoJSON_array.forEach(function(geoJSON) { + + geoJSON.features.forEach(function(feature) { + // get the unique featureID of the spatial unit feature as String + var featureId = KmHelper.getSpatialUnitFeatureIdValue(feature); + // get the time series value of the base indicator feature for the requested target date (with its required prefix!) + var partValue = KmHelper.getIndicatorValue(feature, targetDate); + if(partValue === undefined || partValue === null){ + KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); + KmHelper.log("WARNING: the feature value will thus be set to '0' and computation will continue"); + partValue = 0; + } + // modify map object (i.e. set value initially, or perform calculations and store modified value) + // key should be unique featureId of the spatial unit feature + if (! map.has(featureId)){ + var mapObject = { + featureId: featureId, + indicatorValue: undefined, + intermediateValue: 1 + }; + map.set(featureId, mapObject); + } + var mapEntry = map.get(featureId); + mapEntry.intermediateValue = mapEntry.intermediateValue * partValue; + map.set(featureId, mapEntry); + }); + }); + + var numFeatures = targetSpatialUnit_geoJSON.features.length; + + // now we compute the new indicator + KmHelper.log("Compute indicator for a total amount of " + numFeatures + " features"); + + // iterate once over target spatial unit features and compute indicator utilizing map entries + var spatialUnitIndex = 0; + // create progress log after each 10th percent of features + var logProgressIndexSeparator = Math.round(numFeatures / 100 * 10); + targetSpatialUnit_geoJSON.features.forEach(function(spatialUnitFeature) { + + // get spatialUnit feature id as string --> use it to get associated map entry + var spatialUnitFeatureId = KmHelper.getSpatialUnitFeatureIdValue(spatialUnitFeature); + + if (! map.has(spatialUnitFeatureId)){ + KmHelper.log("Target spatial unit feature with id '" + spatialUnitFeatureId + "' was not computed from computation resources. Will set indicator value to null."); + var mapObject = { + featureId: spatialUnitFeatureId, + indicatorValue: null, + intermediateValue: null + }; + map.set(spatialUnitFeatureId, mapObject); + } + + var mapEntry = map.get(spatialUnitFeatureId); + + + var indicatorValue = mapEntry.intermediateValue; + + // set aggregationWeight as number of citizens + KmHelper.setAggregationWeight(spatialUnitFeature, indicatorValue); + + // set indicator value for spatialUnitFeature + spatialUnitFeature = KmHelper.setIndicatorValue(spatialUnitFeature, targetDate, indicatorValue); + + spatialUnitIndex ++; + + // only log after certain progress + if(spatialUnitIndex % logProgressIndexSeparator === 0){ + KmHelper.log("PROGRESS: Computed '" + spatialUnitIndex + "' of total '" + numFeatures + "' features."); + } + }); + + KmHelper.log("Computation of indicator finished"); + + return targetSpatialUnit_geoJSON; +}; + +/** +* This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). +* The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. +* The aggrgation internally aggregates features of {@linkcode indicator_geoJSON} to features of {@linkcode targetSpatialUnit_geoJSON} by comparing their geometries. +* Each {@linkcode indicator_geoJSON} feature whose geometry lies within a certain geometry of a {@linkcode targetSpatialUnit_geoJSON} feature will be used to compute the aggregated indicator values. +* The within comparison is executed by method {@linkcode within_usingBBOX}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be aggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter targetSpatialUnit_geoJSON +* @see aggregationType +* @see within_usingBBOX +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the aggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)){ + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if(aggregationType === "SUM"){ + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +}; + +/** +* This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). +* @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be disaggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be disaggregated to the features of parameter targetSpatialUnit_geoJSON +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the disaggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // disaggregate indicator + +}; + + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. +* Also it uses the {@linkcode KmHelper.getAggregationWeight(feature)} method as weight during aggregtion. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + + // compute average for share + if(baseIndicatorTotalWeight === 0){ + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + + KmHelper.log("Aggregation finished"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} +* to determine which features of {@linkcode indicator_geoJSON} can be aggregated to which features of {@linkcode targetSpatialUnit_geoJSON}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + var totalAggregatedIndicatorFeatures = 0; + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + + +module.exports.computeIndicator = computeIndicator; +module.exports.aggregateIndicator = aggregateIndicator; +module.exports.disaggregateIndicator = disaggregateIndicator; diff --git a/app/kommonitor-script-resources/km_indicator_percentage.js b/app/kommonitor-script-resources/km_indicator_percentage.js index 75c4e495a..ebf53f951 100644 --- a/app/kommonitor-script-resources/km_indicator_percentage.js +++ b/app/kommonitor-script-resources/km_indicator_percentage.js @@ -1,21 +1,18 @@ +"use strict"; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // NECESSARY NODE MODULE DEPENDENCIES // // // // // SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * Module that contains various helper methods (spatial GIS functions and statistical functions) * to simplify script writing */ const KmHelper = require("kmhelper"); - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // CONSTANTS DEFINITION // // here you may specify custom CONSTANTS used within the script. // // // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * This constant specifies allowed values to determine how the aggregation process will deal with indicator values. * I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. @@ -25,7 +22,6 @@ const KmHelper = require("kmhelper"); * @constant */ const aggregationTypeEnum = ["SUM", "AVERAGE"]; - /** * via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. * Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option @@ -34,10 +30,8 @@ const aggregationTypeEnum = ["SUM", "AVERAGE"]; * @constant */ const aggregationType = "AVERAGE"; - const parameterName_referenceIndicatorId = "REFERENCE_ID"; const parameterName_computationIndicatorId = "COMPUTATION_ID"; - /** * This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined * as method parameters that can be used within the method body. @@ -55,162 +49,137 @@ const parameterName_computationIndicatorId = "COMPUTATION_ID"; * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ - - var referenceIndicatorId = KmHelper.getProcessParameterByName_asString(parameterName_referenceIndicatorId, processParameters); - var referenceGeoJSON = KmHelper.getBaseIndicatorById(referenceIndicatorId, baseIndicatorsMap); - - var computationIndicatorIds = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId, processParameters); - var computationIndicatorIds_array = computationIndicatorIds.split(','); - var computationGeoJSON_array = []; - for (const indicatorID of computationIndicatorIds_array){ - computationGeoJSON_array.push(KmHelper.getBaseIndicatorById(indicatorID, baseIndicatorsMap))}; - - KmHelper.log("Retrieved required baseIndicators successfully"); - - // now we compute the new indicator - KmHelper.log("Iterate over base indicators and save intermediate values within a map object"); - - /** - * create a map to store indicator values for each feature of the target spatial unit - * by using such a map object, we can ensure, that we only iterate ONCE over each bease indicator - * and also can only iterate ONCE over each target spatial unit feature at the end to compute the indicator - */ - var map = new Map(); - - KmHelper.log("Process reference indicator '" + referenceIndicatorId + "'"); - - /** - * iterate over each feature of the baseIndicator and use its indicator value to modify map object - * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! - */ - referenceGeoJSON.features.forEach(function(feature) { +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters) { + var referenceIndicatorId = KmHelper.getProcessParameterByName_asString(parameterName_referenceIndicatorId, processParameters); + var referenceGeoJSON = KmHelper.getBaseIndicatorById(referenceIndicatorId, baseIndicatorsMap); + var computationIndicatorIds = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId, processParameters); + var computationIndicatorIds_array = computationIndicatorIds.split(','); + var computationGeoJSON_array = []; + for (const indicatorID of computationIndicatorIds_array) { + computationGeoJSON_array.push(KmHelper.getBaseIndicatorById(indicatorID, baseIndicatorsMap)); + } + ; + KmHelper.log("Retrieved required baseIndicators successfully"); + // now we compute the new indicator + KmHelper.log("Iterate over base indicators and save intermediate values within a map object"); + /** + * create a map to store indicator values for each feature of the target spatial unit + * by using such a map object, we can ensure, that we only iterate ONCE over each bease indicator + * and also can only iterate ONCE over each target spatial unit feature at the end to compute the indicator + */ + var map = new Map(); + KmHelper.log("Process reference indicator '" + referenceIndicatorId + "'"); + /** + * iterate over each feature of the baseIndicator and use its indicator value to modify map object + * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! + */ + referenceGeoJSON.features.forEach(function (feature) { // get the unique featureID of the spatial unit feature as String var featureId = KmHelper.getSpatialUnitFeatureIdValue(feature); // get the time series value of the base indicator feature for the requested target date (with its required prefix!) var referenceValue = KmHelper.getIndicatorValue(feature, targetDate); - - if(referenceValue === undefined || referenceValue === null){ - KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); - KmHelper.log("WARNING: process will return"); - referenceValue = 0; + if (referenceValue === undefined || referenceValue === null) { + KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); + KmHelper.log("WARNING: process will return"); + referenceValue = 0; } - // modify map object (i.e. set value initially, or perform calculations and store modified value) + // modify map object (i.e. set value initially, or perform calculations and store modified value) // key should be unique featureId of the spatial unit feature - if (! map.has(featureId)){ + if (!map.has(featureId)) { var mapObject = { featureId: featureId, indicatorValue: undefined, refValue: 0, - intermediateValue: 0 - }; - - map.set(featureId, mapObject); + intermediateValue: 0 + }; + map.set(featureId, mapObject); } - var mapEntry = map.get(featureId); - mapEntry.refValue = referenceValue; + var mapEntry = map.get(featureId); + mapEntry.refValue = referenceValue; map.set(featureId, mapEntry); - }); - - KmHelper.log("Process computation indicator"); - - /** - * iterate over each feature of the baseIndicator and use its indicator value to modify map object - * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! - */ - computationGeoJSON_array.forEach(function(geoJSON) { - - geoJSON.features.forEach(function(feature) { - // get the unique featureID of the spatial unit feature as String - var featureId = KmHelper.getSpatialUnitFeatureIdValue(feature); - // get the time series value of the base indicator feature for the requested target date (with its required prefix!) - var partValue = KmHelper.getIndicatorValue(feature, targetDate); - if(partValue === undefined || partValue === null){ - KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); - KmHelper.log("WARNING: the feature value will thus be set to '0' and computation will continue"); - partValue = 0; - } - // modify map object (i.e. set value initially, or perform calculations and store modified value) - // key should be unique featureId of the spatial unit feature - - if (! map.has(featureId)){ - KmHelper.log("Computation Indicator feature with id '" + featureId + "' was not computed from computation resources. Will set ref value to null."); - var mapObject = { - featureId: featureId, - indicatorValue: undefined, - refValue: null, - intermediateValue: 0 + }); + KmHelper.log("Process computation indicator"); + /** + * iterate over each feature of the baseIndicator and use its indicator value to modify map object + * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! + */ + computationGeoJSON_array.forEach(function (geoJSON) { + geoJSON.features.forEach(function (feature) { + // get the unique featureID of the spatial unit feature as String + var featureId = KmHelper.getSpatialUnitFeatureIdValue(feature); + // get the time series value of the base indicator feature for the requested target date (with its required prefix!) + var partValue = KmHelper.getIndicatorValue(feature, targetDate); + if (partValue === undefined || partValue === null) { + KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); + KmHelper.log("WARNING: the feature value will thus be set to '0' and computation will continue"); + partValue = 0; + } + // modify map object (i.e. set value initially, or perform calculations and store modified value) + // key should be unique featureId of the spatial unit feature + if (!map.has(featureId)) { + KmHelper.log("Computation Indicator feature with id '" + featureId + "' was not computed from computation resources. Will set ref value to null."); + var mapObject = { + featureId: featureId, + indicatorValue: undefined, + refValue: null, + intermediateValue: 0 }; - - map.set(featureId, mapObject); - } - - var mapEntry = map.get(featureId); - mapEntry.intermediateValue = mapEntry.intermediateValue + partValue; - map.set(featureId, mapEntry); - }); - }); - - var numFeatures = targetSpatialUnit_geoJSON.features.length; - - // now we compute the new indicator - KmHelper.log("Compute indicator for a total amount of " + numFeatures + " features"); - - // iterate once over target spatial unit features and compute indicator utilizing map entries - var spatialUnitIndex = 0; - // create progress log after each 10th percent of features - var logProgressIndexSeparator = Math.round(numFeatures / 100 * 10); - targetSpatialUnit_geoJSON.features.forEach(function(spatialUnitFeature) { - + map.set(featureId, mapObject); + } + var mapEntry = map.get(featureId); + mapEntry.intermediateValue = mapEntry.intermediateValue + partValue; + map.set(featureId, mapEntry); + }); + }); + var numFeatures = targetSpatialUnit_geoJSON.features.length; + // now we compute the new indicator + KmHelper.log("Compute indicator for a total amount of " + numFeatures + " features"); + // iterate once over target spatial unit features and compute indicator utilizing map entries + var spatialUnitIndex = 0; + // create progress log after each 10th percent of features + var logProgressIndexSeparator = Math.round(numFeatures / 100 * 10); + targetSpatialUnit_geoJSON.features.forEach(function (spatialUnitFeature) { // get spatialUnit feature id as string --> use it to get associated map entry var spatialUnitFeatureId = KmHelper.getSpatialUnitFeatureIdValue(spatialUnitFeature); - - if (! map.has(spatialUnitFeatureId)){ - KmHelper.log("Target spatial unit feature with id '" + spatialUnitFeatureId + "' was not computed from computation resources. Will set indicator value to null."); - var mapObject = { - featureId: spatialUnitFeatureId, - indicatorValue: undefined, - refValue: null, - intermediateValue: null - }; - - map.set(spatialUnitFeatureId, mapObject); - } - + if (!map.has(spatialUnitFeatureId)) { + KmHelper.log("Target spatial unit feature with id '" + spatialUnitFeatureId + "' was not computed from computation resources. Will set indicator value to null."); + var mapObject = { + featureId: spatialUnitFeatureId, + indicatorValue: undefined, + refValue: null, + intermediateValue: null + }; + map.set(spatialUnitFeatureId, mapObject); + } var mapEntry = map.get(spatialUnitFeatureId); - - var indicatorValue = null; - if(mapEntry.refValue === undefined || mapEntry.refValue === null || mapEntry.refValue === undefined || mapEntry.intermediateValue === null){ - KmHelper.log("WARNING: the feature with featureID '" + spatialUnitFeatureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); - KmHelper.log("INFO: indicator value is set to null"); - indicatorValue = null; - } else if(mapEntry.refValue === 0) { - indicatorValue = 0; - KmHelper.log("WARNING: the feature with featureID '" + spatialUnitFeatureId + "' cotains a '0' as numerator value for targetDate '" + targetDate + "'"); - KmHelper.log("INFO: indicator value is set to 0"); - } else { - indicatorValue = (mapEntry.intermediateValue / mapEntry.refValue) * 100; - } - + var indicatorValue = null; + if (mapEntry.refValue === undefined || mapEntry.refValue === null || mapEntry.refValue === undefined || mapEntry.intermediateValue === null) { + KmHelper.log("WARNING: the feature with featureID '" + spatialUnitFeatureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); + KmHelper.log("INFO: indicator value is set to null"); + indicatorValue = null; + } + else if (mapEntry.refValue === 0) { + indicatorValue = 0; + KmHelper.log("WARNING: the feature with featureID '" + spatialUnitFeatureId + "' cotains a '0' as numerator value for targetDate '" + targetDate + "'"); + KmHelper.log("INFO: indicator value is set to 0"); + } + else { + indicatorValue = (mapEntry.intermediateValue / mapEntry.refValue) * 100; + } // set aggregationWeight as number of citizens KmHelper.setAggregationWeight(spatialUnitFeature, indicatorValue); - // set indicator value for spatialUnitFeature spatialUnitFeature = KmHelper.setIndicatorValue(spatialUnitFeature, targetDate, indicatorValue); - - spatialUnitIndex ++; - + spatialUnitIndex++; // only log after certain progress - if(spatialUnitIndex % logProgressIndexSeparator === 0){ + if (spatialUnitIndex % logProgressIndexSeparator === 0) { KmHelper.log("PROGRESS: Computed '" + spatialUnitIndex + "' of total '" + numFeatures + "' features."); } - }); - - KmHelper.log("Computation of indicator finished"); - - return targetSpatialUnit_geoJSON; -}; - + }); + KmHelper.log("Computation of indicator finished"); + return targetSpatialUnit_geoJSON; +} +; /** * This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). * The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. @@ -226,22 +195,22 @@ async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndic * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - if (!aggregationTypeEnum.includes(aggregationType)){ - console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + - "'. Allowed values are: " + aggregationTypeEnum); - console.log("Will fallback to using AVERAGE aggregation logic."); - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else if(aggregationType === "SUM"){ - return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else { - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } -}; - +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)) { + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if (aggregationType === "SUM") { + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +} +; /** * This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). * @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! @@ -252,12 +221,10 @@ function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geo * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // disaggregate indicator - -}; - - +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // disaggregate indicator +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. @@ -271,74 +238,60 @@ function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check to aggregate - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var baseIndicatorTotalWeight = 0; - var featureCounter = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - featureCounter++; - - // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number - if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ - // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method - // it "survives" until this aggregation logic within processing engine - var weight = KmHelper.getAggregationWeight(indicatorFeature); - - // use weight as weight for indicator value - baseIndicatorTotalWeight += weight; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; - } - } - } - - // compute average for share - if(baseIndicatorTotalWeight === 0){ - targetFeature.properties[targetDate] = Number.NaN; +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; } - else { - targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if (!Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined) { + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + // compute average for share + if (baseIndicatorTotalWeight === 0) { + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + KmHelper.log("Aggregation finished"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); } - // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); - }); - - KmHelper.log("Aggregation finished"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - + return targetSpatialUnit_geoJSON; +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} @@ -352,59 +305,47 @@ function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - var totalAggregatedIndicatorFeatures = 0; - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check for aggregation - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var numberOfIndicatorFeaturesWithinTargetFeature = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - numberOfIndicatorFeaturesWithinTargetFeature++; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); - } - } - totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; - }); - - KmHelper.log("Aggregation finished"); - KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - - +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + var totalAggregatedIndicatorFeatures = 0; + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; + } + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + return targetSpatialUnit_geoJSON; +} +; module.exports.computeIndicator = computeIndicator; module.exports.aggregateIndicator = aggregateIndicator; module.exports.disaggregateIndicator = disaggregateIndicator; +//# sourceMappingURL=km_indicator_percentage.js.map \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_indicator_percentage.js.map b/app/kommonitor-script-resources/km_indicator_percentage.js.map new file mode 100644 index 000000000..98394ffa5 --- /dev/null +++ b/app/kommonitor-script-resources/km_indicator_percentage.js.map @@ -0,0 +1 @@ +{"version":3,"file":"km_indicator_percentage.js","sourceRoot":"","sources":["km_indicator_percentage.ts"],"names":[],"mappings":";AAAA,8JAA8J;AAC9J,yRAAyR;AACzR,8JAA8J;AAC9J,4GAA4G;AAC5G,8JAA8J;AAE9J;;;EAGE;AACF,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAGrC,8JAA8J;AAC9J,8JAA8J;AAC9J,6OAA6O;AAC7O,8JAA8J;AAE9J;;;;;;;EAOE;AACF,MAAM,mBAAmB,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AAE/C;;;;;;EAME;AACF,MAAM,eAAe,GAAG,SAAS,CAAC;AAElC,MAAM,kCAAkC,GAAG,cAAc,CAAC;AAC1D,MAAM,oCAAoC,GAAG,gBAAgB,CAAC;AAE9D;;;;;;;;;;;;;;;;EAgBE;AACF,KAAK,UAAU,gBAAgB,CAAC,UAAU,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,eAAe,EAAE,iBAAiB;IAEzH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,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;gBAChC,KAAK,EAAE,CAAC;gBACX,4CAA4C,EAAE,CAAC;gBAC/C,aAAa,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,gBAAgB,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;aACxF;SACD;QACA,gCAAgC,IAAI,4CAA4C,CAAC;IACnF,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;IACrC,QAAQ,CAAC,GAAG,CAAC,gCAAgC,GAAG,+BAA+B,GAAG,yBAAyB,CAAC,QAAQ,CAAC,MAAM,GAAG,iBAAiB,CAAC,CAAC;IAEjJ,IAAG,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAC;QAC9B,OAAO,CAAC,KAAK,CAAC,mDAAmD,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAC9F,MAAM,KAAK,CAAC,6DAA6D,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;KACvG;IAED,OAAO,yBAAyB,CAAC;AACnC,CAAC;AAAA,CAAC;AAGF,MAAM,CAAC,OAAO,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;AACnD,MAAM,CAAC,OAAO,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;AACvD,MAAM,CAAC,OAAO,CAAC,qBAAqB,GAAG,qBAAqB,CAAC"} \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_indicator_percentage.ts b/app/kommonitor-script-resources/km_indicator_percentage.ts new file mode 100644 index 000000000..75c4e495a --- /dev/null +++ b/app/kommonitor-script-resources/km_indicator_percentage.ts @@ -0,0 +1,410 @@ +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// NECESSARY NODE MODULE DEPENDENCIES // // +// // +// SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* Module that contains various helper methods (spatial GIS functions and statistical functions) +* to simplify script writing +*/ +const KmHelper = require("kmhelper"); + + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// CONSTANTS DEFINITION // +// here you may specify custom CONSTANTS used within the script. // // // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* This constant specifies allowed values to determine how the aggregation process will deal with indicator values. +* I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. +* Note that these values must not be changed by users! +* @type {Array.} +* @memberof CONSTANTS +* @constant +*/ +const aggregationTypeEnum = ["SUM", "AVERAGE"]; + +/** +* via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. +* Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option +* @type {string} +* @memberof CONSTANTS +* @constant +*/ +const aggregationType = "AVERAGE"; + +const parameterName_referenceIndicatorId = "REFERENCE_ID"; +const parameterName_computationIndicatorId = "COMPUTATION_ID"; + +/** +* This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined +* as method parameters that can be used within the method body. +* +* NOTE: The function is async, so users may make use of keyword "await" to wait for results of other async helper API methods. +* (This is necessary when users want to wait for asynchronous method execution such as external API calls in a synchronous program) +* +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit as GeoJSON FeatureCollection object. +* @param {map.>} baseIndicatorsMap - Map containing all indicators, wheres key='meaningful name or id of the indicator' and value='indicator as GeoJSON object' (it contains duplicate entries, one for the indicator name and one for the indicator id) +* @param {map.>} georesourcesMap - Map containing all georesources, wheres key='meaningful name or id of the georesource' and value='georesource as GeoJSON object' (they are used to execute geometric/toptologic computations) (it contains duplicate entries, one for the georesource name and one for the georesource id) +* @param {Array.>} processParameters - an array containing objects representing variable additional process parameters that are required to perform the indicator computation. +* Each entry has properties Object.name and Object.value for name and value of the parameter. +* @returns {FeatureCollection} the computed indicator for submitted {@linkcode targetSpatialUnit_geoJSON} features as GeoJSON FeatureCollection +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ + + var referenceIndicatorId = KmHelper.getProcessParameterByName_asString(parameterName_referenceIndicatorId, processParameters); + var referenceGeoJSON = KmHelper.getBaseIndicatorById(referenceIndicatorId, baseIndicatorsMap); + + var computationIndicatorIds = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId, processParameters); + var computationIndicatorIds_array = computationIndicatorIds.split(','); + var computationGeoJSON_array = []; + for (const indicatorID of computationIndicatorIds_array){ + computationGeoJSON_array.push(KmHelper.getBaseIndicatorById(indicatorID, baseIndicatorsMap))}; + + KmHelper.log("Retrieved required baseIndicators successfully"); + + // now we compute the new indicator + KmHelper.log("Iterate over base indicators and save intermediate values within a map object"); + + /** + * create a map to store indicator values for each feature of the target spatial unit + * by using such a map object, we can ensure, that we only iterate ONCE over each bease indicator + * and also can only iterate ONCE over each target spatial unit feature at the end to compute the indicator + */ + var map = new Map(); + + KmHelper.log("Process reference indicator '" + referenceIndicatorId + "'"); + + /** + * iterate over each feature of the baseIndicator and use its indicator value to modify map object + * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! + */ + referenceGeoJSON.features.forEach(function(feature) { + // get the unique featureID of the spatial unit feature as String + var featureId = KmHelper.getSpatialUnitFeatureIdValue(feature); + // get the time series value of the base indicator feature for the requested target date (with its required prefix!) + var referenceValue = KmHelper.getIndicatorValue(feature, targetDate); + + if(referenceValue === undefined || referenceValue === null){ + KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); + KmHelper.log("WARNING: process will return"); + referenceValue = 0; + } + // modify map object (i.e. set value initially, or perform calculations and store modified value) + // key should be unique featureId of the spatial unit feature + if (! map.has(featureId)){ + var mapObject = { + featureId: featureId, + indicatorValue: undefined, + refValue: 0, + intermediateValue: 0 + }; + + map.set(featureId, mapObject); + } + var mapEntry = map.get(featureId); + mapEntry.refValue = referenceValue; + map.set(featureId, mapEntry); + }); + + KmHelper.log("Process computation indicator"); + + /** + * iterate over each feature of the baseIndicator and use its indicator value to modify map object + * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! + */ + computationGeoJSON_array.forEach(function(geoJSON) { + + geoJSON.features.forEach(function(feature) { + // get the unique featureID of the spatial unit feature as String + var featureId = KmHelper.getSpatialUnitFeatureIdValue(feature); + // get the time series value of the base indicator feature for the requested target date (with its required prefix!) + var partValue = KmHelper.getIndicatorValue(feature, targetDate); + if(partValue === undefined || partValue === null){ + KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); + KmHelper.log("WARNING: the feature value will thus be set to '0' and computation will continue"); + partValue = 0; + } + // modify map object (i.e. set value initially, or perform calculations and store modified value) + // key should be unique featureId of the spatial unit feature + + if (! map.has(featureId)){ + KmHelper.log("Computation Indicator feature with id '" + featureId + "' was not computed from computation resources. Will set ref value to null."); + var mapObject = { + featureId: featureId, + indicatorValue: undefined, + refValue: null, + intermediateValue: 0 + }; + + map.set(featureId, mapObject); + } + + var mapEntry = map.get(featureId); + mapEntry.intermediateValue = mapEntry.intermediateValue + partValue; + map.set(featureId, mapEntry); + }); + }); + + var numFeatures = targetSpatialUnit_geoJSON.features.length; + + // now we compute the new indicator + KmHelper.log("Compute indicator for a total amount of " + numFeatures + " features"); + + // iterate once over target spatial unit features and compute indicator utilizing map entries + var spatialUnitIndex = 0; + // create progress log after each 10th percent of features + var logProgressIndexSeparator = Math.round(numFeatures / 100 * 10); + targetSpatialUnit_geoJSON.features.forEach(function(spatialUnitFeature) { + + // get spatialUnit feature id as string --> use it to get associated map entry + var spatialUnitFeatureId = KmHelper.getSpatialUnitFeatureIdValue(spatialUnitFeature); + + if (! map.has(spatialUnitFeatureId)){ + KmHelper.log("Target spatial unit feature with id '" + spatialUnitFeatureId + "' was not computed from computation resources. Will set indicator value to null."); + var mapObject = { + featureId: spatialUnitFeatureId, + indicatorValue: undefined, + refValue: null, + intermediateValue: null + }; + + map.set(spatialUnitFeatureId, mapObject); + } + + var mapEntry = map.get(spatialUnitFeatureId); + + var indicatorValue = null; + if(mapEntry.refValue === undefined || mapEntry.refValue === null || mapEntry.refValue === undefined || mapEntry.intermediateValue === null){ + KmHelper.log("WARNING: the feature with featureID '" + spatialUnitFeatureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); + KmHelper.log("INFO: indicator value is set to null"); + indicatorValue = null; + } else if(mapEntry.refValue === 0) { + indicatorValue = 0; + KmHelper.log("WARNING: the feature with featureID '" + spatialUnitFeatureId + "' cotains a '0' as numerator value for targetDate '" + targetDate + "'"); + KmHelper.log("INFO: indicator value is set to 0"); + } else { + indicatorValue = (mapEntry.intermediateValue / mapEntry.refValue) * 100; + } + + // set aggregationWeight as number of citizens + KmHelper.setAggregationWeight(spatialUnitFeature, indicatorValue); + + // set indicator value for spatialUnitFeature + spatialUnitFeature = KmHelper.setIndicatorValue(spatialUnitFeature, targetDate, indicatorValue); + + spatialUnitIndex ++; + + // only log after certain progress + if(spatialUnitIndex % logProgressIndexSeparator === 0){ + KmHelper.log("PROGRESS: Computed '" + spatialUnitIndex + "' of total '" + numFeatures + "' features."); + } + }); + + KmHelper.log("Computation of indicator finished"); + + return targetSpatialUnit_geoJSON; +}; + +/** +* This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). +* The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. +* The aggrgation internally aggregates features of {@linkcode indicator_geoJSON} to features of {@linkcode targetSpatialUnit_geoJSON} by comparing their geometries. +* Each {@linkcode indicator_geoJSON} feature whose geometry lies within a certain geometry of a {@linkcode targetSpatialUnit_geoJSON} feature will be used to compute the aggregated indicator values. +* The within comparison is executed by method {@linkcode within_usingBBOX}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be aggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter targetSpatialUnit_geoJSON +* @see aggregationType +* @see within_usingBBOX +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the aggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)){ + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if(aggregationType === "SUM"){ + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +}; + +/** +* This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). +* @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be disaggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be disaggregated to the features of parameter targetSpatialUnit_geoJSON +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the disaggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // disaggregate indicator + +}; + + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. +* Also it uses the {@linkcode KmHelper.getAggregationWeight(feature)} method as weight during aggregtion. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + + // compute average for share + if(baseIndicatorTotalWeight === 0){ + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + + KmHelper.log("Aggregation finished"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} +* to determine which features of {@linkcode indicator_geoJSON} can be aggregated to which features of {@linkcode targetSpatialUnit_geoJSON}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + var totalAggregatedIndicatorFeatures = 0; + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + + +module.exports.computeIndicator = computeIndicator; +module.exports.aggregateIndicator = aggregateIndicator; +module.exports.disaggregateIndicator = disaggregateIndicator; diff --git a/app/kommonitor-script-resources/km_indicator_promille.js b/app/kommonitor-script-resources/km_indicator_promille.js index f0fe33cd5..b564256a9 100644 --- a/app/kommonitor-script-resources/km_indicator_promille.js +++ b/app/kommonitor-script-resources/km_indicator_promille.js @@ -1,21 +1,18 @@ +"use strict"; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // NECESSARY NODE MODULE DEPENDENCIES // // // // // SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * Module that contains various helper methods (spatial GIS functions and statistical functions) * to simplify script writing */ const KmHelper = require("kmhelper"); - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // CONSTANTS DEFINITION // // here you may specify custom CONSTANTS used within the script. // // // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * This constant specifies allowed values to determine how the aggregation process will deal with indicator values. * I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. @@ -25,7 +22,6 @@ const KmHelper = require("kmhelper"); * @constant */ const aggregationTypeEnum = ["SUM", "AVERAGE"]; - /** * via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. * Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option @@ -34,10 +30,8 @@ const aggregationTypeEnum = ["SUM", "AVERAGE"]; * @constant */ const aggregationType = "AVERAGE"; - const parameterName_referenceIndicatorId = "REFERENCE_ID"; const parameterName_computationIndicatorId = "COMPUTATION_ID"; - /** * This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined * as method parameters that can be used within the method body. @@ -55,162 +49,137 @@ const parameterName_computationIndicatorId = "COMPUTATION_ID"; * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ - - var referenceIndicatorId = KmHelper.getProcessParameterByName_asString(parameterName_referenceIndicatorId, processParameters); - var referenceGeoJSON = KmHelper.getBaseIndicatorById(referenceIndicatorId, baseIndicatorsMap); - - var computationIndicatorIds = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId, processParameters); - var computationIndicatorIds_array = computationIndicatorIds.split(','); - var computationGeoJSON_array = []; - for (const indicatorID of computationIndicatorIds_array){ - computationGeoJSON_array.push(KmHelper.getBaseIndicatorById(indicatorID, baseIndicatorsMap))}; - - KmHelper.log("Retrieved required baseIndicators successfully"); - - // now we compute the new indicator - KmHelper.log("Iterate over base indicators and save intermediate values within a map object"); - - /** - * create a map to store indicator values for each feature of the target spatial unit - * by using such a map object, we can ensure, that we only iterate ONCE over each bease indicator - * and also can only iterate ONCE over each target spatial unit feature at the end to compute the indicator - */ - var map = new Map(); - - KmHelper.log("Process reference indicator '" + referenceIndicatorId + "'"); - - /** - * iterate over each feature of the baseIndicator and use its indicator value to modify map object - * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! - */ - referenceGeoJSON.features.forEach(function(feature) { +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters) { + var referenceIndicatorId = KmHelper.getProcessParameterByName_asString(parameterName_referenceIndicatorId, processParameters); + var referenceGeoJSON = KmHelper.getBaseIndicatorById(referenceIndicatorId, baseIndicatorsMap); + var computationIndicatorIds = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId, processParameters); + var computationIndicatorIds_array = computationIndicatorIds.split(','); + var computationGeoJSON_array = []; + for (const indicatorID of computationIndicatorIds_array) { + computationGeoJSON_array.push(KmHelper.getBaseIndicatorById(indicatorID, baseIndicatorsMap)); + } + ; + KmHelper.log("Retrieved required baseIndicators successfully"); + // now we compute the new indicator + KmHelper.log("Iterate over base indicators and save intermediate values within a map object"); + /** + * create a map to store indicator values for each feature of the target spatial unit + * by using such a map object, we can ensure, that we only iterate ONCE over each bease indicator + * and also can only iterate ONCE over each target spatial unit feature at the end to compute the indicator + */ + var map = new Map(); + KmHelper.log("Process reference indicator '" + referenceIndicatorId + "'"); + /** + * iterate over each feature of the baseIndicator and use its indicator value to modify map object + * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! + */ + referenceGeoJSON.features.forEach(function (feature) { // get the unique featureID of the spatial unit feature as String var featureId = KmHelper.getSpatialUnitFeatureIdValue(feature); // get the time series value of the base indicator feature for the requested target date (with its required prefix!) var referenceValue = KmHelper.getIndicatorValue(feature, targetDate); - - if(referenceValue === undefined || referenceValue === null){ - KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); - KmHelper.log("WARNING: process will return"); - referenceValue = 0; + if (referenceValue === undefined || referenceValue === null) { + KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); + KmHelper.log("WARNING: process will return"); + referenceValue = 0; } - // modify map object (i.e. set value initially, or perform calculations and store modified value) + // modify map object (i.e. set value initially, or perform calculations and store modified value) // key should be unique featureId of the spatial unit feature - if (! map.has(featureId)){ + if (!map.has(featureId)) { var mapObject = { featureId: featureId, indicatorValue: undefined, refValue: 0, intermediateValue: 0 - }; - - map.set(featureId, mapObject); + }; + map.set(featureId, mapObject); } - var mapEntry = map.get(featureId); - mapEntry.refValue = referenceValue; + var mapEntry = map.get(featureId); + mapEntry.refValue = referenceValue; map.set(featureId, mapEntry); - }); - - KmHelper.log("Process computation indicator"); - - /** - * iterate over each feature of the baseIndicator and use its indicator value to modify map object - * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! - */ - computationGeoJSON_array.forEach(function(geoJSON) { - - geoJSON.features.forEach(function(feature) { - // get the unique featureID of the spatial unit feature as String - var featureId = KmHelper.getSpatialUnitFeatureIdValue(feature); - // get the time series value of the base indicator feature for the requested target date (with its required prefix!) - var partValue = KmHelper.getIndicatorValue(feature, targetDate); - if(partValue === undefined || partValue === null){ - KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); - KmHelper.log("WARNING: the feature value will thus be set to '0' and computation will continue"); - partValue = 0; - } - // modify map object (i.e. set value initially, or perform calculations and store modified value) - // key should be unique featureId of the spatial unit feature - - if (! map.has(featureId)){ - KmHelper.log("Computation Indicator feature with id '" + featureId + "' was not computed from computation resources. Will set ref value to null."); - var mapObject = { - featureId: featureId, - indicatorValue: undefined, - refValue: null, - intermediateValue: 0 + }); + KmHelper.log("Process computation indicator"); + /** + * iterate over each feature of the baseIndicator and use its indicator value to modify map object + * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! + */ + computationGeoJSON_array.forEach(function (geoJSON) { + geoJSON.features.forEach(function (feature) { + // get the unique featureID of the spatial unit feature as String + var featureId = KmHelper.getSpatialUnitFeatureIdValue(feature); + // get the time series value of the base indicator feature for the requested target date (with its required prefix!) + var partValue = KmHelper.getIndicatorValue(feature, targetDate); + if (partValue === undefined || partValue === null) { + KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); + KmHelper.log("WARNING: the feature value will thus be set to '0' and computation will continue"); + partValue = 0; + } + // modify map object (i.e. set value initially, or perform calculations and store modified value) + // key should be unique featureId of the spatial unit feature + if (!map.has(featureId)) { + KmHelper.log("Computation Indicator feature with id '" + featureId + "' was not computed from computation resources. Will set ref value to null."); + var mapObject = { + featureId: featureId, + indicatorValue: undefined, + refValue: null, + intermediateValue: 0 }; - - map.set(featureId, mapObject); - } - - var mapEntry = map.get(featureId); - mapEntry.intermediateValue = mapEntry.intermediateValue + partValue; - map.set(featureId, mapEntry); - }); - }); - - var numFeatures = targetSpatialUnit_geoJSON.features.length; - - // now we compute the new indicator - KmHelper.log("Compute indicator for a total amount of " + numFeatures + " features"); - - // iterate once over target spatial unit features and compute indicator utilizing map entries - var spatialUnitIndex = 0; - // create progress log after each 10th percent of features - var logProgressIndexSeparator = Math.round(numFeatures / 100 * 10); - targetSpatialUnit_geoJSON.features.forEach(function(spatialUnitFeature) { - + map.set(featureId, mapObject); + } + var mapEntry = map.get(featureId); + mapEntry.intermediateValue = mapEntry.intermediateValue + partValue; + map.set(featureId, mapEntry); + }); + }); + var numFeatures = targetSpatialUnit_geoJSON.features.length; + // now we compute the new indicator + KmHelper.log("Compute indicator for a total amount of " + numFeatures + " features"); + // iterate once over target spatial unit features and compute indicator utilizing map entries + var spatialUnitIndex = 0; + // create progress log after each 10th percent of features + var logProgressIndexSeparator = Math.round(numFeatures / 100 * 10); + targetSpatialUnit_geoJSON.features.forEach(function (spatialUnitFeature) { // get spatialUnit feature id as string --> use it to get associated map entry var spatialUnitFeatureId = KmHelper.getSpatialUnitFeatureIdValue(spatialUnitFeature); - - if (! map.has(spatialUnitFeatureId)){ - KmHelper.log("Target spatial unit feature with id '" + spatialUnitFeatureId + "' was not computed from computation resources. Will set indicator value to null."); - var mapObject = { - featureId: spatialUnitFeatureId, - indicatorValue: undefined, - refValue: null, - intermediateValue: null - }; - - map.set(spatialUnitFeatureId, mapObject); - } - + if (!map.has(spatialUnitFeatureId)) { + KmHelper.log("Target spatial unit feature with id '" + spatialUnitFeatureId + "' was not computed from computation resources. Will set indicator value to null."); + var mapObject = { + featureId: spatialUnitFeatureId, + indicatorValue: undefined, + refValue: null, + intermediateValue: null + }; + map.set(spatialUnitFeatureId, mapObject); + } var mapEntry = map.get(spatialUnitFeatureId); - - var indicatorValue = null; - if(mapEntry.refValue === undefined || mapEntry.refValue === null || mapEntry.refValue === undefined || mapEntry.intermediateValue === null){ - KmHelper.log("WARNING: the feature with featureID '" + spatialUnitFeatureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); - KmHelper.log("INFO: indicator value is set to null"); - indicatorValue = null; - } else if(mapEntry.refValue === 0) { - indicatorValue = 0; - KmHelper.log("WARNING: the feature with featureID '" + spatialUnitFeatureId + "' cotains a '0' as numerator value for targetDate '" + targetDate + "'"); - KmHelper.log("INFO: indicator value is set to 0"); - } else { - indicatorValue = (mapEntry.intermediateValue / mapEntry.refValue) * 1000; - } - + var indicatorValue = null; + if (mapEntry.refValue === undefined || mapEntry.refValue === null || mapEntry.refValue === undefined || mapEntry.intermediateValue === null) { + KmHelper.log("WARNING: the feature with featureID '" + spatialUnitFeatureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); + KmHelper.log("INFO: indicator value is set to null"); + indicatorValue = null; + } + else if (mapEntry.refValue === 0) { + indicatorValue = 0; + KmHelper.log("WARNING: the feature with featureID '" + spatialUnitFeatureId + "' cotains a '0' as numerator value for targetDate '" + targetDate + "'"); + KmHelper.log("INFO: indicator value is set to 0"); + } + else { + indicatorValue = (mapEntry.intermediateValue / mapEntry.refValue) * 1000; + } // set aggregationWeight as number of citizens KmHelper.setAggregationWeight(spatialUnitFeature, indicatorValue); - // set indicator value for spatialUnitFeature spatialUnitFeature = KmHelper.setIndicatorValue(spatialUnitFeature, targetDate, indicatorValue); - - spatialUnitIndex ++; - + spatialUnitIndex++; // only log after certain progress - if(spatialUnitIndex % logProgressIndexSeparator === 0){ + if (spatialUnitIndex % logProgressIndexSeparator === 0) { KmHelper.log("PROGRESS: Computed '" + spatialUnitIndex + "' of total '" + numFeatures + "' features."); } - }); - - KmHelper.log("Computation of indicator finished"); - - return targetSpatialUnit_geoJSON; -}; - + }); + KmHelper.log("Computation of indicator finished"); + return targetSpatialUnit_geoJSON; +} +; /** * This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). * The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. @@ -226,22 +195,22 @@ async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndic * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - if (!aggregationTypeEnum.includes(aggregationType)){ - console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + - "'. Allowed values are: " + aggregationTypeEnum); - console.log("Will fallback to using AVERAGE aggregation logic."); - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else if(aggregationType === "SUM"){ - return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else { - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } -}; - +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)) { + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if (aggregationType === "SUM") { + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +} +; /** * This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). * @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! @@ -252,12 +221,10 @@ function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geo * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // disaggregate indicator - -}; - - +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // disaggregate indicator +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. @@ -271,74 +238,60 @@ function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check to aggregate - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var baseIndicatorTotalWeight = 0; - var featureCounter = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - featureCounter++; - - // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number - if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ - // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method - // it "survives" until this aggregation logic within processing engine - var weight = KmHelper.getAggregationWeight(indicatorFeature); - - // use weight as weight for indicator value - baseIndicatorTotalWeight += weight; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; - } - } - } - - // compute average for share - if(baseIndicatorTotalWeight === 0){ - targetFeature.properties[targetDate] = Number.NaN; +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; } - else { - targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if (!Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined) { + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + // compute average for share + if (baseIndicatorTotalWeight === 0) { + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + KmHelper.log("Aggregation finished"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); } - // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); - }); - - KmHelper.log("Aggregation finished"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - + return targetSpatialUnit_geoJSON; +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} @@ -352,59 +305,47 @@ function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - var totalAggregatedIndicatorFeatures = 0; - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check for aggregation - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var numberOfIndicatorFeaturesWithinTargetFeature = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - numberOfIndicatorFeaturesWithinTargetFeature++; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); - } - } - totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; - }); - - KmHelper.log("Aggregation finished"); - KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - - +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + var totalAggregatedIndicatorFeatures = 0; + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; + } + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + return targetSpatialUnit_geoJSON; +} +; module.exports.computeIndicator = computeIndicator; module.exports.aggregateIndicator = aggregateIndicator; module.exports.disaggregateIndicator = disaggregateIndicator; +//# sourceMappingURL=km_indicator_promille.js.map \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_indicator_promille.js.map b/app/kommonitor-script-resources/km_indicator_promille.js.map new file mode 100644 index 000000000..5c0f46d03 --- /dev/null +++ b/app/kommonitor-script-resources/km_indicator_promille.js.map @@ -0,0 +1 @@ +{"version":3,"file":"km_indicator_promille.js","sourceRoot":"","sources":["km_indicator_promille.ts"],"names":[],"mappings":";AAAA,8JAA8J;AAC9J,yRAAyR;AACzR,8JAA8J;AAC9J,4GAA4G;AAC5G,8JAA8J;AAE9J;;;EAGE;AACF,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAGrC,8JAA8J;AAC9J,8JAA8J;AAC9J,6OAA6O;AAC7O,8JAA8J;AAE9J;;;;;;;EAOE;AACF,MAAM,mBAAmB,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AAE/C;;;;;;EAME;AACF,MAAM,eAAe,GAAG,SAAS,CAAC;AAElC,MAAM,kCAAkC,GAAG,cAAc,CAAC;AAC1D,MAAM,oCAAoC,GAAG,gBAAgB,CAAC;AAE9D;;;;;;;;;;;;;;;;EAgBE;AACF,KAAK,UAAU,gBAAgB,CAAC,UAAU,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,eAAe,EAAE,iBAAiB;IAEzH,IAAI,oBAAoB,GAAG,QAAQ,CAAC,kCAAkC,CAAC,kCAAkC,EAAE,iBAAiB,CAAC,CAAC;IAC9H,IAAI,gBAAgB,GAAG,QAAQ,CAAC,oBAAoB,CAAC,oBAAoB,EAAE,iBAAiB,CAAC,CAAC;IAE3F,IAAI,uBAAuB,GAAG,QAAQ,CAAC,kCAAkC,CAAC,oCAAoC,EAAE,iBAAiB,CAAC,CAAC;IACtI,IAAI,6BAA6B,GAAG,uBAAuB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACvE,IAAI,wBAAwB,GAAG,EAAE,CAAC;IAClC,KAAK,MAAM,WAAW,IAAI,6BAA6B,EAAC;QACzD,wBAAwB,CAAC,IAAI,CAAC,QAAQ,CAAC,oBAAoB,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC,CAA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CAAC,KAAK,CAAC,mDAAmD,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAC9F,MAAM,KAAK,CAAC,6DAA6D,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;KACvG;IAED,OAAO,yBAAyB,CAAC;AACnC,CAAC;AAAA,CAAC;AAGF,MAAM,CAAC,OAAO,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;AACnD,MAAM,CAAC,OAAO,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;AACvD,MAAM,CAAC,OAAO,CAAC,qBAAqB,GAAG,qBAAqB,CAAC"} \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_indicator_promille.ts b/app/kommonitor-script-resources/km_indicator_promille.ts new file mode 100644 index 000000000..f0fe33cd5 --- /dev/null +++ b/app/kommonitor-script-resources/km_indicator_promille.ts @@ -0,0 +1,410 @@ +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// NECESSARY NODE MODULE DEPENDENCIES // // +// // +// SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* Module that contains various helper methods (spatial GIS functions and statistical functions) +* to simplify script writing +*/ +const KmHelper = require("kmhelper"); + + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// CONSTANTS DEFINITION // +// here you may specify custom CONSTANTS used within the script. // // // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* This constant specifies allowed values to determine how the aggregation process will deal with indicator values. +* I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. +* Note that these values must not be changed by users! +* @type {Array.} +* @memberof CONSTANTS +* @constant +*/ +const aggregationTypeEnum = ["SUM", "AVERAGE"]; + +/** +* via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. +* Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option +* @type {string} +* @memberof CONSTANTS +* @constant +*/ +const aggregationType = "AVERAGE"; + +const parameterName_referenceIndicatorId = "REFERENCE_ID"; +const parameterName_computationIndicatorId = "COMPUTATION_ID"; + +/** +* This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined +* as method parameters that can be used within the method body. +* +* NOTE: The function is async, so users may make use of keyword "await" to wait for results of other async helper API methods. +* (This is necessary when users want to wait for asynchronous method execution such as external API calls in a synchronous program) +* +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit as GeoJSON FeatureCollection object. +* @param {map.>} baseIndicatorsMap - Map containing all indicators, wheres key='meaningful name or id of the indicator' and value='indicator as GeoJSON object' (it contains duplicate entries, one for the indicator name and one for the indicator id) +* @param {map.>} georesourcesMap - Map containing all georesources, wheres key='meaningful name or id of the georesource' and value='georesource as GeoJSON object' (they are used to execute geometric/toptologic computations) (it contains duplicate entries, one for the georesource name and one for the georesource id) +* @param {Array.>} processParameters - an array containing objects representing variable additional process parameters that are required to perform the indicator computation. +* Each entry has properties Object.name and Object.value for name and value of the parameter. +* @returns {FeatureCollection} the computed indicator for submitted {@linkcode targetSpatialUnit_geoJSON} features as GeoJSON FeatureCollection +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ + + var referenceIndicatorId = KmHelper.getProcessParameterByName_asString(parameterName_referenceIndicatorId, processParameters); + var referenceGeoJSON = KmHelper.getBaseIndicatorById(referenceIndicatorId, baseIndicatorsMap); + + var computationIndicatorIds = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId, processParameters); + var computationIndicatorIds_array = computationIndicatorIds.split(','); + var computationGeoJSON_array = []; + for (const indicatorID of computationIndicatorIds_array){ + computationGeoJSON_array.push(KmHelper.getBaseIndicatorById(indicatorID, baseIndicatorsMap))}; + + KmHelper.log("Retrieved required baseIndicators successfully"); + + // now we compute the new indicator + KmHelper.log("Iterate over base indicators and save intermediate values within a map object"); + + /** + * create a map to store indicator values for each feature of the target spatial unit + * by using such a map object, we can ensure, that we only iterate ONCE over each bease indicator + * and also can only iterate ONCE over each target spatial unit feature at the end to compute the indicator + */ + var map = new Map(); + + KmHelper.log("Process reference indicator '" + referenceIndicatorId + "'"); + + /** + * iterate over each feature of the baseIndicator and use its indicator value to modify map object + * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! + */ + referenceGeoJSON.features.forEach(function(feature) { + // get the unique featureID of the spatial unit feature as String + var featureId = KmHelper.getSpatialUnitFeatureIdValue(feature); + // get the time series value of the base indicator feature for the requested target date (with its required prefix!) + var referenceValue = KmHelper.getIndicatorValue(feature, targetDate); + + if(referenceValue === undefined || referenceValue === null){ + KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); + KmHelper.log("WARNING: process will return"); + referenceValue = 0; + } + // modify map object (i.e. set value initially, or perform calculations and store modified value) + // key should be unique featureId of the spatial unit feature + if (! map.has(featureId)){ + var mapObject = { + featureId: featureId, + indicatorValue: undefined, + refValue: 0, + intermediateValue: 0 + }; + + map.set(featureId, mapObject); + } + var mapEntry = map.get(featureId); + mapEntry.refValue = referenceValue; + map.set(featureId, mapEntry); + }); + + KmHelper.log("Process computation indicator"); + + /** + * iterate over each feature of the baseIndicator and use its indicator value to modify map object + * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! + */ + computationGeoJSON_array.forEach(function(geoJSON) { + + geoJSON.features.forEach(function(feature) { + // get the unique featureID of the spatial unit feature as String + var featureId = KmHelper.getSpatialUnitFeatureIdValue(feature); + // get the time series value of the base indicator feature for the requested target date (with its required prefix!) + var partValue = KmHelper.getIndicatorValue(feature, targetDate); + if(partValue === undefined || partValue === null){ + KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); + KmHelper.log("WARNING: the feature value will thus be set to '0' and computation will continue"); + partValue = 0; + } + // modify map object (i.e. set value initially, or perform calculations and store modified value) + // key should be unique featureId of the spatial unit feature + + if (! map.has(featureId)){ + KmHelper.log("Computation Indicator feature with id '" + featureId + "' was not computed from computation resources. Will set ref value to null."); + var mapObject = { + featureId: featureId, + indicatorValue: undefined, + refValue: null, + intermediateValue: 0 + }; + + map.set(featureId, mapObject); + } + + var mapEntry = map.get(featureId); + mapEntry.intermediateValue = mapEntry.intermediateValue + partValue; + map.set(featureId, mapEntry); + }); + }); + + var numFeatures = targetSpatialUnit_geoJSON.features.length; + + // now we compute the new indicator + KmHelper.log("Compute indicator for a total amount of " + numFeatures + " features"); + + // iterate once over target spatial unit features and compute indicator utilizing map entries + var spatialUnitIndex = 0; + // create progress log after each 10th percent of features + var logProgressIndexSeparator = Math.round(numFeatures / 100 * 10); + targetSpatialUnit_geoJSON.features.forEach(function(spatialUnitFeature) { + + // get spatialUnit feature id as string --> use it to get associated map entry + var spatialUnitFeatureId = KmHelper.getSpatialUnitFeatureIdValue(spatialUnitFeature); + + if (! map.has(spatialUnitFeatureId)){ + KmHelper.log("Target spatial unit feature with id '" + spatialUnitFeatureId + "' was not computed from computation resources. Will set indicator value to null."); + var mapObject = { + featureId: spatialUnitFeatureId, + indicatorValue: undefined, + refValue: null, + intermediateValue: null + }; + + map.set(spatialUnitFeatureId, mapObject); + } + + var mapEntry = map.get(spatialUnitFeatureId); + + var indicatorValue = null; + if(mapEntry.refValue === undefined || mapEntry.refValue === null || mapEntry.refValue === undefined || mapEntry.intermediateValue === null){ + KmHelper.log("WARNING: the feature with featureID '" + spatialUnitFeatureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); + KmHelper.log("INFO: indicator value is set to null"); + indicatorValue = null; + } else if(mapEntry.refValue === 0) { + indicatorValue = 0; + KmHelper.log("WARNING: the feature with featureID '" + spatialUnitFeatureId + "' cotains a '0' as numerator value for targetDate '" + targetDate + "'"); + KmHelper.log("INFO: indicator value is set to 0"); + } else { + indicatorValue = (mapEntry.intermediateValue / mapEntry.refValue) * 1000; + } + + // set aggregationWeight as number of citizens + KmHelper.setAggregationWeight(spatialUnitFeature, indicatorValue); + + // set indicator value for spatialUnitFeature + spatialUnitFeature = KmHelper.setIndicatorValue(spatialUnitFeature, targetDate, indicatorValue); + + spatialUnitIndex ++; + + // only log after certain progress + if(spatialUnitIndex % logProgressIndexSeparator === 0){ + KmHelper.log("PROGRESS: Computed '" + spatialUnitIndex + "' of total '" + numFeatures + "' features."); + } + }); + + KmHelper.log("Computation of indicator finished"); + + return targetSpatialUnit_geoJSON; +}; + +/** +* This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). +* The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. +* The aggrgation internally aggregates features of {@linkcode indicator_geoJSON} to features of {@linkcode targetSpatialUnit_geoJSON} by comparing their geometries. +* Each {@linkcode indicator_geoJSON} feature whose geometry lies within a certain geometry of a {@linkcode targetSpatialUnit_geoJSON} feature will be used to compute the aggregated indicator values. +* The within comparison is executed by method {@linkcode within_usingBBOX}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be aggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter targetSpatialUnit_geoJSON +* @see aggregationType +* @see within_usingBBOX +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the aggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)){ + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if(aggregationType === "SUM"){ + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +}; + +/** +* This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). +* @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be disaggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be disaggregated to the features of parameter targetSpatialUnit_geoJSON +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the disaggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // disaggregate indicator + +}; + + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. +* Also it uses the {@linkcode KmHelper.getAggregationWeight(feature)} method as weight during aggregtion. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + + // compute average for share + if(baseIndicatorTotalWeight === 0){ + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + + KmHelper.log("Aggregation finished"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} +* to determine which features of {@linkcode indicator_geoJSON} can be aggregated to which features of {@linkcode targetSpatialUnit_geoJSON}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + var totalAggregatedIndicatorFeatures = 0; + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + + +module.exports.computeIndicator = computeIndicator; +module.exports.aggregateIndicator = aggregateIndicator; +module.exports.disaggregateIndicator = disaggregateIndicator; diff --git a/app/kommonitor-script-resources/km_indicator_relChange_nTemporalItems.js b/app/kommonitor-script-resources/km_indicator_relChange_nTemporalItems.js index b1111251f..ec9321536 100644 --- a/app/kommonitor-script-resources/km_indicator_relChange_nTemporalItems.js +++ b/app/kommonitor-script-resources/km_indicator_relChange_nTemporalItems.js @@ -1,21 +1,18 @@ +"use strict"; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // NECESSARY NODE MODULE DEPENDENCIES // // // // // SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * Module that contains various helper methods (spatial GIS functions and statistical functions) * to simplify script writing */ const KmHelper = require("kmhelper"); - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // CONSTANTS DEFINITION // // here you may specify custom CONSTANTS used within the script. // // // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * This constant specifies allowed values to determine how the aggregation process will deal with indicator values. * I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. @@ -25,7 +22,6 @@ const KmHelper = require("kmhelper"); * @constant */ const aggregationTypeEnum = ["SUM", "AVERAGE"]; - /** * via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. * Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option @@ -34,15 +30,10 @@ const aggregationTypeEnum = ["SUM", "AVERAGE"]; * @constant */ const aggregationType = "SUM"; - const parameterName_computationIndicatorId = "COMPUTATION_ID"; - const parameterName_numberOfTemporalItems = "NUMBER_OF_TEMPORAL_ITEMS"; - // allowed values ['YEARS', 'MONTHS', 'DAYS'] -const parameterName_temporalType = "TEMPORAL_TYPE" - - +const parameterName_temporalType = "TEMPORAL_TYPE"; /** * This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined * as method parameters that can be used within the method body. @@ -60,44 +51,36 @@ const parameterName_temporalType = "TEMPORAL_TYPE" * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ - +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters) { // get the id to be used for calculations var computationIndicatorId = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId, processParameters); var temporalType = KmHelper.getProcessParameterByName_asString(parameterName_temporalType, processParameters); var numberOfTemporalItems = KmHelper.getProcessParameterByName_asNumber(parameterName_numberOfTemporalItems, processParameters); - - // get the indicator using the computationIndicatorId - var computationIndicator = KmHelper.getBaseIndicatorById(computationIndicatorId, baseIndicatorsMap) - KmHelper.log("Retrieved required computationIndicator successfully."); - + var computationIndicator = KmHelper.getBaseIndicatorById(computationIndicatorId, baseIndicatorsMap); + KmHelper.log("Retrieved required computationIndicator successfully."); // now we compute the new indicator for a relative change compared to previous year // internally tests are run, e.g. if a previous year is available or not var resultMap = new Map(); - - if(temporalType === "YEARS"){ - resultMap = KmHelper.changeRelative_n_years_percent(computationIndicator, targetDate, numberOfTemporalItems); - } - else if(temporalType === "MONTHS"){ - resultMap = KmHelper.changeRelative_n_months_percent(computationIndicator, targetDate, numberOfTemporalItems); - } - else if(temporalType === "DAYS"){ - resultMap = KmHelper.changeRelative_n_days_percent(computationIndicator, targetDate, numberOfTemporalItems); - } - else{ - KmHelper.log("WARNING: parameter '" + parameterName_temporalType + "' with allowed values ['YEARS', 'MONTHS', 'DAYS'] has unknown value '" + temporalType + "'. Will use YEARS as default"); - resultMap = KmHelper.changeRelative_n_years_percent(computationIndicator, targetDate, numberOfTemporalItems); - } - - + if (temporalType === "YEARS") { + resultMap = KmHelper.changeRelative_n_years_percent(computationIndicator, targetDate, numberOfTemporalItems); + } + else if (temporalType === "MONTHS") { + resultMap = KmHelper.changeRelative_n_months_percent(computationIndicator, targetDate, numberOfTemporalItems); + } + else if (temporalType === "DAYS") { + resultMap = KmHelper.changeRelative_n_days_percent(computationIndicator, targetDate, numberOfTemporalItems); + } + else { + KmHelper.log("WARNING: parameter '" + parameterName_temporalType + "' with allowed values ['YEARS', 'MONTHS', 'DAYS'] has unknown value '" + temporalType + "'. Will use YEARS as default"); + resultMap = KmHelper.changeRelative_n_years_percent(computationIndicator, targetDate, numberOfTemporalItems); + } var numFeatures = targetSpatialUnit_geoJSON.features.length; KmHelper.log("Computed change indicator for a total amount of " + numFeatures + " features"); targetSpatialUnit_geoJSON = KmHelper.setIndicatorValues_fromIdValueMap(targetSpatialUnit_geoJSON, targetDate, resultMap); KmHelper.log("Computation of relative change compared to previous year finished"); return targetSpatialUnit_geoJSON; } - /** * This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). * The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. @@ -113,22 +96,22 @@ async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndic * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - if (!aggregationTypeEnum.includes(aggregationType)){ - console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + - "'. Allowed values are: " + aggregationTypeEnum); - console.log("Will fallback to using AVERAGE aggregation logic."); - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else if(aggregationType === "SUM"){ - return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else { - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } -}; - +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)) { + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if (aggregationType === "SUM") { + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +} +; /** * This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). * @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! @@ -139,12 +122,10 @@ function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geo * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // disaggregate indicator - -}; - - +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // disaggregate indicator +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. @@ -158,74 +139,60 @@ function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check to aggregate - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var baseIndicatorTotalWeight = 0; - var featureCounter = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - featureCounter++; - - // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number - if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ - // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method - // it "survives" until this aggregation logic within processing engine - var weight = KmHelper.getAggregationWeight(indicatorFeature); - - // use weight as weight for indicator value - baseIndicatorTotalWeight += weight; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; - } - } - } - - // compute average for share - if(baseIndicatorTotalWeight === 0){ - targetFeature.properties[targetDate] = Number.NaN; +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; } - else { - targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if (!Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined) { + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + // compute average for share + if (baseIndicatorTotalWeight === 0) { + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + KmHelper.log("Aggregation finished"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); } - // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); - }); - - KmHelper.log("Aggregation finished"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - + return targetSpatialUnit_geoJSON; +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} @@ -239,59 +206,47 @@ function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - var totalAggregatedIndicatorFeatures = 0; - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check for aggregation - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var numberOfIndicatorFeaturesWithinTargetFeature = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - numberOfIndicatorFeaturesWithinTargetFeature++; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); - } - } - totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; - }); - - KmHelper.log("Aggregation finished"); - KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - - +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + var totalAggregatedIndicatorFeatures = 0; + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; + } + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + return targetSpatialUnit_geoJSON; +} +; module.exports.computeIndicator = computeIndicator; module.exports.aggregateIndicator = aggregateIndicator; module.exports.disaggregateIndicator = disaggregateIndicator; +//# sourceMappingURL=km_indicator_relChange_nTemporalItems.js.map \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_indicator_relChange_nTemporalItems.js.map b/app/kommonitor-script-resources/km_indicator_relChange_nTemporalItems.js.map new file mode 100644 index 000000000..2461af25e --- /dev/null +++ b/app/kommonitor-script-resources/km_indicator_relChange_nTemporalItems.js.map @@ -0,0 +1 @@ +{"version":3,"file":"km_indicator_relChange_nTemporalItems.js","sourceRoot":"","sources":["km_indicator_relChange_nTemporalItems.ts"],"names":[],"mappings":";AAAA,8JAA8J;AAC9J,yRAAyR;AACzR,8JAA8J;AAC9J,4GAA4G;AAC5G,8JAA8J;AAE9J;;;EAGE;AACF,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAGrC,8JAA8J;AAC9J,8JAA8J;AAC9J,6OAA6O;AAC7O,8JAA8J;AAE9J;;;;;;;EAOE;AACF,MAAM,mBAAmB,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AAE/C;;;;;;EAME;AACF,MAAM,eAAe,GAAG,KAAK,CAAC;AAE9B,MAAM,oCAAoC,GAAG,gBAAgB,CAAC;AAE9D,MAAM,mCAAmC,GAAG,0BAA0B,CAAC;AAEvE,6CAA6C;AAC7C,MAAM,0BAA0B,GAAG,eAAe,CAAA;AAGlD;;;;;;;;;;;;;;;;EAgBE;AACF,KAAK,UAAU,gBAAgB,CAAC,UAAU,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,eAAe,EAAE,iBAAiB;IAExH,yCAAyC;IACzC,IAAI,sBAAsB,GAAG,QAAQ,CAAC,kCAAkC,CAAC,oCAAoC,EAAE,iBAAiB,CAAC,CAAC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,MAAM,CAAC,gBAAgB,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;aACxF;SACD;QACA,gCAAgC,IAAI,4CAA4C,CAAC;IACnF,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;IACrC,QAAQ,CAAC,GAAG,CAAC,gCAAgC,GAAG,+BAA+B,GAAG,yBAAyB,CAAC,QAAQ,CAAC,MAAM,GAAG,iBAAiB,CAAC,CAAC;IAEjJ,IAAG,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAC;QAC9B,OAAO,CAAC,KAAK,CAAC,mDAAmD,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAC9F,MAAM,KAAK,CAAC,6DAA6D,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;KACvG;IAED,OAAO,yBAAyB,CAAC;AACnC,CAAC;AAAA,CAAC;AAGF,MAAM,CAAC,OAAO,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;AACnD,MAAM,CAAC,OAAO,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;AACvD,MAAM,CAAC,OAAO,CAAC,qBAAqB,GAAG,qBAAqB,CAAC"} \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_indicator_relChange_nTemporalItems.ts b/app/kommonitor-script-resources/km_indicator_relChange_nTemporalItems.ts new file mode 100644 index 000000000..b1111251f --- /dev/null +++ b/app/kommonitor-script-resources/km_indicator_relChange_nTemporalItems.ts @@ -0,0 +1,297 @@ +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// NECESSARY NODE MODULE DEPENDENCIES // // +// // +// SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* Module that contains various helper methods (spatial GIS functions and statistical functions) +* to simplify script writing +*/ +const KmHelper = require("kmhelper"); + + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// CONSTANTS DEFINITION // +// here you may specify custom CONSTANTS used within the script. // // // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* This constant specifies allowed values to determine how the aggregation process will deal with indicator values. +* I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. +* Note that these values must not be changed by users! +* @type {Array.} +* @memberof CONSTANTS +* @constant +*/ +const aggregationTypeEnum = ["SUM", "AVERAGE"]; + +/** +* via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. +* Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option +* @type {string} +* @memberof CONSTANTS +* @constant +*/ +const aggregationType = "SUM"; + +const parameterName_computationIndicatorId = "COMPUTATION_ID"; + +const parameterName_numberOfTemporalItems = "NUMBER_OF_TEMPORAL_ITEMS"; + +// allowed values ['YEARS', 'MONTHS', 'DAYS'] +const parameterName_temporalType = "TEMPORAL_TYPE" + + +/** +* This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined +* as method parameters that can be used within the method body. +* +* NOTE: The function is async, so users may make use of keyword "await" to wait for results of other async helper API methods. +* (This is necessary when users want to wait for asynchronous method execution such as external API calls in a synchronous program) +* +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit as GeoJSON FeatureCollection object. +* @param {map.>} baseIndicatorsMap - Map containing all indicators, wheres key='meaningful name or id of the indicator' and value='indicator as GeoJSON object' (it contains duplicate entries, one for the indicator name and one for the indicator id) +* @param {map.>} georesourcesMap - Map containing all georesources, wheres key='meaningful name or id of the georesource' and value='georesource as GeoJSON object' (they are used to execute geometric/toptologic computations) (it contains duplicate entries, one for the georesource name and one for the georesource id) +* @param {Array.>} processParameters - an array containing objects representing variable additional process parameters that are required to perform the indicator computation. +* Each entry has properties Object.name and Object.value for name and value of the parameter. +* @returns {FeatureCollection} the computed indicator for submitted {@linkcode targetSpatialUnit_geoJSON} features as GeoJSON FeatureCollection +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ + + // get the id to be used for calculations + var computationIndicatorId = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId, processParameters); + var temporalType = KmHelper.getProcessParameterByName_asString(parameterName_temporalType, processParameters); + var numberOfTemporalItems = KmHelper.getProcessParameterByName_asNumber(parameterName_numberOfTemporalItems, processParameters); + + + // get the indicator using the computationIndicatorId + var computationIndicator = KmHelper.getBaseIndicatorById(computationIndicatorId, baseIndicatorsMap) + KmHelper.log("Retrieved required computationIndicator successfully."); + + // now we compute the new indicator for a relative change compared to previous year + // internally tests are run, e.g. if a previous year is available or not + var resultMap = new Map(); + + if(temporalType === "YEARS"){ + resultMap = KmHelper.changeRelative_n_years_percent(computationIndicator, targetDate, numberOfTemporalItems); + } + else if(temporalType === "MONTHS"){ + resultMap = KmHelper.changeRelative_n_months_percent(computationIndicator, targetDate, numberOfTemporalItems); + } + else if(temporalType === "DAYS"){ + resultMap = KmHelper.changeRelative_n_days_percent(computationIndicator, targetDate, numberOfTemporalItems); + } + else{ + KmHelper.log("WARNING: parameter '" + parameterName_temporalType + "' with allowed values ['YEARS', 'MONTHS', 'DAYS'] has unknown value '" + temporalType + "'. Will use YEARS as default"); + resultMap = KmHelper.changeRelative_n_years_percent(computationIndicator, targetDate, numberOfTemporalItems); + } + + + var numFeatures = targetSpatialUnit_geoJSON.features.length; + KmHelper.log("Computed change indicator for a total amount of " + numFeatures + " features"); + targetSpatialUnit_geoJSON = KmHelper.setIndicatorValues_fromIdValueMap(targetSpatialUnit_geoJSON, targetDate, resultMap); + KmHelper.log("Computation of relative change compared to previous year finished"); + return targetSpatialUnit_geoJSON; +} + +/** +* This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). +* The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. +* The aggrgation internally aggregates features of {@linkcode indicator_geoJSON} to features of {@linkcode targetSpatialUnit_geoJSON} by comparing their geometries. +* Each {@linkcode indicator_geoJSON} feature whose geometry lies within a certain geometry of a {@linkcode targetSpatialUnit_geoJSON} feature will be used to compute the aggregated indicator values. +* The within comparison is executed by method {@linkcode within_usingBBOX}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be aggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter targetSpatialUnit_geoJSON +* @see aggregationType +* @see within_usingBBOX +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the aggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)){ + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if(aggregationType === "SUM"){ + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +}; + +/** +* This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). +* @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be disaggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be disaggregated to the features of parameter targetSpatialUnit_geoJSON +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the disaggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // disaggregate indicator + +}; + + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. +* Also it uses the {@linkcode KmHelper.getAggregationWeight(feature)} method as weight during aggregtion. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + + // compute average for share + if(baseIndicatorTotalWeight === 0){ + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + + KmHelper.log("Aggregation finished"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} +* to determine which features of {@linkcode indicator_geoJSON} can be aggregated to which features of {@linkcode targetSpatialUnit_geoJSON}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + var totalAggregatedIndicatorFeatures = 0; + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + + +module.exports.computeIndicator = computeIndicator; +module.exports.aggregateIndicator = aggregateIndicator; +module.exports.disaggregateIndicator = disaggregateIndicator; diff --git a/app/kommonitor-script-resources/km_indicator_relChange_refDate.js b/app/kommonitor-script-resources/km_indicator_relChange_refDate.js index 1db67d3c2..ae7dcdcb7 100644 --- a/app/kommonitor-script-resources/km_indicator_relChange_refDate.js +++ b/app/kommonitor-script-resources/km_indicator_relChange_refDate.js @@ -1,21 +1,18 @@ +"use strict"; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // NECESSARY NODE MODULE DEPENDENCIES // // // // // SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * Module that contains various helper methods (spatial GIS functions and statistical functions) * to simplify script writing */ const KmHelper = require("kmhelper"); - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // CONSTANTS DEFINITION // // here you may specify custom CONSTANTS used within the script. // // // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * This constant specifies allowed values to determine how the aggregation process will deal with indicator values. * I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. @@ -25,7 +22,6 @@ const KmHelper = require("kmhelper"); * @constant */ const aggregationTypeEnum = ["SUM", "AVERAGE"]; - /** * via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. * Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option @@ -34,13 +30,8 @@ const aggregationTypeEnum = ["SUM", "AVERAGE"]; * @constant */ const aggregationType = "SUM"; - const parameterName_computationIndicatorId = "COMPUTATION_ID"; - const parameterName_referenceDATE = "REFERENCE_DATE"; - - - /** * This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined * as method parameters that can be used within the method body. @@ -58,28 +49,23 @@ const parameterName_referenceDATE = "REFERENCE_DATE"; * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ - +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters) { // get the id to be used for calculations var computationIndicatorId = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId, processParameters); // get reference date var referenceDate = KmHelper.getProcessParameterByName_asString(parameterName_referenceDATE, processParameters); - // get the indicator using the computationIndicatorId - var computationIndicator = KmHelper.getBaseIndicatorById(computationIndicatorId, baseIndicatorsMap) - KmHelper.log("Retrieved required computationIndicator successfully."); - + var computationIndicator = KmHelper.getBaseIndicatorById(computationIndicatorId, baseIndicatorsMap); + KmHelper.log("Retrieved required computationIndicator successfully."); // now we compute the new indicator for an absolute change compared to previous year // internally tests are run, e.g. if a previous year is available or not var resultMap = KmHelper.changeRelative_referenceDate_percent(computationIndicator, targetDate, referenceDate); - var numFeatures = targetSpatialUnit_geoJSON.features.length; KmHelper.log("Computed change indicator for a total amount of " + numFeatures + " features"); targetSpatialUnit_geoJSON = KmHelper.setIndicatorValues_fromIdValueMap(targetSpatialUnit_geoJSON, targetDate, resultMap); KmHelper.log("Computation of absolute change compared to previous year finished"); return targetSpatialUnit_geoJSON; } - /** * This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). * The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. @@ -95,22 +81,22 @@ async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndic * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - if (!aggregationTypeEnum.includes(aggregationType)){ - console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + - "'. Allowed values are: " + aggregationTypeEnum); - console.log("Will fallback to using AVERAGE aggregation logic."); - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else if(aggregationType === "SUM"){ - return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else { - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } -}; - +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)) { + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if (aggregationType === "SUM") { + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +} +; /** * This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). * @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! @@ -121,12 +107,10 @@ function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geo * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // disaggregate indicator - -}; - - +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // disaggregate indicator +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. @@ -140,74 +124,60 @@ function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check to aggregate - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var baseIndicatorTotalWeight = 0; - var featureCounter = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - featureCounter++; - - // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number - if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ - // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method - // it "survives" until this aggregation logic within processing engine - var weight = KmHelper.getAggregationWeight(indicatorFeature); - - // use weight as weight for indicator value - baseIndicatorTotalWeight += weight; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; - } - } - } - - // compute average for share - if(baseIndicatorTotalWeight === 0){ - targetFeature.properties[targetDate] = Number.NaN; +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; } - else { - targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if (!Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined) { + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + // compute average for share + if (baseIndicatorTotalWeight === 0) { + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + KmHelper.log("Aggregation finished"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); } - // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); - }); - - KmHelper.log("Aggregation finished"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - + return targetSpatialUnit_geoJSON; +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} @@ -221,59 +191,47 @@ function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - var totalAggregatedIndicatorFeatures = 0; - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check for aggregation - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var numberOfIndicatorFeaturesWithinTargetFeature = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - numberOfIndicatorFeaturesWithinTargetFeature++; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); - } - } - totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; - }); - - KmHelper.log("Aggregation finished"); - KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - - +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + var totalAggregatedIndicatorFeatures = 0; + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; + } + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + return targetSpatialUnit_geoJSON; +} +; module.exports.computeIndicator = computeIndicator; module.exports.aggregateIndicator = aggregateIndicator; module.exports.disaggregateIndicator = disaggregateIndicator; +//# sourceMappingURL=km_indicator_relChange_refDate.js.map \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_indicator_relChange_refDate.js.map b/app/kommonitor-script-resources/km_indicator_relChange_refDate.js.map new file mode 100644 index 000000000..e5c3196dc --- /dev/null +++ b/app/kommonitor-script-resources/km_indicator_relChange_refDate.js.map @@ -0,0 +1 @@ +{"version":3,"file":"km_indicator_relChange_refDate.js","sourceRoot":"","sources":["km_indicator_relChange_refDate.ts"],"names":[],"mappings":";AAAA,8JAA8J;AAC9J,yRAAyR;AACzR,8JAA8J;AAC9J,4GAA4G;AAC5G,8JAA8J;AAE9J;;;EAGE;AACF,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAGrC,8JAA8J;AAC9J,8JAA8J;AAC9J,6OAA6O;AAC7O,8JAA8J;AAE9J;;;;;;;EAOE;AACF,MAAM,mBAAmB,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AAE/C;;;;;;EAME;AACF,MAAM,eAAe,GAAG,KAAK,CAAC;AAE9B,MAAM,oCAAoC,GAAG,gBAAgB,CAAC;AAE9D,MAAM,2BAA2B,GAAG,gBAAgB,CAAC;AAIrD;;;;;;;;;;;;;;;;EAgBE;AACF,KAAK,UAAU,gBAAgB,CAAC,UAAU,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,eAAe,EAAE,iBAAiB;IAExH,yCAAyC;IACzC,IAAI,sBAAsB,GAAG,QAAQ,CAAC,kCAAkC,CAAC,oCAAoC,EAAE,iBAAiB,CAAC,CAAC;IAClI,qBAAqB;IACrB,IAAI,aAAa,GAAG,QAAQ,CAAC,kCAAkC,CAAC,2BAA2B,EAAE,iBAAiB,CAAC,CAAC;IAEhH,sDAAsD;IACtD,IAAI,oBAAoB,GAAG,QAAQ,CAAC,oBAAoB,CAAC,sBAAsB,EAAE,iBAAiB,CAAC,CAAA;IACnG,QAAQ,CAAC,GAAG,CAAC,uDAAuD,CAAC,CAAC;IAEtE,oFAAoF;IACpF,yEA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,gBAAgB,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAC9C,IAAG,QAAQ,CAAC,MAAM,CAAC,gBAAgB,EAAE,aAAa,CAAC,EAAC;gBACrD,wCAAwC;gBACxC,iBAAiB,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;gBAChC,KAAK,EAAE,CAAC;gBACX,4CAA4C,EAAE,CAAC;gBAC/C,aAAa,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,gBAAgB,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;aACxF;SACD;QACA,gCAAgC,IAAI,4CAA4C,CAAC;IACnF,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;IACrC,QAAQ,CAAC,GAAG,CAAC,gCAAgC,GAAG,+BAA+B,GAAG,yBAAyB,CAAC,QAAQ,CAAC,MAAM,GAAG,iBAAiB,CAAC,CAAC;IAEjJ,IAAG,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAC;QAC9B,OAAO,CAAC,KAAK,CAAC,mDAAmD,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAC9F,MAAM,KAAK,CAAC,6DAA6D,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;KACvG;IAED,OAAO,yBAAyB,CAAC;AACnC,CAAC;AAAA,CAAC;AAGF,MAAM,CAAC,OAAO,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;AACnD,MAAM,CAAC,OAAO,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;AACvD,MAAM,CAAC,OAAO,CAAC,qBAAqB,GAAG,qBAAqB,CAAC"} \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_indicator_relChange_refDate.ts b/app/kommonitor-script-resources/km_indicator_relChange_refDate.ts new file mode 100644 index 000000000..1db67d3c2 --- /dev/null +++ b/app/kommonitor-script-resources/km_indicator_relChange_refDate.ts @@ -0,0 +1,279 @@ +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// NECESSARY NODE MODULE DEPENDENCIES // // +// // +// SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* Module that contains various helper methods (spatial GIS functions and statistical functions) +* to simplify script writing +*/ +const KmHelper = require("kmhelper"); + + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// CONSTANTS DEFINITION // +// here you may specify custom CONSTANTS used within the script. // // // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* This constant specifies allowed values to determine how the aggregation process will deal with indicator values. +* I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. +* Note that these values must not be changed by users! +* @type {Array.} +* @memberof CONSTANTS +* @constant +*/ +const aggregationTypeEnum = ["SUM", "AVERAGE"]; + +/** +* via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. +* Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option +* @type {string} +* @memberof CONSTANTS +* @constant +*/ +const aggregationType = "SUM"; + +const parameterName_computationIndicatorId = "COMPUTATION_ID"; + +const parameterName_referenceDATE = "REFERENCE_DATE"; + + + +/** +* This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined +* as method parameters that can be used within the method body. +* +* NOTE: The function is async, so users may make use of keyword "await" to wait for results of other async helper API methods. +* (This is necessary when users want to wait for asynchronous method execution such as external API calls in a synchronous program) +* +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit as GeoJSON FeatureCollection object. +* @param {map.>} baseIndicatorsMap - Map containing all indicators, wheres key='meaningful name or id of the indicator' and value='indicator as GeoJSON object' (it contains duplicate entries, one for the indicator name and one for the indicator id) +* @param {map.>} georesourcesMap - Map containing all georesources, wheres key='meaningful name or id of the georesource' and value='georesource as GeoJSON object' (they are used to execute geometric/toptologic computations) (it contains duplicate entries, one for the georesource name and one for the georesource id) +* @param {Array.>} processParameters - an array containing objects representing variable additional process parameters that are required to perform the indicator computation. +* Each entry has properties Object.name and Object.value for name and value of the parameter. +* @returns {FeatureCollection} the computed indicator for submitted {@linkcode targetSpatialUnit_geoJSON} features as GeoJSON FeatureCollection +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ + + // get the id to be used for calculations + var computationIndicatorId = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId, processParameters); + // get reference date + var referenceDate = KmHelper.getProcessParameterByName_asString(parameterName_referenceDATE, processParameters); + + // get the indicator using the computationIndicatorId + var computationIndicator = KmHelper.getBaseIndicatorById(computationIndicatorId, baseIndicatorsMap) + KmHelper.log("Retrieved required computationIndicator successfully."); + + // now we compute the new indicator for an absolute change compared to previous year + // internally tests are run, e.g. if a previous year is available or not + var resultMap = KmHelper.changeRelative_referenceDate_percent(computationIndicator, targetDate, referenceDate); + + var numFeatures = targetSpatialUnit_geoJSON.features.length; + KmHelper.log("Computed change indicator for a total amount of " + numFeatures + " features"); + targetSpatialUnit_geoJSON = KmHelper.setIndicatorValues_fromIdValueMap(targetSpatialUnit_geoJSON, targetDate, resultMap); + KmHelper.log("Computation of absolute change compared to previous year finished"); + return targetSpatialUnit_geoJSON; +} + +/** +* This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). +* The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. +* The aggrgation internally aggregates features of {@linkcode indicator_geoJSON} to features of {@linkcode targetSpatialUnit_geoJSON} by comparing their geometries. +* Each {@linkcode indicator_geoJSON} feature whose geometry lies within a certain geometry of a {@linkcode targetSpatialUnit_geoJSON} feature will be used to compute the aggregated indicator values. +* The within comparison is executed by method {@linkcode within_usingBBOX}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be aggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter targetSpatialUnit_geoJSON +* @see aggregationType +* @see within_usingBBOX +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the aggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)){ + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if(aggregationType === "SUM"){ + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +}; + +/** +* This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). +* @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be disaggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be disaggregated to the features of parameter targetSpatialUnit_geoJSON +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the disaggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // disaggregate indicator + +}; + + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. +* Also it uses the {@linkcode KmHelper.getAggregationWeight(feature)} method as weight during aggregtion. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + + // compute average for share + if(baseIndicatorTotalWeight === 0){ + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + + KmHelper.log("Aggregation finished"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} +* to determine which features of {@linkcode indicator_geoJSON} can be aggregated to which features of {@linkcode targetSpatialUnit_geoJSON}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + var totalAggregatedIndicatorFeatures = 0; + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + + +module.exports.computeIndicator = computeIndicator; +module.exports.aggregateIndicator = aggregateIndicator; +module.exports.disaggregateIndicator = disaggregateIndicator; diff --git a/app/kommonitor-script-resources/km_indicator_share.js b/app/kommonitor-script-resources/km_indicator_share.js index ba82ba24b..4a0006370 100644 --- a/app/kommonitor-script-resources/km_indicator_share.js +++ b/app/kommonitor-script-resources/km_indicator_share.js @@ -1,21 +1,18 @@ +"use strict"; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // NECESSARY NODE MODULE DEPENDENCIES // // // // // SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * Module that contains various helper methods (spatial GIS functions and statistical functions) * to simplify script writing */ const KmHelper = require("kmhelper"); - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // CONSTANTS DEFINITION // // here you may specify custom CONSTANTS used within the script. // // // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * This constant specifies allowed values to determine how the aggregation process will deal with indicator values. * I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. @@ -25,7 +22,6 @@ const KmHelper = require("kmhelper"); * @constant */ const aggregationTypeEnum = ["SUM", "AVERAGE"]; - /** * via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. * Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option @@ -34,10 +30,8 @@ const aggregationTypeEnum = ["SUM", "AVERAGE"]; * @constant */ const aggregationType = "AVERAGE"; - const parameterName_referenceIndicatorId = "REFERENCE_ID"; const parameterName_computationIndicatorId = "COMPUTATION_ID"; - /** * This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined * as method parameters that can be used within the method body. @@ -55,162 +49,137 @@ const parameterName_computationIndicatorId = "COMPUTATION_ID"; * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ - - var referenceIndicatorId = KmHelper.getProcessParameterByName_asString(parameterName_referenceIndicatorId, processParameters); - var referenceGeoJSON = KmHelper.getBaseIndicatorById(referenceIndicatorId, baseIndicatorsMap); - - var computationIndicatorIds = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId, processParameters); - var computationIndicatorIds_array = computationIndicatorIds.split(','); - var computationGeoJSON_array = []; - for (const indicatorID of computationIndicatorIds_array){ - computationGeoJSON_array.push(KmHelper.getBaseIndicatorById(indicatorID, baseIndicatorsMap))}; - - KmHelper.log("Retrieved required baseIndicators successfully"); - - // now we compute the new indicator - KmHelper.log("Iterate over base indicators and save intermediate values within a map object"); - - /** - * create a map to store indicator values for each feature of the target spatial unit - * by using such a map object, we can ensure, that we only iterate ONCE over each bease indicator - * and also can only iterate ONCE over each target spatial unit feature at the end to compute the indicator - */ - var map = new Map(); - - KmHelper.log("Process reference indicator '" + referenceIndicatorId + "'"); - - /** - * iterate over each feature of the baseIndicator and use its indicator value to modify map object - * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! - */ - referenceGeoJSON.features.forEach(function(feature) { +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters) { + var referenceIndicatorId = KmHelper.getProcessParameterByName_asString(parameterName_referenceIndicatorId, processParameters); + var referenceGeoJSON = KmHelper.getBaseIndicatorById(referenceIndicatorId, baseIndicatorsMap); + var computationIndicatorIds = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId, processParameters); + var computationIndicatorIds_array = computationIndicatorIds.split(','); + var computationGeoJSON_array = []; + for (const indicatorID of computationIndicatorIds_array) { + computationGeoJSON_array.push(KmHelper.getBaseIndicatorById(indicatorID, baseIndicatorsMap)); + } + ; + KmHelper.log("Retrieved required baseIndicators successfully"); + // now we compute the new indicator + KmHelper.log("Iterate over base indicators and save intermediate values within a map object"); + /** + * create a map to store indicator values for each feature of the target spatial unit + * by using such a map object, we can ensure, that we only iterate ONCE over each bease indicator + * and also can only iterate ONCE over each target spatial unit feature at the end to compute the indicator + */ + var map = new Map(); + KmHelper.log("Process reference indicator '" + referenceIndicatorId + "'"); + /** + * iterate over each feature of the baseIndicator and use its indicator value to modify map object + * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! + */ + referenceGeoJSON.features.forEach(function (feature) { // get the unique featureID of the spatial unit feature as String var featureId = KmHelper.getSpatialUnitFeatureIdValue(feature); // get the time series value of the base indicator feature for the requested target date (with its required prefix!) var referenceValue = KmHelper.getIndicatorValue(feature, targetDate); - - if(referenceValue === undefined || referenceValue === null){ - KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); - KmHelper.log("WARNING: process will return"); - referenceValue = 0; + if (referenceValue === undefined || referenceValue === null) { + KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); + KmHelper.log("WARNING: process will return"); + referenceValue = 0; } - // modify map object (i.e. set value initially, or perform calculations and store modified value) + // modify map object (i.e. set value initially, or perform calculations and store modified value) // key should be unique featureId of the spatial unit feature - if (! map.has(featureId)){ + if (!map.has(featureId)) { var mapObject = { featureId: featureId, indicatorValue: undefined, refValue: 0, - intermediateValue: 0 - }; - - map.set(featureId, mapObject); + intermediateValue: 0 + }; + map.set(featureId, mapObject); } - var mapEntry = map.get(featureId); - mapEntry.refValue = referenceValue; + var mapEntry = map.get(featureId); + mapEntry.refValue = referenceValue; map.set(featureId, mapEntry); - }); - - KmHelper.log("Process computation indicator"); - - /** - * iterate over each feature of the baseIndicator and use its indicator value to modify map object - * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! - */ - computationGeoJSON_array.forEach(function(geoJSON) { - - geoJSON.features.forEach(function(feature) { - // get the unique featureID of the spatial unit feature as String - var featureId = KmHelper.getSpatialUnitFeatureIdValue(feature); - // get the time series value of the base indicator feature for the requested target date (with its required prefix!) - var partValue = KmHelper.getIndicatorValue(feature, targetDate); - if(partValue === undefined || partValue === null){ - KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); - KmHelper.log("WARNING: the feature value will thus be set to '0' and computation will continue"); - partValue = 0; - } - // modify map object (i.e. set value initially, or perform calculations and store modified value) - // key should be unique featureId of the spatial unit feature - - if (! map.has(featureId)){ - KmHelper.log("Computation Indicator feature with id '" + featureId + "' was not computed from computation resources. Will set ref value to null."); - var mapObject = { - featureId: featureId, - indicatorValue: undefined, - refValue: null, - intermediateValue: 0 + }); + KmHelper.log("Process computation indicator"); + /** + * iterate over each feature of the baseIndicator and use its indicator value to modify map object + * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! + */ + computationGeoJSON_array.forEach(function (geoJSON) { + geoJSON.features.forEach(function (feature) { + // get the unique featureID of the spatial unit feature as String + var featureId = KmHelper.getSpatialUnitFeatureIdValue(feature); + // get the time series value of the base indicator feature for the requested target date (with its required prefix!) + var partValue = KmHelper.getIndicatorValue(feature, targetDate); + if (partValue === undefined || partValue === null) { + KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); + KmHelper.log("WARNING: the feature value will thus be set to '0' and computation will continue"); + partValue = 0; + } + // modify map object (i.e. set value initially, or perform calculations and store modified value) + // key should be unique featureId of the spatial unit feature + if (!map.has(featureId)) { + KmHelper.log("Computation Indicator feature with id '" + featureId + "' was not computed from computation resources. Will set ref value to null."); + var mapObject = { + featureId: featureId, + indicatorValue: undefined, + refValue: null, + intermediateValue: 0 }; - - map.set(featureId, mapObject); - } - - var mapEntry = map.get(featureId); - mapEntry.intermediateValue = mapEntry.intermediateValue + partValue; - map.set(featureId, mapEntry); - }); - }); - - var numFeatures = targetSpatialUnit_geoJSON.features.length; - - // now we compute the new indicator - KmHelper.log("Compute indicator for a total amount of " + numFeatures + " features"); - - // iterate once over target spatial unit features and compute indicator utilizing map entries - var spatialUnitIndex = 0; - // create progress log after each 10th percent of features - var logProgressIndexSeparator = Math.round(numFeatures / 100 * 10); - targetSpatialUnit_geoJSON.features.forEach(function(spatialUnitFeature) { - + map.set(featureId, mapObject); + } + var mapEntry = map.get(featureId); + mapEntry.intermediateValue = mapEntry.intermediateValue + partValue; + map.set(featureId, mapEntry); + }); + }); + var numFeatures = targetSpatialUnit_geoJSON.features.length; + // now we compute the new indicator + KmHelper.log("Compute indicator for a total amount of " + numFeatures + " features"); + // iterate once over target spatial unit features and compute indicator utilizing map entries + var spatialUnitIndex = 0; + // create progress log after each 10th percent of features + var logProgressIndexSeparator = Math.round(numFeatures / 100 * 10); + targetSpatialUnit_geoJSON.features.forEach(function (spatialUnitFeature) { // get spatialUnit feature id as string --> use it to get associated map entry var spatialUnitFeatureId = KmHelper.getSpatialUnitFeatureIdValue(spatialUnitFeature); - - if (! map.has(spatialUnitFeatureId)){ - KmHelper.log("Target spatial unit feature with id '" + spatialUnitFeatureId + "' was not computed from computation resources. Will set indicator value to null."); - var mapObject = { - featureId: spatialUnitFeatureId, - indicatorValue: undefined, - refValue: null, - intermediateValue: null - }; - - map.set(spatialUnitFeatureId, mapObject); - } - - var mapEntry = map.get(spatialUnitFeatureId); - - var indicatorValue = null; - if(mapEntry.refValue === undefined || mapEntry.refValue === null || mapEntry.refValue === undefined || mapEntry.intermediateValue === null){ - KmHelper.log("WARNING: the feature with featureID '" + spatialUnitFeatureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); - KmHelper.log("INFO: indicator value is set to null"); - indicatorValue = null; - } else if(mapEntry.refValue === 0) { - indicatorValue = 0; - KmHelper.log("WARNING: the feature with featureID '" + spatialUnitFeatureId + "' cotains a '0' as numerator value for targetDate '" + targetDate + "'"); - KmHelper.log("INFO: indicator value is set to 0"); - } else { - indicatorValue = (mapEntry.intermediateValue / mapEntry.refValue); - } - + if (!map.has(spatialUnitFeatureId)) { + KmHelper.log("Target spatial unit feature with id '" + spatialUnitFeatureId + "' was not computed from computation resources. Will set indicator value to null."); + var mapObject = { + featureId: spatialUnitFeatureId, + indicatorValue: undefined, + refValue: null, + intermediateValue: null + }; + map.set(spatialUnitFeatureId, mapObject); + } + var mapEntry = map.get(spatialUnitFeatureId); + var indicatorValue = null; + if (mapEntry.refValue === undefined || mapEntry.refValue === null || mapEntry.refValue === undefined || mapEntry.intermediateValue === null) { + KmHelper.log("WARNING: the feature with featureID '" + spatialUnitFeatureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); + KmHelper.log("INFO: indicator value is set to null"); + indicatorValue = null; + } + else if (mapEntry.refValue === 0) { + indicatorValue = 0; + KmHelper.log("WARNING: the feature with featureID '" + spatialUnitFeatureId + "' cotains a '0' as numerator value for targetDate '" + targetDate + "'"); + KmHelper.log("INFO: indicator value is set to 0"); + } + else { + indicatorValue = (mapEntry.intermediateValue / mapEntry.refValue); + } // set aggregationWeight as number of citizens KmHelper.setAggregationWeight(spatialUnitFeature, indicatorValue); - // set indicator value for spatialUnitFeature spatialUnitFeature = KmHelper.setIndicatorValue(spatialUnitFeature, targetDate, indicatorValue); - - spatialUnitIndex ++; - + spatialUnitIndex++; // only log after certain progress - if(spatialUnitIndex % logProgressIndexSeparator === 0){ + if (spatialUnitIndex % logProgressIndexSeparator === 0) { KmHelper.log("PROGRESS: Computed '" + spatialUnitIndex + "' of total '" + numFeatures + "' features."); } - }); - - KmHelper.log("Computation of indicator finished"); - - return targetSpatialUnit_geoJSON; -}; - + }); + KmHelper.log("Computation of indicator finished"); + return targetSpatialUnit_geoJSON; +} +; /** * This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). * The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. @@ -226,22 +195,22 @@ async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndic * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - if (!aggregationTypeEnum.includes(aggregationType)){ - console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + - "'. Allowed values are: " + aggregationTypeEnum); - console.log("Will fallback to using AVERAGE aggregation logic."); - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else if(aggregationType === "SUM"){ - return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else { - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } -}; - +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)) { + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if (aggregationType === "SUM") { + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +} +; /** * This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). * @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! @@ -252,12 +221,10 @@ function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geo * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // disaggregate indicator - -}; - - +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // disaggregate indicator +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. @@ -271,74 +238,60 @@ function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check to aggregate - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var baseIndicatorTotalWeight = 0; - var featureCounter = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - featureCounter++; - - // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number - if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ - // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method - // it "survives" until this aggregation logic within processing engine - var weight = KmHelper.getAggregationWeight(indicatorFeature); - - // use weight as weight for indicator value - baseIndicatorTotalWeight += weight; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; - } - } - } - - // compute average for share - if(baseIndicatorTotalWeight === 0){ - targetFeature.properties[targetDate] = Number.NaN; +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; } - else { - targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if (!Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined) { + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + // compute average for share + if (baseIndicatorTotalWeight === 0) { + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + KmHelper.log("Aggregation finished"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); } - // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); - }); - - KmHelper.log("Aggregation finished"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - + return targetSpatialUnit_geoJSON; +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} @@ -352,59 +305,47 @@ function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - var totalAggregatedIndicatorFeatures = 0; - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check for aggregation - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var numberOfIndicatorFeaturesWithinTargetFeature = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - numberOfIndicatorFeaturesWithinTargetFeature++; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); - } - } - totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; - }); - - KmHelper.log("Aggregation finished"); - KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - - +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + var totalAggregatedIndicatorFeatures = 0; + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; + } + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + return targetSpatialUnit_geoJSON; +} +; module.exports.computeIndicator = computeIndicator; module.exports.aggregateIndicator = aggregateIndicator; module.exports.disaggregateIndicator = disaggregateIndicator; +//# sourceMappingURL=km_indicator_share.js.map \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_indicator_share.js.map b/app/kommonitor-script-resources/km_indicator_share.js.map new file mode 100644 index 000000000..2664c97d0 --- /dev/null +++ b/app/kommonitor-script-resources/km_indicator_share.js.map @@ -0,0 +1 @@ +{"version":3,"file":"km_indicator_share.js","sourceRoot":"","sources":["km_indicator_share.ts"],"names":[],"mappings":";AAAA,8JAA8J;AAC9J,yRAAyR;AACzR,8JAA8J;AAC9J,4GAA4G;AAC5G,8JAA8J;AAE9J;;;EAGE;AACF,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAGrC,8JAA8J;AAC9J,8JAA8J;AAC9J,6OAA6O;AAC7O,8JAA8J;AAE9J;;;;;;;EAOE;AACF,MAAM,mBAAmB,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AAE/C;;;;;;EAME;AACF,MAAM,eAAe,GAAG,SAAS,CAAC;AAElC,MAAM,kCAAkC,GAAG,cAAc,CAAC;AAC1D,MAAM,oCAAoC,GAAG,gBAAgB,CAAC;AAE9D;;;;;;;;;;;;;;;;EAgBE;AACF,KAAK,UAAU,gBAAgB,CAAC,UAAU,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,eAAe,EAAE,iBAAiB;IAEzH,IAAI,oBAAoB,GAAG,QAAQ,CAAC,kCAAkC,CAAC,kCAAkC,EAAE,iBAAiB,CAAC,CAAC;IAC9H,IAAI,gBAAgB,GAAG,QAAQ,CAAC,oBAAoB,CAAC,oBAAoB,EAAE,iBAAiB,CAAC,CAAC;IAE3F,IAAI,uBAAuB,GAAG,QAAQ,CAAC,kCAAkC,CAAC,oCAAoC,EAAE,iBAAiB,CAAC,CAAC;IACtI,IAAI,6BAA6B,GAAG,uBAAuB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACvE,IAAI,wBAAwB,GAAG,EAAE,CAAC;IAClC,KAAK,MAAM,WAAW,IAAI,6BAA6B,EAAC;QACzD,wBAAwB,CAAC,IAAI,CAAC,QAAQ,CAAC,oBAAoB,CAA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,CAAC,EAAC;QAC9B,OAAO,CAAC,KAAK,CAAC,mDAAmD,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAC9F,MAAM,KAAK,CAAC,6DAA6D,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;KACvG;IAED,OAAO,yBAAyB,CAAC;AACnC,CAAC;AAAA,CAAC;AAGF,MAAM,CAAC,OAAO,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;AACnD,MAAM,CAAC,OAAO,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;AACvD,MAAM,CAAC,OAAO,CAAC,qBAAqB,GAAG,qBAAqB,CAAC"} \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_indicator_share.ts b/app/kommonitor-script-resources/km_indicator_share.ts new file mode 100644 index 000000000..ba82ba24b --- /dev/null +++ b/app/kommonitor-script-resources/km_indicator_share.ts @@ -0,0 +1,410 @@ +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// NECESSARY NODE MODULE DEPENDENCIES // // +// // +// SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* Module that contains various helper methods (spatial GIS functions and statistical functions) +* to simplify script writing +*/ +const KmHelper = require("kmhelper"); + + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// CONSTANTS DEFINITION // +// here you may specify custom CONSTANTS used within the script. // // // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* This constant specifies allowed values to determine how the aggregation process will deal with indicator values. +* I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. +* Note that these values must not be changed by users! +* @type {Array.} +* @memberof CONSTANTS +* @constant +*/ +const aggregationTypeEnum = ["SUM", "AVERAGE"]; + +/** +* via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. +* Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option +* @type {string} +* @memberof CONSTANTS +* @constant +*/ +const aggregationType = "AVERAGE"; + +const parameterName_referenceIndicatorId = "REFERENCE_ID"; +const parameterName_computationIndicatorId = "COMPUTATION_ID"; + +/** +* This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined +* as method parameters that can be used within the method body. +* +* NOTE: The function is async, so users may make use of keyword "await" to wait for results of other async helper API methods. +* (This is necessary when users want to wait for asynchronous method execution such as external API calls in a synchronous program) +* +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit as GeoJSON FeatureCollection object. +* @param {map.>} baseIndicatorsMap - Map containing all indicators, wheres key='meaningful name or id of the indicator' and value='indicator as GeoJSON object' (it contains duplicate entries, one for the indicator name and one for the indicator id) +* @param {map.>} georesourcesMap - Map containing all georesources, wheres key='meaningful name or id of the georesource' and value='georesource as GeoJSON object' (they are used to execute geometric/toptologic computations) (it contains duplicate entries, one for the georesource name and one for the georesource id) +* @param {Array.>} processParameters - an array containing objects representing variable additional process parameters that are required to perform the indicator computation. +* Each entry has properties Object.name and Object.value for name and value of the parameter. +* @returns {FeatureCollection} the computed indicator for submitted {@linkcode targetSpatialUnit_geoJSON} features as GeoJSON FeatureCollection +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ + + var referenceIndicatorId = KmHelper.getProcessParameterByName_asString(parameterName_referenceIndicatorId, processParameters); + var referenceGeoJSON = KmHelper.getBaseIndicatorById(referenceIndicatorId, baseIndicatorsMap); + + var computationIndicatorIds = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId, processParameters); + var computationIndicatorIds_array = computationIndicatorIds.split(','); + var computationGeoJSON_array = []; + for (const indicatorID of computationIndicatorIds_array){ + computationGeoJSON_array.push(KmHelper.getBaseIndicatorById(indicatorID, baseIndicatorsMap))}; + + KmHelper.log("Retrieved required baseIndicators successfully"); + + // now we compute the new indicator + KmHelper.log("Iterate over base indicators and save intermediate values within a map object"); + + /** + * create a map to store indicator values for each feature of the target spatial unit + * by using such a map object, we can ensure, that we only iterate ONCE over each bease indicator + * and also can only iterate ONCE over each target spatial unit feature at the end to compute the indicator + */ + var map = new Map(); + + KmHelper.log("Process reference indicator '" + referenceIndicatorId + "'"); + + /** + * iterate over each feature of the baseIndicator and use its indicator value to modify map object + * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! + */ + referenceGeoJSON.features.forEach(function(feature) { + // get the unique featureID of the spatial unit feature as String + var featureId = KmHelper.getSpatialUnitFeatureIdValue(feature); + // get the time series value of the base indicator feature for the requested target date (with its required prefix!) + var referenceValue = KmHelper.getIndicatorValue(feature, targetDate); + + if(referenceValue === undefined || referenceValue === null){ + KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); + KmHelper.log("WARNING: process will return"); + referenceValue = 0; + } + // modify map object (i.e. set value initially, or perform calculations and store modified value) + // key should be unique featureId of the spatial unit feature + if (! map.has(featureId)){ + var mapObject = { + featureId: featureId, + indicatorValue: undefined, + refValue: 0, + intermediateValue: 0 + }; + + map.set(featureId, mapObject); + } + var mapEntry = map.get(featureId); + mapEntry.refValue = referenceValue; + map.set(featureId, mapEntry); + }); + + KmHelper.log("Process computation indicator"); + + /** + * iterate over each feature of the baseIndicator and use its indicator value to modify map object + * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! + */ + computationGeoJSON_array.forEach(function(geoJSON) { + + geoJSON.features.forEach(function(feature) { + // get the unique featureID of the spatial unit feature as String + var featureId = KmHelper.getSpatialUnitFeatureIdValue(feature); + // get the time series value of the base indicator feature for the requested target date (with its required prefix!) + var partValue = KmHelper.getIndicatorValue(feature, targetDate); + if(partValue === undefined || partValue === null){ + KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); + KmHelper.log("WARNING: the feature value will thus be set to '0' and computation will continue"); + partValue = 0; + } + // modify map object (i.e. set value initially, or perform calculations and store modified value) + // key should be unique featureId of the spatial unit feature + + if (! map.has(featureId)){ + KmHelper.log("Computation Indicator feature with id '" + featureId + "' was not computed from computation resources. Will set ref value to null."); + var mapObject = { + featureId: featureId, + indicatorValue: undefined, + refValue: null, + intermediateValue: 0 + }; + + map.set(featureId, mapObject); + } + + var mapEntry = map.get(featureId); + mapEntry.intermediateValue = mapEntry.intermediateValue + partValue; + map.set(featureId, mapEntry); + }); + }); + + var numFeatures = targetSpatialUnit_geoJSON.features.length; + + // now we compute the new indicator + KmHelper.log("Compute indicator for a total amount of " + numFeatures + " features"); + + // iterate once over target spatial unit features and compute indicator utilizing map entries + var spatialUnitIndex = 0; + // create progress log after each 10th percent of features + var logProgressIndexSeparator = Math.round(numFeatures / 100 * 10); + targetSpatialUnit_geoJSON.features.forEach(function(spatialUnitFeature) { + + // get spatialUnit feature id as string --> use it to get associated map entry + var spatialUnitFeatureId = KmHelper.getSpatialUnitFeatureIdValue(spatialUnitFeature); + + if (! map.has(spatialUnitFeatureId)){ + KmHelper.log("Target spatial unit feature with id '" + spatialUnitFeatureId + "' was not computed from computation resources. Will set indicator value to null."); + var mapObject = { + featureId: spatialUnitFeatureId, + indicatorValue: undefined, + refValue: null, + intermediateValue: null + }; + + map.set(spatialUnitFeatureId, mapObject); + } + + var mapEntry = map.get(spatialUnitFeatureId); + + var indicatorValue = null; + if(mapEntry.refValue === undefined || mapEntry.refValue === null || mapEntry.refValue === undefined || mapEntry.intermediateValue === null){ + KmHelper.log("WARNING: the feature with featureID '" + spatialUnitFeatureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); + KmHelper.log("INFO: indicator value is set to null"); + indicatorValue = null; + } else if(mapEntry.refValue === 0) { + indicatorValue = 0; + KmHelper.log("WARNING: the feature with featureID '" + spatialUnitFeatureId + "' cotains a '0' as numerator value for targetDate '" + targetDate + "'"); + KmHelper.log("INFO: indicator value is set to 0"); + } else { + indicatorValue = (mapEntry.intermediateValue / mapEntry.refValue); + } + + // set aggregationWeight as number of citizens + KmHelper.setAggregationWeight(spatialUnitFeature, indicatorValue); + + // set indicator value for spatialUnitFeature + spatialUnitFeature = KmHelper.setIndicatorValue(spatialUnitFeature, targetDate, indicatorValue); + + spatialUnitIndex ++; + + // only log after certain progress + if(spatialUnitIndex % logProgressIndexSeparator === 0){ + KmHelper.log("PROGRESS: Computed '" + spatialUnitIndex + "' of total '" + numFeatures + "' features."); + } + }); + + KmHelper.log("Computation of indicator finished"); + + return targetSpatialUnit_geoJSON; +}; + +/** +* This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). +* The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. +* The aggrgation internally aggregates features of {@linkcode indicator_geoJSON} to features of {@linkcode targetSpatialUnit_geoJSON} by comparing their geometries. +* Each {@linkcode indicator_geoJSON} feature whose geometry lies within a certain geometry of a {@linkcode targetSpatialUnit_geoJSON} feature will be used to compute the aggregated indicator values. +* The within comparison is executed by method {@linkcode within_usingBBOX}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be aggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter targetSpatialUnit_geoJSON +* @see aggregationType +* @see within_usingBBOX +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the aggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)){ + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if(aggregationType === "SUM"){ + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +}; + +/** +* This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). +* @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be disaggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be disaggregated to the features of parameter targetSpatialUnit_geoJSON +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the disaggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // disaggregate indicator + +}; + + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. +* Also it uses the {@linkcode KmHelper.getAggregationWeight(feature)} method as weight during aggregtion. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + + // compute average for share + if(baseIndicatorTotalWeight === 0){ + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + + KmHelper.log("Aggregation finished"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} +* to determine which features of {@linkcode indicator_geoJSON} can be aggregated to which features of {@linkcode targetSpatialUnit_geoJSON}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + var totalAggregatedIndicatorFeatures = 0; + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + + +module.exports.computeIndicator = computeIndicator; +module.exports.aggregateIndicator = aggregateIndicator; +module.exports.disaggregateIndicator = disaggregateIndicator; diff --git a/app/kommonitor-script-resources/km_indicator_subtract.js b/app/kommonitor-script-resources/km_indicator_subtract.js index 3e9018f5f..dff5e54cd 100644 --- a/app/kommonitor-script-resources/km_indicator_subtract.js +++ b/app/kommonitor-script-resources/km_indicator_subtract.js @@ -1,21 +1,18 @@ +"use strict"; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // NECESSARY NODE MODULE DEPENDENCIES // // // // // SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * Module that contains various helper methods (spatial GIS functions and statistical functions) * to simplify script writing */ const KmHelper = require("kmhelper"); - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // CONSTANTS DEFINITION // // here you may specify custom CONSTANTS used within the script. // // // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * This constant specifies allowed values to determine how the aggregation process will deal with indicator values. * I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. @@ -25,7 +22,6 @@ const KmHelper = require("kmhelper"); * @constant */ const aggregationTypeEnum = ["SUM", "AVERAGE"]; - /** * via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. * Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option @@ -34,10 +30,8 @@ const aggregationTypeEnum = ["SUM", "AVERAGE"]; * @constant */ const aggregationType = "SUM"; - const parameterName_referenceIndicatorId = "REFERENCE_ID"; const parameterName_computationIndicatorId = "COMPUTATION_ID"; - /** * This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined * as method parameters that can be used within the method body. @@ -55,156 +49,126 @@ const parameterName_computationIndicatorId = "COMPUTATION_ID"; * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ - - var referenceIndicatorId = KmHelper.getProcessParameterByName_asString(parameterName_referenceIndicatorId, processParameters); - var referenceGeoJSON = KmHelper.getBaseIndicatorById(referenceIndicatorId, baseIndicatorsMap); - - var computationIndicatorIds = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId, processParameters); - var computationIndicatorIds_array = computationIndicatorIds.split(','); - var computationGeoJSON_array = []; - for (const indicatorID of computationIndicatorIds_array){ - computationGeoJSON_array.push(KmHelper.getBaseIndicatorById(indicatorID, baseIndicatorsMap))}; - - KmHelper.log("Retrieved required baseIndicators successfully"); - - // now we compute the new indicator - KmHelper.log("Iterate over base indicators and save intermediate values within a map object"); - - /** - * create a map to store indicator values for each feature of the target spatial unit - * by using such a map object, we can ensure, that we only iterate ONCE over each bease indicator - * and also can only iterate ONCE over each target spatial unit feature at the end to compute the indicator - */ - var map = new Map(); - - KmHelper.log("Process reference indicator '" + referenceIndicatorId + "'"); - - /** - * iterate over each feature of the baseIndicator and use its indicator value to modify map object - * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! - */ - referenceGeoJSON.features.forEach(function(feature) { +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters) { + var referenceIndicatorId = KmHelper.getProcessParameterByName_asString(parameterName_referenceIndicatorId, processParameters); + var referenceGeoJSON = KmHelper.getBaseIndicatorById(referenceIndicatorId, baseIndicatorsMap); + var computationIndicatorIds = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId, processParameters); + var computationIndicatorIds_array = computationIndicatorIds.split(','); + var computationGeoJSON_array = []; + for (const indicatorID of computationIndicatorIds_array) { + computationGeoJSON_array.push(KmHelper.getBaseIndicatorById(indicatorID, baseIndicatorsMap)); + } + ; + KmHelper.log("Retrieved required baseIndicators successfully"); + // now we compute the new indicator + KmHelper.log("Iterate over base indicators and save intermediate values within a map object"); + /** + * create a map to store indicator values for each feature of the target spatial unit + * by using such a map object, we can ensure, that we only iterate ONCE over each bease indicator + * and also can only iterate ONCE over each target spatial unit feature at the end to compute the indicator + */ + var map = new Map(); + KmHelper.log("Process reference indicator '" + referenceIndicatorId + "'"); + /** + * iterate over each feature of the baseIndicator and use its indicator value to modify map object + * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! + */ + referenceGeoJSON.features.forEach(function (feature) { // get the unique featureID of the spatial unit feature as String var featureId = KmHelper.getSpatialUnitFeatureIdValue(feature); // get the time series value of the base indicator feature for the requested target date (with its required prefix!) var referenceValue = KmHelper.getIndicatorValue(feature, targetDate); - - if(referenceValue === undefined || referenceValue === null){ - KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); - referenceValue = 0; + if (referenceValue === undefined || referenceValue === null) { + KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); + referenceValue = 0; } - // modify map object (i.e. set value initially, or perform calculations and store modified value) + // modify map object (i.e. set value initially, or perform calculations and store modified value) // key should be unique featureId of the spatial unit feature - if (! map.has(featureId)){ + if (!map.has(featureId)) { var mapObject = { featureId: featureId, indicatorValue: undefined, refValue: 0, - intermediateValue: 0 - }; - - map.set(featureId, mapObject); + intermediateValue: 0 + }; + map.set(featureId, mapObject); } - var mapEntry = map.get(featureId); - mapEntry.refValue = referenceValue; - map.set(featureId, mapEntry); - }); - - KmHelper.log("Process computation indicator"); - - /** - * iterate over each feature of the baseIndicator and use its indicator value to modify map object - * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! - */ - computationGeoJSON_array.forEach(function(geoJSON) { - - geoJSON.features.forEach(function(feature) { - // get the unique featureID of the spatial unit feature as String - var featureId = KmHelper.getSpatialUnitFeatureIdValue(feature); - // get the time series value of the base indicator feature for the requested target date (with its required prefix!) - var partValue = KmHelper.getIndicatorValue(feature, targetDate); - if(partValue === undefined || partValue === null){ - KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); - KmHelper.log("WARNING: the feature value will thus be set to '0' and computation will continue"); - partValue = 0; - } - - if (! map.has(featureId)){ - KmHelper.log("Computation Indicator feature with id '" + featureId + "' was not computed from computation resources. Will set ref value to null."); - var mapObject = { - featureId: featureId, - indicatorValue: undefined, - refValue: null, - intermediateValue: 0 - }; - - map.set(featureId, mapObject); - } - - // modify map object (i.e. set value initially, or perform calculations and store modified value) - // key should be unique featureId of the spatial unit feature var mapEntry = map.get(featureId); - - mapEntry.intermediateValue = mapEntry.intermediateValue + partValue; - + mapEntry.refValue = referenceValue; map.set(featureId, mapEntry); - }); - }); - - var numFeatures = targetSpatialUnit_geoJSON.features.length; - - // now we compute the new indicator - KmHelper.log("Compute indicator for a total amount of " + numFeatures + " features"); - - // iterate once over target spatial unit features and compute indicator utilizing map entries - var spatialUnitIndex = 0; - // create progress log after each 10th percent of features - var logProgressIndexSeparator = Math.round(numFeatures / 100 * 10); - targetSpatialUnit_geoJSON.features.forEach(function(spatialUnitFeature) { - + }); + KmHelper.log("Process computation indicator"); + /** + * iterate over each feature of the baseIndicator and use its indicator value to modify map object + * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! + */ + computationGeoJSON_array.forEach(function (geoJSON) { + geoJSON.features.forEach(function (feature) { + // get the unique featureID of the spatial unit feature as String + var featureId = KmHelper.getSpatialUnitFeatureIdValue(feature); + // get the time series value of the base indicator feature for the requested target date (with its required prefix!) + var partValue = KmHelper.getIndicatorValue(feature, targetDate); + if (partValue === undefined || partValue === null) { + KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); + KmHelper.log("WARNING: the feature value will thus be set to '0' and computation will continue"); + partValue = 0; + } + if (!map.has(featureId)) { + KmHelper.log("Computation Indicator feature with id '" + featureId + "' was not computed from computation resources. Will set ref value to null."); + var mapObject = { + featureId: featureId, + indicatorValue: undefined, + refValue: null, + intermediateValue: 0 + }; + map.set(featureId, mapObject); + } + // modify map object (i.e. set value initially, or perform calculations and store modified value) + // key should be unique featureId of the spatial unit feature + var mapEntry = map.get(featureId); + mapEntry.intermediateValue = mapEntry.intermediateValue + partValue; + map.set(featureId, mapEntry); + }); + }); + var numFeatures = targetSpatialUnit_geoJSON.features.length; + // now we compute the new indicator + KmHelper.log("Compute indicator for a total amount of " + numFeatures + " features"); + // iterate once over target spatial unit features and compute indicator utilizing map entries + var spatialUnitIndex = 0; + // create progress log after each 10th percent of features + var logProgressIndexSeparator = Math.round(numFeatures / 100 * 10); + targetSpatialUnit_geoJSON.features.forEach(function (spatialUnitFeature) { // get spatialUnit feature id as string --> use it to get associated map entry var spatialUnitFeatureId = KmHelper.getSpatialUnitFeatureIdValue(spatialUnitFeature); - - if (! map.has(spatialUnitFeatureId)){ - KmHelper.log("Target spatial unit feature with id '" + spatialUnitFeatureId + "' was not computed from computation resources. Will set indicator value to null."); - var mapObject = { - featureId: spatialUnitFeatureId, - indicatorValue: undefined, - refValue: null, - intermediateValue: null - }; - - map.set(spatialUnitFeatureId, mapObject); - } - + if (!map.has(spatialUnitFeatureId)) { + KmHelper.log("Target spatial unit feature with id '" + spatialUnitFeatureId + "' was not computed from computation resources. Will set indicator value to null."); + var mapObject = { + featureId: spatialUnitFeatureId, + indicatorValue: undefined, + refValue: null, + intermediateValue: null + }; + map.set(spatialUnitFeatureId, mapObject); + } var mapEntry = map.get(spatialUnitFeatureId); - var indicatorValue = null; - - if(mapEntry && mapEntry.refValue != null && mapEntry.intermediateValue != null){ - indicatorValue = mapEntry.refValue - mapEntry.intermediateValue; + if (mapEntry && mapEntry.refValue != null && mapEntry.intermediateValue != null) { + indicatorValue = mapEntry.refValue - mapEntry.intermediateValue; } - // set aggregationWeight as number of citizens KmHelper.setAggregationWeight(spatialUnitFeature, indicatorValue); - // set indicator value for spatialUnitFeature spatialUnitFeature = KmHelper.setIndicatorValue(spatialUnitFeature, targetDate, indicatorValue); - - spatialUnitIndex ++; - + spatialUnitIndex++; // only log after certain progress - if(spatialUnitIndex % logProgressIndexSeparator === 0){ + if (spatialUnitIndex % logProgressIndexSeparator === 0) { KmHelper.log("PROGRESS: Computed '" + spatialUnitIndex + "' of total '" + numFeatures + "' features."); } - }); - - KmHelper.log("Computation of indicator finished"); - - return targetSpatialUnit_geoJSON; -}; - + }); + KmHelper.log("Computation of indicator finished"); + return targetSpatialUnit_geoJSON; +} +; /** * This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). * The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. @@ -220,22 +184,22 @@ async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndic * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - if (!aggregationTypeEnum.includes(aggregationType)){ - console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + - "'. Allowed values are: " + aggregationTypeEnum); - console.log("Will fallback to using AVERAGE aggregation logic."); - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else if(aggregationType === "SUM"){ - return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else { - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } -}; - +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)) { + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if (aggregationType === "SUM") { + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +} +; /** * This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). * @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! @@ -246,12 +210,10 @@ function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geo * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // disaggregate indicator - -}; - - +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // disaggregate indicator +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. @@ -265,74 +227,60 @@ function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check to aggregate - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var baseIndicatorTotalWeight = 0; - var featureCounter = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - featureCounter++; - - // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number - if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ - // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method - // it "survives" until this aggregation logic within processing engine - var weight = KmHelper.getAggregationWeight(indicatorFeature); - - // use weight as weight for indicator value - baseIndicatorTotalWeight += weight; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; - } - } - } - - // compute average for share - if(baseIndicatorTotalWeight === 0){ - targetFeature.properties[targetDate] = Number.NaN; +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; } - else { - targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if (!Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined) { + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + // compute average for share + if (baseIndicatorTotalWeight === 0) { + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + KmHelper.log("Aggregation finished"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); } - // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); - }); - - KmHelper.log("Aggregation finished"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - + return targetSpatialUnit_geoJSON; +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} @@ -346,59 +294,47 @@ function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - var totalAggregatedIndicatorFeatures = 0; - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check for aggregation - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var numberOfIndicatorFeaturesWithinTargetFeature = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - numberOfIndicatorFeaturesWithinTargetFeature++; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); - } - } - totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; - }); - - KmHelper.log("Aggregation finished"); - KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - - +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + var totalAggregatedIndicatorFeatures = 0; + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; + } + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + return targetSpatialUnit_geoJSON; +} +; module.exports.computeIndicator = computeIndicator; module.exports.aggregateIndicator = aggregateIndicator; module.exports.disaggregateIndicator = disaggregateIndicator; +//# sourceMappingURL=km_indicator_subtract.js.map \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_indicator_subtract.js.map b/app/kommonitor-script-resources/km_indicator_subtract.js.map new file mode 100644 index 000000000..c25cf17f7 --- /dev/null +++ b/app/kommonitor-script-resources/km_indicator_subtract.js.map @@ -0,0 +1 @@ +{"version":3,"file":"km_indicator_subtract.js","sourceRoot":"","sources":["km_indicator_subtract.ts"],"names":[],"mappings":";AAAA,8JAA8J;AAC9J,yRAAyR;AACzR,8JAA8J;AAC9J,4GAA4G;AAC5G,8JAA8J;AAE9J;;;EAGE;AACF,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAGrC,8JAA8J;AAC9J,8JAA8J;AAC9J,6OAA6O;AAC7O,8JAA8J;AAE9J;;;;;;;EAOE;AACF,MAAM,mBAAmB,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AAE/C;;;;;;EAME;AACF,MAAM,eAAe,GAAG,KAAK,CAAC;AAE9B,MAAM,kCAAkC,GAAG,cAAc,CAAC;AAC1D,MAAM,oCAAoC,GAAG,gBAAgB,CAAC;AAE9D;;;;;;;;;;;;;;;;EAgBE;AACF,KAAK,UAAU,gBAAgB,CAAC,UAAU,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,eAAe,EAAE,iBAAiB;IAEzH,IAAI,oBAAoB,GAAG,QAAQ,CAAC,kCAAkC,CAAC,kCAAkC,EAAE,iBAAiB,CAAC,CAAC;IAC9H,IAAI,gBAAgB,GAAG,QAAQ,CAAC,oBAAoB,CAAC,oBAAoB,EAAE,iBAAiB,CAAC,CAAC;IAE3F,IAAI,uBAAuB,GAAG,QAAQ,CAAC,kCAAkC,CAAC,oCAAoC,EAAE,iBAAiB,CAAC,CAAC;IACtI,IAAI,6BAA6B,GAAG,uBAAuB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACvE,IAAI,wBAAwB,GAAG,EAAE,CAAC;IAClC,KAAK,MAAM,WAAW,IAAI,6BAA6B,EAAC;QACzD,wBAAwB,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,iBAAiB,CAAC,MAAM,EAAE,KAAK,EAAE,EAAC;YAC7D,IAAI,gBAAgB,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAC9C,IAAG,QAAQ,CAAC,MAAM,CAAC,gBAAgB,EAAE,aAAa,CAAC,EAAC;gBACrD,wCAAwC;gBACxC,iBAAiB,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;gBAChC,KAAK,EAAE,CAAC;gBACX,4CAA4C,EAAE,CAAC;gBAC/C,aAAa,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,gBAAgB,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;aACxF;SACD;QACA,gCAAgC,IAAI,4CAA4C,CAAC;IACnF,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;IACrC,QAAQ,CAAC,GAAG,CAAC,gCAAgC,GAAG,+BAA+B,GAAG,yBAAyB,CAAC,QAAQ,CAAC,MAAM,GAAG,iBAAiB,CAAC,CAAC;IAEjJ,IAAG,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAC;QAC9B,OAAO,CAAC,KAAK,CAAC,mDAAmD,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAC9F,MAAM,KAAK,CAAC,6DAA6D,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;KACvG;IAED,OAAO,yBAAyB,CAAC;AACnC,CAAC;AAAA,CAAC;AAGF,MAAM,CAAC,OAAO,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;AACnD,MAAM,CAAC,OAAO,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;AACvD,MAAM,CAAC,OAAO,CAAC,qBAAqB,GAAG,qBAAqB,CAAC"} \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_indicator_subtract.ts b/app/kommonitor-script-resources/km_indicator_subtract.ts new file mode 100644 index 000000000..3e9018f5f --- /dev/null +++ b/app/kommonitor-script-resources/km_indicator_subtract.ts @@ -0,0 +1,404 @@ +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// NECESSARY NODE MODULE DEPENDENCIES // // +// // +// SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* Module that contains various helper methods (spatial GIS functions and statistical functions) +* to simplify script writing +*/ +const KmHelper = require("kmhelper"); + + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// CONSTANTS DEFINITION // +// here you may specify custom CONSTANTS used within the script. // // // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* This constant specifies allowed values to determine how the aggregation process will deal with indicator values. +* I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. +* Note that these values must not be changed by users! +* @type {Array.} +* @memberof CONSTANTS +* @constant +*/ +const aggregationTypeEnum = ["SUM", "AVERAGE"]; + +/** +* via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. +* Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option +* @type {string} +* @memberof CONSTANTS +* @constant +*/ +const aggregationType = "SUM"; + +const parameterName_referenceIndicatorId = "REFERENCE_ID"; +const parameterName_computationIndicatorId = "COMPUTATION_ID"; + +/** +* This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined +* as method parameters that can be used within the method body. +* +* NOTE: The function is async, so users may make use of keyword "await" to wait for results of other async helper API methods. +* (This is necessary when users want to wait for asynchronous method execution such as external API calls in a synchronous program) +* +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit as GeoJSON FeatureCollection object. +* @param {map.>} baseIndicatorsMap - Map containing all indicators, wheres key='meaningful name or id of the indicator' and value='indicator as GeoJSON object' (it contains duplicate entries, one for the indicator name and one for the indicator id) +* @param {map.>} georesourcesMap - Map containing all georesources, wheres key='meaningful name or id of the georesource' and value='georesource as GeoJSON object' (they are used to execute geometric/toptologic computations) (it contains duplicate entries, one for the georesource name and one for the georesource id) +* @param {Array.>} processParameters - an array containing objects representing variable additional process parameters that are required to perform the indicator computation. +* Each entry has properties Object.name and Object.value for name and value of the parameter. +* @returns {FeatureCollection} the computed indicator for submitted {@linkcode targetSpatialUnit_geoJSON} features as GeoJSON FeatureCollection +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ + + var referenceIndicatorId = KmHelper.getProcessParameterByName_asString(parameterName_referenceIndicatorId, processParameters); + var referenceGeoJSON = KmHelper.getBaseIndicatorById(referenceIndicatorId, baseIndicatorsMap); + + var computationIndicatorIds = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId, processParameters); + var computationIndicatorIds_array = computationIndicatorIds.split(','); + var computationGeoJSON_array = []; + for (const indicatorID of computationIndicatorIds_array){ + computationGeoJSON_array.push(KmHelper.getBaseIndicatorById(indicatorID, baseIndicatorsMap))}; + + KmHelper.log("Retrieved required baseIndicators successfully"); + + // now we compute the new indicator + KmHelper.log("Iterate over base indicators and save intermediate values within a map object"); + + /** + * create a map to store indicator values for each feature of the target spatial unit + * by using such a map object, we can ensure, that we only iterate ONCE over each bease indicator + * and also can only iterate ONCE over each target spatial unit feature at the end to compute the indicator + */ + var map = new Map(); + + KmHelper.log("Process reference indicator '" + referenceIndicatorId + "'"); + + /** + * iterate over each feature of the baseIndicator and use its indicator value to modify map object + * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! + */ + referenceGeoJSON.features.forEach(function(feature) { + // get the unique featureID of the spatial unit feature as String + var featureId = KmHelper.getSpatialUnitFeatureIdValue(feature); + // get the time series value of the base indicator feature for the requested target date (with its required prefix!) + var referenceValue = KmHelper.getIndicatorValue(feature, targetDate); + + if(referenceValue === undefined || referenceValue === null){ + KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); + referenceValue = 0; + } + // modify map object (i.e. set value initially, or perform calculations and store modified value) + // key should be unique featureId of the spatial unit feature + if (! map.has(featureId)){ + var mapObject = { + featureId: featureId, + indicatorValue: undefined, + refValue: 0, + intermediateValue: 0 + }; + + map.set(featureId, mapObject); + } + var mapEntry = map.get(featureId); + mapEntry.refValue = referenceValue; + map.set(featureId, mapEntry); + }); + + KmHelper.log("Process computation indicator"); + + /** + * iterate over each feature of the baseIndicator and use its indicator value to modify map object + * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! + */ + computationGeoJSON_array.forEach(function(geoJSON) { + + geoJSON.features.forEach(function(feature) { + // get the unique featureID of the spatial unit feature as String + var featureId = KmHelper.getSpatialUnitFeatureIdValue(feature); + // get the time series value of the base indicator feature for the requested target date (with its required prefix!) + var partValue = KmHelper.getIndicatorValue(feature, targetDate); + if(partValue === undefined || partValue === null){ + KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); + KmHelper.log("WARNING: the feature value will thus be set to '0' and computation will continue"); + partValue = 0; + } + + if (! map.has(featureId)){ + KmHelper.log("Computation Indicator feature with id '" + featureId + "' was not computed from computation resources. Will set ref value to null."); + var mapObject = { + featureId: featureId, + indicatorValue: undefined, + refValue: null, + intermediateValue: 0 + }; + + map.set(featureId, mapObject); + } + + // modify map object (i.e. set value initially, or perform calculations and store modified value) + // key should be unique featureId of the spatial unit feature + var mapEntry = map.get(featureId); + + mapEntry.intermediateValue = mapEntry.intermediateValue + partValue; + + map.set(featureId, mapEntry); + }); + }); + + var numFeatures = targetSpatialUnit_geoJSON.features.length; + + // now we compute the new indicator + KmHelper.log("Compute indicator for a total amount of " + numFeatures + " features"); + + // iterate once over target spatial unit features and compute indicator utilizing map entries + var spatialUnitIndex = 0; + // create progress log after each 10th percent of features + var logProgressIndexSeparator = Math.round(numFeatures / 100 * 10); + targetSpatialUnit_geoJSON.features.forEach(function(spatialUnitFeature) { + + // get spatialUnit feature id as string --> use it to get associated map entry + var spatialUnitFeatureId = KmHelper.getSpatialUnitFeatureIdValue(spatialUnitFeature); + + if (! map.has(spatialUnitFeatureId)){ + KmHelper.log("Target spatial unit feature with id '" + spatialUnitFeatureId + "' was not computed from computation resources. Will set indicator value to null."); + var mapObject = { + featureId: spatialUnitFeatureId, + indicatorValue: undefined, + refValue: null, + intermediateValue: null + }; + + map.set(spatialUnitFeatureId, mapObject); + } + + var mapEntry = map.get(spatialUnitFeatureId); + + var indicatorValue = null; + + if(mapEntry && mapEntry.refValue != null && mapEntry.intermediateValue != null){ + indicatorValue = mapEntry.refValue - mapEntry.intermediateValue; + } + + // set aggregationWeight as number of citizens + KmHelper.setAggregationWeight(spatialUnitFeature, indicatorValue); + + // set indicator value for spatialUnitFeature + spatialUnitFeature = KmHelper.setIndicatorValue(spatialUnitFeature, targetDate, indicatorValue); + + spatialUnitIndex ++; + + // only log after certain progress + if(spatialUnitIndex % logProgressIndexSeparator === 0){ + KmHelper.log("PROGRESS: Computed '" + spatialUnitIndex + "' of total '" + numFeatures + "' features."); + } + }); + + KmHelper.log("Computation of indicator finished"); + + return targetSpatialUnit_geoJSON; +}; + +/** +* This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). +* The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. +* The aggrgation internally aggregates features of {@linkcode indicator_geoJSON} to features of {@linkcode targetSpatialUnit_geoJSON} by comparing their geometries. +* Each {@linkcode indicator_geoJSON} feature whose geometry lies within a certain geometry of a {@linkcode targetSpatialUnit_geoJSON} feature will be used to compute the aggregated indicator values. +* The within comparison is executed by method {@linkcode within_usingBBOX}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be aggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter targetSpatialUnit_geoJSON +* @see aggregationType +* @see within_usingBBOX +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the aggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)){ + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if(aggregationType === "SUM"){ + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +}; + +/** +* This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). +* @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be disaggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be disaggregated to the features of parameter targetSpatialUnit_geoJSON +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the disaggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // disaggregate indicator + +}; + + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. +* Also it uses the {@linkcode KmHelper.getAggregationWeight(feature)} method as weight during aggregtion. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + + // compute average for share + if(baseIndicatorTotalWeight === 0){ + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + + KmHelper.log("Aggregation finished"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} +* to determine which features of {@linkcode indicator_geoJSON} can be aggregated to which features of {@linkcode targetSpatialUnit_geoJSON}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + var totalAggregatedIndicatorFeatures = 0; + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + + +module.exports.computeIndicator = computeIndicator; +module.exports.aggregateIndicator = aggregateIndicator; +module.exports.disaggregateIndicator = disaggregateIndicator; diff --git a/app/kommonitor-script-resources/km_indicator_sum.js b/app/kommonitor-script-resources/km_indicator_sum.js index 0d14e7d51..68123e54e 100644 --- a/app/kommonitor-script-resources/km_indicator_sum.js +++ b/app/kommonitor-script-resources/km_indicator_sum.js @@ -1,21 +1,18 @@ +"use strict"; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // NECESSARY NODE MODULE DEPENDENCIES // // // // // SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * Module that contains various helper methods (spatial GIS functions and statistical functions) * to simplify script writing */ const KmHelper = require("kmhelper"); - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // CONSTANTS DEFINITION // // here you may specify custom CONSTANTS used within the script. // // // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * This constant specifies allowed values to determine how the aggregation process will deal with indicator values. * I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. @@ -25,7 +22,6 @@ const KmHelper = require("kmhelper"); * @constant */ const aggregationTypeEnum = ["SUM", "AVERAGE"]; - /** * via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. * Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option @@ -34,9 +30,7 @@ const aggregationTypeEnum = ["SUM", "AVERAGE"]; * @constant */ const aggregationType = "SUM"; - const parameterName_computationIndicatorId = "COMPUTATION_ID"; - /** * This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined * as method parameters that can be used within the method body. @@ -54,108 +48,89 @@ const parameterName_computationIndicatorId = "COMPUTATION_ID"; * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ - - var computationIndicatorIds = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId, processParameters); - var computationIndicatorIds_array = computationIndicatorIds.split(','); - var computationGeoJSON_array = []; - for (const indicatorID of computationIndicatorIds_array){ - computationGeoJSON_array.push(KmHelper.getBaseIndicatorById(indicatorID, baseIndicatorsMap))}; - - KmHelper.log("Retrieved required baseIndicators successfully"); - - // now we compute the new indicator - KmHelper.log("Iterate over base indicators and save intermediate values within a map object"); - - /** - * create a map to store indicator values for each feature of the target spatial unit - * by using such a map object, we can ensure, that we only iterate ONCE over each bease indicator - * and also can only iterate ONCE over each target spatial unit feature at the end to compute the indicator - */ - var map = new Map(); - - KmHelper.log("Process computation indicator"); - - /** - * iterate over each feature of the baseIndicator and use its indicator value to modify map object - * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! - */ - computationGeoJSON_array.forEach(function(geoJSON) { - - geoJSON.features.forEach(function(feature) { - // get the unique featureID of the spatial unit feature as String - var featureId = KmHelper.getSpatialUnitFeatureIdValue(feature); - // get the time series value of the base indicator feature for the requested target date (with its required prefix!) - var partValue = KmHelper.getIndicatorValue(feature, targetDate); - if(partValue === undefined || partValue === null){ - KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); - KmHelper.log("WARNING: the feature value will thus be set to '0' and computation will continue"); - partValue = 0; - } - // modify map object (i.e. set value initially, or perform calculations and store modified value) - // key should be unique featureId of the spatial unit feature - if (! map.has(featureId)){ - var mapObject = { - featureId: featureId, - indicatorValue: undefined, - intermediateValue: 0 - }; - map.set(featureId, mapObject); - } - var mapEntry = map.get(featureId); - mapEntry.intermediateValue = mapEntry.intermediateValue + partValue; - map.set(featureId, mapEntry); - }); - }); - - var numFeatures = targetSpatialUnit_geoJSON.features.length; - - // now we compute the new indicator - KmHelper.log("Compute indicator for a total amount of " + numFeatures + " features"); - - // iterate once over target spatial unit features and compute indicator utilizing map entries - var spatialUnitIndex = 0; - // create progress log after each 10th percent of features - var logProgressIndexSeparator = Math.round(numFeatures / 100 * 10); - targetSpatialUnit_geoJSON.features.forEach(function(spatialUnitFeature) { - +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters) { + var computationIndicatorIds = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId, processParameters); + var computationIndicatorIds_array = computationIndicatorIds.split(','); + var computationGeoJSON_array = []; + for (const indicatorID of computationIndicatorIds_array) { + computationGeoJSON_array.push(KmHelper.getBaseIndicatorById(indicatorID, baseIndicatorsMap)); + } + ; + KmHelper.log("Retrieved required baseIndicators successfully"); + // now we compute the new indicator + KmHelper.log("Iterate over base indicators and save intermediate values within a map object"); + /** + * create a map to store indicator values for each feature of the target spatial unit + * by using such a map object, we can ensure, that we only iterate ONCE over each bease indicator + * and also can only iterate ONCE over each target spatial unit feature at the end to compute the indicator + */ + var map = new Map(); + KmHelper.log("Process computation indicator"); + /** + * iterate over each feature of the baseIndicator and use its indicator value to modify map object + * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! + */ + computationGeoJSON_array.forEach(function (geoJSON) { + geoJSON.features.forEach(function (feature) { + // get the unique featureID of the spatial unit feature as String + var featureId = KmHelper.getSpatialUnitFeatureIdValue(feature); + // get the time series value of the base indicator feature for the requested target date (with its required prefix!) + var partValue = KmHelper.getIndicatorValue(feature, targetDate); + if (partValue === undefined || partValue === null) { + KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); + KmHelper.log("WARNING: the feature value will thus be set to '0' and computation will continue"); + partValue = 0; + } + // modify map object (i.e. set value initially, or perform calculations and store modified value) + // key should be unique featureId of the spatial unit feature + if (!map.has(featureId)) { + var mapObject = { + featureId: featureId, + indicatorValue: undefined, + intermediateValue: 0 + }; + map.set(featureId, mapObject); + } + var mapEntry = map.get(featureId); + mapEntry.intermediateValue = mapEntry.intermediateValue + partValue; + map.set(featureId, mapEntry); + }); + }); + var numFeatures = targetSpatialUnit_geoJSON.features.length; + // now we compute the new indicator + KmHelper.log("Compute indicator for a total amount of " + numFeatures + " features"); + // iterate once over target spatial unit features and compute indicator utilizing map entries + var spatialUnitIndex = 0; + // create progress log after each 10th percent of features + var logProgressIndexSeparator = Math.round(numFeatures / 100 * 10); + targetSpatialUnit_geoJSON.features.forEach(function (spatialUnitFeature) { // get spatialUnit feature id as string --> use it to get associated map entry var spatialUnitFeatureId = KmHelper.getSpatialUnitFeatureIdValue(spatialUnitFeature); - - if (! map.has(spatialUnitFeatureId)){ - KmHelper.log("Target spatial unit feature with id '" + spatialUnitFeatureId + "' was not computed from computation resources. Will set indicator value to null."); - var mapObject = { - featureId: spatialUnitFeatureId, - indicatorValue: null, - intermediateValue: null - }; - map.set(spatialUnitFeatureId, mapObject); - } - + if (!map.has(spatialUnitFeatureId)) { + KmHelper.log("Target spatial unit feature with id '" + spatialUnitFeatureId + "' was not computed from computation resources. Will set indicator value to null."); + var mapObject = { + featureId: spatialUnitFeatureId, + indicatorValue: null, + intermediateValue: null + }; + map.set(spatialUnitFeatureId, mapObject); + } var mapEntry = map.get(spatialUnitFeatureId); - - var indicatorValue = mapEntry.intermediateValue; - // set aggregationWeight as number of citizens KmHelper.setAggregationWeight(spatialUnitFeature, indicatorValue); - // set indicator value for spatialUnitFeature spatialUnitFeature = KmHelper.setIndicatorValue(spatialUnitFeature, targetDate, indicatorValue); - - spatialUnitIndex ++; - + spatialUnitIndex++; // only log after certain progress - if(spatialUnitIndex % logProgressIndexSeparator === 0){ + if (spatialUnitIndex % logProgressIndexSeparator === 0) { KmHelper.log("PROGRESS: Computed '" + spatialUnitIndex + "' of total '" + numFeatures + "' features."); } - }); - - KmHelper.log("Computation of indicator finished"); - - return targetSpatialUnit_geoJSON; -}; - + }); + KmHelper.log("Computation of indicator finished"); + return targetSpatialUnit_geoJSON; +} +; /** * This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). * The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. @@ -171,22 +146,22 @@ async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndic * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - if (!aggregationTypeEnum.includes(aggregationType)){ - console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + - "'. Allowed values are: " + aggregationTypeEnum); - console.log("Will fallback to using AVERAGE aggregation logic."); - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else if(aggregationType === "SUM"){ - return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else { - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } -}; - +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)) { + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if (aggregationType === "SUM") { + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +} +; /** * This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). * @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! @@ -197,12 +172,10 @@ function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geo * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // disaggregate indicator - -}; - - +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // disaggregate indicator +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. @@ -216,74 +189,60 @@ function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check to aggregate - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var baseIndicatorTotalWeight = 0; - var featureCounter = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - featureCounter++; - - // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number - if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ - // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method - // it "survives" until this aggregation logic within processing engine - var weight = KmHelper.getAggregationWeight(indicatorFeature); - - // use weight as weight for indicator value - baseIndicatorTotalWeight += weight; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; - } - } - } - - // compute average for share - if(baseIndicatorTotalWeight === 0){ - targetFeature.properties[targetDate] = Number.NaN; +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; } - else { - targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if (!Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined) { + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + // compute average for share + if (baseIndicatorTotalWeight === 0) { + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + KmHelper.log("Aggregation finished"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); } - // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); - }); - - KmHelper.log("Aggregation finished"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - + return targetSpatialUnit_geoJSON; +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} @@ -297,59 +256,47 @@ function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - var totalAggregatedIndicatorFeatures = 0; - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check for aggregation - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var numberOfIndicatorFeaturesWithinTargetFeature = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - numberOfIndicatorFeaturesWithinTargetFeature++; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); - } - } - totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; - }); - - KmHelper.log("Aggregation finished"); - KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - - +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + var totalAggregatedIndicatorFeatures = 0; + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; + } + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + return targetSpatialUnit_geoJSON; +} +; module.exports.computeIndicator = computeIndicator; module.exports.aggregateIndicator = aggregateIndicator; module.exports.disaggregateIndicator = disaggregateIndicator; +//# sourceMappingURL=km_indicator_sum.js.map \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_indicator_sum.js.map b/app/kommonitor-script-resources/km_indicator_sum.js.map new file mode 100644 index 000000000..907fe97f3 --- /dev/null +++ b/app/kommonitor-script-resources/km_indicator_sum.js.map @@ -0,0 +1 @@ +{"version":3,"file":"km_indicator_sum.js","sourceRoot":"","sources":["km_indicator_sum.ts"],"names":[],"mappings":";AAAA,8JAA8J;AAC9J,yRAAyR;AACzR,8JAA8J;AAC9J,4GAA4G;AAC5G,8JAA8J;AAE9J;;;EAGE;AACF,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAGrC,8JAA8J;AAC9J,8JAA8J;AAC9J,6OAA6O;AAC7O,8JAA8J;AAE9J;;;;;;;EAOE;AACF,MAAM,mBAAmB,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AAE/C;;;;;;EAME;AACF,MAAM,eAAe,GAAG,KAAK,CAAC;AAE9B,MAAM,oCAAoC,GAAG,gBAAgB,CAAC;AAE9D;;;;;;;;;;;;;;;;EAgBE;AACF,KAAK,UAAU,gBAAgB,CAAC,UAAU,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,eAAe,EAAE,iBAAiB;IAEtH,IAAI,uBAAuB,GAAG,QAAQ,CAAC,kCAAkC,CAAC,oCAAoC,EAAE,iBAAiB,CAAC,CAAC;IACtI,IAAI,6BAA6B,GAAG,uBAAuB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACvE,IAAI,wBAAwB,GAAG,EAAE,CAAC;IAClC,KAAK,MAAM,WAAW,IAAI,6BAA6B,EAAC;QACzD,wBAAwB,CAAC,IAAI,CAAC,QAAQ,CAAC,oBAAoB,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC,CAAA;KAAC;IAAA,CAAC;IAE1F,QAAQ,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;IAE/D,mCAAmC;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KAAK,EAAE,CAAC;gBACX,4CAA4C,EAAE,CAAC;gBAC/C,aAAa,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,gBAAgB,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;aACxF;SACD;QACA,gCAAgC,IAAI,4CAA4C,CAAC;IACnF,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;IACrC,QAAQ,CAAC,GAAG,CAAC,gCAAgC,GAAG,+BAA+B,GAAG,yBAAyB,CAAC,QAAQ,CAAC,MAAM,GAAG,iBAAiB,CAAC,CAAC;IAEjJ,IAAG,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAC;QAC9B,OAAO,CAAC,KAAK,CAAC,mDAAmD,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAC9F,MAAM,KAAK,CAAC,6DAA6D,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;KACvG;IAED,OAAO,yBAAyB,CAAC;AACnC,CAAC;AAAA,CAAC;AAGF,MAAM,CAAC,OAAO,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;AACnD,MAAM,CAAC,OAAO,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;AACvD,MAAM,CAAC,OAAO,CAAC,qBAAqB,GAAG,qBAAqB,CAAC"} \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_indicator_sum.ts b/app/kommonitor-script-resources/km_indicator_sum.ts new file mode 100644 index 000000000..0d14e7d51 --- /dev/null +++ b/app/kommonitor-script-resources/km_indicator_sum.ts @@ -0,0 +1,355 @@ +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// NECESSARY NODE MODULE DEPENDENCIES // // +// // +// SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* Module that contains various helper methods (spatial GIS functions and statistical functions) +* to simplify script writing +*/ +const KmHelper = require("kmhelper"); + + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// CONSTANTS DEFINITION // +// here you may specify custom CONSTANTS used within the script. // // // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* This constant specifies allowed values to determine how the aggregation process will deal with indicator values. +* I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. +* Note that these values must not be changed by users! +* @type {Array.} +* @memberof CONSTANTS +* @constant +*/ +const aggregationTypeEnum = ["SUM", "AVERAGE"]; + +/** +* via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. +* Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option +* @type {string} +* @memberof CONSTANTS +* @constant +*/ +const aggregationType = "SUM"; + +const parameterName_computationIndicatorId = "COMPUTATION_ID"; + +/** +* This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined +* as method parameters that can be used within the method body. +* +* NOTE: The function is async, so users may make use of keyword "await" to wait for results of other async helper API methods. +* (This is necessary when users want to wait for asynchronous method execution such as external API calls in a synchronous program) +* +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit as GeoJSON FeatureCollection object. +* @param {map.>} baseIndicatorsMap - Map containing all indicators, wheres key='meaningful name or id of the indicator' and value='indicator as GeoJSON object' (it contains duplicate entries, one for the indicator name and one for the indicator id) +* @param {map.>} georesourcesMap - Map containing all georesources, wheres key='meaningful name or id of the georesource' and value='georesource as GeoJSON object' (they are used to execute geometric/toptologic computations) (it contains duplicate entries, one for the georesource name and one for the georesource id) +* @param {Array.>} processParameters - an array containing objects representing variable additional process parameters that are required to perform the indicator computation. +* Each entry has properties Object.name and Object.value for name and value of the parameter. +* @returns {FeatureCollection} the computed indicator for submitted {@linkcode targetSpatialUnit_geoJSON} features as GeoJSON FeatureCollection +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ + + var computationIndicatorIds = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId, processParameters); + var computationIndicatorIds_array = computationIndicatorIds.split(','); + var computationGeoJSON_array = []; + for (const indicatorID of computationIndicatorIds_array){ + computationGeoJSON_array.push(KmHelper.getBaseIndicatorById(indicatorID, baseIndicatorsMap))}; + + KmHelper.log("Retrieved required baseIndicators successfully"); + + // now we compute the new indicator + KmHelper.log("Iterate over base indicators and save intermediate values within a map object"); + + /** + * create a map to store indicator values for each feature of the target spatial unit + * by using such a map object, we can ensure, that we only iterate ONCE over each bease indicator + * and also can only iterate ONCE over each target spatial unit feature at the end to compute the indicator + */ + var map = new Map(); + + KmHelper.log("Process computation indicator"); + + /** + * iterate over each feature of the baseIndicator and use its indicator value to modify map object + * NOTE use spatialUnitFeatureId as key to be able to identify entries by their unique feature id! + */ + computationGeoJSON_array.forEach(function(geoJSON) { + + geoJSON.features.forEach(function(feature) { + // get the unique featureID of the spatial unit feature as String + var featureId = KmHelper.getSpatialUnitFeatureIdValue(feature); + // get the time series value of the base indicator feature for the requested target date (with its required prefix!) + var partValue = KmHelper.getIndicatorValue(feature, targetDate); + if(partValue === undefined || partValue === null){ + KmHelper.log("WARNING: the feature with featureID '" + featureId + "' does not contain a time series value for targetDate '" + targetDate + "'"); + KmHelper.log("WARNING: the feature value will thus be set to '0' and computation will continue"); + partValue = 0; + } + // modify map object (i.e. set value initially, or perform calculations and store modified value) + // key should be unique featureId of the spatial unit feature + if (! map.has(featureId)){ + var mapObject = { + featureId: featureId, + indicatorValue: undefined, + intermediateValue: 0 + }; + map.set(featureId, mapObject); + } + var mapEntry = map.get(featureId); + mapEntry.intermediateValue = mapEntry.intermediateValue + partValue; + map.set(featureId, mapEntry); + }); + }); + + var numFeatures = targetSpatialUnit_geoJSON.features.length; + + // now we compute the new indicator + KmHelper.log("Compute indicator for a total amount of " + numFeatures + " features"); + + // iterate once over target spatial unit features and compute indicator utilizing map entries + var spatialUnitIndex = 0; + // create progress log after each 10th percent of features + var logProgressIndexSeparator = Math.round(numFeatures / 100 * 10); + targetSpatialUnit_geoJSON.features.forEach(function(spatialUnitFeature) { + + // get spatialUnit feature id as string --> use it to get associated map entry + var spatialUnitFeatureId = KmHelper.getSpatialUnitFeatureIdValue(spatialUnitFeature); + + if (! map.has(spatialUnitFeatureId)){ + KmHelper.log("Target spatial unit feature with id '" + spatialUnitFeatureId + "' was not computed from computation resources. Will set indicator value to null."); + var mapObject = { + featureId: spatialUnitFeatureId, + indicatorValue: null, + intermediateValue: null + }; + map.set(spatialUnitFeatureId, mapObject); + } + + var mapEntry = map.get(spatialUnitFeatureId); + + + var indicatorValue = mapEntry.intermediateValue; + + // set aggregationWeight as number of citizens + KmHelper.setAggregationWeight(spatialUnitFeature, indicatorValue); + + // set indicator value for spatialUnitFeature + spatialUnitFeature = KmHelper.setIndicatorValue(spatialUnitFeature, targetDate, indicatorValue); + + spatialUnitIndex ++; + + // only log after certain progress + if(spatialUnitIndex % logProgressIndexSeparator === 0){ + KmHelper.log("PROGRESS: Computed '" + spatialUnitIndex + "' of total '" + numFeatures + "' features."); + } + }); + + KmHelper.log("Computation of indicator finished"); + + return targetSpatialUnit_geoJSON; +}; + +/** +* This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). +* The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. +* The aggrgation internally aggregates features of {@linkcode indicator_geoJSON} to features of {@linkcode targetSpatialUnit_geoJSON} by comparing their geometries. +* Each {@linkcode indicator_geoJSON} feature whose geometry lies within a certain geometry of a {@linkcode targetSpatialUnit_geoJSON} feature will be used to compute the aggregated indicator values. +* The within comparison is executed by method {@linkcode within_usingBBOX}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be aggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter targetSpatialUnit_geoJSON +* @see aggregationType +* @see within_usingBBOX +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the aggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)){ + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if(aggregationType === "SUM"){ + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +}; + +/** +* This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). +* @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be disaggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be disaggregated to the features of parameter targetSpatialUnit_geoJSON +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the disaggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // disaggregate indicator + +}; + + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. +* Also it uses the {@linkcode KmHelper.getAggregationWeight(feature)} method as weight during aggregtion. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + + // compute average for share + if(baseIndicatorTotalWeight === 0){ + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + + KmHelper.log("Aggregation finished"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} +* to determine which features of {@linkcode indicator_geoJSON} can be aggregated to which features of {@linkcode targetSpatialUnit_geoJSON}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + var totalAggregatedIndicatorFeatures = 0; + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + + +module.exports.computeIndicator = computeIndicator; +module.exports.aggregateIndicator = aggregateIndicator; +module.exports.disaggregateIndicator = disaggregateIndicator; diff --git a/app/kommonitor-script-resources/km_indicator_trend_nTemporalItems.js b/app/kommonitor-script-resources/km_indicator_trend_nTemporalItems.js index ed933875f..1e1b2ef05 100644 --- a/app/kommonitor-script-resources/km_indicator_trend_nTemporalItems.js +++ b/app/kommonitor-script-resources/km_indicator_trend_nTemporalItems.js @@ -1,21 +1,18 @@ +"use strict"; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // NECESSARY NODE MODULE DEPENDENCIES // // // // // SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * Module that contains various helper methods (spatial GIS functions and statistical functions) * to simplify script writing */ const KmHelper = require("kmhelper"); - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // CONSTANTS DEFINITION // // here you may specify custom CONSTANTS used within the script. // // // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * This constant specifies allowed values to determine how the aggregation process will deal with indicator values. * I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. @@ -25,7 +22,6 @@ const KmHelper = require("kmhelper"); * @constant */ const aggregationTypeEnum = ["SUM", "AVERAGE"]; - /** * via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. * Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option @@ -34,15 +30,10 @@ const aggregationTypeEnum = ["SUM", "AVERAGE"]; * @constant */ const aggregationType = "SUM"; - const parameterName_computationIndicatorId = "COMPUTATION_ID"; - const parameterName_numberOfTemporalItems = "NUMBER_OF_TEMPORAL_ITEMS"; - // allowed values ['YEARS', 'MONTHS', 'DAYS'] const parameterName_temporalType = "TEMPORAL_TYPE"; - - /** * This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined * as method parameters that can be used within the method body. @@ -60,43 +51,36 @@ const parameterName_temporalType = "TEMPORAL_TYPE"; * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ - +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters) { // get the id to be used for calculations var computationIndicatorId = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId, processParameters); - var temporalType = KmHelper.getProcessParameterByName_asString(parameterName_temporalType, processParameters); + var temporalType = KmHelper.getProcessParameterByName_asString(parameterName_temporalType, processParameters); var numberOfTemporalItems = KmHelper.getProcessParameterByName_asNumber(parameterName_numberOfTemporalItems, processParameters); - // get the indicator using the computationIndicatorId var computationIndicator = KmHelper.getBaseIndicatorById(computationIndicatorId, baseIndicatorsMap); - KmHelper.log("Retrieved required computationIndicator successfully."); - + KmHelper.log("Retrieved required computationIndicator successfully."); // now we compute the new indicator for the trend within n consecutive years // internally tests are run, e.g. if n previous years are available or not - - var resultMap = new Map(); - - if(temporalType === "YEARS"){ - resultMap = KmHelper.trend_consecutive_n_years(computationIndicator, targetDate, numberOfTemporalItems); - } - else if(temporalType === "MONTHS"){ - resultMap = KmHelper.trend_consecutive_n_months(computationIndicator, targetDate, numberOfTemporalItems); - } - else if(temporalType === "DAYS"){ - resultMap = KmHelper.trend_consecutive_n_days(computationIndicator, targetDate, numberOfTemporalItems); - } - else{ - KmHelper.log("WARNING: parameter '" + parameterName_temporalType + "' with allowed values ['YEARS', 'MONTHS', 'DAYS'] has unknown value '" + temporalType + "'. Will use YEARS as default"); - resultMap = KmHelper.trend_consecutive_n_years(computationIndicator, targetDate, numberOfTemporalItems); - } - + var resultMap = new Map(); + if (temporalType === "YEARS") { + resultMap = KmHelper.trend_consecutive_n_years(computationIndicator, targetDate, numberOfTemporalItems); + } + else if (temporalType === "MONTHS") { + resultMap = KmHelper.trend_consecutive_n_months(computationIndicator, targetDate, numberOfTemporalItems); + } + else if (temporalType === "DAYS") { + resultMap = KmHelper.trend_consecutive_n_days(computationIndicator, targetDate, numberOfTemporalItems); + } + else { + KmHelper.log("WARNING: parameter '" + parameterName_temporalType + "' with allowed values ['YEARS', 'MONTHS', 'DAYS'] has unknown value '" + temporalType + "'. Will use YEARS as default"); + resultMap = KmHelper.trend_consecutive_n_years(computationIndicator, targetDate, numberOfTemporalItems); + } var numFeatures = targetSpatialUnit_geoJSON.features.length; KmHelper.log("Computed trend indicator for a total amount of " + numFeatures + " features"); targetSpatialUnit_geoJSON = KmHelper.setIndicatorValues_fromIdValueMap(targetSpatialUnit_geoJSON, targetDate, resultMap); KmHelper.log("Computation of the trend finished"); return targetSpatialUnit_geoJSON; } - /** * This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). * The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. @@ -112,22 +96,22 @@ async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndic * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - if (!aggregationTypeEnum.includes(aggregationType)){ - console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + - "'. Allowed values are: " + aggregationTypeEnum); - console.log("Will fallback to using AVERAGE aggregation logic."); - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else if(aggregationType === "SUM"){ - return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else { - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } -}; - +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)) { + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if (aggregationType === "SUM") { + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +} +; /** * This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). * @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! @@ -138,12 +122,10 @@ function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geo * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // disaggregate indicator - -}; - - +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // disaggregate indicator +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. @@ -157,74 +139,60 @@ function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check to aggregate - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var baseIndicatorTotalWeight = 0; - var featureCounter = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - featureCounter++; - - // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number - if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ - // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method - // it "survives" until this aggregation logic within processing engine - var weight = KmHelper.getAggregationWeight(indicatorFeature); - - // use weight as weight for indicator value - baseIndicatorTotalWeight += weight; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; - } - } - } - - // compute average for share - if(baseIndicatorTotalWeight === 0){ - targetFeature.properties[targetDate] = Number.NaN; +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; } - else { - targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if (!Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined) { + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + // compute average for share + if (baseIndicatorTotalWeight === 0) { + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + KmHelper.log("Aggregation finished"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); } - // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); - }); - - KmHelper.log("Aggregation finished"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - + return targetSpatialUnit_geoJSON; +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} @@ -238,59 +206,47 @@ function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - var totalAggregatedIndicatorFeatures = 0; - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check for aggregation - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var numberOfIndicatorFeaturesWithinTargetFeature = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - numberOfIndicatorFeaturesWithinTargetFeature++; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); - } - } - totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; - }); - - KmHelper.log("Aggregation finished"); - KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - - +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + var totalAggregatedIndicatorFeatures = 0; + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; + } + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + return targetSpatialUnit_geoJSON; +} +; module.exports.computeIndicator = computeIndicator; module.exports.aggregateIndicator = aggregateIndicator; module.exports.disaggregateIndicator = disaggregateIndicator; +//# sourceMappingURL=km_indicator_trend_nTemporalItems.js.map \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_indicator_trend_nTemporalItems.js.map b/app/kommonitor-script-resources/km_indicator_trend_nTemporalItems.js.map new file mode 100644 index 000000000..1f97804fe --- /dev/null +++ b/app/kommonitor-script-resources/km_indicator_trend_nTemporalItems.js.map @@ -0,0 +1 @@ +{"version":3,"file":"km_indicator_trend_nTemporalItems.js","sourceRoot":"","sources":["km_indicator_trend_nTemporalItems.ts"],"names":[],"mappings":";AAAA,8JAA8J;AAC9J,yRAAyR;AACzR,8JAA8J;AAC9J,4GAA4G;AAC5G,8JAA8J;AAE9J;;;EAGE;AACF,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAGrC,8JAA8J;AAC9J,8JAA8J;AAC9J,6OAA6O;AAC7O,8JAA8J;AAE9J;;;;;;;EAOE;AACF,MAAM,mBAAmB,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AAE/C;;;;;;EAME;AACF,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I,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,iBAAiB,CAAC,MAAM,EAAE,KAAK,EAAE,EAAC;YAC7D,IAAI,gBAAgB,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAC9C,IAAG,QAAQ,CAAC,MAAM,CAAC,gBAAgB,EAAE,aAAa,CAAC,EAAC;gBACrD,wCAAwC;gBACxC,iBAAiB,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;gBAChC,KAAK,EAAE,CAAC;gBACX,4CAA4C,EAAE,CAAC;gBAC/C,aAAa,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,gBAAgB,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;aACxF;SACD;QACA,gCAAgC,IAAI,4CAA4C,CAAC;IACnF,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;IACrC,QAAQ,CAAC,GAAG,CAAC,gCAAgC,GAAG,+BAA+B,GAAG,yBAAyB,CAAC,QAAQ,CAAC,MAAM,GAAG,iBAAiB,CAAC,CAAC;IAEjJ,IAAG,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAC;QAC9B,OAAO,CAAC,KAAK,CAAC,mDAAmD,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAC9F,MAAM,KAAK,CAAC,6DAA6D,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;KACvG;IAED,OAAO,yBAAyB,CAAC;AACnC,CAAC;AAAA,CAAC;AAGF,MAAM,CAAC,OAAO,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;AACnD,MAAM,CAAC,OAAO,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;AACvD,MAAM,CAAC,OAAO,CAAC,qBAAqB,GAAG,qBAAqB,CAAC"} \ No newline at end of file diff --git a/app/kommonitor-script-resources/km_indicator_trend_nTemporalItems.ts b/app/kommonitor-script-resources/km_indicator_trend_nTemporalItems.ts new file mode 100644 index 000000000..ed933875f --- /dev/null +++ b/app/kommonitor-script-resources/km_indicator_trend_nTemporalItems.ts @@ -0,0 +1,296 @@ +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// NECESSARY NODE MODULE DEPENDENCIES // // +// // +// SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* Module that contains various helper methods (spatial GIS functions and statistical functions) +* to simplify script writing +*/ +const KmHelper = require("kmhelper"); + + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// CONSTANTS DEFINITION // +// here you may specify custom CONSTANTS used within the script. // // // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* This constant specifies allowed values to determine how the aggregation process will deal with indicator values. +* I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. +* Note that these values must not be changed by users! +* @type {Array.} +* @memberof CONSTANTS +* @constant +*/ +const aggregationTypeEnum = ["SUM", "AVERAGE"]; + +/** +* via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. +* Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option +* @type {string} +* @memberof CONSTANTS +* @constant +*/ +const aggregationType = "SUM"; + +const parameterName_computationIndicatorId = "COMPUTATION_ID"; + +const parameterName_numberOfTemporalItems = "NUMBER_OF_TEMPORAL_ITEMS"; + +// allowed values ['YEARS', 'MONTHS', 'DAYS'] +const parameterName_temporalType = "TEMPORAL_TYPE"; + + +/** +* This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined +* as method parameters that can be used within the method body. +* +* NOTE: The function is async, so users may make use of keyword "await" to wait for results of other async helper API methods. +* (This is necessary when users want to wait for asynchronous method execution such as external API calls in a synchronous program) +* +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit as GeoJSON FeatureCollection object. +* @param {map.>} baseIndicatorsMap - Map containing all indicators, wheres key='meaningful name or id of the indicator' and value='indicator as GeoJSON object' (it contains duplicate entries, one for the indicator name and one for the indicator id) +* @param {map.>} georesourcesMap - Map containing all georesources, wheres key='meaningful name or id of the georesource' and value='georesource as GeoJSON object' (they are used to execute geometric/toptologic computations) (it contains duplicate entries, one for the georesource name and one for the georesource id) +* @param {Array.>} processParameters - an array containing objects representing variable additional process parameters that are required to perform the indicator computation. +* Each entry has properties Object.name and Object.value for name and value of the parameter. +* @returns {FeatureCollection} the computed indicator for submitted {@linkcode targetSpatialUnit_geoJSON} features as GeoJSON FeatureCollection +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ + + // get the id to be used for calculations + var computationIndicatorId = KmHelper.getProcessParameterByName_asString(parameterName_computationIndicatorId, processParameters); + var temporalType = KmHelper.getProcessParameterByName_asString(parameterName_temporalType, processParameters); + var numberOfTemporalItems = KmHelper.getProcessParameterByName_asNumber(parameterName_numberOfTemporalItems, processParameters); + + // get the indicator using the computationIndicatorId + var computationIndicator = KmHelper.getBaseIndicatorById(computationIndicatorId, baseIndicatorsMap); + KmHelper.log("Retrieved required computationIndicator successfully."); + + // now we compute the new indicator for the trend within n consecutive years + // internally tests are run, e.g. if n previous years are available or not + + var resultMap = new Map(); + + if(temporalType === "YEARS"){ + resultMap = KmHelper.trend_consecutive_n_years(computationIndicator, targetDate, numberOfTemporalItems); + } + else if(temporalType === "MONTHS"){ + resultMap = KmHelper.trend_consecutive_n_months(computationIndicator, targetDate, numberOfTemporalItems); + } + else if(temporalType === "DAYS"){ + resultMap = KmHelper.trend_consecutive_n_days(computationIndicator, targetDate, numberOfTemporalItems); + } + else{ + KmHelper.log("WARNING: parameter '" + parameterName_temporalType + "' with allowed values ['YEARS', 'MONTHS', 'DAYS'] has unknown value '" + temporalType + "'. Will use YEARS as default"); + resultMap = KmHelper.trend_consecutive_n_years(computationIndicator, targetDate, numberOfTemporalItems); + } + + var numFeatures = targetSpatialUnit_geoJSON.features.length; + KmHelper.log("Computed trend indicator for a total amount of " + numFeatures + " features"); + targetSpatialUnit_geoJSON = KmHelper.setIndicatorValues_fromIdValueMap(targetSpatialUnit_geoJSON, targetDate, resultMap); + KmHelper.log("Computation of the trend finished"); + return targetSpatialUnit_geoJSON; +} + +/** +* This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). +* The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. +* The aggrgation internally aggregates features of {@linkcode indicator_geoJSON} to features of {@linkcode targetSpatialUnit_geoJSON} by comparing their geometries. +* Each {@linkcode indicator_geoJSON} feature whose geometry lies within a certain geometry of a {@linkcode targetSpatialUnit_geoJSON} feature will be used to compute the aggregated indicator values. +* The within comparison is executed by method {@linkcode within_usingBBOX}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be aggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter targetSpatialUnit_geoJSON +* @see aggregationType +* @see within_usingBBOX +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the aggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)){ + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if(aggregationType === "SUM"){ + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +}; + +/** +* This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). +* @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be disaggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be disaggregated to the features of parameter targetSpatialUnit_geoJSON +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the disaggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // disaggregate indicator + +}; + + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. +* Also it uses the {@linkcode KmHelper.getAggregationWeight(feature)} method as weight during aggregtion. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + + // compute average for share + if(baseIndicatorTotalWeight === 0){ + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + + KmHelper.log("Aggregation finished"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} +* to determine which features of {@linkcode indicator_geoJSON} can be aggregated to which features of {@linkcode targetSpatialUnit_geoJSON}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + var totalAggregatedIndicatorFeatures = 0; + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + + +module.exports.computeIndicator = computeIndicator; +module.exports.aggregateIndicator = aggregateIndicator; +module.exports.disaggregateIndicator = disaggregateIndicator; diff --git a/app/kommonitor-script-resources/kommonitor-script-template.js b/app/kommonitor-script-resources/kommonitor-script-template.js index d8e3a3ce2..78aeccf58 100644 --- a/app/kommonitor-script-resources/kommonitor-script-template.js +++ b/app/kommonitor-script-resources/kommonitor-script-template.js @@ -1,9 +1,9 @@ +"use strict"; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // NECESSARY NODE MODULE DEPENDENCIES // // // // // SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * This constant may be used to perform spatial analysis and geometric operation tasks. * A full-featured API documentation of Turf.js library can be found at {@link http://turfjs.org/}. @@ -15,7 +15,6 @@ * @constant */ const turf = require('@turf/turf'); - /** * This constant may be used to perform statistical computations. * A full-featured API documentation of JStat.js library can be found at {@link http://jstat.org/}. @@ -27,19 +26,15 @@ const turf = require('@turf/turf'); * @constant */ const jStat = require('jStat').jStat; - /** * Module that contains various helper methods (spatial GIS functions and statistical functions) * to simplify script writing */ const KmHelper = require("kmhelper"); - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // CONSTANTS DEFINITION // // here you may specify custom CONSTANTS used within the script. // // // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** * This constant specifies allowed values to determine how the aggregation process will deal with indicator values. * I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. @@ -49,7 +44,6 @@ const KmHelper = require("kmhelper"); * @constant */ const aggregationTypeEnum = ["SUM", "AVERAGE"]; - /** * via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. * Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option @@ -58,9 +52,6 @@ const aggregationTypeEnum = ["SUM", "AVERAGE"]; * @constant */ const aggregationType = "AVERAGE"; - - - /** * This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined * as method parameters that can be used within the method body. @@ -78,14 +69,12 @@ const aggregationType = "AVERAGE"; * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ - // compute indicator for targetDate and targetSpatialUnitFeatures - // i.e. then modify the features of targetSpatialUnit_geoJSON and return it - - - return targetSpatialUnit_geoJSON; -}; - +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters) { + // compute indicator for targetDate and targetSpatialUnitFeatures + // i.e. then modify the features of targetSpatialUnit_geoJSON and return it + return targetSpatialUnit_geoJSON; +} +; /** * This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). * The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. @@ -101,22 +90,22 @@ async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndic * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - if (!aggregationTypeEnum.includes(aggregationType)){ - console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + - "'. Allowed values are: " + aggregationTypeEnum); - console.log("Will fallback to using AVERAGE aggregation logic."); - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else if(aggregationType === "SUM"){ - return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } - else { - return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); - } -}; - +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)) { + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if (aggregationType === "SUM") { + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +} +; /** * This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). * @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! @@ -127,12 +116,10 @@ function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geo * @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE * @function */ -function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // disaggregate indicator - -}; - - +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // disaggregate indicator +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. @@ -146,74 +133,60 @@ function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check to aggregate - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var baseIndicatorTotalWeight = 0; - var featureCounter = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - featureCounter++; - - // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number - if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ - // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method - // it "survives" until this aggregation logic within processing engine - var weight = KmHelper.getAggregationWeight(indicatorFeature); - - // use weight as weight for indicator value - baseIndicatorTotalWeight += weight; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; - } - } - } - - // compute average for share - if(baseIndicatorTotalWeight === 0){ - targetFeature.properties[targetDate] = Number.NaN; +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; } - else { - targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if (!Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined) { + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + // compute average for share + if (baseIndicatorTotalWeight === 0) { + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + KmHelper.log("Aggregation finished"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); } - // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); - }); - - KmHelper.log("Aggregation finished"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - + return targetSpatialUnit_geoJSON; +} +; /** * Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} * by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} @@ -227,58 +200,47 @@ function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJ * @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS * @function */ -function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ - // aggregate indicator - - var indicatorFeatures = indicator_geoJSON.features; - - KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); - KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); - KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); - - targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); - KmHelper.log('Target Date with prefix: ' + targetDate); - - var totalAggregatedIndicatorFeatures = 0; - - // first replace indicatorFeature geoimetry by their pointOnSurface - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - var centerPoint = KmHelper.pointOnFeature(indicatorFeature); - - indicatorFeature.geometry = centerPoint.geometry; - } - - // spatial within check for aggregation - targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ - - targetFeature.properties[targetDate] = 0; - var numberOfIndicatorFeaturesWithinTargetFeature = 0; - - for (var index = 0; index < indicatorFeatures.length; index++){ - var indicatorFeature = indicatorFeatures[index]; - if(KmHelper.within(indicatorFeature, targetFeature)){ - // remove from array and decrement index - indicatorFeatures.splice(index, 1); - index--; - numberOfIndicatorFeaturesWithinTargetFeature++; - targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); - } - } - totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; - }); - - KmHelper.log("Aggregation finished"); - KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); - - if(indicatorFeatures.length > 0){ - console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); - throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); - } - - return targetSpatialUnit_geoJSON; -}; - +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON) { + // aggregate indicator + var indicatorFeatures = indicator_geoJSON.features; + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + var totalAggregatedIndicatorFeatures = 0; + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + indicatorFeature.geometry = centerPoint.geometry; + } + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function (targetFeature) { + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + for (var index = 0; index < indicatorFeatures.length; index++) { + var indicatorFeature = indicatorFeatures[index]; + if (KmHelper.within(indicatorFeature, targetFeature)) { + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + if (indicatorFeatures.length > 0) { + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + return targetSpatialUnit_geoJSON; +} +; module.exports.computeIndicator = computeIndicator; module.exports.aggregateIndicator = aggregateIndicator; module.exports.disaggregateIndicator = disaggregateIndicator; +//# sourceMappingURL=kommonitor-script-template.js.map \ No newline at end of file diff --git a/app/kommonitor-script-resources/kommonitor-script-template.js.map b/app/kommonitor-script-resources/kommonitor-script-template.js.map new file mode 100644 index 000000000..056d53350 --- /dev/null +++ b/app/kommonitor-script-resources/kommonitor-script-template.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-script-template.js","sourceRoot":"","sources":["kommonitor-script-template.ts"],"names":[],"mappings":";AAAA,8JAA8J;AAC9J,yRAAyR;AACzR,8JAA8J;AAC9J,4GAA4G;AAC5G,8JAA8J;AAE9J;;;;;;;;;EASE;AACF,MAAM,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAEnC;;;;;;;;;EASE;AACF,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC;AAErC;;;EAGE;AACF,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAGrC,8JAA8J;AAC9J,8JAA8J;AAC9J,6OAA6O;AAC7O,8JAA8J;AAE9J;;;;;;;EAOE;AACF,MAAM,mBAAmB,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AAE/C;;;;;;EAME;AACF,MAAM,eAAe,GAAG,SAAS,CAAC;AAIlC;;;;;;;;;;;;;;;;EAgBE;AACF,KAAK,UAAU,gBAAgB,CAAC,UAAU,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,eAAe,EAAE,iBAAiB;IAC1H,iEAAiE;IACjE,2EAA2E;IAG3E,OAAO,yBAAyB,CAAC;AACnC,CAAC;AAAA,CAAC;AAEF;;;;;;;;;;;;;;EAcE;AACF,SAAS,kBAAkB,CAAC,UAAU,EAAE,yBAAyB,EAAE,iBAAiB;IAClF,sBAAsB;IACtB,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAC;QACjD,OAAO,CA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EjJ,IAAG,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAC;QAC9B,OAAO,CAAC,KAAK,CAAC,mDAAmD,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAC9F,MAAM,KAAK,CAAC,6DAA6D,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;KACvG;IAED,OAAO,yBAAyB,CAAC;AACnC,CAAC;AAAA,CAAC;AAEF,MAAM,CAAC,OAAO,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;AACnD,MAAM,CAAC,OAAO,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;AACvD,MAAM,CAAC,OAAO,CAAC,qBAAqB,GAAG,qBAAqB,CAAC"} \ No newline at end of file diff --git a/app/kommonitor-script-resources/kommonitor-script-template.ts b/app/kommonitor-script-resources/kommonitor-script-template.ts new file mode 100644 index 000000000..d8e3a3ce2 --- /dev/null +++ b/app/kommonitor-script-resources/kommonitor-script-template.ts @@ -0,0 +1,284 @@ +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// NECESSARY NODE MODULE DEPENDENCIES // // +// // +// SEE MODULE "KmProcessingEngine" for numerous predefined helper methods // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* This constant may be used to perform spatial analysis and geometric operation tasks. +* A full-featured API documentation of Turf.js library can be found at {@link http://turfjs.org/}. +* This template offers several API methods that utilize Turf.js to implement typical geospatial operations. +* If required a user can implement custom functions, in which this constant can be called directly. +* @see {@link http://turfjs.org/} +* @see {@link https://github.com/Turfjs/turf} +* @memberof CONSTANTS +* @constant +*/ +const turf = require('@turf/turf'); + +/** +* This constant may be used to perform statistical computations. +* A full-featured API documentation of JStat.js library can be found at {@link http://jstat.org/}. +* This template offers several API methods that utilize JStst.js to implement typical statistical operations. +* If required a user can implement custom functions, in which this constant can be called directly. +* @see {@link https://github.com/jstat/jstat} +* @see {@link https://jstat.github.io/overview.html} +* @memberof CONSTANTS +* @constant +*/ +const jStat = require('jStat').jStat; + +/** +* Module that contains various helper methods (spatial GIS functions and statistical functions) +* to simplify script writing +*/ +const KmHelper = require("kmhelper"); + + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// CONSTANTS DEFINITION // +// here you may specify custom CONSTANTS used within the script. // // // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** +* This constant specifies allowed values to determine how the aggregation process will deal with indicator values. +* I.e. "SUM" will compute the sum of all affected features, while "AVERAGE" will compute the average of all affected features. +* Note that these values must not be changed by users! +* @type {Array.} +* @memberof CONSTANTS +* @constant +*/ +const aggregationTypeEnum = ["SUM", "AVERAGE"]; + +/** +* via the setting constant {@linkcode aggregationType} the user can decide how the aggregation process will deal with indicator values. +* Any value of {@linkcode aggregationTypeEnum} can be used. If set to an unknown type, then "AVERAGE" is taken as fallback option +* @type {string} +* @memberof CONSTANTS +* @constant +*/ +const aggregationType = "AVERAGE"; + + + +/** +* This method computes the indicator for the specified point in time and target spatial unit. To do this, necessary base indicators and/or georesources as well as variable process properties are defined +* as method parameters that can be used within the method body. +* +* NOTE: The function is async, so users may make use of keyword "await" to wait for results of other async helper API methods. +* (This is necessary when users want to wait for asynchronous method execution such as external API calls in a synchronous program) +* +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit as GeoJSON FeatureCollection object. +* @param {map.>} baseIndicatorsMap - Map containing all indicators, wheres key='meaningful name or id of the indicator' and value='indicator as GeoJSON object' (it contains duplicate entries, one for the indicator name and one for the indicator id) +* @param {map.>} georesourcesMap - Map containing all georesources, wheres key='meaningful name or id of the georesource' and value='georesource as GeoJSON object' (they are used to execute geometric/toptologic computations) (it contains duplicate entries, one for the georesource name and one for the georesource id) +* @param {Array.>} processParameters - an array containing objects representing variable additional process parameters that are required to perform the indicator computation. +* Each entry has properties Object.name and Object.value for name and value of the parameter. +* @returns {FeatureCollection} the computed indicator for submitted {@linkcode targetSpatialUnit_geoJSON} features as GeoJSON FeatureCollection +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndicatorsMap, georesourcesMap, processParameters){ + // compute indicator for targetDate and targetSpatialUnitFeatures + // i.e. then modify the features of targetSpatialUnit_geoJSON and return it + + + return targetSpatialUnit_geoJSON; +}; + +/** +* This method is used to aggregate indicators of a certain spatial unit to the features of a more high-level spatial unit (i.e. aggregate from building blocks to city districts). +* The template contains predefined aggregation logic that makes use of constant {@linkcode aggregationType} to decide how indicator values shall be aggregated. +* The aggrgation internally aggregates features of {@linkcode indicator_geoJSON} to features of {@linkcode targetSpatialUnit_geoJSON} by comparing their geometries. +* Each {@linkcode indicator_geoJSON} feature whose geometry lies within a certain geometry of a {@linkcode targetSpatialUnit_geoJSON} feature will be used to compute the aggregated indicator values. +* The within comparison is executed by method {@linkcode within_usingBBOX}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be aggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter targetSpatialUnit_geoJSON +* @see aggregationType +* @see within_usingBBOX +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the aggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function aggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + if (!aggregationTypeEnum.includes(aggregationType)){ + console.log("Unknown parameter value for 'aggregationType' was specified for aggregation logic. Parameter value was '" + aggregationType + + "'. Allowed values are: " + aggregationTypeEnum); + console.log("Will fallback to using AVERAGE aggregation logic."); + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else if(aggregationType === "SUM"){ + return aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } + else { + return aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON); + } +}; + +/** +* This method is used to disaggregate indicators of a certain spatial unit to the features of a more low-level spatial unit (i.e. disaggregate from city districts to building blocks). +* @todo CURRENTLY THIS METHOD IS NOT USED WITHIN KOMMONITOR PROJECT: THUS IT CONTAINS NO IMPLEMENTATION YET! +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - string target spatial unit features of the target spatial unit, for which the indicator shall be disaggregated to as GeoJSON FeatureCollection +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be disaggregated to the features of parameter targetSpatialUnit_geoJSON +* @returns {FeatureCollection} the features of {@linkcode targetSpatialUnit_geoJSON} which contain the disaggregated indicator values as GeoJSON FeatureCollection. +* @memberof METHODS_TO_IMPLEMENT_OR_OVERWRITE +* @function +*/ +function disaggregateIndicator(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // disaggregate indicator + +}; + + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the AVERAGE indicator value of all affected features. Internally this compares the centroids of each indicator feature to target spatial unit features. +* Also it uses the {@linkcode KmHelper.getAggregationWeight(feature)} method as weight during aggregtion. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_average(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing AVERAGE values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features. Each indicator feature will be weighted by its size (area in squareMeters)."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check to aggregate + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var baseIndicatorTotalWeight = 0; + var featureCounter = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + featureCounter++; + + // only use in aggregation, if the indicator value is not NaN, null or undefined but a "real" numeric number + if(! Number.isNaN(indicatorFeature.properties[targetDate]) && indicatorFeature.properties[targetDate] !== null && indicatorFeature.properties[targetDate] !== undefined){ + // aggregationWeight is either 1 or a custom user-set weight value set within computeIndicator()-method + // it "survives" until this aggregation logic within processing engine + var weight = KmHelper.getAggregationWeight(indicatorFeature); + + // use weight as weight for indicator value + baseIndicatorTotalWeight += weight; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]) * weight; + } + } + } + + // compute average for share + if(baseIndicatorTotalWeight === 0){ + targetFeature.properties[targetDate] = Number.NaN; + } + else { + targetFeature.properties[targetDate] = (targetFeature.properties[targetDate] / baseIndicatorTotalWeight); + } + // KmHelper.log("resulting average value is " + targetFeature.properties[targetDate]); + }); + + KmHelper.log("Aggregation finished"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + +/** +* Aggregate features from {@linkcode indicator_geoJSON} to target features of {@linkcode targetSpatialUnit_geoJSON} +* by computing the SUM indicator value of all affected features. Internally this uses the function {@linkcode within_usingBBOX} +* to determine which features of {@linkcode indicator_geoJSON} can be aggregated to which features of {@linkcode targetSpatialUnit_geoJSON}. +* @param {string} targetDate - string representing the target date for which the indicator shall be computed, following the pattern {@linkcode YYYY-MM-DD}, e.g. {@linkcode 2018-01-01} +* @param {FeatureCollection} targetSpatialUnit_geoJSON - GeoJSON features of the target spatial unit, for which the indicator shall be aggregated to +* @param {FeatureCollection} indicator_geoJSON - GeoJSON features containing the indicator values for a spatial unit that can be aggregated to the features of parameter {@linkcode targetSpatialUnitFeatures} +* @returns {FeatureCollection} a GeoJSON FeatureCollection of all features of the submitted {@linkcode targetSpatialUnit_geoJSON} +* containing the resulting aggregated indicator values as new property according to the submitted {@linkcode targetDate} +* @see {@link within_usingBBOX} +* @memberof API_HELPER_METHODS_GEOMETRIC_OPERATIONS +* @function +*/ +function aggregate_sum(targetDate, targetSpatialUnit_geoJSON, indicator_geoJSON){ + // aggregate indicator + + var indicatorFeatures = indicator_geoJSON.features; + + KmHelper.log("Aggregate indicator for targetDate " + targetDate + " for a total amount of " + targetSpatialUnit_geoJSON.features.length + " target features. Computing SUM values."); + KmHelper.log("Aggregate from a total number of " + indicator_geoJSON.features.length + " baseFeatures"); + KmHelper.log("Aggregating by comparing the centroids of each indicator feature to target spatial unit features."); + + targetDate = KmHelper.getTargetDateWithPropertyPrefix(targetDate); + KmHelper.log('Target Date with prefix: ' + targetDate); + + var totalAggregatedIndicatorFeatures = 0; + + // first replace indicatorFeature geoimetry by their pointOnSurface + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + var centerPoint = KmHelper.pointOnFeature(indicatorFeature); + + indicatorFeature.geometry = centerPoint.geometry; + } + + // spatial within check for aggregation + targetSpatialUnit_geoJSON.features.forEach(function(targetFeature){ + + targetFeature.properties[targetDate] = 0; + var numberOfIndicatorFeaturesWithinTargetFeature = 0; + + for (var index = 0; index < indicatorFeatures.length; index++){ + var indicatorFeature = indicatorFeatures[index]; + if(KmHelper.within(indicatorFeature, targetFeature)){ + // remove from array and decrement index + indicatorFeatures.splice(index, 1); + index--; + numberOfIndicatorFeaturesWithinTargetFeature++; + targetFeature.properties[targetDate] += Number(indicatorFeature.properties[targetDate]); + } + } + totalAggregatedIndicatorFeatures += numberOfIndicatorFeaturesWithinTargetFeature; + }); + + KmHelper.log("Aggregation finished"); + KmHelper.log(totalAggregatedIndicatorFeatures + " features were aggregated to " + targetSpatialUnit_geoJSON.features.length + " targetFeatures"); + + if(indicatorFeatures.length > 0){ + console.error("Spatial Aggregation failed for a total number of " + indicatorFeatures.length); + throw Error("Spatial Aggregation operation failed for a total number of " + indicatorFeatures.length); + } + + return targetSpatialUnit_geoJSON; +}; + +module.exports.computeIndicator = computeIndicator; +module.exports.aggregateIndicator = aggregateIndicator; +module.exports.disaggregateIndicator = disaggregateIndicator; diff --git a/app/util/genericServices/kommonitorBatchUpdateHelperService/kommonitor-batch-update-helper-service.module.js b/app/util/genericServices/kommonitorBatchUpdateHelperService/kommonitor-batch-update-helper-service.module.js index 48cbb33fd..a92368f1c 100644 --- a/app/util/genericServices/kommonitorBatchUpdateHelperService/kommonitor-batch-update-helper-service.module.js +++ b/app/util/genericServices/kommonitorBatchUpdateHelperService/kommonitor-batch-update-helper-service.module.js @@ -1,1275 +1,1094 @@ +"use strict"; angular.module('kommonitorBatchUpdateHelper', ['kommonitorDataExchange', 'kommonitorImporterHelper']); - angular - .module('kommonitorBatchUpdateHelper', []) - .service( - 'kommonitorBatchUpdateHelperService', ['$rootScope', '$timeout', 'kommonitorDataExchangeService', 'kommonitorImporterHelperService', '__env', - function ($rootScope, $timeout, kommonitorDataExchangeService, kommonitorImporterHelperService, __env) { - - let thisService = this; // to enable access to service methods from inside other functions (e. g. $timeout) where 'this' references something else - let timeseriesMappingReference; - - // Maps the values of the "name" property in the converter's parameter array to the property names used in the batch update - // We can't use the parameters array directly because we have to bind angularjs variables to object properties, not array elements - // Used in converterParametersArrayToProperties and converterPropertiesToParametersArray - const converterParametersToPropertiesMapping = { - "CRS": "crs", - "Hausnummer_Spaltenname": "hnrColumnName", - "Strasse_Spaltenname": "streetColumnName", - "Adresse_Spaltenname": "addressColumnName", - "Strasse_Hausnummer_Spaltenname": "streetHnrColumnName", - "X_Koordinatenspalte_Rechtswert": "xCoordColumnName", - "Y_Koordinatenspalte_Hochwert": "yCoordColumnName", - "Postleitzahl_Spaltenname": "plzColumnName", - "Stadt_Spaltenname": "cityColumnName", - "NAMESPACE": "schemaNamespace", - "SCHEMA_LOCATION": "schemaLocation", - "Trennzeichen": "separator", - } - const datasourceParametersToPropertiesMapping = { - "NAME": "name", - "URL": "url", - "payload": "payload" - } - - this.batchUpdate = async function (resourceType, batchList, keepMissingOrNullValueIndicator, keepMissingOrNullValueAttributes) { - - let startBtn = document.getElementById(resourceType + "-batch-update-btn"); - startBtn.innerHTML = "Update wird ausgeführt..."; - startBtn.setAttribute("disabled", "disabled"); - - - // clear result modal - document.getElementById("batch-update-result-table-tbody").innerHTML = ""; - - // create array to store response messages - var responses = []; - - // deep copy batch list - var batchListCopy = []; - for(let i=0; i= 0; i--) { - if (batchList[i].isSelected) - batchList.splice(i, 1); - } - - allRowsSelected = false; // in case it was true - } - - // examples - // mappingTable0 --> 0 - // mappingTable12 --> 12 - // but: 12mappingTable23 --> 12, returns first occurrence of number as index - this.getIndexFromId = function (id) { - var re = /\d+/g; // gets all numbers - var index = id.match(re); - if (index) { - index = index[0]; - } - return index; - } - - - // builds a converter definition with parameters array from the currently selected datasource - // selectedConverter = the currently selected converter in the dropdown - // oldConverter = the converter property from a mapping object. - this.buildConverterDefinition = function (selectedConverter, oldConverter) { - console.log("building converter definition"); - console.log("selected converter: ", selectedConverter); - console.log("old converter: ", oldConverter); - - if (! selectedConverter){ - return oldConverter; - } - - // Remove all properties that are not part of the selected converter. - // This is usually needed when the user switches to a different converter. - let paramNames = selectedConverter.parameters.map(obj => obj.name); - for(var i=oldConverter.parameters.length-1; i>=0; i--) { - if(!paramNames.includes(oldConverter.parameters[i].name)) { - oldConverter.parameters.splice(i, 1); - } - } - - let mimeTypeValue = oldConverter.mimeType ? oldConverter.mimeType : ""; - if (mimeTypeValue == "" && oldConverter.parameters){ - // check for another property already inserted as parameter - for (const parameter of oldConverter.parameters) { - if (parameter.name == "mimeType"){ - mimeTypeValue = parameter.value; - break; - } - } - } - - let encodingValue = oldConverter.encoding ? oldConverter.encoding : ""; - if (encodingValue == "" && oldConverter.parameters){ - // check for another property already inserted as parameter - for (const parameter of oldConverter.parameters) { - if (parameter.name == "encoding"){ - encodingValue = parameter.value; - break; - } - } - } - // set first encoding as fallback option - if(encodingValue == ""){ - encodingValue = selectedConverter.encodings[0]; - } - - var converterDefinition = { - encoding: encodingValue, - mimeType: mimeTypeValue, - name: selectedConverter.name, - parameters: oldConverter.parameters, - schema: undefined - } - - if (selectedConverter.name.includes("WFS_v1")) { - if (oldConverter.schema && oldConverter.schema.length > 0) - converterDefinition.schema = oldConverter.schema; - } - - return converterDefinition; - } - - - // builds a datasource definition with parameters array from the currently selected datasource - // selectedDatasourceType = the currently selected datasource in the dropdown - // oldDataSource = the datasource property from a mapping object. - this.buildDataSourceDefinition = function (selectedDatasourceType, oldDataSource, includeFileName) { - console.log("in buildDataSourceDefinition"); - console.log("selectedDatasourceType: ", selectedDatasourceType); - console.log("oldDataSource", oldDataSource); - if (! selectedDatasourceType){ - return oldDataSource; - } - - // Remove all properties that are not part of the selected datasource. - // This is usually needed when the user switches to a different datasource. - // let paramNames = selectedDatasourceType.parameters.map(obj => obj.name); - // for(var i=oldDataSource.parameters.length-1; i>=0; i--) { - // if(!paramNames.includes(oldDataSource.parameters[i].name)) { - // oldDataSource.parameters.splice(i, 1); - // } - // } - - var dataSourceDefinition = { - parameters: [], - type: selectedDatasourceType.type - } - - if (dataSourceDefinition.type === "FILE") { - dataSourceDefinition.parameters.push({ - name: "NAME", - value: includeFileName ? oldDataSource.name : "" - }); - } - - if (dataSourceDefinition.type === "HTTP") { - - let urlValue = oldDataSource.URL ? oldDataSource.URL : ""; - if (urlValue == "" && oldDataSource.parameters){ - // check for another property already inserted as parameter - for (const parameter of oldDataSource.parameters) { - if (parameter.name == "URL"){ - urlValue = parameter.value; - break; - } - } - } - - dataSourceDefinition.parameters.push({ - name: "URL", - value: urlValue - }); - } - - if (dataSourceDefinition.type === "INLINE") { - - let payloadValue = oldDataSource.payload ? oldDataSource.payload : ""; - if (payloadValue == "" && oldDataSource.parameters){ - // check for another property already inserted as parameter - for (const parameter of oldDataSource.parameters) { - if (parameter.name == "payload"){ - payloadValue = parameter.value; - break; - } - } - } - - dataSourceDefinition.parameters.push({ - name: "payload", - value: payloadValue - }); - } - - return dataSourceDefinition; - } - - // We need properties to bind model variables to them. - // Binding to unnamed objects in an array tricky (using the index is not reliable) - // It also creates other problems - this.converterParametersArrayToProperties = function (converter) { - var result = $.extend(true, {}, converter); - var array = converter.parameters; - // for each array element add a new property - for (var i = 0; i < array.length; i++) { - var paramName = array[i].name; - var propName = converterParametersToPropertiesMapping[paramName]; - var paramValue = array[i].value; - result[propName] = paramValue; - } - delete result.parameters; - return result; - } - - // This reverses the result of the method converterParametersArrayToProperties - this.converterPropertiesToParametersArray = function (converter) { - var result = $.extend(true, {}, converter); - result.parameters = []; - - for(const [prop, value] of Object.entries(result)) { - // If prop is in mapping table - Object.keys(converterParametersToPropertiesMapping).forEach(function(key) { - if (converterParametersToPropertiesMapping[key] == prop) { - result.parameters.push({ - name: key, - value: value - }); - delete result[prop]; - } - }); - } - return result; - } - - // We need properties to bind model variables to them. - // Binding to unnamed objects in an array is tricky (using the index is not reliable) - // It also creates other problems - this.dataSourceParametersArrayToProperty = function (dataSource) { - if(dataSource) { - var result = $.extend(true, {}, dataSource); - var array = dataSource.parameters; - // only one datasource can be selected for each row, so the array has to be of length one - var paramName = array[0].name; - var paramValue = array[0].value; - result[paramName] = paramValue; - delete result.parameters; - return result; - } - } - - // This reverses the result of the method dataSourceParametersArrayToProperty - this.dataSourcePropertyToParametersArray = function (dataSource) { - if (dataSource) { - var result = $.extend(true, {}, dataSource); - result.parameters = []; - - for(const [prop, value] of Object.entries(result)) { - // If prop is in mapping table - Object.keys(datasourceParametersToPropertiesMapping).forEach(function(key) { - if (datasourceParametersToPropertiesMapping[key] == prop) { - result.parameters.push({ - name: key, - value: value - }); - delete result[prop]; - } - }); - } - return result; - } - } - - - // helper function to get a converter object by full name. - // returns null if no converter was found - this.getConverterObjectByName = function (name) { - if(kommonitorImporterHelperService.availableConverters) { - for (const converter of kommonitorImporterHelperService.availableConverters) { - if (converter.name === name) { - return converter; - } - } - } - return null; - } - - - // helper function to get a datasourceType object by type. - // returns null if no datasourceType was found - this.getDatasourceTypeObjectByType = function (type) { - for (const datasourceType of kommonitorImporterHelperService.availableDatasourceTypes) { - if (datasourceType.type === type) { - return datasourceType; - } - } - return null; - } - - - // helper function to get a spatial unit object by full name. - // returns null if no spatial unit was found - this.getSpatialUnitObjectByName = function (name) { - for (const spatialUnit of kommonitorDataExchangeService.availableSpatialUnits) { - if (spatialUnit.spatialUnitLevel === name) { - return spatialUnit; - } - } - return null; - } - - this.createAttributeMappingsObject = function(row) { - var attributeMapping = []; - for (let i = 0; i < row.mappingObj.propertyMapping.attributes.length; i++) { - let attribute = row.mappingObj.propertyMapping.attributes[i]; - var tmpEntry = { - "sourceName": attribute.name, - "destinationName": attribute.mappingName - }; - - for (const dataType of kommonitorImporterHelperService.attributeMapping_attributeTypes) { - if (dataType.apiName === attribute.type) { - tmpEntry.dataType = dataType; - } - } - - attributeMapping.push(tmpEntry); - } - - return attributeMapping; - } - - this.uploadFileToImporter = async function(datasourceFileInputId) { - - // this should be defined since the update is only possible if a file was manually selected - var file = $("#" + datasourceFileInputId).get(0).files[0]; - - if(file === null || file === undefined) { - throw new Error("File was not defined. Did not start upload to importer.") - } - - // upload file to importer - var fileUploadName; - try { - fileUploadName = await kommonitorImporterHelperService.uploadNewFile(file, file.name); - } catch (error) { - throw error; - } - - return fileUploadName; - }; - - // loop through batch list and check if condition is true for at least one row - this.checkIfMappingTableIsSpecified = function(batchList) { - let mappingTableIsSpecified = false; - for(let i=0; i 0) { - if (converterName.includes("WFS_v1")) { - selectedConverterIsWfsV1 = true; - break; - } - } - } - } - return selectedConverterIsWfsV1; - } - - - // loop through batch list and check if condition is true for at least one row - this.checkIfSelectedDatasourceTypeIsFile = function(batchList) { - let selectedDatasourceTypeIsFile = false; - for (let i=0; i 0) { - if (datasourceType == "FILE") { - selectedDatasourceTypeIsFile = true; - break; - } - } - } - } - return selectedDatasourceTypeIsFile; - } - - - // loop through batch list and check if condition is true for at least one row - this.checkIfSelectedDatasourceTypeIsHttp = function(batchList) { - let selectedDatasourceTypeIsHttp = false; - for (let i=0; i 0) { - if (datasourceType == "HTTP") { - selectedDatasourceTypeIsHttp = true; - break; - } - } - } - } - return selectedDatasourceTypeIsHttp; - } - - - // loop through batch list and check if condition is true for at least one row - this.checkIfSelectedDatasourceTypeIsInline = function(batchList) { - let selectedDatasourceTypeIsInline = false; - for (let i=0; i 0) { - if (datasourceType == "INLINE") { - selectedDatasourceTypeIsInline = true; - break; - } - } - } - } - return selectedDatasourceTypeIsInline; - } - - - this.checkIfNameAndFilesChosenInEachRow = function(resourceType, batchList) { - - let updateBtn = document.getElementById(resourceType + "-batch-update-btn"); - updateBtn.title = "Update starten" // default title, might get overwritten later - - if(batchList.length == 0) { - updateBtn.title = "Die Batch-Liste is leer." - return false; - } - - for(let i=0; i 0) { - - if (datasourceType == "FILE") { - if(!dataSource.name) { - updateBtn.title = "Die Spalte Datei* ist nicht für alle Zeilen gesetzt, in denen die Spalte Datenquelltyp* auf FILE gesetzt ist." - return false; - } else { - if(dataSource.name == undefined || dataSource.name == "") { - updateBtn.title = "Die Spalte Datei* ist nicht für alle Zeilen gesetzt, in denen die Spalte Datenquelltyp* auf FILE gesetzt ist." - return false; - } - } - } - - if (datasourceType == "HTTP") { - if(!dataSource.URL) { - // property does not exist until user uses the input field for the first time - updateBtn.title = "Die Spalte URL* ist nicht für alle Zeilen gesetzt, in denen die Spalte Datenquelltyp* auf HTTP gesetzt ist." - return false; - } else { - // the field could still be empty (if it had input before) - if(dataSource.URL == undefined || dataSource.URL == "") { - updateBtn.title = "Die Spalte URL* ist nicht für alle Zeilen gesetzt, in denen die Spalte Datenquelltyp* auf HTTP gesetzt ist." - return false; - } - } - } - - if (datasourceType == "INLINE") { - if(!dataSource.payload) { - // property does not exist until user uses the input field for the first time - updateBtn.title = "Die Spalte Payload* ist nicht für alle Zeilen gesetzt, in denen die Spalte Datenquelltyp* auf INLINE gesetzt ist." - return false; - } else { - // the field could still be empty (if it had input before) - if(dataSource.payload == undefined || dataSource.payload == "") { - updateBtn.title = "Die Spalte Payload* ist nicht für alle Zeilen gesetzt, in denen die Spalte Datenquelltyp* auf INLINE gesetzt ist." - return false; - } - } - } - } - } else { - updateBtn.title = "Die Spalte Datenquelltyp* ist nicht für alle Zeilen gesetzt." - return false; - } - - - if (!batchList[i].selectedConverter) { - if(resourceType === "georesource") - updateBtn.title = "Die Spalte Geodaten-Quellformat* ist nicht für alle Zeilen gesetzt." - else - updateBtn.title = "Die Spalte Datensatz-Quellformat* ist nicht für alle Zeilen gesetzt." // for indicators - - return false; - } - } - - return true; - } - - - this.onDataSourceFileSelected = function(file, rowIndex, batchList) { - // set filename manually - let name = file.name; - $timeout(function() { - let dataSource = batchList[rowIndex].mappingObj.dataSource; - dataSource.parameters = []; - dataSource.name = name - batchList[rowIndex].mappingObj.dataSource = dataSource; - }); - } - - - this.onMappingTableSelected = function(resourceType, event, rowIndex, file, batchList) { - - let mappingObj = JSON.parse(event.target.result); - - batchList[rowIndex].mappingTableName = file.name; - - mappingObj.converter = this.converterParametersArrayToProperties(mappingObj.converter); - mappingObj.dataSource = this.dataSourceParametersArrayToProperty(mappingObj.dataSource); - - // set value of column "Datensatz-Quellformat*" by converter name - let converterName = mappingObj.converter.name - for(let i=0; i 0)) { - let fields = angular.element('[ng-model="' + resourceType + '.' + selectedCol + '"]'); - for(let i=0; i 0) { - // Only add if name isn't added already - if( !result.includes(converterName) ) { - result.push(converterName) - } - } - } - } - return result; - } - - // the variable availableGeoresources / availableIndicators (which is used to fill the ng-options) - // changes after each update, causing angularjs to loose the connection. - // this function restores the names - this.refreshNameColumn = function(resourceType, batchList) { - for(let i=0;i= 0; i--) { + if (batchList[i].isSelected) + batchList.splice(i, 1); + } + allRowsSelected = false; // in case it was true + }; + // examples + // mappingTable0 --> 0 + // mappingTable12 --> 12 + // but: 12mappingTable23 --> 12, returns first occurrence of number as index + this.getIndexFromId = function (id) { + var re = /\d+/g; // gets all numbers + var index = id.match(re); + if (index) { + index = index[0]; + } + return index; + }; + // builds a converter definition with parameters array from the currently selected datasource + // selectedConverter = the currently selected converter in the dropdown + // oldConverter = the converter property from a mapping object. + this.buildConverterDefinition = function (selectedConverter, oldConverter) { + console.log("building converter definition"); + console.log("selected converter: ", selectedConverter); + console.log("old converter: ", oldConverter); + if (!selectedConverter) { + return oldConverter; + } + // Remove all properties that are not part of the selected converter. + // This is usually needed when the user switches to a different converter. + let paramNames = selectedConverter.parameters.map(obj => obj.name); + for (var i = oldConverter.parameters.length - 1; i >= 0; i--) { + if (!paramNames.includes(oldConverter.parameters[i].name)) { + oldConverter.parameters.splice(i, 1); + } + } + let mimeTypeValue = oldConverter.mimeType ? oldConverter.mimeType : ""; + if (mimeTypeValue == "" && oldConverter.parameters) { + // check for another property already inserted as parameter + for (const parameter of oldConverter.parameters) { + if (parameter.name == "mimeType") { + mimeTypeValue = parameter.value; + break; + } + } + } + let encodingValue = oldConverter.encoding ? oldConverter.encoding : ""; + if (encodingValue == "" && oldConverter.parameters) { + // check for another property already inserted as parameter + for (const parameter of oldConverter.parameters) { + if (parameter.name == "encoding") { + encodingValue = parameter.value; + break; + } + } + } + // set first encoding as fallback option + if (encodingValue == "") { + encodingValue = selectedConverter.encodings[0]; + } + var converterDefinition = { + encoding: encodingValue, + mimeType: mimeTypeValue, + name: selectedConverter.name, + parameters: oldConverter.parameters, + schema: undefined + }; + if (selectedConverter.name.includes("WFS_v1")) { + if (oldConverter.schema && oldConverter.schema.length > 0) + converterDefinition.schema = oldConverter.schema; + } + return converterDefinition; + }; + // builds a datasource definition with parameters array from the currently selected datasource + // selectedDatasourceType = the currently selected datasource in the dropdown + // oldDataSource = the datasource property from a mapping object. + this.buildDataSourceDefinition = function (selectedDatasourceType, oldDataSource, includeFileName) { + console.log("in buildDataSourceDefinition"); + console.log("selectedDatasourceType: ", selectedDatasourceType); + console.log("oldDataSource", oldDataSource); + if (!selectedDatasourceType) { + return oldDataSource; + } + // Remove all properties that are not part of the selected datasource. + // This is usually needed when the user switches to a different datasource. + // let paramNames = selectedDatasourceType.parameters.map(obj => obj.name); + // for(var i=oldDataSource.parameters.length-1; i>=0; i--) { + // if(!paramNames.includes(oldDataSource.parameters[i].name)) { + // oldDataSource.parameters.splice(i, 1); + // } + // } + var dataSourceDefinition = { + parameters: [], + type: selectedDatasourceType.type + }; + if (dataSourceDefinition.type === "FILE") { + dataSourceDefinition.parameters.push({ + name: "NAME", + value: includeFileName ? oldDataSource.name : "" + }); + } + if (dataSourceDefinition.type === "HTTP") { + let urlValue = oldDataSource.URL ? oldDataSource.URL : ""; + if (urlValue == "" && oldDataSource.parameters) { + // check for another property already inserted as parameter + for (const parameter of oldDataSource.parameters) { + if (parameter.name == "URL") { + urlValue = parameter.value; + break; + } + } + } + dataSourceDefinition.parameters.push({ + name: "URL", + value: urlValue + }); + } + if (dataSourceDefinition.type === "INLINE") { + let payloadValue = oldDataSource.payload ? oldDataSource.payload : ""; + if (payloadValue == "" && oldDataSource.parameters) { + // check for another property already inserted as parameter + for (const parameter of oldDataSource.parameters) { + if (parameter.name == "payload") { + payloadValue = parameter.value; + break; + } + } + } + dataSourceDefinition.parameters.push({ + name: "payload", + value: payloadValue + }); + } + return dataSourceDefinition; + }; + // We need properties to bind model variables to them. + // Binding to unnamed objects in an array tricky (using the index is not reliable) + // It also creates other problems + this.converterParametersArrayToProperties = function (converter) { + var result = $.extend(true, {}, converter); + var array = converter.parameters; + // for each array element add a new property + for (var i = 0; i < array.length; i++) { + var paramName = array[i].name; + var propName = converterParametersToPropertiesMapping[paramName]; + var paramValue = array[i].value; + result[propName] = paramValue; + } + delete result.parameters; + return result; + }; + // This reverses the result of the method converterParametersArrayToProperties + this.converterPropertiesToParametersArray = function (converter) { + var result = $.extend(true, {}, converter); + result.parameters = []; + for (const [prop, value] of Object.entries(result)) { + // If prop is in mapping table + Object.keys(converterParametersToPropertiesMapping).forEach(function (key) { + if (converterParametersToPropertiesMapping[key] == prop) { + result.parameters.push({ + name: key, + value: value + }); + delete result[prop]; + } + }); + } + return result; + }; + // We need properties to bind model variables to them. + // Binding to unnamed objects in an array is tricky (using the index is not reliable) + // It also creates other problems + this.dataSourceParametersArrayToProperty = function (dataSource) { + if (dataSource) { + var result = $.extend(true, {}, dataSource); + var array = dataSource.parameters; + // only one datasource can be selected for each row, so the array has to be of length one + var paramName = array[0].name; + var paramValue = array[0].value; + result[paramName] = paramValue; + delete result.parameters; + return result; + } + }; + // This reverses the result of the method dataSourceParametersArrayToProperty + this.dataSourcePropertyToParametersArray = function (dataSource) { + if (dataSource) { + var result = $.extend(true, {}, dataSource); + result.parameters = []; + for (const [prop, value] of Object.entries(result)) { + // If prop is in mapping table + Object.keys(datasourceParametersToPropertiesMapping).forEach(function (key) { + if (datasourceParametersToPropertiesMapping[key] == prop) { + result.parameters.push({ + name: key, + value: value + }); + delete result[prop]; + } + }); + } + return result; + } + }; + // helper function to get a converter object by full name. + // returns null if no converter was found + this.getConverterObjectByName = function (name) { + if (kommonitorImporterHelperService.availableConverters) { + for (const converter of kommonitorImporterHelperService.availableConverters) { + if (converter.name === name) { + return converter; + } + } + } + return null; + }; + // helper function to get a datasourceType object by type. + // returns null if no datasourceType was found + this.getDatasourceTypeObjectByType = function (type) { + for (const datasourceType of kommonitorImporterHelperService.availableDatasourceTypes) { + if (datasourceType.type === type) { + return datasourceType; + } + } + return null; + }; + // helper function to get a spatial unit object by full name. + // returns null if no spatial unit was found + this.getSpatialUnitObjectByName = function (name) { + for (const spatialUnit of kommonitorDataExchangeService.availableSpatialUnits) { + if (spatialUnit.spatialUnitLevel === name) { + return spatialUnit; + } + } + return null; + }; + this.createAttributeMappingsObject = function (row) { + var attributeMapping = []; + for (let i = 0; i < row.mappingObj.propertyMapping.attributes.length; i++) { + let attribute = row.mappingObj.propertyMapping.attributes[i]; + var tmpEntry = { + "sourceName": attribute.name, + "destinationName": attribute.mappingName + }; + for (const dataType of kommonitorImporterHelperService.attributeMapping_attributeTypes) { + if (dataType.apiName === attribute.type) { + tmpEntry.dataType = dataType; + } + } + attributeMapping.push(tmpEntry); + } + return attributeMapping; + }; + this.uploadFileToImporter = async function (datasourceFileInputId) { + // this should be defined since the update is only possible if a file was manually selected + var file = $("#" + datasourceFileInputId).get(0).files[0]; + if (file === null || file === undefined) { + throw new Error("File was not defined. Did not start upload to importer."); + } + // upload file to importer + var fileUploadName; + try { + fileUploadName = await kommonitorImporterHelperService.uploadNewFile(file, file.name); + } + catch (error) { + throw error; + } + return fileUploadName; + }; + // loop through batch list and check if condition is true for at least one row + this.checkIfMappingTableIsSpecified = function (batchList) { + let mappingTableIsSpecified = false; + for (let i = 0; i < batchList.length; i++) { + if (batchList[i].mappingTableName != "") { + mappingTableIsSpecified = true; + break; + } + } + return mappingTableIsSpecified; + }; + // Generic function to check which columns have to be shown depending on the selected converter. + // Returns a boolean + // loop through batch list and check if condition is true for at least one row + this.checkIfSelectedConverterIsWfsV1 = function (batchList) { + let selectedConverterIsWfsV1 = false; + for (let i = 0; i < batchList.length; i++) { + console.log(batchList[i]); + if (batchList[i].selectedConverter) { + let converterName = batchList[i].selectedConverter.name; + if (converterName != undefined && converterName.length > 0) { + if (converterName.includes("WFS_v1")) { + selectedConverterIsWfsV1 = true; + break; + } + } + } + } + return selectedConverterIsWfsV1; + }; + // loop through batch list and check if condition is true for at least one row + this.checkIfSelectedDatasourceTypeIsFile = function (batchList) { + let selectedDatasourceTypeIsFile = false; + for (let i = 0; i < batchList.length; i++) { + if (batchList[i].selectedDatasourceType) { + let datasourceType = batchList[i].selectedDatasourceType.type; + if (datasourceType != undefined && datasourceType.length > 0) { + if (datasourceType == "FILE") { + selectedDatasourceTypeIsFile = true; + break; + } + } + } + } + return selectedDatasourceTypeIsFile; + }; + // loop through batch list and check if condition is true for at least one row + this.checkIfSelectedDatasourceTypeIsHttp = function (batchList) { + let selectedDatasourceTypeIsHttp = false; + for (let i = 0; i < batchList.length; i++) { + if (batchList[i].selectedDatasourceType) { + let datasourceType = batchList[i].selectedDatasourceType.type; + if (datasourceType != undefined && datasourceType.length > 0) { + if (datasourceType == "HTTP") { + selectedDatasourceTypeIsHttp = true; + break; + } + } + } + } + return selectedDatasourceTypeIsHttp; + }; + // loop through batch list and check if condition is true for at least one row + this.checkIfSelectedDatasourceTypeIsInline = function (batchList) { + let selectedDatasourceTypeIsInline = false; + for (let i = 0; i < batchList.length; i++) { + if (batchList[i].selectedDatasourceType) { + let datasourceType = batchList[i].selectedDatasourceType.type; + if (datasourceType != undefined && datasourceType.length > 0) { + if (datasourceType == "INLINE") { + selectedDatasourceTypeIsInline = true; + break; + } + } + } + } + return selectedDatasourceTypeIsInline; + }; + this.checkIfNameAndFilesChosenInEachRow = function (resourceType, batchList) { + let updateBtn = document.getElementById(resourceType + "-batch-update-btn"); + updateBtn.title = "Update starten"; // default title, might get overwritten later + if (batchList.length == 0) { + updateBtn.title = "Die Batch-Liste is leer."; + return false; + } + for (let i = 0; i < batchList.length; i++) { + if (batchList[i].name == undefined || batchList[i].name == "") { + updateBtn.title = "Die Spalte Name* ist nicht für alle Zeilen gesetzt."; + return false; + } + if (batchList[i].selectedDatasourceType) { + let datasourceType = batchList[i].selectedDatasourceType.type; + let dataSource = batchList[i].mappingObj.dataSource; + if (datasourceType != undefined && datasourceType.length > 0) { + if (datasourceType == "FILE") { + if (!dataSource.name) { + updateBtn.title = "Die Spalte Datei* ist nicht für alle Zeilen gesetzt, in denen die Spalte Datenquelltyp* auf FILE gesetzt ist."; + return false; + } + else { + if (dataSource.name == undefined || dataSource.name == "") { + updateBtn.title = "Die Spalte Datei* ist nicht für alle Zeilen gesetzt, in denen die Spalte Datenquelltyp* auf FILE gesetzt ist."; + return false; + } + } + } + if (datasourceType == "HTTP") { + if (!dataSource.URL) { + // property does not exist until user uses the input field for the first time + updateBtn.title = "Die Spalte URL* ist nicht für alle Zeilen gesetzt, in denen die Spalte Datenquelltyp* auf HTTP gesetzt ist."; + return false; + } + else { + // the field could still be empty (if it had input before) + if (dataSource.URL == undefined || dataSource.URL == "") { + updateBtn.title = "Die Spalte URL* ist nicht für alle Zeilen gesetzt, in denen die Spalte Datenquelltyp* auf HTTP gesetzt ist."; + return false; + } + } + } + if (datasourceType == "INLINE") { + if (!dataSource.payload) { + // property does not exist until user uses the input field for the first time + updateBtn.title = "Die Spalte Payload* ist nicht für alle Zeilen gesetzt, in denen die Spalte Datenquelltyp* auf INLINE gesetzt ist."; + return false; + } + else { + // the field could still be empty (if it had input before) + if (dataSource.payload == undefined || dataSource.payload == "") { + updateBtn.title = "Die Spalte Payload* ist nicht für alle Zeilen gesetzt, in denen die Spalte Datenquelltyp* auf INLINE gesetzt ist."; + return false; + } + } + } + } + } + else { + updateBtn.title = "Die Spalte Datenquelltyp* ist nicht für alle Zeilen gesetzt."; + return false; + } + if (!batchList[i].selectedConverter) { + if (resourceType === "georesource") + updateBtn.title = "Die Spalte Geodaten-Quellformat* ist nicht für alle Zeilen gesetzt."; + else + updateBtn.title = "Die Spalte Datensatz-Quellformat* ist nicht für alle Zeilen gesetzt."; // for indicators + return false; + } + } + return true; + }; + this.onDataSourceFileSelected = function (file, rowIndex, batchList) { + // set filename manually + let name = file.name; + $timeout(function () { + let dataSource = batchList[rowIndex].mappingObj.dataSource; + dataSource.parameters = []; + dataSource.name = name; + batchList[rowIndex].mappingObj.dataSource = dataSource; + }); + }; + this.onMappingTableSelected = function (resourceType, event, rowIndex, file, batchList) { + let mappingObj = JSON.parse(event.target.result); + batchList[rowIndex].mappingTableName = file.name; + mappingObj.converter = this.converterParametersArrayToProperties(mappingObj.converter); + mappingObj.dataSource = this.dataSourceParametersArrayToProperty(mappingObj.dataSource); + // set value of column "Datensatz-Quellformat*" by converter name + let converterName = mappingObj.converter.name; + for (let i = 0; i < kommonitorImporterHelperService.availableConverters.length; i++) { + let avConverterName = kommonitorImporterHelperService.availableConverters[i].name; + if (converterName == avConverterName) { + $timeout(function () { + batchList[rowIndex].selectedConverter = kommonitorImporterHelperService.availableConverters[i]; + }); + break; + } + } + // set value of column "Datenquelltyp*" by dataSource type + if (mappingObj.dataSource) { + let dataSourceType = mappingObj.dataSource.type; + for (let i = 0; i < kommonitorImporterHelperService.availableDatasourceTypes.length; i++) { + let avDataSourceType = kommonitorImporterHelperService.availableDatasourceTypes[i].type; + if (dataSourceType == avDataSourceType) { + $timeout(function () { + batchList[rowIndex].selectedDatasourceType = kommonitorImporterHelperService.availableDatasourceTypes[i]; + }); + break; + } + } + } + if (resourceType === "indicator") { + // set value of column "Ziel-Raumebene*" by target spatial unit name + let targetSpatialUnitName = mappingObj.targetSpatialUnitName; + let spatialUnitObject = this.getSpatialUnitObjectByName(targetSpatialUnitName); + $timeout(function () { + batchList[rowIndex].selectedTargetSpatialUnit = spatialUnitObject; + }); + } + // do not import file name + if (mappingObj.dataSource) { + if (mappingObj.dataSource.type == "FILE") { + mappingObj.dataSource.name = ""; + } + } + //apply to scope + $timeout(function () { + batchList[rowIndex].mappingObj = mappingObj; + if (resourceType === "georesource") + thisService.initializeGeoresourceDatepickerFields(batchList); + }); + }; + this.onClickSaveColDefaultValue = function (resourceType, selectedCol, newValue, replaceAll, batchList) { + // differentiate between timeseries mapping and other columns + if (selectedCol == "mappingObj.propertyMapping.timeseriesMappings") { + // new value is undefined for timeseries mapping. + // instead we get the new mapping from the variable + if (typeof (newValue == "undefined")) { + let btns = angular.element($('.indicatorTimeseriesMappingBtn')); + for (let i = 0; i < batchList.length; i++) { + // never change disabled fields + let btn = btns.get(i); + if (btn.getAttribute('disabled')) + continue; + timeseriesMappingReference = angular.fromJson(angular.toJson(timeseriesMappingReference)); + let oldMapping = batchList[i].mappingObj.propertyMapping.timeseriesMappings; + // iterate timeseriesMappingReference + for (let j = 0; j < timeseriesMappingReference.length; j++) { + let exists = false; + // for each entry check if it exists in oldMapping + for (let k = 0; k < oldMapping.length; k++) { + // check if indicatorValueProperty value property is the same + if (oldMapping[k].indicatorValueProperty == timeseriesMappingReference[j].indicatorValueProperty) { + exists = true; + if (replaceAll) + batchList[i].mappingObj.propertyMapping.timeseriesMappings[j] = timeseriesMappingReference[j]; + } + } + if (!exists) { + // add mapping + batchList[i].mappingObj.propertyMapping.timeseriesMappings.push(timeseriesMappingReference[j]); + } + } + } + } + } + else { + if (typeof (newValue != "undefined")) { + if (typeof (newValue === "object") || (typeof (newValue) === "string" && newValue.length > 0)) { + let fields = angular.element('[ng-model="' + resourceType + '.' + selectedCol + '"]'); + for (let i = 0; i < batchList.length; i++) { + // never change disabled fields + let field = fields.get(i); + if (field.getAttribute('disabled')) + continue; + if (replaceAll) { + // if checkbox is true update all rows + set(batchList[i], selectedCol, newValue); + } + else { + // else only update empty rows + if (get(batchList[i], selectedCol) == undefined || get(batchList[i], selectedCol) == "") + set(batchList[i], selectedCol, newValue); + } + } + } + } + } + // helper function to get nested properties where the path is variable + function get(obj, path) { + var schema = obj; // a moving reference to internal objects within obj + var pList = path.split('.'); + var len = pList.length; + for (var i = 0; i < len - 1; i++) { + var elem = pList[i]; + if (!schema[elem]) + schema[elem] = {}; + schema = schema[elem]; + } + return schema[pList[len - 1]]; + } + ; + // helper function to set nested properties where the path is variable + function set(obj, path, value) { + var schema = obj; // a moving reference to internal objects within obj + var pList = path.split('.'); + var len = pList.length; + for (var i = 0; i < len - 1; i++) { + var elem = pList[i]; + if (!schema[elem]) + schema[elem] = {}; + schema = schema[elem]; + } + schema[pList[len - 1]] = value; + } + ; + }; + this.initializeGeoresourceDatepickerFields = function (batchList) { + $timeout(function () { + for (let i = 0; i < batchList.length; i++) { + $('#georesourcePeriodOfValidityStartDatePicker' + i).datepicker(kommonitorDataExchangeService.datePickerOptions); + $('#georesourcePeriodOfValidityEndDatePicker' + i).datepicker(kommonitorDataExchangeService.datePickerOptions); + } + ; + }, 200); + }; + // Generic function to check which columns have to be shown depending on the selected converter. + // Returns an array of the selected converter names + this.checkColumnsToShow_selectedConverter = function (batchList) { + let result = []; + // We have to check the whole batch list. + // If only one row has a spscific converter selected, we have to show the corresponding collumns + for (let i = 0; i < batchList.length; i++) { + if (batchList[i].selectedConverter) { + let converterName = batchList[i].selectedConverter.name; + if (converterName != undefined && converterName.length > 0) { + // Only add if name isn't added already + if (!result.includes(converterName)) { + result.push(converterName); + } + } + } + } + return result; + }; + // the variable availableGeoresources / availableIndicators (which is used to fill the ng-options) + // changes after each update, causing angularjs to loose the connection. + // this function restores the names + this.refreshNameColumn = function (resourceType, batchList) { + for (let i = 0; i < batchList.length; i++) { + let row = batchList[i]; + if (row.tempResourceId) { + let resource; + if (resourceType === "georesource") + resource = kommonitorDataExchangeService.getGeoresourceMetadataById(row.tempResourceId); + if (resourceType === "indicator") + resource = kommonitorDataExchangeService.getIndicatorMetadataById(row.tempResourceId); + row.name = resource; + } + } + }; + this.resizeNameColumnDropdowns = function (resource) { + $timeout(function () { + let inputs = $('.ui-select-toggle'); + for (let input of inputs) { + input = $(input); + input.css("background-color", "white"); + input.css("border", "none"); + input.css("width", '100%'); + } + }, 500); + }; + $rootScope.$on("timeseriesMappingChanged", function (event, data) { + timeseriesMappingReference = data.mapping; + }); + } +]); +//# sourceMappingURL=kommonitor-batch-update-helper-service.module.js.map \ No newline at end of file diff --git a/app/util/genericServices/kommonitorBatchUpdateHelperService/kommonitor-batch-update-helper-service.module.js.map b/app/util/genericServices/kommonitorBatchUpdateHelperService/kommonitor-batch-update-helper-service.module.js.map new file mode 100644 index 000000000..d94d0b9a2 --- /dev/null +++ b/app/util/genericServices/kommonitorBatchUpdateHelperService/kommonitor-batch-update-helper-service.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-batch-update-helper-service.module.js","sourceRoot":"","sources":["kommonitor-batch-update-helper-service.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,6BAA6B,EAAE,CAAC,wBAAwB,EAAE,0BAA0B,CAAC,CAAC,CAAC;AAEtG,OAAO;KACL,MAAM,CAAC,6BAA6B,EAAE,EAAE,CAAC;KACzC,OAAO,CACP,oCAAoC,EAAE,CAAC,YAAY,EAAE,UAAU,EAAE,+BAA+B,EAAE,iCAAiC,EAAE,OAAO;IAC3I,UAAU,UAAU,EAAE,QAAQ,EAAE,6BAA6B,EAAE,+BAA+B,EAAE,KAAK;QAEpG,IAAI,WAAW,GAAG,IAAI,CAAC,CAAC,0HAA0H;QAClJ,IAAI,0BAA0B,CAAC;QAE/B,2HAA2H;QAC3H,kIAAkI;QAClI,yFAAyF;QACzF,MAAM,sCAAsC,GAAG;YAC9C,KAAK,EAAE,KAAK;YACZ,wBAAwB,EAAE,eAAe;YACzC,qBAAqB,EAAE,kBAAkB;YACzC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AG,6BAA6B,CAAC,wBAAwB,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;oBAEvF,GAAG,CAAC,IAAI,GAAG,QAAQ,CAAC;iBACpB;aACD;QACF,CAAC,CAAA;QAGD,IAAI,CAAC,yBAAyB,GAAG,UAAS,QAAQ;YACjD,QAAQ,CAAC;gBACR,IAAI,MAAM,GAAG,CAAC,CAAC,mBAAmB,CAAC,CAAC;gBAEpC,KAAI,IAAI,KAAK,IAAI,MAAM,EAAE;oBACxB,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;oBACjB,KAAK,CAAC,GAAG,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;oBACvC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;oBAC5B,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;iBAC3B;YACF,CAAC,EAAE,GAAG,CAAC,CAAC;QACT,CAAC,CAAC;QAGF,UAAU,CAAC,GAAG,CAAC,0BAA0B,EAAE,UAAS,KAAK,EAAE,IAAI;YAC9D,0BAA0B,GAAG,IAAI,CAAC,OAAO,CAAC;QAC3C,CAAC,CAAC,CAAC;IAGJ,CAAC;CACD,CAAC,CAAC"} \ No newline at end of file diff --git a/app/util/genericServices/kommonitorBatchUpdateHelperService/kommonitor-batch-update-helper-service.module.ts b/app/util/genericServices/kommonitorBatchUpdateHelperService/kommonitor-batch-update-helper-service.module.ts new file mode 100644 index 000000000..48cbb33fd --- /dev/null +++ b/app/util/genericServices/kommonitorBatchUpdateHelperService/kommonitor-batch-update-helper-service.module.ts @@ -0,0 +1,1275 @@ +angular.module('kommonitorBatchUpdateHelper', ['kommonitorDataExchange', 'kommonitorImporterHelper']); + +angular + .module('kommonitorBatchUpdateHelper', []) + .service( + 'kommonitorBatchUpdateHelperService', ['$rootScope', '$timeout', 'kommonitorDataExchangeService', 'kommonitorImporterHelperService', '__env', + function ($rootScope, $timeout, kommonitorDataExchangeService, kommonitorImporterHelperService, __env) { + + let thisService = this; // to enable access to service methods from inside other functions (e. g. $timeout) where 'this' references something else + let timeseriesMappingReference; + + // Maps the values of the "name" property in the converter's parameter array to the property names used in the batch update + // We can't use the parameters array directly because we have to bind angularjs variables to object properties, not array elements + // Used in converterParametersArrayToProperties and converterPropertiesToParametersArray + const converterParametersToPropertiesMapping = { + "CRS": "crs", + "Hausnummer_Spaltenname": "hnrColumnName", + "Strasse_Spaltenname": "streetColumnName", + "Adresse_Spaltenname": "addressColumnName", + "Strasse_Hausnummer_Spaltenname": "streetHnrColumnName", + "X_Koordinatenspalte_Rechtswert": "xCoordColumnName", + "Y_Koordinatenspalte_Hochwert": "yCoordColumnName", + "Postleitzahl_Spaltenname": "plzColumnName", + "Stadt_Spaltenname": "cityColumnName", + "NAMESPACE": "schemaNamespace", + "SCHEMA_LOCATION": "schemaLocation", + "Trennzeichen": "separator", + } + const datasourceParametersToPropertiesMapping = { + "NAME": "name", + "URL": "url", + "payload": "payload" + } + + this.batchUpdate = async function (resourceType, batchList, keepMissingOrNullValueIndicator, keepMissingOrNullValueAttributes) { + + let startBtn = document.getElementById(resourceType + "-batch-update-btn"); + startBtn.innerHTML = "Update wird ausgeführt..."; + startBtn.setAttribute("disabled", "disabled"); + + + // clear result modal + document.getElementById("batch-update-result-table-tbody").innerHTML = ""; + + // create array to store response messages + var responses = []; + + // deep copy batch list + var batchListCopy = []; + for(let i=0; i= 0; i--) { + if (batchList[i].isSelected) + batchList.splice(i, 1); + } + + allRowsSelected = false; // in case it was true + } + + // examples + // mappingTable0 --> 0 + // mappingTable12 --> 12 + // but: 12mappingTable23 --> 12, returns first occurrence of number as index + this.getIndexFromId = function (id) { + var re = /\d+/g; // gets all numbers + var index = id.match(re); + if (index) { + index = index[0]; + } + return index; + } + + + // builds a converter definition with parameters array from the currently selected datasource + // selectedConverter = the currently selected converter in the dropdown + // oldConverter = the converter property from a mapping object. + this.buildConverterDefinition = function (selectedConverter, oldConverter) { + console.log("building converter definition"); + console.log("selected converter: ", selectedConverter); + console.log("old converter: ", oldConverter); + + if (! selectedConverter){ + return oldConverter; + } + + // Remove all properties that are not part of the selected converter. + // This is usually needed when the user switches to a different converter. + let paramNames = selectedConverter.parameters.map(obj => obj.name); + for(var i=oldConverter.parameters.length-1; i>=0; i--) { + if(!paramNames.includes(oldConverter.parameters[i].name)) { + oldConverter.parameters.splice(i, 1); + } + } + + let mimeTypeValue = oldConverter.mimeType ? oldConverter.mimeType : ""; + if (mimeTypeValue == "" && oldConverter.parameters){ + // check for another property already inserted as parameter + for (const parameter of oldConverter.parameters) { + if (parameter.name == "mimeType"){ + mimeTypeValue = parameter.value; + break; + } + } + } + + let encodingValue = oldConverter.encoding ? oldConverter.encoding : ""; + if (encodingValue == "" && oldConverter.parameters){ + // check for another property already inserted as parameter + for (const parameter of oldConverter.parameters) { + if (parameter.name == "encoding"){ + encodingValue = parameter.value; + break; + } + } + } + // set first encoding as fallback option + if(encodingValue == ""){ + encodingValue = selectedConverter.encodings[0]; + } + + var converterDefinition = { + encoding: encodingValue, + mimeType: mimeTypeValue, + name: selectedConverter.name, + parameters: oldConverter.parameters, + schema: undefined + } + + if (selectedConverter.name.includes("WFS_v1")) { + if (oldConverter.schema && oldConverter.schema.length > 0) + converterDefinition.schema = oldConverter.schema; + } + + return converterDefinition; + } + + + // builds a datasource definition with parameters array from the currently selected datasource + // selectedDatasourceType = the currently selected datasource in the dropdown + // oldDataSource = the datasource property from a mapping object. + this.buildDataSourceDefinition = function (selectedDatasourceType, oldDataSource, includeFileName) { + console.log("in buildDataSourceDefinition"); + console.log("selectedDatasourceType: ", selectedDatasourceType); + console.log("oldDataSource", oldDataSource); + if (! selectedDatasourceType){ + return oldDataSource; + } + + // Remove all properties that are not part of the selected datasource. + // This is usually needed when the user switches to a different datasource. + // let paramNames = selectedDatasourceType.parameters.map(obj => obj.name); + // for(var i=oldDataSource.parameters.length-1; i>=0; i--) { + // if(!paramNames.includes(oldDataSource.parameters[i].name)) { + // oldDataSource.parameters.splice(i, 1); + // } + // } + + var dataSourceDefinition = { + parameters: [], + type: selectedDatasourceType.type + } + + if (dataSourceDefinition.type === "FILE") { + dataSourceDefinition.parameters.push({ + name: "NAME", + value: includeFileName ? oldDataSource.name : "" + }); + } + + if (dataSourceDefinition.type === "HTTP") { + + let urlValue = oldDataSource.URL ? oldDataSource.URL : ""; + if (urlValue == "" && oldDataSource.parameters){ + // check for another property already inserted as parameter + for (const parameter of oldDataSource.parameters) { + if (parameter.name == "URL"){ + urlValue = parameter.value; + break; + } + } + } + + dataSourceDefinition.parameters.push({ + name: "URL", + value: urlValue + }); + } + + if (dataSourceDefinition.type === "INLINE") { + + let payloadValue = oldDataSource.payload ? oldDataSource.payload : ""; + if (payloadValue == "" && oldDataSource.parameters){ + // check for another property already inserted as parameter + for (const parameter of oldDataSource.parameters) { + if (parameter.name == "payload"){ + payloadValue = parameter.value; + break; + } + } + } + + dataSourceDefinition.parameters.push({ + name: "payload", + value: payloadValue + }); + } + + return dataSourceDefinition; + } + + // We need properties to bind model variables to them. + // Binding to unnamed objects in an array tricky (using the index is not reliable) + // It also creates other problems + this.converterParametersArrayToProperties = function (converter) { + var result = $.extend(true, {}, converter); + var array = converter.parameters; + // for each array element add a new property + for (var i = 0; i < array.length; i++) { + var paramName = array[i].name; + var propName = converterParametersToPropertiesMapping[paramName]; + var paramValue = array[i].value; + result[propName] = paramValue; + } + delete result.parameters; + return result; + } + + // This reverses the result of the method converterParametersArrayToProperties + this.converterPropertiesToParametersArray = function (converter) { + var result = $.extend(true, {}, converter); + result.parameters = []; + + for(const [prop, value] of Object.entries(result)) { + // If prop is in mapping table + Object.keys(converterParametersToPropertiesMapping).forEach(function(key) { + if (converterParametersToPropertiesMapping[key] == prop) { + result.parameters.push({ + name: key, + value: value + }); + delete result[prop]; + } + }); + } + return result; + } + + // We need properties to bind model variables to them. + // Binding to unnamed objects in an array is tricky (using the index is not reliable) + // It also creates other problems + this.dataSourceParametersArrayToProperty = function (dataSource) { + if(dataSource) { + var result = $.extend(true, {}, dataSource); + var array = dataSource.parameters; + // only one datasource can be selected for each row, so the array has to be of length one + var paramName = array[0].name; + var paramValue = array[0].value; + result[paramName] = paramValue; + delete result.parameters; + return result; + } + } + + // This reverses the result of the method dataSourceParametersArrayToProperty + this.dataSourcePropertyToParametersArray = function (dataSource) { + if (dataSource) { + var result = $.extend(true, {}, dataSource); + result.parameters = []; + + for(const [prop, value] of Object.entries(result)) { + // If prop is in mapping table + Object.keys(datasourceParametersToPropertiesMapping).forEach(function(key) { + if (datasourceParametersToPropertiesMapping[key] == prop) { + result.parameters.push({ + name: key, + value: value + }); + delete result[prop]; + } + }); + } + return result; + } + } + + + // helper function to get a converter object by full name. + // returns null if no converter was found + this.getConverterObjectByName = function (name) { + if(kommonitorImporterHelperService.availableConverters) { + for (const converter of kommonitorImporterHelperService.availableConverters) { + if (converter.name === name) { + return converter; + } + } + } + return null; + } + + + // helper function to get a datasourceType object by type. + // returns null if no datasourceType was found + this.getDatasourceTypeObjectByType = function (type) { + for (const datasourceType of kommonitorImporterHelperService.availableDatasourceTypes) { + if (datasourceType.type === type) { + return datasourceType; + } + } + return null; + } + + + // helper function to get a spatial unit object by full name. + // returns null if no spatial unit was found + this.getSpatialUnitObjectByName = function (name) { + for (const spatialUnit of kommonitorDataExchangeService.availableSpatialUnits) { + if (spatialUnit.spatialUnitLevel === name) { + return spatialUnit; + } + } + return null; + } + + this.createAttributeMappingsObject = function(row) { + var attributeMapping = []; + for (let i = 0; i < row.mappingObj.propertyMapping.attributes.length; i++) { + let attribute = row.mappingObj.propertyMapping.attributes[i]; + var tmpEntry = { + "sourceName": attribute.name, + "destinationName": attribute.mappingName + }; + + for (const dataType of kommonitorImporterHelperService.attributeMapping_attributeTypes) { + if (dataType.apiName === attribute.type) { + tmpEntry.dataType = dataType; + } + } + + attributeMapping.push(tmpEntry); + } + + return attributeMapping; + } + + this.uploadFileToImporter = async function(datasourceFileInputId) { + + // this should be defined since the update is only possible if a file was manually selected + var file = $("#" + datasourceFileInputId).get(0).files[0]; + + if(file === null || file === undefined) { + throw new Error("File was not defined. Did not start upload to importer.") + } + + // upload file to importer + var fileUploadName; + try { + fileUploadName = await kommonitorImporterHelperService.uploadNewFile(file, file.name); + } catch (error) { + throw error; + } + + return fileUploadName; + }; + + // loop through batch list and check if condition is true for at least one row + this.checkIfMappingTableIsSpecified = function(batchList) { + let mappingTableIsSpecified = false; + for(let i=0; i 0) { + if (converterName.includes("WFS_v1")) { + selectedConverterIsWfsV1 = true; + break; + } + } + } + } + return selectedConverterIsWfsV1; + } + + + // loop through batch list and check if condition is true for at least one row + this.checkIfSelectedDatasourceTypeIsFile = function(batchList) { + let selectedDatasourceTypeIsFile = false; + for (let i=0; i 0) { + if (datasourceType == "FILE") { + selectedDatasourceTypeIsFile = true; + break; + } + } + } + } + return selectedDatasourceTypeIsFile; + } + + + // loop through batch list and check if condition is true for at least one row + this.checkIfSelectedDatasourceTypeIsHttp = function(batchList) { + let selectedDatasourceTypeIsHttp = false; + for (let i=0; i 0) { + if (datasourceType == "HTTP") { + selectedDatasourceTypeIsHttp = true; + break; + } + } + } + } + return selectedDatasourceTypeIsHttp; + } + + + // loop through batch list and check if condition is true for at least one row + this.checkIfSelectedDatasourceTypeIsInline = function(batchList) { + let selectedDatasourceTypeIsInline = false; + for (let i=0; i 0) { + if (datasourceType == "INLINE") { + selectedDatasourceTypeIsInline = true; + break; + } + } + } + } + return selectedDatasourceTypeIsInline; + } + + + this.checkIfNameAndFilesChosenInEachRow = function(resourceType, batchList) { + + let updateBtn = document.getElementById(resourceType + "-batch-update-btn"); + updateBtn.title = "Update starten" // default title, might get overwritten later + + if(batchList.length == 0) { + updateBtn.title = "Die Batch-Liste is leer." + return false; + } + + for(let i=0; i 0) { + + if (datasourceType == "FILE") { + if(!dataSource.name) { + updateBtn.title = "Die Spalte Datei* ist nicht für alle Zeilen gesetzt, in denen die Spalte Datenquelltyp* auf FILE gesetzt ist." + return false; + } else { + if(dataSource.name == undefined || dataSource.name == "") { + updateBtn.title = "Die Spalte Datei* ist nicht für alle Zeilen gesetzt, in denen die Spalte Datenquelltyp* auf FILE gesetzt ist." + return false; + } + } + } + + if (datasourceType == "HTTP") { + if(!dataSource.URL) { + // property does not exist until user uses the input field for the first time + updateBtn.title = "Die Spalte URL* ist nicht für alle Zeilen gesetzt, in denen die Spalte Datenquelltyp* auf HTTP gesetzt ist." + return false; + } else { + // the field could still be empty (if it had input before) + if(dataSource.URL == undefined || dataSource.URL == "") { + updateBtn.title = "Die Spalte URL* ist nicht für alle Zeilen gesetzt, in denen die Spalte Datenquelltyp* auf HTTP gesetzt ist." + return false; + } + } + } + + if (datasourceType == "INLINE") { + if(!dataSource.payload) { + // property does not exist until user uses the input field for the first time + updateBtn.title = "Die Spalte Payload* ist nicht für alle Zeilen gesetzt, in denen die Spalte Datenquelltyp* auf INLINE gesetzt ist." + return false; + } else { + // the field could still be empty (if it had input before) + if(dataSource.payload == undefined || dataSource.payload == "") { + updateBtn.title = "Die Spalte Payload* ist nicht für alle Zeilen gesetzt, in denen die Spalte Datenquelltyp* auf INLINE gesetzt ist." + return false; + } + } + } + } + } else { + updateBtn.title = "Die Spalte Datenquelltyp* ist nicht für alle Zeilen gesetzt." + return false; + } + + + if (!batchList[i].selectedConverter) { + if(resourceType === "georesource") + updateBtn.title = "Die Spalte Geodaten-Quellformat* ist nicht für alle Zeilen gesetzt." + else + updateBtn.title = "Die Spalte Datensatz-Quellformat* ist nicht für alle Zeilen gesetzt." // for indicators + + return false; + } + } + + return true; + } + + + this.onDataSourceFileSelected = function(file, rowIndex, batchList) { + // set filename manually + let name = file.name; + $timeout(function() { + let dataSource = batchList[rowIndex].mappingObj.dataSource; + dataSource.parameters = []; + dataSource.name = name + batchList[rowIndex].mappingObj.dataSource = dataSource; + }); + } + + + this.onMappingTableSelected = function(resourceType, event, rowIndex, file, batchList) { + + let mappingObj = JSON.parse(event.target.result); + + batchList[rowIndex].mappingTableName = file.name; + + mappingObj.converter = this.converterParametersArrayToProperties(mappingObj.converter); + mappingObj.dataSource = this.dataSourceParametersArrayToProperty(mappingObj.dataSource); + + // set value of column "Datensatz-Quellformat*" by converter name + let converterName = mappingObj.converter.name + for(let i=0; i 0)) { + let fields = angular.element('[ng-model="' + resourceType + '.' + selectedCol + '"]'); + for(let i=0; i 0) { + // Only add if name isn't added already + if( !result.includes(converterName) ) { + result.push(converterName) + } + } + } + } + return result; + } + + // the variable availableGeoresources / availableIndicators (which is used to fill the ng-options) + // changes after each update, causing angularjs to loose the connection. + // this function restores the names + this.refreshNameColumn = function(resourceType, batchList) { + for(let i=0;i 0){ - // admin role is kommonitor-creator - if(keycloakRolesArray.includes(__env.keycloakKomMonitorAdminRoleName)){ - metadataKey += "_" + __env.keycloakKomMonitorAdminRoleName; - timestampKey += "_" + __env.keycloakKomMonitorAdminRoleName; - } - else{ - metadataKey += "_" + JSON.stringify(keycloakRolesArray); - timestampKey += "_" + JSON.stringify(keycloakRolesArray); - } - } - else{ - metadataKey += "_public"; - timestampKey += "_public"; - } - - - let lastModTimestamp_fromCache_string = localStorage.getItem(timestampKey); - - if (lastModTimestamp_fromCache_string) { - let lastModTimestamp_fromCache = JSON.parse(lastModTimestamp_fromCache_string); - - if (lastModTimestamp_fromCache) { - - let lastModTimestamp_fromServer = this.lastDatabaseModificationInfo[lastModificationResourceName]; - - if (lastModTimestamp_fromCache == lastModTimestamp_fromServer) { - let storageObject_string = localStorage.getItem(metadataKey); - - if (storageObject_string) { - let storageObject = JSON.parse(storageObject_string); - return storageObject; - } + this.lastDatabaseModificationInfo; + this.baseUrlToKomMonitorDataAPI = __env.apiUrl + __env.basePath; + let self = this; + const localStorageKey_prefix = __env.localStoragePrefix; + const localStorageKey_accessControl = localStorageKey_prefix + "_lastModification_accessControl"; + const localStorageKey_topics = localStorageKey_prefix + "_lastModification_topics"; + const localStorageKey_spatialUnits = localStorageKey_prefix + "_lastModification_spatialUnits"; + const localStorageKey_georesources = localStorageKey_prefix + "_lastModification_georesources"; + const localStorageKey_indicators = localStorageKey_prefix + "_lastModification_indicators"; + const localStorageKey_processScripts = localStorageKey_prefix + "_lastModification_processScripts"; + const georesourcesPublicEndpoint = "/public/georesources"; + const georesourcesProtectedEndpoint = "/georesources"; + const spatialUnitsPublicEndpoint = "/public/spatial-units"; + const spatialUnitsProtectedEndpoint = "/spatial-units"; + const indicatorsPublicEndpoint = "/public/indicators"; + const indicatorsProtectedEndpoint = "/indicators"; + const scriptsPublicEndpoint = "/public/process-scripts"; + const scriptsProtectedEndpoint = "/process-scripts"; + const topicsPublicEndpoint = "/public/topics"; + // only resource that has no public endpoint + const accessControlEndpoint = "/organizationalUnits"; + var georesourcesEndpoint = georesourcesProtectedEndpoint; + var spatialUnitsEndpoint = spatialUnitsProtectedEndpoint; + var indicatorsEndpoint = indicatorsProtectedEndpoint; + var scriptsEndpoint = scriptsProtectedEndpoint; + this.spatialResourceGETUrlPath_forAuthentication = "/public"; + this.checkAuthentication = function () { + if (Auth.keycloak.authenticated) { + georesourcesEndpoint = georesourcesProtectedEndpoint; + spatialUnitsEndpoint = spatialUnitsProtectedEndpoint; + indicatorsEndpoint = indicatorsProtectedEndpoint; + scriptsEndpoint = scriptsProtectedEndpoint; + this.spatialResourceGETUrlPath_forAuthentication = ""; } - } - } - - // when code reaches this place we must overwrite/set timestamp and actual metadata - - // persist last modification timestamp object as String in local storage - localStorage.setItem(timestampKey, JSON.stringify(this.lastDatabaseModificationInfo[lastModificationResourceName])); - - return await $http({ - url: this.baseUrlToKomMonitorDataAPI + resourceEndpoint, - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - localStorage.setItem(metadataKey, JSON.stringify(response.data)); - - return response.data; - }); - }; - - this.fetchAccessControlMetadata = async function (keycloakRolesArray) { - return await this.fetchResource_fromCacheOrServer(localStorageKey_accessControl, accessControlEndpoint, "access-control", keycloakRolesArray); - }; - - this.fetchTopicsMetadata = async function (keycloakRolesArray) { - return await this.fetchResource_fromCacheOrServer(localStorageKey_topics, topicsPublicEndpoint, "topics", keycloakRolesArray); - }; - - this.fetchSpatialUnitsMetadata = async function (keycloakRolesArray) { - return await this.fetchResource_fromCacheOrServer(localStorageKey_spatialUnits, spatialUnitsEndpoint, "spatial-units", keycloakRolesArray); - }; - - this.fetchIndicatorsMetadata = async function (keycloakRolesArray) { - return await this.fetchResource_fromCacheOrServer(localStorageKey_indicators, indicatorsEndpoint, "indicators", keycloakRolesArray); - }; - - this.fetchGeoresourceMetadata = async function (keycloakRolesArray) { - return await this.fetchResource_fromCacheOrServer(localStorageKey_georesources, georesourcesEndpoint, "georesources", keycloakRolesArray); - }; - - this.fetchProcessScriptsMetadata = async function (keycloakRolesArray) { - return await this.fetchResource_fromCacheOrServer(localStorageKey_processScripts, scriptsEndpoint, "process-scripts", keycloakRolesArray); - }; - - this.fetchSingleAccessControlMetadata = function (targetId, keycloakRolesArray) { - return $http({ - url: this.baseUrlToKomMonitorDataAPI + accessControlEndpoint + "/" + targetId, - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - // let cache be checked, but in the background, do not wait for it - self.fetchAccessControlMetadata(keycloakRolesArray); - return response.data; - }); - }; - - this.fetchSingleSpatialUnitMetadata = function (targetSpatialUnitId, keycloakRolesArray) { - return $http({ - url: this.baseUrlToKomMonitorDataAPI + spatialUnitsEndpoint + "/" + targetSpatialUnitId, - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - self.fetchSpatialUnitsMetadata(keycloakRolesArray); - return response.data; - - }); - }; - - this.fetchSingleGeoresourceMetadata = function (targetGeoresourceId, keycloakRolesArray) { - return $http({ - url: this.baseUrlToKomMonitorDataAPI + georesourcesEndpoint + "/" + targetGeoresourceId, - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - self.fetchGeoresourceMetadata(keycloakRolesArray); - return response.data; - - }); - }; - - this.fetchSingleIndicatorMetadata = function (targetIndicatorId, keycloakRolesArray) { - return $http({ - url: this.baseUrlToKomMonitorDataAPI + indicatorsEndpoint + "/" + targetIndicatorId, - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - self.fetchIndicatorsMetadata(keycloakRolesArray); - return response.data; - - }); - }; - - this.fetchSingleIndicatorScriptMetadata = function (targetScriptId, keycloakRolesArray) { - return $http({ - url: this.baseUrlToKomMonitorDataAPI + scriptsEndpoint + "/" + targetScriptId, - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - self.fetchProcessScriptsMetadata(keycloakRolesArray); - return response.data; - - }); - }; - - this.fetchSingleGeoresourceSchema = function (targetGeoresourceId) { - return $http({ - url: this.baseUrlToKomMonitorDataAPI + georesourcesEndpoint + "/" + targetGeoresourceId + "/schema", - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - return response.data; - - }); - }; - - this.fetchSingleGeoresourceWithoutGeometry = function (targetGeoresourceId) { - return $http({ - url: this.baseUrlToKomMonitorDataAPI + georesourcesEndpoint + "/" + targetGeoresourceId + "/allFeatures/without-geometry", - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - return response.data; - - }); - }; - - this.init = async function () { - this.checkAuthentication(); - - await this.fetchLastDatabaseModificationObject(); - }; - - this.init(); - - }]); + else { + georesourcesEndpoint = georesourcesPublicEndpoint; + spatialUnitsEndpoint = spatialUnitsPublicEndpoint; + indicatorsEndpoint = indicatorsPublicEndpoint; + scriptsEndpoint = scriptsPublicEndpoint; + this.spatialResourceGETUrlPath_forAuthentication = "/public"; + } + }; + this.fetchLastDatabaseModificationObject = async function () { + await $http({ + url: this.baseUrlToKomMonitorDataAPI + "/public/database/last-modification", + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + self.lastDatabaseModificationInfo = response.data; + }); + }; + this.fetchResource_fromCacheOrServer = async function (localStorageKey, resourceEndpoint, lastModificationResourceName, keycloakRolesArray) { + // check if the last modification date within local storage is the same as on the server + // if YES, then try to use data from cache + // else set new last modification date, fetch data from server and set that also within localStorage + await this.fetchLastDatabaseModificationObject(); + let timestampKey = localStorageKey + "_timestamp"; + let metadataKey = localStorageKey + "_metadata"; + //TODO: why do we need this? There is ever only a single rolesArray why do we need to differentiate between different roles? + if (keycloakRolesArray && keycloakRolesArray.length > 0) { + // admin role is kommonitor-creator + if (keycloakRolesArray.includes(__env.keycloakKomMonitorAdminRoleName)) { + metadataKey += "_" + __env.keycloakKomMonitorAdminRoleName; + timestampKey += "_" + __env.keycloakKomMonitorAdminRoleName; + } + else { + metadataKey += "_" + JSON.stringify(keycloakRolesArray); + timestampKey += "_" + JSON.stringify(keycloakRolesArray); + } + } + else { + metadataKey += "_public"; + timestampKey += "_public"; + } + let lastModTimestamp_fromCache_string = localStorage.getItem(timestampKey); + if (lastModTimestamp_fromCache_string) { + let lastModTimestamp_fromCache = JSON.parse(lastModTimestamp_fromCache_string); + if (lastModTimestamp_fromCache) { + let lastModTimestamp_fromServer = this.lastDatabaseModificationInfo[lastModificationResourceName]; + if (lastModTimestamp_fromCache == lastModTimestamp_fromServer) { + let storageObject_string = localStorage.getItem(metadataKey); + if (storageObject_string) { + let storageObject = JSON.parse(storageObject_string); + return storageObject; + } + } + } + } + // when code reaches this place we must overwrite/set timestamp and actual metadata + // persist last modification timestamp object as String in local storage + localStorage.setItem(timestampKey, JSON.stringify(this.lastDatabaseModificationInfo[lastModificationResourceName])); + return await $http({ + url: this.baseUrlToKomMonitorDataAPI + resourceEndpoint, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + localStorage.setItem(metadataKey, JSON.stringify(response.data)); + return response.data; + }); + }; + this.fetchAccessControlMetadata = async function (keycloakRolesArray) { + return await this.fetchResource_fromCacheOrServer(localStorageKey_accessControl, accessControlEndpoint, "access-control", keycloakRolesArray); + }; + this.fetchTopicsMetadata = async function (keycloakRolesArray) { + return await this.fetchResource_fromCacheOrServer(localStorageKey_topics, topicsPublicEndpoint, "topics", keycloakRolesArray); + }; + this.fetchSpatialUnitsMetadata = async function (keycloakRolesArray) { + return await this.fetchResource_fromCacheOrServer(localStorageKey_spatialUnits, spatialUnitsEndpoint, "spatial-units", keycloakRolesArray); + }; + this.fetchIndicatorsMetadata = async function (keycloakRolesArray) { + return await this.fetchResource_fromCacheOrServer(localStorageKey_indicators, indicatorsEndpoint, "indicators", keycloakRolesArray); + }; + this.fetchGeoresourceMetadata = async function (keycloakRolesArray) { + return await this.fetchResource_fromCacheOrServer(localStorageKey_georesources, georesourcesEndpoint, "georesources", keycloakRolesArray); + }; + this.fetchProcessScriptsMetadata = async function (keycloakRolesArray) { + return await this.fetchResource_fromCacheOrServer(localStorageKey_processScripts, scriptsEndpoint, "process-scripts", keycloakRolesArray); + }; + this.fetchSingleAccessControlMetadata = function (targetId, keycloakRolesArray) { + return $http({ + url: this.baseUrlToKomMonitorDataAPI + accessControlEndpoint + "/" + targetId, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + // let cache be checked, but in the background, do not wait for it + self.fetchAccessControlMetadata(keycloakRolesArray); + return response.data; + }); + }; + this.fetchSingleSpatialUnitMetadata = function (targetSpatialUnitId, keycloakRolesArray) { + return $http({ + url: this.baseUrlToKomMonitorDataAPI + spatialUnitsEndpoint + "/" + targetSpatialUnitId, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + self.fetchSpatialUnitsMetadata(keycloakRolesArray); + return response.data; + }); + }; + this.fetchSingleGeoresourceMetadata = function (targetGeoresourceId, keycloakRolesArray) { + return $http({ + url: this.baseUrlToKomMonitorDataAPI + georesourcesEndpoint + "/" + targetGeoresourceId, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + self.fetchGeoresourceMetadata(keycloakRolesArray); + return response.data; + }); + }; + this.fetchSingleIndicatorMetadata = function (targetIndicatorId, keycloakRolesArray) { + return $http({ + url: this.baseUrlToKomMonitorDataAPI + indicatorsEndpoint + "/" + targetIndicatorId, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + self.fetchIndicatorsMetadata(keycloakRolesArray); + return response.data; + }); + }; + this.fetchSingleIndicatorScriptMetadata = function (targetScriptId, keycloakRolesArray) { + return $http({ + url: this.baseUrlToKomMonitorDataAPI + scriptsEndpoint + "/" + targetScriptId, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + self.fetchProcessScriptsMetadata(keycloakRolesArray); + return response.data; + }); + }; + this.fetchSingleGeoresourceSchema = function (targetGeoresourceId) { + return $http({ + url: this.baseUrlToKomMonitorDataAPI + georesourcesEndpoint + "/" + targetGeoresourceId + "/schema", + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + return response.data; + }); + }; + this.fetchSingleGeoresourceWithoutGeometry = function (targetGeoresourceId) { + return $http({ + url: this.baseUrlToKomMonitorDataAPI + georesourcesEndpoint + "/" + targetGeoresourceId + "/allFeatures/without-geometry", + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + return response.data; + }); + }; + this.init = async function () { + this.checkAuthentication(); + await this.fetchLastDatabaseModificationObject(); + }; + this.init(); + } +]); +//# sourceMappingURL=kommonitor-cache-helper-service.module.js.map \ No newline at end of file diff --git a/app/util/genericServices/kommonitorCacheHelperService/kommonitor-cache-helper-service.module.js.map b/app/util/genericServices/kommonitorCacheHelperService/kommonitor-cache-helper-service.module.js.map new file mode 100644 index 000000000..412097258 --- /dev/null +++ b/app/util/genericServices/kommonitorCacheHelperService/kommonitor-cache-helper-service.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-cache-helper-service.module.js","sourceRoot":"","sources":["kommonitor-cache-helper-service.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,uBAAuB,EAAE,EAAE,CAAC,CAAC;AAE5C;;;;;;;;GAQG;AACH,OAAO;KACJ,MAAM,CAAC,uBAAuB,EAAE,EAAE,CAAC;KACnC,OAAO,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AA8C;gBAC9C,iCAAiC;gBACjC,OAAO,QAAQ,CAAC,IAAI,CAAC;YAEvB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;QAEF,IAAI,CAAC,qCAAqC,GAAG,UAAU,mBAAmB;YACxE,OAAO,KAAK,CAAC;gBACX,GAAG,EAAE,IAAI,CAAC,0BAA0B,GAAG,oBAAoB,GAAG,GAAG,GAAG,mBAAmB,GAAG,+BAA+B;gBACzH,MAAM,EAAE,KAAK;aACd,CAAC,CAAC,IAAI,CAAC,SAAS,eAAe,CAAC,QAAQ;gBACvC,8CAA8C;gBAC9C,iCAAiC;gBACjC,OAAO,QAAQ,CAAC,IAAI,CAAC;YAEvB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;QAEF,IAAI,CAAC,IAAI,GAAG,KAAK;YACf,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAE3B,MAAM,IAAI,CAAC,mCAAmC,EAAE,CAAC;QACnD,CAAC,CAAC;QAEF,IAAI,CAAC,IAAI,EAAE,CAAC;IAEd,CAAC;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/util/genericServices/kommonitorCacheHelperService/kommonitor-cache-helper-service.module.ts b/app/util/genericServices/kommonitorCacheHelperService/kommonitor-cache-helper-service.module.ts new file mode 100644 index 000000000..aa8f07de9 --- /dev/null +++ b/app/util/genericServices/kommonitorCacheHelperService/kommonitor-cache-helper-service.module.ts @@ -0,0 +1,275 @@ +angular.module('kommonitorCacheHelper', []); + +/** + * a common serviceInstance that holds all needed properties for a WPS service. + * + * This service represents a shared object ´which is used across the different + * application tabs/components like Setup, Capabilities, Execute etc. + * + * This way, one single service instance can be used to easily share values and + * parameters for each WPS operation represented by different Angular components + */ +angular + .module('kommonitorCacheHelper', []) + .service( + 'kommonitorCacheHelperService', [ + '$http', '__env', 'Auth', + function ($http, __env, Auth) { + + this.lastDatabaseModificationInfo; + this.baseUrlToKomMonitorDataAPI = __env.apiUrl + __env.basePath; + let self = this; + + const localStorageKey_prefix = __env.localStoragePrefix; + + const localStorageKey_accessControl = localStorageKey_prefix + "_lastModification_accessControl"; + const localStorageKey_topics = localStorageKey_prefix + "_lastModification_topics"; + const localStorageKey_spatialUnits = localStorageKey_prefix + "_lastModification_spatialUnits"; + const localStorageKey_georesources = localStorageKey_prefix + "_lastModification_georesources"; + const localStorageKey_indicators = localStorageKey_prefix + "_lastModification_indicators"; + const localStorageKey_processScripts = localStorageKey_prefix + "_lastModification_processScripts"; + + const georesourcesPublicEndpoint = "/public/georesources"; + const georesourcesProtectedEndpoint = "/georesources"; + const spatialUnitsPublicEndpoint = "/public/spatial-units"; + const spatialUnitsProtectedEndpoint = "/spatial-units"; + const indicatorsPublicEndpoint = "/public/indicators"; + const indicatorsProtectedEndpoint = "/indicators"; + const scriptsPublicEndpoint = "/public/process-scripts"; + const scriptsProtectedEndpoint = "/process-scripts"; + const topicsPublicEndpoint = "/public/topics"; + // only resource that has no public endpoint + const accessControlEndpoint = "/organizationalUnits"; + + var georesourcesEndpoint = georesourcesProtectedEndpoint; + var spatialUnitsEndpoint = spatialUnitsProtectedEndpoint; + var indicatorsEndpoint = indicatorsProtectedEndpoint; + var scriptsEndpoint = scriptsProtectedEndpoint; + this.spatialResourceGETUrlPath_forAuthentication = "/public"; + + this.checkAuthentication = function () { + if (Auth.keycloak.authenticated) { + georesourcesEndpoint = georesourcesProtectedEndpoint; + spatialUnitsEndpoint = spatialUnitsProtectedEndpoint; + indicatorsEndpoint = indicatorsProtectedEndpoint; + scriptsEndpoint = scriptsProtectedEndpoint; + this.spatialResourceGETUrlPath_forAuthentication = ""; + } else { + georesourcesEndpoint = georesourcesPublicEndpoint; + spatialUnitsEndpoint = spatialUnitsPublicEndpoint; + indicatorsEndpoint = indicatorsPublicEndpoint; + scriptsEndpoint = scriptsPublicEndpoint; + this.spatialResourceGETUrlPath_forAuthentication = "/public"; + } + + }; + + this.fetchLastDatabaseModificationObject = async function () { + await $http({ + url: this.baseUrlToKomMonitorDataAPI + "/public/database/last-modification", + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + self.lastDatabaseModificationInfo = response.data; + + }); + }; + + this.fetchResource_fromCacheOrServer = async function (localStorageKey, resourceEndpoint, lastModificationResourceName, keycloakRolesArray) { + // check if the last modification date within local storage is the same as on the server + + // if YES, then try to use data from cache + + // else set new last modification date, fetch data from server and set that also within localStorage + + await this.fetchLastDatabaseModificationObject(); + + let timestampKey = localStorageKey + "_timestamp"; + let metadataKey = localStorageKey + "_metadata"; + + //TODO: why do we need this? There is ever only a single rolesArray why do we need to differentiate between different roles? + + if(keycloakRolesArray && keycloakRolesArray.length > 0){ + // admin role is kommonitor-creator + if(keycloakRolesArray.includes(__env.keycloakKomMonitorAdminRoleName)){ + metadataKey += "_" + __env.keycloakKomMonitorAdminRoleName; + timestampKey += "_" + __env.keycloakKomMonitorAdminRoleName; + } + else{ + metadataKey += "_" + JSON.stringify(keycloakRolesArray); + timestampKey += "_" + JSON.stringify(keycloakRolesArray); + } + } + else{ + metadataKey += "_public"; + timestampKey += "_public"; + } + + + let lastModTimestamp_fromCache_string = localStorage.getItem(timestampKey); + + if (lastModTimestamp_fromCache_string) { + let lastModTimestamp_fromCache = JSON.parse(lastModTimestamp_fromCache_string); + + if (lastModTimestamp_fromCache) { + + let lastModTimestamp_fromServer = this.lastDatabaseModificationInfo[lastModificationResourceName]; + + if (lastModTimestamp_fromCache == lastModTimestamp_fromServer) { + let storageObject_string = localStorage.getItem(metadataKey); + + if (storageObject_string) { + let storageObject = JSON.parse(storageObject_string); + return storageObject; + } + } + } + } + + // when code reaches this place we must overwrite/set timestamp and actual metadata + + // persist last modification timestamp object as String in local storage + localStorage.setItem(timestampKey, JSON.stringify(this.lastDatabaseModificationInfo[lastModificationResourceName])); + + return await $http({ + url: this.baseUrlToKomMonitorDataAPI + resourceEndpoint, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + localStorage.setItem(metadataKey, JSON.stringify(response.data)); + + return response.data; + }); + }; + + this.fetchAccessControlMetadata = async function (keycloakRolesArray) { + return await this.fetchResource_fromCacheOrServer(localStorageKey_accessControl, accessControlEndpoint, "access-control", keycloakRolesArray); + }; + + this.fetchTopicsMetadata = async function (keycloakRolesArray) { + return await this.fetchResource_fromCacheOrServer(localStorageKey_topics, topicsPublicEndpoint, "topics", keycloakRolesArray); + }; + + this.fetchSpatialUnitsMetadata = async function (keycloakRolesArray) { + return await this.fetchResource_fromCacheOrServer(localStorageKey_spatialUnits, spatialUnitsEndpoint, "spatial-units", keycloakRolesArray); + }; + + this.fetchIndicatorsMetadata = async function (keycloakRolesArray) { + return await this.fetchResource_fromCacheOrServer(localStorageKey_indicators, indicatorsEndpoint, "indicators", keycloakRolesArray); + }; + + this.fetchGeoresourceMetadata = async function (keycloakRolesArray) { + return await this.fetchResource_fromCacheOrServer(localStorageKey_georesources, georesourcesEndpoint, "georesources", keycloakRolesArray); + }; + + this.fetchProcessScriptsMetadata = async function (keycloakRolesArray) { + return await this.fetchResource_fromCacheOrServer(localStorageKey_processScripts, scriptsEndpoint, "process-scripts", keycloakRolesArray); + }; + + this.fetchSingleAccessControlMetadata = function (targetId, keycloakRolesArray) { + return $http({ + url: this.baseUrlToKomMonitorDataAPI + accessControlEndpoint + "/" + targetId, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + // let cache be checked, but in the background, do not wait for it + self.fetchAccessControlMetadata(keycloakRolesArray); + return response.data; + }); + }; + + this.fetchSingleSpatialUnitMetadata = function (targetSpatialUnitId, keycloakRolesArray) { + return $http({ + url: this.baseUrlToKomMonitorDataAPI + spatialUnitsEndpoint + "/" + targetSpatialUnitId, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + self.fetchSpatialUnitsMetadata(keycloakRolesArray); + return response.data; + + }); + }; + + this.fetchSingleGeoresourceMetadata = function (targetGeoresourceId, keycloakRolesArray) { + return $http({ + url: this.baseUrlToKomMonitorDataAPI + georesourcesEndpoint + "/" + targetGeoresourceId, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + self.fetchGeoresourceMetadata(keycloakRolesArray); + return response.data; + + }); + }; + + this.fetchSingleIndicatorMetadata = function (targetIndicatorId, keycloakRolesArray) { + return $http({ + url: this.baseUrlToKomMonitorDataAPI + indicatorsEndpoint + "/" + targetIndicatorId, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + self.fetchIndicatorsMetadata(keycloakRolesArray); + return response.data; + + }); + }; + + this.fetchSingleIndicatorScriptMetadata = function (targetScriptId, keycloakRolesArray) { + return $http({ + url: this.baseUrlToKomMonitorDataAPI + scriptsEndpoint + "/" + targetScriptId, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + self.fetchProcessScriptsMetadata(keycloakRolesArray); + return response.data; + + }); + }; + + this.fetchSingleGeoresourceSchema = function (targetGeoresourceId) { + return $http({ + url: this.baseUrlToKomMonitorDataAPI + georesourcesEndpoint + "/" + targetGeoresourceId + "/schema", + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + return response.data; + + }); + }; + + this.fetchSingleGeoresourceWithoutGeometry = function (targetGeoresourceId) { + return $http({ + url: this.baseUrlToKomMonitorDataAPI + georesourcesEndpoint + "/" + targetGeoresourceId + "/allFeatures/without-geometry", + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + return response.data; + + }); + }; + + this.init = async function () { + this.checkAuthentication(); + + await this.fetchLastDatabaseModificationObject(); + }; + + this.init(); + + }]); diff --git a/app/util/genericServices/kommonitorConfigStorageService/kommonitor-config-storage-service.module.js b/app/util/genericServices/kommonitorConfigStorageService/kommonitor-config-storage-service.module.js index d199edc08..063fed989 100644 --- a/app/util/genericServices/kommonitorConfigStorageService/kommonitor-config-storage-service.module.js +++ b/app/util/genericServices/kommonitorConfigStorageService/kommonitor-config-storage-service.module.js @@ -1,157 +1,128 @@ +"use strict"; angular.module('kommonitorConfigStorage', ['kommonitorDataExchange']); - angular - .module('kommonitorConfigStorage', []) - .service( - 'kommonitorConfigStorageService', ['$rootScope', '$timeout', 'kommonitorDataExchangeService', '$http', '__env', - function ($rootScope, $timeout, - kommonitorDataExchangeService, $http, __env) { - - this.postKeycloakConfig = async function(jsonString){ - - console.log("Trying to POST to config storage service to upload new keycloak config."); - - var formdata = new FormData(); - formdata.append("appConfig", new Blob([jsonString], { type: "application/json"})); - - return await $http({ - url: __env.configStorageServerConfig.targetUrlToConfigStorageServer_keycloakConfig, - method: "POST", - data: formdata, - // must set header content-type to undefined in order to send as multipart-formdata - headers: {"Content-Type": undefined, "Accept": "text/plain" }, - responseType: 'text' - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(response) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while posting to config storage service."); - throw response; - }); - }; - - this.postControlsConfig = async function(jsonString){ - - console.log("Trying to POST to config storage service to upload new controls config."); - - var formdata = new FormData(); - formdata.append("appConfig", new Blob([jsonString], { type: "application/json"})); - - return await $http({ - url: __env.configStorageServerConfig.targetUrlToConfigStorageServer_controlsConfig, - method: "POST", - data: formdata, - // must set header content-type to undefined in order to send as multipart-formdata - headers: {"Content-Type": undefined, "Accept": "text/plain" }, - responseType: 'text' - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(response) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while posting to config storage service."); - throw response; - }); - }; - - this.postAppConfig = async function(jsString){ - - console.log("Trying to POST to config storage service to upload new app config."); - - var formdata = new FormData(); - formdata.append("appConfig", new Blob([jsString], { type: "application/javascript"})); - - return await $http({ - url: __env.configStorageServerConfig.targetUrlToConfigStorageServer_appConfig, - method: "POST", - data: formdata, - // must set header content-type to undefined in order to send as multipart-formdata - headers: {"Content-Type": undefined, "Accept": "text/plain" }, - responseType: 'text' - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(response) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while posting to config storage service."); - throw response; - }); - }; - - this.getKeycloakConfig = async function(){ - return await $http({ - url: __env.configStorageServerConfig.targetUrlToConfigStorageServer_keycloakConfig, - method: "GET", - responseType: 'json' - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(response) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while getting keycloak config from config storage service."); - throw response; - }); - }; - - this.getControlsConfig = async function(){ - return await $http({ - url: __env.configStorageServerConfig.targetUrlToConfigStorageServer_controlsConfig, - method: "GET", - responseType: 'json' - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(response) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while getting keycloak config from config storage service."); - throw response; - }); - }; - - this.getAppConfig = async function(){ - return await $http({ - url: __env.configStorageServerConfig.targetUrlToConfigStorageServer_appConfig, - method: "GET", - responseType: 'text' - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(response) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while getting keycloak config from config storage service."); - throw response; - }); - }; - + .module('kommonitorConfigStorage', []) + .service('kommonitorConfigStorageService', ['$rootScope', '$timeout', 'kommonitorDataExchangeService', '$http', '__env', + function ($rootScope, $timeout, kommonitorDataExchangeService, $http, __env) { + this.postKeycloakConfig = async function (jsonString) { + console.log("Trying to POST to config storage service to upload new keycloak config."); + var formdata = new FormData(); + formdata.append("appConfig", new Blob([jsonString], { type: "application/json" })); + return await $http({ + url: __env.configStorageServerConfig.targetUrlToConfigStorageServer_keycloakConfig, + method: "POST", + data: formdata, + // must set header content-type to undefined in order to send as multipart-formdata + headers: { "Content-Type": undefined, "Accept": "text/plain" }, + responseType: 'text' + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + return response.data; + }, function errorCallback(response) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while posting to config storage service."); + throw response; + }); + }; + this.postControlsConfig = async function (jsonString) { + console.log("Trying to POST to config storage service to upload new controls config."); + var formdata = new FormData(); + formdata.append("appConfig", new Blob([jsonString], { type: "application/json" })); + return await $http({ + url: __env.configStorageServerConfig.targetUrlToConfigStorageServer_controlsConfig, + method: "POST", + data: formdata, + // must set header content-type to undefined in order to send as multipart-formdata + headers: { "Content-Type": undefined, "Accept": "text/plain" }, + responseType: 'text' + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + return response.data; + }, function errorCallback(response) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while posting to config storage service."); + throw response; + }); + }; + this.postAppConfig = async function (jsString) { + console.log("Trying to POST to config storage service to upload new app config."); + var formdata = new FormData(); + formdata.append("appConfig", new Blob([jsString], { type: "application/javascript" })); + return await $http({ + url: __env.configStorageServerConfig.targetUrlToConfigStorageServer_appConfig, + method: "POST", + data: formdata, + // must set header content-type to undefined in order to send as multipart-formdata + headers: { "Content-Type": undefined, "Accept": "text/plain" }, + responseType: 'text' + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + return response.data; + }, function errorCallback(response) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while posting to config storage service."); + throw response; + }); + }; + this.getKeycloakConfig = async function () { + return await $http({ + url: __env.configStorageServerConfig.targetUrlToConfigStorageServer_keycloakConfig, + method: "GET", + responseType: 'json' + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + return response.data; + }, function errorCallback(response) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while getting keycloak config from config storage service."); + throw response; + }); + }; + this.getControlsConfig = async function () { + return await $http({ + url: __env.configStorageServerConfig.targetUrlToConfigStorageServer_controlsConfig, + method: "GET", + responseType: 'json' + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + return response.data; + }, function errorCallback(response) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while getting keycloak config from config storage service."); + throw response; + }); + }; + this.getAppConfig = async function () { + return await $http({ + url: __env.configStorageServerConfig.targetUrlToConfigStorageServer_appConfig, + method: "GET", + responseType: 'text' + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + return response.data; + }, function errorCallback(response) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while getting keycloak config from config storage service."); + throw response; + }); + }; }]); +//# sourceMappingURL=kommonitor-config-storage-service.module.js.map \ No newline at end of file diff --git a/app/util/genericServices/kommonitorConfigStorageService/kommonitor-config-storage-service.module.js.map b/app/util/genericServices/kommonitorConfigStorageService/kommonitor-config-storage-service.module.js.map new file mode 100644 index 000000000..d35312f6c --- /dev/null +++ b/app/util/genericServices/kommonitorConfigStorageService/kommonitor-config-storage-service.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-config-storage-service.module.js","sourceRoot":"","sources":["kommonitor-config-storage-service.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,yBAAyB,EAAE,CAAC,wBAAwB,CAAC,CAAC,CAAC;AAEtE,OAAO;KACJ,MAAM,CAAC,yBAAyB,EAAE,EAAE,CAAC;KACrC,OAAO,CACN,gCAAgC,EAAE,CAAC,YAAY,EAAE,UAAU,EAAE,+BAA+B,EAAE,OAAO,EAAE,OAAO;IAC9G,UAAU,UAAU,EAAE,QAAQ,EAC5B,6BAA6B,EAAE,KAAK,EAAE,KAAK;QAE3C,IAAI,CAAC,kBAAkB,GAAG,KAAK,WAAU,UAAU;YAEjD,OAAO,CAAC,GAAG,CAAC,yEAAyE,CA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E,MAAM,EAAE,KAAK;gBACb,YAAY,EAAE,MAAM;aACrB,CAAC,CAAC,IAAI,CAAC,SAAS,eAAe,CAAC,QAAQ;gBACvC,8CAA8C;gBAC9C,iCAAiC;gBAEjC,OAAO,QAAQ,CAAC,IAAI,CAAC;YAErB,CAAC,EAAE,SAAS,aAAa,CAAC,QAAQ;gBAClC,2CAA2C;gBAC3C,mDAAmD;gBACnD,qCAAqC;gBACrC,OAAO,CAAC,KAAK,CAAC,kEAAkE,CAAC,CAAC;gBAClF,MAAM,QAAQ,CAAC;YACjB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;IAEJ,CAAC,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/util/genericServices/kommonitorConfigStorageService/kommonitor-config-storage-service.module.ts b/app/util/genericServices/kommonitorConfigStorageService/kommonitor-config-storage-service.module.ts new file mode 100644 index 000000000..d199edc08 --- /dev/null +++ b/app/util/genericServices/kommonitorConfigStorageService/kommonitor-config-storage-service.module.ts @@ -0,0 +1,157 @@ +angular.module('kommonitorConfigStorage', ['kommonitorDataExchange']); + +angular + .module('kommonitorConfigStorage', []) + .service( + 'kommonitorConfigStorageService', ['$rootScope', '$timeout', 'kommonitorDataExchangeService', '$http', '__env', + function ($rootScope, $timeout, + kommonitorDataExchangeService, $http, __env) { + + this.postKeycloakConfig = async function(jsonString){ + + console.log("Trying to POST to config storage service to upload new keycloak config."); + + var formdata = new FormData(); + formdata.append("appConfig", new Blob([jsonString], { type: "application/json"})); + + return await $http({ + url: __env.configStorageServerConfig.targetUrlToConfigStorageServer_keycloakConfig, + method: "POST", + data: formdata, + // must set header content-type to undefined in order to send as multipart-formdata + headers: {"Content-Type": undefined, "Accept": "text/plain" }, + responseType: 'text' + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + return response.data; + + }, function errorCallback(response) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while posting to config storage service."); + throw response; + }); + }; + + this.postControlsConfig = async function(jsonString){ + + console.log("Trying to POST to config storage service to upload new controls config."); + + var formdata = new FormData(); + formdata.append("appConfig", new Blob([jsonString], { type: "application/json"})); + + return await $http({ + url: __env.configStorageServerConfig.targetUrlToConfigStorageServer_controlsConfig, + method: "POST", + data: formdata, + // must set header content-type to undefined in order to send as multipart-formdata + headers: {"Content-Type": undefined, "Accept": "text/plain" }, + responseType: 'text' + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + return response.data; + + }, function errorCallback(response) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while posting to config storage service."); + throw response; + }); + }; + + this.postAppConfig = async function(jsString){ + + console.log("Trying to POST to config storage service to upload new app config."); + + var formdata = new FormData(); + formdata.append("appConfig", new Blob([jsString], { type: "application/javascript"})); + + return await $http({ + url: __env.configStorageServerConfig.targetUrlToConfigStorageServer_appConfig, + method: "POST", + data: formdata, + // must set header content-type to undefined in order to send as multipart-formdata + headers: {"Content-Type": undefined, "Accept": "text/plain" }, + responseType: 'text' + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + return response.data; + + }, function errorCallback(response) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while posting to config storage service."); + throw response; + }); + }; + + this.getKeycloakConfig = async function(){ + return await $http({ + url: __env.configStorageServerConfig.targetUrlToConfigStorageServer_keycloakConfig, + method: "GET", + responseType: 'json' + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + return response.data; + + }, function errorCallback(response) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while getting keycloak config from config storage service."); + throw response; + }); + }; + + this.getControlsConfig = async function(){ + return await $http({ + url: __env.configStorageServerConfig.targetUrlToConfigStorageServer_controlsConfig, + method: "GET", + responseType: 'json' + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + return response.data; + + }, function errorCallback(response) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while getting keycloak config from config storage service."); + throw response; + }); + }; + + this.getAppConfig = async function(){ + return await $http({ + url: __env.configStorageServerConfig.targetUrlToConfigStorageServer_appConfig, + method: "GET", + responseType: 'text' + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + return response.data; + + }, function errorCallback(response) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while getting keycloak config from config storage service."); + throw response; + }); + }; + + }]); diff --git a/app/util/genericServices/kommonitorDataExchangeService/kommonitor-data-exchange-service.module.js b/app/util/genericServices/kommonitorDataExchangeService/kommonitor-data-exchange-service.module.js index 0cea61601..f710e790b 100644 --- a/app/util/genericServices/kommonitorDataExchangeService/kommonitor-data-exchange-service.module.js +++ b/app/util/genericServices/kommonitorDataExchangeService/kommonitor-data-exchange-service.module.js @@ -1,5 +1,5 @@ +"use strict"; angular.module('kommonitorDataExchange', ['kommonitorMap', 'kommonitorKeycloakHelper']); - /** * a common serviceInstance that holds all needed properties for a WPS service. * @@ -10,1078 +10,867 @@ angular.module('kommonitorDataExchange', ['kommonitorMap', 'kommonitorKeycloakHe * parameters for each WPS operation represented by different Angular components */ angular - .module('kommonitorDataExchange', ['kommonitorCacheHelper', 'angularjs-dropdown-multiselect']) - .service( - 'kommonitorDataExchangeService', ['$rootScope', '$timeout', '$interval', 'kommonitorMapService', 'kommonitorKeycloakHelperService', - 'kommonitorCacheHelperService', - '$http', '__env', '$q', 'Auth', - function($rootScope, $timeout, $interval, - kommonitorMapService, kommonitorKeycloakHelperService, kommonitorCacheHelperService, $http, __env, $q, Auth,) { - - let thisService = this; - this.appTitle = __env.appTitle; - - this.customLogoURL = __env.customLogoURL; - this.customLogo_onClickURL = __env.customLogo_onClickURL; - this.customLogoWidth = __env.customLogoWidth; - this.customGreetingsContact_name = __env.customGreetingsContact_name; - this.customGreetingsContact_organisation = __env.customGreetingsContact_organisation; - this.customGreetingsContact_mail = __env.customGreetingsContact_mail; - this.customGreetingsTextInfoMessage = __env.customGreetingsTextInfoMessage; // maybe undefined or empty string - - this.showDiagramExportButtons = true; - this.showGeoresourceExportButtons = true; - - var numberOfDecimals = __env.numberOfDecimals; - const DATE_PREFIX = __env.indicatorDatePrefix; - var defaultColorForZeroValues = __env.defaultColorForZeroValues; - var defaultColorForNoDataValues = __env.defaultColorForNoDataValues; - var defaultColorForFilteredValues = __env.defaultColorForFilteredValues; - - const defaultColorForOutliers_high = __env.defaultColorForOutliers_high; - const defaultBorderColorForOutliers_high = __env.defaultBorderColorForOutliers_high; - const defaultFillOpacityForOutliers_high = __env.defaultFillOpacityForOutliers_high; - const defaultColorForOutliers_low = __env.defaultColorForOutliers_low; - const defaultBorderColorForOutliers_low = __env.defaultBorderColorForOutliers_low; - const defaultFillOpacityForOutliers_low = __env.defaultFillOpacityForOutliers_low; - - - - var self = this; - - this.headlineIndicatorHierarchy = []; - this.computationIndicatorHierarchy = []; - this.topicIndicatorHierarchy = []; - this.topicIndicatorHierarchy_forOrderView = []; - - this.topicGeoresourceHierarchy = []; - this.topicGeoresourceHierarchy_unmappedEntries = {}; - this.georesourceMapKey_forUnmappedTopicReferences = "unmapped"; - - this.enableKeycloakSecurity = __env.enableKeycloakSecurity; - this.currentKeycloakLoginRoles = []; - this.currentKomMonitorLoginRoleNames = []; - this.currentKeycloakUser; - - // MAP objects for available resource metadata in order to have quick access to datasets by ID - this.availableIndicators_map = new Map(); - this.availableGeoresources_map = new Map(); - this.availableSpatialUnits_map = new Map(); - this.availableProcessScripts_map = new Map(); - - this.accessControl = []; - this.accessControl_map = new Map(); - - // Define translations, settings for dropdown-multiselect - this.multiselectDropdownTranslations = { checkAll: 'Alle auswählen', uncheckAll: 'Nichts auswählen', dynamicButtonTextSuffix: 'Werte ausgewählt', - buttonDefaultText: 'Objekteigenschaften auswählen', searchPlaceholder: 'Suchen...' - }; - - this.multiselectDropdownSettings = { + .module('kommonitorDataExchange', ['kommonitorCacheHelper', 'angularjs-dropdown-multiselect']) + .service('kommonitorDataExchangeService', ['$rootScope', '$timeout', '$interval', 'kommonitorMapService', 'kommonitorKeycloakHelperService', + 'kommonitorCacheHelperService', + '$http', '__env', '$q', 'Auth', + function ($rootScope, $timeout, $interval, kommonitorMapService, kommonitorKeycloakHelperService, kommonitorCacheHelperService, $http, __env, $q, Auth) { + let thisService = this; + this.appTitle = __env.appTitle; + this.customLogoURL = __env.customLogoURL; + this.customLogo_onClickURL = __env.customLogo_onClickURL; + this.customLogoWidth = __env.customLogoWidth; + this.customGreetingsContact_name = __env.customGreetingsContact_name; + this.customGreetingsContact_organisation = __env.customGreetingsContact_organisation; + this.customGreetingsContact_mail = __env.customGreetingsContact_mail; + this.customGreetingsTextInfoMessage = __env.customGreetingsTextInfoMessage; // maybe undefined or empty string + this.showDiagramExportButtons = true; + this.showGeoresourceExportButtons = true; + var numberOfDecimals = __env.numberOfDecimals; + const DATE_PREFIX = __env.indicatorDatePrefix; + var defaultColorForZeroValues = __env.defaultColorForZeroValues; + var defaultColorForNoDataValues = __env.defaultColorForNoDataValues; + var defaultColorForFilteredValues = __env.defaultColorForFilteredValues; + const defaultColorForOutliers_high = __env.defaultColorForOutliers_high; + const defaultBorderColorForOutliers_high = __env.defaultBorderColorForOutliers_high; + const defaultFillOpacityForOutliers_high = __env.defaultFillOpacityForOutliers_high; + const defaultColorForOutliers_low = __env.defaultColorForOutliers_low; + const defaultBorderColorForOutliers_low = __env.defaultBorderColorForOutliers_low; + const defaultFillOpacityForOutliers_low = __env.defaultFillOpacityForOutliers_low; + var self = this; + this.headlineIndicatorHierarchy = []; + this.computationIndicatorHierarchy = []; + this.topicIndicatorHierarchy = []; + this.topicIndicatorHierarchy_forOrderView = []; + this.topicGeoresourceHierarchy = []; + this.topicGeoresourceHierarchy_unmappedEntries = {}; + this.georesourceMapKey_forUnmappedTopicReferences = "unmapped"; + this.enableKeycloakSecurity = __env.enableKeycloakSecurity; + this.currentKeycloakLoginRoles = []; + this.currentKomMonitorLoginRoleNames = []; + this.currentKeycloakUser; + // MAP objects for available resource metadata in order to have quick access to datasets by ID + this.availableIndicators_map = new Map(); + this.availableGeoresources_map = new Map(); + this.availableSpatialUnits_map = new Map(); + this.availableProcessScripts_map = new Map(); + this.accessControl = []; + this.accessControl_map = new Map(); + // Define translations, settings for dropdown-multiselect + this.multiselectDropdownTranslations = { checkAll: 'Alle auswählen', uncheckAll: 'Nichts auswählen', dynamicButtonTextSuffix: 'Werte ausgewählt', + buttonDefaultText: 'Objekteigenschaften auswählen', searchPlaceholder: 'Suchen...' + }; + this.multiselectDropdownSettings = { enableSearch: true, clearSearchOnClose: true, scrollableHeight: '250px', scrollable: true, - buttonClasses: 'form-control btn-block', + buttonClasses: 'form-control btn-block', template: '{{option}}', smartButtonTextConverter(skip, option) { return option; }, styleActive: true - }; - - // Filter out roles unrelated to kommonitor - this.setCurrentKomMonitorLoginRoleNames = function() { - var possibleRoles = ["manage-realm"] + }; + // Filter out roles unrelated to kommonitor + this.setCurrentKomMonitorLoginRoleNames = function () { + var possibleRoles = ["manage-realm"]; this.accessControl.forEach(organizationalUnit => { - organizationalUnit.roles.forEach(role => { - possibleRoles.push(organizationalUnit.name + "-" + role.permissionLevel) - }); + organizationalUnit.roles.forEach(role => { + possibleRoles.push(organizationalUnit.name + "-" + role.permissionLevel); + }); }); this.currentKomMonitorLoginRoleNames = this.currentKeycloakLoginRoles.filter(role => possibleRoles.includes(role)); - } - - this.setCurrentKomMonitorLoginRoleIds = function() { + }; + this.setCurrentKomMonitorLoginRoleIds = function () { this.currentKomMonitorLoginRoleIds = []; - // make a map of all role names currently logged in user according to pattern // - let roleNameMap_loggedIn = new Map(); - for (const roleName of this.currentKeycloakLoginRoles) { - // roleName consists of - - roleNameMap_loggedIn.set(roleName, ""); + // roleName consists of - + roleNameMap_loggedIn.set(roleName, ""); } - // now iterate once over all possible KomMonitor roles and check if they are within previous map this.accessControl.forEach(organizationalUnit => { - organizationalUnit.roles.forEach(role => { - if(roleNameMap_loggedIn.has(organizationalUnit.name + "-" + role.permissionLevel)){ - this.currentKomMonitorLoginRoleIds.push(role.roleId); - } - }); + organizationalUnit.roles.forEach(role => { + if (roleNameMap_loggedIn.has(organizationalUnit.name + "-" + role.permissionLevel)) { + this.currentKomMonitorLoginRoleIds.push(role.roleId); + } + }); }); - }; - - this.getCurrentKomMonitorLoginRoleIds = function() { + }; + this.getCurrentKomMonitorLoginRoleIds = function () { return this.currentKomMonitorLoginRoleIds; - }; - - - this.isAllowedSpatialUnitForCurrentIndicator = function(spatialUnitMetadata){ - if(! this.selectedIndicator){ - return false; + }; + this.isAllowedSpatialUnitForCurrentIndicator = function (spatialUnitMetadata) { + if (!this.selectedIndicator) { + return false; } - - if(! spatialUnitMetadata || ! spatialUnitMetadata.spatialUnitLevel){ - return false; + if (!spatialUnitMetadata || !spatialUnitMetadata.spatialUnitLevel) { + return false; } - var filteredApplicableUnits = this.selectedIndicator.applicableSpatialUnits.filter(function (applicableSpatialUnit) { - if (applicableSpatialUnit.spatialUnitId === spatialUnitMetadata.spatialUnitId){ - return true; - } - else{ - return false; - } + if (applicableSpatialUnit.spatialUnitId === spatialUnitMetadata.spatialUnitId) { + return true; + } + else { + return false; + } }); - return filteredApplicableUnits.length > 0; - }; - - this.FEATURE_ID_PROPERTY_NAME = __env.FEATURE_ID_PROPERTY_NAME; - this.FEATURE_NAME_PROPERTY_NAME = __env.FEATURE_NAME_PROPERTY_NAME; - this.VALID_START_DATE_PROPERTY_NAME = __env.VALID_START_DATE_PROPERTY_NAME; - this.VALID_END_DATE_PROPERTY_NAME = __env.VALID_END_DATE_PROPERTY_NAME; - this.indicatorDatePrefix = __env.indicatorDatePrefix; - - this.datePickerOptions = { + }; + this.FEATURE_ID_PROPERTY_NAME = __env.FEATURE_ID_PROPERTY_NAME; + this.FEATURE_NAME_PROPERTY_NAME = __env.FEATURE_NAME_PROPERTY_NAME; + this.VALID_START_DATE_PROPERTY_NAME = __env.VALID_START_DATE_PROPERTY_NAME; + this.VALID_END_DATE_PROPERTY_NAME = __env.VALID_END_DATE_PROPERTY_NAME; + this.indicatorDatePrefix = __env.indicatorDatePrefix; + this.datePickerOptions = { autoclose: true, - language: 'de', - format: 'yyyy-mm-dd' - }; - - this.disableIndicatorDatePicker = false; - - this.getLimitedDatePickerOptions = function(availableDates){ - + language: 'de', + format: 'yyyy-mm-dd' + }; + this.disableIndicatorDatePicker = false; + this.getLimitedDatePickerOptions = function (availableDates) { var months = new Map(); - var years = new Map(); - var yearMonths = new Map(); - for (const dateString of availableDates) { - var date = new Date(dateString); - var month = date.getMonth() + 1; - var year = date.getFullYear(); - var yearMonth = year + "-" + month; - - months.set(month, month); - years.set(year, year); - yearMonths.set(yearMonth, yearMonth); + var date = new Date(dateString); + var month = date.getMonth() + 1; + var year = date.getFullYear(); + var yearMonth = year + "-" + month; + months.set(month, month); + years.set(year, year); + yearMonths.set(yearMonth, yearMonth); } - var newDatePickerOptions = { - autoclose: true, - language: 'de', - format: 'yyyy-mm-dd', - endDate: new Date(availableDates[availableDates.length - 1]), - startDate: new Date(availableDates[0]), - defaultViewDate: new Date(availableDates[availableDates.length - 1]), - beforeShowDay: function(date) { - var month = (date.getMonth()+1); - if (month < 10 ){ - month = "0" + month; - } - var day = (date.getDate()); - if (day < 10 ){ - day = "0" + day; - } - var dateString = date.getFullYear() + "-" + month + "-" + day; - - if (availableDates.includes(dateString)) { - - return "enabled-datepicker-item"; - - } else { - - return "disabled disabled-datepicker-item"; - - } - }, - beforeShowMonth: function(date) { - var month = date.getMonth()+1; - var year = date.getFullYear(); - var yearMonth = year + "-" + month; - - if (yearMonths.has(yearMonth)) { - - return "enabled-datepicker-item"; - - } else { - - return "disabled disabled-datepicker-item"; - - } - }, - beforeShowYear: function(date) { - var year = date.getFullYear(); - - if (years.has(year)) { - - return "enabled-datepicker-item"; - - } else { - - return "disabled disabled-datepicker-item"; - - } - }, - beforeShowDecade: function(date) { - var year = date.getFullYear(); - - if (years.has(year)) { - - return "enabled-datepicker-item"; - - } else { - - return "disabled disabled-datepicker-item"; - - } - }, - beforeShowCentury: function(date) { - var year = date.getFullYear(); - - if (years.has(year)) { - - return "enabled-datepicker-item"; - - } else { - - return "disabled disabled-datepicker-item"; - - } - } + autoclose: true, + language: 'de', + format: 'yyyy-mm-dd', + endDate: new Date(availableDates[availableDates.length - 1]), + startDate: new Date(availableDates[0]), + defaultViewDate: new Date(availableDates[availableDates.length - 1]), + beforeShowDay: function (date) { + var month = (date.getMonth() + 1); + if (month < 10) { + month = "0" + month; + } + var day = (date.getDate()); + if (day < 10) { + day = "0" + day; + } + var dateString = date.getFullYear() + "-" + month + "-" + day; + if (availableDates.includes(dateString)) { + return "enabled-datepicker-item"; + } + else { + return "disabled disabled-datepicker-item"; + } + }, + beforeShowMonth: function (date) { + var month = date.getMonth() + 1; + var year = date.getFullYear(); + var yearMonth = year + "-" + month; + if (yearMonths.has(yearMonth)) { + return "enabled-datepicker-item"; + } + else { + return "disabled disabled-datepicker-item"; + } + }, + beforeShowYear: function (date) { + var year = date.getFullYear(); + if (years.has(year)) { + return "enabled-datepicker-item"; + } + else { + return "disabled disabled-datepicker-item"; + } + }, + beforeShowDecade: function (date) { + var year = date.getFullYear(); + if (years.has(year)) { + return "enabled-datepicker-item"; + } + else { + return "disabled disabled-datepicker-item"; + } + }, + beforeShowCentury: function (date) { + var year = date.getFullYear(); + if (years.has(year)) { + return "enabled-datepicker-item"; + } + else { + return "disabled disabled-datepicker-item"; + } + } }; - return newDatePickerOptions; - }; - - this.adminUserName = __env.adminUserName; - this.adminPassword = __env.adminPassword; - this.adminIsLoggedIn = false; - - this.availablePoiMarkerColors = [ + }; + this.adminUserName = __env.adminUserName; + this.adminPassword = __env.adminPassword; + this.adminIsLoggedIn = false; + this.availablePoiMarkerColors = [ { - "colorName" : "red", - "colorValue" : "rgb(205,59,40)" + "colorName": "red", + "colorValue": "rgb(205,59,40)" }, { - "colorName" : "white", - "colorValue" : "rgb(255,255,255)" + "colorName": "white", + "colorValue": "rgb(255,255,255)" }, { - "colorName" : "orange", - "colorValue" : "rgb(235,144,46)" + "colorName": "orange", + "colorValue": "rgb(235,144,46)" }, { - "colorName" : "beige", - "colorValue" : "rgb(255,198,138)" + "colorName": "beige", + "colorValue": "rgb(255,198,138)" }, { - "colorName" : "green", - "colorValue" : "rgb(108,166,36)" + "colorName": "green", + "colorValue": "rgb(108,166,36)" }, { - "colorName" : "blue", - "colorValue" : "rgb(53,161,209)" + "colorName": "blue", + "colorValue": "rgb(53,161,209)" }, { - "colorName" : "purple", - "colorValue" : "rgb(198,77,175)" + "colorName": "purple", + "colorValue": "rgb(198,77,175)" }, { - "colorName" : "pink", - "colorValue" : "rgb(255,138,232)" + "colorName": "pink", + "colorValue": "rgb(255,138,232)" }, { - "colorName" : "gray", - "colorValue" : "rgb(163,163,163)" + "colorName": "gray", + "colorValue": "rgb(163,163,163)" }, { - "colorName" : "black", - "colorValue" : "rgb(47,47,47)" + "colorName": "black", + "colorValue": "rgb(47,47,47)" } - ]; - - this.availableLoiDashArrayObjects = [ + ]; + this.availableLoiDashArrayObjects = [ { - "svgString" : '', - "dashArrayValue" : "" + "svgString": '', + "dashArrayValue": "" }, { - "svgString" : '', - "dashArrayValue" : "20" + "svgString": '', + "dashArrayValue": "20" }, { - "svgString" : '', - "dashArrayValue" : "20 10" + "svgString": '', + "dashArrayValue": "20 10" }, { - "svgString" : '', - "dashArrayValue" : "20 10 5 10" + "svgString": '', + "dashArrayValue": "20 10 5 10" }, { - "svgString" : '', - "dashArrayValue" : "5" + "svgString": '', + "dashArrayValue": "5" } - ]; - - this.getLoiDashSvgFromStringValue = function(loiDashArrayString){ + ]; + this.getLoiDashSvgFromStringValue = function (loiDashArrayString) { for (const loiDashArrayObject of this.availableLoiDashArrayObjects) { - if(loiDashArrayObject.dashArrayValue == loiDashArrayString){ - return loiDashArrayObject.svgString; - } + if (loiDashArrayObject.dashArrayValue == loiDashArrayString) { + return loiDashArrayObject.svgString; + } } - }; - - this.kommonitorMapServiceInstance = kommonitorMapService; - - this.updateIntervalOptions = __env.updateIntervalOptions; - this.indicatorTypeOptions = __env.indicatorTypeOptions; - this.indicatorUnitOptions = __env.indicatorUnitOptions.sort(); - this.indicatorCreationTypeOptions = __env.indicatorCreationTypeOptions; - this.geodataSourceFormats = __env.geodataSourceFormats; - - this.anySideBarIsShown = false; - - this.isMeasureOfValueChecked = false; - this.isBalanceChecked = false; - this.indicatorAndMetadataAsBalance; - this.tmpIndicatorGeoJSON = undefined; - - this.wmsUrlForSelectedIndicator = undefined; - this.wfsUrlForSelectedIndicator = undefined; - - this.baseUrlToKomMonitorDataAPI = __env.apiUrl + __env.basePath; - this.simplifyGeometriesParameterName = __env.simplifyGeometriesParameterName; - this.simplifyGeometriesOptions = __env.simplifyGeometriesOptions; - this.simplifyGeometries = __env.simplifyGeometries; - - this.wmsDatasets = __env.wmsDatasets.sort((a, b) => (a.title > b.title) ? 1 : -1); - this.wfsDatasets = __env.wfsDatasets.sort((a, b) => (a.title > b.title) ? 1 : -1); - this.wmsDatasets_keywordFiltered = JSON.parse(JSON.stringify(this.wmsDatasets)); - this.wfsDatasets_keywordFiltered = JSON.parse(JSON.stringify(this.wfsDatasets)); - - - this.fileDatasets = []; - - this.availableRoles = []; - this.availableUsers = []; - this.availableProcessScripts = []; - this.isochroneLegend; - - this.useOutlierDetectionOnIndicator = __env.useOutlierDetectionOnIndicator; - this.classifyZeroSeparately = __env.classifyZeroSeparately; - this.classifyUsingWholeTimeseries = __env.classifyUsingWholeTimeseries; - this.useNoDataToggle = __env.useNoDataToggle; - - this.getUpdateIntervalDisplayValue = function(apiValue){ + }; + this.kommonitorMapServiceInstance = kommonitorMapService; + this.updateIntervalOptions = __env.updateIntervalOptions; + this.indicatorTypeOptions = __env.indicatorTypeOptions; + this.indicatorUnitOptions = __env.indicatorUnitOptions.sort(); + this.indicatorCreationTypeOptions = __env.indicatorCreationTypeOptions; + this.geodataSourceFormats = __env.geodataSourceFormats; + this.anySideBarIsShown = false; + this.isMeasureOfValueChecked = false; + this.isBalanceChecked = false; + this.indicatorAndMetadataAsBalance; + this.tmpIndicatorGeoJSON = undefined; + this.wmsUrlForSelectedIndicator = undefined; + this.wfsUrlForSelectedIndicator = undefined; + this.baseUrlToKomMonitorDataAPI = __env.apiUrl + __env.basePath; + this.simplifyGeometriesParameterName = __env.simplifyGeometriesParameterName; + this.simplifyGeometriesOptions = __env.simplifyGeometriesOptions; + this.simplifyGeometries = __env.simplifyGeometries; + this.wmsDatasets = __env.wmsDatasets.sort((a, b) => (a.title > b.title) ? 1 : -1); + this.wfsDatasets = __env.wfsDatasets.sort((a, b) => (a.title > b.title) ? 1 : -1); + this.wmsDatasets_keywordFiltered = JSON.parse(JSON.stringify(this.wmsDatasets)); + this.wfsDatasets_keywordFiltered = JSON.parse(JSON.stringify(this.wfsDatasets)); + this.fileDatasets = []; + this.availableRoles = []; + this.availableUsers = []; + this.availableProcessScripts = []; + this.isochroneLegend; + this.useOutlierDetectionOnIndicator = __env.useOutlierDetectionOnIndicator; + this.classifyZeroSeparately = __env.classifyZeroSeparately; + this.classifyUsingWholeTimeseries = __env.classifyUsingWholeTimeseries; + this.useNoDataToggle = __env.useNoDataToggle; + this.getUpdateIntervalDisplayValue = function (apiValue) { for (const updateIntervalOption of this.updateIntervalOptions) { - if(updateIntervalOption.apiName === apiValue){ - return updateIntervalOption.displayName - } + if (updateIntervalOption.apiName === apiValue) { + return updateIntervalOption.displayName; + } } - }; - - this.getBaseUrlToKomMonitorDataAPI_spatialResource = function(){ + }; + this.getBaseUrlToKomMonitorDataAPI_spatialResource = function () { return this.baseUrlToKomMonitorDataAPI + kommonitorCacheHelperService.spatialResourceGETUrlPath_forAuthentication; - }; - - this.setProcessScripts = function(scriptsArray){ - this.availableProcessScripts = scriptsArray; + }; + this.setProcessScripts = function (scriptsArray) { + this.availableProcessScripts = scriptsArray; this.availableProcessScripts_map = new Map(); for (const scriptMetadata of scriptsArray) { - this.availableProcessScripts_map.set(scriptMetadata.scriptId, scriptMetadata); + this.availableProcessScripts_map.set(scriptMetadata.scriptId, scriptMetadata); } - }; - - this.addSingleProcessScriptMetadata = function(processScriptMetadata){ + }; + this.addSingleProcessScriptMetadata = function (processScriptMetadata) { let tmpArray = [processScriptMetadata]; Array.prototype.push.apply(tmpArray, this.availableProcessScripts); - this.availableProcessScripts = tmpArray; + this.availableProcessScripts = tmpArray; this.availableProcessScripts_map.set(processScriptMetadata.scriptId, processScriptMetadata); - }; - - this.replaceSingleProcessScriptMetadata = function(processScriptMetadata){ + }; + this.replaceSingleProcessScriptMetadata = function (processScriptMetadata) { for (let index = 0; index < this.availableProcessScripts.length; index++) { - let processScript = this.availableProcessScripts[index]; - if(processScript.scriptId == processScriptMetadata.scriptId){ - this.availableProcessScripts[index] = processScriptMetadata; - break; - } + let processScript = this.availableProcessScripts[index]; + if (processScript.scriptId == processScriptMetadata.scriptId) { + this.availableProcessScripts[index] = processScriptMetadata; + break; + } } this.availableProcessScripts_map.set(processScriptMetadata.scriptId, processScriptMetadata); - }; - - this.deleteSingleProcessScriptMetadata = function(processScriptId){ + }; + this.deleteSingleProcessScriptMetadata = function (processScriptId) { for (let index = 0; index < this.availableProcessScripts.length; index++) { - const processScript = this.availableProcessScripts[index]; - if(processScript.scriptId == processScriptId){ - this.availableProcessScripts.splice(index, 1); - break; - } + const processScript = this.availableProcessScripts[index]; + if (processScript.scriptId == processScriptId) { + this.availableProcessScripts.splice(index, 1); + break; + } } this.availableProcessScripts_map.delete(processScriptId); - }; - - this.getProcessScriptMetadataById = function(scriptId){ + }; + this.getProcessScriptMetadataById = function (scriptId) { return this.availableProcessScripts_map.get(scriptId); - }; - - - // ERROR HANDLING - this.errorMessage = undefined; - this.hideErrorAlert = function(){ + }; + // ERROR HANDLING + this.errorMessage = undefined; + this.hideErrorAlert = function () { $(".mapApplicationErrorAlert").hide(); - }; - - this.displayMapApplicationError = function(error){ + }; + this.displayMapApplicationError = function (error) { $timeout(function () { - if(error.data){ - self.errorMessage = self.syntaxHighlightJSON(error.data); + if (error.data) { + self.errorMessage = self.syntaxHighlightJSON(error.data); } - if(error.message){ - self.errorMessage = self.syntaxHighlightJSON(error.message); + if (error.message) { + self.errorMessage = self.syntaxHighlightJSON(error.message); } - else{ - self.errorMessage = self.syntaxHighlightJSON(error); + else { + self.errorMessage = self.syntaxHighlightJSON(error); } - // $rootScope.$apply(); $rootScope.$broadcast("hideLoadingIconOnMap"); - $(".mapApplicationErrorAlert").show(); - }, 1000); - - }; - - // SPATIAL UNITS - - this.availableSpatialUnits = []; - - this.selectedSpatialUnit; - this.selectedDate; - - this.setSpatialUnits = function(spatialUnitsArray){ - this.availableSpatialUnits = spatialUnitsArray; + }, 1000); + }; + // SPATIAL UNITS + this.availableSpatialUnits = []; + this.selectedSpatialUnit; + this.selectedDate; + this.setSpatialUnits = function (spatialUnitsArray) { + this.availableSpatialUnits = spatialUnitsArray; this.availableSpatialUnits_map = new Map(); for (const spatialUnitMetadata of spatialUnitsArray) { - this.availableSpatialUnits_map.set(spatialUnitMetadata.spatialUnitId, spatialUnitMetadata); + this.availableSpatialUnits_map.set(spatialUnitMetadata.spatialUnitId, spatialUnitMetadata); } - }; - - this.addSingleSpatialUnitMetadata = function(spatialUnitMetadata){ + }; + this.addSingleSpatialUnitMetadata = function (spatialUnitMetadata) { let tmpArray = [spatialUnitMetadata]; Array.prototype.push.apply(tmpArray, this.availableSpatialUnits); - this.availableSpatialUnits = tmpArray; + this.availableSpatialUnits = tmpArray; this.availableSpatialUnits_map.set(spatialUnitMetadata.spatialUnitId, spatialUnitMetadata); - }; - - this.replaceSingleSpatialUnitMetadata = function(spatialUnitMetadata){ + }; + this.replaceSingleSpatialUnitMetadata = function (spatialUnitMetadata) { for (let index = 0; index < this.availableSpatialUnits.length; index++) { - let spatialUnit = this.availableSpatialUnits[index]; - if(spatialUnit.spatialUnitId == spatialUnitMetadata.spatialUnitId){ - this.availableSpatialUnits[index] = spatialUnitMetadata; - break; - } + let spatialUnit = this.availableSpatialUnits[index]; + if (spatialUnit.spatialUnitId == spatialUnitMetadata.spatialUnitId) { + this.availableSpatialUnits[index] = spatialUnitMetadata; + break; + } } this.availableSpatialUnits_map.set(spatialUnitMetadata.spatialUnitId, spatialUnitMetadata); - }; - - this.deleteSingleSpatialUnitMetadata = function(spatialUnitId){ + }; + this.deleteSingleSpatialUnitMetadata = function (spatialUnitId) { for (let index = 0; index < this.availableSpatialUnits.length; index++) { - const spatialUnit = this.availableSpatialUnits[index]; - if(spatialUnit.spatialUnitId == spatialUnitId){ - this.availableSpatialUnits.splice(index, 1); - break; - } + const spatialUnit = this.availableSpatialUnits[index]; + if (spatialUnit.spatialUnitId == spatialUnitId) { + this.availableSpatialUnits.splice(index, 1); + break; + } } this.availableSpatialUnits_map.delete(spatialUnitId); - }; - - // GEORESOURCES - - this.availableGeoresources = []; - this.displayableGeoresources = []; - this.displayableGeoresources_keywordFiltered = []; - this.displayableGeoresources_keywordFiltered_forAlphabeticalDisplay = {}; - - this.selectedGeoresource; - - this.setGeoresources = function(georesourcesArray){ - this.availableGeoresources = georesourcesArray; - + }; + // GEORESOURCES + this.availableGeoresources = []; + this.displayableGeoresources = []; + this.displayableGeoresources_keywordFiltered = []; + this.displayableGeoresources_keywordFiltered_forAlphabeticalDisplay = {}; + this.selectedGeoresource; + this.setGeoresources = function (georesourcesArray) { + this.availableGeoresources = georesourcesArray; this.availableGeoresources_map = new Map(); for (const georesourceMetadata of georesourcesArray) { - this.availableGeoresources_map.set(georesourceMetadata.georesourceId, georesourceMetadata); + this.availableGeoresources_map.set(georesourceMetadata.georesourceId, georesourceMetadata); } - this.displayableGeoresources = this.availableGeoresources.filter(item => self.isDisplayableGeoresource(item)); this.displayableGeoresources_keywordFiltered = JSON.parse(JSON.stringify(this.displayableGeoresources)); - this.wmsDatasets_keywordFiltered = JSON.parse(JSON.stringify(this.wmsDatasets)); this.wfsDatasets_keywordFiltered = JSON.parse(JSON.stringify(this.wfsDatasets)); - this.displayableGeoresources_keywordFiltered_forAlphabeticalDisplay = { - poiData: this.displayableGeoresources_keywordFiltered.filter(item => item.isPOI), - loiData: this.displayableGeoresources_keywordFiltered.filter(item => item.isLOI), - aoiData: this.displayableGeoresources_keywordFiltered.filter(item => item.isAOI), - wmsData: this.wmsDatasets_keywordFiltered, - wfsData: this.wfsDatasets_keywordFiltered + poiData: this.displayableGeoresources_keywordFiltered.filter(item => item.isPOI), + loiData: this.displayableGeoresources_keywordFiltered.filter(item => item.isLOI), + aoiData: this.displayableGeoresources_keywordFiltered.filter(item => item.isAOI), + wmsData: this.wmsDatasets_keywordFiltered, + wfsData: this.wfsDatasets_keywordFiltered }; - }; - - this.addSingleGeoresourceMetadata = function(georesourceMetadata){ + }; + this.addSingleGeoresourceMetadata = function (georesourceMetadata) { let tmpArray = [georesourceMetadata]; Array.prototype.push.apply(tmpArray, this.availableGeoresources); - this.availableGeoresources = tmpArray; + this.availableGeoresources = tmpArray; this.availableGeoresources_map.set(georesourceMetadata.georesourceId, georesourceMetadata); - }; - - this.replaceSingleGeoresourceMetadata = function(georesourceMetadata){ + }; + this.replaceSingleGeoresourceMetadata = function (georesourceMetadata) { for (let index = 0; index < this.availableGeoresources.length; index++) { - let georesource = this.availableGeoresources[index]; - if(georesource.georesourceId == georesourceMetadata.georesourceId){ - this.availableGeoresources[index] = georesourceMetadata; - break; - } + let georesource = this.availableGeoresources[index]; + if (georesource.georesourceId == georesourceMetadata.georesourceId) { + this.availableGeoresources[index] = georesourceMetadata; + break; + } } this.availableGeoresources_map.set(georesourceMetadata.georesourceId, georesourceMetadata); - }; - - this.deleteSingleGeoresourceMetadata = function(georesourceId){ + }; + this.deleteSingleGeoresourceMetadata = function (georesourceId) { for (let index = 0; index < this.availableGeoresources.length; index++) { - const georesource = this.availableGeoresources[index]; - if(georesource.georesourceId == georesourceId){ - this.availableGeoresources.splice(index, 1); - break; - } + const georesource = this.availableGeoresources[index]; + if (georesource.georesourceId == georesourceId) { + this.availableGeoresources.splice(index, 1); + break; + } } this.availableGeoresources_map.delete(georesourceId); - }; - - // INDICATORS - - this.availableIndicators = []; - this.displayableIndicators = []; - - this.selectedIndicator; - // backup used when switching themes --< this might make selectedIndicator undefined due to filtering list of theme-matching indicators - this.selectedIndicatorBackup; - this.wmsUrlForSelectedIndicator; - this.wfsUrlForSelectedIndicator; - - this.selectedIndicatorLegendURL; - - this.measureOfValue = 51; - - // updateInterval (from kommonitor data management api) = ['ARBITRARY', 'MONTHLY', 'QUARTERLY', 'HALF_YEARLY', 'YEARLY'] - this.updateInterval = new Map(); - this.updateInterval.set("ARBITRARY", "beliebig"); - this.updateInterval.set("YEARLY", "jährlich"); - this.updateInterval.set("HALF_YEARLY", "halbjährig"); - this.updateInterval.set("MONTHLY", "monatlich"); - this.updateInterval.set("QUARTERLY", "vierteljährlich"); - - this.setIndicators = function(indicatorsArray){ - this.availableIndicators = indicatorsArray; + }; + // INDICATORS + this.availableIndicators = []; + this.displayableIndicators = []; + this.selectedIndicator; + // backup used when switching themes --< this might make selectedIndicator undefined due to filtering list of theme-matching indicators + this.selectedIndicatorBackup; + this.wmsUrlForSelectedIndicator; + this.wfsUrlForSelectedIndicator; + this.selectedIndicatorLegendURL; + this.measureOfValue = 51; + // updateInterval (from kommonitor data management api) = ['ARBITRARY', 'MONTHLY', 'QUARTERLY', 'HALF_YEARLY', 'YEARLY'] + this.updateInterval = new Map(); + this.updateInterval.set("ARBITRARY", "beliebig"); + this.updateInterval.set("YEARLY", "jährlich"); + this.updateInterval.set("HALF_YEARLY", "halbjährig"); + this.updateInterval.set("MONTHLY", "monatlich"); + this.updateInterval.set("QUARTERLY", "vierteljährlich"); + this.setIndicators = function (indicatorsArray) { + this.availableIndicators = indicatorsArray; this.availableIndicators_map = new Map(); - for (const indicatorMetadata of indicatorsArray) { - this.availableIndicators_map.set(indicatorMetadata.indicatorId, indicatorMetadata); + this.availableIndicators_map.set(indicatorMetadata.indicatorId, indicatorMetadata); } - }; - - this.addSingleIndicatorMetadata = function(indicatorMetadata){ + }; + this.addSingleIndicatorMetadata = function (indicatorMetadata) { let tmpArray = [indicatorMetadata]; Array.prototype.push.apply(tmpArray, this.availableIndicators); - this.availableIndicators = tmpArray; + this.availableIndicators = tmpArray; this.availableIndicators_map.set(indicatorMetadata.indicatorId, indicatorMetadata); - }; - - this.replaceSingleIndicatorMetadata = function(indicatorMetadata){ + }; + this.replaceSingleIndicatorMetadata = function (indicatorMetadata) { for (let index = 0; index < this.availableIndicators.length; index++) { - let indicator = this.availableIndicators[index]; - if(indicator.indicatorId == indicatorMetadata.indicatorId){ - this.availableIndicators[index] = indicatorMetadata; - break; - } + let indicator = this.availableIndicators[index]; + if (indicator.indicatorId == indicatorMetadata.indicatorId) { + this.availableIndicators[index] = indicatorMetadata; + break; + } } this.availableIndicators_map.set(indicatorMetadata.indicatorId, indicatorMetadata); - }; - - this.deleteSingleIndicatorMetadata = function(indicatorId){ + }; + this.deleteSingleIndicatorMetadata = function (indicatorId) { for (let index = 0; index < this.availableIndicators.length; index++) { - const indicator = this.availableIndicators[index]; - if(indicator.indicatorId == indicatorId){ - this.availableIndicators.splice(index, 1); - break; - } + const indicator = this.availableIndicators[index]; + if (indicator.indicatorId == indicatorId) { + this.availableIndicators.splice(index, 1); + break; + } } this.availableIndicators_map.delete(indicatorId); - }; - - - // TOPICS - - this.availableTopics = []; - - this.selectedTopic; - - this.setTopics = function(topicsArray){ - this.availableTopics = topicsArray; - }; - - this.topicHierarchyContainsGeoresource = function(topic, georesourceMetadata){ + }; + // TOPICS + this.availableTopics = []; + this.selectedTopic; + this.setTopics = function (topicsArray) { + this.availableTopics = topicsArray; + }; + this.topicHierarchyContainsGeoresource = function (topic, georesourceMetadata) { // luckily, the topicReference is defined exactly like for indicators // hence we can simply refer to that method - return this.topicHierarchyContainsIndicator(topic, georesourceMetadata); - }; - - this.topicHierarchyContainsWms = function(topic, wmsMetadata){ + }; + this.topicHierarchyContainsWms = function (topic, wmsMetadata) { // luckily, the topicReference is defined exactly like for indicators // hence we can simply refer to that method - return this.topicHierarchyContainsIndicator(topic, wmsMetadata); - }; - - this.topicHierarchyContainsWfs = function(topic, wfsMetadata){ + }; + this.topicHierarchyContainsWfs = function (topic, wfsMetadata) { // luckily, the topicReference is defined exactly like for indicators // hence we can simply refer to that method - return this.topicHierarchyContainsIndicator(topic, wfsMetadata); - }; - - this.topicHierarchyContainsIndicator = function(topic, indicatorMetadata){ - if(topic === null || topic === ""){ - if (indicatorMetadata.topicReference === null || indicatorMetadata.topicReference === "" || ! this.referencedTopicIdExists(indicatorMetadata.topicReference)){ - return true; - } - else{ - return false; - } + }; + this.topicHierarchyContainsIndicator = function (topic, indicatorMetadata) { + if (topic === null || topic === "") { + if (indicatorMetadata.topicReference === null || indicatorMetadata.topicReference === "" || !this.referencedTopicIdExists(indicatorMetadata.topicReference)) { + return true; + } + else { + return false; + } } - - if (topic.topicId === indicatorMetadata.topicReference){ - return true; + if (topic.topicId === indicatorMetadata.topicReference) { + return true; } - else{ - return this.anySubTopicContainsIndicator(topic, indicatorMetadata); + else { + return this.anySubTopicContainsIndicator(topic, indicatorMetadata); } - }; - - this.anySubTopicContainsIndicator = function(topic, indicatorMetadata){ + }; + this.anySubTopicContainsIndicator = function (topic, indicatorMetadata) { var isContained = false; - for (const subTopic of topic.subTopics) { - isContained = this.topicHierarchyContainsIndicator(subTopic, indicatorMetadata); - - if(isContained){ - break; - } + isContained = this.topicHierarchyContainsIndicator(subTopic, indicatorMetadata); + if (isContained) { + break; + } } - return isContained; - }; - - // topic may be null - this.getGeoresourceDatasets = function(topic, georesourceNameFilter, showPOI, showLOI, showAOI, showWMS, showWFS){ - var availableGeoresources = this.getAvailableGeoresources(topic, georesourceNameFilter, showPOI, showLOI, showAOI); + }; + // topic may be null + this.getGeoresourceDatasets = function (topic, georesourceNameFilter, showPOI, showLOI, showAOI, showWMS, showWFS) { + var availableGeoresources = this.getAvailableGeoresources(topic, georesourceNameFilter, showPOI, showLOI, showAOI); var wmsDatasets = this.getAvailableWmsDatasets(topic, georesourceNameFilter, showWMS); var wfsDatasets = this.getAvailableWfsDatasets(topic, georesourceNameFilter, showWFS); - var datasets = availableGeoresources.concat(wmsDatasets).concat(wfsDatasets); return datasets; - }; - - this.getNumberOfGeoresources = function(topic, georesourceNameFilter, showPOI, showLOI, showAOI, showWMS, showWFS){ - - var numberOfAvailableGeoresources = this.getNumberOfAvailableGeoresources(topic, georesourceNameFilter, showPOI, showLOI, showAOI); + }; + this.getNumberOfGeoresources = function (topic, georesourceNameFilter, showPOI, showLOI, showAOI, showWMS, showWFS) { + var numberOfAvailableGeoresources = this.getNumberOfAvailableGeoresources(topic, georesourceNameFilter, showPOI, showLOI, showAOI); var numberOfWmsDatasets = this.getNumberOfAvailableWmsDatasets(topic, georesourceNameFilter, showWMS); var numberOfWfsDatasets = this.getNumberOfAvailableWfsDatasets(topic, georesourceNameFilter, showWFS); - var numberOfResources = numberOfAvailableGeoresources + numberOfWmsDatasets + numberOfWfsDatasets; return numberOfResources; - }; - - var filterGeoresourcesByTypes = function(georesourceMetadataArray, showPOI, showLOI, showAOI){ - - if(!showPOI && !showLOI && !showAOI){ - return []; - } - - return georesourceMetadataArray.filter(georesourceMetadata => { - if(georesourceMetadata.isPOI){ - if(showPOI){ - return true; - } - else{ - return false; + }; + var filterGeoresourcesByTypes = function (georesourceMetadataArray, showPOI, showLOI, showAOI) { + if (!showPOI && !showLOI && !showAOI) { + return []; + } + return georesourceMetadataArray.filter(georesourceMetadata => { + if (georesourceMetadata.isPOI) { + if (showPOI) { + return true; + } + else { + return false; + } } - } - else if(georesourceMetadata.isLOI){ - if(showLOI){ - return true; + else if (georesourceMetadata.isLOI) { + if (showLOI) { + return true; + } + else { + return false; + } } - else{ - return false; + else if (georesourceMetadata.isAOI) { + if (showAOI) { + return true; + } + else { + return false; + } } - } - else if(georesourceMetadata.isAOI){ - if(showAOI){ - return true; - } - else{ - return false; + else { + return false; } - } - else{ - return false; - } }); - }; - - this.getAvailableGeoresources = function(topic, georesourceNameFilter, showPOI, showLOI, showAOI){ + }; + this.getAvailableGeoresources = function (topic, georesourceNameFilter, showPOI, showLOI, showAOI) { var georesources = []; - var filteredGeoresources = this.availableGeoresources; - filteredGeoresources = filterByGeoresourceNamesToHide(filteredGeoresources); - - if(georesourceNameFilter && georesourceNameFilter != ""){ - filteredGeoresources = filterArrayObjectsByValue(filteredGeoresources, georesourceNameFilter); + if (georesourceNameFilter && georesourceNameFilter != "") { + filteredGeoresources = filterArrayObjectsByValue(filteredGeoresources, georesourceNameFilter); } - filteredGeoresources = filterGeoresourcesByTypes(filteredGeoresources, showPOI, showLOI, showAOI); - - for (const georesourceMetadata of filteredGeoresources) { - if (this.topicHierarchyContainsGeoresource(topic, georesourceMetadata)){ - georesources.push(georesourceMetadata); - } + for (const georesourceMetadata of filteredGeoresources) { + if (this.topicHierarchyContainsGeoresource(topic, georesourceMetadata)) { + georesources.push(georesourceMetadata); + } } - return georesources; - }; - - this.getNumberOfAvailableGeoresources = function(topic, georesourceNameFilter, showPOI, showLOI, showAOI){ + }; + this.getNumberOfAvailableGeoresources = function (topic, georesourceNameFilter, showPOI, showLOI, showAOI) { return this.getAvailableGeoresources(topic, georesourceNameFilter, showPOI, showLOI, showAOI).length; - }; - - this.getAvailableWmsDatasets = function(topic, georesourceNameFilter, showWMS){ - if(!showWMS){ - return []; + }; + this.getAvailableWmsDatasets = function (topic, georesourceNameFilter, showWMS) { + if (!showWMS) { + return []; } - var wmsDatasets = []; - var filteredWmsDatasets = this.wmsDatasets; - - if(georesourceNameFilter && georesourceNameFilter != ""){ - filteredWmsDatasets = filterArrayObjectsByValue(filteredWmsDatasets, georesourceNameFilter); + if (georesourceNameFilter && georesourceNameFilter != "") { + filteredWmsDatasets = filterArrayObjectsByValue(filteredWmsDatasets, georesourceNameFilter); } - for (const wmsMetadata of filteredWmsDatasets) { - if (this.topicHierarchyContainsWms(topic, wmsMetadata)){ - wmsDatasets.push(wmsMetadata); - } + if (this.topicHierarchyContainsWms(topic, wmsMetadata)) { + wmsDatasets.push(wmsMetadata); + } } - return wmsDatasets; - }; - - this.getNumberOfAvailableWmsDatasets = function(topic, georesourceNameFilter, showWMS){ - if(!showWMS){ - return 0; + }; + this.getNumberOfAvailableWmsDatasets = function (topic, georesourceNameFilter, showWMS) { + if (!showWMS) { + return 0; } - return this.getAvailableWmsDatasets(topic, georesourceNameFilter, showWMS).length; - }; - - this.getAvailableWfsDatasets = function(topic, georesourceNameFilter, showWFS){ - if(!showWFS){ - return []; + }; + this.getAvailableWfsDatasets = function (topic, georesourceNameFilter, showWFS) { + if (!showWFS) { + return []; } - var wfsDatasets = []; - var filteredWfsDatasets = this.wfsDatasets; - - if(georesourceNameFilter && georesourceNameFilter != ""){ - filteredWfsDatasets = filterArrayObjectsByValue(filteredWfsDatasets, georesourceNameFilter); + if (georesourceNameFilter && georesourceNameFilter != "") { + filteredWfsDatasets = filterArrayObjectsByValue(filteredWfsDatasets, georesourceNameFilter); } - for (const wfsMetadata of filteredWfsDatasets) { - if (this.topicHierarchyContainsWms(topic, wfsMetadata)){ - wfsDatasets.push(wfsMetadata); - } + if (this.topicHierarchyContainsWms(topic, wfsMetadata)) { + wfsDatasets.push(wfsMetadata); + } } - return wfsDatasets; - }; - - this.getNumberOfAvailableWfsDatasets = function(topic, georesourceNameFilter, showWFS){ - if(!showWFS){ - return 0; + }; + this.getNumberOfAvailableWfsDatasets = function (topic, georesourceNameFilter, showWFS) { + if (!showWFS) { + return 0; } - return this.getAvailableWfsDatasets(topic, georesourceNameFilter, showWFS).length; - }; - - this.getNumberOfIndicators = function(topic, indicatorNameFilter){ + }; + this.getNumberOfIndicators = function (topic, indicatorNameFilter) { var numberOfIndicators = 0; - var filteredIndicators = this.availableIndicators; - - if(indicatorNameFilter && indicatorNameFilter != ""){ - filteredIndicators = filterArrayObjectsByValue(this.availableIndicators, indicatorNameFilter); + if (indicatorNameFilter && indicatorNameFilter != "") { + filteredIndicators = filterArrayObjectsByValue(this.availableIndicators, indicatorNameFilter); } - filteredIndicators = filterByIndicatorNamesToHide(filteredIndicators); - for (const indicatorMetadata of filteredIndicators) { - if (this.topicHierarchyContainsIndicator(topic, indicatorMetadata)){ - numberOfIndicators++; - } + if (this.topicHierarchyContainsIndicator(topic, indicatorMetadata)) { + numberOfIndicators++; + } } - return numberOfIndicators; - }; - - var filterByIndicatorNamesToHide = function(filteredIndicators){ - - return filteredIndicators.filter(indicatorMetadata => { - return isDisplayableIndicator(indicatorMetadata); + }; + var filterByIndicatorNamesToHide = function (filteredIndicators) { + return filteredIndicators.filter(indicatorMetadata => { + return isDisplayableIndicator(indicatorMetadata); }); - }; - - var filterByGeoresourceNamesToHide = function(filteredGeoresources){ - - return filteredGeoresources.filter(georesourceMetadata => { - return self.isDisplayableGeoresource(georesourceMetadata); + }; + var filterByGeoresourceNamesToHide = function (filteredGeoresources) { + return filteredGeoresources.filter(georesourceMetadata => { + return self.isDisplayableGeoresource(georesourceMetadata); }); - }; - - var filterArrayObjectsByValue = function (array, string) { - return array.filter(o => { - return Object.keys(o).some(k => { - if (typeof o[k] === 'string') - return o[k].toLowerCase().includes(string.toLowerCase()); - }); - }); - }; - - this.getIndicatorMetadataById = function(indicatorId){ + }; + var filterArrayObjectsByValue = function (array, string) { + return array.filter(o => { + return Object.keys(o).some(k => { + if (typeof o[k] === 'string') + return o[k].toLowerCase().includes(string.toLowerCase()); + }); + }); + }; + this.getIndicatorMetadataById = function (indicatorId) { return this.availableIndicators_map.get(indicatorId); - }; - - this.getGeoresourceMetadataById = function(georesourceId){ + }; + this.getGeoresourceMetadataById = function (georesourceId) { return this.availableGeoresources_map.get(georesourceId); - }; - - this.getSpatialUnitMetadataById = function(spatialUnitId){ + }; + this.getSpatialUnitMetadataById = function (spatialUnitId) { return this.availableSpatialUnits_map.get(spatialUnitId); - }; - - this.getIndicatorAbbreviationFromIndicatorId = function(indicatorId){ + }; + this.getIndicatorAbbreviationFromIndicatorId = function (indicatorId) { for (var indicatorMetadata of this.availableIndicators) { - if (indicatorMetadata.indicatorId === indicatorId){ - return indicatorMetadata.abbreviation; - } + if (indicatorMetadata.indicatorId === indicatorId) { + return indicatorMetadata.abbreviation; + } } - }; - - this.getIndicatorNameFromIndicatorId = function(indicatorId){ + }; + this.getIndicatorNameFromIndicatorId = function (indicatorId) { for (var indicatorMetadata of this.availableIndicators) { - if (indicatorMetadata.indicatorId === indicatorId){ - return indicatorMetadata.indicatorName; - } + if (indicatorMetadata.indicatorId === indicatorId) { + return indicatorMetadata.indicatorName; + } } - }; - - this.getGeoresourceNameFromGeoresourceId = function(georesourceId){ + }; + this.getGeoresourceNameFromGeoresourceId = function (georesourceId) { for (var georesourceMetadata of this.availableGeoresources) { - if (georesourceMetadata.georesourceId === georesourceId){ - return georesourceMetadata.datasetName; - } + if (georesourceMetadata.georesourceId === georesourceId) { + return georesourceMetadata.datasetName; + } } - }; - - this.referencedTopicIdExists = function(topicId){ + }; + this.referencedTopicIdExists = function (topicId) { var topicHierarchy = this.getTopicHierarchyForTopicId(topicId); - - if(topicHierarchy.length === 0){ - return false; + if (topicHierarchy.length === 0) { + return false; } - else{ - return true; + else { + return true; } - }; - - this.getTopicHierarchyForTopicId = function(topicReferenceId){ + }; + this.getTopicHierarchyForTopicId = function (topicReferenceId) { // create an array respresenting the topic hierarchy // i.e. [mainTopic_firstTier, subTopic_secondTier, subTopic_thirdTier, ...] var topicHierarchyArray = []; - for (var i = 0; i < this.availableTopics.length; i++) { - - var mainTopicCandidate = this.availableTopics[i]; - - if(mainTopicCandidate.topicId === topicReferenceId){ - topicHierarchyArray.push(mainTopicCandidate); - break; - } - - else if(this.findIdInAnySubTopicHierarchy(topicReferenceId, mainTopicCandidate.subTopics)){ - topicHierarchyArray.push(mainTopicCandidate); - topicHierarchyArray = this.addSubTopicHierarchy(topicHierarchyArray, topicReferenceId, mainTopicCandidate.subTopics); - } + var mainTopicCandidate = this.availableTopics[i]; + if (mainTopicCandidate.topicId === topicReferenceId) { + topicHierarchyArray.push(mainTopicCandidate); + break; + } + else if (this.findIdInAnySubTopicHierarchy(topicReferenceId, mainTopicCandidate.subTopics)) { + topicHierarchyArray.push(mainTopicCandidate); + topicHierarchyArray = this.addSubTopicHierarchy(topicHierarchyArray, topicReferenceId, mainTopicCandidate.subTopics); + } } - return topicHierarchyArray; - }; - - this.findIdInAnySubTopicHierarchy = function(topicReferenceId, subTopicsArray){ + }; + this.findIdInAnySubTopicHierarchy = function (topicReferenceId, subTopicsArray) { for (let index = 0; index < subTopicsArray.length; index++) { - const subTopicCandidate = subTopicsArray[index]; - - if(subTopicCandidate.topicId === topicReferenceId){ - return true; - } - - else if(this.findIdInAnySubTopicHierarchy(topicReferenceId, subTopicCandidate.subTopics)){ - return true; - } + const subTopicCandidate = subTopicsArray[index]; + if (subTopicCandidate.topicId === topicReferenceId) { + return true; + } + else if (this.findIdInAnySubTopicHierarchy(topicReferenceId, subTopicCandidate.subTopics)) { + return true; + } } - return false; - }; - - this.addSubTopicHierarchy = function(topicHierarchyArray, topicReferenceId, subTopicsArray){ + }; + this.addSubTopicHierarchy = function (topicHierarchyArray, topicReferenceId, subTopicsArray) { for (let index = 0; index < subTopicsArray.length; index++) { - const subTopicCandidate = subTopicsArray[index]; - - if(subTopicCandidate.topicId === topicReferenceId){ - topicHierarchyArray.push(subTopicCandidate); - break; - } - - else if(this.findIdInAnySubTopicHierarchy(topicReferenceId, subTopicCandidate.subTopics)){ - topicHierarchyArray.push(subTopicCandidate); - topicHierarchyArray = this.addSubTopicHierarchy(topicHierarchyArray, topicReferenceId, subTopicCandidate.subTopics); - } + const subTopicCandidate = subTopicsArray[index]; + if (subTopicCandidate.topicId === topicReferenceId) { + topicHierarchyArray.push(subTopicCandidate); + break; + } + else if (this.findIdInAnySubTopicHierarchy(topicReferenceId, subTopicCandidate.subTopics)) { + topicHierarchyArray.push(subTopicCandidate); + topicHierarchyArray = this.addSubTopicHierarchy(topicHierarchyArray, topicReferenceId, subTopicCandidate.subTopics); + } } - return topicHierarchyArray; - }; - - this.syntaxHighlightJSON = function(json) { - if (typeof json != 'string') { - json = JSON.stringify(json, undefined, 2); - } - json = json.replace(/&/g, '&').replace(//g, '>'); - return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match) { - var cls = 'number'; - if (/^"/.test(match)) { - if (/:$/.test(match)) { - cls = 'key'; - } else { - cls = 'string'; - } - } else if (/true|false/.test(match)) { - cls = 'boolean'; - } else if (/null/.test(match)) { - cls = 'null'; - } - return '' + match + ''; - }); - }; - - - - this.extendKeycloakSession = function () { + }; + this.syntaxHighlightJSON = function (json) { + if (typeof json != 'string') { + json = JSON.stringify(json, undefined, 2); + } + json = json.replace(/&/g, '&').replace(//g, '>'); + return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match) { + var cls = 'number'; + if (/^"/.test(match)) { + if (/:$/.test(match)) { + cls = 'key'; + } + else { + cls = 'string'; + } + } + else if (/true|false/.test(match)) { + cls = 'boolean'; + } + else if (/null/.test(match)) { + cls = 'null'; + } + return '' + match + ''; + }); + }; + this.extendKeycloakSession = function () { // Auth.keycloak.updateToken(5).then(function () { // console.log("keycloak token refreshed."); // }).catch(function () { // console.error('Failed to refresh token. Will redirect to Login screen'); // Auth.keycloak.login(); // }); - Auth.keycloak.login(); - }; - - this.tryLogoutUser = function() { + }; + this.tryLogoutUser = function () { Auth.keycloak.logout(); - }; - - var startCheckSessionExpiration = function(){ + }; + var startCheckSessionExpiration = function () { $interval(function () { - // minutes until current browser session invalidates - // use refresh token as this is used when calling "updateToken" keycloak method. Only if that is invalid the whole session is invalid - self.keycloakTokenExpirationInfo = Math.round((Auth.keycloak.refreshTokenParsed.exp + Auth.keycloak.timeSkew - new Date().getTime() / 1000) / 60); - if(! self.keycloakTokenExpirationInfo){ - self.keycloakTokenExpirationInfo = 30; - } - - // if session is expired then show warning to User! - if (self.keycloakTokenExpirationInfo < 0){ - self.keycloakTokenExpirationInfo = 0; - self.displayMapApplicationError("Ihre aktuelle Login-Session ist abgelaufen. Sie müssen sich neu einloggen. Nutzen Sie dazu das User-Menü oben rechts."); - } - - }, 1000 * 60); - }; - - /* - * FETCH INITIAL METADATA ABOUT EACH RESOURCE - */ - - // $rootScope.$on("$locationChangeStart", function(event){ - // self.fetchAllMetadata(); - // self.adminIsLoggedIn = false; - // }); - - this.fetchAllMetadata = async function(){ + // minutes until current browser session invalidates + // use refresh token as this is used when calling "updateToken" keycloak method. Only if that is invalid the whole session is invalid + self.keycloakTokenExpirationInfo = Math.round((Auth.keycloak.refreshTokenParsed.exp + Auth.keycloak.timeSkew - new Date().getTime() / 1000) / 60); + if (!self.keycloakTokenExpirationInfo) { + self.keycloakTokenExpirationInfo = 30; + } + // if session is expired then show warning to User! + if (self.keycloakTokenExpirationInfo < 0) { + self.keycloakTokenExpirationInfo = 0; + self.displayMapApplicationError("Ihre aktuelle Login-Session ist abgelaufen. Sie müssen sich neu einloggen. Nutzen Sie dazu das User-Menü oben rechts."); + } + }, 1000 * 60); + }; + /* + * FETCH INITIAL METADATA ABOUT EACH RESOURCE + */ + // $rootScope.$on("$locationChangeStart", function(event){ + // self.fetchAllMetadata(); + // self.adminIsLoggedIn = false; + // }); + this.fetchAllMetadata = async function () { console.log("fetching all metadata from management component"); - // var metadataPromises = [topicsPromise, usersPromise, rolesPromise, spatialUnitsPromise, georesourcesPromise, indicatorsPromise, scriptsPromise]; var metadataPromises = []; - - if (Auth.keycloak.authenticated){ - await Auth.keycloak.loadUserProfile() - .then(function (profile) { - // set user profile - self.currentKeycloakUser = profile; - console.log("User logged in with email: " + profile.email); - - if(Auth.keycloak.tokenParsed && Auth.keycloak.tokenParsed.realm_access && Auth.keycloak.tokenParsed.realm_access.roles){ - self.currentKeycloakLoginRoles = Auth.keycloak.tokenParsed.realm_access.roles; - if (Auth.keycloak.tokenParsed.resource_access["realm-management"]) { - self.isRealmAdmin = true; - self.currentKeycloakLoginRoles = self.currentKeycloakLoginRoles.concat(Auth.keycloak.tokenParsed.resource_access["realm-management"].roles); - } - } else { - self.currentKeycloakLoginRoles = []; - } - - // set token expiration - startCheckSessionExpiration(); + if (Auth.keycloak.authenticated) { + await Auth.keycloak.loadUserProfile() + .then(function (profile) { + // set user profile + self.currentKeycloakUser = profile; + console.log("User logged in with email: " + profile.email); + if (Auth.keycloak.tokenParsed && Auth.keycloak.tokenParsed.realm_access && Auth.keycloak.tokenParsed.realm_access.roles) { + self.currentKeycloakLoginRoles = Auth.keycloak.tokenParsed.realm_access.roles; + if (Auth.keycloak.tokenParsed.resource_access["realm-management"]) { + self.isRealmAdmin = true; + self.currentKeycloakLoginRoles = self.currentKeycloakLoginRoles.concat(Auth.keycloak.tokenParsed.resource_access["realm-management"].roles); + } + } + else { + self.currentKeycloakLoginRoles = []; + } + // set token expiration + startCheckSessionExpiration(); }) - .catch(function () { - console.log('Failed to load user profile'); - }); - var promise = await this.fetchAccessControlMetadata(self.currentKeycloakLoginRoles); - metadataPromises.push(promise); + .catch(function () { + console.log('Failed to load user profile'); + }); + var promise = await this.fetchAccessControlMetadata(self.currentKeycloakLoginRoles); + metadataPromises.push(promise); } - //TODO revise metadata fecthing for protected endpoints var scriptsPromise = await this.fetchIndicatorScriptsMetadata(self.currentKeycloakLoginRoles); var topicsPromise = await this.fetchTopicsMetadata(self.currentKeycloakLoginRoles); @@ -1093,122 +882,97 @@ angular metadataPromises.push(spatialUnitsPromise); metadataPromises.push(georesourcesPromise); metadataPromises.push(indicatorsPromise); - $q.all(metadataPromises).then(function successCallback(successArray) { - - self.modifyIndicatorApplicableSpatialUnitsForLoginRoles(); - - self.buildHeadlineIndicatorHierarchy(); - self.buildTopicIndicatorHierarchy(); - self.topicIndicatorHierarchy_forOrderView = JSON.parse(JSON.stringify(self.topicIndicatorHierarchy)); - self.buildComputationIndicatorHierarchy(); - - self.buildTopicGeoresourceHierarchy(); - - console.log("Metadata fetched. Call initialize event."); - onMetadataLoadingCompleted(); - - $timeout(function(){ - $('.list-group-item > .collapseTrigger').on('click', function() { - $('.glyphicon', this) - .toggleClass('glyphicon-chevron-right') - .toggleClass('glyphicon-chevron-down'); - + self.modifyIndicatorApplicableSpatialUnitsForLoginRoles(); + self.buildHeadlineIndicatorHierarchy(); + self.buildTopicIndicatorHierarchy(); + self.topicIndicatorHierarchy_forOrderView = JSON.parse(JSON.stringify(self.topicIndicatorHierarchy)); + self.buildComputationIndicatorHierarchy(); + self.buildTopicGeoresourceHierarchy(); + console.log("Metadata fetched. Call initialize event."); + onMetadataLoadingCompleted(); + $timeout(function () { + $('.list-group-item > .collapseTrigger').on('click', function () { + $('.glyphicon', this) + .toggleClass('glyphicon-chevron-right') + .toggleClass('glyphicon-chevron-down'); }); - }); - }, function errorCallback(errorArray) { + }); + }, function errorCallback(errorArray) { // todo error handling self.displayMapApplicationError("Beim Laden der erforderlichen Anwendungsdaten ist ein Fehler aufgetreten. Bitte wenden Sie sich an Ihren Administrator."); $rootScope.$broadcast("initialMetadataLoadingFailed", errorArray); - }); - - }; - - this.modifyIndicatorApplicableSpatialUnitsForLoginRoles = function(){ + }); + }; + this.modifyIndicatorApplicableSpatialUnitsForLoginRoles = function () { var availableSpatialUnitNames = []; for (const spatialUnit of this.availableSpatialUnits) { - availableSpatialUnitNames.push(spatialUnit.spatialUnitLevel); + availableSpatialUnitNames.push(spatialUnit.spatialUnitLevel); } for (const indicator of this.availableIndicators) { - indicator.applicableSpatialUnits = indicator.applicableSpatialUnits.filter(applicableSpatialUnit => availableSpatialUnitNames.includes(applicableSpatialUnit.spatialUnitName)); + indicator.applicableSpatialUnits = indicator.applicableSpatialUnits.filter(applicableSpatialUnit => availableSpatialUnitNames.includes(applicableSpatialUnit.spatialUnitName)); } - this.displayableIndicators = this.availableIndicators.filter(item => isDisplayableIndicator(item)); this.displayableIndicators_keywordFiltered = JSON.parse(JSON.stringify(this.displayableIndicators)); - }; - - this.buildTopicsMap_indicators = function(indicatorTopics){ - var topicsMap = new Map(); - + }; + this.buildTopicsMap_indicators = function (indicatorTopics) { + var topicsMap = new Map(); for (const topic of indicatorTopics) { - topicsMap.set(topic.topicId, []); - if(topic.subTopics.length > 0){ - topicsMap = this.addSubTopicsToMap_indicators(topic.subTopics, topicsMap); - } + topicsMap.set(topic.topicId, []); + if (topic.subTopics.length > 0) { + topicsMap = this.addSubTopicsToMap_indicators(topic.subTopics, topicsMap); + } } - return topicsMap; - }; - - this.buildTopicsMap_georesources = function(georesourceTopics){ - var topicsMap = new Map(); - + }; + this.buildTopicsMap_georesources = function (georesourceTopics) { + var topicsMap = new Map(); for (const topic of georesourceTopics) { - topicsMap.set(topic.topicId, { + topicsMap.set(topic.topicId, { + poiDatasets: [], + loiDatasets: [], + aoiDatasets: [], + wmsDatasets: [], + wfsDatasets: [] + }); + if (topic.subTopics.length > 0) { + topicsMap = this.addSubTopicsToMap_georesources(topic.subTopics, topicsMap); + } + } + topicsMap.set(this.georesourceMapKey_forUnmappedTopicReferences, { poiDatasets: [], loiDatasets: [], aoiDatasets: [], wmsDatasets: [], wfsDatasets: [] - }); - if(topic.subTopics.length > 0){ - topicsMap = this.addSubTopicsToMap_georesources(topic.subTopics, topicsMap); - } - } - - topicsMap.set(this.georesourceMapKey_forUnmappedTopicReferences, { - poiDatasets: [], - loiDatasets: [], - aoiDatasets: [], - wmsDatasets: [], - wfsDatasets: [] }); - return topicsMap; - }; - - this.addSubTopicsToMap_indicators = function(subTopicsArray, topicsMap){ - + }; + this.addSubTopicsToMap_indicators = function (subTopicsArray, topicsMap) { for (const subTopic of subTopicsArray) { - topicsMap.set(subTopic.topicId, []); - if(subTopic.subTopics.length > 0){ - topicsMap = this.addSubTopicsToMap_indicators(subTopic.subTopics, topicsMap); - } - } - + topicsMap.set(subTopic.topicId, []); + if (subTopic.subTopics.length > 0) { + topicsMap = this.addSubTopicsToMap_indicators(subTopic.subTopics, topicsMap); + } + } return topicsMap; - }; - - this.addSubTopicsToMap_georesources = function(subTopicsArray, topicsMap){ - + }; + this.addSubTopicsToMap_georesources = function (subTopicsArray, topicsMap) { for (const subTopic of subTopicsArray) { - topicsMap.set(subTopic.topicId, { - poiDatasets: [], - loiDatasets: [], - aoiDatasets: [], - wmsDatasets: [], - wfsDatasets: [] - }); - if(subTopic.subTopics.length > 0){ - topicsMap = this.addSubTopicsToMap_georesources(subTopic.subTopics, topicsMap); - } - } - + topicsMap.set(subTopic.topicId, { + poiDatasets: [], + loiDatasets: [], + aoiDatasets: [], + wmsDatasets: [], + wfsDatasets: [] + }); + if (subTopic.subTopics.length > 0) { + topicsMap = this.addSubTopicsToMap_georesources(subTopic.subTopics, topicsMap); + } + } return topicsMap; - }; - - this.buildTopicGeoresourceHierarchy = function(){ - + }; + this.buildTopicGeoresourceHierarchy = function () { var georesourceTopics = JSON.parse(JSON.stringify(this.availableTopics)).filter(topic => topic.topicResource === "georesource"); /* topicsMap.set(topic.topicId, { @@ -1222,128 +986,101 @@ angular + special entry with key "unmapped" for all datasets without valid topic reference */ var topicsMap = this.buildTopicsMap_georesources(georesourceTopics); - - // PROCESS GEORESOURCES var filteredGeoresources = this.displayableGeoresources_keywordFiltered; - for (const georesourceMetadata of filteredGeoresources) { - if (topicsMap.has(georesourceMetadata.topicReference)){ - var georesourceDatasets = topicsMap.get(georesourceMetadata.topicReference); - - if(georesourceMetadata.isPOI){ - georesourceDatasets.poiDatasets.push(georesourceMetadata); - } - if(georesourceMetadata.isLOI){ - georesourceDatasets.loiDatasets.push(georesourceMetadata); - } - if(georesourceMetadata.isAOI){ - georesourceDatasets.aoiDatasets.push(georesourceMetadata); - } - - topicsMap.set(georesourceMetadata.topicReference, georesourceDatasets); - } - else{ - var georesourceDatasets_unmapped = topicsMap.get(this.georesourceMapKey_forUnmappedTopicReferences); - - if(georesourceMetadata.isPOI){ - georesourceDatasets_unmapped.poiDatasets.push(georesourceMetadata); - } - if(georesourceMetadata.isLOI){ - georesourceDatasets_unmapped.loiDatasets.push(georesourceMetadata); - } - if(georesourceMetadata.isAOI){ - georesourceDatasets_unmapped.aoiDatasets.push(georesourceMetadata); - } - - topicsMap.set(this.georesourceMapKey_forUnmappedTopicReferences, georesourceDatasets_unmapped); - } + if (topicsMap.has(georesourceMetadata.topicReference)) { + var georesourceDatasets = topicsMap.get(georesourceMetadata.topicReference); + if (georesourceMetadata.isPOI) { + georesourceDatasets.poiDatasets.push(georesourceMetadata); + } + if (georesourceMetadata.isLOI) { + georesourceDatasets.loiDatasets.push(georesourceMetadata); + } + if (georesourceMetadata.isAOI) { + georesourceDatasets.aoiDatasets.push(georesourceMetadata); + } + topicsMap.set(georesourceMetadata.topicReference, georesourceDatasets); + } + else { + var georesourceDatasets_unmapped = topicsMap.get(this.georesourceMapKey_forUnmappedTopicReferences); + if (georesourceMetadata.isPOI) { + georesourceDatasets_unmapped.poiDatasets.push(georesourceMetadata); + } + if (georesourceMetadata.isLOI) { + georesourceDatasets_unmapped.loiDatasets.push(georesourceMetadata); + } + if (georesourceMetadata.isAOI) { + georesourceDatasets_unmapped.aoiDatasets.push(georesourceMetadata); + } + topicsMap.set(this.georesourceMapKey_forUnmappedTopicReferences, georesourceDatasets_unmapped); + } } - // PROCESS WMS and WFS for (const wmsMetadata of this.wmsDatasets_keywordFiltered) { - if (topicsMap.has(wmsMetadata.topicReference)){ - var georesourceDatasets = topicsMap.get(wmsMetadata.topicReference); - georesourceDatasets.wmsDatasets.push(wmsMetadata); - - topicsMap.set(wmsMetadata.topicReference, georesourceDatasets); - } - else{ - var georesourceDatasets_unmapped = topicsMap.get(this.georesourceMapKey_forUnmappedTopicReferences); - - georesourceDatasets_unmapped.wmsDatasets.push(wmsMetadata); - - topicsMap.set(this.georesourceMapKey_forUnmappedTopicReferences, georesourceDatasets_unmapped); - } + if (topicsMap.has(wmsMetadata.topicReference)) { + var georesourceDatasets = topicsMap.get(wmsMetadata.topicReference); + georesourceDatasets.wmsDatasets.push(wmsMetadata); + topicsMap.set(wmsMetadata.topicReference, georesourceDatasets); + } + else { + var georesourceDatasets_unmapped = topicsMap.get(this.georesourceMapKey_forUnmappedTopicReferences); + georesourceDatasets_unmapped.wmsDatasets.push(wmsMetadata); + topicsMap.set(this.georesourceMapKey_forUnmappedTopicReferences, georesourceDatasets_unmapped); + } } - // PROCESS WMS and WFS for (const wfsMetadata of this.wfsDatasets_keywordFiltered) { - if (topicsMap.has(wfsMetadata.topicReference)){ - var georesourceDatasets = topicsMap.get(wfsMetadata.topicReference); - georesourceDatasets.wfsDatasets.push(wfsMetadata); - - topicsMap.set(wfsMetadata.topicReference, georesourceDatasets); - } - else{ - var georesourceDatasets_unmapped = topicsMap.get(this.georesourceMapKey_forUnmappedTopicReferences); - - georesourceDatasets_unmapped.wfsDatasets.push(wfsMetadata); - - topicsMap.set(this.georesourceMapKey_forUnmappedTopicReferences, georesourceDatasets_unmapped); - } + if (topicsMap.has(wfsMetadata.topicReference)) { + var georesourceDatasets = topicsMap.get(wfsMetadata.topicReference); + georesourceDatasets.wfsDatasets.push(wfsMetadata); + topicsMap.set(wfsMetadata.topicReference, georesourceDatasets); + } + else { + var georesourceDatasets_unmapped = topicsMap.get(this.georesourceMapKey_forUnmappedTopicReferences); + georesourceDatasets_unmapped.wfsDatasets.push(wfsMetadata); + topicsMap.set(this.georesourceMapKey_forUnmappedTopicReferences, georesourceDatasets_unmapped); + } } - this.topicGeoresourceHierarchy = this.addGeoresourceDataToTopicHierarchy(georesourceTopics, topicsMap); - }; - - this.buildTopicIndicatorHierarchy = function(){ - + }; + this.buildTopicIndicatorHierarchy = function () { var indicatorTopics = JSON.parse(JSON.stringify(this.availableTopics)).filter(topic => topic.topicResource === "indicator"); var topicsMap = this.buildTopicsMap_indicators(indicatorTopics); - var filteredIndicators = this.displayableIndicators_keywordFiltered; - for (const indicatorMetadata of filteredIndicators) { - if (topicsMap.has(indicatorMetadata.topicReference)){ - var indicatorArray = topicsMap.get(indicatorMetadata.topicReference); - indicatorArray.push(indicatorMetadata); - topicsMap.set(indicatorMetadata.topicReference, indicatorArray); - } + if (topicsMap.has(indicatorMetadata.topicReference)) { + var indicatorArray = topicsMap.get(indicatorMetadata.topicReference); + indicatorArray.push(indicatorMetadata); + topicsMap.set(indicatorMetadata.topicReference, indicatorArray); + } } - this.topicIndicatorHierarchy = this.addIndicatorDataToTopicHierarchy(indicatorTopics, topicsMap); - }; - - this.addIndicatorDataToTopicHierarchy = function(topicsArray, topicsMap){ + }; + this.addIndicatorDataToTopicHierarchy = function (topicsArray, topicsMap) { for (var topic of topicsArray) { - topic.indicatorData = topicsMap.get(topic.topicId); - topic.indicatorData.sort((a,b) => (a.displayOrder > b.displayOrder) ? 1 : ((b.displayOrder > a.displayOrder) ? -1 : 0)); - topic.indicatorCount = topic.indicatorData.length; - if(topic.subTopics.length > 0){ - topic = this.addIndicatorDataToSubTopics(topic, topicsMap); - } + topic.indicatorData = topicsMap.get(topic.topicId); + topic.indicatorData.sort((a, b) => (a.displayOrder > b.displayOrder) ? 1 : ((b.displayOrder > a.displayOrder) ? -1 : 0)); + topic.indicatorCount = topic.indicatorData.length; + if (topic.subTopics.length > 0) { + topic = this.addIndicatorDataToSubTopics(topic, topicsMap); + } } - return topicsArray; - }; - - this.addIndicatorDataToSubTopics = function(topic, topicsMap){ + }; + this.addIndicatorDataToSubTopics = function (topic, topicsMap) { for (var subTopic of topic.subTopics) { - subTopic.indicatorData = topicsMap.get(subTopic.topicId); - subTopic.indicatorData.sort((a,b) => (a.displayOrder > b.displayOrder) ? 1 : ((b.displayOrder > a.displayOrder) ? -1 : 0)); - subTopic.indicatorCount = subTopic.indicatorData.length; - if(subTopic.subTopics.length > 0){ - subTopic = this.addIndicatorDataToSubTopics(subTopic, topicsMap); - } - topic.indicatorCount = topic.indicatorCount + subTopic.indicatorCount; + subTopic.indicatorData = topicsMap.get(subTopic.topicId); + subTopic.indicatorData.sort((a, b) => (a.displayOrder > b.displayOrder) ? 1 : ((b.displayOrder > a.displayOrder) ? -1 : 0)); + subTopic.indicatorCount = subTopic.indicatorData.length; + if (subTopic.subTopics.length > 0) { + subTopic = this.addIndicatorDataToSubTopics(subTopic, topicsMap); + } + topic.indicatorCount = topic.indicatorCount + subTopic.indicatorCount; } - return topic; - }; - - this.addGeoresourceDataToTopicHierarchy = function(topicsArray, topicsMap){ - + }; + this.addGeoresourceDataToTopicHierarchy = function (topicsArray, topicsMap) { /* topicsMap.set(topic.topicId, { poiDatasets: [], @@ -1355,916 +1092,725 @@ angular + special entry with key "unmapped" for all datasets without valid topic reference */ - for (var topic of topicsArray) { - var topicsDataEntry = topicsMap.get(topic.topicId); - topic.poiData = topicsDataEntry.poiDatasets; - topic.poiCount = topicsDataEntry.poiDatasets.length; - - topic.loiData = topicsDataEntry.loiDatasets; - topic.loiCount = topicsDataEntry.loiDatasets.length; - - topic.aoiData = topicsDataEntry.aoiDatasets; - topic.aoiCount = topicsDataEntry.aoiDatasets.length; - - topic.wmsData = topicsDataEntry.wmsDatasets; - topic.wmsCount = topicsDataEntry.wmsDatasets.length; - - topic.wfsData = topicsDataEntry.wfsDatasets; - topic.wfsCount = topicsDataEntry.wfsDatasets.length; - - topic.totalCount = topic.poiCount + topic.loiCount + topic.aoiCount + topic.wmsCount + topic.wfsCount; - topic.ownCount = topic.poiCount + topic.loiCount + topic.aoiCount + topic.wmsCount + topic.wfsCount; - - if(topic.subTopics.length > 0){ - topic = this.addGeoresourceDataToSubTopics(topic, topicsMap); - } + var topicsDataEntry = topicsMap.get(topic.topicId); + topic.poiData = topicsDataEntry.poiDatasets; + topic.poiCount = topicsDataEntry.poiDatasets.length; + topic.loiData = topicsDataEntry.loiDatasets; + topic.loiCount = topicsDataEntry.loiDatasets.length; + topic.aoiData = topicsDataEntry.aoiDatasets; + topic.aoiCount = topicsDataEntry.aoiDatasets.length; + topic.wmsData = topicsDataEntry.wmsDatasets; + topic.wmsCount = topicsDataEntry.wmsDatasets.length; + topic.wfsData = topicsDataEntry.wfsDatasets; + topic.wfsCount = topicsDataEntry.wfsDatasets.length; + topic.totalCount = topic.poiCount + topic.loiCount + topic.aoiCount + topic.wmsCount + topic.wfsCount; + topic.ownCount = topic.poiCount + topic.loiCount + topic.aoiCount + topic.wmsCount + topic.wfsCount; + if (topic.subTopics.length > 0) { + topic = this.addGeoresourceDataToSubTopics(topic, topicsMap); + } } - // PROCESS UNMAPPED entries this.topicGeoresourceHierarchy_unmappedEntries = {}; var topicsDataEntry_unmapped = topicsMap.get(this.georesourceMapKey_forUnmappedTopicReferences); this.topicGeoresourceHierarchy_unmappedEntries.poiData = topicsDataEntry_unmapped.poiDatasets; this.topicGeoresourceHierarchy_unmappedEntries.poiCount = topicsDataEntry_unmapped.poiDatasets.length; - this.topicGeoresourceHierarchy_unmappedEntries.loiData = topicsDataEntry_unmapped.loiDatasets; this.topicGeoresourceHierarchy_unmappedEntries.loiCount = topicsDataEntry_unmapped.loiDatasets.length; - this.topicGeoresourceHierarchy_unmappedEntries.aoiData = topicsDataEntry_unmapped.aoiDatasets; this.topicGeoresourceHierarchy_unmappedEntries.aoiCount = topicsDataEntry_unmapped.aoiDatasets.length; - this.topicGeoresourceHierarchy_unmappedEntries.wmsData = topicsDataEntry_unmapped.wmsDatasets; this.topicGeoresourceHierarchy_unmappedEntries.wmsCount = topicsDataEntry_unmapped.wmsDatasets.length; - this.topicGeoresourceHierarchy_unmappedEntries.wfsData = topicsDataEntry_unmapped.wfsDatasets; this.topicGeoresourceHierarchy_unmappedEntries.wfsCount = topicsDataEntry_unmapped.wfsDatasets.length; - - this.topicGeoresourceHierarchy_unmappedEntries.totalCount = this.topicGeoresourceHierarchy_unmappedEntries.poiCount + - this.topicGeoresourceHierarchy_unmappedEntries.loiCount + - this.topicGeoresourceHierarchy_unmappedEntries.aoiCount + - this.topicGeoresourceHierarchy_unmappedEntries.wmsCount + - this.topicGeoresourceHierarchy_unmappedEntries.wfsCount; - + this.topicGeoresourceHierarchy_unmappedEntries.totalCount = this.topicGeoresourceHierarchy_unmappedEntries.poiCount + + this.topicGeoresourceHierarchy_unmappedEntries.loiCount + + this.topicGeoresourceHierarchy_unmappedEntries.aoiCount + + this.topicGeoresourceHierarchy_unmappedEntries.wmsCount + + this.topicGeoresourceHierarchy_unmappedEntries.wfsCount; return topicsArray; - }; - - this.addGeoresourceDataToSubTopics = function(topic, topicsMap){ - for (var subTopic of topic.subTopics) { - - var topicsDataEntry = topicsMap.get(subTopic.topicId); - subTopic.poiData = topicsDataEntry.poiDatasets; - subTopic.poiCount = topicsDataEntry.poiDatasets.length; - - subTopic.loiData = topicsDataEntry.loiDatasets; - subTopic.loiCount = topicsDataEntry.loiDatasets.length; - - subTopic.aoiData = topicsDataEntry.aoiDatasets; - subTopic.aoiCount = topicsDataEntry.aoiDatasets.length; - - subTopic.wmsData = topicsDataEntry.wmsDatasets; - subTopic.wmsCount = topicsDataEntry.wmsDatasets.length; - - subTopic.wfsData = topicsDataEntry.wfsDatasets; - subTopic.wfsCount = topicsDataEntry.wfsDatasets.length; - - subTopic.totalCount = subTopic.poiCount + subTopic.loiCount + subTopic.aoiCount + subTopic.wmsCount + subTopic.wfsCount; - subTopic.ownCount = subTopic.poiCount + subTopic.loiCount + subTopic.aoiCount + subTopic.wmsCount + subTopic.wfsCount; - - if(subTopic.subTopics.length > 0){ - subTopic = this.addGeoresourceDataToSubTopics(subTopic, topicsMap); - } - topic.poiCount = topic.poiCount + subTopic.poiCount; - topic.loiCount = topic.loiCount + subTopic.loiCount; - topic.aoiCount = topic.aoiCount + subTopic.aoiCount; - topic.wmsCount = topic.wmsCount + subTopic.wmsCount; - topic.wfsCount = topic.wfsCount + subTopic.wfsCount; - topic.totalCount = topic.totalCount + subTopic.totalCount; + }; + this.addGeoresourceDataToSubTopics = function (topic, topicsMap) { + for (var subTopic of topic.subTopics) { + var topicsDataEntry = topicsMap.get(subTopic.topicId); + subTopic.poiData = topicsDataEntry.poiDatasets; + subTopic.poiCount = topicsDataEntry.poiDatasets.length; + subTopic.loiData = topicsDataEntry.loiDatasets; + subTopic.loiCount = topicsDataEntry.loiDatasets.length; + subTopic.aoiData = topicsDataEntry.aoiDatasets; + subTopic.aoiCount = topicsDataEntry.aoiDatasets.length; + subTopic.wmsData = topicsDataEntry.wmsDatasets; + subTopic.wmsCount = topicsDataEntry.wmsDatasets.length; + subTopic.wfsData = topicsDataEntry.wfsDatasets; + subTopic.wfsCount = topicsDataEntry.wfsDatasets.length; + subTopic.totalCount = subTopic.poiCount + subTopic.loiCount + subTopic.aoiCount + subTopic.wmsCount + subTopic.wfsCount; + subTopic.ownCount = subTopic.poiCount + subTopic.loiCount + subTopic.aoiCount + subTopic.wmsCount + subTopic.wfsCount; + if (subTopic.subTopics.length > 0) { + subTopic = this.addGeoresourceDataToSubTopics(subTopic, topicsMap); + } + topic.poiCount = topic.poiCount + subTopic.poiCount; + topic.loiCount = topic.loiCount + subTopic.loiCount; + topic.aoiCount = topic.aoiCount + subTopic.aoiCount; + topic.wmsCount = topic.wmsCount + subTopic.wmsCount; + topic.wfsCount = topic.wfsCount + subTopic.wfsCount; + topic.totalCount = topic.totalCount + subTopic.totalCount; } - return topic; - }; - - this.onChangeIndicatorKeywordFilter = function(indicatorNameFilter){ + }; + this.onChangeIndicatorKeywordFilter = function (indicatorNameFilter) { this.displayableIndicators_keywordFiltered = JSON.parse(JSON.stringify(this.displayableIndicators)); - - if(indicatorNameFilter && indicatorNameFilter != ""){ - this.displayableIndicators_keywordFiltered = filterArrayObjectsByValue(this.displayableIndicators_keywordFiltered, indicatorNameFilter); + if (indicatorNameFilter && indicatorNameFilter != "") { + this.displayableIndicators_keywordFiltered = filterArrayObjectsByValue(this.displayableIndicators_keywordFiltered, indicatorNameFilter); } - this.buildTopicIndicatorHierarchy(); this.buildHeadlineIndicatorHierarchy(); - this.buildComputationIndicatorHierarchy(); - }; - - this.onChangeGeoresourceKeywordFilter = function(georesourceNameFilter, showPOI, showLOI, showAOI, showWMS, showWFS){ + this.buildComputationIndicatorHierarchy(); + }; + this.onChangeGeoresourceKeywordFilter = function (georesourceNameFilter, showPOI, showLOI, showAOI, showWMS, showWFS) { this.wmsDatasets_keywordFiltered = JSON.parse(JSON.stringify(this.wmsDatasets)); this.wfsDatasets_keywordFiltered = JSON.parse(JSON.stringify(this.wfsDatasets)); - this.displayableGeoresources_keywordFiltered = JSON.parse(JSON.stringify(this.displayableGeoresources)); - - if(georesourceNameFilter && georesourceNameFilter != ""){ - this.displayableGeoresources_keywordFiltered = filterArrayObjectsByValue(this.displayableGeoresources_keywordFiltered, georesourceNameFilter); - - this.wmsDatasets_keywordFiltered = filterArrayObjectsByValue(this.wmsDatasets_keywordFiltered, georesourceNameFilter); - this.wfsDatasets_keywordFiltered = filterArrayObjectsByValue(this.wfsDatasets_keywordFiltered, georesourceNameFilter); + if (georesourceNameFilter && georesourceNameFilter != "") { + this.displayableGeoresources_keywordFiltered = filterArrayObjectsByValue(this.displayableGeoresources_keywordFiltered, georesourceNameFilter); + this.wmsDatasets_keywordFiltered = filterArrayObjectsByValue(this.wmsDatasets_keywordFiltered, georesourceNameFilter); + this.wfsDatasets_keywordFiltered = filterArrayObjectsByValue(this.wfsDatasets_keywordFiltered, georesourceNameFilter); } - this.displayableGeoresources_keywordFiltered_forAlphabeticalDisplay = { - poiData: this.displayableGeoresources_keywordFiltered.filter(item => item.isPOI), - loiData: this.displayableGeoresources_keywordFiltered.filter(item => item.isLOI), - aoiData: this.displayableGeoresources_keywordFiltered.filter(item => item.isAOI), - wmsData: this.wmsDatasets_keywordFiltered, - wfsData: this.wfsDatasets_keywordFiltered + poiData: this.displayableGeoresources_keywordFiltered.filter(item => item.isPOI), + loiData: this.displayableGeoresources_keywordFiltered.filter(item => item.isLOI), + aoiData: this.displayableGeoresources_keywordFiltered.filter(item => item.isAOI), + wmsData: this.wmsDatasets_keywordFiltered, + wfsData: this.wfsDatasets_keywordFiltered }; - - if(!showWMS){ - this.wmsDatasets_keywordFiltered = []; - } - if(!showWFS){ - this.wfsDatasets_keywordFiltered = []; - } - - if(! (showPOI && showLOI && showAOI)){ - this.displayableGeoresources_keywordFiltered = this.displayableGeoresources_keywordFiltered.filter(item => { - if (! showPOI && item.isPOI){ - return false; - } - if (! showLOI && item.isLOI){ - return false; - } - - if (! showAOI && item.isAOI){ - return false; - } - - return true; - }); + if (!showWMS) { + this.wmsDatasets_keywordFiltered = []; + } + if (!showWFS) { + this.wfsDatasets_keywordFiltered = []; + } + if (!(showPOI && showLOI && showAOI)) { + this.displayableGeoresources_keywordFiltered = this.displayableGeoresources_keywordFiltered.filter(item => { + if (!showPOI && item.isPOI) { + return false; + } + if (!showLOI && item.isLOI) { + return false; + } + if (!showAOI && item.isAOI) { + return false; + } + return true; + }); } - - this.buildTopicGeoresourceHierarchy(); - }; - - this.buildHeadlineIndicatorHierarchy = function(){ - + this.buildTopicGeoresourceHierarchy(); + }; + this.buildHeadlineIndicatorHierarchy = function () { var indicatorsMap = new Map(); - var filteredIndicators = this.displayableIndicators_keywordFiltered; - for (const indicatorMetadata of filteredIndicators) { - indicatorsMap.set(indicatorMetadata.indicatorId, indicatorMetadata); + indicatorsMap.set(indicatorMetadata.indicatorId, indicatorMetadata); } - var headlineIndicatorsArray = filteredIndicators.filter(indicatorMetadata => indicatorMetadata.isHeadlineIndicator == true); - var headlineIndicatorsIdArray = headlineIndicatorsArray.map(indicatorMetadata => indicatorMetadata.indicatorId); - var headlineIndicatorsMap = new Map(); - for (const indicatorMetadata of headlineIndicatorsArray) { - headlineIndicatorsMap.set(indicatorMetadata.indicatorId, indicatorMetadata); + headlineIndicatorsMap.set(indicatorMetadata.indicatorId, indicatorMetadata); } - var headlineIndicatorScriptsMap = new Map(); for (const scriptMetadata of this.availableProcessScripts) { - if(headlineIndicatorsIdArray.includes(scriptMetadata.indicatorId)){ - headlineIndicatorScriptsMap.set(scriptMetadata.indicatorId, scriptMetadata); - } + if (headlineIndicatorsIdArray.includes(scriptMetadata.indicatorId)) { + headlineIndicatorScriptsMap.set(scriptMetadata.indicatorId, scriptMetadata); + } } - this.headlineIndicatorHierarchy = []; - // var item = { // headlineIndicator: {metadata} // baseIndicators: [{metadata}] // maybeSomeAnalysisItems? // } - for (const headlineIndicatorMetadata of headlineIndicatorsArray) { - var item = {}; - item.headlineIndicator = headlineIndicatorMetadata; - item.baseIndicators = []; - - if(headlineIndicatorScriptsMap.has(headlineIndicatorMetadata.indicatorId)){ - var targetScriptMetadata = headlineIndicatorScriptsMap.get(headlineIndicatorMetadata.indicatorId); - for (const requiredIndicatorId of targetScriptMetadata.requiredIndicatorIds) { - if (indicatorsMap.has(requiredIndicatorId)){ - item.baseIndicators.push(indicatorsMap.get(requiredIndicatorId)); - } - } - } - - this.headlineIndicatorHierarchy.push(item); - } - - }; - - this.buildComputationIndicatorHierarchy = function(){ - + var item = {}; + item.headlineIndicator = headlineIndicatorMetadata; + item.baseIndicators = []; + if (headlineIndicatorScriptsMap.has(headlineIndicatorMetadata.indicatorId)) { + var targetScriptMetadata = headlineIndicatorScriptsMap.get(headlineIndicatorMetadata.indicatorId); + for (const requiredIndicatorId of targetScriptMetadata.requiredIndicatorIds) { + if (indicatorsMap.has(requiredIndicatorId)) { + item.baseIndicators.push(indicatorsMap.get(requiredIndicatorId)); + } + } + } + this.headlineIndicatorHierarchy.push(item); + } + }; + this.buildComputationIndicatorHierarchy = function () { var indicatorsMap = new Map(); - var filteredIndicators = this.displayableIndicators_keywordFiltered; - for (const indicatorMetadata of filteredIndicators) { - indicatorsMap.set(indicatorMetadata.indicatorId, indicatorMetadata); + indicatorsMap.set(indicatorMetadata.indicatorId, indicatorMetadata); } - var computationIndicatorsArray = filteredIndicators.filter(indicatorMetadata => indicatorMetadata.creationType == "COMPUTATION"); - var computationIndicatorsIdArray = computationIndicatorsArray.map(indicatorMetadata => indicatorMetadata.indicatorId); - var computationIndicatorsMap = new Map(); - for (const indicatorMetadata of computationIndicatorsArray) { - computationIndicatorsMap.set(indicatorMetadata.indicatorId, indicatorMetadata); + computationIndicatorsMap.set(indicatorMetadata.indicatorId, indicatorMetadata); } - var computationIndicatorScriptsMap = new Map(); for (const scriptMetadata of this.availableProcessScripts) { - if(computationIndicatorsIdArray.includes(scriptMetadata.indicatorId)){ - computationIndicatorScriptsMap.set(scriptMetadata.indicatorId, scriptMetadata); - } + if (computationIndicatorsIdArray.includes(scriptMetadata.indicatorId)) { + computationIndicatorScriptsMap.set(scriptMetadata.indicatorId, scriptMetadata); + } } - this.computationIndicatorHierarchy = []; - // var item = { // computationIndicator: {metadata} // baseIndicators: [{metadata}] // maybeSomeAnalysisItems? // } - for (const computationIndicatorMetadata of computationIndicatorsArray) { - var item = {}; - item.computationIndicator = computationIndicatorMetadata; - item.baseIndicators = []; - - if(computationIndicatorScriptsMap.has(computationIndicatorMetadata.indicatorId)){ - var targetScriptMetadata = computationIndicatorScriptsMap.get(computationIndicatorMetadata.indicatorId); - for (const requiredIndicatorId of targetScriptMetadata.requiredIndicatorIds) { - if (indicatorsMap.has(requiredIndicatorId)){ - item.baseIndicators.push(indicatorsMap.get(requiredIndicatorId)); - } - } - } - - this.computationIndicatorHierarchy.push(item); - } - - }; - - this.filterCurrentlySelectedIndicator = function(){ - return function( item ) { - - if (item.indicatorMetadata.indicatorId === self.selectedIndicator.indicatorId){ - return true; - } - return false; - - }; - }; - - this.filterBaseIndicatorsOfCurrentHeadlineIndicator = function(){ - return function( item ) { - - var headlineIndicatorEntry = self.headlineIndicatorHierarchy.filter(element => element.headlineIndicator.indicatorId == self.selectedIndicator.indicatorId)[0]; - - if(headlineIndicatorEntry){ - var baseIndicators_filtered = headlineIndicatorEntry.baseIndicators.filter(element => element.indicatorId == item.indicatorMetadata.indicatorId); - if (baseIndicators_filtered.length > 0){ - return true; - } - } - - return false; - - }; - }; - - this.filterBaseIndicatorsOfCurrentComputationIndicator = function(){ - return function( item ) { - - var computationIndicatorEntry = self.computationIndicatorHierarchy.filter(element => element.computationIndicator.indicatorId == self.selectedIndicator.indicatorId)[0]; - - if(computationIndicatorEntry){ - var baseIndicators_filtered = computationIndicatorEntry.baseIndicators.filter(element => element.indicatorId == item.indicatorMetadata.indicatorId); - if (baseIndicators_filtered.length > 0){ - return true; - } - } - - return false; - - }; - }; - - var onMetadataLoadingCompleted = function(){ - + var item = {}; + item.computationIndicator = computationIndicatorMetadata; + item.baseIndicators = []; + if (computationIndicatorScriptsMap.has(computationIndicatorMetadata.indicatorId)) { + var targetScriptMetadata = computationIndicatorScriptsMap.get(computationIndicatorMetadata.indicatorId); + for (const requiredIndicatorId of targetScriptMetadata.requiredIndicatorIds) { + if (indicatorsMap.has(requiredIndicatorId)) { + item.baseIndicators.push(indicatorsMap.get(requiredIndicatorId)); + } + } + } + this.computationIndicatorHierarchy.push(item); + } + }; + this.filterCurrentlySelectedIndicator = function () { + return function (item) { + if (item.indicatorMetadata.indicatorId === self.selectedIndicator.indicatorId) { + return true; + } + return false; + }; + }; + this.filterBaseIndicatorsOfCurrentHeadlineIndicator = function () { + return function (item) { + var headlineIndicatorEntry = self.headlineIndicatorHierarchy.filter(element => element.headlineIndicator.indicatorId == self.selectedIndicator.indicatorId)[0]; + if (headlineIndicatorEntry) { + var baseIndicators_filtered = headlineIndicatorEntry.baseIndicators.filter(element => element.indicatorId == item.indicatorMetadata.indicatorId); + if (baseIndicators_filtered.length > 0) { + return true; + } + } + return false; + }; + }; + this.filterBaseIndicatorsOfCurrentComputationIndicator = function () { + return function (item) { + var computationIndicatorEntry = self.computationIndicatorHierarchy.filter(element => element.computationIndicator.indicatorId == self.selectedIndicator.indicatorId)[0]; + if (computationIndicatorEntry) { + var baseIndicators_filtered = computationIndicatorEntry.baseIndicators.filter(element => element.indicatorId == item.indicatorMetadata.indicatorId); + if (baseIndicators_filtered.length > 0) { + return true; + } + } + return false; + }; + }; + var onMetadataLoadingCompleted = function () { $timeout(function () { - $rootScope.$broadcast("initialMetadataLoadingCompleted"); - - $timeout(function () { - $("option").each(function (index, element) { - var text = $(element).text(); - $(element).attr("title", text); - }); - }, 1000); + $rootScope.$broadcast("initialMetadataLoadingCompleted"); + $timeout(function () { + $("option").each(function (index, element) { + var text = $(element).text(); + $(element).attr("title", text); + }); + }, 1000); }, 1000); // setTimeout(() => { // // $rootScope.$broadcast("initialMetadataLoadingCompleted"); // }, 1000); - }; - - this.setAccessControl = function(input){ + }; + this.setAccessControl = function (input) { this.accessControl = input; this.accessControl_map = new Map(); for (const entry of input) { - this.accessControl_map.set(entry.organizationalUnitId, entry); + this.accessControl_map.set(entry.organizationalUnitId, entry); } this.updateAvailableRoles(); - }; - - this.fetchAccessControlMetadata = async function(keycloakRolesArray){ + }; + this.fetchAccessControlMetadata = async function (keycloakRolesArray) { self.setAccessControl(await kommonitorCacheHelperService.fetchAccessControlMetadata(keycloakRolesArray)); self.setCurrentKomMonitorLoginRoleNames(); self.setCurrentKomMonitorLoginRoleIds(); - }; - - this.replaceSingleAccessControlMetadata = function(targetRoleMetadata){ + }; + this.replaceSingleAccessControlMetadata = function (targetRoleMetadata) { for (let index = 0; index < this.accessControl.length; index++) { - let oldMetadata = this.accessControl[index]; - if(oldMetadata.organizationalUnitId == targetRoleMetadata.organizationalUnitId){ - this.accessControl[index] = targetRoleMetadata; - break; - } + let oldMetadata = this.accessControl[index]; + if (oldMetadata.organizationalUnitId == targetRoleMetadata.organizationalUnitId) { + this.accessControl[index] = targetRoleMetadata; + break; + } } this.accessControl_map.set(targetRoleMetadata.organizationalUnitId, targetRoleMetadata); this.updateAvailableRoles(); - }; - - this.addSingleAccessControlMetadata = function(metadata){ + }; + this.addSingleAccessControlMetadata = function (metadata) { let tmpArray = [metadata]; Array.prototype.push.apply(tmpArray, this.accessControl); this.accessControl = tmpArray; this.accessControl_map.set(metadata.organizationalUnitId, metadata); this.updateAvailableRoles(); - }; - - this.deleteSingleAccessControlMetadata = function(id){ + }; + this.deleteSingleAccessControlMetadata = function (id) { for (let index = 0; index < this.accessControl.length; index++) { - const oldMetadata = this.accessControl[index]; - if(oldMetadata.organizationalUnitId == id){ - this.accessControl.splice(index, 1); - break; - } + const oldMetadata = this.accessControl[index]; + if (oldMetadata.organizationalUnitId == id) { + this.accessControl.splice(index, 1); + break; + } } this.accessControl_map.delete(id); this.updateAvailableRoles(); - }; - - this.updateAvailableRoles = function() { + }; + this.updateAvailableRoles = function () { this.availableRoles = []; for (let elem of this.accessControl) { - for (let role of elem.roles) { - let available = {...role, ...{"organizationalUnit": elem, "roleName": elem.name + "-" + role.permissionLevel}}; - this.availableRoles.push(available); - } + for (let role of elem.roles) { + let available = { ...role, ...{ "organizationalUnit": elem, "roleName": elem.name + "-" + role.permissionLevel } }; + this.availableRoles.push(available); + } } // we need to refresh all modals as roles have changed $rootScope.$broadcast("availableRolesUpdate"); - } - - this.getAccessControlById = function(id){ + }; + this.getAccessControlById = function (id) { return this.accessControl_map.get(id); - }; - - this.fetchTopicsMetadata = async function(keycloakRolesArray){ + }; + this.fetchTopicsMetadata = async function (keycloakRolesArray) { self.setTopics(await kommonitorCacheHelperService.fetchTopicsMetadata(keycloakRolesArray)); - }; - - this.fetchSpatialUnitsMetadata = async function(keycloakRolesArray){ + }; + this.fetchSpatialUnitsMetadata = async function (keycloakRolesArray) { self.setSpatialUnits(await kommonitorCacheHelperService.fetchSpatialUnitsMetadata(keycloakRolesArray)); - }; - - this.fetchGeoresourcesMetadata = async function(keycloakRolesArray){ + }; + this.fetchGeoresourcesMetadata = async function (keycloakRolesArray) { self.setGeoresources(await kommonitorCacheHelperService.fetchGeoresourceMetadata(keycloakRolesArray)); - }; - - this.fetchIndicatorsMetadata = async function(keycloakRolesArray){ + }; + this.fetchIndicatorsMetadata = async function (keycloakRolesArray) { self.setIndicators(await kommonitorCacheHelperService.fetchIndicatorsMetadata(keycloakRolesArray)); - }; - - this.fetchIndicatorScriptsMetadata = async function(keycloakRolesArray){ + }; + this.fetchIndicatorScriptsMetadata = async function (keycloakRolesArray) { self.setProcessScripts(await kommonitorCacheHelperService.fetchProcessScriptsMetadata(keycloakRolesArray)); - }; - - this.indicatorValueIsNoData = function(indicatorValue){ - if(Number.isNaN(indicatorValue) || indicatorValue === null || indicatorValue === undefined){ - return true; - } - return false; - }; - - this.getIndicatorValueFromArray_asNumber = function(propertiesArray, targetDateString){ - if(!targetDateString.includes(DATE_PREFIX)){ - targetDateString = DATE_PREFIX + targetDateString; - } - var indicatorValue = propertiesArray[targetDateString]; - var value; - if(this.indicatorValueIsNoData(indicatorValue)){ - value = "NoData"; - } - else{ - value = this.getIndicatorValue_asNumber(indicatorValue); - } - - return value; - }; - - this.getIndicatorValueFromArray_asFormattedText = function(propertiesArray, targetDateString){ - if(!targetDateString.includes(DATE_PREFIX)){ - targetDateString = DATE_PREFIX + targetDateString; - } - var indicatorValue = propertiesArray[targetDateString]; - var value; - if(this.indicatorValueIsNoData(indicatorValue)){ - value = "NoData"; - } - else{ - value = this.getIndicatorValue_asFormattedText(indicatorValue); - } - - return value; - }; - - this.getIndicatorValue_asNumber = function(indicatorValue){ - var value; - if(this.indicatorValueIsNoData(indicatorValue)){ - value = "NoData"; - } - else{ - value = +Number(indicatorValue).toFixed(numberOfDecimals); - } - + }; + this.indicatorValueIsNoData = function (indicatorValue) { + if (Number.isNaN(indicatorValue) || indicatorValue === null || indicatorValue === undefined) { + return true; + } + return false; + }; + this.getIndicatorValueFromArray_asNumber = function (propertiesArray, targetDateString) { + if (!targetDateString.includes(DATE_PREFIX)) { + targetDateString = DATE_PREFIX + targetDateString; + } + var indicatorValue = propertiesArray[targetDateString]; + var value; + if (this.indicatorValueIsNoData(indicatorValue)) { + value = "NoData"; + } + else { + value = this.getIndicatorValue_asNumber(indicatorValue); + } + return value; + }; + this.getIndicatorValueFromArray_asFormattedText = function (propertiesArray, targetDateString) { + if (!targetDateString.includes(DATE_PREFIX)) { + targetDateString = DATE_PREFIX + targetDateString; + } + var indicatorValue = propertiesArray[targetDateString]; + var value; + if (this.indicatorValueIsNoData(indicatorValue)) { + value = "NoData"; + } + else { + value = this.getIndicatorValue_asFormattedText(indicatorValue); + } + return value; + }; + this.getIndicatorValue_asNumber = function (indicatorValue) { + var value; + if (this.indicatorValueIsNoData(indicatorValue)) { + value = "NoData"; + } + else { + value = +Number(indicatorValue).toFixed(numberOfDecimals); + } // if the original value is greater than zero but would be rounded as 0 then we must return the original result - if(Number(value) == 0 && indicatorValue > 0){ - value = Number(indicatorValue); - } - - return value; - }; - - this.getIndicatorValue_asFormattedText = function(indicatorValue){ - var value; - if(this.indicatorValueIsNoData(indicatorValue)){ - value = "NoData"; - } - else{ - value = Number(indicatorValue).toLocaleString('de-DE', {maximumFractionDigits: numberOfDecimals}); - } - + if (Number(value) == 0 && indicatorValue > 0) { + value = Number(indicatorValue); + } + return value; + }; + this.getIndicatorValue_asFormattedText = function (indicatorValue) { + var value; + if (this.indicatorValueIsNoData(indicatorValue)) { + value = "NoData"; + } + else { + value = Number(indicatorValue).toLocaleString('de-DE', { maximumFractionDigits: numberOfDecimals }); + } // if the original value is greater than zero but would be rounded as 0 then we must return the original result - if(Number(value) == 0 && indicatorValue > 0){ - value = Number(indicatorValue).toLocaleString('de-DE'); - } - - return value; - }; - - this.getTopicHierarchyDisplayString = function(topicReferenceId){ + if (Number(value) == 0 && indicatorValue > 0) { + value = Number(indicatorValue).toLocaleString('de-DE'); + } + return value; + }; + this.getTopicHierarchyDisplayString = function (topicReferenceId) { var topicHierarchyArray = this.getTopicHierarchyForTopicId(topicReferenceId); - var topicsString = ""; for (let index = 0; index < topicHierarchyArray.length; index++) { - if (index === 0) { - // mainTopic --> first tier - topicsString += topicHierarchyArray[index].topicName; - } - else { - var numberOfWhitespaces = 2 * index; - var whitespaceString = ""; - for (let k = 0; k < numberOfWhitespaces; k++) { - whitespaceString += " "; - } - topicsString += whitespaceString + topicHierarchyArray[index].topicName; - } - - if (index < topicHierarchyArray.length) { - topicsString += "
        "; - } - + if (index === 0) { + // mainTopic --> first tier + topicsString += topicHierarchyArray[index].topicName; + } + else { + var numberOfWhitespaces = 2 * index; + var whitespaceString = ""; + for (let k = 0; k < numberOfWhitespaces; k++) { + whitespaceString += " "; + } + topicsString += whitespaceString + topicHierarchyArray[index].topicName; + } + if (index < topicHierarchyArray.length) { + topicsString += "
        "; + } } - return topicsString; - }; - - this.getIndicatorStringFromIndicatorType = function (indicatorType) { + }; + this.getIndicatorStringFromIndicatorType = function (indicatorType) { var indicatorTypeString; - for (const indicatorTypeOption of this.indicatorTypeOptions) { - if (indicatorType.includes(indicatorTypeOption.apiName)) { - indicatorTypeString = indicatorTypeOption.displayName; - break; - } + if (indicatorType.includes(indicatorTypeOption.apiName)) { + indicatorTypeString = indicatorTypeOption.displayName; + break; + } } - return indicatorTypeString; - }; - - - this.labelAllFeatures = "alle Features"; - this.labelFilteredFeatures = "gefilterte Features"; - this.labelSelectedFeatures = "selektierte Features"; - this.labelNumberOfFeatures = "Anzahl:" - this.labelSum = "Summe:" - this.labelMean = "arith. Mittel:" - this.labelMin = "Minimalwert:" - this.labelMax = "Maximalwert" - - this.allFeaturesNumberOfFeatures; - this.allFeaturesSum; - this.allFeaturesMean; - this.allFeaturesMin; - this.allFeaturesMax; - this.selectedFeaturesNumberOfFeatures; - this.selectedFeaturesSum; - this.selectedFeaturesMean; - this.selectedFeaturesMin; - this.selectedFeaturesMax; - this.allFeaturesPropertyUnit; - - this.setAllFeaturesProperty = function(indicatorMetadataAndGeoJSON, propertyName){ + }; + this.labelAllFeatures = "alle Features"; + this.labelFilteredFeatures = "gefilterte Features"; + this.labelSelectedFeatures = "selektierte Features"; + this.labelNumberOfFeatures = "Anzahl:"; + this.labelSum = "Summe:"; + this.labelMean = "arith. Mittel:"; + this.labelMin = "Minimalwert:"; + this.labelMax = "Maximalwert"; + this.allFeaturesNumberOfFeatures; + this.allFeaturesSum; + this.allFeaturesMean; + this.allFeaturesMin; + this.allFeaturesMax; + this.selectedFeaturesNumberOfFeatures; + this.selectedFeaturesSum; + this.selectedFeaturesMean; + this.selectedFeaturesMin; + this.selectedFeaturesMax; + this.allFeaturesPropertyUnit; + this.setAllFeaturesProperty = function (indicatorMetadataAndGeoJSON, propertyName) { let sum = 0; let count = 0; let min = Number.MAX_VALUE; let max = Number.MIN_VALUE; - for (const feature of indicatorMetadataAndGeoJSON.geoJSON.features) { - if(! this.indicatorValueIsNoData(feature.properties[propertyName])){ - let value = this.getIndicatorValueFromArray_asNumber(feature.properties, propertyName) - sum += value; - if (value < min) min = value; - if (value > max) max = value; - count++; - } + if (!this.indicatorValueIsNoData(feature.properties[propertyName])) { + let value = this.getIndicatorValueFromArray_asNumber(feature.properties, propertyName); + sum += value; + if (value < min) + min = value; + if (value > max) + max = value; + count++; + } } - this.allFeaturesPropertyUnit = indicatorMetadataAndGeoJSON.unit; this.allFeaturesNumberOfFeatures = count; this.allFeaturesSum = this.getIndicatorValue_asFormattedText(sum); // no division by zero - if (count > 0) - this.allFeaturesMean = this.getIndicatorValue_asFormattedText(sum / count); - else - this.allFeaturesMean = 0; + if (count > 0) + this.allFeaturesMean = this.getIndicatorValue_asFormattedText(sum / count); + else + this.allFeaturesMean = 0; this.allFeaturesMin = this.getIndicatorValue_asFormattedText(min); - this.allFeaturesMax = this.getIndicatorValue_asFormattedText(max) - }; - - - this.setSelectedFeatureProperty = function(selectedFeaturesMap, propertyName) { + this.allFeaturesMax = this.getIndicatorValue_asFormattedText(max); + }; + this.setSelectedFeatureProperty = function (selectedFeaturesMap, propertyName) { let sum = 0; - let count = 0 + let count = 0; let min = Number.MAX_VALUE; let max = Number.MIN_VALUE; - - selectedFeaturesMap.forEach(function(feature, key, map) { - if(! thisService.indicatorValueIsNoData(feature.properties[propertyName])){ - let value = thisService.getIndicatorValueFromArray_asNumber(feature.properties, propertyName); - sum += value; - if (value < min) min = value; - if (value > max) max = value; - count++; - } + selectedFeaturesMap.forEach(function (feature, key, map) { + if (!thisService.indicatorValueIsNoData(feature.properties[propertyName])) { + let value = thisService.getIndicatorValueFromArray_asNumber(feature.properties, propertyName); + sum += value; + if (value < min) + min = value; + if (value > max) + max = value; + count++; + } }); - - if(count === 0) { - // no feature selected, overwrite initial values for min and max - min = 0; - max = 0; + if (count === 0) { + // no feature selected, overwrite initial values for min and max + min = 0; + max = 0; } - - this.selectedFeaturesNumberOfFeatures = count; this.selectedFeaturesSum = this.getIndicatorValue_asFormattedText(sum); // no division by zero - if (count > 0) - this.selectedFeaturesMean = this.getIndicatorValue_asFormattedText(sum / count); - else - this.selectedFeaturesMean = 0; + if (count > 0) + this.selectedFeaturesMean = this.getIndicatorValue_asFormattedText(sum / count); + else + this.selectedFeaturesMean = 0; this.selectedFeaturesMin = this.getIndicatorValue_asFormattedText(min); this.selectedFeaturesMax = this.getIndicatorValue_asFormattedText(max); - }; - - - var containsNegativeValues = function(geoJSON, propertyName){ - + }; + var containsNegativeValues = function (geoJSON, propertyName) { var containsNegativeValues = false; - for(var i=0; i< geoJSON.features.length; i++){ - if (geoJSON.features[i].properties[propertyName] < 0){ - containsNegativeValues = true; - break; - } + for (var i = 0; i < geoJSON.features.length; i++) { + if (geoJSON.features[i].properties[propertyName] < 0) { + containsNegativeValues = true; + break; + } } - return containsNegativeValues; - }; - - this.formatIndicatorNameForLabel = function(indicatorName, maxCharsPerLine){ + }; + this.formatIndicatorNameForLabel = function (indicatorName, maxCharsPerLine) { var arr = []; var space = /\s/; - const words = indicatorName.split(space); // push first word into new array if (words[0].length) { - arr.push(words[0]); + arr.push(words[0]); } - for (let i = 1; i < words.length; i++) { - if (words[i].length + arr[arr.length - 1].length < maxCharsPerLine) { - arr[arr.length - 1] = `${arr[arr.length - 1]} ${words[i - ]}`; - } - else { - arr.push(words[i]); - } + if (words[i].length + arr[arr.length - 1].length < maxCharsPerLine) { + arr[arr.length - 1] = `${arr[arr.length - 1]} ${words[i]}`; + } + else { + arr.push(words[i]); + } } return arr.join("\n"); - }; - - this.filterIndicators = function (){ - return function( item ) { - - return isDisplayableIndicator(item); + }; + this.filterIndicators = function () { + return function (item) { + return isDisplayableIndicator(item); }; - }; - - this.filterGeoresources = function (){ - return function( item ) { - - return self.isDisplayableGeoresource(item); + }; + this.filterGeoresources = function () { + return function (item) { + return self.isDisplayableGeoresource(item); }; - }; - - this.isDisplayableGeoresource = function(item){ + }; + this.isDisplayableGeoresource = function (item) { var arrayOfNameSubstringsForHidingGeoresources = __env.arrayOfNameSubstringsForHidingGeoresources; - - if(item.availablePeriodsOfValidity == undefined || item.availablePeriodsOfValidity.length === 0) + if (item.availablePeriodsOfValidity == undefined || item.availablePeriodsOfValidity.length === 0) return false; - - var isGeoresourceThatShallNotBeDisplayed = arrayOfNameSubstringsForHidingGeoresources.some(substring => String(item.datasetName).includes(substring)); - - if(isGeoresourceThatShallNotBeDisplayed){ - return false; - } - return true; - }; - - this.selectedSpatialUnitIsRaster = function(){ + var isGeoresourceThatShallNotBeDisplayed = arrayOfNameSubstringsForHidingGeoresources.some(substring => String(item.datasetName).includes(substring)); + if (isGeoresourceThatShallNotBeDisplayed) { + return false; + } + return true; + }; + this.selectedSpatialUnitIsRaster = function () { var spatialUnitName = this.selectedSpatialUnit ? this.selectedSpatialUnit.spatialUnitLevel : ""; - return (spatialUnitName.includes("raster") || spatialUnitName.includes("Raster") || spatialUnitName.includes("RASTER") || spatialUnitName.includes("grid") || spatialUnitName.includes("GRID") || spatialUnitName.includes("Grid")); - }; - - // var roleMappingAllowsDisplay = function(indicatorMetadata){ - // //admin --> everything allowed - // if(self.currentKeycloakLoginRoles.includes(__env.keycloakKomMonitorAdminRoleName)){ - // return true; - // } - - // // public user - - - // // non-admin - // self.roleMetadataForCurrentKeycloakLoginRoles = self.availableRoles.filter(role => self.currentKeycloakLoginRoles.includes(role.roleName)); - - // var filteredApplicableUnits = indicatorMetadata.applicableSpatialUnits.filter(function (applicableSpatialUnit) { - // return applicableSpatialUnit.allowedRoles.length == 0 || applicableSpatialUnit.allowedRoles.some(allowedRoleId => self.roleMetadataForCurrentKeycloakLoginRoles.some(roleMetadata => roleMetadata.roleId === allowedRoleId) ); - // }); - - // return filteredApplicableUnits.length > 0; - // }; - - var isDisplayableIndicator = function(item){ - // var arrayOfNameSubstringsForHidingIndicators = ["Standardabweichung", "Prozentuale Ver"]; - var arrayOfNameSubstringsForHidingIndicators = __env.arrayOfNameSubstringsForHidingIndicators; - - // this is an item from i.e. indicatorRadar, that has a different structure - if(item.indicatorMetadata){ - if(item.indicatorMetadata.applicableDates == undefined || item.indicatorMetadata.applicableDates.length === 0) - return false; - - if(item.indicatorMetadata.applicableSpatialUnits == undefined || item.indicatorMetadata.applicableSpatialUnits.length === 0) - return false; - - var isIndicatorThatShallNotBeDisplayed = arrayOfNameSubstringsForHidingIndicators.some(substring => String(item.indicatorMetadata.indicatorName).includes(substring)); - - if(isIndicatorThatShallNotBeDisplayed){ - return false; - } - + }; + // var roleMappingAllowsDisplay = function(indicatorMetadata){ + // //admin --> everything allowed + // if(self.currentKeycloakLoginRoles.includes(__env.keycloakKomMonitorAdminRoleName)){ + // return true; + // } + // // public user + // // non-admin + // self.roleMetadataForCurrentKeycloakLoginRoles = self.availableRoles.filter(role => self.currentKeycloakLoginRoles.includes(role.roleName)); + // var filteredApplicableUnits = indicatorMetadata.applicableSpatialUnits.filter(function (applicableSpatialUnit) { + // return applicableSpatialUnit.allowedRoles.length == 0 || applicableSpatialUnit.allowedRoles.some(allowedRoleId => self.roleMetadataForCurrentKeycloakLoginRoles.some(roleMetadata => roleMetadata.roleId === allowedRoleId) ); + // }); + // return filteredApplicableUnits.length > 0; + // }; + var isDisplayableIndicator = function (item) { + // var arrayOfNameSubstringsForHidingIndicators = ["Standardabweichung", "Prozentuale Ver"]; + var arrayOfNameSubstringsForHidingIndicators = __env.arrayOfNameSubstringsForHidingIndicators; + // this is an item from i.e. indicatorRadar, that has a different structure + if (item.indicatorMetadata) { + if (item.indicatorMetadata.applicableDates == undefined || item.indicatorMetadata.applicableDates.length === 0) + return false; + if (item.indicatorMetadata.applicableSpatialUnits == undefined || item.indicatorMetadata.applicableSpatialUnits.length === 0) + return false; + var isIndicatorThatShallNotBeDisplayed = arrayOfNameSubstringsForHidingIndicators.some(substring => String(item.indicatorMetadata.indicatorName).includes(substring)); + if (isIndicatorThatShallNotBeDisplayed) { + return false; + } // if(! roleMappingAllowsDisplay(item.indicatorMetadata)){ // return false; // } - - return true; - } - else{ - // - if(item.applicableDates == undefined || item.applicableDates.length === 0) - return false; - - if(item.applicableSpatialUnits == undefined || item.applicableSpatialUnits.length === 0) - return false; - - // var isIndicatorThatShallNotBeDisplayed = item.indicatorName.includes("Standardabweichung") || item.indicatorName.includes("Prozentuale Ver"); - var isIndicatorThatShallNotBeDisplayed = arrayOfNameSubstringsForHidingIndicators.some(substring => String(item.indicatorName).includes(substring)); - - if(isIndicatorThatShallNotBeDisplayed){ - return false; - } - + return true; + } + else { + // + if (item.applicableDates == undefined || item.applicableDates.length === 0) + return false; + if (item.applicableSpatialUnits == undefined || item.applicableSpatialUnits.length === 0) + return false; + // var isIndicatorThatShallNotBeDisplayed = item.indicatorName.includes("Standardabweichung") || item.indicatorName.includes("Prozentuale Ver"); + var isIndicatorThatShallNotBeDisplayed = arrayOfNameSubstringsForHidingIndicators.some(substring => String(item.indicatorName).includes(substring)); + if (isIndicatorThatShallNotBeDisplayed) { + return false; + } // if(! roleMappingAllowsDisplay(item)){ // return false; // } - - return true; - } - }; - - this.filterGeoresourcesByPoi = function(){ - return function( item ) { - - try{ - if(item.isPOI){ - return true; + return true; + } + }; + this.filterGeoresourcesByPoi = function () { + return function (item) { + try { + if (item.isPOI) { + return true; + } + return false; + } + catch (error) { + return false; } - return false; - } - catch(error){ - return false; - } }; - }; - - this.filterPois = function(){ - return function( item ) { - - try{ - // if(item.datasetName.includes("Lebensmittel")){ - // return false; - // } - return true; - } - catch(error){ - return true; - } + }; + this.filterPois = function () { + return function (item) { + try { + // if(item.datasetName.includes("Lebensmittel")){ + // return false; + // } + return true; + } + catch (error) { + return true; + } }; - }; - - function getImageDimensions(file) { - return new Promise (function (resolved, rejected) { - var i = new Image(); - i.onload = function(){ - resolved({w: i.width, h: i.height}) - }; - i.src = file; + }; + function getImageDimensions(file) { + return new Promise(function (resolved, rejected) { + var i = new Image(); + i.onload = function () { + resolved({ w: i.width, h: i.height }); + }; + i.src = file; }); - } - - /** - * creates and returns a pdf for the indicator given as parameter - */ - this.createMetadataPDF_indicator = async function(indicator) { - + } + /** + * creates and returns a pdf for the indicator given as parameter + */ + this.createMetadataPDF_indicator = async function (indicator) { var jspdf = new jsPDF(); jspdf.setFontSize(16); // jspdf.text("Metadatenblatt", 70, 6); - //insert logo var img = new Image(); var subPath = location.pathname; img.src = subPath + 'logos/KM_Logo1.png'; jspdf.addImage(img, 'PNG', 193, 5, 12, 12); - jspdf.setFontSize(16); jspdf.setFont('Helvetica', 'bolditalic', 'normal'); - var titleArray = jspdf.splitTextToSize("Indikator: " +indicator.indicatorName, 180); + var titleArray = jspdf.splitTextToSize("Indikator: " + indicator.indicatorName, 180); jspdf.text(titleArray, 14, 25); - if (indicator.characteristicValue && indicator.characteristicValue != "-" && indicator.characteristicValue != "") { - jspdf.setFontSize(14); - jspdf.text(indicator.characteristicValue, 14, 25); + jspdf.setFontSize(14); + jspdf.text(indicator.characteristicValue, 14, 25); } - - jspdf.setFontSize(11); - var initialStartY = 30; - if (titleArray.length > 1) { - titleArray.forEach(function (item) { - initialStartY += 5; - }); + titleArray.forEach(function (item) { + initialStartY += 5; + }); } if (indicator.characteristicValue && indicator.characteristicValue != "-" && indicator.characteristicValue != "") { - initialStartY += 5; + initialStartY += 5; } - var headStyles = { - fontStyle: 'bold', - fontSize: 12, - fillColor: '#337ab7', - // auto or wrap - cellWidth: 'auto' + fontStyle: 'bold', + fontSize: 12, + fillColor: '#337ab7', + // auto or wrap + cellWidth: 'auto' }; - var bodyStyles = { - fontStyle: 'normal', - fontSize: 11, - // auto or wrap or number - cellWidth: 'auto' + fontStyle: 'normal', + fontSize: 11, + // auto or wrap or number + cellWidth: 'auto' }; - // first column with fixed width var columnStyles = { - 0: { cellWidth: 45, fontStyle: 'bold' }, - 1: { fontStyle: 'normal' } + 0: { cellWidth: 45, fontStyle: 'bold' }, + 1: { fontStyle: 'normal' } }; - var topicsString = ""; - var topicReferenceId = indicator.topicReference; - // will be an array representing the topic hierarchy // i.e. [mainTopic, subTopicFirstTier, subTopicSecondTier, ...] var topicHierarchyArray = this.getTopicHierarchyForTopicId(topicReferenceId); - for (let index = 0; index < topicHierarchyArray.length; index++) { - if (index === 0) { - // mainTopic --> first tier - topicsString += topicHierarchyArray[index].topicName; - } - else { - var numberOfWhitespaces = 2 * index; - var whitespaceString = ""; - for (let k = 0; k < numberOfWhitespaces; k++) { - whitespaceString += " "; - } - topicsString += whitespaceString + topicHierarchyArray[index].topicName; - } - - if (index < topicHierarchyArray.length - 1) { - topicsString += "\n"; - } - - } - + if (index === 0) { + // mainTopic --> first tier + topicsString += topicHierarchyArray[index].topicName; + } + else { + var numberOfWhitespaces = 2 * index; + var whitespaceString = ""; + for (let k = 0; k < numberOfWhitespaces; k++) { + whitespaceString += " "; + } + topicsString += whitespaceString + topicHierarchyArray[index].topicName; + } + if (index < topicHierarchyArray.length - 1) { + topicsString += "\n"; + } + } var category = "Basisindikator"; if (indicator.isHeadlineIndicator) { - category = "Leitindikator"; + category = "Leitindikator"; } - // Or JavaScript: jspdf.autoTable({ - head: [['Themenfeld', 'Kategorie', 'Typ', 'Kennzeichen']], - body: [ - [topicsString, category, this.getIndicatorStringFromIndicatorType(indicator.indicatorType), indicator.abbreviation ? indicator.abbreviation : "-"] - // ... - ], - theme: 'grid', - headStyles: headStyles, - bodyStyles: bodyStyles, - startY: initialStartY + head: [['Themenfeld', 'Kategorie', 'Typ', 'Kennzeichen']], + body: [ + [topicsString, category, this.getIndicatorStringFromIndicatorType(indicator.indicatorType), indicator.abbreviation ? indicator.abbreviation : "-"] + // ... + ], + theme: 'grid', + headStyles: headStyles, + bodyStyles: bodyStyles, + startY: initialStartY }); - var linkedIndicatorsString = ""; - for (var [index, linkedIndicator] of indicator.referencedIndicators.entries()) { - linkedIndicatorsString += linkedIndicator.referencedIndicatorName + " - \n " + linkedIndicator.referencedIndicatorDescription; - - if (index < indicator.referencedIndicators.length - 1) { - linkedIndicatorsString += "\n\n"; - } + linkedIndicatorsString += linkedIndicator.referencedIndicatorName + " - \n " + linkedIndicator.referencedIndicatorDescription; + if (index < indicator.referencedIndicators.length - 1) { + linkedIndicatorsString += "\n\n"; + } } - if (linkedIndicatorsString === "") { - linkedIndicatorsString = "-"; + linkedIndicatorsString = "-"; } - var linkedGeoresourcesString = ""; - for (var [k, linkedGeoresource] of indicator.referencedGeoresources.entries()) { - linkedGeoresourcesString += linkedGeoresource.referencedGeoresourceName + " - \n " + linkedGeoresource.referencedGeoresourceDescription; - - if (k < indicator.referencedGeoresources.length - 1) { - linkedGeoresourcesString += "\n\n"; - } + linkedGeoresourcesString += linkedGeoresource.referencedGeoresourceName + " - \n " + linkedGeoresource.referencedGeoresourceDescription; + if (k < indicator.referencedGeoresources.length - 1) { + linkedGeoresourcesString += "\n\n"; + } } - if (linkedGeoresourcesString === "") { - linkedGeoresourcesString = "-"; + linkedGeoresourcesString = "-"; } - // jspdf.autoTable({ // head: [], // body: [ @@ -2279,111 +1825,90 @@ angular // ], // startY: jspdf.autoTable.previous.finalY + 20, // }); - var spatialUnitsString = ""; var processedSpatialUnits = 0; - for (var availableSpatialUnit of this.availableSpatialUnits) { - - for (var applicableSpatialUnit of indicator.applicableSpatialUnits) { - - if (availableSpatialUnit.spatialUnitLevel === applicableSpatialUnit.spatialUnitName) { - spatialUnitsString += applicableSpatialUnit.spatialUnitName; - processedSpatialUnits++; - - if (processedSpatialUnits < indicator.applicableSpatialUnits.length) { - spatialUnitsString += "\n"; - } - } - - } - } - + for (var applicableSpatialUnit of indicator.applicableSpatialUnits) { + if (availableSpatialUnit.spatialUnitLevel === applicableSpatialUnit.spatialUnitName) { + spatialUnitsString += applicableSpatialUnit.spatialUnitName; + processedSpatialUnits++; + if (processedSpatialUnits < indicator.applicableSpatialUnits.length) { + spatialUnitsString += "\n"; + } + } + } + } var datesString = ""; - - if(indicator.applicableDates.length <= 20){ - for (var [j, date] of indicator.applicableDates.entries()) { - var asDate = new Date(date); - - datesString += this.tsToDate_withOptionalUpdateInterval(this.dateToTS(asDate), indicator.metadata.updateInterval); - - if (j < indicator.applicableDates.length - 1) { - datesString += " "; - } - } - } - else{ - datesString += "Zeitreihe umfasst insgesamt " + indicator.applicableDates.length + " Zeitpunkte\n\n"; - - datesString += "frühester Zeitpunkt: " + this.tsToDate_withOptionalUpdateInterval(this.dateToTS(indicator.applicableDates[0]), indicator.metadata.updateInterval) + "\n"; - datesString += "spätester Zeitpunkt: " + this.tsToDate_withOptionalUpdateInterval(this.dateToTS(indicator.applicableDates[indicator.applicableDates.length - 1]), indicator.metadata.updateInterval); - - } - + if (indicator.applicableDates.length <= 20) { + for (var [j, date] of indicator.applicableDates.entries()) { + var asDate = new Date(date); + datesString += this.tsToDate_withOptionalUpdateInterval(this.dateToTS(asDate), indicator.metadata.updateInterval); + if (j < indicator.applicableDates.length - 1) { + datesString += " "; + } + } + } + else { + datesString += "Zeitreihe umfasst insgesamt " + indicator.applicableDates.length + " Zeitpunkte\n\n"; + datesString += "frühester Zeitpunkt: " + this.tsToDate_withOptionalUpdateInterval(this.dateToTS(indicator.applicableDates[0]), indicator.metadata.updateInterval) + "\n"; + datesString += "spätester Zeitpunkt: " + this.tsToDate_withOptionalUpdateInterval(this.dateToTS(indicator.applicableDates[indicator.applicableDates.length - 1]), indicator.metadata.updateInterval); + } var imgData; var imgWidth; var imgHeight; - - if(indicator.processDescription && indicator.processDescription.includes("$")){ - await html2canvas(document.querySelector("#indicatorProcessDescription")).then(canvas => { - // document.body.appendChild(canvas) - - imgData = canvas.toDataURL('image/png'); - - }); - - var dimensions = await getImageDimensions(imgData); - imgWidth = dimensions.w; - imgHeight = dimensions.h; - } - + if (indicator.processDescription && indicator.processDescription.includes("$")) { + await html2canvas(document.querySelector("#indicatorProcessDescription")).then(canvas => { + // document.body.appendChild(canvas) + imgData = canvas.toDataURL('image/png'); + }); + var dimensions = await getImageDimensions(imgData); + imgWidth = dimensions.w; + imgHeight = dimensions.h; + } jspdf.autoTable({ - head: [], - body: [ - ["Beschreibung", indicator.metadata.description], - ["Maßeinheit", indicator.unit], - ["Methodik", indicator.processDescription ? indicator.processDescription : "-"], - // ["Klassifizierung", "-"], - ["Interpretation", indicator.interpretation ? indicator.interpretation : "-"], - ["Tags", indicator.tags ? JSON.stringify(indicator.tags) : "-"], - ["Verknüpfte Indikatoren", linkedIndicatorsString], - ["Verknüpfte Geodaten", linkedGeoresourcesString] - ], - theme: 'grid', - headStyles: headStyles, - bodyStyles: bodyStyles, - columnStyles: columnStyles, - startY: jspdf.autoTable.previous.finalY + 10, - willDrawCell: function(data) { - if (imgData && data.row.index === 2 && data.column.index === 1 && data.cell.section === 'body') { - data.row.height = 2.5 * data.cell.height; - data.row.maxCellHeight = 2.5 * data.cell.height; - data.cell.height = 2.5 * data.cell.height; - data.cell.text = ""; - } - if (imgData && data.row.index === 2 && data.column.index === 0 && data.cell.section === 'body') { - data.row.height = 2.5 * data.cell.height; - data.row.maxCellHeight = 2.5 * data.cell.height; - data.cell.height = 2.5 * data.cell.height; - } - }, - didDrawCell: function(data) { - if (imgData && data.row.index === 2 && data.column.index === 1 && data.cell.section === 'body') { - var cellHeight = data.cell.height - data.cell.padding('vertical'); - var cellWidth = data.cell.width - data.cell.padding('horizontal'); - var textPos = data.cell.textPos; - - var imgScale = cellHeight / imgHeight; - var width = imgWidth * imgScale; - if (width > cellWidth){ - width = cellWidth; - } - - jspdf.addImage(imgData, "PNG", textPos.x, textPos.y, width, cellHeight); + head: [], + body: [ + ["Beschreibung", indicator.metadata.description], + ["Maßeinheit", indicator.unit], + ["Methodik", indicator.processDescription ? indicator.processDescription : "-"], + // ["Klassifizierung", "-"], + ["Interpretation", indicator.interpretation ? indicator.interpretation : "-"], + ["Tags", indicator.tags ? JSON.stringify(indicator.tags) : "-"], + ["Verknüpfte Indikatoren", linkedIndicatorsString], + ["Verknüpfte Geodaten", linkedGeoresourcesString] + ], + theme: 'grid', + headStyles: headStyles, + bodyStyles: bodyStyles, + columnStyles: columnStyles, + startY: jspdf.autoTable.previous.finalY + 10, + willDrawCell: function (data) { + if (imgData && data.row.index === 2 && data.column.index === 1 && data.cell.section === 'body') { + data.row.height = 2.5 * data.cell.height; + data.row.maxCellHeight = 2.5 * data.cell.height; + data.cell.height = 2.5 * data.cell.height; + data.cell.text = ""; + } + if (imgData && data.row.index === 2 && data.column.index === 0 && data.cell.section === 'body') { + data.row.height = 2.5 * data.cell.height; + data.row.maxCellHeight = 2.5 * data.cell.height; + data.cell.height = 2.5 * data.cell.height; + } + }, + didDrawCell: function (data) { + if (imgData && data.row.index === 2 && data.column.index === 1 && data.cell.section === 'body') { + var cellHeight = data.cell.height - data.cell.padding('vertical'); + var cellWidth = data.cell.width - data.cell.padding('horizontal'); + var textPos = data.cell.textPos; + var imgScale = cellHeight / imgHeight; + var width = imgWidth * imgScale; + if (width > cellWidth) { + width = cellWidth; + } + jspdf.addImage(imgData, "PNG", textPos.x, textPos.y, width, cellHeight); + } } - } }); - // // linked elements // jspdf.autoTable({ // head: [], @@ -2397,30 +1922,28 @@ angular // columnStyles: columnStyles, // startY: jspdf.autoTable.previous.finalY + 10 // }); - // linked elements jspdf.autoTable({ - head: [], - body: [ - ["Datengrundlage", indicator.metadata.databasis ? indicator.metadata.databasis : "-"], - ["Datenquelle", indicator.metadata.datasource ? indicator.metadata.datasource : "-"], - ["Datenhalter und Kontakt", indicator.metadata.contact ? indicator.metadata.contact : "-"], - ["Bemerkung", indicator.metadata.note ? indicator.metadata.note : "-"], - ["Raumbezug", spatialUnitsString], - // $scope.updateInteval is a map mapping the english KEYs to german expressions - ["Zeitbezug / Fortführungsintervall", this.updateInterval.get(indicator.metadata.updateInterval.toUpperCase())], - ["Hinweise zum Referenzdatum", indicator.referenceDateNote ? indicator.referenceDateNote : "-"], - ["Verfügbare Zeitreihen", datesString], - ["Datum der letzten Aktualisierung", this.tsToDate_withOptionalUpdateInterval(this.dateToTS(indicator.metadata.lastUpdate))], - ["Quellen / Literatur", indicator.metadata.literature ? indicator.metadata.literature : "-"] - ], - theme: 'grid', - headStyles: headStyles, - bodyStyles: bodyStyles, - columnStyles: columnStyles, - startY: jspdf.autoTable.previous.finalY + 10 + head: [], + body: [ + ["Datengrundlage", indicator.metadata.databasis ? indicator.metadata.databasis : "-"], + ["Datenquelle", indicator.metadata.datasource ? indicator.metadata.datasource : "-"], + ["Datenhalter und Kontakt", indicator.metadata.contact ? indicator.metadata.contact : "-"], + ["Bemerkung", indicator.metadata.note ? indicator.metadata.note : "-"], + ["Raumbezug", spatialUnitsString], + // $scope.updateInteval is a map mapping the english KEYs to german expressions + ["Zeitbezug / Fortführungsintervall", this.updateInterval.get(indicator.metadata.updateInterval.toUpperCase())], + ["Hinweise zum Referenzdatum", indicator.referenceDateNote ? indicator.referenceDateNote : "-"], + ["Verfügbare Zeitreihen", datesString], + ["Datum der letzten Aktualisierung", this.tsToDate_withOptionalUpdateInterval(this.dateToTS(indicator.metadata.lastUpdate))], + ["Quellen / Literatur", indicator.metadata.literature ? indicator.metadata.literature : "-"] + ], + theme: 'grid', + headStyles: headStyles, + bodyStyles: bodyStyles, + columnStyles: columnStyles, + startY: jspdf.autoTable.previous.finalY + 10 }); - // // jspdf.autoTable({ // head: [], @@ -2434,655 +1957,571 @@ angular // columnStyles: columnStyles, // startY: jspdf.autoTable.previous.finalY + 10 // }); - return jspdf; - }; - - this.generateIndicatorMetadataPdf_asBlob = async function(){ + }; + this.generateIndicatorMetadataPdf_asBlob = async function () { // create PDF from currently selected/displayed indicator! var indicatorMetadata = this.selectedIndicator; var pdfName = indicatorMetadata.indicatorName + ".pdf"; - var jspdf = await this.generateIndicatorMetadataPdf(indicatorMetadata, pdfName); - return jspdf.output("blob", {filename: pdfName}); - }; - - this.generateIndicatorMetadataPdf = async function(indicatorMetadata, pdfName){ + var jspdf = await this.generateIndicatorMetadataPdf(indicatorMetadata, pdfName); + return jspdf.output("blob", { filename: pdfName }); + }; + this.generateIndicatorMetadataPdf = async function (indicatorMetadata, pdfName) { var jspdf = await this.createMetadataPDF_indicator(indicatorMetadata); - jspdf.setProperties({ - title: 'KomMonitor Indikatorenblatt', - subject: pdfName, - author: 'KomMonitor', - keywords: 'Indikator, Metadatenblatt', - creator: 'KomMonitor' + title: 'KomMonitor Indikatorenblatt', + subject: pdfName, + author: 'KomMonitor', + keywords: 'Indikator, Metadatenblatt', + creator: 'KomMonitor' }); return jspdf; - }; - - /** - * creates and returns a pdf for the georesource given as parameter - */ - this.createMetadataPDF_georesource = async function(georesource, pdfName) { - + }; + /** + * creates and returns a pdf for the georesource given as parameter + */ + this.createMetadataPDF_georesource = async function (georesource, pdfName) { var jspdf = new jsPDF(); jspdf.setFontSize(16); // jspdf.text("Metadatenblatt", 70, 6); - //insert logo var img = new Image(); var subPath = location.pathname; img.src = subPath + 'logos/KM_Logo1.png'; jspdf.addImage(img, 'PNG', 193, 5, 12, 12); - jspdf.setFontSize(16); jspdf.setFont('Helvetica', 'bolditalic', 'normal'); var titleArray = jspdf.splitTextToSize("Geodatensatz: " + georesource.datasetName, 180); jspdf.text(titleArray, 14, 25); - - jspdf.setFontSize(11); - var initialStartY = 30; - if (titleArray.length > 1) { - titleArray.forEach(function (item) { - initialStartY += 5; - }); + titleArray.forEach(function (item) { + initialStartY += 5; + }); } - var headStyles = { - fontStyle: 'bold', - fontSize: 12, - fillColor: '#337ab7', - // auto or wrap - cellWidth: 'auto' + fontStyle: 'bold', + fontSize: 12, + fillColor: '#337ab7', + // auto or wrap + cellWidth: 'auto' }; - var bodyStyles = { - fontStyle: 'normal', - fontSize: 11, - // auto or wrap or number - cellWidth: 'auto' + fontStyle: 'normal', + fontSize: 11, + // auto or wrap or number + cellWidth: 'auto' }; - // first column with fixed width var columnStyles = { - 0: { cellWidth: 45, fontStyle: 'bold' }, - 1: { fontStyle: 'normal' } + 0: { cellWidth: 45, fontStyle: 'bold' }, + 1: { fontStyle: 'normal' } }; - var topicsString = ""; - var topicReferenceId = georesource.topicReference; - // will be an array representing the topic hierarchy // i.e. [mainTopic, subTopicFirstTier, subTopicSecondTier, ...] var topicHierarchyArray = this.getTopicHierarchyForTopicId(topicReferenceId); - for (let index = 0; index < topicHierarchyArray.length; index++) { - if (index === 0) { - // mainTopic --> first tier - topicsString += topicHierarchyArray[index].topicName; - } - else { - var numberOfWhitespaces = 2 * index; - var whitespaceString = ""; - for (let k = 0; k < numberOfWhitespaces; k++) { - whitespaceString += " "; - } - topicsString += whitespaceString + topicHierarchyArray[index].topicName; - } - - if (index < topicHierarchyArray.length - 1) { - topicsString += "\n"; - } - - } - + if (index === 0) { + // mainTopic --> first tier + topicsString += topicHierarchyArray[index].topicName; + } + else { + var numberOfWhitespaces = 2 * index; + var whitespaceString = ""; + for (let k = 0; k < numberOfWhitespaces; k++) { + whitespaceString += " "; + } + topicsString += whitespaceString + topicHierarchyArray[index].topicName; + } + if (index < topicHierarchyArray.length - 1) { + topicsString += "\n"; + } + } var category = "Punkt"; if (georesource.isLOI) { - category = "Linie"; + category = "Linie"; } - else if(georesource.isAOI){ - category = "Fläche"; + else if (georesource.isAOI) { + category = "Fläche"; } - // Or JavaScript: jspdf.autoTable({ - head: [['Themenfeld', 'Datentyp', 'letzte Aktualisierung']], - body: [ - [topicsString, category, this.tsToDate_withOptionalUpdateInterval(this.dateToTS(georesource.metadata.lastUpdate))] - // ... - ], - theme: 'grid', - headStyles: headStyles, - bodyStyles: bodyStyles, - startY: initialStartY + head: [['Themenfeld', 'Datentyp', 'letzte Aktualisierung']], + body: [ + [topicsString, category, this.tsToDate_withOptionalUpdateInterval(this.dateToTS(georesource.metadata.lastUpdate))] + // ... + ], + theme: 'grid', + headStyles: headStyles, + bodyStyles: bodyStyles, + startY: initialStartY }); - var datesString = ""; - - if(georesource.availablePeriodsOfValidity.length <= 10){ - for (var [j, period] of georesource.availablePeriodsOfValidity.entries()) { - - var startDate = new Date(period.startDate); - var endDate = period.endDate? new Date(period.endDate) : undefined; - - datesString += "Zeitspanne: " + this.tsToDate_withOptionalUpdateInterval(this.dateToTS(startDate)); - if(endDate){ - datesString += " - " + this.tsToDate_withOptionalUpdateInterval(this.dateToTS(endDate)); + if (georesource.availablePeriodsOfValidity.length <= 10) { + for (var [j, period] of georesource.availablePeriodsOfValidity.entries()) { + var startDate = new Date(period.startDate); + var endDate = period.endDate ? new Date(period.endDate) : undefined; + datesString += "Zeitspanne: " + this.tsToDate_withOptionalUpdateInterval(this.dateToTS(startDate)); + if (endDate) { + datesString += " - " + this.tsToDate_withOptionalUpdateInterval(this.dateToTS(endDate)); + } + else { + datesString += "- 'null' (demnach gültig bis auf weiteres)"; + } + if (j < georesource.availablePeriodsOfValidity.length - 1) { + datesString += "\n"; + } } - else{ - datesString += "- 'null' (demnach gültig bis auf weiteres)"; + } + else { + datesString += "insgesamt " + georesource.availablePeriodsOfValidity.length + " Zeitspannen\n\n"; + var earliestStartDate; + var latestEndDate = -1; // my be null --> enc init with -1 + for (var [j, period] of georesource.availablePeriodsOfValidity.entries()) { + if (!earliestStartDate) { + earliestStartDate = new Date(period.startDate); + } + else { + if (new Date(period.startDate) < earliestStartDate) { + earliestStartDate = new Date(period.startDate); + } + } + if (latestEndDate == -1) { + if (period.endDate) { + latestEndDate = new Date(period.endDate); + } + else if (period.endDate == null) { + latestEndDate = null; + } + } + else { + if (latestEndDate && period.endDate && new Date(period.endDate) > latestEndDate) { + latestEndDate = new Date(period.endDate); + } + } + } + datesString += "frühestes Startdatum: " + this.tsToDate_withOptionalUpdateInterval(this.dateToTS(earliestStartDate)) + "\n"; + if (latestEndDate != null && latestEndDate != -1) { + datesString += "spätestes Enddatum: " + this.tsToDate_withOptionalUpdateInterval(this.dateToTS(latestEndDate)) + "\n"; } - - if (j < georesource.availablePeriodsOfValidity.length - 1) { - datesString += "\n"; + else { + datesString += "spätestes Enddatum: ohne explizites Enddatum (demnach gültig bis auf weiteres)\n"; } - } } - else{ - datesString += "insgesamt " + georesource.availablePeriodsOfValidity.length + " Zeitspannen\n\n"; - - var earliestStartDate; - var latestEndDate = -1; // my be null --> enc init with -1 - - for (var [j, period] of georesource.availablePeriodsOfValidity.entries()) { - - if(! earliestStartDate){ - earliestStartDate = new Date(period.startDate); - } - else{ - if(new Date(period.startDate) < earliestStartDate){ - earliestStartDate = new Date(period.startDate); - } - } - - if(latestEndDate == -1){ - if(period.endDate){ - latestEndDate = new Date(period.endDate); - } - else if(period.endDate == null){ - latestEndDate = null; - } - - } - else{ - if(latestEndDate && period.endDate && new Date(period.endDate) > latestEndDate){ - latestEndDate = new Date(period.endDate); - } - } - } - - datesString += "frühestes Startdatum: " + this.tsToDate_withOptionalUpdateInterval(this.dateToTS(earliestStartDate)) + "\n"; - if(latestEndDate != null && latestEndDate != -1){ - datesString += "spätestes Enddatum: " + this.tsToDate_withOptionalUpdateInterval(this.dateToTS(latestEndDate)) + "\n"; - } - else{ - datesString += "spätestes Enddatum: ohne explizites Enddatum (demnach gültig bis auf weiteres)\n"; - } - - - } - // linked elements jspdf.autoTable({ - head: [], - body: [ - ["Beschreibung", georesource.metadata.description], - ["Datengrundlage", georesource.metadata.databasis ? georesource.metadata.databasis : "-"], - ["Datenquelle", georesource.metadata.datasource ? georesource.metadata.datasource : "-"], - ["Datenhalter und Kontakt", georesource.metadata.contact ? georesource.metadata.contact : "-"], - ["Bemerkung", georesource.metadata.note ? georesource.metadata.note : "-"], - // $scope.updateInteval is a map mapping the english KEYs to german expressions - ["Zeitbezug / Fortführungsintervall", this.updateInterval.get(georesource.metadata.updateInterval.toUpperCase())], - ["Verfügbare Gültigkeitszeiträume", datesString], - ["Quellen / Literatur", georesource.metadata.literature ? georesource.metadata.literature : "-"] - ], - theme: 'grid', - headStyles: headStyles, - bodyStyles: bodyStyles, - columnStyles: columnStyles, - startY: jspdf.autoTable.previous.finalY + 10 + head: [], + body: [ + ["Beschreibung", georesource.metadata.description], + ["Datengrundlage", georesource.metadata.databasis ? georesource.metadata.databasis : "-"], + ["Datenquelle", georesource.metadata.datasource ? georesource.metadata.datasource : "-"], + ["Datenhalter und Kontakt", georesource.metadata.contact ? georesource.metadata.contact : "-"], + ["Bemerkung", georesource.metadata.note ? georesource.metadata.note : "-"], + // $scope.updateInteval is a map mapping the english KEYs to german expressions + ["Zeitbezug / Fortführungsintervall", this.updateInterval.get(georesource.metadata.updateInterval.toUpperCase())], + ["Verfügbare Gültigkeitszeiträume", datesString], + ["Quellen / Literatur", georesource.metadata.literature ? georesource.metadata.literature : "-"] + ], + theme: 'grid', + headStyles: headStyles, + bodyStyles: bodyStyles, + columnStyles: columnStyles, + startY: jspdf.autoTable.previous.finalY + 10 }); - jspdf.setProperties({ - title: 'KomMonitor Geodatenblatt', - subject: pdfName, - author: 'KomMonitor', - keywords: 'Geodaten, Metadatenblatt', - creator: 'KomMonitor' + title: 'KomMonitor Geodatenblatt', + subject: pdfName, + author: 'KomMonitor', + keywords: 'Geodaten, Metadatenblatt', + creator: 'KomMonitor' }); return jspdf; - }; - - this.generateGeoresourceMetadataPdf_asBlob = async function(georesourceMetadata){ + }; + this.generateGeoresourceMetadataPdf_asBlob = async function (georesourceMetadata) { var pdfName = georesourceMetadata.datasetName + ".pdf"; - var jspdf = await this.createMetadataPDF_georesource(georesourceMetadata, pdfName); - return jspdf.output("blob", {filename: pdfName}); - }; - - this.downloadMetadataPDF_georesource = async function(georesourceMetadata){ + var jspdf = await this.createMetadataPDF_georesource(georesourceMetadata, pdfName); + return jspdf.output("blob", { filename: pdfName }); + }; + this.downloadMetadataPDF_georesource = async function (georesourceMetadata) { var pdfName = georesourceMetadata.datasetName + ".pdf"; - var jspdf = await this.createMetadataPDF_georesource(georesourceMetadata, pdfName); + var jspdf = await this.createMetadataPDF_georesource(georesourceMetadata, pdfName); return jspdf.save(pdfName); - }; - - // this.getIndicatorStringFromIndicatorType = function (indicator) { - // var indicatorTypeString; - // if (indicator.indicatorType.includes("DYNAMIC_ABSOLUTE")) { - // indicatorTypeString = "Dynamik-Indikator (absolute)"; - // } - // else if (indicator.indicatorType.includes("DYNAMIC_RELATIVE")) { - // indicatorTypeString = "Dynamik-Indikator (relativ)"; - // } - // else if (indicator.indicatorType.includes("DYNAMIC_STANDARDIZED")) { - // indicatorTypeString = "Dynamik-Indikator (standardisiert)"; - // } - // else if (indicator.indicatorType.includes("STATUS_ABSOLUTE")) { - // indicatorTypeString = "Status-Indikator (absolut)"; - // } - // else if (indicator.indicatorType.includes("STATUS_RELATIVE")) { - // indicatorTypeString = "Status-Indikator (relativ)"; - // } - // else if (indicator.indicatorType.includes("STATUS_STANDARDIZED")) { - // indicatorTypeString = "Status-Indikator (standardisiert)"; - // } - - // return indicatorTypeString; - // }; - - this.dateToTS = function(date) { - if(date){ - return date.valueOf(); - } - - }; - - this.tsToDate = function(ts) { - if(ts){ - var date = new Date(ts); - - return date.toLocaleDateString("de-DE", { - year: 'numeric', - month: 'long', - day: 'numeric' - }); + }; + // this.getIndicatorStringFromIndicatorType = function (indicator) { + // var indicatorTypeString; + // if (indicator.indicatorType.includes("DYNAMIC_ABSOLUTE")) { + // indicatorTypeString = "Dynamik-Indikator (absolute)"; + // } + // else if (indicator.indicatorType.includes("DYNAMIC_RELATIVE")) { + // indicatorTypeString = "Dynamik-Indikator (relativ)"; + // } + // else if (indicator.indicatorType.includes("DYNAMIC_STANDARDIZED")) { + // indicatorTypeString = "Dynamik-Indikator (standardisiert)"; + // } + // else if (indicator.indicatorType.includes("STATUS_ABSOLUTE")) { + // indicatorTypeString = "Status-Indikator (absolut)"; + // } + // else if (indicator.indicatorType.includes("STATUS_RELATIVE")) { + // indicatorTypeString = "Status-Indikator (relativ)"; + // } + // else if (indicator.indicatorType.includes("STATUS_STANDARDIZED")) { + // indicatorTypeString = "Status-Indikator (standardisiert)"; + // } + // return indicatorTypeString; + // }; + this.dateToTS = function (date) { + if (date) { + return date.valueOf(); + } + }; + this.tsToDate = function (ts) { + if (ts) { + var date = new Date(ts); + return date.toLocaleDateString("de-DE", { + year: 'numeric', + month: 'long', + day: 'numeric' + }); } - }; - - this.tsToDate_withOptionalUpdateInterval = function(ts, updateIntervalApiName) { - if(ts){ - var date = new Date(ts); - - /** - * TODO FIXME dateSLider formatter will return only year for now to prevent misleading month and day settings - */ - - // return date.getFullYear(); - - if(updateIntervalApiName){ - if(updateIntervalApiName.toLowerCase() === "yearly"){ - return date.getFullYear(); - } - else if(updateIntervalApiName.toLowerCase() === "half_yearly"){ - return (date.getMonth() + 1) + "/" + date.getFullYear(); - } - else if(updateIntervalApiName.toLowerCase() === "monthly"){ - return (date.getMonth() + 1) + "/" + date.getFullYear(); - } - // else if(updateIntervalApiName.toLowerCase() === "weekly"){ - // return date.toLocaleDateString("de-DE", { - // year: 'numeric', - // month: 'short', - // day: 'numeric' - // }); - // } - // else if(updateIntervalApiName.toLowerCase() === "daily"){ - // return date.toLocaleDateString("de-DE", { - // year: 'numeric', - // month: 'short', - // day: 'numeric' - // }); - // } - else if(updateIntervalApiName.toLowerCase() === "quarterly"){ - var year = date.getFullYear(); - var month = date.getMonth(); - if(month < 4){ - return "Q1/" + year; - } - else if(month < 7){ - return "Q2/" + year; - } - else if(month < 10){ - return "Q3/" + year; + }; + this.tsToDate_withOptionalUpdateInterval = function (ts, updateIntervalApiName) { + if (ts) { + var date = new Date(ts); + /** + * TODO FIXME dateSLider formatter will return only year for now to prevent misleading month and day settings + */ + // return date.getFullYear(); + if (updateIntervalApiName) { + if (updateIntervalApiName.toLowerCase() === "yearly") { + return date.getFullYear(); + } + else if (updateIntervalApiName.toLowerCase() === "half_yearly") { + return (date.getMonth() + 1) + "/" + date.getFullYear(); + } + else if (updateIntervalApiName.toLowerCase() === "monthly") { + return (date.getMonth() + 1) + "/" + date.getFullYear(); + } + // else if(updateIntervalApiName.toLowerCase() === "weekly"){ + // return date.toLocaleDateString("de-DE", { + // year: 'numeric', + // month: 'short', + // day: 'numeric' + // }); + // } + // else if(updateIntervalApiName.toLowerCase() === "daily"){ + // return date.toLocaleDateString("de-DE", { + // year: 'numeric', + // month: 'short', + // day: 'numeric' + // }); + // } + else if (updateIntervalApiName.toLowerCase() === "quarterly") { + var year = date.getFullYear(); + var month = date.getMonth(); + if (month < 4) { + return "Q1/" + year; + } + else if (month < 7) { + return "Q2/" + year; + } + else if (month < 10) { + return "Q3/" + year; + } + else { + return "Q4/" + year; + } + } + else { + // includes daily and weekly, as they are presented equally + return date.toLocaleDateString("de-DE", { + year: 'numeric', + month: 'short', + day: 'numeric' + }); + } } else { - return "Q4/" + year; + return date.toLocaleDateString("de-DE", { + year: 'numeric', + month: 'short', + day: 'numeric' + }); } - } - else{ - // includes daily and weekly, as they are presented equally - return date.toLocaleDateString("de-DE", { - year: 'numeric', - month: 'short', - day: 'numeric' - }); - } - } - else{ - return date.toLocaleDateString("de-DE", { - year: 'numeric', - month: 'short', - day: 'numeric' - }); - } - - } - }; - - this.getSpatialUnitIdFromSpatialUnitName = function(name) { + } + }; + this.getSpatialUnitIdFromSpatialUnitName = function (name) { let result = null; - $(this.availableSpatialUnits).each( (id, obj) => { - if (obj.spatialUnitLevel === name) { - result = obj.spatialUnitId; - return false; - } + $(this.availableSpatialUnits).each((id, obj) => { + if (obj.spatialUnitLevel === name) { + result = obj.spatialUnitId; + return false; + } }); return result; - } - - /** - * creates an array of objects from an array of strings. - * each object in the result has the properties "category" and "name" - * - * example: - * convert ["s1", "s2", ...] ===> [{category: "s1",name: "s1"}, {category: "s2", name: "s2"}, ...] - * @param {array} array - */ - this.createDualListInputArray = function(array, nameProperty, idProperty) { - var result = []; - - if(array && Array.isArray(array)){ - for (var i=0;i [{category: "s1",name: "s1"}, {category: "s2", name: "s2"}, ...] + * @param {array} array + */ + this.createDualListInputArray = function (array, nameProperty, idProperty) { + var result = []; + if (array && Array.isArray(array)) { + for (var i = 0; i < array.length; i++) { + var obj = {}; + obj["category"] = array[i][nameProperty]; + obj["name"] = array[i][nameProperty]; + if (idProperty && array[i][idProperty]) { + obj["id"] = array[i][idProperty]; + } + result.push(obj); + } + } + return result; + }; + this.initializeRoleDualListConfig = function (inputArray, selectedArray, nameProperty) { + var duallistRoleOptions = { + label: 'Rollen', + boxItemsHeight: 'md', + items: this.createDualListInputArray(inputArray, nameProperty), + button: { leftText: "Alle auswählen", rightText: "Alle entfernen" }, + selectedItems: this.createDualListInputArray(selectedArray, nameProperty) + }; + // remove those timestamps from left side + duallistRoleOptions.items = duallistRoleOptions.items.filter(function (unselectedItem) { + return !duallistRoleOptions.selectedItems.find(function (selectedItem) { + return unselectedItem.name === selectedItem.name; + }); + }); + return duallistRoleOptions; + }; + this.getRoleMetadataForRoleName = function (roleName) { + for (const roleMetadata of this.availableRoles) { + if (roleMetadata.roleName === roleName) { + return roleMetadata; + } + } + }; + this.getRoleMetadataForRoleId = function (roleId) { + for (const roleMetadata of this.availableRoles) { + if (roleMetadata.roleId === roleId) { + return roleMetadata; + } + } + }; + this.getRoleMetadataForRoleIds = function (roleIdsArray) { + var rolesMetadata = []; + for (const roleMetadata of this.availableRoles) { + if (roleIdsArray.includes(roleMetadata.roleId)) { + rolesMetadata.push(roleMetadata); + } + } + return rolesMetadata; + }; + this.getAllowedRolesString = function (allowedRoleIds) { + var allowedRoles = []; + for (const organizationalUnit of this.accessControl) { + for (const role of organizationalUnit.roles) { + if (allowedRoleIds.includes(role.roleId)) { + allowedRoles.push(organizationalUnit.name + "-" + role.permissionLevel); + } + } + } + return allowedRoles.join(", "); + }; + this.checkDeletePermission = function () { + for (const role of this.currentKeycloakLoginRoles) { + let roleNameParts = role.split("-"); + const permissionLevel = roleNameParts[roleNameParts.length - 1]; //e.g. kommonitor-creator + if (permissionLevel == "creator") { + return true; + } + } + return false; + }; + this.checkCreatePermission = function () { + for (const role of this.currentKeycloakLoginRoles) { + let roleNameParts = role.split("-"); + const permissionLevel = roleNameParts[roleNameParts.length - 1]; //e.g. kommonitor-creator + if (permissionLevel == "publisher" || permissionLevel == "creator") { + return true; + } + } + return false; + }; + this.checkEditorPermission = function () { + for (const role of this.currentKeycloakLoginRoles) { + let roleNameParts = role.split("-"); + const permissionLevel = roleNameParts[roleNameParts.length - 1]; //e.g. kommonitor-creator + if (permissionLevel == "editor" || permissionLevel == "creator" || permissionLevel == "publisher") { + return true; + } + } + return false; + }; + this.checkAdminPermission = function () { + if (this.currentKeycloakLoginRoles.includes(__env.keycloakKomMonitorAdminRoleName)) { + return true; + } + return false; + }; + $rootScope.$on("onAddedFeatureToSelection", function (event, selectedIndicatorFeatureIds) { + let propertyName = buildIndicatorPropertyName(); + $timeout(function (params) { + thisService.setSelectedFeatureProperty(selectedIndicatorFeatureIds, propertyName); + }); + }); + $rootScope.$on("onRemovedFeatureFromSelection", function (event, selectedIndicatorFeatureIds) { + let propertyName = buildIndicatorPropertyName(); + $timeout(function (params) { + thisService.setSelectedFeatureProperty(selectedIndicatorFeatureIds, propertyName); + }); + }); + function buildIndicatorPropertyName() { + const INDICATOR_DATE_PREFIX = __env.indicatorDatePrefix; + let propertyName = INDICATOR_DATE_PREFIX + thisService.selectedDate; + return propertyName; } - } - return false; - } - - this.checkAdminPermission = function(){ - if(this.currentKeycloakLoginRoles.includes(__env.keycloakKomMonitorAdminRoleName)){ - return true; - } - return false; - } - - - $rootScope.$on("onAddedFeatureToSelection", function (event, selectedIndicatorFeatureIds) { - let propertyName = buildIndicatorPropertyName(); - - $timeout(function(params) { - thisService.setSelectedFeatureProperty(selectedIndicatorFeatureIds, propertyName); - }); - }); - - $rootScope.$on("onRemovedFeatureFromSelection", function (event, selectedIndicatorFeatureIds) { - let propertyName = buildIndicatorPropertyName(); - - $timeout(function(params) { - thisService.setSelectedFeatureProperty(selectedIndicatorFeatureIds, propertyName); - }); - }); - - function buildIndicatorPropertyName() { - const INDICATOR_DATE_PREFIX = __env.indicatorDatePrefix; - let propertyName = INDICATOR_DATE_PREFIX + thisService.selectedDate; - return propertyName; - } - - this.reportingDefaultTemplatePageElements = [ - { - "type": "indicatorTitle-landscape", - "dimensions": { - "top": "15px", - "left": "15px", - "width": "720px", - "height": "30px" - }, - "isPlaceholder": true, - "placeholderText": "Titel des Indikators [Einheit]", - "text": "", - "css": "text-align: left; padding-left: 5px; font-weight: bold;" - }, - { - "type": "dataTimestamp-landscape", - "dimensions": { - "top": "50px", - "left": "15px", - "width": "720px", - "height": "30px" - }, - "isPlaceholder": true, - "placeholderText": "Datenstand", - "text": "", - "css": "text-align: left; padding-left: 5px;" - }, - { - "type": "dataTimeseries-landscape", - "dimensions": { - "top": "50px", - "left": "15px", - "width": "720px", - "height": "30px" - }, - "isPlaceholder": true, - "placeholderText": "Zeitreihe von - bis", - "text": "", - "css": "text-align: left; padding-left: 5px;" - }, - { - "type": "reachability-subtitle-landscape", - "dimensions": { - "top": "50px", - "left": "15px", - "width": "720px", - "height": "30px" - }, - "isPlaceholder": true, - "placeholderText": "Aktueller Datenstand, Fortbewegungsmittel, [Indikator]", - "text": "", - "css": "text-align: left; padding-left: 5px;" - }, - { - "type": "communeLogo-landscape", - "dimensions": { - "top": "15px", - "left": "740px", - "width": "75px", - "height": "65px" - }, - "isPlaceholder": true, - "placeholderText": "Logo", - "src": "" - }, - { - "type": "footerHorizontalSpacer-landscape", - "dimensions": { - "top": "535px", - "left": "15px", - "width": "800px", - "height": "0px" - }, - "css": "border-top: solid rgb(148, 148, 148) 1px;" - }, - - { - "type": "footerCreationInfo-landscape", - "dimensions": { - "top": "545px", - "left": "15px", - "width": "720px", - "height": "30px" - }, - "isPlaceholder": true, - "placeholderText": "Erstellt am [Datum] von [Name d. Bearbeiters], [Name d. Kommune]", - "css": "text-align: left; padding-left: 5px;" - }, - { - "type": "pageNumber-landscape", - "dimensions": { - "top": "545px", - "left": "740px", - "width": "75px", - "height": "30px" - }, - "isPlaceholder": true, - "placeholderText": "[Seitenzahl]", - "css": "text-align: right; padding-right: 5px;" - }, - ] - - this.getDefaultReportingTemplatePageElement = function(type) { - let result = this.reportingDefaultTemplatePageElements.filter((el) => { - return el.type === type; - }); - if(typeof(result) === "undefined") { - throw "No DefaultReportingTemplatePageElement exists for type " + type + "." - } else { - return result[0]; - } - } - - - this.generateAndDownloadIndicatorZIP = async function(indicatorData, fileName, fileEnding, jsZipOptions){ - // generate metadata file and include actual dataset and metadata file in download - - var metadataPdf = await this.generateIndicatorMetadataPdf_asBlob(); - var zip = new JSZip(); - zip.file(fileName + fileEnding, indicatorData, jsZipOptions); - zip.file(fileName + "_Metadata.pdf", metadataPdf); - zip.generateAsync({type:"blob"}) - .then(function(content) { - // see FileSaver.js - saveAs(content, fileName + ".zip"); - }); - }; - - this.generateAndDownloadGeoresourceZIP = async function(georesourceMetadata, georesourceData, fileName, fileEnding, jsZipOptions){ - // generate metadata file and include actual dataset and metadata file in download - - var metadataPdf = await this.generateGeoresourceMetadataPdf_asBlob(georesourceMetadata); - var zip = new JSZip(); - zip.file(fileName + fileEnding, georesourceData, jsZipOptions); - zip.file(fileName + "_Metadata.pdf", metadataPdf); - zip.generateAsync({type:"blob"}) - .then(function(content) { - // see FileSaver.js - saveAs(content, fileName + ".zip"); - }); - }; -}]); + this.reportingDefaultTemplatePageElements = [ + { + "type": "indicatorTitle-landscape", + "dimensions": { + "top": "15px", + "left": "15px", + "width": "720px", + "height": "30px" + }, + "isPlaceholder": true, + "placeholderText": "Titel des Indikators [Einheit]", + "text": "", + "css": "text-align: left; padding-left: 5px; font-weight: bold;" + }, + { + "type": "dataTimestamp-landscape", + "dimensions": { + "top": "50px", + "left": "15px", + "width": "720px", + "height": "30px" + }, + "isPlaceholder": true, + "placeholderText": "Datenstand", + "text": "", + "css": "text-align: left; padding-left: 5px;" + }, + { + "type": "dataTimeseries-landscape", + "dimensions": { + "top": "50px", + "left": "15px", + "width": "720px", + "height": "30px" + }, + "isPlaceholder": true, + "placeholderText": "Zeitreihe von - bis", + "text": "", + "css": "text-align: left; padding-left: 5px;" + }, + { + "type": "reachability-subtitle-landscape", + "dimensions": { + "top": "50px", + "left": "15px", + "width": "720px", + "height": "30px" + }, + "isPlaceholder": true, + "placeholderText": "Aktueller Datenstand, Fortbewegungsmittel, [Indikator]", + "text": "", + "css": "text-align: left; padding-left: 5px;" + }, + { + "type": "communeLogo-landscape", + "dimensions": { + "top": "15px", + "left": "740px", + "width": "75px", + "height": "65px" + }, + "isPlaceholder": true, + "placeholderText": "Logo", + "src": "" + }, + { + "type": "footerHorizontalSpacer-landscape", + "dimensions": { + "top": "535px", + "left": "15px", + "width": "800px", + "height": "0px" + }, + "css": "border-top: solid rgb(148, 148, 148) 1px;" + }, + { + "type": "footerCreationInfo-landscape", + "dimensions": { + "top": "545px", + "left": "15px", + "width": "720px", + "height": "30px" + }, + "isPlaceholder": true, + "placeholderText": "Erstellt am [Datum] von [Name d. Bearbeiters], [Name d. Kommune]", + "css": "text-align: left; padding-left: 5px;" + }, + { + "type": "pageNumber-landscape", + "dimensions": { + "top": "545px", + "left": "740px", + "width": "75px", + "height": "30px" + }, + "isPlaceholder": true, + "placeholderText": "[Seitenzahl]", + "css": "text-align: right; padding-right: 5px;" + }, + ]; + this.getDefaultReportingTemplatePageElement = function (type) { + let result = this.reportingDefaultTemplatePageElements.filter((el) => { + return el.type === type; + }); + if (typeof (result) === "undefined") { + throw "No DefaultReportingTemplatePageElement exists for type " + type + "."; + } + else { + return result[0]; + } + }; + this.generateAndDownloadIndicatorZIP = async function (indicatorData, fileName, fileEnding, jsZipOptions) { + // generate metadata file and include actual dataset and metadata file in download + var metadataPdf = await this.generateIndicatorMetadataPdf_asBlob(); + var zip = new JSZip(); + zip.file(fileName + fileEnding, indicatorData, jsZipOptions); + zip.file(fileName + "_Metadata.pdf", metadataPdf); + zip.generateAsync({ type: "blob" }) + .then(function (content) { + // see FileSaver.js + saveAs(content, fileName + ".zip"); + }); + }; + this.generateAndDownloadGeoresourceZIP = async function (georesourceMetadata, georesourceData, fileName, fileEnding, jsZipOptions) { + // generate metadata file and include actual dataset and metadata file in download + var metadataPdf = await this.generateGeoresourceMetadataPdf_asBlob(georesourceMetadata); + var zip = new JSZip(); + zip.file(fileName + fileEnding, georesourceData, jsZipOptions); + zip.file(fileName + "_Metadata.pdf", metadataPdf); + zip.generateAsync({ type: "blob" }) + .then(function (content) { + // see FileSaver.js + saveAs(content, fileName + ".zip"); + }); + }; + }]); +//# sourceMappingURL=kommonitor-data-exchange-service.module.js.map \ No newline at end of file diff --git a/app/util/genericServices/kommonitorDataExchangeService/kommonitor-data-exchange-service.module.js.map b/app/util/genericServices/kommonitorDataExchangeService/kommonitor-data-exchange-service.module.js.map new file mode 100644 index 000000000..e992a97a1 --- /dev/null +++ b/app/util/genericServices/kommonitorDataExchangeService/kommonitor-data-exchange-service.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-data-exchange-service.module.js","sourceRoot":"","sources":["kommonitor-data-exchange-service.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,wBAAwB,EAAE,CAAC,eAAe,EAAE,0BAA0B,CAAC,CAAC,CAAC;AAExF;;;;;;;;GAQG;AACH,OAAO;KACJ,MAAM,CAAC,wBAAwB,EAAE,CAAC,uBAAuB,EAAE,gCAAgC,CAAC,CAAC;KAC7F,OAAO,CACN,+BAA+B,EAAE,CAAC,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,sBAAsB,EAAE,iCAAiC;IAC9H,8BAA8B;IAC9B,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM;IAClC,UAAS,UAAU,EAAE,QAAQ,EAAE,SAAS,EACtC,oBAAoB,EAAE,+BAA+B,EAAE,4BAA4B,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI;QAEnG,IAAI,WAAW,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAE/B,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC;QACzC,IAAI,CAAC,qBAAqB,GAAG,KAAK,CAAC,qBAAqB,CAAC;QACzD,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC;QAC7C,IAAI,CAAC,2BAA2B,GAAG,KAAK,CAAC,2BAA2B,CAAC;QACrE,IAAI,CAAC,mCAAmC,GAAG,KAAK,CAAC,mCAAmC,CAAC;QACrF,IAAI,CAAC,2BAA2B,GAAG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module.ts b/app/util/genericServices/kommonitorDataExchangeService/kommonitor-data-exchange-service.module.ts new file mode 100644 index 000000000..0cea61601 --- /dev/null +++ b/app/util/genericServices/kommonitorDataExchangeService/kommonitor-data-exchange-service.module.ts @@ -0,0 +1,3088 @@ +angular.module('kommonitorDataExchange', ['kommonitorMap', 'kommonitorKeycloakHelper']); + +/** + * a common serviceInstance that holds all needed properties for a WPS service. + * + * This service represents a shared object ´which is used across the different + * application tabs/components like Setup, Capabilities, Execute etc. + * + * This way, one single service instance can be used to easily share values and + * parameters for each WPS operation represented by different Angular components + */ +angular + .module('kommonitorDataExchange', ['kommonitorCacheHelper', 'angularjs-dropdown-multiselect']) + .service( + 'kommonitorDataExchangeService', ['$rootScope', '$timeout', '$interval', 'kommonitorMapService', 'kommonitorKeycloakHelperService', + 'kommonitorCacheHelperService', + '$http', '__env', '$q', 'Auth', + function($rootScope, $timeout, $interval, + kommonitorMapService, kommonitorKeycloakHelperService, kommonitorCacheHelperService, $http, __env, $q, Auth,) { + + let thisService = this; + this.appTitle = __env.appTitle; + + this.customLogoURL = __env.customLogoURL; + this.customLogo_onClickURL = __env.customLogo_onClickURL; + this.customLogoWidth = __env.customLogoWidth; + this.customGreetingsContact_name = __env.customGreetingsContact_name; + this.customGreetingsContact_organisation = __env.customGreetingsContact_organisation; + this.customGreetingsContact_mail = __env.customGreetingsContact_mail; + this.customGreetingsTextInfoMessage = __env.customGreetingsTextInfoMessage; // maybe undefined or empty string + + this.showDiagramExportButtons = true; + this.showGeoresourceExportButtons = true; + + var numberOfDecimals = __env.numberOfDecimals; + const DATE_PREFIX = __env.indicatorDatePrefix; + var defaultColorForZeroValues = __env.defaultColorForZeroValues; + var defaultColorForNoDataValues = __env.defaultColorForNoDataValues; + var defaultColorForFilteredValues = __env.defaultColorForFilteredValues; + + const defaultColorForOutliers_high = __env.defaultColorForOutliers_high; + const defaultBorderColorForOutliers_high = __env.defaultBorderColorForOutliers_high; + const defaultFillOpacityForOutliers_high = __env.defaultFillOpacityForOutliers_high; + const defaultColorForOutliers_low = __env.defaultColorForOutliers_low; + const defaultBorderColorForOutliers_low = __env.defaultBorderColorForOutliers_low; + const defaultFillOpacityForOutliers_low = __env.defaultFillOpacityForOutliers_low; + + + + var self = this; + + this.headlineIndicatorHierarchy = []; + this.computationIndicatorHierarchy = []; + this.topicIndicatorHierarchy = []; + this.topicIndicatorHierarchy_forOrderView = []; + + this.topicGeoresourceHierarchy = []; + this.topicGeoresourceHierarchy_unmappedEntries = {}; + this.georesourceMapKey_forUnmappedTopicReferences = "unmapped"; + + this.enableKeycloakSecurity = __env.enableKeycloakSecurity; + this.currentKeycloakLoginRoles = []; + this.currentKomMonitorLoginRoleNames = []; + this.currentKeycloakUser; + + // MAP objects for available resource metadata in order to have quick access to datasets by ID + this.availableIndicators_map = new Map(); + this.availableGeoresources_map = new Map(); + this.availableSpatialUnits_map = new Map(); + this.availableProcessScripts_map = new Map(); + + this.accessControl = []; + this.accessControl_map = new Map(); + + // Define translations, settings for dropdown-multiselect + this.multiselectDropdownTranslations = { checkAll: 'Alle auswählen', uncheckAll: 'Nichts auswählen', dynamicButtonTextSuffix: 'Werte ausgewählt', + buttonDefaultText: 'Objekteigenschaften auswählen', searchPlaceholder: 'Suchen...' + }; + + this.multiselectDropdownSettings = { + enableSearch: true, clearSearchOnClose: true, + scrollableHeight: '250px', scrollable: true, + buttonClasses: 'form-control btn-block', + template: '{{option}}', smartButtonTextConverter(skip, option) { return option; }, + styleActive: true + }; + + // Filter out roles unrelated to kommonitor + this.setCurrentKomMonitorLoginRoleNames = function() { + var possibleRoles = ["manage-realm"] + this.accessControl.forEach(organizationalUnit => { + organizationalUnit.roles.forEach(role => { + possibleRoles.push(organizationalUnit.name + "-" + role.permissionLevel) + }); + }); + this.currentKomMonitorLoginRoleNames = this.currentKeycloakLoginRoles.filter(role => possibleRoles.includes(role)); + } + + this.setCurrentKomMonitorLoginRoleIds = function() { + this.currentKomMonitorLoginRoleIds = []; + + // make a map of all role names currently logged in user according to pattern + // - + let roleNameMap_loggedIn = new Map(); + + for (const roleName of this.currentKeycloakLoginRoles) { + // roleName consists of - + roleNameMap_loggedIn.set(roleName, ""); + } + + // now iterate once over all possible KomMonitor roles and check if they are within previous map + this.accessControl.forEach(organizationalUnit => { + organizationalUnit.roles.forEach(role => { + if(roleNameMap_loggedIn.has(organizationalUnit.name + "-" + role.permissionLevel)){ + this.currentKomMonitorLoginRoleIds.push(role.roleId); + } + }); + }); + }; + + this.getCurrentKomMonitorLoginRoleIds = function() { + return this.currentKomMonitorLoginRoleIds; + }; + + + this.isAllowedSpatialUnitForCurrentIndicator = function(spatialUnitMetadata){ + if(! this.selectedIndicator){ + return false; + } + + if(! spatialUnitMetadata || ! spatialUnitMetadata.spatialUnitLevel){ + return false; + } + + var filteredApplicableUnits = this.selectedIndicator.applicableSpatialUnits.filter(function (applicableSpatialUnit) { + if (applicableSpatialUnit.spatialUnitId === spatialUnitMetadata.spatialUnitId){ + return true; + } + else{ + return false; + } + }); + + return filteredApplicableUnits.length > 0; + }; + + this.FEATURE_ID_PROPERTY_NAME = __env.FEATURE_ID_PROPERTY_NAME; + this.FEATURE_NAME_PROPERTY_NAME = __env.FEATURE_NAME_PROPERTY_NAME; + this.VALID_START_DATE_PROPERTY_NAME = __env.VALID_START_DATE_PROPERTY_NAME; + this.VALID_END_DATE_PROPERTY_NAME = __env.VALID_END_DATE_PROPERTY_NAME; + this.indicatorDatePrefix = __env.indicatorDatePrefix; + + this.datePickerOptions = { + autoclose: true, + language: 'de', + format: 'yyyy-mm-dd' + }; + + this.disableIndicatorDatePicker = false; + + this.getLimitedDatePickerOptions = function(availableDates){ + + var months = new Map(); + + var years = new Map(); + + var yearMonths = new Map(); + + for (const dateString of availableDates) { + var date = new Date(dateString); + var month = date.getMonth() + 1; + var year = date.getFullYear(); + var yearMonth = year + "-" + month; + + months.set(month, month); + years.set(year, year); + yearMonths.set(yearMonth, yearMonth); + } + + var newDatePickerOptions = { + autoclose: true, + language: 'de', + format: 'yyyy-mm-dd', + endDate: new Date(availableDates[availableDates.length - 1]), + startDate: new Date(availableDates[0]), + defaultViewDate: new Date(availableDates[availableDates.length - 1]), + beforeShowDay: function(date) { + var month = (date.getMonth()+1); + if (month < 10 ){ + month = "0" + month; + } + var day = (date.getDate()); + if (day < 10 ){ + day = "0" + day; + } + var dateString = date.getFullYear() + "-" + month + "-" + day; + + if (availableDates.includes(dateString)) { + + return "enabled-datepicker-item"; + + } else { + + return "disabled disabled-datepicker-item"; + + } + }, + beforeShowMonth: function(date) { + var month = date.getMonth()+1; + var year = date.getFullYear(); + var yearMonth = year + "-" + month; + + if (yearMonths.has(yearMonth)) { + + return "enabled-datepicker-item"; + + } else { + + return "disabled disabled-datepicker-item"; + + } + }, + beforeShowYear: function(date) { + var year = date.getFullYear(); + + if (years.has(year)) { + + return "enabled-datepicker-item"; + + } else { + + return "disabled disabled-datepicker-item"; + + } + }, + beforeShowDecade: function(date) { + var year = date.getFullYear(); + + if (years.has(year)) { + + return "enabled-datepicker-item"; + + } else { + + return "disabled disabled-datepicker-item"; + + } + }, + beforeShowCentury: function(date) { + var year = date.getFullYear(); + + if (years.has(year)) { + + return "enabled-datepicker-item"; + + } else { + + return "disabled disabled-datepicker-item"; + + } + } + }; + + return newDatePickerOptions; + }; + + this.adminUserName = __env.adminUserName; + this.adminPassword = __env.adminPassword; + this.adminIsLoggedIn = false; + + this.availablePoiMarkerColors = [ + { + "colorName" : "red", + "colorValue" : "rgb(205,59,40)" + }, + { + "colorName" : "white", + "colorValue" : "rgb(255,255,255)" + }, + { + "colorName" : "orange", + "colorValue" : "rgb(235,144,46)" + }, + { + "colorName" : "beige", + "colorValue" : "rgb(255,198,138)" + }, + { + "colorName" : "green", + "colorValue" : "rgb(108,166,36)" + }, + { + "colorName" : "blue", + "colorValue" : "rgb(53,161,209)" + }, + { + "colorName" : "purple", + "colorValue" : "rgb(198,77,175)" + }, + { + "colorName" : "pink", + "colorValue" : "rgb(255,138,232)" + }, + { + "colorName" : "gray", + "colorValue" : "rgb(163,163,163)" + }, + { + "colorName" : "black", + "colorValue" : "rgb(47,47,47)" + } + ]; + + this.availableLoiDashArrayObjects = [ + { + "svgString" : '', + "dashArrayValue" : "" + }, + { + "svgString" : '', + "dashArrayValue" : "20" + }, + { + "svgString" : '', + "dashArrayValue" : "20 10" + }, + { + "svgString" : '', + "dashArrayValue" : "20 10 5 10" + }, + { + "svgString" : '', + "dashArrayValue" : "5" + } + ]; + + this.getLoiDashSvgFromStringValue = function(loiDashArrayString){ + for (const loiDashArrayObject of this.availableLoiDashArrayObjects) { + if(loiDashArrayObject.dashArrayValue == loiDashArrayString){ + return loiDashArrayObject.svgString; + } + } + }; + + this.kommonitorMapServiceInstance = kommonitorMapService; + + this.updateIntervalOptions = __env.updateIntervalOptions; + this.indicatorTypeOptions = __env.indicatorTypeOptions; + this.indicatorUnitOptions = __env.indicatorUnitOptions.sort(); + this.indicatorCreationTypeOptions = __env.indicatorCreationTypeOptions; + this.geodataSourceFormats = __env.geodataSourceFormats; + + this.anySideBarIsShown = false; + + this.isMeasureOfValueChecked = false; + this.isBalanceChecked = false; + this.indicatorAndMetadataAsBalance; + this.tmpIndicatorGeoJSON = undefined; + + this.wmsUrlForSelectedIndicator = undefined; + this.wfsUrlForSelectedIndicator = undefined; + + this.baseUrlToKomMonitorDataAPI = __env.apiUrl + __env.basePath; + this.simplifyGeometriesParameterName = __env.simplifyGeometriesParameterName; + this.simplifyGeometriesOptions = __env.simplifyGeometriesOptions; + this.simplifyGeometries = __env.simplifyGeometries; + + this.wmsDatasets = __env.wmsDatasets.sort((a, b) => (a.title > b.title) ? 1 : -1); + this.wfsDatasets = __env.wfsDatasets.sort((a, b) => (a.title > b.title) ? 1 : -1); + this.wmsDatasets_keywordFiltered = JSON.parse(JSON.stringify(this.wmsDatasets)); + this.wfsDatasets_keywordFiltered = JSON.parse(JSON.stringify(this.wfsDatasets)); + + + this.fileDatasets = []; + + this.availableRoles = []; + this.availableUsers = []; + this.availableProcessScripts = []; + this.isochroneLegend; + + this.useOutlierDetectionOnIndicator = __env.useOutlierDetectionOnIndicator; + this.classifyZeroSeparately = __env.classifyZeroSeparately; + this.classifyUsingWholeTimeseries = __env.classifyUsingWholeTimeseries; + this.useNoDataToggle = __env.useNoDataToggle; + + this.getUpdateIntervalDisplayValue = function(apiValue){ + for (const updateIntervalOption of this.updateIntervalOptions) { + if(updateIntervalOption.apiName === apiValue){ + return updateIntervalOption.displayName + } + } + }; + + this.getBaseUrlToKomMonitorDataAPI_spatialResource = function(){ + return this.baseUrlToKomMonitorDataAPI + kommonitorCacheHelperService.spatialResourceGETUrlPath_forAuthentication; + }; + + this.setProcessScripts = function(scriptsArray){ + this.availableProcessScripts = scriptsArray; + this.availableProcessScripts_map = new Map(); + for (const scriptMetadata of scriptsArray) { + this.availableProcessScripts_map.set(scriptMetadata.scriptId, scriptMetadata); + } + }; + + this.addSingleProcessScriptMetadata = function(processScriptMetadata){ + let tmpArray = [processScriptMetadata]; + Array.prototype.push.apply(tmpArray, this.availableProcessScripts); + this.availableProcessScripts = tmpArray; + this.availableProcessScripts_map.set(processScriptMetadata.scriptId, processScriptMetadata); + }; + + this.replaceSingleProcessScriptMetadata = function(processScriptMetadata){ + for (let index = 0; index < this.availableProcessScripts.length; index++) { + let processScript = this.availableProcessScripts[index]; + if(processScript.scriptId == processScriptMetadata.scriptId){ + this.availableProcessScripts[index] = processScriptMetadata; + break; + } + } + this.availableProcessScripts_map.set(processScriptMetadata.scriptId, processScriptMetadata); + }; + + this.deleteSingleProcessScriptMetadata = function(processScriptId){ + for (let index = 0; index < this.availableProcessScripts.length; index++) { + const processScript = this.availableProcessScripts[index]; + if(processScript.scriptId == processScriptId){ + this.availableProcessScripts.splice(index, 1); + break; + } + } + this.availableProcessScripts_map.delete(processScriptId); + }; + + this.getProcessScriptMetadataById = function(scriptId){ + return this.availableProcessScripts_map.get(scriptId); + }; + + + // ERROR HANDLING + this.errorMessage = undefined; + this.hideErrorAlert = function(){ + $(".mapApplicationErrorAlert").hide(); + }; + + this.displayMapApplicationError = function(error){ + $timeout(function () { + if(error.data){ + self.errorMessage = self.syntaxHighlightJSON(error.data); + } + if(error.message){ + self.errorMessage = self.syntaxHighlightJSON(error.message); + } + else{ + self.errorMessage = self.syntaxHighlightJSON(error); + } + + // $rootScope.$apply(); + $rootScope.$broadcast("hideLoadingIconOnMap"); + + $(".mapApplicationErrorAlert").show(); + }, 1000); + + }; + + // SPATIAL UNITS + + this.availableSpatialUnits = []; + + this.selectedSpatialUnit; + this.selectedDate; + + this.setSpatialUnits = function(spatialUnitsArray){ + this.availableSpatialUnits = spatialUnitsArray; + this.availableSpatialUnits_map = new Map(); + for (const spatialUnitMetadata of spatialUnitsArray) { + this.availableSpatialUnits_map.set(spatialUnitMetadata.spatialUnitId, spatialUnitMetadata); + } + }; + + this.addSingleSpatialUnitMetadata = function(spatialUnitMetadata){ + let tmpArray = [spatialUnitMetadata]; + Array.prototype.push.apply(tmpArray, this.availableSpatialUnits); + this.availableSpatialUnits = tmpArray; + this.availableSpatialUnits_map.set(spatialUnitMetadata.spatialUnitId, spatialUnitMetadata); + }; + + this.replaceSingleSpatialUnitMetadata = function(spatialUnitMetadata){ + for (let index = 0; index < this.availableSpatialUnits.length; index++) { + let spatialUnit = this.availableSpatialUnits[index]; + if(spatialUnit.spatialUnitId == spatialUnitMetadata.spatialUnitId){ + this.availableSpatialUnits[index] = spatialUnitMetadata; + break; + } + } + this.availableSpatialUnits_map.set(spatialUnitMetadata.spatialUnitId, spatialUnitMetadata); + }; + + this.deleteSingleSpatialUnitMetadata = function(spatialUnitId){ + for (let index = 0; index < this.availableSpatialUnits.length; index++) { + const spatialUnit = this.availableSpatialUnits[index]; + if(spatialUnit.spatialUnitId == spatialUnitId){ + this.availableSpatialUnits.splice(index, 1); + break; + } + } + this.availableSpatialUnits_map.delete(spatialUnitId); + }; + + // GEORESOURCES + + this.availableGeoresources = []; + this.displayableGeoresources = []; + this.displayableGeoresources_keywordFiltered = []; + this.displayableGeoresources_keywordFiltered_forAlphabeticalDisplay = {}; + + this.selectedGeoresource; + + this.setGeoresources = function(georesourcesArray){ + this.availableGeoresources = georesourcesArray; + + this.availableGeoresources_map = new Map(); + for (const georesourceMetadata of georesourcesArray) { + this.availableGeoresources_map.set(georesourceMetadata.georesourceId, georesourceMetadata); + } + + this.displayableGeoresources = this.availableGeoresources.filter(item => self.isDisplayableGeoresource(item)); + this.displayableGeoresources_keywordFiltered = JSON.parse(JSON.stringify(this.displayableGeoresources)); + + this.wmsDatasets_keywordFiltered = JSON.parse(JSON.stringify(this.wmsDatasets)); + this.wfsDatasets_keywordFiltered = JSON.parse(JSON.stringify(this.wfsDatasets)); + + this.displayableGeoresources_keywordFiltered_forAlphabeticalDisplay = { + poiData: this.displayableGeoresources_keywordFiltered.filter(item => item.isPOI), + loiData: this.displayableGeoresources_keywordFiltered.filter(item => item.isLOI), + aoiData: this.displayableGeoresources_keywordFiltered.filter(item => item.isAOI), + wmsData: this.wmsDatasets_keywordFiltered, + wfsData: this.wfsDatasets_keywordFiltered + }; + }; + + this.addSingleGeoresourceMetadata = function(georesourceMetadata){ + let tmpArray = [georesourceMetadata]; + Array.prototype.push.apply(tmpArray, this.availableGeoresources); + this.availableGeoresources = tmpArray; + this.availableGeoresources_map.set(georesourceMetadata.georesourceId, georesourceMetadata); + }; + + this.replaceSingleGeoresourceMetadata = function(georesourceMetadata){ + for (let index = 0; index < this.availableGeoresources.length; index++) { + let georesource = this.availableGeoresources[index]; + if(georesource.georesourceId == georesourceMetadata.georesourceId){ + this.availableGeoresources[index] = georesourceMetadata; + break; + } + } + this.availableGeoresources_map.set(georesourceMetadata.georesourceId, georesourceMetadata); + }; + + this.deleteSingleGeoresourceMetadata = function(georesourceId){ + for (let index = 0; index < this.availableGeoresources.length; index++) { + const georesource = this.availableGeoresources[index]; + if(georesource.georesourceId == georesourceId){ + this.availableGeoresources.splice(index, 1); + break; + } + } + this.availableGeoresources_map.delete(georesourceId); + }; + + // INDICATORS + + this.availableIndicators = []; + this.displayableIndicators = []; + + this.selectedIndicator; + // backup used when switching themes --< this might make selectedIndicator undefined due to filtering list of theme-matching indicators + this.selectedIndicatorBackup; + this.wmsUrlForSelectedIndicator; + this.wfsUrlForSelectedIndicator; + + this.selectedIndicatorLegendURL; + + this.measureOfValue = 51; + + // updateInterval (from kommonitor data management api) = ['ARBITRARY', 'MONTHLY', 'QUARTERLY', 'HALF_YEARLY', 'YEARLY'] + this.updateInterval = new Map(); + this.updateInterval.set("ARBITRARY", "beliebig"); + this.updateInterval.set("YEARLY", "jährlich"); + this.updateInterval.set("HALF_YEARLY", "halbjährig"); + this.updateInterval.set("MONTHLY", "monatlich"); + this.updateInterval.set("QUARTERLY", "vierteljährlich"); + + this.setIndicators = function(indicatorsArray){ + this.availableIndicators = indicatorsArray; + this.availableIndicators_map = new Map(); + + for (const indicatorMetadata of indicatorsArray) { + this.availableIndicators_map.set(indicatorMetadata.indicatorId, indicatorMetadata); + } + }; + + this.addSingleIndicatorMetadata = function(indicatorMetadata){ + let tmpArray = [indicatorMetadata]; + Array.prototype.push.apply(tmpArray, this.availableIndicators); + this.availableIndicators = tmpArray; + this.availableIndicators_map.set(indicatorMetadata.indicatorId, indicatorMetadata); + }; + + this.replaceSingleIndicatorMetadata = function(indicatorMetadata){ + for (let index = 0; index < this.availableIndicators.length; index++) { + let indicator = this.availableIndicators[index]; + if(indicator.indicatorId == indicatorMetadata.indicatorId){ + this.availableIndicators[index] = indicatorMetadata; + break; + } + } + this.availableIndicators_map.set(indicatorMetadata.indicatorId, indicatorMetadata); + }; + + this.deleteSingleIndicatorMetadata = function(indicatorId){ + for (let index = 0; index < this.availableIndicators.length; index++) { + const indicator = this.availableIndicators[index]; + if(indicator.indicatorId == indicatorId){ + this.availableIndicators.splice(index, 1); + break; + } + } + this.availableIndicators_map.delete(indicatorId); + }; + + + // TOPICS + + this.availableTopics = []; + + this.selectedTopic; + + this.setTopics = function(topicsArray){ + this.availableTopics = topicsArray; + }; + + this.topicHierarchyContainsGeoresource = function(topic, georesourceMetadata){ + // luckily, the topicReference is defined exactly like for indicators + // hence we can simply refer to that method + + return this.topicHierarchyContainsIndicator(topic, georesourceMetadata); + }; + + this.topicHierarchyContainsWms = function(topic, wmsMetadata){ + // luckily, the topicReference is defined exactly like for indicators + // hence we can simply refer to that method + + return this.topicHierarchyContainsIndicator(topic, wmsMetadata); + }; + + this.topicHierarchyContainsWfs = function(topic, wfsMetadata){ + // luckily, the topicReference is defined exactly like for indicators + // hence we can simply refer to that method + + return this.topicHierarchyContainsIndicator(topic, wfsMetadata); + }; + + this.topicHierarchyContainsIndicator = function(topic, indicatorMetadata){ + if(topic === null || topic === ""){ + if (indicatorMetadata.topicReference === null || indicatorMetadata.topicReference === "" || ! this.referencedTopicIdExists(indicatorMetadata.topicReference)){ + return true; + } + else{ + return false; + } + } + + if (topic.topicId === indicatorMetadata.topicReference){ + return true; + } + else{ + return this.anySubTopicContainsIndicator(topic, indicatorMetadata); + } + }; + + this.anySubTopicContainsIndicator = function(topic, indicatorMetadata){ + var isContained = false; + + for (const subTopic of topic.subTopics) { + isContained = this.topicHierarchyContainsIndicator(subTopic, indicatorMetadata); + + if(isContained){ + break; + } + } + + return isContained; + }; + + // topic may be null + this.getGeoresourceDatasets = function(topic, georesourceNameFilter, showPOI, showLOI, showAOI, showWMS, showWFS){ + var availableGeoresources = this.getAvailableGeoresources(topic, georesourceNameFilter, showPOI, showLOI, showAOI); + var wmsDatasets = this.getAvailableWmsDatasets(topic, georesourceNameFilter, showWMS); + var wfsDatasets = this.getAvailableWfsDatasets(topic, georesourceNameFilter, showWFS); + + var datasets = availableGeoresources.concat(wmsDatasets).concat(wfsDatasets); + return datasets; + }; + + this.getNumberOfGeoresources = function(topic, georesourceNameFilter, showPOI, showLOI, showAOI, showWMS, showWFS){ + + var numberOfAvailableGeoresources = this.getNumberOfAvailableGeoresources(topic, georesourceNameFilter, showPOI, showLOI, showAOI); + var numberOfWmsDatasets = this.getNumberOfAvailableWmsDatasets(topic, georesourceNameFilter, showWMS); + var numberOfWfsDatasets = this.getNumberOfAvailableWfsDatasets(topic, georesourceNameFilter, showWFS); + + var numberOfResources = numberOfAvailableGeoresources + numberOfWmsDatasets + numberOfWfsDatasets; + return numberOfResources; + }; + + var filterGeoresourcesByTypes = function(georesourceMetadataArray, showPOI, showLOI, showAOI){ + + if(!showPOI && !showLOI && !showAOI){ + return []; + } + + return georesourceMetadataArray.filter(georesourceMetadata => { + if(georesourceMetadata.isPOI){ + if(showPOI){ + return true; + } + else{ + return false; + } + } + else if(georesourceMetadata.isLOI){ + if(showLOI){ + return true; + } + else{ + return false; + } + } + else if(georesourceMetadata.isAOI){ + if(showAOI){ + return true; + } + else{ + return false; + } + } + else{ + return false; + } + }); + }; + + this.getAvailableGeoresources = function(topic, georesourceNameFilter, showPOI, showLOI, showAOI){ + var georesources = []; + + var filteredGeoresources = this.availableGeoresources; + + filteredGeoresources = filterByGeoresourceNamesToHide(filteredGeoresources); + + if(georesourceNameFilter && georesourceNameFilter != ""){ + filteredGeoresources = filterArrayObjectsByValue(filteredGeoresources, georesourceNameFilter); + } + + filteredGeoresources = filterGeoresourcesByTypes(filteredGeoresources, showPOI, showLOI, showAOI); + + for (const georesourceMetadata of filteredGeoresources) { + if (this.topicHierarchyContainsGeoresource(topic, georesourceMetadata)){ + georesources.push(georesourceMetadata); + } + } + + return georesources; + }; + + this.getNumberOfAvailableGeoresources = function(topic, georesourceNameFilter, showPOI, showLOI, showAOI){ + return this.getAvailableGeoresources(topic, georesourceNameFilter, showPOI, showLOI, showAOI).length; + }; + + this.getAvailableWmsDatasets = function(topic, georesourceNameFilter, showWMS){ + if(!showWMS){ + return []; + } + + var wmsDatasets = []; + + var filteredWmsDatasets = this.wmsDatasets; + + if(georesourceNameFilter && georesourceNameFilter != ""){ + filteredWmsDatasets = filterArrayObjectsByValue(filteredWmsDatasets, georesourceNameFilter); + } + + for (const wmsMetadata of filteredWmsDatasets) { + if (this.topicHierarchyContainsWms(topic, wmsMetadata)){ + wmsDatasets.push(wmsMetadata); + } + } + + return wmsDatasets; + }; + + this.getNumberOfAvailableWmsDatasets = function(topic, georesourceNameFilter, showWMS){ + if(!showWMS){ + return 0; + } + + return this.getAvailableWmsDatasets(topic, georesourceNameFilter, showWMS).length; + }; + + this.getAvailableWfsDatasets = function(topic, georesourceNameFilter, showWFS){ + if(!showWFS){ + return []; + } + + var wfsDatasets = []; + + var filteredWfsDatasets = this.wfsDatasets; + + if(georesourceNameFilter && georesourceNameFilter != ""){ + filteredWfsDatasets = filterArrayObjectsByValue(filteredWfsDatasets, georesourceNameFilter); + } + + for (const wfsMetadata of filteredWfsDatasets) { + if (this.topicHierarchyContainsWms(topic, wfsMetadata)){ + wfsDatasets.push(wfsMetadata); + } + } + + return wfsDatasets; + }; + + this.getNumberOfAvailableWfsDatasets = function(topic, georesourceNameFilter, showWFS){ + if(!showWFS){ + return 0; + } + + return this.getAvailableWfsDatasets(topic, georesourceNameFilter, showWFS).length; + }; + + this.getNumberOfIndicators = function(topic, indicatorNameFilter){ + var numberOfIndicators = 0; + + var filteredIndicators = this.availableIndicators; + + if(indicatorNameFilter && indicatorNameFilter != ""){ + filteredIndicators = filterArrayObjectsByValue(this.availableIndicators, indicatorNameFilter); + } + + filteredIndicators = filterByIndicatorNamesToHide(filteredIndicators); + + for (const indicatorMetadata of filteredIndicators) { + if (this.topicHierarchyContainsIndicator(topic, indicatorMetadata)){ + numberOfIndicators++; + } + } + + return numberOfIndicators; + }; + + var filterByIndicatorNamesToHide = function(filteredIndicators){ + + return filteredIndicators.filter(indicatorMetadata => { + return isDisplayableIndicator(indicatorMetadata); + }); + }; + + var filterByGeoresourceNamesToHide = function(filteredGeoresources){ + + return filteredGeoresources.filter(georesourceMetadata => { + return self.isDisplayableGeoresource(georesourceMetadata); + }); + }; + + var filterArrayObjectsByValue = function (array, string) { + return array.filter(o => { + return Object.keys(o).some(k => { + if (typeof o[k] === 'string') + return o[k].toLowerCase().includes(string.toLowerCase()); + }); + }); + }; + + this.getIndicatorMetadataById = function(indicatorId){ + return this.availableIndicators_map.get(indicatorId); + }; + + this.getGeoresourceMetadataById = function(georesourceId){ + return this.availableGeoresources_map.get(georesourceId); + }; + + this.getSpatialUnitMetadataById = function(spatialUnitId){ + return this.availableSpatialUnits_map.get(spatialUnitId); + }; + + this.getIndicatorAbbreviationFromIndicatorId = function(indicatorId){ + for (var indicatorMetadata of this.availableIndicators) { + if (indicatorMetadata.indicatorId === indicatorId){ + return indicatorMetadata.abbreviation; + } + } + }; + + this.getIndicatorNameFromIndicatorId = function(indicatorId){ + for (var indicatorMetadata of this.availableIndicators) { + if (indicatorMetadata.indicatorId === indicatorId){ + return indicatorMetadata.indicatorName; + } + } + }; + + this.getGeoresourceNameFromGeoresourceId = function(georesourceId){ + for (var georesourceMetadata of this.availableGeoresources) { + if (georesourceMetadata.georesourceId === georesourceId){ + return georesourceMetadata.datasetName; + } + } + }; + + this.referencedTopicIdExists = function(topicId){ + var topicHierarchy = this.getTopicHierarchyForTopicId(topicId); + + if(topicHierarchy.length === 0){ + return false; + } + else{ + return true; + } + }; + + this.getTopicHierarchyForTopicId = function(topicReferenceId){ + // create an array respresenting the topic hierarchy + // i.e. [mainTopic_firstTier, subTopic_secondTier, subTopic_thirdTier, ...] + var topicHierarchyArray = []; + + for (var i = 0; i < this.availableTopics.length; i++) { + + var mainTopicCandidate = this.availableTopics[i]; + + if(mainTopicCandidate.topicId === topicReferenceId){ + topicHierarchyArray.push(mainTopicCandidate); + break; + } + + else if(this.findIdInAnySubTopicHierarchy(topicReferenceId, mainTopicCandidate.subTopics)){ + topicHierarchyArray.push(mainTopicCandidate); + topicHierarchyArray = this.addSubTopicHierarchy(topicHierarchyArray, topicReferenceId, mainTopicCandidate.subTopics); + } + } + + return topicHierarchyArray; + }; + + this.findIdInAnySubTopicHierarchy = function(topicReferenceId, subTopicsArray){ + for (let index = 0; index < subTopicsArray.length; index++) { + const subTopicCandidate = subTopicsArray[index]; + + if(subTopicCandidate.topicId === topicReferenceId){ + return true; + } + + else if(this.findIdInAnySubTopicHierarchy(topicReferenceId, subTopicCandidate.subTopics)){ + return true; + } + } + + return false; + }; + + this.addSubTopicHierarchy = function(topicHierarchyArray, topicReferenceId, subTopicsArray){ + for (let index = 0; index < subTopicsArray.length; index++) { + const subTopicCandidate = subTopicsArray[index]; + + if(subTopicCandidate.topicId === topicReferenceId){ + topicHierarchyArray.push(subTopicCandidate); + break; + } + + else if(this.findIdInAnySubTopicHierarchy(topicReferenceId, subTopicCandidate.subTopics)){ + topicHierarchyArray.push(subTopicCandidate); + topicHierarchyArray = this.addSubTopicHierarchy(topicHierarchyArray, topicReferenceId, subTopicCandidate.subTopics); + } + } + + return topicHierarchyArray; + }; + + this.syntaxHighlightJSON = function(json) { + if (typeof json != 'string') { + json = JSON.stringify(json, undefined, 2); + } + json = json.replace(/&/g, '&').replace(//g, '>'); + return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match) { + var cls = 'number'; + if (/^"/.test(match)) { + if (/:$/.test(match)) { + cls = 'key'; + } else { + cls = 'string'; + } + } else if (/true|false/.test(match)) { + cls = 'boolean'; + } else if (/null/.test(match)) { + cls = 'null'; + } + return '' + match + ''; + }); + }; + + + + this.extendKeycloakSession = function () { + // Auth.keycloak.updateToken(5).then(function () { + // console.log("keycloak token refreshed."); + // }).catch(function () { + // console.error('Failed to refresh token. Will redirect to Login screen'); + // Auth.keycloak.login(); + // }); + + Auth.keycloak.login(); + }; + + this.tryLogoutUser = function() { + Auth.keycloak.logout(); + }; + + var startCheckSessionExpiration = function(){ + $interval(function () { + // minutes until current browser session invalidates + // use refresh token as this is used when calling "updateToken" keycloak method. Only if that is invalid the whole session is invalid + self.keycloakTokenExpirationInfo = Math.round((Auth.keycloak.refreshTokenParsed.exp + Auth.keycloak.timeSkew - new Date().getTime() / 1000) / 60); + if(! self.keycloakTokenExpirationInfo){ + self.keycloakTokenExpirationInfo = 30; + } + + // if session is expired then show warning to User! + if (self.keycloakTokenExpirationInfo < 0){ + self.keycloakTokenExpirationInfo = 0; + self.displayMapApplicationError("Ihre aktuelle Login-Session ist abgelaufen. Sie müssen sich neu einloggen. Nutzen Sie dazu das User-Menü oben rechts."); + } + + }, 1000 * 60); + }; + + /* + * FETCH INITIAL METADATA ABOUT EACH RESOURCE + */ + + // $rootScope.$on("$locationChangeStart", function(event){ + // self.fetchAllMetadata(); + // self.adminIsLoggedIn = false; + // }); + + this.fetchAllMetadata = async function(){ + console.log("fetching all metadata from management component"); + + // var metadataPromises = [topicsPromise, usersPromise, rolesPromise, spatialUnitsPromise, georesourcesPromise, indicatorsPromise, scriptsPromise]; + var metadataPromises = []; + + if (Auth.keycloak.authenticated){ + await Auth.keycloak.loadUserProfile() + .then(function (profile) { + // set user profile + self.currentKeycloakUser = profile; + console.log("User logged in with email: " + profile.email); + + if(Auth.keycloak.tokenParsed && Auth.keycloak.tokenParsed.realm_access && Auth.keycloak.tokenParsed.realm_access.roles){ + self.currentKeycloakLoginRoles = Auth.keycloak.tokenParsed.realm_access.roles; + if (Auth.keycloak.tokenParsed.resource_access["realm-management"]) { + self.isRealmAdmin = true; + self.currentKeycloakLoginRoles = self.currentKeycloakLoginRoles.concat(Auth.keycloak.tokenParsed.resource_access["realm-management"].roles); + } + } else { + self.currentKeycloakLoginRoles = []; + } + + // set token expiration + startCheckSessionExpiration(); + }) + .catch(function () { + console.log('Failed to load user profile'); + }); + var promise = await this.fetchAccessControlMetadata(self.currentKeycloakLoginRoles); + metadataPromises.push(promise); + } + + //TODO revise metadata fecthing for protected endpoints + var scriptsPromise = await this.fetchIndicatorScriptsMetadata(self.currentKeycloakLoginRoles); + var topicsPromise = await this.fetchTopicsMetadata(self.currentKeycloakLoginRoles); + var spatialUnitsPromise = await this.fetchSpatialUnitsMetadata(self.currentKeycloakLoginRoles); + var georesourcesPromise = await this.fetchGeoresourcesMetadata(self.currentKeycloakLoginRoles); + var indicatorsPromise = await this.fetchIndicatorsMetadata(self.currentKeycloakLoginRoles); + metadataPromises.push(scriptsPromise); + metadataPromises.push(topicsPromise); + metadataPromises.push(spatialUnitsPromise); + metadataPromises.push(georesourcesPromise); + metadataPromises.push(indicatorsPromise); + + $q.all(metadataPromises).then(function successCallback(successArray) { + + self.modifyIndicatorApplicableSpatialUnitsForLoginRoles(); + + self.buildHeadlineIndicatorHierarchy(); + self.buildTopicIndicatorHierarchy(); + self.topicIndicatorHierarchy_forOrderView = JSON.parse(JSON.stringify(self.topicIndicatorHierarchy)); + self.buildComputationIndicatorHierarchy(); + + self.buildTopicGeoresourceHierarchy(); + + console.log("Metadata fetched. Call initialize event."); + onMetadataLoadingCompleted(); + + $timeout(function(){ + $('.list-group-item > .collapseTrigger').on('click', function() { + $('.glyphicon', this) + .toggleClass('glyphicon-chevron-right') + .toggleClass('glyphicon-chevron-down'); + + }); + }); + }, function errorCallback(errorArray) { + // todo error handling + self.displayMapApplicationError("Beim Laden der erforderlichen Anwendungsdaten ist ein Fehler aufgetreten. Bitte wenden Sie sich an Ihren Administrator."); + $rootScope.$broadcast("initialMetadataLoadingFailed", errorArray); + }); + + }; + + this.modifyIndicatorApplicableSpatialUnitsForLoginRoles = function(){ + var availableSpatialUnitNames = []; + for (const spatialUnit of this.availableSpatialUnits) { + availableSpatialUnitNames.push(spatialUnit.spatialUnitLevel); + } + for (const indicator of this.availableIndicators) { + indicator.applicableSpatialUnits = indicator.applicableSpatialUnits.filter(applicableSpatialUnit => availableSpatialUnitNames.includes(applicableSpatialUnit.spatialUnitName)); + } + + this.displayableIndicators = this.availableIndicators.filter(item => isDisplayableIndicator(item)); + this.displayableIndicators_keywordFiltered = JSON.parse(JSON.stringify(this.displayableIndicators)); + }; + + this.buildTopicsMap_indicators = function(indicatorTopics){ + var topicsMap = new Map(); + + for (const topic of indicatorTopics) { + topicsMap.set(topic.topicId, []); + if(topic.subTopics.length > 0){ + topicsMap = this.addSubTopicsToMap_indicators(topic.subTopics, topicsMap); + } + } + + return topicsMap; + }; + + this.buildTopicsMap_georesources = function(georesourceTopics){ + var topicsMap = new Map(); + + for (const topic of georesourceTopics) { + topicsMap.set(topic.topicId, { + poiDatasets: [], + loiDatasets: [], + aoiDatasets: [], + wmsDatasets: [], + wfsDatasets: [] + }); + if(topic.subTopics.length > 0){ + topicsMap = this.addSubTopicsToMap_georesources(topic.subTopics, topicsMap); + } + } + + topicsMap.set(this.georesourceMapKey_forUnmappedTopicReferences, { + poiDatasets: [], + loiDatasets: [], + aoiDatasets: [], + wmsDatasets: [], + wfsDatasets: [] + }); + + return topicsMap; + }; + + this.addSubTopicsToMap_indicators = function(subTopicsArray, topicsMap){ + + for (const subTopic of subTopicsArray) { + topicsMap.set(subTopic.topicId, []); + if(subTopic.subTopics.length > 0){ + topicsMap = this.addSubTopicsToMap_indicators(subTopic.subTopics, topicsMap); + } + } + + return topicsMap; + }; + + this.addSubTopicsToMap_georesources = function(subTopicsArray, topicsMap){ + + for (const subTopic of subTopicsArray) { + topicsMap.set(subTopic.topicId, { + poiDatasets: [], + loiDatasets: [], + aoiDatasets: [], + wmsDatasets: [], + wfsDatasets: [] + }); + if(subTopic.subTopics.length > 0){ + topicsMap = this.addSubTopicsToMap_georesources(subTopic.subTopics, topicsMap); + } + } + + return topicsMap; + }; + + this.buildTopicGeoresourceHierarchy = function(){ + + var georesourceTopics = JSON.parse(JSON.stringify(this.availableTopics)).filter(topic => topic.topicResource === "georesource"); + /* + topicsMap.set(topic.topicId, { + poiDatasets: [], + loiDatasets: [], + aoiDatasets: [], + wmsDatasets: [], + wfsDatasets: [] + }) + + + special entry with key "unmapped" for all datasets without valid topic reference + */ + var topicsMap = this.buildTopicsMap_georesources(georesourceTopics); + + + // PROCESS GEORESOURCES + var filteredGeoresources = this.displayableGeoresources_keywordFiltered; + + for (const georesourceMetadata of filteredGeoresources) { + if (topicsMap.has(georesourceMetadata.topicReference)){ + var georesourceDatasets = topicsMap.get(georesourceMetadata.topicReference); + + if(georesourceMetadata.isPOI){ + georesourceDatasets.poiDatasets.push(georesourceMetadata); + } + if(georesourceMetadata.isLOI){ + georesourceDatasets.loiDatasets.push(georesourceMetadata); + } + if(georesourceMetadata.isAOI){ + georesourceDatasets.aoiDatasets.push(georesourceMetadata); + } + + topicsMap.set(georesourceMetadata.topicReference, georesourceDatasets); + } + else{ + var georesourceDatasets_unmapped = topicsMap.get(this.georesourceMapKey_forUnmappedTopicReferences); + + if(georesourceMetadata.isPOI){ + georesourceDatasets_unmapped.poiDatasets.push(georesourceMetadata); + } + if(georesourceMetadata.isLOI){ + georesourceDatasets_unmapped.loiDatasets.push(georesourceMetadata); + } + if(georesourceMetadata.isAOI){ + georesourceDatasets_unmapped.aoiDatasets.push(georesourceMetadata); + } + + topicsMap.set(this.georesourceMapKey_forUnmappedTopicReferences, georesourceDatasets_unmapped); + } + } + + // PROCESS WMS and WFS + for (const wmsMetadata of this.wmsDatasets_keywordFiltered) { + if (topicsMap.has(wmsMetadata.topicReference)){ + var georesourceDatasets = topicsMap.get(wmsMetadata.topicReference); + georesourceDatasets.wmsDatasets.push(wmsMetadata); + + topicsMap.set(wmsMetadata.topicReference, georesourceDatasets); + } + else{ + var georesourceDatasets_unmapped = topicsMap.get(this.georesourceMapKey_forUnmappedTopicReferences); + + georesourceDatasets_unmapped.wmsDatasets.push(wmsMetadata); + + topicsMap.set(this.georesourceMapKey_forUnmappedTopicReferences, georesourceDatasets_unmapped); + } + } + + // PROCESS WMS and WFS + for (const wfsMetadata of this.wfsDatasets_keywordFiltered) { + if (topicsMap.has(wfsMetadata.topicReference)){ + var georesourceDatasets = topicsMap.get(wfsMetadata.topicReference); + georesourceDatasets.wfsDatasets.push(wfsMetadata); + + topicsMap.set(wfsMetadata.topicReference, georesourceDatasets); + } + else{ + var georesourceDatasets_unmapped = topicsMap.get(this.georesourceMapKey_forUnmappedTopicReferences); + + georesourceDatasets_unmapped.wfsDatasets.push(wfsMetadata); + + topicsMap.set(this.georesourceMapKey_forUnmappedTopicReferences, georesourceDatasets_unmapped); + } + } + + this.topicGeoresourceHierarchy = this.addGeoresourceDataToTopicHierarchy(georesourceTopics, topicsMap); + }; + + this.buildTopicIndicatorHierarchy = function(){ + + var indicatorTopics = JSON.parse(JSON.stringify(this.availableTopics)).filter(topic => topic.topicResource === "indicator"); + var topicsMap = this.buildTopicsMap_indicators(indicatorTopics); + + var filteredIndicators = this.displayableIndicators_keywordFiltered; + + for (const indicatorMetadata of filteredIndicators) { + if (topicsMap.has(indicatorMetadata.topicReference)){ + var indicatorArray = topicsMap.get(indicatorMetadata.topicReference); + indicatorArray.push(indicatorMetadata); + topicsMap.set(indicatorMetadata.topicReference, indicatorArray); + } + } + + this.topicIndicatorHierarchy = this.addIndicatorDataToTopicHierarchy(indicatorTopics, topicsMap); + }; + + this.addIndicatorDataToTopicHierarchy = function(topicsArray, topicsMap){ + for (var topic of topicsArray) { + topic.indicatorData = topicsMap.get(topic.topicId); + topic.indicatorData.sort((a,b) => (a.displayOrder > b.displayOrder) ? 1 : ((b.displayOrder > a.displayOrder) ? -1 : 0)); + topic.indicatorCount = topic.indicatorData.length; + if(topic.subTopics.length > 0){ + topic = this.addIndicatorDataToSubTopics(topic, topicsMap); + } + } + + return topicsArray; + }; + + this.addIndicatorDataToSubTopics = function(topic, topicsMap){ + for (var subTopic of topic.subTopics) { + subTopic.indicatorData = topicsMap.get(subTopic.topicId); + subTopic.indicatorData.sort((a,b) => (a.displayOrder > b.displayOrder) ? 1 : ((b.displayOrder > a.displayOrder) ? -1 : 0)); + subTopic.indicatorCount = subTopic.indicatorData.length; + if(subTopic.subTopics.length > 0){ + subTopic = this.addIndicatorDataToSubTopics(subTopic, topicsMap); + } + topic.indicatorCount = topic.indicatorCount + subTopic.indicatorCount; + } + + return topic; + }; + + this.addGeoresourceDataToTopicHierarchy = function(topicsArray, topicsMap){ + + /* + topicsMap.set(topic.topicId, { + poiDatasets: [], + loiDatasets: [], + aoiDatasets: [], + wmsDatasets: [], + wfsDatasets: [] + }) + + + special entry with key "unmapped" for all datasets without valid topic reference + */ + + for (var topic of topicsArray) { + var topicsDataEntry = topicsMap.get(topic.topicId); + topic.poiData = topicsDataEntry.poiDatasets; + topic.poiCount = topicsDataEntry.poiDatasets.length; + + topic.loiData = topicsDataEntry.loiDatasets; + topic.loiCount = topicsDataEntry.loiDatasets.length; + + topic.aoiData = topicsDataEntry.aoiDatasets; + topic.aoiCount = topicsDataEntry.aoiDatasets.length; + + topic.wmsData = topicsDataEntry.wmsDatasets; + topic.wmsCount = topicsDataEntry.wmsDatasets.length; + + topic.wfsData = topicsDataEntry.wfsDatasets; + topic.wfsCount = topicsDataEntry.wfsDatasets.length; + + topic.totalCount = topic.poiCount + topic.loiCount + topic.aoiCount + topic.wmsCount + topic.wfsCount; + topic.ownCount = topic.poiCount + topic.loiCount + topic.aoiCount + topic.wmsCount + topic.wfsCount; + + if(topic.subTopics.length > 0){ + topic = this.addGeoresourceDataToSubTopics(topic, topicsMap); + } + } + + // PROCESS UNMAPPED entries + this.topicGeoresourceHierarchy_unmappedEntries = {}; + var topicsDataEntry_unmapped = topicsMap.get(this.georesourceMapKey_forUnmappedTopicReferences); + this.topicGeoresourceHierarchy_unmappedEntries.poiData = topicsDataEntry_unmapped.poiDatasets; + this.topicGeoresourceHierarchy_unmappedEntries.poiCount = topicsDataEntry_unmapped.poiDatasets.length; + + this.topicGeoresourceHierarchy_unmappedEntries.loiData = topicsDataEntry_unmapped.loiDatasets; + this.topicGeoresourceHierarchy_unmappedEntries.loiCount = topicsDataEntry_unmapped.loiDatasets.length; + + this.topicGeoresourceHierarchy_unmappedEntries.aoiData = topicsDataEntry_unmapped.aoiDatasets; + this.topicGeoresourceHierarchy_unmappedEntries.aoiCount = topicsDataEntry_unmapped.aoiDatasets.length; + + this.topicGeoresourceHierarchy_unmappedEntries.wmsData = topicsDataEntry_unmapped.wmsDatasets; + this.topicGeoresourceHierarchy_unmappedEntries.wmsCount = topicsDataEntry_unmapped.wmsDatasets.length; + + this.topicGeoresourceHierarchy_unmappedEntries.wfsData = topicsDataEntry_unmapped.wfsDatasets; + this.topicGeoresourceHierarchy_unmappedEntries.wfsCount = topicsDataEntry_unmapped.wfsDatasets.length; + + this.topicGeoresourceHierarchy_unmappedEntries.totalCount = this.topicGeoresourceHierarchy_unmappedEntries.poiCount + + this.topicGeoresourceHierarchy_unmappedEntries.loiCount + + this.topicGeoresourceHierarchy_unmappedEntries.aoiCount + + this.topicGeoresourceHierarchy_unmappedEntries.wmsCount + + this.topicGeoresourceHierarchy_unmappedEntries.wfsCount; + + return topicsArray; + }; + + this.addGeoresourceDataToSubTopics = function(topic, topicsMap){ + for (var subTopic of topic.subTopics) { + + var topicsDataEntry = topicsMap.get(subTopic.topicId); + subTopic.poiData = topicsDataEntry.poiDatasets; + subTopic.poiCount = topicsDataEntry.poiDatasets.length; + + subTopic.loiData = topicsDataEntry.loiDatasets; + subTopic.loiCount = topicsDataEntry.loiDatasets.length; + + subTopic.aoiData = topicsDataEntry.aoiDatasets; + subTopic.aoiCount = topicsDataEntry.aoiDatasets.length; + + subTopic.wmsData = topicsDataEntry.wmsDatasets; + subTopic.wmsCount = topicsDataEntry.wmsDatasets.length; + + subTopic.wfsData = topicsDataEntry.wfsDatasets; + subTopic.wfsCount = topicsDataEntry.wfsDatasets.length; + + subTopic.totalCount = subTopic.poiCount + subTopic.loiCount + subTopic.aoiCount + subTopic.wmsCount + subTopic.wfsCount; + subTopic.ownCount = subTopic.poiCount + subTopic.loiCount + subTopic.aoiCount + subTopic.wmsCount + subTopic.wfsCount; + + if(subTopic.subTopics.length > 0){ + subTopic = this.addGeoresourceDataToSubTopics(subTopic, topicsMap); + } + topic.poiCount = topic.poiCount + subTopic.poiCount; + topic.loiCount = topic.loiCount + subTopic.loiCount; + topic.aoiCount = topic.aoiCount + subTopic.aoiCount; + topic.wmsCount = topic.wmsCount + subTopic.wmsCount; + topic.wfsCount = topic.wfsCount + subTopic.wfsCount; + topic.totalCount = topic.totalCount + subTopic.totalCount; + } + + return topic; + }; + + this.onChangeIndicatorKeywordFilter = function(indicatorNameFilter){ + this.displayableIndicators_keywordFiltered = JSON.parse(JSON.stringify(this.displayableIndicators)); + + if(indicatorNameFilter && indicatorNameFilter != ""){ + this.displayableIndicators_keywordFiltered = filterArrayObjectsByValue(this.displayableIndicators_keywordFiltered, indicatorNameFilter); + } + + this.buildTopicIndicatorHierarchy(); + this.buildHeadlineIndicatorHierarchy(); + this.buildComputationIndicatorHierarchy(); + }; + + this.onChangeGeoresourceKeywordFilter = function(georesourceNameFilter, showPOI, showLOI, showAOI, showWMS, showWFS){ + this.wmsDatasets_keywordFiltered = JSON.parse(JSON.stringify(this.wmsDatasets)); + this.wfsDatasets_keywordFiltered = JSON.parse(JSON.stringify(this.wfsDatasets)); + + this.displayableGeoresources_keywordFiltered = JSON.parse(JSON.stringify(this.displayableGeoresources)); + + if(georesourceNameFilter && georesourceNameFilter != ""){ + this.displayableGeoresources_keywordFiltered = filterArrayObjectsByValue(this.displayableGeoresources_keywordFiltered, georesourceNameFilter); + + this.wmsDatasets_keywordFiltered = filterArrayObjectsByValue(this.wmsDatasets_keywordFiltered, georesourceNameFilter); + this.wfsDatasets_keywordFiltered = filterArrayObjectsByValue(this.wfsDatasets_keywordFiltered, georesourceNameFilter); + } + + this.displayableGeoresources_keywordFiltered_forAlphabeticalDisplay = { + poiData: this.displayableGeoresources_keywordFiltered.filter(item => item.isPOI), + loiData: this.displayableGeoresources_keywordFiltered.filter(item => item.isLOI), + aoiData: this.displayableGeoresources_keywordFiltered.filter(item => item.isAOI), + wmsData: this.wmsDatasets_keywordFiltered, + wfsData: this.wfsDatasets_keywordFiltered + }; + + if(!showWMS){ + this.wmsDatasets_keywordFiltered = []; + } + if(!showWFS){ + this.wfsDatasets_keywordFiltered = []; + } + + if(! (showPOI && showLOI && showAOI)){ + this.displayableGeoresources_keywordFiltered = this.displayableGeoresources_keywordFiltered.filter(item => { + if (! showPOI && item.isPOI){ + return false; + } + if (! showLOI && item.isLOI){ + return false; + } + + if (! showAOI && item.isAOI){ + return false; + } + + return true; + }); + } + + this.buildTopicGeoresourceHierarchy(); + }; + + this.buildHeadlineIndicatorHierarchy = function(){ + + var indicatorsMap = new Map(); + + var filteredIndicators = this.displayableIndicators_keywordFiltered; + + for (const indicatorMetadata of filteredIndicators) { + indicatorsMap.set(indicatorMetadata.indicatorId, indicatorMetadata); + } + + var headlineIndicatorsArray = filteredIndicators.filter(indicatorMetadata => indicatorMetadata.isHeadlineIndicator == true); + + var headlineIndicatorsIdArray = headlineIndicatorsArray.map(indicatorMetadata => indicatorMetadata.indicatorId); + + var headlineIndicatorsMap = new Map(); + + for (const indicatorMetadata of headlineIndicatorsArray) { + headlineIndicatorsMap.set(indicatorMetadata.indicatorId, indicatorMetadata); + } + + var headlineIndicatorScriptsMap = new Map(); + for (const scriptMetadata of this.availableProcessScripts) { + if(headlineIndicatorsIdArray.includes(scriptMetadata.indicatorId)){ + headlineIndicatorScriptsMap.set(scriptMetadata.indicatorId, scriptMetadata); + } + } + + this.headlineIndicatorHierarchy = []; + + // var item = { + // headlineIndicator: {metadata} + // baseIndicators: [{metadata}] + // maybeSomeAnalysisItems? + // } + + for (const headlineIndicatorMetadata of headlineIndicatorsArray) { + var item = {}; + item.headlineIndicator = headlineIndicatorMetadata; + item.baseIndicators = []; + + if(headlineIndicatorScriptsMap.has(headlineIndicatorMetadata.indicatorId)){ + var targetScriptMetadata = headlineIndicatorScriptsMap.get(headlineIndicatorMetadata.indicatorId); + for (const requiredIndicatorId of targetScriptMetadata.requiredIndicatorIds) { + if (indicatorsMap.has(requiredIndicatorId)){ + item.baseIndicators.push(indicatorsMap.get(requiredIndicatorId)); + } + } + } + + this.headlineIndicatorHierarchy.push(item); + } + + }; + + this.buildComputationIndicatorHierarchy = function(){ + + var indicatorsMap = new Map(); + + var filteredIndicators = this.displayableIndicators_keywordFiltered; + + for (const indicatorMetadata of filteredIndicators) { + indicatorsMap.set(indicatorMetadata.indicatorId, indicatorMetadata); + } + + var computationIndicatorsArray = filteredIndicators.filter(indicatorMetadata => indicatorMetadata.creationType == "COMPUTATION"); + + var computationIndicatorsIdArray = computationIndicatorsArray.map(indicatorMetadata => indicatorMetadata.indicatorId); + + var computationIndicatorsMap = new Map(); + + for (const indicatorMetadata of computationIndicatorsArray) { + computationIndicatorsMap.set(indicatorMetadata.indicatorId, indicatorMetadata); + } + + var computationIndicatorScriptsMap = new Map(); + for (const scriptMetadata of this.availableProcessScripts) { + if(computationIndicatorsIdArray.includes(scriptMetadata.indicatorId)){ + computationIndicatorScriptsMap.set(scriptMetadata.indicatorId, scriptMetadata); + } + } + + this.computationIndicatorHierarchy = []; + + // var item = { + // computationIndicator: {metadata} + // baseIndicators: [{metadata}] + // maybeSomeAnalysisItems? + // } + + for (const computationIndicatorMetadata of computationIndicatorsArray) { + var item = {}; + item.computationIndicator = computationIndicatorMetadata; + item.baseIndicators = []; + + if(computationIndicatorScriptsMap.has(computationIndicatorMetadata.indicatorId)){ + var targetScriptMetadata = computationIndicatorScriptsMap.get(computationIndicatorMetadata.indicatorId); + for (const requiredIndicatorId of targetScriptMetadata.requiredIndicatorIds) { + if (indicatorsMap.has(requiredIndicatorId)){ + item.baseIndicators.push(indicatorsMap.get(requiredIndicatorId)); + } + } + } + + this.computationIndicatorHierarchy.push(item); + } + + }; + + this.filterCurrentlySelectedIndicator = function(){ + return function( item ) { + + if (item.indicatorMetadata.indicatorId === self.selectedIndicator.indicatorId){ + return true; + } + return false; + + }; + }; + + this.filterBaseIndicatorsOfCurrentHeadlineIndicator = function(){ + return function( item ) { + + var headlineIndicatorEntry = self.headlineIndicatorHierarchy.filter(element => element.headlineIndicator.indicatorId == self.selectedIndicator.indicatorId)[0]; + + if(headlineIndicatorEntry){ + var baseIndicators_filtered = headlineIndicatorEntry.baseIndicators.filter(element => element.indicatorId == item.indicatorMetadata.indicatorId); + if (baseIndicators_filtered.length > 0){ + return true; + } + } + + return false; + + }; + }; + + this.filterBaseIndicatorsOfCurrentComputationIndicator = function(){ + return function( item ) { + + var computationIndicatorEntry = self.computationIndicatorHierarchy.filter(element => element.computationIndicator.indicatorId == self.selectedIndicator.indicatorId)[0]; + + if(computationIndicatorEntry){ + var baseIndicators_filtered = computationIndicatorEntry.baseIndicators.filter(element => element.indicatorId == item.indicatorMetadata.indicatorId); + if (baseIndicators_filtered.length > 0){ + return true; + } + } + + return false; + + }; + }; + + var onMetadataLoadingCompleted = function(){ + + $timeout(function () { + $rootScope.$broadcast("initialMetadataLoadingCompleted"); + + $timeout(function () { + $("option").each(function (index, element) { + var text = $(element).text(); + $(element).attr("title", text); + }); + }, 1000); + }, 1000); + // setTimeout(() => { + // // $rootScope.$broadcast("initialMetadataLoadingCompleted"); + // }, 1000); + }; + + this.setAccessControl = function(input){ + this.accessControl = input; + this.accessControl_map = new Map(); + for (const entry of input) { + this.accessControl_map.set(entry.organizationalUnitId, entry); + } + this.updateAvailableRoles(); + }; + + this.fetchAccessControlMetadata = async function(keycloakRolesArray){ + self.setAccessControl(await kommonitorCacheHelperService.fetchAccessControlMetadata(keycloakRolesArray)); + self.setCurrentKomMonitorLoginRoleNames(); + self.setCurrentKomMonitorLoginRoleIds(); + }; + + this.replaceSingleAccessControlMetadata = function(targetRoleMetadata){ + for (let index = 0; index < this.accessControl.length; index++) { + let oldMetadata = this.accessControl[index]; + if(oldMetadata.organizationalUnitId == targetRoleMetadata.organizationalUnitId){ + this.accessControl[index] = targetRoleMetadata; + break; + } + } + this.accessControl_map.set(targetRoleMetadata.organizationalUnitId, targetRoleMetadata); + this.updateAvailableRoles(); + }; + + this.addSingleAccessControlMetadata = function(metadata){ + let tmpArray = [metadata]; + Array.prototype.push.apply(tmpArray, this.accessControl); + this.accessControl = tmpArray; + this.accessControl_map.set(metadata.organizationalUnitId, metadata); + this.updateAvailableRoles(); + }; + + this.deleteSingleAccessControlMetadata = function(id){ + for (let index = 0; index < this.accessControl.length; index++) { + const oldMetadata = this.accessControl[index]; + if(oldMetadata.organizationalUnitId == id){ + this.accessControl.splice(index, 1); + break; + } + } + this.accessControl_map.delete(id); + this.updateAvailableRoles(); + }; + + this.updateAvailableRoles = function() { + this.availableRoles = []; + for (let elem of this.accessControl) { + for (let role of elem.roles) { + let available = {...role, ...{"organizationalUnit": elem, "roleName": elem.name + "-" + role.permissionLevel}}; + this.availableRoles.push(available); + } + } + // we need to refresh all modals as roles have changed + $rootScope.$broadcast("availableRolesUpdate"); + } + + this.getAccessControlById = function(id){ + return this.accessControl_map.get(id); + }; + + this.fetchTopicsMetadata = async function(keycloakRolesArray){ + self.setTopics(await kommonitorCacheHelperService.fetchTopicsMetadata(keycloakRolesArray)); + }; + + this.fetchSpatialUnitsMetadata = async function(keycloakRolesArray){ + self.setSpatialUnits(await kommonitorCacheHelperService.fetchSpatialUnitsMetadata(keycloakRolesArray)); + }; + + this.fetchGeoresourcesMetadata = async function(keycloakRolesArray){ + self.setGeoresources(await kommonitorCacheHelperService.fetchGeoresourceMetadata(keycloakRolesArray)); + }; + + this.fetchIndicatorsMetadata = async function(keycloakRolesArray){ + self.setIndicators(await kommonitorCacheHelperService.fetchIndicatorsMetadata(keycloakRolesArray)); + }; + + this.fetchIndicatorScriptsMetadata = async function(keycloakRolesArray){ + self.setProcessScripts(await kommonitorCacheHelperService.fetchProcessScriptsMetadata(keycloakRolesArray)); + }; + + this.indicatorValueIsNoData = function(indicatorValue){ + if(Number.isNaN(indicatorValue) || indicatorValue === null || indicatorValue === undefined){ + return true; + } + return false; + }; + + this.getIndicatorValueFromArray_asNumber = function(propertiesArray, targetDateString){ + if(!targetDateString.includes(DATE_PREFIX)){ + targetDateString = DATE_PREFIX + targetDateString; + } + var indicatorValue = propertiesArray[targetDateString]; + var value; + if(this.indicatorValueIsNoData(indicatorValue)){ + value = "NoData"; + } + else{ + value = this.getIndicatorValue_asNumber(indicatorValue); + } + + return value; + }; + + this.getIndicatorValueFromArray_asFormattedText = function(propertiesArray, targetDateString){ + if(!targetDateString.includes(DATE_PREFIX)){ + targetDateString = DATE_PREFIX + targetDateString; + } + var indicatorValue = propertiesArray[targetDateString]; + var value; + if(this.indicatorValueIsNoData(indicatorValue)){ + value = "NoData"; + } + else{ + value = this.getIndicatorValue_asFormattedText(indicatorValue); + } + + return value; + }; + + this.getIndicatorValue_asNumber = function(indicatorValue){ + var value; + if(this.indicatorValueIsNoData(indicatorValue)){ + value = "NoData"; + } + else{ + value = +Number(indicatorValue).toFixed(numberOfDecimals); + } + + // if the original value is greater than zero but would be rounded as 0 then we must return the original result + if(Number(value) == 0 && indicatorValue > 0){ + value = Number(indicatorValue); + } + + return value; + }; + + this.getIndicatorValue_asFormattedText = function(indicatorValue){ + var value; + if(this.indicatorValueIsNoData(indicatorValue)){ + value = "NoData"; + } + else{ + value = Number(indicatorValue).toLocaleString('de-DE', {maximumFractionDigits: numberOfDecimals}); + } + + // if the original value is greater than zero but would be rounded as 0 then we must return the original result + if(Number(value) == 0 && indicatorValue > 0){ + value = Number(indicatorValue).toLocaleString('de-DE'); + } + + return value; + }; + + this.getTopicHierarchyDisplayString = function(topicReferenceId){ + var topicHierarchyArray = this.getTopicHierarchyForTopicId(topicReferenceId); + + var topicsString = ""; + for (let index = 0; index < topicHierarchyArray.length; index++) { + if (index === 0) { + // mainTopic --> first tier + topicsString += topicHierarchyArray[index].topicName; + } + else { + var numberOfWhitespaces = 2 * index; + var whitespaceString = ""; + for (let k = 0; k < numberOfWhitespaces; k++) { + whitespaceString += " "; + } + topicsString += whitespaceString + topicHierarchyArray[index].topicName; + } + + if (index < topicHierarchyArray.length) { + topicsString += "
        "; + } + + } + + return topicsString; + }; + + this.getIndicatorStringFromIndicatorType = function (indicatorType) { + var indicatorTypeString; + + for (const indicatorTypeOption of this.indicatorTypeOptions) { + if (indicatorType.includes(indicatorTypeOption.apiName)) { + indicatorTypeString = indicatorTypeOption.displayName; + break; + } + } + + return indicatorTypeString; + }; + + + this.labelAllFeatures = "alle Features"; + this.labelFilteredFeatures = "gefilterte Features"; + this.labelSelectedFeatures = "selektierte Features"; + this.labelNumberOfFeatures = "Anzahl:" + this.labelSum = "Summe:" + this.labelMean = "arith. Mittel:" + this.labelMin = "Minimalwert:" + this.labelMax = "Maximalwert" + + this.allFeaturesNumberOfFeatures; + this.allFeaturesSum; + this.allFeaturesMean; + this.allFeaturesMin; + this.allFeaturesMax; + this.selectedFeaturesNumberOfFeatures; + this.selectedFeaturesSum; + this.selectedFeaturesMean; + this.selectedFeaturesMin; + this.selectedFeaturesMax; + this.allFeaturesPropertyUnit; + + this.setAllFeaturesProperty = function(indicatorMetadataAndGeoJSON, propertyName){ + let sum = 0; + let count = 0; + let min = Number.MAX_VALUE; + let max = Number.MIN_VALUE; + + for (const feature of indicatorMetadataAndGeoJSON.geoJSON.features) { + if(! this.indicatorValueIsNoData(feature.properties[propertyName])){ + let value = this.getIndicatorValueFromArray_asNumber(feature.properties, propertyName) + sum += value; + if (value < min) min = value; + if (value > max) max = value; + count++; + } + } + + this.allFeaturesPropertyUnit = indicatorMetadataAndGeoJSON.unit; + this.allFeaturesNumberOfFeatures = count; + this.allFeaturesSum = this.getIndicatorValue_asFormattedText(sum); + // no division by zero + if (count > 0) + this.allFeaturesMean = this.getIndicatorValue_asFormattedText(sum / count); + else + this.allFeaturesMean = 0; + this.allFeaturesMin = this.getIndicatorValue_asFormattedText(min); + this.allFeaturesMax = this.getIndicatorValue_asFormattedText(max) + }; + + + this.setSelectedFeatureProperty = function(selectedFeaturesMap, propertyName) { + let sum = 0; + let count = 0 + let min = Number.MAX_VALUE; + let max = Number.MIN_VALUE; + + selectedFeaturesMap.forEach(function(feature, key, map) { + if(! thisService.indicatorValueIsNoData(feature.properties[propertyName])){ + let value = thisService.getIndicatorValueFromArray_asNumber(feature.properties, propertyName); + sum += value; + if (value < min) min = value; + if (value > max) max = value; + count++; + } + }); + + if(count === 0) { + // no feature selected, overwrite initial values for min and max + min = 0; + max = 0; + } + + + this.selectedFeaturesNumberOfFeatures = count; + this.selectedFeaturesSum = this.getIndicatorValue_asFormattedText(sum); + // no division by zero + if (count > 0) + this.selectedFeaturesMean = this.getIndicatorValue_asFormattedText(sum / count); + else + this.selectedFeaturesMean = 0; + this.selectedFeaturesMin = this.getIndicatorValue_asFormattedText(min); + this.selectedFeaturesMax = this.getIndicatorValue_asFormattedText(max); + }; + + + var containsNegativeValues = function(geoJSON, propertyName){ + + var containsNegativeValues = false; + for(var i=0; i< geoJSON.features.length; i++){ + if (geoJSON.features[i].properties[propertyName] < 0){ + containsNegativeValues = true; + break; + } + } + + return containsNegativeValues; + }; + + this.formatIndicatorNameForLabel = function(indicatorName, maxCharsPerLine){ + var arr = []; + var space = /\s/; + + const words = indicatorName.split(space); + // push first word into new array + if (words[0].length) { + arr.push(words[0]); + } + + for (let i = 1; i < words.length; i++) { + if (words[i].length + arr[arr.length - 1].length < maxCharsPerLine) { + arr[arr.length - 1] = `${arr[arr.length - 1]} ${words[i + ]}`; + } + else { + arr.push(words[i]); + } + } + return arr.join("\n"); + }; + + this.filterIndicators = function (){ + return function( item ) { + + return isDisplayableIndicator(item); + }; + }; + + this.filterGeoresources = function (){ + return function( item ) { + + return self.isDisplayableGeoresource(item); + }; + }; + + this.isDisplayableGeoresource = function(item){ + var arrayOfNameSubstringsForHidingGeoresources = __env.arrayOfNameSubstringsForHidingGeoresources; + + if(item.availablePeriodsOfValidity == undefined || item.availablePeriodsOfValidity.length === 0) + return false; + + var isGeoresourceThatShallNotBeDisplayed = arrayOfNameSubstringsForHidingGeoresources.some(substring => String(item.datasetName).includes(substring)); + + if(isGeoresourceThatShallNotBeDisplayed){ + return false; + } + return true; + }; + + this.selectedSpatialUnitIsRaster = function(){ + var spatialUnitName = this.selectedSpatialUnit ? this.selectedSpatialUnit.spatialUnitLevel : ""; + + return (spatialUnitName.includes("raster") || spatialUnitName.includes("Raster") || spatialUnitName.includes("RASTER") || spatialUnitName.includes("grid") || spatialUnitName.includes("GRID") || spatialUnitName.includes("Grid")); + }; + + // var roleMappingAllowsDisplay = function(indicatorMetadata){ + // //admin --> everything allowed + // if(self.currentKeycloakLoginRoles.includes(__env.keycloakKomMonitorAdminRoleName)){ + // return true; + // } + + // // public user + + + // // non-admin + // self.roleMetadataForCurrentKeycloakLoginRoles = self.availableRoles.filter(role => self.currentKeycloakLoginRoles.includes(role.roleName)); + + // var filteredApplicableUnits = indicatorMetadata.applicableSpatialUnits.filter(function (applicableSpatialUnit) { + // return applicableSpatialUnit.allowedRoles.length == 0 || applicableSpatialUnit.allowedRoles.some(allowedRoleId => self.roleMetadataForCurrentKeycloakLoginRoles.some(roleMetadata => roleMetadata.roleId === allowedRoleId) ); + // }); + + // return filteredApplicableUnits.length > 0; + // }; + + var isDisplayableIndicator = function(item){ + // var arrayOfNameSubstringsForHidingIndicators = ["Standardabweichung", "Prozentuale Ver"]; + var arrayOfNameSubstringsForHidingIndicators = __env.arrayOfNameSubstringsForHidingIndicators; + + // this is an item from i.e. indicatorRadar, that has a different structure + if(item.indicatorMetadata){ + if(item.indicatorMetadata.applicableDates == undefined || item.indicatorMetadata.applicableDates.length === 0) + return false; + + if(item.indicatorMetadata.applicableSpatialUnits == undefined || item.indicatorMetadata.applicableSpatialUnits.length === 0) + return false; + + var isIndicatorThatShallNotBeDisplayed = arrayOfNameSubstringsForHidingIndicators.some(substring => String(item.indicatorMetadata.indicatorName).includes(substring)); + + if(isIndicatorThatShallNotBeDisplayed){ + return false; + } + + // if(! roleMappingAllowsDisplay(item.indicatorMetadata)){ + // return false; + // } + + return true; + } + else{ + // + if(item.applicableDates == undefined || item.applicableDates.length === 0) + return false; + + if(item.applicableSpatialUnits == undefined || item.applicableSpatialUnits.length === 0) + return false; + + // var isIndicatorThatShallNotBeDisplayed = item.indicatorName.includes("Standardabweichung") || item.indicatorName.includes("Prozentuale Ver"); + var isIndicatorThatShallNotBeDisplayed = arrayOfNameSubstringsForHidingIndicators.some(substring => String(item.indicatorName).includes(substring)); + + if(isIndicatorThatShallNotBeDisplayed){ + return false; + } + + // if(! roleMappingAllowsDisplay(item)){ + // return false; + // } + + return true; + } + }; + + this.filterGeoresourcesByPoi = function(){ + return function( item ) { + + try{ + if(item.isPOI){ + return true; + } + return false; + } + catch(error){ + return false; + } + }; + }; + + this.filterPois = function(){ + return function( item ) { + + try{ + // if(item.datasetName.includes("Lebensmittel")){ + // return false; + // } + return true; + } + catch(error){ + return true; + } + }; + }; + + function getImageDimensions(file) { + return new Promise (function (resolved, rejected) { + var i = new Image(); + i.onload = function(){ + resolved({w: i.width, h: i.height}) + }; + i.src = file; + }); + } + + /** + * creates and returns a pdf for the indicator given as parameter + */ + this.createMetadataPDF_indicator = async function(indicator) { + + var jspdf = new jsPDF(); + jspdf.setFontSize(16); + // jspdf.text("Metadatenblatt", 70, 6); + + //insert logo + var img = new Image(); + var subPath = location.pathname; + img.src = subPath + 'logos/KM_Logo1.png'; + jspdf.addImage(img, 'PNG', 193, 5, 12, 12); + + jspdf.setFontSize(16); + jspdf.setFont('Helvetica', 'bolditalic', 'normal'); + var titleArray = jspdf.splitTextToSize("Indikator: " +indicator.indicatorName, 180); + jspdf.text(titleArray, 14, 25); + + if (indicator.characteristicValue && indicator.characteristicValue != "-" && indicator.characteristicValue != "") { + jspdf.setFontSize(14); + jspdf.text(indicator.characteristicValue, 14, 25); + } + + + jspdf.setFontSize(11); + + var initialStartY = 30; + + if (titleArray.length > 1) { + titleArray.forEach(function (item) { + initialStartY += 5; + }); + } + if (indicator.characteristicValue && indicator.characteristicValue != "-" && indicator.characteristicValue != "") { + initialStartY += 5; + } + + var headStyles = { + fontStyle: 'bold', + fontSize: 12, + fillColor: '#337ab7', + // auto or wrap + cellWidth: 'auto' + }; + + var bodyStyles = { + fontStyle: 'normal', + fontSize: 11, + // auto or wrap or number + cellWidth: 'auto' + }; + + // first column with fixed width + var columnStyles = { + 0: { cellWidth: 45, fontStyle: 'bold' }, + 1: { fontStyle: 'normal' } + }; + + var topicsString = ""; + + var topicReferenceId = indicator.topicReference; + + // will be an array representing the topic hierarchy + // i.e. [mainTopic, subTopicFirstTier, subTopicSecondTier, ...] + var topicHierarchyArray = this.getTopicHierarchyForTopicId(topicReferenceId); + + for (let index = 0; index < topicHierarchyArray.length; index++) { + if (index === 0) { + // mainTopic --> first tier + topicsString += topicHierarchyArray[index].topicName; + } + else { + var numberOfWhitespaces = 2 * index; + var whitespaceString = ""; + for (let k = 0; k < numberOfWhitespaces; k++) { + whitespaceString += " "; + } + topicsString += whitespaceString + topicHierarchyArray[index].topicName; + } + + if (index < topicHierarchyArray.length - 1) { + topicsString += "\n"; + } + + } + + var category = "Basisindikator"; + if (indicator.isHeadlineIndicator) { + category = "Leitindikator"; + } + + // Or JavaScript: + jspdf.autoTable({ + head: [['Themenfeld', 'Kategorie', 'Typ', 'Kennzeichen']], + body: [ + [topicsString, category, this.getIndicatorStringFromIndicatorType(indicator.indicatorType), indicator.abbreviation ? indicator.abbreviation : "-"] + // ... + ], + theme: 'grid', + headStyles: headStyles, + bodyStyles: bodyStyles, + startY: initialStartY + }); + + var linkedIndicatorsString = ""; + + for (var [index, linkedIndicator] of indicator.referencedIndicators.entries()) { + linkedIndicatorsString += linkedIndicator.referencedIndicatorName + " - \n " + linkedIndicator.referencedIndicatorDescription; + + if (index < indicator.referencedIndicators.length - 1) { + linkedIndicatorsString += "\n\n"; + } + } + + if (linkedIndicatorsString === "") { + linkedIndicatorsString = "-"; + } + + var linkedGeoresourcesString = ""; + + for (var [k, linkedGeoresource] of indicator.referencedGeoresources.entries()) { + linkedGeoresourcesString += linkedGeoresource.referencedGeoresourceName + " - \n " + linkedGeoresource.referencedGeoresourceDescription; + + if (k < indicator.referencedGeoresources.length - 1) { + linkedGeoresourcesString += "\n\n"; + } + } + + if (linkedGeoresourcesString === "") { + linkedGeoresourcesString = "-"; + } + + // jspdf.autoTable({ + // head: [], + // body: [ + // ["Beschreibung", indicator.metadata.description], + // ["Maßeinheit", indicator.unit], + // ["Definition des Leitindikators", "-"], + // ["Klassifizierung", "-"], + // ["Interpretation", "-"], + // ["Verknüpfte Indikatoren", linkedIndicatorsString], + // ["Verknüpfte Geodaten", linkedGeoresourcesString] + // // ... + // ], + // startY: jspdf.autoTable.previous.finalY + 20, + // }); + + var spatialUnitsString = ""; + var processedSpatialUnits = 0; + + for (var availableSpatialUnit of this.availableSpatialUnits) { + + for (var applicableSpatialUnit of indicator.applicableSpatialUnits) { + + if (availableSpatialUnit.spatialUnitLevel === applicableSpatialUnit.spatialUnitName) { + spatialUnitsString += applicableSpatialUnit.spatialUnitName; + processedSpatialUnits++; + + if (processedSpatialUnits < indicator.applicableSpatialUnits.length) { + spatialUnitsString += "\n"; + } + } + + } + } + + var datesString = ""; + + if(indicator.applicableDates.length <= 20){ + for (var [j, date] of indicator.applicableDates.entries()) { + var asDate = new Date(date); + + datesString += this.tsToDate_withOptionalUpdateInterval(this.dateToTS(asDate), indicator.metadata.updateInterval); + + if (j < indicator.applicableDates.length - 1) { + datesString += " "; + } + } + } + else{ + datesString += "Zeitreihe umfasst insgesamt " + indicator.applicableDates.length + " Zeitpunkte\n\n"; + + datesString += "frühester Zeitpunkt: " + this.tsToDate_withOptionalUpdateInterval(this.dateToTS(indicator.applicableDates[0]), indicator.metadata.updateInterval) + "\n"; + datesString += "spätester Zeitpunkt: " + this.tsToDate_withOptionalUpdateInterval(this.dateToTS(indicator.applicableDates[indicator.applicableDates.length - 1]), indicator.metadata.updateInterval); + + } + + var imgData; + var imgWidth; + var imgHeight; + + if(indicator.processDescription && indicator.processDescription.includes("$")){ + await html2canvas(document.querySelector("#indicatorProcessDescription")).then(canvas => { + // document.body.appendChild(canvas) + + imgData = canvas.toDataURL('image/png'); + + }); + + var dimensions = await getImageDimensions(imgData); + imgWidth = dimensions.w; + imgHeight = dimensions.h; + } + + jspdf.autoTable({ + head: [], + body: [ + ["Beschreibung", indicator.metadata.description], + ["Maßeinheit", indicator.unit], + ["Methodik", indicator.processDescription ? indicator.processDescription : "-"], + // ["Klassifizierung", "-"], + ["Interpretation", indicator.interpretation ? indicator.interpretation : "-"], + ["Tags", indicator.tags ? JSON.stringify(indicator.tags) : "-"], + ["Verknüpfte Indikatoren", linkedIndicatorsString], + ["Verknüpfte Geodaten", linkedGeoresourcesString] + ], + theme: 'grid', + headStyles: headStyles, + bodyStyles: bodyStyles, + columnStyles: columnStyles, + startY: jspdf.autoTable.previous.finalY + 10, + willDrawCell: function(data) { + if (imgData && data.row.index === 2 && data.column.index === 1 && data.cell.section === 'body') { + data.row.height = 2.5 * data.cell.height; + data.row.maxCellHeight = 2.5 * data.cell.height; + data.cell.height = 2.5 * data.cell.height; + data.cell.text = ""; + } + if (imgData && data.row.index === 2 && data.column.index === 0 && data.cell.section === 'body') { + data.row.height = 2.5 * data.cell.height; + data.row.maxCellHeight = 2.5 * data.cell.height; + data.cell.height = 2.5 * data.cell.height; + } + }, + didDrawCell: function(data) { + if (imgData && data.row.index === 2 && data.column.index === 1 && data.cell.section === 'body') { + var cellHeight = data.cell.height - data.cell.padding('vertical'); + var cellWidth = data.cell.width - data.cell.padding('horizontal'); + var textPos = data.cell.textPos; + + var imgScale = cellHeight / imgHeight; + var width = imgWidth * imgScale; + if (width > cellWidth){ + width = cellWidth; + } + + jspdf.addImage(imgData, "PNG", textPos.x, textPos.y, width, cellHeight); + } + } + }); + + // // linked elements + // jspdf.autoTable({ + // head: [], + // body: [ + // ["Verknüpfte Indikatoren", linkedIndicatorsString], + // ["Verknüpfte Geodaten", linkedGeoresourcesString] + // ], + // theme: 'grid', + // headStyles: headStyles, + // bodyStyles: bodyStyles, + // columnStyles: columnStyles, + // startY: jspdf.autoTable.previous.finalY + 10 + // }); + + // linked elements + jspdf.autoTable({ + head: [], + body: [ + ["Datengrundlage", indicator.metadata.databasis ? indicator.metadata.databasis : "-"], + ["Datenquelle", indicator.metadata.datasource ? indicator.metadata.datasource : "-"], + ["Datenhalter und Kontakt", indicator.metadata.contact ? indicator.metadata.contact : "-"], + ["Bemerkung", indicator.metadata.note ? indicator.metadata.note : "-"], + ["Raumbezug", spatialUnitsString], + // $scope.updateInteval is a map mapping the english KEYs to german expressions + ["Zeitbezug / Fortführungsintervall", this.updateInterval.get(indicator.metadata.updateInterval.toUpperCase())], + ["Hinweise zum Referenzdatum", indicator.referenceDateNote ? indicator.referenceDateNote : "-"], + ["Verfügbare Zeitreihen", datesString], + ["Datum der letzten Aktualisierung", this.tsToDate_withOptionalUpdateInterval(this.dateToTS(indicator.metadata.lastUpdate))], + ["Quellen / Literatur", indicator.metadata.literature ? indicator.metadata.literature : "-"] + ], + theme: 'grid', + headStyles: headStyles, + bodyStyles: bodyStyles, + columnStyles: columnStyles, + startY: jspdf.autoTable.previous.finalY + 10 + }); + + // + // jspdf.autoTable({ + // head: [], + // body: [ + // ["Quellen / Literatur", indicator.metadata.literature ? indicator.metadata.literature : "-"] + // // ... + // ], + // theme: 'grid', + // headStyles: headStyles, + // bodyStyles: bodyStyles, + // columnStyles: columnStyles, + // startY: jspdf.autoTable.previous.finalY + 10 + // }); + + return jspdf; + }; + + this.generateIndicatorMetadataPdf_asBlob = async function(){ + // create PDF from currently selected/displayed indicator! + var indicatorMetadata = this.selectedIndicator; + var pdfName = indicatorMetadata.indicatorName + ".pdf"; + var jspdf = await this.generateIndicatorMetadataPdf(indicatorMetadata, pdfName); + return jspdf.output("blob", {filename: pdfName}); + }; + + this.generateIndicatorMetadataPdf = async function(indicatorMetadata, pdfName){ + var jspdf = await this.createMetadataPDF_indicator(indicatorMetadata); + + jspdf.setProperties({ + title: 'KomMonitor Indikatorenblatt', + subject: pdfName, + author: 'KomMonitor', + keywords: 'Indikator, Metadatenblatt', + creator: 'KomMonitor' + }); + return jspdf; + }; + + /** + * creates and returns a pdf for the georesource given as parameter + */ + this.createMetadataPDF_georesource = async function(georesource, pdfName) { + + var jspdf = new jsPDF(); + jspdf.setFontSize(16); + // jspdf.text("Metadatenblatt", 70, 6); + + //insert logo + var img = new Image(); + var subPath = location.pathname; + img.src = subPath + 'logos/KM_Logo1.png'; + jspdf.addImage(img, 'PNG', 193, 5, 12, 12); + + jspdf.setFontSize(16); + jspdf.setFont('Helvetica', 'bolditalic', 'normal'); + var titleArray = jspdf.splitTextToSize("Geodatensatz: " + georesource.datasetName, 180); + jspdf.text(titleArray, 14, 25); + + + jspdf.setFontSize(11); + + var initialStartY = 30; + + if (titleArray.length > 1) { + titleArray.forEach(function (item) { + initialStartY += 5; + }); + } + + var headStyles = { + fontStyle: 'bold', + fontSize: 12, + fillColor: '#337ab7', + // auto or wrap + cellWidth: 'auto' + }; + + var bodyStyles = { + fontStyle: 'normal', + fontSize: 11, + // auto or wrap or number + cellWidth: 'auto' + }; + + // first column with fixed width + var columnStyles = { + 0: { cellWidth: 45, fontStyle: 'bold' }, + 1: { fontStyle: 'normal' } + }; + + var topicsString = ""; + + var topicReferenceId = georesource.topicReference; + + // will be an array representing the topic hierarchy + // i.e. [mainTopic, subTopicFirstTier, subTopicSecondTier, ...] + var topicHierarchyArray = this.getTopicHierarchyForTopicId(topicReferenceId); + + for (let index = 0; index < topicHierarchyArray.length; index++) { + if (index === 0) { + // mainTopic --> first tier + topicsString += topicHierarchyArray[index].topicName; + } + else { + var numberOfWhitespaces = 2 * index; + var whitespaceString = ""; + for (let k = 0; k < numberOfWhitespaces; k++) { + whitespaceString += " "; + } + topicsString += whitespaceString + topicHierarchyArray[index].topicName; + } + + if (index < topicHierarchyArray.length - 1) { + topicsString += "\n"; + } + + } + + var category = "Punkt"; + if (georesource.isLOI) { + category = "Linie"; + } + else if(georesource.isAOI){ + category = "Fläche"; + } + + // Or JavaScript: + jspdf.autoTable({ + head: [['Themenfeld', 'Datentyp', 'letzte Aktualisierung']], + body: [ + [topicsString, category, this.tsToDate_withOptionalUpdateInterval(this.dateToTS(georesource.metadata.lastUpdate))] + // ... + ], + theme: 'grid', + headStyles: headStyles, + bodyStyles: bodyStyles, + startY: initialStartY + }); + + var datesString = ""; + + if(georesource.availablePeriodsOfValidity.length <= 10){ + for (var [j, period] of georesource.availablePeriodsOfValidity.entries()) { + + var startDate = new Date(period.startDate); + var endDate = period.endDate? new Date(period.endDate) : undefined; + + datesString += "Zeitspanne: " + this.tsToDate_withOptionalUpdateInterval(this.dateToTS(startDate)); + if(endDate){ + datesString += " - " + this.tsToDate_withOptionalUpdateInterval(this.dateToTS(endDate)); + } + else{ + datesString += "- 'null' (demnach gültig bis auf weiteres)"; + } + + if (j < georesource.availablePeriodsOfValidity.length - 1) { + datesString += "\n"; + } + } + } + else{ + datesString += "insgesamt " + georesource.availablePeriodsOfValidity.length + " Zeitspannen\n\n"; + + var earliestStartDate; + var latestEndDate = -1; // my be null --> enc init with -1 + + for (var [j, period] of georesource.availablePeriodsOfValidity.entries()) { + + if(! earliestStartDate){ + earliestStartDate = new Date(period.startDate); + } + else{ + if(new Date(period.startDate) < earliestStartDate){ + earliestStartDate = new Date(period.startDate); + } + } + + if(latestEndDate == -1){ + if(period.endDate){ + latestEndDate = new Date(period.endDate); + } + else if(period.endDate == null){ + latestEndDate = null; + } + + } + else{ + if(latestEndDate && period.endDate && new Date(period.endDate) > latestEndDate){ + latestEndDate = new Date(period.endDate); + } + } + } + + datesString += "frühestes Startdatum: " + this.tsToDate_withOptionalUpdateInterval(this.dateToTS(earliestStartDate)) + "\n"; + if(latestEndDate != null && latestEndDate != -1){ + datesString += "spätestes Enddatum: " + this.tsToDate_withOptionalUpdateInterval(this.dateToTS(latestEndDate)) + "\n"; + } + else{ + datesString += "spätestes Enddatum: ohne explizites Enddatum (demnach gültig bis auf weiteres)\n"; + } + + + } + + // linked elements + jspdf.autoTable({ + head: [], + body: [ + ["Beschreibung", georesource.metadata.description], + ["Datengrundlage", georesource.metadata.databasis ? georesource.metadata.databasis : "-"], + ["Datenquelle", georesource.metadata.datasource ? georesource.metadata.datasource : "-"], + ["Datenhalter und Kontakt", georesource.metadata.contact ? georesource.metadata.contact : "-"], + ["Bemerkung", georesource.metadata.note ? georesource.metadata.note : "-"], + // $scope.updateInteval is a map mapping the english KEYs to german expressions + ["Zeitbezug / Fortführungsintervall", this.updateInterval.get(georesource.metadata.updateInterval.toUpperCase())], + ["Verfügbare Gültigkeitszeiträume", datesString], + ["Quellen / Literatur", georesource.metadata.literature ? georesource.metadata.literature : "-"] + ], + theme: 'grid', + headStyles: headStyles, + bodyStyles: bodyStyles, + columnStyles: columnStyles, + startY: jspdf.autoTable.previous.finalY + 10 + }); + + jspdf.setProperties({ + title: 'KomMonitor Geodatenblatt', + subject: pdfName, + author: 'KomMonitor', + keywords: 'Geodaten, Metadatenblatt', + creator: 'KomMonitor' + }); + return jspdf; + }; + + this.generateGeoresourceMetadataPdf_asBlob = async function(georesourceMetadata){ + var pdfName = georesourceMetadata.datasetName + ".pdf"; + var jspdf = await this.createMetadataPDF_georesource(georesourceMetadata, pdfName); + return jspdf.output("blob", {filename: pdfName}); + }; + + this.downloadMetadataPDF_georesource = async function(georesourceMetadata){ + var pdfName = georesourceMetadata.datasetName + ".pdf"; + var jspdf = await this.createMetadataPDF_georesource(georesourceMetadata, pdfName); + return jspdf.save(pdfName); + }; + + // this.getIndicatorStringFromIndicatorType = function (indicator) { + // var indicatorTypeString; + // if (indicator.indicatorType.includes("DYNAMIC_ABSOLUTE")) { + // indicatorTypeString = "Dynamik-Indikator (absolute)"; + // } + // else if (indicator.indicatorType.includes("DYNAMIC_RELATIVE")) { + // indicatorTypeString = "Dynamik-Indikator (relativ)"; + // } + // else if (indicator.indicatorType.includes("DYNAMIC_STANDARDIZED")) { + // indicatorTypeString = "Dynamik-Indikator (standardisiert)"; + // } + // else if (indicator.indicatorType.includes("STATUS_ABSOLUTE")) { + // indicatorTypeString = "Status-Indikator (absolut)"; + // } + // else if (indicator.indicatorType.includes("STATUS_RELATIVE")) { + // indicatorTypeString = "Status-Indikator (relativ)"; + // } + // else if (indicator.indicatorType.includes("STATUS_STANDARDIZED")) { + // indicatorTypeString = "Status-Indikator (standardisiert)"; + // } + + // return indicatorTypeString; + // }; + + this.dateToTS = function(date) { + if(date){ + return date.valueOf(); + } + + }; + + this.tsToDate = function(ts) { + if(ts){ + var date = new Date(ts); + + return date.toLocaleDateString("de-DE", { + year: 'numeric', + month: 'long', + day: 'numeric' + }); + } + }; + + this.tsToDate_withOptionalUpdateInterval = function(ts, updateIntervalApiName) { + if(ts){ + var date = new Date(ts); + + /** + * TODO FIXME dateSLider formatter will return only year for now to prevent misleading month and day settings + */ + + // return date.getFullYear(); + + if(updateIntervalApiName){ + if(updateIntervalApiName.toLowerCase() === "yearly"){ + return date.getFullYear(); + } + else if(updateIntervalApiName.toLowerCase() === "half_yearly"){ + return (date.getMonth() + 1) + "/" + date.getFullYear(); + } + else if(updateIntervalApiName.toLowerCase() === "monthly"){ + return (date.getMonth() + 1) + "/" + date.getFullYear(); + } + // else if(updateIntervalApiName.toLowerCase() === "weekly"){ + // return date.toLocaleDateString("de-DE", { + // year: 'numeric', + // month: 'short', + // day: 'numeric' + // }); + // } + // else if(updateIntervalApiName.toLowerCase() === "daily"){ + // return date.toLocaleDateString("de-DE", { + // year: 'numeric', + // month: 'short', + // day: 'numeric' + // }); + // } + else if(updateIntervalApiName.toLowerCase() === "quarterly"){ + var year = date.getFullYear(); + var month = date.getMonth(); + if(month < 4){ + return "Q1/" + year; + } + else if(month < 7){ + return "Q2/" + year; + } + else if(month < 10){ + return "Q3/" + year; + } + else { + return "Q4/" + year; + } + } + else{ + // includes daily and weekly, as they are presented equally + return date.toLocaleDateString("de-DE", { + year: 'numeric', + month: 'short', + day: 'numeric' + }); + } + } + else{ + return date.toLocaleDateString("de-DE", { + year: 'numeric', + month: 'short', + day: 'numeric' + }); + } + + } + }; + + this.getSpatialUnitIdFromSpatialUnitName = function(name) { + let result = null; + $(this.availableSpatialUnits).each( (id, obj) => { + if (obj.spatialUnitLevel === name) { + result = obj.spatialUnitId; + return false; + } + }); + return result; + } + + /** + * creates an array of objects from an array of strings. + * each object in the result has the properties "category" and "name" + * + * example: + * convert ["s1", "s2", ...] ===> [{category: "s1",name: "s1"}, {category: "s2", name: "s2"}, ...] + * @param {array} array + */ + this.createDualListInputArray = function(array, nameProperty, idProperty) { + var result = []; + + if(array && Array.isArray(array)){ + for (var i=0;i { + return el.type === type; + }); + if(typeof(result) === "undefined") { + throw "No DefaultReportingTemplatePageElement exists for type " + type + "." + } else { + return result[0]; + } + } + + + this.generateAndDownloadIndicatorZIP = async function(indicatorData, fileName, fileEnding, jsZipOptions){ + // generate metadata file and include actual dataset and metadata file in download + + var metadataPdf = await this.generateIndicatorMetadataPdf_asBlob(); + var zip = new JSZip(); + zip.file(fileName + fileEnding, indicatorData, jsZipOptions); + zip.file(fileName + "_Metadata.pdf", metadataPdf); + zip.generateAsync({type:"blob"}) + .then(function(content) { + // see FileSaver.js + saveAs(content, fileName + ".zip"); + }); + }; + + this.generateAndDownloadGeoresourceZIP = async function(georesourceMetadata, georesourceData, fileName, fileEnding, jsZipOptions){ + // generate metadata file and include actual dataset and metadata file in download + + var metadataPdf = await this.generateGeoresourceMetadataPdf_asBlob(georesourceMetadata); + var zip = new JSZip(); + zip.file(fileName + fileEnding, georesourceData, jsZipOptions); + zip.file(fileName + "_Metadata.pdf", metadataPdf); + zip.generateAsync({type:"blob"}) + .then(function(content) { + // see FileSaver.js + saveAs(content, fileName + ".zip"); + }); + }; +}]); diff --git a/app/util/genericServices/kommonitorDataGridHelperService/kommonitor-data-grid-helper-service.module.js b/app/util/genericServices/kommonitorDataGridHelperService/kommonitor-data-grid-helper-service.module.js index 72262fa72..c3668bdcd 100644 --- a/app/util/genericServices/kommonitorDataGridHelperService/kommonitor-data-grid-helper-service.module.js +++ b/app/util/genericServices/kommonitorDataGridHelperService/kommonitor-data-grid-helper-service.module.js @@ -1,3017 +1,2605 @@ +"use strict"; angular.module('kommonitorDataGridHelper', ['kommonitorDataExchange']); - angular - .module('kommonitorDataGridHelper', []) - .service( - 'kommonitorDataGridHelperService', ['kommonitorDataExchangeService', '$rootScope', '$timeout', '$http', '$httpParamSerializerJQLike', '__env', - function (kommonitorDataExchangeService, $rootScope, $timeout, - $http, $httpParamSerializerJQLike, __env) { - - var self = this; - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - - this.resourceType_georesource = "georesource"; - this.resourceType_spatialUnit = "spatialUnit"; - this.resourceType_indicator = "indicator"; - - this.featureTable_spatialUnit_lastUpdate_timestamp_success = undefined; - this.featureTable_spatialUnit_lastUpdate_timestamp_failure = undefined; - this.featureTable_georesource_lastUpdate_timestamp_success = undefined; - this.featureTable_georesource_lastUpdate_timestamp_failure = undefined; - this.featureTable_indicator_lastUpdate_timestamp_success = undefined; - this.featureTable_indicator_lastUpdate_timestamp_failure = undefined; - - this.dataGridOptions_indicators; - this.dataGridOptions_georesources_poi; - this.dataGridOptions_georesources_loi; - this.dataGridOptions_georesources_aoi; - this.dataGridOptions_spatialUnits; - this.dataGridOptions_accessControl; - - function getCurrentTimestampString(){ - let date = new Date(); - let hours = date.getHours(); - if(hours < 10){ - hours = "0" + hours; - } - let minutes = date.getMinutes(); - if(minutes < 10){ - minutes = "0" + minutes; - } - let seconds = date.getSeconds(); - if(seconds < 10){ - seconds = "0" + seconds; - } - return "" + hours + ":" + minutes + ":" + seconds; - } - - function headerHeightGetter() { - var columnHeaderTexts = [ - ...document.querySelectorAll('.ag-header-cell-text'), - ]; - var clientHeights = columnHeaderTexts.map( - headerText => headerText.clientHeight - ); - var tallestHeaderTextHeight = Math.max(...clientHeights); - - return tallestHeaderTextHeight; - } - - function headerHeightSetter(gridOptions) { - var padding = 20; - var height = headerHeightGetter() + padding; - gridOptions.api.setHeaderHeight(height); - } - - var displayEditButtons_indicators = function (params) { - let disabledEditButtons = !params.data.userPermissions.includes("editor") - let editMetadataButtonId = 'btn_georesource_editMetadata_' + params.data.indicatorId; - let editFeaturesButtonId = 'btn_georesource_editFeatures_' + params.data.indicatorId; - - let html = '
        '; - html += ''; - html += ''; - - if(!disabledEditButtons){ - html = html.replaceAll("disabled", "") //enabled - } - - if (kommonitorDataExchangeService.enableKeycloakSecurity) { - // disable button if there is no applicable spatial unit or user has no creator rights - let disabled = params.data.applicableSpatialUnits.length == 0 || !params.data.userPermissions.includes("editor"); - html += ''; - html += ''; - html += '' - html += '
        '; - - return html; - }; - - var displayEditButtons_spatialUnits = function (params) { - - let html = '
        '; - html += ''; - html += ''; - html += '' - html += '
        '; - - return html; - }; - - var displayEditButtons_accessControl = function (params) { - - let html = '
        '; - html += ''; - html += '
        '; - - return html; - }; - - function getDatePicker() { - // function to act as a class - function Datepicker() {} - - // gets called once before the renderer is used - Datepicker.prototype.init = function (params) { - // create the cell - this.eInput = document.createElement('input'); - this.eInput.value = params.value; - this.eInput.classList.add('ag-input'); - this.eInput.style.height = '100%'; - - // https://jqueryui.com/datepicker/ - // $(this.eInput).datepicker({ - // dateFormat: 'yyyy-mm-dd', - // }); - $(this.eInput).datepicker(kommonitorDataExchangeService.datePickerOptions); - - }; - - // gets called once when grid ready to insert the element - Datepicker.prototype.getGui = function () { - return this.eInput; - }; - - // focus and select can be done after the gui is attached - Datepicker.prototype.afterGuiAttached = function () { - this.eInput.focus(); - this.eInput.select(); - }; - - // returns the new value after editing - Datepicker.prototype.getValue = function () { - return this.eInput.value; - }; - - // any cleanup we need to be done here - Datepicker.prototype.destroy = () => { - // but this example is simple, no cleanup, we could - // even leave this method out as it's optional - }; - - // if true, then this editor will appear in a popup - Datepicker.prototype.isPopup = () => { - // and we could leave this method out also, false is the default - return false; - }; - - return Datepicker; - } - - this.buildDataGridColumnConfig_indicators = function (indicatorMetadataArray) { - const columnDefs = [ - { headerName: 'Editierfunktionen', pinned: 'left', maxWidth: 150, checkboxSelection: false, filter: false, sortable: false, cellRenderer: 'displayEditButtons_indicators' }, - { headerName: 'Id', field: "indicatorId", pinned: 'left', maxWidth: 125 }, - { headerName: 'Name', field: "indicatorName", pinned: 'left', minWidth: 300 }, - { headerName: 'Einheit', field: "unit", minWidth: 200 }, - { headerName: 'Beschreibung', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.description; }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + params.data.metadata.description; - } - }, - { - headerName: 'Methodik', minWidth: 400, - cellRenderer: function (params) { - - if(params.data.processDescription && params.data.processDescription.includes("$$")){ - let splitArray = params.data.processDescription.split("$$"); - - for (let index = 0; index < splitArray.length; index++) { - if((index % 2) == 0){ - params.data.processDescription += "
        "; - } - } - } - return params.data.processDescription; - }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + params.data.processDescription; - } - }, - { - headerName: 'Verfügbare Raumeinheiten', field: "applicableSpatialUnits", minWidth: 400, - cellRenderer: function (params) { - /* -
          -
        • - {{::applicableSpatialUnit.spatialUnitName}} -
        • -
        - */ - let html = '
          '; - for (const applicableSpatialUnit of params.data.applicableSpatialUnits) { - html += '
        • '; - html += applicableSpatialUnit.spatialUnitName; - html += '
        • '; - } - html += '
        '; - return html; - }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - if (params.data.applicableSpatialUnits && params.data.applicableSpatialUnits.length > 1){ - return "" + JSON.stringify(params.data.applicableSpatialUnits); - } - return params.data.applicableSpatialUnits; - } - }, - { - headerName: 'Verfügbare Zeitschnitte', field: "applicableDates", minWidth: 400, - cellRenderer: function (params) { - /* -
          -
        • - {{::timestamp}} -
        • -
        - */ - let html = '
          '; - for (const timestamp of params.data.applicableDates) { - html += '
        • '; - html += timestamp; - html += '
        • '; - } - html += '
        '; - return html; - }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - if (params.data.applicableDates && params.data.applicableDates.length > 1){ - return "" + JSON.stringify(params.data.applicableDates); - } - return params.data.applicableDates; + .module('kommonitorDataGridHelper', []) + .service('kommonitorDataGridHelperService', ['kommonitorDataExchangeService', '$rootScope', '$timeout', '$http', '$httpParamSerializerJQLike', '__env', + function (kommonitorDataExchangeService, $rootScope, $timeout, $http, $httpParamSerializerJQLike, __env) { + var self = this; + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + this.resourceType_georesource = "georesource"; + this.resourceType_spatialUnit = "spatialUnit"; + this.resourceType_indicator = "indicator"; + this.featureTable_spatialUnit_lastUpdate_timestamp_success = undefined; + this.featureTable_spatialUnit_lastUpdate_timestamp_failure = undefined; + this.featureTable_georesource_lastUpdate_timestamp_success = undefined; + this.featureTable_georesource_lastUpdate_timestamp_failure = undefined; + this.featureTable_indicator_lastUpdate_timestamp_success = undefined; + this.featureTable_indicator_lastUpdate_timestamp_failure = undefined; + this.dataGridOptions_indicators; + this.dataGridOptions_georesources_poi; + this.dataGridOptions_georesources_loi; + this.dataGridOptions_georesources_aoi; + this.dataGridOptions_spatialUnits; + this.dataGridOptions_accessControl; + function getCurrentTimestampString() { + let date = new Date(); + let hours = date.getHours(); + if (hours < 10) { + hours = "0" + hours; } - }, - { headerName: 'Kürzel', field: "abbreviation" }, - { headerName: 'Leitindikator', field: "isHeadlineIndicator" }, - { headerName: 'Indikator-Typ', minWidth: 200, - cellRenderer: function (params) { return kommonitorDataExchangeService.getIndicatorStringFromIndicatorType(params.data.indicatorType); }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + kommonitorDataExchangeService.getIndicatorStringFromIndicatorType(params.data.indicatorType); - } - }, - { headerName: 'Merkmal', field: "characteristicValue", minWidth: 200 }, - { headerName: 'Art der Fortführung', field: "creationType", minWidth: 200 }, - // { headerName: 'Interpretation', minWidth: 400, cellRenderer: function(params){ return params.data.interpretation; } }, - - { headerName: 'Tags/Stichworte', field: "tags", minWidth: 250 }, - { headerName: 'Themenhierarchie', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getTopicHierarchyDisplayString(params.data.topicReference); }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + kommonitorDataExchangeService.getTopicHierarchyDisplayString(params.data.topicReference); + let minutes = date.getMinutes(); + if (minutes < 10) { + minutes = "0" + minutes; } - }, - { headerName: 'Datenquelle', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.datasource; }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + params.data.metadata.datasource; + let seconds = date.getSeconds(); + if (seconds < 10) { + seconds = "0" + seconds; } - }, - { headerName: 'Datenhalter und Kontakt', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.contact; }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + params.data.metadata.contact; + return "" + hours + ":" + minutes + ":" + seconds; + } + function headerHeightGetter() { + var columnHeaderTexts = [ + ...document.querySelectorAll('.ag-header-cell-text'), + ]; + var clientHeights = columnHeaderTexts.map(headerText => headerText.clientHeight); + var tallestHeaderTextHeight = Math.max(...clientHeights); + return tallestHeaderTextHeight; + } + function headerHeightSetter(gridOptions) { + var padding = 20; + var height = headerHeightGetter() + padding; + gridOptions.api.setHeaderHeight(height); + } + var displayEditButtons_indicators = function (params) { + let disabledEditButtons = !params.data.userPermissions.includes("editor"); + let editMetadataButtonId = 'btn_georesource_editMetadata_' + params.data.indicatorId; + let editFeaturesButtonId = 'btn_georesource_editFeatures_' + params.data.indicatorId; + let html = '
        '; + html += ''; + html += ''; + if (!disabledEditButtons) { + html = html.replaceAll("disabled", ""); //enabled } - }, - { headerName: 'Rollen', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); - } - } - ]; - - return columnDefs; - }; - - this.buildDataGridRowData_indicators = function (indicatorMetadataArray) { - return indicatorMetadataArray; - }; - - - this.buildDataGridColumnConfig_georesources_poi = function (georesourceMetadataArray) { - const columnDefs = [ - { headerName: 'Editierfunktionen', pinned: 'left', maxWidth: 150, checkboxSelection: false, - headerCheckboxSelection: false, - headerCheckboxSelectionFilteredOnly: true, - filter: false, - sortable: false, cellRenderer: 'displayEditButtons_georesources' }, - { headerName: 'Id', field: "georesourceId", pinned: 'left', maxWidth: 125 }, - { headerName: 'Name', field: "datasetName", pinned: 'left', minWidth: 300 }, - { headerName: 'Symbolfarbe', filter: false, sortable: false, maxWidth: 125, cellRenderer: function (params) { return "
        " + params.data.poiSymbolColor+ "

        "; } }, - { headerName: 'Symbolname', maxWidth: 125, - cellRenderer: function (params) { return params.data.poiSymbolBootstrap3Name + "

        "; }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + params.data.poiSymbolBootstrap3Name; - } - }, - { headerName: 'Markerfarbe', filter: false, sortable: false, maxWidth: 125, cellRenderer: function (params) { return "
        " + params.data.poiMarkerColor+ "

        "; } }, - { headerName: 'Beschreibung', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.description; }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + params.data.metadata.description; + if (kommonitorDataExchangeService.enableKeycloakSecurity) { + // disable button if there is no applicable spatial unit or user has no creator rights + let disabled = params.data.applicableSpatialUnits.length == 0 || !params.data.userPermissions.includes("editor"); + html += '
        '; + return html; + }; + var displayEditButtons_georesources = function (params) { + let editMetadataButtonId = 'btn_georesource_editMetadata_' + params.data.georesourceId; + let editFeaturesButtonId = 'btn_georesource_editFeatures_' + params.data.georesourceId; + let html = '
        '; + html += ''; + html += ''; + html += ''; + html += '
        '; + return html; + }; + var displayEditButtons_spatialUnits = function (params) { + let html = '
        '; + html += ''; + html += ''; + html += ''; + html += '
        '; + return html; + }; + var displayEditButtons_accessControl = function (params) { + let html = '
        '; + html += ''; + html += '
        '; + return html; + }; + function getDatePicker() { + // function to act as a class + function Datepicker() { } + // gets called once before the renderer is used + Datepicker.prototype.init = function (params) { + // create the cell + this.eInput = document.createElement('input'); + this.eInput.value = params.value; + this.eInput.classList.add('ag-input'); + this.eInput.style.height = '100%'; + // https://jqueryui.com/datepicker/ + // $(this.eInput).datepicker({ + // dateFormat: 'yyyy-mm-dd', + // }); + $(this.eInput).datepicker(kommonitorDataExchangeService.datePickerOptions); + }; + // gets called once when grid ready to insert the element + Datepicker.prototype.getGui = function () { + return this.eInput; + }; + // focus and select can be done after the gui is attached + Datepicker.prototype.afterGuiAttached = function () { + this.eInput.focus(); + this.eInput.select(); + }; + // returns the new value after editing + Datepicker.prototype.getValue = function () { + return this.eInput.value; + }; + // any cleanup we need to be done here + Datepicker.prototype.destroy = () => { + // but this example is simple, no cleanup, we could + // even leave this method out as it's optional + }; + // if true, then this editor will appear in a popup + Datepicker.prototype.isPopup = () => { + // and we could leave this method out also, false is the default + return false; + }; + return Datepicker; + } + this.buildDataGridColumnConfig_indicators = function (indicatorMetadataArray) { + const columnDefs = [ + { headerName: 'Editierfunktionen', pinned: 'left', maxWidth: 150, checkboxSelection: false, filter: false, sortable: false, cellRenderer: 'displayEditButtons_indicators' }, + { headerName: 'Id', field: "indicatorId", pinned: 'left', maxWidth: 125 }, + { headerName: 'Name', field: "indicatorName", pinned: 'left', minWidth: 300 }, + { headerName: 'Einheit', field: "unit", minWidth: 200 }, + { headerName: 'Beschreibung', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.description; }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + params.data.metadata.description; + } + }, + { + headerName: 'Methodik', minWidth: 400, + cellRenderer: function (params) { + if (params.data.processDescription && params.data.processDescription.includes("$$")) { + let splitArray = params.data.processDescription.split("$$"); + for (let index = 0; index < splitArray.length; index++) { + if ((index % 2) == 0) { + params.data.processDescription += "
        "; + } + } + } + return params.data.processDescription; + }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + params.data.processDescription; + } + }, + { + headerName: 'Verfügbare Raumeinheiten', field: "applicableSpatialUnits", minWidth: 400, + cellRenderer: function (params) { + /* +
          +
        • + {{::applicableSpatialUnit.spatialUnitName}} +
        • +
        + */ + let html = '
          '; + for (const applicableSpatialUnit of params.data.applicableSpatialUnits) { + html += '
        • '; + html += applicableSpatialUnit.spatialUnitName; + html += '
        • '; + } + html += '
        '; + return html; + }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + if (params.data.applicableSpatialUnits && params.data.applicableSpatialUnits.length > 1) { + return "" + JSON.stringify(params.data.applicableSpatialUnits); + } + return params.data.applicableSpatialUnits; + } + }, + { + headerName: 'Verfügbare Zeitschnitte', field: "applicableDates", minWidth: 400, + cellRenderer: function (params) { + /* +
          +
        • + {{::timestamp}} +
        • +
        + */ + let html = '
          '; + for (const timestamp of params.data.applicableDates) { + html += '
        • '; + html += timestamp; + html += '
        • '; + } + html += '
        '; + return html; + }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + if (params.data.applicableDates && params.data.applicableDates.length > 1) { + return "" + JSON.stringify(params.data.applicableDates); + } + return params.data.applicableDates; + } + }, + { headerName: 'Kürzel', field: "abbreviation" }, + { headerName: 'Leitindikator', field: "isHeadlineIndicator" }, + { headerName: 'Indikator-Typ', minWidth: 200, + cellRenderer: function (params) { return kommonitorDataExchangeService.getIndicatorStringFromIndicatorType(params.data.indicatorType); }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + kommonitorDataExchangeService.getIndicatorStringFromIndicatorType(params.data.indicatorType); + } + }, + { headerName: 'Merkmal', field: "characteristicValue", minWidth: 200 }, + { headerName: 'Art der Fortführung', field: "creationType", minWidth: 200 }, + // { headerName: 'Interpretation', minWidth: 400, cellRenderer: function(params){ return params.data.interpretation; } }, + { headerName: 'Tags/Stichworte', field: "tags", minWidth: 250 }, + { headerName: 'Themenhierarchie', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getTopicHierarchyDisplayString(params.data.topicReference); }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + kommonitorDataExchangeService.getTopicHierarchyDisplayString(params.data.topicReference); + } + }, + { headerName: 'Datenquelle', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.datasource; }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + params.data.metadata.datasource; + } + }, + { headerName: 'Datenhalter und Kontakt', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.contact; }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + params.data.metadata.contact; + } + }, + { headerName: 'Rollen', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); + } + } + ]; + return columnDefs; + }; + this.buildDataGridRowData_indicators = function (indicatorMetadataArray) { + return indicatorMetadataArray; + }; + this.buildDataGridColumnConfig_georesources_poi = function (georesourceMetadataArray) { + const columnDefs = [ + { headerName: 'Editierfunktionen', pinned: 'left', maxWidth: 150, checkboxSelection: false, + headerCheckboxSelection: false, + headerCheckboxSelectionFilteredOnly: true, + filter: false, + sortable: false, cellRenderer: 'displayEditButtons_georesources' }, + { headerName: 'Id', field: "georesourceId", pinned: 'left', maxWidth: 125 }, + { headerName: 'Name', field: "datasetName", pinned: 'left', minWidth: 300 }, + { headerName: 'Symbolfarbe', filter: false, sortable: false, maxWidth: 125, cellRenderer: function (params) { return "
        " + params.data.poiSymbolColor + "

        "; } }, + { headerName: 'Symbolname', maxWidth: 125, + cellRenderer: function (params) { return params.data.poiSymbolBootstrap3Name + "

        "; }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + params.data.poiSymbolBootstrap3Name; + } + }, + { headerName: 'Markerfarbe', filter: false, sortable: false, maxWidth: 125, cellRenderer: function (params) { return "
        " + params.data.poiMarkerColor + "

        "; } }, + { headerName: 'Beschreibung', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.description; }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + params.data.metadata.description; + } + }, + { + headerName: 'Gültigkeitszeitraum', minWidth: 400, + cellRenderer: function (params) { + /* +
          +
        • +

          {{::periodOfValidity.startDate}} - {{::periodOfValidity.endDate}}

          +

          {{::periodOfValidity.startDate}} - heute

          +
        • +
        + */ + let html = '
          '; + for (const periodOfValidity of params.data.availablePeriodsOfValidity) { + html += '
        • '; + if (periodOfValidity.endDate) { + html += "

          " + periodOfValidity.startDate + " ‐ " + periodOfValidity.endDate + "

          "; + } + else { + html += "

          " + periodOfValidity.startDate + " ‐ heute

          "; + } + html += '
        • '; + } + html += '
        '; + return html; + }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + if (params.data.availablePeriodsOfValidity && params.data.availablePeriodsOfValidity.length > 1) { + return "" + JSON.stringify(params.data.availablePeriodsOfValidity); + } + return params.data.availablePeriodsOfValidity; + } + }, + { headerName: 'Themenhierarchie', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getTopicHierarchyDisplayString(params.data.topicReference); }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + kommonitorDataExchangeService.getTopicHierarchyDisplayString(params.data.topicReference); + } + }, + { headerName: 'Datenquelle', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.datasource; }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + params.data.metadata.datasource; + } + }, + { headerName: 'Datenhalter und Kontakt', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.contact; }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + params.data.metadata.contact; + } + }, + { headerName: 'Rollen', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); + } + } + ]; + return columnDefs; + }; + this.buildDataGridColumnConfig_georesources_loi = function (georesourceMetadataArray) { + const columnDefs = [ + { headerName: 'Editierfunktionen', pinned: 'left', maxWidth: 150, checkboxSelection: false, headerCheckboxSelection: false, + headerCheckboxSelectionFilteredOnly: true, filter: false, sortable: false, cellRenderer: 'displayEditButtons_georesources' }, + { headerName: 'Id', field: "georesourceId", pinned: 'left', maxWidth: 125 }, + { headerName: 'Name', field: "datasetName", pinned: 'left', minWidth: 300 }, + { headerName: 'Linienfarbe', filter: false, sortable: false, maxWidth: 125, cellRenderer: function (params) { return "
        " + params.data.loiColor + "

        "; } }, + { headerName: 'Linienbreite', maxWidth: 125, field: "loiWidth" }, + { headerName: 'Linienmuster', filter: false, sortable: false, maxWidth: 125, cellRenderer: function (params) { return "
        " + kommonitorDataExchangeService.getLoiDashSvgFromStringValue(params.data.loiDashArrayString) + "
        "; } }, + { headerName: 'Beschreibung', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.description; }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + params.data.metadata.description; + } + }, + { + headerName: 'Gültigkeitszeitraum', minWidth: 400, + cellRenderer: function (params) { + /* +
          +
        • +

          {{::periodOfValidity.startDate}} - {{::periodOfValidity.endDate}}

          +

          {{::periodOfValidity.startDate}} - heute

          +
        • +
        + */ + let html = '
          '; + for (const periodOfValidity of params.data.availablePeriodsOfValidity) { + html += '
        • '; + if (periodOfValidity.endDate) { + html += "

          " + periodOfValidity.startDate + " ‐ " + periodOfValidity.endDate + "

          "; + } + else { + html += "

          " + periodOfValidity.startDate + " ‐ heute

          "; + } + html += '
        • '; + } + html += '
        '; + return html; + }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + if (params.data.availablePeriodsOfValidity && params.data.availablePeriodsOfValidity.length > 1) { + return "" + JSON.stringify(params.data.availablePeriodsOfValidity); + } + return params.data.availablePeriodsOfValidity; + } + }, + { headerName: 'Themenhierarchie', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getTopicHierarchyDisplayString(params.data.topicReference); }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + kommonitorDataExchangeService.getTopicHierarchyDisplayString(params.data.topicReference); + } + }, + { headerName: 'Datenquelle', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.datasource; }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + params.data.metadata.datasource; + } + }, + { headerName: 'Datenhalter und Kontakt', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.contact; }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + params.data.metadata.contact; + } + }, + { headerName: 'Rollen', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); + } + } + ]; + return columnDefs; + }; + this.buildDataGridColumnConfig_georesources_aoi = function (georesourceMetadataArray) { + const columnDefs = [ + { headerName: 'Editierfunktionen', pinned: 'left', maxWidth: 150, checkboxSelection: false, headerCheckboxSelection: false, + headerCheckboxSelectionFilteredOnly: true, filter: false, sortable: false, cellRenderer: 'displayEditButtons_georesources' }, + { headerName: 'Id', field: "georesourceId", pinned: 'left', maxWidth: 125 }, + { headerName: 'Name', field: "datasetName", pinned: 'left', minWidth: 300 }, + { headerName: 'Polygonfarbe', filter: false, sortable: false, maxWidth: 125, cellRenderer: function (params) { return "
        " + params.data.aoiColor + "

        "; } }, + { headerName: 'Beschreibung', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.description; }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + params.data.metadata.description; + } + }, + { + headerName: 'Gültigkeitszeitraum', minWidth: 400, + cellRenderer: function (params) { + /* +
          +
        • +

          {{::periodOfValidity.startDate}} - {{::periodOfValidity.endDate}}

          +

          {{::periodOfValidity.startDate}} - heute

          +
        • +
        + */ + let html = '
          '; + for (const periodOfValidity of params.data.availablePeriodsOfValidity) { + html += '
        • '; + if (periodOfValidity.endDate) { + html += "

          " + periodOfValidity.startDate + " ‐ " + periodOfValidity.endDate + "

          "; + } + else { + html += "

          " + periodOfValidity.startDate + " ‐ heute

          "; + } + html += '
        • '; + } + html += '
        '; + return html; + }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + if (params.data.availablePeriodsOfValidity && params.data.availablePeriodsOfValidity.length > 1) { + return "" + JSON.stringify(params.data.availablePeriodsOfValidity); + } + return params.data.availablePeriodsOfValidity; + } + }, + { headerName: 'Themenhierarchie', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getTopicHierarchyDisplayString(params.data.topicReference); }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + kommonitorDataExchangeService.getTopicHierarchyDisplayString(params.data.topicReference); + } + }, + { headerName: 'Datenquelle', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.datasource; }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + params.data.metadata.datasource; + } + }, + { headerName: 'Datenhalter und Kontakt', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.contact; }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + params.data.metadata.contact; + } + }, + { headerName: 'Rollen', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); + } + } + ]; + return columnDefs; + }; + this.buildDataGridRowData_georesources_poi = function (georesourceMetadataArray) { + return georesourceMetadataArray.filter(georesourceMetadata => georesourceMetadata.isPOI); + }; + this.buildDataGridRowData_georesources_loi = function (georesourceMetadataArray) { + return georesourceMetadataArray.filter(georesourceMetadata => georesourceMetadata.isLOI); + }; + this.buildDataGridRowData_georesources_aoi = function (georesourceMetadataArray) { + return georesourceMetadataArray.filter(georesourceMetadata => georesourceMetadata.isAOI); + }; + this.getSelectedGeoresourcesMetadata = function () { + let georesourceMetadataArray = []; + //POI + if (this.dataGridOptions_georesources_poi && this.dataGridOptions_georesources_poi.api) { + let selectedPoiNodes = this.dataGridOptions_georesources_poi.api.getSelectedNodes(); + for (const selectedPoiNode of selectedPoiNodes) { + georesourceMetadataArray.push(selectedPoiNode.data); } - else{ - html += "

        " + periodOfValidity.startDate + " ‐ heute

        "; - } - html += ''; - } - html += ''; - return html; - }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - if (params.data.availablePeriodsOfValidity && params.data.availablePeriodsOfValidity.length > 1){ - return "" + JSON.stringify(params.data.availablePeriodsOfValidity); - } - return params.data.availablePeriodsOfValidity; } - }, - { headerName: 'Themenhierarchie', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getTopicHierarchyDisplayString(params.data.topicReference); }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + kommonitorDataExchangeService.getTopicHierarchyDisplayString(params.data.topicReference); + //LOI + if (this.dataGridOptions_georesources_loi && this.dataGridOptions_georesources_loi.api) { + let selectedLoiNodes = this.dataGridOptions_georesources_loi.api.getSelectedNodes(); + for (const selectedLoiNode of selectedLoiNodes) { + georesourceMetadataArray.push(selectedLoiNode.data); + } } - }, - { headerName: 'Datenquelle', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.datasource; }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + params.data.metadata.datasource; + //AOI + if (this.dataGridOptions_georesources_aoi && this.dataGridOptions_georesources_aoi.api) { + let selectedAoiNodes = this.dataGridOptions_georesources_aoi.api.getSelectedNodes(); + for (const selectedAoiNode of selectedAoiNodes) { + georesourceMetadataArray.push(selectedAoiNode.data); + } } - }, - { headerName: 'Datenhalter und Kontakt', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.contact; }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + params.data.metadata.contact; + return georesourceMetadataArray; + }; + this.buildDataGridRowData_spatialUnits = function (spatialUnitMetadataArray) { + return spatialUnitMetadataArray; + }; + this.buildDataGridColumnConfig_spatialUnits = function (spatialUnitMetadataArray) { + const columnDefs = [ + { headerName: 'Editierfunktionen', pinned: 'left', maxWidth: 150, checkboxSelection: false, headerCheckboxSelection: false, + headerCheckboxSelectionFilteredOnly: true, filter: false, sortable: false, cellRenderer: 'displayEditButtons_spatialUnits' }, + { headerName: 'Id', field: "spatialUnitId", pinned: 'left', maxWidth: 125 }, + { headerName: 'Name', field: "spatialUnitLevel", pinned: 'left', minWidth: 300 }, + { headerName: 'Beschreibung', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.description; }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + params.data.metadata.description; + } + }, + { headerName: 'Nächst niedrigere Raumebene', field: "nextLowerHierarchyLevel", minWidth: 250 }, + { headerName: 'Nächst höhere Raumebene', field: "nextUpperHierarchyLevel", minWidth: 250 }, + { + headerName: 'Gültigkeitszeitraum', minWidth: 400, + cellRenderer: function (params) { + /* +
          +
        • +

          {{::periodOfValidity.startDate}} - {{::periodOfValidity.endDate}}

          +

          {{::periodOfValidity.startDate}} - heute

          +
        • +
        + */ + let html = '
          '; + for (const periodOfValidity of params.data.availablePeriodsOfValidity) { + html += '
        • '; + if (periodOfValidity.endDate) { + html += "

          " + periodOfValidity.startDate + " ‐ " + periodOfValidity.endDate + "

          "; + } + else { + html += "

          " + periodOfValidity.startDate + " ‐ heute

          "; + } + html += '
        • '; + } + html += '
        '; + return html; + }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + if (params.data.availablePeriodsOfValidity && params.data.availablePeriodsOfValidity.length > 1) { + return "" + JSON.stringify(params.data.availablePeriodsOfValidity); + } + return params.data.availablePeriodsOfValidity; + } + }, + { headerName: 'Datenquelle', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.datasource; }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + params.data.metadata.datasource; + } + }, + { headerName: 'Datenhalter und Kontakt', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.contact; }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + params.data.metadata.contact; + } + }, + { headerName: 'Rollen', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); + } + } + ]; + return columnDefs; + }; + this.getSelectedSpatialUnitsMetadata = function () { + let spatialUnitsMetadataArray = []; + if (this.dataGridOptions_spatialUnits && this.dataGridOptions_spatialUnits.api) { + let selectedNodes = this.dataGridOptions_spatialUnits.api.getSelectedNodes(); + for (const selectedNode of selectedNodes) { + spatialUnitsMetadataArray.push(selectedNode.data); + } } - }, - { headerName: 'Rollen', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); - } - } - ]; - - return columnDefs; - }; - - this.buildDataGridColumnConfig_georesources_loi = function (georesourceMetadataArray) { - const columnDefs = [ - { headerName: 'Editierfunktionen', pinned: 'left', maxWidth: 150, checkboxSelection: false, headerCheckboxSelection: false, - headerCheckboxSelectionFilteredOnly: true, filter: false, sortable: false, cellRenderer: 'displayEditButtons_georesources' }, - { headerName: 'Id', field: "georesourceId", pinned: 'left', maxWidth: 125 }, - { headerName: 'Name', field: "datasetName", pinned: 'left', minWidth: 300 }, - { headerName: 'Linienfarbe', filter: false, sortable: false, maxWidth: 125, cellRenderer: function (params) { return "
        " + params.data.loiColor+ "

        "; } }, - { headerName: 'Linienbreite', maxWidth: 125, field: "loiWidth"}, - { headerName: 'Linienmuster', filter: false, sortable: false, maxWidth: 125, cellRenderer: function (params) { return "
        " + kommonitorDataExchangeService.getLoiDashSvgFromStringValue(params.data.loiDashArrayString) + "
        "; } }, - { headerName: 'Beschreibung', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.description; }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + params.data.metadata.description; + return spatialUnitsMetadataArray; + }; + this.getSelectedAccessControlMetadata = function () { + let accessControlMetadataArray = []; + if (this.dataGridOptions_accessControl && this.dataGridOptions_accessControl.api) { + let selectedNodes = this.dataGridOptions_accessControl.api.getSelectedNodes(); + for (const selectedNode of selectedNodes) { + accessControlMetadataArray.push(selectedNode.data); + } } - }, - { - headerName: 'Gültigkeitszeitraum', minWidth: 400, - cellRenderer: function (params) { - /* -
          -
        • -

          {{::periodOfValidity.startDate}} - {{::periodOfValidity.endDate}}

          -

          {{::periodOfValidity.startDate}} - heute

          -
        • -
        - */ - let html = '
          '; - for (const periodOfValidity of params.data.availablePeriodsOfValidity) { - html += '
        • '; - - if(periodOfValidity.endDate){ - html += "

          " + periodOfValidity.startDate + " ‐ " + periodOfValidity.endDate + "

          " ; + return accessControlMetadataArray; + }; + this.getSelectedScriptsMetadata = function () { + let scriptsMetadataArray = []; + if (this.dataGridOptions_scripts && this.dataGridOptions_scripts.api) { + let selectedNodes = this.dataGridOptions_scripts.api.getSelectedNodes(); + for (const selectedNode of selectedNodes) { + scriptsMetadataArray.push(selectedNode.data); } - else{ - html += "

          " + periodOfValidity.startDate + " ‐ heute

          "; - } - html += '
        • '; - } - html += '
        '; - return html; - }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - if (params.data.availablePeriodsOfValidity && params.data.availablePeriodsOfValidity.length > 1){ - return "" + JSON.stringify(params.data.availablePeriodsOfValidity); - } - return params.data.availablePeriodsOfValidity; } - }, - { headerName: 'Themenhierarchie', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getTopicHierarchyDisplayString(params.data.topicReference); }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + kommonitorDataExchangeService.getTopicHierarchyDisplayString(params.data.topicReference); + return scriptsMetadataArray; + }; + this.buildDataGridOptions_indicators = function (indicatorMetadataArray) { + let columnDefs = this.buildDataGridColumnConfig_indicators(indicatorMetadataArray); + let rowData = this.buildDataGridRowData_indicators(indicatorMetadataArray); + let gridOptions = { + defaultColDef: { + editable: false, + sortable: true, + flex: 1, + minWidth: 200, + filter: true, + floatingFilter: true, + // filterParams: { + // newRowsAction: 'keep' + // }, + resizable: true, + wrapText: true, + autoHeight: true, + cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, + headerComponentParams: { + template: '', + }, + }, + components: { + displayEditButtons_indicators: displayEditButtons_indicators + }, + columnDefs: columnDefs, + rowData: rowData, + enableCellTextSelection: true, + ensureDomOrder: true, + pagination: true, + paginationPageSize: 10, + suppressColumnVirtualisation: true, + // rowHeight: 200, + onGridReady: function () { + // self.registerClickHandler_indicators(indicatorMetadataArray); + }, + onFirstDataRendered: function () { + headerHeightSetter(self.dataGridOptions_indicators); + // self.registerClickHandler_indicators(indicatorMetadataArray); + }, + onColumnResized: function () { + headerHeightSetter(self.dataGridOptions_indicators); + // self.registerClickHandler_indicators(indicatorMetadataArray); + }, + onModelUpdated: function () { + self.registerClickHandler_indicators(indicatorMetadataArray); + }, + onRowDataChanged: function () { + self.registerClickHandler_indicators(indicatorMetadataArray); + }, + // onPaginationChanged: function () { + // self.registerClickHandler_indicators(indicatorMetadataArray); + // }, + onViewportChanged: function () { + self.registerClickHandler_indicators(indicatorMetadataArray); + setTimeout(function () { + let domNode = document.querySelector('#indicatorOverviewTable'); + // if (domNode) { + // MathJax.typesetPromise(); + // } + MathJax.typesetPromise().then(function () { + // setTimeout(function () { + // self.dataGridOptions_indicators.api.resetRowHeights(); + // }, 1000); + // self.dataGridOptions_indicators.api.resetRowHeights(); + }); + // setTimeout(function () { + // self.dataGridOptions_indicators.api.resetRowHeights(); + // }, 1000); + }, 250); + }, + }; + return gridOptions; + }; + this.registerClickHandler_indicators = function (indicatorMetadataArray) { + // for (const indicatorMetadata of indicatorMetadataArray) { + // $( "#btn_indicator_editMetadata_" + indicatorMetadata.indicatorId).click(function() { + // let indicatorId = this.id.split("_")[3]; + // let indicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(indicatorId); + // $rootScope.$broadcast("onEditIndicatorMetadata", indicatorMetadata); + // }); + // } + //first unbind previous click events + $(".indicatorEditMetadataBtn").off(); + $(".indicatorEditMetadataBtn").on("click", function (event) { + // ensure that only the target button gets clicked + // manually open modal + event.stopPropagation(); + let modalId = document.getElementById(this.id).getAttribute("data-target"); + $(modalId).modal('show'); + let indicatorId = this.id.split("_")[3]; + let indicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(indicatorId); + $rootScope.$broadcast("onEditIndicatorMetadata", indicatorMetadata); + }); + //first unbind previous click events + $(".indicatorEditFeaturesBtn").off(); + $(".indicatorEditFeaturesBtn").on("click", function (event) { + // ensure that only the target button gets clicked + // manually open modal + event.stopPropagation(); + let modalId = document.getElementById(this.id).getAttribute("data-target"); + $(modalId).modal('show'); + let indicatorId = this.id.split("_")[3]; + let indicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(indicatorId); + $rootScope.$broadcast("onEditIndicatorFeatures", indicatorMetadata); + }); + $(".indicatorEditRoleBasedAccessBtn").off(); + $(".indicatorEditRoleBasedAccessBtn").on("click", function (event) { + // ensure that only the target button gets clicked + // manually open modal + event.stopPropagation(); + let modalId = document.getElementById(this.id).getAttribute("data-target"); + $(modalId).modal('show'); + let indicatorId = this.id.split("_")[3]; + let indicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(indicatorId); + $rootScope.$broadcast("onEditIndicatorSpatialUnitRoles", indicatorMetadata); + }); + }; + this.registerClickHandler_georesources = function (georesourceMetadataArray) { + $(".georesourceEditMetadataBtn").off(); + $(".georesourceEditMetadataBtn").on("click", function (event) { + // ensure that only the target button gets clicked + // manually open modal + event.stopPropagation(); + let modalId = document.getElementById(this.id).getAttribute("data-target"); + $(modalId).modal('show'); + let georesourceId = this.id.split("_")[3]; + let georesourceMetadata = kommonitorDataExchangeService.getGeoresourceMetadataById(georesourceId); + $rootScope.$broadcast("onEditGeoresourceMetadata", georesourceMetadata); + }); + $(".georesourceEditFeaturesBtn").off(); + $(".georesourceEditFeaturesBtn").on("click", function (event) { + // ensure that only the target button gets clicked + // manually open modal + event.stopPropagation(); + let modalId = document.getElementById(this.id).getAttribute("data-target"); + $(modalId).modal('show'); + let georesourceId = this.id.split("_")[3]; + let georesourceMetadata = kommonitorDataExchangeService.getGeoresourceMetadataById(georesourceId); + $rootScope.$broadcast("onEditGeoresourceFeatures", georesourceMetadata); + }); + $(".georesourceDeleteBtn").off(); + $(".georesourceDeleteBtn").on("click", function (event) { + // ensure that only the target button gets clicked + // manually open modal + event.stopPropagation(); + let modalId = document.getElementById(this.id).getAttribute("data-target"); + $(modalId).modal('show'); + let spatialUnitId = this.id.split("_")[3]; + let spatialUnitMetadata = kommonitorDataExchangeService.getGeoresourceMetadataById(spatialUnitId); + $rootScope.$broadcast("onDeleteGeoresources", [spatialUnitMetadata]); //handler function takes an array + }); + }; + this.buildDataGrid_indicators = function (indicatorMetadataArray) { + if (this.dataGridOptions_indicators && this.dataGridOptions_indicators.api && document.querySelector('#indicatorOverviewTable').childElementCount > 0) { + this.saveGridStore(this.dataGridOptions_indicators); + let newRowData = this.buildDataGridRowData_indicators(indicatorMetadataArray); + this.dataGridOptions_indicators.api.setRowData(newRowData); + this.restoreGridStore(this.dataGridOptions_indicators); } - }, - { headerName: 'Datenquelle', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.datasource; }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + params.data.metadata.datasource; + else { + this.dataGridOptions_indicators = this.buildDataGridOptions_indicators(indicatorMetadataArray); + let gridDiv = document.querySelector('#indicatorOverviewTable'); + new agGrid.Grid(gridDiv, this.dataGridOptions_indicators); } - }, - { headerName: 'Datenhalter und Kontakt', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.contact; }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + params.data.metadata.contact; + }; + this.buildDataGridOptions_georesources_poi = function (georesourceMetadataArray) { + let columnDefs = this.buildDataGridColumnConfig_georesources_poi(georesourceMetadataArray); + let rowData = this.buildDataGridRowData_georesources_poi(georesourceMetadataArray); + let gridOptions = { + defaultColDef: { + editable: false, + sortable: true, + flex: 1, + minWidth: 200, + filter: true, + floatingFilter: true, + // filterParams: { + // newRowsAction: 'keep' + // }, + resizable: true, + wrapText: true, + autoHeight: true, + cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, + headerComponentParams: { + template: '', + }, + }, + components: { + displayEditButtons_georesources: displayEditButtons_georesources + }, + columnDefs: columnDefs, + rowData: rowData, + suppressRowClickSelection: true, + rowSelection: 'multiple', + enableCellTextSelection: true, + ensureDomOrder: true, + pagination: true, + paginationPageSize: 10, + suppressColumnVirtualisation: true, + onFirstDataRendered: function () { + headerHeightSetter(self.dataGridOptions_georesources_poi); + }, + onColumnResized: function () { + headerHeightSetter(self.dataGridOptions_georesources_poi); + }, + onRowDataChanged: function () { + self.registerClickHandler_georesources(georesourceMetadataArray); + }, + onModelUpdated: function () { + self.registerClickHandler_georesources(georesourceMetadataArray); + }, + onViewportChanged: function () { + self.registerClickHandler_georesources(georesourceMetadataArray); + }, + }; + return gridOptions; + }; + this.buildDataGridOptions_georesources_loi = function (georesourceMetadataArray) { + let columnDefs = this.buildDataGridColumnConfig_georesources_loi(georesourceMetadataArray); + let rowData = this.buildDataGridRowData_georesources_loi(georesourceMetadataArray); + let gridOptions = { + defaultColDef: { + editable: false, + sortable: true, + flex: 1, + minWidth: 200, + filter: true, + floatingFilter: true, + // filterParams: { + // newRowsAction: 'keep' + // }, + resizable: true, + wrapText: true, + autoHeight: true, + cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, + headerComponentParams: { + template: '', + }, + }, + components: { + displayEditButtons_georesources: displayEditButtons_georesources + }, + columnDefs: columnDefs, + rowData: rowData, + suppressRowClickSelection: true, + rowSelection: 'multiple', + enableCellTextSelection: true, + ensureDomOrder: true, + pagination: true, + paginationPageSize: 10, + suppressColumnVirtualisation: true, + onFirstDataRendered: function () { + headerHeightSetter(self.dataGridOptions_georesources_loi); + }, + onColumnResized: function () { + headerHeightSetter(self.dataGridOptions_georesources_loi); + }, + onRowDataChanged: function () { + self.registerClickHandler_georesources(georesourceMetadataArray); + }, + onModelUpdated: function () { + self.registerClickHandler_georesources(georesourceMetadataArray); + }, + onViewportChanged: function () { + self.registerClickHandler_georesources(georesourceMetadataArray); + }, + }; + return gridOptions; + }; + this.buildDataGridOptions_georesources_aoi = function (georesourceMetadataArray) { + let columnDefs = this.buildDataGridColumnConfig_georesources_aoi(georesourceMetadataArray); + let rowData = this.buildDataGridRowData_georesources_aoi(georesourceMetadataArray); + let gridOptions = { + defaultColDef: { + editable: false, + sortable: true, + flex: 1, + minWidth: 200, + filter: true, + floatingFilter: true, + // filterParams: { + // newRowsAction: 'keep' + // }, + resizable: true, + wrapText: true, + autoHeight: true, + cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, + headerComponentParams: { + template: '', + }, + }, + components: { + displayEditButtons_georesources: displayEditButtons_georesources + }, + columnDefs: columnDefs, + rowData: rowData, + suppressRowClickSelection: true, + rowSelection: 'multiple', + enableCellTextSelection: true, + ensureDomOrder: true, + pagination: true, + paginationPageSize: 10, + suppressColumnVirtualisation: true, + onFirstDataRendered: function () { + headerHeightSetter(self.dataGridOptions_georesources_aoi); + }, + onColumnResized: function () { + headerHeightSetter(self.dataGridOptions_georesources_aoi); + }, + onRowDataChanged: function () { + self.registerClickHandler_georesources(georesourceMetadataArray); + }, + onModelUpdated: function () { + self.registerClickHandler_georesources(georesourceMetadataArray); + }, + onViewportChanged: function () { + self.registerClickHandler_georesources(georesourceMetadataArray); + }, + }; + return gridOptions; + }; + this.buildDataGridOptions_spatialUnits = function (spatialUnitMetadataArray) { + let columnDefs = this.buildDataGridColumnConfig_spatialUnits(spatialUnitMetadataArray); + let rowData = this.buildDataGridRowData_spatialUnits(spatialUnitMetadataArray); + let gridOptions = { + defaultColDef: { + editable: false, + sortable: true, + flex: 1, + minWidth: 200, + filter: true, + floatingFilter: true, + // filterParams: { + // newRowsAction: 'keep' + // }, + resizable: true, + wrapText: true, + autoHeight: true, + cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, + headerComponentParams: { + template: '', + }, + }, + components: { + displayEditButtons_spatialUnits: displayEditButtons_spatialUnits + }, + columnDefs: columnDefs, + rowData: rowData, + suppressRowClickSelection: true, + rowSelection: 'multiple', + enableCellTextSelection: true, + ensureDomOrder: true, + pagination: true, + paginationPageSize: 10, + suppressColumnVirtualisation: true, + onFirstDataRendered: function () { + headerHeightSetter(self.dataGridOptions_spatialUnits); + }, + onColumnResized: function () { + headerHeightSetter(self.dataGridOptions_spatialUnits); + }, + onRowDataChanged: function () { + self.registerClickHandler_spatialUnits(spatialUnitMetadataArray); + }, + onModelUpdated: function () { + self.registerClickHandler_spatialUnits(spatialUnitMetadataArray); + }, + onViewportChanged: function () { + self.registerClickHandler_spatialUnits(spatialUnitMetadataArray); + }, + }; + return gridOptions; + }; + this.registerClickHandler_spatialUnits = function (spatialUnitMetadataArray) { + $(".spatialUnitEditMetadataBtn").off(); + $(".spatialUnitEditMetadataBtn").on("click", function (event) { + // ensure that only the target button gets clicked + // manually open modal + event.stopPropagation(); + let modalId = document.getElementById(this.id).getAttribute("data-target"); + $(modalId).modal('show'); + let spatialUnitId = this.id.split("_")[3]; + let spatialUnitMetadata = kommonitorDataExchangeService.getSpatialUnitMetadataById(spatialUnitId); + $rootScope.$broadcast("onEditSpatialUnitMetadata", spatialUnitMetadata); + }); + $(".spatialUnitEditFeaturesBtn").off(); + $(".spatialUnitEditFeaturesBtn").on("click", function (event) { + // ensure that only the target button gets clicked + // manually open modal + event.stopPropagation(); + let modalId = document.getElementById(this.id).getAttribute("data-target"); + $(modalId).modal('show'); + let spatialUnitId = this.id.split("_")[3]; + let spatialUnitMetadata = kommonitorDataExchangeService.getSpatialUnitMetadataById(spatialUnitId); + $rootScope.$broadcast("onEditSpatialUnitFeatures", spatialUnitMetadata); + }); + $(".spatialUnitDeleteBtn").off(); + $(".spatialUnitDeleteBtn").on("click", function (event) { + // ensure that only the target button gets clicked + // manually open modal + event.stopPropagation(); + let modalId = document.getElementById(this.id).getAttribute("data-target"); + $(modalId).modal('show'); + let spatialUnitId = this.id.split("_")[3]; + let spatialUnitMetadata = kommonitorDataExchangeService.getSpatialUnitMetadataById(spatialUnitId); + $rootScope.$broadcast("onDeleteSpatialUnits", [spatialUnitMetadata]); //handler function takes an array + }); + }; + this.buildDataGrid_georesources = function (georesourceMetadataArray) { + // POI + if (this.dataGridOptions_georesources_poi && this.dataGridOptions_georesources_poi.api && document.querySelector('#poiOverviewTable').childElementCount > 0) { + this.saveGridStore(this.dataGridOptions_georesources_poi); + let newRowData = this.buildDataGridRowData_georesources_poi(georesourceMetadataArray); + this.dataGridOptions_georesources_poi.api.setRowData(newRowData); + this.restoreGridStore(this.dataGridOptions_georesources_poi); } - }, - { headerName: 'Rollen', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); - } - } - ]; - - return columnDefs; - }; - - this.buildDataGridColumnConfig_georesources_aoi = function (georesourceMetadataArray) { - const columnDefs = [ - { headerName: 'Editierfunktionen', pinned: 'left', maxWidth: 150, checkboxSelection: false, headerCheckboxSelection: false, - headerCheckboxSelectionFilteredOnly: true, filter: false, sortable: false, cellRenderer: 'displayEditButtons_georesources' }, - { headerName: 'Id', field: "georesourceId", pinned: 'left', maxWidth: 125 }, - { headerName: 'Name', field: "datasetName", pinned: 'left', minWidth: 300 }, - { headerName: 'Polygonfarbe', filter: false, sortable: false, maxWidth: 125, cellRenderer: function (params) { return "
        " + params.data.aoiColor+ "

        "; } }, - { headerName: 'Beschreibung', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.description; }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + params.data.metadata.description; + else { + this.dataGridOptions_georesources_poi = this.buildDataGridOptions_georesources_poi(georesourceMetadataArray); + let gridDiv = document.querySelector('#poiOverviewTable'); + new agGrid.Grid(gridDiv, this.dataGridOptions_georesources_poi); } - }, - { - headerName: 'Gültigkeitszeitraum', minWidth: 400, - cellRenderer: function (params) { - /* -
          -
        • -

          {{::periodOfValidity.startDate}} - {{::periodOfValidity.endDate}}

          -

          {{::periodOfValidity.startDate}} - heute

          -
        • -
        - */ - let html = '
          '; - for (const periodOfValidity of params.data.availablePeriodsOfValidity) { - html += '
        • '; - - if(periodOfValidity.endDate){ - html += "

          " + periodOfValidity.startDate + " ‐ " + periodOfValidity.endDate + "

          " ; - } - else{ - html += "

          " + periodOfValidity.startDate + " ‐ heute

          "; - } - html += '
        • '; - } - html += '
        '; - return html; - }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - if (params.data.availablePeriodsOfValidity && params.data.availablePeriodsOfValidity.length > 1){ - return "" + JSON.stringify(params.data.availablePeriodsOfValidity); - } - return params.data.availablePeriodsOfValidity; + // LOI + if (this.dataGridOptions_georesources_loi && this.dataGridOptions_georesources_loi.api && document.querySelector('#loiOverviewTable').childElementCount > 0) { + this.saveGridStore(this.dataGridOptions_georesources_loi); + let newRowData = this.buildDataGridRowData_georesources_loi(georesourceMetadataArray); + this.dataGridOptions_georesources_loi.api.setRowData(newRowData); + this.restoreGridStore(this.dataGridOptions_georesources_loi); } - }, - { headerName: 'Themenhierarchie', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getTopicHierarchyDisplayString(params.data.topicReference); }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + kommonitorDataExchangeService.getTopicHierarchyDisplayString(params.data.topicReference); + else { + this.dataGridOptions_georesources_loi = this.buildDataGridOptions_georesources_loi(georesourceMetadataArray); + let gridDiv = document.querySelector('#loiOverviewTable'); + new agGrid.Grid(gridDiv, this.dataGridOptions_georesources_loi); } - }, - { headerName: 'Datenquelle', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.datasource; }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + params.data.metadata.datasource; + // AOI + if (this.dataGridOptions_georesources_aoi && this.dataGridOptions_georesources_aoi.api && document.querySelector('#aoiOverviewTable').childElementCount > 0) { + this.saveGridStore(this.dataGridOptions_georesources_aoi); + let newRowData = this.buildDataGridRowData_georesources_aoi(georesourceMetadataArray); + this.dataGridOptions_georesources_aoi.api.setRowData(newRowData); + this.restoreGridStore(this.dataGridOptions_georesources_aoi); } - }, - { headerName: 'Datenhalter und Kontakt', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.contact; }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + params.data.metadata.contact; + else { + this.dataGridOptions_georesources_aoi = this.buildDataGridOptions_georesources_aoi(georesourceMetadataArray); + let gridDiv = document.querySelector('#aoiOverviewTable'); + new agGrid.Grid(gridDiv, this.dataGridOptions_georesources_aoi); } - }, - { headerName: 'Rollen', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); - } - } - ]; - - return columnDefs; - }; - - this.buildDataGridRowData_georesources_poi = function (georesourceMetadataArray) { - return georesourceMetadataArray.filter(georesourceMetadata => georesourceMetadata.isPOI); - }; - - this.buildDataGridRowData_georesources_loi = function (georesourceMetadataArray) { - return georesourceMetadataArray.filter(georesourceMetadata => georesourceMetadata.isLOI); - }; - - this.buildDataGridRowData_georesources_aoi = function (georesourceMetadataArray) { - return georesourceMetadataArray.filter(georesourceMetadata => georesourceMetadata.isAOI); - }; - - this.getSelectedGeoresourcesMetadata = function(){ - let georesourceMetadataArray = []; - - //POI - if (this.dataGridOptions_georesources_poi && this.dataGridOptions_georesources_poi.api){ - let selectedPoiNodes = this.dataGridOptions_georesources_poi.api.getSelectedNodes(); - - for (const selectedPoiNode of selectedPoiNodes) { - georesourceMetadataArray.push(selectedPoiNode.data); - } - } - - //LOI - if (this.dataGridOptions_georesources_loi && this.dataGridOptions_georesources_loi.api){ - let selectedLoiNodes = this.dataGridOptions_georesources_loi.api.getSelectedNodes(); - - for (const selectedLoiNode of selectedLoiNodes) { - georesourceMetadataArray.push(selectedLoiNode.data); - } - } - - //AOI - if (this.dataGridOptions_georesources_aoi && this.dataGridOptions_georesources_aoi.api){ - let selectedAoiNodes = this.dataGridOptions_georesources_aoi.api.getSelectedNodes(); - - for (const selectedAoiNode of selectedAoiNodes) { - georesourceMetadataArray.push(selectedAoiNode.data); - } - } - - return georesourceMetadataArray; - }; - - this.buildDataGridRowData_spatialUnits = function (spatialUnitMetadataArray) { - return spatialUnitMetadataArray; - }; - - this.buildDataGridColumnConfig_spatialUnits = function (spatialUnitMetadataArray) { - const columnDefs = [ - { headerName: 'Editierfunktionen', pinned: 'left', maxWidth: 150, checkboxSelection: false, headerCheckboxSelection: false, - headerCheckboxSelectionFilteredOnly: true, filter: false, sortable: false, cellRenderer: 'displayEditButtons_spatialUnits' }, - { headerName: 'Id', field: "spatialUnitId", pinned: 'left', maxWidth: 125 }, - { headerName: 'Name', field: "spatialUnitLevel", pinned: 'left', minWidth: 300 }, - { headerName: 'Beschreibung', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.description; }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + params.data.metadata.description; + }; + this.buildDataGrid_spatialUnits = function (spatialUnitMetadataArray) { + if (this.dataGridOptions_spatialUnits && this.dataGridOptions_spatialUnits.api && document.querySelector('#spatialUnitOverviewTable').childElementCount > 0) { + this.saveGridStore(this.dataGridOptions_spatialUnits); + let newRowData = this.buildDataGridRowData_spatialUnits(spatialUnitMetadataArray); + this.dataGridOptions_spatialUnits.api.setRowData(newRowData); + this.restoreGridStore(this.dataGridOptions_spatialUnits); } - }, - { headerName: 'Nächst niedrigere Raumebene', field: "nextLowerHierarchyLevel", minWidth: 250 }, - { headerName: 'Nächst höhere Raumebene', field: "nextUpperHierarchyLevel", minWidth: 250 }, - { - headerName: 'Gültigkeitszeitraum', minWidth: 400, - cellRenderer: function (params) { - /* -
          -
        • -

          {{::periodOfValidity.startDate}} - {{::periodOfValidity.endDate}}

          -

          {{::periodOfValidity.startDate}} - heute

          -
        • -
        - */ - let html = '
          '; - for (const periodOfValidity of params.data.availablePeriodsOfValidity) { - html += '
        • '; - - if(periodOfValidity.endDate){ - html += "

          " + periodOfValidity.startDate + " ‐ " + periodOfValidity.endDate + "

          " ; - } - else{ - html += "

          " + periodOfValidity.startDate + " ‐ heute

          "; - } - html += '
        • '; - } - html += '
        '; - return html; - }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - if (params.data.availablePeriodsOfValidity && params.data.availablePeriodsOfValidity.length > 1){ - return "" + JSON.stringify(params.data.availablePeriodsOfValidity); - } - return params.data.availablePeriodsOfValidity; + else { + this.dataGridOptions_spatialUnits = this.buildDataGridOptions_spatialUnits(spatialUnitMetadataArray); + let gridDiv = document.querySelector('#spatialUnitOverviewTable'); + new agGrid.Grid(gridDiv, this.dataGridOptions_spatialUnits); } - }, - { headerName: 'Datenquelle', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.datasource; }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + params.data.metadata.datasource; + }; + // FEATURE TABLES + const isDate = (date) => { + return (new Date(date) !== "Invalid Date") && !isNaN(new Date(date)); + }; + this.buildDataGridColumnConfig_featureTable_spatialResource = function (specificHeadersArray, datasetId, resourceType, deleteButtonEnabled) { + const columnDefs = [ + { headerName: 'DB-Record-Id', field: "kommonitorRecordId", pinned: 'left', editable: false, cellClass: "grid-non-editable", maxWidth: 125, + cellRenderer: function (params) { + let html = ""; + // only show delete button, if user has the permission to delete the dataset + // if only editor rights, then user may edit cells, but shall not remove data entries + // if(params.data.userPermissions.includes("creator")){ + // if (resourceType == self.resourceType_spatialUnit){ + // html += ''; + // } + // else { + // html += ''; + // } + // } + if (resourceType == self.resourceType_spatialUnit) { + html += ''; + } + else { + html += ''; + } + html += "
        "; + html += params.data.kommonitorRecordId; + return html; + } + }, + { headerName: 'Feature-Id', field: __env.FEATURE_ID_PROPERTY_NAME, pinned: 'left', editable: false, cellClass: "grid-non-editable", maxWidth: 125 }, + { headerName: 'Name', field: __env.FEATURE_NAME_PROPERTY_NAME, pinned: 'left', minWidth: 150 }, + // { headerName: 'Geometrie', field: "kommonitorGeometry", autoHeight: false, wrapText: false, + // cellRenderer: function (params) { + // let html = JSON.stringify(params.data.kommonitorGeometry); + // return html; + // }, + // filter: 'agTextColumnFilter', + // filterValueGetter: (params) => { + // return JSON.stringify(params.data.kommonitorGeometry); + // }, + // valueGetter: params => { + // return JSON.stringify(params.data.kommonitorGeometry); + // }, + // valueSetter: params => { + // try { + // params.data.kommonitorGeometry = JSON.parse(params.newValue); + // } catch (error) { + // try { + // params.data.kommonitorGeometry = JSON.parse(params.oldValue); + // } catch (error) { + // params.data.kommonitorGeometry = params.oldValue; + // } + // } + // return true; + // }, + // minWidth: 200 + // }, + { headerName: 'Lebenszeitbeginn', field: __env.VALID_START_DATE_PROPERTY_NAME, minWidth: 150, cellEditor: getDatePicker() }, + { headerName: 'Lebenszeitende', field: __env.VALID_END_DATE_PROPERTY_NAME, cellEditor: getDatePicker(), + // cellRenderer: function (params) { + // let html = '

        '; + // if (params.data.validEndDate){ + // html += params.data.validEndDate; + // } + // else{ + // html += "uneingeschränkt gültig"; + // } + // html += "

        "; + // return html; + // }, + // filter: 'agTextColumnFilter', + // filterValueGetter: (params) => { + // if (params.data.validEndDate){ + // return "" + params.data.validEndDate; + // } + // return "uneingeschränkt gültig"; + // }, + minWidth: 150 } + ]; + for (const header of specificHeadersArray) { + columnDefs.push({ headerName: "" + header, field: "" + header, minWidth: 125 }); } - }, - { headerName: 'Datenhalter und Kontakt', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.contact; }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + params.data.metadata.contact; + return columnDefs; + }; + this.buildDataGridRowData_featureTable_spatialResource = function (dataArray) { + if (dataArray[0] && dataArray[0].properties) { + return dataArray.map(dataItem => { + // add geometry and database record ID to properties to be available within data grid object + dataItem.properties.kommonitorGeometry = dataItem.geometry; + dataItem.properties.kommonitorRecordId = dataItem.id; + return dataItem.properties; + }); } - }, - { headerName: 'Rollen', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); - } - } - ]; - - return columnDefs; - }; - - this.getSelectedSpatialUnitsMetadata = function(){ - let spatialUnitsMetadataArray = []; - - if (this.dataGridOptions_spatialUnits && this.dataGridOptions_spatialUnits.api){ - let selectedNodes = this.dataGridOptions_spatialUnits.api.getSelectedNodes(); - - for (const selectedNode of selectedNodes) { - spatialUnitsMetadataArray.push(selectedNode.data); - } - } - - return spatialUnitsMetadataArray; - }; - - this.getSelectedAccessControlMetadata = function(){ - let accessControlMetadataArray = []; - - if (this.dataGridOptions_accessControl && this.dataGridOptions_accessControl.api){ - let selectedNodes = this.dataGridOptions_accessControl.api.getSelectedNodes(); - - for (const selectedNode of selectedNodes) { - accessControlMetadataArray.push(selectedNode.data); - } - } - - return accessControlMetadataArray; - }; - - this.getSelectedScriptsMetadata = function(){ - let scriptsMetadataArray = []; - - if (this.dataGridOptions_scripts && this.dataGridOptions_scripts.api){ - let selectedNodes = this.dataGridOptions_scripts.api.getSelectedNodes(); - - for (const selectedNode of selectedNodes) { - scriptsMetadataArray.push(selectedNode.data); - } - } - - return scriptsMetadataArray; - }; - - this.buildDataGridOptions_indicators = function (indicatorMetadataArray) { - let columnDefs = this.buildDataGridColumnConfig_indicators(indicatorMetadataArray); - let rowData = this.buildDataGridRowData_indicators(indicatorMetadataArray); - - let gridOptions = { - defaultColDef: { - editable: false, - sortable: true, - flex: 1, - minWidth: 200, - filter: true, - floatingFilter: true, - // filterParams: { - // newRowsAction: 'keep' - // }, - resizable: true, - wrapText: true, - autoHeight: true, - cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, - headerComponentParams: { - template: - '', - }, - }, - components: { - displayEditButtons_indicators: displayEditButtons_indicators - }, - columnDefs: columnDefs, - rowData: rowData, - enableCellTextSelection: true, - ensureDomOrder: true, - pagination: true, - paginationPageSize: 10, - suppressColumnVirtualisation: true, - // rowHeight: 200, - onGridReady: function () { - // self.registerClickHandler_indicators(indicatorMetadataArray); - }, - onFirstDataRendered: function () { - headerHeightSetter(self.dataGridOptions_indicators); - // self.registerClickHandler_indicators(indicatorMetadataArray); - }, - onColumnResized: function () { - headerHeightSetter(self.dataGridOptions_indicators); - // self.registerClickHandler_indicators(indicatorMetadataArray); - }, - onModelUpdated: function () { - self.registerClickHandler_indicators(indicatorMetadataArray); - - }, - onRowDataChanged: function () { - self.registerClickHandler_indicators(indicatorMetadataArray); - }, - // onPaginationChanged: function () { - // self.registerClickHandler_indicators(indicatorMetadataArray); - // }, - onViewportChanged: function () { - self.registerClickHandler_indicators(indicatorMetadataArray); - setTimeout(function () { - let domNode = document.querySelector('#indicatorOverviewTable'); - // if (domNode) { - // MathJax.typesetPromise(); - // } - MathJax.typesetPromise().then(function (){ - // setTimeout(function () { - // self.dataGridOptions_indicators.api.resetRowHeights(); - // }, 1000); - // self.dataGridOptions_indicators.api.resetRowHeights(); - }); - - // setTimeout(function () { - // self.dataGridOptions_indicators.api.resetRowHeights(); - // }, 1000); - }, 250); - }, - - }; - - return gridOptions; - }; - - this.registerClickHandler_indicators = function (indicatorMetadataArray) { - - // for (const indicatorMetadata of indicatorMetadataArray) { - // $( "#btn_indicator_editMetadata_" + indicatorMetadata.indicatorId).click(function() { - // let indicatorId = this.id.split("_")[3]; - - // let indicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(indicatorId); - - // $rootScope.$broadcast("onEditIndicatorMetadata", indicatorMetadata); - // }); - // } - - //first unbind previous click events - $(".indicatorEditMetadataBtn").off(); - $(".indicatorEditMetadataBtn").on("click", function (event) { - // ensure that only the target button gets clicked - // manually open modal - event.stopPropagation(); - let modalId = document.getElementById(this.id).getAttribute("data-target"); - $(modalId).modal('show'); - - let indicatorId = this.id.split("_")[3]; - - let indicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(indicatorId); - - $rootScope.$broadcast("onEditIndicatorMetadata", indicatorMetadata); - }); - - //first unbind previous click events - $(".indicatorEditFeaturesBtn").off(); - $(".indicatorEditFeaturesBtn").on("click", function (event) { - // ensure that only the target button gets clicked - // manually open modal - event.stopPropagation(); - let modalId = document.getElementById(this.id).getAttribute("data-target"); - $(modalId).modal('show'); - - let indicatorId = this.id.split("_")[3]; - - let indicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(indicatorId); - - $rootScope.$broadcast("onEditIndicatorFeatures", indicatorMetadata); - }); - - $(".indicatorEditRoleBasedAccessBtn").off(); - $(".indicatorEditRoleBasedAccessBtn").on("click", function (event) { - // ensure that only the target button gets clicked - // manually open modal - event.stopPropagation(); - let modalId = document.getElementById(this.id).getAttribute("data-target"); - $(modalId).modal('show'); - - let indicatorId = this.id.split("_")[3]; - - let indicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(indicatorId); - - $rootScope.$broadcast("onEditIndicatorSpatialUnitRoles", indicatorMetadata); - }); - - }; - - this.registerClickHandler_georesources = function (georesourceMetadataArray) { - - $(".georesourceEditMetadataBtn").off(); - $(".georesourceEditMetadataBtn").on("click", function (event) { - // ensure that only the target button gets clicked - // manually open modal - event.stopPropagation(); - let modalId = document.getElementById(this.id).getAttribute("data-target"); - $(modalId).modal('show'); - - let georesourceId = this.id.split("_")[3]; - - let georesourceMetadata = kommonitorDataExchangeService.getGeoresourceMetadataById(georesourceId); - - $rootScope.$broadcast("onEditGeoresourceMetadata", georesourceMetadata); - }); - - $(".georesourceEditFeaturesBtn").off(); - $(".georesourceEditFeaturesBtn").on("click", function (event) { - // ensure that only the target button gets clicked - // manually open modal - event.stopPropagation(); - let modalId = document.getElementById(this.id).getAttribute("data-target"); - $(modalId).modal('show'); - - let georesourceId = this.id.split("_")[3]; - - let georesourceMetadata = kommonitorDataExchangeService.getGeoresourceMetadataById(georesourceId); - - $rootScope.$broadcast("onEditGeoresourceFeatures", georesourceMetadata); - }); - - $(".georesourceDeleteBtn").off(); - $(".georesourceDeleteBtn").on("click", function (event) { - // ensure that only the target button gets clicked - // manually open modal - event.stopPropagation(); - let modalId = document.getElementById(this.id).getAttribute("data-target"); - $(modalId).modal('show'); - - let spatialUnitId = this.id.split("_")[3]; - - let spatialUnitMetadata = kommonitorDataExchangeService.getGeoresourceMetadataById(spatialUnitId); - - $rootScope.$broadcast("onDeleteGeoresources", [spatialUnitMetadata]); //handler function takes an array - }); - - }; - - this.buildDataGrid_indicators = function (indicatorMetadataArray) { - if (this.dataGridOptions_indicators && this.dataGridOptions_indicators.api && document.querySelector('#indicatorOverviewTable').childElementCount > 0) { - - this.saveGridStore(this.dataGridOptions_indicators); - let newRowData = this.buildDataGridRowData_indicators(indicatorMetadataArray); - this.dataGridOptions_indicators.api.setRowData(newRowData); - this.restoreGridStore(this.dataGridOptions_indicators); - } - else { - this.dataGridOptions_indicators = this.buildDataGridOptions_indicators(indicatorMetadataArray); - let gridDiv = document.querySelector('#indicatorOverviewTable'); - new agGrid.Grid(gridDiv, this.dataGridOptions_indicators); - } - }; - - this.buildDataGridOptions_georesources_poi = function (georesourceMetadataArray) { - let columnDefs = this.buildDataGridColumnConfig_georesources_poi(georesourceMetadataArray); - let rowData = this.buildDataGridRowData_georesources_poi(georesourceMetadataArray); - - let gridOptions = { - defaultColDef: { - editable: false, - sortable: true, - flex: 1, - minWidth: 200, - filter: true, - floatingFilter: true, - // filterParams: { - // newRowsAction: 'keep' - // }, - resizable: true, - wrapText: true, - autoHeight: true, - cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, - headerComponentParams: { - template: - '', - }, - }, - components: { - displayEditButtons_georesources: displayEditButtons_georesources - }, - columnDefs: columnDefs, - rowData: rowData, - suppressRowClickSelection: true, - rowSelection: 'multiple', - enableCellTextSelection: true, - ensureDomOrder: true, - pagination: true, - paginationPageSize: 10, - suppressColumnVirtualisation: true, - onFirstDataRendered: function () { - headerHeightSetter(self.dataGridOptions_georesources_poi); - }, - onColumnResized: function () { - headerHeightSetter(self.dataGridOptions_georesources_poi); - }, - onRowDataChanged: function () { - self.registerClickHandler_georesources(georesourceMetadataArray); - }, - onModelUpdated: function () { - self.registerClickHandler_georesources(georesourceMetadataArray); - }, - onViewportChanged: function () { - self.registerClickHandler_georesources(georesourceMetadataArray); - }, - - }; - - return gridOptions; - }; - - this.buildDataGridOptions_georesources_loi = function (georesourceMetadataArray) { - let columnDefs = this.buildDataGridColumnConfig_georesources_loi(georesourceMetadataArray); - let rowData = this.buildDataGridRowData_georesources_loi(georesourceMetadataArray); - - let gridOptions = { - defaultColDef: { - editable: false, - sortable: true, - flex: 1, - minWidth: 200, - filter: true, - floatingFilter: true, - // filterParams: { - // newRowsAction: 'keep' - // }, - resizable: true, - wrapText: true, - autoHeight: true, - cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, - headerComponentParams: { - template: - '', - }, - }, - components: { - displayEditButtons_georesources: displayEditButtons_georesources - }, - columnDefs: columnDefs, - rowData: rowData, - suppressRowClickSelection: true, - rowSelection: 'multiple', - enableCellTextSelection: true, - ensureDomOrder: true, - pagination: true, - paginationPageSize: 10, - suppressColumnVirtualisation: true, - onFirstDataRendered: function () { - headerHeightSetter(self.dataGridOptions_georesources_loi); - }, - onColumnResized: function () { - headerHeightSetter(self.dataGridOptions_georesources_loi); - }, - onRowDataChanged: function () { - self.registerClickHandler_georesources(georesourceMetadataArray); - }, - onModelUpdated: function () { - self.registerClickHandler_georesources(georesourceMetadataArray); - }, - onViewportChanged: function () { - self.registerClickHandler_georesources(georesourceMetadataArray); - }, - - }; - - return gridOptions; - }; - - this.buildDataGridOptions_georesources_aoi = function (georesourceMetadataArray) { - let columnDefs = this.buildDataGridColumnConfig_georesources_aoi(georesourceMetadataArray); - let rowData = this.buildDataGridRowData_georesources_aoi(georesourceMetadataArray); - - let gridOptions = { - defaultColDef: { - editable: false, - sortable: true, - flex: 1, - minWidth: 200, - filter: true, - floatingFilter: true, - // filterParams: { - // newRowsAction: 'keep' - // }, - resizable: true, - wrapText: true, - autoHeight: true, - cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, - headerComponentParams: { - template: - '', - }, - }, - components: { - displayEditButtons_georesources: displayEditButtons_georesources - }, - columnDefs: columnDefs, - rowData: rowData, - suppressRowClickSelection: true, - rowSelection: 'multiple', - enableCellTextSelection: true, - ensureDomOrder: true, - pagination: true, - paginationPageSize: 10, - suppressColumnVirtualisation: true, - onFirstDataRendered: function () { - headerHeightSetter(self.dataGridOptions_georesources_aoi); - }, - onColumnResized: function () { - headerHeightSetter(self.dataGridOptions_georesources_aoi); - }, - onRowDataChanged: function () { - self.registerClickHandler_georesources(georesourceMetadataArray); - }, - onModelUpdated: function () { - self.registerClickHandler_georesources(georesourceMetadataArray); - }, - onViewportChanged: function () { - self.registerClickHandler_georesources(georesourceMetadataArray); - }, - - }; - - return gridOptions; - }; - - this.buildDataGridOptions_spatialUnits = function (spatialUnitMetadataArray) { - let columnDefs = this.buildDataGridColumnConfig_spatialUnits(spatialUnitMetadataArray); - let rowData = this.buildDataGridRowData_spatialUnits(spatialUnitMetadataArray); - - let gridOptions = { - defaultColDef: { - editable: false, - sortable: true, - flex: 1, - minWidth: 200, - filter: true, - floatingFilter: true, - // filterParams: { - // newRowsAction: 'keep' - // }, - resizable: true, - wrapText: true, - autoHeight: true, - cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, - headerComponentParams: { - template: - '', - }, - }, - components: { - displayEditButtons_spatialUnits: displayEditButtons_spatialUnits - }, - columnDefs: columnDefs, - rowData: rowData, - suppressRowClickSelection: true, - rowSelection: 'multiple', - enableCellTextSelection: true, - ensureDomOrder: true, - pagination: true, - paginationPageSize: 10, - suppressColumnVirtualisation: true, - onFirstDataRendered: function () { - headerHeightSetter(self.dataGridOptions_spatialUnits); - }, - onColumnResized: function () { - headerHeightSetter(self.dataGridOptions_spatialUnits); - }, - onRowDataChanged: function () { - self.registerClickHandler_spatialUnits(spatialUnitMetadataArray); - }, - onModelUpdated: function () { - self.registerClickHandler_spatialUnits(spatialUnitMetadataArray); - - }, - onViewportChanged: function () { - self.registerClickHandler_spatialUnits(spatialUnitMetadataArray); - }, - - }; - - return gridOptions; - }; - - this.registerClickHandler_spatialUnits = function (spatialUnitMetadataArray) { - - $(".spatialUnitEditMetadataBtn").off(); - $(".spatialUnitEditMetadataBtn").on("click", function (event) { - // ensure that only the target button gets clicked - // manually open modal - event.stopPropagation(); - let modalId = document.getElementById(this.id).getAttribute("data-target"); - $(modalId).modal('show'); - - let spatialUnitId = this.id.split("_")[3]; - - let spatialUnitMetadata = kommonitorDataExchangeService.getSpatialUnitMetadataById(spatialUnitId); - - $rootScope.$broadcast("onEditSpatialUnitMetadata", spatialUnitMetadata); - }); - - $(".spatialUnitEditFeaturesBtn").off(); - $(".spatialUnitEditFeaturesBtn").on("click", function (event) { - // ensure that only the target button gets clicked - // manually open modal - event.stopPropagation(); - let modalId = document.getElementById(this.id).getAttribute("data-target"); - $(modalId).modal('show'); - - let spatialUnitId = this.id.split("_")[3]; - - let spatialUnitMetadata = kommonitorDataExchangeService.getSpatialUnitMetadataById(spatialUnitId); - - $rootScope.$broadcast("onEditSpatialUnitFeatures", spatialUnitMetadata); - }); - - $(".spatialUnitDeleteBtn").off(); - $(".spatialUnitDeleteBtn").on("click", function (event) { - // ensure that only the target button gets clicked - // manually open modal - event.stopPropagation(); - let modalId = document.getElementById(this.id).getAttribute("data-target"); - $(modalId).modal('show'); - - let spatialUnitId = this.id.split("_")[3]; - - let spatialUnitMetadata = kommonitorDataExchangeService.getSpatialUnitMetadataById(spatialUnitId); - - $rootScope.$broadcast("onDeleteSpatialUnits", [spatialUnitMetadata]); //handler function takes an array - }); - - }; - - this.buildDataGrid_georesources = function (georesourceMetadataArray) { - // POI - if (this.dataGridOptions_georesources_poi && this.dataGridOptions_georesources_poi.api && document.querySelector('#poiOverviewTable').childElementCount > 0) { - - this.saveGridStore(this.dataGridOptions_georesources_poi); - let newRowData = this.buildDataGridRowData_georesources_poi(georesourceMetadataArray); - this.dataGridOptions_georesources_poi.api.setRowData(newRowData); - this.restoreGridStore(this.dataGridOptions_georesources_poi); - } - else { - this.dataGridOptions_georesources_poi = this.buildDataGridOptions_georesources_poi(georesourceMetadataArray); - let gridDiv = document.querySelector('#poiOverviewTable'); - new agGrid.Grid(gridDiv, this.dataGridOptions_georesources_poi); - } - - // LOI - if (this.dataGridOptions_georesources_loi && this.dataGridOptions_georesources_loi.api && document.querySelector('#loiOverviewTable').childElementCount > 0) { - - this.saveGridStore(this.dataGridOptions_georesources_loi); - let newRowData = this.buildDataGridRowData_georesources_loi(georesourceMetadataArray); - this.dataGridOptions_georesources_loi.api.setRowData(newRowData); - this.restoreGridStore(this.dataGridOptions_georesources_loi); - } - else { - this.dataGridOptions_georesources_loi = this.buildDataGridOptions_georesources_loi(georesourceMetadataArray); - let gridDiv = document.querySelector('#loiOverviewTable'); - new agGrid.Grid(gridDiv, this.dataGridOptions_georesources_loi); - } - - // AOI - if (this.dataGridOptions_georesources_aoi && this.dataGridOptions_georesources_aoi.api && document.querySelector('#aoiOverviewTable').childElementCount > 0) { - - this.saveGridStore(this.dataGridOptions_georesources_aoi); - let newRowData = this.buildDataGridRowData_georesources_aoi(georesourceMetadataArray); - this.dataGridOptions_georesources_aoi.api.setRowData(newRowData); - this.restoreGridStore(this.dataGridOptions_georesources_aoi); - } - else { - this.dataGridOptions_georesources_aoi = this.buildDataGridOptions_georesources_aoi(georesourceMetadataArray); - let gridDiv = document.querySelector('#aoiOverviewTable'); - new agGrid.Grid(gridDiv, this.dataGridOptions_georesources_aoi); - } - }; - - this.buildDataGrid_spatialUnits = function (spatialUnitMetadataArray) { - - if (this.dataGridOptions_spatialUnits && this.dataGridOptions_spatialUnits.api && document.querySelector('#spatialUnitOverviewTable').childElementCount > 0) { - - this.saveGridStore(this.dataGridOptions_spatialUnits); - let newRowData = this.buildDataGridRowData_spatialUnits(spatialUnitMetadataArray); - this.dataGridOptions_spatialUnits.api.setRowData(newRowData); - this.restoreGridStore(this.dataGridOptions_spatialUnits); - } - else { - this.dataGridOptions_spatialUnits = this.buildDataGridOptions_spatialUnits(spatialUnitMetadataArray); - let gridDiv = document.querySelector('#spatialUnitOverviewTable'); - new agGrid.Grid(gridDiv, this.dataGridOptions_spatialUnits); - } - }; - - // FEATURE TABLES - - const isDate = (date) => { - return (new Date(date) !== "Invalid Date") && !isNaN(new Date(date)); - } - - this.buildDataGridColumnConfig_featureTable_spatialResource = function(specificHeadersArray, datasetId, resourceType, deleteButtonEnabled){ - const columnDefs = [ - { headerName: 'DB-Record-Id', field: "kommonitorRecordId", pinned: 'left', editable: false, cellClass: "grid-non-editable", maxWidth: 125, - cellRenderer: function (params) { - let html = ""; - - // only show delete button, if user has the permission to delete the dataset - // if only editor rights, then user may edit cells, but shall not remove data entries - // if(params.data.userPermissions.includes("creator")){ - // if (resourceType == self.resourceType_spatialUnit){ - // html += ''; - // } - // else { - // html += ''; + return dataArray; + }; + this.buildDataGridOptions_featureTable_spatialResource = function (specificHeadersArray, dataArray, datasetId, resourceType, deleteButtonEnabled) { + let columnDefs = this.buildDataGridColumnConfig_featureTable_spatialResource(specificHeadersArray, datasetId, resourceType, deleteButtonEnabled); + let rowData = this.buildDataGridRowData_featureTable_spatialResource(dataArray); + let gridOptions = { + defaultColDef: { + editable: true, + // enables the fill handle + enableFillHandle: false, + cellEditor: 'agLargeTextCellEditor', + onCellValueChanged: function (newValueParams) { + /* https://www.ag-grid.com/javascript-data-grid/cell-editing/ + interface NewValueParams { + // The value before the change + oldValue: any; + // The value after the change + newValue: any; + // Row node for the given row + node: RowNode | null; + // Data associated with the node + data: any; + // Column for this callback + column: Column; + // ColDef provided for this column + colDef: ColDef; + api: GridApi; + columnApi: ColumnApi; + // The context as provided on `gridOptions.context` + context: any; + } + */ + // make sure that date properties are actually set + if (!newValueParams.data.validStartDate) { + newValueParams.data.validStartDate = newValueParams.oldValue; + } + if (!isDate(newValueParams.data.validStartDate)) { + newValueParams.data.validStartDate = newValueParams.oldValue; + } + if (newValueParams.data.validEndDate == "") { + newValueParams.data.validEndDate = undefined; + } + if (newValueParams.data.validEndDate) { + if (!isDate(newValueParams.data.validEndDate)) { + newValueParams.data.validEndDate = newValueParams.oldValue; + } + } + // take the modified data from newValueParams.data + // take geometry info from newValueParams.data.geometry and remove that property afterwards + // take kommonitorRecordId info from newValueParams.data.kommonitorRecordId and remove that property afterwards + // then build GeoJSON and send modification request to data Management component + let geoJSON = { + "type": "Feature", + geometry: "", + properties: "", + id: "" + }; + // clone properties + geoJSON.geometry = JSON.parse(JSON.stringify(newValueParams.data.kommonitorGeometry)); + geoJSON.id = JSON.parse(JSON.stringify(newValueParams.data.kommonitorRecordId)); + geoJSON.properties = JSON.parse(JSON.stringify(newValueParams.data)); + // now delete information + delete geoJSON.properties.kommonitorGeometry; + delete geoJSON.properties.kommonitorRecordId; + let url = __env.apiUrl + __env.basePath; + if (resourceType == self.resourceType_georesource) { + url += "/georesources/"; + } + else { + url += "/spatial-units/"; + } + url += datasetId + "/singleFeature/" + newValueParams.data[__env.FEATURE_ID_PROPERTY_NAME] + "/singleFeatureRecord/" + newValueParams.data.kommonitorRecordId; + $http({ + url: url, + method: "PUT", + data: geoJSON, + headers: { + 'Content-Type': "application/json" + } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + console.log("Successfully updated database record"); + // on success mark grid cell with green background and set update information + newValueParams.colDef.cellStyle = (p) => p.rowIndex.toString() === newValueParams.node.id ? { 'background-color': '#9DC89F' } : ""; + newValueParams.api.refreshCells({ + force: true, + columns: [newValueParams.column.getId()], + rowNodes: [newValueParams.node] + }); + if (resourceType == self.resourceType_georesource) { + self.featureTable_georesource_lastUpdate_timestamp_success = getCurrentTimestampString(); + } + else { + self.featureTable_spatialUnit_lastUpdate_timestamp_success = getCurrentTimestampString(); + } + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while updating database record. Error is:\n" + error); + // reset cell value as an error occurred + newValueParams.data[newValueParams.column.colId] = newValueParams.oldValue; + // on failure mark grid cell with red background and set update failure information + newValueParams.colDef.cellStyle = (p) => p.rowIndex.toString() === newValueParams.node.id ? { 'background-color': '#E79595' } : ""; + newValueParams.api.refreshCells({ + force: true, + columns: [newValueParams.column.getId()], + rowNodes: [newValueParams.node] + }); + if (resourceType == self.resourceType_georesource) { + self.featureTable_georesource_lastUpdate_timestamp_failure = timestamp_string; + } + else { + self.featureTable_spatialUnit_lastUpdate_timestamp_failure = timestamp_string; + } + throw error; + }); + }, + sortable: true, + flex: 1, + minWidth: 200, + filter: true, + floatingFilter: true, + // filterParams: { + // newRowsAction: 'keep' + // }, + resizable: true, + wrapText: true, + autoHeight: true, + cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, + headerComponentParams: { + template: '', + }, + }, + columnDefs: columnDefs, + rowData: rowData, + // enables undo / redo + undoRedoCellEditing: true, + // restricts the number of undo / redo steps to 10 + undoRedoCellEditingLimit: 10, + // enables flashing to help see cell changes + enableCellChangeFlash: true, + suppressRowClickSelection: true, + // rowSelection: 'multiple', + enableCellTextSelection: true, + ensureDomOrder: true, + pagination: true, + paginationPageSize: 10, + suppressColumnVirtualisation: true, + // onFirstDataRendered: function () { + // headerHeightSetter(this); + // }, + // onColumnResized: function () { + // headerHeightSetter(this); // } - - // } - - if (resourceType == self.resourceType_spatialUnit){ - html += ''; - } - else { - html += ''; - } - - html += "
        "; - - html += params.data.kommonitorRecordId; - - return html; - } - }, - { headerName: 'Feature-Id', field: __env.FEATURE_ID_PROPERTY_NAME, pinned: 'left', editable: false, cellClass: "grid-non-editable", maxWidth: 125 }, - { headerName: 'Name', field: __env.FEATURE_NAME_PROPERTY_NAME, pinned: 'left', minWidth: 150 }, - // { headerName: 'Geometrie', field: "kommonitorGeometry", autoHeight: false, wrapText: false, - // cellRenderer: function (params) { - // let html = JSON.stringify(params.data.kommonitorGeometry); - - // return html; - // }, - // filter: 'agTextColumnFilter', - // filterValueGetter: (params) => { - // return JSON.stringify(params.data.kommonitorGeometry); - // }, - // valueGetter: params => { - // return JSON.stringify(params.data.kommonitorGeometry); - // }, - // valueSetter: params => { - // try { - // params.data.kommonitorGeometry = JSON.parse(params.newValue); - // } catch (error) { - // try { - // params.data.kommonitorGeometry = JSON.parse(params.oldValue); - // } catch (error) { - // params.data.kommonitorGeometry = params.oldValue; - // } - - // } - // return true; - // }, - // minWidth: 200 - // }, - { headerName: 'Lebenszeitbeginn', field: __env.VALID_START_DATE_PROPERTY_NAME, minWidth: 150, cellEditor: getDatePicker() }, - { headerName: 'Lebenszeitende', field: __env.VALID_END_DATE_PROPERTY_NAME, cellEditor: getDatePicker(), - // cellRenderer: function (params) { - // let html = '

        '; - - // if (params.data.validEndDate){ - // html += params.data.validEndDate; - // } - // else{ - // html += "uneingeschränkt gültig"; - // } - - // html += "

        "; - - // return html; - // }, - // filter: 'agTextColumnFilter', - // filterValueGetter: (params) => { - // if (params.data.validEndDate){ - // return "" + params.data.validEndDate; - // } - // return "uneingeschränkt gültig"; - // }, - minWidth: 150 } - ]; - - for (const header of specificHeadersArray) { - columnDefs.push({ headerName: "" + header, field: "" + header, minWidth: 125 }); - } - - return columnDefs; - }; - - this.buildDataGridRowData_featureTable_spatialResource = function(dataArray){ - - - if(dataArray[0] && dataArray[0].properties){ - return dataArray.map(dataItem => { - // add geometry and database record ID to properties to be available within data grid object - dataItem.properties.kommonitorGeometry = dataItem.geometry; - dataItem.properties.kommonitorRecordId = dataItem.id; - return dataItem.properties; - } - ); - } - - return dataArray; - }; - - this.buildDataGridOptions_featureTable_spatialResource = function(specificHeadersArray, dataArray, datasetId, resourceType, deleteButtonEnabled){ - let columnDefs = this.buildDataGridColumnConfig_featureTable_spatialResource(specificHeadersArray, datasetId, resourceType, deleteButtonEnabled); - let rowData = this.buildDataGridRowData_featureTable_spatialResource(dataArray); - - let gridOptions = { - defaultColDef: { - editable: true, - // enables the fill handle - enableFillHandle: false, - cellEditor: 'agLargeTextCellEditor', - onCellValueChanged: function(newValueParams){ - /* https://www.ag-grid.com/javascript-data-grid/cell-editing/ - interface NewValueParams { - // The value before the change - oldValue: any; - // The value after the change - newValue: any; - // Row node for the given row - node: RowNode | null; - // Data associated with the node - data: any; - // Column for this callback - column: Column; - // ColDef provided for this column - colDef: ColDef; - api: GridApi; - columnApi: ColumnApi; - // The context as provided on `gridOptions.context` - context: any; - } - */ - - // make sure that date properties are actually set - if (! newValueParams.data.validStartDate){ - newValueParams.data.validStartDate = newValueParams.oldValue; - } - if (!isDate(newValueParams.data.validStartDate)){ - newValueParams.data.validStartDate = newValueParams.oldValue; - } - if(newValueParams.data.validEndDate == ""){ - newValueParams.data.validEndDate = undefined; - } - if(newValueParams.data.validEndDate){ - if (!isDate(newValueParams.data.validEndDate)){ - newValueParams.data.validEndDate = newValueParams.oldValue; - } - } - - // take the modified data from newValueParams.data - // take geometry info from newValueParams.data.geometry and remove that property afterwards - // take kommonitorRecordId info from newValueParams.data.kommonitorRecordId and remove that property afterwards - // then build GeoJSON and send modification request to data Management component - let geoJSON = { - "type": "Feature", - geometry: "", - properties: "", - id: "" - }; - - // clone properties - geoJSON.geometry = JSON.parse(JSON.stringify(newValueParams.data.kommonitorGeometry)); - geoJSON.id = JSON.parse(JSON.stringify(newValueParams.data.kommonitorRecordId)); - geoJSON.properties = JSON.parse(JSON.stringify(newValueParams.data)); - - // now delete information - delete geoJSON.properties.kommonitorGeometry; - delete geoJSON.properties.kommonitorRecordId; - - let url = __env.apiUrl + __env.basePath; - if(resourceType == self.resourceType_georesource){ - url += "/georesources/"; - } - else { - url += "/spatial-units/"; - } - - url += datasetId + "/singleFeature/" + newValueParams.data[__env.FEATURE_ID_PROPERTY_NAME] + "/singleFeatureRecord/" + newValueParams.data.kommonitorRecordId; - - $http({ - url: url, - method: "PUT", - data: geoJSON, - headers: { - 'Content-Type': "application/json" - } - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - console.log("Successfully updated database record"); - - // on success mark grid cell with green background and set update information - newValueParams.colDef.cellStyle = (p) => - p.rowIndex.toString() === newValueParams.node.id ? {'background-color': '#9DC89F'} : ""; - - newValueParams.api.refreshCells({ - force: true, - columns: [newValueParams.column.getId()], - rowNodes: [newValueParams.node] - }); - - if(resourceType == self.resourceType_georesource){ - self.featureTable_georesource_lastUpdate_timestamp_success = getCurrentTimestampString(); - } - else { - self.featureTable_spatialUnit_lastUpdate_timestamp_success = getCurrentTimestampString(); - } - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while updating database record. Error is:\n" + error); - - // reset cell value as an error occurred - newValueParams.data[newValueParams.column.colId] = newValueParams.oldValue; - - // on failure mark grid cell with red background and set update failure information - newValueParams.colDef.cellStyle = (p) => - p.rowIndex.toString() === newValueParams.node.id ? {'background-color': '#E79595'} : ""; - - newValueParams.api.refreshCells({ - force: true, - columns: [newValueParams.column.getId()], - rowNodes: [newValueParams.node] - }); - if(resourceType == self.resourceType_georesource){ - self.featureTable_georesource_lastUpdate_timestamp_failure = timestamp_string; - } - else { - self.featureTable_spatialUnit_lastUpdate_timestamp_failure = timestamp_string; - } - throw error; - }); - }, - sortable: true, - flex: 1, - minWidth: 200, - filter: true, - floatingFilter: true, - // filterParams: { - // newRowsAction: 'keep' - // }, - resizable: true, - wrapText: true, - autoHeight: true, - cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, - headerComponentParams: { - template: - '', - }, - }, - columnDefs: columnDefs, - rowData: rowData, - // enables undo / redo - undoRedoCellEditing: true, - // restricts the number of undo / redo steps to 10 - undoRedoCellEditingLimit: 10, - // enables flashing to help see cell changes - enableCellChangeFlash: true, - suppressRowClickSelection: true, - // rowSelection: 'multiple', - enableCellTextSelection: true, - ensureDomOrder: true, - pagination: true, - paginationPageSize: 10, - suppressColumnVirtualisation: true, - // onFirstDataRendered: function () { - // headerHeightSetter(this); - // }, - // onColumnResized: function () { - // headerHeightSetter(this); - // } - onRowDataChanged: function () { - self.registerClickHandler_featureTable_spatialResource(resourceType); - }, - onModelUpdated: function () { - self.registerClickHandler_featureTable_spatialResource(resourceType); - - }, - onViewportChanged: function () { - self.registerClickHandler_featureTable_spatialResource(resourceType); - }, - - }; - - return gridOptions; - }; - - this.registerClickHandler_featureTable_spatialResource = function (resourceType) { - - let className = ""; - let url = __env.apiUrl + __env.basePath; - - if (resourceType == this.resourceType_georesource){ - className = ".georesourceDeleteFeatureRecordBtn"; - url += "/georesources/"; - } - else{ - className = ".spatialUnitDeleteFeatureRecordBtn"; - url += "/spatial-units/"; - } - - $(className).off(); - $(className).on("click", function (event) { - - // ensure that only the target button gets clicked - event.stopPropagation(); - event.stopImmediatePropagation(); - $rootScope.$broadcast("showLoadingIcon_" + resourceType); - - // id example is id="btn__spatialUnit__deleteFeatureEntry__' + datasetId + '__' + params.data[__env.FEATURE_ID_PROPERTY_NAME] + '__' + params.data.kommonitorRecordId + '" - let idArray = this.id.split("__"); - - let datasetId = idArray[3]; - let featureId = idArray[4]; - let recordId = idArray[5]; - - url += datasetId + "/singleFeature/" + featureId + "/singleFeatureRecord/" + recordId; - - $http({ + onRowDataChanged: function () { + self.registerClickHandler_featureTable_spatialResource(resourceType); + }, + onModelUpdated: function () { + self.registerClickHandler_featureTable_spatialResource(resourceType); + }, + onViewportChanged: function () { + self.registerClickHandler_featureTable_spatialResource(resourceType); + }, + }; + return gridOptions; + }; + this.registerClickHandler_featureTable_spatialResource = function (resourceType) { + let className = ""; + let url = __env.apiUrl + __env.basePath; + if (resourceType == this.resourceType_georesource) { + className = ".georesourceDeleteFeatureRecordBtn"; + url += "/georesources/"; + } + else { + className = ".spatialUnitDeleteFeatureRecordBtn"; + url += "/spatial-units/"; + } + $(className).off(); + $(className).on("click", function (event) { + // ensure that only the target button gets clicked + event.stopPropagation(); + event.stopImmediatePropagation(); + $rootScope.$broadcast("showLoadingIcon_" + resourceType); + // id example is id="btn__spatialUnit__deleteFeatureEntry__' + datasetId + '__' + params.data[__env.FEATURE_ID_PROPERTY_NAME] + '__' + params.data.kommonitorRecordId + '" + let idArray = this.id.split("__"); + let datasetId = idArray[3]; + let featureId = idArray[4]; + let recordId = idArray[5]; + url += datasetId + "/singleFeature/" + featureId + "/singleFeatureRecord/" + recordId; + $http({ url: url, method: "DELETE" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - console.log("Successfully deleted database record"); - - if(resourceType == self.resourceType_georesource){ + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + console.log("Successfully deleted database record"); + if (resourceType == self.resourceType_georesource) { self.featureTable_georesource_lastUpdate_timestamp_success = getCurrentTimestampString(); - } - else { + } + else { self.featureTable_spatialUnit_lastUpdate_timestamp_success = getCurrentTimestampString(); - } - - $rootScope.$broadcast("onDeleteFeatureEntry_" + resourceType); - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while deleting database record. Error is:\n" + error); - $rootScope.$broadcast("hideLoadingIcon_" + resourceType); - if(resourceType == self.resourceType_georesource){ + } + $rootScope.$broadcast("onDeleteFeatureEntry_" + resourceType); + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while deleting database record. Error is:\n" + error); + $rootScope.$broadcast("hideLoadingIcon_" + resourceType); + if (resourceType == self.resourceType_georesource) { self.featureTable_georesource_lastUpdate_timestamp_failure = getCurrentTimestampString(); - } - else { + } + else { self.featureTable_spatialUnit_lastUpdate_timestamp_failure = getCurrentTimestampString(); - } - throw error; - }); - }); - - }; - - this.buildDataGrid_featureTable_spatialResource = function (domElementId, specificHeadersArray, dataArray, datasetId, resourceType, deleteButtonEnabled) { - - let dataGridOptions_featureTable; - - dataGridOptions_featureTable = this.buildDataGridOptions_featureTable_spatialResource(specificHeadersArray, dataArray, datasetId, resourceType, deleteButtonEnabled); - - let gridDiv = document.querySelector('#' + domElementId); - while (gridDiv.firstChild) { - gridDiv.removeChild(gridDiv.firstChild); - } - new agGrid.Grid(gridDiv, dataGridOptions_featureTable); - }; - - // INDICATORS FEATURE TABLE - this.buildDataGridColumnConfig_featureTable_indicatorResource = function(specificHeadersArray, datasetId, resourceType, deleteButtonEnabled, spatialUnitId){ - const columnDefs = [ - { headerName: 'DB-Record-Id', field: "fid", pinned: 'left', editable: false, cellClass: "grid-non-editable", maxWidth: 125, - cellRenderer: function (params) { - let html = ""; - - // only show delete button, if user has the permission to delete the dataset - // if only editor rights, then user may edit cells, but shall not remove data entries - // if(params.data.userPermissions.includes("creator")){ - // html += ''; - - - // } - - html += ''; - - html += "  "; - html += params.data.fid; - - return html; - } - }, - { headerName: 'Feature-Id', field: __env.FEATURE_ID_PROPERTY_NAME, pinned: 'left', editable: false, cellClass: "grid-non-editable", maxWidth: 125 }, - { headerName: 'Name', field: __env.FEATURE_NAME_PROPERTY_NAME, pinned: 'left', minWidth: 200, editable: false, cellClass: "grid-non-editable", }, - // { headerName: 'Id', field: __env.FEATURE_ID_PROPERTY_NAME, maxWidth: 125 }, - // { headerName: 'Name', field: __env.FEATURE_NAME_PROPERTY_NAME, minWidth: 300 }, - { headerName: 'Lebenszeitbeginn', field: __env.VALID_START_DATE_PROPERTY_NAME, minWidth: 125, editable: false, cellClass: "grid-non-editable" }, - { headerName: 'Lebenszeitende', field: __env.VALID_END_DATE_PROPERTY_NAME, editable: false, cellClass: "grid-non-editable", - minWidth: 125 } - ]; - - for (const header of specificHeadersArray) { - columnDefs.push({ headerName: "" + header, field: "" + header, minWidth: 125 }); - } - - return columnDefs; - }; - - this.buildDataGridRowData_featureTable_indicatorResource = function(dataArray){ - - return dataArray.map(dataItem => { - // remove arisonFrom property as this is currently never used - delete dataItem.arisenFrom; - return dataItem; - } - ); - }; - - this.buildDataGridOptions_featureTable_indicatorResource = function(specificHeadersArray, dataArray, datasetId, resourceType, deleteButtonEnabled, spatialUnitId){ - let columnDefs = this.buildDataGridColumnConfig_featureTable_indicatorResource(specificHeadersArray, datasetId, resourceType, deleteButtonEnabled, spatialUnitId); - let rowData = this.buildDataGridRowData_featureTable_indicatorResource(dataArray); - - let gridOptions = { - defaultColDef: { - editable: true, - // enables the fill handle - enableFillHandle: false, - cellEditor: 'agLargeTextCellEditor', - onCellValueChanged: function(newValueParams){ - /* https://www.ag-grid.com/javascript-data-grid/cell-editing/ - interface NewValueParams { - // The value before the change - oldValue: any; - // The value after the change - newValue: any; - // Row node for the given row - node: RowNode | null; - // Data associated with the node - data: any; - // Column for this callback - column: Column; - // ColDef provided for this column - colDef: ColDef; - api: GridApi; - columnApi: ColumnApi; - // The context as provided on `gridOptions.context` - context: any; - } - */ - - // take the modified data from newValueParams.data - // then build JSON and send modification request to data Management component - let json = JSON.parse(JSON.stringify(newValueParams.data)); - - // now delete information - only ID and fid shall remain for indicator record update - delete json[__env.VALID_START_DATE_PROPERTY_NAME]; - delete json[__env.VALID_END_DATE_PROPERTY_NAME]; - delete json[__env.FEATURE_NAME_PROPERTY_NAME]; - - /* - for indicators we should check if an empty/null/undefined value has been set by user and transmit it as null value - */ - for (const key in json) { - if (Object.hasOwnProperty.call(json, key)) { - const element = json[key]; - - if(key.includes(__env.indicatorDatePrefix)){ - if (element == ""){ - json[key] = null; - } } - - } - } - - let url = __env.apiUrl + __env.basePath + "/indicators/"; - - url += datasetId + "/" + spatialUnitId + "/singleFeature/" + newValueParams.data[__env.FEATURE_ID_PROPERTY_NAME] + "/singleFeatureRecord/" + newValueParams.data.fid; - - $http({ - url: url, - method: "PUT", - data: json, - headers: { - 'Content-Type': "application/json" + throw error; + }); + }); + }; + this.buildDataGrid_featureTable_spatialResource = function (domElementId, specificHeadersArray, dataArray, datasetId, resourceType, deleteButtonEnabled) { + let dataGridOptions_featureTable; + dataGridOptions_featureTable = this.buildDataGridOptions_featureTable_spatialResource(specificHeadersArray, dataArray, datasetId, resourceType, deleteButtonEnabled); + let gridDiv = document.querySelector('#' + domElementId); + while (gridDiv.firstChild) { + gridDiv.removeChild(gridDiv.firstChild); + } + new agGrid.Grid(gridDiv, dataGridOptions_featureTable); + }; + // INDICATORS FEATURE TABLE + this.buildDataGridColumnConfig_featureTable_indicatorResource = function (specificHeadersArray, datasetId, resourceType, deleteButtonEnabled, spatialUnitId) { + const columnDefs = [ + { headerName: 'DB-Record-Id', field: "fid", pinned: 'left', editable: false, cellClass: "grid-non-editable", maxWidth: 125, + cellRenderer: function (params) { + let html = ""; + // only show delete button, if user has the permission to delete the dataset + // if only editor rights, then user may edit cells, but shall not remove data entries + // if(params.data.userPermissions.includes("creator")){ + // html += ''; + // } + html += ''; + html += "  "; + html += params.data.fid; + return html; } - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - console.log("Successfully updated database record"); - - // on success mark grid cell with green background and set update information - newValueParams.colDef.cellStyle = (p) => - p.rowIndex.toString() === newValueParams.node.id ? {'background-color': '#9DC89F'} : ""; - - newValueParams.api.refreshCells({ - force: true, - columns: [newValueParams.column.getId()], - rowNodes: [newValueParams.node] - }); - - self.featureTable_indicator_lastUpdate_timestamp_success = getCurrentTimestampString(); - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while updating database record. Error is:\n" + error); - - // reset cell value as an error occurred - newValueParams.data[newValueParams.column.colId] = newValueParams.oldValue; - - // on failure mark grid cell with red background and set update failure information - newValueParams.colDef.cellStyle = (p) => - p.rowIndex.toString() === newValueParams.node.id ? {'background-color': '#E79595'} : ""; - - newValueParams.api.refreshCells({ - force: true, - columns: [newValueParams.column.getId()], - rowNodes: [newValueParams.node] - }); - self.featureTable_indicator_lastUpdate_timestamp_failure = timestamp_string; - throw error; - }); - }, - sortable: true, - flex: 1, - minWidth: 200, - filter: true, - floatingFilter: true, - // filterParams: { - // newRowsAction: 'keep' - // }, - resizable: true, - wrapText: true, - autoHeight: true, - cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, - headerComponentParams: { - template: - '', - }, - }, - columnDefs: columnDefs, - rowData: rowData, - // enables undo / redo - undoRedoCellEditing: true, - // restricts the number of undo / redo steps to 10 - undoRedoCellEditingLimit: 10, - // enables flashing to help see cell changes - enableCellChangeFlash: true, - suppressRowClickSelection: true, - // rowSelection: 'multiple', - enableCellTextSelection: true, - ensureDomOrder: true, - pagination: true, - paginationPageSize: 10, - suppressColumnVirtualisation: true, - onViewportChanged: function () { - self.registerClickHandler_featureTable_indicatorResource(resourceType); - }, - - }; - - return gridOptions; - }; - - this.registerClickHandler_featureTable_indicatorResource = function (resourceType) { - - let className = ".indicatorDeleteFeatureRecordBtn"; - let url = __env.apiUrl + __env.basePath + "/indicators/"; - - $(className).off(); - $(className).on("click", function (event) { - - // ensure that only the target button gets clicked - event.stopPropagation(); - event.stopImmediatePropagation(); - $rootScope.$broadcast("showLoadingIcon_" + resourceType); - - // id example is "btn__indicator__deleteFeatureEntry__' + datasetId + '__' + spatialUnitId + '__' + params.data[__env.FEATURE_ID_PROPERTY_NAME] + '__' + params.data.kommonitorRecordId + '" class="btn btn-danger btn-sm indicatorDeleteFeatureRecordBtn" - let idArray = this.id.split("__"); - - let datasetId = idArray[3]; - let spatialUnitId = idArray[4]; - let featureId = idArray[5]; - let recordId = idArray[6]; - - url += datasetId + "/" + spatialUnitId + "/singleFeature/" + featureId + "/singleFeatureRecord/" + recordId; - - $http({ + }, + { headerName: 'Feature-Id', field: __env.FEATURE_ID_PROPERTY_NAME, pinned: 'left', editable: false, cellClass: "grid-non-editable", maxWidth: 125 }, + { headerName: 'Name', field: __env.FEATURE_NAME_PROPERTY_NAME, pinned: 'left', minWidth: 200, editable: false, cellClass: "grid-non-editable", }, + // { headerName: 'Id', field: __env.FEATURE_ID_PROPERTY_NAME, maxWidth: 125 }, + // { headerName: 'Name', field: __env.FEATURE_NAME_PROPERTY_NAME, minWidth: 300 }, + { headerName: 'Lebenszeitbeginn', field: __env.VALID_START_DATE_PROPERTY_NAME, minWidth: 125, editable: false, cellClass: "grid-non-editable" }, + { headerName: 'Lebenszeitende', field: __env.VALID_END_DATE_PROPERTY_NAME, editable: false, cellClass: "grid-non-editable", + minWidth: 125 } + ]; + for (const header of specificHeadersArray) { + columnDefs.push({ headerName: "" + header, field: "" + header, minWidth: 125 }); + } + return columnDefs; + }; + this.buildDataGridRowData_featureTable_indicatorResource = function (dataArray) { + return dataArray.map(dataItem => { + // remove arisonFrom property as this is currently never used + delete dataItem.arisenFrom; + return dataItem; + }); + }; + this.buildDataGridOptions_featureTable_indicatorResource = function (specificHeadersArray, dataArray, datasetId, resourceType, deleteButtonEnabled, spatialUnitId) { + let columnDefs = this.buildDataGridColumnConfig_featureTable_indicatorResource(specificHeadersArray, datasetId, resourceType, deleteButtonEnabled, spatialUnitId); + let rowData = this.buildDataGridRowData_featureTable_indicatorResource(dataArray); + let gridOptions = { + defaultColDef: { + editable: true, + // enables the fill handle + enableFillHandle: false, + cellEditor: 'agLargeTextCellEditor', + onCellValueChanged: function (newValueParams) { + /* https://www.ag-grid.com/javascript-data-grid/cell-editing/ + interface NewValueParams { + // The value before the change + oldValue: any; + // The value after the change + newValue: any; + // Row node for the given row + node: RowNode | null; + // Data associated with the node + data: any; + // Column for this callback + column: Column; + // ColDef provided for this column + colDef: ColDef; + api: GridApi; + columnApi: ColumnApi; + // The context as provided on `gridOptions.context` + context: any; + } + */ + // take the modified data from newValueParams.data + // then build JSON and send modification request to data Management component + let json = JSON.parse(JSON.stringify(newValueParams.data)); + // now delete information - only ID and fid shall remain for indicator record update + delete json[__env.VALID_START_DATE_PROPERTY_NAME]; + delete json[__env.VALID_END_DATE_PROPERTY_NAME]; + delete json[__env.FEATURE_NAME_PROPERTY_NAME]; + /* + for indicators we should check if an empty/null/undefined value has been set by user and transmit it as null value + */ + for (const key in json) { + if (Object.hasOwnProperty.call(json, key)) { + const element = json[key]; + if (key.includes(__env.indicatorDatePrefix)) { + if (element == "") { + json[key] = null; + } + } + } + } + let url = __env.apiUrl + __env.basePath + "/indicators/"; + url += datasetId + "/" + spatialUnitId + "/singleFeature/" + newValueParams.data[__env.FEATURE_ID_PROPERTY_NAME] + "/singleFeatureRecord/" + newValueParams.data.fid; + $http({ + url: url, + method: "PUT", + data: json, + headers: { + 'Content-Type': "application/json" + } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + console.log("Successfully updated database record"); + // on success mark grid cell with green background and set update information + newValueParams.colDef.cellStyle = (p) => p.rowIndex.toString() === newValueParams.node.id ? { 'background-color': '#9DC89F' } : ""; + newValueParams.api.refreshCells({ + force: true, + columns: [newValueParams.column.getId()], + rowNodes: [newValueParams.node] + }); + self.featureTable_indicator_lastUpdate_timestamp_success = getCurrentTimestampString(); + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while updating database record. Error is:\n" + error); + // reset cell value as an error occurred + newValueParams.data[newValueParams.column.colId] = newValueParams.oldValue; + // on failure mark grid cell with red background and set update failure information + newValueParams.colDef.cellStyle = (p) => p.rowIndex.toString() === newValueParams.node.id ? { 'background-color': '#E79595' } : ""; + newValueParams.api.refreshCells({ + force: true, + columns: [newValueParams.column.getId()], + rowNodes: [newValueParams.node] + }); + self.featureTable_indicator_lastUpdate_timestamp_failure = timestamp_string; + throw error; + }); + }, + sortable: true, + flex: 1, + minWidth: 200, + filter: true, + floatingFilter: true, + // filterParams: { + // newRowsAction: 'keep' + // }, + resizable: true, + wrapText: true, + autoHeight: true, + cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, + headerComponentParams: { + template: '', + }, + }, + columnDefs: columnDefs, + rowData: rowData, + // enables undo / redo + undoRedoCellEditing: true, + // restricts the number of undo / redo steps to 10 + undoRedoCellEditingLimit: 10, + // enables flashing to help see cell changes + enableCellChangeFlash: true, + suppressRowClickSelection: true, + // rowSelection: 'multiple', + enableCellTextSelection: true, + ensureDomOrder: true, + pagination: true, + paginationPageSize: 10, + suppressColumnVirtualisation: true, + onViewportChanged: function () { + self.registerClickHandler_featureTable_indicatorResource(resourceType); + }, + }; + return gridOptions; + }; + this.registerClickHandler_featureTable_indicatorResource = function (resourceType) { + let className = ".indicatorDeleteFeatureRecordBtn"; + let url = __env.apiUrl + __env.basePath + "/indicators/"; + $(className).off(); + $(className).on("click", function (event) { + // ensure that only the target button gets clicked + event.stopPropagation(); + event.stopImmediatePropagation(); + $rootScope.$broadcast("showLoadingIcon_" + resourceType); + // id example is "btn__indicator__deleteFeatureEntry__' + datasetId + '__' + spatialUnitId + '__' + params.data[__env.FEATURE_ID_PROPERTY_NAME] + '__' + params.data.kommonitorRecordId + '" class="btn btn-danger btn-sm indicatorDeleteFeatureRecordBtn" + let idArray = this.id.split("__"); + let datasetId = idArray[3]; + let spatialUnitId = idArray[4]; + let featureId = idArray[5]; + let recordId = idArray[6]; + url += datasetId + "/" + spatialUnitId + "/singleFeature/" + featureId + "/singleFeatureRecord/" + recordId; + $http({ url: url, method: "DELETE" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - console.log("Successfully deleted database record"); - - $rootScope.$broadcast("onDeleteFeatureEntry_" + resourceType); - self.featureTable_indicator_lastUpdate_timestamp_success = getCurrentTimestampString(); - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while deleting database record. Error is:\n" + error); - $rootScope.$broadcast("hideLoadingIcon_" + resourceType); - self.featureTable_indicator_lastUpdate_timestamp_failure = getCurrentTimestampString(); - throw error; - }); - }); - - }; - - this.buildDataGrid_featureTable_indicatorResource = function (domElementId, specificHeadersArray, dataArray, datasetId, resourceType, deleteButtonEnabled, spatialUnitId) { - - let dataGridOptions_featureTable = this.buildDataGridOptions_featureTable_indicatorResource(specificHeadersArray, dataArray, datasetId, resourceType, deleteButtonEnabled, spatialUnitId); - - let gridDiv = document.querySelector('#' + domElementId); - while (gridDiv.firstChild) { - gridDiv.removeChild(gridDiv.firstChild); - } - new agGrid.Grid(gridDiv, dataGridOptions_featureTable); - }; - - - // ROLE OVERVIEW TABLE - - this.buildDataGridColumnConfig_accessControl = function(isRealmAdmin){ - let columnDefs = []; - // Only show edit column if user is Realm Admin - if (isRealmAdmin) { - columnDefs.push({ headerName: 'Editierfunktionen', maxWidth: 200, checkboxSelection: (row) => {return row.data.name != "public" && row.data.name != "kommonitor"}, filter: false, sortable: false, cellRenderer: 'displayEditButtons_accessControl' }); - } - - return columnDefs.concat([ - //{ headerName: 'Id', field: "organizationalUnitId", minWidth: 400 }, - { headerName: 'Organisationseinheit', field: "name", minWidth: 300 }, - { headerName: 'Rollen', field: "roleString", minWidth: 300 }, - { headerName: 'Beschreibung', field: "description", minWidth: 400 }, - { headerName: 'Kontakt', field: "contact", minWidth: 400 }, - ]); - }; - - this.buildDataGridRowData_accessControl = function(dataArray){ - let data = JSON.parse(JSON.stringify(dataArray)); - for (let elem of data) { - elem.roleString = ""; - for (let role of elem.roles) { - elem.roleString += role.permissionLevel + ", "; - } - elem.roleString = elem.roleString.substring(0, elem.roleString.length - 2); - } - return data; - }; - - this.buildDataGridOptions_accessControl = function(accessControlArray){ - let columnDefs = this.buildDataGridColumnConfig_accessControl(kommonitorDataExchangeService.isRealmAdmin); - let rowData = this.buildDataGridRowData_accessControl(accessControlArray); - - let components = {}; - if (kommonitorDataExchangeService.isRealmAdmin) { - components = {displayEditButtons_accessControl: displayEditButtons_accessControl}; - } else { - components = {} - } - - let gridOptions = { - defaultColDef: { - editable: false, - sortable: true, - flex: 1, - minWidth: 200, - filter: true, - floatingFilter: true, - // filterParams: { - // newRowsAction: 'keep' - // }, - resizable: true, - wrapText: true, - autoHeight: true, - cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, - headerComponentParams: { - template: - '', - }, - }, - components: components, - columnDefs: columnDefs, - rowData: rowData, - suppressRowClickSelection: true, - rowSelection: 'multiple', - enableCellTextSelection: true, - ensureDomOrder: true, - pagination: true, - paginationPageSize: 10, - suppressColumnVirtualisation: true, - onFirstDataRendered: function () { - headerHeightSetter(self.dataGridOptions_accessControl); - }, - onColumnResized: function () { - headerHeightSetter(self.dataGridOptions_accessControl); - }, - onRowDataChanged: function () { - self.registerClickHandler_accessControl(accessControlArray); - }, - onModelUpdated: function () { - self.registerClickHandler_accessControl(accessControlArray); - }, - - onViewportChanged: function () { - self.registerClickHandler_accessControl(accessControlArray); - }, - - }; - - return gridOptions; - }; - - this.registerClickHandler_accessControl = function (roleMetadataArray) { - - $(".roleEditMetadataBtn").off(); - $(".roleEditMetadataBtn").on("click", function (event) { - // ensure that only the target button gets clicked - // manually open modal - event.stopPropagation(); - let modalId = document.getElementById(this.id).getAttribute("data-target"); - $(modalId).modal('show'); - - let id = this.id.split("_")[3]; - - let roleMetadata = kommonitorDataExchangeService.getAccessControlById(id); - - $rootScope.$broadcast("onEditRoleMetadata", roleMetadata); - }); - }; - - this.buildDataGrid_accessControl = function (accessControlArray) { - - if (this.dataGridOptions_accessControl && this.dataGridOptions_accessControl.api && document.querySelector('#roleOverviewTable').childElementCount > 0) { - - this.saveGridStore(this.dataGridOptions_accessControl); - let newRowData = this.buildDataGridRowData_accessControl(accessControlArray); - this.dataGridOptions_accessControl.api.setRowData(newRowData); - this.restoreGridStore(this.dataGridOptions_accessControl); - } - else { - this.dataGridOptions_accessControl = this.buildDataGridOptions_accessControl(accessControlArray); - let gridDiv = document.querySelector('#roleOverviewTable'); - new agGrid.Grid(gridDiv, this.dataGridOptions_accessControl); - } - }; - - - // SCRIPT OVERVIEW TABLE - - this.buildDataGridColumnConfig_scripts = function(){ - const columnDefs = [ - { headerName: 'Id', field: "scriptId", pinned: 'left', maxWidth: 125, checkboxSelection: true, headerCheckboxSelection: true, - headerCheckboxSelectionFilteredOnly: true }, - { headerName: 'Name', field: "name", pinned: 'left', maxWidth: 300 }, - { headerName: 'Ziel-Indikatoren-Id', field: "indicatorId", maxWidth: 125 }, - { headerName: 'Ziel-Indikatoren-Name', minWidth: 200, cellRenderer: function (params) { - return kommonitorDataExchangeService.getIndicatorNameFromIndicatorId(params.data.indicatorId); - }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return kommonitorDataExchangeService.getIndicatorNameFromIndicatorId(params.data.indicatorId); - } - }, - { headerName: 'Beschreibung', field: "description", minWidth: 300 }, - { headerName: 'notwendige Basis-Indikatoren', minWidth: 300, cellRenderer: function (params) { - - /* - - - - - - - - - - - - - -
        IdName
        {{::baseIndicatorId}}{{::$ctrl.kommonitorDataExchangeServiceInstance.getIndicatorNameFromIndicatorId(baseIndicatorId)}}
        - */ - if(params.data && params.data.requiredIndicatorIds && params.data.requiredIndicatorIds.length > 0){ - let html = ''; - - for (const baseIndicatorId of params.data.requiredIndicatorIds) { - html += ""; - html += ""; - html += ""; - html += ""; + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + console.log("Successfully deleted database record"); + $rootScope.$broadcast("onDeleteFeatureEntry_" + resourceType); + self.featureTable_indicator_lastUpdate_timestamp_success = getCurrentTimestampString(); + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while deleting database record. Error is:\n" + error); + $rootScope.$broadcast("hideLoadingIcon_" + resourceType); + self.featureTable_indicator_lastUpdate_timestamp_failure = getCurrentTimestampString(); + throw error; + }); + }); + }; + this.buildDataGrid_featureTable_indicatorResource = function (domElementId, specificHeadersArray, dataArray, datasetId, resourceType, deleteButtonEnabled, spatialUnitId) { + let dataGridOptions_featureTable = this.buildDataGridOptions_featureTable_indicatorResource(specificHeadersArray, dataArray, datasetId, resourceType, deleteButtonEnabled, spatialUnitId); + let gridDiv = document.querySelector('#' + domElementId); + while (gridDiv.firstChild) { + gridDiv.removeChild(gridDiv.firstChild); + } + new agGrid.Grid(gridDiv, dataGridOptions_featureTable); + }; + // ROLE OVERVIEW TABLE + this.buildDataGridColumnConfig_accessControl = function (isRealmAdmin) { + let columnDefs = []; + // Only show edit column if user is Realm Admin + if (isRealmAdmin) { + columnDefs.push({ headerName: 'Editierfunktionen', maxWidth: 200, checkboxSelection: (row) => { return row.data.name != "public" && row.data.name != "kommonitor"; }, filter: false, sortable: false, cellRenderer: 'displayEditButtons_accessControl' }); + } + return columnDefs.concat([ + //{ headerName: 'Id', field: "organizationalUnitId", minWidth: 400 }, + { headerName: 'Organisationseinheit', field: "name", minWidth: 300 }, + { headerName: 'Rollen', field: "roleString", minWidth: 300 }, + { headerName: 'Beschreibung', field: "description", minWidth: 400 }, + { headerName: 'Kontakt', field: "contact", minWidth: 400 }, + ]); + }; + this.buildDataGridRowData_accessControl = function (dataArray) { + let data = JSON.parse(JSON.stringify(dataArray)); + for (let elem of data) { + elem.roleString = ""; + for (let role of elem.roles) { + elem.roleString += role.permissionLevel + ", "; + } + elem.roleString = elem.roleString.substring(0, elem.roleString.length - 2); + } + return data; + }; + this.buildDataGridOptions_accessControl = function (accessControlArray) { + let columnDefs = this.buildDataGridColumnConfig_accessControl(kommonitorDataExchangeService.isRealmAdmin); + let rowData = this.buildDataGridRowData_accessControl(accessControlArray); + let components = {}; + if (kommonitorDataExchangeService.isRealmAdmin) { + components = { displayEditButtons_accessControl: displayEditButtons_accessControl }; + } + else { + components = {}; + } + let gridOptions = { + defaultColDef: { + editable: false, + sortable: true, + flex: 1, + minWidth: 200, + filter: true, + floatingFilter: true, + // filterParams: { + // newRowsAction: 'keep' + // }, + resizable: true, + wrapText: true, + autoHeight: true, + cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, + headerComponentParams: { + template: '', + }, + }, + components: components, + columnDefs: columnDefs, + rowData: rowData, + suppressRowClickSelection: true, + rowSelection: 'multiple', + enableCellTextSelection: true, + ensureDomOrder: true, + pagination: true, + paginationPageSize: 10, + suppressColumnVirtualisation: true, + onFirstDataRendered: function () { + headerHeightSetter(self.dataGridOptions_accessControl); + }, + onColumnResized: function () { + headerHeightSetter(self.dataGridOptions_accessControl); + }, + onRowDataChanged: function () { + self.registerClickHandler_accessControl(accessControlArray); + }, + onModelUpdated: function () { + self.registerClickHandler_accessControl(accessControlArray); + }, + onViewportChanged: function () { + self.registerClickHandler_accessControl(accessControlArray); + }, + }; + return gridOptions; + }; + this.registerClickHandler_accessControl = function (roleMetadataArray) { + $(".roleEditMetadataBtn").off(); + $(".roleEditMetadataBtn").on("click", function (event) { + // ensure that only the target button gets clicked + // manually open modal + event.stopPropagation(); + let modalId = document.getElementById(this.id).getAttribute("data-target"); + $(modalId).modal('show'); + let id = this.id.split("_")[3]; + let roleMetadata = kommonitorDataExchangeService.getAccessControlById(id); + $rootScope.$broadcast("onEditRoleMetadata", roleMetadata); + }); + }; + this.buildDataGrid_accessControl = function (accessControlArray) { + if (this.dataGridOptions_accessControl && this.dataGridOptions_accessControl.api && document.querySelector('#roleOverviewTable').childElementCount > 0) { + this.saveGridStore(this.dataGridOptions_accessControl); + let newRowData = this.buildDataGridRowData_accessControl(accessControlArray); + this.dataGridOptions_accessControl.api.setRowData(newRowData); + this.restoreGridStore(this.dataGridOptions_accessControl); + } + else { + this.dataGridOptions_accessControl = this.buildDataGridOptions_accessControl(accessControlArray); + let gridDiv = document.querySelector('#roleOverviewTable'); + new agGrid.Grid(gridDiv, this.dataGridOptions_accessControl); + } + }; + // SCRIPT OVERVIEW TABLE + this.buildDataGridColumnConfig_scripts = function () { + const columnDefs = [ + { headerName: 'Id', field: "scriptId", pinned: 'left', maxWidth: 125, checkboxSelection: true, headerCheckboxSelection: true, + headerCheckboxSelectionFilteredOnly: true }, + { headerName: 'Name', field: "name", pinned: 'left', maxWidth: 300 }, + { headerName: 'Ziel-Indikatoren-Id', field: "indicatorId", maxWidth: 125 }, + { headerName: 'Ziel-Indikatoren-Name', minWidth: 200, cellRenderer: function (params) { + return kommonitorDataExchangeService.getIndicatorNameFromIndicatorId(params.data.indicatorId); + }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return kommonitorDataExchangeService.getIndicatorNameFromIndicatorId(params.data.indicatorId); + } + }, + { headerName: 'Beschreibung', field: "description", minWidth: 300 }, + { headerName: 'notwendige Basis-Indikatoren', minWidth: 300, cellRenderer: function (params) { + /* +
        IdName
        " + baseIndicatorId + "" + kommonitorDataExchangeService.getIndicatorNameFromIndicatorId(baseIndicatorId) + "
        + + + + + + + + + + + + +
        IdName
        {{::baseIndicatorId}}{{::$ctrl.kommonitorDataExchangeServiceInstance.getIndicatorNameFromIndicatorId(baseIndicatorId)}}
        + */ + if (params.data && params.data.requiredIndicatorIds && params.data.requiredIndicatorIds.length > 0) { + let html = ''; + for (const baseIndicatorId of params.data.requiredIndicatorIds) { + html += ""; + html += ""; + html += ""; + html += ""; + } + html += "
        IdName
        " + baseIndicatorId + "" + kommonitorDataExchangeService.getIndicatorNameFromIndicatorId(baseIndicatorId) + "
        "; + return html; + } + else { + return "keine"; + } + }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + if (params.data && params.data.requiredIndicatorIds && params.data.requiredIndicatorIds.length > 0) { + let string = JSON.stringify(params.data.requiredIndicatorIds); + for (const baseIndicatorId of params.data.requiredIndicatorIds) { + string += kommonitorDataExchangeService.getIndicatorNameFromIndicatorId(baseIndicatorId); + } + return string; + } + else { + return "keine"; + } + } + }, + { headerName: 'notwendige Basis-Georessourcen', minWidth: 300, cellRenderer: function (params) { + if (params.data && params.data.requiredGeoresourceIds && params.data.requiredGeoresourceIds.length > 0) { + let html = ''; + for (const baseGeoresourceId of params.data.requiredGeoresourceIds) { + html += ""; + html += ""; + html += ""; + html += ""; + } + html += "
        IdName
        " + baseGeoresourceId + "" + kommonitorDataExchangeService.getGeoresourceNameFromGeoresourceId(baseGeoresourceId) + "
        "; + return html; + } + else { + return "keine"; + } + }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + if (params.data && params.data.requiredGeoresourceIds && params.data.requiredGeoresourceIds.length > 0) { + let string = JSON.stringify(params.data.requiredGeoresourceIds); + for (const baseIndicatorId of params.data.requiredGeoresourceIds) { + string += kommonitorDataExchangeService.getGeoresourceNameFromGeoresourceId(baseIndicatorId); + } + return string; + } + else { + return "keine"; + } + } + }, + { headerName: 'Prozessparameter', field: "", minWidth: 1000, cellRenderer: function (params) { + /* + + + + + + + + + + + + + + + + + + + +
        NameBeschreibungDatentypStandard-Werterlaubter Wertebereich
        {{::processParameter.name}}{{::processParameter.description}}{{::processParameter.dataType}}{{::processParameter.defaultValue}}
        erlaubter Wertebereich {{::processParameter.minParameterValueForNumericInputs}} - {{::processParameter.maxParameterValueForNumericInputs}}
        + */ + if (params.data && params.data.variableProcessParameters && params.data.variableProcessParameters.length > 0) { + let html = ''; + for (const processParameter of params.data.variableProcessParameters) { + html += ""; + html += ""; + html += ""; + html += ""; + html += ""; + html += ""; + html += ""; + } + html += "
        NameBeschreibungDatentypStandard-Werterlaubter Wertebereich
        " + processParameter.name + "" + processParameter.description + "" + processParameter.dataType + "" + processParameter.defaultValue + ""; + if (processParameter.dataType == "integer" || processParameter.dataType == "double") { + html += "erlaubter Wertebereich

        "; + html += "" + processParameter.minParameterValueForNumericInputs + " ‐ " + processParameter.maxParameterValueForNumericInputs; + } + html += "
        "; + return html; + } + else { + return "keine"; + } + }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + if (params.data && params.data.variableProcessParameters && params.data.variableProcessParameters.length > 0) { + return JSON.stringify(params.data.variableProcessParameters); + } + else { + return "keine"; + } + } } - - html += ""; - return html; - } - else{ - return "keine"; - } - - }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - - if(params.data && params.data.requiredIndicatorIds && params.data.requiredIndicatorIds.length > 0){ - let string = JSON.stringify(params.data.requiredIndicatorIds); - - for (const baseIndicatorId of params.data.requiredIndicatorIds) { - string += kommonitorDataExchangeService.getIndicatorNameFromIndicatorId(baseIndicatorId); - } - - return string; - } - else{ - return "keine"; - } - } - }, - { headerName: 'notwendige Basis-Georessourcen', minWidth: 300, cellRenderer: function (params) { - if(params.data && params.data.requiredGeoresourceIds && params.data.requiredGeoresourceIds.length > 0){ - let html = ''; - - for (const baseGeoresourceId of params.data.requiredGeoresourceIds) { - html += ""; - html += ""; - html += ""; - html += ""; + ]; + return columnDefs; + }; + this.buildDataGridRowData_scripts = function (dataArray) { + return dataArray; + }; + this.buildDataGridOptions_scripts = function (scriptsArray) { + let columnDefs = this.buildDataGridColumnConfig_scripts(); + let rowData = this.buildDataGridRowData_scripts(scriptsArray); + let gridOptions = { + defaultColDef: { + editable: false, + sortable: true, + flex: 1, + minWidth: 200, + filter: true, + floatingFilter: true, + // filterParams: { + // newRowsAction: 'keep' + // }, + resizable: true, + wrapText: true, + autoHeight: true, + cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, + headerComponentParams: { + template: '', + }, + }, + columnDefs: columnDefs, + rowData: rowData, + suppressRowClickSelection: true, + rowSelection: 'multiple', + enableCellTextSelection: true, + ensureDomOrder: true, + pagination: true, + paginationPageSize: 10, + suppressColumnVirtualisation: true, + onFirstDataRendered: function () { + headerHeightSetter(self.dataGridOptions_scripts); + }, + onColumnResized: function () { + headerHeightSetter(self.dataGridOptions_scripts); } - - html += "
        IdName
        " + baseGeoresourceId + "" + kommonitorDataExchangeService.getGeoresourceNameFromGeoresourceId(baseGeoresourceId) + "
        "; - return html; - } - else{ - return "keine"; - } - }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - if(params.data && params.data.requiredGeoresourceIds && params.data.requiredGeoresourceIds.length > 0){ - let string = JSON.stringify(params.data.requiredGeoresourceIds); - - for (const baseIndicatorId of params.data.requiredGeoresourceIds) { - string += kommonitorDataExchangeService.getGeoresourceNameFromGeoresourceId(baseIndicatorId); - } - - return string; - } - else{ - return "keine"; - } - } - }, - { headerName: 'Prozessparameter', field: "", minWidth: 1000, cellRenderer: function (params) { - /* - - - - - - - - - - - - - - - - - - - -
        NameBeschreibungDatentypStandard-Werterlaubter Wertebereich
        {{::processParameter.name}}{{::processParameter.description}}{{::processParameter.dataType}}{{::processParameter.defaultValue}}
        erlaubter Wertebereich {{::processParameter.minParameterValueForNumericInputs}} - {{::processParameter.maxParameterValueForNumericInputs}}
        - */ - if(params.data && params.data.variableProcessParameters && params.data.variableProcessParameters.length > 0){ - let html = ''; - - for (const processParameter of params.data.variableProcessParameters) { - html += ""; - html += ""; - html += ""; - html += ""; - html += ""; - html += ""; - html += ""; + }; + return gridOptions; + }; + this.buildDataGrid_scripts = function (scriptsArray) { + if (this.dataGridOptions_scripts && this.dataGridOptions_scripts.api && document.querySelector('#scriptOverviewTable').childElementCount > 0) { + this.saveGridStore(this.dataGridOptions_scripts); + let newRowData = this.buildDataGridRowData_scripts(scriptsArray); + this.dataGridOptions_scripts.api.setRowData(newRowData); + this.restoreGridStore(this.dataGridOptions_scripts); + } + else { + this.dataGridOptions_scripts = this.buildDataGridOptions_scripts(scriptsArray); + let gridDiv = document.querySelector('#scriptOverviewTable'); + new agGrid.Grid(gridDiv, this.dataGridOptions_scripts); + } + }; + // DEFAULT JOBS OVERVIEW TABLE + this.buildDataGridColumnConfig_defaultJobs = function () { + const columnDefs = [ + { headerName: 'Job-Id', field: "jobId", pinned: 'left', maxWidth: 125, checkboxSelection: true, headerCheckboxSelection: true, + headerCheckboxSelectionFilteredOnly: true }, + { headerName: 'Script-Id', field: "jobData.scriptId", pinned: 'left', maxWidth: 125 }, + { headerName: 'Ziel-Indikator', pinned: 'left', maxWidth: 250, cellRenderer: function (params) { + if (params.data.jobData && params.data.jobData.targetIndicatorId) { + let indicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(params.data.jobData.targetIndicatorId); + if (indicatorMetadata) { + return indicatorMetadata.indicatorName; + } + } + return ""; + }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + if (params.data.jobData && params.data.jobData.targetIndicatorId) { + let indicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(params.data.jobData.targetIndicatorId); + if (indicatorMetadata) { + return indicatorMetadata.indicatorName; + } + } + return ""; } - - html += "
        NameBeschreibungDatentypStandard-Werterlaubter Wertebereich
        " + processParameter.name + "" + processParameter.description + "" + processParameter.dataType + "" + processParameter.defaultValue + "" ; - - if(processParameter.dataType == "integer" || processParameter.dataType == "double"){ - html += "erlaubter Wertebereich

        "; - html += "" + processParameter.minParameterValueForNumericInputs + " ‐ " + processParameter.maxParameterValueForNumericInputs; - } - - html += "
        "; - return html; - } - else{ - return "keine"; - } - }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - if(params.data && params.data.variableProcessParameters && params.data.variableProcessParameters.length > 0){ - return JSON.stringify(params.data.variableProcessParameters); - } - else{ - return "keine"; - } - } - } - ]; - - return columnDefs; - }; - - this.buildDataGridRowData_scripts = function(dataArray){ - - return dataArray; - }; - - this.buildDataGridOptions_scripts = function(scriptsArray){ - let columnDefs = this.buildDataGridColumnConfig_scripts(); - let rowData = this.buildDataGridRowData_scripts(scriptsArray); - - let gridOptions = { - defaultColDef: { - editable: false, - sortable: true, - flex: 1, - minWidth: 200, - filter: true, - floatingFilter: true, - // filterParams: { - // newRowsAction: 'keep' - // }, - resizable: true, - wrapText: true, - autoHeight: true, - cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, - headerComponentParams: { - template: - '', - }, - }, - columnDefs: columnDefs, - rowData: rowData, - suppressRowClickSelection: true, - rowSelection: 'multiple', - enableCellTextSelection: true, - ensureDomOrder: true, - pagination: true, - paginationPageSize: 10, - suppressColumnVirtualisation: true, - onFirstDataRendered: function () { - headerHeightSetter(self.dataGridOptions_scripts); - }, - onColumnResized: function () { - headerHeightSetter(self.dataGridOptions_scripts); + }, + { headerName: 'Job-Status', field: "status", maxWidth: 125 }, + { headerName: 'Job-Fortschritt', field: "progress", maxWidth: 125 }, + { headerName: 'Job-Data', minWidth: 500, cellRenderer: function (params) { + return kommonitorDataExchangeService.syntaxHighlightJSON(params.data.jobData); + }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return params.data.jobData; + } + }, + { headerName: 'Job-Logs', maxWidth: 150, cellRenderer: function (params) { + if (params.data.logs) { + var logJSON = JSON.stringify(params.data.logs); + var blob = new Blob([logJSON], { type: "application/json" }); + var data = URL.createObjectURL(blob); + let html = ''; + return html; + } + else { + return "Dieser Job umfasst keine Logs"; + } + }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return params.data.logs; + } + }, + { headerName: 'Job-Summary', minWidth: 1000, cellRenderer: function (params) { + let html = ""; + if (params.data.spatialUnitIntegrationSummary && params.data.spatialUnitIntegrationSummary.length > 0) { + html += ''; + for (const item of params.data.spatialUnitIntegrationSummary) { + html += ""; + html += ""; + html += ""; + html += ""; + html += ""; + html += ""; + if (item.errorsOccurred && item.errorsOccurred.length > 0) { + html += ""; + } + else { + html += ""; + } + html += ""; + } + html += "
        Raumeinheits-IdRaumeinheits-NameAnzahl integrierter Indikatoren-FeaturesAnzahl integrierter Zeitstempelintegrierte ZeitstempelFehlermeldung
        " + item.spatialUnitId + "" + item.spatialUnitName + "" + item.numberOfIntegratedIndicatorFeatures + "" + item.numberOfIntegratedTargetDates + "" + item.integratedTargetDates + "" + kommonitorDataExchangeService.syntaxHighlightJSON(item.errorsOccurred) + "keine Fehlermeldungen vorhanden
        "; + } + else { + html += "Dieser Job umfasst keine Informationen zur erfolgreichen/gescheiterten Datenintegration"; + } + return html; + }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return JSON.stringify(params.data.spatialUnitIntegrationSummary); + } + } + ]; + return columnDefs; + }; + this.buildDataGridRowData_defaultJobs = function (dataArray) { + dataArray.sort((a, b) => b.jobId - a.jobId); + return dataArray; + }; + this.buildDataGridOptions_defaultJobs = function (jobsArray) { + let columnDefs = this.buildDataGridColumnConfig_defaultJobs(); + let rowData = this.buildDataGridRowData_defaultJobs(jobsArray); + let gridOptions = { + defaultColDef: { + editable: false, + sortable: true, + flex: 1, + minWidth: 200, + filter: true, + floatingFilter: true, + // filterParams: { + // newRowsAction: 'keep' + // }, + resizable: true, + wrapText: true, + autoHeight: true, + cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, + headerComponentParams: { + template: '', + }, + }, + columnDefs: columnDefs, + rowData: rowData, + suppressRowClickSelection: true, + rowSelection: 'multiple', + enableCellTextSelection: true, + ensureDomOrder: true, + pagination: true, + paginationPageSize: 10, + suppressColumnVirtualisation: true, + onFirstDataRendered: function () { + headerHeightSetter(self.dataGridOptions_scripts); + }, + onColumnResized: function () { + headerHeightSetter(self.dataGridOptions_scripts); + } + }; + return gridOptions; + }; + this.buildDataGrid_defaultJobs = function (jobsArray) { + if (this.dataGridOptions_defaultJobs && this.dataGridOptions_defaultJobs.api && document.querySelector('#jobExecutionTable_defaultComputation').childElementCount > 0) { + this.saveGridStore(this.dataGridOptions_defaultJobs); + let newRowData = this.buildDataGridRowData_defaultJobs(jobsArray); + this.dataGridOptions_defaultJobs.api.setRowData(newRowData); + this.restoreGridStore(this.dataGridOptions_defaultJobs); } - - }; - - return gridOptions; - }; - - this.buildDataGrid_scripts = function (scriptsArray) { - - if (this.dataGridOptions_scripts && this.dataGridOptions_scripts.api && document.querySelector('#scriptOverviewTable').childElementCount > 0) { - - this.saveGridStore(this.dataGridOptions_scripts); - let newRowData = this.buildDataGridRowData_scripts(scriptsArray); - this.dataGridOptions_scripts.api.setRowData(newRowData); - this.restoreGridStore(this.dataGridOptions_scripts); - } - else { - this.dataGridOptions_scripts = this.buildDataGridOptions_scripts(scriptsArray); - let gridDiv = document.querySelector('#scriptOverviewTable'); - new agGrid.Grid(gridDiv, this.dataGridOptions_scripts); + else { + this.dataGridOptions_defaultJobs = this.buildDataGridOptions_defaultJobs(jobsArray); + let gridDiv = document.querySelector('#jobExecutionTable_defaultComputation'); + new agGrid.Grid(gridDiv, this.dataGridOptions_defaultJobs); + } + }; + // CUSTOMIZED JOBS OVERVIEW TABLE + this.buildDataGridColumnConfig_customizedJobs = function () { + const columnDefs = [ + { headerName: 'Job-Id', field: "jobId", pinned: 'left', maxWidth: 125, checkboxSelection: true, headerCheckboxSelection: true, + headerCheckboxSelectionFilteredOnly: true }, + { headerName: 'Job-Status', field: "status", maxWidth: 125 }, + { headerName: 'Job-Fortschritt', field: "progress", maxWidth: 125 }, + { headerName: 'Job-Data', minWidth: 500, cellRenderer: function (params) { + return kommonitorDataExchangeService.syntaxHighlightJSON(params.data.jobData); + }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return params.data.jobData; + } + }, + { headerName: 'Job-Logs', maxWidth: 150, cellRenderer: function (params) { + if (params.data.logs) { + var logJSON = JSON.stringify(params.data.logs); + var blob = new Blob([logJSON], { type: "application/json" }); + var data = URL.createObjectURL(blob); + let html = ''; + return html; + } + else { + return "Dieser Job umfasst keine Logs"; + } + }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return params.data.logs; + } + } + ]; + return columnDefs; + }; + this.buildDataGridRowData_customizedJobs = function (dataArray) { + dataArray.sort((a, b) => b.jobId - a.jobId); + return dataArray; + }; + this.buildDataGridOptions_customizedJobs = function (jobsArray) { + let columnDefs = this.buildDataGridColumnConfig_customizedJobs(); + let rowData = this.buildDataGridRowData_customizedJobs(jobsArray); + let gridOptions = { + defaultColDef: { + editable: false, + sortable: true, + flex: 1, + minWidth: 200, + filter: true, + floatingFilter: true, + // filterParams: { + // newRowsAction: 'keep' + // }, + resizable: true, + wrapText: true, + autoHeight: true, + cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, + headerComponentParams: { + template: '', + }, + }, + columnDefs: columnDefs, + rowData: rowData, + suppressRowClickSelection: true, + rowSelection: 'multiple', + enableCellTextSelection: true, + ensureDomOrder: true, + pagination: true, + paginationPageSize: 10, + suppressColumnVirtualisation: true, + onFirstDataRendered: function () { + headerHeightSetter(self.dataGridOptions_scripts); + }, + onColumnResized: function () { + headerHeightSetter(self.dataGridOptions_scripts); + } + }; + return gridOptions; + }; + this.buildDataGrid_customizedJobs = function (jobsArray) { + if (this.dataGridOptions_customizedJobs && this.dataGridOptions_customizedJobs.api && document.querySelector('#jobExecutionTable_customizedComputation').childElementCount > 0) { + this.saveGridStore(this.dataGridOptions_customizedJobs); + let newRowData = this.buildDataGridRowData_customizedJobs(jobsArray); + this.dataGridOptions_customizedJobs.api.setRowData(newRowData); + this.restoreGridStore(this.dataGridOptions_customizedJobs); + } + else { + this.dataGridOptions_customizedJobs = this.buildDataGridOptions_customizedJobs(jobsArray); + let gridDiv = document.querySelector('#jobExecutionTable_customizedComputation'); + new agGrid.Grid(gridDiv, this.dataGridOptions_customizedJobs); + } + }; + function anyHigherRoleIsChecked(roles, roleSuffix) { + let filteresRoles = []; + if (roleSuffix == "viewer") { + filteresRoles = roles.filter(function (role) { + if (role.isChecked && (role.permissionLevel == "editor" || role.permissionLevel == "creator")) { + return true; + } + }); + } + else if (roleSuffix == "editor") { + filteresRoles = roles.filter(function (role) { + if (role.isChecked && role.permissionLevel == "creator") { + return true; + } + }); + } + return filteresRoles.length > 0; } - }; - - // DEFAULT JOBS OVERVIEW TABLE - - this.buildDataGridColumnConfig_defaultJobs = function(){ - const columnDefs = [ - { headerName: 'Job-Id', field: "jobId", pinned: 'left', maxWidth: 125, checkboxSelection: true, headerCheckboxSelection: true, - headerCheckboxSelectionFilteredOnly: true }, - { headerName: 'Script-Id', field: "jobData.scriptId", pinned: 'left', maxWidth: 125 }, - { headerName: 'Ziel-Indikator', pinned: 'left', maxWidth: 250, cellRenderer: function (params) { - if(params.data.jobData && params.data.jobData.targetIndicatorId){ - let indicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(params.data.jobData.targetIndicatorId); - if (indicatorMetadata){ - return indicatorMetadata.indicatorName; - } + ; + function CheckboxRenderer_viewer() { } + CheckboxRenderer_viewer.prototype.init = function (params) { + this.params = params; + let isChecked = false; + let exists = false; + let className; + for (const role of params.data.roles) { + if (role.permissionLevel == "viewer") { + exists = true; + isChecked = role.isChecked; + className = role.roleId; + break; + } + } + if (exists) { + this.eGui = document.createElement('input'); + this.eGui.className = className; + this.eGui.type = 'checkbox'; + this.eGui.checked = isChecked; + this.checkedHandler = this.checkedHandler.bind(this); + this.eGui.addEventListener('click', this.checkedHandler); + // if higher role rights are checked as well + if (isChecked && anyHigherRoleIsChecked(params.data.roles, "viewer")) { + this.eGui.disabled = true; + } + } + }; + CheckboxRenderer_viewer.prototype.checkedHandler = function (e) { + let checked = e.target.checked; + for (const role of this.params.data.roles) { + if (role.permissionLevel == "viewer") { + role.isChecked = checked; + break; + } } - return ""; - }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - if(params.data.jobData && params.data.jobData.targetIndicatorId){ - let indicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(params.data.jobData.targetIndicatorId); - if (indicatorMetadata){ - return indicatorMetadata.indicatorName; + }; + CheckboxRenderer_viewer.prototype.getGui = function (params) { + return this.eGui; + }; + CheckboxRenderer_viewer.prototype.destroy = function (params) { + if (this.eGui) { + this.eGui.removeEventListener('click', this.checkedHandler); + } + }; + function CheckboxRenderer_editor() { } + CheckboxRenderer_editor.prototype.init = function (params) { + this.params = params; + let isChecked = false; + let exists = false; + let className; + for (const role of params.data.roles) { + if (role.permissionLevel == "editor") { + exists = true; + isChecked = role.isChecked; + className = role.roleId; + break; } - } - return ""; - } - }, - { headerName: 'Job-Status', field: "status", maxWidth: 125 }, - { headerName: 'Job-Fortschritt', field: "progress", maxWidth: 125 }, - { headerName: 'Job-Data', minWidth: 500, cellRenderer: function (params) { - return kommonitorDataExchangeService.syntaxHighlightJSON(params.data.jobData); - }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return params.data.jobData; - } - }, - { headerName: 'Job-Logs', maxWidth: 150, cellRenderer: function (params) { - if(params.data.logs){ - - var logJSON = JSON.stringify(params.data.logs); - - var blob = new Blob([logJSON], {type: "application/json"}); - var data = URL.createObjectURL(blob); - - let html = ''; - return html; - } - else{ - return "Dieser Job umfasst keine Logs"; } - }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return params.data.logs; - } - }, - { headerName: 'Job-Summary', minWidth: 1000, cellRenderer: function (params) { - - let html = ""; - if(params.data.spatialUnitIntegrationSummary && params.data.spatialUnitIntegrationSummary.length > 0){ - html += ''; - - for (const item of params.data.spatialUnitIntegrationSummary) { - html += ""; - html += ""; - html += ""; - html += ""; - html += ""; - html += ""; - if(item.errorsOccurred && item.errorsOccurred.length > 0){ - html += ""; + if (exists) { + this.eGui = document.createElement('input'); + this.eGui.className = className; + this.eGui.type = 'checkbox'; + this.eGui.checked = isChecked; + this.checkedHandler = this.checkedHandler.bind(this); + this.eGui.addEventListener('click', this.checkedHandler); + // if higher role rights are checked as well + if (isChecked && anyHigherRoleIsChecked(params.data.roles, "editor")) { + this.eGui.disabled = true; + } + } + }; + CheckboxRenderer_editor.prototype.checkedHandler = function (e) { + let checked = e.target.checked; + for (const role of this.params.data.roles) { + if (role.permissionLevel == "viewer") { + if (checked) { + role.isChecked = true; + $('.' + role.roleId).attr('disabled', true); + $('.' + role.roleId).prop("checked", true); } - else{ - html += ""; + else { + $('.' + role.roleId).attr('disabled', false); } - - html += ""; - } - html += "
        Raumeinheits-IdRaumeinheits-NameAnzahl integrierter Indikatoren-FeaturesAnzahl integrierter Zeitstempelintegrierte ZeitstempelFehlermeldung
        " + item.spatialUnitId + "" + item.spatialUnitName + "" + item.numberOfIntegratedIndicatorFeatures + "" + item.numberOfIntegratedTargetDates + "" + item.integratedTargetDates + "" + kommonitorDataExchangeService.syntaxHighlightJSON(item.errorsOccurred) + "keine Fehlermeldungen vorhanden
        "; } - else{ - html += "Dieser Job umfasst keine Informationen zur erfolgreichen/gescheiterten Datenintegration"; + else if (role.permissionLevel == "editor") { + role.isChecked = checked; } - - return html; - }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return JSON.stringify(params.data.spatialUnitIntegrationSummary); - } - } - - ]; - - return columnDefs; - }; - - this.buildDataGridRowData_defaultJobs = function(dataArray){ - - dataArray.sort((a, b) => b.jobId - a.jobId); - - return dataArray; - }; - - this.buildDataGridOptions_defaultJobs = function(jobsArray){ - let columnDefs = this.buildDataGridColumnConfig_defaultJobs(); - let rowData = this.buildDataGridRowData_defaultJobs(jobsArray); - - let gridOptions = { - defaultColDef: { - editable: false, - sortable: true, - flex: 1, - minWidth: 200, - filter: true, - floatingFilter: true, - // filterParams: { - // newRowsAction: 'keep' - // }, - resizable: true, - wrapText: true, - autoHeight: true, - cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, - headerComponentParams: { - template: - '', - }, - }, - columnDefs: columnDefs, - rowData: rowData, - suppressRowClickSelection: true, - rowSelection: 'multiple', - enableCellTextSelection: true, - ensureDomOrder: true, - pagination: true, - paginationPageSize: 10, - suppressColumnVirtualisation: true, - onFirstDataRendered: function () { - headerHeightSetter(self.dataGridOptions_scripts); - }, - onColumnResized: function () { - headerHeightSetter(self.dataGridOptions_scripts); } - - }; - - return gridOptions; - }; - - this.buildDataGrid_defaultJobs = function (jobsArray) { - - if (this.dataGridOptions_defaultJobs && this.dataGridOptions_defaultJobs.api && document.querySelector('#jobExecutionTable_defaultComputation').childElementCount > 0) { - - this.saveGridStore(this.dataGridOptions_defaultJobs); - let newRowData = this.buildDataGridRowData_defaultJobs(jobsArray); - this.dataGridOptions_defaultJobs.api.setRowData(newRowData); - this.restoreGridStore(this.dataGridOptions_defaultJobs); - } - else { - this.dataGridOptions_defaultJobs = this.buildDataGridOptions_defaultJobs(jobsArray); - let gridDiv = document.querySelector('#jobExecutionTable_defaultComputation'); - new agGrid.Grid(gridDiv, this.dataGridOptions_defaultJobs); - } - }; - - // CUSTOMIZED JOBS OVERVIEW TABLE - - this.buildDataGridColumnConfig_customizedJobs = function(){ - const columnDefs = [ - { headerName: 'Job-Id', field: "jobId", pinned: 'left', maxWidth: 125, checkboxSelection: true, headerCheckboxSelection: true, - headerCheckboxSelectionFilteredOnly: true}, - { headerName: 'Job-Status', field: "status", maxWidth: 125 }, - { headerName: 'Job-Fortschritt', field: "progress", maxWidth: 125 }, - { headerName: 'Job-Data', minWidth: 500, cellRenderer: function (params) { - return kommonitorDataExchangeService.syntaxHighlightJSON(params.data.jobData); - }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return params.data.jobData; - } - }, - { headerName: 'Job-Logs', maxWidth: 150, cellRenderer: function (params) { - if(params.data.logs){ - - var logJSON = JSON.stringify(params.data.logs); - - var blob = new Blob([logJSON], {type: "application/json"}); - var data = URL.createObjectURL(blob); - - let html = ''; - return html; - } - else{ - return "Dieser Job umfasst keine Logs"; - } - }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return params.data.logs; - } - } - - ]; - - return columnDefs; - }; - - this.buildDataGridRowData_customizedJobs = function(dataArray){ - - dataArray.sort((a, b) => b.jobId - a.jobId); - - return dataArray; - }; - - this.buildDataGridOptions_customizedJobs = function(jobsArray){ - let columnDefs = this.buildDataGridColumnConfig_customizedJobs(); - let rowData = this.buildDataGridRowData_customizedJobs(jobsArray); - - let gridOptions = { - defaultColDef: { - editable: false, - sortable: true, - flex: 1, - minWidth: 200, - filter: true, - floatingFilter: true, - // filterParams: { - // newRowsAction: 'keep' - // }, - resizable: true, - wrapText: true, - autoHeight: true, - cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, - headerComponentParams: { - template: - '', - }, - }, - columnDefs: columnDefs, - rowData: rowData, - suppressRowClickSelection: true, - rowSelection: 'multiple', - enableCellTextSelection: true, - ensureDomOrder: true, - pagination: true, - paginationPageSize: 10, - suppressColumnVirtualisation: true, - onFirstDataRendered: function () { - headerHeightSetter(self.dataGridOptions_scripts); - }, - onColumnResized: function () { - headerHeightSetter(self.dataGridOptions_scripts); + }; + CheckboxRenderer_editor.prototype.getGui = function (params) { + return this.eGui; + }; + CheckboxRenderer_editor.prototype.destroy = function (params) { + if (this.eGui) { + this.eGui.removeEventListener('click', this.checkedHandler); } - - }; - - return gridOptions; - }; - - this.buildDataGrid_customizedJobs = function (jobsArray) { - - if (this.dataGridOptions_customizedJobs && this.dataGridOptions_customizedJobs.api && document.querySelector('#jobExecutionTable_customizedComputation').childElementCount > 0) { - - this.saveGridStore(this.dataGridOptions_customizedJobs); - let newRowData = this.buildDataGridRowData_customizedJobs(jobsArray); - this.dataGridOptions_customizedJobs.api.setRowData(newRowData); - this.restoreGridStore(this.dataGridOptions_customizedJobs); - } - else { - this.dataGridOptions_customizedJobs = this.buildDataGridOptions_customizedJobs(jobsArray); - let gridDiv = document.querySelector('#jobExecutionTable_customizedComputation'); - new agGrid.Grid(gridDiv, this.dataGridOptions_customizedJobs); - } - }; - - function anyHigherRoleIsChecked(roles, roleSuffix){ - let filteresRoles = []; - - if(roleSuffix == "viewer"){ - filteresRoles = roles.filter(function(role){ - if (role.isChecked && (role.permissionLevel == "editor" || role.permissionLevel == "creator")){ - return true; + }; + function CheckboxRenderer_creator() { } + CheckboxRenderer_creator.prototype.init = function (params) { + this.params = params; + let isChecked = false; + let exists = false; + let className; + for (const role of params.data.roles) { + if (role.permissionLevel == "creator") { + exists = true; + isChecked = role.isChecked; + className = role.roleId; + break; + } } - }); - } - else if (roleSuffix == "editor"){ - filteresRoles = roles.filter(function(role){ - if (role.isChecked && role.permissionLevel == "creator"){ - return true; + if (exists) { + this.eGui = document.createElement('input'); + this.eGui.className = className; + this.eGui.type = 'checkbox'; + this.eGui.checked = isChecked; + this.checkedHandler = this.checkedHandler.bind(this); + this.eGui.addEventListener('click', this.checkedHandler); } - }); - } - - return filteresRoles.length > 0; - }; - - function CheckboxRenderer_viewer() {} - - CheckboxRenderer_viewer.prototype.init = function(params) { - this.params = params; - - let isChecked = false; - let exists = false; - let className; - for (const role of params.data.roles) { - if (role.permissionLevel == "viewer"){ - exists = true; - isChecked = role.isChecked; - className = role.roleId; - break; - } - } - - if(exists){ - this.eGui = document.createElement('input'); - this.eGui.className = className; - this.eGui.type = 'checkbox'; - this.eGui.checked = isChecked; - - this.checkedHandler = this.checkedHandler.bind(this); - this.eGui.addEventListener('click', this.checkedHandler); - // if higher role rights are checked as well - if(isChecked && anyHigherRoleIsChecked(params.data.roles, "viewer")){ - this.eGui.disabled = true; - } - } - }; - - CheckboxRenderer_viewer.prototype.checkedHandler = function(e) { - let checked = e.target.checked; - for (const role of this.params.data.roles) { - if (role.permissionLevel == "viewer"){ - role.isChecked = checked; - break; - } - } - }; - - CheckboxRenderer_viewer.prototype.getGui = function(params) { - return this.eGui; - }; - - CheckboxRenderer_viewer.prototype.destroy = function(params) { - if(this.eGui){ - this.eGui.removeEventListener('click', this.checkedHandler); - } - }; - - function CheckboxRenderer_editor() {} - - CheckboxRenderer_editor.prototype.init = function(params) { - this.params = params; - - let isChecked = false; - let exists = false; - let className; - for (const role of params.data.roles) { - if (role.permissionLevel == "editor"){ - exists = true; - isChecked = role.isChecked; - className = role.roleId; - break; - } - } - - if(exists){ - this.eGui = document.createElement('input'); - this.eGui.className = className; - this.eGui.type = 'checkbox'; - this.eGui.checked = isChecked; - - this.checkedHandler = this.checkedHandler.bind(this); - this.eGui.addEventListener('click', this.checkedHandler); - // if higher role rights are checked as well - if(isChecked && anyHigherRoleIsChecked(params.data.roles, "editor")){ - this.eGui.disabled = true; - } - } - }; - - CheckboxRenderer_editor.prototype.checkedHandler = function(e) { - let checked = e.target.checked; - for (const role of this.params.data.roles) { - if (role.permissionLevel == "viewer"){ - if (checked){ - role.isChecked = true; - $('.' + role.roleId).attr('disabled', true); - $('.' + role.roleId).prop("checked", true); - } - else{ - $('.' + role.roleId).attr('disabled', false); + }; + CheckboxRenderer_creator.prototype.checkedHandler = function (e) { + let checked = e.target.checked; + for (const role of this.params.data.roles) { + if (role.permissionLevel == "editor") { + if (checked) { + role.isChecked = true; + $('.' + role.roleId).attr('disabled', true); + $('.' + role.roleId).prop("checked", true); + } + else { + $('.' + role.roleId).attr('disabled', false); + } + } + else if (role.permissionLevel == "viewer") { + if (checked) { + role.isChecked = true; + $('.' + role.roleId).attr('disabled', true); + $('.' + role.roleId).prop("checked", true); + } + else { + $('.' + role.roleId).attr('disabled', true); + } + } + else if (role.permissionLevel == "creator" || role.permissionLevel == "editor" || role.permissionLevel == "viewer") { + role.isChecked = checked; + } } - } - else if (role.permissionLevel == "editor"){ - role.isChecked = checked; - } - } - }; - - CheckboxRenderer_editor.prototype.getGui = function(params) { - return this.eGui; - }; - - CheckboxRenderer_editor.prototype.destroy = function(params) { - if(this.eGui){ - this.eGui.removeEventListener('click', this.checkedHandler); - } - }; - - function CheckboxRenderer_creator() {} - - CheckboxRenderer_creator.prototype.init = function(params) { - this.params = params; - - let isChecked = false; - let exists = false; - let className; - for (const role of params.data.roles) { - if (role.permissionLevel == "creator"){ - exists = true; - isChecked = role.isChecked; - className = role.roleId; - break; - } - } - - if(exists){ - this.eGui = document.createElement('input'); - this.eGui.className = className; - this.eGui.type = 'checkbox'; - this.eGui.checked = isChecked; - - this.checkedHandler = this.checkedHandler.bind(this); - this.eGui.addEventListener('click', this.checkedHandler); - } - }; - - CheckboxRenderer_creator.prototype.checkedHandler = function(e) { - let checked = e.target.checked; - for (const role of this.params.data.roles) { - if (role.permissionLevel == "editor"){ - if (checked){ - role.isChecked = true; - $('.' + role.roleId).attr('disabled', true); - $('.' + role.roleId).prop("checked", true); - } - else{ - $('.' + role.roleId).attr('disabled', false); + }; + CheckboxRenderer_creator.prototype.getGui = function (params) { + return this.eGui; + }; + CheckboxRenderer_creator.prototype.destroy = function (params) { + if (this.eGui) { + this.eGui.removeEventListener('click', this.checkedHandler); + } + }; + this.buildRoleManagementGridRowData = function (accessControlMetadata, selectedRoleIds) { + let data = JSON.parse(JSON.stringify(accessControlMetadata)); + for (let elem of data) { + for (let role of elem.roles) { + role.isChecked = false; + if (selectedRoleIds && selectedRoleIds.includes(role.roleId)) { + role.isChecked = true; + } + } + } + let array = []; + array.push(data[0]); + array.push(data[1]); + data.splice(0, 2); + data.sort(function (a, b) { + if (a.name < b.name) { + return -1; + } + if (a.name > b.name) { + return 1; + } + return 0; + }); + array = array.concat(data); + return array; + }; + this.buildRoleManagementGridColumnConfig = function () { + let columnDefs = []; + return columnDefs.concat([ + { headerName: 'Organisationseinheit', field: "name", minWidth: 200 }, + { headerName: 'lesen', field: "roles", filter: false, sortable: false, maxWidth: 100, cellRenderer: 'checkboxRenderer_viewer', }, + { headerName: 'editieren', field: "roles", filter: false, sortable: false, maxWidth: 100, cellRenderer: 'checkboxRenderer_editor', }, + { headerName: 'löschen', field: "roles", filter: false, sortable: false, maxWidth: 100, cellRenderer: 'checkboxRenderer_creator', } + ]); + }; + this.buildRoleManagementGridOptions = function (accessControlMetadata, selectedRoleIds) { + let columnDefs = this.buildRoleManagementGridColumnConfig(); + let rowData = this.buildRoleManagementGridRowData(accessControlMetadata, selectedRoleIds); + let components = { + checkboxRenderer_viewer: CheckboxRenderer_viewer, + checkboxRenderer_editor: CheckboxRenderer_editor, + checkboxRenderer_creator: CheckboxRenderer_creator + }; + let gridOptions = { + defaultColDef: { + editable: false, + sortable: true, + flex: 1, + minWidth: 200, + filter: true, + floatingFilter: false, + // filterParams: { + // newRowsAction: 'keep' + // }, + resizable: true, + wrapText: true, + autoHeight: true, + cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, + headerComponentParams: { + template: '', + }, + }, + components: components, + floatingFilter: false, + columnDefs: columnDefs, + rowData: rowData, + rowHeight: 10, + suppressRowClickSelection: true, + rowSelection: 'multiple', + enableCellTextSelection: false, + ensureDomOrder: true, + pagination: true, + paginationPageSize: 5, + suppressColumnVirtualisation: true, + onFirstDataRendered: function () { + }, + onColumnResized: function () { + self.registerClickHandler_accessControl(accessControlMetadata); + }, + onRowDataChanged: function () { + self.registerClickHandler_accessControl(accessControlMetadata); + }, + onModelUpdated: function () { + self.registerClickHandler_accessControl(accessControlMetadata); + }, + onViewportChanged: function () { + self.registerClickHandler_accessControl(accessControlMetadata); + }, + }; + return gridOptions; + }; + this.buildRoleManagementGrid = function (tableDOMId, currentTableOptionsObject, accessControlMetadata, selectedRoleIds) { + if (currentTableOptionsObject && currentTableOptionsObject.api) { + let newRowData = this.buildRoleManagementGridRowData(accessControlMetadata, selectedRoleIds); + currentTableOptionsObject.api.setRowData(newRowData); } - } - else if (role.permissionLevel == "viewer"){ - if (checked){ - role.isChecked = true; - $('.' + role.roleId).attr('disabled', true); - $('.' + role.roleId).prop("checked", true); - } - else{ - $('.' + role.roleId).attr('disabled', true); + else { + currentTableOptionsObject = this.buildRoleManagementGridOptions(accessControlMetadata, selectedRoleIds); + let gridDiv = document.querySelector('#' + tableDOMId); + new agGrid.Grid(gridDiv, currentTableOptionsObject); } - } - else if (role.permissionLevel == "creator" || role.permissionLevel == "editor" || role.permissionLevel == "viewer"){ - role.isChecked = checked; - } - } - }; - - CheckboxRenderer_creator.prototype.getGui = function(params) { - return this.eGui; - }; - - CheckboxRenderer_creator.prototype.destroy = function(params) { - if(this.eGui){ - this.eGui.removeEventListener('click', this.checkedHandler); - } - }; - - this.buildRoleManagementGridRowData = function(accessControlMetadata, selectedRoleIds){ - let data = JSON.parse(JSON.stringify(accessControlMetadata)); - for (let elem of data) { - for (let role of elem.roles) { - role.isChecked = false; - if (selectedRoleIds && selectedRoleIds.includes(role.roleId)){ - role.isChecked = true; + return currentTableOptionsObject; + }; + this.getSelectedRoleIds_roleManagementGrid = function (roleManagementTableOptions) { + let ids = []; + if (roleManagementTableOptions && roleManagementTableOptions.api) { + roleManagementTableOptions.api.forEachNode(function (node, index) { + for (const role of node.data.roles) { + if (role && role.isChecked) { + ids.push(role.roleId); + } + } + }); } - } - } - - let array = []; - array.push(data[0]); - array.push(data[1]); - - data.splice(0,2); - data.sort(function (a, b) { - if (a.name < b.name) { - return -1; - } - if (a.name > b.name) { - return 1; - } - return 0; - }); - - array = array.concat(data); - - return array; - }; - - this.buildRoleManagementGridColumnConfig = function(){ - let columnDefs = []; - - return columnDefs.concat([ - { headerName: 'Organisationseinheit', field: "name", minWidth: 200 }, - { headerName: 'lesen', field: "roles", filter: false, sortable: false, maxWidth: 100, cellRenderer: 'checkboxRenderer_viewer', }, - { headerName: 'editieren', field: "roles", filter: false, sortable: false, maxWidth: 100, cellRenderer: 'checkboxRenderer_editor', }, - { headerName: 'löschen', field: "roles", filter: false, sortable: false, maxWidth: 100, cellRenderer: 'checkboxRenderer_creator', } - ]); - }; - - this.buildRoleManagementGridOptions = function(accessControlMetadata, selectedRoleIds){ - let columnDefs = this.buildRoleManagementGridColumnConfig(); - let rowData = this.buildRoleManagementGridRowData(accessControlMetadata, selectedRoleIds); - - let components = { - checkboxRenderer_viewer: CheckboxRenderer_viewer, - checkboxRenderer_editor: CheckboxRenderer_editor, - checkboxRenderer_creator: CheckboxRenderer_creator - }; - - let gridOptions = { - defaultColDef: { - editable: false, - sortable: true, - flex: 1, - minWidth: 200, - filter: true, - floatingFilter: false, - // filterParams: { - // newRowsAction: 'keep' - // }, - resizable: true, - wrapText: true, - autoHeight: true, - cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, - headerComponentParams: { - template: - '', - }, - }, - components: components, - floatingFilter: false, - columnDefs: columnDefs, - rowData: rowData, - rowHeight: 10, - suppressRowClickSelection: true, - rowSelection: 'multiple', - enableCellTextSelection: false, - ensureDomOrder: true, - pagination: true, - paginationPageSize: 5, - suppressColumnVirtualisation: true, - onFirstDataRendered: function () { - }, - onColumnResized: function () { - self.registerClickHandler_accessControl(accessControlMetadata); - }, - onRowDataChanged: function () { - self.registerClickHandler_accessControl(accessControlMetadata); - }, - onModelUpdated: function () { - self.registerClickHandler_accessControl(accessControlMetadata); - }, - onViewportChanged: function () { - self.registerClickHandler_accessControl(accessControlMetadata); - }, - - }; - - return gridOptions; - }; - - this.buildRoleManagementGrid = function(tableDOMId, currentTableOptionsObject, accessControlMetadata, selectedRoleIds){ - if (currentTableOptionsObject && currentTableOptionsObject.api) { - - let newRowData = this.buildRoleManagementGridRowData(accessControlMetadata, selectedRoleIds); - currentTableOptionsObject.api.setRowData(newRowData); - } - else { - currentTableOptionsObject = this.buildRoleManagementGridOptions(accessControlMetadata, selectedRoleIds); - let gridDiv = document.querySelector('#' + tableDOMId); - new agGrid.Grid(gridDiv, currentTableOptionsObject); - } - return currentTableOptionsObject; - }; - - this.getSelectedRoleIds_roleManagementGrid = function(roleManagementTableOptions){ - let ids = []; - if (roleManagementTableOptions && roleManagementTableOptions.api){ - - roleManagementTableOptions.api.forEachNode(function(node, index){ - for (const role of node.data.roles) { - if(role && role.isChecked){ - ids.push(role.roleId); - } + return ids; + }; + this.saveGridStore = function (gridOptions) { + window.colState = gridOptions.columnApi.getColumnState(); + window.filterState = gridOptions.api.getFilterModel(); + }; + this.restoreGridStore = function (gridOptions) { + // gridOptions.columnApi.setColumnState(window.colState); + // gridOptions.columnApi.setColumnGroupState(window.groupState); + if (window.colState) { + gridOptions.columnApi.applyColumnState({ state: window.colState, applyOrder: true }); } - }) - } - return ids; - }; - - this.saveGridStore = function (gridOptions) { - window.colState = gridOptions.columnApi.getColumnState(); - window.filterState = gridOptions.api.getFilterModel(); - - }; - - this.restoreGridStore = function (gridOptions) { - // gridOptions.columnApi.setColumnState(window.colState); - // gridOptions.columnApi.setColumnGroupState(window.groupState); - if (window.colState) { - gridOptions.columnApi.applyColumnState({ state: window.colState, applyOrder: true }); - } - - if (window.filterState) { - gridOptions.api.setFilterModel(window.filterState); - } - }; - + if (window.filterState) { + gridOptions.api.setFilterModel(window.filterState); + } + }; }]); +//# sourceMappingURL=kommonitor-data-grid-helper-service.module.js.map \ No newline at end of file diff --git a/app/util/genericServices/kommonitorDataGridHelperService/kommonitor-data-grid-helper-service.module.js.map b/app/util/genericServices/kommonitorDataGridHelperService/kommonitor-data-grid-helper-service.module.js.map new file mode 100644 index 000000000..d05651885 --- /dev/null +++ b/app/util/genericServices/kommonitorDataGridHelperService/kommonitor-data-grid-helper-service.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-data-grid-helper-service.module.js","sourceRoot":"","sources":["kommonitor-data-grid-helper-service.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,0BAA0B,EAAE,CAAC,wBAAwB,CAAC,CAAC,CAAC;AAEvE,OAAO;KACJ,MAAM,CAAC,0BAA0B,EAAE,EAAE,CAAC;KACtC,OAAO,CACN,iCAAiC,EAAE,CAAC,+BAA+B,EAAE,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,4BAA4B,EAAE,OAAO;IAC7I,UAAU,6BAA6B,EAAE,UAAU,EAAE,QAAQ,EAC3D,KAAK,EA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Service/kommonitor-data-grid-helper-service.module.ts b/app/util/genericServices/kommonitorDataGridHelperService/kommonitor-data-grid-helper-service.module.ts new file mode 100644 index 000000000..72262fa72 --- /dev/null +++ b/app/util/genericServices/kommonitorDataGridHelperService/kommonitor-data-grid-helper-service.module.ts @@ -0,0 +1,3017 @@ +angular.module('kommonitorDataGridHelper', ['kommonitorDataExchange']); + +angular + .module('kommonitorDataGridHelper', []) + .service( + 'kommonitorDataGridHelperService', ['kommonitorDataExchangeService', '$rootScope', '$timeout', '$http', '$httpParamSerializerJQLike', '__env', + function (kommonitorDataExchangeService, $rootScope, $timeout, + $http, $httpParamSerializerJQLike, __env) { + + var self = this; + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; + + this.resourceType_georesource = "georesource"; + this.resourceType_spatialUnit = "spatialUnit"; + this.resourceType_indicator = "indicator"; + + this.featureTable_spatialUnit_lastUpdate_timestamp_success = undefined; + this.featureTable_spatialUnit_lastUpdate_timestamp_failure = undefined; + this.featureTable_georesource_lastUpdate_timestamp_success = undefined; + this.featureTable_georesource_lastUpdate_timestamp_failure = undefined; + this.featureTable_indicator_lastUpdate_timestamp_success = undefined; + this.featureTable_indicator_lastUpdate_timestamp_failure = undefined; + + this.dataGridOptions_indicators; + this.dataGridOptions_georesources_poi; + this.dataGridOptions_georesources_loi; + this.dataGridOptions_georesources_aoi; + this.dataGridOptions_spatialUnits; + this.dataGridOptions_accessControl; + + function getCurrentTimestampString(){ + let date = new Date(); + let hours = date.getHours(); + if(hours < 10){ + hours = "0" + hours; + } + let minutes = date.getMinutes(); + if(minutes < 10){ + minutes = "0" + minutes; + } + let seconds = date.getSeconds(); + if(seconds < 10){ + seconds = "0" + seconds; + } + return "" + hours + ":" + minutes + ":" + seconds; + } + + function headerHeightGetter() { + var columnHeaderTexts = [ + ...document.querySelectorAll('.ag-header-cell-text'), + ]; + var clientHeights = columnHeaderTexts.map( + headerText => headerText.clientHeight + ); + var tallestHeaderTextHeight = Math.max(...clientHeights); + + return tallestHeaderTextHeight; + } + + function headerHeightSetter(gridOptions) { + var padding = 20; + var height = headerHeightGetter() + padding; + gridOptions.api.setHeaderHeight(height); + } + + var displayEditButtons_indicators = function (params) { + let disabledEditButtons = !params.data.userPermissions.includes("editor") + let editMetadataButtonId = 'btn_georesource_editMetadata_' + params.data.indicatorId; + let editFeaturesButtonId = 'btn_georesource_editFeatures_' + params.data.indicatorId; + + let html = '
        '; + html += ''; + html += ''; + + if(!disabledEditButtons){ + html = html.replaceAll("disabled", "") //enabled + } + + if (kommonitorDataExchangeService.enableKeycloakSecurity) { + // disable button if there is no applicable spatial unit or user has no creator rights + let disabled = params.data.applicableSpatialUnits.length == 0 || !params.data.userPermissions.includes("editor"); + html += ''; + html += ''; + html += '' + html += '
        '; + + return html; + }; + + var displayEditButtons_spatialUnits = function (params) { + + let html = '
        '; + html += ''; + html += ''; + html += '' + html += '
        '; + + return html; + }; + + var displayEditButtons_accessControl = function (params) { + + let html = '
        '; + html += ''; + html += '
        '; + + return html; + }; + + function getDatePicker() { + // function to act as a class + function Datepicker() {} + + // gets called once before the renderer is used + Datepicker.prototype.init = function (params) { + // create the cell + this.eInput = document.createElement('input'); + this.eInput.value = params.value; + this.eInput.classList.add('ag-input'); + this.eInput.style.height = '100%'; + + // https://jqueryui.com/datepicker/ + // $(this.eInput).datepicker({ + // dateFormat: 'yyyy-mm-dd', + // }); + $(this.eInput).datepicker(kommonitorDataExchangeService.datePickerOptions); + + }; + + // gets called once when grid ready to insert the element + Datepicker.prototype.getGui = function () { + return this.eInput; + }; + + // focus and select can be done after the gui is attached + Datepicker.prototype.afterGuiAttached = function () { + this.eInput.focus(); + this.eInput.select(); + }; + + // returns the new value after editing + Datepicker.prototype.getValue = function () { + return this.eInput.value; + }; + + // any cleanup we need to be done here + Datepicker.prototype.destroy = () => { + // but this example is simple, no cleanup, we could + // even leave this method out as it's optional + }; + + // if true, then this editor will appear in a popup + Datepicker.prototype.isPopup = () => { + // and we could leave this method out also, false is the default + return false; + }; + + return Datepicker; + } + + this.buildDataGridColumnConfig_indicators = function (indicatorMetadataArray) { + const columnDefs = [ + { headerName: 'Editierfunktionen', pinned: 'left', maxWidth: 150, checkboxSelection: false, filter: false, sortable: false, cellRenderer: 'displayEditButtons_indicators' }, + { headerName: 'Id', field: "indicatorId", pinned: 'left', maxWidth: 125 }, + { headerName: 'Name', field: "indicatorName", pinned: 'left', minWidth: 300 }, + { headerName: 'Einheit', field: "unit", minWidth: 200 }, + { headerName: 'Beschreibung', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.description; }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + params.data.metadata.description; + } + }, + { + headerName: 'Methodik', minWidth: 400, + cellRenderer: function (params) { + + if(params.data.processDescription && params.data.processDescription.includes("$$")){ + let splitArray = params.data.processDescription.split("$$"); + + for (let index = 0; index < splitArray.length; index++) { + if((index % 2) == 0){ + params.data.processDescription += "
        "; + } + } + } + return params.data.processDescription; + }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + params.data.processDescription; + } + }, + { + headerName: 'Verfügbare Raumeinheiten', field: "applicableSpatialUnits", minWidth: 400, + cellRenderer: function (params) { + /* +
          +
        • + {{::applicableSpatialUnit.spatialUnitName}} +
        • +
        + */ + let html = '
          '; + for (const applicableSpatialUnit of params.data.applicableSpatialUnits) { + html += '
        • '; + html += applicableSpatialUnit.spatialUnitName; + html += '
        • '; + } + html += '
        '; + return html; + }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + if (params.data.applicableSpatialUnits && params.data.applicableSpatialUnits.length > 1){ + return "" + JSON.stringify(params.data.applicableSpatialUnits); + } + return params.data.applicableSpatialUnits; + } + }, + { + headerName: 'Verfügbare Zeitschnitte', field: "applicableDates", minWidth: 400, + cellRenderer: function (params) { + /* +
          +
        • + {{::timestamp}} +
        • +
        + */ + let html = '
          '; + for (const timestamp of params.data.applicableDates) { + html += '
        • '; + html += timestamp; + html += '
        • '; + } + html += '
        '; + return html; + }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + if (params.data.applicableDates && params.data.applicableDates.length > 1){ + return "" + JSON.stringify(params.data.applicableDates); + } + return params.data.applicableDates; + } + }, + { headerName: 'Kürzel', field: "abbreviation" }, + { headerName: 'Leitindikator', field: "isHeadlineIndicator" }, + { headerName: 'Indikator-Typ', minWidth: 200, + cellRenderer: function (params) { return kommonitorDataExchangeService.getIndicatorStringFromIndicatorType(params.data.indicatorType); }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + kommonitorDataExchangeService.getIndicatorStringFromIndicatorType(params.data.indicatorType); + } + }, + { headerName: 'Merkmal', field: "characteristicValue", minWidth: 200 }, + { headerName: 'Art der Fortführung', field: "creationType", minWidth: 200 }, + // { headerName: 'Interpretation', minWidth: 400, cellRenderer: function(params){ return params.data.interpretation; } }, + + { headerName: 'Tags/Stichworte', field: "tags", minWidth: 250 }, + { headerName: 'Themenhierarchie', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getTopicHierarchyDisplayString(params.data.topicReference); }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + kommonitorDataExchangeService.getTopicHierarchyDisplayString(params.data.topicReference); + } + }, + { headerName: 'Datenquelle', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.datasource; }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + params.data.metadata.datasource; + } + }, + { headerName: 'Datenhalter und Kontakt', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.contact; }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + params.data.metadata.contact; + } + }, + { headerName: 'Rollen', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); + } + } + ]; + + return columnDefs; + }; + + this.buildDataGridRowData_indicators = function (indicatorMetadataArray) { + return indicatorMetadataArray; + }; + + + this.buildDataGridColumnConfig_georesources_poi = function (georesourceMetadataArray) { + const columnDefs = [ + { headerName: 'Editierfunktionen', pinned: 'left', maxWidth: 150, checkboxSelection: false, + headerCheckboxSelection: false, + headerCheckboxSelectionFilteredOnly: true, + filter: false, + sortable: false, cellRenderer: 'displayEditButtons_georesources' }, + { headerName: 'Id', field: "georesourceId", pinned: 'left', maxWidth: 125 }, + { headerName: 'Name', field: "datasetName", pinned: 'left', minWidth: 300 }, + { headerName: 'Symbolfarbe', filter: false, sortable: false, maxWidth: 125, cellRenderer: function (params) { return "
        " + params.data.poiSymbolColor+ "

        "; } }, + { headerName: 'Symbolname', maxWidth: 125, + cellRenderer: function (params) { return params.data.poiSymbolBootstrap3Name + "

        "; }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + params.data.poiSymbolBootstrap3Name; + } + }, + { headerName: 'Markerfarbe', filter: false, sortable: false, maxWidth: 125, cellRenderer: function (params) { return "
        " + params.data.poiMarkerColor+ "

        "; } }, + { headerName: 'Beschreibung', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.description; }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + params.data.metadata.description; + } + }, + { + headerName: 'Gültigkeitszeitraum', minWidth: 400, + cellRenderer: function (params) { + /* +
          +
        • +

          {{::periodOfValidity.startDate}} - {{::periodOfValidity.endDate}}

          +

          {{::periodOfValidity.startDate}} - heute

          +
        • +
        + */ + let html = '
          '; + for (const periodOfValidity of params.data.availablePeriodsOfValidity) { + html += '
        • '; + + if(periodOfValidity.endDate){ + html += "

          " + periodOfValidity.startDate + " ‐ " + periodOfValidity.endDate + "

          " ; + } + else{ + html += "

          " + periodOfValidity.startDate + " ‐ heute

          "; + } + html += '
        • '; + } + html += '
        '; + return html; + }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + if (params.data.availablePeriodsOfValidity && params.data.availablePeriodsOfValidity.length > 1){ + return "" + JSON.stringify(params.data.availablePeriodsOfValidity); + } + return params.data.availablePeriodsOfValidity; + } + }, + { headerName: 'Themenhierarchie', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getTopicHierarchyDisplayString(params.data.topicReference); }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + kommonitorDataExchangeService.getTopicHierarchyDisplayString(params.data.topicReference); + } + }, + { headerName: 'Datenquelle', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.datasource; }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + params.data.metadata.datasource; + } + }, + { headerName: 'Datenhalter und Kontakt', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.contact; }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + params.data.metadata.contact; + } + }, + { headerName: 'Rollen', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); + } + } + ]; + + return columnDefs; + }; + + this.buildDataGridColumnConfig_georesources_loi = function (georesourceMetadataArray) { + const columnDefs = [ + { headerName: 'Editierfunktionen', pinned: 'left', maxWidth: 150, checkboxSelection: false, headerCheckboxSelection: false, + headerCheckboxSelectionFilteredOnly: true, filter: false, sortable: false, cellRenderer: 'displayEditButtons_georesources' }, + { headerName: 'Id', field: "georesourceId", pinned: 'left', maxWidth: 125 }, + { headerName: 'Name', field: "datasetName", pinned: 'left', minWidth: 300 }, + { headerName: 'Linienfarbe', filter: false, sortable: false, maxWidth: 125, cellRenderer: function (params) { return "
        " + params.data.loiColor+ "

        "; } }, + { headerName: 'Linienbreite', maxWidth: 125, field: "loiWidth"}, + { headerName: 'Linienmuster', filter: false, sortable: false, maxWidth: 125, cellRenderer: function (params) { return "
        " + kommonitorDataExchangeService.getLoiDashSvgFromStringValue(params.data.loiDashArrayString) + "
        "; } }, + { headerName: 'Beschreibung', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.description; }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + params.data.metadata.description; + } + }, + { + headerName: 'Gültigkeitszeitraum', minWidth: 400, + cellRenderer: function (params) { + /* +
          +
        • +

          {{::periodOfValidity.startDate}} - {{::periodOfValidity.endDate}}

          +

          {{::periodOfValidity.startDate}} - heute

          +
        • +
        + */ + let html = '
          '; + for (const periodOfValidity of params.data.availablePeriodsOfValidity) { + html += '
        • '; + + if(periodOfValidity.endDate){ + html += "

          " + periodOfValidity.startDate + " ‐ " + periodOfValidity.endDate + "

          " ; + } + else{ + html += "

          " + periodOfValidity.startDate + " ‐ heute

          "; + } + html += '
        • '; + } + html += '
        '; + return html; + }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + if (params.data.availablePeriodsOfValidity && params.data.availablePeriodsOfValidity.length > 1){ + return "" + JSON.stringify(params.data.availablePeriodsOfValidity); + } + return params.data.availablePeriodsOfValidity; + } + }, + { headerName: 'Themenhierarchie', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getTopicHierarchyDisplayString(params.data.topicReference); }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + kommonitorDataExchangeService.getTopicHierarchyDisplayString(params.data.topicReference); + } + }, + { headerName: 'Datenquelle', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.datasource; }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + params.data.metadata.datasource; + } + }, + { headerName: 'Datenhalter und Kontakt', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.contact; }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + params.data.metadata.contact; + } + }, + { headerName: 'Rollen', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); + } + } + ]; + + return columnDefs; + }; + + this.buildDataGridColumnConfig_georesources_aoi = function (georesourceMetadataArray) { + const columnDefs = [ + { headerName: 'Editierfunktionen', pinned: 'left', maxWidth: 150, checkboxSelection: false, headerCheckboxSelection: false, + headerCheckboxSelectionFilteredOnly: true, filter: false, sortable: false, cellRenderer: 'displayEditButtons_georesources' }, + { headerName: 'Id', field: "georesourceId", pinned: 'left', maxWidth: 125 }, + { headerName: 'Name', field: "datasetName", pinned: 'left', minWidth: 300 }, + { headerName: 'Polygonfarbe', filter: false, sortable: false, maxWidth: 125, cellRenderer: function (params) { return "
        " + params.data.aoiColor+ "

        "; } }, + { headerName: 'Beschreibung', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.description; }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + params.data.metadata.description; + } + }, + { + headerName: 'Gültigkeitszeitraum', minWidth: 400, + cellRenderer: function (params) { + /* +
          +
        • +

          {{::periodOfValidity.startDate}} - {{::periodOfValidity.endDate}}

          +

          {{::periodOfValidity.startDate}} - heute

          +
        • +
        + */ + let html = '
          '; + for (const periodOfValidity of params.data.availablePeriodsOfValidity) { + html += '
        • '; + + if(periodOfValidity.endDate){ + html += "

          " + periodOfValidity.startDate + " ‐ " + periodOfValidity.endDate + "

          " ; + } + else{ + html += "

          " + periodOfValidity.startDate + " ‐ heute

          "; + } + html += '
        • '; + } + html += '
        '; + return html; + }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + if (params.data.availablePeriodsOfValidity && params.data.availablePeriodsOfValidity.length > 1){ + return "" + JSON.stringify(params.data.availablePeriodsOfValidity); + } + return params.data.availablePeriodsOfValidity; + } + }, + { headerName: 'Themenhierarchie', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getTopicHierarchyDisplayString(params.data.topicReference); }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + kommonitorDataExchangeService.getTopicHierarchyDisplayString(params.data.topicReference); + } + }, + { headerName: 'Datenquelle', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.datasource; }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + params.data.metadata.datasource; + } + }, + { headerName: 'Datenhalter und Kontakt', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.contact; }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + params.data.metadata.contact; + } + }, + { headerName: 'Rollen', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); + } + } + ]; + + return columnDefs; + }; + + this.buildDataGridRowData_georesources_poi = function (georesourceMetadataArray) { + return georesourceMetadataArray.filter(georesourceMetadata => georesourceMetadata.isPOI); + }; + + this.buildDataGridRowData_georesources_loi = function (georesourceMetadataArray) { + return georesourceMetadataArray.filter(georesourceMetadata => georesourceMetadata.isLOI); + }; + + this.buildDataGridRowData_georesources_aoi = function (georesourceMetadataArray) { + return georesourceMetadataArray.filter(georesourceMetadata => georesourceMetadata.isAOI); + }; + + this.getSelectedGeoresourcesMetadata = function(){ + let georesourceMetadataArray = []; + + //POI + if (this.dataGridOptions_georesources_poi && this.dataGridOptions_georesources_poi.api){ + let selectedPoiNodes = this.dataGridOptions_georesources_poi.api.getSelectedNodes(); + + for (const selectedPoiNode of selectedPoiNodes) { + georesourceMetadataArray.push(selectedPoiNode.data); + } + } + + //LOI + if (this.dataGridOptions_georesources_loi && this.dataGridOptions_georesources_loi.api){ + let selectedLoiNodes = this.dataGridOptions_georesources_loi.api.getSelectedNodes(); + + for (const selectedLoiNode of selectedLoiNodes) { + georesourceMetadataArray.push(selectedLoiNode.data); + } + } + + //AOI + if (this.dataGridOptions_georesources_aoi && this.dataGridOptions_georesources_aoi.api){ + let selectedAoiNodes = this.dataGridOptions_georesources_aoi.api.getSelectedNodes(); + + for (const selectedAoiNode of selectedAoiNodes) { + georesourceMetadataArray.push(selectedAoiNode.data); + } + } + + return georesourceMetadataArray; + }; + + this.buildDataGridRowData_spatialUnits = function (spatialUnitMetadataArray) { + return spatialUnitMetadataArray; + }; + + this.buildDataGridColumnConfig_spatialUnits = function (spatialUnitMetadataArray) { + const columnDefs = [ + { headerName: 'Editierfunktionen', pinned: 'left', maxWidth: 150, checkboxSelection: false, headerCheckboxSelection: false, + headerCheckboxSelectionFilteredOnly: true, filter: false, sortable: false, cellRenderer: 'displayEditButtons_spatialUnits' }, + { headerName: 'Id', field: "spatialUnitId", pinned: 'left', maxWidth: 125 }, + { headerName: 'Name', field: "spatialUnitLevel", pinned: 'left', minWidth: 300 }, + { headerName: 'Beschreibung', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.description; }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + params.data.metadata.description; + } + }, + { headerName: 'Nächst niedrigere Raumebene', field: "nextLowerHierarchyLevel", minWidth: 250 }, + { headerName: 'Nächst höhere Raumebene', field: "nextUpperHierarchyLevel", minWidth: 250 }, + { + headerName: 'Gültigkeitszeitraum', minWidth: 400, + cellRenderer: function (params) { + /* +
          +
        • +

          {{::periodOfValidity.startDate}} - {{::periodOfValidity.endDate}}

          +

          {{::periodOfValidity.startDate}} - heute

          +
        • +
        + */ + let html = '
          '; + for (const periodOfValidity of params.data.availablePeriodsOfValidity) { + html += '
        • '; + + if(periodOfValidity.endDate){ + html += "

          " + periodOfValidity.startDate + " ‐ " + periodOfValidity.endDate + "

          " ; + } + else{ + html += "

          " + periodOfValidity.startDate + " ‐ heute

          "; + } + html += '
        • '; + } + html += '
        '; + return html; + }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + if (params.data.availablePeriodsOfValidity && params.data.availablePeriodsOfValidity.length > 1){ + return "" + JSON.stringify(params.data.availablePeriodsOfValidity); + } + return params.data.availablePeriodsOfValidity; + } + }, + { headerName: 'Datenquelle', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.datasource; }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + params.data.metadata.datasource; + } + }, + { headerName: 'Datenhalter und Kontakt', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.contact; }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + params.data.metadata.contact; + } + }, + { headerName: 'Rollen', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return "" + kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); + } + } + ]; + + return columnDefs; + }; + + this.getSelectedSpatialUnitsMetadata = function(){ + let spatialUnitsMetadataArray = []; + + if (this.dataGridOptions_spatialUnits && this.dataGridOptions_spatialUnits.api){ + let selectedNodes = this.dataGridOptions_spatialUnits.api.getSelectedNodes(); + + for (const selectedNode of selectedNodes) { + spatialUnitsMetadataArray.push(selectedNode.data); + } + } + + return spatialUnitsMetadataArray; + }; + + this.getSelectedAccessControlMetadata = function(){ + let accessControlMetadataArray = []; + + if (this.dataGridOptions_accessControl && this.dataGridOptions_accessControl.api){ + let selectedNodes = this.dataGridOptions_accessControl.api.getSelectedNodes(); + + for (const selectedNode of selectedNodes) { + accessControlMetadataArray.push(selectedNode.data); + } + } + + return accessControlMetadataArray; + }; + + this.getSelectedScriptsMetadata = function(){ + let scriptsMetadataArray = []; + + if (this.dataGridOptions_scripts && this.dataGridOptions_scripts.api){ + let selectedNodes = this.dataGridOptions_scripts.api.getSelectedNodes(); + + for (const selectedNode of selectedNodes) { + scriptsMetadataArray.push(selectedNode.data); + } + } + + return scriptsMetadataArray; + }; + + this.buildDataGridOptions_indicators = function (indicatorMetadataArray) { + let columnDefs = this.buildDataGridColumnConfig_indicators(indicatorMetadataArray); + let rowData = this.buildDataGridRowData_indicators(indicatorMetadataArray); + + let gridOptions = { + defaultColDef: { + editable: false, + sortable: true, + flex: 1, + minWidth: 200, + filter: true, + floatingFilter: true, + // filterParams: { + // newRowsAction: 'keep' + // }, + resizable: true, + wrapText: true, + autoHeight: true, + cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, + headerComponentParams: { + template: + '', + }, + }, + components: { + displayEditButtons_indicators: displayEditButtons_indicators + }, + columnDefs: columnDefs, + rowData: rowData, + enableCellTextSelection: true, + ensureDomOrder: true, + pagination: true, + paginationPageSize: 10, + suppressColumnVirtualisation: true, + // rowHeight: 200, + onGridReady: function () { + // self.registerClickHandler_indicators(indicatorMetadataArray); + }, + onFirstDataRendered: function () { + headerHeightSetter(self.dataGridOptions_indicators); + // self.registerClickHandler_indicators(indicatorMetadataArray); + }, + onColumnResized: function () { + headerHeightSetter(self.dataGridOptions_indicators); + // self.registerClickHandler_indicators(indicatorMetadataArray); + }, + onModelUpdated: function () { + self.registerClickHandler_indicators(indicatorMetadataArray); + + }, + onRowDataChanged: function () { + self.registerClickHandler_indicators(indicatorMetadataArray); + }, + // onPaginationChanged: function () { + // self.registerClickHandler_indicators(indicatorMetadataArray); + // }, + onViewportChanged: function () { + self.registerClickHandler_indicators(indicatorMetadataArray); + setTimeout(function () { + let domNode = document.querySelector('#indicatorOverviewTable'); + // if (domNode) { + // MathJax.typesetPromise(); + // } + MathJax.typesetPromise().then(function (){ + // setTimeout(function () { + // self.dataGridOptions_indicators.api.resetRowHeights(); + // }, 1000); + // self.dataGridOptions_indicators.api.resetRowHeights(); + }); + + // setTimeout(function () { + // self.dataGridOptions_indicators.api.resetRowHeights(); + // }, 1000); + }, 250); + }, + + }; + + return gridOptions; + }; + + this.registerClickHandler_indicators = function (indicatorMetadataArray) { + + // for (const indicatorMetadata of indicatorMetadataArray) { + // $( "#btn_indicator_editMetadata_" + indicatorMetadata.indicatorId).click(function() { + // let indicatorId = this.id.split("_")[3]; + + // let indicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(indicatorId); + + // $rootScope.$broadcast("onEditIndicatorMetadata", indicatorMetadata); + // }); + // } + + //first unbind previous click events + $(".indicatorEditMetadataBtn").off(); + $(".indicatorEditMetadataBtn").on("click", function (event) { + // ensure that only the target button gets clicked + // manually open modal + event.stopPropagation(); + let modalId = document.getElementById(this.id).getAttribute("data-target"); + $(modalId).modal('show'); + + let indicatorId = this.id.split("_")[3]; + + let indicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(indicatorId); + + $rootScope.$broadcast("onEditIndicatorMetadata", indicatorMetadata); + }); + + //first unbind previous click events + $(".indicatorEditFeaturesBtn").off(); + $(".indicatorEditFeaturesBtn").on("click", function (event) { + // ensure that only the target button gets clicked + // manually open modal + event.stopPropagation(); + let modalId = document.getElementById(this.id).getAttribute("data-target"); + $(modalId).modal('show'); + + let indicatorId = this.id.split("_")[3]; + + let indicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(indicatorId); + + $rootScope.$broadcast("onEditIndicatorFeatures", indicatorMetadata); + }); + + $(".indicatorEditRoleBasedAccessBtn").off(); + $(".indicatorEditRoleBasedAccessBtn").on("click", function (event) { + // ensure that only the target button gets clicked + // manually open modal + event.stopPropagation(); + let modalId = document.getElementById(this.id).getAttribute("data-target"); + $(modalId).modal('show'); + + let indicatorId = this.id.split("_")[3]; + + let indicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(indicatorId); + + $rootScope.$broadcast("onEditIndicatorSpatialUnitRoles", indicatorMetadata); + }); + + }; + + this.registerClickHandler_georesources = function (georesourceMetadataArray) { + + $(".georesourceEditMetadataBtn").off(); + $(".georesourceEditMetadataBtn").on("click", function (event) { + // ensure that only the target button gets clicked + // manually open modal + event.stopPropagation(); + let modalId = document.getElementById(this.id).getAttribute("data-target"); + $(modalId).modal('show'); + + let georesourceId = this.id.split("_")[3]; + + let georesourceMetadata = kommonitorDataExchangeService.getGeoresourceMetadataById(georesourceId); + + $rootScope.$broadcast("onEditGeoresourceMetadata", georesourceMetadata); + }); + + $(".georesourceEditFeaturesBtn").off(); + $(".georesourceEditFeaturesBtn").on("click", function (event) { + // ensure that only the target button gets clicked + // manually open modal + event.stopPropagation(); + let modalId = document.getElementById(this.id).getAttribute("data-target"); + $(modalId).modal('show'); + + let georesourceId = this.id.split("_")[3]; + + let georesourceMetadata = kommonitorDataExchangeService.getGeoresourceMetadataById(georesourceId); + + $rootScope.$broadcast("onEditGeoresourceFeatures", georesourceMetadata); + }); + + $(".georesourceDeleteBtn").off(); + $(".georesourceDeleteBtn").on("click", function (event) { + // ensure that only the target button gets clicked + // manually open modal + event.stopPropagation(); + let modalId = document.getElementById(this.id).getAttribute("data-target"); + $(modalId).modal('show'); + + let spatialUnitId = this.id.split("_")[3]; + + let spatialUnitMetadata = kommonitorDataExchangeService.getGeoresourceMetadataById(spatialUnitId); + + $rootScope.$broadcast("onDeleteGeoresources", [spatialUnitMetadata]); //handler function takes an array + }); + + }; + + this.buildDataGrid_indicators = function (indicatorMetadataArray) { + if (this.dataGridOptions_indicators && this.dataGridOptions_indicators.api && document.querySelector('#indicatorOverviewTable').childElementCount > 0) { + + this.saveGridStore(this.dataGridOptions_indicators); + let newRowData = this.buildDataGridRowData_indicators(indicatorMetadataArray); + this.dataGridOptions_indicators.api.setRowData(newRowData); + this.restoreGridStore(this.dataGridOptions_indicators); + } + else { + this.dataGridOptions_indicators = this.buildDataGridOptions_indicators(indicatorMetadataArray); + let gridDiv = document.querySelector('#indicatorOverviewTable'); + new agGrid.Grid(gridDiv, this.dataGridOptions_indicators); + } + }; + + this.buildDataGridOptions_georesources_poi = function (georesourceMetadataArray) { + let columnDefs = this.buildDataGridColumnConfig_georesources_poi(georesourceMetadataArray); + let rowData = this.buildDataGridRowData_georesources_poi(georesourceMetadataArray); + + let gridOptions = { + defaultColDef: { + editable: false, + sortable: true, + flex: 1, + minWidth: 200, + filter: true, + floatingFilter: true, + // filterParams: { + // newRowsAction: 'keep' + // }, + resizable: true, + wrapText: true, + autoHeight: true, + cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, + headerComponentParams: { + template: + '', + }, + }, + components: { + displayEditButtons_georesources: displayEditButtons_georesources + }, + columnDefs: columnDefs, + rowData: rowData, + suppressRowClickSelection: true, + rowSelection: 'multiple', + enableCellTextSelection: true, + ensureDomOrder: true, + pagination: true, + paginationPageSize: 10, + suppressColumnVirtualisation: true, + onFirstDataRendered: function () { + headerHeightSetter(self.dataGridOptions_georesources_poi); + }, + onColumnResized: function () { + headerHeightSetter(self.dataGridOptions_georesources_poi); + }, + onRowDataChanged: function () { + self.registerClickHandler_georesources(georesourceMetadataArray); + }, + onModelUpdated: function () { + self.registerClickHandler_georesources(georesourceMetadataArray); + }, + onViewportChanged: function () { + self.registerClickHandler_georesources(georesourceMetadataArray); + }, + + }; + + return gridOptions; + }; + + this.buildDataGridOptions_georesources_loi = function (georesourceMetadataArray) { + let columnDefs = this.buildDataGridColumnConfig_georesources_loi(georesourceMetadataArray); + let rowData = this.buildDataGridRowData_georesources_loi(georesourceMetadataArray); + + let gridOptions = { + defaultColDef: { + editable: false, + sortable: true, + flex: 1, + minWidth: 200, + filter: true, + floatingFilter: true, + // filterParams: { + // newRowsAction: 'keep' + // }, + resizable: true, + wrapText: true, + autoHeight: true, + cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, + headerComponentParams: { + template: + '', + }, + }, + components: { + displayEditButtons_georesources: displayEditButtons_georesources + }, + columnDefs: columnDefs, + rowData: rowData, + suppressRowClickSelection: true, + rowSelection: 'multiple', + enableCellTextSelection: true, + ensureDomOrder: true, + pagination: true, + paginationPageSize: 10, + suppressColumnVirtualisation: true, + onFirstDataRendered: function () { + headerHeightSetter(self.dataGridOptions_georesources_loi); + }, + onColumnResized: function () { + headerHeightSetter(self.dataGridOptions_georesources_loi); + }, + onRowDataChanged: function () { + self.registerClickHandler_georesources(georesourceMetadataArray); + }, + onModelUpdated: function () { + self.registerClickHandler_georesources(georesourceMetadataArray); + }, + onViewportChanged: function () { + self.registerClickHandler_georesources(georesourceMetadataArray); + }, + + }; + + return gridOptions; + }; + + this.buildDataGridOptions_georesources_aoi = function (georesourceMetadataArray) { + let columnDefs = this.buildDataGridColumnConfig_georesources_aoi(georesourceMetadataArray); + let rowData = this.buildDataGridRowData_georesources_aoi(georesourceMetadataArray); + + let gridOptions = { + defaultColDef: { + editable: false, + sortable: true, + flex: 1, + minWidth: 200, + filter: true, + floatingFilter: true, + // filterParams: { + // newRowsAction: 'keep' + // }, + resizable: true, + wrapText: true, + autoHeight: true, + cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, + headerComponentParams: { + template: + '', + }, + }, + components: { + displayEditButtons_georesources: displayEditButtons_georesources + }, + columnDefs: columnDefs, + rowData: rowData, + suppressRowClickSelection: true, + rowSelection: 'multiple', + enableCellTextSelection: true, + ensureDomOrder: true, + pagination: true, + paginationPageSize: 10, + suppressColumnVirtualisation: true, + onFirstDataRendered: function () { + headerHeightSetter(self.dataGridOptions_georesources_aoi); + }, + onColumnResized: function () { + headerHeightSetter(self.dataGridOptions_georesources_aoi); + }, + onRowDataChanged: function () { + self.registerClickHandler_georesources(georesourceMetadataArray); + }, + onModelUpdated: function () { + self.registerClickHandler_georesources(georesourceMetadataArray); + }, + onViewportChanged: function () { + self.registerClickHandler_georesources(georesourceMetadataArray); + }, + + }; + + return gridOptions; + }; + + this.buildDataGridOptions_spatialUnits = function (spatialUnitMetadataArray) { + let columnDefs = this.buildDataGridColumnConfig_spatialUnits(spatialUnitMetadataArray); + let rowData = this.buildDataGridRowData_spatialUnits(spatialUnitMetadataArray); + + let gridOptions = { + defaultColDef: { + editable: false, + sortable: true, + flex: 1, + minWidth: 200, + filter: true, + floatingFilter: true, + // filterParams: { + // newRowsAction: 'keep' + // }, + resizable: true, + wrapText: true, + autoHeight: true, + cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, + headerComponentParams: { + template: + '', + }, + }, + components: { + displayEditButtons_spatialUnits: displayEditButtons_spatialUnits + }, + columnDefs: columnDefs, + rowData: rowData, + suppressRowClickSelection: true, + rowSelection: 'multiple', + enableCellTextSelection: true, + ensureDomOrder: true, + pagination: true, + paginationPageSize: 10, + suppressColumnVirtualisation: true, + onFirstDataRendered: function () { + headerHeightSetter(self.dataGridOptions_spatialUnits); + }, + onColumnResized: function () { + headerHeightSetter(self.dataGridOptions_spatialUnits); + }, + onRowDataChanged: function () { + self.registerClickHandler_spatialUnits(spatialUnitMetadataArray); + }, + onModelUpdated: function () { + self.registerClickHandler_spatialUnits(spatialUnitMetadataArray); + + }, + onViewportChanged: function () { + self.registerClickHandler_spatialUnits(spatialUnitMetadataArray); + }, + + }; + + return gridOptions; + }; + + this.registerClickHandler_spatialUnits = function (spatialUnitMetadataArray) { + + $(".spatialUnitEditMetadataBtn").off(); + $(".spatialUnitEditMetadataBtn").on("click", function (event) { + // ensure that only the target button gets clicked + // manually open modal + event.stopPropagation(); + let modalId = document.getElementById(this.id).getAttribute("data-target"); + $(modalId).modal('show'); + + let spatialUnitId = this.id.split("_")[3]; + + let spatialUnitMetadata = kommonitorDataExchangeService.getSpatialUnitMetadataById(spatialUnitId); + + $rootScope.$broadcast("onEditSpatialUnitMetadata", spatialUnitMetadata); + }); + + $(".spatialUnitEditFeaturesBtn").off(); + $(".spatialUnitEditFeaturesBtn").on("click", function (event) { + // ensure that only the target button gets clicked + // manually open modal + event.stopPropagation(); + let modalId = document.getElementById(this.id).getAttribute("data-target"); + $(modalId).modal('show'); + + let spatialUnitId = this.id.split("_")[3]; + + let spatialUnitMetadata = kommonitorDataExchangeService.getSpatialUnitMetadataById(spatialUnitId); + + $rootScope.$broadcast("onEditSpatialUnitFeatures", spatialUnitMetadata); + }); + + $(".spatialUnitDeleteBtn").off(); + $(".spatialUnitDeleteBtn").on("click", function (event) { + // ensure that only the target button gets clicked + // manually open modal + event.stopPropagation(); + let modalId = document.getElementById(this.id).getAttribute("data-target"); + $(modalId).modal('show'); + + let spatialUnitId = this.id.split("_")[3]; + + let spatialUnitMetadata = kommonitorDataExchangeService.getSpatialUnitMetadataById(spatialUnitId); + + $rootScope.$broadcast("onDeleteSpatialUnits", [spatialUnitMetadata]); //handler function takes an array + }); + + }; + + this.buildDataGrid_georesources = function (georesourceMetadataArray) { + // POI + if (this.dataGridOptions_georesources_poi && this.dataGridOptions_georesources_poi.api && document.querySelector('#poiOverviewTable').childElementCount > 0) { + + this.saveGridStore(this.dataGridOptions_georesources_poi); + let newRowData = this.buildDataGridRowData_georesources_poi(georesourceMetadataArray); + this.dataGridOptions_georesources_poi.api.setRowData(newRowData); + this.restoreGridStore(this.dataGridOptions_georesources_poi); + } + else { + this.dataGridOptions_georesources_poi = this.buildDataGridOptions_georesources_poi(georesourceMetadataArray); + let gridDiv = document.querySelector('#poiOverviewTable'); + new agGrid.Grid(gridDiv, this.dataGridOptions_georesources_poi); + } + + // LOI + if (this.dataGridOptions_georesources_loi && this.dataGridOptions_georesources_loi.api && document.querySelector('#loiOverviewTable').childElementCount > 0) { + + this.saveGridStore(this.dataGridOptions_georesources_loi); + let newRowData = this.buildDataGridRowData_georesources_loi(georesourceMetadataArray); + this.dataGridOptions_georesources_loi.api.setRowData(newRowData); + this.restoreGridStore(this.dataGridOptions_georesources_loi); + } + else { + this.dataGridOptions_georesources_loi = this.buildDataGridOptions_georesources_loi(georesourceMetadataArray); + let gridDiv = document.querySelector('#loiOverviewTable'); + new agGrid.Grid(gridDiv, this.dataGridOptions_georesources_loi); + } + + // AOI + if (this.dataGridOptions_georesources_aoi && this.dataGridOptions_georesources_aoi.api && document.querySelector('#aoiOverviewTable').childElementCount > 0) { + + this.saveGridStore(this.dataGridOptions_georesources_aoi); + let newRowData = this.buildDataGridRowData_georesources_aoi(georesourceMetadataArray); + this.dataGridOptions_georesources_aoi.api.setRowData(newRowData); + this.restoreGridStore(this.dataGridOptions_georesources_aoi); + } + else { + this.dataGridOptions_georesources_aoi = this.buildDataGridOptions_georesources_aoi(georesourceMetadataArray); + let gridDiv = document.querySelector('#aoiOverviewTable'); + new agGrid.Grid(gridDiv, this.dataGridOptions_georesources_aoi); + } + }; + + this.buildDataGrid_spatialUnits = function (spatialUnitMetadataArray) { + + if (this.dataGridOptions_spatialUnits && this.dataGridOptions_spatialUnits.api && document.querySelector('#spatialUnitOverviewTable').childElementCount > 0) { + + this.saveGridStore(this.dataGridOptions_spatialUnits); + let newRowData = this.buildDataGridRowData_spatialUnits(spatialUnitMetadataArray); + this.dataGridOptions_spatialUnits.api.setRowData(newRowData); + this.restoreGridStore(this.dataGridOptions_spatialUnits); + } + else { + this.dataGridOptions_spatialUnits = this.buildDataGridOptions_spatialUnits(spatialUnitMetadataArray); + let gridDiv = document.querySelector('#spatialUnitOverviewTable'); + new agGrid.Grid(gridDiv, this.dataGridOptions_spatialUnits); + } + }; + + // FEATURE TABLES + + const isDate = (date) => { + return (new Date(date) !== "Invalid Date") && !isNaN(new Date(date)); + } + + this.buildDataGridColumnConfig_featureTable_spatialResource = function(specificHeadersArray, datasetId, resourceType, deleteButtonEnabled){ + const columnDefs = [ + { headerName: 'DB-Record-Id', field: "kommonitorRecordId", pinned: 'left', editable: false, cellClass: "grid-non-editable", maxWidth: 125, + cellRenderer: function (params) { + let html = ""; + + // only show delete button, if user has the permission to delete the dataset + // if only editor rights, then user may edit cells, but shall not remove data entries + // if(params.data.userPermissions.includes("creator")){ + // if (resourceType == self.resourceType_spatialUnit){ + // html += ''; + // } + // else { + // html += ''; + // } + + // } + + if (resourceType == self.resourceType_spatialUnit){ + html += ''; + } + else { + html += ''; + } + + html += "
        "; + + html += params.data.kommonitorRecordId; + + return html; + } + }, + { headerName: 'Feature-Id', field: __env.FEATURE_ID_PROPERTY_NAME, pinned: 'left', editable: false, cellClass: "grid-non-editable", maxWidth: 125 }, + { headerName: 'Name', field: __env.FEATURE_NAME_PROPERTY_NAME, pinned: 'left', minWidth: 150 }, + // { headerName: 'Geometrie', field: "kommonitorGeometry", autoHeight: false, wrapText: false, + // cellRenderer: function (params) { + // let html = JSON.stringify(params.data.kommonitorGeometry); + + // return html; + // }, + // filter: 'agTextColumnFilter', + // filterValueGetter: (params) => { + // return JSON.stringify(params.data.kommonitorGeometry); + // }, + // valueGetter: params => { + // return JSON.stringify(params.data.kommonitorGeometry); + // }, + // valueSetter: params => { + // try { + // params.data.kommonitorGeometry = JSON.parse(params.newValue); + // } catch (error) { + // try { + // params.data.kommonitorGeometry = JSON.parse(params.oldValue); + // } catch (error) { + // params.data.kommonitorGeometry = params.oldValue; + // } + + // } + // return true; + // }, + // minWidth: 200 + // }, + { headerName: 'Lebenszeitbeginn', field: __env.VALID_START_DATE_PROPERTY_NAME, minWidth: 150, cellEditor: getDatePicker() }, + { headerName: 'Lebenszeitende', field: __env.VALID_END_DATE_PROPERTY_NAME, cellEditor: getDatePicker(), + // cellRenderer: function (params) { + // let html = '

        '; + + // if (params.data.validEndDate){ + // html += params.data.validEndDate; + // } + // else{ + // html += "uneingeschränkt gültig"; + // } + + // html += "

        "; + + // return html; + // }, + // filter: 'agTextColumnFilter', + // filterValueGetter: (params) => { + // if (params.data.validEndDate){ + // return "" + params.data.validEndDate; + // } + // return "uneingeschränkt gültig"; + // }, + minWidth: 150 } + ]; + + for (const header of specificHeadersArray) { + columnDefs.push({ headerName: "" + header, field: "" + header, minWidth: 125 }); + } + + return columnDefs; + }; + + this.buildDataGridRowData_featureTable_spatialResource = function(dataArray){ + + + if(dataArray[0] && dataArray[0].properties){ + return dataArray.map(dataItem => { + // add geometry and database record ID to properties to be available within data grid object + dataItem.properties.kommonitorGeometry = dataItem.geometry; + dataItem.properties.kommonitorRecordId = dataItem.id; + return dataItem.properties; + } + ); + } + + return dataArray; + }; + + this.buildDataGridOptions_featureTable_spatialResource = function(specificHeadersArray, dataArray, datasetId, resourceType, deleteButtonEnabled){ + let columnDefs = this.buildDataGridColumnConfig_featureTable_spatialResource(specificHeadersArray, datasetId, resourceType, deleteButtonEnabled); + let rowData = this.buildDataGridRowData_featureTable_spatialResource(dataArray); + + let gridOptions = { + defaultColDef: { + editable: true, + // enables the fill handle + enableFillHandle: false, + cellEditor: 'agLargeTextCellEditor', + onCellValueChanged: function(newValueParams){ + /* https://www.ag-grid.com/javascript-data-grid/cell-editing/ + interface NewValueParams { + // The value before the change + oldValue: any; + // The value after the change + newValue: any; + // Row node for the given row + node: RowNode | null; + // Data associated with the node + data: any; + // Column for this callback + column: Column; + // ColDef provided for this column + colDef: ColDef; + api: GridApi; + columnApi: ColumnApi; + // The context as provided on `gridOptions.context` + context: any; + } + */ + + // make sure that date properties are actually set + if (! newValueParams.data.validStartDate){ + newValueParams.data.validStartDate = newValueParams.oldValue; + } + if (!isDate(newValueParams.data.validStartDate)){ + newValueParams.data.validStartDate = newValueParams.oldValue; + } + if(newValueParams.data.validEndDate == ""){ + newValueParams.data.validEndDate = undefined; + } + if(newValueParams.data.validEndDate){ + if (!isDate(newValueParams.data.validEndDate)){ + newValueParams.data.validEndDate = newValueParams.oldValue; + } + } + + // take the modified data from newValueParams.data + // take geometry info from newValueParams.data.geometry and remove that property afterwards + // take kommonitorRecordId info from newValueParams.data.kommonitorRecordId and remove that property afterwards + // then build GeoJSON and send modification request to data Management component + let geoJSON = { + "type": "Feature", + geometry: "", + properties: "", + id: "" + }; + + // clone properties + geoJSON.geometry = JSON.parse(JSON.stringify(newValueParams.data.kommonitorGeometry)); + geoJSON.id = JSON.parse(JSON.stringify(newValueParams.data.kommonitorRecordId)); + geoJSON.properties = JSON.parse(JSON.stringify(newValueParams.data)); + + // now delete information + delete geoJSON.properties.kommonitorGeometry; + delete geoJSON.properties.kommonitorRecordId; + + let url = __env.apiUrl + __env.basePath; + if(resourceType == self.resourceType_georesource){ + url += "/georesources/"; + } + else { + url += "/spatial-units/"; + } + + url += datasetId + "/singleFeature/" + newValueParams.data[__env.FEATURE_ID_PROPERTY_NAME] + "/singleFeatureRecord/" + newValueParams.data.kommonitorRecordId; + + $http({ + url: url, + method: "PUT", + data: geoJSON, + headers: { + 'Content-Type': "application/json" + } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + console.log("Successfully updated database record"); + + // on success mark grid cell with green background and set update information + newValueParams.colDef.cellStyle = (p) => + p.rowIndex.toString() === newValueParams.node.id ? {'background-color': '#9DC89F'} : ""; + + newValueParams.api.refreshCells({ + force: true, + columns: [newValueParams.column.getId()], + rowNodes: [newValueParams.node] + }); + + if(resourceType == self.resourceType_georesource){ + self.featureTable_georesource_lastUpdate_timestamp_success = getCurrentTimestampString(); + } + else { + self.featureTable_spatialUnit_lastUpdate_timestamp_success = getCurrentTimestampString(); + } + + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while updating database record. Error is:\n" + error); + + // reset cell value as an error occurred + newValueParams.data[newValueParams.column.colId] = newValueParams.oldValue; + + // on failure mark grid cell with red background and set update failure information + newValueParams.colDef.cellStyle = (p) => + p.rowIndex.toString() === newValueParams.node.id ? {'background-color': '#E79595'} : ""; + + newValueParams.api.refreshCells({ + force: true, + columns: [newValueParams.column.getId()], + rowNodes: [newValueParams.node] + }); + if(resourceType == self.resourceType_georesource){ + self.featureTable_georesource_lastUpdate_timestamp_failure = timestamp_string; + } + else { + self.featureTable_spatialUnit_lastUpdate_timestamp_failure = timestamp_string; + } + throw error; + }); + }, + sortable: true, + flex: 1, + minWidth: 200, + filter: true, + floatingFilter: true, + // filterParams: { + // newRowsAction: 'keep' + // }, + resizable: true, + wrapText: true, + autoHeight: true, + cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, + headerComponentParams: { + template: + '', + }, + }, + columnDefs: columnDefs, + rowData: rowData, + // enables undo / redo + undoRedoCellEditing: true, + // restricts the number of undo / redo steps to 10 + undoRedoCellEditingLimit: 10, + // enables flashing to help see cell changes + enableCellChangeFlash: true, + suppressRowClickSelection: true, + // rowSelection: 'multiple', + enableCellTextSelection: true, + ensureDomOrder: true, + pagination: true, + paginationPageSize: 10, + suppressColumnVirtualisation: true, + // onFirstDataRendered: function () { + // headerHeightSetter(this); + // }, + // onColumnResized: function () { + // headerHeightSetter(this); + // } + onRowDataChanged: function () { + self.registerClickHandler_featureTable_spatialResource(resourceType); + }, + onModelUpdated: function () { + self.registerClickHandler_featureTable_spatialResource(resourceType); + + }, + onViewportChanged: function () { + self.registerClickHandler_featureTable_spatialResource(resourceType); + }, + + }; + + return gridOptions; + }; + + this.registerClickHandler_featureTable_spatialResource = function (resourceType) { + + let className = ""; + let url = __env.apiUrl + __env.basePath; + + if (resourceType == this.resourceType_georesource){ + className = ".georesourceDeleteFeatureRecordBtn"; + url += "/georesources/"; + } + else{ + className = ".spatialUnitDeleteFeatureRecordBtn"; + url += "/spatial-units/"; + } + + $(className).off(); + $(className).on("click", function (event) { + + // ensure that only the target button gets clicked + event.stopPropagation(); + event.stopImmediatePropagation(); + $rootScope.$broadcast("showLoadingIcon_" + resourceType); + + // id example is id="btn__spatialUnit__deleteFeatureEntry__' + datasetId + '__' + params.data[__env.FEATURE_ID_PROPERTY_NAME] + '__' + params.data.kommonitorRecordId + '" + let idArray = this.id.split("__"); + + let datasetId = idArray[3]; + let featureId = idArray[4]; + let recordId = idArray[5]; + + url += datasetId + "/singleFeature/" + featureId + "/singleFeatureRecord/" + recordId; + + $http({ + url: url, + method: "DELETE" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + console.log("Successfully deleted database record"); + + if(resourceType == self.resourceType_georesource){ + self.featureTable_georesource_lastUpdate_timestamp_success = getCurrentTimestampString(); + } + else { + self.featureTable_spatialUnit_lastUpdate_timestamp_success = getCurrentTimestampString(); + } + + $rootScope.$broadcast("onDeleteFeatureEntry_" + resourceType); + + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while deleting database record. Error is:\n" + error); + $rootScope.$broadcast("hideLoadingIcon_" + resourceType); + if(resourceType == self.resourceType_georesource){ + self.featureTable_georesource_lastUpdate_timestamp_failure = getCurrentTimestampString(); + } + else { + self.featureTable_spatialUnit_lastUpdate_timestamp_failure = getCurrentTimestampString(); + } + throw error; + }); + }); + + }; + + this.buildDataGrid_featureTable_spatialResource = function (domElementId, specificHeadersArray, dataArray, datasetId, resourceType, deleteButtonEnabled) { + + let dataGridOptions_featureTable; + + dataGridOptions_featureTable = this.buildDataGridOptions_featureTable_spatialResource(specificHeadersArray, dataArray, datasetId, resourceType, deleteButtonEnabled); + + let gridDiv = document.querySelector('#' + domElementId); + while (gridDiv.firstChild) { + gridDiv.removeChild(gridDiv.firstChild); + } + new agGrid.Grid(gridDiv, dataGridOptions_featureTable); + }; + + // INDICATORS FEATURE TABLE + this.buildDataGridColumnConfig_featureTable_indicatorResource = function(specificHeadersArray, datasetId, resourceType, deleteButtonEnabled, spatialUnitId){ + const columnDefs = [ + { headerName: 'DB-Record-Id', field: "fid", pinned: 'left', editable: false, cellClass: "grid-non-editable", maxWidth: 125, + cellRenderer: function (params) { + let html = ""; + + // only show delete button, if user has the permission to delete the dataset + // if only editor rights, then user may edit cells, but shall not remove data entries + // if(params.data.userPermissions.includes("creator")){ + // html += ''; + + + // } + + html += ''; + + html += "  "; + html += params.data.fid; + + return html; + } + }, + { headerName: 'Feature-Id', field: __env.FEATURE_ID_PROPERTY_NAME, pinned: 'left', editable: false, cellClass: "grid-non-editable", maxWidth: 125 }, + { headerName: 'Name', field: __env.FEATURE_NAME_PROPERTY_NAME, pinned: 'left', minWidth: 200, editable: false, cellClass: "grid-non-editable", }, + // { headerName: 'Id', field: __env.FEATURE_ID_PROPERTY_NAME, maxWidth: 125 }, + // { headerName: 'Name', field: __env.FEATURE_NAME_PROPERTY_NAME, minWidth: 300 }, + { headerName: 'Lebenszeitbeginn', field: __env.VALID_START_DATE_PROPERTY_NAME, minWidth: 125, editable: false, cellClass: "grid-non-editable" }, + { headerName: 'Lebenszeitende', field: __env.VALID_END_DATE_PROPERTY_NAME, editable: false, cellClass: "grid-non-editable", + minWidth: 125 } + ]; + + for (const header of specificHeadersArray) { + columnDefs.push({ headerName: "" + header, field: "" + header, minWidth: 125 }); + } + + return columnDefs; + }; + + this.buildDataGridRowData_featureTable_indicatorResource = function(dataArray){ + + return dataArray.map(dataItem => { + // remove arisonFrom property as this is currently never used + delete dataItem.arisenFrom; + return dataItem; + } + ); + }; + + this.buildDataGridOptions_featureTable_indicatorResource = function(specificHeadersArray, dataArray, datasetId, resourceType, deleteButtonEnabled, spatialUnitId){ + let columnDefs = this.buildDataGridColumnConfig_featureTable_indicatorResource(specificHeadersArray, datasetId, resourceType, deleteButtonEnabled, spatialUnitId); + let rowData = this.buildDataGridRowData_featureTable_indicatorResource(dataArray); + + let gridOptions = { + defaultColDef: { + editable: true, + // enables the fill handle + enableFillHandle: false, + cellEditor: 'agLargeTextCellEditor', + onCellValueChanged: function(newValueParams){ + /* https://www.ag-grid.com/javascript-data-grid/cell-editing/ + interface NewValueParams { + // The value before the change + oldValue: any; + // The value after the change + newValue: any; + // Row node for the given row + node: RowNode | null; + // Data associated with the node + data: any; + // Column for this callback + column: Column; + // ColDef provided for this column + colDef: ColDef; + api: GridApi; + columnApi: ColumnApi; + // The context as provided on `gridOptions.context` + context: any; + } + */ + + // take the modified data from newValueParams.data + // then build JSON and send modification request to data Management component + let json = JSON.parse(JSON.stringify(newValueParams.data)); + + // now delete information - only ID and fid shall remain for indicator record update + delete json[__env.VALID_START_DATE_PROPERTY_NAME]; + delete json[__env.VALID_END_DATE_PROPERTY_NAME]; + delete json[__env.FEATURE_NAME_PROPERTY_NAME]; + + /* + for indicators we should check if an empty/null/undefined value has been set by user and transmit it as null value + */ + for (const key in json) { + if (Object.hasOwnProperty.call(json, key)) { + const element = json[key]; + + if(key.includes(__env.indicatorDatePrefix)){ + if (element == ""){ + json[key] = null; + } + } + + } + } + + let url = __env.apiUrl + __env.basePath + "/indicators/"; + + url += datasetId + "/" + spatialUnitId + "/singleFeature/" + newValueParams.data[__env.FEATURE_ID_PROPERTY_NAME] + "/singleFeatureRecord/" + newValueParams.data.fid; + + $http({ + url: url, + method: "PUT", + data: json, + headers: { + 'Content-Type': "application/json" + } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + console.log("Successfully updated database record"); + + // on success mark grid cell with green background and set update information + newValueParams.colDef.cellStyle = (p) => + p.rowIndex.toString() === newValueParams.node.id ? {'background-color': '#9DC89F'} : ""; + + newValueParams.api.refreshCells({ + force: true, + columns: [newValueParams.column.getId()], + rowNodes: [newValueParams.node] + }); + + self.featureTable_indicator_lastUpdate_timestamp_success = getCurrentTimestampString(); + + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while updating database record. Error is:\n" + error); + + // reset cell value as an error occurred + newValueParams.data[newValueParams.column.colId] = newValueParams.oldValue; + + // on failure mark grid cell with red background and set update failure information + newValueParams.colDef.cellStyle = (p) => + p.rowIndex.toString() === newValueParams.node.id ? {'background-color': '#E79595'} : ""; + + newValueParams.api.refreshCells({ + force: true, + columns: [newValueParams.column.getId()], + rowNodes: [newValueParams.node] + }); + self.featureTable_indicator_lastUpdate_timestamp_failure = timestamp_string; + throw error; + }); + }, + sortable: true, + flex: 1, + minWidth: 200, + filter: true, + floatingFilter: true, + // filterParams: { + // newRowsAction: 'keep' + // }, + resizable: true, + wrapText: true, + autoHeight: true, + cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, + headerComponentParams: { + template: + '', + }, + }, + columnDefs: columnDefs, + rowData: rowData, + // enables undo / redo + undoRedoCellEditing: true, + // restricts the number of undo / redo steps to 10 + undoRedoCellEditingLimit: 10, + // enables flashing to help see cell changes + enableCellChangeFlash: true, + suppressRowClickSelection: true, + // rowSelection: 'multiple', + enableCellTextSelection: true, + ensureDomOrder: true, + pagination: true, + paginationPageSize: 10, + suppressColumnVirtualisation: true, + onViewportChanged: function () { + self.registerClickHandler_featureTable_indicatorResource(resourceType); + }, + + }; + + return gridOptions; + }; + + this.registerClickHandler_featureTable_indicatorResource = function (resourceType) { + + let className = ".indicatorDeleteFeatureRecordBtn"; + let url = __env.apiUrl + __env.basePath + "/indicators/"; + + $(className).off(); + $(className).on("click", function (event) { + + // ensure that only the target button gets clicked + event.stopPropagation(); + event.stopImmediatePropagation(); + $rootScope.$broadcast("showLoadingIcon_" + resourceType); + + // id example is "btn__indicator__deleteFeatureEntry__' + datasetId + '__' + spatialUnitId + '__' + params.data[__env.FEATURE_ID_PROPERTY_NAME] + '__' + params.data.kommonitorRecordId + '" class="btn btn-danger btn-sm indicatorDeleteFeatureRecordBtn" + let idArray = this.id.split("__"); + + let datasetId = idArray[3]; + let spatialUnitId = idArray[4]; + let featureId = idArray[5]; + let recordId = idArray[6]; + + url += datasetId + "/" + spatialUnitId + "/singleFeature/" + featureId + "/singleFeatureRecord/" + recordId; + + $http({ + url: url, + method: "DELETE" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + console.log("Successfully deleted database record"); + + $rootScope.$broadcast("onDeleteFeatureEntry_" + resourceType); + self.featureTable_indicator_lastUpdate_timestamp_success = getCurrentTimestampString(); + + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while deleting database record. Error is:\n" + error); + $rootScope.$broadcast("hideLoadingIcon_" + resourceType); + self.featureTable_indicator_lastUpdate_timestamp_failure = getCurrentTimestampString(); + throw error; + }); + }); + + }; + + this.buildDataGrid_featureTable_indicatorResource = function (domElementId, specificHeadersArray, dataArray, datasetId, resourceType, deleteButtonEnabled, spatialUnitId) { + + let dataGridOptions_featureTable = this.buildDataGridOptions_featureTable_indicatorResource(specificHeadersArray, dataArray, datasetId, resourceType, deleteButtonEnabled, spatialUnitId); + + let gridDiv = document.querySelector('#' + domElementId); + while (gridDiv.firstChild) { + gridDiv.removeChild(gridDiv.firstChild); + } + new agGrid.Grid(gridDiv, dataGridOptions_featureTable); + }; + + + // ROLE OVERVIEW TABLE + + this.buildDataGridColumnConfig_accessControl = function(isRealmAdmin){ + let columnDefs = []; + // Only show edit column if user is Realm Admin + if (isRealmAdmin) { + columnDefs.push({ headerName: 'Editierfunktionen', maxWidth: 200, checkboxSelection: (row) => {return row.data.name != "public" && row.data.name != "kommonitor"}, filter: false, sortable: false, cellRenderer: 'displayEditButtons_accessControl' }); + } + + return columnDefs.concat([ + //{ headerName: 'Id', field: "organizationalUnitId", minWidth: 400 }, + { headerName: 'Organisationseinheit', field: "name", minWidth: 300 }, + { headerName: 'Rollen', field: "roleString", minWidth: 300 }, + { headerName: 'Beschreibung', field: "description", minWidth: 400 }, + { headerName: 'Kontakt', field: "contact", minWidth: 400 }, + ]); + }; + + this.buildDataGridRowData_accessControl = function(dataArray){ + let data = JSON.parse(JSON.stringify(dataArray)); + for (let elem of data) { + elem.roleString = ""; + for (let role of elem.roles) { + elem.roleString += role.permissionLevel + ", "; + } + elem.roleString = elem.roleString.substring(0, elem.roleString.length - 2); + } + return data; + }; + + this.buildDataGridOptions_accessControl = function(accessControlArray){ + let columnDefs = this.buildDataGridColumnConfig_accessControl(kommonitorDataExchangeService.isRealmAdmin); + let rowData = this.buildDataGridRowData_accessControl(accessControlArray); + + let components = {}; + if (kommonitorDataExchangeService.isRealmAdmin) { + components = {displayEditButtons_accessControl: displayEditButtons_accessControl}; + } else { + components = {} + } + + let gridOptions = { + defaultColDef: { + editable: false, + sortable: true, + flex: 1, + minWidth: 200, + filter: true, + floatingFilter: true, + // filterParams: { + // newRowsAction: 'keep' + // }, + resizable: true, + wrapText: true, + autoHeight: true, + cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, + headerComponentParams: { + template: + '', + }, + }, + components: components, + columnDefs: columnDefs, + rowData: rowData, + suppressRowClickSelection: true, + rowSelection: 'multiple', + enableCellTextSelection: true, + ensureDomOrder: true, + pagination: true, + paginationPageSize: 10, + suppressColumnVirtualisation: true, + onFirstDataRendered: function () { + headerHeightSetter(self.dataGridOptions_accessControl); + }, + onColumnResized: function () { + headerHeightSetter(self.dataGridOptions_accessControl); + }, + onRowDataChanged: function () { + self.registerClickHandler_accessControl(accessControlArray); + }, + onModelUpdated: function () { + self.registerClickHandler_accessControl(accessControlArray); + }, + + onViewportChanged: function () { + self.registerClickHandler_accessControl(accessControlArray); + }, + + }; + + return gridOptions; + }; + + this.registerClickHandler_accessControl = function (roleMetadataArray) { + + $(".roleEditMetadataBtn").off(); + $(".roleEditMetadataBtn").on("click", function (event) { + // ensure that only the target button gets clicked + // manually open modal + event.stopPropagation(); + let modalId = document.getElementById(this.id).getAttribute("data-target"); + $(modalId).modal('show'); + + let id = this.id.split("_")[3]; + + let roleMetadata = kommonitorDataExchangeService.getAccessControlById(id); + + $rootScope.$broadcast("onEditRoleMetadata", roleMetadata); + }); + }; + + this.buildDataGrid_accessControl = function (accessControlArray) { + + if (this.dataGridOptions_accessControl && this.dataGridOptions_accessControl.api && document.querySelector('#roleOverviewTable').childElementCount > 0) { + + this.saveGridStore(this.dataGridOptions_accessControl); + let newRowData = this.buildDataGridRowData_accessControl(accessControlArray); + this.dataGridOptions_accessControl.api.setRowData(newRowData); + this.restoreGridStore(this.dataGridOptions_accessControl); + } + else { + this.dataGridOptions_accessControl = this.buildDataGridOptions_accessControl(accessControlArray); + let gridDiv = document.querySelector('#roleOverviewTable'); + new agGrid.Grid(gridDiv, this.dataGridOptions_accessControl); + } + }; + + + // SCRIPT OVERVIEW TABLE + + this.buildDataGridColumnConfig_scripts = function(){ + const columnDefs = [ + { headerName: 'Id', field: "scriptId", pinned: 'left', maxWidth: 125, checkboxSelection: true, headerCheckboxSelection: true, + headerCheckboxSelectionFilteredOnly: true }, + { headerName: 'Name', field: "name", pinned: 'left', maxWidth: 300 }, + { headerName: 'Ziel-Indikatoren-Id', field: "indicatorId", maxWidth: 125 }, + { headerName: 'Ziel-Indikatoren-Name', minWidth: 200, cellRenderer: function (params) { + return kommonitorDataExchangeService.getIndicatorNameFromIndicatorId(params.data.indicatorId); + }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return kommonitorDataExchangeService.getIndicatorNameFromIndicatorId(params.data.indicatorId); + } + }, + { headerName: 'Beschreibung', field: "description", minWidth: 300 }, + { headerName: 'notwendige Basis-Indikatoren', minWidth: 300, cellRenderer: function (params) { + + /* + + + + + + + + + + + + + +
        IdName
        {{::baseIndicatorId}}{{::$ctrl.kommonitorDataExchangeServiceInstance.getIndicatorNameFromIndicatorId(baseIndicatorId)}}
        + */ + if(params.data && params.data.requiredIndicatorIds && params.data.requiredIndicatorIds.length > 0){ + let html = ''; + + for (const baseIndicatorId of params.data.requiredIndicatorIds) { + html += ""; + html += ""; + html += ""; + html += ""; + } + + html += "
        IdName
        " + baseIndicatorId + "" + kommonitorDataExchangeService.getIndicatorNameFromIndicatorId(baseIndicatorId) + "
        "; + return html; + } + else{ + return "keine"; + } + + }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + + if(params.data && params.data.requiredIndicatorIds && params.data.requiredIndicatorIds.length > 0){ + let string = JSON.stringify(params.data.requiredIndicatorIds); + + for (const baseIndicatorId of params.data.requiredIndicatorIds) { + string += kommonitorDataExchangeService.getIndicatorNameFromIndicatorId(baseIndicatorId); + } + + return string; + } + else{ + return "keine"; + } + } + }, + { headerName: 'notwendige Basis-Georessourcen', minWidth: 300, cellRenderer: function (params) { + if(params.data && params.data.requiredGeoresourceIds && params.data.requiredGeoresourceIds.length > 0){ + let html = ''; + + for (const baseGeoresourceId of params.data.requiredGeoresourceIds) { + html += ""; + html += ""; + html += ""; + html += ""; + } + + html += "
        IdName
        " + baseGeoresourceId + "" + kommonitorDataExchangeService.getGeoresourceNameFromGeoresourceId(baseGeoresourceId) + "
        "; + return html; + } + else{ + return "keine"; + } + }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + if(params.data && params.data.requiredGeoresourceIds && params.data.requiredGeoresourceIds.length > 0){ + let string = JSON.stringify(params.data.requiredGeoresourceIds); + + for (const baseIndicatorId of params.data.requiredGeoresourceIds) { + string += kommonitorDataExchangeService.getGeoresourceNameFromGeoresourceId(baseIndicatorId); + } + + return string; + } + else{ + return "keine"; + } + } + }, + { headerName: 'Prozessparameter', field: "", minWidth: 1000, cellRenderer: function (params) { + /* + + + + + + + + + + + + + + + + + + + +
        NameBeschreibungDatentypStandard-Werterlaubter Wertebereich
        {{::processParameter.name}}{{::processParameter.description}}{{::processParameter.dataType}}{{::processParameter.defaultValue}}
        erlaubter Wertebereich {{::processParameter.minParameterValueForNumericInputs}} - {{::processParameter.maxParameterValueForNumericInputs}}
        + */ + if(params.data && params.data.variableProcessParameters && params.data.variableProcessParameters.length > 0){ + let html = ''; + + for (const processParameter of params.data.variableProcessParameters) { + html += ""; + html += ""; + html += ""; + html += ""; + html += ""; + html += ""; + html += ""; + } + + html += "
        NameBeschreibungDatentypStandard-Werterlaubter Wertebereich
        " + processParameter.name + "" + processParameter.description + "" + processParameter.dataType + "" + processParameter.defaultValue + "" ; + + if(processParameter.dataType == "integer" || processParameter.dataType == "double"){ + html += "erlaubter Wertebereich

        "; + html += "" + processParameter.minParameterValueForNumericInputs + " ‐ " + processParameter.maxParameterValueForNumericInputs; + } + + html += "
        "; + return html; + } + else{ + return "keine"; + } + }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + if(params.data && params.data.variableProcessParameters && params.data.variableProcessParameters.length > 0){ + return JSON.stringify(params.data.variableProcessParameters); + } + else{ + return "keine"; + } + } + } + ]; + + return columnDefs; + }; + + this.buildDataGridRowData_scripts = function(dataArray){ + + return dataArray; + }; + + this.buildDataGridOptions_scripts = function(scriptsArray){ + let columnDefs = this.buildDataGridColumnConfig_scripts(); + let rowData = this.buildDataGridRowData_scripts(scriptsArray); + + let gridOptions = { + defaultColDef: { + editable: false, + sortable: true, + flex: 1, + minWidth: 200, + filter: true, + floatingFilter: true, + // filterParams: { + // newRowsAction: 'keep' + // }, + resizable: true, + wrapText: true, + autoHeight: true, + cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, + headerComponentParams: { + template: + '', + }, + }, + columnDefs: columnDefs, + rowData: rowData, + suppressRowClickSelection: true, + rowSelection: 'multiple', + enableCellTextSelection: true, + ensureDomOrder: true, + pagination: true, + paginationPageSize: 10, + suppressColumnVirtualisation: true, + onFirstDataRendered: function () { + headerHeightSetter(self.dataGridOptions_scripts); + }, + onColumnResized: function () { + headerHeightSetter(self.dataGridOptions_scripts); + } + + }; + + return gridOptions; + }; + + this.buildDataGrid_scripts = function (scriptsArray) { + + if (this.dataGridOptions_scripts && this.dataGridOptions_scripts.api && document.querySelector('#scriptOverviewTable').childElementCount > 0) { + + this.saveGridStore(this.dataGridOptions_scripts); + let newRowData = this.buildDataGridRowData_scripts(scriptsArray); + this.dataGridOptions_scripts.api.setRowData(newRowData); + this.restoreGridStore(this.dataGridOptions_scripts); + } + else { + this.dataGridOptions_scripts = this.buildDataGridOptions_scripts(scriptsArray); + let gridDiv = document.querySelector('#scriptOverviewTable'); + new agGrid.Grid(gridDiv, this.dataGridOptions_scripts); + } + }; + + // DEFAULT JOBS OVERVIEW TABLE + + this.buildDataGridColumnConfig_defaultJobs = function(){ + const columnDefs = [ + { headerName: 'Job-Id', field: "jobId", pinned: 'left', maxWidth: 125, checkboxSelection: true, headerCheckboxSelection: true, + headerCheckboxSelectionFilteredOnly: true }, + { headerName: 'Script-Id', field: "jobData.scriptId", pinned: 'left', maxWidth: 125 }, + { headerName: 'Ziel-Indikator', pinned: 'left', maxWidth: 250, cellRenderer: function (params) { + if(params.data.jobData && params.data.jobData.targetIndicatorId){ + let indicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(params.data.jobData.targetIndicatorId); + if (indicatorMetadata){ + return indicatorMetadata.indicatorName; + } + } + return ""; + }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + if(params.data.jobData && params.data.jobData.targetIndicatorId){ + let indicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(params.data.jobData.targetIndicatorId); + if (indicatorMetadata){ + return indicatorMetadata.indicatorName; + } + } + return ""; + } + }, + { headerName: 'Job-Status', field: "status", maxWidth: 125 }, + { headerName: 'Job-Fortschritt', field: "progress", maxWidth: 125 }, + { headerName: 'Job-Data', minWidth: 500, cellRenderer: function (params) { + return kommonitorDataExchangeService.syntaxHighlightJSON(params.data.jobData); + }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return params.data.jobData; + } + }, + { headerName: 'Job-Logs', maxWidth: 150, cellRenderer: function (params) { + if(params.data.logs){ + + var logJSON = JSON.stringify(params.data.logs); + + var blob = new Blob([logJSON], {type: "application/json"}); + var data = URL.createObjectURL(blob); + + let html = ''; + return html; + } + else{ + return "Dieser Job umfasst keine Logs"; + } + }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return params.data.logs; + } + }, + { headerName: 'Job-Summary', minWidth: 1000, cellRenderer: function (params) { + + let html = ""; + if(params.data.spatialUnitIntegrationSummary && params.data.spatialUnitIntegrationSummary.length > 0){ + html += ''; + + for (const item of params.data.spatialUnitIntegrationSummary) { + html += ""; + html += ""; + html += ""; + html += ""; + html += ""; + html += ""; + if(item.errorsOccurred && item.errorsOccurred.length > 0){ + html += ""; + } + else{ + html += ""; + } + + html += ""; + } + html += "
        Raumeinheits-IdRaumeinheits-NameAnzahl integrierter Indikatoren-FeaturesAnzahl integrierter Zeitstempelintegrierte ZeitstempelFehlermeldung
        " + item.spatialUnitId + "" + item.spatialUnitName + "" + item.numberOfIntegratedIndicatorFeatures + "" + item.numberOfIntegratedTargetDates + "" + item.integratedTargetDates + "" + kommonitorDataExchangeService.syntaxHighlightJSON(item.errorsOccurred) + "keine Fehlermeldungen vorhanden
        "; + } + else{ + html += "Dieser Job umfasst keine Informationen zur erfolgreichen/gescheiterten Datenintegration"; + } + + return html; + }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return JSON.stringify(params.data.spatialUnitIntegrationSummary); + } + } + + ]; + + return columnDefs; + }; + + this.buildDataGridRowData_defaultJobs = function(dataArray){ + + dataArray.sort((a, b) => b.jobId - a.jobId); + + return dataArray; + }; + + this.buildDataGridOptions_defaultJobs = function(jobsArray){ + let columnDefs = this.buildDataGridColumnConfig_defaultJobs(); + let rowData = this.buildDataGridRowData_defaultJobs(jobsArray); + + let gridOptions = { + defaultColDef: { + editable: false, + sortable: true, + flex: 1, + minWidth: 200, + filter: true, + floatingFilter: true, + // filterParams: { + // newRowsAction: 'keep' + // }, + resizable: true, + wrapText: true, + autoHeight: true, + cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, + headerComponentParams: { + template: + '', + }, + }, + columnDefs: columnDefs, + rowData: rowData, + suppressRowClickSelection: true, + rowSelection: 'multiple', + enableCellTextSelection: true, + ensureDomOrder: true, + pagination: true, + paginationPageSize: 10, + suppressColumnVirtualisation: true, + onFirstDataRendered: function () { + headerHeightSetter(self.dataGridOptions_scripts); + }, + onColumnResized: function () { + headerHeightSetter(self.dataGridOptions_scripts); + } + + }; + + return gridOptions; + }; + + this.buildDataGrid_defaultJobs = function (jobsArray) { + + if (this.dataGridOptions_defaultJobs && this.dataGridOptions_defaultJobs.api && document.querySelector('#jobExecutionTable_defaultComputation').childElementCount > 0) { + + this.saveGridStore(this.dataGridOptions_defaultJobs); + let newRowData = this.buildDataGridRowData_defaultJobs(jobsArray); + this.dataGridOptions_defaultJobs.api.setRowData(newRowData); + this.restoreGridStore(this.dataGridOptions_defaultJobs); + } + else { + this.dataGridOptions_defaultJobs = this.buildDataGridOptions_defaultJobs(jobsArray); + let gridDiv = document.querySelector('#jobExecutionTable_defaultComputation'); + new agGrid.Grid(gridDiv, this.dataGridOptions_defaultJobs); + } + }; + + // CUSTOMIZED JOBS OVERVIEW TABLE + + this.buildDataGridColumnConfig_customizedJobs = function(){ + const columnDefs = [ + { headerName: 'Job-Id', field: "jobId", pinned: 'left', maxWidth: 125, checkboxSelection: true, headerCheckboxSelection: true, + headerCheckboxSelectionFilteredOnly: true}, + { headerName: 'Job-Status', field: "status", maxWidth: 125 }, + { headerName: 'Job-Fortschritt', field: "progress", maxWidth: 125 }, + { headerName: 'Job-Data', minWidth: 500, cellRenderer: function (params) { + return kommonitorDataExchangeService.syntaxHighlightJSON(params.data.jobData); + }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return params.data.jobData; + } + }, + { headerName: 'Job-Logs', maxWidth: 150, cellRenderer: function (params) { + if(params.data.logs){ + + var logJSON = JSON.stringify(params.data.logs); + + var blob = new Blob([logJSON], {type: "application/json"}); + var data = URL.createObjectURL(blob); + + let html = ''; + return html; + } + else{ + return "Dieser Job umfasst keine Logs"; + } + }, + filter: 'agTextColumnFilter', + filterValueGetter: (params) => { + return params.data.logs; + } + } + + ]; + + return columnDefs; + }; + + this.buildDataGridRowData_customizedJobs = function(dataArray){ + + dataArray.sort((a, b) => b.jobId - a.jobId); + + return dataArray; + }; + + this.buildDataGridOptions_customizedJobs = function(jobsArray){ + let columnDefs = this.buildDataGridColumnConfig_customizedJobs(); + let rowData = this.buildDataGridRowData_customizedJobs(jobsArray); + + let gridOptions = { + defaultColDef: { + editable: false, + sortable: true, + flex: 1, + minWidth: 200, + filter: true, + floatingFilter: true, + // filterParams: { + // newRowsAction: 'keep' + // }, + resizable: true, + wrapText: true, + autoHeight: true, + cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, + headerComponentParams: { + template: + '', + }, + }, + columnDefs: columnDefs, + rowData: rowData, + suppressRowClickSelection: true, + rowSelection: 'multiple', + enableCellTextSelection: true, + ensureDomOrder: true, + pagination: true, + paginationPageSize: 10, + suppressColumnVirtualisation: true, + onFirstDataRendered: function () { + headerHeightSetter(self.dataGridOptions_scripts); + }, + onColumnResized: function () { + headerHeightSetter(self.dataGridOptions_scripts); + } + + }; + + return gridOptions; + }; + + this.buildDataGrid_customizedJobs = function (jobsArray) { + + if (this.dataGridOptions_customizedJobs && this.dataGridOptions_customizedJobs.api && document.querySelector('#jobExecutionTable_customizedComputation').childElementCount > 0) { + + this.saveGridStore(this.dataGridOptions_customizedJobs); + let newRowData = this.buildDataGridRowData_customizedJobs(jobsArray); + this.dataGridOptions_customizedJobs.api.setRowData(newRowData); + this.restoreGridStore(this.dataGridOptions_customizedJobs); + } + else { + this.dataGridOptions_customizedJobs = this.buildDataGridOptions_customizedJobs(jobsArray); + let gridDiv = document.querySelector('#jobExecutionTable_customizedComputation'); + new agGrid.Grid(gridDiv, this.dataGridOptions_customizedJobs); + } + }; + + function anyHigherRoleIsChecked(roles, roleSuffix){ + let filteresRoles = []; + + if(roleSuffix == "viewer"){ + filteresRoles = roles.filter(function(role){ + if (role.isChecked && (role.permissionLevel == "editor" || role.permissionLevel == "creator")){ + return true; + } + }); + } + else if (roleSuffix == "editor"){ + filteresRoles = roles.filter(function(role){ + if (role.isChecked && role.permissionLevel == "creator"){ + return true; + } + }); + } + + return filteresRoles.length > 0; + }; + + function CheckboxRenderer_viewer() {} + + CheckboxRenderer_viewer.prototype.init = function(params) { + this.params = params; + + let isChecked = false; + let exists = false; + let className; + for (const role of params.data.roles) { + if (role.permissionLevel == "viewer"){ + exists = true; + isChecked = role.isChecked; + className = role.roleId; + break; + } + } + + if(exists){ + this.eGui = document.createElement('input'); + this.eGui.className = className; + this.eGui.type = 'checkbox'; + this.eGui.checked = isChecked; + + this.checkedHandler = this.checkedHandler.bind(this); + this.eGui.addEventListener('click', this.checkedHandler); + // if higher role rights are checked as well + if(isChecked && anyHigherRoleIsChecked(params.data.roles, "viewer")){ + this.eGui.disabled = true; + } + } + }; + + CheckboxRenderer_viewer.prototype.checkedHandler = function(e) { + let checked = e.target.checked; + for (const role of this.params.data.roles) { + if (role.permissionLevel == "viewer"){ + role.isChecked = checked; + break; + } + } + }; + + CheckboxRenderer_viewer.prototype.getGui = function(params) { + return this.eGui; + }; + + CheckboxRenderer_viewer.prototype.destroy = function(params) { + if(this.eGui){ + this.eGui.removeEventListener('click', this.checkedHandler); + } + }; + + function CheckboxRenderer_editor() {} + + CheckboxRenderer_editor.prototype.init = function(params) { + this.params = params; + + let isChecked = false; + let exists = false; + let className; + for (const role of params.data.roles) { + if (role.permissionLevel == "editor"){ + exists = true; + isChecked = role.isChecked; + className = role.roleId; + break; + } + } + + if(exists){ + this.eGui = document.createElement('input'); + this.eGui.className = className; + this.eGui.type = 'checkbox'; + this.eGui.checked = isChecked; + + this.checkedHandler = this.checkedHandler.bind(this); + this.eGui.addEventListener('click', this.checkedHandler); + // if higher role rights are checked as well + if(isChecked && anyHigherRoleIsChecked(params.data.roles, "editor")){ + this.eGui.disabled = true; + } + } + }; + + CheckboxRenderer_editor.prototype.checkedHandler = function(e) { + let checked = e.target.checked; + for (const role of this.params.data.roles) { + if (role.permissionLevel == "viewer"){ + if (checked){ + role.isChecked = true; + $('.' + role.roleId).attr('disabled', true); + $('.' + role.roleId).prop("checked", true); + } + else{ + $('.' + role.roleId).attr('disabled', false); + } + } + else if (role.permissionLevel == "editor"){ + role.isChecked = checked; + } + } + }; + + CheckboxRenderer_editor.prototype.getGui = function(params) { + return this.eGui; + }; + + CheckboxRenderer_editor.prototype.destroy = function(params) { + if(this.eGui){ + this.eGui.removeEventListener('click', this.checkedHandler); + } + }; + + function CheckboxRenderer_creator() {} + + CheckboxRenderer_creator.prototype.init = function(params) { + this.params = params; + + let isChecked = false; + let exists = false; + let className; + for (const role of params.data.roles) { + if (role.permissionLevel == "creator"){ + exists = true; + isChecked = role.isChecked; + className = role.roleId; + break; + } + } + + if(exists){ + this.eGui = document.createElement('input'); + this.eGui.className = className; + this.eGui.type = 'checkbox'; + this.eGui.checked = isChecked; + + this.checkedHandler = this.checkedHandler.bind(this); + this.eGui.addEventListener('click', this.checkedHandler); + } + }; + + CheckboxRenderer_creator.prototype.checkedHandler = function(e) { + let checked = e.target.checked; + for (const role of this.params.data.roles) { + if (role.permissionLevel == "editor"){ + if (checked){ + role.isChecked = true; + $('.' + role.roleId).attr('disabled', true); + $('.' + role.roleId).prop("checked", true); + } + else{ + $('.' + role.roleId).attr('disabled', false); + } + } + else if (role.permissionLevel == "viewer"){ + if (checked){ + role.isChecked = true; + $('.' + role.roleId).attr('disabled', true); + $('.' + role.roleId).prop("checked", true); + } + else{ + $('.' + role.roleId).attr('disabled', true); + } + } + else if (role.permissionLevel == "creator" || role.permissionLevel == "editor" || role.permissionLevel == "viewer"){ + role.isChecked = checked; + } + } + }; + + CheckboxRenderer_creator.prototype.getGui = function(params) { + return this.eGui; + }; + + CheckboxRenderer_creator.prototype.destroy = function(params) { + if(this.eGui){ + this.eGui.removeEventListener('click', this.checkedHandler); + } + }; + + this.buildRoleManagementGridRowData = function(accessControlMetadata, selectedRoleIds){ + let data = JSON.parse(JSON.stringify(accessControlMetadata)); + for (let elem of data) { + for (let role of elem.roles) { + role.isChecked = false; + if (selectedRoleIds && selectedRoleIds.includes(role.roleId)){ + role.isChecked = true; + } + } + } + + let array = []; + array.push(data[0]); + array.push(data[1]); + + data.splice(0,2); + data.sort(function (a, b) { + if (a.name < b.name) { + return -1; + } + if (a.name > b.name) { + return 1; + } + return 0; + }); + + array = array.concat(data); + + return array; + }; + + this.buildRoleManagementGridColumnConfig = function(){ + let columnDefs = []; + + return columnDefs.concat([ + { headerName: 'Organisationseinheit', field: "name", minWidth: 200 }, + { headerName: 'lesen', field: "roles", filter: false, sortable: false, maxWidth: 100, cellRenderer: 'checkboxRenderer_viewer', }, + { headerName: 'editieren', field: "roles", filter: false, sortable: false, maxWidth: 100, cellRenderer: 'checkboxRenderer_editor', }, + { headerName: 'löschen', field: "roles", filter: false, sortable: false, maxWidth: 100, cellRenderer: 'checkboxRenderer_creator', } + ]); + }; + + this.buildRoleManagementGridOptions = function(accessControlMetadata, selectedRoleIds){ + let columnDefs = this.buildRoleManagementGridColumnConfig(); + let rowData = this.buildRoleManagementGridRowData(accessControlMetadata, selectedRoleIds); + + let components = { + checkboxRenderer_viewer: CheckboxRenderer_viewer, + checkboxRenderer_editor: CheckboxRenderer_editor, + checkboxRenderer_creator: CheckboxRenderer_creator + }; + + let gridOptions = { + defaultColDef: { + editable: false, + sortable: true, + flex: 1, + minWidth: 200, + filter: true, + floatingFilter: false, + // filterParams: { + // newRowsAction: 'keep' + // }, + resizable: true, + wrapText: true, + autoHeight: true, + cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, + headerComponentParams: { + template: + '', + }, + }, + components: components, + floatingFilter: false, + columnDefs: columnDefs, + rowData: rowData, + rowHeight: 10, + suppressRowClickSelection: true, + rowSelection: 'multiple', + enableCellTextSelection: false, + ensureDomOrder: true, + pagination: true, + paginationPageSize: 5, + suppressColumnVirtualisation: true, + onFirstDataRendered: function () { + }, + onColumnResized: function () { + self.registerClickHandler_accessControl(accessControlMetadata); + }, + onRowDataChanged: function () { + self.registerClickHandler_accessControl(accessControlMetadata); + }, + onModelUpdated: function () { + self.registerClickHandler_accessControl(accessControlMetadata); + }, + onViewportChanged: function () { + self.registerClickHandler_accessControl(accessControlMetadata); + }, + + }; + + return gridOptions; + }; + + this.buildRoleManagementGrid = function(tableDOMId, currentTableOptionsObject, accessControlMetadata, selectedRoleIds){ + if (currentTableOptionsObject && currentTableOptionsObject.api) { + + let newRowData = this.buildRoleManagementGridRowData(accessControlMetadata, selectedRoleIds); + currentTableOptionsObject.api.setRowData(newRowData); + } + else { + currentTableOptionsObject = this.buildRoleManagementGridOptions(accessControlMetadata, selectedRoleIds); + let gridDiv = document.querySelector('#' + tableDOMId); + new agGrid.Grid(gridDiv, currentTableOptionsObject); + } + return currentTableOptionsObject; + }; + + this.getSelectedRoleIds_roleManagementGrid = function(roleManagementTableOptions){ + let ids = []; + if (roleManagementTableOptions && roleManagementTableOptions.api){ + + roleManagementTableOptions.api.forEachNode(function(node, index){ + for (const role of node.data.roles) { + if(role && role.isChecked){ + ids.push(role.roleId); + } + } + }) + } + return ids; + }; + + this.saveGridStore = function (gridOptions) { + window.colState = gridOptions.columnApi.getColumnState(); + window.filterState = gridOptions.api.getFilterModel(); + + }; + + this.restoreGridStore = function (gridOptions) { + // gridOptions.columnApi.setColumnState(window.colState); + // gridOptions.columnApi.setColumnGroupState(window.groupState); + if (window.colState) { + gridOptions.columnApi.applyColumnState({ state: window.colState, applyOrder: true }); + } + + if (window.filterState) { + gridOptions.api.setFilterModel(window.filterState); + } + }; + + }]); diff --git a/app/util/genericServices/kommonitorDiagramHelperService/kommonitor-diagram-helper-service.module.js b/app/util/genericServices/kommonitorDiagramHelperService/kommonitor-diagram-helper-service.module.js index b25aaf9af..fc84ed1f0 100644 --- a/app/util/genericServices/kommonitorDiagramHelperService/kommonitor-diagram-helper-service.module.js +++ b/app/util/genericServices/kommonitorDiagramHelperService/kommonitor-diagram-helper-service.module.js @@ -1,5 +1,5 @@ +"use strict"; angular.module('kommonitorDiagramHelper', ['kommonitorMap', 'kommonitorDataExchange']); - /** * a common serviceInstance that holds all needed properties for a WPS service. * @@ -10,2063 +10,1771 @@ angular.module('kommonitorDiagramHelper', ['kommonitorMap', 'kommonitorDataExcha * parameters for each WPS operation represented by different Angular components */ angular - .module('kommonitorDiagramHelper', ["kommonitorFilterHelper"]) - .service( - 'kommonitorDiagramHelperService', ['$rootScope', '$timeout', 'kommonitorMapService', 'kommonitorDataExchangeService', + .module('kommonitorDiagramHelper', ["kommonitorFilterHelper"]) + .service('kommonitorDiagramHelperService', ['$rootScope', '$timeout', 'kommonitorMapService', 'kommonitorDataExchangeService', 'kommonitorFilterHelperService', '$http', '__env', '$q', - function ($rootScope, $timeout, - kommonitorMapService, kommonitorDataExchangeService, kommonitorFilterHelperService, $http, __env, $q) { - - const INDICATOR_DATE_PREFIX = __env.indicatorDatePrefix; - const defaultColorForHoveredFeatures = __env.defaultColorForHoveredFeatures; - const defaultColorForClickedFeatures = __env.defaultColorForClickedFeatures; - - var numberOfDecimals = __env.numberOfDecimals; - var defaultColorForZeroValues = __env.defaultColorForZeroValues; - var defaultColorForNoDataValues = __env.defaultColorForNoDataValues; - var defaultColorForFilteredValues = __env.defaultColorForFilteredValues; - - const defaultColorForOutliers_high = __env.defaultColorForOutliers_high; - const defaultBorderColorForOutliers_high = __env.defaultBorderColorForOutliers_high; - const defaultFillOpacityForOutliers_high = __env.defaultFillOpacityForOutliers_high; - const defaultColorForOutliers_low = __env.defaultColorForOutliers_low; - const defaultBorderColorForOutliers_low = __env.defaultBorderColorForOutliers_low; - const defaultFillOpacityForOutliers_low = __env.defaultFillOpacityForOutliers_low; - - this.indicatorPropertyName = ""; - - this.barChartOptions = {}; - this.lineChartOptions = {}; - this.histogramChartOptions = {}; - this.radarChartOptions = {}; - this.regressionChartOptions = {}; - - this.isCloserToTargetDate = function(date, closestDate, targetDate){ - var targetYear = targetDate.split("-")[0]; - var targetMonth = targetDate.split("-")[1]; - var targetDay = targetDate.split("-")[2]; - - var closestDateComps = closestDate.split("-"); - var closestDateYear = closestDateComps[0]; - var closestDateMonth = closestDateComps[1]; - var closestDateDay = closestDateComps[2]; - - var dateComps = date.split("-"); - var year = dateComps[0]; - var month = dateComps[1]; - var day = dateComps[2]; - - var monthDiff_closestDate = Math.abs(targetMonth - closestDateMonth); - var monthDiff_date = Math.abs(targetMonth - month); - - if(monthDiff_date <= monthDiff_closestDate){ - var dayDiff_closestDate = Math.abs(targetDay - closestDateDay); - var dayDiff_date = Math.abs(targetDay - day); - - if(dayDiff_date < dayDiff_closestDate){ - return true; - } - } - return false; - }; - - this.findClostestTimestamForTargetDate = function(indicatorForRadar, targetDate){ - var applicableDates = indicatorForRadar.indicatorMetadata.applicableDates; - - var targetYear = targetDate.split("-")[0]; - var targetMonth = targetDate.split("-")[1]; - var targetDay = targetDate.split("-")[2]; - - var closestDate = undefined; - - for (var date of applicableDates) { - var dateComps = date.split("-"); - var year = dateComps[0]; - var month = dateComps[1]; - var day = dateComps[2]; - - if(targetDate.includes(year)){ - if(! closestDate){ - closestDate = date; + function ($rootScope, $timeout, kommonitorMapService, kommonitorDataExchangeService, kommonitorFilterHelperService, $http, __env, $q) { + const INDICATOR_DATE_PREFIX = __env.indicatorDatePrefix; + const defaultColorForHoveredFeatures = __env.defaultColorForHoveredFeatures; + const defaultColorForClickedFeatures = __env.defaultColorForClickedFeatures; + var numberOfDecimals = __env.numberOfDecimals; + var defaultColorForZeroValues = __env.defaultColorForZeroValues; + var defaultColorForNoDataValues = __env.defaultColorForNoDataValues; + var defaultColorForFilteredValues = __env.defaultColorForFilteredValues; + const defaultColorForOutliers_high = __env.defaultColorForOutliers_high; + const defaultBorderColorForOutliers_high = __env.defaultBorderColorForOutliers_high; + const defaultFillOpacityForOutliers_high = __env.defaultFillOpacityForOutliers_high; + const defaultColorForOutliers_low = __env.defaultColorForOutliers_low; + const defaultBorderColorForOutliers_low = __env.defaultBorderColorForOutliers_low; + const defaultFillOpacityForOutliers_low = __env.defaultFillOpacityForOutliers_low; + this.indicatorPropertyName = ""; + this.barChartOptions = {}; + this.lineChartOptions = {}; + this.histogramChartOptions = {}; + this.radarChartOptions = {}; + this.regressionChartOptions = {}; + this.isCloserToTargetDate = function (date, closestDate, targetDate) { + var targetYear = targetDate.split("-")[0]; + var targetMonth = targetDate.split("-")[1]; + var targetDay = targetDate.split("-")[2]; + var closestDateComps = closestDate.split("-"); + var closestDateYear = closestDateComps[0]; + var closestDateMonth = closestDateComps[1]; + var closestDateDay = closestDateComps[2]; + var dateComps = date.split("-"); + var year = dateComps[0]; + var month = dateComps[1]; + var day = dateComps[2]; + var monthDiff_closestDate = Math.abs(targetMonth - closestDateMonth); + var monthDiff_date = Math.abs(targetMonth - month); + if (monthDiff_date <= monthDiff_closestDate) { + var dayDiff_closestDate = Math.abs(targetDay - closestDateDay); + var dayDiff_date = Math.abs(targetDay - day); + if (dayDiff_date < dayDiff_closestDate) { + return true; + } } - else{ - if(this.isCloserToTargetDate(date, closestDate, targetDate)){ - closestDate = date; - } + return false; + }; + this.findClostestTimestamForTargetDate = function (indicatorForRadar, targetDate) { + var applicableDates = indicatorForRadar.indicatorMetadata.applicableDates; + var targetYear = targetDate.split("-")[0]; + var targetMonth = targetDate.split("-")[1]; + var targetDay = targetDate.split("-")[2]; + var closestDate = undefined; + for (var date of applicableDates) { + var dateComps = date.split("-"); + var year = dateComps[0]; + var month = dateComps[1]; + var day = dateComps[2]; + if (targetDate.includes(year)) { + if (!closestDate) { + closestDate = date; + } + else { + if (this.isCloserToTargetDate(date, closestDate, targetDate)) { + closestDate = date; + } + } + } } - - } - } - - return closestDate; - }; - - // an array of only the properties and metadata of all indicatorFeatures - this.indicatorPropertiesForCurrentSpatialUnitAndTime; - - this.filterSameUnitAndSameTime = false; - - this.setupIndicatorPropertiesForCurrentSpatialUnitAndTime = function (filterBySameUnitAndSameTime) { - - $rootScope.$broadcast("allIndicatorPropertiesForCurrentSpatialUnitAndTime setup begin"); - - this.indicatorPropertiesForCurrentSpatialUnitAndTime = []; - - kommonitorDataExchangeService.displayableIndicators.forEach(indicatorMetadata => { - var targetYear = kommonitorDataExchangeService.selectedDate.split("-")[0]; - var indicatorCandidateYears = [] - indicatorMetadata.applicableDates.forEach((date, i) => { - indicatorCandidateYears.push(date.split("-")[0]); - }); - - - // if (indicatorCandidateYears.includes(targetYear) && indicatorMetadata.applicableSpatialUnits.some(o => o.spatialUnitName === kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel)) { - // var selectableIndicatorEntry = {}; - // selectableIndicatorEntry.indicatorProperties = null; - // // per default show no indicators on radar - // selectableIndicatorEntry.isSelected = false; - // selectableIndicatorEntry.indicatorMetadata = indicatorMetadata; - // selectableIndicatorEntry.closestTimestamp = undefined; - - // this.indicatorPropertiesForCurrentSpatialUnitAndTime.push(selectableIndicatorEntry); - // } - - if (indicatorMetadata.applicableSpatialUnits.some(o => o.spatialUnitName === kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel)) { - var canBeAdded = true; - - if(filterBySameUnitAndSameTime){ - if(indicatorCandidateYears.includes(targetYear)){ - canBeAdded = true; - } - else{ - canBeAdded = false; - } + return closestDate; + }; + // an array of only the properties and metadata of all indicatorFeatures + this.indicatorPropertiesForCurrentSpatialUnitAndTime; + this.filterSameUnitAndSameTime = false; + this.setupIndicatorPropertiesForCurrentSpatialUnitAndTime = function (filterBySameUnitAndSameTime) { + $rootScope.$broadcast("allIndicatorPropertiesForCurrentSpatialUnitAndTime setup begin"); + this.indicatorPropertiesForCurrentSpatialUnitAndTime = []; + kommonitorDataExchangeService.displayableIndicators.forEach(indicatorMetadata => { + var targetYear = kommonitorDataExchangeService.selectedDate.split("-")[0]; + var indicatorCandidateYears = []; + indicatorMetadata.applicableDates.forEach((date, i) => { + indicatorCandidateYears.push(date.split("-")[0]); + }); + // if (indicatorCandidateYears.includes(targetYear) && indicatorMetadata.applicableSpatialUnits.some(o => o.spatialUnitName === kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel)) { + // var selectableIndicatorEntry = {}; + // selectableIndicatorEntry.indicatorProperties = null; + // // per default show no indicators on radar + // selectableIndicatorEntry.isSelected = false; + // selectableIndicatorEntry.indicatorMetadata = indicatorMetadata; + // selectableIndicatorEntry.closestTimestamp = undefined; + // this.indicatorPropertiesForCurrentSpatialUnitAndTime.push(selectableIndicatorEntry); + // } + if (indicatorMetadata.applicableSpatialUnits.some(o => o.spatialUnitName === kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel)) { + var canBeAdded = true; + if (filterBySameUnitAndSameTime) { + if (indicatorCandidateYears.includes(targetYear)) { + canBeAdded = true; + } + else { + canBeAdded = false; + } + } + if (canBeAdded) { + var selectableIndicatorEntry = {}; + selectableIndicatorEntry.indicatorProperties = null; + // per default show no indicators on radar + selectableIndicatorEntry.isSelected = false; + selectableIndicatorEntry.indicatorMetadata = indicatorMetadata; + // selectableIndicatorEntry.closestTimestamp = undefined; + this.indicatorPropertiesForCurrentSpatialUnitAndTime.push(selectableIndicatorEntry); + } + } + }); + $rootScope.$broadcast("allIndicatorPropertiesForCurrentSpatialUnitAndTime setup completed"); + }; + this.fetchIndicatorPropertiesIfNotExists = async function (index) { + if (this.indicatorPropertiesForCurrentSpatialUnitAndTime[index].indicatorProperties === null || this.indicatorPropertiesForCurrentSpatialUnitAndTime[index].indicatorProperties === undefined) { + // var dateComps = kommonitorDataExchangeService.selectedDate.split("-"); + // + // var year = dateComps[0]; + // var month = dateComps[1]; + // var day = dateComps[2]; + this.indicatorPropertiesForCurrentSpatialUnitAndTime[index].indicatorProperties = await this.fetchIndicatorProperties(this.indicatorPropertiesForCurrentSpatialUnitAndTime[index].indicatorMetadata, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitId); } - - if (canBeAdded){ - var selectableIndicatorEntry = {}; - selectableIndicatorEntry.indicatorProperties = null; - // per default show no indicators on radar - selectableIndicatorEntry.isSelected = false; - selectableIndicatorEntry.indicatorMetadata = indicatorMetadata; - // selectableIndicatorEntry.closestTimestamp = undefined; - - this.indicatorPropertiesForCurrentSpatialUnitAndTime.push(selectableIndicatorEntry); + }; + this.fetchIndicatorProperties = function (indicatorMetadata, spatialUnitId) { + return $http({ + url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/indicators/" + indicatorMetadata.indicatorId + "/" + spatialUnitId + "/without-geometry", + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + return response.data; + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + kommonitorDataExchangeService.displayMapApplicationError(error); + }); + }; + this.getColorFromBrewInstance = function (brewInstance, feature, targetDate) { + var color; + for (var index = 0; index < brewInstance.breaks.length; index++) { + if (kommonitorDataExchangeService.getIndicatorValueFromArray_asNumber(feature.properties, targetDate) == kommonitorDataExchangeService.getIndicatorValue_asNumber(brewInstance.breaks[index])) { + if (index < brewInstance.breaks.length - 1) { + // min value + color = brewInstance.colors[index]; + break; + } + else { + //max value + if (brewInstance.colors[index]) { + color = brewInstance.colors[index]; + } + else { + color = brewInstance.colors[index - 1]; + } + break; + } + } + else { + if (kommonitorDataExchangeService.getIndicatorValueFromArray_asNumber(feature.properties, targetDate) < kommonitorDataExchangeService.getIndicatorValue_asNumber(brewInstance.breaks[index + 1])) { + color = brewInstance.colors[index]; + break; + } + } } - - } - }); - - $rootScope.$broadcast("allIndicatorPropertiesForCurrentSpatialUnitAndTime setup completed"); - }; - - this.fetchIndicatorPropertiesIfNotExists = async function(index){ - if(this.indicatorPropertiesForCurrentSpatialUnitAndTime[index].indicatorProperties === null || this.indicatorPropertiesForCurrentSpatialUnitAndTime[index].indicatorProperties === undefined){ - // var dateComps = kommonitorDataExchangeService.selectedDate.split("-"); - // - // var year = dateComps[0]; - // var month = dateComps[1]; - // var day = dateComps[2]; - - this.indicatorPropertiesForCurrentSpatialUnitAndTime[index].indicatorProperties = await this.fetchIndicatorProperties(this.indicatorPropertiesForCurrentSpatialUnitAndTime[index].indicatorMetadata, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitId); - } - }; - - this.fetchIndicatorProperties = function (indicatorMetadata, spatialUnitId) { - return $http({ - url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/indicators/" + indicatorMetadata.indicatorId + "/" + spatialUnitId + "/without-geometry", - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - return response.data; - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - kommonitorDataExchangeService.displayMapApplicationError(error); - }); - }; - - this.getColorFromBrewInstance = function(brewInstance, feature, targetDate){ - var color; - for (var index=0; index < brewInstance.breaks.length; index++){ - - if(kommonitorDataExchangeService.getIndicatorValueFromArray_asNumber(feature.properties, targetDate) == kommonitorDataExchangeService.getIndicatorValue_asNumber(brewInstance.breaks[index])){ - if(index < brewInstance.breaks.length -1){ - // min value - color = brewInstance.colors[index]; - break; + return color; + }; + this.getColorForFeature = function (feature, indicatorMetadataAndGeoJSON, targetDate, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue) { + var color; + if (!targetDate.includes(INDICATOR_DATE_PREFIX)) { + targetDate = INDICATOR_DATE_PREFIX + targetDate; } - else { - //max value - if (brewInstance.colors[index]){ - color = brewInstance.colors[index]; - } - else{ - color = brewInstance.colors[index - 1]; - } - break; + if (kommonitorDataExchangeService.indicatorValueIsNoData(feature.properties[targetDate])) { + color = defaultColorForNoDataValues; } - } - else{ - if(kommonitorDataExchangeService.getIndicatorValueFromArray_asNumber(feature.properties, targetDate) < kommonitorDataExchangeService.getIndicatorValue_asNumber(brewInstance.breaks[index + 1])) { - color = brewInstance.colors[index]; - break; + else if (kommonitorFilterHelperService.featureIsCurrentlyFiltered(feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { + color = defaultColorForFilteredValues; } - } - } - - return color; - }; - - this.getColorForFeature = function(feature, indicatorMetadataAndGeoJSON, targetDate, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue){ - var color; - - if(!targetDate.includes(INDICATOR_DATE_PREFIX)){ - targetDate = INDICATOR_DATE_PREFIX + targetDate; - } - - if(kommonitorDataExchangeService.indicatorValueIsNoData(feature.properties[targetDate])){ - color = defaultColorForNoDataValues; - } - else if(kommonitorFilterHelperService.featureIsCurrentlyFiltered(feature.properties[__env.FEATURE_ID_PROPERTY_NAME])){ - color = defaultColorForFilteredValues; - } - else if(kommonitorDataExchangeService.classifyZeroSeparately && kommonitorDataExchangeService.getIndicatorValueFromArray_asNumber(feature.properties, targetDate) === 0 ){ - color = defaultColorForZeroValues; - } - else if(feature.properties["outlier"] !== undefined && feature.properties["outlier"].includes("low") && kommonitorDataExchangeService.useOutlierDetectionOnIndicator){ - color = defaultColorForOutliers_low; - } - else if(feature.properties["outlier"] !== undefined && feature.properties["outlier"].includes("high") && kommonitorDataExchangeService.useOutlierDetectionOnIndicator){ - color = defaultColorForOutliers_high; - } - else if(isMeasureOfValueChecked){ - - if(kommonitorDataExchangeService.getIndicatorValueFromArray_asNumber(feature.properties, targetDate) >= +Number(measureOfValue).toFixed(numberOfDecimals)){ - color = this.getColorFromBrewInstance(gtMeasureOfValueBrew, feature, targetDate); - } - else { - color = this.getColorFromBrewInstance(ltMeasureOfValueBrew, feature, targetDate); - } - - } - else{ - if(indicatorMetadataAndGeoJSON.indicatorType.includes('DYNAMIC')){ - - if(feature.properties[targetDate] < 0){ - - color = this.getColorFromBrewInstance(dynamicDecreaseBrew, feature, targetDate); + else if (kommonitorDataExchangeService.classifyZeroSeparately && kommonitorDataExchangeService.getIndicatorValueFromArray_asNumber(feature.properties, targetDate) === 0) { + color = defaultColorForZeroValues; } - else{ - color = this.getColorFromBrewInstance(dynamicIncreaseBrew, feature, targetDate); + else if (feature.properties["outlier"] !== undefined && feature.properties["outlier"].includes("low") && kommonitorDataExchangeService.useOutlierDetectionOnIndicator) { + color = defaultColorForOutliers_low; } - - } - else{ - - if(containsNegativeValues(indicatorMetadataAndGeoJSON.geoJSON, targetDate)){ - if(kommonitorDataExchangeService.getIndicatorValue_asNumber(feature.properties[targetDate]) >= 0){ - if(kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[targetDate] == 0 || feature.properties[targetDate] == "0")){ - color = defaultColorForZeroValues; - // if(__env.useTransparencyOnIndicator){ - // fillOpacity = __env.defaultFillOpacityForZeroFeatures; - // } + else if (feature.properties["outlier"] !== undefined && feature.properties["outlier"].includes("high") && kommonitorDataExchangeService.useOutlierDetectionOnIndicator) { + color = defaultColorForOutliers_high; + } + else if (isMeasureOfValueChecked) { + if (kommonitorDataExchangeService.getIndicatorValueFromArray_asNumber(feature.properties, targetDate) >= +Number(measureOfValue).toFixed(numberOfDecimals)) { + color = this.getColorFromBrewInstance(gtMeasureOfValueBrew, feature, targetDate); } - else{ - color = this.getColorFromBrewInstance(dynamicIncreaseBrew, feature, targetDate); + else { + color = this.getColorFromBrewInstance(ltMeasureOfValueBrew, feature, targetDate); } - } - else{ - if(kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[targetDate] == 0 || feature.properties[targetDate] == "0")){ - color = defaultColorForZeroValues; - // if(__env.useTransparencyOnIndicator){ - // fillOpacity = __env.defaultFillOpacityForZeroFeatures; - // } + } + else { + if (indicatorMetadataAndGeoJSON.indicatorType.includes('DYNAMIC')) { + if (feature.properties[targetDate] < 0) { + color = this.getColorFromBrewInstance(dynamicDecreaseBrew, feature, targetDate); + } + else { + color = this.getColorFromBrewInstance(dynamicIncreaseBrew, feature, targetDate); + } } - else{ - color = this.getColorFromBrewInstance(dynamicDecreaseBrew, feature, targetDate); + else { + if (containsNegativeValues(indicatorMetadataAndGeoJSON.geoJSON, targetDate)) { + if (kommonitorDataExchangeService.getIndicatorValue_asNumber(feature.properties[targetDate]) >= 0) { + if (kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[targetDate] == 0 || feature.properties[targetDate] == "0")) { + color = defaultColorForZeroValues; + // if(__env.useTransparencyOnIndicator){ + // fillOpacity = __env.defaultFillOpacityForZeroFeatures; + // } + } + else { + color = this.getColorFromBrewInstance(dynamicIncreaseBrew, feature, targetDate); + } + } + else { + if (kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[targetDate] == 0 || feature.properties[targetDate] == "0")) { + color = defaultColorForZeroValues; + // if(__env.useTransparencyOnIndicator){ + // fillOpacity = __env.defaultFillOpacityForZeroFeatures; + // } + } + else { + color = this.getColorFromBrewInstance(dynamicDecreaseBrew, feature, targetDate); + } + } + } + else { + color = this.getColorFromBrewInstance(defaultBrew, feature, targetDate); + } } - } } - else{ - color = this.getColorFromBrewInstance(defaultBrew, feature, targetDate); + return color; + }; + this.getBarChartOptions = function () { + return self.barChartOptions; + }; + this.getGeoMapChartOptions = function () { + return self.geoMapChartOptions; + }; + this.getHistogramChartOptions = function () { + return self.histogramChartOptions; + }; + this.getLineChartOptions = function () { + return self.lineChartOptions; + }; + this.prepareAllDiagramResources_forCurrentMapIndicator = function (indicatorMetadataAndGeoJSON, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue, filterOutFutureDates) { + this.prepareAllDiagramResources(indicatorMetadataAndGeoJSON, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue, filterOutFutureDates, false); + }; + this.prepareAllDiagramResources_forReportingIndicator = function (indicatorMetadataAndGeoJSON, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue, filterOutFutureDates) { + this.prepareAllDiagramResources(indicatorMetadataAndGeoJSON, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue, filterOutFutureDates, true); + }; + this.prepareAllDiagramResources = function (indicatorMetadataAndGeoJSON, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue, filterOutFutureDates, forceUseSubmittedIndicatorForTimeseries) { + self.indicatorPropertyName = INDICATOR_DATE_PREFIX + date; + var featureNamesArray = new Array(); + var indicatorValueArray = new Array(); + var indicatorValueBarChartArray = new Array(); + //sort array of features + var cartographicFeatures = indicatorMetadataAndGeoJSON.geoJSON.features; + cartographicFeatures.sort(compareFeaturesByIndicatorValue); + for (var j = 0; j < cartographicFeatures.length; j++) { + // diff occurs when balance mode is activated + // then, cartographicFeatures display balance over time period, which shall be reflected in bar chart and histogram + // the other diagrams must use the "normal" unbalanced indicator instead --> selectedFeatures + var cartographicFeature = cartographicFeatures[j]; + var indicatorValue; + if (kommonitorDataExchangeService.indicatorValueIsNoData(cartographicFeature.properties[self.indicatorPropertyName])) { + indicatorValue = null; + } + else { + indicatorValue = kommonitorDataExchangeService.getIndicatorValue_asNumber(cartographicFeature.properties[self.indicatorPropertyName]); + } + var featureName = cartographicFeature.properties[__env.FEATURE_NAME_PROPERTY_NAME]; + featureNamesArray.push(featureName); + indicatorValueArray.push(indicatorValue); + var color = this.getColorForFeature(cartographicFeature, indicatorMetadataAndGeoJSON, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue); + var seriesItem = { + value: indicatorValue, + name: featureName, + itemStyle: { + color: color + // borderWidth: 1, + // borderColor: 'black' + } + }; + indicatorValueBarChartArray.push(seriesItem); } - } - } - - return color; - }; - - this.getBarChartOptions = function () { - return self.barChartOptions; - }; - - this.getGeoMapChartOptions = function () { - return self.geoMapChartOptions; - }; - - this.getHistogramChartOptions = function () { - return self.histogramChartOptions; - }; - - this.getLineChartOptions = function () { - return self.lineChartOptions; - }; - - this.prepareAllDiagramResources_forCurrentMapIndicator = function (indicatorMetadataAndGeoJSON, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue, filterOutFutureDates) { - this.prepareAllDiagramResources(indicatorMetadataAndGeoJSON, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue, filterOutFutureDates, false); - }; - - this.prepareAllDiagramResources_forReportingIndicator = function (indicatorMetadataAndGeoJSON, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue, filterOutFutureDates) { - this.prepareAllDiagramResources(indicatorMetadataAndGeoJSON, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue, filterOutFutureDates, true); - }; - - this.prepareAllDiagramResources = function (indicatorMetadataAndGeoJSON, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue, filterOutFutureDates, forceUseSubmittedIndicatorForTimeseries) { - - self.indicatorPropertyName = INDICATOR_DATE_PREFIX + date; - - var featureNamesArray = new Array(); - var indicatorValueArray = new Array(); - var indicatorValueBarChartArray = new Array(); - - //sort array of features - var cartographicFeatures = indicatorMetadataAndGeoJSON.geoJSON.features; - cartographicFeatures.sort(compareFeaturesByIndicatorValue); - - for (var j = 0; j < cartographicFeatures.length; j++) { - // diff occurs when balance mode is activated - // then, cartographicFeatures display balance over time period, which shall be reflected in bar chart and histogram - // the other diagrams must use the "normal" unbalanced indicator instead --> selectedFeatures - var cartographicFeature = cartographicFeatures[j]; - - var indicatorValue; - if (kommonitorDataExchangeService.indicatorValueIsNoData(cartographicFeature.properties[self.indicatorPropertyName])) { - indicatorValue = null; - } - else { - indicatorValue = kommonitorDataExchangeService.getIndicatorValue_asNumber(cartographicFeature.properties[self.indicatorPropertyName]); - } - - var featureName = cartographicFeature.properties[__env.FEATURE_NAME_PROPERTY_NAME] - featureNamesArray.push(featureName); - indicatorValueArray.push(indicatorValue); - - var color = this.getColorForFeature(cartographicFeature, indicatorMetadataAndGeoJSON, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue); - - var seriesItem = { - value: indicatorValue, - name: featureName, - itemStyle: { - color: color - // borderWidth: 1, - // borderColor: 'black' + // TIMESERIES + var indicatorTimeSeriesDatesArray = indicatorMetadataAndGeoJSON.applicableDates; + if (filterOutFutureDates) { + // remove all timestamps that are newer than the given date + var dateInDateFormat = Date.parse(date); + indicatorTimeSeriesDatesArray = indicatorTimeSeriesDatesArray.filter(t => { + var tInDateFormat = Date.parse(t); + if (tInDateFormat <= dateInDateFormat) { + return true; + } + else { + return false; + } + }); } - }; - - indicatorValueBarChartArray.push(seriesItem); - - } - - // TIMESERIES - var indicatorTimeSeriesDatesArray = indicatorMetadataAndGeoJSON.applicableDates; - - if(filterOutFutureDates){ - // remove all timestamps that are newer than the given date - var dateInDateFormat = Date.parse(date); - indicatorTimeSeriesDatesArray = indicatorTimeSeriesDatesArray.filter( t => { - var tInDateFormat = Date.parse(t); - if (tInDateFormat <= dateInDateFormat) { - return true; - } else { - return false; + var indicatorTimeSeriesAverageArray = new Array(indicatorTimeSeriesDatesArray.length); + var indicatorTimeSeriesMaxArray = new Array(indicatorTimeSeriesDatesArray.length); + var indicatorTimeSeriesMinArray = new Array(indicatorTimeSeriesDatesArray.length); + var indicatorTimeSeriesCountArray = new Array(indicatorTimeSeriesDatesArray.length); + // initialize timeSeries arrays + for (var i = 0; i < indicatorTimeSeriesDatesArray.length; i++) { + indicatorTimeSeriesAverageArray[i] = 0; + indicatorTimeSeriesCountArray[i] = 0; } - }); - } - - var indicatorTimeSeriesAverageArray = new Array(indicatorTimeSeriesDatesArray.length); - var indicatorTimeSeriesMaxArray = new Array(indicatorTimeSeriesDatesArray.length); - var indicatorTimeSeriesMinArray = new Array(indicatorTimeSeriesDatesArray.length); - var indicatorTimeSeriesCountArray = new Array(indicatorTimeSeriesDatesArray.length); - - // initialize timeSeries arrays - for (var i = 0; i < indicatorTimeSeriesDatesArray.length; i++) { - indicatorTimeSeriesAverageArray[i] = 0; - indicatorTimeSeriesCountArray[i] = 0; - } - - let indicatorMetadataForTimeseries = indicatorMetadataAndGeoJSON; - - if(!forceUseSubmittedIndicatorForTimeseries && kommonitorDataExchangeService.isBalanceChecked){ - indicatorMetadataForTimeseries = kommonitorDataExchangeService.selectedIndicator; - } - // we must use the original selectedIndicator in case balance mode is active - // otherwise balance timestamp will have balance values - for (var t = 0; t < indicatorMetadataForTimeseries.geoJSON.features.length; t++) { - var indicatorFeature = indicatorMetadataForTimeseries.geoJSON.features[t]; - // continue timeSeries arrays by adding and counting all time series values - for (var i = 0; i < indicatorTimeSeriesDatesArray.length; i++) { - var datePropertyName = INDICATOR_DATE_PREFIX + indicatorTimeSeriesDatesArray[i]; - if (!kommonitorDataExchangeService.indicatorValueIsNoData(indicatorFeature.properties[datePropertyName])) { - // indicatorTimeSeriesAverageArray[i] += selectedFeature.properties[datePropertyName]; - indicatorTimeSeriesAverageArray[i] += indicatorFeature.properties[datePropertyName]; - indicatorTimeSeriesCountArray[i]++; - - // min stack - if (indicatorTimeSeriesMinArray[i] === undefined || indicatorTimeSeriesMinArray[i] === null){ - indicatorTimeSeriesMinArray[i] = indicatorFeature.properties[datePropertyName]; - } - else{ - if(indicatorFeature.properties[datePropertyName] < indicatorTimeSeriesMinArray[i]){ - indicatorTimeSeriesMinArray[i] = indicatorFeature.properties[datePropertyName]; - } - } - - // max stack - if (indicatorTimeSeriesMaxArray[i] === undefined || indicatorTimeSeriesMaxArray[i] === null){ - indicatorTimeSeriesMaxArray[i] = indicatorFeature.properties[datePropertyName]; - } - else{ - if(indicatorFeature.properties[datePropertyName] > indicatorTimeSeriesMaxArray[i]){ - indicatorTimeSeriesMaxArray[i] = indicatorFeature.properties[datePropertyName]; + let indicatorMetadataForTimeseries = indicatorMetadataAndGeoJSON; + if (!forceUseSubmittedIndicatorForTimeseries && kommonitorDataExchangeService.isBalanceChecked) { + indicatorMetadataForTimeseries = kommonitorDataExchangeService.selectedIndicator; + } + // we must use the original selectedIndicator in case balance mode is active + // otherwise balance timestamp will have balance values + for (var t = 0; t < indicatorMetadataForTimeseries.geoJSON.features.length; t++) { + var indicatorFeature = indicatorMetadataForTimeseries.geoJSON.features[t]; + // continue timeSeries arrays by adding and counting all time series values + for (var i = 0; i < indicatorTimeSeriesDatesArray.length; i++) { + var datePropertyName = INDICATOR_DATE_PREFIX + indicatorTimeSeriesDatesArray[i]; + if (!kommonitorDataExchangeService.indicatorValueIsNoData(indicatorFeature.properties[datePropertyName])) { + // indicatorTimeSeriesAverageArray[i] += selectedFeature.properties[datePropertyName]; + indicatorTimeSeriesAverageArray[i] += indicatorFeature.properties[datePropertyName]; + indicatorTimeSeriesCountArray[i]++; + // min stack + if (indicatorTimeSeriesMinArray[i] === undefined || indicatorTimeSeriesMinArray[i] === null) { + indicatorTimeSeriesMinArray[i] = indicatorFeature.properties[datePropertyName]; + } + else { + if (indicatorFeature.properties[datePropertyName] < indicatorTimeSeriesMinArray[i]) { + indicatorTimeSeriesMinArray[i] = indicatorFeature.properties[datePropertyName]; + } + } + // max stack + if (indicatorTimeSeriesMaxArray[i] === undefined || indicatorTimeSeriesMaxArray[i] === null) { + indicatorTimeSeriesMaxArray[i] = indicatorFeature.properties[datePropertyName]; + } + else { + if (indicatorFeature.properties[datePropertyName] > indicatorTimeSeriesMaxArray[i]) { + indicatorTimeSeriesMaxArray[i] = indicatorFeature.properties[datePropertyName]; + } + } + } } - } } - } - } - - // finish timeSeries arrays by computing averages of all time series values - for (var i = 0; i < indicatorTimeSeriesDatesArray.length; i++) { - indicatorTimeSeriesAverageArray[i] = kommonitorDataExchangeService.getIndicatorValue_asNumber(indicatorTimeSeriesAverageArray[i] / indicatorTimeSeriesCountArray[i]); - } - - // setHistogramChartOptions(indicatorMetadataAndGeoJSON, indicatorValueArray, spatialUnitName, date); - - setLineChartOptions(indicatorMetadataAndGeoJSON, indicatorTimeSeriesDatesArray, indicatorTimeSeriesAverageArray, indicatorTimeSeriesMaxArray, indicatorTimeSeriesMinArray, spatialUnitName, date); - - setBarChartOptions(indicatorMetadataAndGeoJSON, featureNamesArray, indicatorValueBarChartArray, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue); - - setGeoMapChartOptions(indicatorMetadataAndGeoJSON, featureNamesArray, indicatorValueBarChartArray, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue); - }; - - var compareFeaturesByIndicatorValue = function (featureA, featureB) { - if (featureA.properties[self.indicatorPropertyName] < featureB.properties[self.indicatorPropertyName]) - return -1; - if (featureA.properties[self.indicatorPropertyName] > featureB.properties[self.indicatorPropertyName]) - return 1; - return 0; - }; - - var setBarChartOptions = function (indicatorMetadataAndGeoJSON, featureNamesArray, indicatorValueBarChartArray, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue) { - - // specify chart configuration item and data - var labelOption = { - normal: { - show: true, - position: 'insideBottom', - align: 'left', - verticalAlign: 'middle', - rotate: 90, - formatter: '{c}', - } - }; - - // default fontSize of echarts - var fontSize = 18; - var barChartTitel = 'Ranking - ' + spatialUnitName + ' - '; - if (indicatorMetadataAndGeoJSON.fromDate) { - barChartTitel += "Bilanz " + indicatorMetadataAndGeoJSON.fromDate + " - " + indicatorMetadataAndGeoJSON.toDate; - fontSize = 14; - } - else { - barChartTitel += date; - } - - var legendConfig = setupVisualMap(indicatorMetadataAndGeoJSON, featureNamesArray, - indicatorValueBarChartArray, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, - ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, - measureOfValue); - - var barOption = { - // grid get rid of whitespace around chart - grid: { - left: '4%', - top: 32, - right: '4%', - bottom: 32, - containLabel: true - }, - title: { - text: barChartTitel, - left: 'center', - textStyle: { - fontSize: fontSize - }, - show: false - // top: 15 - }, - tooltip: { - trigger: 'item', - confine: 'true', - formatter: function (params) { - var value = kommonitorDataExchangeService.getIndicatorValue_asFormattedText(params.value); - return "" + params.name + ": " + value + " [" + indicatorMetadataAndGeoJSON.unit + "]"; - }, - axisPointer: { - type: 'line', - crossStyle: { - color: '#999' - } + // finish timeSeries arrays by computing averages of all time series values + for (var i = 0; i < indicatorTimeSeriesDatesArray.length; i++) { + indicatorTimeSeriesAverageArray[i] = kommonitorDataExchangeService.getIndicatorValue_asNumber(indicatorTimeSeriesAverageArray[i] / indicatorTimeSeriesCountArray[i]); } - }, - toolbox: { - show: true, - right: '15', - feature: { - // mark : {show: true}, - dataView: { - show: kommonitorDataExchangeService.showDiagramExportButtons, readOnly: true, title: "Datenansicht", lang: ['Datenansicht - Feature-Vergleich', 'schließen', 'refresh'], optionToContent: function (opt) { - - var barData = opt.series[0].data; - var featureNames = opt.xAxis[0].data; - - var dataTableId = "barDataTable_" + Math.random(); - var tableExportName = opt.xAxis[0].name + " - " + opt.title[0].text; - - var htmlString = ''; - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - - htmlString += ""; - - for (var i = 0; i < barData.length; i++) { - var value = kommonitorDataExchangeService.getIndicatorValue_asNumber(barData[i].value); - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - } - - htmlString += ""; - htmlString += "
        Feature-Name" + opt.xAxis[0].name + " [" + opt.yAxis[0].name + "]
        " + featureNames[i] + "" + value + "
        "; - - $rootScope.$broadcast("AppendExportButtonsForTable", dataTableId, tableExportName); - - return htmlString; + // setHistogramChartOptions(indicatorMetadataAndGeoJSON, indicatorValueArray, spatialUnitName, date); + setLineChartOptions(indicatorMetadataAndGeoJSON, indicatorTimeSeriesDatesArray, indicatorTimeSeriesAverageArray, indicatorTimeSeriesMaxArray, indicatorTimeSeriesMinArray, spatialUnitName, date); + setBarChartOptions(indicatorMetadataAndGeoJSON, featureNamesArray, indicatorValueBarChartArray, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue); + setGeoMapChartOptions(indicatorMetadataAndGeoJSON, featureNamesArray, indicatorValueBarChartArray, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue); + }; + var compareFeaturesByIndicatorValue = function (featureA, featureB) { + if (featureA.properties[self.indicatorPropertyName] < featureB.properties[self.indicatorPropertyName]) + return -1; + if (featureA.properties[self.indicatorPropertyName] > featureB.properties[self.indicatorPropertyName]) + return 1; + return 0; + }; + var setBarChartOptions = function (indicatorMetadataAndGeoJSON, featureNamesArray, indicatorValueBarChartArray, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue) { + // specify chart configuration item and data + var labelOption = { + normal: { + show: true, + position: 'insideBottom', + align: 'left', + verticalAlign: 'middle', + rotate: 90, + formatter: '{c}', } - }, - restore: { show: false, title: "Erneuern" }, - saveAsImage: { show: true, title: "Export", pixelRatio: 4 } + }; + // default fontSize of echarts + var fontSize = 18; + var barChartTitel = 'Ranking - ' + spatialUnitName + ' - '; + if (indicatorMetadataAndGeoJSON.fromDate) { + barChartTitel += "Bilanz " + indicatorMetadataAndGeoJSON.fromDate + " - " + indicatorMetadataAndGeoJSON.toDate; + fontSize = 14; + } + else { + barChartTitel += date; } - }, - // legend: { - // //data:[indicatorMetadataAndGeoJSON.indicatorName] - // }, - xAxis: { - name: indicatorMetadataAndGeoJSON.indicatorName, - nameLocation: 'center', - nameGap: 15, - axisLabel: { - rotate: 90, - interval: 0, - inside: true, - show: false - }, - axisTick: { - show: false - }, - z: 6, - zlevel: 6, - data: featureNamesArray - }, - yAxis: { - type: 'value', - name: indicatorMetadataAndGeoJSON.unit, - // splitArea: { - // show: true + var legendConfig = setupVisualMap(indicatorMetadataAndGeoJSON, featureNamesArray, indicatorValueBarChartArray, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue); + var barOption = { + // grid get rid of whitespace around chart + grid: { + left: '4%', + top: 32, + right: '4%', + bottom: 32, + containLabel: true + }, + title: { + text: barChartTitel, + left: 'center', + textStyle: { + fontSize: fontSize + }, + show: false + // top: 15 + }, + tooltip: { + trigger: 'item', + confine: 'true', + formatter: function (params) { + var value = kommonitorDataExchangeService.getIndicatorValue_asFormattedText(params.value); + return "" + params.name + ": " + value + " [" + indicatorMetadataAndGeoJSON.unit + "]"; + }, + axisPointer: { + type: 'line', + crossStyle: { + color: '#999' + } + } + }, + toolbox: { + show: true, + right: '15', + feature: { + // mark : {show: true}, + dataView: { + show: kommonitorDataExchangeService.showDiagramExportButtons, readOnly: true, title: "Datenansicht", lang: ['Datenansicht - Feature-Vergleich', 'schließen', 'refresh'], optionToContent: function (opt) { + var barData = opt.series[0].data; + var featureNames = opt.xAxis[0].data; + var dataTableId = "barDataTable_" + Math.random(); + var tableExportName = opt.xAxis[0].name + " - " + opt.title[0].text; + var htmlString = ''; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + for (var i = 0; i < barData.length; i++) { + var value = kommonitorDataExchangeService.getIndicatorValue_asNumber(barData[i].value); + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + } + htmlString += ""; + htmlString += "
        Feature-Name" + opt.xAxis[0].name + " [" + opt.yAxis[0].name + "]
        " + featureNames[i] + "" + value + "
        "; + $rootScope.$broadcast("AppendExportButtonsForTable", dataTableId, tableExportName); + return htmlString; + } + }, + restore: { show: false, title: "Erneuern" }, + saveAsImage: { show: true, title: "Export", pixelRatio: 4 } + } + }, + // legend: { + // //data:[indicatorMetadataAndGeoJSON.indicatorName] + // }, + xAxis: { + name: indicatorMetadataAndGeoJSON.indicatorName, + nameLocation: 'center', + nameGap: 15, + axisLabel: { + rotate: 90, + interval: 0, + inside: true, + show: false + }, + axisTick: { + show: false + }, + z: 6, + zlevel: 6, + data: featureNamesArray + }, + yAxis: { + type: 'value', + name: indicatorMetadataAndGeoJSON.unit, + // splitArea: { + // show: true + // } + }, + series: [{ + // name: indicatorMetadataAndGeoJSON.indicatorName, + type: 'bar', + emphasis: { + itemStyle: { + borderWidth: 4, + borderColor: defaultColorForClickedFeatures + } + }, + data: indicatorValueBarChartArray + }], + visualMap: [{ + left: 'left', + type: "piecewise", + pieces: legendConfig, + precision: 2, + show: false + }] + }; + // if (indicatorMetadataAndGeoJSON.geoJSON.features.length > 50) { + // // barOption.xAxis.data = undefined; + // barOption.xAxis.axisLabel.show = false; // } - }, - series: [{ - // name: indicatorMetadataAndGeoJSON.indicatorName, - type: 'bar', - emphasis: { - itemStyle: { - borderWidth: 4, - borderColor: defaultColorForClickedFeatures - } - }, - data: indicatorValueBarChartArray - }], - visualMap: [{ - left: 'left', - type: "piecewise", - pieces: legendConfig, - precision: 2, - show: false - }] + // use configuration item and data specified to show chart + self.barChartOptions = barOption; }; - - // if (indicatorMetadataAndGeoJSON.geoJSON.features.length > 50) { - // // barOption.xAxis.data = undefined; - // barOption.xAxis.axisLabel.show = false; - // } - - // use configuration item and data specified to show chart - self.barChartOptions = barOption; - }; - - var containsNegativeValues = function (geoJSON, date) { - - var propertyName = date; - - if(! propertyName.includes(kommonitorDataExchangeService.indicatorDatePrefix)){ - propertyName = kommonitorDataExchangeService.indicatorDatePrefix + propertyName; - } - - var containsNegativeValues = false; - for (var i = 0; i < geoJSON.features.length; i++) { - if (geoJSON.features[i].properties[propertyName] < 0) { - containsNegativeValues = true; - break; - } - } - - return containsNegativeValues; - }; - - var containsZeroValues = function (geoJSON, date) { - - var propertyName = date; - - if(! propertyName.includes(kommonitorDataExchangeService.indicatorDatePrefix)){ - propertyName = kommonitorDataExchangeService.indicatorDatePrefix + propertyName; - } - - var containsZeroValues = false; - for (var i = 0; i < geoJSON.features.length; i++) { - if (geoJSON.features[i].properties[propertyName] === 0 || geoJSON.features[i].properties[propertyName] === "0") { - containsZeroValues = true; - break; - } - } - - return containsZeroValues; - }; - - var setupVisualMap = function(indicatorMetadataAndGeoJSON, featureNamesArray, indicatorValueBarChartArray, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue){ - /* - pieces: [ - // Range of a piece can be specified by property min and max, - // where min will be set as -Infinity if ignored, - // and max will be set as Infinity if ignored. - {min: 1500}, - {min: 900, max: 1500}, - {min: 310, max: 1000}, - {min: 200, max: 300}, - // Label of the piece can be specified. - {min: 10, max: 200, label: '10 to 200 (custom label) '}, - // Color of the piece can be specified. - {value: 123, label: '123 (custom special color) ', color: 'grey'}, - {max: 5} - ] - */ - - var indicatorType = indicatorMetadataAndGeoJSON.indicatorType; - - var pieces = []; - - if(containsZeroValues(indicatorMetadataAndGeoJSON.geoJSON, date)){ - pieces.push({ - min: 0, - opacity: 0.8, - max: 0, - color: defaultColorForZeroValues - }); - } - - // if(containsOutlierValues(indicatorMetadataAndGeoJSON.geoJSON, date)){ - // pieces.push({ - // min: 0, - // opacity: 0.8, - // max: 0, - // color: defaultColorForZeroValues - // }); - // } - - if(isMeasureOfValueChecked){ - - if(gtMeasureOfValueBrew && gtMeasureOfValueBrew.breaks && gtMeasureOfValueBrew.colors){ - // measure of value brew - var gtBreaks = gtMeasureOfValueBrew.breaks; - var gtColors = gtMeasureOfValueBrew.colors; - - for (var j = 0; j < gtColors.length; j++) { - - var legendItem_gtMov = { - min: gtBreaks[j], - opacity: 0.8, - color: gtColors[j] - }; - if(gtBreaks[j + 1]){ - legendItem_gtMov.max = gtBreaks[j + 1]; + var containsNegativeValues = function (geoJSON, date) { + var propertyName = date; + if (!propertyName.includes(kommonitorDataExchangeService.indicatorDatePrefix)) { + propertyName = kommonitorDataExchangeService.indicatorDatePrefix + propertyName; + } + var containsNegativeValues = false; + for (var i = 0; i < geoJSON.features.length; i++) { + if (geoJSON.features[i].properties[propertyName] < 0) { + containsNegativeValues = true; + break; } - - pieces.push(legendItem_gtMov); - - } - } - - if(ltMeasureOfValueBrew && ltMeasureOfValueBrew.breaks && ltMeasureOfValueBrew.colors){ - var ltBreaks = ltMeasureOfValueBrew.breaks; - var ltColors = ltMeasureOfValueBrew.colors; - - for (var j = 0; j < ltColors.length; j++) { - - var legendItem_ltMov = { - min: ltBreaks[j], - opacity: 0.8, - color: ltColors[ltColors.length - 1 - j] - }; - if(ltBreaks[j + 1]){ - legendItem_ltMov.max = ltBreaks[j + 1]; - } - - pieces.push(legendItem_ltMov); - } - } - - - - } - else if(indicatorType.includes("DYNAMIC")){ - // dynamic brew - - if(dynamicDecreaseBrew){ - var dynamicDecreaseBreaks = dynamicDecreaseBrew.breaks; - var dynamicDecreaseColors = dynamicDecreaseBrew.colors; - - for (var j = 0; j < dynamicDecreaseColors.length; j++) { - - var legendItem_dynamicDecreaseMov = { - min: dynamicDecreaseBreaks[j], - opacity: 0.8, - // color: dynamicDecreaseColors[dynamicDecreaseColors.length - 1 - j] - color: dynamicDecreaseColors[j] - }; - if(dynamicDecreaseBreaks[j + 1]){ - legendItem_dynamicDecreaseMov.max = dynamicDecreaseBreaks[j + 1]; - legendItem_dynamicDecreaseMov.label = "" + dynamicDecreaseBreaks[j] + " - < " + dynamicDecreaseBreaks[j + 1]; - - // in negative scala we must ensure that smallest value near 0 (here max) is included in range - if(j == dynamicDecreaseColors.length - 1){ - legendItem_dynamicDecreaseMov.max = -0.01; + return containsNegativeValues; + }; + var containsZeroValues = function (geoJSON, date) { + var propertyName = date; + if (!propertyName.includes(kommonitorDataExchangeService.indicatorDatePrefix)) { + propertyName = kommonitorDataExchangeService.indicatorDatePrefix + propertyName; + } + var containsZeroValues = false; + for (var i = 0; i < geoJSON.features.length; i++) { + if (geoJSON.features[i].properties[propertyName] === 0 || geoJSON.features[i].properties[propertyName] === "0") { + containsZeroValues = true; + break; } - } - else{ - legendItem_dynamicDecreaseMov.max = -0.01; - legendItem_dynamicDecreaseMov.label = dynamicDecreaseBreaks[j]; - } - - pieces.push(legendItem_dynamicDecreaseMov); - } - } - - if(dynamicIncreaseBrew){ - var dynamicIncreaseBreaks = dynamicIncreaseBrew.breaks; - var dynamicIncreaseColors = dynamicIncreaseBrew.colors; - - for (var j = 0; j < dynamicIncreaseColors.length; j++) { - - var legendItem_dynamicIncreaseMov = { - min: dynamicIncreaseBreaks[j], - opacity: 0.8, - color: dynamicIncreaseColors[j] - }; - if(dynamicIncreaseBreaks[j + 1]){ - legendItem_dynamicIncreaseMov.max = dynamicIncreaseBreaks[j + 1]; - legendItem_dynamicIncreaseMov.label = "" + dynamicIncreaseBreaks[j] + " - < " + dynamicIncreaseBreaks[j + 1]; + return containsZeroValues; + }; + var setupVisualMap = function (indicatorMetadataAndGeoJSON, featureNamesArray, indicatorValueBarChartArray, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue) { + /* + pieces: [ + // Range of a piece can be specified by property min and max, + // where min will be set as -Infinity if ignored, + // and max will be set as Infinity if ignored. + {min: 1500}, + {min: 900, max: 1500}, + {min: 310, max: 1000}, + {min: 200, max: 300}, + // Label of the piece can be specified. + {min: 10, max: 200, label: '10 to 200 (custom label) '}, + // Color of the piece can be specified. + {value: 123, label: '123 (custom special color) ', color: 'grey'}, + {max: 5} + ] + */ + var indicatorType = indicatorMetadataAndGeoJSON.indicatorType; + var pieces = []; + if (containsZeroValues(indicatorMetadataAndGeoJSON.geoJSON, date)) { + pieces.push({ + min: 0, + opacity: 0.8, + max: 0, + color: defaultColorForZeroValues + }); + } + // if(containsOutlierValues(indicatorMetadataAndGeoJSON.geoJSON, date)){ + // pieces.push({ + // min: 0, + // opacity: 0.8, + // max: 0, + // color: defaultColorForZeroValues + // }); + // } + if (isMeasureOfValueChecked) { + if (gtMeasureOfValueBrew && gtMeasureOfValueBrew.breaks && gtMeasureOfValueBrew.colors) { + // measure of value brew + var gtBreaks = gtMeasureOfValueBrew.breaks; + var gtColors = gtMeasureOfValueBrew.colors; + for (var j = 0; j < gtColors.length; j++) { + var legendItem_gtMov = { + min: gtBreaks[j], + opacity: 0.8, + color: gtColors[j] + }; + if (gtBreaks[j + 1]) { + legendItem_gtMov.max = gtBreaks[j + 1]; + } + pieces.push(legendItem_gtMov); + } } - else{ - legendItem_dynamicIncreaseMov.max = dynamicIncreaseBreaks[j]; + if (ltMeasureOfValueBrew && ltMeasureOfValueBrew.breaks && ltMeasureOfValueBrew.colors) { + var ltBreaks = ltMeasureOfValueBrew.breaks; + var ltColors = ltMeasureOfValueBrew.colors; + for (var j = 0; j < ltColors.length; j++) { + var legendItem_ltMov = { + min: ltBreaks[j], + opacity: 0.8, + color: ltColors[ltColors.length - 1 - j] + }; + if (ltBreaks[j + 1]) { + legendItem_ltMov.max = ltBreaks[j + 1]; + } + pieces.push(legendItem_ltMov); + } } - - pieces.push(legendItem_dynamicIncreaseMov); - - } - } - - } - else { - // default brew - - if(containsNegativeValues(indicatorMetadataAndGeoJSON.geoJSON, date)){ - // dynamic brew - if(dynamicDecreaseBrew){ - var dynamicDecreaseBreaks = dynamicDecreaseBrew.breaks; - var dynamicDecreaseColors = dynamicDecreaseBrew.colors; - - for (var j = 0; j < dynamicDecreaseColors.length; j++) { - - var legendItem_dynamicDecreaseMov = { - min: dynamicDecreaseBreaks[j], - opacity: 0.8, - // color: dynamicDecreaseColors[dynamicDecreaseColors.length - 1 - j] - color: dynamicDecreaseColors[j] - }; - if(dynamicDecreaseBreaks[j + 1]){ - legendItem_dynamicDecreaseMov.max = dynamicDecreaseBreaks[j + 1]; - legendItem_dynamicDecreaseMov.label = "" + dynamicDecreaseBreaks[j] + " - < " + dynamicDecreaseBreaks[j + 1]; - - // in negative scala we must ensure that smallest value near 0 (here max) is included in range - if(j == dynamicDecreaseColors.length - 1){ - legendItem_dynamicDecreaseMov.max = -0.01; - } + } + else if (indicatorType.includes("DYNAMIC")) { + // dynamic brew + if (dynamicDecreaseBrew) { + var dynamicDecreaseBreaks = dynamicDecreaseBrew.breaks; + var dynamicDecreaseColors = dynamicDecreaseBrew.colors; + for (var j = 0; j < dynamicDecreaseColors.length; j++) { + var legendItem_dynamicDecreaseMov = { + min: dynamicDecreaseBreaks[j], + opacity: 0.8, + // color: dynamicDecreaseColors[dynamicDecreaseColors.length - 1 - j] + color: dynamicDecreaseColors[j] + }; + if (dynamicDecreaseBreaks[j + 1]) { + legendItem_dynamicDecreaseMov.max = dynamicDecreaseBreaks[j + 1]; + legendItem_dynamicDecreaseMov.label = "" + dynamicDecreaseBreaks[j] + " - < " + dynamicDecreaseBreaks[j + 1]; + // in negative scala we must ensure that smallest value near 0 (here max) is included in range + if (j == dynamicDecreaseColors.length - 1) { + legendItem_dynamicDecreaseMov.max = -0.01; + } + } + else { + legendItem_dynamicDecreaseMov.max = -0.01; + legendItem_dynamicDecreaseMov.label = dynamicDecreaseBreaks[j]; + } + pieces.push(legendItem_dynamicDecreaseMov); + } } - else{ - legendItem_dynamicDecreaseMov.max = -0.01; - legendItem_dynamicDecreaseMov.label = dynamicDecreaseBreaks[j]; + if (dynamicIncreaseBrew) { + var dynamicIncreaseBreaks = dynamicIncreaseBrew.breaks; + var dynamicIncreaseColors = dynamicIncreaseBrew.colors; + for (var j = 0; j < dynamicIncreaseColors.length; j++) { + var legendItem_dynamicIncreaseMov = { + min: dynamicIncreaseBreaks[j], + opacity: 0.8, + color: dynamicIncreaseColors[j] + }; + if (dynamicIncreaseBreaks[j + 1]) { + legendItem_dynamicIncreaseMov.max = dynamicIncreaseBreaks[j + 1]; + legendItem_dynamicIncreaseMov.label = "" + dynamicIncreaseBreaks[j] + " - < " + dynamicIncreaseBreaks[j + 1]; + } + else { + legendItem_dynamicIncreaseMov.max = dynamicIncreaseBreaks[j]; + } + pieces.push(legendItem_dynamicIncreaseMov); + } } - - pieces.push(legendItem_dynamicDecreaseMov); - - } } - - if(dynamicIncreaseBrew){ - var dynamicIncreaseBreaks = dynamicIncreaseBrew.breaks; - var dynamicIncreaseColors = dynamicIncreaseBrew.colors; - - for (var j = 0; j < dynamicIncreaseColors.length; j++) { - - var legendItem_dynamicIncreaseMov = { - min: dynamicIncreaseBreaks[j], - opacity: 0.8, - color: dynamicIncreaseColors[j] - }; - if(dynamicIncreaseBreaks[j + 1]){ - legendItem_dynamicIncreaseMov.max = dynamicIncreaseBreaks[j + 1]; - legendItem_dynamicIncreaseMov.label = "" + dynamicIncreaseBreaks[j] + " - < " + dynamicIncreaseBreaks[j + 1]; + else { + // default brew + if (containsNegativeValues(indicatorMetadataAndGeoJSON.geoJSON, date)) { + // dynamic brew + if (dynamicDecreaseBrew) { + var dynamicDecreaseBreaks = dynamicDecreaseBrew.breaks; + var dynamicDecreaseColors = dynamicDecreaseBrew.colors; + for (var j = 0; j < dynamicDecreaseColors.length; j++) { + var legendItem_dynamicDecreaseMov = { + min: dynamicDecreaseBreaks[j], + opacity: 0.8, + // color: dynamicDecreaseColors[dynamicDecreaseColors.length - 1 - j] + color: dynamicDecreaseColors[j] + }; + if (dynamicDecreaseBreaks[j + 1]) { + legendItem_dynamicDecreaseMov.max = dynamicDecreaseBreaks[j + 1]; + legendItem_dynamicDecreaseMov.label = "" + dynamicDecreaseBreaks[j] + " - < " + dynamicDecreaseBreaks[j + 1]; + // in negative scala we must ensure that smallest value near 0 (here max) is included in range + if (j == dynamicDecreaseColors.length - 1) { + legendItem_dynamicDecreaseMov.max = -0.01; + } + } + else { + legendItem_dynamicDecreaseMov.max = -0.01; + legendItem_dynamicDecreaseMov.label = dynamicDecreaseBreaks[j]; + } + pieces.push(legendItem_dynamicDecreaseMov); + } + } + if (dynamicIncreaseBrew) { + var dynamicIncreaseBreaks = dynamicIncreaseBrew.breaks; + var dynamicIncreaseColors = dynamicIncreaseBrew.colors; + for (var j = 0; j < dynamicIncreaseColors.length; j++) { + var legendItem_dynamicIncreaseMov = { + min: dynamicIncreaseBreaks[j], + opacity: 0.8, + color: dynamicIncreaseColors[j] + }; + if (dynamicIncreaseBreaks[j + 1]) { + legendItem_dynamicIncreaseMov.max = dynamicIncreaseBreaks[j + 1]; + legendItem_dynamicIncreaseMov.label = "" + dynamicIncreaseBreaks[j] + " - < " + dynamicIncreaseBreaks[j + 1]; + } + else { + legendItem_dynamicIncreaseMov.max = dynamicIncreaseBreaks[j]; + } + pieces.push(legendItem_dynamicIncreaseMov); + } + } } - else{ - legendItem_dynamicIncreaseMov.max = dynamicIncreaseBreaks[j]; + else { + if (defaultBrew && defaultBrew.breaks && defaultBrew.colors) { + var breaks = defaultBrew.breaks; + var colors = defaultBrew.colors; + for (var j = 0; j < colors.length; j++) { + var legendItem_default = { + min: breaks[j], + opacity: 0.8, + max: breaks[j + 1], + color: colors[j] + }; + pieces.push(legendItem_default); + } + } } - - pieces.push(legendItem_dynamicIncreaseMov); - - } } - - } - else{ - if(defaultBrew && defaultBrew.breaks && defaultBrew.colors){ - var breaks = defaultBrew.breaks; - var colors = defaultBrew.colors; - - for (var j = 0; j < colors.length; j++) { - - var legendItem_default = { - min: breaks[j], - opacity: 0.8, - max: breaks[j + 1], - color: colors[j] - }; - - pieces.push(legendItem_default); - - } - } - - } - - - } - - return pieces; - - }; - - - var setGeoMapChartOptions = function (indicatorMetadataAndGeoJSON, featureNamesArray, indicatorValueBarChartArray, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue) { - - indicatorMetadataAndGeoJSON.geoJSON.features.forEach(feature => { - feature.properties.name= feature.properties[kommonitorDataExchangeService.FEATURE_NAME_PROPERTY_NAME]; - }); - - var uniqueMapRef = 'geoMapChart'; - - echarts.registerMap(uniqueMapRef, indicatorMetadataAndGeoJSON.geoJSON); - - // specify chart configuration item and data - - var legendConfig = setupVisualMap(indicatorMetadataAndGeoJSON, featureNamesArray, indicatorValueBarChartArray, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue); - - // default fontSize of echarts - var fontSize = 18; - var geoMapChartTitel = indicatorMetadataAndGeoJSON.indicatorName + ' - ' + spatialUnitName + ' - ' + date; - - var seriesData = []; - - for (let index = 0; index < featureNamesArray.length; index++) { - var featureName = featureNamesArray[index]; - - /* - var seriesItem = { - value: indicatorValue, - itemStyle: { - color: color - // borderWidth: 1, - // borderColor: 'black' - } - }; - */ - var featureValue = indicatorValueBarChartArray[index].value; - - seriesData.push({ - name: featureName, - value: featureValue - }); - } - - // needed for reporting - for(let feature of indicatorMetadataAndGeoJSON.geoJSON.features) { - bbox = turf.bbox(feature); // calculate bbox for each feature - feature.properties.bbox = bbox; - } - var bbox = calculateOverallBoundingBoxFromGeoJSON(indicatorMetadataAndGeoJSON.geoJSON.features) - // change format of bbox to match the format needed for echarts - bbox = [ - [bbox[0], bbox[3]], // north-west lon lat - [bbox[2], bbox[1]] // south-east lon lat - ] - - var geoMapOption = { - // grid get rid of whitespace around chart - // grid: { - // left: '4%', - // top: 32, - // right: '4%', - // bottom: 32, - // containLabel: true - // }, - title: { - text: geoMapChartTitel, - left: 'center', - textStyle: { - fontSize: fontSize - }, - show: true - // top: 15 - }, - tooltip: { - trigger: 'item', - confine: 'true', - showDelay: 0, - transitionDuration: 0.2, - formatter: function (params) { - var value = kommonitorDataExchangeService.getIndicatorValue_asFormattedText(params.value); - return "" + params.name + ": " + value + " [" + indicatorMetadataAndGeoJSON.unit + "]"; - } - }, - toolbox: { - show: true, - right: '15', - feature: { - // mark : {show: true}, - dataView: { - show: kommonitorDataExchangeService.showDiagramExportButtons, readOnly: true, title: "Datenansicht", lang: ['Datenansicht - Geo Map Chart', 'schließen', 'refresh'], optionToContent: function (opt) { - - var dataTableId = "geoMapDataTable_" + Math.random(); - var tableExportName = indicatorMetadataAndGeoJSON.indicatorName + " - " + opt.title[0].text; - - var htmlString = ''; - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - - htmlString += ""; - - for (var i = 0; i < seriesData.length; i++) { - var value = kommonitorDataExchangeService.getIndicatorValue_asNumber(seriesData[i].value); - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; + return pieces; + }; + var setGeoMapChartOptions = function (indicatorMetadataAndGeoJSON, featureNamesArray, indicatorValueBarChartArray, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue) { + indicatorMetadataAndGeoJSON.geoJSON.features.forEach(feature => { + feature.properties.name = feature.properties[kommonitorDataExchangeService.FEATURE_NAME_PROPERTY_NAME]; + }); + var uniqueMapRef = 'geoMapChart'; + echarts.registerMap(uniqueMapRef, indicatorMetadataAndGeoJSON.geoJSON); + // specify chart configuration item and data + var legendConfig = setupVisualMap(indicatorMetadataAndGeoJSON, featureNamesArray, indicatorValueBarChartArray, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue); + // default fontSize of echarts + var fontSize = 18; + var geoMapChartTitel = indicatorMetadataAndGeoJSON.indicatorName + ' - ' + spatialUnitName + ' - ' + date; + var seriesData = []; + for (let index = 0; index < featureNamesArray.length; index++) { + var featureName = featureNamesArray[index]; + /* + var seriesItem = { + value: indicatorValue, + itemStyle: { + color: color + // borderWidth: 1, + // borderColor: 'black' } - - htmlString += ""; - htmlString += "
        Feature-Name" + indicatorMetadataAndGeoJSON.indicatorName + " [" + indicatorMetadataAndGeoJSON.indicatorName + "]
        " + seriesData[i].name + "" + value + "
        "; - - $rootScope.$broadcast("AppendExportButtonsForTable", dataTableId, tableExportName); - - return htmlString; - } - }, - restore: { show: false, title: "Erneuern" }, - saveAsImage: { show: true, title: "Export", pixelRatio: 4 } + }; + */ + var featureValue = indicatorValueBarChartArray[index].value; + seriesData.push({ + name: featureName, + value: featureValue + }); + } + // needed for reporting + for (let feature of indicatorMetadataAndGeoJSON.geoJSON.features) { + bbox = turf.bbox(feature); // calculate bbox for each feature + feature.properties.bbox = bbox; } - }, - // legend: { - // //data:[indicatorMetadataAndGeoJSON.indicatorName] - // }, - visualMap: { - left: 'left', - type: "piecewise", - pieces: legendConfig, - // selectedMode: 'multiple', - precision: 2, - show: true - }, - series: [{ - name: indicatorMetadataAndGeoJSON.indicatorName, - type: 'map', - roam: true, - boundingCoords: bbox, - map: uniqueMapRef, - emphasis: { - label: { + var bbox = calculateOverallBoundingBoxFromGeoJSON(indicatorMetadataAndGeoJSON.geoJSON.features); + // change format of bbox to match the format needed for echarts + bbox = [ + [bbox[0], bbox[3]], + [bbox[2], bbox[1]] // south-east lon lat + ]; + var geoMapOption = { + // grid get rid of whitespace around chart + // grid: { + // left: '4%', + // top: 32, + // right: '4%', + // bottom: 32, + // containLabel: true + // }, + title: { + text: geoMapChartTitel, + left: 'center', + textStyle: { + fontSize: fontSize + }, show: true - } - }, - data: seriesData - }] + // top: 15 + }, + tooltip: { + trigger: 'item', + confine: 'true', + showDelay: 0, + transitionDuration: 0.2, + formatter: function (params) { + var value = kommonitorDataExchangeService.getIndicatorValue_asFormattedText(params.value); + return "" + params.name + ": " + value + " [" + indicatorMetadataAndGeoJSON.unit + "]"; + } + }, + toolbox: { + show: true, + right: '15', + feature: { + // mark : {show: true}, + dataView: { + show: kommonitorDataExchangeService.showDiagramExportButtons, readOnly: true, title: "Datenansicht", lang: ['Datenansicht - Geo Map Chart', 'schließen', 'refresh'], optionToContent: function (opt) { + var dataTableId = "geoMapDataTable_" + Math.random(); + var tableExportName = indicatorMetadataAndGeoJSON.indicatorName + " - " + opt.title[0].text; + var htmlString = ''; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + for (var i = 0; i < seriesData.length; i++) { + var value = kommonitorDataExchangeService.getIndicatorValue_asNumber(seriesData[i].value); + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + } + htmlString += ""; + htmlString += "
        Feature-Name" + indicatorMetadataAndGeoJSON.indicatorName + " [" + indicatorMetadataAndGeoJSON.indicatorName + "]
        " + seriesData[i].name + "" + value + "
        "; + $rootScope.$broadcast("AppendExportButtonsForTable", dataTableId, tableExportName); + return htmlString; + } + }, + restore: { show: false, title: "Erneuern" }, + saveAsImage: { show: true, title: "Export", pixelRatio: 4 } + } + }, + // legend: { + // //data:[indicatorMetadataAndGeoJSON.indicatorName] + // }, + visualMap: { + left: 'left', + type: "piecewise", + pieces: legendConfig, + // selectedMode: 'multiple', + precision: 2, + show: true + }, + series: [{ + name: indicatorMetadataAndGeoJSON.indicatorName, + type: 'map', + roam: true, + boundingCoords: bbox, + map: uniqueMapRef, + emphasis: { + label: { + show: true + } + }, + data: seriesData + }] + }; + // use configuration item and data specified to show chart + self.geoMapChartOptions = geoMapOption; }; - - // use configuration item and data specified to show chart - self.geoMapChartOptions = geoMapOption; - }; - - - var setLineChartOptions = function (indicatorMetadataAndGeoJSON, indicatorTimeSeriesDatesArray, indicatorTimeSeriesAverageArray, indicatorTimeSeriesMaxArray, indicatorTimeSeriesMinArray, spatialUnitName, date) { - - var lineOption = { - // grid get rid of whitespace around chart - grid: { - left: '4%', - top: 32, - right: '4%', - bottom: 55, - containLabel: true - }, - title: { - text: 'Zeitreihe - ' + spatialUnitName, - left: 'center', - show: false, - textStyle: { - fontSize: 18 - }, - // top: 15 - }, - tooltip: { - trigger: 'axis', - confine: 'true', - formatter: function (params) { - - var string = "" + params[0].axisValueLabel + "
        "; - - params.forEach(function (paramObj) { - - if(! paramObj.seriesName.includes("Stack")){ - var value = kommonitorDataExchangeService.getIndicatorValue_asFormattedText(paramObj.value); - string += paramObj.seriesName + ": " + value + " [" + indicatorMetadataAndGeoJSON.unit + "]" + "
        "; - } - }); - - return string; - }, - axisPointer: { - type: 'line', - crossStyle: { - color: '#999' - } + var setLineChartOptions = function (indicatorMetadataAndGeoJSON, indicatorTimeSeriesDatesArray, indicatorTimeSeriesAverageArray, indicatorTimeSeriesMaxArray, indicatorTimeSeriesMinArray, spatialUnitName, date) { + var lineOption = { + // grid get rid of whitespace around chart + grid: { + left: '4%', + top: 32, + right: '4%', + bottom: 55, + containLabel: true + }, + title: { + text: 'Zeitreihe - ' + spatialUnitName, + left: 'center', + show: false, + textStyle: { + fontSize: 18 + }, + // top: 15 + }, + tooltip: { + trigger: 'axis', + confine: 'true', + formatter: function (params) { + var string = "" + params[0].axisValueLabel + "
        "; + params.forEach(function (paramObj) { + if (!paramObj.seriesName.includes("Stack")) { + var value = kommonitorDataExchangeService.getIndicatorValue_asFormattedText(paramObj.value); + string += paramObj.seriesName + ": " + value + " [" + indicatorMetadataAndGeoJSON.unit + "]" + "
        "; + } + }); + return string; + }, + axisPointer: { + type: 'line', + crossStyle: { + color: '#999' + } + } + }, + toolbox: { + show: true, + right: '15', + feature: { + // mark : {show: true}, + dataView: { + show: kommonitorDataExchangeService.showDiagramExportButtons, readOnly: true, title: "Datenansicht", lang: ['Datenansicht - Zeitreihe', 'schließen', 'refresh'], optionToContent: function (opt) { + // + // + // + // + // + // + // + // + // + // + // + // + // + //
        Indikator-NameBeschreibung der Verknüpfung
        {{indicator.referencedIndicatorName}}{{indicator.referencedIndicatorDescription}}
        + var lineSeries = opt.series; + var timestamps = opt.xAxis[0].data; + var dataTableId = "lineDataTable_" + Math.random(); + var tableExportName = opt.xAxis[0].name + " - " + opt.title[0].text; + var htmlString = ''; + htmlString += ""; + htmlString += ""; + htmlString += ""; + for (var i = 0; i < lineSeries.length; i++) { + htmlString += ""; + } + htmlString += ""; + htmlString += ""; + htmlString += ""; + for (var j = 0; j < timestamps.length; j++) { + htmlString += ""; + htmlString += ""; + for (var k = 0; k < lineSeries.length; k++) { + var value = kommonitorDataExchangeService.getIndicatorValue_asNumber(lineSeries[k].data[j]); + htmlString += ""; + } + htmlString += ""; + } + htmlString += ""; + htmlString += "
        Zeitpunkt" + lineSeries[i].name + " [" + opt.yAxis[0].name + "]
        " + timestamps[j] + "" + value + "
        "; + $rootScope.$broadcast("AppendExportButtonsForTable", dataTableId, tableExportName); + return htmlString; + } + }, + restore: { show: false, title: "Erneuern" }, + saveAsImage: { show: true, title: "Export", pixelRatio: 4 } + } + }, + legend: { + type: "scroll", + bottom: 0, + data: ['Arithmetisches Mittel'] + }, + xAxis: { + name: indicatorMetadataAndGeoJSON.indicatorName, + nameLocation: 'center', + nameGap: 22, + // axisLabel: { + // rotate: 90, + // interval: 0, + // inside: true + // }, + // z: 6, + // zlevel: 6, + type: 'category', + axisTick: { + show: false + }, + data: indicatorTimeSeriesDatesArray + }, + yAxis: { + type: 'value', + name: indicatorMetadataAndGeoJSON.unit, + // splitArea: { + // show: true + // } + }, + series: [ + { + name: "Arithmetisches Mittel", + type: 'line', + data: indicatorTimeSeriesAverageArray, + lineStyle: { + normal: { + color: 'gray', + width: 2, + type: 'dashed' + } + }, + itemStyle: { + normal: { + borderWidth: 3, + color: 'gray' + } + } + } + ] + }; + // SETTING FOR MIN AND MAX STACK + // default for min value of 0 + var minStack = { + name: "MinStack", + type: 'line', + data: indicatorTimeSeriesMinArray, + stack: "MinMax", + // areaStyle:{ + // color: "#d6d6d6" + // }, + lineStyle: { + opacity: 0 + }, + itemStyle: { + opacity: 0 + }, + silent: true + }; + var minLine = { + name: "Min", + type: 'line', + data: indicatorTimeSeriesMinArray, + lineStyle: { + opacity: 0, + color: "#d6d6d6" + }, + itemStyle: { + opacity: 0 + } + }; + var maxStack = { + name: "MaxStack", + type: 'line', + data: indicatorTimeSeriesMaxArray, + stack: "MinMax", + areaStyle: { + color: "#d6d6d6" + }, + lineStyle: { + opacity: 0 + }, + itemStyle: { + opacity: 0 + }, + silent: true + }; + var maxLine = { + name: "Max", + type: 'line', + data: indicatorTimeSeriesMaxArray, + lineStyle: { + opacity: 0, + color: "#d6d6d6" + }, + itemStyle: { + opacity: 0 + } + }; + // perform checks if there are negative values or only > 0 values + // then stacks must be adjusted to be correctly displayed + var minStack_minValue = Math.min(...indicatorTimeSeriesMinArray); + if (minStack_minValue < 0) { + minStack.areaStyle = { + color: "#d6d6d6" + }; } - }, - toolbox: { - show: true, - right: '15', - feature: { - // mark : {show: true}, - dataView: { - show: kommonitorDataExchangeService.showDiagramExportButtons, readOnly: true, title: "Datenansicht", lang: ['Datenansicht - Zeitreihe', 'schließen', 'refresh'], optionToContent: function (opt) { - - // - // - // - // - // - // - // - // - // - // - // - // - // - //
        Indikator-NameBeschreibung der Verknüpfung
        {{indicator.referencedIndicatorName}}{{indicator.referencedIndicatorDescription}}
        - - var lineSeries = opt.series; - var timestamps = opt.xAxis[0].data; - - var dataTableId = "lineDataTable_" + Math.random(); - var tableExportName = opt.xAxis[0].name + " - " + opt.title[0].text; - - var htmlString = ''; - htmlString += ""; - htmlString += ""; - htmlString += ""; - - for (var i = 0; i < lineSeries.length; i++) { - htmlString += ""; - } - - htmlString += ""; - htmlString += ""; - - htmlString += ""; - - for (var j = 0; j < timestamps.length; j++) { - htmlString += ""; - htmlString += ""; - for (var k = 0; k < lineSeries.length; k++) { - var value = kommonitorDataExchangeService.getIndicatorValue_asNumber(lineSeries[k].data[j]); - htmlString += ""; + let indicatorTimeSeriesMaxArray_copy = JSON.parse(JSON.stringify(indicatorTimeSeriesMaxArray)); + if ((indicatorTimeSeriesMinArray.filter(item => item > 0))) { + for (let index = 0; index < indicatorTimeSeriesMaxArray_copy.length; index++) { + if (indicatorTimeSeriesMinArray[index] > 0) { + indicatorTimeSeriesMaxArray_copy[index] = indicatorTimeSeriesMaxArray_copy[index] - indicatorTimeSeriesMinArray[index]; } - htmlString += ""; - } - - htmlString += ""; - htmlString += "
        Zeitpunkt" + lineSeries[i].name + " [" + opt.yAxis[0].name + "]
        " + timestamps[j] + "" + value + "
        "; - - $rootScope.$broadcast("AppendExportButtonsForTable", dataTableId, tableExportName); - - return htmlString; } - }, - restore: { show: false, title: "Erneuern" }, - saveAsImage: { show: true, title: "Export", pixelRatio: 4 } + maxStack.data = indicatorTimeSeriesMaxArray_copy; } - }, - legend: { - type: "scroll", - bottom: 0, - data: ['Arithmetisches Mittel'] - }, - xAxis: { - name: indicatorMetadataAndGeoJSON.indicatorName, - nameLocation: 'center', - nameGap: 22, - // axisLabel: { - // rotate: 90, - // interval: 0, - // inside: true - // }, - // z: 6, - // zlevel: 6, - type: 'category', - axisTick: { - show: false - }, - data: indicatorTimeSeriesDatesArray - }, - yAxis: { - type: 'value', - name: indicatorMetadataAndGeoJSON.unit, - // splitArea: { - // show: true - // } - }, - series: [ - { - name: "Arithmetisches Mittel", - type: 'line', - data: indicatorTimeSeriesAverageArray, - lineStyle: { - normal: { - color: 'gray', - width: 2, - type: 'dashed' - } - }, - itemStyle: { - normal: { - borderWidth: 3, - color: 'gray' - } + lineOption.series.push(minLine); + lineOption.series.push(maxLine); + lineOption.series.push(minStack); + lineOption.series.push(maxStack); + // use configuration item and data specified to show chart + self.lineChartOptions = lineOption; + }; + var setHistogramChartOptions = function (indicatorMetadataAndGeoJSON, indicatorValueArray, spatialUnitName, date) { + var bins; + try { + bins = ecStat.histogram(indicatorValueArray); + } + catch (error) { + console.log("Histogram chart cannot be drawn - error in bins creation"); + // kommonitorDataExchangeService.displayMapApplicationError(error); } - }] + // default fontSize of echarts title + var fontSize = 18; + var histogramChartTitel = 'Histogramm - ' + spatialUnitName + ' - '; + if (indicatorMetadataAndGeoJSON.fromDate) { + histogramChartTitel += "Bilanz " + indicatorMetadataAndGeoJSON.fromDate + " - " + indicatorMetadataAndGeoJSON.toDate; + fontSize = 14; + } + else { + histogramChartTitel += date; + } + var histogramOption = { + // grid get rid of whitespace around chart + grid: { + left: '4%', + top: 32, + right: '4%', + bottom: 35, + containLabel: true + }, + title: { + text: histogramChartTitel, + left: 'center', + textStyle: { + fontSize: fontSize + }, + show: false + // top: 15 + }, + tooltip: { + trigger: 'item', + confine: 'true', + axisPointer: { + type: 'line', + crossStyle: { + color: '#999' + } + } + }, + toolbox: { + show: true, + right: '15', + feature: { + // mark : {show: true}, + dataView: { + show: kommonitorDataExchangeService.showDiagramExportButtons, readOnly: true, title: "Datenansicht", lang: ['Datenansicht - Histogramm', 'schließen', 'refresh'], optionToContent: function (opt) { + // + // + // + // + // + // + // + // + // + // + // + // + // + //
        Indikator-NameBeschreibung der Verknüpfung
        {{indicator.referencedIndicatorName}}{{indicator.referencedIndicatorDescription}}
        + var histogramData = opt.series[0].data; + var dataTableId = "histogramDataTable_" + Math.random(); + var tableExportName = opt.xAxis[0].name + " - " + opt.title[0].text; + var htmlString = ''; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + for (var i = 0; i < histogramData.length; i++) { + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + } + htmlString += ""; + htmlString += "
        WertintervallHäufigkeit
        " + histogramData[i][0] + " — " + histogramData[i][1] + "" + histogramData[i][2] + "
        "; + $rootScope.$broadcast("AppendExportButtonsForTable", dataTableId, tableExportName); + return htmlString; + } + }, + restore: { show: false, title: "Erneuern" }, + saveAsImage: { show: true, title: "Export", pixelRatio: 4 } + } + }, + xAxis: [{ + name: indicatorMetadataAndGeoJSON.indicatorName, + nameLocation: 'center', + nameGap: 22, + scale: true, + }], + yAxis: { + name: 'Anzahl Features', + // nameGap: 35, + // nameLocation: 'center', + // nameRotate: 90, + }, + series: [{ + type: 'custom', + name: indicatorMetadataAndGeoJSON.indicatorName, + renderItem: function (params, api) { + var yValue = api.value(2); + var start = api.coord([api.value(0), yValue]); + var size = api.size([api.value(1) - api.value(0), yValue]); + return { + type: 'rect', + shape: { + x: start[0], + y: start[1], + width: size[0] * 0.99, + height: size[1] + }, + style: api.style() + }; + }, + itemStyle: { + color: '#337ab7' + }, + // label: { + // normal: { + // show: true, + // position: 'insideTop' + // } + // }, + dimensions: ['untere Intervallgrenze', 'obere Intervallgrenze', 'Anzahl'], + encode: { + x: [0, 1], + y: 2, + tooltip: [0, 1, 2] + }, + data: bins ? bins.customData : undefined + }] + }; + // var option = { + // title: { + // text: 'Histogram Chart', + // left: 'center', + // top: 20 + // }, + // tooltip: { + // trigger: 'axis', + // axisPointer: { + // type: 'line', + // crossStyle: { + // color: '#999' + // } + // } + // }, + // color: ['rgb(25, 183, 207)'], + // grid: { + // left: '3%', + // right: '3%', + // bottom: '3%', + // containLabel: true + // }, + // xAxis: [{ + // type: 'value', + // name: 'Wertintervalle', + // nameLocation: 'center', + // nameGap: 15, + // scale: true, + // }], + // yAxis: { + // type: 'value', + // name: 'Anzahl Features', + // nameGap: 22, + // nameLocation: 'center', + // nameRotate: 90, + // }, + // series: [{ + // name: 'Anzahl', + // type: 'bar', + // barWidth: '99,3%', + // // label: { + // // normal: { + // // show: true, + // // position: 'insideTop', + // // formatter: function (params) { + // // return params.value[1]; + // // } + // // } + // // }, + // data: bins.data + // }] + // }; + if (onlyContainsPositiveNumbers(indicatorValueArray)) { + histogramOption.xAxis.min = 0; + } + self.histogramChartOptions = histogramOption; }; - - // SETTING FOR MIN AND MAX STACK - - // default for min value of 0 - var minStack = { - name: "MinStack", - type: 'line', - data: indicatorTimeSeriesMinArray, - stack: "MinMax", - // areaStyle:{ - // color: "#d6d6d6" - // }, - lineStyle: { - opacity: 0 - }, - itemStyle: { - opacity: 0 - }, - silent: true + var onlyContainsPositiveNumbers = function (indicatorValueArray) { + indicatorValueArray.forEach(function (element) { + if (element < 0) { + return false; + } + }); + return true; }; - - var minLine = { - name: "Min", - type: 'line', - data: indicatorTimeSeriesMinArray, - lineStyle: { - opacity: 0, - color: "#d6d6d6" - }, - itemStyle: { - opacity: 0 - } + var appendSeriesToLineChart = function (featureProperties) { + // in case of activated balance mode, we must use the properties of kommonitorDataExchangeService.selectedIndicator, to aquire the correct time series item! + if (kommonitorDataExchangeService.isBalanceChecked) { + featureProperties = findPropertiesForTimeSeries(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); + } + // append feature name to legend + $scope.lineOption.legend.data.push(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); + // create feature data series + var featureSeries = {}; + featureSeries.name = featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]; + featureSeries.type = 'line'; + featureSeries.data = new Array(); + // for each date create series data entry for feature + for (var date of $scope.lineOption.xAxis.data) { + var value; + if (kommonitorDataExchangeService.indicatorValueIsNoData(featureProperties[INDICATOR_DATE_PREFIX + date])) { + value = null; + } + else { + value = kommonitorDataExchangeService.getIndicatorValue_asNumber(featureProperties[INDICATOR_DATE_PREFIX + date]); + } + featureSeries.data.push(value); + } + $scope.lineOption.series.push(featureSeries); + $scope.lineChart.setOption($scope.lineOption); + setTimeout(function () { + $scope.lineChart.resize(); + }, 350); }; - - var maxStack = { - name: "MaxStack", - type: 'line', - data: indicatorTimeSeriesMaxArray, - stack: "MinMax", - areaStyle:{ - color: "#d6d6d6" - }, - lineStyle: { - opacity: 0 - }, - itemStyle: { - opacity: 0 - }, - silent: true + var findPropertiesForTimeSeries = function (spatialUnitFeatureName) { + for (var feature of kommonitorDataExchangeService.selectedIndicator.geoJSON.features) { + if (feature.properties[__env.FEATURE_NAME_PROPERTY_NAME] == spatialUnitFeatureName) { + return feature.properties; + } + } }; - - var maxLine = { - name: "Max", - type: 'line', - data: indicatorTimeSeriesMaxArray, - lineStyle: { - opacity: 0, - color: "#d6d6d6" - }, - itemStyle: { - opacity: 0 - } + var getSeriesIndexByFeatureName = function (featureName) { + for (var index = 0; index < $scope.lineOption.series.length; index++) { + if ($scope.lineOption.series[index].name === featureName) + return index; + } + //return -1 if none was found + return -1; }; - - // perform checks if there are negative values or only > 0 values - // then stacks must be adjusted to be correctly displayed - var minStack_minValue = Math.min(...indicatorTimeSeriesMinArray); - if(minStack_minValue < 0){ - minStack.areaStyle = { - color: "#d6d6d6" - }; - } - - let indicatorTimeSeriesMaxArray_copy = JSON.parse(JSON.stringify(indicatorTimeSeriesMaxArray)); - - if ((indicatorTimeSeriesMinArray.filter(item => item > 0))){ - for (let index = 0; index < indicatorTimeSeriesMaxArray_copy.length; index++) { - - if(indicatorTimeSeriesMinArray[index] > 0){ - indicatorTimeSeriesMaxArray_copy[index] = indicatorTimeSeriesMaxArray_copy[index] - indicatorTimeSeriesMinArray[index]; - } - } - maxStack.data = indicatorTimeSeriesMaxArray_copy; - } - - lineOption.series.push(minLine); - lineOption.series.push(maxLine); - lineOption.series.push(minStack); - lineOption.series.push(maxStack); - - - // use configuration item and data specified to show chart - self.lineChartOptions = lineOption; - }; - - - var setHistogramChartOptions = function (indicatorMetadataAndGeoJSON, indicatorValueArray, spatialUnitName, date) { - var bins; - try { - bins = ecStat.histogram(indicatorValueArray); - } - catch (error) { - console.log("Histogram chart cannot be drawn - error in bins creation"); - // kommonitorDataExchangeService.displayMapApplicationError(error); - } - - // default fontSize of echarts title - var fontSize = 18; - var histogramChartTitel = 'Histogramm - ' + spatialUnitName + ' - '; - if (indicatorMetadataAndGeoJSON.fromDate) { - histogramChartTitel += "Bilanz " + indicatorMetadataAndGeoJSON.fromDate + " - " + indicatorMetadataAndGeoJSON.toDate; - fontSize = 14; - } - else { - histogramChartTitel += date; - } - - var histogramOption = { - // grid get rid of whitespace around chart - grid: { - left: '4%', - top: 32, - right: '4%', - bottom: 35, - containLabel: true - }, - title: { - text: histogramChartTitel, - left: 'center', - textStyle: { - fontSize: fontSize - }, - show: false - // top: 15 - }, - tooltip: { - trigger: 'item', - confine: 'true', - axisPointer: { - type: 'line', - crossStyle: { - color: '#999' - } + var removeSeriesFromLineChart = function (featureProperties) { + // remove feature from legend + var legendIndex = $scope.lineOption.legend.data.indexOf(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); + if (legendIndex > -1) { + $scope.lineOption.legend.data.splice(legendIndex, 1); } - }, - toolbox: { - show: true, - right: '15', - feature: { - // mark : {show: true}, - dataView: { - show: kommonitorDataExchangeService.showDiagramExportButtons, readOnly: true, title: "Datenansicht", lang: ['Datenansicht - Histogramm', 'schließen', 'refresh'], optionToContent: function (opt) { - - // - // - // - // - // - // - // - // - // - // - // - // - // - //
        Indikator-NameBeschreibung der Verknüpfung
        {{indicator.referencedIndicatorName}}{{indicator.referencedIndicatorDescription}}
        - - var histogramData = opt.series[0].data; - - var dataTableId = "histogramDataTable_" + Math.random(); - var tableExportName = opt.xAxis[0].name + " - " + opt.title[0].text; - - var htmlString = ''; - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - - htmlString += ""; - - for (var i = 0; i < histogramData.length; i++) { - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - } - - htmlString += ""; - htmlString += "
        WertintervallHäufigkeit
        " + histogramData[i][0] + " — " + histogramData[i][1] + "" + histogramData[i][2] + "
        "; - - $rootScope.$broadcast("AppendExportButtonsForTable", dataTableId, tableExportName); - - return htmlString; - } - }, - restore: { show: false, title: "Erneuern" }, - saveAsImage: { show: true, title: "Export", pixelRatio: 4 } + // remove feature data series + var seriesIndex = getSeriesIndexByFeatureName(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); + if (seriesIndex > -1) { + $scope.lineOption.series.splice(seriesIndex, 1); } - }, - xAxis: [{ - name: indicatorMetadataAndGeoJSON.indicatorName, - nameLocation: 'center', - nameGap: 22, - scale: true, - }], - yAxis: { - name: 'Anzahl Features', - // nameGap: 35, - // nameLocation: 'center', - // nameRotate: 90, - }, - series: [{ - type: 'custom', - name: indicatorMetadataAndGeoJSON.indicatorName, - renderItem: function (params, api) { - var yValue = api.value(2); - var start = api.coord([api.value(0), yValue]); - var size = api.size([api.value(1) - api.value(0), yValue]); - return { - type: 'rect', - shape: { - x: start[0], - y: start[1], - width: size[0] * 0.99, - height: size[1] + // second parameter tells echarts to not merge options with previous data. hence really remove series from graphic + $scope.lineChart.setOption($scope.lineOption, true); + setTimeout(function () { + $scope.lineChart.resize(); + }, 350); + }; + this.makeFeatureNameForPoiInIsochroneDiagram = function (poiGeoresource, geoJSONFeatureCollection, date) { + return poiGeoresource.datasetName + " - " + date + " (" + geoJSONFeatureCollection.features.length + ")"; + }; + this.createInitialReachabilityAnalysisPieOptions = function (poiGeoresource, geoJSONFeatureCollection, rangeValue, date) { + var option = { + grid: { + left: '4%', + top: 0, + right: '4%', + bottom: 30, + containLabel: true + }, + title: { + text: 'Analyse Einzugsgebiet ' + rangeValue, + left: 'center', + show: false + // top: 15 + }, + toolbox: { + show: true, + right: '15', + feature: { + // mark : {show: true}, + dataView: { + show: kommonitorDataExchangeService.showDiagramExportButtons, readOnly: true, title: "Datenansicht", lang: ['Datenansicht - Punkte im Einzugsgebiet ' + rangeValue, 'schließen', 'refresh'], optionToContent: function (opt) { + var poiData = opt.series[0].data; + var dataTableId = "poiInIsochroneTable_" + Math.random(); + var tableExportName = opt.title[0].text; + var htmlString = ''; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + for (var i = 0; i < poiData.length; i++) { + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + } + htmlString += ""; + htmlString += "
        PunktlayerAnzahl Punkte im Einzugsgebiet
        " + poiData[i].name + "" + poiData[i].value + "
        "; + $rootScope.$broadcast("AppendExportButtonsForTable", dataTableId, tableExportName); + return htmlString; + } + }, + restore: { show: false, title: "Erneuern" }, + saveAsImage: { show: true, title: "Export", pixelRatio: 4 } + } }, - style: api.style() - }; - }, - itemStyle: { - color: '#337ab7' - }, - // label: { - // normal: { - // show: true, - // position: 'insideTop' - // } - // }, - dimensions: ['untere Intervallgrenze', 'obere Intervallgrenze', 'Anzahl'], - encode: { - x: [0, 1], - y: 2, - tooltip: [0, 1, 2] - }, - data: bins ? bins.customData : undefined - }] + tooltip: { + trigger: 'item', + formatter: '{a}
        {b}: {c} ({d}%)', + confine: true + }, + legend: { + orient: 'vertical', + type: "scroll", + left: 0, + data: [this.makeFeatureNameForPoiInIsochroneDiagram(poiGeoresource, geoJSONFeatureCollection, date)] + // data: [legendText] + }, + series: [ + { + name: "Punkte im Einzugsgebiet " + rangeValue, + type: 'pie', + radius: ['50%', '70%'], + center: ["70%", "50%"], + avoidLabelOverlap: true, + label: { + show: false, + position: 'center' + }, + emphasis: { + label: { + show: true, + fontSize: '10', + // fontWeight: 'bold' + } + }, + labelLine: { + show: true + }, + data: [ + { value: geoJSONFeatureCollection.features.length, name: this.makeFeatureNameForPoiInIsochroneDiagram(poiGeoresource, geoJSONFeatureCollection, date) } + ] + } + ] + }; + return option; }; - - // var option = { - // title: { - // text: 'Histogram Chart', - // left: 'center', - // top: 20 - // }, - // tooltip: { - // trigger: 'axis', - // axisPointer: { - // type: 'line', - // crossStyle: { - // color: '#999' - // } - // } - // }, - // color: ['rgb(25, 183, 207)'], - // grid: { - // left: '3%', - // right: '3%', - // bottom: '3%', - // containLabel: true - // }, - // xAxis: [{ - // type: 'value', - // name: 'Wertintervalle', - // nameLocation: 'center', - // nameGap: 15, - // scale: true, - // }], - // yAxis: { - // type: 'value', - // name: 'Anzahl Features', - // nameGap: 22, - // nameLocation: 'center', - // nameRotate: 90, - // }, - // series: [{ - // name: 'Anzahl', - // type: 'bar', - // barWidth: '99,3%', - // // label: { - // // normal: { - // // show: true, - // // position: 'insideTop', - // // formatter: function (params) { - // // return params.value[1]; - // // } - // // } - // // }, - // data: bins.data - // }] - // }; - - if (onlyContainsPositiveNumbers(indicatorValueArray)) { - histogramOption.xAxis.min = 0; - } - - self.histogramChartOptions = histogramOption; - }; - - var onlyContainsPositiveNumbers = function (indicatorValueArray) { - indicatorValueArray.forEach(function (element) { - if (element < 0) { - return false; - } - }); - - return true; - }; - - - var appendSeriesToLineChart = function (featureProperties) { - - // in case of activated balance mode, we must use the properties of kommonitorDataExchangeService.selectedIndicator, to aquire the correct time series item! - if (kommonitorDataExchangeService.isBalanceChecked) { - featureProperties = findPropertiesForTimeSeries(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); - } - - // append feature name to legend - $scope.lineOption.legend.data.push(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); - - // create feature data series - var featureSeries = {}; - featureSeries.name = featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]; - featureSeries.type = 'line'; - featureSeries.data = new Array(); - - // for each date create series data entry for feature - for (var date of $scope.lineOption.xAxis.data) { - var value; - if (kommonitorDataExchangeService.indicatorValueIsNoData(featureProperties[INDICATOR_DATE_PREFIX + date])) { - value = null; - } - else { - value = kommonitorDataExchangeService.getIndicatorValue_asNumber(featureProperties[INDICATOR_DATE_PREFIX + date]); - } - featureSeries.data.push(value); - } - - $scope.lineOption.series.push(featureSeries); - - $scope.lineChart.setOption($scope.lineOption); - setTimeout(function () { - $scope.lineChart.resize(); - }, 350); - }; - - var findPropertiesForTimeSeries = function (spatialUnitFeatureName) { - for (var feature of kommonitorDataExchangeService.selectedIndicator.geoJSON.features) { - if (feature.properties[__env.FEATURE_NAME_PROPERTY_NAME] == spatialUnitFeatureName) { - return feature.properties; - } - } - } - - var getSeriesIndexByFeatureName = function (featureName) { - for (var index = 0; index < $scope.lineOption.series.length; index++) { - if ($scope.lineOption.series[index].name === featureName) - return index; - } - - //return -1 if none was found - return -1; - }; - - var removeSeriesFromLineChart = function (featureProperties) { - // remove feature from legend - var legendIndex = $scope.lineOption.legend.data.indexOf(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); - if (legendIndex > -1) { - $scope.lineOption.legend.data.splice(legendIndex, 1); - } - - // remove feature data series - var seriesIndex = getSeriesIndexByFeatureName(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); - if (seriesIndex > -1) { - $scope.lineOption.series.splice(seriesIndex, 1); - } - - // second parameter tells echarts to not merge options with previous data. hence really remove series from graphic - $scope.lineChart.setOption($scope.lineOption, true); - setTimeout(function () { - $scope.lineChart.resize(); - }, 350); - }; - - this.makeFeatureNameForPoiInIsochroneDiagram = function(poiGeoresource, geoJSONFeatureCollection, date){ - return poiGeoresource.datasetName + " - " + date + " (" + geoJSONFeatureCollection.features.length + ")"; - }; - - this.createInitialReachabilityAnalysisPieOptions = function(poiGeoresource, geoJSONFeatureCollection, rangeValue, date){ - var option = { - grid: { - left: '4%', - top: 0, - right: '4%', - bottom: 30, - containLabel: true - }, - title: { - text: 'Analyse Einzugsgebiet ' + rangeValue, - left: 'center', - show: false - // top: 15 - }, - toolbox: { - show: true, - right: '15', - feature: { - // mark : {show: true}, - dataView: { - show: kommonitorDataExchangeService.showDiagramExportButtons, readOnly: true, title: "Datenansicht", lang: ['Datenansicht - Punkte im Einzugsgebiet ' + rangeValue, 'schließen', 'refresh'], optionToContent: function (opt) { - - var poiData = opt.series[0].data; - - var dataTableId = "poiInIsochroneTable_" + Math.random(); - var tableExportName = opt.title[0].text; - - var htmlString = ''; - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - - htmlString += ""; - - for (var i = 0; i < poiData.length; i++) { - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - } - - htmlString += ""; - htmlString += "
        PunktlayerAnzahl Punkte im Einzugsgebiet
        " + poiData[i].name + "" + poiData[i].value + "
        "; - - $rootScope.$broadcast("AppendExportButtonsForTable", dataTableId, tableExportName); - - return htmlString; + this.appendToReachabilityAnalysisOptions = function (poiGeoresource, geoJSONFeatureCollection, eChartsOptions, date) { + eChartsOptions.legend[0].data.push(this.makeFeatureNameForPoiInIsochroneDiagram(poiGeoresource, geoJSONFeatureCollection, date)); + eChartsOptions.series[0].data.push({ value: geoJSONFeatureCollection.features.length, name: this.makeFeatureNameForPoiInIsochroneDiagram(poiGeoresource, geoJSONFeatureCollection, date) }); + return eChartsOptions; + }; + this.removePoiFromReachabilityAnalysisOption = function (eChartOptions, poiGeoresource) { + for (let index = 0; index < eChartOptions.legend[0].data.length; index++) { + const legendItem = eChartOptions.legend[0].data[index]; + if (legendItem.includes(poiGeoresource.datasetName)) { + eChartOptions.legend[0].data.splice(index, 1); + } + } + for (let index2 = 0; index2 < eChartOptions.series[0].data.length; index2++) { + const dataItem = eChartOptions.series[0].data[index2]; + if (dataItem.name.includes(poiGeoresource.datasetName)) { + eChartOptions.series[0].data.splice(index2, 1); } - }, - restore: { show: false, title: "Erneuern" }, - saveAsImage: { show: true, title: "Export", pixelRatio: 4 } } - }, - tooltip: { - trigger: 'item', - formatter: '{a}
        {b}: {c} ({d}%)', - confine: true - }, - legend: { - orient: 'vertical', - type: "scroll", - left: 0, - data: [this.makeFeatureNameForPoiInIsochroneDiagram(poiGeoresource, geoJSONFeatureCollection, date)] - // data: [legendText] - }, - series: [ - { - name: "Punkte im Einzugsgebiet " + rangeValue, - type: 'pie', - radius: ['50%', '70%'], - center: ["70%", "50%"], - avoidLabelOverlap: true, - label: { - show: false, - position: 'center' - }, - - emphasis: { - label: { - show: true, - fontSize: '10', - // fontWeight: 'bold' - } - }, - labelLine: { - show: true - }, - data: [ - {value: geoJSONFeatureCollection.features.length, name: this.makeFeatureNameForPoiInIsochroneDiagram(poiGeoresource, geoJSONFeatureCollection, date)} - ] - } - ] + return eChartOptions; }; - - return option; - }; - - this.appendToReachabilityAnalysisOptions = function(poiGeoresource, geoJSONFeatureCollection, eChartsOptions, date){ - eChartsOptions.legend[0].data.push(this.makeFeatureNameForPoiInIsochroneDiagram(poiGeoresource, geoJSONFeatureCollection, date)); - eChartsOptions.series[0].data.push({value: geoJSONFeatureCollection.features.length, name: this.makeFeatureNameForPoiInIsochroneDiagram(poiGeoresource, geoJSONFeatureCollection, date)}); - - return eChartsOptions; - }; - - this.removePoiFromReachabilityAnalysisOption = function(eChartOptions, poiGeoresource){ - for (let index = 0; index < eChartOptions.legend[0].data.length; index++) { - const legendItem = eChartOptions.legend[0].data[index]; - if(legendItem.includes(poiGeoresource.datasetName)){ - eChartOptions.legend[0].data.splice(index, 1); - } - } - - for (let index2 = 0; index2 < eChartOptions.series[0].data.length; index2++) { - const dataItem = eChartOptions.series[0].data[index2]; - if(dataItem.name.includes(poiGeoresource.datasetName)){ - eChartOptions.series[0].data.splice(index2, 1); - } - } - - return eChartOptions; - }; - - this.makeTrendChartOptions_forAllFeatures = function(indicatorMetadataAndGeoJSON, fromDateAsPropertyString, toDateAsPropertyString, showMinMax, showCompleteTimeseries, computationType){ - // we may base on the the precomputed timeseries lineOptions and modify that from a cloned instance - - var timeseriesOptions = JSON.parse(JSON.stringify(this.getLineChartOptions())); - - // remove any additional lines for concrete features - timeseriesOptions.series.length = 3; - - // add markedAreas for periods out of scope - - var fromDateString = fromDateAsPropertyString.split(__env.indicatorDatePrefix)[1]; - var fromDate_date = new Date(fromDateString); - var toDateString = toDateAsPropertyString.split(__env.indicatorDatePrefix)[1]; - var toDate_date = new Date(toDateString); - - if(showCompleteTimeseries){ - timeseriesOptions.series[0].markArea = { - silent: true, - itemStyle: { - color: '#b50b0b', - opacity: 0.3 - }, - data: [[{ - xAxis: indicatorMetadataAndGeoJSON.applicableDates[0] - }, { - xAxis: fromDateString - }], - [{ - xAxis: toDateString - }, { - xAxis: indicatorMetadataAndGeoJSON.applicableDates[indicatorMetadataAndGeoJSON.applicableDates.length - 1] - }]] - }; - } - - // hide data points - timeseriesOptions.series[0].itemStyle.normal.opacity = 0; - timeseriesOptions.series[0].lineStyle.normal.width = 3; - timeseriesOptions.series[0].lineStyle.normal.type = "solid"; - - var trendData = []; - - var timeseriesData = timeseriesOptions.series[0].data; - var minSeriesData = timeseriesOptions.series[1].data; - var maxSeriesData = timeseriesOptions.series[2].data; - - if(! showCompleteTimeseries){ - var xData = []; - var timeData = []; - var minData = []; - var maxData = []; + this.makeTrendChartOptions_forAllFeatures = function (indicatorMetadataAndGeoJSON, fromDateAsPropertyString, toDateAsPropertyString, showMinMax, showCompleteTimeseries, computationType) { + // we may base on the the precomputed timeseries lineOptions and modify that from a cloned instance + var timeseriesOptions = JSON.parse(JSON.stringify(this.getLineChartOptions())); + // remove any additional lines for concrete features + timeseriesOptions.series.length = 3; + // add markedAreas for periods out of scope + var fromDateString = fromDateAsPropertyString.split(__env.indicatorDatePrefix)[1]; + var fromDate_date = new Date(fromDateString); + var toDateString = toDateAsPropertyString.split(__env.indicatorDatePrefix)[1]; + var toDate_date = new Date(toDateString); + if (showCompleteTimeseries) { + timeseriesOptions.series[0].markArea = { + silent: true, + itemStyle: { + color: '#b50b0b', + opacity: 0.3 + }, + data: [[{ + xAxis: indicatorMetadataAndGeoJSON.applicableDates[0] + }, { + xAxis: fromDateString + }], + [{ + xAxis: toDateString + }, { + xAxis: indicatorMetadataAndGeoJSON.applicableDates[indicatorMetadataAndGeoJSON.applicableDates.length - 1] + }]] + }; + } + // hide data points + timeseriesOptions.series[0].itemStyle.normal.opacity = 0; + timeseriesOptions.series[0].lineStyle.normal.width = 3; + timeseriesOptions.series[0].lineStyle.normal.type = "solid"; + var trendData = []; + var timeseriesData = timeseriesOptions.series[0].data; + var minSeriesData = timeseriesOptions.series[1].data; + var maxSeriesData = timeseriesOptions.series[2].data; + if (!showCompleteTimeseries) { + var xData = []; + var timeData = []; + var minData = []; + var maxData = []; + for (let index = 0; index < timeseriesData.length; index++) { + var date_candidate = new Date(indicatorMetadataAndGeoJSON.applicableDates[index]); + if (date_candidate >= fromDate_date && date_candidate <= toDate_date) { + const value = timeseriesData[index]; + // const date = indicatorMetadataAndGeoJSON.applicableDates[index]; + timeData.push(value); + xData.push(indicatorMetadataAndGeoJSON.applicableDates[index]); + minData.push(minSeriesData[index]); + maxData.push(maxSeriesData[index]); + } + } + timeseriesOptions.series[0].data = timeData; + timeseriesOptions.series[1].data = minData; + timeseriesOptions.series[2].data = maxData; + timeseriesOptions.xAxis.data = xData; + } + // update value if it has changed + timeseriesData = timeseriesOptions.series[0].data; + var xAxisData = timeseriesOptions.xAxis.data; for (let index = 0; index < timeseriesData.length; index++) { - var date_candidate = new Date(indicatorMetadataAndGeoJSON.applicableDates[index]); - if(date_candidate >= fromDate_date && date_candidate <= toDate_date){ - const value = timeseriesData[index]; - // const date = indicatorMetadataAndGeoJSON.applicableDates[index]; - - timeData.push(value); - xData.push(indicatorMetadataAndGeoJSON.applicableDates[index]); - minData.push(minSeriesData[index]); - maxData.push(maxSeriesData[index]); - } + var dateCandidate = new Date(xAxisData[index]); + if (dateCandidate >= fromDate_date && dateCandidate <= toDate_date) { + const value = timeseriesData[index]; + // const date = indicatorMetadataAndGeoJSON.applicableDates[index]; + trendData.push([index, value]); + } } - - timeseriesOptions.series[0].data = timeData; - timeseriesOptions.series[1].data = minData; - timeseriesOptions.series[2].data = maxData; - - timeseriesOptions.xAxis.data = xData; - } - - // update value if it has changed - timeseriesData = timeseriesOptions.series[0].data; - var xAxisData = timeseriesOptions.xAxis.data; - for (let index = 0; index < timeseriesData.length; index++) { - var dateCandidate = new Date(xAxisData[index]); - if(dateCandidate >= fromDate_date && dateCandidate <= toDate_date){ - const value = timeseriesData[index]; - // const date = indicatorMetadataAndGeoJSON.applicableDates[index]; - - trendData.push([index, value]); - } - } - - // add regression line according to option - - var trendLine; - if (computationType.includes("linear")){ - trendLine = ecStat.regression('linear', trendData); - } - else if (computationType.includes("exponential")){ - trendLine = ecStat.regression('exponential', trendData); - } - else if (computationType.includes("polynomial_3")){ - trendLine = ecStat.regression('polynomial', trendData, 3); - } - else{ - trendLine = ecStat.regression('linear', trendData); - } - - timeseriesOptions.legend.data.push("Trendlinie"); - - timeseriesOptions.series.push({ - name: 'Trendlinie', - type: 'line', - showSymbol: false, - data: trendLine.points, - lineStyle: { - normal: { - color: 'red', - width: 4, - type: 'dashed' - } - }, - itemStyle: { - normal: { - borderWidth: 3, - color: 'red', - opacity: 0 - } - }, - markPoint: { + // add regression line according to option + var trendLine; + if (computationType.includes("linear")) { + trendLine = ecStat.regression('linear', trendData); + } + else if (computationType.includes("exponential")) { + trendLine = ecStat.regression('exponential', trendData); + } + else if (computationType.includes("polynomial_3")) { + trendLine = ecStat.regression('polynomial', trendData, 3); + } + else { + trendLine = ecStat.regression('linear', trendData); + } + timeseriesOptions.legend.data.push("Trendlinie"); + timeseriesOptions.series.push({ + name: 'Trendlinie', + type: 'line', + showSymbol: false, + data: trendLine.points, + lineStyle: { + normal: { + color: 'red', + width: 4, + type: 'dashed' + } + }, itemStyle: { normal: { - color: 'transparent' + borderWidth: 3, + color: 'red', + opacity: 0 } }, - // label: { - // normal: { - // show: true, - // position: 'left', - // formatter: trendLine.expression, - // textStyle: { - // color: '#333', - // fontSize: 14 - // } - // } - // }, - data: [{ - coord: trendLine.points[trendLine.points.length - 1] - }] - } - }); - - if(! showMinMax){ - timeseriesOptions.series.splice(1, 1); - timeseriesOptions.series.splice(1, 1); - } - - return timeseriesOptions; - }; - - // Returns an image. - // Attribution has to be converted to an image anyway for report generation. - this.createReportingReachabilityMapAttribution = async function() { - let attributionText = "Leaflet | Map data @ OpenStreetMap contributors" - let canvas = document.createElement("canvas") - canvas.width = 800; - let ctx = canvas.getContext('2d') - ctx.font = "8pt Arial"; - ctx.textBaseline = 'top'; - ctx.fillStyle = "rgb(60, 60, 60)"; - ctx.fillText(attributionText, 0, 0); - canvas = trimCanvas(canvas, 5) - - let image = new Image(canvas.width, canvas.height) - image.style.backgroundColor = "white"; - return await new Promise( (resolve, reject) => { - image.onload = function() { - resolve(image); - } - image.src = canvas.toDataURL(); - }); - } - - // Returns an image. - // Legend has to be converted to an image anyway for report generation. - this.createReportingReachabilityMapLegend = async function(echartsOptions, selectedSpatialUnit, isochronesRangeType, isochronesRangeUnits) { - let legendEntries = []; - let isochronesHeadingAdded = false; - for(let i=0; i { - return entry.isIsochroneEntry - }); - // layer isochrone icons on top of each other unitl we reach the current one - for(let isochroneEntry of isochroneEntries.reverse()) { - if(isochroneEntry === entry) { - break; + return timeseriesOptions; + }; + // Returns an image. + // Attribution has to be converted to an image anyway for report generation. + this.createReportingReachabilityMapAttribution = async function () { + let attributionText = "Leaflet | Map data @ OpenStreetMap contributors"; + let canvas = document.createElement("canvas"); + canvas.width = 800; + let ctx = canvas.getContext('2d'); + ctx.font = "8pt Arial"; + ctx.textBaseline = 'top'; + ctx.fillStyle = "rgb(60, 60, 60)"; + ctx.fillText(attributionText, 0, 0); + canvas = trimCanvas(canvas, 5); + let image = new Image(canvas.width, canvas.height); + image.style.backgroundColor = "white"; + return await new Promise((resolve, reject) => { + image.onload = function () { + resolve(image); + }; + image.src = canvas.toDataURL(); + }); + }; + // Returns an image. + // Legend has to be converted to an image anyway for report generation. + this.createReportingReachabilityMapLegend = async function (echartsOptions, selectedSpatialUnit, isochronesRangeType, isochronesRangeUnits) { + let legendEntries = []; + let isochronesHeadingAdded = false; + for (let i = 0; i < echartsOptions.series.length; i++) { + let series = echartsOptions.series[i]; + if (series.name === "spatialUnitBoundaries") { + legendEntries.push({ + label: selectedSpatialUnit.spatialUnitName ? selectedSpatialUnit.spatialUnitName : selectedSpatialUnit.spatialUnitLevel, + iconColor: series.itemStyle.borderColor, + iconHeight: 4, + isGroupHeading: false + }); + } + if (series.name.includes("isochrones")) { + if (!isochronesHeadingAdded) { // add heading above first isochrone entry + legendEntries.push({ + label: "Erreichbarkeit", + isGroupHeading: true + }); + isochronesHeadingAdded = true; + } + let value = series.data[0].value; + legendEntries.push({ + label: value, + iconColor: series.data[0].itemStyle.areaColor, + iconOpacity: series.data[0].itemStyle.opacity, + iconHeight: 12, + isGroupHeading: false, + isIsochroneEntry: true + }); } - ctx.fillStyle = isochroneEntry.iconColor; - ctx.globalAlpha = isochroneEntry.iconOpacity; - ctx.fillRect(xPos, yPos + ( (12-entry.iconHeight) / 2), iconWidth, isochroneEntry.iconHeight) - ctx.globalAlpha = 1; - } } - - ctx.fillStyle = entry.iconColor; - ctx.globalAlpha = entry.iconOpacity ? entry.iconOpacity : 1; - ctx.fillRect(xPos, yPos + ( (12-entry.iconHeight) / 2), iconWidth, entry.iconHeight) - ctx.globalAlpha = 1; - // and label + let canvas = document.createElement("canvas"); + canvas.width = 800; + canvas.height = 800; + let ctx = canvas.getContext('2d'); + let fontStyle = "8pt Arial"; ctx.font = fontStyle; - ctx.fillStyle = "black"; - ctx.textBaseline = "top"; - if(entry.isIsochroneEntry) { - let text = entry.label + " " + isochronesRangeUnits - ctx.fillText(text, xPos + iconWidth + 5, yPos) - } else { - ctx.fillText(entry.label, xPos + iconWidth + 5, yPos) + let xPos = 5; + let yPos = 5; + let rowHeight = 20; + let iconWidth = 30; + for (let entry of legendEntries) { + if (entry.isGroupHeading) { + let isochronesRangeTypeMapping = { + "time": "Zeit", + "distance": "Distanz" + }; + // only draw label + ctx.font = "bold " + fontStyle; + ctx.fillStyle = "black"; + ctx.textBaseline = "top"; + let text = entry.label + " [" + isochronesRangeTypeMapping[isochronesRangeType] + "]"; + ctx.fillText(text, xPos, yPos); + yPos += rowHeight; + } + else { + // icon + if (entry.isIsochroneEntry) { + let isochroneEntries = legendEntries.filter(entry => { + return entry.isIsochroneEntry; + }); + // layer isochrone icons on top of each other unitl we reach the current one + for (let isochroneEntry of isochroneEntries.reverse()) { + if (isochroneEntry === entry) { + break; + } + ctx.fillStyle = isochroneEntry.iconColor; + ctx.globalAlpha = isochroneEntry.iconOpacity; + ctx.fillRect(xPos, yPos + ((12 - entry.iconHeight) / 2), iconWidth, isochroneEntry.iconHeight); + ctx.globalAlpha = 1; + } + } + ctx.fillStyle = entry.iconColor; + ctx.globalAlpha = entry.iconOpacity ? entry.iconOpacity : 1; + ctx.fillRect(xPos, yPos + ((12 - entry.iconHeight) / 2), iconWidth, entry.iconHeight); + ctx.globalAlpha = 1; + // and label + ctx.font = fontStyle; + ctx.fillStyle = "black"; + ctx.textBaseline = "top"; + if (entry.isIsochroneEntry) { + let text = entry.label + " " + isochronesRangeUnits; + ctx.fillText(text, xPos + iconWidth + 5, yPos); + } + else { + ctx.fillText(entry.label, xPos + iconWidth + 5, yPos); + } + yPos += rowHeight; + } } - yPos += rowHeight - } - } - - canvas = trimCanvas(canvas, 5) - let image = new Image(canvas.width, canvas.height) - image.style.backgroundColor = "white"; - return await new Promise( (resolve, reject) => { - image.onload = function() { - resolve(image); - } - image.src = canvas.toDataURL(); - }); - } - - var calculateOverallBoundingBoxFromGeoJSON = function(features) { - let result = []; - for(var i=0; i result[2]) ? bbox[2] : result[2]; - result[3] = (bbox[3] > result[3]) ? bbox[3] : result[3]; - } - } - return result; - }; - - function trimCanvas(canvas, padding=0) { - function rowBlank(imageData, width, y) { - for (var x = 0; x < width; ++x) { - if (imageData.data[y * width * 4 + x * 4 + 3] !== 0) return false; + canvas = trimCanvas(canvas, 5); + let image = new Image(canvas.width, canvas.height); + image.style.backgroundColor = "white"; + return await new Promise((resolve, reject) => { + image.onload = function () { + resolve(image); + }; + image.src = canvas.toDataURL(); + }); + }; + var calculateOverallBoundingBoxFromGeoJSON = function (features) { + let result = []; + for (var i = 0; i < features.length; i++) { + // check if we have to modify our overall bbox (result) + if (result.length === 0) { // for first feature + result.push(...features[i].properties.bbox); + } + else { + // all other features + let bbox = features[i].properties.bbox; + result[0] = (bbox[0] < result[0]) ? bbox[0] : result[0]; + result[1] = (bbox[1] < result[1]) ? bbox[1] : result[1]; + result[2] = (bbox[2] > result[2]) ? bbox[2] : result[2]; + result[3] = (bbox[3] > result[3]) ? bbox[3] : result[3]; + } } - return true; - } - - function columnBlank(imageData, width, x, top, bottom) { - for (var y = top; y < bottom; ++y) { - if (imageData.data[y * width * 4 + x * 4 + 3] !== 0) return false; + return result; + }; + function trimCanvas(canvas, padding = 0) { + function rowBlank(imageData, width, y) { + for (var x = 0; x < width; ++x) { + if (imageData.data[y * width * 4 + x * 4 + 3] !== 0) + return false; + } + return true; + } + function columnBlank(imageData, width, x, top, bottom) { + for (var y = top; y < bottom; ++y) { + if (imageData.data[y * width * 4 + x * 4 + 3] !== 0) + return false; + } + return true; } - return true; - } - - var ctx = canvas.getContext("2d"); var width = canvas.width; var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height); var top = 0, bottom = imageData.height, left = 0, right = imageData.width; - - while (top < bottom && rowBlank(imageData, width, top)) ++top; - while (bottom - 1 > top && rowBlank(imageData, width, bottom - 1)) --bottom; - while (left < right && columnBlank(imageData, width, left, top, bottom)) ++left; - while (right - 1 > left && columnBlank(imageData, width, right - 1, top, bottom)) --right; - + while (top < bottom && rowBlank(imageData, width, top)) + ++top; + while (bottom - 1 > top && rowBlank(imageData, width, bottom - 1)) + --bottom; + while (left < right && columnBlank(imageData, width, left, top, bottom)) + ++left; + while (right - 1 > left && columnBlank(imageData, width, right - 1, top, bottom)) + --right; var trimmed = ctx.getImageData(left, top, right - left, bottom - top); var copy = canvas.ownerDocument.createElement("canvas"); var copyCtx = copy.getContext("2d"); - copy.width = trimmed.width + padding*2; - copy.height = trimmed.height + padding*2; + copy.width = trimmed.width + padding * 2; + copy.height = trimmed.height + padding * 2; copyCtx.putImageData(trimmed, padding, padding); - return copy; - }; - + } + ; }]); +//# sourceMappingURL=kommonitor-diagram-helper-service.module.js.map \ No newline at end of file diff --git a/app/util/genericServices/kommonitorDiagramHelperService/kommonitor-diagram-helper-service.module.js.map b/app/util/genericServices/kommonitorDiagramHelperService/kommonitor-diagram-helper-service.module.js.map new file mode 100644 index 000000000..fb90dffb5 --- /dev/null +++ b/app/util/genericServices/kommonitorDiagramHelperService/kommonitor-diagram-helper-service.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-diagram-helper-service.module.js","sourceRoot":"","sources":["kommonitor-diagram-helper-service.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,yBAAyB,EAAE,CAAC,eAAe,EAAE,wBAAwB,CAAC,CAAC,CAAC;AAEvF;;;;;;;;GAQG;AACH,OAAO;KACJ,MAAM,CAAC,yBAAyB,EAAE,CAAC,wBAAwB,CAAC,CAAC;KAC7D,OAAO,CACN,gCAAgC,EAAE,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E,MAAM,CAAC;gBAAE,EAAE,IAAI,CAAC;YAChF,OAAO,KAAK,GAAG,CAAC,GAAG,IAAI,IAAI,WAAW,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC;gBAAE,EAAE,KAAK,CAAC;YAE1F,IAAI,OAAO,GAAG,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC,CAAC;YACtE,IAAI,IAAI,GAAG,MAAM,CAAC,aAAa,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;YACxD,IAAI,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YACpC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,GAAG,OAAO,GAAC,CAAC,CAAC;YACvC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,GAAC,CAAC,CAAC;YACzC,OAAO,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAEhD,OAAO,IAAI,CAAC;QACnB,CAAC;QAAA,CAAC;IAEH,CAAC,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/util/genericServices/kommonitorDiagramHelperService/kommonitor-diagram-helper-service.module.ts b/app/util/genericServices/kommonitorDiagramHelperService/kommonitor-diagram-helper-service.module.ts new file mode 100644 index 000000000..b25aaf9af --- /dev/null +++ b/app/util/genericServices/kommonitorDiagramHelperService/kommonitor-diagram-helper-service.module.ts @@ -0,0 +1,2072 @@ +angular.module('kommonitorDiagramHelper', ['kommonitorMap', 'kommonitorDataExchange']); + +/** + * a common serviceInstance that holds all needed properties for a WPS service. + * + * This service represents a shared object ´which is used across the different + * application tabs/components like Setup, Capabilities, Execute etc. + * + * This way, one single service instance can be used to easily share values and + * parameters for each WPS operation represented by different Angular components + */ +angular + .module('kommonitorDiagramHelper', ["kommonitorFilterHelper"]) + .service( + 'kommonitorDiagramHelperService', ['$rootScope', '$timeout', 'kommonitorMapService', 'kommonitorDataExchangeService', + 'kommonitorFilterHelperService', '$http', '__env', '$q', + function ($rootScope, $timeout, + kommonitorMapService, kommonitorDataExchangeService, kommonitorFilterHelperService, $http, __env, $q) { + + const INDICATOR_DATE_PREFIX = __env.indicatorDatePrefix; + const defaultColorForHoveredFeatures = __env.defaultColorForHoveredFeatures; + const defaultColorForClickedFeatures = __env.defaultColorForClickedFeatures; + + var numberOfDecimals = __env.numberOfDecimals; + var defaultColorForZeroValues = __env.defaultColorForZeroValues; + var defaultColorForNoDataValues = __env.defaultColorForNoDataValues; + var defaultColorForFilteredValues = __env.defaultColorForFilteredValues; + + const defaultColorForOutliers_high = __env.defaultColorForOutliers_high; + const defaultBorderColorForOutliers_high = __env.defaultBorderColorForOutliers_high; + const defaultFillOpacityForOutliers_high = __env.defaultFillOpacityForOutliers_high; + const defaultColorForOutliers_low = __env.defaultColorForOutliers_low; + const defaultBorderColorForOutliers_low = __env.defaultBorderColorForOutliers_low; + const defaultFillOpacityForOutliers_low = __env.defaultFillOpacityForOutliers_low; + + this.indicatorPropertyName = ""; + + this.barChartOptions = {}; + this.lineChartOptions = {}; + this.histogramChartOptions = {}; + this.radarChartOptions = {}; + this.regressionChartOptions = {}; + + this.isCloserToTargetDate = function(date, closestDate, targetDate){ + var targetYear = targetDate.split("-")[0]; + var targetMonth = targetDate.split("-")[1]; + var targetDay = targetDate.split("-")[2]; + + var closestDateComps = closestDate.split("-"); + var closestDateYear = closestDateComps[0]; + var closestDateMonth = closestDateComps[1]; + var closestDateDay = closestDateComps[2]; + + var dateComps = date.split("-"); + var year = dateComps[0]; + var month = dateComps[1]; + var day = dateComps[2]; + + var monthDiff_closestDate = Math.abs(targetMonth - closestDateMonth); + var monthDiff_date = Math.abs(targetMonth - month); + + if(monthDiff_date <= monthDiff_closestDate){ + var dayDiff_closestDate = Math.abs(targetDay - closestDateDay); + var dayDiff_date = Math.abs(targetDay - day); + + if(dayDiff_date < dayDiff_closestDate){ + return true; + } + } + return false; + }; + + this.findClostestTimestamForTargetDate = function(indicatorForRadar, targetDate){ + var applicableDates = indicatorForRadar.indicatorMetadata.applicableDates; + + var targetYear = targetDate.split("-")[0]; + var targetMonth = targetDate.split("-")[1]; + var targetDay = targetDate.split("-")[2]; + + var closestDate = undefined; + + for (var date of applicableDates) { + var dateComps = date.split("-"); + var year = dateComps[0]; + var month = dateComps[1]; + var day = dateComps[2]; + + if(targetDate.includes(year)){ + if(! closestDate){ + closestDate = date; + } + else{ + if(this.isCloserToTargetDate(date, closestDate, targetDate)){ + closestDate = date; + } + } + + } + } + + return closestDate; + }; + + // an array of only the properties and metadata of all indicatorFeatures + this.indicatorPropertiesForCurrentSpatialUnitAndTime; + + this.filterSameUnitAndSameTime = false; + + this.setupIndicatorPropertiesForCurrentSpatialUnitAndTime = function (filterBySameUnitAndSameTime) { + + $rootScope.$broadcast("allIndicatorPropertiesForCurrentSpatialUnitAndTime setup begin"); + + this.indicatorPropertiesForCurrentSpatialUnitAndTime = []; + + kommonitorDataExchangeService.displayableIndicators.forEach(indicatorMetadata => { + var targetYear = kommonitorDataExchangeService.selectedDate.split("-")[0]; + var indicatorCandidateYears = [] + indicatorMetadata.applicableDates.forEach((date, i) => { + indicatorCandidateYears.push(date.split("-")[0]); + }); + + + // if (indicatorCandidateYears.includes(targetYear) && indicatorMetadata.applicableSpatialUnits.some(o => o.spatialUnitName === kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel)) { + // var selectableIndicatorEntry = {}; + // selectableIndicatorEntry.indicatorProperties = null; + // // per default show no indicators on radar + // selectableIndicatorEntry.isSelected = false; + // selectableIndicatorEntry.indicatorMetadata = indicatorMetadata; + // selectableIndicatorEntry.closestTimestamp = undefined; + + // this.indicatorPropertiesForCurrentSpatialUnitAndTime.push(selectableIndicatorEntry); + // } + + if (indicatorMetadata.applicableSpatialUnits.some(o => o.spatialUnitName === kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel)) { + var canBeAdded = true; + + if(filterBySameUnitAndSameTime){ + if(indicatorCandidateYears.includes(targetYear)){ + canBeAdded = true; + } + else{ + canBeAdded = false; + } + } + + if (canBeAdded){ + var selectableIndicatorEntry = {}; + selectableIndicatorEntry.indicatorProperties = null; + // per default show no indicators on radar + selectableIndicatorEntry.isSelected = false; + selectableIndicatorEntry.indicatorMetadata = indicatorMetadata; + // selectableIndicatorEntry.closestTimestamp = undefined; + + this.indicatorPropertiesForCurrentSpatialUnitAndTime.push(selectableIndicatorEntry); + } + + } + }); + + $rootScope.$broadcast("allIndicatorPropertiesForCurrentSpatialUnitAndTime setup completed"); + }; + + this.fetchIndicatorPropertiesIfNotExists = async function(index){ + if(this.indicatorPropertiesForCurrentSpatialUnitAndTime[index].indicatorProperties === null || this.indicatorPropertiesForCurrentSpatialUnitAndTime[index].indicatorProperties === undefined){ + // var dateComps = kommonitorDataExchangeService.selectedDate.split("-"); + // + // var year = dateComps[0]; + // var month = dateComps[1]; + // var day = dateComps[2]; + + this.indicatorPropertiesForCurrentSpatialUnitAndTime[index].indicatorProperties = await this.fetchIndicatorProperties(this.indicatorPropertiesForCurrentSpatialUnitAndTime[index].indicatorMetadata, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitId); + } + }; + + this.fetchIndicatorProperties = function (indicatorMetadata, spatialUnitId) { + return $http({ + url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/indicators/" + indicatorMetadata.indicatorId + "/" + spatialUnitId + "/without-geometry", + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + return response.data; + + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + kommonitorDataExchangeService.displayMapApplicationError(error); + }); + }; + + this.getColorFromBrewInstance = function(brewInstance, feature, targetDate){ + var color; + for (var index=0; index < brewInstance.breaks.length; index++){ + + if(kommonitorDataExchangeService.getIndicatorValueFromArray_asNumber(feature.properties, targetDate) == kommonitorDataExchangeService.getIndicatorValue_asNumber(brewInstance.breaks[index])){ + if(index < brewInstance.breaks.length -1){ + // min value + color = brewInstance.colors[index]; + break; + } + else { + //max value + if (brewInstance.colors[index]){ + color = brewInstance.colors[index]; + } + else{ + color = brewInstance.colors[index - 1]; + } + break; + } + } + else{ + if(kommonitorDataExchangeService.getIndicatorValueFromArray_asNumber(feature.properties, targetDate) < kommonitorDataExchangeService.getIndicatorValue_asNumber(brewInstance.breaks[index + 1])) { + color = brewInstance.colors[index]; + break; + } + } + } + + return color; + }; + + this.getColorForFeature = function(feature, indicatorMetadataAndGeoJSON, targetDate, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue){ + var color; + + if(!targetDate.includes(INDICATOR_DATE_PREFIX)){ + targetDate = INDICATOR_DATE_PREFIX + targetDate; + } + + if(kommonitorDataExchangeService.indicatorValueIsNoData(feature.properties[targetDate])){ + color = defaultColorForNoDataValues; + } + else if(kommonitorFilterHelperService.featureIsCurrentlyFiltered(feature.properties[__env.FEATURE_ID_PROPERTY_NAME])){ + color = defaultColorForFilteredValues; + } + else if(kommonitorDataExchangeService.classifyZeroSeparately && kommonitorDataExchangeService.getIndicatorValueFromArray_asNumber(feature.properties, targetDate) === 0 ){ + color = defaultColorForZeroValues; + } + else if(feature.properties["outlier"] !== undefined && feature.properties["outlier"].includes("low") && kommonitorDataExchangeService.useOutlierDetectionOnIndicator){ + color = defaultColorForOutliers_low; + } + else if(feature.properties["outlier"] !== undefined && feature.properties["outlier"].includes("high") && kommonitorDataExchangeService.useOutlierDetectionOnIndicator){ + color = defaultColorForOutliers_high; + } + else if(isMeasureOfValueChecked){ + + if(kommonitorDataExchangeService.getIndicatorValueFromArray_asNumber(feature.properties, targetDate) >= +Number(measureOfValue).toFixed(numberOfDecimals)){ + color = this.getColorFromBrewInstance(gtMeasureOfValueBrew, feature, targetDate); + } + else { + color = this.getColorFromBrewInstance(ltMeasureOfValueBrew, feature, targetDate); + } + + } + else{ + if(indicatorMetadataAndGeoJSON.indicatorType.includes('DYNAMIC')){ + + if(feature.properties[targetDate] < 0){ + + color = this.getColorFromBrewInstance(dynamicDecreaseBrew, feature, targetDate); + } + else{ + color = this.getColorFromBrewInstance(dynamicIncreaseBrew, feature, targetDate); + } + + } + else{ + + if(containsNegativeValues(indicatorMetadataAndGeoJSON.geoJSON, targetDate)){ + if(kommonitorDataExchangeService.getIndicatorValue_asNumber(feature.properties[targetDate]) >= 0){ + if(kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[targetDate] == 0 || feature.properties[targetDate] == "0")){ + color = defaultColorForZeroValues; + // if(__env.useTransparencyOnIndicator){ + // fillOpacity = __env.defaultFillOpacityForZeroFeatures; + // } + } + else{ + color = this.getColorFromBrewInstance(dynamicIncreaseBrew, feature, targetDate); + } + } + else{ + if(kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[targetDate] == 0 || feature.properties[targetDate] == "0")){ + color = defaultColorForZeroValues; + // if(__env.useTransparencyOnIndicator){ + // fillOpacity = __env.defaultFillOpacityForZeroFeatures; + // } + } + else{ + color = this.getColorFromBrewInstance(dynamicDecreaseBrew, feature, targetDate); + } + } + } + else{ + color = this.getColorFromBrewInstance(defaultBrew, feature, targetDate); + } + } + } + + return color; + }; + + this.getBarChartOptions = function () { + return self.barChartOptions; + }; + + this.getGeoMapChartOptions = function () { + return self.geoMapChartOptions; + }; + + this.getHistogramChartOptions = function () { + return self.histogramChartOptions; + }; + + this.getLineChartOptions = function () { + return self.lineChartOptions; + }; + + this.prepareAllDiagramResources_forCurrentMapIndicator = function (indicatorMetadataAndGeoJSON, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue, filterOutFutureDates) { + this.prepareAllDiagramResources(indicatorMetadataAndGeoJSON, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue, filterOutFutureDates, false); + }; + + this.prepareAllDiagramResources_forReportingIndicator = function (indicatorMetadataAndGeoJSON, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue, filterOutFutureDates) { + this.prepareAllDiagramResources(indicatorMetadataAndGeoJSON, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue, filterOutFutureDates, true); + }; + + this.prepareAllDiagramResources = function (indicatorMetadataAndGeoJSON, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue, filterOutFutureDates, forceUseSubmittedIndicatorForTimeseries) { + + self.indicatorPropertyName = INDICATOR_DATE_PREFIX + date; + + var featureNamesArray = new Array(); + var indicatorValueArray = new Array(); + var indicatorValueBarChartArray = new Array(); + + //sort array of features + var cartographicFeatures = indicatorMetadataAndGeoJSON.geoJSON.features; + cartographicFeatures.sort(compareFeaturesByIndicatorValue); + + for (var j = 0; j < cartographicFeatures.length; j++) { + // diff occurs when balance mode is activated + // then, cartographicFeatures display balance over time period, which shall be reflected in bar chart and histogram + // the other diagrams must use the "normal" unbalanced indicator instead --> selectedFeatures + var cartographicFeature = cartographicFeatures[j]; + + var indicatorValue; + if (kommonitorDataExchangeService.indicatorValueIsNoData(cartographicFeature.properties[self.indicatorPropertyName])) { + indicatorValue = null; + } + else { + indicatorValue = kommonitorDataExchangeService.getIndicatorValue_asNumber(cartographicFeature.properties[self.indicatorPropertyName]); + } + + var featureName = cartographicFeature.properties[__env.FEATURE_NAME_PROPERTY_NAME] + featureNamesArray.push(featureName); + indicatorValueArray.push(indicatorValue); + + var color = this.getColorForFeature(cartographicFeature, indicatorMetadataAndGeoJSON, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue); + + var seriesItem = { + value: indicatorValue, + name: featureName, + itemStyle: { + color: color + // borderWidth: 1, + // borderColor: 'black' + } + }; + + indicatorValueBarChartArray.push(seriesItem); + + } + + // TIMESERIES + var indicatorTimeSeriesDatesArray = indicatorMetadataAndGeoJSON.applicableDates; + + if(filterOutFutureDates){ + // remove all timestamps that are newer than the given date + var dateInDateFormat = Date.parse(date); + indicatorTimeSeriesDatesArray = indicatorTimeSeriesDatesArray.filter( t => { + var tInDateFormat = Date.parse(t); + if (tInDateFormat <= dateInDateFormat) { + return true; + } else { + return false; + } + }); + } + + var indicatorTimeSeriesAverageArray = new Array(indicatorTimeSeriesDatesArray.length); + var indicatorTimeSeriesMaxArray = new Array(indicatorTimeSeriesDatesArray.length); + var indicatorTimeSeriesMinArray = new Array(indicatorTimeSeriesDatesArray.length); + var indicatorTimeSeriesCountArray = new Array(indicatorTimeSeriesDatesArray.length); + + // initialize timeSeries arrays + for (var i = 0; i < indicatorTimeSeriesDatesArray.length; i++) { + indicatorTimeSeriesAverageArray[i] = 0; + indicatorTimeSeriesCountArray[i] = 0; + } + + let indicatorMetadataForTimeseries = indicatorMetadataAndGeoJSON; + + if(!forceUseSubmittedIndicatorForTimeseries && kommonitorDataExchangeService.isBalanceChecked){ + indicatorMetadataForTimeseries = kommonitorDataExchangeService.selectedIndicator; + } + // we must use the original selectedIndicator in case balance mode is active + // otherwise balance timestamp will have balance values + for (var t = 0; t < indicatorMetadataForTimeseries.geoJSON.features.length; t++) { + var indicatorFeature = indicatorMetadataForTimeseries.geoJSON.features[t]; + // continue timeSeries arrays by adding and counting all time series values + for (var i = 0; i < indicatorTimeSeriesDatesArray.length; i++) { + var datePropertyName = INDICATOR_DATE_PREFIX + indicatorTimeSeriesDatesArray[i]; + if (!kommonitorDataExchangeService.indicatorValueIsNoData(indicatorFeature.properties[datePropertyName])) { + // indicatorTimeSeriesAverageArray[i] += selectedFeature.properties[datePropertyName]; + indicatorTimeSeriesAverageArray[i] += indicatorFeature.properties[datePropertyName]; + indicatorTimeSeriesCountArray[i]++; + + // min stack + if (indicatorTimeSeriesMinArray[i] === undefined || indicatorTimeSeriesMinArray[i] === null){ + indicatorTimeSeriesMinArray[i] = indicatorFeature.properties[datePropertyName]; + } + else{ + if(indicatorFeature.properties[datePropertyName] < indicatorTimeSeriesMinArray[i]){ + indicatorTimeSeriesMinArray[i] = indicatorFeature.properties[datePropertyName]; + } + } + + // max stack + if (indicatorTimeSeriesMaxArray[i] === undefined || indicatorTimeSeriesMaxArray[i] === null){ + indicatorTimeSeriesMaxArray[i] = indicatorFeature.properties[datePropertyName]; + } + else{ + if(indicatorFeature.properties[datePropertyName] > indicatorTimeSeriesMaxArray[i]){ + indicatorTimeSeriesMaxArray[i] = indicatorFeature.properties[datePropertyName]; + } + } + } + } + } + + // finish timeSeries arrays by computing averages of all time series values + for (var i = 0; i < indicatorTimeSeriesDatesArray.length; i++) { + indicatorTimeSeriesAverageArray[i] = kommonitorDataExchangeService.getIndicatorValue_asNumber(indicatorTimeSeriesAverageArray[i] / indicatorTimeSeriesCountArray[i]); + } + + // setHistogramChartOptions(indicatorMetadataAndGeoJSON, indicatorValueArray, spatialUnitName, date); + + setLineChartOptions(indicatorMetadataAndGeoJSON, indicatorTimeSeriesDatesArray, indicatorTimeSeriesAverageArray, indicatorTimeSeriesMaxArray, indicatorTimeSeriesMinArray, spatialUnitName, date); + + setBarChartOptions(indicatorMetadataAndGeoJSON, featureNamesArray, indicatorValueBarChartArray, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue); + + setGeoMapChartOptions(indicatorMetadataAndGeoJSON, featureNamesArray, indicatorValueBarChartArray, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue); + }; + + var compareFeaturesByIndicatorValue = function (featureA, featureB) { + if (featureA.properties[self.indicatorPropertyName] < featureB.properties[self.indicatorPropertyName]) + return -1; + if (featureA.properties[self.indicatorPropertyName] > featureB.properties[self.indicatorPropertyName]) + return 1; + return 0; + }; + + var setBarChartOptions = function (indicatorMetadataAndGeoJSON, featureNamesArray, indicatorValueBarChartArray, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue) { + + // specify chart configuration item and data + var labelOption = { + normal: { + show: true, + position: 'insideBottom', + align: 'left', + verticalAlign: 'middle', + rotate: 90, + formatter: '{c}', + } + }; + + // default fontSize of echarts + var fontSize = 18; + var barChartTitel = 'Ranking - ' + spatialUnitName + ' - '; + if (indicatorMetadataAndGeoJSON.fromDate) { + barChartTitel += "Bilanz " + indicatorMetadataAndGeoJSON.fromDate + " - " + indicatorMetadataAndGeoJSON.toDate; + fontSize = 14; + } + else { + barChartTitel += date; + } + + var legendConfig = setupVisualMap(indicatorMetadataAndGeoJSON, featureNamesArray, + indicatorValueBarChartArray, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, + ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, + measureOfValue); + + var barOption = { + // grid get rid of whitespace around chart + grid: { + left: '4%', + top: 32, + right: '4%', + bottom: 32, + containLabel: true + }, + title: { + text: barChartTitel, + left: 'center', + textStyle: { + fontSize: fontSize + }, + show: false + // top: 15 + }, + tooltip: { + trigger: 'item', + confine: 'true', + formatter: function (params) { + var value = kommonitorDataExchangeService.getIndicatorValue_asFormattedText(params.value); + return "" + params.name + ": " + value + " [" + indicatorMetadataAndGeoJSON.unit + "]"; + }, + axisPointer: { + type: 'line', + crossStyle: { + color: '#999' + } + } + }, + toolbox: { + show: true, + right: '15', + feature: { + // mark : {show: true}, + dataView: { + show: kommonitorDataExchangeService.showDiagramExportButtons, readOnly: true, title: "Datenansicht", lang: ['Datenansicht - Feature-Vergleich', 'schließen', 'refresh'], optionToContent: function (opt) { + + var barData = opt.series[0].data; + var featureNames = opt.xAxis[0].data; + + var dataTableId = "barDataTable_" + Math.random(); + var tableExportName = opt.xAxis[0].name + " - " + opt.title[0].text; + + var htmlString = ''; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + + htmlString += ""; + + for (var i = 0; i < barData.length; i++) { + var value = kommonitorDataExchangeService.getIndicatorValue_asNumber(barData[i].value); + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + } + + htmlString += ""; + htmlString += "
        Feature-Name" + opt.xAxis[0].name + " [" + opt.yAxis[0].name + "]
        " + featureNames[i] + "" + value + "
        "; + + $rootScope.$broadcast("AppendExportButtonsForTable", dataTableId, tableExportName); + + return htmlString; + } + }, + restore: { show: false, title: "Erneuern" }, + saveAsImage: { show: true, title: "Export", pixelRatio: 4 } + } + }, + // legend: { + // //data:[indicatorMetadataAndGeoJSON.indicatorName] + // }, + xAxis: { + name: indicatorMetadataAndGeoJSON.indicatorName, + nameLocation: 'center', + nameGap: 15, + axisLabel: { + rotate: 90, + interval: 0, + inside: true, + show: false + }, + axisTick: { + show: false + }, + z: 6, + zlevel: 6, + data: featureNamesArray + }, + yAxis: { + type: 'value', + name: indicatorMetadataAndGeoJSON.unit, + // splitArea: { + // show: true + // } + }, + series: [{ + // name: indicatorMetadataAndGeoJSON.indicatorName, + type: 'bar', + emphasis: { + itemStyle: { + borderWidth: 4, + borderColor: defaultColorForClickedFeatures + } + }, + data: indicatorValueBarChartArray + }], + visualMap: [{ + left: 'left', + type: "piecewise", + pieces: legendConfig, + precision: 2, + show: false + }] + }; + + // if (indicatorMetadataAndGeoJSON.geoJSON.features.length > 50) { + // // barOption.xAxis.data = undefined; + // barOption.xAxis.axisLabel.show = false; + // } + + // use configuration item and data specified to show chart + self.barChartOptions = barOption; + }; + + var containsNegativeValues = function (geoJSON, date) { + + var propertyName = date; + + if(! propertyName.includes(kommonitorDataExchangeService.indicatorDatePrefix)){ + propertyName = kommonitorDataExchangeService.indicatorDatePrefix + propertyName; + } + + var containsNegativeValues = false; + for (var i = 0; i < geoJSON.features.length; i++) { + if (geoJSON.features[i].properties[propertyName] < 0) { + containsNegativeValues = true; + break; + } + } + + return containsNegativeValues; + }; + + var containsZeroValues = function (geoJSON, date) { + + var propertyName = date; + + if(! propertyName.includes(kommonitorDataExchangeService.indicatorDatePrefix)){ + propertyName = kommonitorDataExchangeService.indicatorDatePrefix + propertyName; + } + + var containsZeroValues = false; + for (var i = 0; i < geoJSON.features.length; i++) { + if (geoJSON.features[i].properties[propertyName] === 0 || geoJSON.features[i].properties[propertyName] === "0") { + containsZeroValues = true; + break; + } + } + + return containsZeroValues; + }; + + var setupVisualMap = function(indicatorMetadataAndGeoJSON, featureNamesArray, indicatorValueBarChartArray, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue){ + /* + pieces: [ + // Range of a piece can be specified by property min and max, + // where min will be set as -Infinity if ignored, + // and max will be set as Infinity if ignored. + {min: 1500}, + {min: 900, max: 1500}, + {min: 310, max: 1000}, + {min: 200, max: 300}, + // Label of the piece can be specified. + {min: 10, max: 200, label: '10 to 200 (custom label) '}, + // Color of the piece can be specified. + {value: 123, label: '123 (custom special color) ', color: 'grey'}, + {max: 5} + ] + */ + + var indicatorType = indicatorMetadataAndGeoJSON.indicatorType; + + var pieces = []; + + if(containsZeroValues(indicatorMetadataAndGeoJSON.geoJSON, date)){ + pieces.push({ + min: 0, + opacity: 0.8, + max: 0, + color: defaultColorForZeroValues + }); + } + + // if(containsOutlierValues(indicatorMetadataAndGeoJSON.geoJSON, date)){ + // pieces.push({ + // min: 0, + // opacity: 0.8, + // max: 0, + // color: defaultColorForZeroValues + // }); + // } + + if(isMeasureOfValueChecked){ + + if(gtMeasureOfValueBrew && gtMeasureOfValueBrew.breaks && gtMeasureOfValueBrew.colors){ + // measure of value brew + var gtBreaks = gtMeasureOfValueBrew.breaks; + var gtColors = gtMeasureOfValueBrew.colors; + + for (var j = 0; j < gtColors.length; j++) { + + var legendItem_gtMov = { + min: gtBreaks[j], + opacity: 0.8, + color: gtColors[j] + }; + if(gtBreaks[j + 1]){ + legendItem_gtMov.max = gtBreaks[j + 1]; + } + + pieces.push(legendItem_gtMov); + + } + } + + if(ltMeasureOfValueBrew && ltMeasureOfValueBrew.breaks && ltMeasureOfValueBrew.colors){ + var ltBreaks = ltMeasureOfValueBrew.breaks; + var ltColors = ltMeasureOfValueBrew.colors; + + for (var j = 0; j < ltColors.length; j++) { + + var legendItem_ltMov = { + min: ltBreaks[j], + opacity: 0.8, + color: ltColors[ltColors.length - 1 - j] + }; + if(ltBreaks[j + 1]){ + legendItem_ltMov.max = ltBreaks[j + 1]; + } + + pieces.push(legendItem_ltMov); + + } + } + + + + } + else if(indicatorType.includes("DYNAMIC")){ + // dynamic brew + + if(dynamicDecreaseBrew){ + var dynamicDecreaseBreaks = dynamicDecreaseBrew.breaks; + var dynamicDecreaseColors = dynamicDecreaseBrew.colors; + + for (var j = 0; j < dynamicDecreaseColors.length; j++) { + + var legendItem_dynamicDecreaseMov = { + min: dynamicDecreaseBreaks[j], + opacity: 0.8, + // color: dynamicDecreaseColors[dynamicDecreaseColors.length - 1 - j] + color: dynamicDecreaseColors[j] + }; + if(dynamicDecreaseBreaks[j + 1]){ + legendItem_dynamicDecreaseMov.max = dynamicDecreaseBreaks[j + 1]; + legendItem_dynamicDecreaseMov.label = "" + dynamicDecreaseBreaks[j] + " - < " + dynamicDecreaseBreaks[j + 1]; + + // in negative scala we must ensure that smallest value near 0 (here max) is included in range + if(j == dynamicDecreaseColors.length - 1){ + legendItem_dynamicDecreaseMov.max = -0.01; + } + } + else{ + legendItem_dynamicDecreaseMov.max = -0.01; + legendItem_dynamicDecreaseMov.label = dynamicDecreaseBreaks[j]; + } + + pieces.push(legendItem_dynamicDecreaseMov); + + } + } + + if(dynamicIncreaseBrew){ + var dynamicIncreaseBreaks = dynamicIncreaseBrew.breaks; + var dynamicIncreaseColors = dynamicIncreaseBrew.colors; + + for (var j = 0; j < dynamicIncreaseColors.length; j++) { + + var legendItem_dynamicIncreaseMov = { + min: dynamicIncreaseBreaks[j], + opacity: 0.8, + color: dynamicIncreaseColors[j] + }; + if(dynamicIncreaseBreaks[j + 1]){ + legendItem_dynamicIncreaseMov.max = dynamicIncreaseBreaks[j + 1]; + legendItem_dynamicIncreaseMov.label = "" + dynamicIncreaseBreaks[j] + " - < " + dynamicIncreaseBreaks[j + 1]; + } + else{ + legendItem_dynamicIncreaseMov.max = dynamicIncreaseBreaks[j]; + } + + pieces.push(legendItem_dynamicIncreaseMov); + + } + } + + } + else { + // default brew + + if(containsNegativeValues(indicatorMetadataAndGeoJSON.geoJSON, date)){ + // dynamic brew + if(dynamicDecreaseBrew){ + var dynamicDecreaseBreaks = dynamicDecreaseBrew.breaks; + var dynamicDecreaseColors = dynamicDecreaseBrew.colors; + + for (var j = 0; j < dynamicDecreaseColors.length; j++) { + + var legendItem_dynamicDecreaseMov = { + min: dynamicDecreaseBreaks[j], + opacity: 0.8, + // color: dynamicDecreaseColors[dynamicDecreaseColors.length - 1 - j] + color: dynamicDecreaseColors[j] + }; + if(dynamicDecreaseBreaks[j + 1]){ + legendItem_dynamicDecreaseMov.max = dynamicDecreaseBreaks[j + 1]; + legendItem_dynamicDecreaseMov.label = "" + dynamicDecreaseBreaks[j] + " - < " + dynamicDecreaseBreaks[j + 1]; + + // in negative scala we must ensure that smallest value near 0 (here max) is included in range + if(j == dynamicDecreaseColors.length - 1){ + legendItem_dynamicDecreaseMov.max = -0.01; + } + } + else{ + legendItem_dynamicDecreaseMov.max = -0.01; + legendItem_dynamicDecreaseMov.label = dynamicDecreaseBreaks[j]; + } + + pieces.push(legendItem_dynamicDecreaseMov); + + } + } + + if(dynamicIncreaseBrew){ + var dynamicIncreaseBreaks = dynamicIncreaseBrew.breaks; + var dynamicIncreaseColors = dynamicIncreaseBrew.colors; + + for (var j = 0; j < dynamicIncreaseColors.length; j++) { + + var legendItem_dynamicIncreaseMov = { + min: dynamicIncreaseBreaks[j], + opacity: 0.8, + color: dynamicIncreaseColors[j] + }; + if(dynamicIncreaseBreaks[j + 1]){ + legendItem_dynamicIncreaseMov.max = dynamicIncreaseBreaks[j + 1]; + legendItem_dynamicIncreaseMov.label = "" + dynamicIncreaseBreaks[j] + " - < " + dynamicIncreaseBreaks[j + 1]; + } + else{ + legendItem_dynamicIncreaseMov.max = dynamicIncreaseBreaks[j]; + } + + pieces.push(legendItem_dynamicIncreaseMov); + + } + } + + } + else{ + if(defaultBrew && defaultBrew.breaks && defaultBrew.colors){ + var breaks = defaultBrew.breaks; + var colors = defaultBrew.colors; + + for (var j = 0; j < colors.length; j++) { + + var legendItem_default = { + min: breaks[j], + opacity: 0.8, + max: breaks[j + 1], + color: colors[j] + }; + + pieces.push(legendItem_default); + + } + } + + } + + + } + + return pieces; + + }; + + + var setGeoMapChartOptions = function (indicatorMetadataAndGeoJSON, featureNamesArray, indicatorValueBarChartArray, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue) { + + indicatorMetadataAndGeoJSON.geoJSON.features.forEach(feature => { + feature.properties.name= feature.properties[kommonitorDataExchangeService.FEATURE_NAME_PROPERTY_NAME]; + }); + + var uniqueMapRef = 'geoMapChart'; + + echarts.registerMap(uniqueMapRef, indicatorMetadataAndGeoJSON.geoJSON); + + // specify chart configuration item and data + + var legendConfig = setupVisualMap(indicatorMetadataAndGeoJSON, featureNamesArray, indicatorValueBarChartArray, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue); + + // default fontSize of echarts + var fontSize = 18; + var geoMapChartTitel = indicatorMetadataAndGeoJSON.indicatorName + ' - ' + spatialUnitName + ' - ' + date; + + var seriesData = []; + + for (let index = 0; index < featureNamesArray.length; index++) { + var featureName = featureNamesArray[index]; + + /* + var seriesItem = { + value: indicatorValue, + itemStyle: { + color: color + // borderWidth: 1, + // borderColor: 'black' + } + }; + */ + var featureValue = indicatorValueBarChartArray[index].value; + + seriesData.push({ + name: featureName, + value: featureValue + }); + } + + // needed for reporting + for(let feature of indicatorMetadataAndGeoJSON.geoJSON.features) { + bbox = turf.bbox(feature); // calculate bbox for each feature + feature.properties.bbox = bbox; + } + var bbox = calculateOverallBoundingBoxFromGeoJSON(indicatorMetadataAndGeoJSON.geoJSON.features) + // change format of bbox to match the format needed for echarts + bbox = [ + [bbox[0], bbox[3]], // north-west lon lat + [bbox[2], bbox[1]] // south-east lon lat + ] + + var geoMapOption = { + // grid get rid of whitespace around chart + // grid: { + // left: '4%', + // top: 32, + // right: '4%', + // bottom: 32, + // containLabel: true + // }, + title: { + text: geoMapChartTitel, + left: 'center', + textStyle: { + fontSize: fontSize + }, + show: true + // top: 15 + }, + tooltip: { + trigger: 'item', + confine: 'true', + showDelay: 0, + transitionDuration: 0.2, + formatter: function (params) { + var value = kommonitorDataExchangeService.getIndicatorValue_asFormattedText(params.value); + return "" + params.name + ": " + value + " [" + indicatorMetadataAndGeoJSON.unit + "]"; + } + }, + toolbox: { + show: true, + right: '15', + feature: { + // mark : {show: true}, + dataView: { + show: kommonitorDataExchangeService.showDiagramExportButtons, readOnly: true, title: "Datenansicht", lang: ['Datenansicht - Geo Map Chart', 'schließen', 'refresh'], optionToContent: function (opt) { + + var dataTableId = "geoMapDataTable_" + Math.random(); + var tableExportName = indicatorMetadataAndGeoJSON.indicatorName + " - " + opt.title[0].text; + + var htmlString = ''; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + + htmlString += ""; + + for (var i = 0; i < seriesData.length; i++) { + var value = kommonitorDataExchangeService.getIndicatorValue_asNumber(seriesData[i].value); + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + } + + htmlString += ""; + htmlString += "
        Feature-Name" + indicatorMetadataAndGeoJSON.indicatorName + " [" + indicatorMetadataAndGeoJSON.indicatorName + "]
        " + seriesData[i].name + "" + value + "
        "; + + $rootScope.$broadcast("AppendExportButtonsForTable", dataTableId, tableExportName); + + return htmlString; + } + }, + restore: { show: false, title: "Erneuern" }, + saveAsImage: { show: true, title: "Export", pixelRatio: 4 } + } + }, + // legend: { + // //data:[indicatorMetadataAndGeoJSON.indicatorName] + // }, + visualMap: { + left: 'left', + type: "piecewise", + pieces: legendConfig, + // selectedMode: 'multiple', + precision: 2, + show: true + }, + series: [{ + name: indicatorMetadataAndGeoJSON.indicatorName, + type: 'map', + roam: true, + boundingCoords: bbox, + map: uniqueMapRef, + emphasis: { + label: { + show: true + } + }, + data: seriesData + }] + }; + + // use configuration item and data specified to show chart + self.geoMapChartOptions = geoMapOption; + }; + + + var setLineChartOptions = function (indicatorMetadataAndGeoJSON, indicatorTimeSeriesDatesArray, indicatorTimeSeriesAverageArray, indicatorTimeSeriesMaxArray, indicatorTimeSeriesMinArray, spatialUnitName, date) { + + var lineOption = { + // grid get rid of whitespace around chart + grid: { + left: '4%', + top: 32, + right: '4%', + bottom: 55, + containLabel: true + }, + title: { + text: 'Zeitreihe - ' + spatialUnitName, + left: 'center', + show: false, + textStyle: { + fontSize: 18 + }, + // top: 15 + }, + tooltip: { + trigger: 'axis', + confine: 'true', + formatter: function (params) { + + var string = "" + params[0].axisValueLabel + "
        "; + + params.forEach(function (paramObj) { + + if(! paramObj.seriesName.includes("Stack")){ + var value = kommonitorDataExchangeService.getIndicatorValue_asFormattedText(paramObj.value); + string += paramObj.seriesName + ": " + value + " [" + indicatorMetadataAndGeoJSON.unit + "]" + "
        "; + } + }); + + return string; + }, + axisPointer: { + type: 'line', + crossStyle: { + color: '#999' + } + } + }, + toolbox: { + show: true, + right: '15', + feature: { + // mark : {show: true}, + dataView: { + show: kommonitorDataExchangeService.showDiagramExportButtons, readOnly: true, title: "Datenansicht", lang: ['Datenansicht - Zeitreihe', 'schließen', 'refresh'], optionToContent: function (opt) { + + // + // + // + // + // + // + // + // + // + // + // + // + // + //
        Indikator-NameBeschreibung der Verknüpfung
        {{indicator.referencedIndicatorName}}{{indicator.referencedIndicatorDescription}}
        + + var lineSeries = opt.series; + var timestamps = opt.xAxis[0].data; + + var dataTableId = "lineDataTable_" + Math.random(); + var tableExportName = opt.xAxis[0].name + " - " + opt.title[0].text; + + var htmlString = ''; + htmlString += ""; + htmlString += ""; + htmlString += ""; + + for (var i = 0; i < lineSeries.length; i++) { + htmlString += ""; + } + + htmlString += ""; + htmlString += ""; + + htmlString += ""; + + for (var j = 0; j < timestamps.length; j++) { + htmlString += ""; + htmlString += ""; + for (var k = 0; k < lineSeries.length; k++) { + var value = kommonitorDataExchangeService.getIndicatorValue_asNumber(lineSeries[k].data[j]); + htmlString += ""; + } + htmlString += ""; + } + + htmlString += ""; + htmlString += "
        Zeitpunkt" + lineSeries[i].name + " [" + opt.yAxis[0].name + "]
        " + timestamps[j] + "" + value + "
        "; + + $rootScope.$broadcast("AppendExportButtonsForTable", dataTableId, tableExportName); + + return htmlString; + } + }, + restore: { show: false, title: "Erneuern" }, + saveAsImage: { show: true, title: "Export", pixelRatio: 4 } + } + }, + legend: { + type: "scroll", + bottom: 0, + data: ['Arithmetisches Mittel'] + }, + xAxis: { + name: indicatorMetadataAndGeoJSON.indicatorName, + nameLocation: 'center', + nameGap: 22, + // axisLabel: { + // rotate: 90, + // interval: 0, + // inside: true + // }, + // z: 6, + // zlevel: 6, + type: 'category', + axisTick: { + show: false + }, + data: indicatorTimeSeriesDatesArray + }, + yAxis: { + type: 'value', + name: indicatorMetadataAndGeoJSON.unit, + // splitArea: { + // show: true + // } + }, + series: [ + { + name: "Arithmetisches Mittel", + type: 'line', + data: indicatorTimeSeriesAverageArray, + lineStyle: { + normal: { + color: 'gray', + width: 2, + type: 'dashed' + } + }, + itemStyle: { + normal: { + borderWidth: 3, + color: 'gray' + } + } + }] + }; + + // SETTING FOR MIN AND MAX STACK + + // default for min value of 0 + var minStack = { + name: "MinStack", + type: 'line', + data: indicatorTimeSeriesMinArray, + stack: "MinMax", + // areaStyle:{ + // color: "#d6d6d6" + // }, + lineStyle: { + opacity: 0 + }, + itemStyle: { + opacity: 0 + }, + silent: true + }; + + var minLine = { + name: "Min", + type: 'line', + data: indicatorTimeSeriesMinArray, + lineStyle: { + opacity: 0, + color: "#d6d6d6" + }, + itemStyle: { + opacity: 0 + } + }; + + var maxStack = { + name: "MaxStack", + type: 'line', + data: indicatorTimeSeriesMaxArray, + stack: "MinMax", + areaStyle:{ + color: "#d6d6d6" + }, + lineStyle: { + opacity: 0 + }, + itemStyle: { + opacity: 0 + }, + silent: true + }; + + var maxLine = { + name: "Max", + type: 'line', + data: indicatorTimeSeriesMaxArray, + lineStyle: { + opacity: 0, + color: "#d6d6d6" + }, + itemStyle: { + opacity: 0 + } + }; + + // perform checks if there are negative values or only > 0 values + // then stacks must be adjusted to be correctly displayed + var minStack_minValue = Math.min(...indicatorTimeSeriesMinArray); + if(minStack_minValue < 0){ + minStack.areaStyle = { + color: "#d6d6d6" + }; + } + + let indicatorTimeSeriesMaxArray_copy = JSON.parse(JSON.stringify(indicatorTimeSeriesMaxArray)); + + if ((indicatorTimeSeriesMinArray.filter(item => item > 0))){ + for (let index = 0; index < indicatorTimeSeriesMaxArray_copy.length; index++) { + + if(indicatorTimeSeriesMinArray[index] > 0){ + indicatorTimeSeriesMaxArray_copy[index] = indicatorTimeSeriesMaxArray_copy[index] - indicatorTimeSeriesMinArray[index]; + } + } + maxStack.data = indicatorTimeSeriesMaxArray_copy; + } + + lineOption.series.push(minLine); + lineOption.series.push(maxLine); + lineOption.series.push(minStack); + lineOption.series.push(maxStack); + + + // use configuration item and data specified to show chart + self.lineChartOptions = lineOption; + }; + + + var setHistogramChartOptions = function (indicatorMetadataAndGeoJSON, indicatorValueArray, spatialUnitName, date) { + var bins; + try { + bins = ecStat.histogram(indicatorValueArray); + } + catch (error) { + console.log("Histogram chart cannot be drawn - error in bins creation"); + // kommonitorDataExchangeService.displayMapApplicationError(error); + } + + // default fontSize of echarts title + var fontSize = 18; + var histogramChartTitel = 'Histogramm - ' + spatialUnitName + ' - '; + if (indicatorMetadataAndGeoJSON.fromDate) { + histogramChartTitel += "Bilanz " + indicatorMetadataAndGeoJSON.fromDate + " - " + indicatorMetadataAndGeoJSON.toDate; + fontSize = 14; + } + else { + histogramChartTitel += date; + } + + var histogramOption = { + // grid get rid of whitespace around chart + grid: { + left: '4%', + top: 32, + right: '4%', + bottom: 35, + containLabel: true + }, + title: { + text: histogramChartTitel, + left: 'center', + textStyle: { + fontSize: fontSize + }, + show: false + // top: 15 + }, + tooltip: { + trigger: 'item', + confine: 'true', + axisPointer: { + type: 'line', + crossStyle: { + color: '#999' + } + } + }, + toolbox: { + show: true, + right: '15', + feature: { + // mark : {show: true}, + dataView: { + show: kommonitorDataExchangeService.showDiagramExportButtons, readOnly: true, title: "Datenansicht", lang: ['Datenansicht - Histogramm', 'schließen', 'refresh'], optionToContent: function (opt) { + + // + // + // + // + // + // + // + // + // + // + // + // + // + //
        Indikator-NameBeschreibung der Verknüpfung
        {{indicator.referencedIndicatorName}}{{indicator.referencedIndicatorDescription}}
        + + var histogramData = opt.series[0].data; + + var dataTableId = "histogramDataTable_" + Math.random(); + var tableExportName = opt.xAxis[0].name + " - " + opt.title[0].text; + + var htmlString = ''; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + + htmlString += ""; + + for (var i = 0; i < histogramData.length; i++) { + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + } + + htmlString += ""; + htmlString += "
        WertintervallHäufigkeit
        " + histogramData[i][0] + " — " + histogramData[i][1] + "" + histogramData[i][2] + "
        "; + + $rootScope.$broadcast("AppendExportButtonsForTable", dataTableId, tableExportName); + + return htmlString; + } + }, + restore: { show: false, title: "Erneuern" }, + saveAsImage: { show: true, title: "Export", pixelRatio: 4 } + } + }, + xAxis: [{ + name: indicatorMetadataAndGeoJSON.indicatorName, + nameLocation: 'center', + nameGap: 22, + scale: true, + }], + yAxis: { + name: 'Anzahl Features', + // nameGap: 35, + // nameLocation: 'center', + // nameRotate: 90, + }, + series: [{ + type: 'custom', + name: indicatorMetadataAndGeoJSON.indicatorName, + renderItem: function (params, api) { + var yValue = api.value(2); + var start = api.coord([api.value(0), yValue]); + var size = api.size([api.value(1) - api.value(0), yValue]); + return { + type: 'rect', + shape: { + x: start[0], + y: start[1], + width: size[0] * 0.99, + height: size[1] + }, + style: api.style() + }; + }, + itemStyle: { + color: '#337ab7' + }, + // label: { + // normal: { + // show: true, + // position: 'insideTop' + // } + // }, + dimensions: ['untere Intervallgrenze', 'obere Intervallgrenze', 'Anzahl'], + encode: { + x: [0, 1], + y: 2, + tooltip: [0, 1, 2] + }, + data: bins ? bins.customData : undefined + }] + }; + + // var option = { + // title: { + // text: 'Histogram Chart', + // left: 'center', + // top: 20 + // }, + // tooltip: { + // trigger: 'axis', + // axisPointer: { + // type: 'line', + // crossStyle: { + // color: '#999' + // } + // } + // }, + // color: ['rgb(25, 183, 207)'], + // grid: { + // left: '3%', + // right: '3%', + // bottom: '3%', + // containLabel: true + // }, + // xAxis: [{ + // type: 'value', + // name: 'Wertintervalle', + // nameLocation: 'center', + // nameGap: 15, + // scale: true, + // }], + // yAxis: { + // type: 'value', + // name: 'Anzahl Features', + // nameGap: 22, + // nameLocation: 'center', + // nameRotate: 90, + // }, + // series: [{ + // name: 'Anzahl', + // type: 'bar', + // barWidth: '99,3%', + // // label: { + // // normal: { + // // show: true, + // // position: 'insideTop', + // // formatter: function (params) { + // // return params.value[1]; + // // } + // // } + // // }, + // data: bins.data + // }] + // }; + + if (onlyContainsPositiveNumbers(indicatorValueArray)) { + histogramOption.xAxis.min = 0; + } + + self.histogramChartOptions = histogramOption; + }; + + var onlyContainsPositiveNumbers = function (indicatorValueArray) { + indicatorValueArray.forEach(function (element) { + if (element < 0) { + return false; + } + }); + + return true; + }; + + + var appendSeriesToLineChart = function (featureProperties) { + + // in case of activated balance mode, we must use the properties of kommonitorDataExchangeService.selectedIndicator, to aquire the correct time series item! + if (kommonitorDataExchangeService.isBalanceChecked) { + featureProperties = findPropertiesForTimeSeries(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); + } + + // append feature name to legend + $scope.lineOption.legend.data.push(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); + + // create feature data series + var featureSeries = {}; + featureSeries.name = featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]; + featureSeries.type = 'line'; + featureSeries.data = new Array(); + + // for each date create series data entry for feature + for (var date of $scope.lineOption.xAxis.data) { + var value; + if (kommonitorDataExchangeService.indicatorValueIsNoData(featureProperties[INDICATOR_DATE_PREFIX + date])) { + value = null; + } + else { + value = kommonitorDataExchangeService.getIndicatorValue_asNumber(featureProperties[INDICATOR_DATE_PREFIX + date]); + } + featureSeries.data.push(value); + } + + $scope.lineOption.series.push(featureSeries); + + $scope.lineChart.setOption($scope.lineOption); + setTimeout(function () { + $scope.lineChart.resize(); + }, 350); + }; + + var findPropertiesForTimeSeries = function (spatialUnitFeatureName) { + for (var feature of kommonitorDataExchangeService.selectedIndicator.geoJSON.features) { + if (feature.properties[__env.FEATURE_NAME_PROPERTY_NAME] == spatialUnitFeatureName) { + return feature.properties; + } + } + } + + var getSeriesIndexByFeatureName = function (featureName) { + for (var index = 0; index < $scope.lineOption.series.length; index++) { + if ($scope.lineOption.series[index].name === featureName) + return index; + } + + //return -1 if none was found + return -1; + }; + + var removeSeriesFromLineChart = function (featureProperties) { + // remove feature from legend + var legendIndex = $scope.lineOption.legend.data.indexOf(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); + if (legendIndex > -1) { + $scope.lineOption.legend.data.splice(legendIndex, 1); + } + + // remove feature data series + var seriesIndex = getSeriesIndexByFeatureName(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); + if (seriesIndex > -1) { + $scope.lineOption.series.splice(seriesIndex, 1); + } + + // second parameter tells echarts to not merge options with previous data. hence really remove series from graphic + $scope.lineChart.setOption($scope.lineOption, true); + setTimeout(function () { + $scope.lineChart.resize(); + }, 350); + }; + + this.makeFeatureNameForPoiInIsochroneDiagram = function(poiGeoresource, geoJSONFeatureCollection, date){ + return poiGeoresource.datasetName + " - " + date + " (" + geoJSONFeatureCollection.features.length + ")"; + }; + + this.createInitialReachabilityAnalysisPieOptions = function(poiGeoresource, geoJSONFeatureCollection, rangeValue, date){ + var option = { + grid: { + left: '4%', + top: 0, + right: '4%', + bottom: 30, + containLabel: true + }, + title: { + text: 'Analyse Einzugsgebiet ' + rangeValue, + left: 'center', + show: false + // top: 15 + }, + toolbox: { + show: true, + right: '15', + feature: { + // mark : {show: true}, + dataView: { + show: kommonitorDataExchangeService.showDiagramExportButtons, readOnly: true, title: "Datenansicht", lang: ['Datenansicht - Punkte im Einzugsgebiet ' + rangeValue, 'schließen', 'refresh'], optionToContent: function (opt) { + + var poiData = opt.series[0].data; + + var dataTableId = "poiInIsochroneTable_" + Math.random(); + var tableExportName = opt.title[0].text; + + var htmlString = ''; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + + htmlString += ""; + + for (var i = 0; i < poiData.length; i++) { + htmlString += ""; + htmlString += ""; + htmlString += ""; + htmlString += ""; + } + + htmlString += ""; + htmlString += "
        PunktlayerAnzahl Punkte im Einzugsgebiet
        " + poiData[i].name + "" + poiData[i].value + "
        "; + + $rootScope.$broadcast("AppendExportButtonsForTable", dataTableId, tableExportName); + + return htmlString; + } + }, + restore: { show: false, title: "Erneuern" }, + saveAsImage: { show: true, title: "Export", pixelRatio: 4 } + } + }, + tooltip: { + trigger: 'item', + formatter: '{a}
        {b}: {c} ({d}%)', + confine: true + }, + legend: { + orient: 'vertical', + type: "scroll", + left: 0, + data: [this.makeFeatureNameForPoiInIsochroneDiagram(poiGeoresource, geoJSONFeatureCollection, date)] + // data: [legendText] + }, + series: [ + { + name: "Punkte im Einzugsgebiet " + rangeValue, + type: 'pie', + radius: ['50%', '70%'], + center: ["70%", "50%"], + avoidLabelOverlap: true, + label: { + show: false, + position: 'center' + }, + + emphasis: { + label: { + show: true, + fontSize: '10', + // fontWeight: 'bold' + } + }, + labelLine: { + show: true + }, + data: [ + {value: geoJSONFeatureCollection.features.length, name: this.makeFeatureNameForPoiInIsochroneDiagram(poiGeoresource, geoJSONFeatureCollection, date)} + ] + } + ] + }; + + return option; + }; + + this.appendToReachabilityAnalysisOptions = function(poiGeoresource, geoJSONFeatureCollection, eChartsOptions, date){ + eChartsOptions.legend[0].data.push(this.makeFeatureNameForPoiInIsochroneDiagram(poiGeoresource, geoJSONFeatureCollection, date)); + eChartsOptions.series[0].data.push({value: geoJSONFeatureCollection.features.length, name: this.makeFeatureNameForPoiInIsochroneDiagram(poiGeoresource, geoJSONFeatureCollection, date)}); + + return eChartsOptions; + }; + + this.removePoiFromReachabilityAnalysisOption = function(eChartOptions, poiGeoresource){ + for (let index = 0; index < eChartOptions.legend[0].data.length; index++) { + const legendItem = eChartOptions.legend[0].data[index]; + if(legendItem.includes(poiGeoresource.datasetName)){ + eChartOptions.legend[0].data.splice(index, 1); + } + } + + for (let index2 = 0; index2 < eChartOptions.series[0].data.length; index2++) { + const dataItem = eChartOptions.series[0].data[index2]; + if(dataItem.name.includes(poiGeoresource.datasetName)){ + eChartOptions.series[0].data.splice(index2, 1); + } + } + + return eChartOptions; + }; + + this.makeTrendChartOptions_forAllFeatures = function(indicatorMetadataAndGeoJSON, fromDateAsPropertyString, toDateAsPropertyString, showMinMax, showCompleteTimeseries, computationType){ + // we may base on the the precomputed timeseries lineOptions and modify that from a cloned instance + + var timeseriesOptions = JSON.parse(JSON.stringify(this.getLineChartOptions())); + + // remove any additional lines for concrete features + timeseriesOptions.series.length = 3; + + // add markedAreas for periods out of scope + + var fromDateString = fromDateAsPropertyString.split(__env.indicatorDatePrefix)[1]; + var fromDate_date = new Date(fromDateString); + var toDateString = toDateAsPropertyString.split(__env.indicatorDatePrefix)[1]; + var toDate_date = new Date(toDateString); + + if(showCompleteTimeseries){ + timeseriesOptions.series[0].markArea = { + silent: true, + itemStyle: { + color: '#b50b0b', + opacity: 0.3 + }, + data: [[{ + xAxis: indicatorMetadataAndGeoJSON.applicableDates[0] + }, { + xAxis: fromDateString + }], + [{ + xAxis: toDateString + }, { + xAxis: indicatorMetadataAndGeoJSON.applicableDates[indicatorMetadataAndGeoJSON.applicableDates.length - 1] + }]] + }; + } + + // hide data points + timeseriesOptions.series[0].itemStyle.normal.opacity = 0; + timeseriesOptions.series[0].lineStyle.normal.width = 3; + timeseriesOptions.series[0].lineStyle.normal.type = "solid"; + + var trendData = []; + + var timeseriesData = timeseriesOptions.series[0].data; + var minSeriesData = timeseriesOptions.series[1].data; + var maxSeriesData = timeseriesOptions.series[2].data; + + if(! showCompleteTimeseries){ + var xData = []; + var timeData = []; + var minData = []; + var maxData = []; + for (let index = 0; index < timeseriesData.length; index++) { + var date_candidate = new Date(indicatorMetadataAndGeoJSON.applicableDates[index]); + if(date_candidate >= fromDate_date && date_candidate <= toDate_date){ + const value = timeseriesData[index]; + // const date = indicatorMetadataAndGeoJSON.applicableDates[index]; + + timeData.push(value); + xData.push(indicatorMetadataAndGeoJSON.applicableDates[index]); + minData.push(minSeriesData[index]); + maxData.push(maxSeriesData[index]); + } + } + + timeseriesOptions.series[0].data = timeData; + timeseriesOptions.series[1].data = minData; + timeseriesOptions.series[2].data = maxData; + + timeseriesOptions.xAxis.data = xData; + } + + // update value if it has changed + timeseriesData = timeseriesOptions.series[0].data; + var xAxisData = timeseriesOptions.xAxis.data; + for (let index = 0; index < timeseriesData.length; index++) { + var dateCandidate = new Date(xAxisData[index]); + if(dateCandidate >= fromDate_date && dateCandidate <= toDate_date){ + const value = timeseriesData[index]; + // const date = indicatorMetadataAndGeoJSON.applicableDates[index]; + + trendData.push([index, value]); + } + } + + // add regression line according to option + + var trendLine; + if (computationType.includes("linear")){ + trendLine = ecStat.regression('linear', trendData); + } + else if (computationType.includes("exponential")){ + trendLine = ecStat.regression('exponential', trendData); + } + else if (computationType.includes("polynomial_3")){ + trendLine = ecStat.regression('polynomial', trendData, 3); + } + else{ + trendLine = ecStat.regression('linear', trendData); + } + + timeseriesOptions.legend.data.push("Trendlinie"); + + timeseriesOptions.series.push({ + name: 'Trendlinie', + type: 'line', + showSymbol: false, + data: trendLine.points, + lineStyle: { + normal: { + color: 'red', + width: 4, + type: 'dashed' + } + }, + itemStyle: { + normal: { + borderWidth: 3, + color: 'red', + opacity: 0 + } + }, + markPoint: { + itemStyle: { + normal: { + color: 'transparent' + } + }, + // label: { + // normal: { + // show: true, + // position: 'left', + // formatter: trendLine.expression, + // textStyle: { + // color: '#333', + // fontSize: 14 + // } + // } + // }, + data: [{ + coord: trendLine.points[trendLine.points.length - 1] + }] + } + }); + + if(! showMinMax){ + timeseriesOptions.series.splice(1, 1); + timeseriesOptions.series.splice(1, 1); + } + + return timeseriesOptions; + }; + + // Returns an image. + // Attribution has to be converted to an image anyway for report generation. + this.createReportingReachabilityMapAttribution = async function() { + let attributionText = "Leaflet | Map data @ OpenStreetMap contributors" + let canvas = document.createElement("canvas") + canvas.width = 800; + let ctx = canvas.getContext('2d') + ctx.font = "8pt Arial"; + ctx.textBaseline = 'top'; + ctx.fillStyle = "rgb(60, 60, 60)"; + ctx.fillText(attributionText, 0, 0); + canvas = trimCanvas(canvas, 5) + + let image = new Image(canvas.width, canvas.height) + image.style.backgroundColor = "white"; + return await new Promise( (resolve, reject) => { + image.onload = function() { + resolve(image); + } + image.src = canvas.toDataURL(); + }); + } + + // Returns an image. + // Legend has to be converted to an image anyway for report generation. + this.createReportingReachabilityMapLegend = async function(echartsOptions, selectedSpatialUnit, isochronesRangeType, isochronesRangeUnits) { + let legendEntries = []; + let isochronesHeadingAdded = false; + for(let i=0; i { + return entry.isIsochroneEntry + }); + // layer isochrone icons on top of each other unitl we reach the current one + for(let isochroneEntry of isochroneEntries.reverse()) { + if(isochroneEntry === entry) { + break; + } + ctx.fillStyle = isochroneEntry.iconColor; + ctx.globalAlpha = isochroneEntry.iconOpacity; + ctx.fillRect(xPos, yPos + ( (12-entry.iconHeight) / 2), iconWidth, isochroneEntry.iconHeight) + ctx.globalAlpha = 1; + } + } + + ctx.fillStyle = entry.iconColor; + ctx.globalAlpha = entry.iconOpacity ? entry.iconOpacity : 1; + ctx.fillRect(xPos, yPos + ( (12-entry.iconHeight) / 2), iconWidth, entry.iconHeight) + ctx.globalAlpha = 1; + // and label + ctx.font = fontStyle; + ctx.fillStyle = "black"; + ctx.textBaseline = "top"; + if(entry.isIsochroneEntry) { + let text = entry.label + " " + isochronesRangeUnits + ctx.fillText(text, xPos + iconWidth + 5, yPos) + } else { + ctx.fillText(entry.label, xPos + iconWidth + 5, yPos) + } + yPos += rowHeight + } + } + + canvas = trimCanvas(canvas, 5) + let image = new Image(canvas.width, canvas.height) + image.style.backgroundColor = "white"; + return await new Promise( (resolve, reject) => { + image.onload = function() { + resolve(image); + } + image.src = canvas.toDataURL(); + }); + } + + var calculateOverallBoundingBoxFromGeoJSON = function(features) { + let result = []; + for(var i=0; i result[2]) ? bbox[2] : result[2]; + result[3] = (bbox[3] > result[3]) ? bbox[3] : result[3]; + } + } + return result; + }; + + function trimCanvas(canvas, padding=0) { + function rowBlank(imageData, width, y) { + for (var x = 0; x < width; ++x) { + if (imageData.data[y * width * 4 + x * 4 + 3] !== 0) return false; + } + return true; + } + + function columnBlank(imageData, width, x, top, bottom) { + for (var y = top; y < bottom; ++y) { + if (imageData.data[y * width * 4 + x * 4 + 3] !== 0) return false; + } + return true; + } + + + var ctx = canvas.getContext("2d"); + var width = canvas.width; + var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height); + var top = 0, bottom = imageData.height, left = 0, right = imageData.width; + + while (top < bottom && rowBlank(imageData, width, top)) ++top; + while (bottom - 1 > top && rowBlank(imageData, width, bottom - 1)) --bottom; + while (left < right && columnBlank(imageData, width, left, top, bottom)) ++left; + while (right - 1 > left && columnBlank(imageData, width, right - 1, top, bottom)) --right; + + var trimmed = ctx.getImageData(left, top, right - left, bottom - top); + var copy = canvas.ownerDocument.createElement("canvas"); + var copyCtx = copy.getContext("2d"); + copy.width = trimmed.width + padding*2; + copy.height = trimmed.height + padding*2; + copyCtx.putImageData(trimmed, padding, padding); + + return copy; + }; + + }]); diff --git a/app/util/genericServices/kommonitorElementVisibilityHelperService/kommonitor-element-visibility-helper-service.module.js b/app/util/genericServices/kommonitorElementVisibilityHelperService/kommonitor-element-visibility-helper-service.module.js index d2604eb61..2c7bcdca5 100644 --- a/app/util/genericServices/kommonitorElementVisibilityHelperService/kommonitor-element-visibility-helper-service.module.js +++ b/app/util/genericServices/kommonitorElementVisibilityHelperService/kommonitor-element-visibility-helper-service.module.js @@ -1,5 +1,5 @@ +"use strict"; angular.module('kommonitorElementVisibilityHelper', ['kommonitorDataExchange', 'kommonitorKeycloakHelper']); - /** * a common serviceInstance that holds all needed properties for a WPS service. * @@ -10,111 +10,89 @@ angular.module('kommonitorElementVisibilityHelper', ['kommonitorDataExchange', ' * parameters for each WPS operation represented by different Angular components */ angular - .module('kommonitorElementVisibilityHelper', []) - .service( - 'kommonitorElementVisibilityHelperService', ['$rootScope', '$timeout', '$http', '$httpParamSerializerJQLike', '__env', + .module('kommonitorElementVisibilityHelper', []) + .service('kommonitorElementVisibilityHelperService', ['$rootScope', '$timeout', '$http', '$httpParamSerializerJQLike', '__env', 'ControlsConfigService', 'Auth', 'kommonitorDataExchangeService', 'kommonitorKeycloakHelperService', - function ($rootScope, $timeout, - $http, $httpParamSerializerJQLike, __env, ControlsConfigService, Auth, kommonitorDataExchangeService, kommonitorKeycloakHelperService) { - - var self = this; - this.elementVisibility = {}; - - this.isAdvancedMode = __env.isAdvancedMode; - this.showAdvancedModeSwitch = __env.showAdvancedModeSwitch; - - this.advancedModeRoleName = "fakeAdvancedModeRole"; - - this.initElementVisibility = function () { - kommonitorDataExchangeService.showDiagramExportButtons = true; - kommonitorDataExchangeService.showGeoresourceExportButtons = true; - + function ($rootScope, $timeout, $http, $httpParamSerializerJQLike, __env, ControlsConfigService, Auth, kommonitorDataExchangeService, kommonitorKeycloakHelperService) { + var self = this; this.elementVisibility = {}; - var config = ControlsConfigService.getControlsConfig(); - config.forEach(element => { - self.elementVisibility[element.id] = checkElementVisibility(element.id); - }); - - $timeout(function(){ - $rootScope.$apply(); - - }); - - - }; - - this.onChangeIsAdvancedMode = function (){ - - this.initElementVisibility(); - - // if any sidebar was previously not displayed we must ensure that it is properly instantiated for current indicator - $rootScope.$broadcast("changeIndicatorDate"); - }; - - var checkElementVisibility = function(id) { - - var element = ControlsConfigService.getControlsConfig().filter(element => element.id === id)[0]; - - if(element.roles === undefined || element.roles.length === 0) { - return true; - } - else if(self.isAdvancedMode && element.roles && element.roles.includes(self.advancedModeRoleName)){ - return true; - } - else if(Auth.keycloak.authenticated) { - // admin role user always sees all data and widgets - if(Auth.keycloak.showAdminView){ - return true; - } - var hasAllowedRole = false; - for (var i = 0; i < element.roles.length; i++) { - if(Auth.keycloak.tokenParsed.realm_access.roles.includes(element.roles[i])){ - return true; - } - } - - // special case for diagram export buttons - if(! hasAllowedRole && element.id === "diagramExportButtons"){ - kommonitorDataExchangeService.showDiagramExportButtons = false; - } - // special case for georesource export buttons - if(! hasAllowedRole && element.id === "georesourceExportButtons"){ - kommonitorDataExchangeService.showGeoresourceExportButtons = false; - } - - return hasAllowedRole; - } else { - if(! kommonitorDataExchangeService.enableKeycloakSecurity){ - if(element.roles && element.roles.includes(self.advancedModeRoleName)){ - - // special case for diagram export buttons - if(element.id === "diagramExportButtons"){ - kommonitorDataExchangeService.showDiagramExportButtons = false; - } - // special case for georesource export buttons - if(element.id === "georesourceExportButtons"){ - kommonitorDataExchangeService.showGeoresourceExportButtons = false; - } - - return false; + this.isAdvancedMode = __env.isAdvancedMode; + this.showAdvancedModeSwitch = __env.showAdvancedModeSwitch; + this.advancedModeRoleName = "fakeAdvancedModeRole"; + this.initElementVisibility = function () { + kommonitorDataExchangeService.showDiagramExportButtons = true; + kommonitorDataExchangeService.showGeoresourceExportButtons = true; + this.elementVisibility = {}; + var config = ControlsConfigService.getControlsConfig(); + config.forEach(element => { + self.elementVisibility[element.id] = checkElementVisibility(element.id); + }); + $timeout(function () { + $rootScope.$apply(); + }); + }; + this.onChangeIsAdvancedMode = function () { + this.initElementVisibility(); + // if any sidebar was previously not displayed we must ensure that it is properly instantiated for current indicator + $rootScope.$broadcast("changeIndicatorDate"); + }; + var checkElementVisibility = function (id) { + var element = ControlsConfigService.getControlsConfig().filter(element => element.id === id)[0]; + if (element.roles === undefined || element.roles.length === 0) { + return true; + } + else if (self.isAdvancedMode && element.roles && element.roles.includes(self.advancedModeRoleName)) { + return true; } - return true; - } - else{ - // special case for diagram export buttons - if(element.id === "diagramExportButtons"){ - kommonitorDataExchangeService.showDiagramExportButtons = false; + else if (Auth.keycloak.authenticated) { + // admin role user always sees all data and widgets + if (Auth.keycloak.showAdminView) { + return true; + } + var hasAllowedRole = false; + for (var i = 0; i < element.roles.length; i++) { + if (Auth.keycloak.tokenParsed.realm_access.roles.includes(element.roles[i])) { + return true; + } + } + // special case for diagram export buttons + if (!hasAllowedRole && element.id === "diagramExportButtons") { + kommonitorDataExchangeService.showDiagramExportButtons = false; + } + // special case for georesource export buttons + if (!hasAllowedRole && element.id === "georesourceExportButtons") { + kommonitorDataExchangeService.showGeoresourceExportButtons = false; + } + return hasAllowedRole; } - // special case for georesource export buttons - if(element.id === "georesourceExportButtons"){ - kommonitorDataExchangeService.showGeoresourceExportButtons = false; + else { + if (!kommonitorDataExchangeService.enableKeycloakSecurity) { + if (element.roles && element.roles.includes(self.advancedModeRoleName)) { + // special case for diagram export buttons + if (element.id === "diagramExportButtons") { + kommonitorDataExchangeService.showDiagramExportButtons = false; + } + // special case for georesource export buttons + if (element.id === "georesourceExportButtons") { + kommonitorDataExchangeService.showGeoresourceExportButtons = false; + } + return false; + } + return true; + } + else { + // special case for diagram export buttons + if (element.id === "diagramExportButtons") { + kommonitorDataExchangeService.showDiagramExportButtons = false; + } + // special case for georesource export buttons + if (element.id === "georesourceExportButtons") { + kommonitorDataExchangeService.showGeoresourceExportButtons = false; + } + return false; + } } - - return false; - } - } - }; - - this.initElementVisibility(); - + }; + this.initElementVisibility(); }]); +//# sourceMappingURL=kommonitor-element-visibility-helper-service.module.js.map \ No newline at end of file diff --git a/app/util/genericServices/kommonitorElementVisibilityHelperService/kommonitor-element-visibility-helper-service.module.js.map b/app/util/genericServices/kommonitorElementVisibilityHelperService/kommonitor-element-visibility-helper-service.module.js.map new file mode 100644 index 000000000..503e17636 --- /dev/null +++ b/app/util/genericServices/kommonitorElementVisibilityHelperService/kommonitor-element-visibility-helper-service.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-element-visibility-helper-service.module.js","sourceRoot":"","sources":["kommonitor-element-visibility-helper-service.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,mCAAmC,EAAE,CAAC,wBAAwB,EAAE,0BAA0B,CAAC,CAAC,CAAC;AAE5G;;;;;;;;GAQG;AACH,OAAO;KACJ,MAAM,CAAC,mCAAmC,EAAE,EAAE,CAAC;KAC/C,OAAO,CACN,0CAA0C,EAAE,CAAC,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,4BAA4B,EAAE,OAAO;IACrH,uBAAuB,EAAE,MAAM,EAAE,+BAA+B,EAAE,iCAAiC;IACnG,UAAU,UAAU,EAAE,QAAQ,EAC5B,KAAK,EAAE,0BAA0B,EAAE,KAAK,EAAE,qBAAqB,EAAE,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,CAAC,wBAAwB,GAAG,KAAK,CAAC;yBAChE;wBACD,8CAA8C;wBAC9C,IAAG,OAAO,CAAC,EAAE,KAAK,0BAA0B,EAAC;4BAC3C,6BAA6B,CAAC,4BAA4B,GAAG,KAAK,CAAC;yBACpE;wBAED,OAAO,KAAK,CAAC;qBACd;oBACD,OAAO,IAAI,CAAC;iBACb;qBACG;oBACF,0CAA0C;oBAC1C,IAAG,OAAO,CAAC,EAAE,KAAK,sBAAsB,EAAC;wBACvC,6BAA6B,CAAC,wBAAwB,GAAG,KAAK,CAAC;qBAChE;oBACD,8CAA8C;oBAC9C,IAAG,OAAO,CAAC,EAAE,KAAK,0BAA0B,EAAC;wBAC3C,6BAA6B,CAAC,4BAA4B,GAAG,KAAK,CAAC;qBACpE;oBAED,OAAO,KAAK,CAAC;iBACd;aACF;QACH,CAAC,CAAC;QAEF,IAAI,CAAC,qBAAqB,EAAE,CAAC;IAE/B,CAAC,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/util/genericServices/kommonitorElementVisibilityHelperService/kommonitor-element-visibility-helper-service.module.ts b/app/util/genericServices/kommonitorElementVisibilityHelperService/kommonitor-element-visibility-helper-service.module.ts new file mode 100644 index 000000000..d2604eb61 --- /dev/null +++ b/app/util/genericServices/kommonitorElementVisibilityHelperService/kommonitor-element-visibility-helper-service.module.ts @@ -0,0 +1,120 @@ +angular.module('kommonitorElementVisibilityHelper', ['kommonitorDataExchange', 'kommonitorKeycloakHelper']); + +/** + * a common serviceInstance that holds all needed properties for a WPS service. + * + * This service represents a shared object ´which is used across the different + * application tabs/components like Setup, Capabilities, Execute etc. + * + * This way, one single service instance can be used to easily share values and + * parameters for each WPS operation represented by different Angular components + */ +angular + .module('kommonitorElementVisibilityHelper', []) + .service( + 'kommonitorElementVisibilityHelperService', ['$rootScope', '$timeout', '$http', '$httpParamSerializerJQLike', '__env', + 'ControlsConfigService', 'Auth', 'kommonitorDataExchangeService', 'kommonitorKeycloakHelperService', + function ($rootScope, $timeout, + $http, $httpParamSerializerJQLike, __env, ControlsConfigService, Auth, kommonitorDataExchangeService, kommonitorKeycloakHelperService) { + + var self = this; + this.elementVisibility = {}; + + this.isAdvancedMode = __env.isAdvancedMode; + this.showAdvancedModeSwitch = __env.showAdvancedModeSwitch; + + this.advancedModeRoleName = "fakeAdvancedModeRole"; + + this.initElementVisibility = function () { + kommonitorDataExchangeService.showDiagramExportButtons = true; + kommonitorDataExchangeService.showGeoresourceExportButtons = true; + + this.elementVisibility = {}; + var config = ControlsConfigService.getControlsConfig(); + config.forEach(element => { + self.elementVisibility[element.id] = checkElementVisibility(element.id); + }); + + $timeout(function(){ + $rootScope.$apply(); + + }); + + + }; + + this.onChangeIsAdvancedMode = function (){ + + this.initElementVisibility(); + + // if any sidebar was previously not displayed we must ensure that it is properly instantiated for current indicator + $rootScope.$broadcast("changeIndicatorDate"); + }; + + var checkElementVisibility = function(id) { + + var element = ControlsConfigService.getControlsConfig().filter(element => element.id === id)[0]; + + if(element.roles === undefined || element.roles.length === 0) { + return true; + } + else if(self.isAdvancedMode && element.roles && element.roles.includes(self.advancedModeRoleName)){ + return true; + } + else if(Auth.keycloak.authenticated) { + // admin role user always sees all data and widgets + if(Auth.keycloak.showAdminView){ + return true; + } + var hasAllowedRole = false; + for (var i = 0; i < element.roles.length; i++) { + if(Auth.keycloak.tokenParsed.realm_access.roles.includes(element.roles[i])){ + return true; + } + } + + // special case for diagram export buttons + if(! hasAllowedRole && element.id === "diagramExportButtons"){ + kommonitorDataExchangeService.showDiagramExportButtons = false; + } + // special case for georesource export buttons + if(! hasAllowedRole && element.id === "georesourceExportButtons"){ + kommonitorDataExchangeService.showGeoresourceExportButtons = false; + } + + return hasAllowedRole; + } else { + if(! kommonitorDataExchangeService.enableKeycloakSecurity){ + if(element.roles && element.roles.includes(self.advancedModeRoleName)){ + + // special case for diagram export buttons + if(element.id === "diagramExportButtons"){ + kommonitorDataExchangeService.showDiagramExportButtons = false; + } + // special case for georesource export buttons + if(element.id === "georesourceExportButtons"){ + kommonitorDataExchangeService.showGeoresourceExportButtons = false; + } + + return false; + } + return true; + } + else{ + // special case for diagram export buttons + if(element.id === "diagramExportButtons"){ + kommonitorDataExchangeService.showDiagramExportButtons = false; + } + // special case for georesource export buttons + if(element.id === "georesourceExportButtons"){ + kommonitorDataExchangeService.showGeoresourceExportButtons = false; + } + + return false; + } + } + }; + + this.initElementVisibility(); + + }]); diff --git a/app/util/genericServices/kommonitorFilterHelperService/kommonitor-filter-helper-service.module.js b/app/util/genericServices/kommonitorFilterHelperService/kommonitor-filter-helper-service.module.js index 31c3719e1..d70722ad0 100644 --- a/app/util/genericServices/kommonitorFilterHelperService/kommonitor-filter-helper-service.module.js +++ b/app/util/genericServices/kommonitorFilterHelperService/kommonitor-filter-helper-service.module.js @@ -1,181 +1,141 @@ +"use strict"; angular.module('kommonitorFilterHelper', []); - angular - .module('kommonitorFilterHelper', ['kommonitorMap', 'kommonitorDataExchange']) - .service( - 'kommonitorFilterHelperService', ['$rootScope', '$timeout', '__env', 'kommonitorMapService', "kommonitorDataExchangeService", - function ($rootScope, $timeout, - __env, kommonitorMapService, kommonitorDataExchangeService) { - - var self = this; - - this.filteredIndicatorFeatureIds = new Map(); - this.selectedIndicatorFeatureIds = new Map(); - - this.completelyRemoveFilteredFeaturesFromDisplay = true; - - this.onChangeFilterBehaviourToggle = function(){ - this.performSpatialFilter(); - }; - - // FEATURE SELECTION - - this.featureIsCurrentlySelected = function(featureId){ - return this.selectedIndicatorFeatureIds.has("" + featureId); - }; - - this.clearSelectedFeatures = function(){ - this.selectedIndicatorFeatureIds = new Map(); - }; - - this.addFeatureToSelection = function(feature){ - if(feature.properties){ - this.selectedIndicatorFeatureIds.set("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME], feature); - } - else{ - this.selectedIndicatorFeatureIds.set("" + feature[__env.FEATURE_ID_PROPERTY_NAME], feature); - } - $rootScope.$broadcast("onAddedFeatureToSelection", this.selectedIndicatorFeatureIds); - }; - - this.removeFeatureFromSelection = function(featureId){ - this.selectedIndicatorFeatureIds.delete("" + featureId); - $rootScope.$broadcast("onRemovedFeatureFromSelection", this.selectedIndicatorFeatureIds); - }; - - - // FEATURE FILTER - - this.featureIsCurrentlyFiltered = function(featureId){ - return this.filteredIndicatorFeatureIds.has("" + featureId); - }; - - this.clearFilteredFeatures = function(){ + .module('kommonitorFilterHelper', ['kommonitorMap', 'kommonitorDataExchange']) + .service('kommonitorFilterHelperService', ['$rootScope', '$timeout', '__env', 'kommonitorMapService', "kommonitorDataExchangeService", + function ($rootScope, $timeout, __env, kommonitorMapService, kommonitorDataExchangeService) { + var self = this; this.filteredIndicatorFeatureIds = new Map(); - }; - - this.applyRangeFilter = function(features, targetDateProperty, minFilterValue, maxFilterValue){ - if(!this.filteredIndicatorFeatureIds){ - this.filteredIndicatorFeatureIds = new Map(); - } - for (const feature of features) { - var value = +Number(feature.properties[targetDateProperty]).toFixed(__env.numberOfDecimals); - - if(value >= minFilterValue && value <= maxFilterValue){ - // feature must not be filtered - make sure it is not marked as filtered - if (this.filteredIndicatorFeatureIds.has("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME])){ - this.filteredIndicatorFeatureIds.delete("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME]); + this.selectedIndicatorFeatureIds = new Map(); + this.completelyRemoveFilteredFeaturesFromDisplay = true; + this.onChangeFilterBehaviourToggle = function () { + this.performSpatialFilter(); + }; + // FEATURE SELECTION + this.featureIsCurrentlySelected = function (featureId) { + return this.selectedIndicatorFeatureIds.has("" + featureId); + }; + this.clearSelectedFeatures = function () { + this.selectedIndicatorFeatureIds = new Map(); + }; + this.addFeatureToSelection = function (feature) { + if (feature.properties) { + this.selectedIndicatorFeatureIds.set("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME], feature); } - } - else{ - // feature must be filtered - if (!this.filteredIndicatorFeatureIds.has("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME])){ - this.filteredIndicatorFeatureIds.set("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME], feature); + else { + this.selectedIndicatorFeatureIds.set("" + feature[__env.FEATURE_ID_PROPERTY_NAME], feature); } - } - } - - // range filter should only display filtered items as filtered, not remove them totally, as this qould require either - // more complicated management of all features or direct update of range min/max values - kommonitorMapService.restyleCurrentLayer(); - - }; - - this.performSpatialFilter = function(){ - if(! this.completelyRemoveFilteredFeaturesFromDisplay){ - // kommonitorMapService.restyleCurrentLayer(); - if(kommonitorDataExchangeService.isBalanceChecked){ - kommonitorMapService.replaceIndicatorGeoJSON(kommonitorDataExchangeService.indicatorAndMetadataAsBalance, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, kommonitorDataExchangeService.selectedDate, false); - } - else{ - kommonitorMapService.replaceIndicatorGeoJSON(kommonitorDataExchangeService.selectedIndicator, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, kommonitorDataExchangeService.selectedDate, false); - } - } - else{ - this.filterAndReplaceDataset(); - } - - this.checkFeatureSelection(); - }; - - this.checkFeatureSelection = function(){ - // remove any selected items that are not visible in current filtered dataset - // only if features are fully removed from dataset - if(this.completelyRemoveFilteredFeaturesFromDisplay){ - let oldSelectionMap = this.selectedIndicatorFeatureIds; - - for (let key of this.selectedIndicatorFeatureIds.keys()) { - if (this.filteredIndicatorFeatureIds.has("" + key)){ - this.selectedIndicatorFeatureIds.delete("" + key); + $rootScope.$broadcast("onAddedFeatureToSelection", this.selectedIndicatorFeatureIds); + }; + this.removeFeatureFromSelection = function (featureId) { + this.selectedIndicatorFeatureIds.delete("" + featureId); + $rootScope.$broadcast("onRemovedFeatureFromSelection", this.selectedIndicatorFeatureIds); + }; + // FEATURE FILTER + this.featureIsCurrentlyFiltered = function (featureId) { + return this.filteredIndicatorFeatureIds.has("" + featureId); + }; + this.clearFilteredFeatures = function () { + this.filteredIndicatorFeatureIds = new Map(); + }; + this.applyRangeFilter = function (features, targetDateProperty, minFilterValue, maxFilterValue) { + if (!this.filteredIndicatorFeatureIds) { + this.filteredIndicatorFeatureIds = new Map(); } - } - } - - $rootScope.$broadcast("onRemovedFeatureFromSelection", this.selectedIndicatorFeatureIds); - }; - - this.filterAndReplaceDataset = function(){ - let indicatorMetadataAndGeoJSON; - if(kommonitorDataExchangeService.isBalanceChecked){ - let filteredIndicatorFeatures = kommonitorDataExchangeService.indicatorAndMetadataAsBalance.geoJSON.features.filter(feature => !self.filteredIndicatorFeatureIds.has("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME])); - - indicatorMetadataAndGeoJSON = JSON.parse(JSON.stringify(kommonitorDataExchangeService.indicatorAndMetadataAsBalance)); - indicatorMetadataAndGeoJSON.geoJSON.features = filteredIndicatorFeatures; - kommonitorMapService.replaceIndicatorGeoJSON(indicatorMetadataAndGeoJSON, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, kommonitorDataExchangeService.selectedDate, false); - - } - else{ - let filteredIndicatorFeatures = kommonitorDataExchangeService.selectedIndicator.geoJSON.features.filter(feature => !self.filteredIndicatorFeatureIds.has("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME])); - - indicatorMetadataAndGeoJSON = JSON.parse(JSON.stringify(kommonitorDataExchangeService.selectedIndicator)); - indicatorMetadataAndGeoJSON.geoJSON.features = filteredIndicatorFeatures; - kommonitorMapService.replaceIndicatorGeoJSON(indicatorMetadataAndGeoJSON, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, kommonitorDataExchangeService.selectedDate, false); - - } - - $rootScope.$broadcast("updateIndicatorValueRangeFilter", kommonitorDataExchangeService.selectedDate, indicatorMetadataAndGeoJSON); - $rootScope.$broadcast("updateMeasureOfValueBar", kommonitorDataExchangeService.selectedDate, indicatorMetadataAndGeoJSON); - }; - - this.applySpatialFilter_higherSpatialUnitFeatures = function(higherSpatialUnitFilterFeatureGeoJSON, targetFeatureNames){ - - // if(!this.filteredIndicatorFeatureIds){ - - // } - this.filteredIndicatorFeatureIds = new Map(); - - // manage map of filtered features - let targetHigherSpatialUnitFilterFeatures = higherSpatialUnitFilterFeatureGeoJSON.features.filter(feature => targetFeatureNames.includes(feature.properties[__env.FEATURE_NAME_PROPERTY_NAME])); - - for (const feature of kommonitorDataExchangeService.selectedIndicator.geoJSON.features) { - this.filteredIndicatorFeatureIds.set("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME], feature); - for (const higherSpatialUnitFeature of targetHigherSpatialUnitFilterFeatures) { - if(turf.booleanPointInPolygon(turf.pointOnFeature(feature), higherSpatialUnitFeature)){ - this.filteredIndicatorFeatureIds.delete("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME]); - break; + for (const feature of features) { + var value = +Number(feature.properties[targetDateProperty]).toFixed(__env.numberOfDecimals); + if (value >= minFilterValue && value <= maxFilterValue) { + // feature must not be filtered - make sure it is not marked as filtered + if (this.filteredIndicatorFeatureIds.has("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { + this.filteredIndicatorFeatureIds.delete("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME]); + } + } + else { + // feature must be filtered + if (!this.filteredIndicatorFeatureIds.has("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME])) { + this.filteredIndicatorFeatureIds.set("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME], feature); + } + } } - } - } - - // apply filter - this.performSpatialFilter(); - }; - - this.applySpatialFilter_currentSpatialUnitFeatures = function(targetFeatureNames){ - // if(!this.filteredIndicatorFeatureIds){ - - // } - this.filteredIndicatorFeatureIds = new Map(); - - // manage map of filtered features - for (const feature of kommonitorDataExchangeService.selectedIndicator.geoJSON.features) { - if(!targetFeatureNames.includes(feature.properties[__env.FEATURE_NAME_PROPERTY_NAME])){ - this.filteredIndicatorFeatureIds.set("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME], feature); - } - } - - // apply filter - this.performSpatialFilter(); - }; - + // range filter should only display filtered items as filtered, not remove them totally, as this qould require either + // more complicated management of all features or direct update of range min/max values + kommonitorMapService.restyleCurrentLayer(); + }; + this.performSpatialFilter = function () { + if (!this.completelyRemoveFilteredFeaturesFromDisplay) { + // kommonitorMapService.restyleCurrentLayer(); + if (kommonitorDataExchangeService.isBalanceChecked) { + kommonitorMapService.replaceIndicatorGeoJSON(kommonitorDataExchangeService.indicatorAndMetadataAsBalance, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, kommonitorDataExchangeService.selectedDate, false); + } + else { + kommonitorMapService.replaceIndicatorGeoJSON(kommonitorDataExchangeService.selectedIndicator, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, kommonitorDataExchangeService.selectedDate, false); + } + } + else { + this.filterAndReplaceDataset(); + } + this.checkFeatureSelection(); + }; + this.checkFeatureSelection = function () { + // remove any selected items that are not visible in current filtered dataset + // only if features are fully removed from dataset + if (this.completelyRemoveFilteredFeaturesFromDisplay) { + let oldSelectionMap = this.selectedIndicatorFeatureIds; + for (let key of this.selectedIndicatorFeatureIds.keys()) { + if (this.filteredIndicatorFeatureIds.has("" + key)) { + this.selectedIndicatorFeatureIds.delete("" + key); + } + } + } + $rootScope.$broadcast("onRemovedFeatureFromSelection", this.selectedIndicatorFeatureIds); + }; + this.filterAndReplaceDataset = function () { + let indicatorMetadataAndGeoJSON; + if (kommonitorDataExchangeService.isBalanceChecked) { + let filteredIndicatorFeatures = kommonitorDataExchangeService.indicatorAndMetadataAsBalance.geoJSON.features.filter(feature => !self.filteredIndicatorFeatureIds.has("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME])); + indicatorMetadataAndGeoJSON = JSON.parse(JSON.stringify(kommonitorDataExchangeService.indicatorAndMetadataAsBalance)); + indicatorMetadataAndGeoJSON.geoJSON.features = filteredIndicatorFeatures; + kommonitorMapService.replaceIndicatorGeoJSON(indicatorMetadataAndGeoJSON, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, kommonitorDataExchangeService.selectedDate, false); + } + else { + let filteredIndicatorFeatures = kommonitorDataExchangeService.selectedIndicator.geoJSON.features.filter(feature => !self.filteredIndicatorFeatureIds.has("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME])); + indicatorMetadataAndGeoJSON = JSON.parse(JSON.stringify(kommonitorDataExchangeService.selectedIndicator)); + indicatorMetadataAndGeoJSON.geoJSON.features = filteredIndicatorFeatures; + kommonitorMapService.replaceIndicatorGeoJSON(indicatorMetadataAndGeoJSON, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, kommonitorDataExchangeService.selectedDate, false); + } + $rootScope.$broadcast("updateIndicatorValueRangeFilter", kommonitorDataExchangeService.selectedDate, indicatorMetadataAndGeoJSON); + $rootScope.$broadcast("updateMeasureOfValueBar", kommonitorDataExchangeService.selectedDate, indicatorMetadataAndGeoJSON); + }; + this.applySpatialFilter_higherSpatialUnitFeatures = function (higherSpatialUnitFilterFeatureGeoJSON, targetFeatureNames) { + // if(!this.filteredIndicatorFeatureIds){ + // } + this.filteredIndicatorFeatureIds = new Map(); + // manage map of filtered features + let targetHigherSpatialUnitFilterFeatures = higherSpatialUnitFilterFeatureGeoJSON.features.filter(feature => targetFeatureNames.includes(feature.properties[__env.FEATURE_NAME_PROPERTY_NAME])); + for (const feature of kommonitorDataExchangeService.selectedIndicator.geoJSON.features) { + this.filteredIndicatorFeatureIds.set("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME], feature); + for (const higherSpatialUnitFeature of targetHigherSpatialUnitFilterFeatures) { + if (turf.booleanPointInPolygon(turf.pointOnFeature(feature), higherSpatialUnitFeature)) { + this.filteredIndicatorFeatureIds.delete("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME]); + break; + } + } + } + // apply filter + this.performSpatialFilter(); + }; + this.applySpatialFilter_currentSpatialUnitFeatures = function (targetFeatureNames) { + // if(!this.filteredIndicatorFeatureIds){ + // } + this.filteredIndicatorFeatureIds = new Map(); + // manage map of filtered features + for (const feature of kommonitorDataExchangeService.selectedIndicator.geoJSON.features) { + if (!targetFeatureNames.includes(feature.properties[__env.FEATURE_NAME_PROPERTY_NAME])) { + this.filteredIndicatorFeatureIds.set("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME], feature); + } + } + // apply filter + this.performSpatialFilter(); + }; }]); +//# sourceMappingURL=kommonitor-filter-helper-service.module.js.map \ No newline at end of file diff --git a/app/util/genericServices/kommonitorFilterHelperService/kommonitor-filter-helper-service.module.js.map b/app/util/genericServices/kommonitorFilterHelperService/kommonitor-filter-helper-service.module.js.map new file mode 100644 index 000000000..2fbf9f90c --- /dev/null +++ b/app/util/genericServices/kommonitorFilterHelperService/kommonitor-filter-helper-service.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-filter-helper-service.module.js","sourceRoot":"","sources":["kommonitor-filter-helper-service.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,wBAAwB,EAAE,EAAE,CAAC,CAAC;AAE7C,OAAO;KACJ,MAAM,CAAC,wBAAwB,EAAE,CAAC,eAAe,EAAE,wBAAwB,CAAC,CAAC;KAC7E,OAAO,CACN,+BAA+B,EAAE,CAAC,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,sBAAsB,EAAE,+BAA+B;IAC5H,UAAU,UAAU,EAAE,QAAQ,EAC5B,KAAK,EAAE,oBAAoB,EAAE,6BAA6B;QAE1D,IAAI,IAAI,GAAG,IAAI,CAAC;QAEhB,IAAI,CAAC,2BAA2B,GAAG,IAAI,GAAG,EAAE,CAAC;QAC7C,IAAI,CAAC,2BAA2B,GAAG,IAAI,GAAG,EAAE,CAAC;QAE7C,IAAI,CAAC,2CAA2C,GAAG,IAAI,CAAC;QAExD,IAAI,CAAC,6BAA6B,GAAG;YACnC,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC9B,CAAC,CAAC;QAEF,oBAAoB;QAEpB,IAAI,CAAC,0BAA0B,GAAG,UAAS,SAAS;YAClD,OAAO,IAAI,CAAC,2BAA2B,CAAC,GAAG,CAAC,EAAE,GAAG,SAAS,CAAC,CAAC;QAC9D,CAAC,CAAC;QAEF,IAAI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AC"} \ No newline at end of file diff --git a/app/util/genericServices/kommonitorFilterHelperService/kommonitor-filter-helper-service.module.ts b/app/util/genericServices/kommonitorFilterHelperService/kommonitor-filter-helper-service.module.ts new file mode 100644 index 000000000..31c3719e1 --- /dev/null +++ b/app/util/genericServices/kommonitorFilterHelperService/kommonitor-filter-helper-service.module.ts @@ -0,0 +1,181 @@ +angular.module('kommonitorFilterHelper', []); + +angular + .module('kommonitorFilterHelper', ['kommonitorMap', 'kommonitorDataExchange']) + .service( + 'kommonitorFilterHelperService', ['$rootScope', '$timeout', '__env', 'kommonitorMapService', "kommonitorDataExchangeService", + function ($rootScope, $timeout, + __env, kommonitorMapService, kommonitorDataExchangeService) { + + var self = this; + + this.filteredIndicatorFeatureIds = new Map(); + this.selectedIndicatorFeatureIds = new Map(); + + this.completelyRemoveFilteredFeaturesFromDisplay = true; + + this.onChangeFilterBehaviourToggle = function(){ + this.performSpatialFilter(); + }; + + // FEATURE SELECTION + + this.featureIsCurrentlySelected = function(featureId){ + return this.selectedIndicatorFeatureIds.has("" + featureId); + }; + + this.clearSelectedFeatures = function(){ + this.selectedIndicatorFeatureIds = new Map(); + }; + + this.addFeatureToSelection = function(feature){ + if(feature.properties){ + this.selectedIndicatorFeatureIds.set("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME], feature); + } + else{ + this.selectedIndicatorFeatureIds.set("" + feature[__env.FEATURE_ID_PROPERTY_NAME], feature); + } + $rootScope.$broadcast("onAddedFeatureToSelection", this.selectedIndicatorFeatureIds); + }; + + this.removeFeatureFromSelection = function(featureId){ + this.selectedIndicatorFeatureIds.delete("" + featureId); + $rootScope.$broadcast("onRemovedFeatureFromSelection", this.selectedIndicatorFeatureIds); + }; + + + // FEATURE FILTER + + this.featureIsCurrentlyFiltered = function(featureId){ + return this.filteredIndicatorFeatureIds.has("" + featureId); + }; + + this.clearFilteredFeatures = function(){ + this.filteredIndicatorFeatureIds = new Map(); + }; + + this.applyRangeFilter = function(features, targetDateProperty, minFilterValue, maxFilterValue){ + if(!this.filteredIndicatorFeatureIds){ + this.filteredIndicatorFeatureIds = new Map(); + } + for (const feature of features) { + var value = +Number(feature.properties[targetDateProperty]).toFixed(__env.numberOfDecimals); + + if(value >= minFilterValue && value <= maxFilterValue){ + // feature must not be filtered - make sure it is not marked as filtered + if (this.filteredIndicatorFeatureIds.has("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME])){ + this.filteredIndicatorFeatureIds.delete("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME]); + } + } + else{ + // feature must be filtered + if (!this.filteredIndicatorFeatureIds.has("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME])){ + this.filteredIndicatorFeatureIds.set("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME], feature); + } + } + } + + // range filter should only display filtered items as filtered, not remove them totally, as this qould require either + // more complicated management of all features or direct update of range min/max values + kommonitorMapService.restyleCurrentLayer(); + + }; + + this.performSpatialFilter = function(){ + if(! this.completelyRemoveFilteredFeaturesFromDisplay){ + // kommonitorMapService.restyleCurrentLayer(); + if(kommonitorDataExchangeService.isBalanceChecked){ + kommonitorMapService.replaceIndicatorGeoJSON(kommonitorDataExchangeService.indicatorAndMetadataAsBalance, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, kommonitorDataExchangeService.selectedDate, false); + } + else{ + kommonitorMapService.replaceIndicatorGeoJSON(kommonitorDataExchangeService.selectedIndicator, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, kommonitorDataExchangeService.selectedDate, false); + } + } + else{ + this.filterAndReplaceDataset(); + } + + this.checkFeatureSelection(); + }; + + this.checkFeatureSelection = function(){ + // remove any selected items that are not visible in current filtered dataset + // only if features are fully removed from dataset + if(this.completelyRemoveFilteredFeaturesFromDisplay){ + let oldSelectionMap = this.selectedIndicatorFeatureIds; + + for (let key of this.selectedIndicatorFeatureIds.keys()) { + if (this.filteredIndicatorFeatureIds.has("" + key)){ + this.selectedIndicatorFeatureIds.delete("" + key); + } + } + } + + $rootScope.$broadcast("onRemovedFeatureFromSelection", this.selectedIndicatorFeatureIds); + }; + + this.filterAndReplaceDataset = function(){ + let indicatorMetadataAndGeoJSON; + if(kommonitorDataExchangeService.isBalanceChecked){ + let filteredIndicatorFeatures = kommonitorDataExchangeService.indicatorAndMetadataAsBalance.geoJSON.features.filter(feature => !self.filteredIndicatorFeatureIds.has("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME])); + + indicatorMetadataAndGeoJSON = JSON.parse(JSON.stringify(kommonitorDataExchangeService.indicatorAndMetadataAsBalance)); + indicatorMetadataAndGeoJSON.geoJSON.features = filteredIndicatorFeatures; + kommonitorMapService.replaceIndicatorGeoJSON(indicatorMetadataAndGeoJSON, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, kommonitorDataExchangeService.selectedDate, false); + + } + else{ + let filteredIndicatorFeatures = kommonitorDataExchangeService.selectedIndicator.geoJSON.features.filter(feature => !self.filteredIndicatorFeatureIds.has("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME])); + + indicatorMetadataAndGeoJSON = JSON.parse(JSON.stringify(kommonitorDataExchangeService.selectedIndicator)); + indicatorMetadataAndGeoJSON.geoJSON.features = filteredIndicatorFeatures; + kommonitorMapService.replaceIndicatorGeoJSON(indicatorMetadataAndGeoJSON, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, kommonitorDataExchangeService.selectedDate, false); + + } + + $rootScope.$broadcast("updateIndicatorValueRangeFilter", kommonitorDataExchangeService.selectedDate, indicatorMetadataAndGeoJSON); + $rootScope.$broadcast("updateMeasureOfValueBar", kommonitorDataExchangeService.selectedDate, indicatorMetadataAndGeoJSON); + }; + + this.applySpatialFilter_higherSpatialUnitFeatures = function(higherSpatialUnitFilterFeatureGeoJSON, targetFeatureNames){ + + // if(!this.filteredIndicatorFeatureIds){ + + // } + this.filteredIndicatorFeatureIds = new Map(); + + // manage map of filtered features + let targetHigherSpatialUnitFilterFeatures = higherSpatialUnitFilterFeatureGeoJSON.features.filter(feature => targetFeatureNames.includes(feature.properties[__env.FEATURE_NAME_PROPERTY_NAME])); + + for (const feature of kommonitorDataExchangeService.selectedIndicator.geoJSON.features) { + this.filteredIndicatorFeatureIds.set("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME], feature); + for (const higherSpatialUnitFeature of targetHigherSpatialUnitFilterFeatures) { + if(turf.booleanPointInPolygon(turf.pointOnFeature(feature), higherSpatialUnitFeature)){ + this.filteredIndicatorFeatureIds.delete("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME]); + break; + } + } + } + + // apply filter + this.performSpatialFilter(); + }; + + this.applySpatialFilter_currentSpatialUnitFeatures = function(targetFeatureNames){ + // if(!this.filteredIndicatorFeatureIds){ + + // } + this.filteredIndicatorFeatureIds = new Map(); + + // manage map of filtered features + for (const feature of kommonitorDataExchangeService.selectedIndicator.geoJSON.features) { + if(!targetFeatureNames.includes(feature.properties[__env.FEATURE_NAME_PROPERTY_NAME])){ + this.filteredIndicatorFeatureIds.set("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME], feature); + } + } + + // apply filter + this.performSpatialFilter(); + }; + + }]); diff --git a/app/util/genericServices/kommonitorImporterHelperService/kommonitor-importer-helper-service.module.js b/app/util/genericServices/kommonitorImporterHelperService/kommonitor-importer-helper-service.module.js index 66f177d46..74c578b49 100644 --- a/app/util/genericServices/kommonitorImporterHelperService/kommonitor-importer-helper-service.module.js +++ b/app/util/genericServices/kommonitorImporterHelperService/kommonitor-importer-helper-service.module.js @@ -1,5 +1,5 @@ +"use strict"; angular.module('kommonitorImporterHelper', ['kommonitorDataExchange']); - /** * a common serviceInstance that holds all needed properties for a WPS service. * @@ -10,721 +10,603 @@ angular.module('kommonitorImporterHelper', ['kommonitorDataExchange']); * parameters for each WPS operation represented by different Angular components */ angular - .module('kommonitorImporterHelper', []) - .service( - 'kommonitorImporterHelperService', ['$rootScope', '$timeout', 'kommonitorDataExchangeService', '$http', '__env', - function ($rootScope, $timeout, - kommonitorDataExchangeService, $http, __env) { - - this.targetUrlToImporterService = __env.targetUrlToImporterService; - - this.availableConverters = undefined; - - this.availableDatasourceTypes = undefined; - - this.attributeMapping_attributeTypes = [ - { - displayName: "Text/String", - apiName: "string" - }, - { - displayName: "Ganzzahl", - apiName: "integer" - }, - { - displayName: "Gleitkommazahl", - apiName: "float" - }, - { - displayName: "Datum", - apiName: "date" - }, - ]; - - this.mappingConfigStructure = { - "converter": { - "encoding": "string", - "mimeType": "string", - "name": "string", - "parameters": [ + .module('kommonitorImporterHelper', []) + .service('kommonitorImporterHelperService', ['$rootScope', '$timeout', 'kommonitorDataExchangeService', '$http', '__env', + function ($rootScope, $timeout, kommonitorDataExchangeService, $http, __env) { + this.targetUrlToImporterService = __env.targetUrlToImporterService; + this.availableConverters = undefined; + this.availableDatasourceTypes = undefined; + this.attributeMapping_attributeTypes = [ { - "name": "string", - "value": "string" - } - ], - "schema": "string" - }, - "dataSource": { - "parameters": [ + displayName: "Text/String", + apiName: "string" + }, { - "name": "string", - "value": "string" - } - ], - "type": "FILE" // FILE|HTTP|INLINE - }, - "propertyMapping": { - "arisenFromProperty": "string", - "attributes": [ + displayName: "Ganzzahl", + apiName: "integer" + }, { - "mappingName": "string", // target name - "name": "string", // source name - "type": "string" // dataType, [string|integer|float|date] + displayName: "Gleitkommazahl", + apiName: "float" + }, + { + displayName: "Datum", + apiName: "date" + }, + ]; + this.mappingConfigStructure = { + "converter": { + "encoding": "string", + "mimeType": "string", + "name": "string", + "parameters": [ + { + "name": "string", + "value": "string" + } + ], + "schema": "string" + }, + "dataSource": { + "parameters": [ + { + "name": "string", + "value": "string" + } + ], + "type": "FILE" // FILE|HTTP|INLINE + }, + "propertyMapping": { + "arisenFromProperty": "string", + "attributes": [ + { + "mappingName": "string", + "name": "string", + "type": "string" // dataType, [string|integer|float|date] + } + ], + "identifierProperty": "string", + "keepAttributes": true, + "nameProperty": "string", + "validEndDateProperty": "string", + "validStartDateProperty": "string" + }, + "periodOfValidity": { + "startDate": "yyyy-mm-tt", + "endDate": "yyyy-mm-tt" } - ], - "identifierProperty": "string", - "keepAttributes": true, // if true, then mapping under attributes is ignored and all attributes are imported with the same attribute name - "nameProperty": "string", - "validEndDateProperty": "string", - "validStartDateProperty": "string" - }, - "periodOfValidity":{ - "startDate": "yyyy-mm-tt", - "endDate": "yyyy-mm-tt" - } }; - this.mappingConfigStructure_indicator = { - "converter": { - "encoding": "string", - "mimeType": "string", - "name": "string", + "converter": { + "encoding": "string", + "mimeType": "string", + "name": "string", + "parameters": [ + { + "name": "string", + "value": "string" + } + ], + "schema": "string" + }, + "dataSource": { + "parameters": [ + { + "name": "string", + "value": "string" + } + ], + "type": "FILE" // FILE|HTTP|INLINE + }, + "propertyMapping": { + "attributeMappings": [ + { + "mappingName": "string", + "name": "string", + "type": "string" + } + ], + "spatialReferenceKeyProperty": "string", + "timeseriesMappings": [ + { + "indicatorValueProperty": "string", + "timestamp": "string", + "timestampProperty": "string" + } + ] + }, + "targetSpatialUnitName": "string" + }; + this.converterDefinition_singleFeatureImport = { + "encoding": "UTF-8", + "mimeType": "application/geo+json", + "name": "GeoJSON", "parameters": [ - { - "name": "string", - "value": "string" - } - ], - "schema": "string" - }, - "dataSource": { + { + "name": "CRS", + "value": "EPSG:4326" + } + ] + }; + this.datasourceDefinition_singleFeatureImport = { "parameters": [ - { - "name": "string", - "value": "string" - } - ], - "type": "FILE" // FILE|HTTP|INLINE - }, - "propertyMapping": { - "attributeMappings": [ - { - "mappingName": "string", - "name": "string", - "type": "string" - } + { + "name": "payload", + "value": "geojsonValue" + } ], - "spatialReferenceKeyProperty": "string", - "timeseriesMappings": [ - { - "indicatorValueProperty": "string", - "timestamp": "string", - "timestampProperty": "string" - } - ] - }, - "targetSpatialUnitName": "string" - }; - - this.converterDefinition_singleFeatureImport = { - "encoding": "UTF-8", - "mimeType": "application/geo+json", - "name": "GeoJSON", - "parameters": [ - { - "name": "CRS", - "value": "EPSG:4326" - } - ] - }; - - this.datasourceDefinition_singleFeatureImport = { - "parameters": [ - { - "name": "payload", - "value": "geojsonValue" - } - ], - "type": "INLINE" - }; - - this.propertyMappingDefinition_singleFeatureImport = { - "identifierProperty": "ID", - "nameProperty": "NAME", - "keepAttributes": true, - "keepMissingOrNullValueAttributes": true, - "attributes": [] - }; - - this.fetchResourcesFromImporter = async function(){ - console.log("Trying to fetch converters and datasourceTypes from importer service"); - this.availableConverters = await this.fetchConverters(); - this.availableDatasourceTypes = await this.fetchDatasourceTypes(); - - if(! this.availableConverters || ! this.availableDatasourceTypes){ - - kommonitorDataExchangeService.displayMapApplicationError("Notwendige Anbindung an Importer-Service ist fehlerhaft. Bitte wenden Sie sich an Ihren Administrator."); - - return; - } - - for (let index = 0; index < this.availableConverters.length; index++) { - var converter = this.availableConverters[index]; - - converter = await this.fetchConverterDetails(converter); - this.availableConverters[index] = converter; - } - - for (let k = 0; k < this.availableDatasourceTypes.length; k++) { - this.availableDatasourceTypes[k] = await this.fetchDatasourceTypeDetails(this.availableDatasourceTypes[k]); - } - - setTimeout(() => { - $rootScope.$apply(); - }, 1500); - - }; - - this.filterConverters = function(resourceType) { - // remove csvLatLon for indicators - // and csv_onlyIndicator for georesources - return function (converter) { - if(resourceType === "georesource" && converter.name.includes("Indikator")) - return false; - if(resourceType === "spatialUnit" && (converter.name.includes("Indikator") || converter.name.includes("Tabelle"))) - return false; - if(resourceType === "indicator" && (converter.name.includes("Geokodierung") || converter.name.includes("Koordinate")) ) - return false; - - return true; + "type": "INLINE" }; - }; - - this.fetchConverters = async function(){ - return await $http({ - url: this.targetUrlToImporterService + "converters", - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while fetching converters from importer."); - kommonitorDataExchangeService.displayMapApplicationError(error); - - }); - }; - - this.fetchConverterDetails = async function(converter){ - return await $http({ - url: this.targetUrlToImporterService + "converters/" + converter.name, - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(response) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while fetching converter for name '" + converter.name + "' from importer."); - - }); - }; - - this.fetchDatasourceTypes = async function(){ - return await $http({ - url: this.targetUrlToImporterService + "datasourceTypes", - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while fetching datasourceTypes from importer."); - kommonitorDataExchangeService.displayMapApplicationError(error); - }); - }; - - this.fetchDatasourceTypeDetails = async function(datasourceType){ - return await $http({ - url: this.targetUrlToImporterService + "datasourceTypes/" + datasourceType.type, - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(response) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while fetching datasourceType for type '" + datasource.type + "' from importer."); - }); - }; - - // load data - this.fetchResourcesFromImporter(); - - - this.uploadNewFile = async function(fileData, fileName){ - console.log("Trying to POST to importer service to upload a new file."); - - var formdata = new FormData(); - formdata.append("filename", fileName); - formdata.append("file", fileData); - - return await $http({ - url: this.targetUrlToImporterService + "upload", - method: "POST", - data: formdata, - // must set header content-type to undefined in order to send as multipart-formdata - headers: {"Content-Type": undefined, "Accept": "text/plain" }, - responseType: 'text' - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(response) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while posting to importer service."); - throw response; - }); - }; - - this.buildConverterDefinition = function(selectedConverter, converterParameterPrefix, schema, mimeType){ - var converterDefinition = { - "encoding": selectedConverter.encodings[0], - "mimeType": selectedConverter.mimeTypes.filter(element => element == mimeType)[0], - "name": selectedConverter.name, - "parameters": [ - - ], - "schema": undefined - }; - - if(selectedConverter.schemas){ - if (schema === undefined || schema === null){ - return null; - } - else{ - converterDefinition.schema = schema; - } - } - - if(selectedConverter.parameters.length > 0){ - for (const parameter of selectedConverter.parameters) { - var parameterName = parameter.name; - var parameterValue = $("#" + converterParameterPrefix + parameterName).val(); - - if(parameter.mandatory){ - + this.propertyMappingDefinition_singleFeatureImport = { + "identifierProperty": "ID", + "nameProperty": "NAME", + "keepAttributes": true, + "keepMissingOrNullValueAttributes": true, + "attributes": [] + }; + this.fetchResourcesFromImporter = async function () { + console.log("Trying to fetch converters and datasourceTypes from importer service"); + this.availableConverters = await this.fetchConverters(); + this.availableDatasourceTypes = await this.fetchDatasourceTypes(); + if (!this.availableConverters || !this.availableDatasourceTypes) { + kommonitorDataExchangeService.displayMapApplicationError("Notwendige Anbindung an Importer-Service ist fehlerhaft. Bitte wenden Sie sich an Ihren Administrator."); + return; } - - if (parameter.mandatory && (parameterValue === undefined || parameterValue === null || parameterValue === "")){ - return null; + for (let index = 0; index < this.availableConverters.length; index++) { + var converter = this.availableConverters[index]; + converter = await this.fetchConverterDetails(converter); + this.availableConverters[index] = converter; } - else{ - if(parameterValue && !(parameterValue === "")){ - converterDefinition.parameters.push({ - "name": parameterName, - "value": parameterValue - }); - } - + for (let k = 0; k < this.availableDatasourceTypes.length; k++) { + this.availableDatasourceTypes[k] = await this.fetchDatasourceTypeDetails(this.availableDatasourceTypes[k]); } - } - } - - return converterDefinition; - }; - - this.buildDatasourceTypeDefinition = async function(selectedDatasourceType, datasourceTypeParameterPrefix, datasourceFileInputId){ - var datasourceTypeDefinition = { - "parameters": [ - - ], - "type": selectedDatasourceType.type - }; - - if(selectedDatasourceType.type === "FILE"){ - // get file if present - - // upload it to importer - - // use file reference name for datasourceType definition - - - var file = document.getElementById(datasourceFileInputId).files[0]; - - if(file === null || file === undefined){ - return null; - } - - var fileUploadName; - try { - fileUploadName = await this.uploadNewFile(file, file.name); - } catch (error) { - console.error("Error while uploading file to importer."); - console.error(error); - kommonitorDataExchangeService.displayMapApplicationError(error); - throw error; - } - - datasourceTypeDefinition.parameters.push({ - "name": "NAME", - "value": fileUploadName - }); - } - else{ - if(selectedDatasourceType.parameters.length > 0){ - for (const parameter of selectedDatasourceType.parameters) { - var parameterName = parameter.name; - var parameterValue = $("#" + datasourceTypeParameterPrefix + parameterName).val(); - - if (parameterValue === undefined || parameterValue === null){ - return null; - } - else{ + setTimeout(() => { + $rootScope.$apply(); + }, 1500); + }; + this.filterConverters = function (resourceType) { + // remove csvLatLon for indicators + // and csv_onlyIndicator for georesources + return function (converter) { + if (resourceType === "georesource" && converter.name.includes("Indikator")) + return false; + if (resourceType === "spatialUnit" && (converter.name.includes("Indikator") || converter.name.includes("Tabelle"))) + return false; + if (resourceType === "indicator" && (converter.name.includes("Geokodierung") || converter.name.includes("Koordinate"))) + return false; + return true; + }; + }; + this.fetchConverters = async function () { + return await $http({ + url: this.targetUrlToImporterService + "converters", + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + return response.data; + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while fetching converters from importer."); + kommonitorDataExchangeService.displayMapApplicationError(error); + }); + }; + this.fetchConverterDetails = async function (converter) { + return await $http({ + url: this.targetUrlToImporterService + "converters/" + converter.name, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + return response.data; + }, function errorCallback(response) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while fetching converter for name '" + converter.name + "' from importer."); + }); + }; + this.fetchDatasourceTypes = async function () { + return await $http({ + url: this.targetUrlToImporterService + "datasourceTypes", + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + return response.data; + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while fetching datasourceTypes from importer."); + kommonitorDataExchangeService.displayMapApplicationError(error); + }); + }; + this.fetchDatasourceTypeDetails = async function (datasourceType) { + return await $http({ + url: this.targetUrlToImporterService + "datasourceTypes/" + datasourceType.type, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + return response.data; + }, function errorCallback(response) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while fetching datasourceType for type '" + datasource.type + "' from importer."); + }); + }; + // load data + this.fetchResourcesFromImporter(); + this.uploadNewFile = async function (fileData, fileName) { + console.log("Trying to POST to importer service to upload a new file."); + var formdata = new FormData(); + formdata.append("filename", fileName); + formdata.append("file", fileData); + return await $http({ + url: this.targetUrlToImporterService + "upload", + method: "POST", + data: formdata, + // must set header content-type to undefined in order to send as multipart-formdata + headers: { "Content-Type": undefined, "Accept": "text/plain" }, + responseType: 'text' + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + return response.data; + }, function errorCallback(response) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while posting to importer service."); + throw response; + }); + }; + this.buildConverterDefinition = function (selectedConverter, converterParameterPrefix, schema, mimeType) { + var converterDefinition = { + "encoding": selectedConverter.encodings[0], + "mimeType": selectedConverter.mimeTypes.filter(element => element == mimeType)[0], + "name": selectedConverter.name, + "parameters": [], + "schema": undefined + }; + if (selectedConverter.schemas) { + if (schema === undefined || schema === null) { + return null; + } + else { + converterDefinition.schema = schema; + } + } + if (selectedConverter.parameters.length > 0) { + for (const parameter of selectedConverter.parameters) { + var parameterName = parameter.name; + var parameterValue = $("#" + converterParameterPrefix + parameterName).val(); + if (parameter.mandatory) { + } + if (parameter.mandatory && (parameterValue === undefined || parameterValue === null || parameterValue === "")) { + return null; + } + else { + if (parameterValue && !(parameterValue === "")) { + converterDefinition.parameters.push({ + "name": parameterName, + "value": parameterValue + }); + } + } + } + } + return converterDefinition; + }; + this.buildDatasourceTypeDefinition = async function (selectedDatasourceType, datasourceTypeParameterPrefix, datasourceFileInputId) { + var datasourceTypeDefinition = { + "parameters": [], + "type": selectedDatasourceType.type + }; + if (selectedDatasourceType.type === "FILE") { + // get file if present + // upload it to importer + // use file reference name for datasourceType definition + var file = document.getElementById(datasourceFileInputId).files[0]; + if (file === null || file === undefined) { + return null; + } + var fileUploadName; + try { + fileUploadName = await this.uploadNewFile(file, file.name); + } + catch (error) { + console.error("Error while uploading file to importer."); + console.error(error); + kommonitorDataExchangeService.displayMapApplicationError(error); + throw error; + } datasourceTypeDefinition.parameters.push({ - "name": parameterName, - "value": parameterValue + "name": "NAME", + "value": fileUploadName }); - } } - } - } - - return datasourceTypeDefinition; - }; - - this.buildPutBody_georesources = function(scopeProperties) { - - var putBody = - { - "geoJsonString": "", - "periodOfValidity": { - "endDate": scopeProperties.periodOfValidity.endDate, - "startDate": scopeProperties.periodOfValidity.startDate - }, - "isPartialUpdate": scopeProperties.isPartialUpdate + else { + if (selectedDatasourceType.parameters.length > 0) { + for (const parameter of selectedDatasourceType.parameters) { + var parameterName = parameter.name; + var parameterValue = $("#" + datasourceTypeParameterPrefix + parameterName).val(); + if (parameterValue === undefined || parameterValue === null) { + return null; + } + else { + datasourceTypeDefinition.parameters.push({ + "name": parameterName, + "value": parameterValue + }); + } + } + } + } + return datasourceTypeDefinition; + }; + this.buildPutBody_georesources = function (scopeProperties) { + var putBody = { + "geoJsonString": "", + "periodOfValidity": { + "endDate": scopeProperties.periodOfValidity.endDate, + "startDate": scopeProperties.periodOfValidity.startDate + }, + "isPartialUpdate": scopeProperties.isPartialUpdate + }; + return putBody; + }; + this.buildPutBody_indicators = function (scopeProperties) { + var putBody = { + "indicatorValues": [], + "applicableSpatialUnit": scopeProperties.targetSpatialUnitMetadata.spatialUnitLevel, + "defaultClassificationMapping": scopeProperties.currentIndicatorDataset.defaultClassificationMapping, + "allowedRoles": scopeProperties.allowedRoles + }; + return putBody; + }; + this.buildPropertyMapping_spatialResource = function (nameProperty, idPropety, validStartDateProperty, validEndDateProperty, arisenFromProperty, keepAttributes, keepMissingValues, attributeMappings_adminView) { + if (validStartDateProperty === "") { + validStartDateProperty = undefined; + } + if (validEndDateProperty === "") { + validEndDateProperty = undefined; + } + if (arisenFromProperty === "") { + arisenFromProperty = undefined; + } + var propertyMapping = { + "arisenFromProperty": arisenFromProperty, + "identifierProperty": idPropety, + "nameProperty": nameProperty, + "validEndDateProperty": validEndDateProperty, + "validStartDateProperty": validStartDateProperty, + "keepAttributes": keepAttributes, + "keepMissingOrNullValueAttributes": keepMissingValues, + "attributes": [] + }; + if (!keepAttributes) { + // add attribute mappings + attributeMappings_adminView.forEach(attributeMapping_adminView => { + propertyMapping.attributes.push({ + name: attributeMapping_adminView.sourceName, + mappingName: attributeMapping_adminView.destinationName, + type: attributeMapping_adminView.dataType.apiName + }); + }); + } + return propertyMapping; + }; + this.buildPropertyMapping_indicatorResource = function (spatialReferenceKeyProperty, timeseriesMappings, keepMissingOrNullValueIndicator) { + console.log(spatialReferenceKeyProperty); + console.log(timeseriesMappings); + console.log(keepMissingOrNullValueIndicator); + // attributeMapping is undefined for indicators + return { + "spatialReferenceKeyProperty": spatialReferenceKeyProperty, + "timeseriesMappings": timeseriesMappings, + "keepMissingOrNullValueIndicator": keepMissingOrNullValueIndicator, + "attributeMappings": undefined + }; + }; + this.registerNewSpatialUnit = async function (converterDefinition, datasourceTypeDefinition, propertyMappingDefinition, spatiaUnitPostBody_managementAPI, isDryRun) { + console.log("Trying to POST to importer service to register new spatial unit."); + var postBody = { + "converter": converterDefinition, + "dataSource": datasourceTypeDefinition, + "propertyMapping": propertyMappingDefinition, + "spatialUnitPostBody": spatiaUnitPostBody_managementAPI, + "dryRun": isDryRun + }; + return await $http({ + url: this.targetUrlToImporterService + "spatial-units", + method: "POST", + data: postBody, + headers: { + 'Content-Type': "application/json" + } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + return response.data; + }, function errorCallback(response) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while posting to importer service."); + throw response; + }); + }; + this.updateSpatialUnit = async function (converterDefinition, datasourceTypeDefinition, propertyMappingDefinition, spatialUnitId, spatialUnitPutBody_managementAPI, isDryRun) { + console.log("Trying to POST to importer service to update spatial unit with id '" + spatialUnitId + "'."); + var postBody = { + "converter": converterDefinition, + "dataSource": datasourceTypeDefinition, + "propertyMapping": propertyMappingDefinition, + "spatialUnitId": spatialUnitId, + "spatialUnitPutBody": spatialUnitPutBody_managementAPI, + "dryRun": isDryRun + }; + return await $http({ + url: this.targetUrlToImporterService + "spatial-units/update", + method: "POST", + data: postBody, + headers: { + 'Content-Type': "application/json" + } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + return response.data; + }, function errorCallback(response) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while posting to importer service."); + throw response; + }); + }; + this.registerNewGeoresource = async function (converterDefinition, datasourceTypeDefinition, propertyMappingDefinition, georesourcePostBody_managementAPI, isDryRun) { + console.log("Trying to POST to importer service to register new georesource."); + var postBody = { + "converter": converterDefinition, + "dataSource": datasourceTypeDefinition, + "propertyMapping": propertyMappingDefinition, + "georesourcePostBody": georesourcePostBody_managementAPI, + "dryRun": isDryRun + }; + return await $http({ + url: this.targetUrlToImporterService + "georesources", + method: "POST", + data: postBody, + headers: { + 'Content-Type': "application/json" + } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + return response.data; + }, function errorCallback(response) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while posting to importer service."); + throw response; + }); + }; + this.updateGeoresource = async function (converterDefinition, datasourceTypeDefinition, propertyMappingDefinition, georesourceId, georesourcePutBody_managementAPI, isDryRun) { + console.log("Trying to POST to importer service to update georesource with id '" + georesourceId + "'."); + var postBody = { + "converter": converterDefinition, + "dataSource": datasourceTypeDefinition, + "propertyMapping": propertyMappingDefinition, + "georesourceId": georesourceId, + "georesourcePutBody": georesourcePutBody_managementAPI, + "dryRun": isDryRun + }; + return await $http({ + url: this.targetUrlToImporterService + "georesources/update", + method: "POST", + data: postBody, + headers: { + 'Content-Type': "application/json" + } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + return response.data; + }, function errorCallback(response) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while posting to importer service."); + throw response; + }); }; - - return putBody; - } - - this.buildPutBody_indicators = function(scopeProperties){ - - var putBody = - { - "indicatorValues": [], - "applicableSpatialUnit": scopeProperties.targetSpatialUnitMetadata.spatialUnitLevel, - "defaultClassificationMapping": scopeProperties.currentIndicatorDataset.defaultClassificationMapping, - "allowedRoles": scopeProperties.allowedRoles - }; - - return putBody; - }; - - this.buildPropertyMapping_spatialResource = function(nameProperty, idPropety, validStartDateProperty, validEndDateProperty, arisenFromProperty, keepAttributes, keepMissingValues, attributeMappings_adminView){ - if(validStartDateProperty === ""){ - validStartDateProperty = undefined; - } - if(validEndDateProperty === ""){ - validEndDateProperty = undefined; - } - if(arisenFromProperty === ""){ - arisenFromProperty = undefined; - } - - var propertyMapping = { - "arisenFromProperty": arisenFromProperty, - "identifierProperty": idPropety, - "nameProperty": nameProperty, - "validEndDateProperty": validEndDateProperty, - "validStartDateProperty": validStartDateProperty, - "keepAttributes": keepAttributes, - "keepMissingOrNullValueAttributes": keepMissingValues, - "attributes": [] + this.registerNewIndicator = async function (converterDefinition, datasourceTypeDefinition, propertyMappingDefinition, indicatorPostBody_managementAPI, isDryRun) { + console.log("Trying to POST to importer service to register new indicator."); + var postBody = { + "converter": converterDefinition, + "dataSource": datasourceTypeDefinition, + "propertyMapping": propertyMappingDefinition, + "indicatorPostBody": indicatorPostBody_managementAPI, + "dryRun": isDryRun + }; + return await $http({ + url: this.targetUrlToImporterService + "indicators", + method: "POST", + data: postBody, + headers: { + 'Content-Type': "application/json" + } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + return response.data; + }, function errorCallback(response) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while posting to importer service."); + throw response; + }); }; - - if (! keepAttributes){ - // add attribute mappings - attributeMappings_adminView.forEach(attributeMapping_adminView => { - propertyMapping.attributes.push({ - name: attributeMapping_adminView.sourceName, - mappingName: attributeMapping_adminView.destinationName, - type: attributeMapping_adminView.dataType.apiName - }); - }); - } - - return propertyMapping; - - }; - - this.buildPropertyMapping_indicatorResource = function(spatialReferenceKeyProperty, timeseriesMappings, keepMissingOrNullValueIndicator){ - console.log(spatialReferenceKeyProperty); - console.log(timeseriesMappings); - console.log(keepMissingOrNullValueIndicator); - // attributeMapping is undefined for indicators - return { - "spatialReferenceKeyProperty": spatialReferenceKeyProperty, - "timeseriesMappings": timeseriesMappings, - "keepMissingOrNullValueIndicator": keepMissingOrNullValueIndicator, - "attributeMappings": undefined + this.updateIndicator = async function (converterDefinition, datasourceTypeDefinition, propertyMappingDefinition, indicatorId, indicatorPutBody_managementAPI, isDryRun) { + console.log("Trying to POST to importer service to update indicator with id '" + indicatorId + "'."); + var postBody = { + "converter": converterDefinition, + "dataSource": datasourceTypeDefinition, + "propertyMapping": propertyMappingDefinition, + "indicatorId": indicatorId, + "indicatorPutBody": indicatorPutBody_managementAPI, + "dryRun": isDryRun + }; + return await $http({ + url: this.targetUrlToImporterService + "indicators/update", + method: "POST", + data: postBody, + headers: { + 'Content-Type': "application/json" + } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + return response.data; + }, function errorCallback(response) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while posting to importer service."); + throw response; + }); + }; + this.importerResponseContainsErrors = function (importerResponse) { + if (importerResponse.errors && importerResponse.errors.length > 0) { + return true; + } + return false; + }; + this.getIdFromImporterResponse = function (importerResponse) { + if (importerResponse.uri) { + return importerResponse.uri; + } + return undefined; + }; + this.getErrorsFromImporterResponse = function (importerResponse) { + if (importerResponse.errors) { + return importerResponse.errors; + } + return undefined; + }; + this.getImportedFeaturesFromImporterResponse = function (importerResponse) { + if (importerResponse.importedFeatures) { + return importerResponse.importedFeatures; + } + return undefined; }; - }; - - this.registerNewSpatialUnit = async function(converterDefinition, datasourceTypeDefinition, propertyMappingDefinition, spatiaUnitPostBody_managementAPI, isDryRun){ - console.log("Trying to POST to importer service to register new spatial unit."); - - var postBody = { - "converter": converterDefinition, - "dataSource": datasourceTypeDefinition, - "propertyMapping": propertyMappingDefinition, - "spatialUnitPostBody": spatiaUnitPostBody_managementAPI, - "dryRun": isDryRun - }; - - return await $http({ - url: this.targetUrlToImporterService + "spatial-units", - method: "POST", - data: postBody, - headers: { - 'Content-Type': "application/json" - } - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(response) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while posting to importer service."); - throw response; - }); - }; - - this.updateSpatialUnit = async function(converterDefinition, datasourceTypeDefinition, propertyMappingDefinition, spatialUnitId, spatialUnitPutBody_managementAPI, isDryRun){ - console.log("Trying to POST to importer service to update spatial unit with id '" + spatialUnitId + "'."); - - var postBody = { - "converter": converterDefinition, - "dataSource": datasourceTypeDefinition, - "propertyMapping": propertyMappingDefinition, - "spatialUnitId": spatialUnitId, - "spatialUnitPutBody": spatialUnitPutBody_managementAPI, - "dryRun": isDryRun - }; - - return await $http({ - url: this.targetUrlToImporterService + "spatial-units/update", - method: "POST", - data: postBody, - headers: { - 'Content-Type': "application/json" - } - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(response) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while posting to importer service."); - throw response; - }); - }; - - - - this.registerNewGeoresource = async function(converterDefinition, datasourceTypeDefinition, propertyMappingDefinition, georesourcePostBody_managementAPI, isDryRun){ - console.log("Trying to POST to importer service to register new georesource."); - - var postBody = { - "converter": converterDefinition, - "dataSource": datasourceTypeDefinition, - "propertyMapping": propertyMappingDefinition, - "georesourcePostBody": georesourcePostBody_managementAPI, - "dryRun": isDryRun - }; - - return await $http({ - url: this.targetUrlToImporterService + "georesources", - method: "POST", - data: postBody, - headers: { - 'Content-Type': "application/json" - } - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(response) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while posting to importer service."); - throw response; - }); - }; - - this.updateGeoresource = async function(converterDefinition, datasourceTypeDefinition, propertyMappingDefinition, georesourceId, georesourcePutBody_managementAPI, isDryRun){ - console.log("Trying to POST to importer service to update georesource with id '" + georesourceId + "'."); - - var postBody = { - "converter": converterDefinition, - "dataSource": datasourceTypeDefinition, - "propertyMapping": propertyMappingDefinition, - "georesourceId": georesourceId, - "georesourcePutBody": georesourcePutBody_managementAPI, - "dryRun": isDryRun - }; - - return await $http({ - url: this.targetUrlToImporterService + "georesources/update", - method: "POST", - data: postBody, - headers: { - 'Content-Type': "application/json" - } - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(response) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while posting to importer service."); - throw response; - }); - }; - - - - this.registerNewIndicator = async function(converterDefinition, datasourceTypeDefinition, propertyMappingDefinition, indicatorPostBody_managementAPI, isDryRun){ - console.log("Trying to POST to importer service to register new indicator."); - - var postBody = { - "converter": converterDefinition, - "dataSource": datasourceTypeDefinition, - "propertyMapping": propertyMappingDefinition, - "indicatorPostBody": indicatorPostBody_managementAPI, - "dryRun": isDryRun - }; - - return await $http({ - url: this.targetUrlToImporterService + "indicators", - method: "POST", - data: postBody, - headers: { - 'Content-Type': "application/json" - } - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(response) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while posting to importer service."); - throw response; - }); - }; - - this.updateIndicator = async function(converterDefinition, datasourceTypeDefinition, propertyMappingDefinition, indicatorId, indicatorPutBody_managementAPI, isDryRun){ - console.log("Trying to POST to importer service to update indicator with id '" + indicatorId + "'."); - - var postBody = { - "converter": converterDefinition, - "dataSource": datasourceTypeDefinition, - "propertyMapping": propertyMappingDefinition, - "indicatorId": indicatorId, - "indicatorPutBody": indicatorPutBody_managementAPI, - "dryRun": isDryRun - }; - - return await $http({ - url: this.targetUrlToImporterService + "indicators/update", - method: "POST", - data: postBody, - headers: { - 'Content-Type': "application/json" - } - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(response) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while posting to importer service."); - throw response; - }); - }; - - this.importerResponseContainsErrors = function (importerResponse){ - if (importerResponse.errors && importerResponse.errors.length > 0){ - return true; - } - return false; - }; - - this.getIdFromImporterResponse = function (importerResponse){ - if (importerResponse.uri){ - return importerResponse.uri; - } - return undefined; - }; - - this.getErrorsFromImporterResponse = function (importerResponse){ - if (importerResponse.errors){ - return importerResponse.errors; - } - return undefined; - }; - - this.getImportedFeaturesFromImporterResponse = function (importerResponse){ - if (importerResponse.importedFeatures){ - return importerResponse.importedFeatures; - } - return undefined; - }; - - }]); +//# sourceMappingURL=kommonitor-importer-helper-service.module.js.map \ No newline at end of file diff --git a/app/util/genericServices/kommonitorImporterHelperService/kommonitor-importer-helper-service.module.js.map b/app/util/genericServices/kommonitorImporterHelperService/kommonitor-importer-helper-service.module.js.map new file mode 100644 index 000000000..7290c3b83 --- /dev/null +++ b/app/util/genericServices/kommonitorImporterHelperService/kommonitor-importer-helper-service.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-importer-helper-service.module.js","sourceRoot":"","sources":["kommonitor-importer-helper-service.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,0BAA0B,EAAE,CAAC,w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C;aAC1C;YACD,OAAO,SAAS,CAAC;QACnB,CAAC,CAAC;IAGJ,CAAC,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/util/genericServices/kommonitorImporterHelperService/kommonitor-importer-helper-service.module.ts b/app/util/genericServices/kommonitorImporterHelperService/kommonitor-importer-helper-service.module.ts new file mode 100644 index 000000000..66f177d46 --- /dev/null +++ b/app/util/genericServices/kommonitorImporterHelperService/kommonitor-importer-helper-service.module.ts @@ -0,0 +1,730 @@ +angular.module('kommonitorImporterHelper', ['kommonitorDataExchange']); + +/** + * a common serviceInstance that holds all needed properties for a WPS service. + * + * This service represents a shared object ´which is used across the different + * application tabs/components like Setup, Capabilities, Execute etc. + * + * This way, one single service instance can be used to easily share values and + * parameters for each WPS operation represented by different Angular components + */ +angular + .module('kommonitorImporterHelper', []) + .service( + 'kommonitorImporterHelperService', ['$rootScope', '$timeout', 'kommonitorDataExchangeService', '$http', '__env', + function ($rootScope, $timeout, + kommonitorDataExchangeService, $http, __env) { + + this.targetUrlToImporterService = __env.targetUrlToImporterService; + + this.availableConverters = undefined; + + this.availableDatasourceTypes = undefined; + + this.attributeMapping_attributeTypes = [ + { + displayName: "Text/String", + apiName: "string" + }, + { + displayName: "Ganzzahl", + apiName: "integer" + }, + { + displayName: "Gleitkommazahl", + apiName: "float" + }, + { + displayName: "Datum", + apiName: "date" + }, + ]; + + this.mappingConfigStructure = { + "converter": { + "encoding": "string", + "mimeType": "string", + "name": "string", + "parameters": [ + { + "name": "string", + "value": "string" + } + ], + "schema": "string" + }, + "dataSource": { + "parameters": [ + { + "name": "string", + "value": "string" + } + ], + "type": "FILE" // FILE|HTTP|INLINE + }, + "propertyMapping": { + "arisenFromProperty": "string", + "attributes": [ + { + "mappingName": "string", // target name + "name": "string", // source name + "type": "string" // dataType, [string|integer|float|date] + } + ], + "identifierProperty": "string", + "keepAttributes": true, // if true, then mapping under attributes is ignored and all attributes are imported with the same attribute name + "nameProperty": "string", + "validEndDateProperty": "string", + "validStartDateProperty": "string" + }, + "periodOfValidity":{ + "startDate": "yyyy-mm-tt", + "endDate": "yyyy-mm-tt" + } + }; + + this.mappingConfigStructure_indicator = { + "converter": { + "encoding": "string", + "mimeType": "string", + "name": "string", + "parameters": [ + { + "name": "string", + "value": "string" + } + ], + "schema": "string" + }, + "dataSource": { + "parameters": [ + { + "name": "string", + "value": "string" + } + ], + "type": "FILE" // FILE|HTTP|INLINE + }, + "propertyMapping": { + "attributeMappings": [ + { + "mappingName": "string", + "name": "string", + "type": "string" + } + ], + "spatialReferenceKeyProperty": "string", + "timeseriesMappings": [ + { + "indicatorValueProperty": "string", + "timestamp": "string", + "timestampProperty": "string" + } + ] + }, + "targetSpatialUnitName": "string" + }; + + this.converterDefinition_singleFeatureImport = { + "encoding": "UTF-8", + "mimeType": "application/geo+json", + "name": "GeoJSON", + "parameters": [ + { + "name": "CRS", + "value": "EPSG:4326" + } + ] + }; + + this.datasourceDefinition_singleFeatureImport = { + "parameters": [ + { + "name": "payload", + "value": "geojsonValue" + } + ], + "type": "INLINE" + }; + + this.propertyMappingDefinition_singleFeatureImport = { + "identifierProperty": "ID", + "nameProperty": "NAME", + "keepAttributes": true, + "keepMissingOrNullValueAttributes": true, + "attributes": [] + }; + + this.fetchResourcesFromImporter = async function(){ + console.log("Trying to fetch converters and datasourceTypes from importer service"); + this.availableConverters = await this.fetchConverters(); + this.availableDatasourceTypes = await this.fetchDatasourceTypes(); + + if(! this.availableConverters || ! this.availableDatasourceTypes){ + + kommonitorDataExchangeService.displayMapApplicationError("Notwendige Anbindung an Importer-Service ist fehlerhaft. Bitte wenden Sie sich an Ihren Administrator."); + + return; + } + + for (let index = 0; index < this.availableConverters.length; index++) { + var converter = this.availableConverters[index]; + + converter = await this.fetchConverterDetails(converter); + this.availableConverters[index] = converter; + } + + for (let k = 0; k < this.availableDatasourceTypes.length; k++) { + this.availableDatasourceTypes[k] = await this.fetchDatasourceTypeDetails(this.availableDatasourceTypes[k]); + } + + setTimeout(() => { + $rootScope.$apply(); + }, 1500); + + }; + + this.filterConverters = function(resourceType) { + // remove csvLatLon for indicators + // and csv_onlyIndicator for georesources + return function (converter) { + if(resourceType === "georesource" && converter.name.includes("Indikator")) + return false; + if(resourceType === "spatialUnit" && (converter.name.includes("Indikator") || converter.name.includes("Tabelle"))) + return false; + if(resourceType === "indicator" && (converter.name.includes("Geokodierung") || converter.name.includes("Koordinate")) ) + return false; + + return true; + }; + }; + + this.fetchConverters = async function(){ + return await $http({ + url: this.targetUrlToImporterService + "converters", + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + return response.data; + + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while fetching converters from importer."); + kommonitorDataExchangeService.displayMapApplicationError(error); + + }); + }; + + this.fetchConverterDetails = async function(converter){ + return await $http({ + url: this.targetUrlToImporterService + "converters/" + converter.name, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + return response.data; + + }, function errorCallback(response) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while fetching converter for name '" + converter.name + "' from importer."); + + }); + }; + + this.fetchDatasourceTypes = async function(){ + return await $http({ + url: this.targetUrlToImporterService + "datasourceTypes", + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + return response.data; + + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while fetching datasourceTypes from importer."); + kommonitorDataExchangeService.displayMapApplicationError(error); + }); + }; + + this.fetchDatasourceTypeDetails = async function(datasourceType){ + return await $http({ + url: this.targetUrlToImporterService + "datasourceTypes/" + datasourceType.type, + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + return response.data; + + }, function errorCallback(response) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while fetching datasourceType for type '" + datasource.type + "' from importer."); + }); + }; + + // load data + this.fetchResourcesFromImporter(); + + + this.uploadNewFile = async function(fileData, fileName){ + console.log("Trying to POST to importer service to upload a new file."); + + var formdata = new FormData(); + formdata.append("filename", fileName); + formdata.append("file", fileData); + + return await $http({ + url: this.targetUrlToImporterService + "upload", + method: "POST", + data: formdata, + // must set header content-type to undefined in order to send as multipart-formdata + headers: {"Content-Type": undefined, "Accept": "text/plain" }, + responseType: 'text' + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + return response.data; + + }, function errorCallback(response) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while posting to importer service."); + throw response; + }); + }; + + this.buildConverterDefinition = function(selectedConverter, converterParameterPrefix, schema, mimeType){ + var converterDefinition = { + "encoding": selectedConverter.encodings[0], + "mimeType": selectedConverter.mimeTypes.filter(element => element == mimeType)[0], + "name": selectedConverter.name, + "parameters": [ + + ], + "schema": undefined + }; + + if(selectedConverter.schemas){ + if (schema === undefined || schema === null){ + return null; + } + else{ + converterDefinition.schema = schema; + } + } + + if(selectedConverter.parameters.length > 0){ + for (const parameter of selectedConverter.parameters) { + var parameterName = parameter.name; + var parameterValue = $("#" + converterParameterPrefix + parameterName).val(); + + if(parameter.mandatory){ + + } + + if (parameter.mandatory && (parameterValue === undefined || parameterValue === null || parameterValue === "")){ + return null; + } + else{ + if(parameterValue && !(parameterValue === "")){ + converterDefinition.parameters.push({ + "name": parameterName, + "value": parameterValue + }); + } + + } + } + } + + return converterDefinition; + }; + + this.buildDatasourceTypeDefinition = async function(selectedDatasourceType, datasourceTypeParameterPrefix, datasourceFileInputId){ + var datasourceTypeDefinition = { + "parameters": [ + + ], + "type": selectedDatasourceType.type + }; + + if(selectedDatasourceType.type === "FILE"){ + // get file if present + + // upload it to importer + + // use file reference name for datasourceType definition + + + var file = document.getElementById(datasourceFileInputId).files[0]; + + if(file === null || file === undefined){ + return null; + } + + var fileUploadName; + try { + fileUploadName = await this.uploadNewFile(file, file.name); + } catch (error) { + console.error("Error while uploading file to importer."); + console.error(error); + kommonitorDataExchangeService.displayMapApplicationError(error); + throw error; + } + + datasourceTypeDefinition.parameters.push({ + "name": "NAME", + "value": fileUploadName + }); + } + else{ + if(selectedDatasourceType.parameters.length > 0){ + for (const parameter of selectedDatasourceType.parameters) { + var parameterName = parameter.name; + var parameterValue = $("#" + datasourceTypeParameterPrefix + parameterName).val(); + + if (parameterValue === undefined || parameterValue === null){ + return null; + } + else{ + datasourceTypeDefinition.parameters.push({ + "name": parameterName, + "value": parameterValue + }); + } + } + } + } + + return datasourceTypeDefinition; + }; + + this.buildPutBody_georesources = function(scopeProperties) { + + var putBody = + { + "geoJsonString": "", + "periodOfValidity": { + "endDate": scopeProperties.periodOfValidity.endDate, + "startDate": scopeProperties.periodOfValidity.startDate + }, + "isPartialUpdate": scopeProperties.isPartialUpdate + }; + + return putBody; + } + + this.buildPutBody_indicators = function(scopeProperties){ + + var putBody = + { + "indicatorValues": [], + "applicableSpatialUnit": scopeProperties.targetSpatialUnitMetadata.spatialUnitLevel, + "defaultClassificationMapping": scopeProperties.currentIndicatorDataset.defaultClassificationMapping, + "allowedRoles": scopeProperties.allowedRoles + }; + + return putBody; + }; + + this.buildPropertyMapping_spatialResource = function(nameProperty, idPropety, validStartDateProperty, validEndDateProperty, arisenFromProperty, keepAttributes, keepMissingValues, attributeMappings_adminView){ + if(validStartDateProperty === ""){ + validStartDateProperty = undefined; + } + if(validEndDateProperty === ""){ + validEndDateProperty = undefined; + } + if(arisenFromProperty === ""){ + arisenFromProperty = undefined; + } + + var propertyMapping = { + "arisenFromProperty": arisenFromProperty, + "identifierProperty": idPropety, + "nameProperty": nameProperty, + "validEndDateProperty": validEndDateProperty, + "validStartDateProperty": validStartDateProperty, + "keepAttributes": keepAttributes, + "keepMissingOrNullValueAttributes": keepMissingValues, + "attributes": [] + }; + + if (! keepAttributes){ + // add attribute mappings + attributeMappings_adminView.forEach(attributeMapping_adminView => { + propertyMapping.attributes.push({ + name: attributeMapping_adminView.sourceName, + mappingName: attributeMapping_adminView.destinationName, + type: attributeMapping_adminView.dataType.apiName + }); + }); + } + + return propertyMapping; + + }; + + this.buildPropertyMapping_indicatorResource = function(spatialReferenceKeyProperty, timeseriesMappings, keepMissingOrNullValueIndicator){ + console.log(spatialReferenceKeyProperty); + console.log(timeseriesMappings); + console.log(keepMissingOrNullValueIndicator); + // attributeMapping is undefined for indicators + return { + "spatialReferenceKeyProperty": spatialReferenceKeyProperty, + "timeseriesMappings": timeseriesMappings, + "keepMissingOrNullValueIndicator": keepMissingOrNullValueIndicator, + "attributeMappings": undefined + }; + }; + + this.registerNewSpatialUnit = async function(converterDefinition, datasourceTypeDefinition, propertyMappingDefinition, spatiaUnitPostBody_managementAPI, isDryRun){ + console.log("Trying to POST to importer service to register new spatial unit."); + + var postBody = { + "converter": converterDefinition, + "dataSource": datasourceTypeDefinition, + "propertyMapping": propertyMappingDefinition, + "spatialUnitPostBody": spatiaUnitPostBody_managementAPI, + "dryRun": isDryRun + }; + + return await $http({ + url: this.targetUrlToImporterService + "spatial-units", + method: "POST", + data: postBody, + headers: { + 'Content-Type': "application/json" + } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + return response.data; + + }, function errorCallback(response) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while posting to importer service."); + throw response; + }); + }; + + this.updateSpatialUnit = async function(converterDefinition, datasourceTypeDefinition, propertyMappingDefinition, spatialUnitId, spatialUnitPutBody_managementAPI, isDryRun){ + console.log("Trying to POST to importer service to update spatial unit with id '" + spatialUnitId + "'."); + + var postBody = { + "converter": converterDefinition, + "dataSource": datasourceTypeDefinition, + "propertyMapping": propertyMappingDefinition, + "spatialUnitId": spatialUnitId, + "spatialUnitPutBody": spatialUnitPutBody_managementAPI, + "dryRun": isDryRun + }; + + return await $http({ + url: this.targetUrlToImporterService + "spatial-units/update", + method: "POST", + data: postBody, + headers: { + 'Content-Type': "application/json" + } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + return response.data; + + }, function errorCallback(response) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while posting to importer service."); + throw response; + }); + }; + + + + this.registerNewGeoresource = async function(converterDefinition, datasourceTypeDefinition, propertyMappingDefinition, georesourcePostBody_managementAPI, isDryRun){ + console.log("Trying to POST to importer service to register new georesource."); + + var postBody = { + "converter": converterDefinition, + "dataSource": datasourceTypeDefinition, + "propertyMapping": propertyMappingDefinition, + "georesourcePostBody": georesourcePostBody_managementAPI, + "dryRun": isDryRun + }; + + return await $http({ + url: this.targetUrlToImporterService + "georesources", + method: "POST", + data: postBody, + headers: { + 'Content-Type': "application/json" + } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + return response.data; + + }, function errorCallback(response) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while posting to importer service."); + throw response; + }); + }; + + this.updateGeoresource = async function(converterDefinition, datasourceTypeDefinition, propertyMappingDefinition, georesourceId, georesourcePutBody_managementAPI, isDryRun){ + console.log("Trying to POST to importer service to update georesource with id '" + georesourceId + "'."); + + var postBody = { + "converter": converterDefinition, + "dataSource": datasourceTypeDefinition, + "propertyMapping": propertyMappingDefinition, + "georesourceId": georesourceId, + "georesourcePutBody": georesourcePutBody_managementAPI, + "dryRun": isDryRun + }; + + return await $http({ + url: this.targetUrlToImporterService + "georesources/update", + method: "POST", + data: postBody, + headers: { + 'Content-Type': "application/json" + } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + return response.data; + + }, function errorCallback(response) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while posting to importer service."); + throw response; + }); + }; + + + + this.registerNewIndicator = async function(converterDefinition, datasourceTypeDefinition, propertyMappingDefinition, indicatorPostBody_managementAPI, isDryRun){ + console.log("Trying to POST to importer service to register new indicator."); + + var postBody = { + "converter": converterDefinition, + "dataSource": datasourceTypeDefinition, + "propertyMapping": propertyMappingDefinition, + "indicatorPostBody": indicatorPostBody_managementAPI, + "dryRun": isDryRun + }; + + return await $http({ + url: this.targetUrlToImporterService + "indicators", + method: "POST", + data: postBody, + headers: { + 'Content-Type': "application/json" + } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + return response.data; + + }, function errorCallback(response) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while posting to importer service."); + throw response; + }); + }; + + this.updateIndicator = async function(converterDefinition, datasourceTypeDefinition, propertyMappingDefinition, indicatorId, indicatorPutBody_managementAPI, isDryRun){ + console.log("Trying to POST to importer service to update indicator with id '" + indicatorId + "'."); + + var postBody = { + "converter": converterDefinition, + "dataSource": datasourceTypeDefinition, + "propertyMapping": propertyMappingDefinition, + "indicatorId": indicatorId, + "indicatorPutBody": indicatorPutBody_managementAPI, + "dryRun": isDryRun + }; + + return await $http({ + url: this.targetUrlToImporterService + "indicators/update", + method: "POST", + data: postBody, + headers: { + 'Content-Type': "application/json" + } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + return response.data; + + }, function errorCallback(response) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while posting to importer service."); + throw response; + }); + }; + + this.importerResponseContainsErrors = function (importerResponse){ + if (importerResponse.errors && importerResponse.errors.length > 0){ + return true; + } + return false; + }; + + this.getIdFromImporterResponse = function (importerResponse){ + if (importerResponse.uri){ + return importerResponse.uri; + } + return undefined; + }; + + this.getErrorsFromImporterResponse = function (importerResponse){ + if (importerResponse.errors){ + return importerResponse.errors; + } + return undefined; + }; + + this.getImportedFeaturesFromImporterResponse = function (importerResponse){ + if (importerResponse.importedFeatures){ + return importerResponse.importedFeatures; + } + return undefined; + }; + + + }]); diff --git a/app/util/genericServices/kommonitorInfoLegendHelperService/kommonitor-info-legend-helper-service.module.js b/app/util/genericServices/kommonitorInfoLegendHelperService/kommonitor-info-legend-helper-service.module.js index 9f1bb46a3..5fdddac09 100644 --- a/app/util/genericServices/kommonitorInfoLegendHelperService/kommonitor-info-legend-helper-service.module.js +++ b/app/util/genericServices/kommonitorInfoLegendHelperService/kommonitor-info-legend-helper-service.module.js @@ -1,5 +1,5 @@ +"use strict"; angular.module('kommonitorInfoLegendHelper', ['kommonitorDataExchange']); - /** * a common serviceInstance that holds all needed properties for a WPS service. * @@ -10,12 +10,8 @@ angular.module('kommonitorInfoLegendHelper', ['kommonitorDataExchange']); * parameters for each WPS operation represented by different Angular components */ angular - .module('kommonitorInfoLegendHelper', []) - .service( - 'kommonitorInfoLegendHelperService', ['$rootScope', '$timeout', 'kommonitorDataExchangeService', '$http', '__env', - function ($rootScope, $timeout, - kommonitorDataExchangeService, $http, __env) { - - - + .module('kommonitorInfoLegendHelper', []) + .service('kommonitorInfoLegendHelperService', ['$rootScope', '$timeout', 'kommonitorDataExchangeService', '$http', '__env', + function ($rootScope, $timeout, kommonitorDataExchangeService, $http, __env) { }]); +//# sourceMappingURL=kommonitor-info-legend-helper-service.module.js.map \ No newline at end of file diff --git a/app/util/genericServices/kommonitorInfoLegendHelperService/kommonitor-info-legend-helper-service.module.js.map b/app/util/genericServices/kommonitorInfoLegendHelperService/kommonitor-info-legend-helper-service.module.js.map new file mode 100644 index 000000000..2c16026ad --- /dev/null +++ b/app/util/genericServices/kommonitorInfoLegendHelperService/kommonitor-info-legend-helper-service.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-info-legend-helper-service.module.js","sourceRoot":"","sources":["kommonitor-info-legend-helper-service.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,4BAA4B,EAAE,CAAC,wBAAwB,CAAC,CAAC,CAAC;AAEzE;;;;;;;;GAQG;AACH,OAAO;KACJ,MAAM,CAAC,4BAA4B,EAAE,EAAE,CAAC;KACxC,OAAO,CACN,mCAAmC,EAAE,CAAC,YAAY,EAAE,UAAU,EAAE,+BAA+B,EAAE,OAAO,EAAE,OAAO;IACjH,UAAU,UAAU,EAAE,QAAQ,EAC5B,6BAA6B,EAAE,KAAK,EAAE,KAAK;IAI7C,CAAC,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/util/genericServices/kommonitorInfoLegendHelperService/kommonitor-info-legend-helper-service.module.ts b/app/util/genericServices/kommonitorInfoLegendHelperService/kommonitor-info-legend-helper-service.module.ts new file mode 100644 index 000000000..9f1bb46a3 --- /dev/null +++ b/app/util/genericServices/kommonitorInfoLegendHelperService/kommonitor-info-legend-helper-service.module.ts @@ -0,0 +1,21 @@ +angular.module('kommonitorInfoLegendHelper', ['kommonitorDataExchange']); + +/** + * a common serviceInstance that holds all needed properties for a WPS service. + * + * This service represents a shared object ´which is used across the different + * application tabs/components like Setup, Capabilities, Execute etc. + * + * This way, one single service instance can be used to easily share values and + * parameters for each WPS operation represented by different Angular components + */ +angular + .module('kommonitorInfoLegendHelper', []) + .service( + 'kommonitorInfoLegendHelperService', ['$rootScope', '$timeout', 'kommonitorDataExchangeService', '$http', '__env', + function ($rootScope, $timeout, + kommonitorDataExchangeService, $http, __env) { + + + + }]); diff --git a/app/util/genericServices/kommonitorKeycloakHelperService/kommonitor-keycloak-helper-service.module.js b/app/util/genericServices/kommonitorKeycloakHelperService/kommonitor-keycloak-helper-service.module.js index 9b8049394..5edd4088b 100644 --- a/app/util/genericServices/kommonitorKeycloakHelperService/kommonitor-keycloak-helper-service.module.js +++ b/app/util/genericServices/kommonitorKeycloakHelperService/kommonitor-keycloak-helper-service.module.js @@ -1,283 +1,232 @@ +"use strict"; angular.module('kommonitorKeycloakHelper', ['kommonitorDataExchange']); - angular - .module('kommonitorKeycloakHelper', []) - .service( - 'kommonitorKeycloakHelperService', ['$rootScope', '$timeout', '$http', '$httpParamSerializerJQLike', 'Auth', '__env', + .module('kommonitorKeycloakHelper', []) + .service('kommonitorKeycloakHelperService', ['$rootScope', '$timeout', '$http', '$httpParamSerializerJQLike', 'Auth', '__env', function ($rootScope, $timeout, $http, $httpParamSerializerJQLike, Auth, __env) { - - var self = this; - this.availableKeycloakRoles = []; - this.targetUrlToKeycloakInstance = ""; - this.targetRealmUrlToKeycloakInstance = ""; - this.realm = ""; - this.clientId = ""; - - this.roleSuffixes = ["viewer", "editor", "publisher", "creator"]; - - this.init = async function () { - try { - if (window.__env.keycloakConfig) { - this.configureKeycloakParameters(window.__env.keycloakConfig); - } - else { - await $http.get('./config/keycloak_backup.json').then(async function (response) { - self.configureKeycloakParameters(response.data); + var self = this; + this.availableKeycloakRoles = []; + this.targetUrlToKeycloakInstance = ""; + this.targetRealmUrlToKeycloakInstance = ""; + this.realm = ""; + this.clientId = ""; + this.roleSuffixes = ["viewer", "editor", "publisher", "creator"]; + this.init = async function () { + try { + if (window.__env.keycloakConfig) { + this.configureKeycloakParameters(window.__env.keycloakConfig); + } + else { + await $http.get('./config/keycloak_backup.json').then(async function (response) { + self.configureKeycloakParameters(response.data); + }); + } + } + catch (error) { + console.error("Error while initializing kommonitorKeycloakHelperService. Error while fetching and interpreting config file. Error is: " + error); + } + }; + this.configureKeycloakParameters = function (keycloakConfig) { + // // https:///auth/ + self.targetUrlToKeycloakInstance = keycloakConfig['auth-server-url']; + self.realm = keycloakConfig['realm']; + self.clientId = keycloakConfig['resource']; + // https:///auth/admin//console + self.targetRealmUrlToKeycloakInstance = self.targetUrlToKeycloakInstance + "admin/" + self.realm + "/console"; + }; + this.fetchRoles = async function () { + console.log = "Fetching roles from Keycloak instance at " + this.targetUrlToKeycloakInstance; + return await $http({ + url: this.targetUrlToKeycloakInstance + this.realm + "/clients/" + this.clientId + "/roles", + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + return response.data; + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while fetching roles from keycloak."); + }); + }; + this.postNewRole_withToken = async function (bearerToken, rolesBody) { + return await $http({ + url: this.targetUrlToKeycloakInstance + "admin/realms/" + this.realm + "/roles", + method: 'POST', + data: rolesBody, + headers: { + 'Content-Type': 'application/json', + 'Authorization': "Bearer " + bearerToken // Note the appropriate header + } + }).then(function successCallback(response) { + // return created response location + return response.data; + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while posting role to keycloak."); + throw error; + }); + }; + this.renameExistingRole_withToken = async function (bearerToken, oldRoleName, newRoleName) { + var rolesBody = { + "name": newRoleName + }; + return await $http({ + url: this.targetUrlToKeycloakInstance + "admin/realms/" + this.realm + "/roles/" + oldRoleName, + method: 'PUT', + data: rolesBody, + headers: { + 'Content-Type': 'application/json', + 'Authorization': "Bearer " + bearerToken // Note the appropriate header + } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + return response.data; + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while posting role to keycloak."); + throw error; + }); + }; + this.deleteRole_withToken = async function (bearerToken, roleName) { + return await $http({ + url: this.targetUrlToKeycloakInstance + "admin/realms/" + this.realm + "/roles/" + roleName, + method: 'DELETE', + headers: { + 'Authorization': "Bearer " + bearerToken // Note the appropriate header + } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + return response.data; + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while deleting role from keycloak."); + throw error; + }); + }; + this.getAllRoles_withToken = async function (bearerToken) { + return await $http({ + url: this.targetUrlToKeycloakInstance + "admin/realms/" + this.realm + "/roles", + method: 'GET', + headers: { + 'Authorization': "Bearer " + bearerToken // Note the appropriate header + } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + return response.data; + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while adding role to keycloak."); + throw error; }); - } - } catch (error) { - console.error("Error while initializing kommonitorKeycloakHelperService. Error while fetching and interpreting config file. Error is: " + error); - } - }; - - this.configureKeycloakParameters = function (keycloakConfig) { - // // https:///auth/ - self.targetUrlToKeycloakInstance = keycloakConfig['auth-server-url']; - self.realm = keycloakConfig['realm']; - self.clientId = keycloakConfig['resource']; - - // https:///auth/admin//console - self.targetRealmUrlToKeycloakInstance = self.targetUrlToKeycloakInstance + "admin/" + self.realm + "/console"; - }; - - this.fetchRoles = async function () { - - console.log = "Fetching roles from Keycloak instance at " + this.targetUrlToKeycloakInstance; - return await $http({ - url: this.targetUrlToKeycloakInstance + this.realm + "/clients/" + this.clientId + "/roles", - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while fetching roles from keycloak."); - - }); - }; - - this.postNewRole_withToken = async function (bearerToken, rolesBody) { - - return await $http({ - url: this.targetUrlToKeycloakInstance + "admin/realms/" + this.realm + "/roles", - method: 'POST', - data: rolesBody, - headers: { - 'Content-Type': 'application/json', - 'Authorization': "Bearer " + bearerToken // Note the appropriate header - } - }).then(function successCallback(response) { - // return created response location - return response.data; - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while posting role to keycloak."); - throw error; - }); - }; - - this.renameExistingRole_withToken = async function (bearerToken, oldRoleName, newRoleName) { - var rolesBody = { - "name": newRoleName }; - - return await $http({ - url: this.targetUrlToKeycloakInstance + "admin/realms/" + this.realm + "/roles/" + oldRoleName, - method: 'PUT', - data: rolesBody, - headers: { - 'Content-Type': 'application/json', - 'Authorization': "Bearer " + bearerToken // Note the appropriate header - } - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while posting role to keycloak."); - throw error; - - }); - }; - - this.deleteRole_withToken = async function (bearerToken, roleName) { - - return await $http({ - url: this.targetUrlToKeycloakInstance + "admin/realms/" + this.realm + "/roles/" + roleName, - method: 'DELETE', - headers: { - 'Authorization': "Bearer " + bearerToken // Note the appropriate header - } - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while deleting role from keycloak."); - throw error; - - }); - }; - - this.getAllRoles_withToken = async function (bearerToken) { - - return await $http({ - url: this.targetUrlToKeycloakInstance + "admin/realms/" + this.realm + "/roles", - method: 'GET', - headers: { - 'Authorization': "Bearer " + bearerToken // Note the appropriate header - } - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while adding role to keycloak."); - throw error; - - }); - }; - - this.addCompositeRole_withToken = async function (bearerToken, baseRole, composite) { - let data = [{ - "id": composite.id, - "name": composite.name - }]; - return await $http({ - url: this.targetUrlToKeycloakInstance + "admin/realms/" + this.realm + "/roles/" + baseRole.name + "/composites", - method: 'POST', - data: data, - headers: { - 'Authorization': "Bearer " + bearerToken // Note the appropriate header - } - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - return response.data; - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while creating composite role in keycloak."); - throw error; - }); - } - - this.postNewRoles = async function (organizationalUnitName) { - try { - // get auth token to make admin requests - var bearerToken = Auth.keycloak.token; - - // post individual roles - for (let suffix of this.roleSuffixes) { - // post individual role - await this.postNewRole_withToken(bearerToken, { "name": organizationalUnitName + "-" + suffix }); - } - const allRoles = await this.getAllRoles_withToken(bearerToken); - var roleMap = allRoles.filter(role => role.name.startsWith(organizationalUnitName + "-")) - .reduce((prev, curr) => (prev[curr.name] = curr, prev), {}); - - // Add composites - await this.addCompositeRole_withToken( - bearerToken, - roleMap[organizationalUnitName + "-editor"], - roleMap[organizationalUnitName + "-viewer"] - ); - await this.addCompositeRole_withToken( - bearerToken, - roleMap[organizationalUnitName + "-publisher"], - roleMap[organizationalUnitName + "-editor"] - ); - await this.addCompositeRole_withToken( - bearerToken, - roleMap[organizationalUnitName + "-creator"], - roleMap[organizationalUnitName + "-publisher"] - ); - } catch (error) { - throw error; - } - }; - - this.renameExistingRoles = async function (oldOrganizationalUnitName, newOrganizationalUnitName) { - try { - // first get auth token to make admin requests - var bearerToken = Auth.keycloak.token; - - for (let suffix of this.roleSuffixes) { - await this.renameExistingRole_withToken(bearerToken, oldOrganizationalUnitName + "-" + suffix, newOrganizationalUnitName + "-" + suffix); - } - } catch (error) { - throw error; - } - - }; - - this.deleteRoles = async function (organizationalUnitName) { - try { - // first get auth token to make admin requests - var bearerToken = Auth.keycloak.token; - - for (let suffix of this.roleSuffixes) { - await this.deleteRole_withToken(bearerToken, organizationalUnitName + "-" + suffix); - } - } catch (error) { - throw error; - } - }; - - this.getAllRoles = async function () { - try { - // first get auth token to make admin requests - var bearerToken = Auth.keycloak.token; - - // then make admin request - return await this.getAllRoles_withToken(bearerToken); - } catch (error) { - throw error; - } - - }; - - this.setAvailableKeycloakRoles = function (roles) { - this.availableKeycloakRoles = roles; - }; - - this.fetchAndSetKeycloakRoles = async function (username, password) { - this.setAvailableKeycloakRoles(await this.getAllRoles(username, password)); - }; - - this.isRoleInKeycloak = function (roleName) { - for (const keycloakRole of this.availableKeycloakRoles) { - if (keycloakRole.name === roleName) { - return true; - } - } - return false; - }; - - var self = this; - this.init(); - + this.addCompositeRole_withToken = async function (bearerToken, baseRole, composite) { + let data = [{ + "id": composite.id, + "name": composite.name + }]; + return await $http({ + url: this.targetUrlToKeycloakInstance + "admin/realms/" + this.realm + "/roles/" + baseRole.name + "/composites", + method: 'POST', + data: data, + headers: { + 'Authorization': "Bearer " + bearerToken // Note the appropriate header + } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + return response.data; + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while creating composite role in keycloak."); + throw error; + }); + }; + this.postNewRoles = async function (organizationalUnitName) { + try { + // get auth token to make admin requests + var bearerToken = Auth.keycloak.token; + // post individual roles + for (let suffix of this.roleSuffixes) { + // post individual role + await this.postNewRole_withToken(bearerToken, { "name": organizationalUnitName + "-" + suffix }); + } + const allRoles = await this.getAllRoles_withToken(bearerToken); + var roleMap = allRoles.filter(role => role.name.startsWith(organizationalUnitName + "-")) + .reduce((prev, curr) => (prev[curr.name] = curr, prev), {}); + // Add composites + await this.addCompositeRole_withToken(bearerToken, roleMap[organizationalUnitName + "-editor"], roleMap[organizationalUnitName + "-viewer"]); + await this.addCompositeRole_withToken(bearerToken, roleMap[organizationalUnitName + "-publisher"], roleMap[organizationalUnitName + "-editor"]); + await this.addCompositeRole_withToken(bearerToken, roleMap[organizationalUnitName + "-creator"], roleMap[organizationalUnitName + "-publisher"]); + } + catch (error) { + throw error; + } + }; + this.renameExistingRoles = async function (oldOrganizationalUnitName, newOrganizationalUnitName) { + try { + // first get auth token to make admin requests + var bearerToken = Auth.keycloak.token; + for (let suffix of this.roleSuffixes) { + await this.renameExistingRole_withToken(bearerToken, oldOrganizationalUnitName + "-" + suffix, newOrganizationalUnitName + "-" + suffix); + } + } + catch (error) { + throw error; + } + }; + this.deleteRoles = async function (organizationalUnitName) { + try { + // first get auth token to make admin requests + var bearerToken = Auth.keycloak.token; + for (let suffix of this.roleSuffixes) { + await this.deleteRole_withToken(bearerToken, organizationalUnitName + "-" + suffix); + } + } + catch (error) { + throw error; + } + }; + this.getAllRoles = async function () { + try { + // first get auth token to make admin requests + var bearerToken = Auth.keycloak.token; + // then make admin request + return await this.getAllRoles_withToken(bearerToken); + } + catch (error) { + throw error; + } + }; + this.setAvailableKeycloakRoles = function (roles) { + this.availableKeycloakRoles = roles; + }; + this.fetchAndSetKeycloakRoles = async function (username, password) { + this.setAvailableKeycloakRoles(await this.getAllRoles(username, password)); + }; + this.isRoleInKeycloak = function (roleName) { + for (const keycloakRole of this.availableKeycloakRoles) { + if (keycloakRole.name === roleName) { + return true; + } + } + return false; + }; + var self = this; + this.init(); }]); +//# sourceMappingURL=kommonitor-keycloak-helper-service.module.js.map \ No newline at end of file diff --git a/app/util/genericServices/kommonitorKeycloakHelperService/kommonitor-keycloak-helper-service.module.js.map b/app/util/genericServices/kommonitorKeycloakHelperService/kommonitor-keycloak-helper-service.module.js.map new file mode 100644 index 000000000..75c5386ef --- /dev/null +++ b/app/util/genericServices/kommonitorKeycloakHelperService/kommonitor-keycloak-helper-service.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-keycloak-helper-service.module.js","sourceRoot":"","sources":["kommonitor-keycloak-helper-service.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,0BAA0B,EAAE,CAAC,wBAAwB,CAAC,CAAC,CAAC;AAEvE,OAAO;KACJ,MAAM,CAAC,0BAA0B,EAAE,EAAE,CAAC;KACtC,OAAO,CACN,iCAAiC,EAAE,CAAC,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,4BAA4B,EAAE,MAAM,EAAE,OAAO;IACpH,UAAU,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,0BAA0B,EAAE,IAAI,EAAE,KAAK;QAE5E,IAAI,IAAI,GAAG,IAAI,CAAC;QAChB,IAAI,CAAC,sBAAsB,GAAG,EAAE,CAAC;QACjC,IAAI,CAAC,2BAA2B,GAAG,EAAE,CAAC;QACtC,IAAI,CAAC,gCAAgC,GAAG,EAAE,CAAC;QAC3C,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QAEnB,IAAI,CAAC,YAAY,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;QAEjE,IAAI,CAAC,IAAI,GAAG,KAAK;YACf,IAAI;gBACF,IAAI,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AQ,EAAE,QAAQ;YAChE,IAAI,CAAC,yBAAyB,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;QAC7E,CAAC,CAAC;QAEF,IAAI,CAAC,gBAAgB,GAAG,UAAU,QAAQ;YACxC,KAAK,MAAM,YAAY,IAAI,IAAI,CAAC,sBAAsB,EAAE;gBACtD,IAAI,YAAY,CAAC,IAAI,KAAK,QAAQ,EAAE;oBAClC,OAAO,IAAI,CAAC;iBACb;aACF;YACD,OAAO,KAAK,CAAC;QACf,CAAC,CAAC;QAEF,IAAI,IAAI,GAAG,IAAI,CAAC;QAChB,IAAI,CAAC,IAAI,EAAE,CAAC;IAEd,CAAC,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/util/genericServices/kommonitorKeycloakHelperService/kommonitor-keycloak-helper-service.module.ts b/app/util/genericServices/kommonitorKeycloakHelperService/kommonitor-keycloak-helper-service.module.ts new file mode 100644 index 000000000..9b8049394 --- /dev/null +++ b/app/util/genericServices/kommonitorKeycloakHelperService/kommonitor-keycloak-helper-service.module.ts @@ -0,0 +1,283 @@ +angular.module('kommonitorKeycloakHelper', ['kommonitorDataExchange']); + +angular + .module('kommonitorKeycloakHelper', []) + .service( + 'kommonitorKeycloakHelperService', ['$rootScope', '$timeout', '$http', '$httpParamSerializerJQLike', 'Auth', '__env', + function ($rootScope, $timeout, $http, $httpParamSerializerJQLike, Auth, __env) { + + var self = this; + this.availableKeycloakRoles = []; + this.targetUrlToKeycloakInstance = ""; + this.targetRealmUrlToKeycloakInstance = ""; + this.realm = ""; + this.clientId = ""; + + this.roleSuffixes = ["viewer", "editor", "publisher", "creator"]; + + this.init = async function () { + try { + if (window.__env.keycloakConfig) { + this.configureKeycloakParameters(window.__env.keycloakConfig); + } + else { + await $http.get('./config/keycloak_backup.json').then(async function (response) { + self.configureKeycloakParameters(response.data); + }); + } + } catch (error) { + console.error("Error while initializing kommonitorKeycloakHelperService. Error while fetching and interpreting config file. Error is: " + error); + } + }; + + this.configureKeycloakParameters = function (keycloakConfig) { + // // https:///auth/ + self.targetUrlToKeycloakInstance = keycloakConfig['auth-server-url']; + self.realm = keycloakConfig['realm']; + self.clientId = keycloakConfig['resource']; + + // https:///auth/admin//console + self.targetRealmUrlToKeycloakInstance = self.targetUrlToKeycloakInstance + "admin/" + self.realm + "/console"; + }; + + this.fetchRoles = async function () { + + console.log = "Fetching roles from Keycloak instance at " + this.targetUrlToKeycloakInstance; + return await $http({ + url: this.targetUrlToKeycloakInstance + this.realm + "/clients/" + this.clientId + "/roles", + method: "GET" + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + return response.data; + + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while fetching roles from keycloak."); + + }); + }; + + this.postNewRole_withToken = async function (bearerToken, rolesBody) { + + return await $http({ + url: this.targetUrlToKeycloakInstance + "admin/realms/" + this.realm + "/roles", + method: 'POST', + data: rolesBody, + headers: { + 'Content-Type': 'application/json', + 'Authorization': "Bearer " + bearerToken // Note the appropriate header + } + }).then(function successCallback(response) { + // return created response location + return response.data; + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while posting role to keycloak."); + throw error; + }); + }; + + this.renameExistingRole_withToken = async function (bearerToken, oldRoleName, newRoleName) { + var rolesBody = { + "name": newRoleName + }; + + return await $http({ + url: this.targetUrlToKeycloakInstance + "admin/realms/" + this.realm + "/roles/" + oldRoleName, + method: 'PUT', + data: rolesBody, + headers: { + 'Content-Type': 'application/json', + 'Authorization': "Bearer " + bearerToken // Note the appropriate header + } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + return response.data; + + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while posting role to keycloak."); + throw error; + + }); + }; + + this.deleteRole_withToken = async function (bearerToken, roleName) { + + return await $http({ + url: this.targetUrlToKeycloakInstance + "admin/realms/" + this.realm + "/roles/" + roleName, + method: 'DELETE', + headers: { + 'Authorization': "Bearer " + bearerToken // Note the appropriate header + } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + return response.data; + + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while deleting role from keycloak."); + throw error; + + }); + }; + + this.getAllRoles_withToken = async function (bearerToken) { + + return await $http({ + url: this.targetUrlToKeycloakInstance + "admin/realms/" + this.realm + "/roles", + method: 'GET', + headers: { + 'Authorization': "Bearer " + bearerToken // Note the appropriate header + } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + return response.data; + + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while adding role to keycloak."); + throw error; + + }); + }; + + this.addCompositeRole_withToken = async function (bearerToken, baseRole, composite) { + let data = [{ + "id": composite.id, + "name": composite.name + }]; + return await $http({ + url: this.targetUrlToKeycloakInstance + "admin/realms/" + this.realm + "/roles/" + baseRole.name + "/composites", + method: 'POST', + data: data, + headers: { + 'Authorization': "Bearer " + bearerToken // Note the appropriate header + } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + return response.data; + }, function errorCallback(error) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while creating composite role in keycloak."); + throw error; + }); + } + + this.postNewRoles = async function (organizationalUnitName) { + try { + // get auth token to make admin requests + var bearerToken = Auth.keycloak.token; + + // post individual roles + for (let suffix of this.roleSuffixes) { + // post individual role + await this.postNewRole_withToken(bearerToken, { "name": organizationalUnitName + "-" + suffix }); + } + const allRoles = await this.getAllRoles_withToken(bearerToken); + var roleMap = allRoles.filter(role => role.name.startsWith(organizationalUnitName + "-")) + .reduce((prev, curr) => (prev[curr.name] = curr, prev), {}); + + // Add composites + await this.addCompositeRole_withToken( + bearerToken, + roleMap[organizationalUnitName + "-editor"], + roleMap[organizationalUnitName + "-viewer"] + ); + await this.addCompositeRole_withToken( + bearerToken, + roleMap[organizationalUnitName + "-publisher"], + roleMap[organizationalUnitName + "-editor"] + ); + await this.addCompositeRole_withToken( + bearerToken, + roleMap[organizationalUnitName + "-creator"], + roleMap[organizationalUnitName + "-publisher"] + ); + } catch (error) { + throw error; + } + }; + + this.renameExistingRoles = async function (oldOrganizationalUnitName, newOrganizationalUnitName) { + try { + // first get auth token to make admin requests + var bearerToken = Auth.keycloak.token; + + for (let suffix of this.roleSuffixes) { + await this.renameExistingRole_withToken(bearerToken, oldOrganizationalUnitName + "-" + suffix, newOrganizationalUnitName + "-" + suffix); + } + } catch (error) { + throw error; + } + + }; + + this.deleteRoles = async function (organizationalUnitName) { + try { + // first get auth token to make admin requests + var bearerToken = Auth.keycloak.token; + + for (let suffix of this.roleSuffixes) { + await this.deleteRole_withToken(bearerToken, organizationalUnitName + "-" + suffix); + } + } catch (error) { + throw error; + } + }; + + this.getAllRoles = async function () { + try { + // first get auth token to make admin requests + var bearerToken = Auth.keycloak.token; + + // then make admin request + return await this.getAllRoles_withToken(bearerToken); + } catch (error) { + throw error; + } + + }; + + this.setAvailableKeycloakRoles = function (roles) { + this.availableKeycloakRoles = roles; + }; + + this.fetchAndSetKeycloakRoles = async function (username, password) { + this.setAvailableKeycloakRoles(await this.getAllRoles(username, password)); + }; + + this.isRoleInKeycloak = function (roleName) { + for (const keycloakRole of this.availableKeycloakRoles) { + if (keycloakRole.name === roleName) { + return true; + } + } + return false; + }; + + var self = this; + this.init(); + + }]); diff --git a/app/util/genericServices/kommonitorMultiStepFormHelperService/kommonitor-multi-step-form-helper-service.module.js b/app/util/genericServices/kommonitorMultiStepFormHelperService/kommonitor-multi-step-form-helper-service.module.js index f97d6d1e3..8de6d8057 100644 --- a/app/util/genericServices/kommonitorMultiStepFormHelperService/kommonitor-multi-step-form-helper-service.module.js +++ b/app/util/genericServices/kommonitorMultiStepFormHelperService/kommonitor-multi-step-form-helper-service.module.js @@ -1,166 +1,127 @@ +"use strict"; angular.module('kommonitorMultiStepFormHelper', ['kommonitorSingleFeatureMapHelper']); - angular - .module('kommonitorMultiStepFormHelper', []) - .service( - 'kommonitorMultiStepFormHelperService', [ + .module('kommonitorMultiStepFormHelper', []) + .service('kommonitorMultiStepFormHelperService', [ '$http', '__env', '$timeout', 'kommonitorSingleFeatureMapHelperService', function ($http, __env, $timeout, kommonitorSingleFeatureMapHelperService) { - - /* - MULTI STEP FORM STUFF - */ - //jQuery time - this.current_fs; - this.next_fs; - this.previous_fs; //fieldsets - this.opacity; - this.scale; //fieldset properties which we will animate - this.animating; //flag to prevent quick multi-click glitches - - let self = this; - - this.registerClickHandler = function(){ - this.registerNextButtonClick(); - this.registerPreviousButtonClick(); - this.registerProgressBarItemClick(); - }; - - this.registerProgressBarItemClick = function(){ - $timeout(function(){ - $("#progressbar > li").click(function(){ - let newIndex = $("#progressbar > li").index(this); - let oldIndex; - let allFs = $($(this).parent().parent().parent().children("fieldset")); - let activeFs; - - for (const fsCandidate of allFs) { - if(fsCandidate.style["display"] != "none"){ - activeFs = fsCandidate; - break; - } - } - oldIndex = $("fieldset").index(activeFs); - - self.current_fs = $($("fieldset").get(oldIndex)); - - - if(newIndex == oldIndex){ - return; - } - else if(newIndex < oldIndex){ - - self.previous_fs = $($("fieldset").get(newIndex)); - - //de-activate current step on progressbar - for (let index = oldIndex; index > newIndex; index--) { - $($("#progressbar > li").get(index)).removeClass("active"); - } - - //show the previous fieldset - self.previous_fs.show(); - - self.previous_fs.css({ - 'position': 'relative' - }); - self.current_fs.css({ - 'position': 'absolute' - }); - - self.current_fs.hide(); - } - else { - self.animating = true; - self.next_fs = $($("fieldset").get(newIndex)); - - //activate next step on progressbar using the index of self.next_fs - for (let index = oldIndex; index <= newIndex; index++) { - $($("#progressbar > li").get(index)).addClass("active"); - } - - //show the next fieldset - self.next_fs.show(); - - self.next_fs.css({ - 'position': 'relative' - }); - self.current_fs.css({ - 'position': 'absolute' - }); - - self.current_fs.hide(); - } - - // should any page be shown, where there is a single feature edit map then we must ensure that content is zoomed to - kommonitorSingleFeatureMapHelperService.invalidateMap(); - kommonitorSingleFeatureMapHelperService.zoomToDataLayer(); - }); - - }, 500); - }; - - - this.registerNextButtonClick = function(){ - $timeout(function(){ - - $(".next").click(function(){ - - self.current_fs = $(this).parent(); - self.next_fs = $(this).parent().next(); - - //activate next step on progressbar using the index of self.next_fs - $("#progressbar li").eq($("fieldset").index(self.next_fs)).addClass("active"); - - //show the next fieldset - self.next_fs.show(); - - self.next_fs.css({ - 'position': 'relative' - }); - self.current_fs.css({ - 'position': 'absolute' - }); - - self.current_fs.hide(); - - // should any page be shown, where there is a single feature edit map then we must ensure that content is zoomed to - kommonitorSingleFeatureMapHelperService.invalidateMap(); - kommonitorSingleFeatureMapHelperService.zoomToDataLayer(); - }); - - }, 500); - }; - - this.registerPreviousButtonClick = function(){ - $timeout(function(){ - - $(".previous").click(function(){ - - self.current_fs = $(this).parent(); - self.previous_fs = $(this).parent().prev(); - - //de-activate current step on progressbar - $("#progressbar li").eq($("fieldset").index(self.current_fs)).removeClass("active"); - - //show the previous fieldset - self.previous_fs.show(); - self.previous_fs.css({ - 'position': 'relative' - }); - self.current_fs.css({ - 'position': 'absolute' - }); - self.current_fs.hide(); - - // should any page be shown, where there is a single feature edit map then we must ensure that content is zoomed to - kommonitorSingleFeatureMapHelperService.invalidateMap(); - kommonitorSingleFeatureMapHelperService.zoomToDataLayer(); - }); - - }, 500); - }; - - - - - }]); + /* + MULTI STEP FORM STUFF + */ + //jQuery time + this.current_fs; + this.next_fs; + this.previous_fs; //fieldsets + this.opacity; + this.scale; //fieldset properties which we will animate + this.animating; //flag to prevent quick multi-click glitches + let self = this; + this.registerClickHandler = function () { + this.registerNextButtonClick(); + this.registerPreviousButtonClick(); + this.registerProgressBarItemClick(); + }; + this.registerProgressBarItemClick = function () { + $timeout(function () { + $("#progressbar > li").click(function () { + let newIndex = $("#progressbar > li").index(this); + let oldIndex; + let allFs = $($(this).parent().parent().parent().children("fieldset")); + let activeFs; + for (const fsCandidate of allFs) { + if (fsCandidate.style["display"] != "none") { + activeFs = fsCandidate; + break; + } + } + oldIndex = $("fieldset").index(activeFs); + self.current_fs = $($("fieldset").get(oldIndex)); + if (newIndex == oldIndex) { + return; + } + else if (newIndex < oldIndex) { + self.previous_fs = $($("fieldset").get(newIndex)); + //de-activate current step on progressbar + for (let index = oldIndex; index > newIndex; index--) { + $($("#progressbar > li").get(index)).removeClass("active"); + } + //show the previous fieldset + self.previous_fs.show(); + self.previous_fs.css({ + 'position': 'relative' + }); + self.current_fs.css({ + 'position': 'absolute' + }); + self.current_fs.hide(); + } + else { + self.animating = true; + self.next_fs = $($("fieldset").get(newIndex)); + //activate next step on progressbar using the index of self.next_fs + for (let index = oldIndex; index <= newIndex; index++) { + $($("#progressbar > li").get(index)).addClass("active"); + } + //show the next fieldset + self.next_fs.show(); + self.next_fs.css({ + 'position': 'relative' + }); + self.current_fs.css({ + 'position': 'absolute' + }); + self.current_fs.hide(); + } + // should any page be shown, where there is a single feature edit map then we must ensure that content is zoomed to + kommonitorSingleFeatureMapHelperService.invalidateMap(); + kommonitorSingleFeatureMapHelperService.zoomToDataLayer(); + }); + }, 500); + }; + this.registerNextButtonClick = function () { + $timeout(function () { + $(".next").click(function () { + self.current_fs = $(this).parent(); + self.next_fs = $(this).parent().next(); + //activate next step on progressbar using the index of self.next_fs + $("#progressbar li").eq($("fieldset").index(self.next_fs)).addClass("active"); + //show the next fieldset + self.next_fs.show(); + self.next_fs.css({ + 'position': 'relative' + }); + self.current_fs.css({ + 'position': 'absolute' + }); + self.current_fs.hide(); + // should any page be shown, where there is a single feature edit map then we must ensure that content is zoomed to + kommonitorSingleFeatureMapHelperService.invalidateMap(); + kommonitorSingleFeatureMapHelperService.zoomToDataLayer(); + }); + }, 500); + }; + this.registerPreviousButtonClick = function () { + $timeout(function () { + $(".previous").click(function () { + self.current_fs = $(this).parent(); + self.previous_fs = $(this).parent().prev(); + //de-activate current step on progressbar + $("#progressbar li").eq($("fieldset").index(self.current_fs)).removeClass("active"); + //show the previous fieldset + self.previous_fs.show(); + self.previous_fs.css({ + 'position': 'relative' + }); + self.current_fs.css({ + 'position': 'absolute' + }); + self.current_fs.hide(); + // should any page be shown, where there is a single feature edit map then we must ensure that content is zoomed to + kommonitorSingleFeatureMapHelperService.invalidateMap(); + kommonitorSingleFeatureMapHelperService.zoomToDataLayer(); + }); + }, 500); + }; + } +]); +//# sourceMappingURL=kommonitor-multi-step-form-helper-service.module.js.map \ No newline at end of file diff --git a/app/util/genericServices/kommonitorMultiStepFormHelperService/kommonitor-multi-step-form-helper-service.module.js.map b/app/util/genericServices/kommonitorMultiStepFormHelperService/kommonitor-multi-step-form-helper-service.module.js.map new file mode 100644 index 000000000..5dd5d0c3a --- /dev/null +++ b/app/util/genericServices/kommonitorMultiStepFormHelperService/kommonitor-multi-step-form-helper-service.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-multi-step-form-helper-service.module.js","sourceRoot":"","sources":["kommonitor-multi-step-form-helper-service.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,+BAA+B,EAAE,CAAC,kCAAkC,CAAC,CAAC,CAAC;AAEtF,OAAO;KACJ,MAAM,CAAC,+BAA+B,EAAE,EAAE,CAAC;KAC3C,OAAO,CACN,sCAAsC,EAAE;IACxC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,yCAAyC;IACvE,UAAU,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,uCAAuC;QAEvE;;gBAED;QACF,aAAa;QACb,IAAI,CAAC,UAAU,CAAC;QAChB,IAAI,CAAC,OAAO,CAAC;QACb,IAAI,CAAC,WAAW,CAAC,CAAC,WAAW;QAC7B,IAAI,CAAC,OAAO,CAAC;QACb,IAAI,CAAC,KAAK,CAAC,CAAC,2CAA2C;QACvD,IAAI,CAAC,SAAS,CAAC,CAAC,4CAA4C;Q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W,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC;oBAE3C,yCAAyC;oBACzC,CAAC,CAAC,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;oBAEpF,4BAA4B;oBAC5B,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;oBACxB,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC;wBACnB,UAAU,EAAE,UAAU;qBACvB,CAAC,CAAC;oBACH,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;wBAClB,UAAU,EAAE,UAAU;qBACvB,CAAC,CAAC;oBACH,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;oBAEvB,mHAAmH;oBACnH,uCAAuC,CAAC,aAAa,EAAE,CAAC;oBACxD,uCAAuC,CAAC,eAAe,EAAE,CAAC;gBAC5D,CAAC,CAAC,CAAC;YAEL,CAAC,EAAE,GAAG,CAAC,CAAC;QACV,CAAC,CAAC;IAKJ,CAAC;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/util/genericServices/kommonitorMultiStepFormHelperService/kommonitor-multi-step-form-helper-service.module.ts b/app/util/genericServices/kommonitorMultiStepFormHelperService/kommonitor-multi-step-form-helper-service.module.ts new file mode 100644 index 000000000..f97d6d1e3 --- /dev/null +++ b/app/util/genericServices/kommonitorMultiStepFormHelperService/kommonitor-multi-step-form-helper-service.module.ts @@ -0,0 +1,166 @@ +angular.module('kommonitorMultiStepFormHelper', ['kommonitorSingleFeatureMapHelper']); + +angular + .module('kommonitorMultiStepFormHelper', []) + .service( + 'kommonitorMultiStepFormHelperService', [ + '$http', '__env', '$timeout', 'kommonitorSingleFeatureMapHelperService', + function ($http, __env, $timeout, kommonitorSingleFeatureMapHelperService) { + + /* + MULTI STEP FORM STUFF + */ + //jQuery time + this.current_fs; + this.next_fs; + this.previous_fs; //fieldsets + this.opacity; + this.scale; //fieldset properties which we will animate + this.animating; //flag to prevent quick multi-click glitches + + let self = this; + + this.registerClickHandler = function(){ + this.registerNextButtonClick(); + this.registerPreviousButtonClick(); + this.registerProgressBarItemClick(); + }; + + this.registerProgressBarItemClick = function(){ + $timeout(function(){ + $("#progressbar > li").click(function(){ + let newIndex = $("#progressbar > li").index(this); + let oldIndex; + let allFs = $($(this).parent().parent().parent().children("fieldset")); + let activeFs; + + for (const fsCandidate of allFs) { + if(fsCandidate.style["display"] != "none"){ + activeFs = fsCandidate; + break; + } + } + oldIndex = $("fieldset").index(activeFs); + + self.current_fs = $($("fieldset").get(oldIndex)); + + + if(newIndex == oldIndex){ + return; + } + else if(newIndex < oldIndex){ + + self.previous_fs = $($("fieldset").get(newIndex)); + + //de-activate current step on progressbar + for (let index = oldIndex; index > newIndex; index--) { + $($("#progressbar > li").get(index)).removeClass("active"); + } + + //show the previous fieldset + self.previous_fs.show(); + + self.previous_fs.css({ + 'position': 'relative' + }); + self.current_fs.css({ + 'position': 'absolute' + }); + + self.current_fs.hide(); + } + else { + self.animating = true; + self.next_fs = $($("fieldset").get(newIndex)); + + //activate next step on progressbar using the index of self.next_fs + for (let index = oldIndex; index <= newIndex; index++) { + $($("#progressbar > li").get(index)).addClass("active"); + } + + //show the next fieldset + self.next_fs.show(); + + self.next_fs.css({ + 'position': 'relative' + }); + self.current_fs.css({ + 'position': 'absolute' + }); + + self.current_fs.hide(); + } + + // should any page be shown, where there is a single feature edit map then we must ensure that content is zoomed to + kommonitorSingleFeatureMapHelperService.invalidateMap(); + kommonitorSingleFeatureMapHelperService.zoomToDataLayer(); + }); + + }, 500); + }; + + + this.registerNextButtonClick = function(){ + $timeout(function(){ + + $(".next").click(function(){ + + self.current_fs = $(this).parent(); + self.next_fs = $(this).parent().next(); + + //activate next step on progressbar using the index of self.next_fs + $("#progressbar li").eq($("fieldset").index(self.next_fs)).addClass("active"); + + //show the next fieldset + self.next_fs.show(); + + self.next_fs.css({ + 'position': 'relative' + }); + self.current_fs.css({ + 'position': 'absolute' + }); + + self.current_fs.hide(); + + // should any page be shown, where there is a single feature edit map then we must ensure that content is zoomed to + kommonitorSingleFeatureMapHelperService.invalidateMap(); + kommonitorSingleFeatureMapHelperService.zoomToDataLayer(); + }); + + }, 500); + }; + + this.registerPreviousButtonClick = function(){ + $timeout(function(){ + + $(".previous").click(function(){ + + self.current_fs = $(this).parent(); + self.previous_fs = $(this).parent().prev(); + + //de-activate current step on progressbar + $("#progressbar li").eq($("fieldset").index(self.current_fs)).removeClass("active"); + + //show the previous fieldset + self.previous_fs.show(); + self.previous_fs.css({ + 'position': 'relative' + }); + self.current_fs.css({ + 'position': 'absolute' + }); + self.current_fs.hide(); + + // should any page be shown, where there is a single feature edit map then we must ensure that content is zoomed to + kommonitorSingleFeatureMapHelperService.invalidateMap(); + kommonitorSingleFeatureMapHelperService.zoomToDataLayer(); + }); + + }, 500); + }; + + + + + }]); diff --git a/app/util/genericServices/kommonitorScriptHelperService/kommonitor-script-helper-service.module.js b/app/util/genericServices/kommonitorScriptHelperService/kommonitor-script-helper-service.module.js index d1fcef1cb..6d43c7e39 100644 --- a/app/util/genericServices/kommonitorScriptHelperService/kommonitor-script-helper-service.module.js +++ b/app/util/genericServices/kommonitorScriptHelperService/kommonitor-script-helper-service.module.js @@ -1,495 +1,430 @@ +"use strict"; angular.module('kommonitorScriptHelper', ['kommonitorDataExchange']); - angular - .module('kommonitorScriptHelper', []) - .service( - 'kommonitorScriptHelperService', ['$rootScope', '$timeout', 'kommonitorDataExchangeService', '$http', '__env', - function ($rootScope, $timeout, - kommonitorDataExchangeService, $http, __env) { - - var self = this; - - this.targetUrlToManagementService = __env.apiUrl + __env.basePath + "/"; - - this.availableScriptDataTypes = [ - { - "displayName": "Textuell (String)", - "apiName": "string" - }, - { - "displayName": "Wahrheitswert (Boolean)", - "apiName": "boolean" - }, - { - "displayName": "Ganzzahl (Integer)", - "apiName": "integer" - }, - { - "displayName": "Gleitkommazahl (Double)", - "apiName": "double" - } - ]; - - this.availableScriptTypeOptions = [ - { - "displayName": "Generische Definition", - "apiName": "generic" - }, - { - "displayName": "Indikatoren - Summe aller Indikatoren", - "apiName": "indicator_sum" - }, - { - "displayName": "Indikatoren - Subtraktion von Basis-Indikatoren von einem Referenzindikator", - "apiName": "indicator_subtract" - }, - { - "displayName": "Indikatoren - Prozentualer Anteil (Quotient zwischen Basis-Indikatoren und einem Referenzindikator)", - "apiName": "indicator_percentage" - }, - { - "displayName": "Indikatoren - Anteil (Quotient zwischen Basis-Indikatoren und einem Referenzindikator)", - "apiName": "indicator_share" - }, - { - "displayName": "Indikatoren - Division (Quotient zweier Indikatoren)", - "apiName": "indicator_division" - }, - { - "displayName": "Indikatoren - Trend (mittels linearer Regression)", - "apiName": "indicator_trend" - }, - { - "displayName": "Indikatoren - Kontinuität (mittels Pearson Korrelation)", - "apiName": "indicator_continuity" - }, - { - "displayName": "Indikatoren - Veränderung absolut", - "apiName": "indicator_change_absolute" - }, - { - "displayName": "Indikatoren - Veränderung absolut mit festem Referenz-Zeitpunkt", - "apiName": "indicator_change_absolute_refDate" - }, - { - "displayName": "Indikatoren - Veränderung prozentual mit festem Referenz-Zeitpunkt", - "apiName": "indicator_change_relative_refDate" - }, - { - "displayName": "Indikatoren - Veränderung prozentual", - "apiName": "indicator_change_relative" - }, - { - "displayName": "Indikatoren - Promille-Wert (Quotient zwischen Basis-Indikatoren und einem Referenzindikator)", - "apiName": "indicator_promille" - }, - { - "displayName": "Leitindikator - verkettete Berechnung (Rank, Min-Max-Normalisierung, Aggregation)", - "apiName": "indicator_headlineIndicator" - }, - { - "displayName": "Indikatoren - Produkt aller Indikatoren", - "apiName": "indicator_multiplication" - }, - { - "displayName": "Georessourcen - Anzahl Punkte in Polygon", - "apiName": "georesource_pointsInPolygon" - }, - { - "displayName": "Georessourcen - Statistiken anhand Objekteigenschaft (Punktdatensätze)", - "apiName": "georesource_statistics" - }, - { - "displayName": "Georessourcen - Prozentualer Anteil anhand Objekteigenschaft (Punktdatensätze)", - "apiName": "georesource_subsetShare" - }, - { - "displayName": "Georessourcen - Summierte Linienlänge je Polygon", - "apiName": "lineSegmentInPolygon" - } - ]; - - this.temporalOptions = [ - { - "apiName": "YEARS", - "displayName": "Jahr(e)" - }, - { - "apiName": "MONTHS", - "displayName": "Monat(e)" - }, - { - "apiName": "DAYS", - "displayName": "Tag(e)" - } - ]; - - this.requiredIndicators_tmp = []; - this.requiredGeoresources_tmp = []; - this.requiredScriptParameters_tmp = []; - this.scriptCode_base64String = undefined; - this.scriptCode_readableString = undefined; - - this.scriptFormulaHTML = undefined; - this.scriptFormulaHTML_successToastDisplay = this.scriptFormulaHTML; - this.scriptFormulaHTML_overwriteTargetIndicatorMethod = false; - - this.scriptFormulaExplanation = undefined; - - this.targetIndicatorOldProcessDescription = undefined; - - this.reset = function(){ + .module('kommonitorScriptHelper', []) + .service('kommonitorScriptHelperService', ['$rootScope', '$timeout', 'kommonitorDataExchangeService', '$http', '__env', + function ($rootScope, $timeout, kommonitorDataExchangeService, $http, __env) { + var self = this; + this.targetUrlToManagementService = __env.apiUrl + __env.basePath + "/"; + this.availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + this.availableScriptTypeOptions = [ + { + "displayName": "Generische Definition", + "apiName": "generic" + }, + { + "displayName": "Indikatoren - Summe aller Indikatoren", + "apiName": "indicator_sum" + }, + { + "displayName": "Indikatoren - Subtraktion von Basis-Indikatoren von einem Referenzindikator", + "apiName": "indicator_subtract" + }, + { + "displayName": "Indikatoren - Prozentualer Anteil (Quotient zwischen Basis-Indikatoren und einem Referenzindikator)", + "apiName": "indicator_percentage" + }, + { + "displayName": "Indikatoren - Anteil (Quotient zwischen Basis-Indikatoren und einem Referenzindikator)", + "apiName": "indicator_share" + }, + { + "displayName": "Indikatoren - Division (Quotient zweier Indikatoren)", + "apiName": "indicator_division" + }, + { + "displayName": "Indikatoren - Trend (mittels linearer Regression)", + "apiName": "indicator_trend" + }, + { + "displayName": "Indikatoren - Kontinuität (mittels Pearson Korrelation)", + "apiName": "indicator_continuity" + }, + { + "displayName": "Indikatoren - Veränderung absolut", + "apiName": "indicator_change_absolute" + }, + { + "displayName": "Indikatoren - Veränderung absolut mit festem Referenz-Zeitpunkt", + "apiName": "indicator_change_absolute_refDate" + }, + { + "displayName": "Indikatoren - Veränderung prozentual mit festem Referenz-Zeitpunkt", + "apiName": "indicator_change_relative_refDate" + }, + { + "displayName": "Indikatoren - Veränderung prozentual", + "apiName": "indicator_change_relative" + }, + { + "displayName": "Indikatoren - Promille-Wert (Quotient zwischen Basis-Indikatoren und einem Referenzindikator)", + "apiName": "indicator_promille" + }, + { + "displayName": "Leitindikator - verkettete Berechnung (Rank, Min-Max-Normalisierung, Aggregation)", + "apiName": "indicator_headlineIndicator" + }, + { + "displayName": "Indikatoren - Produkt aller Indikatoren", + "apiName": "indicator_multiplication" + }, + { + "displayName": "Georessourcen - Anzahl Punkte in Polygon", + "apiName": "georesource_pointsInPolygon" + }, + { + "displayName": "Georessourcen - Statistiken anhand Objekteigenschaft (Punktdatensätze)", + "apiName": "georesource_statistics" + }, + { + "displayName": "Georessourcen - Prozentualer Anteil anhand Objekteigenschaft (Punktdatensätze)", + "apiName": "georesource_subsetShare" + }, + { + "displayName": "Georessourcen - Summierte Linienlänge je Polygon", + "apiName": "lineSegmentInPolygon" + } + ]; + this.temporalOptions = [ + { + "apiName": "YEARS", + "displayName": "Jahr(e)" + }, + { + "apiName": "MONTHS", + "displayName": "Monat(e)" + }, + { + "apiName": "DAYS", + "displayName": "Tag(e)" + } + ]; this.requiredIndicators_tmp = []; this.requiredGeoresources_tmp = []; this.requiredScriptParameters_tmp = []; this.scriptCode_base64String = undefined; this.scriptCode_readableString = undefined; this.scriptFormulaHTML = undefined; + this.scriptFormulaHTML_successToastDisplay = this.scriptFormulaHTML; this.scriptFormulaHTML_overwriteTargetIndicatorMethod = false; this.scriptFormulaExplanation = undefined; this.targetIndicatorOldProcessDescription = undefined; - }; - - this.addBaseIndicator = function(indicatorMetadata){ - if(!indicatorMetadata){ - return; - } - // for (const baseIndicator of this.requiredIndicators_tmp) { - // if (baseIndicator.indicatorId === indicatorMetadata.indicatorId){ - // // already inserted as base indicator, hence add not allowed - // return; - // } - // } - this.requiredIndicators_tmp.push(indicatorMetadata); - }; - - this.removeBaseIndicator = function(indicatorMetadata){ - for (let index = 0; index < this.requiredIndicators_tmp.length; index++) { - - if (this.requiredIndicators_tmp[index].indicatorId === indicatorMetadata.indicatorId){ - // remove object - this.requiredIndicators_tmp.splice(index, 1); - break; - } - } - }; - - this.addBaseGeoresource = function(georesourceMetadata){ - // for (const baseGeoresource of this.requiredGeoresources_tmp) { - // if (baseGeoresource.georesourceId === georesourceMetadata.georesourceId){ - // // already inserted as base georesource, hence add not allowed - // return; - // } - // } - this.requiredGeoresources_tmp.push(georesourceMetadata); - }; - - this.removeBaseGeoresource = function(georesourceMetadata){ - for (let index = 0; index < this.requiredGeoresources_tmp.length; index++) { - - if (this.requiredGeoresources_tmp[index].georesourceId === georesourceMetadata.georesourceId){ - // remove object - this.requiredGeoresources_tmp.splice(index, 1); - break; - } - } - }; - - this.addScriptParameter = function(parameterName, parameterDescription, parameterDataType, parameterDefaultValue, parameterNumericMinValue, parameterNumericMaxValue){ - for (const scriptParameter of this.requiredScriptParameters_tmp) { - if (scriptParameter.name === parameterName){ - // already inserted as script parameter, hence add not allowed - return; - } - } - - var scriptParameter = { - "name": parameterName, - "description": parameterDescription, - "dataType": parameterDataType.apiName, - "defaultValue": parameterDefaultValue, - "minParameterValueForNumericInputs": parameterNumericMinValue || 0, - "maxParameterValueForNumericInputs": parameterNumericMaxValue || 1 - + this.reset = function () { + this.requiredIndicators_tmp = []; + this.requiredGeoresources_tmp = []; + this.requiredScriptParameters_tmp = []; + this.scriptCode_base64String = undefined; + this.scriptCode_readableString = undefined; + this.scriptFormulaHTML = undefined; + this.scriptFormulaHTML_overwriteTargetIndicatorMethod = false; + this.scriptFormulaExplanation = undefined; + this.targetIndicatorOldProcessDescription = undefined; }; - this.requiredScriptParameters_tmp.push(scriptParameter); - }; - - this.removeScriptParameter = function(scriptParameter){ - for (let index = 0; index < this.requiredScriptParameters_tmp.length; index++) { - - if (this.requiredScriptParameters_tmp[index].name === scriptParameter.name){ - // remove object - this.requiredScriptParameters_tmp.splice(index, 1); - break; - } - } - }; - - this.removeScriptParameter_byName = function(scriptParameterName){ - for (let index = 0; index < this.requiredScriptParameters_tmp.length; index++) { - - if (this.requiredScriptParameters_tmp[index].name === scriptParameterName){ - // remove object - this.requiredScriptParameters_tmp.splice(index, 1); - break; - } - } - }; - - this.prettifyScriptCodePreview = function(htmlDomElementId){ - - $timeout(function(){ - - $(htmlDomElementId).removeClass("prettyprinted"); - - PR.prettyPrint(); - - }, 250); - - }; - - this.buildPatchBody_indicators = function(targetIndicatorMetadata){ - var patchBody = - { - "metadata": { - "note": targetIndicatorMetadata.metadata.note || null, - "literature": targetIndicatorMetadata.metadata.literature || null, - "updateInterval": targetIndicatorMetadata.metadata.updateInterval, - "sridEPSG": targetIndicatorMetadata.metadata.sridEPSG || 4326, - "datasource": targetIndicatorMetadata.metadata.datasource, - "contact": targetIndicatorMetadata.metadata.contact, - "lastUpdate": targetIndicatorMetadata.metadata.lastUpdate, - "description": targetIndicatorMetadata.metadata.description || null, - "databasis": targetIndicatorMetadata.metadata.databasis || null - }, - "refrencesToOtherIndicators": [], // filled directly after - "allowedRoles": targetIndicatorMetadata.allowedRoles, - "datasetName": targetIndicatorMetadata.indicatorName, - "abbreviation": targetIndicatorMetadata.abbreviation || null, - "characteristicValue": targetIndicatorMetadata.characteristicValue || null, - "tags": targetIndicatorMetadata.tags, - "creationType": targetIndicatorMetadata.creationType, - "unit": targetIndicatorMetadata.unit, - "topicReference": targetIndicatorMetadata.topicReference, - "refrencesToGeoresources": [], // filled directly after - "indicatorType": targetIndicatorMetadata.indicatorType, - "interpretation": targetIndicatorMetadata.interpretation || "", - "isHeadlineIndicator": targetIndicatorMetadata.isHeadlineIndicator || false, - "processDescription": this.scriptFormulaHTML || targetIndicatorMetadata.processDescription, - "lowestSpatialUnitForComputation": targetIndicatorMetadata.lowestSpatialUnitForComputation, - "defaultClassificationMapping": targetIndicatorMetadata.defaultClassificationMapping - }; - - // REFERENCES - - if(targetIndicatorMetadata.referencedIndicators && targetIndicatorMetadata.referencedIndicators.length > 0){ - patchBody.refrencesToOtherIndicators = []; - - for (const indicRef of targetIndicatorMetadata.referencedIndicators) { - patchBody.refrencesToOtherIndicators.push({ - "indicatorId": indicRef.referencedIndicatorId, - "referenceDescription": indicRef.referencedIndicatorDescription - }); + this.addBaseIndicator = function (indicatorMetadata) { + if (!indicatorMetadata) { + return; } - } - - if(targetIndicatorMetadata.referencedGeoresources && targetIndicatorMetadata.referencedGeoresources.length > 0){ - patchBody.refrencesToGeoresources = []; - - for (const geoRef of targetIndicatorMetadata.referencedGeoresources) { - patchBody.refrencesToGeoresources.push({ - "georesourceId": geoRef.referencedGeoresourceId, - "referenceDescription": geoRef.referencedGeoresourceDescription - }); + // for (const baseIndicator of this.requiredIndicators_tmp) { + // if (baseIndicator.indicatorId === indicatorMetadata.indicatorId){ + // // already inserted as base indicator, hence add not allowed + // return; + // } + // } + this.requiredIndicators_tmp.push(indicatorMetadata); + }; + this.removeBaseIndicator = function (indicatorMetadata) { + for (let index = 0; index < this.requiredIndicators_tmp.length; index++) { + if (this.requiredIndicators_tmp[index].indicatorId === indicatorMetadata.indicatorId) { + // remove object + this.requiredIndicators_tmp.splice(index, 1); + break; + } + } + }; + this.addBaseGeoresource = function (georesourceMetadata) { + // for (const baseGeoresource of this.requiredGeoresources_tmp) { + // if (baseGeoresource.georesourceId === georesourceMetadata.georesourceId){ + // // already inserted as base georesource, hence add not allowed + // return; + // } + // } + this.requiredGeoresources_tmp.push(georesourceMetadata); + }; + this.removeBaseGeoresource = function (georesourceMetadata) { + for (let index = 0; index < this.requiredGeoresources_tmp.length; index++) { + if (this.requiredGeoresources_tmp[index].georesourceId === georesourceMetadata.georesourceId) { + // remove object + this.requiredGeoresources_tmp.splice(index, 1); + break; + } + } + }; + this.addScriptParameter = function (parameterName, parameterDescription, parameterDataType, parameterDefaultValue, parameterNumericMinValue, parameterNumericMaxValue) { + for (const scriptParameter of this.requiredScriptParameters_tmp) { + if (scriptParameter.name === parameterName) { + // already inserted as script parameter, hence add not allowed + return; + } + } + var scriptParameter = { + "name": parameterName, + "description": parameterDescription, + "dataType": parameterDataType.apiName, + "defaultValue": parameterDefaultValue, + "minParameterValueForNumericInputs": parameterNumericMinValue || 0, + "maxParameterValueForNumericInputs": parameterNumericMaxValue || 1 + }; + this.requiredScriptParameters_tmp.push(scriptParameter); + }; + this.removeScriptParameter = function (scriptParameter) { + for (let index = 0; index < this.requiredScriptParameters_tmp.length; index++) { + if (this.requiredScriptParameters_tmp[index].name === scriptParameter.name) { + // remove object + this.requiredScriptParameters_tmp.splice(index, 1); + break; + } + } + }; + this.removeScriptParameter_byName = function (scriptParameterName) { + for (let index = 0; index < this.requiredScriptParameters_tmp.length; index++) { + if (this.requiredScriptParameters_tmp[index].name === scriptParameterName) { + // remove object + this.requiredScriptParameters_tmp.splice(index, 1); + break; + } + } + }; + this.prettifyScriptCodePreview = function (htmlDomElementId) { + $timeout(function () { + $(htmlDomElementId).removeClass("prettyprinted"); + PR.prettyPrint(); + }, 250); + }; + this.buildPatchBody_indicators = function (targetIndicatorMetadata) { + var patchBody = { + "metadata": { + "note": targetIndicatorMetadata.metadata.note || null, + "literature": targetIndicatorMetadata.metadata.literature || null, + "updateInterval": targetIndicatorMetadata.metadata.updateInterval, + "sridEPSG": targetIndicatorMetadata.metadata.sridEPSG || 4326, + "datasource": targetIndicatorMetadata.metadata.datasource, + "contact": targetIndicatorMetadata.metadata.contact, + "lastUpdate": targetIndicatorMetadata.metadata.lastUpdate, + "description": targetIndicatorMetadata.metadata.description || null, + "databasis": targetIndicatorMetadata.metadata.databasis || null + }, + "refrencesToOtherIndicators": [], + "allowedRoles": targetIndicatorMetadata.allowedRoles, + "datasetName": targetIndicatorMetadata.indicatorName, + "abbreviation": targetIndicatorMetadata.abbreviation || null, + "characteristicValue": targetIndicatorMetadata.characteristicValue || null, + "tags": targetIndicatorMetadata.tags, + "creationType": targetIndicatorMetadata.creationType, + "unit": targetIndicatorMetadata.unit, + "topicReference": targetIndicatorMetadata.topicReference, + "refrencesToGeoresources": [], + "indicatorType": targetIndicatorMetadata.indicatorType, + "interpretation": targetIndicatorMetadata.interpretation || "", + "isHeadlineIndicator": targetIndicatorMetadata.isHeadlineIndicator || false, + "processDescription": this.scriptFormulaHTML || targetIndicatorMetadata.processDescription, + "lowestSpatialUnitForComputation": targetIndicatorMetadata.lowestSpatialUnitForComputation, + "defaultClassificationMapping": targetIndicatorMetadata.defaultClassificationMapping + }; + // REFERENCES + if (targetIndicatorMetadata.referencedIndicators && targetIndicatorMetadata.referencedIndicators.length > 0) { + patchBody.refrencesToOtherIndicators = []; + for (const indicRef of targetIndicatorMetadata.referencedIndicators) { + patchBody.refrencesToOtherIndicators.push({ + "indicatorId": indicRef.referencedIndicatorId, + "referenceDescription": indicRef.referencedIndicatorDescription + }); + } } - } - - return patchBody; - }; - - this.replaceMethodMetadataForTargetIndicator = async function(targetIndicatorMetadata){ - var patchBody = this.buildPatchBody_indicators(targetIndicatorMetadata); - - this.targetIndicatorOldProcessDescription = targetIndicatorMetadata.processDescription; - - $http({ - url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/indicators/" + targetIndicatorMetadata.indicatorId, - method: "PATCH", - data: patchBody - // headers: { - // 'Content-Type': undefined - // } - }).then(function successCallback(response) { - - $rootScope.$broadcast("refreshIndicatorOverviewTable", "edit", targetIndicatorMetadata.indicatorId); - - }, function errorCallback(error) { - - }); - }; - - this.postNewScript = async function(scriptName, description, targetIndicatorMetadata){ - console.log("Trying to POST to management service to register new script."); - - /* POST BODY - { - "scriptCodeBase64": "scriptCodeBase64", - "requiredIndicatorIds": [ - "requiredIndicatorIds", - "requiredIndicatorIds" - ], - "variableProcessParameters": [ - { - "minParameterValueForNumericInputs": 6.027456183070403, - "maxParameterValueForNumericInputs": 0.8008281904610115, - "defaultValue": "defaultValue", - "dataType": "string", - "name": "name", - "description": "description" - }, - { - "minParameterValueForNumericInputs": 6.027456183070403, - "maxParameterValueForNumericInputs": 0.8008281904610115, - "defaultValue": "defaultValue", - "dataType": "string", - "name": "name", - "description": "description" - } - ], - "associatedIndicatorId": "associatedIndicatorId", - "name": "name", - "description": "description", - "requiredGeoresourceIds": [ - "requiredGeoresourceIds", - "requiredGeoresourceIds" - ] - } - */ - - var postBody = { - "name": scriptName, - "description": description, - "associatedIndicatorId": targetIndicatorMetadata.indicatorId, - "requiredIndicatorIds": this.requiredIndicators_tmp.map(indicatorMetadata => indicatorMetadata.indicatorId), - "requiredGeoresourceIds": this.requiredGeoresources_tmp.map(georesourceMetadata => georesourceMetadata.georesourceId), - "variableProcessParameters": this.requiredScriptParameters_tmp, - "scriptCodeBase64": window.btoa(this.scriptCode_readableString) - }; - - return await $http({ - url: this.targetUrlToManagementService + "process-scripts", - method: "POST", - data: postBody, - headers: { - 'Content-Type': "application/json" - } - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(response) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while posting to importer service."); - throw response; - }); - }; - - this.updateScript = async function(scriptName, description, scriptId){ - console.log("Trying to POST to importer service to update spatial unit with id '" + spatialUnitId + "'."); - - var putBody = { - "name": scriptName, - "description": description, - "requiredIndicatorIds": this.requiredIndicators_tmp, - "requiredGeoresourceIds": this.requiredGeoresources_tmp, - "variableProcessParameters": this.requiredScriptParameters_tmp, - "scriptCodeBase64": window.btoa(this.scriptCode_readableString) - }; - - return await $http({ - url: this.targetUrlToManagementService + "process-scripts/" + scriptId, - method: "PUT", - data: putBody, - headers: { - 'Content-Type': "application/json" - } - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(response) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while posting to importer service."); - throw response; - }); - }; - - this.getAlphabetLetterFromNumber = function(number){ - return String.fromCharCode(Number(number) + 'A'.charCodeAt(0)); - }; - - this.styleMathFormula = function(domOutputElementId){ - var output = document.getElementById(domOutputElementId); - output.innerHTML = this.scriptFormulaHTML; - - // MathJax.texReset(); - // MathJax.typesetClear(); - MathJax.typesetPromise([output]).then(function(){ - - }).catch(function (err) { - output.innerHTML = ''; - output.appendChild(document.createTextNode(err.message)); - console.error(err); - }).then(function () { - - }); - }; - - this.styleMathFormula_forExplanation = function(domOutputElementId){ - var output = document.getElementById(domOutputElementId); - - // MathJax.texReset(); - // MathJax.typesetClear(); - MathJax.typesetPromise([output]).then(function(){ - $timeout(function(){ - self.scriptFormulaExplanation = "" + output.innerHTML; - $rootScope.$apply(); - }); - }).catch(function (err) { - output.innerHTML = ''; - output.appendChild(document.createTextNode(err.message)); - console.error(err); - }).then(function () { - $timeout(function(){ - self.scriptFormulaExplanation = "" + output.innerHTML; - $rootScope.$apply(); - }); - }); - }; - - this.typesetContainerByClass = function(className){ - var domElements = document.getElementsByClassName(className); - - for (const domElement of domElements) { - MathJax.typesetPromise([domElement]).then(function(){ - $timeout(function(){ + if (targetIndicatorMetadata.referencedGeoresources && targetIndicatorMetadata.referencedGeoresources.length > 0) { + patchBody.refrencesToGeoresources = []; + for (const geoRef of targetIndicatorMetadata.referencedGeoresources) { + patchBody.refrencesToGeoresources.push({ + "georesourceId": geoRef.referencedGeoresourceId, + "referenceDescription": geoRef.referencedGeoresourceDescription + }); + } + } + return patchBody; + }; + this.replaceMethodMetadataForTargetIndicator = async function (targetIndicatorMetadata) { + var patchBody = this.buildPatchBody_indicators(targetIndicatorMetadata); + this.targetIndicatorOldProcessDescription = targetIndicatorMetadata.processDescription; + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/indicators/" + targetIndicatorMetadata.indicatorId, + method: "PATCH", + data: patchBody + // headers: { + // 'Content-Type': undefined + // } + }).then(function successCallback(response) { + $rootScope.$broadcast("refreshIndicatorOverviewTable", "edit", targetIndicatorMetadata.indicatorId); + }, function errorCallback(error) { }); - }).catch(function (err) { - console.error(err); - }).then(function () { - $timeout(function(){ + }; + this.postNewScript = async function (scriptName, description, targetIndicatorMetadata) { + console.log("Trying to POST to management service to register new script."); + /* POST BODY + { + "scriptCodeBase64": "scriptCodeBase64", + "requiredIndicatorIds": [ + "requiredIndicatorIds", + "requiredIndicatorIds" + ], + "variableProcessParameters": [ + { + "minParameterValueForNumericInputs": 6.027456183070403, + "maxParameterValueForNumericInputs": 0.8008281904610115, + "defaultValue": "defaultValue", + "dataType": "string", + "name": "name", + "description": "description" + }, + { + "minParameterValueForNumericInputs": 6.027456183070403, + "maxParameterValueForNumericInputs": 0.8008281904610115, + "defaultValue": "defaultValue", + "dataType": "string", + "name": "name", + "description": "description" + } + ], + "associatedIndicatorId": "associatedIndicatorId", + "name": "name", + "description": "description", + "requiredGeoresourceIds": [ + "requiredGeoresourceIds", + "requiredGeoresourceIds" + ] + } + */ + var postBody = { + "name": scriptName, + "description": description, + "associatedIndicatorId": targetIndicatorMetadata.indicatorId, + "requiredIndicatorIds": this.requiredIndicators_tmp.map(indicatorMetadata => indicatorMetadata.indicatorId), + "requiredGeoresourceIds": this.requiredGeoresources_tmp.map(georesourceMetadata => georesourceMetadata.georesourceId), + "variableProcessParameters": this.requiredScriptParameters_tmp, + "scriptCodeBase64": window.btoa(this.scriptCode_readableString) + }; + return await $http({ + url: this.targetUrlToManagementService + "process-scripts", + method: "POST", + data: postBody, + headers: { + 'Content-Type': "application/json" + } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + return response.data; + }, function errorCallback(response) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while posting to importer service."); + throw response; }); - }); - } - }; - + }; + this.updateScript = async function (scriptName, description, scriptId) { + console.log("Trying to POST to importer service to update spatial unit with id '" + spatialUnitId + "'."); + var putBody = { + "name": scriptName, + "description": description, + "requiredIndicatorIds": this.requiredIndicators_tmp, + "requiredGeoresourceIds": this.requiredGeoresources_tmp, + "variableProcessParameters": this.requiredScriptParameters_tmp, + "scriptCodeBase64": window.btoa(this.scriptCode_readableString) + }; + return await $http({ + url: this.targetUrlToManagementService + "process-scripts/" + scriptId, + method: "PUT", + data: putBody, + headers: { + 'Content-Type': "application/json" + } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + return response.data; + }, function errorCallback(response) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while posting to importer service."); + throw response; + }); + }; + this.getAlphabetLetterFromNumber = function (number) { + return String.fromCharCode(Number(number) + 'A'.charCodeAt(0)); + }; + this.styleMathFormula = function (domOutputElementId) { + var output = document.getElementById(domOutputElementId); + output.innerHTML = this.scriptFormulaHTML; + // MathJax.texReset(); + // MathJax.typesetClear(); + MathJax.typesetPromise([output]).then(function () { + }).catch(function (err) { + output.innerHTML = ''; + output.appendChild(document.createTextNode(err.message)); + console.error(err); + }).then(function () { + }); + }; + this.styleMathFormula_forExplanation = function (domOutputElementId) { + var output = document.getElementById(domOutputElementId); + // MathJax.texReset(); + // MathJax.typesetClear(); + MathJax.typesetPromise([output]).then(function () { + $timeout(function () { + self.scriptFormulaExplanation = "" + output.innerHTML; + $rootScope.$apply(); + }); + }).catch(function (err) { + output.innerHTML = ''; + output.appendChild(document.createTextNode(err.message)); + console.error(err); + }).then(function () { + $timeout(function () { + self.scriptFormulaExplanation = "" + output.innerHTML; + $rootScope.$apply(); + }); + }); + }; + this.typesetContainerByClass = function (className) { + var domElements = document.getElementsByClassName(className); + for (const domElement of domElements) { + MathJax.typesetPromise([domElement]).then(function () { + $timeout(function () { + }); + }).catch(function (err) { + console.error(err); + }).then(function () { + $timeout(function () { + }); + }); + } + }; }]); +//# sourceMappingURL=kommonitor-script-helper-service.module.js.map \ No newline at end of file diff --git a/app/util/genericServices/kommonitorScriptHelperService/kommonitor-script-helper-service.module.js.map b/app/util/genericServices/kommonitorScriptHelperService/kommonitor-script-helper-service.module.js.map new file mode 100644 index 000000000..65b5e5788 --- /dev/null +++ b/app/util/genericServices/kommonitorScriptHelperService/kommonitor-script-helper-service.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-script-helper-service.module.js","sourceRoot":"","sources":["kommonitor-script-helper-service.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,wBAAwB,EAAE,CAAC,wBAAwB,CAAC,CAAC,CAAC;AAErE,OAAO;KACJ,MAAM,CAAC,wBAAwB,EAAE,EAAE,CAAC;KACpC,OAAO,CACN,+BAA+B,EAAE,CAAC,YAAY,EAAE,UAAU,EAAE,+BAA+B,EAAE,OAAO,EAAE,OAAO;IAC7G,UAAU,UAAU,EAAE,QAAQ,EAC5B,6BAA6B,EAAE,KAAK,EAAE,KAAK;QAE3C,IAAI,IAAI,GAAG,IAAI,CAAC;QAEhB,IAAI,CAAC,4BAA4B,GAAG,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,QAAQ,GAAG,GAAG,CAAC;QAExE,IAAI,CAAC,wBAAwB,GAAG;YAC9B;gBACH,aAAa,EAAE,mBAAmB;gBAClC,SAAS,EAAE,QAAQ;aACnB;YACD;gBACC,aAAa,EAAE,yBAAyB;gBACxC,SAAS,EAAE,SAAS;aAChB;YACD;gBACH,aAAa,EAAE,oBAAoB;gBACnC,SAAS,EAAE,SAAS;aACpB;YACD;gBACC,aAAa,EAAE,yBAAyB;gBACxC,SAAS,EAAE,QAAQ;aACnB;SACE,CAAC;QAEF,IAAI,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itor-script-helper-service.module.ts b/app/util/genericServices/kommonitorScriptHelperService/kommonitor-script-helper-service.module.ts new file mode 100644 index 000000000..d1fcef1cb --- /dev/null +++ b/app/util/genericServices/kommonitorScriptHelperService/kommonitor-script-helper-service.module.ts @@ -0,0 +1,495 @@ +angular.module('kommonitorScriptHelper', ['kommonitorDataExchange']); + +angular + .module('kommonitorScriptHelper', []) + .service( + 'kommonitorScriptHelperService', ['$rootScope', '$timeout', 'kommonitorDataExchangeService', '$http', '__env', + function ($rootScope, $timeout, + kommonitorDataExchangeService, $http, __env) { + + var self = this; + + this.targetUrlToManagementService = __env.apiUrl + __env.basePath + "/"; + + this.availableScriptDataTypes = [ + { + "displayName": "Textuell (String)", + "apiName": "string" + }, + { + "displayName": "Wahrheitswert (Boolean)", + "apiName": "boolean" + }, + { + "displayName": "Ganzzahl (Integer)", + "apiName": "integer" + }, + { + "displayName": "Gleitkommazahl (Double)", + "apiName": "double" + } + ]; + + this.availableScriptTypeOptions = [ + { + "displayName": "Generische Definition", + "apiName": "generic" + }, + { + "displayName": "Indikatoren - Summe aller Indikatoren", + "apiName": "indicator_sum" + }, + { + "displayName": "Indikatoren - Subtraktion von Basis-Indikatoren von einem Referenzindikator", + "apiName": "indicator_subtract" + }, + { + "displayName": "Indikatoren - Prozentualer Anteil (Quotient zwischen Basis-Indikatoren und einem Referenzindikator)", + "apiName": "indicator_percentage" + }, + { + "displayName": "Indikatoren - Anteil (Quotient zwischen Basis-Indikatoren und einem Referenzindikator)", + "apiName": "indicator_share" + }, + { + "displayName": "Indikatoren - Division (Quotient zweier Indikatoren)", + "apiName": "indicator_division" + }, + { + "displayName": "Indikatoren - Trend (mittels linearer Regression)", + "apiName": "indicator_trend" + }, + { + "displayName": "Indikatoren - Kontinuität (mittels Pearson Korrelation)", + "apiName": "indicator_continuity" + }, + { + "displayName": "Indikatoren - Veränderung absolut", + "apiName": "indicator_change_absolute" + }, + { + "displayName": "Indikatoren - Veränderung absolut mit festem Referenz-Zeitpunkt", + "apiName": "indicator_change_absolute_refDate" + }, + { + "displayName": "Indikatoren - Veränderung prozentual mit festem Referenz-Zeitpunkt", + "apiName": "indicator_change_relative_refDate" + }, + { + "displayName": "Indikatoren - Veränderung prozentual", + "apiName": "indicator_change_relative" + }, + { + "displayName": "Indikatoren - Promille-Wert (Quotient zwischen Basis-Indikatoren und einem Referenzindikator)", + "apiName": "indicator_promille" + }, + { + "displayName": "Leitindikator - verkettete Berechnung (Rank, Min-Max-Normalisierung, Aggregation)", + "apiName": "indicator_headlineIndicator" + }, + { + "displayName": "Indikatoren - Produkt aller Indikatoren", + "apiName": "indicator_multiplication" + }, + { + "displayName": "Georessourcen - Anzahl Punkte in Polygon", + "apiName": "georesource_pointsInPolygon" + }, + { + "displayName": "Georessourcen - Statistiken anhand Objekteigenschaft (Punktdatensätze)", + "apiName": "georesource_statistics" + }, + { + "displayName": "Georessourcen - Prozentualer Anteil anhand Objekteigenschaft (Punktdatensätze)", + "apiName": "georesource_subsetShare" + }, + { + "displayName": "Georessourcen - Summierte Linienlänge je Polygon", + "apiName": "lineSegmentInPolygon" + } + ]; + + this.temporalOptions = [ + { + "apiName": "YEARS", + "displayName": "Jahr(e)" + }, + { + "apiName": "MONTHS", + "displayName": "Monat(e)" + }, + { + "apiName": "DAYS", + "displayName": "Tag(e)" + } + ]; + + this.requiredIndicators_tmp = []; + this.requiredGeoresources_tmp = []; + this.requiredScriptParameters_tmp = []; + this.scriptCode_base64String = undefined; + this.scriptCode_readableString = undefined; + + this.scriptFormulaHTML = undefined; + this.scriptFormulaHTML_successToastDisplay = this.scriptFormulaHTML; + this.scriptFormulaHTML_overwriteTargetIndicatorMethod = false; + + this.scriptFormulaExplanation = undefined; + + this.targetIndicatorOldProcessDescription = undefined; + + this.reset = function(){ + this.requiredIndicators_tmp = []; + this.requiredGeoresources_tmp = []; + this.requiredScriptParameters_tmp = []; + this.scriptCode_base64String = undefined; + this.scriptCode_readableString = undefined; + this.scriptFormulaHTML = undefined; + this.scriptFormulaHTML_overwriteTargetIndicatorMethod = false; + this.scriptFormulaExplanation = undefined; + this.targetIndicatorOldProcessDescription = undefined; + }; + + this.addBaseIndicator = function(indicatorMetadata){ + if(!indicatorMetadata){ + return; + } + // for (const baseIndicator of this.requiredIndicators_tmp) { + // if (baseIndicator.indicatorId === indicatorMetadata.indicatorId){ + // // already inserted as base indicator, hence add not allowed + // return; + // } + // } + this.requiredIndicators_tmp.push(indicatorMetadata); + }; + + this.removeBaseIndicator = function(indicatorMetadata){ + for (let index = 0; index < this.requiredIndicators_tmp.length; index++) { + + if (this.requiredIndicators_tmp[index].indicatorId === indicatorMetadata.indicatorId){ + // remove object + this.requiredIndicators_tmp.splice(index, 1); + break; + } + } + }; + + this.addBaseGeoresource = function(georesourceMetadata){ + // for (const baseGeoresource of this.requiredGeoresources_tmp) { + // if (baseGeoresource.georesourceId === georesourceMetadata.georesourceId){ + // // already inserted as base georesource, hence add not allowed + // return; + // } + // } + this.requiredGeoresources_tmp.push(georesourceMetadata); + }; + + this.removeBaseGeoresource = function(georesourceMetadata){ + for (let index = 0; index < this.requiredGeoresources_tmp.length; index++) { + + if (this.requiredGeoresources_tmp[index].georesourceId === georesourceMetadata.georesourceId){ + // remove object + this.requiredGeoresources_tmp.splice(index, 1); + break; + } + } + }; + + this.addScriptParameter = function(parameterName, parameterDescription, parameterDataType, parameterDefaultValue, parameterNumericMinValue, parameterNumericMaxValue){ + for (const scriptParameter of this.requiredScriptParameters_tmp) { + if (scriptParameter.name === parameterName){ + // already inserted as script parameter, hence add not allowed + return; + } + } + + var scriptParameter = { + "name": parameterName, + "description": parameterDescription, + "dataType": parameterDataType.apiName, + "defaultValue": parameterDefaultValue, + "minParameterValueForNumericInputs": parameterNumericMinValue || 0, + "maxParameterValueForNumericInputs": parameterNumericMaxValue || 1 + + }; + this.requiredScriptParameters_tmp.push(scriptParameter); + }; + + this.removeScriptParameter = function(scriptParameter){ + for (let index = 0; index < this.requiredScriptParameters_tmp.length; index++) { + + if (this.requiredScriptParameters_tmp[index].name === scriptParameter.name){ + // remove object + this.requiredScriptParameters_tmp.splice(index, 1); + break; + } + } + }; + + this.removeScriptParameter_byName = function(scriptParameterName){ + for (let index = 0; index < this.requiredScriptParameters_tmp.length; index++) { + + if (this.requiredScriptParameters_tmp[index].name === scriptParameterName){ + // remove object + this.requiredScriptParameters_tmp.splice(index, 1); + break; + } + } + }; + + this.prettifyScriptCodePreview = function(htmlDomElementId){ + + $timeout(function(){ + + $(htmlDomElementId).removeClass("prettyprinted"); + + PR.prettyPrint(); + + }, 250); + + }; + + this.buildPatchBody_indicators = function(targetIndicatorMetadata){ + var patchBody = + { + "metadata": { + "note": targetIndicatorMetadata.metadata.note || null, + "literature": targetIndicatorMetadata.metadata.literature || null, + "updateInterval": targetIndicatorMetadata.metadata.updateInterval, + "sridEPSG": targetIndicatorMetadata.metadata.sridEPSG || 4326, + "datasource": targetIndicatorMetadata.metadata.datasource, + "contact": targetIndicatorMetadata.metadata.contact, + "lastUpdate": targetIndicatorMetadata.metadata.lastUpdate, + "description": targetIndicatorMetadata.metadata.description || null, + "databasis": targetIndicatorMetadata.metadata.databasis || null + }, + "refrencesToOtherIndicators": [], // filled directly after + "allowedRoles": targetIndicatorMetadata.allowedRoles, + "datasetName": targetIndicatorMetadata.indicatorName, + "abbreviation": targetIndicatorMetadata.abbreviation || null, + "characteristicValue": targetIndicatorMetadata.characteristicValue || null, + "tags": targetIndicatorMetadata.tags, + "creationType": targetIndicatorMetadata.creationType, + "unit": targetIndicatorMetadata.unit, + "topicReference": targetIndicatorMetadata.topicReference, + "refrencesToGeoresources": [], // filled directly after + "indicatorType": targetIndicatorMetadata.indicatorType, + "interpretation": targetIndicatorMetadata.interpretation || "", + "isHeadlineIndicator": targetIndicatorMetadata.isHeadlineIndicator || false, + "processDescription": this.scriptFormulaHTML || targetIndicatorMetadata.processDescription, + "lowestSpatialUnitForComputation": targetIndicatorMetadata.lowestSpatialUnitForComputation, + "defaultClassificationMapping": targetIndicatorMetadata.defaultClassificationMapping + }; + + // REFERENCES + + if(targetIndicatorMetadata.referencedIndicators && targetIndicatorMetadata.referencedIndicators.length > 0){ + patchBody.refrencesToOtherIndicators = []; + + for (const indicRef of targetIndicatorMetadata.referencedIndicators) { + patchBody.refrencesToOtherIndicators.push({ + "indicatorId": indicRef.referencedIndicatorId, + "referenceDescription": indicRef.referencedIndicatorDescription + }); + } + } + + if(targetIndicatorMetadata.referencedGeoresources && targetIndicatorMetadata.referencedGeoresources.length > 0){ + patchBody.refrencesToGeoresources = []; + + for (const geoRef of targetIndicatorMetadata.referencedGeoresources) { + patchBody.refrencesToGeoresources.push({ + "georesourceId": geoRef.referencedGeoresourceId, + "referenceDescription": geoRef.referencedGeoresourceDescription + }); + } + } + + return patchBody; + }; + + this.replaceMethodMetadataForTargetIndicator = async function(targetIndicatorMetadata){ + var patchBody = this.buildPatchBody_indicators(targetIndicatorMetadata); + + this.targetIndicatorOldProcessDescription = targetIndicatorMetadata.processDescription; + + $http({ + url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/indicators/" + targetIndicatorMetadata.indicatorId, + method: "PATCH", + data: patchBody + // headers: { + // 'Content-Type': undefined + // } + }).then(function successCallback(response) { + + $rootScope.$broadcast("refreshIndicatorOverviewTable", "edit", targetIndicatorMetadata.indicatorId); + + }, function errorCallback(error) { + + }); + }; + + this.postNewScript = async function(scriptName, description, targetIndicatorMetadata){ + console.log("Trying to POST to management service to register new script."); + + /* POST BODY + { + "scriptCodeBase64": "scriptCodeBase64", + "requiredIndicatorIds": [ + "requiredIndicatorIds", + "requiredIndicatorIds" + ], + "variableProcessParameters": [ + { + "minParameterValueForNumericInputs": 6.027456183070403, + "maxParameterValueForNumericInputs": 0.8008281904610115, + "defaultValue": "defaultValue", + "dataType": "string", + "name": "name", + "description": "description" + }, + { + "minParameterValueForNumericInputs": 6.027456183070403, + "maxParameterValueForNumericInputs": 0.8008281904610115, + "defaultValue": "defaultValue", + "dataType": "string", + "name": "name", + "description": "description" + } + ], + "associatedIndicatorId": "associatedIndicatorId", + "name": "name", + "description": "description", + "requiredGeoresourceIds": [ + "requiredGeoresourceIds", + "requiredGeoresourceIds" + ] + } + */ + + var postBody = { + "name": scriptName, + "description": description, + "associatedIndicatorId": targetIndicatorMetadata.indicatorId, + "requiredIndicatorIds": this.requiredIndicators_tmp.map(indicatorMetadata => indicatorMetadata.indicatorId), + "requiredGeoresourceIds": this.requiredGeoresources_tmp.map(georesourceMetadata => georesourceMetadata.georesourceId), + "variableProcessParameters": this.requiredScriptParameters_tmp, + "scriptCodeBase64": window.btoa(this.scriptCode_readableString) + }; + + return await $http({ + url: this.targetUrlToManagementService + "process-scripts", + method: "POST", + data: postBody, + headers: { + 'Content-Type': "application/json" + } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + return response.data; + + }, function errorCallback(response) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while posting to importer service."); + throw response; + }); + }; + + this.updateScript = async function(scriptName, description, scriptId){ + console.log("Trying to POST to importer service to update spatial unit with id '" + spatialUnitId + "'."); + + var putBody = { + "name": scriptName, + "description": description, + "requiredIndicatorIds": this.requiredIndicators_tmp, + "requiredGeoresourceIds": this.requiredGeoresources_tmp, + "variableProcessParameters": this.requiredScriptParameters_tmp, + "scriptCodeBase64": window.btoa(this.scriptCode_readableString) + }; + + return await $http({ + url: this.targetUrlToManagementService + "process-scripts/" + scriptId, + method: "PUT", + data: putBody, + headers: { + 'Content-Type': "application/json" + } + }).then(function successCallback(response) { + // this callback will be called asynchronously + // when the response is available + + return response.data; + + }, function errorCallback(response) { + // called asynchronously if an error occurs + // or server returns response with an error status. + //$scope.error = response.statusText; + console.error("Error while posting to importer service."); + throw response; + }); + }; + + this.getAlphabetLetterFromNumber = function(number){ + return String.fromCharCode(Number(number) + 'A'.charCodeAt(0)); + }; + + this.styleMathFormula = function(domOutputElementId){ + var output = document.getElementById(domOutputElementId); + output.innerHTML = this.scriptFormulaHTML; + + // MathJax.texReset(); + // MathJax.typesetClear(); + MathJax.typesetPromise([output]).then(function(){ + + }).catch(function (err) { + output.innerHTML = ''; + output.appendChild(document.createTextNode(err.message)); + console.error(err); + }).then(function () { + + }); + }; + + this.styleMathFormula_forExplanation = function(domOutputElementId){ + var output = document.getElementById(domOutputElementId); + + // MathJax.texReset(); + // MathJax.typesetClear(); + MathJax.typesetPromise([output]).then(function(){ + $timeout(function(){ + self.scriptFormulaExplanation = "" + output.innerHTML; + $rootScope.$apply(); + }); + }).catch(function (err) { + output.innerHTML = ''; + output.appendChild(document.createTextNode(err.message)); + console.error(err); + }).then(function () { + $timeout(function(){ + self.scriptFormulaExplanation = "" + output.innerHTML; + $rootScope.$apply(); + }); + }); + }; + + this.typesetContainerByClass = function(className){ + var domElements = document.getElementsByClassName(className); + + for (const domElement of domElements) { + MathJax.typesetPromise([domElement]).then(function(){ + $timeout(function(){ + }); + }).catch(function (err) { + console.error(err); + }).then(function () { + $timeout(function(){ + }); + }); + } + }; + + }]); diff --git a/app/util/genericServices/kommonitorShareHelperService/kommonitor-share-helper-service.module.js b/app/util/genericServices/kommonitorShareHelperService/kommonitor-share-helper-service.module.js index 4639a9bae..6995df3ed 100644 --- a/app/util/genericServices/kommonitorShareHelperService/kommonitor-share-helper-service.module.js +++ b/app/util/genericServices/kommonitorShareHelperService/kommonitor-share-helper-service.module.js @@ -1,139 +1,115 @@ +"use strict"; angular.module('kommonitorShareHelper', ['kommonitorDataExchange']); - - angular - .module('kommonitorShareHelper', []) - .service( - 'kommonitorShareHelperService', [ + .module('kommonitorShareHelper', []) + .service('kommonitorShareHelperService', [ '$http', '__env', 'Auth', '$routeParams', '$location', 'kommonitorDataExchangeService', function ($http, __env, Auth, $routeParams, $location, kommonitorDataExchangeService) { - - this.baseUrlToKomMonitorDataAPI = __env.apiUrl + __env.basePath; - let self = this; - - this.queryParamMap = new Map(); - this.currentShareLink = ""; - - this.paramName_loginRequired = "login"; - this.paramName_indicatorId = "ind"; - this.paramName_spatialUnitName = "spu"; - this.paramName_zoomLevel = "zoom"; - this.paramName_latitude = "lat"; - this.paramName_longitude = "lon"; - - this.initParamsMap = function(){ - // set map content from params + this.baseUrlToKomMonitorDataAPI = __env.apiUrl + __env.basePath; + let self = this; this.queryParamMap = new Map(); - - for (const key in $routeParams) { - if (Object.hasOwnProperty.call($routeParams, key)) { - const value = $routeParams[key]; - this.queryParamMap.set(key, value); - } - } - }; - - this.applyQueryParams = function(){ - if ($routeParams[this.paramName_indicatorId]){ - __env.initialIndicatorId = $routeParams[this.paramName_indicatorId]; - } - if ($routeParams[this.paramName_spatialUnitName]){ - __env.initialSpatialUnitName = $routeParams[this.paramName_spatialUnitName]; - } - if ($routeParams[this.paramName_latitude]){ - __env.initialLatitude = $routeParams[this.paramName_latitude]; - } - if ($routeParams[this.paramName_longitude]){ - __env.initialLongitude = $routeParams[this.paramName_longitude]; - } - if ($routeParams[this.paramName_zoomLevel]){ - __env.initialZoomLevel = $routeParams[this.paramName_zoomLevel]; - } - }; - - this.init = function(){ - // parse query params - this.initParamsMap(); - - // if login required then route to login page with same link as redirect URL - if ($routeParams[this.paramName_loginRequired] && JSON.parse($routeParams[this.paramName_loginRequired])){ - // login required - if(window.__env.enableKeycloakSecurity){ - if (Auth.keycloak.authenticated) { - // if (Auth.keycloak.showAdminView) { - // return true; - // } else { - // return $q.reject('Not Authenticated'); - // } + this.currentShareLink = ""; + this.paramName_loginRequired = "login"; + this.paramName_indicatorId = "ind"; + this.paramName_spatialUnitName = "spu"; + this.paramName_zoomLevel = "zoom"; + this.paramName_latitude = "lat"; + this.paramName_longitude = "lon"; + this.initParamsMap = function () { + // set map content from params + this.queryParamMap = new Map(); + for (const key in $routeParams) { + if (Object.hasOwnProperty.call($routeParams, key)) { + const value = $routeParams[key]; + this.queryParamMap.set(key, value); + } + } + }; + this.applyQueryParams = function () { + if ($routeParams[this.paramName_indicatorId]) { + __env.initialIndicatorId = $routeParams[this.paramName_indicatorId]; + } + if ($routeParams[this.paramName_spatialUnitName]) { + __env.initialSpatialUnitName = $routeParams[this.paramName_spatialUnitName]; + } + if ($routeParams[this.paramName_latitude]) { + __env.initialLatitude = $routeParams[this.paramName_latitude]; + } + if ($routeParams[this.paramName_longitude]) { + __env.initialLongitude = $routeParams[this.paramName_longitude]; + } + if ($routeParams[this.paramName_zoomLevel]) { + __env.initialZoomLevel = $routeParams[this.paramName_zoomLevel]; + } + }; + this.init = function () { + // parse query params + this.initParamsMap(); + // if login required then route to login page with same link as redirect URL + if ($routeParams[this.paramName_loginRequired] && JSON.parse($routeParams[this.paramName_loginRequired])) { + // login required + if (window.__env.enableKeycloakSecurity) { + if (Auth.keycloak.authenticated) { + // if (Auth.keycloak.showAdminView) { + // return true; + // } else { + // return $q.reject('Not Authenticated'); + // } + } + else { + Auth.keycloak.login({ + redirectUri: this.currentShareLink + }); + } + } + } + // set config and data options from params + this.applyQueryParams(); + }; + this.generateCurrentShareLink = function () { + this.setShareLinkParam_mapExtent(); + this.setShareLinkParam_currentIndicatorId(); + this.setShareLinkParam_currentSpatialUnitName(); + // regerenate the share link from all current parameters + this.currentShareLink = $location.absUrl(); + if (this.currentShareLink.includes("?")) { + this.currentShareLink = this.currentShareLink.split("?")[0]; + } + this.currentShareLink += "?"; + this.queryParamMap.forEach((value, key) => { + self.currentShareLink += "" + key + "=" + value + "&"; + }); + }; + this.setShareLinkParam = function (paramName, value) { + this.queryParamMap.set(paramName, value); + }; + this.setShareLinkParam_currentIndicatorId = function () { + this.setShareLinkParam(this.paramName_indicatorId, kommonitorDataExchangeService.selectedIndicator.indicatorId); + if (kommonitorDataExchangeService.selectedIndicator.allowedRoles.length > 0) { + this.setShareLinkParam(this.paramName_loginRequired, "true"); } else { - Auth.keycloak.login({ - redirectUri: this.currentShareLink - }); + for (const spatialUnit of kommonitorDataExchangeService.selectedIndicator.applicableSpatialUnits) { + if (spatialUnit.spatialUnitName == kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel) { + if (spatialUnit.allowedRoles.length > 0) { + this.setShareLinkParam(this.paramName_loginRequired, "true"); + } + } + } } - } - } - - // set config and data options from params - this.applyQueryParams(); - }; - - this.generateCurrentShareLink = function(){ - - this.setShareLinkParam_mapExtent(); - this.setShareLinkParam_currentIndicatorId(); - this.setShareLinkParam_currentSpatialUnitName(); - - // regerenate the share link from all current parameters - this.currentShareLink = $location.absUrl(); - - if(this.currentShareLink.includes("?")){ - this.currentShareLink = this.currentShareLink.split("?")[0]; - } - - this.currentShareLink += "?"; - - this.queryParamMap.forEach((value, key) => { - self.currentShareLink += "" + key + "=" + value + "&"; - } - ); - - }; - - this.setShareLinkParam = function(paramName, value){ - this.queryParamMap.set(paramName, value); - }; - - this.setShareLinkParam_currentIndicatorId = function(){ - this.setShareLinkParam(this.paramName_indicatorId, kommonitorDataExchangeService.selectedIndicator.indicatorId); - - if(kommonitorDataExchangeService.selectedIndicator.allowedRoles.length > 0){ - this.setShareLinkParam(this.paramName_loginRequired, "true"); - } - else{ - for (const spatialUnit of kommonitorDataExchangeService.selectedIndicator.applicableSpatialUnits) { - if(spatialUnit.spatialUnitName == kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel){ - if (spatialUnit.allowedRoles.length > 0){ + }; + this.setShareLinkParam_currentSpatialUnitName = function () { + this.setShareLinkParam(this.paramName_spatialUnitName, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel); + if (kommonitorDataExchangeService.selectedSpatialUnit.allowedRoles.length > 0) { this.setShareLinkParam(this.paramName_loginRequired, "true"); - } } - } - } - - }; - - this.setShareLinkParam_currentSpatialUnitName = function(){ - this.setShareLinkParam(this.paramName_spatialUnitName, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel); - if(kommonitorDataExchangeService.selectedSpatialUnit.allowedRoles.length > 0){ - this.setShareLinkParam(this.paramName_loginRequired, "true"); - } - }; - - this.setShareLinkParam_mapExtent = function(){ - this.setShareLinkParam(this.paramName_latitude, __env.currentLatitude); - this.setShareLinkParam(this.paramName_longitude, __env.currentLongitude); - this.setShareLinkParam(this.paramName_zoomLevel, __env.currentZoomLevel); - __env.centerMapInitially = false; - }; - - }]); + }; + this.setShareLinkParam_mapExtent = function () { + this.setShareLinkParam(this.paramName_latitude, __env.currentLatitude); + this.setShareLinkParam(this.paramName_longitude, __env.currentLongitude); + this.setShareLinkParam(this.paramName_zoomLevel, __env.currentZoomLevel); + __env.centerMapInitially = false; + }; + } +]); +//# sourceMappingURL=kommonitor-share-helper-service.module.js.map \ No newline at end of file diff --git a/app/util/genericServices/kommonitorShareHelperService/kommonitor-share-helper-service.module.js.map b/app/util/genericServices/kommonitorShareHelperService/kommonitor-share-helper-service.module.js.map new file mode 100644 index 000000000..9d3efdc8c --- /dev/null +++ b/app/util/genericServices/kommonitorShareHelperService/kommonitor-share-helper-service.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-share-helper-service.module.js","sourceRoot":"","sources":["kommonitor-share-helper-service.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,uBAAuB,EAAE,CAAC,wBAAwB,CAAC,CAAC,CAAC;AAGpE,OAAO;KACJ,MAAM,CAAC,uBAAuB,EAAE,EAAE,CAAC;KACnC,OAAO,CACN,8BAA8B,EAAE;IAChC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,+BAA+B;IACtF,UAAU,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,6BAA6B;QAElF,IAAI,CAAC,0BAA0B,GAAG,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC;QAChE,IAAI,IAAI,GAAG,IAAI,CAAC;QAEhB,IAAI,CAAC,aAAa,GAAG,IAAI,GAAG,EAAE,CAAC;QAC/B,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC;QAE3B,IAAI,CAAC,uBAAuB,GAAG,OAAO,CAAC;QACvC,IAAI,CAAC,qBAAqB,GAAG,KAAK,CAA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C,CAAC;aAC9D;QACH,CAAC,CAAC;QAEF,IAAI,CAAC,2BAA2B,GAAG;YACjC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,kBAAkB,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;YACvE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,mBAAmB,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;YACzE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,mBAAmB,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;YACzE,KAAK,CAAC,kBAAkB,GAAG,KAAK,CAAC;QACnC,CAAC,CAAC;IAEJ,CAAC;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/util/genericServices/kommonitorShareHelperService/kommonitor-share-helper-service.module.ts b/app/util/genericServices/kommonitorShareHelperService/kommonitor-share-helper-service.module.ts new file mode 100644 index 000000000..4639a9bae --- /dev/null +++ b/app/util/genericServices/kommonitorShareHelperService/kommonitor-share-helper-service.module.ts @@ -0,0 +1,139 @@ +angular.module('kommonitorShareHelper', ['kommonitorDataExchange']); + + +angular + .module('kommonitorShareHelper', []) + .service( + 'kommonitorShareHelperService', [ + '$http', '__env', 'Auth', '$routeParams', '$location', 'kommonitorDataExchangeService', + function ($http, __env, Auth, $routeParams, $location, kommonitorDataExchangeService) { + + this.baseUrlToKomMonitorDataAPI = __env.apiUrl + __env.basePath; + let self = this; + + this.queryParamMap = new Map(); + this.currentShareLink = ""; + + this.paramName_loginRequired = "login"; + this.paramName_indicatorId = "ind"; + this.paramName_spatialUnitName = "spu"; + this.paramName_zoomLevel = "zoom"; + this.paramName_latitude = "lat"; + this.paramName_longitude = "lon"; + + this.initParamsMap = function(){ + // set map content from params + this.queryParamMap = new Map(); + + for (const key in $routeParams) { + if (Object.hasOwnProperty.call($routeParams, key)) { + const value = $routeParams[key]; + this.queryParamMap.set(key, value); + } + } + }; + + this.applyQueryParams = function(){ + if ($routeParams[this.paramName_indicatorId]){ + __env.initialIndicatorId = $routeParams[this.paramName_indicatorId]; + } + if ($routeParams[this.paramName_spatialUnitName]){ + __env.initialSpatialUnitName = $routeParams[this.paramName_spatialUnitName]; + } + if ($routeParams[this.paramName_latitude]){ + __env.initialLatitude = $routeParams[this.paramName_latitude]; + } + if ($routeParams[this.paramName_longitude]){ + __env.initialLongitude = $routeParams[this.paramName_longitude]; + } + if ($routeParams[this.paramName_zoomLevel]){ + __env.initialZoomLevel = $routeParams[this.paramName_zoomLevel]; + } + }; + + this.init = function(){ + // parse query params + this.initParamsMap(); + + // if login required then route to login page with same link as redirect URL + if ($routeParams[this.paramName_loginRequired] && JSON.parse($routeParams[this.paramName_loginRequired])){ + // login required + if(window.__env.enableKeycloakSecurity){ + if (Auth.keycloak.authenticated) { + // if (Auth.keycloak.showAdminView) { + // return true; + // } else { + // return $q.reject('Not Authenticated'); + // } + } + else { + Auth.keycloak.login({ + redirectUri: this.currentShareLink + }); + } + } + } + + // set config and data options from params + this.applyQueryParams(); + }; + + this.generateCurrentShareLink = function(){ + + this.setShareLinkParam_mapExtent(); + this.setShareLinkParam_currentIndicatorId(); + this.setShareLinkParam_currentSpatialUnitName(); + + // regerenate the share link from all current parameters + this.currentShareLink = $location.absUrl(); + + if(this.currentShareLink.includes("?")){ + this.currentShareLink = this.currentShareLink.split("?")[0]; + } + + this.currentShareLink += "?"; + + this.queryParamMap.forEach((value, key) => { + self.currentShareLink += "" + key + "=" + value + "&"; + } + ); + + }; + + this.setShareLinkParam = function(paramName, value){ + this.queryParamMap.set(paramName, value); + }; + + this.setShareLinkParam_currentIndicatorId = function(){ + this.setShareLinkParam(this.paramName_indicatorId, kommonitorDataExchangeService.selectedIndicator.indicatorId); + + if(kommonitorDataExchangeService.selectedIndicator.allowedRoles.length > 0){ + this.setShareLinkParam(this.paramName_loginRequired, "true"); + } + else{ + for (const spatialUnit of kommonitorDataExchangeService.selectedIndicator.applicableSpatialUnits) { + if(spatialUnit.spatialUnitName == kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel){ + if (spatialUnit.allowedRoles.length > 0){ + this.setShareLinkParam(this.paramName_loginRequired, "true"); + } + } + } + } + + }; + + this.setShareLinkParam_currentSpatialUnitName = function(){ + this.setShareLinkParam(this.paramName_spatialUnitName, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel); + if(kommonitorDataExchangeService.selectedSpatialUnit.allowedRoles.length > 0){ + this.setShareLinkParam(this.paramName_loginRequired, "true"); + } + }; + + this.setShareLinkParam_mapExtent = function(){ + this.setShareLinkParam(this.paramName_latitude, __env.currentLatitude); + this.setShareLinkParam(this.paramName_longitude, __env.currentLongitude); + this.setShareLinkParam(this.paramName_zoomLevel, __env.currentZoomLevel); + __env.centerMapInitially = false; + }; + + }]); diff --git a/app/util/genericServices/kommonitorSingleFeatureMapHelperService/kommonitor-single-feature-map-helper-service.module.js b/app/util/genericServices/kommonitorSingleFeatureMapHelperService/kommonitor-single-feature-map-helper-service.module.js index 3abfd1b00..606421aa3 100644 --- a/app/util/genericServices/kommonitorSingleFeatureMapHelperService/kommonitor-single-feature-map-helper-service.module.js +++ b/app/util/genericServices/kommonitorSingleFeatureMapHelperService/kommonitor-single-feature-map-helper-service.module.js @@ -1,431 +1,368 @@ +"use strict"; angular.module('kommonitorSingleFeatureMapHelper', ['kommonitorDataExchange']); - angular - .module('kommonitorSingleFeatureMapHelper', []) - .service( - 'kommonitorSingleFeatureMapHelperService', ['$rootScope', '__env', '$timeout', + .module('kommonitorSingleFeatureMapHelper', []) + .service('kommonitorSingleFeatureMapHelperService', ['$rootScope', '__env', '$timeout', function ($rootScope, __env, $timeout) { - - var self = this; - - this.resourceType_point = "POINT"; - this.resourceType_line = "LINE"; - this.resourceType_polygon = "POLYGON"; - - //leaflet map instance - this.map; - this.layerControl; - // layer holding the editable feature - this.featureLayer; - this.drawControl; - this.geosearchControl; - - // backgroundLayer - this.backgroundLayer; - - /* - * L.TileLayer.Grayscale is a regular tilelayer with grayscale makeover. - */ - + var self = this; + this.resourceType_point = "POINT"; + this.resourceType_line = "LINE"; + this.resourceType_polygon = "POLYGON"; + //leaflet map instance + this.map; + this.layerControl; + // layer holding the editable feature + this.featureLayer; + this.drawControl; + this.geosearchControl; + // backgroundLayer + this.backgroundLayer; + /* + * L.TileLayer.Grayscale is a regular tilelayer with grayscale makeover. + */ L.TileLayer.Grayscale = L.TileLayer.extend({ - options: { - quotaRed: 21, - quotaGreen: 71, - quotaBlue: 8, - quotaDividerTune: 0, - quotaDivider: function () { - return this.quotaRed + this.quotaGreen + this.quotaBlue + this.quotaDividerTune; + options: { + quotaRed: 21, + quotaGreen: 71, + quotaBlue: 8, + quotaDividerTune: 0, + quotaDivider: function () { + return this.quotaRed + this.quotaGreen + this.quotaBlue + this.quotaDividerTune; + } + }, + initialize: function (url, options) { + options = options || {}; + options.crossOrigin = true; + L.TileLayer.prototype.initialize.call(this, url, options); + this.on('tileload', function (e) { + this._makeGrayscale(e.tile); + }); + }, + _createTile: function () { + var tile = L.TileLayer.prototype._createTile.call(this); + tile.crossOrigin = "Anonymous"; + return tile; + }, + _makeGrayscale: function (img) { + if (img.getAttribute('data-grayscaled')) + return; + img.crossOrigin = ''; + var canvas = document.createElement("canvas"); + canvas.width = img.width; + canvas.height = img.height; + var ctx = canvas.getContext("2d"); + ctx.drawImage(img, 0, 0); + var imgd = ctx.getImageData(0, 0, canvas.width, canvas.height); + var pix = imgd.data; + for (var i = 0, n = pix.length; i < n; i += 4) { + pix[i] = pix[i + 1] = pix[i + 2] = (this.options.quotaRed * pix[i] + this.options.quotaGreen * pix[i + 1] + this.options.quotaBlue * pix[i + 2]) / this.options.quotaDivider(); + } + ctx.putImageData(imgd, 0, 0); + img.setAttribute('data-grayscaled', true); + img.src = canvas.toDataURL(); + } + }); + this.invalidateMap = function () { + if (this.map) { + // just wait a bit in order to ensure that map element is visible to make invalidateSize actually work + $timeout(function () { + self.map.invalidateSize(true); + }, 500); + } + }; + this.zoomToDataLayer = function () { + if (this.map && this.dataLayer) { + // just wait a bit in order to ensure that map element is visible to make invalidateSize actually work + $timeout(function () { + self.map.fitBounds(self.dataLayer.getBounds()); + }, 750); + } + }; + this.initSingleFeatureGeoMap = function (domId, resourceType) { + // init leaflet map + // add geometry editing tool for the respective RESOURCE TYPE + // add geocoding plugin if it is POINT resource + // register events that broadcast new geometry to other components + if (this.map) { + this.map.off(); + this.map.remove(); + // var domNode = document.getElementById(domId); + // while (domNode.hasChildNodes()) { + // domNode.removeChild(domNode.lastChild); + // } } - }, - - initialize: function (url, options) { - options = options || {}; - options.crossOrigin = true; - L.TileLayer.prototype.initialize.call(this, url, options); - - this.on('tileload', function (e) { - this._makeGrayscale(e.tile); + // backgroundLayer + this.backgroundLayer = new L.TileLayer.Grayscale("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", { minZoom: __env.minZoomLevel, maxZoom: __env.maxZoomLevel, attribution: "Map data © OpenStreetMap contributors" }); + this.map = L.map(domId, { + center: [__env.initialLatitude, __env.initialLongitude], + zoom: __env.initialZoomLevel, + zoomDelta: 0.5, + zoomSnap: 0.5, + layers: [this.backgroundLayer] }); - }, - - _createTile: function () { - var tile = L.TileLayer.prototype._createTile.call(this); - tile.crossOrigin = "Anonymous"; - return tile; - }, - - _makeGrayscale: function (img) { - if (img.getAttribute('data-grayscaled')) - return; - - img.crossOrigin = ''; - var canvas = document.createElement("canvas"); - canvas.width = img.width; - canvas.height = img.height; - var ctx = canvas.getContext("2d"); - ctx.drawImage(img, 0, 0); - - var imgd = ctx.getImageData(0, 0, canvas.width, canvas.height); - var pix = imgd.data; - for (var i = 0, n = pix.length; i < n; i += 4) { - pix[i] = pix[i + 1] = pix[i + 2] = (this.options.quotaRed * pix[i] + this.options.quotaGreen * pix[i + 1] + this.options.quotaBlue * pix[i + 2]) / this.options.quotaDivider(); + L.control.scale().addTo(this.map); + // this.initLayerControl(); + if (resourceType == this.resourceType_point) { + this.initGeosearchControl(); } - ctx.putImageData(imgd, 0, 0); - img.setAttribute('data-grayscaled', true); - img.src = canvas.toDataURL(); - } - }); - - this.invalidateMap = function(){ - if (this.map){ - // just wait a bit in order to ensure that map element is visible to make invalidateSize actually work - $timeout(function(){ - self.map.invalidateSize(true); - }, 500); - } - }; - - this.zoomToDataLayer = function(){ - if (this.map && this.dataLayer){ - // just wait a bit in order to ensure that map element is visible to make invalidateSize actually work - $timeout(function(){ - self.map.fitBounds(self.dataLayer.getBounds()); - }, 750); - } - }; - - this.initSingleFeatureGeoMap = function(domId, resourceType){ - // init leaflet map - - // add geometry editing tool for the respective RESOURCE TYPE - - // add geocoding plugin if it is POINT resource - - // register events that broadcast new geometry to other components - - if(this.map){ - this.map.off(); - this.map.remove(); - - // var domNode = document.getElementById(domId); - - // while (domNode.hasChildNodes()) { - // domNode.removeChild(domNode.lastChild); - // } - } - - // backgroundLayer - this.backgroundLayer = new L.TileLayer.Grayscale("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", { minZoom: __env.minZoomLevel, maxZoom: __env.maxZoomLevel, attribution: "Map data © OpenStreetMap contributors" }); - - this.map = L.map(domId, { - center: [__env.initialLatitude, __env.initialLongitude], - zoom: __env.initialZoomLevel, - zoomDelta: 0.5, - zoomSnap: 0.5, - layers: [this.backgroundLayer] - }); - - L.control.scale().addTo(this.map); - - // this.initLayerControl(); - - if(resourceType == this.resourceType_point){ - this.initGeosearchControl(); - } - - this.initDrawControl(resourceType); - - this.invalidateMap(); - }; - - this.initLayerControl = function(){ - let baseLayers = { - "OpenStreetMap Graustufen": this.backgroundLayer + this.initDrawControl(resourceType); + this.invalidateMap(); }; - let overlays = {}; - - this.layerControl = L.control.layers(baseLayers, overlays, {position: "topleft"}).addTo(this.map); - }; - - this.initGeosearchControl = function(){ - ///////////////////////////////////////////////////// - ///// LEAFLET GEOSEARCH SETUP - ///////////////////////////////////////////////////// - var GeoSearchControl = window.GeoSearch.GeoSearchControl; - var OpenStreetMapProvider = window.GeoSearch.OpenStreetMapProvider; - - // remaining is the same as in the docs, accept for the var instead of const declarations - var provider = new OpenStreetMapProvider( - { - params: { - 'accept-language': 'de', // render results in Dutch - countrycodes: 'de', // limit search results to the Netherlands - addressdetails: 1, // include additional address detail parts - viewbox: "" + (Number(__env.initialLongitude) - 0.001) + "," + (Number(__env.initialLatitude) - 0.001) + "," + (Number(__env.initialLongitude) + 0.001) + "," + (Number(__env.initialLatitude) + 0.001) - }, - searchUrl: __env.targetUrlToGeocoderService + '/search', - reverseUrl: __env.targetUrlToGeocoderService + '/reverse' - } - ); - - console.log(provider); - - this.geosearchControl = new GeoSearchControl({ - position: "topright", - provider: provider, - style: 'button', - autoComplete: true, - autoCompleteDelay: 250, - showMarker: false, // optional: true|false - default true - showPopup: false, // optional: true|false - default false - marker: { // optional: L.Marker - default L.Icon.Default - icon: new L.Icon.Default(), - draggable: false, - }, - popupFormat: ({ query, result }) => result.label, // optional: function - default returns result label - maxMarkers: 1, // optional: number - default 1 - retainZoomLevel: false, // optional: true|false - default false - animateZoom: true, // optional: true|false - default true - autoClose: false, // optional: true|false - default false - searchLabel: 'Suche nach Adressen ...', // optional: string - default 'Enter address' - keepResult: false // optional: true|false - default false - }); - - this.map.addControl(this.geosearchControl); - // this.map.on('geosearch/showlocation', function(event){ - // console.log(event); - // let geoJSON = { - // type: "Feature", - // geometry: { - // type: "Point", - // coordinates: [event.x, event.y] - // }, - // properties: { - - // } - // }; - // $rootScope.$broadcast("onUpdateSingleFeatureGeometry", geoJSON); - // }); - }; - - this.initDrawControlOptions = function(resourceType, enableDrawToolbar){ - let options = { - edit: { - featureGroup: this.featureLayer - }, - position: 'bottomright' + this.initLayerControl = function () { + let baseLayers = { + "OpenStreetMap Graustufen": this.backgroundLayer + }; + let overlays = {}; + this.layerControl = L.control.layers(baseLayers, overlays, { position: "topleft" }).addTo(this.map); }; - - if(enableDrawToolbar){ - options.draw = { - polyline: resourceType == this.resourceType_line ? true : false, - polygon: resourceType == this.resourceType_polygon ? true : false, - rectangle: false, - circle: false, - circlemarker: false, - marker: resourceType == this.resourceType_point ? true : false - }; - } - else{ - options.draw = false; - } - - return options; - }; - - this.initDrawControl = function(resourceType){ - // FeatureGroup is to store editable layers - this.featureLayer = new L.FeatureGroup(); - - L.drawLocal = { - edit: { - toolbar: { - actions: { - save: { - title: "Bearbeitung speichern.", - text: "Speichern", - }, - cancel: { - title: "Bearbeitung verwerfen.", - text: "Abbrechen", + this.initGeosearchControl = function () { + ///////////////////////////////////////////////////// + ///// LEAFLET GEOSEARCH SETUP + ///////////////////////////////////////////////////// + var GeoSearchControl = window.GeoSearch.GeoSearchControl; + var OpenStreetMapProvider = window.GeoSearch.OpenStreetMapProvider; + // remaining is the same as in the docs, accept for the var instead of const declarations + var provider = new OpenStreetMapProvider({ + params: { + 'accept-language': 'de', + countrycodes: 'de', + addressdetails: 1, + viewbox: "" + (Number(__env.initialLongitude) - 0.001) + "," + (Number(__env.initialLatitude) - 0.001) + "," + (Number(__env.initialLongitude) + 0.001) + "," + (Number(__env.initialLatitude) + 0.001) }, - clearAll: { - title: "Alle Features entfernen.", - text: "Alle Features entfernen", - }, - }, - buttons: { - edit: "Layer editieren.", - editDisabled: "Keine Layer zum editieren vorhanden.", - remove: "Layer entfernen.", - removeDisabled: "Keine Layer zum entfernen vorhanden.", - }, - }, - handlers: { - edit: { - tooltip: { - text: "Bearbeitungspunkte oder Punktmarker ziehen, um Feature zu editieren.", - subtext: "Abbrechen klicken, um Bearbeitung zu verwefen.", + searchUrl: __env.targetUrlToGeocoderService + '/search', + reverseUrl: __env.targetUrlToGeocoderService + '/reverse' + }); + console.log(provider); + this.geosearchControl = new GeoSearchControl({ + position: "topright", + provider: provider, + style: 'button', + autoComplete: true, + autoCompleteDelay: 250, + showMarker: false, + showPopup: false, + marker: { + icon: new L.Icon.Default(), + draggable: false, }, - }, - remove: { - tooltip: { - text: "Feature anklicken, um es zu entfernen", + popupFormat: ({ query, result }) => result.label, + maxMarkers: 1, + retainZoomLevel: false, + animateZoom: true, + autoClose: false, + searchLabel: 'Suche nach Adressen ...', + keepResult: false // optional: true|false - default false + }); + this.map.addControl(this.geosearchControl); + // this.map.on('geosearch/showlocation', function(event){ + // console.log(event); + // let geoJSON = { + // type: "Feature", + // geometry: { + // type: "Point", + // coordinates: [event.x, event.y] + // }, + // properties: { + // } + // }; + // $rootScope.$broadcast("onUpdateSingleFeatureGeometry", geoJSON); + // }); + }; + this.initDrawControlOptions = function (resourceType, enableDrawToolbar) { + let options = { + edit: { + featureGroup: this.featureLayer }, - }, + position: 'bottomright' + }; + if (enableDrawToolbar) { + options.draw = { + polyline: resourceType == this.resourceType_line ? true : false, + polygon: resourceType == this.resourceType_polygon ? true : false, + rectangle: false, + circle: false, + circlemarker: false, + marker: resourceType == this.resourceType_point ? true : false + }; } - }, - draw: { - toolbar: { - actions: { - title: "Zeichnen abbrechen", - text: "Abbrechen", - }, - finish: { - title: "Zeichnen beenden", - text: "Beenden", - }, - undo: { - title: "Zuletzt gezeichneten Punkt entfernen", - text: "Letzten Punkt entfernen", - }, - buttons: { - polyline: "Polylinie zeichnen", - polygon: "Polygon zeichnen", - rectangle: "Rechteck zeichnen", - circle: "Kreis zeichnen", - marker: "Punkt zeichnen", - circlemarker: "Kreispunkt zeichnen", - }, - }, - handlers: { - circle: { - tooltip: { - start: "Klicken und halten, um Kreis zu zeichnen.", - }, - radius: "Radius", - }, - circlemarker: { - tooltip: { - start: "Klicken, um einen Punkt zu markieren.", - }, - }, - marker: { - tooltip: { - start: "Klicken, um einen Punkt zu markieren.", - }, - }, - polygon: { - tooltip: { - start: "Klicken, um ein Polygon zu beginnen.", - cont: "Klicken, um das Polygon weiter zu zeichnen.", - end: "Ersten Punkt anklicken, um Polygon zu beenden.", - }, - }, - polyline: { - error: "Fehler: Selbstueberschneidung!", - tooltip: { - start: "Klicken, um eine Polylinie zu beginnen.", - cont: "Klicken, um die Polylinie weiter zu zeichnen.", - end: "Letzten Punkt erneut anklicken, um Polylinie zu beenden.", - }, - }, - rectangle: { - tooltip: { - start: "Klicken und halten, um Rechteck zu zeichnen.", - }, - }, - simpleshape: { - tooltip: { - end: "Maus loslassen, um Zeichnung zu beenden.", + else { + options.draw = false; + } + return options; + }; + this.initDrawControl = function (resourceType) { + // FeatureGroup is to store editable layers + this.featureLayer = new L.FeatureGroup(); + L.drawLocal = { + edit: { + toolbar: { + actions: { + save: { + title: "Bearbeitung speichern.", + text: "Speichern", + }, + cancel: { + title: "Bearbeitung verwerfen.", + text: "Abbrechen", + }, + clearAll: { + title: "Alle Features entfernen.", + text: "Alle Features entfernen", + }, + }, + buttons: { + edit: "Layer editieren.", + editDisabled: "Keine Layer zum editieren vorhanden.", + remove: "Layer entfernen.", + removeDisabled: "Keine Layer zum entfernen vorhanden.", + }, + }, + handlers: { + edit: { + tooltip: { + text: "Bearbeitungspunkte oder Punktmarker ziehen, um Feature zu editieren.", + subtext: "Abbrechen klicken, um Bearbeitung zu verwefen.", + }, + }, + remove: { + tooltip: { + text: "Feature anklicken, um es zu entfernen", + }, + }, + } }, - }, + draw: { + toolbar: { + actions: { + title: "Zeichnen abbrechen", + text: "Abbrechen", + }, + finish: { + title: "Zeichnen beenden", + text: "Beenden", + }, + undo: { + title: "Zuletzt gezeichneten Punkt entfernen", + text: "Letzten Punkt entfernen", + }, + buttons: { + polyline: "Polylinie zeichnen", + polygon: "Polygon zeichnen", + rectangle: "Rechteck zeichnen", + circle: "Kreis zeichnen", + marker: "Punkt zeichnen", + circlemarker: "Kreispunkt zeichnen", + }, + }, + handlers: { + circle: { + tooltip: { + start: "Klicken und halten, um Kreis zu zeichnen.", + }, + radius: "Radius", + }, + circlemarker: { + tooltip: { + start: "Klicken, um einen Punkt zu markieren.", + }, + }, + marker: { + tooltip: { + start: "Klicken, um einen Punkt zu markieren.", + }, + }, + polygon: { + tooltip: { + start: "Klicken, um ein Polygon zu beginnen.", + cont: "Klicken, um das Polygon weiter zu zeichnen.", + end: "Ersten Punkt anklicken, um Polygon zu beenden.", + }, + }, + polyline: { + error: "Fehler: Selbstueberschneidung!", + tooltip: { + start: "Klicken, um eine Polylinie zu beginnen.", + cont: "Klicken, um die Polylinie weiter zu zeichnen.", + end: "Letzten Punkt erneut anklicken, um Polylinie zu beenden.", + }, + }, + rectangle: { + tooltip: { + start: "Klicken und halten, um Rechteck zu zeichnen.", + }, + }, + simpleshape: { + tooltip: { + end: "Maus loslassen, um Zeichnung zu beenden.", + }, + }, + } + } + }; + this.map.addLayer(this.featureLayer); + this.drawControlOptions = this.initDrawControlOptions(resourceType, true); + this.drawControl = new L.Control.Draw(this.drawControlOptions); + this.map.addControl(this.drawControl); + this.map.on(L.Draw.Event.CREATED, function (event) { + var layer = event.layer; + self.featureLayer.addLayer(layer); + // disable draw tools + self.map.removeControl(self.drawControl); + self.drawControl = new L.Control.Draw(self.initDrawControlOptions(resourceType, false)); + self.map.addControl(self.drawControl); + $rootScope.$broadcast("onUpdateSingleFeatureGeometry", self.featureLayer.toGeoJSON()); + }); + this.map.on(L.Draw.Event.EDITED, function (event) { + $rootScope.$broadcast("onUpdateSingleFeatureGeometry", self.featureLayer.toGeoJSON()); + }); + this.map.on(L.Draw.Event.DELETED, function (event) { + // reinit featureGroupLayer + self.featureLayer = new L.FeatureGroup(); + // enable draw tools + self.map.removeControl(self.drawControl); + self.drawControl = new L.Control.Draw(self.initDrawControlOptions(resourceType, true)); + self.map.addControl(self.drawControl); + $rootScope.$broadcast("onUpdateSingleFeatureGeometry", undefined); + }); + }; + /** + * binds the popup of a clicked output + * to layer.feature.properties.popupContent + */ + this.onEachFeatureGeoresource = function (feature, layer) { + layer.on({ + click: function () { + var popupContent = '
        '; + for (var p in feature.properties) { + popupContent += ''; + } + popupContent += '
        ' + p + '' + feature.properties[p] + '
        '; + layer.bindPopup(popupContent); + } + }); + }; + this.addDataLayertoSingleFeatureGeoMap = function (geoJSON) { + if (this.map) { + this.dataLayer = L.geoJSON(geoJSON, { + pointToLayer: function (geoJsonPoint, latlng) { + return L.circleMarker(latlng, { + radius: 6 + }); + }, + style: function (feature) { + return { + color: "red", + weight: 1, + opacity: 1 + }; + }, + onEachFeature: self.onEachFeatureGeoresource + }); + // this.layerControl.addOverlay(this.dataLayer, "weitere Objekte des Datensatzes"); + this.dataLayer.addTo(this.map); + this.map.fitBounds(this.dataLayer.getBounds()); + this.invalidateMap(); } - } - }; - - this.map.addLayer(this.featureLayer); - this.drawControlOptions = this.initDrawControlOptions(resourceType, true); - this.drawControl = new L.Control.Draw(this.drawControlOptions); - - this.map.addControl(this.drawControl); - - this.map.on(L.Draw.Event.CREATED, function (event) { - var layer = event.layer; - - self.featureLayer.addLayer(layer); - - // disable draw tools - self.map.removeControl(self.drawControl); - self.drawControl = new L.Control.Draw(self.initDrawControlOptions(resourceType, false)); - self.map.addControl(self.drawControl); - - $rootScope.$broadcast("onUpdateSingleFeatureGeometry", self.featureLayer.toGeoJSON()); - }); - - this.map.on(L.Draw.Event.EDITED, function (event) { - - $rootScope.$broadcast("onUpdateSingleFeatureGeometry", self.featureLayer.toGeoJSON()); - }); - - this.map.on(L.Draw.Event.DELETED, function (event) { - - // reinit featureGroupLayer - self.featureLayer = new L.FeatureGroup(); - - // enable draw tools - self.map.removeControl(self.drawControl); - self.drawControl = new L.Control.Draw(self.initDrawControlOptions(resourceType, true)); - self.map.addControl(self.drawControl); - - $rootScope.$broadcast("onUpdateSingleFeatureGeometry", undefined); - }); - }; - - /** - * binds the popup of a clicked output - * to layer.feature.properties.popupContent - */ - this.onEachFeatureGeoresource = function(feature, layer) { - layer.on({ - click: function () { - - var popupContent = '
        '; - for (var p in feature.properties) { - popupContent += ''; - } - popupContent += '
        ' + p + ''+ feature.properties[p] + '
        '; - - layer.bindPopup(popupContent); - } - }); - }; - - this.addDataLayertoSingleFeatureGeoMap = function(geoJSON){ - if(this.map){ - this.dataLayer = L.geoJSON(geoJSON, { - pointToLayer: function(geoJsonPoint, latlng) { - return L.circleMarker(latlng, { - radius: 6 - }); - }, - style: function (feature) { - return { - color: "red", - weight: 1, - opacity: 1 - }; - }, - onEachFeature: self.onEachFeatureGeoresource - }); - - // this.layerControl.addOverlay(this.dataLayer, "weitere Objekte des Datensatzes"); - this.dataLayer.addTo(this.map); - this.map.fitBounds(this.dataLayer.getBounds()); - this.invalidateMap(); - } - }; - - }]); +//# sourceMappingURL=kommonitor-single-feature-map-helper-service.module.js.map \ No newline at end of file diff --git a/app/util/genericServices/kommonitorSingleFeatureMapHelperService/kommonitor-single-feature-map-helper-service.module.js.map b/app/util/genericServices/kommonitorSingleFeatureMapHelperService/kommonitor-single-feature-map-helper-service.module.js.map new file mode 100644 index 000000000..765081bd8 --- /dev/null +++ b/app/util/genericServices/kommonitorSingleFeatureMapHelperService/kommonitor-single-feature-map-helper-service.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-single-feature-map-helper-service.module.js","sourceRoot":"","sources":["kommonitor-single-feature-map-helper-service.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,kCAAkC,EAAE,CAAC,wBAAwB,CAAC,CAAC,CAAC;AAE/E,OAAO;KACJ,MAAM,CAAC,kCAAkC,EAAE,EAAE,CAAC;KAC9C,OAAO,CACN,yCAAyC,EAAE,CAAC,YAAY,EAAE,OAAO,EAAE,UAAU;IAC7E,UAAU,UAAU,EAAE,KAAK,EAAE,QAAQ;QAEnC,IAAI,IAAI,GAAG,IAAI,CAAC;QAEhB,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC;QAClC,IAAI,CAAC,iBAAiB,GAAG,MAAM,CAAC;QAChC,IAAI,CAAC,oBAAoB,GAAG,SAAS,CAAC;QAEtC,sBAAsB;QACtB,IAAI,CAAC,GAAG,CAAC;QACT,IAAI,CAAC,YAAY,CAAC;QAClB,qCAAqC;QACrC,IAAI,CAAC,YAAY,CAAC;QAClB,IAAI,CAAC,WAAW,CAAC;QACjB,IAAI,CAAC,gBAAgB,CAAC;QAEtB,kBAAkB;QAClB,IAAI,CAAC,eAAe,CAAC;QAErB;;aAEK;QAEH,CAAC,CAAC,SAAS,CAAC,SAAS,GAAG,CAAC,C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iC,GAAG,UAAS,OAAO;YACvD,IAAG,IAAI,CAAC,GAAG,EAAC;gBACV,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE;oBAClC,YAAY,EAAE,UAAS,YAAY,EAAE,MAAM;wBACzC,OAAO,CAAC,CAAC,YAAY,CAAC,MAAM,EAAE;4BAC5B,MAAM,EAAE,CAAC;yBACV,CAAC,CAAC;oBACP,CAAC;oBACC,KAAK,EAAE,UAAU,OAAO;wBACtB,OAAO;4BACL,KAAK,EAAE,KAAK;4BACZ,MAAM,EAAE,CAAC;4BACT,OAAO,EAAE,CAAC;yBACX,CAAC;oBACJ,CAAC;oBACD,aAAa,EAAE,IAAI,CAAC,wBAAwB;iBAC7C,CAAC,CAAC;gBAEH,mFAAmF;gBACnF,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAC/B,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC,CAAC;gBAC/C,IAAI,CAAC,aAAa,EAAE,CAAC;aACtB;QACH,CAAC,CAAC;IAGJ,CAAC,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/util/genericServices/kommonitorSingleFeatureMapHelperService/kommonitor-single-feature-map-helper-service.module.ts b/app/util/genericServices/kommonitorSingleFeatureMapHelperService/kommonitor-single-feature-map-helper-service.module.ts new file mode 100644 index 000000000..3abfd1b00 --- /dev/null +++ b/app/util/genericServices/kommonitorSingleFeatureMapHelperService/kommonitor-single-feature-map-helper-service.module.ts @@ -0,0 +1,431 @@ +angular.module('kommonitorSingleFeatureMapHelper', ['kommonitorDataExchange']); + +angular + .module('kommonitorSingleFeatureMapHelper', []) + .service( + 'kommonitorSingleFeatureMapHelperService', ['$rootScope', '__env', '$timeout', + function ($rootScope, __env, $timeout) { + + var self = this; + + this.resourceType_point = "POINT"; + this.resourceType_line = "LINE"; + this.resourceType_polygon = "POLYGON"; + + //leaflet map instance + this.map; + this.layerControl; + // layer holding the editable feature + this.featureLayer; + this.drawControl; + this.geosearchControl; + + // backgroundLayer + this.backgroundLayer; + + /* + * L.TileLayer.Grayscale is a regular tilelayer with grayscale makeover. + */ + + L.TileLayer.Grayscale = L.TileLayer.extend({ + options: { + quotaRed: 21, + quotaGreen: 71, + quotaBlue: 8, + quotaDividerTune: 0, + quotaDivider: function () { + return this.quotaRed + this.quotaGreen + this.quotaBlue + this.quotaDividerTune; + } + }, + + initialize: function (url, options) { + options = options || {}; + options.crossOrigin = true; + L.TileLayer.prototype.initialize.call(this, url, options); + + this.on('tileload', function (e) { + this._makeGrayscale(e.tile); + }); + }, + + _createTile: function () { + var tile = L.TileLayer.prototype._createTile.call(this); + tile.crossOrigin = "Anonymous"; + return tile; + }, + + _makeGrayscale: function (img) { + if (img.getAttribute('data-grayscaled')) + return; + + img.crossOrigin = ''; + var canvas = document.createElement("canvas"); + canvas.width = img.width; + canvas.height = img.height; + var ctx = canvas.getContext("2d"); + ctx.drawImage(img, 0, 0); + + var imgd = ctx.getImageData(0, 0, canvas.width, canvas.height); + var pix = imgd.data; + for (var i = 0, n = pix.length; i < n; i += 4) { + pix[i] = pix[i + 1] = pix[i + 2] = (this.options.quotaRed * pix[i] + this.options.quotaGreen * pix[i + 1] + this.options.quotaBlue * pix[i + 2]) / this.options.quotaDivider(); + } + ctx.putImageData(imgd, 0, 0); + img.setAttribute('data-grayscaled', true); + img.src = canvas.toDataURL(); + } + }); + + this.invalidateMap = function(){ + if (this.map){ + // just wait a bit in order to ensure that map element is visible to make invalidateSize actually work + $timeout(function(){ + self.map.invalidateSize(true); + }, 500); + } + }; + + this.zoomToDataLayer = function(){ + if (this.map && this.dataLayer){ + // just wait a bit in order to ensure that map element is visible to make invalidateSize actually work + $timeout(function(){ + self.map.fitBounds(self.dataLayer.getBounds()); + }, 750); + } + }; + + this.initSingleFeatureGeoMap = function(domId, resourceType){ + // init leaflet map + + // add geometry editing tool for the respective RESOURCE TYPE + + // add geocoding plugin if it is POINT resource + + // register events that broadcast new geometry to other components + + if(this.map){ + this.map.off(); + this.map.remove(); + + // var domNode = document.getElementById(domId); + + // while (domNode.hasChildNodes()) { + // domNode.removeChild(domNode.lastChild); + // } + } + + // backgroundLayer + this.backgroundLayer = new L.TileLayer.Grayscale("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", { minZoom: __env.minZoomLevel, maxZoom: __env.maxZoomLevel, attribution: "Map data © OpenStreetMap contributors" }); + + this.map = L.map(domId, { + center: [__env.initialLatitude, __env.initialLongitude], + zoom: __env.initialZoomLevel, + zoomDelta: 0.5, + zoomSnap: 0.5, + layers: [this.backgroundLayer] + }); + + L.control.scale().addTo(this.map); + + // this.initLayerControl(); + + if(resourceType == this.resourceType_point){ + this.initGeosearchControl(); + } + + this.initDrawControl(resourceType); + + this.invalidateMap(); + }; + + this.initLayerControl = function(){ + let baseLayers = { + "OpenStreetMap Graustufen": this.backgroundLayer + }; + let overlays = {}; + + this.layerControl = L.control.layers(baseLayers, overlays, {position: "topleft"}).addTo(this.map); + }; + + this.initGeosearchControl = function(){ + ///////////////////////////////////////////////////// + ///// LEAFLET GEOSEARCH SETUP + ///////////////////////////////////////////////////// + var GeoSearchControl = window.GeoSearch.GeoSearchControl; + var OpenStreetMapProvider = window.GeoSearch.OpenStreetMapProvider; + + // remaining is the same as in the docs, accept for the var instead of const declarations + var provider = new OpenStreetMapProvider( + { + params: { + 'accept-language': 'de', // render results in Dutch + countrycodes: 'de', // limit search results to the Netherlands + addressdetails: 1, // include additional address detail parts + viewbox: "" + (Number(__env.initialLongitude) - 0.001) + "," + (Number(__env.initialLatitude) - 0.001) + "," + (Number(__env.initialLongitude) + 0.001) + "," + (Number(__env.initialLatitude) + 0.001) + }, + searchUrl: __env.targetUrlToGeocoderService + '/search', + reverseUrl: __env.targetUrlToGeocoderService + '/reverse' + } + ); + + console.log(provider); + + this.geosearchControl = new GeoSearchControl({ + position: "topright", + provider: provider, + style: 'button', + autoComplete: true, + autoCompleteDelay: 250, + showMarker: false, // optional: true|false - default true + showPopup: false, // optional: true|false - default false + marker: { // optional: L.Marker - default L.Icon.Default + icon: new L.Icon.Default(), + draggable: false, + }, + popupFormat: ({ query, result }) => result.label, // optional: function - default returns result label + maxMarkers: 1, // optional: number - default 1 + retainZoomLevel: false, // optional: true|false - default false + animateZoom: true, // optional: true|false - default true + autoClose: false, // optional: true|false - default false + searchLabel: 'Suche nach Adressen ...', // optional: string - default 'Enter address' + keepResult: false // optional: true|false - default false + }); + + this.map.addControl(this.geosearchControl); + // this.map.on('geosearch/showlocation', function(event){ + // console.log(event); + // let geoJSON = { + // type: "Feature", + // geometry: { + // type: "Point", + // coordinates: [event.x, event.y] + // }, + // properties: { + + // } + // }; + // $rootScope.$broadcast("onUpdateSingleFeatureGeometry", geoJSON); + // }); + }; + + this.initDrawControlOptions = function(resourceType, enableDrawToolbar){ + let options = { + edit: { + featureGroup: this.featureLayer + }, + position: 'bottomright' + }; + + if(enableDrawToolbar){ + options.draw = { + polyline: resourceType == this.resourceType_line ? true : false, + polygon: resourceType == this.resourceType_polygon ? true : false, + rectangle: false, + circle: false, + circlemarker: false, + marker: resourceType == this.resourceType_point ? true : false + }; + } + else{ + options.draw = false; + } + + return options; + }; + + this.initDrawControl = function(resourceType){ + // FeatureGroup is to store editable layers + this.featureLayer = new L.FeatureGroup(); + + L.drawLocal = { + edit: { + toolbar: { + actions: { + save: { + title: "Bearbeitung speichern.", + text: "Speichern", + }, + cancel: { + title: "Bearbeitung verwerfen.", + text: "Abbrechen", + }, + clearAll: { + title: "Alle Features entfernen.", + text: "Alle Features entfernen", + }, + }, + buttons: { + edit: "Layer editieren.", + editDisabled: "Keine Layer zum editieren vorhanden.", + remove: "Layer entfernen.", + removeDisabled: "Keine Layer zum entfernen vorhanden.", + }, + }, + handlers: { + edit: { + tooltip: { + text: "Bearbeitungspunkte oder Punktmarker ziehen, um Feature zu editieren.", + subtext: "Abbrechen klicken, um Bearbeitung zu verwefen.", + }, + }, + remove: { + tooltip: { + text: "Feature anklicken, um es zu entfernen", + }, + }, + } + }, + draw: { + toolbar: { + actions: { + title: "Zeichnen abbrechen", + text: "Abbrechen", + }, + finish: { + title: "Zeichnen beenden", + text: "Beenden", + }, + undo: { + title: "Zuletzt gezeichneten Punkt entfernen", + text: "Letzten Punkt entfernen", + }, + buttons: { + polyline: "Polylinie zeichnen", + polygon: "Polygon zeichnen", + rectangle: "Rechteck zeichnen", + circle: "Kreis zeichnen", + marker: "Punkt zeichnen", + circlemarker: "Kreispunkt zeichnen", + }, + }, + handlers: { + circle: { + tooltip: { + start: "Klicken und halten, um Kreis zu zeichnen.", + }, + radius: "Radius", + }, + circlemarker: { + tooltip: { + start: "Klicken, um einen Punkt zu markieren.", + }, + }, + marker: { + tooltip: { + start: "Klicken, um einen Punkt zu markieren.", + }, + }, + polygon: { + tooltip: { + start: "Klicken, um ein Polygon zu beginnen.", + cont: "Klicken, um das Polygon weiter zu zeichnen.", + end: "Ersten Punkt anklicken, um Polygon zu beenden.", + }, + }, + polyline: { + error: "Fehler: Selbstueberschneidung!", + tooltip: { + start: "Klicken, um eine Polylinie zu beginnen.", + cont: "Klicken, um die Polylinie weiter zu zeichnen.", + end: "Letzten Punkt erneut anklicken, um Polylinie zu beenden.", + }, + }, + rectangle: { + tooltip: { + start: "Klicken und halten, um Rechteck zu zeichnen.", + }, + }, + simpleshape: { + tooltip: { + end: "Maus loslassen, um Zeichnung zu beenden.", + }, + }, + } + } + + }; + + this.map.addLayer(this.featureLayer); + this.drawControlOptions = this.initDrawControlOptions(resourceType, true); + this.drawControl = new L.Control.Draw(this.drawControlOptions); + + this.map.addControl(this.drawControl); + + this.map.on(L.Draw.Event.CREATED, function (event) { + var layer = event.layer; + + self.featureLayer.addLayer(layer); + + // disable draw tools + self.map.removeControl(self.drawControl); + self.drawControl = new L.Control.Draw(self.initDrawControlOptions(resourceType, false)); + self.map.addControl(self.drawControl); + + $rootScope.$broadcast("onUpdateSingleFeatureGeometry", self.featureLayer.toGeoJSON()); + }); + + this.map.on(L.Draw.Event.EDITED, function (event) { + + $rootScope.$broadcast("onUpdateSingleFeatureGeometry", self.featureLayer.toGeoJSON()); + }); + + this.map.on(L.Draw.Event.DELETED, function (event) { + + // reinit featureGroupLayer + self.featureLayer = new L.FeatureGroup(); + + // enable draw tools + self.map.removeControl(self.drawControl); + self.drawControl = new L.Control.Draw(self.initDrawControlOptions(resourceType, true)); + self.map.addControl(self.drawControl); + + $rootScope.$broadcast("onUpdateSingleFeatureGeometry", undefined); + }); + }; + + /** + * binds the popup of a clicked output + * to layer.feature.properties.popupContent + */ + this.onEachFeatureGeoresource = function(feature, layer) { + layer.on({ + click: function () { + + var popupContent = '
        '; + for (var p in feature.properties) { + popupContent += ''; + } + popupContent += '
        ' + p + ''+ feature.properties[p] + '
        '; + + layer.bindPopup(popupContent); + } + }); + }; + + this.addDataLayertoSingleFeatureGeoMap = function(geoJSON){ + if(this.map){ + this.dataLayer = L.geoJSON(geoJSON, { + pointToLayer: function(geoJsonPoint, latlng) { + return L.circleMarker(latlng, { + radius: 6 + }); + }, + style: function (feature) { + return { + color: "red", + weight: 1, + opacity: 1 + }; + }, + onEachFeature: self.onEachFeatureGeoresource + }); + + // this.layerControl.addOverlay(this.dataLayer, "weitere Objekte des Datensatzes"); + this.dataLayer.addTo(this.map); + this.map.fitBounds(this.dataLayer.getBounds()); + this.invalidateMap(); + } + }; + + + }]); diff --git a/app/util/genericServices/kommonitorVisualStyleHelperService/kommonitor-visual-style-helper-service.module.js b/app/util/genericServices/kommonitorVisualStyleHelperService/kommonitor-visual-style-helper-service.module.js index 158544890..7cbd45f02 100644 --- a/app/util/genericServices/kommonitorVisualStyleHelperService/kommonitor-visual-style-helper-service.module.js +++ b/app/util/genericServices/kommonitorVisualStyleHelperService/kommonitor-visual-style-helper-service.module.js @@ -1,5 +1,5 @@ +"use strict"; angular.module('kommonitorVisualStyleHelper', ['kommonitorDataExchange']); - /** * a common serviceInstance that holds all needed properties for a WPS service. * @@ -10,559 +10,470 @@ angular.module('kommonitorVisualStyleHelper', ['kommonitorDataExchange']); * parameters for each WPS operation represented by different Angular components */ angular - .module('kommonitorVisualStyleHelper', []) - .service( - 'kommonitorVisualStyleHelperService', ['$rootScope', '$timeout', 'kommonitorDataExchangeService', '$http', '__env', - function ($rootScope, $timeout, - kommonitorDataExchangeService, $http, __env) { - - const INDICATOR_DATE_PREFIX = __env.indicatorDatePrefix; - - this.defaultBrew = undefined; - this.measureOfValueBrew = undefined; - this.dynamicBrew = undefined; - - //allowesValues: equal_interval, quantile, jenks - this.classifyMethods = [{ - name: "Jenks", - value: "jenks" - }, { - name: "Gleiches Intervall", - value: "equal_interval" - }, { - name: "Quantile", - value: "quantile" - }]; - - this.classifyMethod = __env.defaultClassifyMethod || "jenks"; - - this.isCustomComputation = false; - - const numberOfDecimals = __env.numberOfDecimals; - var defaultColorForFilteredValues = __env.defaultColorForFilteredValues; - var defaultBorderColorForFilteredValues = __env.defaultBorderColorForFilteredValues; - var defaultBorderColor = __env.defaultBorderColor; - var defaultFillOpacity = __env.defaultFillOpacity; - var defaultFillOpacityForFilteredFeatures = __env.defaultFillOpacityForFilteredFeatures; - var defaultFillOpacityForHighlightedFeatures = __env.defaultFillOpacityForHighlightedFeatures; - var defaultFillOpacityForZeroFeatures = __env.defaultFillOpacityForZeroFeatures; - var defaultColorBrewerPaletteForBalanceIncreasingValues = __env.defaultColorBrewerPaletteForBalanceIncreasingValues; - var defaultColorBrewerPaletteForBalanceDecreasingValues = __env.defaultColorBrewerPaletteForBalanceDecreasingValues; - var defaultColorBrewerPaletteForGtMovValues = __env.defaultColorBrewerPaletteForGtMovValues; - var defaultColorBrewerPaletteForLtMovValues = __env.defaultColorBrewerPaletteForLtMovValues; - var defaultColorForHoveredFeatures = __env.defaultColorForHoveredFeatures; - var defaultColorForClickedFeatures = __env.defaultColorForClickedFeatures; - var defaultBorderColorForNoDataValues = __env.defaultBorderColorForNoDataValues; - var defaultColorForNoDataValues = __env.defaultColorForNoDataValues; - var defaultFillOpacityForNoDataValues = __env.defaultFillOpacityForNoDataValues; - - this.indicatorTransparency = 1 - __env.defaultFillOpacity; - this.currentIndicatorOpacity = __env.defaultFillOpacity; - - var defaultColorForZeroValues = __env.defaultColorForZeroValues; - - - var defaultColorForOutliers_high = __env.defaultColorForOutliers_high; - var defaultBorderColorForOutliers_high = __env.defaultBorderColorForOutliers_high; - var defaultFillOpacityForOutliers_high = __env.defaultFillOpacityForOutliers_high; - var defaultColorForOutliers_low = __env.defaultColorForOutliers_low; - var defaultBorderColorForOutliers_low = __env.defaultBorderColorForOutliers_low; - var defaultFillOpacityForOutliers_low = __env.defaultFillOpacityForOutliers_low; - var useOutlierDetectionOnIndicator = __env.useOutlierDetectionOnIndicator; - - const outlierPropertyName = "outlier"; - const outlierPropertyValue_high_soft = "high-soft"; - const outlierPropertyValue_low_soft = "low-soft"; - const outlierPropertyValue_high_extreme = "high-extreme"; - const outlierPropertyValue_low_extreme = "low-extreme"; - const outlierPropertyValue_no = "no"; - - this.outlierFillPattern_low = new L.StripePattern({ weight: 1, spaceweight: 1, patternTransform: "rotate(45)" }); - - this.outlierFillPattern_high = new L.StripePattern({ weight: 1, spaceweight: 1, patternTransform: "rotate(-45)" }); - - var shape = new L.PatternCircle({ - x: 5, - y: 5, - radius: 1, - fill: true, - color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultColorForNoDataValues - }); - this.noDataFillPattern = new L.Pattern({ width: 8, height: 8 }); - this.noDataFillPattern.addShape(shape); - - var outliers_high = undefined; - var outliers_low = undefined; - - this.outlierStyle_high = { - weight: 1, - opacity: 1, - color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColorForOutliers_high, - dashArray: '', - fillOpacity: defaultFillOpacityForOutliers_high, - fillColor: defaultColorForOutliers_high, - fillPattern: this.outlierFillPattern_high - }; - - this.outlierStyle_low = { - weight: 1, - opacity: 1, - color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColorForOutliers_low, - dashArray: '', - fillOpacity: defaultFillOpacityForOutliers_low, - fillColor: defaultColorForOutliers_low, - fillPattern: this.outlierFillPattern_low - }; - - this.noDataStyle = { - weight: 1, - opacity: 1, - color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColorForNoDataValues, - dashArray: '', - fillOpacity: defaultFillOpacityForNoDataValues, - fillColor: defaultColorForNoDataValues, - // fillPattern: this.noDataFillPattern - }; - - this.filteredStyle = { - weight: 1, - opacity: 1, - color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColorForFilteredValues, - dashArray: '', - fillOpacity: defaultFillOpacityForFilteredFeatures, - fillColor: defaultColorForFilteredValues - }; - - this.featuresPerColorMap = new Map(); - this.featuresPerNoData = 0; - this.featuresPerZero = 0; - this.featuresPerOutlierHigh = 0; - this.featuresPerOutlierLow = 0; - - this.resetFeaturesPerColorObjects = function(){ + .module('kommonitorVisualStyleHelper', []) + .service('kommonitorVisualStyleHelperService', ['$rootScope', '$timeout', 'kommonitorDataExchangeService', '$http', '__env', + function ($rootScope, $timeout, kommonitorDataExchangeService, $http, __env) { + const INDICATOR_DATE_PREFIX = __env.indicatorDatePrefix; + this.defaultBrew = undefined; + this.measureOfValueBrew = undefined; + this.dynamicBrew = undefined; + //allowesValues: equal_interval, quantile, jenks + this.classifyMethods = [{ + name: "Jenks", + value: "jenks" + }, { + name: "Gleiches Intervall", + value: "equal_interval" + }, { + name: "Quantile", + value: "quantile" + }]; + this.classifyMethod = __env.defaultClassifyMethod || "jenks"; + this.isCustomComputation = false; + const numberOfDecimals = __env.numberOfDecimals; + var defaultColorForFilteredValues = __env.defaultColorForFilteredValues; + var defaultBorderColorForFilteredValues = __env.defaultBorderColorForFilteredValues; + var defaultBorderColor = __env.defaultBorderColor; + var defaultFillOpacity = __env.defaultFillOpacity; + var defaultFillOpacityForFilteredFeatures = __env.defaultFillOpacityForFilteredFeatures; + var defaultFillOpacityForHighlightedFeatures = __env.defaultFillOpacityForHighlightedFeatures; + var defaultFillOpacityForZeroFeatures = __env.defaultFillOpacityForZeroFeatures; + var defaultColorBrewerPaletteForBalanceIncreasingValues = __env.defaultColorBrewerPaletteForBalanceIncreasingValues; + var defaultColorBrewerPaletteForBalanceDecreasingValues = __env.defaultColorBrewerPaletteForBalanceDecreasingValues; + var defaultColorBrewerPaletteForGtMovValues = __env.defaultColorBrewerPaletteForGtMovValues; + var defaultColorBrewerPaletteForLtMovValues = __env.defaultColorBrewerPaletteForLtMovValues; + var defaultColorForHoveredFeatures = __env.defaultColorForHoveredFeatures; + var defaultColorForClickedFeatures = __env.defaultColorForClickedFeatures; + var defaultBorderColorForNoDataValues = __env.defaultBorderColorForNoDataValues; + var defaultColorForNoDataValues = __env.defaultColorForNoDataValues; + var defaultFillOpacityForNoDataValues = __env.defaultFillOpacityForNoDataValues; + this.indicatorTransparency = 1 - __env.defaultFillOpacity; + this.currentIndicatorOpacity = __env.defaultFillOpacity; + var defaultColorForZeroValues = __env.defaultColorForZeroValues; + var defaultColorForOutliers_high = __env.defaultColorForOutliers_high; + var defaultBorderColorForOutliers_high = __env.defaultBorderColorForOutliers_high; + var defaultFillOpacityForOutliers_high = __env.defaultFillOpacityForOutliers_high; + var defaultColorForOutliers_low = __env.defaultColorForOutliers_low; + var defaultBorderColorForOutliers_low = __env.defaultBorderColorForOutliers_low; + var defaultFillOpacityForOutliers_low = __env.defaultFillOpacityForOutliers_low; + var useOutlierDetectionOnIndicator = __env.useOutlierDetectionOnIndicator; + const outlierPropertyName = "outlier"; + const outlierPropertyValue_high_soft = "high-soft"; + const outlierPropertyValue_low_soft = "low-soft"; + const outlierPropertyValue_high_extreme = "high-extreme"; + const outlierPropertyValue_low_extreme = "low-extreme"; + const outlierPropertyValue_no = "no"; + this.outlierFillPattern_low = new L.StripePattern({ weight: 1, spaceweight: 1, patternTransform: "rotate(45)" }); + this.outlierFillPattern_high = new L.StripePattern({ weight: 1, spaceweight: 1, patternTransform: "rotate(-45)" }); + var shape = new L.PatternCircle({ + x: 5, + y: 5, + radius: 1, + fill: true, + color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultColorForNoDataValues + }); + this.noDataFillPattern = new L.Pattern({ width: 8, height: 8 }); + this.noDataFillPattern.addShape(shape); + var outliers_high = undefined; + var outliers_low = undefined; + this.outlierStyle_high = { + weight: 1, + opacity: 1, + color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColorForOutliers_high, + dashArray: '', + fillOpacity: defaultFillOpacityForOutliers_high, + fillColor: defaultColorForOutliers_high, + fillPattern: this.outlierFillPattern_high + }; + this.outlierStyle_low = { + weight: 1, + opacity: 1, + color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColorForOutliers_low, + dashArray: '', + fillOpacity: defaultFillOpacityForOutliers_low, + fillColor: defaultColorForOutliers_low, + fillPattern: this.outlierFillPattern_low + }; + this.noDataStyle = { + weight: 1, + opacity: 1, + color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColorForNoDataValues, + dashArray: '', + fillOpacity: defaultFillOpacityForNoDataValues, + fillColor: defaultColorForNoDataValues, + // fillPattern: this.noDataFillPattern + }; + this.filteredStyle = { + weight: 1, + opacity: 1, + color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColorForFilteredValues, + dashArray: '', + fillOpacity: defaultFillOpacityForFilteredFeatures, + fillColor: defaultColorForFilteredValues + }; this.featuresPerColorMap = new Map(); this.featuresPerNoData = 0; this.featuresPerZero = 0; - this.featuresPerOutlierLow = 0; this.featuresPerOutlierHigh = 0; - }; - - this.incrementFeaturesPerColor = function(color){ - if(this.featuresPerColorMap.has(color)){ - this.featuresPerColorMap.set(color, this.featuresPerColorMap.get(color) + 1); - } - else{ - this.featuresPerColorMap.set(color, 1); - } - }; - - this.getFillColorForZero = function(){ - this.featuresPerZero ++; - return defaultColorForZeroValues; - }; - - this.setupDefaultBrew = function (geoJSON, propertyName, numClasses, colorCode, classifyMethod, forceProvidedIndicator, indicator) { - this.resetFeaturesPerColorObjects(); - - var values = new Array(); - - if(kommonitorDataExchangeService.classifyUsingWholeTimeseries){ - values = this.setupDefaultBrewValues_wholeTimeseries(geoJSON, values, forceProvidedIndicator, indicator); - } - else{ - values = this.setupDefaultBrewValues_singleTimestamp(geoJSON, propertyName, values); - } - - this.defaultBrew = setupClassyBrew_usingFeatureCount(values, colorCode, classifyMethod, numClasses); - return this.defaultBrew; - }; - - this.setupDefaultBrewValues_singleTimestamp = function(geoJSON, propertyName, values){ - for (var i = 0; i < geoJSON.features.length; i++) { - if (kommonitorDataExchangeService.indicatorValueIsNoData(geoJSON.features[i].properties[propertyName])) - continue; - - if(kommonitorDataExchangeService.classifyZeroSeparately && (geoJSON.features[i].properties[propertyName] == 0 || geoJSON.features[i].properties[propertyName] == "0")){ - continue; - } - - // check if is outlier, then do not use within classification, as it will be marked on map with special color - if (geoJSON.features[i].properties[outlierPropertyName] && geoJSON.features[i].properties[outlierPropertyName] !== outlierPropertyValue_no && kommonitorDataExchangeService.useOutlierDetectionOnIndicator) { - continue; - } - - if(! values.includes(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName]))){ - values.push(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName])); - } - } - - return values; - }; - - this.setupDefaultBrewValues_wholeTimeseries = function(geoJSON, values, forceProvidedIndicator, indicator){ - var indicatorTimeSeriesDatesArray; - if(forceProvidedIndicator) { - indicatorTimeSeriesDatesArray = indicator.applicableDates; - } else { - indicatorTimeSeriesDatesArray = kommonitorDataExchangeService.selectedIndicator.applicableDates; - } - - - for (const date of indicatorTimeSeriesDatesArray) { - var propertyName = __env.indicatorDatePrefix + date; - values = this.setupDefaultBrewValues_singleTimestamp(geoJSON, propertyName, values); - } - - return values; - }; - - /** - * Returns and array of color brewer instances for greater and lesser than measure of value colors - * - * [gtMeasureOfValueBrew, ltMeasureOfValueBrew] - */ - this.setupMeasureOfValueBrew = function (geoJSON, propertyName, colorCodeForGreaterThanValues, colorCodeForLesserThanValues, classifyMethod, measureOfValue) { - - /* - * Idea: Analyse the complete geoJSON property array for each feature and make conclusion about how to build the legend - - e.g. if there are only positive values then display only positive values within 5 categories - same for only negative values - - e.g. if there are equally many positive as negative values then display both using 3 categories each - - e.g. if there are way more positive than negative values, then display both with 2 (negative) and 4 (positive) classes - - --> implement special cases (0, 1 or 2 negative/positive values --> apply colors manually) - --> treat all other cases equally to measureOfValue - */ - - this.resetFeaturesPerColorObjects(); - - this.greaterThanValues = []; - this.lesserThanValues = []; - - if(kommonitorDataExchangeService.classifyUsingWholeTimeseries){ - this.setupMovBrewValues_wholeTimeseries(geoJSON, measureOfValue); - } - else{ - this.setupMovBrewValues_singleTimestamp(geoJSON, propertyName, measureOfValue); - } - - var gtMeasureOfValueBrew = this.setupGtMeasureOfValueBrew(this.greaterThanValues, colorCodeForGreaterThanValues, classifyMethod); - var ltMeasureOfValueBrew = this.setupLtMeasureOfValueBrew(this.lesserThanValues, colorCodeForLesserThanValues, classifyMethod); - - this.measureOfValueBrew = [gtMeasureOfValueBrew, ltMeasureOfValueBrew]; - return this.measureOfValueBrew; - }; - - this.setupMovBrewValues_singleTimestamp = function(geoJSON, propertyName, measureOfValue){ - for (var i = 0; i < geoJSON.features.length; i++) { - - if (kommonitorDataExchangeService.indicatorValueIsNoData(geoJSON.features[i].properties[propertyName])) - continue; - - if(kommonitorDataExchangeService.classifyZeroSeparately && (geoJSON.features[i].properties[propertyName] == 0 || geoJSON.features[i].properties[propertyName] == "0")){ - continue; - } - - // check if is outlier, then do not use within classification, as it will be marked on map with special color - if (geoJSON.features[i].properties[outlierPropertyName] && geoJSON.features[i].properties[outlierPropertyName] !== outlierPropertyValue_no && kommonitorDataExchangeService.useOutlierDetectionOnIndicator) { - continue; - } - - else if (kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName]) >= kommonitorDataExchangeService.getIndicatorValue_asNumber(measureOfValue)){ - if(! this.greaterThanValues.includes(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName]))){ - this.greaterThanValues.push(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName])); - } - } - else{ - if(! this.lesserThanValues.includes(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName]))){ - this.lesserThanValues.push(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName])); - } - } - } - }; - - this.setupMovBrewValues_wholeTimeseries = function(geoJSON, measureOfValue){ - var indicatorTimeSeriesDatesArray = kommonitorDataExchangeService.selectedIndicator.applicableDates; - - for (const date of indicatorTimeSeriesDatesArray) { - var propertyName = __env.indicatorDatePrefix + date; - this.setupMovBrewValues_singleTimestamp(geoJSON, propertyName, measureOfValue); - } - }; - - function setupClassyBrew_usingFeatureCount(valuesArray, colorCode, classifyMethod, maxNumberOfClasses){ - - var tempBrew = new classyBrew(); - var colorBrewerInstance = new classyBrew(); - - if (valuesArray.length >= 5) { - // pass array to our classyBrew series - tempBrew.setSeries(valuesArray); - // define number of classes - tempBrew.setNumClasses(maxNumberOfClasses); - // set color ramp code - tempBrew.setColorCode(colorCode); - // classify by passing in statistical method - // i.e. equal_interval, jenks, quantile - tempBrew.classify(classifyMethod); - - colorBrewerInstance.colors = tempBrew.getColors(); - colorBrewerInstance.breaks = tempBrew.getBreaks(); - } - - else if (valuesArray.length === 4) { - valuesArray.sort((a, b) => a - b); - - colorBrewerInstance.colors = tempBrew.colorSchemes[colorCode]['4']; - colorBrewerInstance.breaks = valuesArray; - } - - else if (valuesArray.length === 3) { - valuesArray.sort((a, b) => a - b); - - colorBrewerInstance.colors = tempBrew.colorSchemes[colorCode]['3']; - colorBrewerInstance.breaks = valuesArray; - } - else if (valuesArray.length === 2) { - valuesArray.sort((a, b) => a - b); - - colorBrewerInstance.colors = tempBrew.colorSchemes[colorCode]['3']; - colorBrewerInstance.breaks = valuesArray; - - colorBrewerInstance.colors.shift(); // remove first element of array - } - else if (valuesArray.length === 1) { - valuesArray.sort((a, b) => a - b); - - colorBrewerInstance.colors = tempBrew.colorSchemes[colorCode]['3']; - colorBrewerInstance.breaks = valuesArray; - - colorBrewerInstance.colors.shift(); // remove first element of array - colorBrewerInstance.colors.shift(); // remove first element of array - } - else { - // no positive values - colorBrewerInstance = undefined; - } - - // round values - if (colorBrewerInstance && colorBrewerInstance.breaks){ - for (let index = 0; index < colorBrewerInstance.breaks.length; index++) { - colorBrewerInstance.breaks[index] = kommonitorDataExchangeService.getIndicatorValue_asNumber(colorBrewerInstance.breaks[index]); - } - } - - return colorBrewerInstance; - } - - this.setupGtMeasureOfValueBrew = function (greaterThanValues, colorCodeForGreaterThanValues, classifyMethod) { - - return setupClassyBrew_usingFeatureCount(greaterThanValues, colorCodeForGreaterThanValues, classifyMethod, 3); - - }; - - this.setupLtMeasureOfValueBrew = function (lesserThanValues, colorCodeForLesserThanValues, classifyMethod) { - - var brew = setupClassyBrew_usingFeatureCount(lesserThanValues, colorCodeForLesserThanValues, classifyMethod, 3); - if(brew && brew.colors && brew.colors.length > 1){ - brew.colors = brew.colors.reverse(); - } - return brew; - }; - - /** - * Returns and array of color brewer instances for dynamic increase and decrease colors - * - * [dynamicIncreaseBrew, dynamicDecreaseBrew] - */ - this.setupDynamicIndicatorBrew = function (geoJSON, propertyName, colorCodeForPositiveValues, colorCodeForNegativeValues, classifyMethod) { - - /* - * Idea: Analyse the complete geoJSON property array for each feature and make conclusion about how to build the legend - - e.g. if there are only positive values then display only positive values within 5 categories - same for only negative values - - e.g. if there are equally many positive as negative values then display both using 3 categories each - - e.g. if there are way more positive than negative values, then display both with 2 (negative) and 4 (positive) classes - - --> implement special cases (0, 1 or 2 negative/positive values --> apply colors manually) - --> treat all other cases equally to measureOfValue - */ - - this.resetFeaturesPerColorObjects(); - - this.positiveValues = []; - this.negativeValues = []; - - if(kommonitorDataExchangeService.classifyUsingWholeTimeseries){ - this.setupDynamicBrewValues_wholeTimeseries(geoJSON); - } - else{ - this.setupDynamicBrewValues_singleTimestamp(geoJSON, propertyName); - } - - var dynamicIncreaseBrew = setupDynamicIncreaseBrew(this.positiveValues, colorCodeForPositiveValues, classifyMethod); - var dynamicDecreaseBrew = setupDynamicDecreaseBrew(this.negativeValues, colorCodeForNegativeValues, classifyMethod); - - this.dynamicBrew = [dynamicIncreaseBrew, dynamicDecreaseBrew]; - return this.dynamicBrew; - }; - - this.setupDynamicBrewValues_wholeTimeseries = function(geoJSON){ - var indicatorTimeSeriesDatesArray = kommonitorDataExchangeService.selectedIndicator.applicableDates; - - for (const date of indicatorTimeSeriesDatesArray) { - var propertyName = __env.indicatorDatePrefix + date; - this.setupDynamicBrewValues_singleTimestamp(geoJSON, propertyName); - } - }; - - this.setupDynamicBrewValues_singleTimestamp = function(geoJSON, propertyName){ - for (var i = 0; i < geoJSON.features.length; i++) { - if (kommonitorDataExchangeService.indicatorValueIsNoData(geoJSON.features[i].properties[propertyName])) - continue; - - if(kommonitorDataExchangeService.classifyZeroSeparately && (geoJSON.features[i].properties[propertyName] == 0 || geoJSON.features[i].properties[propertyName] == "0")){ - continue; - } - - // check if is outlier, then do not use within classification, as it will be marked on map with special color - if (geoJSON.features[i].properties[outlierPropertyName] && geoJSON.features[i].properties[outlierPropertyName] !== outlierPropertyValue_no && kommonitorDataExchangeService.useOutlierDetectionOnIndicator) { - continue; - } - - else if (kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName]) >= 0){ - if(! this.positiveValues.includes(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName]))){ - this.positiveValues.push(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName])); - } - } - else if (kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName]) < 0){ - if(! this.negativeValues.includes(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName]))){ - this.negativeValues.push(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName])); - } - } - } - }; - - function setupDynamicIncreaseBrew(positiveValues, colorCodeForPositiveValues, classifyMethod) { - return setupClassyBrew_usingFeatureCount(positiveValues, colorCodeForPositiveValues, classifyMethod, 3); - } - - function setupDynamicDecreaseBrew(negativeValues, colorCodeForNegativeValues, classifyMethod) { - var brew = setupClassyBrew_usingFeatureCount(negativeValues, colorCodeForNegativeValues, classifyMethod, 3); - if(brew && brew.colors && brew.colors.length > 1){ - brew.colors = brew.colors.reverse(); - } - return brew; - } - - this.styleNoData = function(feature) { - this.featuresPerNoData ++; - return this.noDataStyle; - }; - - this.styleOutlier = function(feature) { - if ((feature.properties[outlierPropertyName] === outlierPropertyValue_low_soft) || (feature.properties[outlierPropertyName] === outlierPropertyValue_low_extreme)) { - - this.featuresPerOutlierLow ++; - return this.outlierStyle_low; - } - else { - - this.featuresPerOutlierHigh ++; - return this.outlierStyle_high; - } - }; - - this.getOpacity = function(opacity){ - - return defaultFillOpacity; - }; - - this.setOpacity = function(opacity){ - - opacity = Number(opacity); - this.indicatorTransparency = Number((1 - opacity).toFixed(numberOfDecimals)); - this.currentIndicatorOpacity = opacity; - - defaultFillOpacity = opacity; - defaultFillOpacityForOutliers_low = opacity; - defaultFillOpacityForOutliers_high = opacity; - defaultFillOpacityForZeroFeatures = opacity; - defaultFillOpacityForNoDataValues = opacity; - defaultFillOpacityForFilteredFeatures = opacity; - - $timeout(function(){ - $rootScope.$apply(); - }); - }; - - // style function to return - this.styleDefault = function(feature, defaultBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, propertyName, useTransparencyOnIndicator, datasetContainsNegativeValues) { - - // check if feature is NoData - if (kommonitorDataExchangeService.indicatorValueIsNoData(feature.properties[propertyName])) { - return this.styleNoData(feature); - } - - // check if feature is outlier - if ((feature.properties[outlierPropertyName] !== outlierPropertyValue_no) && kommonitorDataExchangeService.useOutlierDetectionOnIndicator) { - return this.styleOutlier(feature); + this.featuresPerOutlierLow = 0; + this.resetFeaturesPerColorObjects = function () { + this.featuresPerColorMap = new Map(); + this.featuresPerNoData = 0; + this.featuresPerZero = 0; + this.featuresPerOutlierLow = 0; + this.featuresPerOutlierHigh = 0; + }; + this.incrementFeaturesPerColor = function (color) { + if (this.featuresPerColorMap.has(color)) { + this.featuresPerColorMap.set(color, this.featuresPerColorMap.get(color) + 1); + } + else { + this.featuresPerColorMap.set(color, 1); + } + }; + this.getFillColorForZero = function () { + this.featuresPerZero++; + return defaultColorForZeroValues; + }; + this.setupDefaultBrew = function (geoJSON, propertyName, numClasses, colorCode, classifyMethod, forceProvidedIndicator, indicator) { + this.resetFeaturesPerColorObjects(); + var values = new Array(); + if (kommonitorDataExchangeService.classifyUsingWholeTimeseries) { + values = this.setupDefaultBrewValues_wholeTimeseries(geoJSON, values, forceProvidedIndicator, indicator); + } + else { + values = this.setupDefaultBrewValues_singleTimestamp(geoJSON, propertyName, values); + } + this.defaultBrew = setupClassyBrew_usingFeatureCount(values, colorCode, classifyMethod, numClasses); + return this.defaultBrew; + }; + this.setupDefaultBrewValues_singleTimestamp = function (geoJSON, propertyName, values) { + for (var i = 0; i < geoJSON.features.length; i++) { + if (kommonitorDataExchangeService.indicatorValueIsNoData(geoJSON.features[i].properties[propertyName])) + continue; + if (kommonitorDataExchangeService.classifyZeroSeparately && (geoJSON.features[i].properties[propertyName] == 0 || geoJSON.features[i].properties[propertyName] == "0")) { + continue; + } + // check if is outlier, then do not use within classification, as it will be marked on map with special color + if (geoJSON.features[i].properties[outlierPropertyName] && geoJSON.features[i].properties[outlierPropertyName] !== outlierPropertyValue_no && kommonitorDataExchangeService.useOutlierDetectionOnIndicator) { + continue; + } + if (!values.includes(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName]))) { + values.push(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName])); + } + } + return values; + }; + this.setupDefaultBrewValues_wholeTimeseries = function (geoJSON, values, forceProvidedIndicator, indicator) { + var indicatorTimeSeriesDatesArray; + if (forceProvidedIndicator) { + indicatorTimeSeriesDatesArray = indicator.applicableDates; + } + else { + indicatorTimeSeriesDatesArray = kommonitorDataExchangeService.selectedIndicator.applicableDates; + } + for (const date of indicatorTimeSeriesDatesArray) { + var propertyName = __env.indicatorDatePrefix + date; + values = this.setupDefaultBrewValues_singleTimestamp(geoJSON, propertyName, values); + } + return values; + }; + /** + * Returns and array of color brewer instances for greater and lesser than measure of value colors + * + * [gtMeasureOfValueBrew, ltMeasureOfValueBrew] + */ + this.setupMeasureOfValueBrew = function (geoJSON, propertyName, colorCodeForGreaterThanValues, colorCodeForLesserThanValues, classifyMethod, measureOfValue) { + /* + * Idea: Analyse the complete geoJSON property array for each feature and make conclusion about how to build the legend + + e.g. if there are only positive values then display only positive values within 5 categories - same for only negative values + + e.g. if there are equally many positive as negative values then display both using 3 categories each + + e.g. if there are way more positive than negative values, then display both with 2 (negative) and 4 (positive) classes + + --> implement special cases (0, 1 or 2 negative/positive values --> apply colors manually) + --> treat all other cases equally to measureOfValue + */ + this.resetFeaturesPerColorObjects(); + this.greaterThanValues = []; + this.lesserThanValues = []; + if (kommonitorDataExchangeService.classifyUsingWholeTimeseries) { + this.setupMovBrewValues_wholeTimeseries(geoJSON, measureOfValue); + } + else { + this.setupMovBrewValues_singleTimestamp(geoJSON, propertyName, measureOfValue); + } + var gtMeasureOfValueBrew = this.setupGtMeasureOfValueBrew(this.greaterThanValues, colorCodeForGreaterThanValues, classifyMethod); + var ltMeasureOfValueBrew = this.setupLtMeasureOfValueBrew(this.lesserThanValues, colorCodeForLesserThanValues, classifyMethod); + this.measureOfValueBrew = [gtMeasureOfValueBrew, ltMeasureOfValueBrew]; + return this.measureOfValueBrew; + }; + this.setupMovBrewValues_singleTimestamp = function (geoJSON, propertyName, measureOfValue) { + for (var i = 0; i < geoJSON.features.length; i++) { + if (kommonitorDataExchangeService.indicatorValueIsNoData(geoJSON.features[i].properties[propertyName])) + continue; + if (kommonitorDataExchangeService.classifyZeroSeparately && (geoJSON.features[i].properties[propertyName] == 0 || geoJSON.features[i].properties[propertyName] == "0")) { + continue; + } + // check if is outlier, then do not use within classification, as it will be marked on map with special color + if (geoJSON.features[i].properties[outlierPropertyName] && geoJSON.features[i].properties[outlierPropertyName] !== outlierPropertyValue_no && kommonitorDataExchangeService.useOutlierDetectionOnIndicator) { + continue; + } + else if (kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName]) >= kommonitorDataExchangeService.getIndicatorValue_asNumber(measureOfValue)) { + if (!this.greaterThanValues.includes(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName]))) { + this.greaterThanValues.push(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName])); + } + } + else { + if (!this.lesserThanValues.includes(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName]))) { + this.lesserThanValues.push(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName])); + } + } + } + }; + this.setupMovBrewValues_wholeTimeseries = function (geoJSON, measureOfValue) { + var indicatorTimeSeriesDatesArray = kommonitorDataExchangeService.selectedIndicator.applicableDates; + for (const date of indicatorTimeSeriesDatesArray) { + var propertyName = __env.indicatorDatePrefix + date; + this.setupMovBrewValues_singleTimestamp(geoJSON, propertyName, measureOfValue); + } + }; + function setupClassyBrew_usingFeatureCount(valuesArray, colorCode, classifyMethod, maxNumberOfClasses) { + var tempBrew = new classyBrew(); + var colorBrewerInstance = new classyBrew(); + if (valuesArray.length >= 5) { + // pass array to our classyBrew series + tempBrew.setSeries(valuesArray); + // define number of classes + tempBrew.setNumClasses(maxNumberOfClasses); + // set color ramp code + tempBrew.setColorCode(colorCode); + // classify by passing in statistical method + // i.e. equal_interval, jenks, quantile + tempBrew.classify(classifyMethod); + colorBrewerInstance.colors = tempBrew.getColors(); + colorBrewerInstance.breaks = tempBrew.getBreaks(); + } + else if (valuesArray.length === 4) { + valuesArray.sort((a, b) => a - b); + colorBrewerInstance.colors = tempBrew.colorSchemes[colorCode]['4']; + colorBrewerInstance.breaks = valuesArray; + } + else if (valuesArray.length === 3) { + valuesArray.sort((a, b) => a - b); + colorBrewerInstance.colors = tempBrew.colorSchemes[colorCode]['3']; + colorBrewerInstance.breaks = valuesArray; + } + else if (valuesArray.length === 2) { + valuesArray.sort((a, b) => a - b); + colorBrewerInstance.colors = tempBrew.colorSchemes[colorCode]['3']; + colorBrewerInstance.breaks = valuesArray; + colorBrewerInstance.colors.shift(); // remove first element of array + } + else if (valuesArray.length === 1) { + valuesArray.sort((a, b) => a - b); + colorBrewerInstance.colors = tempBrew.colorSchemes[colorCode]['3']; + colorBrewerInstance.breaks = valuesArray; + colorBrewerInstance.colors.shift(); // remove first element of array + colorBrewerInstance.colors.shift(); // remove first element of array + } + else { + // no positive values + colorBrewerInstance = undefined; + } + // round values + if (colorBrewerInstance && colorBrewerInstance.breaks) { + for (let index = 0; index < colorBrewerInstance.breaks.length; index++) { + colorBrewerInstance.breaks[index] = kommonitorDataExchangeService.getIndicatorValue_asNumber(colorBrewerInstance.breaks[index]); + } + } + return colorBrewerInstance; } - - var fillOpacity = 1; - if (useTransparencyOnIndicator) { - fillOpacity = defaultFillOpacity; + this.setupGtMeasureOfValueBrew = function (greaterThanValues, colorCodeForGreaterThanValues, classifyMethod) { + return setupClassyBrew_usingFeatureCount(greaterThanValues, colorCodeForGreaterThanValues, classifyMethod, 3); + }; + this.setupLtMeasureOfValueBrew = function (lesserThanValues, colorCodeForLesserThanValues, classifyMethod) { + var brew = setupClassyBrew_usingFeatureCount(lesserThanValues, colorCodeForLesserThanValues, classifyMethod, 3); + if (brew && brew.colors && brew.colors.length > 1) { + brew.colors = brew.colors.reverse(); + } + return brew; + }; + /** + * Returns and array of color brewer instances for dynamic increase and decrease colors + * + * [dynamicIncreaseBrew, dynamicDecreaseBrew] + */ + this.setupDynamicIndicatorBrew = function (geoJSON, propertyName, colorCodeForPositiveValues, colorCodeForNegativeValues, classifyMethod) { + /* + * Idea: Analyse the complete geoJSON property array for each feature and make conclusion about how to build the legend + + e.g. if there are only positive values then display only positive values within 5 categories - same for only negative values + + e.g. if there are equally many positive as negative values then display both using 3 categories each + + e.g. if there are way more positive than negative values, then display both with 2 (negative) and 4 (positive) classes + + --> implement special cases (0, 1 or 2 negative/positive values --> apply colors manually) + --> treat all other cases equally to measureOfValue + */ + this.resetFeaturesPerColorObjects(); + this.positiveValues = []; + this.negativeValues = []; + if (kommonitorDataExchangeService.classifyUsingWholeTimeseries) { + this.setupDynamicBrewValues_wholeTimeseries(geoJSON); + } + else { + this.setupDynamicBrewValues_singleTimestamp(geoJSON, propertyName); + } + var dynamicIncreaseBrew = setupDynamicIncreaseBrew(this.positiveValues, colorCodeForPositiveValues, classifyMethod); + var dynamicDecreaseBrew = setupDynamicDecreaseBrew(this.negativeValues, colorCodeForNegativeValues, classifyMethod); + this.dynamicBrew = [dynamicIncreaseBrew, dynamicDecreaseBrew]; + return this.dynamicBrew; + }; + this.setupDynamicBrewValues_wholeTimeseries = function (geoJSON) { + var indicatorTimeSeriesDatesArray = kommonitorDataExchangeService.selectedIndicator.applicableDates; + for (const date of indicatorTimeSeriesDatesArray) { + var propertyName = __env.indicatorDatePrefix + date; + this.setupDynamicBrewValues_singleTimestamp(geoJSON, propertyName); + } + }; + this.setupDynamicBrewValues_singleTimestamp = function (geoJSON, propertyName) { + for (var i = 0; i < geoJSON.features.length; i++) { + if (kommonitorDataExchangeService.indicatorValueIsNoData(geoJSON.features[i].properties[propertyName])) + continue; + if (kommonitorDataExchangeService.classifyZeroSeparately && (geoJSON.features[i].properties[propertyName] == 0 || geoJSON.features[i].properties[propertyName] == "0")) { + continue; + } + // check if is outlier, then do not use within classification, as it will be marked on map with special color + if (geoJSON.features[i].properties[outlierPropertyName] && geoJSON.features[i].properties[outlierPropertyName] !== outlierPropertyValue_no && kommonitorDataExchangeService.useOutlierDetectionOnIndicator) { + continue; + } + else if (kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName]) >= 0) { + if (!this.positiveValues.includes(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName]))) { + this.positiveValues.push(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName])); + } + } + else if (kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName]) < 0) { + if (!this.negativeValues.includes(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName]))) { + this.negativeValues.push(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName])); + } + } + } + }; + function setupDynamicIncreaseBrew(positiveValues, colorCodeForPositiveValues, classifyMethod) { + return setupClassyBrew_usingFeatureCount(positiveValues, colorCodeForPositiveValues, classifyMethod, 3); } - - var fillColor; - if (kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[propertyName] == 0 || feature.properties[propertyName] == "0")) { - fillColor = this.getFillColorForZero(); - if (useTransparencyOnIndicator) { - fillOpacity = defaultFillOpacityForZeroFeatures; - } - + function setupDynamicDecreaseBrew(negativeValues, colorCodeForNegativeValues, classifyMethod) { + var brew = setupClassyBrew_usingFeatureCount(negativeValues, colorCodeForNegativeValues, classifyMethod, 3); + if (brew && brew.colors && brew.colors.length > 1) { + brew.colors = brew.colors.reverse(); + } + return brew; } - else { - if (datasetContainsNegativeValues) { - if (kommonitorDataExchangeService.getIndicatorValue_asNumber(feature.properties[propertyName]) >= 0) { - if (kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[propertyName] == 0 || feature.properties[propertyName] == "0")) { + this.styleNoData = function (feature) { + this.featuresPerNoData++; + return this.noDataStyle; + }; + this.styleOutlier = function (feature) { + if ((feature.properties[outlierPropertyName] === outlierPropertyValue_low_soft) || (feature.properties[outlierPropertyName] === outlierPropertyValue_low_extreme)) { + this.featuresPerOutlierLow++; + return this.outlierStyle_low; + } + else { + this.featuresPerOutlierHigh++; + return this.outlierStyle_high; + } + }; + this.getOpacity = function (opacity) { + return defaultFillOpacity; + }; + this.setOpacity = function (opacity) { + opacity = Number(opacity); + this.indicatorTransparency = Number((1 - opacity).toFixed(numberOfDecimals)); + this.currentIndicatorOpacity = opacity; + defaultFillOpacity = opacity; + defaultFillOpacityForOutliers_low = opacity; + defaultFillOpacityForOutliers_high = opacity; + defaultFillOpacityForZeroFeatures = opacity; + defaultFillOpacityForNoDataValues = opacity; + defaultFillOpacityForFilteredFeatures = opacity; + $timeout(function () { + $rootScope.$apply(); + }); + }; + // style function to return + this.styleDefault = function (feature, defaultBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, propertyName, useTransparencyOnIndicator, datasetContainsNegativeValues) { + // check if feature is NoData + if (kommonitorDataExchangeService.indicatorValueIsNoData(feature.properties[propertyName])) { + return this.styleNoData(feature); + } + // check if feature is outlier + if ((feature.properties[outlierPropertyName] !== outlierPropertyValue_no) && kommonitorDataExchangeService.useOutlierDetectionOnIndicator) { + return this.styleOutlier(feature); + } + var fillOpacity = 1; + if (useTransparencyOnIndicator) { + fillOpacity = defaultFillOpacity; + } + var fillColor; + if (kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[propertyName] == 0 || feature.properties[propertyName] == "0")) { fillColor = this.getFillColorForZero(); if (useTransparencyOnIndicator) { - fillOpacity = defaultFillOpacityForZeroFeatures; + fillOpacity = defaultFillOpacityForZeroFeatures; } - } - else { - fillColor = this.findColorInRange(feature, propertyName, dynamicIncreaseBrew); - } - - return { - weight: 1, - opacity: 1, - color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColor, - dashArray: '', - fillOpacity: fillOpacity, - fillColor: fillColor, - fillPattern: undefined - }; } else { - - if (kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[propertyName] == 0 || feature.properties[propertyName] == "0")) { - fillColor = this.getFillColorForZero(); - if (useTransparencyOnIndicator) { - fillOpacity = defaultFillOpacityForZeroFeatures; + if (datasetContainsNegativeValues) { + if (kommonitorDataExchangeService.getIndicatorValue_asNumber(feature.properties[propertyName]) >= 0) { + if (kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[propertyName] == 0 || feature.properties[propertyName] == "0")) { + fillColor = this.getFillColorForZero(); + if (useTransparencyOnIndicator) { + fillOpacity = defaultFillOpacityForZeroFeatures; + } + } + else { + fillColor = this.findColorInRange(feature, propertyName, dynamicIncreaseBrew); + } + return { + weight: 1, + opacity: 1, + color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColor, + dashArray: '', + fillOpacity: fillOpacity, + fillColor: fillColor, + fillPattern: undefined + }; + } + else { + if (kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[propertyName] == 0 || feature.properties[propertyName] == "0")) { + fillColor = this.getFillColorForZero(); + if (useTransparencyOnIndicator) { + fillOpacity = defaultFillOpacityForZeroFeatures; + } + } + else { + // invert colors, so that lowest values will become strong colored! + fillColor = this.findColorInRange(feature, propertyName, dynamicDecreaseBrew); + } + return { + weight: 1, + opacity: 1, + color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColor, + dashArray: '', + fillOpacity: fillOpacity, + fillColor: fillColor, + fillPattern: undefined + }; + } } - } - else { - // invert colors, so that lowest values will become strong colored! - fillColor = this.findColorInRange(feature, propertyName, dynamicDecreaseBrew); - } - - return { + else { + fillColor = this.findColorInRange(feature, propertyName, defaultBrew); + } + } + return { weight: 1, opacity: 1, color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColor, @@ -570,225 +481,179 @@ angular fillOpacity: fillOpacity, fillColor: fillColor, fillPattern: undefined - }; + }; + }; + this.findColorInRange = function (feature, propertyName, colorBrewInstance) { + var color; + for (var index = 0; index < colorBrewInstance.breaks.length; index++) { + if (kommonitorDataExchangeService.getIndicatorValue_asNumber(feature.properties[propertyName]) == kommonitorDataExchangeService.getIndicatorValue_asNumber(colorBrewInstance.breaks[index])) { + if (index < colorBrewInstance.breaks.length - 1) { + // min value + color = colorBrewInstance.colors[index]; + break; + } + else { + //max value + if (colorBrewInstance.colors[index]) { + color = colorBrewInstance.colors[index]; + } + else { + color = colorBrewInstance.colors[index - 1]; + } + break; + } + } + else { + if (kommonitorDataExchangeService.getIndicatorValue_asNumber(feature.properties[propertyName]) < kommonitorDataExchangeService.getIndicatorValue_asNumber(colorBrewInstance.breaks[index + 1])) { + color = colorBrewInstance.colors[index]; + break; + } + } } - } - else { - fillColor = this.findColorInRange(feature, propertyName, defaultBrew); - } - } - - return { - weight: 1, - opacity: 1, - color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColor, - dashArray: '', - fillOpacity: fillOpacity, - fillColor: fillColor, - fillPattern: undefined + this.incrementFeaturesPerColor(color); + return color; }; - }; - - this.findColorInRange = function(feature, propertyName, colorBrewInstance){ - var color; - - for (var index = 0; index < colorBrewInstance.breaks.length; index++) { - if (kommonitorDataExchangeService.getIndicatorValue_asNumber(feature.properties[propertyName]) == kommonitorDataExchangeService.getIndicatorValue_asNumber(colorBrewInstance.breaks[index])) { - if (index < colorBrewInstance.breaks.length - 1) { - // min value - color = colorBrewInstance.colors[index]; - break; + // this.findColorInRange_invertedColorGradient = function (feature, propertyName, colorBrewInstance){ + // var color; + // for (var k = 0; k < colorBrewInstance.breaks.length; k++) { + // if (kommonitorDataExchangeService.getIndicatorValue_asNumber(feature.properties[propertyName]) == kommonitorDataExchangeService.getIndicatorValue_asNumber(colorBrewInstance.breaks[k])) { + // if (k < colorBrewInstance.breaks.length - 1) { + // // min value + // color = colorBrewInstance.colors[colorBrewInstance.colors.length - k - 1]; + // break; + // } + // else { + // //max value + // if (colorBrewInstance.colors[colorBrewInstance.colors.length - k]) { + // color = colorBrewInstance.colors[colorBrewInstance.colors.length - k]; + // } + // else { + // color = colorBrewInstance.colors[colorBrewInstance.colors.length - k - 1]; + // } + // break; + // } + // } + // else { + // if (kommonitorDataExchangeService.getIndicatorValue_asNumber(feature.properties[propertyName]) < kommonitorDataExchangeService.getIndicatorValue_asNumber(colorBrewInstance.breaks[k + 1])) { + // color = colorBrewInstance.colors[colorBrewInstance.colors.length - k - 1]; + // break; + // } + // } + // } + // this.incrementFeaturesPerColor(color); + // return color; + // }; + this.styleMeasureOfValue = function (feature, gtMeasureOfValueBrew, ltMeasureOfValueBrew, propertyName, useTransparencyOnIndicator) { + // check if feature is NoData + if (kommonitorDataExchangeService.indicatorValueIsNoData(feature.properties[propertyName])) { + return this.styleNoData(feature); } - else { - //max value - if (colorBrewInstance.colors[index]) { - color = colorBrewInstance.colors[index]; - } - else { - color = colorBrewInstance.colors[index - 1]; - } - break; - } - } - else { - if (kommonitorDataExchangeService.getIndicatorValue_asNumber(feature.properties[propertyName]) < kommonitorDataExchangeService.getIndicatorValue_asNumber(colorBrewInstance.breaks[index + 1])) { - color = colorBrewInstance.colors[index]; - break; - } - } - } - - this.incrementFeaturesPerColor(color); - - return color; - }; - - // this.findColorInRange_invertedColorGradient = function (feature, propertyName, colorBrewInstance){ - // var color; - - // for (var k = 0; k < colorBrewInstance.breaks.length; k++) { - // if (kommonitorDataExchangeService.getIndicatorValue_asNumber(feature.properties[propertyName]) == kommonitorDataExchangeService.getIndicatorValue_asNumber(colorBrewInstance.breaks[k])) { - // if (k < colorBrewInstance.breaks.length - 1) { - // // min value - // color = colorBrewInstance.colors[colorBrewInstance.colors.length - k - 1]; - // break; - // } - // else { - // //max value - // if (colorBrewInstance.colors[colorBrewInstance.colors.length - k]) { - // color = colorBrewInstance.colors[colorBrewInstance.colors.length - k]; - // } - // else { - // color = colorBrewInstance.colors[colorBrewInstance.colors.length - k - 1]; - // } - // break; - // } - // } - // else { - // if (kommonitorDataExchangeService.getIndicatorValue_asNumber(feature.properties[propertyName]) < kommonitorDataExchangeService.getIndicatorValue_asNumber(colorBrewInstance.breaks[k + 1])) { - // color = colorBrewInstance.colors[colorBrewInstance.colors.length - k - 1]; - // break; - // } - // } - // } - - // this.incrementFeaturesPerColor(color); - - // return color; - // }; - - this.styleMeasureOfValue = function(feature, gtMeasureOfValueBrew, ltMeasureOfValueBrew, propertyName, useTransparencyOnIndicator) { - - - // check if feature is NoData - if (kommonitorDataExchangeService.indicatorValueIsNoData(feature.properties[propertyName])) { - return this.styleNoData(feature); - } - - // check if feature is outlier - if ((feature.properties[outlierPropertyName] !== outlierPropertyValue_no) && kommonitorDataExchangeService.useOutlierDetectionOnIndicator) { - return this.styleOutlier(feature); - } - - var fillOpacity = 1; - if (useTransparencyOnIndicator) { - fillOpacity = defaultFillOpacity; - } - - var fillColor; - if (kommonitorDataExchangeService.getIndicatorValue_asNumber(feature.properties[propertyName]) >= kommonitorDataExchangeService.measureOfValue) { - - if (kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[propertyName] == 0 || feature.properties[propertyName] == "0")) { - fillColor = this.getFillColorForZero(); - if (useTransparencyOnIndicator) { - fillOpacity = defaultFillOpacityForZeroFeatures; - } - } - else { - - fillColor = this.findColorInRange(feature, propertyName, gtMeasureOfValueBrew); - } - - return { - weight: 1, - opacity: 1, - color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColor, - dashArray: '', - fillOpacity: fillOpacity, - fillColor: fillColor, - fillPattern: undefined - }; - } - else { - if (kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[propertyName] == 0 || feature.properties[propertyName] == "0")) { - fillColor = this.getFillColorForZero(); - if (useTransparencyOnIndicator) { - fillOpacity = defaultFillOpacityForZeroFeatures; - } - } - else { - // invert colors, so that lowest values will become strong colored! - fillColor = this.findColorInRange(feature, propertyName, ltMeasureOfValueBrew); - } - - return { - weight: 1, - opacity: 1, - color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColor, - dashArray: '', - fillOpacity: fillOpacity, - fillColor: fillColor, - fillPattern: undefined - }; - } - - }; - - this.styleDynamicIndicator = function(feature, dynamicIncreaseBrew, dynamicDecreaseBrew, propertyName, useTransparencyOnIndicator) { - - - - // check if feature is NoData - if (kommonitorDataExchangeService.indicatorValueIsNoData(feature.properties[propertyName])) { - return this.styleNoData(feature); - } - - // check if feature is outlier - if ((feature.properties[outlierPropertyName] !== outlierPropertyValue_no) && kommonitorDataExchangeService.useOutlierDetectionOnIndicator) { - return this.styleOutlier(feature); - } - - var fillOpacity = 1; - if (useTransparencyOnIndicator) { - fillOpacity = defaultFillOpacity; - } - - var fillColor; - if (kommonitorDataExchangeService.getIndicatorValue_asNumber(feature.properties[propertyName]) >= 0) { - - if (kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[propertyName] == 0 || feature.properties[propertyName] == "0")) { - fillColor = this.getFillColorForZero(); + // check if feature is outlier + if ((feature.properties[outlierPropertyName] !== outlierPropertyValue_no) && kommonitorDataExchangeService.useOutlierDetectionOnIndicator) { + return this.styleOutlier(feature); + } + var fillOpacity = 1; if (useTransparencyOnIndicator) { - fillOpacity = defaultFillOpacityForZeroFeatures; - } - } - else { - fillColor = this.findColorInRange(feature, propertyName, dynamicIncreaseBrew); - } - - return { - weight: 1, - opacity: 1, - color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColor, - dashArray: '', - fillOpacity: fillOpacity, - fillColor: fillColor, - fillPattern: undefined - }; - } - else { - if (kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[propertyName] == 0 || feature.properties[propertyName] == "0")) { - fillColor = this.getFillColorForZero(); + fillOpacity = defaultFillOpacity; + } + var fillColor; + if (kommonitorDataExchangeService.getIndicatorValue_asNumber(feature.properties[propertyName]) >= kommonitorDataExchangeService.measureOfValue) { + if (kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[propertyName] == 0 || feature.properties[propertyName] == "0")) { + fillColor = this.getFillColorForZero(); + if (useTransparencyOnIndicator) { + fillOpacity = defaultFillOpacityForZeroFeatures; + } + } + else { + fillColor = this.findColorInRange(feature, propertyName, gtMeasureOfValueBrew); + } + return { + weight: 1, + opacity: 1, + color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColor, + dashArray: '', + fillOpacity: fillOpacity, + fillColor: fillColor, + fillPattern: undefined + }; + } + else { + if (kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[propertyName] == 0 || feature.properties[propertyName] == "0")) { + fillColor = this.getFillColorForZero(); + if (useTransparencyOnIndicator) { + fillOpacity = defaultFillOpacityForZeroFeatures; + } + } + else { + // invert colors, so that lowest values will become strong colored! + fillColor = this.findColorInRange(feature, propertyName, ltMeasureOfValueBrew); + } + return { + weight: 1, + opacity: 1, + color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColor, + dashArray: '', + fillOpacity: fillOpacity, + fillColor: fillColor, + fillPattern: undefined + }; + } + }; + this.styleDynamicIndicator = function (feature, dynamicIncreaseBrew, dynamicDecreaseBrew, propertyName, useTransparencyOnIndicator) { + // check if feature is NoData + if (kommonitorDataExchangeService.indicatorValueIsNoData(feature.properties[propertyName])) { + return this.styleNoData(feature); + } + // check if feature is outlier + if ((feature.properties[outlierPropertyName] !== outlierPropertyValue_no) && kommonitorDataExchangeService.useOutlierDetectionOnIndicator) { + return this.styleOutlier(feature); + } + var fillOpacity = 1; if (useTransparencyOnIndicator) { - fillOpacity = defaultFillOpacityForZeroFeatures; - } - } - else { - // invert colors, so that lowest values will become strong colored! - fillColor = this.findColorInRange(feature, propertyName, dynamicDecreaseBrew); - } - - return { - weight: 1, - opacity: 1, - color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColor, - dashArray: '', - fillOpacity: fillOpacity, - fillColor: fillColor, - fillPattern: undefined - }; - } - - }; - + fillOpacity = defaultFillOpacity; + } + var fillColor; + if (kommonitorDataExchangeService.getIndicatorValue_asNumber(feature.properties[propertyName]) >= 0) { + if (kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[propertyName] == 0 || feature.properties[propertyName] == "0")) { + fillColor = this.getFillColorForZero(); + if (useTransparencyOnIndicator) { + fillOpacity = defaultFillOpacityForZeroFeatures; + } + } + else { + fillColor = this.findColorInRange(feature, propertyName, dynamicIncreaseBrew); + } + return { + weight: 1, + opacity: 1, + color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColor, + dashArray: '', + fillOpacity: fillOpacity, + fillColor: fillColor, + fillPattern: undefined + }; + } + else { + if (kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[propertyName] == 0 || feature.properties[propertyName] == "0")) { + fillColor = this.getFillColorForZero(); + if (useTransparencyOnIndicator) { + fillOpacity = defaultFillOpacityForZeroFeatures; + } + } + else { + // invert colors, so that lowest values will become strong colored! + fillColor = this.findColorInRange(feature, propertyName, dynamicDecreaseBrew); + } + return { + weight: 1, + opacity: 1, + color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColor, + dashArray: '', + fillOpacity: fillOpacity, + fillColor: fillColor, + fillPattern: undefined + }; + } + }; }]); +//# sourceMappingURL=kommonitor-visual-style-helper-service.module.js.map \ No newline at end of file diff --git a/app/util/genericServices/kommonitorVisualStyleHelperService/kommonitor-visual-style-helper-service.module.js.map b/app/util/genericServices/kommonitorVisualStyleHelperService/kommonitor-visual-style-helper-service.module.js.map new file mode 100644 index 000000000..a31804ec8 --- /dev/null +++ b/app/util/genericServices/kommonitorVisualStyleHelperService/kommonitor-visual-style-helper-service.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kommonitor-visual-style-helper-service.module.js","sourceRoot":"","sources":["kommonitor-visual-style-helper-service.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,6BAA6B,EAAE,CAAC,wBAAwB,CAAC,CAAC,CAAC;AAE1E;;;;;;;;GAQG;AACH,OAAO;KACJ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AAS;oBACpB,WAAW,EAAE,SAAS;iBACvB,CAAC;aACH;iBACI;gBACH,IAAI,6BAA6B,CAAC,sBAAsB,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC,EAAE;oBAC9I,SAAS,GAAG,IAAI,CAAC,mBAAmB,EAAE,CAAC;oBACvC,IAAI,0BAA0B,EAAE;wBAC9B,WAAW,GAAG,iCAAiC,CAAC;qBACjD;iBACF;qBACI;oBACH,mEAAmE;oBACnE,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,YAAY,EAAE,mBAAmB,CAAC,CAAC;iBAC/E;gBAED,OAAO;oBACL,MAAM,EAAE,CAAC;oBACT,OAAO,EAAE,CAAC;oBACV,KAAK,EAAE,6BAA6B,CAAC,2BAA2B,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,kBAAkB;oBACnG,SAAS,EAAE,EAAE;oBACb,WAAW,EAAE,WAAW;oBACxB,SAAS,EAAE,SAAS;oBACpB,WAAW,EAAE,SAAS;iBACvB,CAAC;aACH;QAEH,CAAC,CAAC;IAEJ,CAAC,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/util/genericServices/kommonitorVisualStyleHelperService/kommonitor-visual-style-helper-service.module.ts b/app/util/genericServices/kommonitorVisualStyleHelperService/kommonitor-visual-style-helper-service.module.ts new file mode 100644 index 000000000..158544890 --- /dev/null +++ b/app/util/genericServices/kommonitorVisualStyleHelperService/kommonitor-visual-style-helper-service.module.ts @@ -0,0 +1,794 @@ +angular.module('kommonitorVisualStyleHelper', ['kommonitorDataExchange']); + +/** + * a common serviceInstance that holds all needed properties for a WPS service. + * + * This service represents a shared object ´which is used across the different + * application tabs/components like Setup, Capabilities, Execute etc. + * + * This way, one single service instance can be used to easily share values and + * parameters for each WPS operation represented by different Angular components + */ +angular + .module('kommonitorVisualStyleHelper', []) + .service( + 'kommonitorVisualStyleHelperService', ['$rootScope', '$timeout', 'kommonitorDataExchangeService', '$http', '__env', + function ($rootScope, $timeout, + kommonitorDataExchangeService, $http, __env) { + + const INDICATOR_DATE_PREFIX = __env.indicatorDatePrefix; + + this.defaultBrew = undefined; + this.measureOfValueBrew = undefined; + this.dynamicBrew = undefined; + + //allowesValues: equal_interval, quantile, jenks + this.classifyMethods = [{ + name: "Jenks", + value: "jenks" + }, { + name: "Gleiches Intervall", + value: "equal_interval" + }, { + name: "Quantile", + value: "quantile" + }]; + + this.classifyMethod = __env.defaultClassifyMethod || "jenks"; + + this.isCustomComputation = false; + + const numberOfDecimals = __env.numberOfDecimals; + var defaultColorForFilteredValues = __env.defaultColorForFilteredValues; + var defaultBorderColorForFilteredValues = __env.defaultBorderColorForFilteredValues; + var defaultBorderColor = __env.defaultBorderColor; + var defaultFillOpacity = __env.defaultFillOpacity; + var defaultFillOpacityForFilteredFeatures = __env.defaultFillOpacityForFilteredFeatures; + var defaultFillOpacityForHighlightedFeatures = __env.defaultFillOpacityForHighlightedFeatures; + var defaultFillOpacityForZeroFeatures = __env.defaultFillOpacityForZeroFeatures; + var defaultColorBrewerPaletteForBalanceIncreasingValues = __env.defaultColorBrewerPaletteForBalanceIncreasingValues; + var defaultColorBrewerPaletteForBalanceDecreasingValues = __env.defaultColorBrewerPaletteForBalanceDecreasingValues; + var defaultColorBrewerPaletteForGtMovValues = __env.defaultColorBrewerPaletteForGtMovValues; + var defaultColorBrewerPaletteForLtMovValues = __env.defaultColorBrewerPaletteForLtMovValues; + var defaultColorForHoveredFeatures = __env.defaultColorForHoveredFeatures; + var defaultColorForClickedFeatures = __env.defaultColorForClickedFeatures; + var defaultBorderColorForNoDataValues = __env.defaultBorderColorForNoDataValues; + var defaultColorForNoDataValues = __env.defaultColorForNoDataValues; + var defaultFillOpacityForNoDataValues = __env.defaultFillOpacityForNoDataValues; + + this.indicatorTransparency = 1 - __env.defaultFillOpacity; + this.currentIndicatorOpacity = __env.defaultFillOpacity; + + var defaultColorForZeroValues = __env.defaultColorForZeroValues; + + + var defaultColorForOutliers_high = __env.defaultColorForOutliers_high; + var defaultBorderColorForOutliers_high = __env.defaultBorderColorForOutliers_high; + var defaultFillOpacityForOutliers_high = __env.defaultFillOpacityForOutliers_high; + var defaultColorForOutliers_low = __env.defaultColorForOutliers_low; + var defaultBorderColorForOutliers_low = __env.defaultBorderColorForOutliers_low; + var defaultFillOpacityForOutliers_low = __env.defaultFillOpacityForOutliers_low; + var useOutlierDetectionOnIndicator = __env.useOutlierDetectionOnIndicator; + + const outlierPropertyName = "outlier"; + const outlierPropertyValue_high_soft = "high-soft"; + const outlierPropertyValue_low_soft = "low-soft"; + const outlierPropertyValue_high_extreme = "high-extreme"; + const outlierPropertyValue_low_extreme = "low-extreme"; + const outlierPropertyValue_no = "no"; + + this.outlierFillPattern_low = new L.StripePattern({ weight: 1, spaceweight: 1, patternTransform: "rotate(45)" }); + + this.outlierFillPattern_high = new L.StripePattern({ weight: 1, spaceweight: 1, patternTransform: "rotate(-45)" }); + + var shape = new L.PatternCircle({ + x: 5, + y: 5, + radius: 1, + fill: true, + color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultColorForNoDataValues + }); + this.noDataFillPattern = new L.Pattern({ width: 8, height: 8 }); + this.noDataFillPattern.addShape(shape); + + var outliers_high = undefined; + var outliers_low = undefined; + + this.outlierStyle_high = { + weight: 1, + opacity: 1, + color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColorForOutliers_high, + dashArray: '', + fillOpacity: defaultFillOpacityForOutliers_high, + fillColor: defaultColorForOutliers_high, + fillPattern: this.outlierFillPattern_high + }; + + this.outlierStyle_low = { + weight: 1, + opacity: 1, + color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColorForOutliers_low, + dashArray: '', + fillOpacity: defaultFillOpacityForOutliers_low, + fillColor: defaultColorForOutliers_low, + fillPattern: this.outlierFillPattern_low + }; + + this.noDataStyle = { + weight: 1, + opacity: 1, + color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColorForNoDataValues, + dashArray: '', + fillOpacity: defaultFillOpacityForNoDataValues, + fillColor: defaultColorForNoDataValues, + // fillPattern: this.noDataFillPattern + }; + + this.filteredStyle = { + weight: 1, + opacity: 1, + color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColorForFilteredValues, + dashArray: '', + fillOpacity: defaultFillOpacityForFilteredFeatures, + fillColor: defaultColorForFilteredValues + }; + + this.featuresPerColorMap = new Map(); + this.featuresPerNoData = 0; + this.featuresPerZero = 0; + this.featuresPerOutlierHigh = 0; + this.featuresPerOutlierLow = 0; + + this.resetFeaturesPerColorObjects = function(){ + this.featuresPerColorMap = new Map(); + this.featuresPerNoData = 0; + this.featuresPerZero = 0; + this.featuresPerOutlierLow = 0; + this.featuresPerOutlierHigh = 0; + }; + + this.incrementFeaturesPerColor = function(color){ + if(this.featuresPerColorMap.has(color)){ + this.featuresPerColorMap.set(color, this.featuresPerColorMap.get(color) + 1); + } + else{ + this.featuresPerColorMap.set(color, 1); + } + }; + + this.getFillColorForZero = function(){ + this.featuresPerZero ++; + return defaultColorForZeroValues; + }; + + this.setupDefaultBrew = function (geoJSON, propertyName, numClasses, colorCode, classifyMethod, forceProvidedIndicator, indicator) { + this.resetFeaturesPerColorObjects(); + + var values = new Array(); + + if(kommonitorDataExchangeService.classifyUsingWholeTimeseries){ + values = this.setupDefaultBrewValues_wholeTimeseries(geoJSON, values, forceProvidedIndicator, indicator); + } + else{ + values = this.setupDefaultBrewValues_singleTimestamp(geoJSON, propertyName, values); + } + + this.defaultBrew = setupClassyBrew_usingFeatureCount(values, colorCode, classifyMethod, numClasses); + return this.defaultBrew; + }; + + this.setupDefaultBrewValues_singleTimestamp = function(geoJSON, propertyName, values){ + for (var i = 0; i < geoJSON.features.length; i++) { + if (kommonitorDataExchangeService.indicatorValueIsNoData(geoJSON.features[i].properties[propertyName])) + continue; + + if(kommonitorDataExchangeService.classifyZeroSeparately && (geoJSON.features[i].properties[propertyName] == 0 || geoJSON.features[i].properties[propertyName] == "0")){ + continue; + } + + // check if is outlier, then do not use within classification, as it will be marked on map with special color + if (geoJSON.features[i].properties[outlierPropertyName] && geoJSON.features[i].properties[outlierPropertyName] !== outlierPropertyValue_no && kommonitorDataExchangeService.useOutlierDetectionOnIndicator) { + continue; + } + + if(! values.includes(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName]))){ + values.push(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName])); + } + } + + return values; + }; + + this.setupDefaultBrewValues_wholeTimeseries = function(geoJSON, values, forceProvidedIndicator, indicator){ + var indicatorTimeSeriesDatesArray; + if(forceProvidedIndicator) { + indicatorTimeSeriesDatesArray = indicator.applicableDates; + } else { + indicatorTimeSeriesDatesArray = kommonitorDataExchangeService.selectedIndicator.applicableDates; + } + + + for (const date of indicatorTimeSeriesDatesArray) { + var propertyName = __env.indicatorDatePrefix + date; + values = this.setupDefaultBrewValues_singleTimestamp(geoJSON, propertyName, values); + } + + return values; + }; + + /** + * Returns and array of color brewer instances for greater and lesser than measure of value colors + * + * [gtMeasureOfValueBrew, ltMeasureOfValueBrew] + */ + this.setupMeasureOfValueBrew = function (geoJSON, propertyName, colorCodeForGreaterThanValues, colorCodeForLesserThanValues, classifyMethod, measureOfValue) { + + /* + * Idea: Analyse the complete geoJSON property array for each feature and make conclusion about how to build the legend + + e.g. if there are only positive values then display only positive values within 5 categories - same for only negative values + + e.g. if there are equally many positive as negative values then display both using 3 categories each + + e.g. if there are way more positive than negative values, then display both with 2 (negative) and 4 (positive) classes + + --> implement special cases (0, 1 or 2 negative/positive values --> apply colors manually) + --> treat all other cases equally to measureOfValue + */ + + this.resetFeaturesPerColorObjects(); + + this.greaterThanValues = []; + this.lesserThanValues = []; + + if(kommonitorDataExchangeService.classifyUsingWholeTimeseries){ + this.setupMovBrewValues_wholeTimeseries(geoJSON, measureOfValue); + } + else{ + this.setupMovBrewValues_singleTimestamp(geoJSON, propertyName, measureOfValue); + } + + var gtMeasureOfValueBrew = this.setupGtMeasureOfValueBrew(this.greaterThanValues, colorCodeForGreaterThanValues, classifyMethod); + var ltMeasureOfValueBrew = this.setupLtMeasureOfValueBrew(this.lesserThanValues, colorCodeForLesserThanValues, classifyMethod); + + this.measureOfValueBrew = [gtMeasureOfValueBrew, ltMeasureOfValueBrew]; + return this.measureOfValueBrew; + }; + + this.setupMovBrewValues_singleTimestamp = function(geoJSON, propertyName, measureOfValue){ + for (var i = 0; i < geoJSON.features.length; i++) { + + if (kommonitorDataExchangeService.indicatorValueIsNoData(geoJSON.features[i].properties[propertyName])) + continue; + + if(kommonitorDataExchangeService.classifyZeroSeparately && (geoJSON.features[i].properties[propertyName] == 0 || geoJSON.features[i].properties[propertyName] == "0")){ + continue; + } + + // check if is outlier, then do not use within classification, as it will be marked on map with special color + if (geoJSON.features[i].properties[outlierPropertyName] && geoJSON.features[i].properties[outlierPropertyName] !== outlierPropertyValue_no && kommonitorDataExchangeService.useOutlierDetectionOnIndicator) { + continue; + } + + else if (kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName]) >= kommonitorDataExchangeService.getIndicatorValue_asNumber(measureOfValue)){ + if(! this.greaterThanValues.includes(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName]))){ + this.greaterThanValues.push(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName])); + } + } + else{ + if(! this.lesserThanValues.includes(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName]))){ + this.lesserThanValues.push(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName])); + } + } + } + }; + + this.setupMovBrewValues_wholeTimeseries = function(geoJSON, measureOfValue){ + var indicatorTimeSeriesDatesArray = kommonitorDataExchangeService.selectedIndicator.applicableDates; + + for (const date of indicatorTimeSeriesDatesArray) { + var propertyName = __env.indicatorDatePrefix + date; + this.setupMovBrewValues_singleTimestamp(geoJSON, propertyName, measureOfValue); + } + }; + + function setupClassyBrew_usingFeatureCount(valuesArray, colorCode, classifyMethod, maxNumberOfClasses){ + + var tempBrew = new classyBrew(); + var colorBrewerInstance = new classyBrew(); + + if (valuesArray.length >= 5) { + // pass array to our classyBrew series + tempBrew.setSeries(valuesArray); + // define number of classes + tempBrew.setNumClasses(maxNumberOfClasses); + // set color ramp code + tempBrew.setColorCode(colorCode); + // classify by passing in statistical method + // i.e. equal_interval, jenks, quantile + tempBrew.classify(classifyMethod); + + colorBrewerInstance.colors = tempBrew.getColors(); + colorBrewerInstance.breaks = tempBrew.getBreaks(); + } + + else if (valuesArray.length === 4) { + valuesArray.sort((a, b) => a - b); + + colorBrewerInstance.colors = tempBrew.colorSchemes[colorCode]['4']; + colorBrewerInstance.breaks = valuesArray; + } + + else if (valuesArray.length === 3) { + valuesArray.sort((a, b) => a - b); + + colorBrewerInstance.colors = tempBrew.colorSchemes[colorCode]['3']; + colorBrewerInstance.breaks = valuesArray; + } + else if (valuesArray.length === 2) { + valuesArray.sort((a, b) => a - b); + + colorBrewerInstance.colors = tempBrew.colorSchemes[colorCode]['3']; + colorBrewerInstance.breaks = valuesArray; + + colorBrewerInstance.colors.shift(); // remove first element of array + } + else if (valuesArray.length === 1) { + valuesArray.sort((a, b) => a - b); + + colorBrewerInstance.colors = tempBrew.colorSchemes[colorCode]['3']; + colorBrewerInstance.breaks = valuesArray; + + colorBrewerInstance.colors.shift(); // remove first element of array + colorBrewerInstance.colors.shift(); // remove first element of array + } + else { + // no positive values + colorBrewerInstance = undefined; + } + + // round values + if (colorBrewerInstance && colorBrewerInstance.breaks){ + for (let index = 0; index < colorBrewerInstance.breaks.length; index++) { + colorBrewerInstance.breaks[index] = kommonitorDataExchangeService.getIndicatorValue_asNumber(colorBrewerInstance.breaks[index]); + } + } + + return colorBrewerInstance; + } + + this.setupGtMeasureOfValueBrew = function (greaterThanValues, colorCodeForGreaterThanValues, classifyMethod) { + + return setupClassyBrew_usingFeatureCount(greaterThanValues, colorCodeForGreaterThanValues, classifyMethod, 3); + + }; + + this.setupLtMeasureOfValueBrew = function (lesserThanValues, colorCodeForLesserThanValues, classifyMethod) { + + var brew = setupClassyBrew_usingFeatureCount(lesserThanValues, colorCodeForLesserThanValues, classifyMethod, 3); + if(brew && brew.colors && brew.colors.length > 1){ + brew.colors = brew.colors.reverse(); + } + return brew; + }; + + /** + * Returns and array of color brewer instances for dynamic increase and decrease colors + * + * [dynamicIncreaseBrew, dynamicDecreaseBrew] + */ + this.setupDynamicIndicatorBrew = function (geoJSON, propertyName, colorCodeForPositiveValues, colorCodeForNegativeValues, classifyMethod) { + + /* + * Idea: Analyse the complete geoJSON property array for each feature and make conclusion about how to build the legend + + e.g. if there are only positive values then display only positive values within 5 categories - same for only negative values + + e.g. if there are equally many positive as negative values then display both using 3 categories each + + e.g. if there are way more positive than negative values, then display both with 2 (negative) and 4 (positive) classes + + --> implement special cases (0, 1 or 2 negative/positive values --> apply colors manually) + --> treat all other cases equally to measureOfValue + */ + + this.resetFeaturesPerColorObjects(); + + this.positiveValues = []; + this.negativeValues = []; + + if(kommonitorDataExchangeService.classifyUsingWholeTimeseries){ + this.setupDynamicBrewValues_wholeTimeseries(geoJSON); + } + else{ + this.setupDynamicBrewValues_singleTimestamp(geoJSON, propertyName); + } + + var dynamicIncreaseBrew = setupDynamicIncreaseBrew(this.positiveValues, colorCodeForPositiveValues, classifyMethod); + var dynamicDecreaseBrew = setupDynamicDecreaseBrew(this.negativeValues, colorCodeForNegativeValues, classifyMethod); + + this.dynamicBrew = [dynamicIncreaseBrew, dynamicDecreaseBrew]; + return this.dynamicBrew; + }; + + this.setupDynamicBrewValues_wholeTimeseries = function(geoJSON){ + var indicatorTimeSeriesDatesArray = kommonitorDataExchangeService.selectedIndicator.applicableDates; + + for (const date of indicatorTimeSeriesDatesArray) { + var propertyName = __env.indicatorDatePrefix + date; + this.setupDynamicBrewValues_singleTimestamp(geoJSON, propertyName); + } + }; + + this.setupDynamicBrewValues_singleTimestamp = function(geoJSON, propertyName){ + for (var i = 0; i < geoJSON.features.length; i++) { + if (kommonitorDataExchangeService.indicatorValueIsNoData(geoJSON.features[i].properties[propertyName])) + continue; + + if(kommonitorDataExchangeService.classifyZeroSeparately && (geoJSON.features[i].properties[propertyName] == 0 || geoJSON.features[i].properties[propertyName] == "0")){ + continue; + } + + // check if is outlier, then do not use within classification, as it will be marked on map with special color + if (geoJSON.features[i].properties[outlierPropertyName] && geoJSON.features[i].properties[outlierPropertyName] !== outlierPropertyValue_no && kommonitorDataExchangeService.useOutlierDetectionOnIndicator) { + continue; + } + + else if (kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName]) >= 0){ + if(! this.positiveValues.includes(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName]))){ + this.positiveValues.push(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName])); + } + } + else if (kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName]) < 0){ + if(! this.negativeValues.includes(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName]))){ + this.negativeValues.push(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName])); + } + } + } + }; + + function setupDynamicIncreaseBrew(positiveValues, colorCodeForPositiveValues, classifyMethod) { + return setupClassyBrew_usingFeatureCount(positiveValues, colorCodeForPositiveValues, classifyMethod, 3); + } + + function setupDynamicDecreaseBrew(negativeValues, colorCodeForNegativeValues, classifyMethod) { + var brew = setupClassyBrew_usingFeatureCount(negativeValues, colorCodeForNegativeValues, classifyMethod, 3); + if(brew && brew.colors && brew.colors.length > 1){ + brew.colors = brew.colors.reverse(); + } + return brew; + } + + this.styleNoData = function(feature) { + this.featuresPerNoData ++; + return this.noDataStyle; + }; + + this.styleOutlier = function(feature) { + if ((feature.properties[outlierPropertyName] === outlierPropertyValue_low_soft) || (feature.properties[outlierPropertyName] === outlierPropertyValue_low_extreme)) { + + this.featuresPerOutlierLow ++; + return this.outlierStyle_low; + } + else { + + this.featuresPerOutlierHigh ++; + return this.outlierStyle_high; + } + }; + + this.getOpacity = function(opacity){ + + return defaultFillOpacity; + }; + + this.setOpacity = function(opacity){ + + opacity = Number(opacity); + this.indicatorTransparency = Number((1 - opacity).toFixed(numberOfDecimals)); + this.currentIndicatorOpacity = opacity; + + defaultFillOpacity = opacity; + defaultFillOpacityForOutliers_low = opacity; + defaultFillOpacityForOutliers_high = opacity; + defaultFillOpacityForZeroFeatures = opacity; + defaultFillOpacityForNoDataValues = opacity; + defaultFillOpacityForFilteredFeatures = opacity; + + $timeout(function(){ + $rootScope.$apply(); + }); + }; + + // style function to return + this.styleDefault = function(feature, defaultBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, propertyName, useTransparencyOnIndicator, datasetContainsNegativeValues) { + + // check if feature is NoData + if (kommonitorDataExchangeService.indicatorValueIsNoData(feature.properties[propertyName])) { + return this.styleNoData(feature); + } + + // check if feature is outlier + if ((feature.properties[outlierPropertyName] !== outlierPropertyValue_no) && kommonitorDataExchangeService.useOutlierDetectionOnIndicator) { + return this.styleOutlier(feature); + } + + var fillOpacity = 1; + if (useTransparencyOnIndicator) { + fillOpacity = defaultFillOpacity; + } + + var fillColor; + if (kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[propertyName] == 0 || feature.properties[propertyName] == "0")) { + fillColor = this.getFillColorForZero(); + if (useTransparencyOnIndicator) { + fillOpacity = defaultFillOpacityForZeroFeatures; + } + + } + else { + if (datasetContainsNegativeValues) { + if (kommonitorDataExchangeService.getIndicatorValue_asNumber(feature.properties[propertyName]) >= 0) { + if (kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[propertyName] == 0 || feature.properties[propertyName] == "0")) { + fillColor = this.getFillColorForZero(); + if (useTransparencyOnIndicator) { + fillOpacity = defaultFillOpacityForZeroFeatures; + } + } + else { + fillColor = this.findColorInRange(feature, propertyName, dynamicIncreaseBrew); + } + + return { + weight: 1, + opacity: 1, + color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColor, + dashArray: '', + fillOpacity: fillOpacity, + fillColor: fillColor, + fillPattern: undefined + }; + } + else { + + if (kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[propertyName] == 0 || feature.properties[propertyName] == "0")) { + fillColor = this.getFillColorForZero(); + if (useTransparencyOnIndicator) { + fillOpacity = defaultFillOpacityForZeroFeatures; + } + } + else { + // invert colors, so that lowest values will become strong colored! + fillColor = this.findColorInRange(feature, propertyName, dynamicDecreaseBrew); + } + + return { + weight: 1, + opacity: 1, + color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColor, + dashArray: '', + fillOpacity: fillOpacity, + fillColor: fillColor, + fillPattern: undefined + }; + } + } + else { + fillColor = this.findColorInRange(feature, propertyName, defaultBrew); + } + } + + return { + weight: 1, + opacity: 1, + color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColor, + dashArray: '', + fillOpacity: fillOpacity, + fillColor: fillColor, + fillPattern: undefined + }; + }; + + this.findColorInRange = function(feature, propertyName, colorBrewInstance){ + var color; + + for (var index = 0; index < colorBrewInstance.breaks.length; index++) { + if (kommonitorDataExchangeService.getIndicatorValue_asNumber(feature.properties[propertyName]) == kommonitorDataExchangeService.getIndicatorValue_asNumber(colorBrewInstance.breaks[index])) { + if (index < colorBrewInstance.breaks.length - 1) { + // min value + color = colorBrewInstance.colors[index]; + break; + } + else { + //max value + if (colorBrewInstance.colors[index]) { + color = colorBrewInstance.colors[index]; + } + else { + color = colorBrewInstance.colors[index - 1]; + } + break; + } + } + else { + if (kommonitorDataExchangeService.getIndicatorValue_asNumber(feature.properties[propertyName]) < kommonitorDataExchangeService.getIndicatorValue_asNumber(colorBrewInstance.breaks[index + 1])) { + color = colorBrewInstance.colors[index]; + break; + } + } + } + + this.incrementFeaturesPerColor(color); + + return color; + }; + + // this.findColorInRange_invertedColorGradient = function (feature, propertyName, colorBrewInstance){ + // var color; + + // for (var k = 0; k < colorBrewInstance.breaks.length; k++) { + // if (kommonitorDataExchangeService.getIndicatorValue_asNumber(feature.properties[propertyName]) == kommonitorDataExchangeService.getIndicatorValue_asNumber(colorBrewInstance.breaks[k])) { + // if (k < colorBrewInstance.breaks.length - 1) { + // // min value + // color = colorBrewInstance.colors[colorBrewInstance.colors.length - k - 1]; + // break; + // } + // else { + // //max value + // if (colorBrewInstance.colors[colorBrewInstance.colors.length - k]) { + // color = colorBrewInstance.colors[colorBrewInstance.colors.length - k]; + // } + // else { + // color = colorBrewInstance.colors[colorBrewInstance.colors.length - k - 1]; + // } + // break; + // } + // } + // else { + // if (kommonitorDataExchangeService.getIndicatorValue_asNumber(feature.properties[propertyName]) < kommonitorDataExchangeService.getIndicatorValue_asNumber(colorBrewInstance.breaks[k + 1])) { + // color = colorBrewInstance.colors[colorBrewInstance.colors.length - k - 1]; + // break; + // } + // } + // } + + // this.incrementFeaturesPerColor(color); + + // return color; + // }; + + this.styleMeasureOfValue = function(feature, gtMeasureOfValueBrew, ltMeasureOfValueBrew, propertyName, useTransparencyOnIndicator) { + + + // check if feature is NoData + if (kommonitorDataExchangeService.indicatorValueIsNoData(feature.properties[propertyName])) { + return this.styleNoData(feature); + } + + // check if feature is outlier + if ((feature.properties[outlierPropertyName] !== outlierPropertyValue_no) && kommonitorDataExchangeService.useOutlierDetectionOnIndicator) { + return this.styleOutlier(feature); + } + + var fillOpacity = 1; + if (useTransparencyOnIndicator) { + fillOpacity = defaultFillOpacity; + } + + var fillColor; + if (kommonitorDataExchangeService.getIndicatorValue_asNumber(feature.properties[propertyName]) >= kommonitorDataExchangeService.measureOfValue) { + + if (kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[propertyName] == 0 || feature.properties[propertyName] == "0")) { + fillColor = this.getFillColorForZero(); + if (useTransparencyOnIndicator) { + fillOpacity = defaultFillOpacityForZeroFeatures; + } + } + else { + + fillColor = this.findColorInRange(feature, propertyName, gtMeasureOfValueBrew); + } + + return { + weight: 1, + opacity: 1, + color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColor, + dashArray: '', + fillOpacity: fillOpacity, + fillColor: fillColor, + fillPattern: undefined + }; + } + else { + if (kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[propertyName] == 0 || feature.properties[propertyName] == "0")) { + fillColor = this.getFillColorForZero(); + if (useTransparencyOnIndicator) { + fillOpacity = defaultFillOpacityForZeroFeatures; + } + } + else { + // invert colors, so that lowest values will become strong colored! + fillColor = this.findColorInRange(feature, propertyName, ltMeasureOfValueBrew); + } + + return { + weight: 1, + opacity: 1, + color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColor, + dashArray: '', + fillOpacity: fillOpacity, + fillColor: fillColor, + fillPattern: undefined + }; + } + + }; + + this.styleDynamicIndicator = function(feature, dynamicIncreaseBrew, dynamicDecreaseBrew, propertyName, useTransparencyOnIndicator) { + + + + // check if feature is NoData + if (kommonitorDataExchangeService.indicatorValueIsNoData(feature.properties[propertyName])) { + return this.styleNoData(feature); + } + + // check if feature is outlier + if ((feature.properties[outlierPropertyName] !== outlierPropertyValue_no) && kommonitorDataExchangeService.useOutlierDetectionOnIndicator) { + return this.styleOutlier(feature); + } + + var fillOpacity = 1; + if (useTransparencyOnIndicator) { + fillOpacity = defaultFillOpacity; + } + + var fillColor; + if (kommonitorDataExchangeService.getIndicatorValue_asNumber(feature.properties[propertyName]) >= 0) { + + if (kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[propertyName] == 0 || feature.properties[propertyName] == "0")) { + fillColor = this.getFillColorForZero(); + if (useTransparencyOnIndicator) { + fillOpacity = defaultFillOpacityForZeroFeatures; + } + } + else { + fillColor = this.findColorInRange(feature, propertyName, dynamicIncreaseBrew); + } + + return { + weight: 1, + opacity: 1, + color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColor, + dashArray: '', + fillOpacity: fillOpacity, + fillColor: fillColor, + fillPattern: undefined + }; + } + else { + if (kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[propertyName] == 0 || feature.properties[propertyName] == "0")) { + fillColor = this.getFillColorForZero(); + if (useTransparencyOnIndicator) { + fillOpacity = defaultFillOpacityForZeroFeatures; + } + } + else { + // invert colors, so that lowest values will become strong colored! + fillColor = this.findColorInRange(feature, propertyName, dynamicDecreaseBrew); + } + + return { + weight: 1, + opacity: 1, + color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColor, + dashArray: '', + fillOpacity: fillOpacity, + fillColor: fillColor, + fillPattern: undefined + }; + } + + }; + + }]); diff --git a/package-lock.json b/package-lock.json index 16e549e45..97c0bd3cb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -72,6 +72,15 @@ "@babel/cli": "^7.17.3", "@babel/core": "^7.17.5", "@release-it/keep-a-changelog": "^3.1.0", + "@types/angular": "^1.8.5", + "@types/angular-animate": "^1.5.11", + "@types/angular-aria": "^1.7.2", + "@types/angular-cookies": "^1.8.1", + "@types/angular-mocks": "^1.7.1", + "@types/angular-resource": "^1.5.17", + "@types/angular-route": "^1.7.3", + "@types/angular-sanitize": "^1.8.1", + "@types/jasmine": "^4.3.5", "babel-core": "^6.26.0", "babel-plugin-angularjs-annotate": "^0.10.0", "babel-plugin-transform-es2015-destructuring": "^6.23.0", @@ -99,6 +108,7 @@ "http-server": "^14.1.0", "license-checker": "^25.0.1", "release-it": "^15.4.1", + "typescript": "^5.1.6", "webpack": "^5.1.0", "webpack-cli": "^4.5.0" } @@ -5526,6 +5536,75 @@ "url": "https://opencollective.com/turf" } }, + "node_modules/@types/angular": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@types/angular/-/angular-1.8.5.tgz", + "integrity": "sha512-tifGGLxuKOEl7Z1BoAkZKpu+eEyfZ/0Ugm5imM+D1Vj+QzuhPQS0icI34laN3CLbksyfZQPGTQa0i+jjZdpiLw==", + "dev": true + }, + "node_modules/@types/angular-animate": { + "version": "1.5.11", + "resolved": "https://registry.npmjs.org/@types/angular-animate/-/angular-animate-1.5.11.tgz", + "integrity": "sha512-JJL2BM9pTLz00oqXh09knxHOjKLBbMyb9k9/DNWWvQome42iMGD+R9+iKaFX6nnvmlMnhoO1wOGWvnOFHhkujg==", + "dev": true, + "dependencies": { + "@types/angular": "*" + } + }, + "node_modules/@types/angular-aria": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@types/angular-aria/-/angular-aria-1.7.2.tgz", + "integrity": "sha512-kO0ZqfOIen/SSftPdqjLFKUF/7YMRsM5AJg/pjV/Gdl+cvPwCdriTF94G9o6i4alAfw7LG5KlmCQr2d/lmuSgw==", + "dev": true, + "dependencies": { + "@types/angular": "*" + } + }, + "node_modules/@types/angular-cookies": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@types/angular-cookies/-/angular-cookies-1.8.1.tgz", + "integrity": "sha512-wcc/YtJTSRQNFrbXMj9nW8jLKWAkY1j0NkVKtbKBqhrP4Oz0tT0/Gug/Gjks87nXERfT/+fBnLWQB+RFiceKJQ==", + "dev": true, + "dependencies": { + "@types/angular": "*" + } + }, + "node_modules/@types/angular-mocks": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@types/angular-mocks/-/angular-mocks-1.7.1.tgz", + "integrity": "sha512-44kaQL8sMGUIDV76zbJ3MX6aqPng7Wmfz91uds+WcNQFHTdSu6KDZNIypIZVAdrWnJfqrfL5VysaCejTW3JVIw==", + "dev": true, + "dependencies": { + "@types/angular": "*" + } + }, + "node_modules/@types/angular-resource": { + "version": "1.5.17", + "resolved": "https://registry.npmjs.org/@types/angular-resource/-/angular-resource-1.5.17.tgz", + "integrity": "sha512-HPyxurb0qxkytQY/zwunMrdx/Hlb+VZ1Neiq3tL1J+HtdVvA1AgNcGTY5aonH3uqbLnKrBASdRbfvtAxT3GCXg==", + "dev": true, + "dependencies": { + "@types/angular": "*" + } + }, + "node_modules/@types/angular-route": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/@types/angular-route/-/angular-route-1.7.3.tgz", + "integrity": "sha512-ej7nZnKUNy3w4zXPfHa28lEhD/1gfEct/BfXvenS+kXUyy7Fbang5qFyEY0pNjAdKMhXoV42qTY+v1v6envLUA==", + "dev": true, + "dependencies": { + "@types/angular": "*" + } + }, + "node_modules/@types/angular-sanitize": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@types/angular-sanitize/-/angular-sanitize-1.8.1.tgz", + "integrity": "sha512-tQ6kyi7Q5iWv5k3yFmpqzTaBe1ZiCF5+rlGgmyLO/4ltu2ELXMPDnq38KACwNnHVWuLJJXXn2V+TfMFwUvF5qw==", + "dev": true, + "dependencies": { + "@types/angular": "*" + } + }, "node_modules/@types/cacheable-request": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.2.tgz", @@ -5575,6 +5654,12 @@ "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==", "dev": true }, + "node_modules/@types/jasmine": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-4.3.5.tgz", + "integrity": "sha512-9YHUdvuNDDRJYXZwHqSsO72Ok0vmqoJbNn73ttyITQp/VA60SarnZ+MPLD37rJAhVoKp+9BWOvJP5tHIRfZylQ==", + "dev": true + }, "node_modules/@types/json-schema": { "version": "7.0.12", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz", @@ -19800,6 +19885,19 @@ "rimraf": "bin.js" } }, + "node_modules/tap/node_modules/typescript": { + "version": "3.9.10", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", + "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, "node_modules/tapable": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", @@ -20505,16 +20603,16 @@ } }, "node_modules/typescript": { - "version": "3.9.9", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.9.tgz", - "integrity": "sha512-kdMjTiekY+z/ubJCATUPlRDl39vXYiMV9iyeMuEuXZh2we6zz80uovNN2WlAxmmdE/Z/YQe+EbOEXB5RHEED3w==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", + "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, "node_modules/uglify-js": { diff --git a/package.json b/package.json index bfa45e6fc..5a7d2ccf5 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,15 @@ "@babel/cli": "^7.17.3", "@babel/core": "^7.17.5", "@release-it/keep-a-changelog": "^3.1.0", + "@types/angular": "^1.8.5", + "@types/angular-animate": "^1.5.11", + "@types/angular-aria": "^1.7.2", + "@types/angular-cookies": "^1.8.1", + "@types/angular-mocks": "^1.7.1", + "@types/angular-resource": "^1.5.17", + "@types/angular-route": "^1.7.3", + "@types/angular-sanitize": "^1.8.1", + "@types/jasmine": "^4.3.5", "babel-core": "^6.26.0", "babel-plugin-angularjs-annotate": "^0.10.0", "babel-plugin-transform-es2015-destructuring": "^6.23.0", @@ -39,13 +48,16 @@ "http-server": "^14.1.0", "license-checker": "^25.0.1", "release-it": "^15.4.1", + "typescript": "^5.1.6", "webpack": "^5.1.0", "webpack-cli": "^4.5.0" }, "scripts": { "build": "npm install --force && webpack && grunt", "start": "http-server -p 8000 -c-1 ./app --cors --gzip", - "release": "release-it" + "release": "release-it", + "tsc": "tsc", + "tsc:w": "tsc -w" }, "dependencies": { "@fortawesome/fontawesome-free": "^6.1.1", diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 000000000..1d41f2724 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,33 @@ +/* To learn more about this file see: https://angular.io/config/tsconfig. */ +{ + "compileOnSave": false, + "compilerOptions": { + "baseUrl": "./", + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "sourceMap": true, + "declaration": false, + "downlevelIteration": true, + "experimentalDecorators": true, + "moduleResolution": "node", + "importHelpers": true, + "target": "ES2022", + "module": "ES2022", + "useDefineForClassFields": false, + "noImplicitAny": false, + "lib": [ + "ES2022", + "dom" + ] + }, + "angularCompilerOptions": { + "enableI18nLegacyMessageIdFormat": false, + "strictInjectionParameters": true, + "strictInputAccessModifiers": true, + "strictTemplates": true + } + } \ No newline at end of file From e73905c9401790bc64d8cbd5247d8201dff7b8fd Mon Sep 17 00:00:00 2001 From: cDanowski Date: Mon, 3 Jul 2023 10:31:56 +0200 Subject: [PATCH 2/8] introduce Angular and required config files for bootstrapping hybrid application and run via ng serve - no code migrated yet --- .gitignore | 1 + angular.json | 101 + app/{app.ts => app.ajs.js} | 0 app/app.ajs.ts | 526 ++ app/app.js | 436 -- app/app.js.map | 1 - app/app.module.ts | 15 + app/index.html | 7 +- app/main.ts | 4 + package-lock.json | 11957 +++++++++++++++++++++++++++++------ package.json | 23 +- tsconfig.app.json | 15 + tsconfig.json | 2 +- 13 files changed, 10709 insertions(+), 2379 deletions(-) create mode 100644 angular.json rename app/{app.ts => app.ajs.js} (100%) create mode 100644 app/app.ajs.ts delete mode 100644 app/app.js delete mode 100644 app/app.js.map create mode 100644 app/app.module.ts create mode 100644 app/main.ts create mode 100644 tsconfig.app.json diff --git a/.gitignore b/.gitignore index 11203de33..47f80db59 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ tmp .idea build dist +.angular \ No newline at end of file diff --git a/angular.json b/angular.json new file mode 100644 index 000000000..b6483a046 --- /dev/null +++ b/angular.json @@ -0,0 +1,101 @@ +{ + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "version": 1, + "newProjectRoot": "projects", + "projects": { + "kommonitor-client": { + "projectType": "application", + "schematics": {}, + "root": "app", + "sourceRoot": "app", + "prefix": "app", + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:browser", + "options": { + "outputPath": "dist/kommonitor-client", + "index": "app/index.html", + "main": "app/main.ts", + "polyfills": [ + "zone.js" + ], + "tsConfig": "tsconfig.app.json", + "assets": [ + "app/" + ], + "styles": [ + "app/app.css" + ], + "scripts": [] + }, + "configurations": { + "production": { + "budgets": [ + { + "type": "initial", + "maximumWarning": "500kb", + "maximumError": "1mb" + }, + { + "type": "anyComponentStyle", + "maximumWarning": "2kb", + "maximumError": "4kb" + } + ], + "outputHashing": "all" + }, + "development": { + "buildOptimizer": false, + "optimization": false, + "vendorChunk": true, + "extractLicenses": false, + "sourceMap": true, + "namedChunks": true + } + }, + "defaultConfiguration": "production" + }, + "serve": { + "builder": "@angular-devkit/build-angular:dev-server", + "options": { + "browserTarget": "latest-angular:build", + "port": 8000 + }, + "configurations": { + "production": { + "browserTarget": "kommonitor-client:build:production" + }, + "development": { + "browserTarget": "kommonitor-client:build:development" + } + }, + "defaultConfiguration": "development" + }, + "extract-i18n": { + "builder": "@angular-devkit/build-angular:extract-i18n", + "options": { + "browserTarget": "kommonitor-client:build" + } + }, + "test": { + "builder": "@angular-devkit/build-angular:karma", + "options": { + "polyfills": [ + "zone.js", + "zone.js/testing" + ], + "tsConfig": "tsconfig.spec.json", + "assets": [ + "app/favicon.ico" + ], + "styles": [ + "app/app.css" + ], + "scripts": [] + } + } + } + } + } + } + \ No newline at end of file diff --git a/app/app.ts b/app/app.ajs.js similarity index 100% rename from app/app.ts rename to app/app.ajs.js diff --git a/app/app.ajs.ts b/app/app.ajs.ts new file mode 100644 index 000000000..caf0bf986 --- /dev/null +++ b/app/app.ajs.ts @@ -0,0 +1,526 @@ +if (/MSIE 9/i.test(navigator.userAgent) || /MSIE 10/i.test(navigator.userAgent) || /rv:11.0/i.test(navigator.userAgent)) { + // This is internet explorer 9, 10 or 11 + window.alert('Internet Explorer erkannt. Für eine optimale Nutzung von KomMonitor nutzen Sie nach Möglichkeit die Browser Firefox oder Chrome.'); +} + + +if (/Edge\/\d./i.test(navigator.userAgent)){ + // This is Microsoft Edge + + window.alert('Microsoft Edge erkannt. Für eine optimale Nutzung von KomMonitor nutzen Sie nach Möglichkeit die Browser Firefox oder Chrome.'); +} + +var env = {}; + +// for jspdf insert backwards compatibility according to https://github.com/parallax/jsPDF/releases/tag/v2.0.0 +window.jsPDF = window.jspdf.jsPDF; + +// Declare app level module which depends on views, and components +var appModule = angular.module('kommonitorClient', [ 'ngRoute', 'kommonitorUserInterface', 'kommonitorAdmin']); + +var controlsServiceName = 'ControlsConfigService'; +var auth = {}; + + +/* + LOAD CONFIG FILES FROM CONFIG STORAGE SERVER +*/ +function ajaxCall_keycloakConfig(configStorageServerConfig) { + console.log("try to fetch keycloak config file"); + return $.ajax({ + url: configStorageServerConfig.targetUrlToConfigStorageServer_keycloakConfig, + success: function(result){ + console.log("keycloak config file fetched"); + window.__env.keycloakConfig = result; + return; + }, + error: function(XMLHttpRequest, textStatus, errorThrown) { + console.log("Use keycloak.json local backup default values"); + } + }); +} + +function ajaxCall_appConfig(configStorageServerConfig) { + console.log("try to fetch app config file"); + return $.ajax({ + url: configStorageServerConfig.targetUrlToConfigStorageServer_appConfig, + success: function(result){ + console.log("app config file fetched"); + window.__env.appConfig = result; + return; + }, + error: function(XMLHttpRequest, textStatus, errorThrown) { + console.log("Use env.js local backup default values"); + } + }); +} + +function ajaxCall_controlsConfig(configStorageServerConfig) { + console.log("try to fetch controls config file"); + return $.ajax({ + url: configStorageServerConfig.targetUrlToConfigStorageServer_controlsConfig, + success: function(result){ + console.log("controls config file fetched"); + window.__env.controlsConfig = result; + return; + }, + error: function(XMLHttpRequest, textStatus, errorThrown) { + console.log("Use controls-config.json local backup default values that has no widget restrictions."); + } + }); +} + + +/* + LOAD CONFIG FILES FROM LOCAL BACKUP FILES +*/ +function ajaxCall_keycloakConfig_localBackup(configStorageServerConfig) { + return $.ajax({ + url: "./config/keycloak_backup.json", + success: function(result){ + console.log("local keycloak config file with default values fetched"); + window.__env.keycloakConfig = result; + return; + }, + error: function(XMLHttpRequest, textStatus, errorThrown) { + console.log("Error parsing local keycloak.json backup file"); + } +}); +} + +function ajaxCall_controlsConfig_localBackup(configStorageServerConfig) { + return $.ajax({ + url: "./config/controls-config_backup.json", + success: function(result){ + console.log("local controls-config file with default values fetched"); + window.__env.controlsConfig = result; + return; + }, + error: function(XMLHttpRequest, textStatus, errorThrown) { + console.log("Error parsing local controlsConfig.json backup file"); + } +}); +} + + +function loadAppConfigScriptDynamically(scriptUrl){ + return new Promise(function (res, rej) { + let script = document.createElement('script'); + script.src = scriptUrl; + script.type = 'text/javascript'; + script.onError = rej; + script.async = true; + script.onload = res; + script.addEventListener('error',rej); + script.addEventListener('load',res); + document.head.appendChild(script); + }); +} + +function ajaxCall_configServerFile() { + return $.ajax({ + url: "./config/config-storage-server.json", + success: function(result){ + window.__env = window.__env || {}; + window.__env.configStorageServerConfig = result; + + // inject script tag dynamically to DOM to load ENV variables + console.log("dynamically load env.js"); + const event = loadAppConfigScriptDynamically(window.__env.configStorageServerConfig.targetUrlToConfigStorageServer_appConfig) + .then(() => { console.log("loaded"); }) + .catch(() => { + console.log("Error while loading app config from client config storage server. Will use defaults instead"); + alert("Error while loading app config from client config storage server. Will use defaults instead."); + }); + + + return $.when(ajaxCall_keycloakConfig(window.__env.configStorageServerConfig), ajaxCall_controlsConfig(window.__env.configStorageServerConfig), ajaxCall_appConfig(window.__env.configStorageServerConfig)).then(function(ajax1Results,ajax2Results, ajax3Results){ + console.log("all configs have been loaded"); + + initAngularComponents(); + + bootstrapApplication(); + + return; + }, function(){ + // on fail + console.log("all configs have been loaded - at least some from local backup values. See console log for details"); + + initAngularComponents(); + + bootstrapApplication(); + + return; + }); + } + }); +} + +var loadConfigsThenApp = function(){ + + console.log("start loading required config files"); + + $.when(ajaxCall_keycloakConfig_localBackup(window.__env.configStorageServerConfig), ajaxCall_controlsConfig_localBackup(window.__env.configStorageServerConfig)).then(function(ajax1Results,ajax2Results){ + console.log("local backup configs have been loaded in case config server is not reachable."); + + ajaxCall_configServerFile(); + + }, function(){ + // on fail + console.log("all configs have been loaded - at least some from local backup values. See console log for details"); + + ajaxCall_configServerFile(); + }); + +}; + +function initAngularComponents(){ + console.log("Start to initialize required AngularJS components"); + + // Import variables if present (from env.js) + if(window){ + Object.assign(env, window.__env); + } + + // Register environment in AngularJS as constant + appModule.constant('__env', env); + + // MathJx directive + appModule.directive("mathjaxBind", function () { + return { + restrict: "EA", + controller: [ + "$scope", + "$element", + "$attrs", + function ($scope, $element, $attrs) { + $scope.$watch($attrs.mathjaxBind, function (texExpression) { + $element.html(texExpression); + // only if texExpression contains the special character '$' which is used to mark tex code + // then call MathJax function + if(texExpression && texExpression.includes("$")){ + MathJax.typesetPromise([$element[0]]); + } + }); + }, + ], + }; + }); + + // custom unique filter + appModule.filter('unique', function() { + return function(collection, primaryKey) { //no need for secondary key + var output = [], + keys = []; + var splitKeys = primaryKey.split('.'); //split by period + + + angular.forEach(collection, function(item) { + var key = {}; + angular.copy(item, key); + for(var i=0; i', + resolve: { + controlsServiceName: function(ControlsConfigService){ + return ControlsConfigService.promise; + } + } + }). + when('/administration', { + template: '', + resolve: { + 'auth': function(Auth, $q, $location) { + if(window.__env.enableKeycloakSecurity){ + if (Auth.keycloak.authenticated) { + if(Auth.keycloak.tokenParsed + && Auth.keycloak.tokenParsed.realm_access + && Auth.keycloak.tokenParsed.realm_access.roles + && Auth.keycloak.tokenParsed.realm_access.roles.some(role => role.endsWith("-creator") || role.endsWith("-publisher") || role.endsWith("-editor"))){ + Auth.keycloak.showAdminView = true; + } + if (Auth.keycloak.showAdminView) { + return true; + } else { + return $q.reject('Not Authenticated'); + } + } + else { + Auth.keycloak.login({ + redirectUri: $location.absUrl() + }); + } + } + else{ + + } + + } + } + }). + otherwise('/'); + } + ]) + .run( function($rootScope, $location, Auth) { + // register listener to watch route changes + $rootScope.$on( "$routeChangeError", function(event, next, current) { + $location.path( "/" ); + }); + }); + + + if (!env.enableDebug) { + if(window){ + window.console.log=function(){}; + } + } + + if(window.__env.enableKeycloakSecurity){ + appModule.factory('authInterceptor', ['$q', 'Auth', function ($q, Auth) { + return { + request: function (config) { + var deferred = $q.defer(); + if (Auth.keycloak.token && urlRequiresKeycloakAuthHeader(config.url)) { + Auth.keycloak.updateToken(5).then(function () { + config.headers = config.headers || {}; + config.headers.Authorization = 'Bearer ' + Auth.keycloak.token; + deferred.resolve(config); + }).catch(function () { + deferred.reject('Failed to refresh token'); + console.error('Failed to refresh token. Will redirect to Login screen'); + auth.keycloak.login(); + }); + return deferred.promise; + } else { + return config; + } + } + }; + }]); + + appModule.config(['$httpProvider', function ($httpProvider) { + $httpProvider.interceptors.push('authInterceptor'); + }]); + } + + if(env.encryption.enabled){ + appModule.factory('encryptionInterceptor', ['$q', function ($q) { + return { + response: function (response) { + // if encrypted, then will look like: + // {encryptedData: encryptedData} + // using AES-CBC + + if(response.data.encryptedData){ + try { + var encryptedString = response.data.encryptedData; + + var decryptedJson = decryptAesCBC(encryptedString); + + response.data = decryptedJson; + + return response; + } catch (error) { + console.error(error); + return response; + } + } + + return response; + }, + }; + }]); + + appModule.config(['$httpProvider', function ($httpProvider) { + $httpProvider.interceptors.push('encryptionInterceptor'); + }]); + } + +} + +function bootstrapApplication(){ + + if(window.__env.enableKeycloakSecurity){ + var keycloakAdapter = new Keycloak(window.__env.configStorageServerConfig.targetUrlToConfigStorageServer_keycloakConfig); + + // https://www.keycloak.org/docs/latest/securing_apps/#session-status-iframe + // https://www.keycloak.org/docs/latest/securing_apps/#_modern_browsers + + keycloakAdapter.init({ + onLoad: 'check-sso', + checkLoginIframe: false, + silentCheckSsoFallback: false + }).then(function (authenticated) { + console.log(authenticated ? 'User is authenticated!' : 'User is not authenticated!'); + auth.keycloak = keycloakAdapter; + appModule.factory('Auth', function () { + return auth; + }); + try { + console.debug('Trying to bootstrap application.'); + angular.bootstrap(document, [appModule.name]); + } + catch (e) { + console.error('Application bootstrapping failed.'); + console.error(e); + } + }).catch(function () { + console.log('Failed to initialize authentication adapter. Will try to bootstrap application without keycloak security'); + alert('Failed to initialize keycloak authentication adapter. Will try to bootstrap application without keycloak security'); + window.__env.enableKeycloakSecurity = false; + bootstrapApplication(); + }); + } + else{ + var keycloakAdapter = new Keycloak(keycloakConfig_forDirectInit); + auth.keycloak = keycloakAdapter; + appModule.factory('Auth', function () { + return auth; + }); + + try { + console.debug('Trying to bootstrap application.'); + angular.bootstrap(document, [appModule.name]); + } + catch (e) { + console.error('Application bootstrapping failed.'); + console.error(e); + } + } + +} + +angular.element(document).ready(function ($http) { + + // load configs before doing anything else + loadConfigsThenApp(); +}); + +var urlRequiresKeycloakAuthHeader = function(url){ + // /admin/ is used to make admin requests against keycloak + if (url.includes("/admin/")){ + return false; + } + // ORS isochrones and directions requests + if (url.includes("isochrones")){ + return false; + } + if (url.includes("routes")){ + return false; + } + + // for KomMonitor public requests we do not need any authentication + if (url.includes("/public/")){ + return false; + } + + return true; +}; + + + +var isBase64 = function(str) { + var notBase64 = /[^A-Z0-9+\/=]/i; + const isString = (typeof str === 'string' || str instanceof String); + + if (!isString) { + let invalidType; + if (str === null) { + invalidType = 'null'; + } else { + invalidType = typeof str; + if (invalidType === 'object' && str.constructor && str.constructor.hasOwnProperty('name')) { + invalidType = str.constructor.name; + } else { + invalidType = `a ${invalidType}`; + } + } + throw new TypeError(`Expected string but received ${invalidType}.`); + } + + const len = str.length; + if (!len || len % 4 !== 0 || notBase64.test(str)) { + return false; + } + const firstPaddingChar = str.indexOf('='); + return firstPaddingChar === -1 || + firstPaddingChar === len - 1 || + (firstPaddingChar === len - 2 && str[len - 1] === '='); + +}; + +var decryptAesCBC = function(encryptedString){ + + var hashedKey = CryptoJS.SHA256(env.encryption.password); + + // from BASE64 encoded encrypted string + var encryptedWordArray = CryptoJS.enc.Base64.parse(encryptedString); + + // get IV from beginning + var iv = CryptoJS.lib.WordArray.create( + encryptedWordArray.words.slice(0, (env.encryption.ivLength_byte) / 4 ) + ); + + var decrypted = CryptoJS.AES.decrypt( + { + ciphertext: CryptoJS.lib.WordArray.create( + encryptedWordArray.words.slice(env.encryption.ivLength_byte / 4) + ) + }, + hashedKey, + {iv: iv} + ); + + var decryptedString = decrypted.toString(CryptoJS.enc.Utf8); + + var decryptedJson = JSON.parse(decryptedString); + + // sometimes a response might still be BASE64 encoded in addition + // if so, then resolve that + if((typeof decryptedJson === 'string' || decryptedJson instanceof String) && isBase64(decryptedJson)){ + decryptedJson = CryptoJS.enc.Base64.parse(decryptedJson).toString(CryptoJS.enc.Utf8); + decryptedJson = JSON.parse(decryptedJson); + } + + return decryptedJson; +}; + + diff --git a/app/app.js b/app/app.js deleted file mode 100644 index 596654234..000000000 --- a/app/app.js +++ /dev/null @@ -1,436 +0,0 @@ -"use strict"; -if (/MSIE 9/i.test(navigator.userAgent) || /MSIE 10/i.test(navigator.userAgent) || /rv:11.0/i.test(navigator.userAgent)) { - // This is internet explorer 9, 10 or 11 - window.alert('Internet Explorer erkannt. Für eine optimale Nutzung von KomMonitor nutzen Sie nach Möglichkeit die Browser Firefox oder Chrome.'); -} -if (/Edge\/\d./i.test(navigator.userAgent)) { - // This is Microsoft Edge - window.alert('Microsoft Edge erkannt. Für eine optimale Nutzung von KomMonitor nutzen Sie nach Möglichkeit die Browser Firefox oder Chrome.'); -} -var env = {}; -// for jspdf insert backwards compatibility according to https://github.com/parallax/jsPDF/releases/tag/v2.0.0 -window.jsPDF = window.jspdf.jsPDF; -// Declare app level module which depends on views, and components -var appModule = angular.module('kommonitorClient', ['ngRoute', 'kommonitorUserInterface', 'kommonitorAdmin']); -var controlsServiceName = 'ControlsConfigService'; -var auth = {}; -/* - LOAD CONFIG FILES FROM CONFIG STORAGE SERVER -*/ -function ajaxCall_keycloakConfig(configStorageServerConfig) { - console.log("try to fetch keycloak config file"); - return $.ajax({ - url: configStorageServerConfig.targetUrlToConfigStorageServer_keycloakConfig, - success: function (result) { - console.log("keycloak config file fetched"); - window.__env.keycloakConfig = result; - return; - }, - error: function (XMLHttpRequest, textStatus, errorThrown) { - console.log("Use keycloak.json local backup default values"); - } - }); -} -function ajaxCall_appConfig(configStorageServerConfig) { - console.log("try to fetch app config file"); - return $.ajax({ - url: configStorageServerConfig.targetUrlToConfigStorageServer_appConfig, - success: function (result) { - console.log("app config file fetched"); - window.__env.appConfig = result; - return; - }, - error: function (XMLHttpRequest, textStatus, errorThrown) { - console.log("Use env.js local backup default values"); - } - }); -} -function ajaxCall_controlsConfig(configStorageServerConfig) { - console.log("try to fetch controls config file"); - return $.ajax({ - url: configStorageServerConfig.targetUrlToConfigStorageServer_controlsConfig, - success: function (result) { - console.log("controls config file fetched"); - window.__env.controlsConfig = result; - return; - }, - error: function (XMLHttpRequest, textStatus, errorThrown) { - console.log("Use controls-config.json local backup default values that has no widget restrictions."); - } - }); -} -/* - LOAD CONFIG FILES FROM LOCAL BACKUP FILES -*/ -function ajaxCall_keycloakConfig_localBackup(configStorageServerConfig) { - return $.ajax({ - url: "./config/keycloak_backup.json", - success: function (result) { - console.log("local keycloak config file with default values fetched"); - window.__env.keycloakConfig = result; - return; - }, - error: function (XMLHttpRequest, textStatus, errorThrown) { - console.log("Error parsing local keycloak.json backup file"); - } - }); -} -function ajaxCall_controlsConfig_localBackup(configStorageServerConfig) { - return $.ajax({ - url: "./config/controls-config_backup.json", - success: function (result) { - console.log("local controls-config file with default values fetched"); - window.__env.controlsConfig = result; - return; - }, - error: function (XMLHttpRequest, textStatus, errorThrown) { - console.log("Error parsing local controlsConfig.json backup file"); - } - }); -} -function loadAppConfigScriptDynamically(scriptUrl) { - return new Promise(function (res, rej) { - let script = document.createElement('script'); - script.src = scriptUrl; - script.type = 'text/javascript'; - script.onError = rej; - script.async = true; - script.onload = res; - script.addEventListener('error', rej); - script.addEventListener('load', res); - document.head.appendChild(script); - }); -} -function ajaxCall_configServerFile() { - return $.ajax({ - url: "./config/config-storage-server.json", - success: function (result) { - window.__env = window.__env || {}; - window.__env.configStorageServerConfig = result; - // inject script tag dynamically to DOM to load ENV variables - console.log("dynamically load env.js"); - const event = loadAppConfigScriptDynamically(window.__env.configStorageServerConfig.targetUrlToConfigStorageServer_appConfig) - .then(() => { console.log("loaded"); }) - .catch(() => { - console.log("Error while loading app config from client config storage server. Will use defaults instead"); - alert("Error while loading app config from client config storage server. Will use defaults instead."); - }); - return $.when(ajaxCall_keycloakConfig(window.__env.configStorageServerConfig), ajaxCall_controlsConfig(window.__env.configStorageServerConfig), ajaxCall_appConfig(window.__env.configStorageServerConfig)).then(function (ajax1Results, ajax2Results, ajax3Results) { - console.log("all configs have been loaded"); - initAngularComponents(); - bootstrapApplication(); - return; - }, function () { - // on fail - console.log("all configs have been loaded - at least some from local backup values. See console log for details"); - initAngularComponents(); - bootstrapApplication(); - return; - }); - } - }); -} -var loadConfigsThenApp = function () { - console.log("start loading required config files"); - $.when(ajaxCall_keycloakConfig_localBackup(window.__env.configStorageServerConfig), ajaxCall_controlsConfig_localBackup(window.__env.configStorageServerConfig)).then(function (ajax1Results, ajax2Results) { - console.log("local backup configs have been loaded in case config server is not reachable."); - ajaxCall_configServerFile(); - }, function () { - // on fail - console.log("all configs have been loaded - at least some from local backup values. See console log for details"); - ajaxCall_configServerFile(); - }); -}; -function initAngularComponents() { - console.log("Start to initialize required AngularJS components"); - // Import variables if present (from env.js) - if (window) { - Object.assign(env, window.__env); - } - // Register environment in AngularJS as constant - appModule.constant('__env', env); - // MathJx directive - appModule.directive("mathjaxBind", function () { - return { - restrict: "EA", - controller: [ - "$scope", - "$element", - "$attrs", - function ($scope, $element, $attrs) { - $scope.$watch($attrs.mathjaxBind, function (texExpression) { - $element.html(texExpression); - // only if texExpression contains the special character '$' which is used to mark tex code - // then call MathJax function - if (texExpression && texExpression.includes("$")) { - MathJax.typesetPromise([$element[0]]); - } - }); - }, - ], - }; - }); - // custom unique filter - appModule.filter('unique', function () { - return function (collection, primaryKey) { - var output = [], keys = []; - var splitKeys = primaryKey.split('.'); //split by period - angular.forEach(collection, function (item) { - var key = {}; - angular.copy(item, key); - for (var i = 0; i < splitKeys.length; i++) { - key = key[splitKeys[i]]; //the beauty of loosely typed js :) - } - if (keys.indexOf(key) === -1) { - keys.push(key); - output.push(item); - } - }); - return output; - }; - }); - appModule.service(controlsServiceName, ['$http', function ($http) { - window.__env.config = null; - // var resourcePath = window.__env.configStorageServerConfig ? window.__env.configStorageServerConfig.targetUrlToConfigStorageServer_controlsConfig : './config/controls-config_backup.json'; - var resourcePath = './config/controls-config_backup.json'; - var promise = $http.get(resourcePath).then(function (response) { - // window.__env.config = response.data; - window.__env.config = window.__env.controlsConfig; - }); - return { - promise: promise, - setData: function (response) { - window.__env.config = window.__env.controlsConfig; - }, - getControlsConfig: function () { - return window.__env.config; - } - }; - }]); - appModule. - config(['$routeProvider', - function config($routeProvider) { - $routeProvider. - when('/', { - template: '', - resolve: { - controlsServiceName: function (ControlsConfigService) { - return ControlsConfigService.promise; - } - } - }). - when('/administration', { - template: '', - resolve: { - 'auth': function (Auth, $q, $location) { - if (window.__env.enableKeycloakSecurity) { - if (Auth.keycloak.authenticated) { - if (Auth.keycloak.tokenParsed - && Auth.keycloak.tokenParsed.realm_access - && Auth.keycloak.tokenParsed.realm_access.roles - && Auth.keycloak.tokenParsed.realm_access.roles.some(role => role.endsWith("-creator") || role.endsWith("-publisher") || role.endsWith("-editor"))) { - Auth.keycloak.showAdminView = true; - } - if (Auth.keycloak.showAdminView) { - return true; - } - else { - return $q.reject('Not Authenticated'); - } - } - else { - Auth.keycloak.login({ - redirectUri: $location.absUrl() - }); - } - } - else { - } - } - } - }). - otherwise('/'); - } - ]) - .run(function ($rootScope, $location, Auth) { - // register listener to watch route changes - $rootScope.$on("$routeChangeError", function (event, next, current) { - $location.path("/"); - }); - }); - if (!env.enableDebug) { - if (window) { - window.console.log = function () { }; - } - } - if (window.__env.enableKeycloakSecurity) { - appModule.factory('authInterceptor', ['$q', 'Auth', function ($q, Auth) { - return { - request: function (config) { - var deferred = $q.defer(); - if (Auth.keycloak.token && urlRequiresKeycloakAuthHeader(config.url)) { - Auth.keycloak.updateToken(5).then(function () { - config.headers = config.headers || {}; - config.headers.Authorization = 'Bearer ' + Auth.keycloak.token; - deferred.resolve(config); - }).catch(function () { - deferred.reject('Failed to refresh token'); - console.error('Failed to refresh token. Will redirect to Login screen'); - auth.keycloak.login(); - }); - return deferred.promise; - } - else { - return config; - } - } - }; - }]); - appModule.config(['$httpProvider', function ($httpProvider) { - $httpProvider.interceptors.push('authInterceptor'); - }]); - } - if (env.encryption.enabled) { - appModule.factory('encryptionInterceptor', ['$q', function ($q) { - return { - response: function (response) { - // if encrypted, then will look like: - // {encryptedData: encryptedData} - // using AES-CBC - if (response.data.encryptedData) { - try { - var encryptedString = response.data.encryptedData; - var decryptedJson = decryptAesCBC(encryptedString); - response.data = decryptedJson; - return response; - } - catch (error) { - console.error(error); - return response; - } - } - return response; - }, - }; - }]); - appModule.config(['$httpProvider', function ($httpProvider) { - $httpProvider.interceptors.push('encryptionInterceptor'); - }]); - } -} -function bootstrapApplication() { - if (window.__env.enableKeycloakSecurity) { - var keycloakAdapter = new Keycloak(window.__env.configStorageServerConfig.targetUrlToConfigStorageServer_keycloakConfig); - // https://www.keycloak.org/docs/latest/securing_apps/#session-status-iframe - // https://www.keycloak.org/docs/latest/securing_apps/#_modern_browsers - keycloakAdapter.init({ - onLoad: 'check-sso', - checkLoginIframe: false, - silentCheckSsoFallback: false - }).then(function (authenticated) { - console.log(authenticated ? 'User is authenticated!' : 'User is not authenticated!'); - auth.keycloak = keycloakAdapter; - appModule.factory('Auth', function () { - return auth; - }); - try { - console.debug('Trying to bootstrap application.'); - angular.bootstrap(document, [appModule.name]); - } - catch (e) { - console.error('Application bootstrapping failed.'); - console.error(e); - } - }).catch(function () { - console.log('Failed to initialize authentication adapter. Will try to bootstrap application without keycloak security'); - alert('Failed to initialize keycloak authentication adapter. Will try to bootstrap application without keycloak security'); - window.__env.enableKeycloakSecurity = false; - bootstrapApplication(); - }); - } - else { - var keycloakAdapter = new Keycloak(keycloakConfig_forDirectInit); - auth.keycloak = keycloakAdapter; - appModule.factory('Auth', function () { - return auth; - }); - try { - console.debug('Trying to bootstrap application.'); - angular.bootstrap(document, [appModule.name]); - } - catch (e) { - console.error('Application bootstrapping failed.'); - console.error(e); - } - } -} -angular.element(document).ready(function ($http) { - // load configs before doing anything else - loadConfigsThenApp(); -}); -var urlRequiresKeycloakAuthHeader = function (url) { - // /admin/ is used to make admin requests against keycloak - if (url.includes("/admin/")) { - return false; - } - // ORS isochrones and directions requests - if (url.includes("isochrones")) { - return false; - } - if (url.includes("routes")) { - return false; - } - // for KomMonitor public requests we do not need any authentication - if (url.includes("/public/")) { - return false; - } - return true; -}; -var isBase64 = function (str) { - var notBase64 = /[^A-Z0-9+\/=]/i; - const isString = (typeof str === 'string' || str instanceof String); - if (!isString) { - let invalidType; - if (str === null) { - invalidType = 'null'; - } - else { - invalidType = typeof str; - if (invalidType === 'object' && str.constructor && str.constructor.hasOwnProperty('name')) { - invalidType = str.constructor.name; - } - else { - invalidType = `a ${invalidType}`; - } - } - throw new TypeError(`Expected string but received ${invalidType}.`); - } - const len = str.length; - if (!len || len % 4 !== 0 || notBase64.test(str)) { - return false; - } - const firstPaddingChar = str.indexOf('='); - return firstPaddingChar === -1 || - firstPaddingChar === len - 1 || - (firstPaddingChar === len - 2 && str[len - 1] === '='); -}; -var decryptAesCBC = function (encryptedString) { - var hashedKey = CryptoJS.SHA256(env.encryption.password); - // from BASE64 encoded encrypted string - var encryptedWordArray = CryptoJS.enc.Base64.parse(encryptedString); - // get IV from beginning - var iv = CryptoJS.lib.WordArray.create(encryptedWordArray.words.slice(0, (env.encryption.ivLength_byte) / 4)); - var decrypted = CryptoJS.AES.decrypt({ - ciphertext: CryptoJS.lib.WordArray.create(encryptedWordArray.words.slice(env.encryption.ivLength_byte / 4)) - }, hashedKey, { iv: iv }); - var decryptedString = decrypted.toString(CryptoJS.enc.Utf8); - var decryptedJson = JSON.parse(decryptedString); - // sometimes a response might still be BASE64 encoded in addition - // if so, then resolve that - if ((typeof decryptedJson === 'string' || decryptedJson instanceof String) && isBase64(decryptedJson)) { - decryptedJson = CryptoJS.enc.Base64.parse(decryptedJson).toString(CryptoJS.enc.Utf8); - decryptedJson = JSON.parse(decryptedJson); - } - return decryptedJson; -}; -//# sourceMappingURL=app.js.map \ No newline at end of file diff --git a/app/app.js.map b/app/app.js.map deleted file mode 100644 index ed361f0ab..000000000 --- a/app/app.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"app.js","sourceRoot":"","sources":["app.ts"],"names":[],"mappings":";AAAA,IAAI,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE;IACrH,wCAAwC;IACxC,MAAM,CAAC,KAAK,CAAC,kIAAkI,CAAC,CAAC;CACpJ;AAGD,IAAI,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,EAAC;IACxC,yBAAyB;IAEzB,MAAM,CAAC,KAAK,CAAC,+HAA+H,CAAC,CAAC;CAChJ;AAED,IAAI,GAAG,GAA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AAO,CAClC;QACE,UAAU,EAAE,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,CACvC,kBAAkB,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,aAAa,GAAG,CAAC,CAAC,CACjE;KACF,EACD,SAAS,EACT,EAAC,EAAE,EAAE,EAAE,EAAC,CACT,CAAC;IAEF,IAAI,eAAe,GAAG,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAE5D,IAAI,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;IAEhD,iEAAiE;IACjE,2BAA2B;IAC3B,IAAG,CAAC,OAAO,aAAa,KAAK,QAAQ,IAAI,aAAa,YAAY,MAAM,CAAC,IAAI,QAAQ,CAAC,aAAa,CAAC,EAAC;QACnG,aAAa,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACrF,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;KAC3C;IAED,OAAO,aAAa,CAAC;AACzB,CAAC,CAAC"} \ No newline at end of file diff --git a/app/app.module.ts b/app/app.module.ts new file mode 100644 index 000000000..d95fba0cb --- /dev/null +++ b/app/app.module.ts @@ -0,0 +1,15 @@ +import { DoBootstrap, NgModule } from '@angular/core'; +import { BrowserModule } from '@angular/platform-browser'; +import { UpgradeModule } from '@angular/upgrade/static'; + +@NgModule({ + imports: [ + BrowserModule, + ], +}) +export class AppModule implements DoBootstrap { + constructor(private upgrade: UpgradeModule) { } + ngDoBootstrap() { + this.upgrade.bootstrap(document.documentElement, ['kommonitorClient']); + } +} \ No newline at end of file diff --git a/app/index.html b/app/index.html index 2b09e77c0..b4a26234b 100644 --- a/app/index.html +++ b/app/index.html @@ -12,7 +12,10 @@ KomMonitor + content="Kommunales Raumbeobachtungssystem"> + + + @@ -331,7 +334,7 @@ - + diff --git a/app/main.ts b/app/main.ts new file mode 100644 index 000000000..91a439a63 --- /dev/null +++ b/app/main.ts @@ -0,0 +1,4 @@ +import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; +import { AppModule } from './app.module'; + +platformBrowserDynamic().bootstrapModule(AppModule); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 97c0bd3cb..9677e6c62 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,15 @@ "version": "2.1.13", "license": "Apache 2.0", "dependencies": { + "@angular/animations": "^16.1.3", + "@angular/common": "^16.1.3", + "@angular/compiler": "^16.1.3", + "@angular/core": "^16.1.3", + "@angular/forms": "^16.1.3", + "@angular/platform-browser": "^16.1.3", + "@angular/platform-browser-dynamic": "^16.1.3", + "@angular/router": "^16.1.3", + "@angular/upgrade": "^16.1.3", "@fortawesome/fontawesome-free": "^6.1.1", "@turf/turf": "^6.5.0", "admin-lte": "^2.4.15", @@ -61,14 +70,20 @@ "leaflet.pattern": "^0.1.0", "mathjax": "^3.1.2", "rangeslide.js": "^0.13.0", + "rxjs": "^7.8.1", "shp-write": "^0.3.2", "shpjs": "^3.4.3", "slimscroll": "^0.9.1", "sortablejs": "^1.13.0", "tableexport": "^5.0.5", - "ui-select": "^0.19.8" + "tslib": "^2.6.0", + "ui-select": "^0.19.8", + "zone.js": "^0.13.1" }, "devDependencies": { + "@angular-devkit/build-angular": "^16.1.3", + "@angular/cli": "^16.1.3", + "@angular/compiler-cli": "^16.1.3", "@babel/cli": "^7.17.3", "@babel/core": "^7.17.5", "@release-it/keep-a-changelog": "^3.1.0", @@ -114,1645 +129,4688 @@ } }, "node_modules/@ampproject/remapping": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.1.2.tgz", - "integrity": "sha512-hoyByceqwKirw7w3Z7gnIIZC3Wx3J484Y3L/cMpXFbr7d9ZQj2mODrirNzcJa+SM3UlpWXYvKV4RlRpFXlWgXg==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", + "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", "dev": true, "dependencies": { - "@jridgewell/trace-mapping": "^0.3.0" + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" }, "engines": { "node": ">=6.0.0" } }, - "node_modules/@babel/cli": { - "version": "7.17.3", - "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.17.3.tgz", - "integrity": "sha512-1+WRlh1IqLocOp122CLx4if345RSHMspwIZNJTlqG/GA46HVZC6p49N1kolfdd2/GOdr+tu4nScbAR3ACJ2ZiA==", - "dev": true, - "dependencies": { - "@jridgewell/trace-mapping": "^0.3.4", - "commander": "^4.0.1", - "convert-source-map": "^1.1.0", - "fs-readdir-recursive": "^1.1.0", - "glob": "^7.0.0", - "make-dir": "^2.1.0", - "slash": "^2.0.0", - "source-map": "^0.5.0" - }, - "bin": { - "babel": "bin/babel.js", - "babel-external-helpers": "bin/babel-external-helpers.js" - }, - "engines": { - "node": ">=6.9.0" + "node_modules/@angular-devkit/architect": { + "version": "0.1601.3", + "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.1601.3.tgz", + "integrity": "sha512-HvW51cCEoIYe2mYqcmnm2RZiMMFbFn7iIdsjbCJe7etFhcG+Y3hGDZMh4IFSiQiss+pwPSYOvQY2zwGrndMgLw==", + "dev": true, + "dependencies": { + "@angular-devkit/core": "16.1.3", + "rxjs": "7.8.1" + }, + "engines": { + "node": "^16.14.0 || >=18.10.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" + } + }, + "node_modules/@angular-devkit/build-angular": { + "version": "16.1.3", + "resolved": "https://registry.npmjs.org/@angular-devkit/build-angular/-/build-angular-16.1.3.tgz", + "integrity": "sha512-1scrdUdKRa9TkJ9jev/KRzFttbLUVACQvVRL0G67nUAdtJ/bQX8eui85axpCNPFihK4ReSW3R4lrgcVC2NUSoA==", + "dev": true, + "dependencies": { + "@ampproject/remapping": "2.2.1", + "@angular-devkit/architect": "0.1601.3", + "@angular-devkit/build-webpack": "0.1601.3", + "@angular-devkit/core": "16.1.3", + "@babel/core": "7.22.5", + "@babel/generator": "7.22.5", + "@babel/helper-annotate-as-pure": "7.22.5", + "@babel/helper-split-export-declaration": "7.22.5", + "@babel/plugin-proposal-async-generator-functions": "7.20.7", + "@babel/plugin-transform-async-to-generator": "7.22.5", + "@babel/plugin-transform-runtime": "7.22.5", + "@babel/preset-env": "7.22.5", + "@babel/runtime": "7.22.5", + "@babel/template": "7.22.5", + "@discoveryjs/json-ext": "0.5.7", + "@ngtools/webpack": "16.1.3", + "@vitejs/plugin-basic-ssl": "1.0.1", + "ansi-colors": "4.1.3", + "autoprefixer": "10.4.14", + "babel-loader": "9.1.2", + "babel-plugin-istanbul": "6.1.1", + "browserslist": "^4.21.5", + "cacache": "17.1.3", + "chokidar": "3.5.3", + "copy-webpack-plugin": "11.0.0", + "critters": "0.0.19", + "css-loader": "6.8.1", + "esbuild-wasm": "0.17.19", + "fast-glob": "3.2.12", + "https-proxy-agent": "5.0.1", + "inquirer": "8.2.4", + "jsonc-parser": "3.2.0", + "karma-source-map-support": "1.4.0", + "less": "4.1.3", + "less-loader": "11.1.0", + "license-webpack-plugin": "4.0.2", + "loader-utils": "3.2.1", + "magic-string": "0.30.0", + "mini-css-extract-plugin": "2.7.6", + "mrmime": "1.0.1", + "open": "8.4.2", + "ora": "5.4.1", + "parse5-html-rewriting-stream": "7.0.0", + "picomatch": "2.3.1", + "piscina": "3.2.0", + "postcss": "8.4.24", + "postcss-loader": "7.3.2", + "resolve-url-loader": "5.0.0", + "rxjs": "7.8.1", + "sass": "1.63.2", + "sass-loader": "13.3.1", + "semver": "7.5.3", + "source-map-loader": "4.0.1", + "source-map-support": "0.5.21", + "terser": "5.17.7", + "text-table": "0.2.0", + "tree-kill": "1.2.2", + "tslib": "2.5.3", + "vite": "4.3.9", + "webpack": "5.86.0", + "webpack-dev-middleware": "6.1.1", + "webpack-dev-server": "4.15.0", + "webpack-merge": "5.9.0", + "webpack-subresource-integrity": "5.1.0" + }, + "engines": { + "node": "^16.14.0 || >=18.10.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" }, "optionalDependencies": { - "@nicolo-ribaudo/chokidar-2": "2.1.8-no-fsevents.3", - "chokidar": "^3.4.0" + "esbuild": "0.17.19" }, "peerDependencies": { - "@babel/core": "^7.0.0-0" + "@angular/compiler-cli": "^16.0.0", + "@angular/localize": "^16.0.0", + "@angular/platform-server": "^16.0.0", + "@angular/service-worker": "^16.0.0", + "jest": "^29.5.0", + "jest-environment-jsdom": "^29.5.0", + "karma": "^6.3.0", + "ng-packagr": "^16.0.0", + "protractor": "^7.0.0", + "tailwindcss": "^2.0.0 || ^3.0.0", + "typescript": ">=4.9.3 <5.2" + }, + "peerDependenciesMeta": { + "@angular/localize": { + "optional": true + }, + "@angular/platform-server": { + "optional": true + }, + "@angular/service-worker": { + "optional": true + }, + "jest": { + "optional": true + }, + "jest-environment-jsdom": { + "optional": true + }, + "karma": { + "optional": true + }, + "ng-packagr": { + "optional": true + }, + "protractor": { + "optional": true + }, + "tailwindcss": { + "optional": true + } } }, - "node_modules/@babel/cli/node_modules/commander": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", - "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "node_modules/@angular-devkit/build-angular/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", "dev": true, + "dependencies": { + "debug": "4" + }, "engines": { - "node": ">= 6" + "node": ">= 6.0.0" } }, - "node_modules/@babel/cli/node_modules/slash": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", - "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "node_modules/@angular-devkit/build-angular/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", "dev": true, - "engines": { - "node": ">=6" + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/@babel/code-frame": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", - "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "node_modules/@angular-devkit/build-angular/node_modules/ajv-keywords": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", + "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", "dev": true, "dependencies": { - "@babel/highlight": "^7.10.4" + "fast-deep-equal": "^3.1.3" + }, + "peerDependencies": { + "ajv": "^8.8.2" } }, - "node_modules/@babel/compat-data": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.17.0.tgz", - "integrity": "sha512-392byTlpGWXMv4FbyWw3sAZ/FrW/DrwqLGXpy0mbyNe9Taqv1mg9yON5/o0cnr8XYCkFTZbC1eV+c+LAROgrng==", + "node_modules/@angular-devkit/build-angular/node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", "dev": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/core": { - "version": "7.17.5", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.17.5.tgz", - "integrity": "sha512-/BBMw4EvjmyquN5O+t5eh0+YqB3XXJkYD2cjKpYtWOfFy4lQ4UozNSmxAcWT8r2XtZs0ewG+zrfsqeR15i1ajA==", - "dev": true, - "dependencies": { - "@ampproject/remapping": "^2.1.0", - "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.17.3", - "@babel/helper-compilation-targets": "^7.16.7", - "@babel/helper-module-transforms": "^7.16.7", - "@babel/helpers": "^7.17.2", - "@babel/parser": "^7.17.3", - "@babel/template": "^7.16.7", - "@babel/traverse": "^7.17.3", - "@babel/types": "^7.17.0", - "convert-source-map": "^1.7.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.2", - "json5": "^2.1.2", - "semver": "^6.3.0" + "dependencies": { + "type-fest": "^0.21.3" }, "engines": { - "node": ">=6.9.0" + "node": ">=8" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/babel" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@babel/core/node_modules/@babel/code-frame": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", - "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "node_modules/@angular-devkit/build-angular/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, - "dependencies": { - "@babel/highlight": "^7.16.7" - }, "engines": { - "node": ">=6.9.0" + "node": ">=8" } }, - "node_modules/@babel/core/node_modules/@babel/generator": { - "version": "7.17.3", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.3.tgz", - "integrity": "sha512-+R6Dctil/MgUsZsZAkYgK+ADNSZzJRRy0TvY65T71z/CR854xHQ1EweBYXdfT+HNeN7w0cSJJEzgxZMv40pxsg==", + "node_modules/@angular-devkit/build-angular/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "@babel/types": "^7.17.0", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" + "color-convert": "^2.0.1" }, "engines": { - "node": ">=6.9.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/@babel/core/node_modules/@babel/helper-function-name": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz", - "integrity": "sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA==", + "node_modules/@angular-devkit/build-angular/node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", "dev": true, "dependencies": { - "@babel/helper-get-function-arity": "^7.16.7", - "@babel/template": "^7.16.7", - "@babel/types": "^7.16.7" - }, - "engines": { - "node": ">=6.9.0" + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/@angular-devkit/build-angular/node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" } }, - "node_modules/@babel/core/node_modules/@babel/helper-get-function-arity": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz", - "integrity": "sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw==", + "node_modules/@angular-devkit/build-angular/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { - "@babel/types": "^7.16.7" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">=6.9.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/@babel/core/node_modules/@babel/helper-split-export-declaration": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", - "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", + "node_modules/@angular-devkit/build-angular/node_modules/cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", "dev": true, "dependencies": { - "@babel/types": "^7.16.7" + "restore-cursor": "^3.1.0" }, "engines": { - "node": ">=6.9.0" + "node": ">=8" } }, - "node_modules/@babel/core/node_modules/@babel/helper-validator-identifier": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", - "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "node_modules/@angular-devkit/build-angular/node_modules/cli-width": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", + "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", "dev": true, "engines": { - "node": ">=6.9.0" + "node": ">= 10" } }, - "node_modules/@babel/core/node_modules/@babel/highlight": { - "version": "7.16.10", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.10.tgz", - "integrity": "sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==", + "node_modules/@angular-devkit/build-angular/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.16.7", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" + "color-name": "~1.1.4" }, "engines": { - "node": ">=6.9.0" + "node": ">=7.0.0" } }, - "node_modules/@babel/core/node_modules/@babel/parser": { - "version": "7.17.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.3.tgz", - "integrity": "sha512-7yJPvPV+ESz2IUTPbOL+YkIGyCqOyNIzdguKQuJGnH7bg1WTIifuM21YqokFt/THWh1AkCRn9IgoykTRCBVpzA==", + "node_modules/@angular-devkit/build-angular/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/@angular-devkit/build-angular/node_modules/copy-webpack-plugin": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-11.0.0.tgz", + "integrity": "sha512-fX2MWpamkW0hZxMEg0+mYnA40LTosOSa5TqZ9GYIBzyJa9C3QUaMPSE2xAi/buNr8u89SfD9wHSQVBzrRa/SOQ==", "dev": true, - "bin": { - "parser": "bin/babel-parser.js" + "dependencies": { + "fast-glob": "^3.2.11", + "glob-parent": "^6.0.1", + "globby": "^13.1.1", + "normalize-path": "^3.0.0", + "schema-utils": "^4.0.0", + "serialize-javascript": "^6.0.0" }, "engines": { - "node": ">=6.0.0" + "node": ">= 14.15.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.1.0" } }, - "node_modules/@babel/core/node_modules/@babel/template": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", - "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", + "node_modules/@angular-devkit/build-angular/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.16.7", - "@babel/parser": "^7.16.7", - "@babel/types": "^7.16.7" + "ms": "2.1.2" }, "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/core/node_modules/@babel/traverse": { - "version": "7.17.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.17.3.tgz", - "integrity": "sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.17.3", - "@babel/helper-environment-visitor": "^7.16.7", - "@babel/helper-function-name": "^7.16.7", - "@babel/helper-hoist-variables": "^7.16.7", - "@babel/helper-split-export-declaration": "^7.16.7", - "@babel/parser": "^7.17.3", - "@babel/types": "^7.17.0", - "debug": "^4.1.0", - "globals": "^11.1.0" + "node": ">=6.0" }, - "engines": { - "node": ">=6.9.0" + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "node_modules/@babel/core/node_modules/@babel/types": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", - "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", + "node_modules/@angular-devkit/build-angular/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/@angular-devkit/build-angular/node_modules/figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.16.7", - "to-fast-properties": "^2.0.0" + "escape-string-regexp": "^1.0.5" }, "engines": { - "node": ">=6.9.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@babel/core/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "node_modules/@angular-devkit/build-angular/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, "dependencies": { - "color-convert": "^1.9.0" + "is-glob": "^4.0.3" }, "engines": { - "node": ">=4" + "node": ">=10.13.0" } }, - "node_modules/@babel/core/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "node_modules/@angular-devkit/build-angular/node_modules/globby": { + "version": "13.2.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.2.1.tgz", + "integrity": "sha512-DPCBxctI7dN4EeIqjW2KGqgdcUMbrhJ9AzON+PlxCtvppWhubTLD4+a0GFxiym14ZvacUydTPjLPc2DlKz7EIg==", "dev": true, "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.11", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^4.0.0" }, "engines": { - "node": ">=4" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@babel/core/node_modules/convert-source-map": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", - "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", + "node_modules/@angular-devkit/build-angular/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "dependencies": { - "safe-buffer": "~5.1.1" + "engines": { + "node": ">=8" } }, - "node_modules/@babel/core/node_modules/debug": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/@babel/core/node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "node_modules/@angular-devkit/build-angular/node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", "dev": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, "engines": { - "node": ">=4" + "node": ">= 6" } }, - "node_modules/@babel/core/node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "node_modules/@angular-devkit/build-angular/node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, - "node_modules/@babel/core/node_modules/jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "node_modules/@angular-devkit/build-angular/node_modules/inquirer": { + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.4.tgz", + "integrity": "sha512-nn4F01dxU8VeKfq192IjLsxu0/OmMZ4Lg3xKAns148rCaXP6ntAoEkVYZThWjwON8AlzdZZi6oqnhNbxUG9hVg==", "dev": true, - "bin": { - "jsesc": "bin/jsesc" + "dependencies": { + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.1", + "cli-cursor": "^3.1.0", + "cli-width": "^3.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.21", + "mute-stream": "0.0.8", + "ora": "^5.4.1", + "run-async": "^2.4.0", + "rxjs": "^7.5.5", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6", + "wrap-ansi": "^7.0.0" }, "engines": { - "node": ">=4" + "node": ">=12.0.0" } }, - "node_modules/@babel/core/node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "node_modules/@angular-devkit/build-angular/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, - "bin": { - "json5": "lib/cli.js" - }, "engines": { - "node": ">=6" + "node": ">=8" } }, - "node_modules/@babel/core/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/@babel/core/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "node_modules/@angular-devkit/build-angular/node_modules/is-interactive": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", "dev": true, - "bin": { - "semver": "bin/semver.js" + "engines": { + "node": ">=8" } }, - "node_modules/@babel/core/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "node_modules/@angular-devkit/build-angular/node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, "engines": { - "node": ">=4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@babel/core/node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "node_modules/@angular-devkit/build-angular/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "node_modules/@angular-devkit/build-angular/node_modules/loader-utils": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-3.2.1.tgz", + "integrity": "sha512-ZvFw1KWS3GVyYBYb7qkmRM/WwL2TQQBxgCK62rlvm4WpVQ23Nb4tYjApUlfjrEGvOs7KHEsmyUn75OHZrJMWPw==", "dev": true, "engines": { - "node": ">=4" + "node": ">= 12.13.0" } }, - "node_modules/@babel/generator": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.13.0.tgz", - "integrity": "sha512-zBZfgvBB/ywjx0Rgc2+BwoH/3H+lDtlgD4hBOpEv5LxRnYsm/753iRuLepqnYlynpjC3AdQxtxsoeHJoEEwOAw==", + "node_modules/@angular-devkit/build-angular/node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, "dependencies": { - "@babel/types": "^7.13.0", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@babel/generator/node_modules/@babel/helper-validator-identifier": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", - "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", - "dev": true - }, - "node_modules/@babel/generator/node_modules/@babel/types": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.13.0.tgz", - "integrity": "sha512-hE+HE8rnG1Z6Wzo+MhaKE5lM5eMx71T4EHJgku2E3xIfaULhDcxiiRxUYgwX8qwP1BBSlag+TdGOt6JAidIZTA==", + "node_modules/@angular-devkit/build-angular/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.12.11", - "lodash": "^4.17.19", - "to-fast-properties": "^2.0.0" - } - }, - "node_modules/@babel/generator/node_modules/jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "dev": true, - "bin": { - "jsesc": "bin/jsesc" + "yallist": "^4.0.0" }, "engines": { - "node": ">=4" + "node": ">=10" } }, - "node_modules/@babel/generator/node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "node_modules/@angular-devkit/build-angular/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/@angular-devkit/build-angular/node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true, "engines": { - "node": ">=4" + "node": ">=0.10.0" } }, - "node_modules/@babel/helper-compilation-targets": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.7.tgz", - "integrity": "sha512-mGojBwIWcwGD6rfqgRXVlVYmPAv7eOpIemUG3dGnDdCY4Pae70ROij3XmfrH6Fa1h1aiDylpglbZyktfzyo/hA==", + "node_modules/@angular-devkit/build-angular/node_modules/open": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", + "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", "dev": true, "dependencies": { - "@babel/compat-data": "^7.16.4", - "@babel/helper-validator-option": "^7.16.7", - "browserslist": "^4.17.5", - "semver": "^6.3.0" + "define-lazy-prop": "^2.0.0", + "is-docker": "^2.1.1", + "is-wsl": "^2.2.0" }, "engines": { - "node": ">=6.9.0" + "node": ">=12" }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/helper-compilation-targets/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@babel/helper-environment-visitor": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz", - "integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==", + "node_modules/@angular-devkit/build-angular/node_modules/ora": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", "dev": true, "dependencies": { - "@babel/types": "^7.16.7" + "bl": "^4.1.0", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" }, "engines": { - "node": ">=6.9.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@babel/helper-environment-visitor/node_modules/@babel/helper-validator-identifier": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", - "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "node_modules/@angular-devkit/build-angular/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, "engines": { - "node": ">=6.9.0" + "node": ">= 6" } }, - "node_modules/@babel/helper-environment-visitor/node_modules/@babel/types": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", - "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", + "node_modules/@angular-devkit/build-angular/node_modules/restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.16.7", - "to-fast-properties": "^2.0.0" + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" }, "engines": { - "node": ">=6.9.0" + "node": ">=8" } }, - "node_modules/@babel/helper-environment-visitor/node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "node_modules/@angular-devkit/build-angular/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/@angular-devkit/build-angular/node_modules/schema-utils": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz", + "integrity": "sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==", "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.9", + "ajv": "^8.9.0", + "ajv-formats": "^2.1.1", + "ajv-keywords": "^5.1.0" + }, "engines": { - "node": ">=4" + "node": ">= 12.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" } }, - "node_modules/@babel/helper-function-name": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", - "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", + "node_modules/@angular-devkit/build-angular/node_modules/semver": { + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", "dev": true, "dependencies": { - "@babel/helper-get-function-arity": "^7.12.13", - "@babel/template": "^7.12.13", - "@babel/types": "^7.12.13" + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" } }, - "node_modules/@babel/helper-function-name/node_modules/@babel/helper-validator-identifier": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", - "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", - "dev": true - }, - "node_modules/@babel/helper-function-name/node_modules/@babel/types": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.13.0.tgz", - "integrity": "sha512-hE+HE8rnG1Z6Wzo+MhaKE5lM5eMx71T4EHJgku2E3xIfaULhDcxiiRxUYgwX8qwP1BBSlag+TdGOt6JAidIZTA==", + "node_modules/@angular-devkit/build-angular/node_modules/serialize-javascript": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz", + "integrity": "sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.12.11", - "lodash": "^4.17.19", - "to-fast-properties": "^2.0.0" + "randombytes": "^2.1.0" } }, - "node_modules/@babel/helper-function-name/node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "node_modules/@angular-devkit/build-angular/node_modules/slash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", "dev": true, "engines": { - "node": ">=4" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@babel/helper-get-function-arity": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", - "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", + "node_modules/@angular-devkit/build-angular/node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "dev": true, "dependencies": { - "@babel/types": "^7.12.13" + "safe-buffer": "~5.2.0" } }, - "node_modules/@babel/helper-get-function-arity/node_modules/@babel/helper-validator-identifier": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", - "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", - "dev": true - }, - "node_modules/@babel/helper-get-function-arity/node_modules/@babel/types": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.13.0.tgz", - "integrity": "sha512-hE+HE8rnG1Z6Wzo+MhaKE5lM5eMx71T4EHJgku2E3xIfaULhDcxiiRxUYgwX8qwP1BBSlag+TdGOt6JAidIZTA==", + "node_modules/@angular-devkit/build-angular/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.12.11", - "lodash": "^4.17.19", - "to-fast-properties": "^2.0.0" - } - }, - "node_modules/@babel/helper-get-function-arity/node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", - "dev": true, + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/@babel/helper-hoist-variables": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", - "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", + "node_modules/@angular-devkit/build-angular/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "dependencies": { - "@babel/types": "^7.16.7" + "ansi-regex": "^5.0.1" }, "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-hoist-variables/node_modules/@babel/helper-validator-identifier": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", - "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", - "dev": true, - "engines": { - "node": ">=6.9.0" + "node": ">=8" } }, - "node_modules/@babel/helper-hoist-variables/node_modules/@babel/types": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", - "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", + "node_modules/@angular-devkit/build-angular/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.16.7", - "to-fast-properties": "^2.0.0" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-hoist-variables/node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", - "dev": true, - "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/@babel/helper-module-imports": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz", - "integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==", + "node_modules/@angular-devkit/build-angular/node_modules/terser": { + "version": "5.17.7", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.17.7.tgz", + "integrity": "sha512-/bi0Zm2C6VAexlGgLlVxA0P2lru/sdLyfCVaRMfKVo9nWxbmz7f/sD8VPybPeSUJaJcwmCJis9pBIhcVcG1QcQ==", "dev": true, "dependencies": { - "@babel/types": "^7.16.7" + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.8.2", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" }, "engines": { - "node": ">=6.9.0" + "node": ">=10" } }, - "node_modules/@babel/helper-module-imports/node_modules/@babel/helper-validator-identifier": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", - "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "node_modules/@angular-devkit/build-angular/node_modules/tslib": { + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.3.tgz", + "integrity": "sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==", + "dev": true + }, + "node_modules/@angular-devkit/build-angular/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", "dev": true, "engines": { - "node": ">=6.9.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@babel/helper-module-imports/node_modules/@babel/types": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", - "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", + "node_modules/@angular-devkit/build-angular/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.16.7", - "to-fast-properties": "^2.0.0" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" }, "engines": { - "node": ">=6.9.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/@babel/helper-module-imports/node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", - "dev": true, - "engines": { - "node": ">=4" - } + "node_modules/@angular-devkit/build-angular/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true }, - "node_modules/@babel/helper-module-transforms": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.16.7.tgz", - "integrity": "sha512-gaqtLDxJEFCeQbYp9aLAefjhkKdjKcdh6DB7jniIGU3Pz52WAmP268zK0VgPz9hUNkMSYeH976K2/Y6yPadpng==", + "node_modules/@angular-devkit/build-webpack": { + "version": "0.1601.3", + "resolved": "https://registry.npmjs.org/@angular-devkit/build-webpack/-/build-webpack-0.1601.3.tgz", + "integrity": "sha512-744+72vi/Vx010VxizGgilhpnDCOG29qyhMmu7BkUhtpq8E8eQn2HU3nPpxAqrg3bKVAwD7v3F111MVIhub8kA==", "dev": true, "dependencies": { - "@babel/helper-environment-visitor": "^7.16.7", - "@babel/helper-module-imports": "^7.16.7", - "@babel/helper-simple-access": "^7.16.7", - "@babel/helper-split-export-declaration": "^7.16.7", - "@babel/helper-validator-identifier": "^7.16.7", - "@babel/template": "^7.16.7", - "@babel/traverse": "^7.16.7", - "@babel/types": "^7.16.7" + "@angular-devkit/architect": "0.1601.3", + "rxjs": "7.8.1" }, "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-module-transforms/node_modules/@babel/code-frame": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", - "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", - "dev": true, - "dependencies": { - "@babel/highlight": "^7.16.7" + "node": "^16.14.0 || >=18.10.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" }, - "engines": { - "node": ">=6.9.0" + "peerDependencies": { + "webpack": "^5.30.0", + "webpack-dev-server": "^4.0.0" } }, - "node_modules/@babel/helper-module-transforms/node_modules/@babel/generator": { - "version": "7.17.3", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.3.tgz", - "integrity": "sha512-+R6Dctil/MgUsZsZAkYgK+ADNSZzJRRy0TvY65T71z/CR854xHQ1EweBYXdfT+HNeN7w0cSJJEzgxZMv40pxsg==", + "node_modules/@angular-devkit/core": { + "version": "16.1.3", + "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-16.1.3.tgz", + "integrity": "sha512-cFhNdJHumNMZGD3NYxOtNuMGRQXeDnKbwvK+IJmKAttXt8na6EvURR/ZxZOI7rl/YRVX+vcNSdtXz3hE6g+Isw==", "dev": true, "dependencies": { - "@babel/types": "^7.17.0", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" + "ajv": "8.12.0", + "ajv-formats": "2.1.1", + "jsonc-parser": "3.2.0", + "rxjs": "7.8.1", + "source-map": "0.7.4" }, "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-module-transforms/node_modules/@babel/helper-function-name": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz", - "integrity": "sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA==", - "dev": true, - "dependencies": { - "@babel/helper-get-function-arity": "^7.16.7", - "@babel/template": "^7.16.7", - "@babel/types": "^7.16.7" + "node": "^16.14.0 || >=18.10.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-module-transforms/node_modules/@babel/helper-get-function-arity": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz", - "integrity": "sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw==", - "dev": true, - "dependencies": { - "@babel/types": "^7.16.7" + "peerDependencies": { + "chokidar": "^3.5.2" }, - "engines": { - "node": ">=6.9.0" + "peerDependenciesMeta": { + "chokidar": { + "optional": true + } } }, - "node_modules/@babel/helper-module-transforms/node_modules/@babel/helper-split-export-declaration": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", - "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", + "node_modules/@angular-devkit/core/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", "dev": true, "dependencies": { - "@babel/types": "^7.16.7" + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" }, - "engines": { - "node": ">=6.9.0" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/@babel/helper-module-transforms/node_modules/@babel/helper-validator-identifier": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", - "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "node_modules/@angular-devkit/core/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "node_modules/@angular-devkit/core/node_modules/source-map": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", + "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", "dev": true, "engines": { - "node": ">=6.9.0" + "node": ">= 8" } }, - "node_modules/@babel/helper-module-transforms/node_modules/@babel/highlight": { - "version": "7.16.10", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.10.tgz", - "integrity": "sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==", + "node_modules/@angular-devkit/schematics": { + "version": "16.1.3", + "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-16.1.3.tgz", + "integrity": "sha512-hWEuQnfQOgcSs4YX6iF4QR/34ROeSPaMi7lQOYg33hStg+pnk/JDdIU0f2nrIIz3t0jqAj+5VXVLBJvOCd84vg==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.16.7", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" + "@angular-devkit/core": "16.1.3", + "jsonc-parser": "3.2.0", + "magic-string": "0.30.0", + "ora": "5.4.1", + "rxjs": "7.8.1" }, "engines": { - "node": ">=6.9.0" + "node": "^16.14.0 || >=18.10.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" } }, - "node_modules/@babel/helper-module-transforms/node_modules/@babel/parser": { - "version": "7.17.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.3.tgz", - "integrity": "sha512-7yJPvPV+ESz2IUTPbOL+YkIGyCqOyNIzdguKQuJGnH7bg1WTIifuM21YqokFt/THWh1AkCRn9IgoykTRCBVpzA==", + "node_modules/@angular-devkit/schematics/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, - "bin": { - "parser": "bin/babel-parser.js" - }, "engines": { - "node": ">=6.0.0" + "node": ">=8" } }, - "node_modules/@babel/helper-module-transforms/node_modules/@babel/template": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", - "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", + "node_modules/@angular-devkit/schematics/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.16.7", - "@babel/parser": "^7.16.7", - "@babel/types": "^7.16.7" + "color-convert": "^2.0.1" }, "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-module-transforms/node_modules/@babel/traverse": { - "version": "7.17.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.17.3.tgz", - "integrity": "sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.17.3", - "@babel/helper-environment-visitor": "^7.16.7", - "@babel/helper-function-name": "^7.16.7", - "@babel/helper-hoist-variables": "^7.16.7", - "@babel/helper-split-export-declaration": "^7.16.7", - "@babel/parser": "^7.17.3", - "@babel/types": "^7.17.0", - "debug": "^4.1.0", - "globals": "^11.1.0" + "node": ">=8" }, - "engines": { - "node": ">=6.9.0" + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/@babel/helper-module-transforms/node_modules/@babel/types": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", - "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", + "node_modules/@angular-devkit/schematics/node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.16.7", - "to-fast-properties": "^2.0.0" - }, - "engines": { - "node": ">=6.9.0" + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" } }, - "node_modules/@babel/helper-module-transforms/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "node_modules/@angular-devkit/schematics/node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" } }, - "node_modules/@babel/helper-module-transforms/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "node_modules/@angular-devkit/schematics/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">=4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/@babel/helper-module-transforms/node_modules/debug": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "node_modules/@angular-devkit/schematics/node_modules/cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", "dev": true, "dependencies": { - "ms": "2.1.2" + "restore-cursor": "^3.1.0" }, "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "node": ">=8" } }, - "node_modules/@babel/helper-module-transforms/node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "node_modules/@angular-devkit/schematics/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, "engines": { - "node": ">=4" + "node": ">=7.0.0" } }, - "node_modules/@babel/helper-module-transforms/node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "node_modules/@angular-devkit/schematics/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/@babel/helper-module-transforms/node_modules/jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "node_modules/@angular-devkit/schematics/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "bin": { - "jsesc": "bin/jsesc" - }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/@babel/helper-module-transforms/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "node_modules/@angular-devkit/schematics/node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, - "node_modules/@babel/helper-module-transforms/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "node_modules/@angular-devkit/schematics/node_modules/is-interactive": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/@babel/helper-module-transforms/node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "node_modules/@angular-devkit/schematics/node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "dev": true, "engines": { - "node": ">=4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@babel/helper-simple-access": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.16.7.tgz", - "integrity": "sha512-ZIzHVyoeLMvXMN/vok/a4LWRy8G2v205mNP0XOuf9XRLyX5/u9CnVulUtDgUTama3lT+bf/UqucuZjqiGuTS1g==", + "node_modules/@angular-devkit/schematics/node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, "dependencies": { - "@babel/types": "^7.16.7" + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" }, "engines": { - "node": ">=6.9.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@babel/helper-simple-access/node_modules/@babel/helper-validator-identifier": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", - "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "node_modules/@angular-devkit/schematics/node_modules/ora": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", "dev": true, + "dependencies": { + "bl": "^4.1.0", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + }, "engines": { - "node": ">=6.9.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@babel/helper-simple-access/node_modules/@babel/types": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", - "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", + "node_modules/@angular-devkit/schematics/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.16.7", - "to-fast-properties": "^2.0.0" + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" }, "engines": { - "node": ">=6.9.0" + "node": ">= 6" } }, - "node_modules/@babel/helper-simple-access/node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "node_modules/@angular-devkit/schematics/node_modules/restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", "dev": true, + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/@babel/helper-split-export-declaration": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", - "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", + "node_modules/@angular-devkit/schematics/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "dev": true, - "dependencies": { - "@babel/types": "^7.12.13" - } - }, - "node_modules/@babel/helper-split-export-declaration/node_modules/@babel/helper-validator-identifier": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", - "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", - "dev": true + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, - "node_modules/@babel/helper-split-export-declaration/node_modules/@babel/types": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.13.0.tgz", - "integrity": "sha512-hE+HE8rnG1Z6Wzo+MhaKE5lM5eMx71T4EHJgku2E3xIfaULhDcxiiRxUYgwX8qwP1BBSlag+TdGOt6JAidIZTA==", + "node_modules/@angular-devkit/schematics/node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.12.11", - "lodash": "^4.17.19", - "to-fast-properties": "^2.0.0" - } - }, - "node_modules/@babel/helper-split-export-declaration/node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", - "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", - "dev": true - }, - "node_modules/@babel/helper-validator-option": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz", - "integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==", - "dev": true, - "engines": { - "node": ">=6.9.0" + "safe-buffer": "~5.2.0" } }, - "node_modules/@babel/helpers": { - "version": "7.17.2", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.17.2.tgz", - "integrity": "sha512-0Qu7RLR1dILozr/6M0xgj+DFPmi6Bnulgm9M8BVa9ZCWxDqlSnqt3cf8IDPB5m45sVXUZ0kuQAgUrdSFFH79fQ==", + "node_modules/@angular-devkit/schematics/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "dependencies": { - "@babel/template": "^7.16.7", - "@babel/traverse": "^7.17.0", - "@babel/types": "^7.17.0" + "ansi-regex": "^5.0.1" }, "engines": { - "node": ">=6.9.0" + "node": ">=8" } }, - "node_modules/@babel/helpers/node_modules/@babel/code-frame": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", - "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "node_modules/@angular-devkit/schematics/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { - "@babel/highlight": "^7.16.7" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=6.9.0" + "node": ">=8" } }, - "node_modules/@babel/helpers/node_modules/@babel/generator": { - "version": "7.17.3", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.3.tgz", - "integrity": "sha512-+R6Dctil/MgUsZsZAkYgK+ADNSZzJRRy0TvY65T71z/CR854xHQ1EweBYXdfT+HNeN7w0cSJJEzgxZMv40pxsg==", - "dev": true, + "node_modules/@angular/animations": { + "version": "16.1.3", + "resolved": "https://registry.npmjs.org/@angular/animations/-/animations-16.1.3.tgz", + "integrity": "sha512-ET6ahrlbOyTYXOTouKs2VJxx0CMTrYkfz0HfI6IHnSKBC6wguDxXYnamMouHgrCkDDEB5qClfGHyS9se0AOX4w==", "dependencies": { - "@babel/types": "^7.17.0", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" + "tslib": "^2.3.0" }, "engines": { - "node": ">=6.9.0" + "node": "^16.14.0 || >=18.10.0" + }, + "peerDependencies": { + "@angular/core": "16.1.3" + } + }, + "node_modules/@angular/cli": { + "version": "16.1.3", + "resolved": "https://registry.npmjs.org/@angular/cli/-/cli-16.1.3.tgz", + "integrity": "sha512-D0gU12z/N2oJ+s6pggAnWYrTUZ+2duGb3Y5oUyClsubz7JWpAwHjSZpb8exPUrgYhr+qIEMGO685y1JazJQ2tA==", + "dev": true, + "dependencies": { + "@angular-devkit/architect": "0.1601.3", + "@angular-devkit/core": "16.1.3", + "@angular-devkit/schematics": "16.1.3", + "@schematics/angular": "16.1.3", + "@yarnpkg/lockfile": "1.1.0", + "ansi-colors": "4.1.3", + "ini": "4.1.1", + "inquirer": "8.2.4", + "jsonc-parser": "3.2.0", + "npm-package-arg": "10.1.0", + "npm-pick-manifest": "8.0.1", + "open": "8.4.2", + "ora": "5.4.1", + "pacote": "15.2.0", + "resolve": "1.22.2", + "semver": "7.5.3", + "symbol-observable": "4.0.0", + "yargs": "17.7.2" + }, + "bin": { + "ng": "bin/ng.js" + }, + "engines": { + "node": "^16.14.0 || >=18.10.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" } }, - "node_modules/@babel/helpers/node_modules/@babel/helper-function-name": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz", - "integrity": "sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA==", + "node_modules/@angular/cli/node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", "dev": true, "dependencies": { - "@babel/helper-get-function-arity": "^7.16.7", - "@babel/template": "^7.16.7", - "@babel/types": "^7.16.7" + "type-fest": "^0.21.3" }, "engines": { - "node": ">=6.9.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@babel/helpers/node_modules/@babel/helper-get-function-arity": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz", - "integrity": "sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw==", + "node_modules/@angular/cli/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, - "dependencies": { - "@babel/types": "^7.16.7" - }, "engines": { - "node": ">=6.9.0" + "node": ">=8" } }, - "node_modules/@babel/helpers/node_modules/@babel/helper-split-export-declaration": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", - "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", + "node_modules/@angular/cli/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "@babel/types": "^7.16.7" + "color-convert": "^2.0.1" }, "engines": { - "node": ">=6.9.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/@babel/helpers/node_modules/@babel/helper-validator-identifier": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", - "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "node_modules/@angular/cli/node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", "dev": true, - "engines": { - "node": ">=6.9.0" + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" } }, - "node_modules/@babel/helpers/node_modules/@babel/highlight": { - "version": "7.16.10", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.10.tgz", - "integrity": "sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==", + "node_modules/@angular/cli/node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], "dependencies": { - "@babel/helper-validator-identifier": "^7.16.7", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "engines": { - "node": ">=6.9.0" + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" } }, - "node_modules/@babel/helpers/node_modules/@babel/parser": { - "version": "7.17.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.3.tgz", - "integrity": "sha512-7yJPvPV+ESz2IUTPbOL+YkIGyCqOyNIzdguKQuJGnH7bg1WTIifuM21YqokFt/THWh1AkCRn9IgoykTRCBVpzA==", + "node_modules/@angular/cli/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, - "bin": { - "parser": "bin/babel-parser.js" + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">=6.0.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/@babel/helpers/node_modules/@babel/template": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", - "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", + "node_modules/@angular/cli/node_modules/cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.16.7", - "@babel/parser": "^7.16.7", - "@babel/types": "^7.16.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helpers/node_modules/@babel/traverse": { - "version": "7.17.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.17.3.tgz", - "integrity": "sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.17.3", - "@babel/helper-environment-visitor": "^7.16.7", - "@babel/helper-function-name": "^7.16.7", - "@babel/helper-hoist-variables": "^7.16.7", - "@babel/helper-split-export-declaration": "^7.16.7", - "@babel/parser": "^7.17.3", - "@babel/types": "^7.17.0", - "debug": "^4.1.0", - "globals": "^11.1.0" + "restore-cursor": "^3.1.0" }, "engines": { - "node": ">=6.9.0" + "node": ">=8" } }, - "node_modules/@babel/helpers/node_modules/@babel/types": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", - "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", + "node_modules/@angular/cli/node_modules/cli-width": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", + "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.16.7", - "to-fast-properties": "^2.0.0" - }, "engines": { - "node": ">=6.9.0" + "node": ">= 10" } }, - "node_modules/@babel/helpers/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "node_modules/@angular/cli/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dev": true, "dependencies": { - "color-convert": "^1.9.0" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" }, "engines": { - "node": ">=4" + "node": ">=12" } }, - "node_modules/@babel/helpers/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "node_modules/@angular/cli/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "color-name": "~1.1.4" }, "engines": { - "node": ">=4" + "node": ">=7.0.0" } }, - "node_modules/@babel/helpers/node_modules/debug": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "node_modules/@angular/cli/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/@angular/cli/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/@angular/cli/node_modules/figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", "dev": true, "dependencies": { - "ms": "2.1.2" + "escape-string-regexp": "^1.0.5" }, "engines": { - "node": ">=6.0" + "node": ">=8" }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@babel/helpers/node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "node_modules/@angular/cli/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/@babel/helpers/node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "node_modules/@angular/cli/node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, - "node_modules/@babel/helpers/node_modules/jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "node_modules/@angular/cli/node_modules/ini": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.1.tgz", + "integrity": "sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==", "dev": true, - "bin": { - "jsesc": "bin/jsesc" - }, "engines": { - "node": ">=4" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/@babel/helpers/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/@babel/helpers/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "node_modules/@angular/cli/node_modules/inquirer": { + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.4.tgz", + "integrity": "sha512-nn4F01dxU8VeKfq192IjLsxu0/OmMZ4Lg3xKAns148rCaXP6ntAoEkVYZThWjwON8AlzdZZi6oqnhNbxUG9hVg==", "dev": true, "dependencies": { - "has-flag": "^3.0.0" + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.1", + "cli-cursor": "^3.1.0", + "cli-width": "^3.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.21", + "mute-stream": "0.0.8", + "ora": "^5.4.1", + "run-async": "^2.4.0", + "rxjs": "^7.5.5", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6", + "wrap-ansi": "^7.0.0" }, "engines": { - "node": ">=4" + "node": ">=12.0.0" } }, - "node_modules/@babel/helpers/node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "node_modules/@angular/cli/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/@babel/highlight": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", - "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "node_modules/@angular/cli/node_modules/is-interactive": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.10.4", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" + "engines": { + "node": ">=8" } }, - "node_modules/@babel/highlight/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "node_modules/@angular/cli/node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@angular/cli/node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, "dependencies": { - "color-convert": "^1.9.0" + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" }, "engines": { - "node": ">=4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@babel/highlight/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "node_modules/@angular/cli/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "yallist": "^4.0.0" }, "engines": { - "node": ">=4" + "node": ">=10" } }, - "node_modules/@babel/highlight/node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "node_modules/@babel/highlight/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "node_modules/@angular/cli/node_modules/open": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", + "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", "dev": true, "dependencies": { - "has-flag": "^3.0.0" + "define-lazy-prop": "^2.0.0", + "is-docker": "^2.1.1", + "is-wsl": "^2.2.0" }, "engines": { - "node": ">=4" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@babel/parser": { - "version": "7.13.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.13.4.tgz", - "integrity": "sha512-uvoOulWHhI+0+1f9L4BoozY7U5cIkZ9PgJqvb041d6vypgUmtVPG4vmGm4pSggjl8BELzvHyUeJSUyEMY6b+qA==", + "node_modules/@angular/cli/node_modules/ora": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", "dev": true, - "bin": { - "parser": "bin/babel-parser.js" + "dependencies": { + "bl": "^4.1.0", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" }, "engines": { - "node": ">=6.0.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@babel/runtime": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.18.6.tgz", - "integrity": "sha512-t9wi7/AW6XtKahAe20Yw0/mMljKq0B1r2fPdvaAdV/KPDZewFXdaaa6K7lxmZBZ8FBNpCiAT6iHPmd6QO9bKfQ==", + "node_modules/@angular/cli/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, "dependencies": { - "regenerator-runtime": "^0.13.4" + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" }, "engines": { - "node": ">=6.9.0" + "node": ">= 6" } }, - "node_modules/@babel/runtime/node_modules/regenerator-runtime": { - "version": "0.13.9", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", - "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==" - }, - "node_modules/@babel/template": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", - "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", + "node_modules/@angular/cli/node_modules/resolve": { + "version": "1.22.2", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", + "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.12.13", - "@babel/parser": "^7.12.13", - "@babel/types": "^7.12.13" + "is-core-module": "^2.11.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/@babel/template/node_modules/@babel/code-frame": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", - "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "node_modules/@angular/cli/node_modules/restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", "dev": true, "dependencies": { - "@babel/highlight": "^7.12.13" + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8" } }, - "node_modules/@babel/template/node_modules/@babel/helper-validator-identifier": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", - "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", - "dev": true + "node_modules/@angular/cli/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, - "node_modules/@babel/template/node_modules/@babel/highlight": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.12.13.tgz", - "integrity": "sha512-kocDQvIbgMKlWxXe9fof3TQ+gkIPOUSEYhJjqUjvKMez3krV7vbzYCDq39Oj11UAVK7JqPVGQPlgE85dPNlQww==", + "node_modules/@angular/cli/node_modules/semver": { + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.12.11", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" } }, - "node_modules/@babel/template/node_modules/@babel/types": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.13.0.tgz", - "integrity": "sha512-hE+HE8rnG1Z6Wzo+MhaKE5lM5eMx71T4EHJgku2E3xIfaULhDcxiiRxUYgwX8qwP1BBSlag+TdGOt6JAidIZTA==", + "node_modules/@angular/cli/node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.12.11", - "lodash": "^4.17.19", - "to-fast-properties": "^2.0.0" + "safe-buffer": "~5.2.0" } }, - "node_modules/@babel/template/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "node_modules/@angular/cli/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "dependencies": { - "color-convert": "^1.9.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/@babel/template/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "node_modules/@angular/cli/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "ansi-regex": "^5.0.1" }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/@babel/template/node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "node_modules/@babel/template/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "node_modules/@angular/cli/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/@babel/template/node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "node_modules/@angular/cli/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", "dev": true, "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/traverse": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.13.0.tgz", - "integrity": "sha512-xys5xi5JEhzC3RzEmSGrs/b3pJW/o87SypZ+G/PhaE7uqVQNv/jlmVIBXuoh5atqQ434LfXV+sf23Oxj0bchJQ==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.13.0", - "@babel/helper-function-name": "^7.12.13", - "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/parser": "^7.13.0", - "@babel/types": "^7.13.0", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.19" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@babel/traverse/node_modules/@babel/code-frame": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", - "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "node_modules/@angular/cli/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "dependencies": { - "@babel/highlight": "^7.12.13" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/@babel/traverse/node_modules/@babel/helper-validator-identifier": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", - "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", + "node_modules/@angular/cli/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, - "node_modules/@babel/traverse/node_modules/@babel/highlight": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.12.13.tgz", - "integrity": "sha512-kocDQvIbgMKlWxXe9fof3TQ+gkIPOUSEYhJjqUjvKMez3krV7vbzYCDq39Oj11UAVK7JqPVGQPlgE85dPNlQww==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.12.11", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - }, - "node_modules/@babel/traverse/node_modules/@babel/types": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.13.0.tgz", - "integrity": "sha512-hE+HE8rnG1Z6Wzo+MhaKE5lM5eMx71T4EHJgku2E3xIfaULhDcxiiRxUYgwX8qwP1BBSlag+TdGOt6JAidIZTA==", + "node_modules/@angular/cli/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.12.11", - "lodash": "^4.17.19", - "to-fast-properties": "^2.0.0" + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" } }, - "node_modules/@babel/traverse/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "node_modules/@angular/cli/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, "engines": { - "node": ">=4" + "node": ">=12" } }, - "node_modules/@babel/traverse/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, + "node_modules/@angular/common": { + "version": "16.1.3", + "resolved": "https://registry.npmjs.org/@angular/common/-/common-16.1.3.tgz", + "integrity": "sha512-ZzJ6EwQHUkiZYV0zH/UxyUYW5uxomsyk7tdtqZIxAR5m2ktYkQ5XlqgPjBO8voF54Rs5Ot43RkPCLesbZyJDsw==", "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "tslib": "^2.3.0" }, "engines": { - "node": ">=4" + "node": "^16.14.0 || >=18.10.0" + }, + "peerDependencies": { + "@angular/core": "16.1.3", + "rxjs": "^6.5.3 || ^7.4.0" } }, - "node_modules/@babel/traverse/node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, + "node_modules/@angular/compiler": { + "version": "16.1.3", + "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-16.1.3.tgz", + "integrity": "sha512-7Ckvssk9+s5xLyXvp72IwAw5vd/Osa3tR6oiQatdbw+O3XjLO04QycoGXwkp/fYVexGsjFyOn6QJ5n1F/PYPbQ==", "dependencies": { - "ms": "2.1.2" + "tslib": "^2.3.0" }, "engines": { - "node": ">=6.0" + "node": "^16.14.0 || >=18.10.0" + }, + "peerDependencies": { + "@angular/core": "16.1.3" }, "peerDependenciesMeta": { - "supports-color": { + "@angular/core": { "optional": true } } }, - "node_modules/@babel/traverse/node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "node_modules/@angular/compiler-cli": { + "version": "16.1.3", + "resolved": "https://registry.npmjs.org/@angular/compiler-cli/-/compiler-cli-16.1.3.tgz", + "integrity": "sha512-aUqnIV9rRTBNgiQRS0Gv6lhghaGj1vpVRyXgiE4VnTR9uBONSsGKMNALYBBhXRTSk2e0cvutt0ubLgmNpdyWyQ==", "dev": true, + "dependencies": { + "@babel/core": "7.22.5", + "@jridgewell/sourcemap-codec": "^1.4.14", + "chokidar": "^3.0.0", + "convert-source-map": "^1.5.1", + "reflect-metadata": "^0.1.2", + "semver": "^7.0.0", + "tslib": "^2.3.0", + "yargs": "^17.2.1" + }, + "bin": { + "ng-xi18n": "bundles/src/bin/ng_xi18n.js", + "ngc": "bundles/src/bin/ngc.js", + "ngcc": "bundles/ngcc/index.js" + }, "engines": { - "node": ">=4" - } + "node": "^16.14.0 || >=18.10.0" + }, + "peerDependencies": { + "@angular/compiler": "16.1.3", + "typescript": ">=4.9.3 <5.2" + } + }, + "node_modules/@angular/compiler-cli/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@angular/compiler-cli/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@angular/compiler-cli/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@angular/compiler-cli/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@angular/compiler-cli/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/@angular/compiler-cli/node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true + }, + "node_modules/@angular/compiler-cli/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/@angular/compiler-cli/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@angular/compiler-cli/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@angular/compiler-cli/node_modules/semver": { + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@angular/compiler-cli/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@angular/compiler-cli/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@angular/compiler-cli/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/@angular/compiler-cli/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/@angular/compiler-cli/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@angular/compiler-cli/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/@angular/core": { + "version": "16.1.3", + "resolved": "https://registry.npmjs.org/@angular/core/-/core-16.1.3.tgz", + "integrity": "sha512-yhRo9hVS8KhfcEgzciWuRWF4Pnnko98bmSJTqd7u8Kys6z3Uj0qgXMssXHIPUALe3mQKjVkdSZPLIZ9/CaVn/Q==", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": "^16.14.0 || >=18.10.0" + }, + "peerDependencies": { + "rxjs": "^6.5.3 || ^7.4.0", + "zone.js": "~0.13.0" + } + }, + "node_modules/@angular/forms": { + "version": "16.1.3", + "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-16.1.3.tgz", + "integrity": "sha512-9tJHgoi/Jmeo30zfnReVZWFcd1WthR+QwYUNwPev+ys58u1mB0cDGORvROySmC2YUyXFSpXt8sxwyWCkYvaV2w==", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": "^16.14.0 || >=18.10.0" + }, + "peerDependencies": { + "@angular/common": "16.1.3", + "@angular/core": "16.1.3", + "@angular/platform-browser": "16.1.3", + "rxjs": "^6.5.3 || ^7.4.0" + } + }, + "node_modules/@angular/platform-browser": { + "version": "16.1.3", + "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-16.1.3.tgz", + "integrity": "sha512-qZA6Lua2fpBe+KD/QArY/4hilypSZFcTcJsPjZwIzo5pavXqYDI8BVghwh5dcZoUa56hVRDJjv+XW6kl8m9Tdw==", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": "^16.14.0 || >=18.10.0" + }, + "peerDependencies": { + "@angular/animations": "16.1.3", + "@angular/common": "16.1.3", + "@angular/core": "16.1.3" + }, + "peerDependenciesMeta": { + "@angular/animations": { + "optional": true + } + } + }, + "node_modules/@angular/platform-browser-dynamic": { + "version": "16.1.3", + "resolved": "https://registry.npmjs.org/@angular/platform-browser-dynamic/-/platform-browser-dynamic-16.1.3.tgz", + "integrity": "sha512-UHxSWpPB5+FSv8zm8T+4ZikLqyy+VE6GlOLp/DdgEz77j81rz2C1pMqozwTnVbD16XbI4rhTp+RFY3C9ArWOtw==", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": "^16.14.0 || >=18.10.0" + }, + "peerDependencies": { + "@angular/common": "16.1.3", + "@angular/compiler": "16.1.3", + "@angular/core": "16.1.3", + "@angular/platform-browser": "16.1.3" + } + }, + "node_modules/@angular/router": { + "version": "16.1.3", + "resolved": "https://registry.npmjs.org/@angular/router/-/router-16.1.3.tgz", + "integrity": "sha512-bkn8cWGBKKZidDaP+R7g/S/6miSfH8iP24d2k86Awo+vaO+7G/5WWGfKJMKK8UNM/A5ueX6ugAZrMHpQ9e6Y4w==", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": "^16.14.0 || >=18.10.0" + }, + "peerDependencies": { + "@angular/common": "16.1.3", + "@angular/core": "16.1.3", + "@angular/platform-browser": "16.1.3", + "rxjs": "^6.5.3 || ^7.4.0" + } + }, + "node_modules/@angular/upgrade": { + "version": "16.1.3", + "resolved": "https://registry.npmjs.org/@angular/upgrade/-/upgrade-16.1.3.tgz", + "integrity": "sha512-LVYfixLlyVlHcXc28sDtBfszd1unmMuIlrjGB0CeewqGeutRiMJX3V4Avo6MfNNvRfkqAphXSCz9qZuPqu2aPA==", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": "^16.14.0 || >=18.10.0" + }, + "peerDependencies": { + "@angular/compiler": "16.1.3", + "@angular/core": "16.1.3", + "@angular/platform-browser": "16.1.3", + "@angular/platform-browser-dynamic": "16.1.3" + } + }, + "node_modules/@assemblyscript/loader": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@assemblyscript/loader/-/loader-0.10.1.tgz", + "integrity": "sha512-H71nDOOL8Y7kWRLqf6Sums+01Q5msqBW2KhDUTemh1tvY04eSkSXrK0uj/4mmY0Xr16/3zyZmsrxN7CKuRbNRg==", + "dev": true + }, + "node_modules/@babel/cli": { + "version": "7.17.3", + "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.17.3.tgz", + "integrity": "sha512-1+WRlh1IqLocOp122CLx4if345RSHMspwIZNJTlqG/GA46HVZC6p49N1kolfdd2/GOdr+tu4nScbAR3ACJ2ZiA==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.4", + "commander": "^4.0.1", + "convert-source-map": "^1.1.0", + "fs-readdir-recursive": "^1.1.0", + "glob": "^7.0.0", + "make-dir": "^2.1.0", + "slash": "^2.0.0", + "source-map": "^0.5.0" + }, + "bin": { + "babel": "bin/babel.js", + "babel-external-helpers": "bin/babel-external-helpers.js" + }, + "engines": { + "node": ">=6.9.0" + }, + "optionalDependencies": { + "@nicolo-ribaudo/chokidar-2": "2.1.8-no-fsevents.3", + "chokidar": "^3.4.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/cli/node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@babel/cli/node_modules/slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", + "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.5.tgz", + "integrity": "sha512-4Jc/YuIaYqKnDDz892kPIledykKg12Aw1PYX5i/TY28anJtacvM1Rrr8wbieB9GfEJwlzqT0hUEao0CxEebiDA==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.22.5.tgz", + "integrity": "sha512-SBuTAjg91A3eKOvD+bPEz3LlhHZRNu1nFOVts9lzDJTXshHTjII0BAtDS3Y2DAkdZdDKWVZGVwkDfc4Clxn1dg==", + "dev": true, + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.22.5", + "@babel/generator": "^7.22.5", + "@babel/helper-compilation-targets": "^7.22.5", + "@babel/helper-module-transforms": "^7.22.5", + "@babel/helpers": "^7.22.5", + "@babel/parser": "^7.22.5", + "@babel/template": "^7.22.5", + "@babel/traverse": "^7.22.5", + "@babel/types": "^7.22.5", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.2", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/convert-source-map": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.1" + } + }, + "node_modules/@babel/core/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@babel/core/node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@babel/core/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/generator": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.5.tgz", + "integrity": "sha512-+lcUbnTRhd0jOewtFSedLyiPsD5tswKkbgcezOqqWFUVNEwoUTlpPOBmvhG7OXWLR4jMdv0czPGH5XbflnD1EA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.22.5", + "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", + "jsesc": "^2.5.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/generator/node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/helper-annotate-as-pure": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz", + "integrity": "sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-builder-binary-assignment-operator-visitor": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.22.5.tgz", + "integrity": "sha512-m1EP3lVOPptR+2DwD125gziZNcmoNSHGmJROKoy87loWUQyJaVXDgpmruWqDARZSmtYQ+Dl25okU8+qhVzuykw==", + "dev": true, + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.5.tgz", + "integrity": "sha512-Ji+ywpHeuqxB8WDxraCiqR0xfhYjiDE/e6k7FuIaANnoOFxAHskHChz4vA1mJC9Lbm01s1PVAGhQY4FUKSkGZw==", + "dev": true, + "dependencies": { + "@babel/compat-data": "^7.22.5", + "@babel/helper-validator-option": "^7.22.5", + "browserslist": "^4.21.3", + "lru-cache": "^5.1.1", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + }, + "node_modules/@babel/helper-create-class-features-plugin": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.22.5.tgz", + "integrity": "sha512-xkb58MyOYIslxu3gKmVXmjTtUPvBU4odYzbiIQbWwLKIHCsx6UGZGX6F1IznMFVnDdirseUZopzN+ZRt8Xb33Q==", + "dev": true, + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-function-name": "^7.22.5", + "@babel/helper-member-expression-to-functions": "^7.22.5", + "@babel/helper-optimise-call-expression": "^7.22.5", + "@babel/helper-replace-supers": "^7.22.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.5", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-create-class-features-plugin/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-create-regexp-features-plugin": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.22.5.tgz", + "integrity": "sha512-1VpEFOIbMRaXyDeUwUfmTIxExLwQ+zkW+Bh5zXpApA3oQedBx9v/updixWxnx/bZpKw7u8VxWjb/qWpIcmPq8A==", + "dev": true, + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.22.5", + "regexpu-core": "^5.3.1", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-create-regexp-features-plugin/node_modules/jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + } + }, + "node_modules/@babel/helper-create-regexp-features-plugin/node_modules/regexpu-core": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.3.2.tgz", + "integrity": "sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ==", + "dev": true, + "dependencies": { + "@babel/regjsgen": "^0.8.0", + "regenerate": "^1.4.2", + "regenerate-unicode-properties": "^10.1.0", + "regjsparser": "^0.9.1", + "unicode-match-property-ecmascript": "^2.0.0", + "unicode-match-property-value-ecmascript": "^2.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/helper-create-regexp-features-plugin/node_modules/regjsparser": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.9.1.tgz", + "integrity": "sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ==", + "dev": true, + "dependencies": { + "jsesc": "~0.5.0" + }, + "bin": { + "regjsparser": "bin/parser" + } + }, + "node_modules/@babel/helper-create-regexp-features-plugin/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-define-polyfill-provider": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.4.0.tgz", + "integrity": "sha512-RnanLx5ETe6aybRi1cO/edaRH+bNYWaryCEmjDDYyNr4wnSzyOp8T0dWipmqVHKEY3AbVKUom50AKSlj1zmKbg==", + "dev": true, + "dependencies": { + "@babel/helper-compilation-targets": "^7.17.7", + "@babel/helper-plugin-utils": "^7.16.7", + "debug": "^4.1.1", + "lodash.debounce": "^4.0.8", + "resolve": "^1.14.2", + "semver": "^6.1.2" + }, + "peerDependencies": { + "@babel/core": "^7.4.0-0" + } + }, + "node_modules/@babel/helper-define-polyfill-provider/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@babel/helper-define-polyfill-provider/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/@babel/helper-define-polyfill-provider/node_modules/resolve": { + "version": "1.22.2", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", + "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", + "dev": true, + "dependencies": { + "is-core-module": "^2.11.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/@babel/helper-define-polyfill-provider/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-environment-visitor": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz", + "integrity": "sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-function-name": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz", + "integrity": "sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==", + "dev": true, + "dependencies": { + "@babel/template": "^7.22.5", + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-hoist-variables": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", + "dev": true, + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-member-expression-to-functions": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.22.5.tgz", + "integrity": "sha512-aBiH1NKMG0H2cGZqspNvsaBe6wNGjbJjuLy29aU+eDZjSbbN53BaxlpB02xm9v34pLTZ1nIQPFYn2qMZoa5BQQ==", + "dev": true, + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz", + "integrity": "sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.22.5.tgz", + "integrity": "sha512-+hGKDt/Ze8GFExiVHno/2dvG5IdstpzCq0y4Qc9OJ25D4q3pKfiIP/4Vp3/JvhDkLKsDK2api3q3fpIgiIF5bw==", + "dev": true, + "dependencies": { + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-module-imports": "^7.22.5", + "@babel/helper-simple-access": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.5", + "@babel/template": "^7.22.5", + "@babel/traverse": "^7.22.5", + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-optimise-call-expression": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz", + "integrity": "sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==", + "dev": true, + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", + "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-remap-async-to-generator": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.22.5.tgz", + "integrity": "sha512-cU0Sq1Rf4Z55fgz7haOakIyM7+x/uCFwXpLPaeRzfoUtAEAuUZjZvFPjL/rk5rW693dIgn2hng1W7xbT7lWT4g==", + "dev": true, + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-wrap-function": "^7.22.5", + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-replace-supers": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.22.5.tgz", + "integrity": "sha512-aLdNM5I3kdI/V9xGNyKSF3X/gTyMUBohTZ+/3QdQKAA9vxIiy12E+8E2HoOP1/DjeqU+g6as35QHJNMDDYpuCg==", + "dev": true, + "dependencies": { + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-member-expression-to-functions": "^7.22.5", + "@babel/helper-optimise-call-expression": "^7.22.5", + "@babel/template": "^7.22.5", + "@babel/traverse": "^7.22.5", + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-simple-access": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", + "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", + "dev": true, + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-skip-transparent-expression-wrappers": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz", + "integrity": "sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q==", + "dev": true, + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-split-export-declaration": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.5.tgz", + "integrity": "sha512-thqK5QFghPKWLhAV321lxF95yCg2K3Ob5yw+M3VHWfdia0IkPXUtoLH8x/6Fh486QUvzhb8YOWHChTVen2/PoQ==", + "dev": true, + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", + "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", + "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz", + "integrity": "sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-wrap-function": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.22.5.tgz", + "integrity": "sha512-bYqLIBSEshYcYQyfks8ewYA8S30yaGSeRslcvKMvoUk6HHPySbxHq9YRi6ghhzEU+yhQv9bP/jXnygkStOcqZw==", + "dev": true, + "dependencies": { + "@babel/helper-function-name": "^7.22.5", + "@babel/template": "^7.22.5", + "@babel/traverse": "^7.22.5", + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.22.5.tgz", + "integrity": "sha512-pSXRmfE1vzcUIDFQcSGA5Mr+GxBV9oiRKDuDxXvWQQBCh8HoIjs/2DlDB7H8smac1IVrB9/xdXj2N3Wol9Cr+Q==", + "dev": true, + "dependencies": { + "@babel/template": "^7.22.5", + "@babel/traverse": "^7.22.5", + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", + "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.22.5", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/@babel/highlight/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/parser": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.5.tgz", + "integrity": "sha512-DFZMC9LJUG9PLOclRC32G63UXwzqS2koQC8dkx+PLdmt1xSePYpbT/NbsrJy8Q/muXz7o/h/d4A7Fuyixm559Q==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.22.5.tgz", + "integrity": "sha512-NP1M5Rf+u2Gw9qfSO4ihjcTGW5zXTi36ITLd4/EoAcEhIZ0yjMqmftDNl3QC19CX7olhrjpyU454g/2W7X0jvQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.22.5.tgz", + "integrity": "sha512-31Bb65aZaUwqCbWMnZPduIZxCBngHFlzyN6Dq6KAJjtx+lx6ohKHubc61OomYi7XwVD4Ol0XCVz4h+pYFR048g==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", + "@babel/plugin-transform-optional-chaining": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.13.0" + } + }, + "node_modules/@babel/plugin-proposal-async-generator-functions": { + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.20.7.tgz", + "integrity": "sha512-xMbiLsn/8RK7Wq7VeVytytS2L6qE69bXPB10YCmMdDZbKF4okCqY74pI/jJQ/8U0b/F6NrT2+14b8/P9/3AMGA==", + "dev": true, + "dependencies": { + "@babel/helper-environment-visitor": "^7.18.9", + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/helper-remap-async-to-generator": "^7.18.9", + "@babel/plugin-syntax-async-generators": "^7.8.4" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-private-property-in-object": { + "version": "7.21.0-placeholder-for-preset-env.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz", + "integrity": "sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==", + "dev": true, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-unicode-property-regex": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.18.6.tgz", + "integrity": "sha512-2BShG/d5yoZyXZfVePH91urL5wTG6ASZU9M4o03lKK8u8UW1y08OMttBSOADTcJrnPMpvDXRG3G8fyLh4ovs8w==", + "dev": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-static-block": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", + "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-dynamic-import": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", + "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-export-namespace-from": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz", + "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-assertions": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.22.5.tgz", + "integrity": "sha512-rdV97N7KqsRzeNGoWUOK6yUsWarLjE5Su/Snk9IYPU9CwkWHs4t+rTGOvffTR8XGkJMTAdLfO0xVnXm8wugIJg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-attributes": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.22.5.tgz", + "integrity": "sha512-KwvoWDeNKPETmozyFE0P2rOLqh39EoQHNjqizrI5B8Vt0ZNS7M56s7dAiAqbYfiAYOuIzIh96z3iR2ktgu3tEg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-private-property-in-object": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", + "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-unicode-sets-regex": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz", + "integrity": "sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg==", + "dev": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-transform-arrow-functions": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.22.5.tgz", + "integrity": "sha512-26lTNXoVRdAnsaDXPpvCNUq+OVWEVC6bx7Vvz9rC53F2bagUWW4u4ii2+h8Fejfh7RYqPxn+libeFBBck9muEw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-async-generator-functions": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.22.5.tgz", + "integrity": "sha512-gGOEvFzm3fWoyD5uZq7vVTD57pPJ3PczPUD/xCFGjzBpUosnklmXyKnGQbbbGs1NPNPskFex0j93yKbHt0cHyg==", + "dev": true, + "dependencies": { + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-remap-async-to-generator": "^7.22.5", + "@babel/plugin-syntax-async-generators": "^7.8.4" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-async-to-generator": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.22.5.tgz", + "integrity": "sha512-b1A8D8ZzE/VhNDoV1MSJTnpKkCG5bJo+19R4o4oy03zM7ws8yEMK755j61Dc3EyvdysbqH5BOOTquJ7ZX9C6vQ==", + "dev": true, + "dependencies": { + "@babel/helper-module-imports": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-remap-async-to-generator": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-block-scoped-functions": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.22.5.tgz", + "integrity": "sha512-tdXZ2UdknEKQWKJP1KMNmuF5Lx3MymtMN/pvA+p/VEkhK8jVcQ1fzSy8KM9qRYhAf2/lV33hoMPKI/xaI9sADA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-block-scoping": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.22.5.tgz", + "integrity": "sha512-EcACl1i5fSQ6bt+YGuU/XGCeZKStLmyVGytWkpyhCLeQVA0eu6Wtiw92V+I1T/hnezUv7j74dA/Ro69gWcU+hg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-class-properties": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.22.5.tgz", + "integrity": "sha512-nDkQ0NfkOhPTq8YCLiWNxp1+f9fCobEjCb0n8WdbNUBc4IB5V7P1QnX9IjpSoquKrXF5SKojHleVNs2vGeHCHQ==", + "dev": true, + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-class-static-block": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.22.5.tgz", + "integrity": "sha512-SPToJ5eYZLxlnp1UzdARpOGeC2GbHvr9d/UV0EukuVx8atktg194oe+C5BqQ8jRTkgLRVOPYeXRSBg1IlMoVRA==", + "dev": true, + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-class-static-block": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.12.0" + } + }, + "node_modules/@babel/plugin-transform-classes": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.22.5.tgz", + "integrity": "sha512-2edQhLfibpWpsVBx2n/GKOz6JdGQvLruZQfGr9l1qes2KQaWswjBzhQF7UDUZMNaMMQeYnQzxwOMPsbYF7wqPQ==", + "dev": true, + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-compilation-targets": "^7.22.5", + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-function-name": "^7.22.5", + "@babel/helper-optimise-call-expression": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-replace-supers": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.5", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-classes/node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/plugin-transform-computed-properties": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.22.5.tgz", + "integrity": "sha512-4GHWBgRf0krxPX+AaPtgBAlTgTeZmqDynokHOX7aqqAB4tHs3U2Y02zH6ETFdLZGcg9UQSD1WCmkVrE9ErHeOg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/template": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-destructuring": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.22.5.tgz", + "integrity": "sha512-GfqcFuGW8vnEqTUBM7UtPd5A4q797LTvvwKxXTgRsFjoqaJiEg9deBG6kWeQYkVEL569NpnmpC0Pkr/8BLKGnQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-dotall-regex": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.22.5.tgz", + "integrity": "sha512-5/Yk9QxCQCl+sOIB1WelKnVRxTJDSAIxtJLL2/pqL14ZVlbH0fUQUZa/T5/UnQtBNgghR7mfB8ERBKyKPCi7Vw==", + "dev": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-duplicate-keys": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.22.5.tgz", + "integrity": "sha512-dEnYD+9BBgld5VBXHnF/DbYGp3fqGMsyxKbtD1mDyIA7AkTSpKXFhCVuj/oQVOoALfBs77DudA0BE4d5mcpmqw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-dynamic-import": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.22.5.tgz", + "integrity": "sha512-0MC3ppTB1AMxd8fXjSrbPa7LT9hrImt+/fcj+Pg5YMD7UQyWp/02+JWpdnCymmsXwIx5Z+sYn1bwCn4ZJNvhqQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-dynamic-import": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-exponentiation-operator": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.22.5.tgz", + "integrity": "sha512-vIpJFNM/FjZ4rh1myqIya9jXwrwwgFRHPjT3DkUA9ZLHuzox8jiXkOLvwm1H+PQIP3CqfC++WPKeuDi0Sjdj1g==", + "dev": true, + "dependencies": { + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-export-namespace-from": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.22.5.tgz", + "integrity": "sha512-X4hhm7FRnPgd4nDA4b/5V280xCx6oL7Oob5+9qVS5C13Zq4bh1qq7LU0GgRU6b5dBWBvhGaXYVB4AcN6+ol6vg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-for-of": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.22.5.tgz", + "integrity": "sha512-3kxQjX1dU9uudwSshyLeEipvrLjBCVthCgeTp6CzE/9JYrlAIaeekVxRpCWsDDfYTfRZRoCeZatCQvwo+wvK8A==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-function-name": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.22.5.tgz", + "integrity": "sha512-UIzQNMS0p0HHiQm3oelztj+ECwFnj+ZRV4KnguvlsD2of1whUeM6o7wGNj6oLwcDoAXQ8gEqfgC24D+VdIcevg==", + "dev": true, + "dependencies": { + "@babel/helper-compilation-targets": "^7.22.5", + "@babel/helper-function-name": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-json-strings": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.22.5.tgz", + "integrity": "sha512-DuCRB7fu8MyTLbEQd1ew3R85nx/88yMoqo2uPSjevMj3yoN7CDM8jkgrY0wmVxfJZyJ/B9fE1iq7EQppWQmR5A==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-json-strings": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-literals": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.22.5.tgz", + "integrity": "sha512-fTLj4D79M+mepcw3dgFBTIDYpbcB9Sm0bpm4ppXPaO+U+PKFFyV9MGRvS0gvGw62sd10kT5lRMKXAADb9pWy8g==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-logical-assignment-operators": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.22.5.tgz", + "integrity": "sha512-MQQOUW1KL8X0cDWfbwYP+TbVbZm16QmQXJQ+vndPtH/BoO0lOKpVoEDMI7+PskYxH+IiE0tS8xZye0qr1lGzSA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-member-expression-literals": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.22.5.tgz", + "integrity": "sha512-RZEdkNtzzYCFl9SE9ATaUMTj2hqMb4StarOJLrZRbqqU4HSBE7UlBw9WBWQiDzrJZJdUWiMTVDI6Gv/8DPvfew==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-amd": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.22.5.tgz", + "integrity": "sha512-R+PTfLTcYEmb1+kK7FNkhQ1gP4KgjpSO6HfH9+f8/yfp2Nt3ggBjiVpRwmwTlfqZLafYKJACy36yDXlEmI9HjQ==", + "dev": true, + "dependencies": { + "@babel/helper-module-transforms": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.22.5.tgz", + "integrity": "sha512-B4pzOXj+ONRmuaQTg05b3y/4DuFz3WcCNAXPLb2Q0GT0TrGKGxNKV4jwsXts+StaM0LQczZbOpj8o1DLPDJIiA==", + "dev": true, + "dependencies": { + "@babel/helper-module-transforms": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-simple-access": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.22.5.tgz", + "integrity": "sha512-emtEpoaTMsOs6Tzz+nbmcePl6AKVtS1yC4YNAeMun9U8YCsgadPNxnOPQ8GhHFB2qdx+LZu9LgoC0Lthuu05DQ==", + "dev": true, + "dependencies": { + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-module-transforms": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-umd": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.22.5.tgz", + "integrity": "sha512-+S6kzefN/E1vkSsKx8kmQuqeQsvCKCd1fraCM7zXm4SFoggI099Tr4G8U81+5gtMdUeMQ4ipdQffbKLX0/7dBQ==", + "dev": true, + "dependencies": { + "@babel/helper-module-transforms": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-named-capturing-groups-regex": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.22.5.tgz", + "integrity": "sha512-YgLLKmS3aUBhHaxp5hi1WJTgOUb/NCuDHzGT9z9WTt3YG+CPRhJs6nprbStx6DnWM4dh6gt7SU3sZodbZ08adQ==", + "dev": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-transform-new-target": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.22.5.tgz", + "integrity": "sha512-AsF7K0Fx/cNKVyk3a+DW0JLo+Ua598/NxMRvxDnkpCIGFh43+h/v2xyhRUYf6oD8gE4QtL83C7zZVghMjHd+iw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-nullish-coalescing-operator": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.22.5.tgz", + "integrity": "sha512-6CF8g6z1dNYZ/VXok5uYkkBBICHZPiGEl7oDnAx2Mt1hlHVHOSIKWJaXHjQJA5VB43KZnXZDIexMchY4y2PGdA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-numeric-separator": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.22.5.tgz", + "integrity": "sha512-NbslED1/6M+sXiwwtcAB/nieypGw02Ejf4KtDeMkCEpP6gWFMX1wI9WKYua+4oBneCCEmulOkRpwywypVZzs/g==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-numeric-separator": "^7.10.4" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-object-rest-spread": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.22.5.tgz", + "integrity": "sha512-Kk3lyDmEslH9DnvCDA1s1kkd3YWQITiBOHngOtDL9Pt6BZjzqb6hiOlb8VfjiiQJ2unmegBqZu0rx5RxJb5vmQ==", + "dev": true, + "dependencies": { + "@babel/compat-data": "^7.22.5", + "@babel/helper-compilation-targets": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-transform-parameters": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-object-super": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.22.5.tgz", + "integrity": "sha512-klXqyaT9trSjIUrcsYIfETAzmOEZL3cBYqOYLJxBHfMFFggmXOv+NYSX/Jbs9mzMVESw/WycLFPRx8ba/b2Ipw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-replace-supers": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-optional-catch-binding": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.22.5.tgz", + "integrity": "sha512-pH8orJahy+hzZje5b8e2QIlBWQvGpelS76C63Z+jhZKsmzfNaPQ+LaW6dcJ9bxTpo1mtXbgHwy765Ro3jftmUg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-optional-chaining": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.22.5.tgz", + "integrity": "sha512-AconbMKOMkyG+xCng2JogMCDcqW8wedQAqpVIL4cOSescZ7+iW8utC6YDZLMCSUIReEA733gzRSaOSXMAt/4WQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", + "@babel/plugin-syntax-optional-chaining": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-parameters": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.22.5.tgz", + "integrity": "sha512-AVkFUBurORBREOmHRKo06FjHYgjrabpdqRSwq6+C7R5iTCZOsM4QbcB27St0a4U6fffyAOqh3s/qEfybAhfivg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-private-methods": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.22.5.tgz", + "integrity": "sha512-PPjh4gyrQnGe97JTalgRGMuU4icsZFnWkzicB/fUtzlKUqvsWBKEpPPfr5a2JiyirZkHxnAqkQMO5Z5B2kK3fA==", + "dev": true, + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-private-property-in-object": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.22.5.tgz", + "integrity": "sha512-/9xnaTTJcVoBtSSmrVyhtSvO3kbqS2ODoh2juEU72c3aYonNF0OMGiaz2gjukyKM2wBBYJP38S4JiE0Wfb5VMQ==", + "dev": true, + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-create-class-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-property-literals": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.22.5.tgz", + "integrity": "sha512-TiOArgddK3mK/x1Qwf5hay2pxI6wCZnvQqrFSqbtg1GLl2JcNMitVH/YnqjP+M31pLUeTfzY1HAXFDnUBV30rQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-regenerator": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.22.5.tgz", + "integrity": "sha512-rR7KePOE7gfEtNTh9Qw+iO3Q/e4DEsoQ+hdvM6QUDH7JRJ5qxq5AA52ZzBWbI5i9lfNuvySgOGP8ZN7LAmaiPw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "regenerator-transform": "^0.15.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-regenerator/node_modules/regenerator-transform": { + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.1.tgz", + "integrity": "sha512-knzmNAcuyxV+gQCufkYcvOqX/qIIfHLv0u5x79kRxuGojfYVky1f15TzZEu2Avte8QGepvUNTnLskf8E6X6Vyg==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.8.4" + } + }, + "node_modules/@babel/plugin-transform-reserved-words": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.22.5.tgz", + "integrity": "sha512-DTtGKFRQUDm8svigJzZHzb/2xatPc6TzNvAIJ5GqOKDsGFYgAskjRulbR/vGsPKq3OPqtexnz327qYpP57RFyA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-runtime": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.22.5.tgz", + "integrity": "sha512-bg4Wxd1FWeFx3daHFTWk1pkSWK/AyQuiyAoeZAOkAOUBjnZPH6KT7eMxouV47tQ6hl6ax2zyAWBdWZXbrvXlaw==", + "dev": true, + "dependencies": { + "@babel/helper-module-imports": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "babel-plugin-polyfill-corejs2": "^0.4.3", + "babel-plugin-polyfill-corejs3": "^0.8.1", + "babel-plugin-polyfill-regenerator": "^0.5.0", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-runtime/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/plugin-transform-shorthand-properties": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.22.5.tgz", + "integrity": "sha512-vM4fq9IXHscXVKzDv5itkO1X52SmdFBFcMIBZ2FRn2nqVYqw6dBexUgMvAjHW+KXpPPViD/Yo3GrDEBaRC0QYA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-spread": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.22.5.tgz", + "integrity": "sha512-5ZzDQIGyvN4w8+dMmpohL6MBo+l2G7tfC/O2Dg7/hjpgeWvUx8FzfeOKxGog9IimPa4YekaQ9PlDqTLOljkcxg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-sticky-regex": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.22.5.tgz", + "integrity": "sha512-zf7LuNpHG0iEeiyCNwX4j3gDg1jgt1k3ZdXBKbZSoA3BbGQGvMiSvfbZRR3Dr3aeJe3ooWFZxOOG3IRStYp2Bw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-template-literals": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.22.5.tgz", + "integrity": "sha512-5ciOehRNf+EyUeewo8NkbQiUs4d6ZxiHo6BcBcnFlgiJfu16q0bQUw9Jvo0b0gBKFG1SMhDSjeKXSYuJLeFSMA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-typeof-symbol": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.22.5.tgz", + "integrity": "sha512-bYkI5lMzL4kPii4HHEEChkD0rkc+nvnlR6+o/qdqR6zrm0Sv/nodmyLhlq2DO0YKLUNd2VePmPRjJXSBh9OIdA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-escapes": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.22.5.tgz", + "integrity": "sha512-biEmVg1IYB/raUO5wT1tgfacCef15Fbzhkx493D3urBI++6hpJ+RFG4SrWMn0NEZLfvilqKf3QDrRVZHo08FYg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-property-regex": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.22.5.tgz", + "integrity": "sha512-HCCIb+CbJIAE6sXn5CjFQXMwkCClcOfPCzTlilJ8cUatfzwHlWQkbtV0zD338u9dZskwvuOYTuuaMaA8J5EI5A==", + "dev": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-regex": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.22.5.tgz", + "integrity": "sha512-028laaOKptN5vHJf9/Arr/HiJekMd41hOEZYvNsrsXqJ7YPYuX2bQxh31fkZzGmq3YqHRJzYFFAVYvKfMPKqyg==", + "dev": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-sets-regex": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.22.5.tgz", + "integrity": "sha512-lhMfi4FC15j13eKrh3DnYHjpGj6UKQHtNKTbtc1igvAhRy4+kLhV07OpLcsN0VgDEw/MjAvJO4BdMJsHwMhzCg==", + "dev": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/preset-env": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.22.5.tgz", + "integrity": "sha512-fj06hw89dpiZzGZtxn+QybifF07nNiZjZ7sazs2aVDcysAZVGjW7+7iFYxg6GLNM47R/thYfLdrXc+2f11Vi9A==", + "dev": true, + "dependencies": { + "@babel/compat-data": "^7.22.5", + "@babel/helper-compilation-targets": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-validator-option": "^7.22.5", + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.22.5", + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.22.5", + "@babel/plugin-proposal-private-property-in-object": "7.21.0-placeholder-for-preset-env.2", + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-class-properties": "^7.12.13", + "@babel/plugin-syntax-class-static-block": "^7.14.5", + "@babel/plugin-syntax-dynamic-import": "^7.8.3", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3", + "@babel/plugin-syntax-import-assertions": "^7.22.5", + "@babel/plugin-syntax-import-attributes": "^7.22.5", + "@babel/plugin-syntax-import-meta": "^7.10.4", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5", + "@babel/plugin-syntax-top-level-await": "^7.14.5", + "@babel/plugin-syntax-unicode-sets-regex": "^7.18.6", + "@babel/plugin-transform-arrow-functions": "^7.22.5", + "@babel/plugin-transform-async-generator-functions": "^7.22.5", + "@babel/plugin-transform-async-to-generator": "^7.22.5", + "@babel/plugin-transform-block-scoped-functions": "^7.22.5", + "@babel/plugin-transform-block-scoping": "^7.22.5", + "@babel/plugin-transform-class-properties": "^7.22.5", + "@babel/plugin-transform-class-static-block": "^7.22.5", + "@babel/plugin-transform-classes": "^7.22.5", + "@babel/plugin-transform-computed-properties": "^7.22.5", + "@babel/plugin-transform-destructuring": "^7.22.5", + "@babel/plugin-transform-dotall-regex": "^7.22.5", + "@babel/plugin-transform-duplicate-keys": "^7.22.5", + "@babel/plugin-transform-dynamic-import": "^7.22.5", + "@babel/plugin-transform-exponentiation-operator": "^7.22.5", + "@babel/plugin-transform-export-namespace-from": "^7.22.5", + "@babel/plugin-transform-for-of": "^7.22.5", + "@babel/plugin-transform-function-name": "^7.22.5", + "@babel/plugin-transform-json-strings": "^7.22.5", + "@babel/plugin-transform-literals": "^7.22.5", + "@babel/plugin-transform-logical-assignment-operators": "^7.22.5", + "@babel/plugin-transform-member-expression-literals": "^7.22.5", + "@babel/plugin-transform-modules-amd": "^7.22.5", + "@babel/plugin-transform-modules-commonjs": "^7.22.5", + "@babel/plugin-transform-modules-systemjs": "^7.22.5", + "@babel/plugin-transform-modules-umd": "^7.22.5", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.22.5", + "@babel/plugin-transform-new-target": "^7.22.5", + "@babel/plugin-transform-nullish-coalescing-operator": "^7.22.5", + "@babel/plugin-transform-numeric-separator": "^7.22.5", + "@babel/plugin-transform-object-rest-spread": "^7.22.5", + "@babel/plugin-transform-object-super": "^7.22.5", + "@babel/plugin-transform-optional-catch-binding": "^7.22.5", + "@babel/plugin-transform-optional-chaining": "^7.22.5", + "@babel/plugin-transform-parameters": "^7.22.5", + "@babel/plugin-transform-private-methods": "^7.22.5", + "@babel/plugin-transform-private-property-in-object": "^7.22.5", + "@babel/plugin-transform-property-literals": "^7.22.5", + "@babel/plugin-transform-regenerator": "^7.22.5", + "@babel/plugin-transform-reserved-words": "^7.22.5", + "@babel/plugin-transform-shorthand-properties": "^7.22.5", + "@babel/plugin-transform-spread": "^7.22.5", + "@babel/plugin-transform-sticky-regex": "^7.22.5", + "@babel/plugin-transform-template-literals": "^7.22.5", + "@babel/plugin-transform-typeof-symbol": "^7.22.5", + "@babel/plugin-transform-unicode-escapes": "^7.22.5", + "@babel/plugin-transform-unicode-property-regex": "^7.22.5", + "@babel/plugin-transform-unicode-regex": "^7.22.5", + "@babel/plugin-transform-unicode-sets-regex": "^7.22.5", + "@babel/preset-modules": "^0.1.5", + "@babel/types": "^7.22.5", + "babel-plugin-polyfill-corejs2": "^0.4.3", + "babel-plugin-polyfill-corejs3": "^0.8.1", + "babel-plugin-polyfill-regenerator": "^0.5.0", + "core-js-compat": "^3.30.2", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/preset-env/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/preset-modules": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.5.tgz", + "integrity": "sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", + "@babel/plugin-transform-dotall-regex": "^7.4.4", + "@babel/types": "^7.4.4", + "esutils": "^2.0.2" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/regjsgen": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@babel/regjsgen/-/regjsgen-0.8.0.tgz", + "integrity": "sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==", + "dev": true + }, + "node_modules/@babel/runtime": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.5.tgz", + "integrity": "sha512-ecjvYlnAaZ/KVneE/OdKYBYfgXV3Ptu6zQWmgEF7vwKhQnvVS6bjMD2XYgj+SNvQ1GfK/pjgokfPkC/2CO8CuA==", + "dependencies": { + "regenerator-runtime": "^0.13.11" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/runtime/node_modules/regenerator-runtime": { + "version": "0.13.11", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", + "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==" + }, + "node_modules/@babel/template": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.5.tgz", + "integrity": "sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.22.5", + "@babel/parser": "^7.22.5", + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.5.tgz", + "integrity": "sha512-7DuIjPgERaNo6r+PZwItpjCZEa5vyw4eJGufeLxrPdBXBoLcCJCIasvK6pK/9DVNrLZTLFhUGqaC6X/PA007TQ==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.22.5", + "@babel/generator": "^7.22.5", + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-function-name": "^7.22.5", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.5", + "@babel/parser": "^7.22.5", + "@babel/types": "^7.22.5", + "debug": "^4.1.0", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@babel/traverse/node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/traverse/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/@babel/types": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", + "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.5", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types/node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@discoveryjs/json-ext": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", + "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", + "dev": true, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.19.tgz", + "integrity": "sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.19.tgz", + "integrity": "sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.19.tgz", + "integrity": "sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz", + "integrity": "sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz", + "integrity": "sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.19.tgz", + "integrity": "sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.19.tgz", + "integrity": "sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.19.tgz", + "integrity": "sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.19.tgz", + "integrity": "sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.19.tgz", + "integrity": "sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.19.tgz", + "integrity": "sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.19.tgz", + "integrity": "sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.19.tgz", + "integrity": "sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.19.tgz", + "integrity": "sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.19.tgz", + "integrity": "sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz", + "integrity": "sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.19.tgz", + "integrity": "sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz", + "integrity": "sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.19.tgz", + "integrity": "sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.19.tgz", + "integrity": "sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.19.tgz", + "integrity": "sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz", + "integrity": "sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@fortawesome/fontawesome-free": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-6.1.1.tgz", + "integrity": "sha512-J/3yg2AIXc9wznaVqpHVX3Wa5jwKovVF0AMYSnbmcXTiL3PpRPfF58pzWucCwEiCJBp+hCNRLWClTomD8SseKg==", + "hasInstallScript": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/@iarna/toml": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/@iarna/toml/-/toml-2.2.5.tgz", + "integrity": "sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==", + "dev": true + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } }, - "node_modules/@babel/traverse/node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true + "node_modules/@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "dependencies": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } }, - "node_modules/@babel/traverse/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "node_modules/@istanbuljs/load-nyc-config/node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "engines": { + "node": ">=6" + } }, - "node_modules/@babel/traverse/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "dependencies": { - "has-flag": "^3.0.0" + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/@babel/traverse/node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/@babel/types": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.4.tgz", - "integrity": "sha512-UTCFOxC3FsFHb7lkRMVvgLzaRVamXuAs2Tz4wajva4WxtVY82eZeaUBtC2Zt95FU9TiznuC0Zk35tsim8jeVpg==", + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.10.4", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/@babel/types/node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "node_modules/@istanbuljs/load-nyc-config/node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/@discoveryjs/json-ext": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.2.tgz", - "integrity": "sha512-HyYEUDeIj5rRQU2Hk5HTB2uHsbRQpF70nvMhVzi+VJR0X+xNEhjPui4/kBf3VeH/wqD28PT4sVOm8qqLjBrSZg==", + "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true, "engines": { - "node": ">=10.0.0" + "node": ">=8" } }, - "node_modules/@fortawesome/fontawesome-free": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-6.1.1.tgz", - "integrity": "sha512-J/3yg2AIXc9wznaVqpHVX3Wa5jwKovVF0AMYSnbmcXTiL3PpRPfF58pzWucCwEiCJBp+hCNRLWClTomD8SseKg==", - "hasInstallScript": true, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, "engines": { - "node": ">=6" + "node": ">=8" } }, - "node_modules/@iarna/toml": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/@iarna/toml/-/toml-2.2.5.tgz", - "integrity": "sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==", - "dev": true - }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", @@ -1782,75 +4840,301 @@ "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", "dev": true, "engines": { - "node": ">=6.0.0" + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.3.tgz", + "integrity": "sha512-b+fsZXeLYi9fEULmfBrhxn4IrPlINf8fiNarzTof004v3lFdntdwa9PF7vFJqm3mg7s+ScJMxXaE3Acp1irZcg==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.14", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", + "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.18", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz", + "integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "3.1.0", + "@jridgewell/sourcemap-codec": "1.4.14" + } + }, + "node_modules/@leichtgewicht/ip-codec": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz", + "integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==", + "dev": true + }, + "node_modules/@ngtools/webpack": { + "version": "16.1.3", + "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-16.1.3.tgz", + "integrity": "sha512-YTL1RzP7ErJqskx+ZwdC/nWsOSBfC4yYWmMyWL2J0d+oJ3N2XIzrKVoDcZ4IVzv3Du+3zoGp0ups/wWXvfzM/Q==", + "dev": true, + "engines": { + "node": "^16.14.0 || >=18.10.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" + }, + "peerDependencies": { + "@angular/compiler-cli": "^16.0.0", + "typescript": ">=4.9.3 <5.2", + "webpack": "^5.54.0" + } + }, + "node_modules/@nicolo-ribaudo/chokidar-2": { + "version": "2.1.8-no-fsevents.3", + "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz", + "integrity": "sha512-s88O1aVtXftvp5bCPB7WnmXc5IwOZZ7YPuwNPt+GtOOXpPvad1LfbmjYv+qII7zP6RU2QGnqve27dnLycEnyEQ==", + "dev": true, + "optional": true + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz", + "integrity": "sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.4", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz", + "integrity": "sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz", + "integrity": "sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.4", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@npmcli/fs": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-3.1.0.tgz", + "integrity": "sha512-7kZUAaLscfgbwBQRbvdMYaZOWyMEcPTH/tJjnyAWJ/dvvs9Ef+CERx/qJb9GExJpl1qipaDGn7KqHnFGGixd0w==", + "dev": true, + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@npmcli/fs/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@npmcli/fs/node_modules/semver": { + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@npmcli/fs/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/@npmcli/git": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-4.1.0.tgz", + "integrity": "sha512-9hwoB3gStVfa0N31ymBmrX+GuDGdVA/QWShZVqE0HK2Af+7QGGrCTbZia/SW0ImUTjTne7SP91qxDmtXvDHRPQ==", + "dev": true, + "dependencies": { + "@npmcli/promise-spawn": "^6.0.0", + "lru-cache": "^7.4.4", + "npm-pick-manifest": "^8.0.0", + "proc-log": "^3.0.0", + "promise-inflight": "^1.0.1", + "promise-retry": "^2.0.1", + "semver": "^7.3.5", + "which": "^3.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@npmcli/git/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/@npmcli/git/node_modules/semver": { + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@npmcli/git/node_modules/semver/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@npmcli/git/node_modules/which": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/which/-/which-3.0.1.tgz", + "integrity": "sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@npmcli/git/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/@npmcli/installed-package-contents": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@npmcli/installed-package-contents/-/installed-package-contents-2.0.2.tgz", + "integrity": "sha512-xACzLPhnfD51GKvTOOuNX2/V4G4mz9/1I2MfDoye9kBM3RYe5g2YbscsaGoTlaWqkxeiapBWyseULVKpSVHtKQ==", + "dev": true, + "dependencies": { + "npm-bundled": "^3.0.0", + "npm-normalize-package-bin": "^3.0.0" + }, + "bin": { + "installed-package-contents": "lib/index.js" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/@jridgewell/source-map": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.3.tgz", - "integrity": "sha512-b+fsZXeLYi9fEULmfBrhxn4IrPlINf8fiNarzTof004v3lFdntdwa9PF7vFJqm3mg7s+ScJMxXaE3Acp1irZcg==", + "node_modules/@npmcli/node-gyp": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/node-gyp/-/node-gyp-3.0.0.tgz", + "integrity": "sha512-gp8pRXC2oOxu0DUE1/M3bYtb1b3/DbJ5aM113+XJBgfXdussRAsX0YOrOhdd8WvnAR6auDBvJomGAkLKA5ydxA==", "dev": true, - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", - "dev": true - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.18", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz", - "integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==", + "node_modules/@npmcli/promise-spawn": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-6.0.2.tgz", + "integrity": "sha512-gGq0NJkIGSwdbUt4yhdF8ZrmkGKVz9vAdVzpOfnom+V8PLSmSOVhZwbNvZZS1EYcJN5hzzKBxmmVVAInM6HQLg==", "dev": true, "dependencies": { - "@jridgewell/resolve-uri": "3.1.0", - "@jridgewell/sourcemap-codec": "1.4.14" + "which": "^3.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/@nicolo-ribaudo/chokidar-2": { - "version": "2.1.8-no-fsevents.3", - "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz", - "integrity": "sha512-s88O1aVtXftvp5bCPB7WnmXc5IwOZZ7YPuwNPt+GtOOXpPvad1LfbmjYv+qII7zP6RU2QGnqve27dnLycEnyEQ==", - "dev": true, - "optional": true - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz", - "integrity": "sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==", + "node_modules/@npmcli/promise-spawn/node_modules/which": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/which/-/which-3.0.1.tgz", + "integrity": "sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==", "dev": true, "dependencies": { - "@nodelib/fs.stat": "2.0.4", - "run-parallel": "^1.1.9" + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/which.js" }, "engines": { - "node": ">= 8" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz", - "integrity": "sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q==", + "node_modules/@npmcli/run-script": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-6.0.2.tgz", + "integrity": "sha512-NCcr1uQo1k5U+SYlnIrbAh3cxy+OQT1VtqiAbxdymSlptbzBb62AjH2xXgjNCoP073hoa1CfCAcwoZ8k96C4nA==", "dev": true, + "dependencies": { + "@npmcli/node-gyp": "^3.0.0", + "@npmcli/promise-spawn": "^6.0.0", + "node-gyp": "^9.0.0", + "read-package-json-fast": "^3.0.0", + "which": "^3.0.0" + }, "engines": { - "node": ">= 8" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz", - "integrity": "sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow==", + "node_modules/@npmcli/run-script/node_modules/which": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/which/-/which-3.0.1.tgz", + "integrity": "sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==", "dev": true, "dependencies": { - "@nodelib/fs.scandir": "2.1.4", - "fastq": "^1.6.0" + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/which.js" }, "engines": { - "node": ">= 8" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, "node_modules/@octokit/auth-token": { @@ -2050,6 +5334,16 @@ "@octokit/openapi-types": "^13.9.1" } }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "optional": true, + "engines": { + "node": ">=14" + } + }, "node_modules/@pnpm/network.ca-file": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@pnpm/network.ca-file/-/network.ca-file-1.0.1.tgz", @@ -2103,6 +5397,44 @@ "integrity": "sha512-SLqR3GBUXuoPP5MmYtD7ompvXiG87QjT6lzOszyXjTM86Uu7At7vNnt2xgyTLq5o9T4IxTYFyGxcULqpsmsfdg==", "dev": true }, + "node_modules/@schematics/angular": { + "version": "16.1.3", + "resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-16.1.3.tgz", + "integrity": "sha512-bNSxCLf6f+/dsQ1k3PhcZhrC/qgJSCpM6h3m6ATpjR+tYW/v7WR1OyE5r3DQmDe7NJSazBvpbrRtg8xjRsMzvw==", + "dev": true, + "dependencies": { + "@angular-devkit/core": "16.1.3", + "@angular-devkit/schematics": "16.1.3", + "jsonc-parser": "3.2.0" + }, + "engines": { + "node": "^16.14.0 || >=18.10.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" + } + }, + "node_modules/@sigstore/protobuf-specs": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@sigstore/protobuf-specs/-/protobuf-specs-0.1.0.tgz", + "integrity": "sha512-a31EnjuIDSX8IXBUib3cYLDRlPMU36AWX4xS8ysLaNu4ZzUesDiPt83pgrW2X1YLMe5L2HbDyaKK5BrL4cNKaQ==", + "dev": true, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@sigstore/tuf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@sigstore/tuf/-/tuf-1.0.2.tgz", + "integrity": "sha512-vjwcYePJzM01Ha6oWWZ9gNcdIgnzyFxfqfWzph483DPJTH8Tb7f7bQRRll3CYVkyH56j0AgcPAcl6Vg95DPF+Q==", + "dev": true, + "dependencies": { + "@sigstore/protobuf-specs": "^0.1.0", + "tuf-js": "^1.1.7" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/@sindresorhus/is": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.3.0.tgz", @@ -2136,6 +5468,52 @@ "node": ">= 6" } }, + "node_modules/@tufjs/canonical-json": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@tufjs/canonical-json/-/canonical-json-1.0.0.tgz", + "integrity": "sha512-QTnf++uxunWvG2z3UFNzAoQPHxnSXOwtaI3iJ+AohhV+5vONuArPjJE7aPXPVXfXJsqrVbZBu9b81AJoSd09IQ==", + "dev": true, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@tufjs/models": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tufjs/models/-/models-1.0.4.tgz", + "integrity": "sha512-qaGV9ltJP0EO25YfFUPhxRVK0evXFIAGicsVXuRim4Ed9cjPxYhNnNJ49SFmbeLgtxpslIkX317IgpfcHPVj/A==", + "dev": true, + "dependencies": { + "@tufjs/canonical-json": "1.0.0", + "minimatch": "^9.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@tufjs/models/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@tufjs/models/node_modules/minimatch": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.2.tgz", + "integrity": "sha512-PZOT9g5v2ojiTL7r1xF6plNHLtOeTpSlDI007As2NlA2aYBMfVom17yqa6QzhmDP8QOhn7LjHTg7DFCVSSa6yg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/@turf/along": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/along/-/along-6.5.0.tgz", @@ -5605,6 +8983,25 @@ "@types/angular": "*" } }, + "node_modules/@types/body-parser": { + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", + "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", + "dev": true, + "dependencies": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "node_modules/@types/bonjour": { + "version": "3.5.10", + "resolved": "https://registry.npmjs.org/@types/bonjour/-/bonjour-3.5.10.tgz", + "integrity": "sha512-p7ienRMiS41Nu2/igbJxxLDWrSZ0WxM8UQgCeO9KhoVF7cOVFkrKsiDr1EsJIla8vV3oEEjGcz11jc5yimhzZw==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/cacheable-request": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.2.tgz", @@ -5617,6 +9014,25 @@ "@types/responselike": "*" } }, + "node_modules/@types/connect": { + "version": "3.4.35", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", + "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/connect-history-api-fallback": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@types/connect-history-api-fallback/-/connect-history-api-fallback-1.5.0.tgz", + "integrity": "sha512-4x5FkPpLipqwthjPsF7ZRbOv3uoLUFkTA9G9v583qi4pACvq0uTELrB8OLUzPWUI4IJIyvM85vzkV1nyiI2Lig==", + "dev": true, + "dependencies": { + "@types/express-serve-static-core": "*", + "@types/node": "*" + } + }, "node_modules/@types/eslint": { "version": "8.40.2", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.40.2.tgz", @@ -5643,6 +9059,30 @@ "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==", "dev": true }, + "node_modules/@types/express": { + "version": "4.17.17", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.17.tgz", + "integrity": "sha512-Q4FmmuLGBG58btUnfS1c1r/NQdlp3DMfGDGig8WhfpA2YRUtEkxAjkZb0yvplJGYdF1fsQ81iMDcH24sSCNC/Q==", + "dev": true, + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.33", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "node_modules/@types/express-serve-static-core": { + "version": "4.17.35", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.35.tgz", + "integrity": "sha512-wALWQwrgiB2AWTT91CB62b6Yt0sNHpznUXeZEcnPU3DRdlDIz74x8Qg1UUYKSVFi+va5vKOLYRBI1bRKiLLKIg==", + "dev": true, + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*", + "@types/send": "*" + } + }, "node_modules/@types/geojson": { "version": "7946.0.8", "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.8.tgz", @@ -5654,6 +9094,21 @@ "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==", "dev": true }, + "node_modules/@types/http-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-/K3ds8TRAfBvi5vfjuz8y6+GiAYBZ0x4tXv1Av6CWBWn0IlADc+ZX9pMq7oU0fNQPnBwIZl3rmeLp6SBApbxSQ==", + "dev": true + }, + "node_modules/@types/http-proxy": { + "version": "1.17.11", + "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.11.tgz", + "integrity": "sha512-HC8G7c1WmaF2ekqpnFq626xd3Zz0uvaqFmBJNRZCGEZCXkvSdJoNFn/8Ygbd9fKNQj8UzLdCETaI0UWPAjK7IA==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/jasmine": { "version": "4.3.5", "resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-4.3.5.tgz", @@ -5675,6 +9130,12 @@ "@types/node": "*" } }, + "node_modules/@types/mime": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", + "integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==", + "dev": true + }, "node_modules/@types/node": { "version": "14.14.31", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.31.tgz", @@ -5687,12 +9148,24 @@ "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", "dev": true }, + "node_modules/@types/qs": { + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", + "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==", + "dev": true + }, "node_modules/@types/raf": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/@types/raf/-/raf-3.4.0.tgz", "integrity": "sha512-taW5/WYqo36N7V39oYyHP9Ipfd5pNFvGTIQsNGj86xV88YQ7GnI30/yMfKDF7Zgin0m3e+ikX88FvImnK4RjGw==", "optional": true }, + "node_modules/@types/range-parser": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", + "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==", + "dev": true + }, "node_modules/@types/responselike": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz", @@ -5702,6 +9175,60 @@ "@types/node": "*" } }, + "node_modules/@types/retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==", + "dev": true + }, + "node_modules/@types/send": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.1.tgz", + "integrity": "sha512-Cwo8LE/0rnvX7kIIa3QHCkcuF21c05Ayb0ZfxPiv0W8VRiZiNW/WuRupHKpqqGVGf7SUA44QSOUKaEd9lIrd/Q==", + "dev": true, + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } + }, + "node_modules/@types/serve-index": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@types/serve-index/-/serve-index-1.9.1.tgz", + "integrity": "sha512-d/Hs3nWDxNL2xAczmOVZNj92YZCS6RGxfBPjKzuu/XirCgXdpKEb88dYNbrYGint6IVWLNP+yonwVAuRC0T2Dg==", + "dev": true, + "dependencies": { + "@types/express": "*" + } + }, + "node_modules/@types/serve-static": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.2.tgz", + "integrity": "sha512-J2LqtvFYCzaj8pVYKw8klQXrLLk7TBZmQ4ShlcdkELFKGwGMfevMLneMMRkMgZxotOD9wg497LpC7O8PcvAmfw==", + "dev": true, + "dependencies": { + "@types/http-errors": "*", + "@types/mime": "*", + "@types/node": "*" + } + }, + "node_modules/@types/sockjs": { + "version": "0.3.33", + "resolved": "https://registry.npmjs.org/@types/sockjs/-/sockjs-0.3.33.tgz", + "integrity": "sha512-f0KEEe05NvUnat+boPTZ0dgaLZ4SfSouXUgv5noUiefG2ajgKjmETo9ZJyuqsl7dfl2aHlLJUiki6B4ZYldiiw==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/ws": { + "version": "8.5.5", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.5.tgz", + "integrity": "sha512-lwhs8hktwxSjf9UaZ9tG5M03PGogvFaH8gUgLNbN9HKIg0dvv6q+gkSuJ8HN4/VbyxkuLzCjlN7GquQ0gUJfIg==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/yauzl": { "version": "2.9.1", "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.9.1.tgz", @@ -5712,6 +9239,18 @@ "@types/node": "*" } }, + "node_modules/@vitejs/plugin-basic-ssl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-basic-ssl/-/plugin-basic-ssl-1.0.1.tgz", + "integrity": "sha512-pcub+YbFtFhaGRTo1832FQHQSHvMrlb43974e2eS8EKleR3p1cDdkJFPci1UhwkEf1J9Bz+wKBSzqpKp7nNj2A==", + "dev": true, + "engines": { + "node": ">=14.6.0" + }, + "peerDependencies": { + "vite": "^3.0.0 || ^4.0.0" + } + }, "node_modules/@webassemblyjs/ast": { "version": "1.11.6", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz", @@ -5906,12 +9445,37 @@ "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", "dev": true }, + "node_modules/@yarnpkg/lockfile": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", + "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==", + "dev": true + }, + "node_modules/abab": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", + "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", + "dev": true + }, "node_modules/abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dev": true, + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/acorn": { "version": "8.8.2", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", @@ -5972,6 +9536,19 @@ "node": ">=0.4.0" } }, + "node_modules/adjust-sourcemap-loader": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/adjust-sourcemap-loader/-/adjust-sourcemap-loader-4.0.0.tgz", + "integrity": "sha512-OXwN5b9pCUXNQHJpwwD2qP40byEmSgzj8B4ydSN0uMNYWiFmJ6x6KwUllMmfk8Rwu/HJDFR7U8ubsWBoN0Xp0A==", + "dev": true, + "dependencies": { + "loader-utils": "^2.0.0", + "regex-parser": "^2.2.11" + }, + "engines": { + "node": ">=8.9" + } + }, "node_modules/adler-32": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/adler-32/-/adler-32-1.2.0.tgz", @@ -6021,18 +9598,77 @@ "slimscroll": "^0.9.1" } }, - "node_modules/ag-grid-community": { - "version": "26.2.1", - "resolved": "https://registry.npmjs.org/ag-grid-community/-/ag-grid-community-26.2.1.tgz", - "integrity": "sha512-aChSGNdPkBda4BhOUUEAmAkRlIG7rFU8UTXx3NPStavrCOHKLDRV90djIKuiXfM6ONBqKmeqw2as0yuLnSN8dw==" + "node_modules/ag-grid-community": { + "version": "26.2.1", + "resolved": "https://registry.npmjs.org/ag-grid-community/-/ag-grid-community-26.2.1.tgz", + "integrity": "sha512-aChSGNdPkBda4BhOUUEAmAkRlIG7rFU8UTXx3NPStavrCOHKLDRV90djIKuiXfM6ONBqKmeqw2as0yuLnSN8dw==" + }, + "node_modules/agent-base": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-5.1.1.tgz", + "integrity": "sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g==", + "dev": true, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/agentkeepalive": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.3.0.tgz", + "integrity": "sha512-7Epl1Blf4Sy37j4v9f9FjICCh4+KAQOyXgHEwlyBiAQLbhKdq/i2QQU3amQalS/wPhdPzDXPL5DMR5bkn+YeWg==", + "dev": true, + "dependencies": { + "debug": "^4.1.0", + "depd": "^2.0.0", + "humanize-ms": "^1.2.1" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/agentkeepalive/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/agentkeepalive/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true }, - "node_modules/agent-base": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-5.1.1.tgz", - "integrity": "sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g==", + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/aggregate-error/node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "dev": true, "engines": { - "node": ">= 6.0.0" + "node": ">=8" } }, "node_modules/ajv": { @@ -6051,6 +9687,45 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/ajv-formats": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", + "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", + "dev": true, + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/ajv-formats/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, "node_modules/ajv-keywords": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", @@ -6176,9 +9851,9 @@ } }, "node_modules/ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", "dev": true, "engines": { "node": ">=6" @@ -6199,6 +9874,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/ansi-html-community": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/ansi-html-community/-/ansi-html-community-0.0.8.tgz", + "integrity": "sha512-1APHAyr3+PCamwNw3bXCPp4HFLONZt/yIH0sZp0/469KWNTEy+qN5jQ3GVX6DMZ1UXAi34yVwtTeaG/HpBuuzw==", + "dev": true, + "engines": [ + "node >= 0.8.0" + ], + "bin": { + "ansi-html": "bin/ansi-html" + } + }, "node_modules/ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", @@ -6222,7 +9909,6 @@ "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", "dev": true, - "optional": true, "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -6236,7 +9922,6 @@ "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true, - "optional": true, "engines": { "node": ">=0.10.0" } @@ -6253,6 +9938,12 @@ "node": ">=4" } }, + "node_modules/aproba": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", + "dev": true + }, "node_modules/archiver": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/archiver/-/archiver-2.1.1.tgz", @@ -6304,6 +9995,62 @@ "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", "dev": true }, + "node_modules/are-we-there-yet": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz", + "integrity": "sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==", + "dev": true, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/are-we-there-yet/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/are-we-there-yet/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/are-we-there-yet/node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, "node_modules/arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", @@ -6337,6 +10084,12 @@ "node": ">=0.10.0" } }, + "node_modules/array-flatten": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-2.1.2.tgz", + "integrity": "sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ==", + "dev": true + }, "node_modules/array-slice": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz", @@ -6660,12 +10413,6 @@ "node": ">=4" } }, - "node_modules/ast-types/node_modules/tslib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", - "dev": true - }, "node_modules/async": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", @@ -6698,6 +10445,39 @@ "node": ">= 4.5.0" } }, + "node_modules/autoprefixer": { + "version": "10.4.14", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.14.tgz", + "integrity": "sha512-FQzyfOsTlwVzjHxKEqRIAdJx9niO6VCBCoEwax/VLSoQF29ggECcPuBqUMZ+u8jCZOPSy8b8/8KnuFbp0SaFZQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/autoprefixer" + } + ], + "dependencies": { + "browserslist": "^4.21.5", + "caniuse-lite": "^1.0.30001464", + "fraction.js": "^4.2.0", + "normalize-range": "^0.1.2", + "picocolors": "^1.0.0", + "postcss-value-parser": "^4.2.0" + }, + "bin": { + "autoprefixer": "bin/autoprefixer" + }, + "engines": { + "node": "^10 || ^12 || >=14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, "node_modules/available-typed-arrays": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.2.tgz", @@ -6860,76 +10640,245 @@ "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", "dev": true, "dependencies": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "node_modules/babel-helper-hoist-variables": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz", + "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", + "dev": true, + "dependencies": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "node_modules/babel-helper-optimise-call-expression": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz", + "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=", + "dev": true, + "dependencies": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "node_modules/babel-helper-regex": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz", + "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=", + "dev": true, + "dependencies": { + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" + } + }, + "node_modules/babel-helper-remap-async-to-generator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz", + "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=", + "dev": true, + "dependencies": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "node_modules/babel-helper-replace-supers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz", + "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=", + "dev": true, + "dependencies": { + "babel-helper-optimise-call-expression": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "node_modules/babel-helpers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", + "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", + "dev": true, + "dependencies": { + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "node_modules/babel-loader": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-9.1.2.tgz", + "integrity": "sha512-mN14niXW43tddohGl8HPu5yfQq70iUThvFL/4QzESA7GcZoC0eVOhvWdQ8+3UlSjaDE9MVtsW9mxDY07W7VpVA==", + "dev": true, + "dependencies": { + "find-cache-dir": "^3.3.2", + "schema-utils": "^4.0.0" + }, + "engines": { + "node": ">= 14.15.0" + }, + "peerDependencies": { + "@babel/core": "^7.12.0", + "webpack": ">=5" + } + }, + "node_modules/babel-loader/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/babel-loader/node_modules/ajv-keywords": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", + "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.3" + }, + "peerDependencies": { + "ajv": "^8.8.2" + } + }, + "node_modules/babel-loader/node_modules/find-cache-dir": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", + "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", + "dev": true, + "dependencies": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/avajs/find-cache-dir?sponsor=1" + } + }, + "node_modules/babel-loader/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-loader/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "node_modules/babel-loader/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/babel-helper-hoist-variables": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz", - "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", + "node_modules/babel-loader/node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, "dependencies": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/babel-helper-optimise-call-expression": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz", - "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=", + "node_modules/babel-loader/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "dependencies": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/babel-helper-regex": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz", - "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=", + "node_modules/babel-loader/node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, - "dependencies": { - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "lodash": "^4.17.4" + "engines": { + "node": ">=8" } }, - "node_modules/babel-helper-remap-async-to-generator": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz", - "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=", + "node_modules/babel-loader/node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, "dependencies": { - "babel-helper-function-name": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/babel-helper-replace-supers": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz", - "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=", + "node_modules/babel-loader/node_modules/schema-utils": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz", + "integrity": "sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==", "dev": true, "dependencies": { - "babel-helper-optimise-call-expression": "^6.24.1", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" + "@types/json-schema": "^7.0.9", + "ajv": "^8.9.0", + "ajv-formats": "^2.1.1", + "ajv-keywords": "^5.1.0" + }, + "engines": { + "node": ">= 12.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" } }, - "node_modules/babel-helpers": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", - "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", + "node_modules/babel-loader/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true, - "dependencies": { - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" + "bin": { + "semver": "bin/semver.js" } }, "node_modules/babel-messages": { @@ -6961,6 +10910,118 @@ "babel-runtime": "^6.22.0" } }, + "node_modules/babel-plugin-istanbul": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", + "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-instrument": "^5.0.4", + "test-exclude": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-coverage": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", + "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", + "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", + "dev": true, + "dependencies": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-istanbul/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/babel-plugin-istanbul/node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-polyfill-corejs2": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.3.tgz", + "integrity": "sha512-bM3gHc337Dta490gg+/AseNB9L4YLHxq1nGKZZSHbhXv4aTYU2MD2cjza1Ru4S6975YLTaL1K8uJf6ukJhhmtw==", + "dev": true, + "dependencies": { + "@babel/compat-data": "^7.17.7", + "@babel/helper-define-polyfill-provider": "^0.4.0", + "semver": "^6.1.1" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/babel-plugin-polyfill-corejs2/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/babel-plugin-polyfill-corejs3": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.8.1.tgz", + "integrity": "sha512-ikFrZITKg1xH6pLND8zT14UPgjKHiGLqex7rGEZCH2EvhsneJaJPemmpQaIZV5AL03II+lXylw3UmddDK8RU5Q==", + "dev": true, + "dependencies": { + "@babel/helper-define-polyfill-provider": "^0.4.0", + "core-js-compat": "^3.30.1" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/babel-plugin-polyfill-regenerator": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.5.0.tgz", + "integrity": "sha512-hDJtKjMLVa7Z+LwnTCxoDLQj6wdc+B8dun7ayF2fYieI6OzfuvcLMB32ihJZ4UhCBwNYGl5bg/x/P9cMdnkc2g==", + "dev": true, + "dependencies": { + "@babel/helper-define-polyfill-provider": "^0.4.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "node_modules/babel-plugin-syntax-async-functions": { "version": "6.13.0", "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz", @@ -7437,9 +11498,23 @@ } }, "node_modules/base64-js": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", - "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==" + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, "node_modules/basic-auth": { "version": "2.0.1", @@ -7459,6 +11534,12 @@ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, + "node_modules/batch": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", + "integrity": "sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==", + "dev": true + }, "node_modules/bcrypt-pbkdf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", @@ -7488,7 +11569,6 @@ "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", "dev": true, - "optional": true, "engines": { "node": ">=8" } @@ -7555,6 +11635,87 @@ "safe-json-parse": "~1.0.1" } }, + "node_modules/body-parser": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", + "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", + "dev": true, + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.1", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/body-parser/node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/body-parser/node_modules/qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dev": true, + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/body-parser/node_modules/raw-body": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "dev": true, + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/bonjour-service": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/bonjour-service/-/bonjour-service-1.1.1.tgz", + "integrity": "sha512-Z/5lQRMOG9k7W+FkeGTNjh7htqn/2LMnfOvBZ8pynNZCM9MwkQkI3zeI4oz09uWdcgmgHugVvBqxGg4VQJ5PCg==", + "dev": true, + "dependencies": { + "array-flatten": "^2.1.2", + "dns-equal": "^1.0.0", + "fast-deep-equal": "^3.1.3", + "multicast-dns": "^7.2.5" + } + }, + "node_modules/boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", + "dev": true + }, "node_modules/bootstrap": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-3.4.1.tgz", @@ -7982,29 +12143,10 @@ "JSONStream": "^1.0.3", "shasum-object": "^1.0.0", "subarg": "^1.0.0", - "through2": "^2.0.0" - }, - "bin": { - "deps-sort": "bin/cmd.js" - } - }, - "node_modules/browserify/node_modules/glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" + "through2": "^2.0.0" }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "bin": { + "deps-sort": "bin/cmd.js" } }, "node_modules/browserify/node_modules/insert-module-globals": { @@ -8302,46 +12444,6 @@ "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" }, - "node_modules/buffer/node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/buffer/node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, "node_modules/builtin-modules": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", @@ -8356,12 +12458,198 @@ "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=" }, + "node_modules/builtins": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", + "integrity": "sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==", + "dev": true, + "dependencies": { + "semver": "^7.0.0" + } + }, + "node_modules/builtins/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/builtins/node_modules/semver": { + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/builtins/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/bytes": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/bytes/-/bytes-1.0.0.tgz", "integrity": "sha1-NWnt6Lo0MV+rmcPpLLBMciDeH6g=", "dev": true }, + "node_modules/cacache": { + "version": "17.1.3", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-17.1.3.tgz", + "integrity": "sha512-jAdjGxmPxZh0IipMdR7fK/4sDSrHMLUV0+GvVUsjwyGNKHsh79kW/otg+GkbXwl6Uzvy9wsvHOX4nUoWldeZMg==", + "dev": true, + "dependencies": { + "@npmcli/fs": "^3.1.0", + "fs-minipass": "^3.0.0", + "glob": "^10.2.2", + "lru-cache": "^7.7.1", + "minipass": "^5.0.0", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "p-map": "^4.0.0", + "ssri": "^10.0.0", + "tar": "^6.1.11", + "unique-filename": "^3.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/cacache/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/cacache/node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/cacache/node_modules/foreground-child": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", + "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/cacache/node_modules/glob": { + "version": "10.3.1", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.1.tgz", + "integrity": "sha512-9BKYcEeIs7QwlCYs+Y3GBvqAMISufUS0i2ELd11zpZjxI5V9iyRj0HgzB5/cLf2NY4vcYBTYzJ7GIui7j/4DOw==", + "dev": true, + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.0.3", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2", + "path-scurry": "^1.10.0" + }, + "bin": { + "glob": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/cacache/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/cacache/node_modules/minimatch": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.2.tgz", + "integrity": "sha512-PZOT9g5v2ojiTL7r1xF6plNHLtOeTpSlDI007As2NlA2aYBMfVom17yqa6QzhmDP8QOhn7LjHTg7DFCVSSa6yg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/cacache/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/cacache/node_modules/signal-exit": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.0.2.tgz", + "integrity": "sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/cacache/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/cacheable-lookup": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-6.1.0.tgz", @@ -8603,7 +12891,6 @@ "url": "https://paulmillr.com/funding/" } ], - "optional": true, "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", @@ -8625,7 +12912,6 @@ "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true, - "optional": true, "engines": { "node": ">=0.10.0" } @@ -8648,6 +12934,12 @@ "node": ">=6.0" } }, + "node_modules/chrome-trace-event/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, "node_modules/ci-info": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.4.0.tgz", @@ -8703,6 +12995,15 @@ "node": ">=0.10.0" } }, + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/clean-yaml-object": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/clean-yaml-object/-/clean-yaml-object-0.1.0.tgz", @@ -8772,25 +13073,6 @@ "node": ">= 12" } }, - "node_modules/cli/node_modules/glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/cliui": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", @@ -8964,6 +13246,51 @@ "node": ">= 0.10.0" } }, + "node_modules/compressible": { + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", + "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", + "dev": true, + "dependencies": { + "mime-db": ">= 1.43.0 < 2" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/compression": { + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz", + "integrity": "sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==", + "dev": true, + "dependencies": { + "accepts": "~1.3.5", + "bytes": "3.0.0", + "compressible": "~2.0.16", + "debug": "2.6.9", + "on-headers": "~1.0.2", + "safe-buffer": "5.1.2", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/compression/node_modules/bytes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", + "integrity": "sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/compression/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -9034,6 +13361,15 @@ "typedarray-to-buffer": "^3.1.5" } }, + "node_modules/connect-history-api-fallback": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-2.0.0.tgz", + "integrity": "sha512-U73+6lQFmfiNPrYbXqr6kZ1i1wiRqXnp2nhMsINseWXO8lDau0LGEffJ8kQi4EjLZympVgRdvqjAgiZ1tgzDDA==", + "dev": true, + "engines": { + "node": ">=0.8" + } + }, "node_modules/console-browserify": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", @@ -9042,10 +13378,57 @@ "date-now": "^0.1.4" } }, - "node_modules/constants-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", - "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=" + "node_modules/console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", + "dev": true + }, + "node_modules/constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=" + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dev": true, + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-disposition/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "dev": true, + "engines": { + "node": ">= 0.6" + } }, "node_modules/continuable-cache": { "version": "0.3.1", @@ -9058,6 +13441,33 @@ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=" }, + "node_modules/cookie": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", + "dev": true + }, + "node_modules/copy-anything": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/copy-anything/-/copy-anything-2.0.6.tgz", + "integrity": "sha512-1j20GZTsvKNkc4BY3NpMOM8tt///wY3FpIzozTOFO2ffuZcV61nojHXVKIy3WM+7ADCy5FVhdZYHYDdgTU0yJw==", + "dev": true, + "dependencies": { + "is-what": "^3.14.1" + }, + "funding": { + "url": "https://github.com/sponsors/mesqueeb" + } + }, "node_modules/copy-webpack-plugin": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-7.0.0.tgz", @@ -9116,6 +13526,19 @@ "dev": true, "hasInstallScript": true }, + "node_modules/core-js-compat": { + "version": "3.31.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.31.0.tgz", + "integrity": "sha512-hM7YCu1cU6Opx7MXNu0NuumM0ezNeAeRKadixyiQELWY3vT3De9S4J5ZBMraWV2vZnrE1Cirl0GtFtDtMUXzPw==", + "dev": true, + "dependencies": { + "browserslist": "^4.21.5" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, "node_modules/core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -9285,6 +13708,189 @@ "sha.js": "^2.4.8" } }, + "node_modules/critters": { + "version": "0.0.19", + "resolved": "https://registry.npmjs.org/critters/-/critters-0.0.19.tgz", + "integrity": "sha512-Fm4ZAXsG0VzWy1U30rP4qxbaWGSsqXDgSupJW1OUJGDAs0KWC+j37v7p5a2kZ9BPJvhRzWm3be+Hc9WvQOBUOw==", + "dev": true, + "dependencies": { + "chalk": "^4.1.0", + "css-select": "^5.1.0", + "dom-serializer": "^2.0.0", + "domhandler": "^5.0.2", + "htmlparser2": "^8.0.2", + "postcss": "^8.4.23", + "pretty-bytes": "^5.3.0" + } + }, + "node_modules/critters/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/critters/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/critters/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/critters/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/critters/node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dev": true, + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/critters/node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ] + }, + "node_modules/critters/node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dev": true, + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/critters/node_modules/domutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", + "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", + "dev": true, + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/critters/node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true, + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/critters/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/critters/node_modules/htmlparser2": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.2.tgz", + "integrity": "sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==", + "dev": true, + "funding": [ + "https://github.com/fb55/htmlparser2?sponsor=1", + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1", + "entities": "^4.4.0" + } + }, + "node_modules/critters/node_modules/pretty-bytes": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", + "integrity": "sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==", + "dev": true, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/critters/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/cross-spawn": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.2.tgz", @@ -9313,35 +13919,201 @@ "randomfill": "^1.0.3" }, "engines": { - "node": "*" + "node": "*" + } + }, + "node_modules/crypto-js": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.0.0.tgz", + "integrity": "sha512-bzHZN8Pn+gS7DQA6n+iUmBfl0hO5DJq++QP3U6uTucDtk/0iGpXd/Gg7CGR0p8tJhofJyaKoWBuJI4eAO00BBg==" + }, + "node_modules/crypto-random-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-4.0.0.tgz", + "integrity": "sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA==", + "dev": true, + "dependencies": { + "type-fest": "^1.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/css-line-break": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/css-line-break/-/css-line-break-2.1.0.tgz", + "integrity": "sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==", + "dependencies": { + "utrie": "^1.0.2" + } + }, + "node_modules/css-loader": { + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-6.8.1.tgz", + "integrity": "sha512-xDAXtEVGlD0gJ07iclwWVkLoZOpEvAWaSyf6W18S2pOC//K8+qUDIx8IIT3D+HjnmkJPQeesOPv5aiUaJsCM2g==", + "dev": true, + "dependencies": { + "icss-utils": "^5.1.0", + "postcss": "^8.4.21", + "postcss-modules-extract-imports": "^3.0.0", + "postcss-modules-local-by-default": "^4.0.3", + "postcss-modules-scope": "^3.0.0", + "postcss-modules-values": "^4.0.0", + "postcss-value-parser": "^4.2.0", + "semver": "^7.3.8" + }, + "engines": { + "node": ">= 12.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.0.0" + } + }, + "node_modules/css-loader/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/css-loader/node_modules/semver": { + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/css-loader/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/css-select": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", + "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", + "dev": true, + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/css-select/node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dev": true, + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/css-select/node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ] + }, + "node_modules/css-select/node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dev": true, + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" } }, - "node_modules/crypto-js": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.0.0.tgz", - "integrity": "sha512-bzHZN8Pn+gS7DQA6n+iUmBfl0hO5DJq++QP3U6uTucDtk/0iGpXd/Gg7CGR0p8tJhofJyaKoWBuJI4eAO00BBg==" - }, - "node_modules/crypto-random-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-4.0.0.tgz", - "integrity": "sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA==", + "node_modules/css-select/node_modules/domutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", + "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", "dev": true, "dependencies": { - "type-fest": "^1.0.1" + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/css-select/node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true, "engines": { - "node": ">=12" + "node": ">=0.12" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/fb55/entities?sponsor=1" } }, - "node_modules/css-line-break": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/css-line-break/-/css-line-break-2.1.0.tgz", - "integrity": "sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==", - "dependencies": { - "utrie": "^1.0.2" + "node_modules/css-what": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", + "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", + "dev": true, + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "dev": true, + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" } }, "node_modules/currently-unhandled": { @@ -9524,6 +14296,18 @@ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, + "node_modules/default-gateway": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/default-gateway/-/default-gateway-6.0.3.tgz", + "integrity": "sha512-fwSOJsbbNzZ/CUFpqFBqYfYNLj1NbMPm8MMCIzHjC83iSJRBEGmDUxU+WP661BaBQImeC2yHwXtz+P/O9o+XEg==", + "dev": true, + "dependencies": { + "execa": "^5.0.0" + }, + "engines": { + "node": ">= 10" + } + }, "node_modules/default-require-extensions": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-2.0.0.tgz", @@ -9612,6 +14396,12 @@ "node": ">=0.4.0" } }, + "node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "dev": true + }, "node_modules/density-clustering": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/density-clustering/-/density-clustering-1.3.0.tgz", @@ -9641,6 +14431,16 @@ "minimalistic-assert": "^1.0.0" } }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "dev": true, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, "node_modules/detect-file": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", @@ -9674,6 +14474,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/detect-node": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz", + "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==", + "dev": true + }, "node_modules/detective": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/detective/-/detective-5.2.0.tgz", @@ -9740,6 +14546,24 @@ "node": ">=8" } }, + "node_modules/dns-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/dns-equal/-/dns-equal-1.0.0.tgz", + "integrity": "sha512-z+paD6YUQsk+AbGCEM4PrOXSss5gd66QfcVBFTKR/HpFL9jCqikS94HYwKww6fQyO7IxrIIyUu+g0Ka9tUS2Cg==", + "dev": true + }, + "node_modules/dns-packet": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-5.6.0.tgz", + "integrity": "sha512-rza3UH1LwdHh9qyPXp8lkwpjSNk/AMD3dPytUoRoqnypDUhY0xvbdmVhWOfxO68frEfV9BU8V12Ez7ZsHGZpCQ==", + "dev": true, + "dependencies": { + "@leichtgewicht/ip-codec": "^2.0.1" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/docx": { "version": "7.3.0", "resolved": "https://registry.npmjs.org/docx/-/docx-7.3.0.tgz", @@ -9903,6 +14727,12 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "dev": true + }, "node_modules/ejs": { "version": "2.7.4", "resolved": "https://registry.npmjs.org/ejs/-/ejs-2.7.4.tgz", @@ -9958,6 +14788,38 @@ "node": ">= 4" } }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/encoding": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", + "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "dev": true, + "optional": true, + "dependencies": { + "iconv-lite": "^0.6.2" + } + }, + "node_modules/encoding/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "optional": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/end-of-stream": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", @@ -9997,6 +14859,15 @@ "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz", "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=" }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/envinfo": { "version": "7.7.4", "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.7.4.tgz", @@ -10009,6 +14880,25 @@ "node": ">=4" } }, + "node_modules/err-code": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", + "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", + "dev": true + }, + "node_modules/errno": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz", + "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==", + "dev": true, + "optional": true, + "dependencies": { + "prr": "~1.0.1" + }, + "bin": { + "errno": "cli.js" + } + }, "node_modules/error": { "version": "7.2.1", "resolved": "https://registry.npmjs.org/error/-/error-7.2.1.tgz", @@ -10155,6 +15045,55 @@ "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" }, + "node_modules/esbuild": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.19.tgz", + "integrity": "sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.17.19", + "@esbuild/android-arm64": "0.17.19", + "@esbuild/android-x64": "0.17.19", + "@esbuild/darwin-arm64": "0.17.19", + "@esbuild/darwin-x64": "0.17.19", + "@esbuild/freebsd-arm64": "0.17.19", + "@esbuild/freebsd-x64": "0.17.19", + "@esbuild/linux-arm": "0.17.19", + "@esbuild/linux-arm64": "0.17.19", + "@esbuild/linux-ia32": "0.17.19", + "@esbuild/linux-loong64": "0.17.19", + "@esbuild/linux-mips64el": "0.17.19", + "@esbuild/linux-ppc64": "0.17.19", + "@esbuild/linux-riscv64": "0.17.19", + "@esbuild/linux-s390x": "0.17.19", + "@esbuild/linux-x64": "0.17.19", + "@esbuild/netbsd-x64": "0.17.19", + "@esbuild/openbsd-x64": "0.17.19", + "@esbuild/sunos-x64": "0.17.19", + "@esbuild/win32-arm64": "0.17.19", + "@esbuild/win32-ia32": "0.17.19", + "@esbuild/win32-x64": "0.17.19" + } + }, + "node_modules/esbuild-wasm": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/esbuild-wasm/-/esbuild-wasm-0.17.19.tgz", + "integrity": "sha512-X9UQEMJMZXwlGCfqcBmJ1jEa+KrLfd+gCBypO/TSzo5hZvbVwFqpxj1YCuX54ptTF75wxmrgorR4RL40AKtLVg==", + "dev": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -10176,6 +15115,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "dev": true + }, "node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -10291,11 +15236,26 @@ "node": ">=0.10.0" } }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/eve-raphael": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/eve-raphael/-/eve-raphael-0.5.0.tgz", "integrity": "sha1-F8dUt5K+7z+maE15z1pHxjxM2jA=" }, + "node_modules/eventemitter-asyncresource": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/eventemitter-asyncresource/-/eventemitter-asyncresource-1.0.0.tgz", + "integrity": "sha512-39F7TBIV0G7gTelxwbEqnwhp90eqCPON1k0NwNfwhgKn4Co4ybUbj2pECcXT0B3ztRKZ7Pw1JujUUgmQJHcVAQ==", + "dev": true + }, "node_modules/eventemitter2": { "version": "0.4.14", "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.14.tgz", @@ -10389,12 +15349,6 @@ "node": ">=8" } }, - "node_modules/execa/node_modules/signal-exit": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", - "dev": true - }, "node_modules/execa/node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -10438,6 +15392,95 @@ "node": ">=0.10.0" } }, + "node_modules/exponential-backoff": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/exponential-backoff/-/exponential-backoff-3.1.1.tgz", + "integrity": "sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw==", + "dev": true + }, + "node_modules/express": { + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", + "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", + "dev": true, + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.1", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.5.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.11.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/express/node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", + "dev": true + }, + "node_modules/express/node_modules/qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dev": true, + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/express/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", @@ -10458,18 +15501,6 @@ "node": ">=4" } }, - "node_modules/external-editor/node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/extract-zip": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", @@ -10529,20 +15560,19 @@ "dev": true }, "node_modules/fast-glob": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz", - "integrity": "sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==", + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.0", + "glob-parent": "^5.1.2", "merge2": "^1.3.0", - "micromatch": "^4.0.2", - "picomatch": "^2.2.1" + "micromatch": "^4.0.4" }, "engines": { - "node": ">=8" + "node": ">=8.6.0" } }, "node_modules/fast-json-stable-stringify": { @@ -10681,6 +15711,24 @@ "node": ">=8" } }, + "node_modules/finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "dev": true, + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/find-cache-dir": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", @@ -10874,6 +15922,15 @@ "node": ">=12.20.0" } }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/frac": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/frac/-/frac-1.1.2.tgz", @@ -10882,6 +15939,28 @@ "node": ">=0.8" } }, + "node_modules/fraction.js": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.2.0.tgz", + "integrity": "sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA==", + "dev": true, + "engines": { + "node": "*" + }, + "funding": { + "type": "patreon", + "url": "https://www.patreon.com/infusion" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", @@ -10905,9 +15984,36 @@ "universalify": "^0.1.0" }, "engines": { - "node": ">=6 <7 || >=8" + "node": ">=6 <7 || >=8" + } + }, + "node_modules/fs-minipass": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.2.tgz", + "integrity": "sha512-2GAfyfoaCDRrM6jaOS3UsBts8yJ55VioXdWcOL7dK9zdAuKT71+WBA4ifnNYqVjYv+4SsPxjK0JT4yIIn4cA/g==", + "dev": true, + "dependencies": { + "minipass": "^5.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/fs-minipass/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true, + "engines": { + "node": ">=8" } }, + "node_modules/fs-monkey": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.0.4.tgz", + "integrity": "sha512-INM/fWAxMICjttnD0DX1rBvinKskj5G1w+oy/pnm9u/tSlnBrzFonJMcalKJ30P8RRsPzKcCG7Q8l0jx5Fh9YQ==", + "dev": true + }, "node_modules/fs-readdir-recursive": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", @@ -11235,6 +16341,75 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/gauge": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", + "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", + "dev": true, + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.3", + "console-control-strings": "^1.1.0", + "has-unicode": "^2.0.1", + "signal-exit": "^3.0.7", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.5" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/gauge/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/gauge/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/gauge/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/gauge/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/gauge/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/gaze": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/gaze/-/gaze-1.1.3.tgz", @@ -11311,6 +16486,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true, + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/get-stdin": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", @@ -11477,20 +16661,22 @@ } }, "node_modules/glob": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.0.6.tgz", - "integrity": "sha1-IRuvr0nlJbjNkyYNFKsTYVKz9Xo=", - "dev": true, + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.2", + "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, "engines": { "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/glob-parent": { @@ -12427,6 +17613,12 @@ "node": ">=0.10.0" } }, + "node_modules/handle-thing": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.1.tgz", + "integrity": "sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg==", + "dev": true + }, "node_modules/har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", @@ -12575,6 +17767,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "dev": true + }, "node_modules/has-yarn": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-3.0.0.tgz", @@ -12620,6 +17818,29 @@ "node": ">=4" } }, + "node_modules/hdr-histogram-js": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/hdr-histogram-js/-/hdr-histogram-js-2.0.3.tgz", + "integrity": "sha512-Hkn78wwzWHNCp2uarhzQ2SGFLU3JY8SBDDd3TAABK4fc30wm+MuPOrg5QVFVfkKOQd6Bfz3ukJEI+q9sXEkK1g==", + "dev": true, + "dependencies": { + "@assemblyscript/loader": "^0.10.1", + "base64-js": "^1.2.0", + "pako": "^1.0.3" + } + }, + "node_modules/hdr-histogram-js/node_modules/pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", + "dev": true + }, + "node_modules/hdr-histogram-percentiles-obj": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hdr-histogram-percentiles-obj/-/hdr-histogram-percentiles-obj-3.0.0.tgz", + "integrity": "sha512-7kIufnBqdsBGcSZLPJwqHT3yhk1QTsSlFsVD3kx5ixH/AlgBs9yM1q6DPhXZ8f8gtdqgh7N7/5btRLpQsS2gHw==", + "dev": true + }, "node_modules/he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", @@ -12679,6 +17900,18 @@ "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", "dev": true }, + "node_modules/hpack.js": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz", + "integrity": "sha512-zJxVehUdMGIKsRaNt7apO2Gqp0BdqW5yaiGHXXmbpvxgBYVZnAql+BJb4RO5ad2MgpbZKn5G6nMnegrH1FcNYQ==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "obuf": "^1.0.0", + "readable-stream": "^2.0.1", + "wbuf": "^1.1.0" + } + }, "node_modules/html-encoding-sniffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", @@ -12691,6 +17924,22 @@ "node": ">=12" } }, + "node_modules/html-entities": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.4.0.tgz", + "integrity": "sha512-igBTJcNNNhvZFRtm8uA6xMY6xYleeDwn3PeBCkDz7tHttv4F2hsDI2aPgNERWzvRcNYHNT3ymRaQzllmXj4YsQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/mdevils" + }, + { + "type": "patreon", + "url": "https://patreon.com/mdevils" + } + ] + }, "node_modules/html-escaper": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", @@ -12806,6 +18055,12 @@ "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", "dev": true }, + "node_modules/http-deceiver": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz", + "integrity": "sha512-LmpOGxTfbpgtGVxJrj5k7asXHCgNZp5nLfp+hWc8QQRqtb7fUy6kRY3BO1h9ddF6yIPYUARgxGOwB42DnxIaNw==", + "dev": true + }, "node_modules/http-errors": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", @@ -12897,6 +18152,30 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, + "node_modules/http-proxy-middleware": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz", + "integrity": "sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw==", + "dev": true, + "dependencies": { + "@types/http-proxy": "^1.17.8", + "http-proxy": "^1.18.1", + "is-glob": "^4.0.1", + "is-plain-obj": "^3.0.0", + "micromatch": "^4.0.2" + }, + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "@types/express": "^4.17.13" + }, + "peerDependenciesMeta": { + "@types/express": { + "optional": true + } + } + }, "node_modules/http-server": { "version": "14.1.0", "resolved": "https://registry.npmjs.org/http-server/-/http-server-14.1.0.tgz", @@ -13072,33 +18351,126 @@ "node": ">=10.17.0" } }, + "node_modules/humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", + "dev": true, + "dependencies": { + "ms": "^2.0.0" + } + }, "node_modules/iconv-lite": { - "version": "0.4.19", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", - "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==", + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, "engines": { "node": ">=0.10.0" } }, + "node_modules/icss-utils": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz", + "integrity": "sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==", + "dev": true, + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, "node_modules/ieee754": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.12.tgz", - "integrity": "sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==" + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, "node_modules/ignore": { - "version": "5.1.8", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", - "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", "dev": true, "engines": { "node": ">= 4" } }, + "node_modules/ignore-walk": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-6.0.3.tgz", + "integrity": "sha512-C7FfFoTA+bI10qfeydT8aZbvr91vAEU+2W5BZUlzPec47oNb07SsOfwYrtxuvOYdUApPP/Qlh4DtAO51Ekk2QA==", + "dev": true, + "dependencies": { + "minimatch": "^9.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/ignore-walk/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/ignore-walk/node_modules/minimatch": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.2.tgz", + "integrity": "sha512-PZOT9g5v2ojiTL7r1xF6plNHLtOeTpSlDI007As2NlA2aYBMfVom17yqa6QzhmDP8QOhn7LjHTg7DFCVSSa6yg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/image-size": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.5.5.tgz", + "integrity": "sha512-6TDAlDPZxUFCv+fuOkIoXT/V/f3Qbq8e37p+YOiYrUv3v9cc3/6x78VdfPgFVaB9dZYeLUfKgHRebpkm/oP2VQ==", + "dev": true, + "optional": true, + "bin": { + "image-size": "bin/image-size.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/immediate": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", "integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps=" }, + "node_modules/immutable": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.0.tgz", + "integrity": "sha512-0AOCmOip+xgJwEVTQj1EfiDDOkPmuyllDuTuEX+DDXUgapLAsBIfkg3sxCYyCEA8mQqZrrxPUGjcOQ2JS3WLkg==", + "dev": true + }, "node_modules/import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", @@ -13165,21 +18537,6 @@ "node": ">=8" } }, - "node_modules/import-local/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/import-local/node_modules/p-locate": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", @@ -13489,6 +18846,15 @@ "integrity": "sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg==", "dev": true }, + "node_modules/ipaddr.js": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.1.0.tgz", + "integrity": "sha512-LlbxQ7xKzfBusov6UMi4MFpEg0m+mAm9xyNGEduwXMEDuf4WfzB/RZwMVYEd7IKGvh4IUkEXYxtAVu9T3OelJQ==", + "dev": true, + "engines": { + "node": ">= 10" + } + }, "node_modules/is-absolute": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", @@ -13539,7 +18905,6 @@ "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dev": true, - "optional": true, "dependencies": { "binary-extensions": "^2.0.0" }, @@ -13643,9 +19008,9 @@ } }, "node_modules/is-core-module": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", - "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz", + "integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==", "dependencies": { "has": "^1.0.3" }, @@ -13760,6 +19125,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-lambda": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", + "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==", + "dev": true + }, "node_modules/is-map": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz", @@ -13834,6 +19205,18 @@ "node": ">=8" } }, + "node_modules/is-plain-obj": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-3.0.0.tgz", + "integrity": "sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", @@ -14084,6 +19467,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-what": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/is-what/-/is-what-3.14.1.tgz", + "integrity": "sha512-sNxgpk9793nzSs7bA6JQJGeIuRBQhAaNGG77kzYQgMkrID+lS6SlK07K5LaptscDlSaIgH+GPFzf+d75FVxozA==", + "dev": true + }, "node_modules/is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", @@ -14234,37 +19623,17 @@ "version": "4.3.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/istanbul-lib-source-maps/node_modules/glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "dev": true, + "dependencies": { + "ms": "2.1.2" }, "engines": { - "node": "*" + "node": ">=6.0" }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, "node_modules/istanbul-lib-source-maps/node_modules/ms": { @@ -14328,6 +19697,24 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/jackspeak": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.2.1.tgz", + "integrity": "sha512-MXbxovZ/Pm42f6cDIDkl3xpwv1AGwObKwfmjs2nQePiy85tP3fatofl3FC1aBsOtP/6fq5SbtgHwWcMsLP+bDw==", + "dev": true, + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, "node_modules/jdataview": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/jdataview/-/jdataview-2.5.0.tgz", @@ -14371,6 +19758,15 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, + "node_modules/jiti": { + "version": "1.18.2", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.18.2.tgz", + "integrity": "sha512-QAdOptna2NYiSSpv0O/BwoHBSmz4YhpzJHyi+fnMRTXFjp7B8i/YG5Z8IfusxB1ufjcD2Sre1F3R+nX3fvy7gg==", + "dev": true, + "bin": { + "jiti": "bin/jiti.js" + } + }, "node_modules/jquery": { "version": "3.5.1", "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz", @@ -14686,6 +20082,12 @@ "json5": "lib/cli.js" } }, + "node_modules/jsonc-parser": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", + "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", + "dev": true + }, "node_modules/jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -14814,6 +20216,15 @@ "jquery": ">=1.5" } }, + "node_modules/karma-source-map-support": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/karma-source-map-support/-/karma-source-map-support-1.4.0.tgz", + "integrity": "sha512-RsBECncGO17KAoJCYXjv+ckIz+Ii9NCi+9enk+rq6XC81ezYkb4/RHE6CTXdA7IOJqoF3wcaLfVG0CPmE5ca6A==", + "dev": true, + "dependencies": { + "source-map-support": "^0.5.5" + } + }, "node_modules/keycloak-js": { "version": "20.0.0", "resolved": "https://registry.npmjs.org/keycloak-js/-/keycloak-js-20.0.0.tgz", @@ -14823,25 +20234,6 @@ "js-sha256": "^0.9.0" } }, - "node_modules/keycloak-js/node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, "node_modules/keyv": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.0.tgz", @@ -14863,6 +20255,15 @@ "node": ">=0.10.0" } }, + "node_modules/klona": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/klona/-/klona-2.0.6.tgz", + "integrity": "sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, "node_modules/labeled-stream-splicer": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.2.tgz", @@ -14887,6 +20288,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/launch-editor": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/launch-editor/-/launch-editor-2.6.0.tgz", + "integrity": "sha512-JpDCcQnyAAzZZaZ7vEiSqL690w7dAEyLao+KC96zBplnYbJS7TYNjvM3M7y3dGz+v7aIsJk3hllWuc0kWAjyRQ==", + "dev": true, + "dependencies": { + "picocolors": "^1.0.0", + "shell-quote": "^1.7.3" + } + }, "node_modules/lazy-cache": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", @@ -15004,6 +20415,62 @@ "resolved": "https://registry.npmjs.org/leaflet/-/leaflet-0.7.7.tgz", "integrity": "sha1-HjUrpU5j0HZFH6NjyQCJDLLPde4=" }, + "node_modules/less": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/less/-/less-4.1.3.tgz", + "integrity": "sha512-w16Xk/Ta9Hhyei0Gpz9m7VS8F28nieJaL/VyShID7cYvP6IL5oHeL6p4TXSDJqZE/lNv0oJ2pGVjJsRkfwm5FA==", + "dev": true, + "dependencies": { + "copy-anything": "^2.0.1", + "parse-node-version": "^1.0.1", + "tslib": "^2.3.0" + }, + "bin": { + "lessc": "bin/lessc" + }, + "engines": { + "node": ">=6" + }, + "optionalDependencies": { + "errno": "^0.1.1", + "graceful-fs": "^4.1.2", + "image-size": "~0.5.0", + "make-dir": "^2.1.0", + "mime": "^1.4.1", + "needle": "^3.1.0", + "source-map": "~0.6.0" + } + }, + "node_modules/less-loader": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/less-loader/-/less-loader-11.1.0.tgz", + "integrity": "sha512-C+uDBV7kS7W5fJlUjq5mPBeBVhYpTIm5gB09APT9o3n/ILeaXVsiSFTbZpTJCJwQ/Crczfn3DmfQFwxYusWFug==", + "dev": true, + "dependencies": { + "klona": "^2.0.4" + }, + "engines": { + "node": ">= 14.15.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "less": "^3.5.0 || ^4.0.0", + "webpack": "^5.0.0" + } + }, + "node_modules/less/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", @@ -15093,32 +20560,6 @@ "nopt": "bin/nopt.js" } }, - "node_modules/license-checker/node_modules/spdx-correct": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", - "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", - "dev": true, - "dependencies": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/license-checker/node_modules/spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", - "dev": true, - "dependencies": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/license-checker/node_modules/spdx-license-ids": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", - "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", - "dev": true - }, "node_modules/license-checker/node_modules/supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -15131,6 +20572,23 @@ "node": ">=4" } }, + "node_modules/license-webpack-plugin": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/license-webpack-plugin/-/license-webpack-plugin-4.0.2.tgz", + "integrity": "sha512-771TFWFD70G1wLTC4oU2Cw4qvtmNrIw+wRvBtn+okgHl7slJVi7zfNcdmqDL72BojM30VNJ2UHylr1o77U37Jw==", + "dev": true, + "dependencies": { + "webpack-sources": "^3.0.0" + }, + "peerDependenciesMeta": { + "webpack": { + "optional": true + }, + "webpack-sources": { + "optional": true + } + } + }, "node_modules/lie": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", @@ -15173,18 +20631,6 @@ "node": ">= 8" } }, - "node_modules/liftup/node_modules/is-core-module": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", - "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", - "dev": true, - "dependencies": { - "has": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/liftup/node_modules/rechoir": { "version": "0.7.1", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz", @@ -15304,6 +20750,12 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, + "node_modules/lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", + "dev": true + }, "node_modules/lodash.flattendeep": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", @@ -15420,6 +20872,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/magic-string": { + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.0.tgz", + "integrity": "sha512-LA+31JYDJLs82r2ScLrlz1GjSgu66ZV518eyWT+S8VhyQn/JL0u9MeBOvQMGYiPk1DBiSN9DDMOcXvigJZaViQ==", + "dev": true, + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.13" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/make-dir": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", @@ -15457,6 +20921,135 @@ "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true }, + "node_modules/make-fetch-happen": { + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-11.1.1.tgz", + "integrity": "sha512-rLWS7GCSTcEujjVBs2YqG7Y4643u8ucvCJeSRqiLYhesrDuzeuFIk37xREzAsfQaqzl8b9rNCE4m6J8tvX4Q8w==", + "dev": true, + "dependencies": { + "agentkeepalive": "^4.2.1", + "cacache": "^17.0.0", + "http-cache-semantics": "^4.1.1", + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.0", + "is-lambda": "^1.0.1", + "lru-cache": "^7.7.1", + "minipass": "^5.0.0", + "minipass-fetch": "^3.0.0", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.3", + "promise-retry": "^2.0.1", + "socks-proxy-agent": "^7.0.0", + "ssri": "^10.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/make-fetch-happen/node_modules/@tootallnate/once": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "dev": true, + "engines": { + "node": ">= 10" + } + }, + "node_modules/make-fetch-happen/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/make-fetch-happen/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/make-fetch-happen/node_modules/http-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "dev": true, + "dependencies": { + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/make-fetch-happen/node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/make-fetch-happen/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/make-fetch-happen/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/make-fetch-happen/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/make-fetch-happen/node_modules/socks-proxy-agent": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-7.0.0.tgz", + "integrity": "sha512-Fgl0YPZ902wEsAyiQ+idGd1A7rSFx/ayC1CQVMw5P+EQx2V0SgpGtf6OKFhVjPflPUl9YMmEOnmfjCdMUsygww==", + "dev": true, + "dependencies": { + "agent-base": "^6.0.2", + "debug": "^4.3.3", + "socks": "^2.6.2" + }, + "engines": { + "node": ">= 10" + } + }, "node_modules/make-iterator": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz", @@ -15531,6 +21124,27 @@ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/memfs": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/memfs/-/memfs-3.5.3.tgz", + "integrity": "sha512-UERzLsxzllchadvbPs5aolHh65ISpKpM+ccLbOJ8/vvpBKmAWf+la7dXFy7Mr0ySHbdHrFv5kGFCUHHe6GFEmw==", + "dev": true, + "dependencies": { + "fs-monkey": "^1.0.4" + }, + "engines": { + "node": ">= 4.0.0" + } + }, "node_modules/meow": { "version": "3.7.0", "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", @@ -15552,6 +21166,12 @@ "node": ">=0.10.0" } }, + "node_modules/merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==", + "dev": true + }, "node_modules/merge-source-map": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.1.0.tgz", @@ -15585,6 +21205,15 @@ "node": ">= 8" } }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/mgrs": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/mgrs/-/mgrs-1.0.0.tgz", @@ -15603,18 +21232,6 @@ "node": ">=8.6" } }, - "node_modules/micromatch/node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, "node_modules/miller-rabin": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", @@ -15640,21 +21257,21 @@ } }, "node_modules/mime-db": { - "version": "1.46.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.46.0.tgz", - "integrity": "sha512-svXaP8UQRZ5K7or+ZmfNhg2xX3yKDMUzqadsSqi4NCH/KomcH75MAMYAGVlvXn4+b/xOPhS3I2uHKRUzvjY7BQ==", + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "dev": true, "engines": { "node": ">= 0.6" } }, "node_modules/mime-types": { - "version": "2.1.29", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.29.tgz", - "integrity": "sha512-Y/jMt/S5sR9OaqteJtslsFZKWOIIqMACsJSiHghlCAyhf7jfVYjKBmLiX8OgpWeW+fjJ2b+Az69aPFPkUOY6xQ==", + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dev": true, "dependencies": { - "mime-db": "1.46.0" + "mime-db": "1.52.0" }, "engines": { "node": ">= 0.6" @@ -15678,6 +21295,78 @@ "node": ">=4" } }, + "node_modules/mini-css-extract-plugin": { + "version": "2.7.6", + "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-2.7.6.tgz", + "integrity": "sha512-Qk7HcgaPkGG6eD77mLvZS1nmxlao3j+9PkrT9Uc7HAE1id3F41+DdBRYRYkbyfNRGzm8/YWtzhw7nVPmwhqTQw==", + "dev": true, + "dependencies": { + "schema-utils": "^4.0.0" + }, + "engines": { + "node": ">= 12.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.0.0" + } + }, + "node_modules/mini-css-extract-plugin/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/mini-css-extract-plugin/node_modules/ajv-keywords": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", + "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.3" + }, + "peerDependencies": { + "ajv": "^8.8.2" + } + }, + "node_modules/mini-css-extract-plugin/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "node_modules/mini-css-extract-plugin/node_modules/schema-utils": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz", + "integrity": "sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.9", + "ajv": "^8.9.0", + "ajv-formats": "^2.1.1", + "ajv-keywords": "^5.1.0" + }, + "engines": { + "node": ">= 12.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, "node_modules/minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -15714,6 +21403,180 @@ "yallist": "^3.0.0" } }, + "node_modules/minipass-collect": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz", + "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minipass-collect/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-collect/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/minipass-fetch": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-3.0.3.tgz", + "integrity": "sha512-n5ITsTkDqYkYJZjcRWzZt9qnZKCT7nKCosJhHoj7S7zD+BP4jVbWs+odsniw5TA3E0sLomhTKOKjF86wf11PuQ==", + "dev": true, + "dependencies": { + "minipass": "^5.0.0", + "minipass-sized": "^1.0.3", + "minizlib": "^2.1.2" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + }, + "optionalDependencies": { + "encoding": "^0.1.13" + } + }, + "node_modules/minipass-fetch/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-flush": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", + "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minipass-flush/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-flush/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/minipass-json-stream": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minipass-json-stream/-/minipass-json-stream-1.0.1.tgz", + "integrity": "sha512-ODqY18UZt/I8k+b7rl2AENgbWE8IDYam+undIJONvigAz8KR5GWblsFTEfQs0WODsjbSXWlm+JHEv8Gr6Tfdbg==", + "dev": true, + "dependencies": { + "jsonparse": "^1.3.1", + "minipass": "^3.0.0" + } + }, + "node_modules/minipass-json-stream/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-json-stream/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/minipass-pipeline": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", + "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-pipeline/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-pipeline/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/minipass-sized": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", + "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-sized/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-sized/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/minipass/node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -15740,6 +21603,37 @@ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minizlib/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/mitt": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mitt/-/mitt-2.1.0.tgz", @@ -15780,12 +21674,34 @@ "node": ">=0.8 <0.11" } }, + "node_modules/mrmime": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-1.0.1.tgz", + "integrity": "sha512-hzzEagAgDyoU1Q6yg5uI+AorQgdvMCur3FcKf7NhMKWsaYg+RnbTyHRa/9IlLF9rf455MOCtcqqrQQ83pPP7Uw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, + "node_modules/multicast-dns": { + "version": "7.2.5", + "resolved": "https://registry.npmjs.org/multicast-dns/-/multicast-dns-7.2.5.tgz", + "integrity": "sha512-2eznPJP8z2BFLX50tf0LuODrpINqP1RVIm/CObbTcBRITQgmC/TjcREF1NeTBzIcR5XO/ukWo+YHOjBbFwIupg==", + "dev": true, + "dependencies": { + "dns-packet": "^5.2.2", + "thunky": "^1.0.2" + }, + "bin": { + "multicast-dns": "cli.js" + } + }, "node_modules/mute-stream": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", @@ -15793,14 +21709,77 @@ "dev": true }, "node_modules/nanoid": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", - "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==", + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", + "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], "bin": { "nanoid": "bin/nanoid.cjs" }, "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/needle": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/needle/-/needle-3.2.0.tgz", + "integrity": "sha512-oUvzXnyLiVyVGoianLijF9O/RecZUf7TkBfimjGrLM4eQhXyeJwM6GeAWccwfQ9aa4gMCZKqhAOuLaMIcQxajQ==", + "dev": true, + "optional": true, + "dependencies": { + "debug": "^3.2.6", + "iconv-lite": "^0.6.3", + "sax": "^1.2.4" + }, + "bin": { + "needle": "bin/needle" + }, + "engines": { + "node": ">= 4.4.x" + } + }, + "node_modules/needle/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "optional": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/needle/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "optional": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/needle/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "optional": true + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "dev": true, + "engines": { + "node": ">= 0.6" } }, "node_modules/neo-async": { @@ -15851,6 +21830,28 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/nice-napi": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/nice-napi/-/nice-napi-1.0.2.tgz", + "integrity": "sha512-px/KnJAJZf5RuBGcfD+Sp2pAKq0ytz8j+1NehvgIGFkvtvFrDM3T8E4x/JJODXK9WZow8RRGrbA9QQ3hs+pDhA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "!win32" + ], + "dependencies": { + "node-addon-api": "^3.0.0", + "node-gyp-build": "^4.2.2" + } + }, + "node_modules/node-addon-api": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz", + "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==", + "dev": true, + "optional": true + }, "node_modules/node-domexception": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", @@ -15888,6 +21889,115 @@ "url": "https://opencollective.com/node-fetch" } }, + "node_modules/node-forge": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", + "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==", + "dev": true, + "engines": { + "node": ">= 6.13.0" + } + }, + "node_modules/node-gyp": { + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-9.4.0.tgz", + "integrity": "sha512-dMXsYP6gc9rRbejLXmTbVRYjAHw7ppswsKyMxuxJxxOHzluIO1rGp9TOQgjFJ+2MCqcOcQTOPB/8Xwhr+7s4Eg==", + "dev": true, + "dependencies": { + "env-paths": "^2.2.0", + "exponential-backoff": "^3.1.1", + "glob": "^7.1.4", + "graceful-fs": "^4.2.6", + "make-fetch-happen": "^11.0.3", + "nopt": "^6.0.0", + "npmlog": "^6.0.0", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.2", + "which": "^2.0.2" + }, + "bin": { + "node-gyp": "bin/node-gyp.js" + }, + "engines": { + "node": "^12.13 || ^14.13 || >=16" + } + }, + "node_modules/node-gyp-build": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.0.tgz", + "integrity": "sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==", + "dev": true, + "optional": true, + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" + } + }, + "node_modules/node-gyp/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-gyp/node_modules/nopt": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-6.0.0.tgz", + "integrity": "sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g==", + "dev": true, + "dependencies": { + "abbrev": "^1.0.0" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/node-gyp/node_modules/semver": { + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-gyp/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/node-gyp/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/node-releases": { "version": "2.0.12", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.12.tgz", @@ -15961,40 +22071,271 @@ "nopt": "bin/nopt.js" } }, - "node_modules/normalize-package-data": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "node_modules/normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "dev": true, + "dependencies": { + "hosted-git-info": "^2.1.4", + "is-builtin-module": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "dependencies": { + "remove-trailing-separator": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/normalize-range": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz", + "integrity": "sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/normalize-url": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", + "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm-bundled": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-3.0.0.tgz", + "integrity": "sha512-Vq0eyEQy+elFpzsKjMss9kxqb9tG3YHg4dsyWuUENuzvSUWe1TCnW/vV9FkhvBk/brEDoDiVd+M1Btosa6ImdQ==", + "dev": true, + "dependencies": { + "npm-normalize-package-bin": "^3.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm-install-checks": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-6.1.1.tgz", + "integrity": "sha512-dH3GmQL4vsPtld59cOn8uY0iOqRmqKvV+DLGwNXV/Q7MDgD2QfOADWd/mFXcIE5LVhYYGjA3baz6W9JneqnuCw==", + "dev": true, + "dependencies": { + "semver": "^7.1.1" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm-install-checks/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/npm-install-checks/node_modules/semver": { + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/npm-install-checks/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/npm-normalize-package-bin": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-3.0.1.tgz", + "integrity": "sha512-dMxCf+zZ+3zeQZXKxmyuCKlIDPGuv8EF940xbkC4kQVDTtqoh6rJFO+JTKSA6/Rwi0getWmtuy4Itup0AMcaDQ==", + "dev": true, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm-package-arg": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-10.1.0.tgz", + "integrity": "sha512-uFyyCEmgBfZTtrKk/5xDfHp6+MdrqGotX/VoOyEEl3mBwiEE5FlBaePanazJSVMPT7vKepcjYBY2ztg9A3yPIA==", + "dev": true, + "dependencies": { + "hosted-git-info": "^6.0.0", + "proc-log": "^3.0.0", + "semver": "^7.3.5", + "validate-npm-package-name": "^5.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm-package-arg/node_modules/hosted-git-info": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-6.1.1.tgz", + "integrity": "sha512-r0EI+HBMcXadMrugk0GCQ+6BQV39PiWAZVfq7oIckeGiN7sjRGyQxPdft3nQekFTCQbYxLBH+/axZMeH8UX6+w==", + "dev": true, + "dependencies": { + "lru-cache": "^7.5.1" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm-package-arg/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/npm-package-arg/node_modules/semver": { + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/npm-package-arg/node_modules/semver/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/npm-package-arg/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/npm-packlist": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-7.0.4.tgz", + "integrity": "sha512-d6RGEuRrNS5/N84iglPivjaJPxhDbZmlbTwTDX2IbcRHG5bZCdtysYMhwiPvcF4GisXHGn7xsxv+GQ7T/02M5Q==", + "dev": true, + "dependencies": { + "ignore-walk": "^6.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm-pick-manifest": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-8.0.1.tgz", + "integrity": "sha512-mRtvlBjTsJvfCCdmPtiu2bdlx8d/KXtF7yNXNWe7G0Z36qWA9Ny5zXsI2PfBZEv7SXgoxTmNaTzGSbbzDZChoA==", + "dev": true, + "dependencies": { + "npm-install-checks": "^6.0.0", + "npm-normalize-package-bin": "^3.0.0", + "npm-package-arg": "^10.0.0", + "semver": "^7.3.5" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm-pick-manifest/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/npm-pick-manifest/node_modules/semver": { + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", "dev": true, "dependencies": { - "hosted-git-info": "^2.1.4", - "is-builtin-module": "^1.0.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" } }, - "node_modules/normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "node_modules/npm-pick-manifest/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/npm-registry-fetch": { + "version": "14.0.5", + "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-14.0.5.tgz", + "integrity": "sha512-kIDMIo4aBm6xg7jOttupWZamsZRkAqMqwqqbVXnUqstY5+tapvv6bkH/qMR76jdgV+YljEUCyWx3hRYMrJiAgA==", "dev": true, "dependencies": { - "remove-trailing-separator": "^1.0.1" + "make-fetch-happen": "^11.0.0", + "minipass": "^5.0.0", + "minipass-fetch": "^3.0.0", + "minipass-json-stream": "^1.0.1", + "minizlib": "^2.1.2", + "npm-package-arg": "^10.0.0", + "proc-log": "^3.0.0" }, "engines": { - "node": ">=0.10.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/normalize-url": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", - "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==", + "node_modules/npm-registry-fetch/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", "dev": true, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, "node_modules/npm-run-path": { @@ -16009,6 +22350,33 @@ "node": ">=8" } }, + "node_modules/npmlog": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", + "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", + "dev": true, + "dependencies": { + "are-we-there-yet": "^3.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^4.0.3", + "set-blocking": "^2.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "dev": true, + "dependencies": { + "boolbase": "^1.0.0" + }, + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" + } + }, "node_modules/number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", @@ -16098,26 +22466,6 @@ "node": ">=6" } }, - "node_modules/nyc/node_modules/glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/nyc/node_modules/rimraf": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", @@ -16317,6 +22665,33 @@ "node": ">=0.10.0" } }, + "node_modules/obuf": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", + "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==", + "dev": true + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dev": true, + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/on-headers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -16591,15 +22966,18 @@ } }, "node_modules/p-limit": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.0.0.tgz", - "integrity": "sha512-fl5s52lI5ahKCernzzIyAP0QAZbGIovtVHGwpcu1Jr/EpzLVDI2myISHwGqK7m8uQFugVWSrbxH7XnhGtvEc+A==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "dependencies": { "p-try": "^2.0.0" }, "engines": { "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-locate": { @@ -16614,6 +22992,34 @@ "node": ">=6" } }, + "node_modules/p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-retry": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-4.6.2.tgz", + "integrity": "sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ==", + "dev": true, + "dependencies": { + "@types/retry": "0.12.0", + "retry": "^0.13.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/p-try": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz", @@ -16694,18 +23100,6 @@ "node": ">= 6" } }, - "node_modules/pac-proxy-agent/node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/pac-proxy-agent/node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -16785,7 +23179,232 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/package-json/node_modules/lru-cache": { + "node_modules/package-json/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/package-json/node_modules/semver": { + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/package-json/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/pacote": { + "version": "15.2.0", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-15.2.0.tgz", + "integrity": "sha512-rJVZeIwHTUta23sIZgEIM62WYwbmGbThdbnkt81ravBplQv+HjyroqnLRNH2+sLJHcGZmLRmhPwACqhfTcOmnA==", + "dev": true, + "dependencies": { + "@npmcli/git": "^4.0.0", + "@npmcli/installed-package-contents": "^2.0.1", + "@npmcli/promise-spawn": "^6.0.1", + "@npmcli/run-script": "^6.0.0", + "cacache": "^17.0.0", + "fs-minipass": "^3.0.0", + "minipass": "^5.0.0", + "npm-package-arg": "^10.0.0", + "npm-packlist": "^7.0.0", + "npm-pick-manifest": "^8.0.0", + "npm-registry-fetch": "^14.0.0", + "proc-log": "^3.0.0", + "promise-retry": "^2.0.1", + "read-package-json": "^6.0.0", + "read-package-json-fast": "^3.0.0", + "sigstore": "^1.3.0", + "ssri": "^10.0.0", + "tar": "^6.1.11" + }, + "bin": { + "pacote": "lib/bin.js" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/pacote/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/pacote/node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/pacote/node_modules/foreground-child": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", + "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/pacote/node_modules/glob": { + "version": "10.3.1", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.1.tgz", + "integrity": "sha512-9BKYcEeIs7QwlCYs+Y3GBvqAMISufUS0i2ELd11zpZjxI5V9iyRj0HgzB5/cLf2NY4vcYBTYzJ7GIui7j/4DOw==", + "dev": true, + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.0.3", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2", + "path-scurry": "^1.10.0" + }, + "bin": { + "glob": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/pacote/node_modules/hosted-git-info": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-6.1.1.tgz", + "integrity": "sha512-r0EI+HBMcXadMrugk0GCQ+6BQV39PiWAZVfq7oIckeGiN7sjRGyQxPdft3nQekFTCQbYxLBH+/axZMeH8UX6+w==", + "dev": true, + "dependencies": { + "lru-cache": "^7.5.1" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/pacote/node_modules/json-parse-even-better-errors": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-3.0.0.tgz", + "integrity": "sha512-iZbGHafX/59r39gPwVPRBGw0QQKnA7tte5pSMrhWOW7swGsVvVTjmfyAV9pNqk8YGT7tRCdxRu8uzcgZwoDooA==", + "dev": true, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/pacote/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/pacote/node_modules/minimatch": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.2.tgz", + "integrity": "sha512-PZOT9g5v2ojiTL7r1xF6plNHLtOeTpSlDI007As2NlA2aYBMfVom17yqa6QzhmDP8QOhn7LjHTg7DFCVSSa6yg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/pacote/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/pacote/node_modules/normalize-package-data": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-5.0.0.tgz", + "integrity": "sha512-h9iPVIfrVZ9wVYQnxFgtw1ugSvGEMOlyPWWtm8BMJhnwyEL/FLbYbTY3V3PpjI/BUK67n9PEWDu6eHzu1fB15Q==", + "dev": true, + "dependencies": { + "hosted-git-info": "^6.0.0", + "is-core-module": "^2.8.1", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/pacote/node_modules/read-package-json": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-6.0.4.tgz", + "integrity": "sha512-AEtWXYfopBj2z5N5PbkAOeNHRPUg5q+Nen7QLxV8M2zJq1ym6/lCz3fYNTCXe19puu2d06jfHhrP7v/S2PtMMw==", + "dev": true, + "dependencies": { + "glob": "^10.2.2", + "json-parse-even-better-errors": "^3.0.0", + "normalize-package-data": "^5.0.0", + "npm-normalize-package-bin": "^3.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/pacote/node_modules/semver": { + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/pacote/node_modules/semver/node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", @@ -16797,22 +23416,34 @@ "node": ">=10" } }, - "node_modules/package-json/node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "node_modules/pacote/node_modules/signal-exit": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.0.2.tgz", + "integrity": "sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/pacote/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "dependencies": { - "lru-cache": "^6.0.0" + "isexe": "^2.0.0" }, "bin": { - "semver": "bin/semver.js" + "node-which": "bin/node-which" }, "engines": { - "node": ">=10" + "node": ">= 8" } }, - "node_modules/package-json/node_modules/yallist": { + "node_modules/pacote/node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", @@ -16881,6 +23512,15 @@ "node": ">=0.10.0" } }, + "node_modules/parse-node-version": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-node-version/-/parse-node-version-1.0.1.tgz", + "integrity": "sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/parse-passwd": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", @@ -16908,6 +23548,68 @@ "parse-path": "^7.0.0" } }, + "node_modules/parse5": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "dev": true, + "dependencies": { + "entities": "^4.4.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5-html-rewriting-stream": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/parse5-html-rewriting-stream/-/parse5-html-rewriting-stream-7.0.0.tgz", + "integrity": "sha512-mazCyGWkmCRWDI15Zp+UiCqMp/0dgEmkZRvhlsqqKYr4SsVm/TvnSpD9fCvqCA2zoWJcfRym846ejWBBHRiYEg==", + "dev": true, + "dependencies": { + "entities": "^4.3.0", + "parse5": "^7.0.0", + "parse5-sax-parser": "^7.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5-html-rewriting-stream/node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true, + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/parse5-sax-parser": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/parse5-sax-parser/-/parse5-sax-parser-7.0.0.tgz", + "integrity": "sha512-5A+v2SNsq8T6/mG3ahcz8ZtQ0OUFTatxPbeidoMB7tkJSGDY3tdfl4MHovtLQHkEn5CGxijNWRQHhRQ6IRpXKg==", + "dev": true, + "dependencies": { + "parse5": "^7.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5/node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true, + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/parsedbf": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/parsedbf/-/parsedbf-1.1.1.tgz", @@ -16917,6 +23619,15 @@ "text-encoding-polyfill": "^0.6.7" } }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/path-exists": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", @@ -16980,6 +23691,46 @@ "node": ">=0.10.0" } }, + "node_modules/path-scurry": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.0.tgz", + "integrity": "sha512-tZFEaRQbMLjwrsmidsGJ6wDMv0iazJWk6SfIKnY4Xru8auXgmJkOBa5DUbYFcFD2Rzk2+KDlIiF0GVXNCbgC7g==", + "dev": true, + "dependencies": { + "lru-cache": "^9.1.1 || ^10.0.0", + "minipass": "^5.0.0 || ^6.0.2" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.0.tgz", + "integrity": "sha512-svTf/fzsKHffP42sujkO/Rjs37BCIsQVRCeNYIm9WN8rgT7ffoUnRtZCqU+6BqcSBdv8gwJeTz8knJpgACeQMw==", + "dev": true, + "engines": { + "node": "14 || >=16.14" + } + }, + "node_modules/path-scurry/node_modules/minipass": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-6.0.2.tgz", + "integrity": "sha512-MzWSV5nYVT7mVyWCwn2o7JH13w2TBRmmSqSRCKzTw+lmft9X4z+3wjvs06Tzijo5z4W/kahUCDpRXTF+ZrmF/w==", + "dev": true, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==", + "dev": true + }, "node_modules/path-type": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", @@ -17021,127 +23772,366 @@ "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", "devOptional": true }, - "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "dependencies": { + "pinkie": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/piscina": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/piscina/-/piscina-3.2.0.tgz", + "integrity": "sha512-yn/jMdHRw+q2ZJhFhyqsmANcbF6V2QwmD84c6xRau+QpQOmtrBCoRGdvTfeuFDYXB5W2m6MfLkjkvQa9lUSmIA==", + "dev": true, + "dependencies": { + "eventemitter-asyncresource": "^1.0.0", + "hdr-histogram-js": "^2.0.1", + "hdr-histogram-percentiles-obj": "^3.0.0" + }, + "optionalDependencies": { + "nice-napi": "^1.0.2" + } + }, + "node_modules/pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "dependencies": { + "find-up": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/pkg-dir/node_modules/find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "dependencies": { + "locate-path": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/point-in-polygon": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/point-in-polygon/-/point-in-polygon-1.1.0.tgz", + "integrity": "sha512-3ojrFwjnnw8Q9242TzgXuTD+eKiutbzyslcq1ydfu82Db2y+Ogbmyrkpv0Hgj31qwT3lbS9+QAAO/pIQM35XRw==" + }, + "node_modules/polygon-clipping": { + "version": "0.15.3", + "resolved": "https://registry.npmjs.org/polygon-clipping/-/polygon-clipping-0.15.3.tgz", + "integrity": "sha512-ho0Xx5DLkgxRx/+n4O74XyJ67DcyN3Tu9bGYKsnTukGAW6ssnuak6Mwcyb1wHy9MZc9xsUWqIoiazkZB5weECg==", + "dependencies": { + "splaytree": "^3.1.0" + } + }, + "node_modules/portfinder": { + "version": "1.0.28", + "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.28.tgz", + "integrity": "sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA==", + "dev": true, + "dependencies": { + "async": "^2.6.2", + "debug": "^3.1.1", + "mkdirp": "^0.5.5" + }, + "engines": { + "node": ">= 0.12.0" + } + }, + "node_modules/portfinder/node_modules/async": { + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", + "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", + "dev": true, + "dependencies": { + "lodash": "^4.17.14" + } + }, + "node_modules/portfinder/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/portfinder/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/postcss": { + "version": "8.4.24", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.24.tgz", + "integrity": "sha512-M0RzbcI0sO/XJNucsGjvWU9ERWxb/ytp1w6dKtxTKgixdtQDq4rmx/g8W1hnaheq9jgwL/oyEdH5Bc4WwJKMqg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.6", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-loader": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/postcss-loader/-/postcss-loader-7.3.2.tgz", + "integrity": "sha512-c7qDlXErX6n0VT+LUsW+nwefVtTu3ORtVvK8EXuUIDcxo+b/euYqpuHlJAvePb0Af5e8uMjR/13e0lTuYifaig==", + "dev": true, + "dependencies": { + "cosmiconfig": "^8.1.3", + "jiti": "^1.18.2", + "klona": "^2.0.6", + "semver": "^7.3.8" + }, + "engines": { + "node": ">= 14.15.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "postcss": "^7.0.0 || ^8.0.1", + "webpack": "^5.0.0" + } + }, + "node_modules/postcss-loader/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, - "node_modules/picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "node_modules/postcss-loader/node_modules/cosmiconfig": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.2.0.tgz", + "integrity": "sha512-3rTMnFJA1tCOPwRxtgF4wd7Ab2qvDbL8jX+3smjIbS4HlZBagTlpERbdN7iAbWlrfxE3M8c27kTwTawQ7st+OQ==", "dev": true, + "dependencies": { + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "parse-json": "^5.0.0", + "path-type": "^4.0.0" + }, "engines": { - "node": ">=8.6" + "node": ">=14" }, "funding": { - "url": "https://github.com/sponsors/jonschlinkert" + "url": "https://github.com/sponsors/d-fischer" } }, - "node_modules/pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "node_modules/postcss-loader/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, - "engines": { - "node": ">=0.10.0" + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" } }, - "node_modules/pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "node_modules/postcss-loader/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, "engines": { - "node": ">=0.10.0" + "node": ">=10" } }, - "node_modules/pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "node_modules/postcss-loader/node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", "dev": true, "dependencies": { - "pinkie": "^2.0.0" + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" }, "engines": { - "node": ">=0.10.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/pkg-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "node_modules/postcss-loader/node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true, - "dependencies": { - "find-up": "^3.0.0" - }, "engines": { - "node": ">=6" + "node": ">=8" } }, - "node_modules/pkg-dir/node_modules/find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "node_modules/postcss-loader/node_modules/semver": { + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", "dev": true, "dependencies": { - "locate-path": "^3.0.0" + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" }, "engines": { - "node": ">=6" + "node": ">=10" } }, - "node_modules/point-in-polygon": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/point-in-polygon/-/point-in-polygon-1.1.0.tgz", - "integrity": "sha512-3ojrFwjnnw8Q9242TzgXuTD+eKiutbzyslcq1ydfu82Db2y+Ogbmyrkpv0Hgj31qwT3lbS9+QAAO/pIQM35XRw==" + "node_modules/postcss-loader/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true }, - "node_modules/polygon-clipping": { - "version": "0.15.3", - "resolved": "https://registry.npmjs.org/polygon-clipping/-/polygon-clipping-0.15.3.tgz", - "integrity": "sha512-ho0Xx5DLkgxRx/+n4O74XyJ67DcyN3Tu9bGYKsnTukGAW6ssnuak6Mwcyb1wHy9MZc9xsUWqIoiazkZB5weECg==", + "node_modules/postcss-modules-extract-imports": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.0.0.tgz", + "integrity": "sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw==", + "dev": true, + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/postcss-modules-local-by-default": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.0.3.tgz", + "integrity": "sha512-2/u2zraspoACtrbFRnTijMiQtb4GW4BvatjaG/bCjYQo8kLTdevCUlwuBHx2sCnSyrI3x3qj4ZK1j5LQBgzmwA==", + "dev": true, "dependencies": { - "splaytree": "^3.1.0" + "icss-utils": "^5.0.0", + "postcss-selector-parser": "^6.0.2", + "postcss-value-parser": "^4.1.0" + }, + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" } }, - "node_modules/portfinder": { - "version": "1.0.28", - "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.28.tgz", - "integrity": "sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA==", + "node_modules/postcss-modules-scope": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-3.0.0.tgz", + "integrity": "sha512-hncihwFA2yPath8oZ15PZqvWGkWf+XUfQgUGamS4LqoP1anQLOsOJw0vr7J7IwLpoY9fatA2qiGUGmuZL0Iqlg==", "dev": true, "dependencies": { - "async": "^2.6.2", - "debug": "^3.1.1", - "mkdirp": "^0.5.5" + "postcss-selector-parser": "^6.0.4" }, "engines": { - "node": ">= 0.12.0" + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" } }, - "node_modules/portfinder/node_modules/async": { - "version": "2.6.4", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", - "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", + "node_modules/postcss-modules-values": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-4.0.0.tgz", + "integrity": "sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ==", "dev": true, "dependencies": { - "lodash": "^4.17.14" + "icss-utils": "^5.0.0" + }, + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" } }, - "node_modules/portfinder/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "node_modules/postcss-selector-parser": { + "version": "6.0.13", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.13.tgz", + "integrity": "sha512-EaV1Gl4mUEV4ddhDnv/xtj7sxwrwxdetHdWUGnT4VJQf+4d05v6lHYZr8N573k5Z0BViss7BDhfWtKS3+sfAqQ==", "dev": true, "dependencies": { - "ms": "^2.1.1" + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" } }, - "node_modules/portfinder/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "node_modules/postcss-value-parser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", "dev": true }, "node_modules/prelude-ls": { @@ -17189,6 +24179,15 @@ "node": ">= 0.6" } }, + "node_modules/proc-log": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-3.0.0.tgz", + "integrity": "sha512-++Vn7NS4Xf9NacaU9Xq3URUuqZETPsf8L4j5/ckhaRYsfPeRyzGw+iDjFhV/Jr3uNmTvvddEJFWh5R1gRgUH8A==", + "dev": true, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", @@ -17220,6 +24219,34 @@ "wkt-parser": "^1.1.3" } }, + "node_modules/promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==", + "dev": true + }, + "node_modules/promise-retry": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", + "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", + "dev": true, + "dependencies": { + "err-code": "^2.0.2", + "retry": "^0.12.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/promise-retry/node_modules/retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, "node_modules/promise.allsettled": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/promise.allsettled/-/promise.allsettled-1.0.5.tgz", @@ -17471,6 +24498,28 @@ "integrity": "sha512-/XJ368cyBJ7fzLMwLKv1e4vLxOju2MNAIokcr7meSaNcVbWz/CPcW22cP04mwxOErdA5mwjA8Q6w/cdAQxVn7Q==", "dev": true }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dev": true, + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/proxy-addr/node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/proxy-agent": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-5.0.0.tgz", @@ -17559,6 +24608,13 @@ "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", "dev": true }, + "node_modules/prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==", + "dev": true, + "optional": true + }, "node_modules/pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", @@ -17767,6 +24823,15 @@ "safe-buffer": "^5.1.0" } }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/rangeslide.js": { "version": "0.13.0", "resolved": "https://registry.npmjs.org/rangeslide.js/-/rangeslide.js-0.13.0.tgz", @@ -17871,21 +24936,26 @@ "graceful-fs": "^4.1.2" } }, - "node_modules/read-package-json/node_modules/glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "node_modules/read-package-json-fast": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-3.0.2.tgz", + "integrity": "sha512-0J+Msgym3vrLOUB3hzQCuZHII0xkNGCtz/HJH9xZshwv9DbDwkw1KaE3gx/e2J5rpEY5rtOy6cyhKOPrkP7FZw==", "dev": true, "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "json-parse-even-better-errors": "^3.0.0", + "npm-normalize-package-bin": "^3.0.0" }, "engines": { - "node": "*" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/read-package-json-fast/node_modules/json-parse-even-better-errors": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-3.0.0.tgz", + "integrity": "sha512-iZbGHafX/59r39gPwVPRBGw0QQKnA7tte5pSMrhWOW7swGsVvVTjmfyAV9pNqk8YGT7tRCdxRu8uzcgZwoDooA==", + "dev": true, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, "node_modules/read-pkg": { @@ -17947,7 +25017,6 @@ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, - "optional": true, "dependencies": { "picomatch": "^2.2.1" }, @@ -17980,12 +25049,30 @@ "node": ">=0.10.0" } }, + "node_modules/reflect-metadata": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", + "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==", + "dev": true + }, "node_modules/regenerate": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", - "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", + "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", "dev": true }, + "node_modules/regenerate-unicode-properties": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.0.tgz", + "integrity": "sha512-d1VudCLoIGitcU/hEg2QqvyGZQmdC0Lf8BqdOMXGFSvJP4bNV1+XqbPQeHHLD51Jh4QJJ225dlIFvY4Ly6MXmQ==", + "dev": true, + "dependencies": { + "regenerate": "^1.4.2" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/regenerator-runtime": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", @@ -18003,6 +25090,12 @@ "private": "^0.1.6" } }, + "node_modules/regex-parser": { + "version": "2.2.11", + "resolved": "https://registry.npmjs.org/regex-parser/-/regex-parser-2.2.11.tgz", + "integrity": "sha512-jbD/FT0+9MBU2XAZluI7w2OBs1RBi6p9M83nkoZayQXXU9e8Robt69FcZc7wU4eJD/YFTjn1JdCk3rbMJajz8Q==", + "dev": true + }, "node_modules/regexp.prototype.flags": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz", @@ -18210,22 +25303,6 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/release-it/node_modules/fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, "node_modules/release-it/node_modules/form-data": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", @@ -18280,58 +25357,28 @@ "node": ">=12.20.0" } }, - "node_modules/release-it/node_modules/ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, "node_modules/release-it/node_modules/is-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", "dev": true, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/release-it/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/release-it/node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true, - "engines": { - "node": ">= 0.6" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/release-it/node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "node_modules/release-it/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "dependencies": { - "mime-db": "1.52.0" + "yallist": "^4.0.0" }, "engines": { - "node": ">= 0.6" + "node": ">=10" } }, "node_modules/release-it/node_modules/mimic-fn": { @@ -18420,12 +25467,6 @@ "node": ">=4" } }, - "node_modules/release-it/node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true - }, "node_modules/release-it/node_modules/slash": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", @@ -18599,6 +25640,15 @@ "node": ">=0.10.0" } }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", @@ -18665,6 +25715,37 @@ "node": ">=4" } }, + "node_modules/resolve-url-loader": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-url-loader/-/resolve-url-loader-5.0.0.tgz", + "integrity": "sha512-uZtduh8/8srhBoMx//5bwqjQ+rfYOUq8zC9NrMUGtjBiGTtFJM42s58/36+hTqeqINcnYe08Nj3LkK9lW4N8Xg==", + "dev": true, + "dependencies": { + "adjust-sourcemap-loader": "^4.0.0", + "convert-source-map": "^1.7.0", + "loader-utils": "^2.0.0", + "postcss": "^8.2.14", + "source-map": "0.6.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/resolve-url-loader/node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true + }, + "node_modules/resolve-url-loader/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/responselike": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.1.tgz", @@ -18757,26 +25838,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/rimraf/node_modules/glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/ripemd160": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", @@ -18791,6 +25852,22 @@ "resolved": "https://registry.npmjs.org/robust-predicates/-/robust-predicates-2.0.4.tgz", "integrity": "sha512-l4NwboJM74Ilm4VKfbAtFeGq7aEjWL+5kVFcmgFA2MrdnQWx9iE/tUGvxY5HyMI7o/WpSIUFLbC5fbeaHgSCYg==" }, + "node_modules/rollup": { + "version": "3.26.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.26.0.tgz", + "integrity": "sha512-YzJH0eunH2hr3knvF3i6IkLO/jTjAEwU4HoMUbQl4//Tnl3ou0e7P5SjxdDr8HQJdeUJShlbEHXrrnEHy1l7Yg==", + "dev": true, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=14.18.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, "node_modules/run-async": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", @@ -18824,20 +25901,13 @@ } }, "node_modules/rxjs": { - "version": "7.5.6", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.5.6.tgz", - "integrity": "sha512-dnyv2/YsXhnm461G+R/Pe5bWP41Nm6LBXEYWI6eiFP4fiwx6WRI/CD0zbdVAudd9xwLEF2IDcKXLHit0FYjUzw==", - "dev": true, + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", + "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", "dependencies": { "tslib": "^2.1.0" } }, - "node_modules/rxjs/node_modules/tslib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", - "dev": true - }, "node_modules/safe-buffer": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", @@ -18852,8 +25922,62 @@ "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/sass": { + "version": "1.63.2", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.63.2.tgz", + "integrity": "sha512-u56TU0AIFqMtauKl/OJ1AeFsXqRHkgO7nCWmHaDwfxDo9GUMSqBA4NEh6GMuh1CYVM7zuROYtZrHzPc2ixK+ww==", + "dev": true, + "dependencies": { + "chokidar": ">=3.0.0 <4.0.0", + "immutable": "^4.0.0", + "source-map-js": ">=0.6.2 <2.0.0" + }, + "bin": { + "sass": "sass.js" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/sass-loader": { + "version": "13.3.1", + "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-13.3.1.tgz", + "integrity": "sha512-cBTxmgyVA1nXPvIK4brjJMXOMJ2v2YrQEuHqLw3LylGb3gsR6jAvdjHMcy/+JGTmmIF9SauTrLLR7bsWDMWqgg==", + "dev": true, + "dependencies": { + "klona": "^2.0.6", + "neo-async": "^2.6.2" + }, + "engines": { + "node": ">= 14.15.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "fibers": ">= 3.1.0", + "node-sass": "^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0", + "sass": "^1.3.0", + "sass-embedded": "*", + "webpack": "^5.0.0" + }, + "peerDependenciesMeta": { + "fibers": { + "optional": true + }, + "node-sass": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + } + } }, "node_modules/sax": { "version": "1.2.4", @@ -18884,11 +26008,29 @@ "integrity": "sha1-8aAymzCLIh+uN7mXTz1XjQypmeM=", "dev": true }, + "node_modules/select-hose": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz", + "integrity": "sha512-mEugaLK+YfkijB4fx0e6kImuJdCIt2LxCRcbEYPqRGCs4F2ogyfZU5IAZRdjCP8JPq2AtdNoC/Dux63d9Kiryg==", + "dev": true + }, "node_modules/select2": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/select2/-/select2-4.0.8.tgz", "integrity": "sha512-H/I2mq71oiEe51S74hdUv4QubH1EJNLEMnjfQucftLa8GiuT5+RKIHwlV/7I/YUqZg0wsYQM946eFG/ntRPF/Q==" }, + "node_modules/selfsigned": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-2.1.1.tgz", + "integrity": "sha512-GSL3aowiF7wa/WtSFwnUrludWFoNhftq8bUkH9pkzjpN2XSPOAYEgg6e0sS9s0rZwgJzJiQRPU18A6clnoW5wQ==", + "dev": true, + "dependencies": { + "node-forge": "^1" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/semver": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", @@ -18946,6 +26088,36 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, + "node_modules/send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "dev": true, + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, "node_modules/serialize-javascript": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", @@ -18955,6 +26127,78 @@ "randombytes": "^2.1.0" } }, + "node_modules/serve-index": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz", + "integrity": "sha512-pXHfKNP4qujrtteMrSBb0rc8HJ9Ms/GrXwcUtUtD5s4ewDJI8bT3Cz2zTVRMKtri49pLx2e0Ya8ziP5Ya2pZZw==", + "dev": true, + "dependencies": { + "accepts": "~1.3.4", + "batch": "0.6.1", + "debug": "2.6.9", + "escape-html": "~1.0.3", + "http-errors": "~1.6.2", + "mime-types": "~2.1.17", + "parseurl": "~1.3.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/serve-index/node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/serve-index/node_modules/http-errors": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "integrity": "sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A==", + "dev": true, + "dependencies": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.0", + "statuses": ">= 1.4.0 < 2" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/serve-index/node_modules/setprototypeof": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", + "dev": true + }, + "node_modules/serve-index/node_modules/statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "dev": true, + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", @@ -19139,11 +26383,28 @@ } }, "node_modules/signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, + "node_modules/sigstore": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/sigstore/-/sigstore-1.7.0.tgz", + "integrity": "sha512-KP7QULhWdlu3hlp+jw2EvgWKlOGOY9McLj/jrchLjHNlNPK0KWIwF919cbmOp6QiKXLmPijR2qH/5KYWlbtG9Q==", + "dev": true, + "dependencies": { + "@sigstore/protobuf-specs": "^0.1.0", + "@sigstore/tuf": "^1.0.1", + "make-fetch-happen": "^11.0.1" + }, + "bin": { + "sigstore": "bin/sigstore.js" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/simple-concat": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.0.tgz", @@ -19202,6 +26463,29 @@ "npm": ">= 3.0.0" } }, + "node_modules/sockjs": { + "version": "0.3.24", + "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.24.tgz", + "integrity": "sha512-GJgLTZ7vYb/JtPSSZ10hsOYIvEYsjbNU+zPdIHcUaWVNUEPivzxku31865sSSud0Da0W4lEeOPlmw93zLQchuQ==", + "dev": true, + "dependencies": { + "faye-websocket": "^0.11.3", + "uuid": "^8.3.2", + "websocket-driver": "^0.7.4" + } + }, + "node_modules/sockjs/node_modules/faye-websocket": { + "version": "0.11.4", + "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz", + "integrity": "sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g==", + "dev": true, + "dependencies": { + "websocket-driver": ">=0.5.1" + }, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/socks": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.0.tgz", @@ -19284,6 +26568,48 @@ "node": ">=0.10.0" } }, + "node_modules/source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-loader": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/source-map-loader/-/source-map-loader-4.0.1.tgz", + "integrity": "sha512-oqXpzDIByKONVY8g1NUPOTQhe0UTU5bWUl32GSkqK2LjJj0HmwTMVKxcUip0RgAYhY1mqgOxjbQM48a0mmeNfA==", + "dev": true, + "dependencies": { + "abab": "^2.0.6", + "iconv-lite": "^0.6.3", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": ">= 14.15.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.72.1" + } + }, + "node_modules/source-map-loader/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/source-map-support": { "version": "0.5.21", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", @@ -19317,26 +26643,6 @@ "which": "^1.3.0" } }, - "node_modules/spawn-wrap/node_modules/glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/spawn-wrap/node_modules/rimraf": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", @@ -19372,29 +26678,14 @@ "spdx-ranges": "^2.0.0" } }, - "node_modules/spdx-compare/node_modules/spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", - "dev": true, - "dependencies": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/spdx-compare/node_modules/spdx-license-ids": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", - "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", - "dev": true - }, "node_modules/spdx-correct": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz", - "integrity": "sha1-SzBz2TP/UfORLwOsVRlJikFQ20A=", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", "dev": true, "dependencies": { - "spdx-license-ids": "^1.0.2" + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" } }, "node_modules/spdx-exceptions": { @@ -19404,15 +26695,19 @@ "dev": true }, "node_modules/spdx-expression-parse": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz", - "integrity": "sha1-m98vIOH0DtRH++JzJmGR/O1RYmw=", - "dev": true + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } }, "node_modules/spdx-license-ids": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz", - "integrity": "sha1-yd96NCRZSt5r0RkA1ZZpbcBrrFc=", + "version": "3.0.13", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.13.tgz", + "integrity": "sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w==", "dev": true }, "node_modules/spdx-ranges": { @@ -19432,20 +26727,123 @@ "spdx-ranges": "^2.0.0" } }, - "node_modules/spdx-satisfies/node_modules/spdx-expression-parse": { + "node_modules/spdy": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/spdy/-/spdy-4.0.2.tgz", + "integrity": "sha512-r46gZQZQV+Kl9oItvl1JZZqJKGr+oEkB08A6BzkiR7593/7IbtuncXHd2YoYeTsG4157ZssMu9KYvUHLcjcDoA==", + "dev": true, + "dependencies": { + "debug": "^4.1.0", + "handle-thing": "^2.0.0", + "http-deceiver": "^1.2.7", + "select-hose": "^2.0.0", + "spdy-transport": "^3.0.0" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/spdy-transport": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "resolved": "https://registry.npmjs.org/spdy-transport/-/spdy-transport-3.0.0.tgz", + "integrity": "sha512-hsLVFE5SjA6TCisWeJXFKniGGOpBgMLmerfO2aCyCU5s7nJ/rpAepqmFifv/GCbSbueEeAJJnmSQ2rKC/g8Fcw==", "dev": true, "dependencies": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" + "debug": "^4.1.0", + "detect-node": "^2.0.4", + "hpack.js": "^2.1.6", + "obuf": "^1.1.2", + "readable-stream": "^3.0.6", + "wbuf": "^1.7.3" + } + }, + "node_modules/spdy-transport/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/spdy-transport/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/spdy-transport/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/spdy-transport/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/spdy-transport/node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/spdy/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "node_modules/spdx-satisfies/node_modules/spdx-license-ids": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", - "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", + "node_modules/spdy/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, "node_modules/splaytree": { @@ -19498,6 +26896,27 @@ "node": ">=0.10.0" } }, + "node_modules/ssri": { + "version": "10.0.4", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.4.tgz", + "integrity": "sha512-12+IR2CB2C28MMAw0Ncqwj5QbTcs0nGIhgJzYWzDkb21vWmfNI83KS4f3Ci6GI98WreIfG7o9UXp3C0qbpA8nQ==", + "dev": true, + "dependencies": { + "minipass": "^5.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/ssri/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/stack-utils": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.4.tgz", @@ -19580,6 +26999,57 @@ "node": ">=6" } }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/string-width-cjs/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/string-width/node_modules/ansi-regex": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", @@ -19637,6 +27107,28 @@ "node": ">=0.10.0" } }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-bom": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", @@ -19722,6 +27214,15 @@ "node": ">=12.0.0" } }, + "node_modules/symbol-observable": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-4.0.0.tgz", + "integrity": "sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ==", + "dev": true, + "engines": { + "node": ">=0.10" + } + }, "node_modules/syntax-error": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.4.0.tgz", @@ -19844,26 +27345,6 @@ "tap-parser": "bin/cmd.js" } }, - "node_modules/tap/node_modules/glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/tap/node_modules/os-homedir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", @@ -19907,6 +27388,23 @@ "node": ">=6" } }, + "node_modules/tar": { + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.15.tgz", + "integrity": "sha512-/zKt9UyngnxIT/EAGYuxaMYgOIJiP81ab9ZfkILq4oNLPFX50qyYmu7jRj9qeXoxmJHjGlbH0+cm2uy1WCs10A==", + "dev": true, + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/tar-fs": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", @@ -19919,26 +27417,6 @@ "tar-stream": "^2.1.4" } }, - "node_modules/tar-fs/node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, "node_modules/tar-fs/node_modules/bl": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", @@ -19957,33 +27435,9 @@ "dev": true }, "node_modules/tar-fs/node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "node_modules/tar-fs/node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "dev": true, "funding": [ { @@ -19998,7 +27452,11 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } }, "node_modules/tar-fs/node_modules/readable-stream": { "version": "3.6.0", @@ -20074,6 +27532,66 @@ "node": ">= 0.8.0" } }, + "node_modules/tar/node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/tar/node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/tar/node_modules/fs-minipass/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tar/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/tar/node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/tar/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/terser": { "version": "5.18.0", "resolved": "https://registry.npmjs.org/terser/-/terser-5.18.0.tgz", @@ -20162,26 +27680,6 @@ "node": ">=6" } }, - "node_modules/test-exclude/node_modules/glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/test-exclude/node_modules/load-json-file": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", @@ -20280,6 +27778,12 @@ "utrie": "^1.0.2" } }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, "node_modules/through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -20316,6 +27820,12 @@ "safe-buffer": "~5.1.0" } }, + "node_modules/thunky": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz", + "integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==", + "dev": true + }, "node_modules/tiny-lr": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/tiny-lr/-/tiny-lr-1.1.1.tgz", @@ -20462,6 +27972,15 @@ "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", "dev": true }, + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true, + "bin": { + "tree-kill": "cli.js" + } + }, "node_modules/treeify": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/treeify/-/treeify-1.1.0.tgz", @@ -20536,9 +28055,45 @@ "dev": true }, "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.0.tgz", + "integrity": "sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA==" + }, + "node_modules/tuf-js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/tuf-js/-/tuf-js-1.1.7.tgz", + "integrity": "sha512-i3P9Kgw3ytjELUfpuKVDNBJvk4u5bXL6gskv572mcevPbSKCV3zt3djhmlEQ65yERjIbOSncy7U4cQJaB1CBCg==", + "dev": true, + "dependencies": { + "@tufjs/models": "1.0.4", + "debug": "^4.3.4", + "make-fetch-happen": "^11.1.1" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/tuf-js/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/tuf-js/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, "node_modules/tunnel-agent": { @@ -20588,6 +28143,25 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dev": true, + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typed-assert": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/typed-assert/-/typed-assert-1.0.9.tgz", + "integrity": "sha512-KNNZtayBCtmnNmbo5mG47p1XsCyrx6iVqomjcZnec/1Y5GGARaxPs6r49RnSPeUP3YjNYiU9sQHAtY4BBvnZwg==", + "dev": true + }, "node_modules/typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", @@ -20722,26 +28296,6 @@ "through": "^2.3.8" } }, - "node_modules/unbzip2-stream/node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, "node_modules/unbzip2-stream/node_modules/buffer": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", @@ -20766,26 +28320,6 @@ "ieee754": "^1.1.13" } }, - "node_modules/unbzip2-stream/node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, "node_modules/unc-path-regex": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", @@ -20834,6 +28368,15 @@ "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==", "dev": true }, + "node_modules/unicode-canonical-property-names-ecmascript": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", + "integrity": "sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/unicode-length": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/unicode-length/-/unicode-length-1.0.3.tgz", @@ -20844,6 +28387,37 @@ "strip-ansi": "^3.0.1" } }, + "node_modules/unicode-match-property-ecmascript": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz", + "integrity": "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==", + "dev": true, + "dependencies": { + "unicode-canonical-property-names-ecmascript": "^2.0.0", + "unicode-property-aliases-ecmascript": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-match-property-value-ecmascript": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.1.0.tgz", + "integrity": "sha512-qxkjQt6qjg/mYscYMC0XKRn3Rh0wFPlfxB0xkt9CfyTvpX1Ra0+rAmdX2QyAobptSEvuy4RtpPRui6XkV+8wjA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-property-aliases-ecmascript": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz", + "integrity": "sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/union": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/union/-/union-0.5.0.tgz", @@ -20856,6 +28430,30 @@ "node": ">= 0.8.0" } }, + "node_modules/unique-filename": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-3.0.0.tgz", + "integrity": "sha512-afXhuC55wkAmZ0P18QsVE6kp8JaxrEokN2HGIoIVv2ijHQd419H0+6EigAFcIzXeMIkcIkNBpB3L/DXB3cTS/g==", + "dev": true, + "dependencies": { + "unique-slug": "^4.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/unique-slug": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-4.0.0.tgz", + "integrity": "sha512-WrcA6AyEfqDX5bWige/4NQfPZMtASNVxdmWR76WESYQVAACSgWcR6e9i0mofqqBxYFtL4oAxPIptY73/0YE1DQ==", + "dev": true, + "dependencies": { + "imurmurhash": "^0.1.4" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/unique-string": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-3.0.0.tgz", @@ -21055,6 +28653,15 @@ "resolved": "https://registry.npmjs.org/util-extend/-/util-extend-1.0.3.tgz", "integrity": "sha1-p8IW0mdUUWljeztu3GypEZ4v+T8=" }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "dev": true, + "engines": { + "node": ">= 0.4.0" + } + }, "node_modules/utrie": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/utrie/-/utrie-1.0.2.tgz", @@ -21063,6 +28670,15 @@ "base64-arraybuffer": "^1.0.2" } }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/v8-compile-cache": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz", @@ -21082,13 +28698,34 @@ } }, "node_modules/validate-npm-package-license": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz", - "integrity": "sha1-KAS6vnEq0zeUWaz74kdGqywwP7w=", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/validate-npm-package-name": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-5.0.0.tgz", + "integrity": "sha512-YuKoXDAhBYxY7SfOKxHBDoSyENFeW5VvIIQp2TGQuit8gpK6MnWaQelBKxso72DoxTZfZdcP3W90LqpSkgPzLQ==", "dev": true, "dependencies": { - "spdx-correct": "~1.0.0", - "spdx-expression-parse": "~1.0.0" + "builtins": "^5.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "dev": true, + "engines": { + "node": ">= 0.8" } }, "node_modules/verror": { @@ -21105,6 +28742,54 @@ "extsprintf": "^1.2.0" } }, + "node_modules/vite": { + "version": "4.3.9", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.3.9.tgz", + "integrity": "sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg==", + "dev": true, + "dependencies": { + "esbuild": "^0.17.5", + "postcss": "^8.4.23", + "rollup": "^3.21.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + }, + "peerDependencies": { + "@types/node": ">= 14", + "less": "*", + "sass": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, "node_modules/vm2": { "version": "3.9.19", "resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.19.tgz", @@ -21143,6 +28828,15 @@ "node": ">=10.13.0" } }, + "node_modules/wbuf": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/wbuf/-/wbuf-1.7.3.tgz", + "integrity": "sha512-O84QOnr0icsbFGLS0O3bI5FswxzRr8/gHwWkDlQFskhSPryQXvrTMxjxGP4+iWYoauLoBvfDpkrOauZ+0iZpDA==", + "dev": true, + "dependencies": { + "minimalistic-assert": "^1.0.0" + } + }, "node_modules/wcwidth": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", @@ -21305,10 +28999,259 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/webpack-dev-middleware": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-6.1.1.tgz", + "integrity": "sha512-y51HrHaFeeWir0YO4f0g+9GwZawuigzcAdRNon6jErXy/SqV/+O6eaVAzDqE6t3e3NpGeR5CS+cCDaTC+V3yEQ==", + "dev": true, + "dependencies": { + "colorette": "^2.0.10", + "memfs": "^3.4.12", + "mime-types": "^2.1.31", + "range-parser": "^1.2.1", + "schema-utils": "^4.0.0" + }, + "engines": { + "node": ">= 14.15.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.0.0" + }, + "peerDependenciesMeta": { + "webpack": { + "optional": true + } + } + }, + "node_modules/webpack-dev-middleware/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/webpack-dev-middleware/node_modules/ajv-keywords": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", + "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.3" + }, + "peerDependencies": { + "ajv": "^8.8.2" + } + }, + "node_modules/webpack-dev-middleware/node_modules/colorette": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", + "dev": true + }, + "node_modules/webpack-dev-middleware/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "node_modules/webpack-dev-middleware/node_modules/schema-utils": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz", + "integrity": "sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.9", + "ajv": "^8.9.0", + "ajv-formats": "^2.1.1", + "ajv-keywords": "^5.1.0" + }, + "engines": { + "node": ">= 12.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/webpack-dev-server": { + "version": "4.15.0", + "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-4.15.0.tgz", + "integrity": "sha512-HmNB5QeSl1KpulTBQ8UT4FPrByYyaLxpJoQ0+s7EvUrMc16m0ZS1sgb1XGqzmgCPk0c9y+aaXxn11tbLzuM7NQ==", + "dev": true, + "dependencies": { + "@types/bonjour": "^3.5.9", + "@types/connect-history-api-fallback": "^1.3.5", + "@types/express": "^4.17.13", + "@types/serve-index": "^1.9.1", + "@types/serve-static": "^1.13.10", + "@types/sockjs": "^0.3.33", + "@types/ws": "^8.5.1", + "ansi-html-community": "^0.0.8", + "bonjour-service": "^1.0.11", + "chokidar": "^3.5.3", + "colorette": "^2.0.10", + "compression": "^1.7.4", + "connect-history-api-fallback": "^2.0.0", + "default-gateway": "^6.0.3", + "express": "^4.17.3", + "graceful-fs": "^4.2.6", + "html-entities": "^2.3.2", + "http-proxy-middleware": "^2.0.3", + "ipaddr.js": "^2.0.1", + "launch-editor": "^2.6.0", + "open": "^8.0.9", + "p-retry": "^4.5.0", + "rimraf": "^3.0.2", + "schema-utils": "^4.0.0", + "selfsigned": "^2.1.1", + "serve-index": "^1.9.1", + "sockjs": "^0.3.24", + "spdy": "^4.0.2", + "webpack-dev-middleware": "^5.3.1", + "ws": "^8.13.0" + }, + "bin": { + "webpack-dev-server": "bin/webpack-dev-server.js" + }, + "engines": { + "node": ">= 12.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^4.37.0 || ^5.0.0" + }, + "peerDependenciesMeta": { + "webpack": { + "optional": true + }, + "webpack-cli": { + "optional": true + } + } + }, + "node_modules/webpack-dev-server/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/webpack-dev-server/node_modules/ajv-keywords": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", + "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.3" + }, + "peerDependencies": { + "ajv": "^8.8.2" + } + }, + "node_modules/webpack-dev-server/node_modules/colorette": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", + "dev": true + }, + "node_modules/webpack-dev-server/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "node_modules/webpack-dev-server/node_modules/schema-utils": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz", + "integrity": "sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.9", + "ajv": "^8.9.0", + "ajv-formats": "^2.1.1", + "ajv-keywords": "^5.1.0" + }, + "engines": { + "node": ">= 12.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/webpack-dev-server/node_modules/webpack-dev-middleware": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-5.3.3.tgz", + "integrity": "sha512-hj5CYrY0bZLB+eTO+x/j67Pkrquiy7kWepMHmUMoPsmcUaeEnQJqFzHJOyxgWlq746/wUuA64p9ta34Kyb01pA==", + "dev": true, + "dependencies": { + "colorette": "^2.0.10", + "memfs": "^3.4.3", + "mime-types": "^2.1.31", + "range-parser": "^1.2.1", + "schema-utils": "^4.0.0" + }, + "engines": { + "node": ">= 12.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^4.0.0 || ^5.0.0" + } + }, + "node_modules/webpack-dev-server/node_modules/ws": { + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", + "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", + "dev": true, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, "node_modules/webpack-merge": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.7.3.tgz", - "integrity": "sha512-6/JUQv0ELQ1igjGDzHkXbVDRxkfA57Zw7PfiupdLFJYrgFqY5ZP8xxbpp2lU3EPwYx89ht5Z/aDkD40hFCm5AA==", + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.9.0.tgz", + "integrity": "sha512-6NbRQw4+Sy50vYNTw7EyOn41OZItPiXB8GNv3INSoe3PSFaHJEz3SHTrYVaRm2LilNGnFUzh0FAwqPEmU/CwDg==", "dev": true, "dependencies": { "clone-deep": "^4.0.1", @@ -21327,6 +29270,27 @@ "node": ">=10.13.0" } }, + "node_modules/webpack-subresource-integrity": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/webpack-subresource-integrity/-/webpack-subresource-integrity-5.1.0.tgz", + "integrity": "sha512-sacXoX+xd8r4WKsy9MvH/q/vBtEHr86cpImXwyg74pFIpERKt6FmB8cXpeuh0ZLgclOlHI4Wcll7+R5L02xk9Q==", + "dev": true, + "dependencies": { + "typed-assert": "^1.0.8" + }, + "engines": { + "node": ">= 12" + }, + "peerDependencies": { + "html-webpack-plugin": ">= 5.0.0-beta.1 < 6", + "webpack": "^5.12.0" + }, + "peerDependenciesMeta": { + "html-webpack-plugin": { + "optional": true + } + } + }, "node_modules/websocket-driver": { "version": "0.7.4", "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz", @@ -21438,6 +29402,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "dev": true, + "dependencies": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, "node_modules/widest-line": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-4.0.1.tgz", @@ -21600,12 +29573,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/windows-release/node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true - }, "node_modules/windows-release/node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -21658,6 +29625,107 @@ "node": ">=6" } }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/wrap-ansi-cjs/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/wrap-ansi/node_modules/ansi-regex": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", @@ -21798,6 +29866,15 @@ "node": ">=0.4" } }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/yallist": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", @@ -21905,6 +29982,14 @@ "node": ">= 0.10.0" } }, + "node_modules/zone.js": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.13.1.tgz", + "integrity": "sha512-+bIeDAFEBYuXRuU3qGQvzdPap+N1zjM4KkBAiiQuVVCrHrhjDuY6VkUhNa5+U27+9w0q3fbKiMCbpJ0XzMmSWA==", + "dependencies": { + "tslib": "^2.3.0" + } + }, "node_modules/zrender": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/zrender/-/zrender-5.3.0.tgz", diff --git a/package.json b/package.json index 5a7d2ccf5..ef23539e5 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,9 @@ }, "license": "Apache 2.0", "devDependencies": { + "@angular-devkit/build-angular": "^16.1.3", + "@angular/cli": "^16.1.3", + "@angular/compiler-cli": "^16.1.3", "@babel/cli": "^7.17.3", "@babel/core": "^7.17.5", "@release-it/keep-a-changelog": "^3.1.0", @@ -53,13 +56,24 @@ "webpack-cli": "^4.5.0" }, "scripts": { - "build": "npm install --force && webpack && grunt", - "start": "http-server -p 8000 -c-1 ./app --cors --gzip", + "ng": "ng", + "start": "ng serve", + "build": "ng build", + "watch": "ng build --watch --configuration development", "release": "release-it", "tsc": "tsc", "tsc:w": "tsc -w" }, "dependencies": { + "@angular/animations": "^16.1.3", + "@angular/common": "^16.1.3", + "@angular/compiler": "^16.1.3", + "@angular/core": "^16.1.3", + "@angular/forms": "^16.1.3", + "@angular/platform-browser": "^16.1.3", + "@angular/platform-browser-dynamic": "^16.1.3", + "@angular/router": "^16.1.3", + "@angular/upgrade": "^16.1.3", "@fortawesome/fontawesome-free": "^6.1.1", "@turf/turf": "^6.5.0", "admin-lte": "^2.4.15", @@ -112,12 +126,15 @@ "leaflet.pattern": "^0.1.0", "mathjax": "^3.1.2", "rangeslide.js": "^0.13.0", + "rxjs": "^7.8.1", "shp-write": "^0.3.2", "shpjs": "^3.4.3", "slimscroll": "^0.9.1", "sortablejs": "^1.13.0", "tableexport": "^5.0.5", - "ui-select": "^0.19.8" + "tslib": "^2.6.0", + "ui-select": "^0.19.8", + "zone.js": "^0.13.1" }, "jshintConfig": { "undef": true, diff --git a/tsconfig.app.json b/tsconfig.app.json new file mode 100644 index 000000000..3cd418e53 --- /dev/null +++ b/tsconfig.app.json @@ -0,0 +1,15 @@ +/* To learn more about this file see: https://angular.io/config/tsconfig. */ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./out-tsc/app", + "types": [] + }, + "files": [ + "app/main.ts" + ], + "include": [ + "app/**/*.d.ts" + ] + } + \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 1d41f2724..34e1344f6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ { "compileOnSave": false, "compilerOptions": { - "baseUrl": "./", + "baseUrl": "./app", "forceConsistentCasingInFileNames": true, "strict": true, "noImplicitOverride": true, From efa9994529e47438b195b3e2f710c78c42f184fd Mon Sep 17 00:00:00 2001 From: ashwanth511 Date: Tue, 18 Jul 2023 21:26:27 +0530 Subject: [PATCH 3/8] updated info_modal and version_info --- angular.json | 6 +- app/app.ajs.js | 860 +- app/app.ajs.js.map | 1 + app/app.module.js | 20 + app/app.module.js.map | 1 + app/app.module.ts | 6 +- .../infoModal/info-modal.component.css | 0 .../infoModal/info-modal.component.js.map | 1 - .../infoModal/info-modal.component.ts | 170 +- .../infoModal/info-modal.module.js.map | 1 - .../infoModal/info-modal.module.ts | 16 +- .../infoModal/info-modal.template.html | 257 +- .../info-modal.component.js | 0 .../info-modal.module.js | 0 .../versionInfo/version-info.component.js.map | 1 - .../versionInfo/version-info.component.ts | 40 +- .../versionInfo/version-info.module.js.map | 1 - .../versionInfo/version-info.module.ts | 19 +- .../versionInfo/version-info.template.html | 165 +- app/config/config-storage-server.json | 6 +- app/index.html | 38 +- .../km_georesource_share_byPropertyValue.js | 6 +- ...m_georesource_share_byPropertyValue.js.map | 2 +- app/main.js | 5 + app/main.js.map | 1 + app/main.ts | 2 + package-lock.json | 24286 +++++++--------- package.json | 10 +- tsconfig.app.json | 4 +- tsconfig.json | 7 +- 30 files changed, 10974 insertions(+), 14958 deletions(-) create mode 100644 app/app.ajs.js.map create mode 100644 app/app.module.js create mode 100644 app/app.module.js.map create mode 100644 app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.component.css delete mode 100644 app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.component.js.map delete mode 100644 app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.module.js.map rename app/components/kommonitorUserInterface/kommonitorControls/{infoModal => kommonitorBalance}/info-modal.component.js (100%) rename app/components/kommonitorUserInterface/kommonitorControls/{infoModal => kommonitorBalance}/info-modal.module.js (100%) delete mode 100644 app/components/kommonitorUserInterface/kommonitorControls/versionInfo/version-info.component.js.map delete mode 100644 app/components/kommonitorUserInterface/kommonitorControls/versionInfo/version-info.module.js.map create mode 100644 app/main.js create mode 100644 app/main.js.map diff --git a/angular.json b/angular.json index b6483a046..e9b5423a2 100644 --- a/angular.json +++ b/angular.json @@ -24,7 +24,8 @@ "app/" ], "styles": [ - "app/app.css" + "app/app.css", + "node_modules/bootstrap/dist/css/bootstrap.min.css" ], "scripts": [] }, @@ -89,7 +90,8 @@ "app/favicon.ico" ], "styles": [ - "app/app.css" + "app/app.css", + "node_modules/bootstrap/dist/css/bootstrap.min.css" ], "scripts": [] } diff --git a/app/app.ajs.js b/app/app.ajs.js index caf0bf986..bc2871254 100644 --- a/app/app.ajs.js +++ b/app/app.ajs.js @@ -1,526 +1,436 @@ +"use strict"; if (/MSIE 9/i.test(navigator.userAgent) || /MSIE 10/i.test(navigator.userAgent) || /rv:11.0/i.test(navigator.userAgent)) { // This is internet explorer 9, 10 or 11 window.alert('Internet Explorer erkannt. Für eine optimale Nutzung von KomMonitor nutzen Sie nach Möglichkeit die Browser Firefox oder Chrome.'); } - - -if (/Edge\/\d./i.test(navigator.userAgent)){ - // This is Microsoft Edge - - window.alert('Microsoft Edge erkannt. Für eine optimale Nutzung von KomMonitor nutzen Sie nach Möglichkeit die Browser Firefox oder Chrome.'); +if (/Edge\/\d./i.test(navigator.userAgent)) { + // This is Microsoft Edge + window.alert('Microsoft Edge erkannt. Für eine optimale Nutzung von KomMonitor nutzen Sie nach Möglichkeit die Browser Firefox oder Chrome.'); } - var env = {}; - // for jspdf insert backwards compatibility according to https://github.com/parallax/jsPDF/releases/tag/v2.0.0 window.jsPDF = window.jspdf.jsPDF; - // Declare app level module which depends on views, and components -var appModule = angular.module('kommonitorClient', [ 'ngRoute', 'kommonitorUserInterface', 'kommonitorAdmin']); - +var appModule = angular.module('kommonitorClient', ['ngRoute', 'kommonitorUserInterface', 'kommonitorAdmin']); var controlsServiceName = 'ControlsConfigService'; var auth = {}; - - /* LOAD CONFIG FILES FROM CONFIG STORAGE SERVER */ function ajaxCall_keycloakConfig(configStorageServerConfig) { - console.log("try to fetch keycloak config file"); - return $.ajax({ - url: configStorageServerConfig.targetUrlToConfigStorageServer_keycloakConfig, - success: function(result){ - console.log("keycloak config file fetched"); - window.__env.keycloakConfig = result; - return; - }, - error: function(XMLHttpRequest, textStatus, errorThrown) { - console.log("Use keycloak.json local backup default values"); - } - }); -} - + console.log("try to fetch keycloak config file"); + return $.ajax({ + url: configStorageServerConfig.targetUrlToConfigStorageServer_keycloakConfig, + success: function (result) { + console.log("keycloak config file fetched"); + window.__env.keycloakConfig = result; + return; + }, + error: function (XMLHttpRequest, textStatus, errorThrown) { + console.log("Use keycloak.json local backup default values"); + } + }); +} function ajaxCall_appConfig(configStorageServerConfig) { - console.log("try to fetch app config file"); - return $.ajax({ - url: configStorageServerConfig.targetUrlToConfigStorageServer_appConfig, - success: function(result){ - console.log("app config file fetched"); - window.__env.appConfig = result; - return; - }, - error: function(XMLHttpRequest, textStatus, errorThrown) { - console.log("Use env.js local backup default values"); - } - }); -} - + console.log("try to fetch app config file"); + return $.ajax({ + url: configStorageServerConfig.targetUrlToConfigStorageServer_appConfig, + success: function (result) { + console.log("app config file fetched"); + window.__env.appConfig = result; + return; + }, + error: function (XMLHttpRequest, textStatus, errorThrown) { + console.log("Use env.js local backup default values"); + } + }); +} function ajaxCall_controlsConfig(configStorageServerConfig) { - console.log("try to fetch controls config file"); - return $.ajax({ - url: configStorageServerConfig.targetUrlToConfigStorageServer_controlsConfig, - success: function(result){ - console.log("controls config file fetched"); - window.__env.controlsConfig = result; - return; - }, - error: function(XMLHttpRequest, textStatus, errorThrown) { - console.log("Use controls-config.json local backup default values that has no widget restrictions."); - } - }); -} - - + console.log("try to fetch controls config file"); + return $.ajax({ + url: configStorageServerConfig.targetUrlToConfigStorageServer_controlsConfig, + success: function (result) { + console.log("controls config file fetched"); + window.__env.controlsConfig = result; + return; + }, + error: function (XMLHttpRequest, textStatus, errorThrown) { + console.log("Use controls-config.json local backup default values that has no widget restrictions."); + } + }); +} /* LOAD CONFIG FILES FROM LOCAL BACKUP FILES */ function ajaxCall_keycloakConfig_localBackup(configStorageServerConfig) { - return $.ajax({ - url: "./config/keycloak_backup.json", - success: function(result){ - console.log("local keycloak config file with default values fetched"); - window.__env.keycloakConfig = result; - return; - }, - error: function(XMLHttpRequest, textStatus, errorThrown) { - console.log("Error parsing local keycloak.json backup file"); - } -}); -} - + return $.ajax({ + url: "./config/keycloak_backup.json", + success: function (result) { + console.log("local keycloak config file with default values fetched"); + window.__env.keycloakConfig = result; + return; + }, + error: function (XMLHttpRequest, textStatus, errorThrown) { + console.log("Error parsing local keycloak.json backup file"); + } + }); +} function ajaxCall_controlsConfig_localBackup(configStorageServerConfig) { - return $.ajax({ - url: "./config/controls-config_backup.json", - success: function(result){ - console.log("local controls-config file with default values fetched"); - window.__env.controlsConfig = result; - return; - }, - error: function(XMLHttpRequest, textStatus, errorThrown) { - console.log("Error parsing local controlsConfig.json backup file"); - } -}); -} - - -function loadAppConfigScriptDynamically(scriptUrl){ - return new Promise(function (res, rej) { - let script = document.createElement('script'); - script.src = scriptUrl; - script.type = 'text/javascript'; - script.onError = rej; - script.async = true; - script.onload = res; - script.addEventListener('error',rej); - script.addEventListener('load',res); - document.head.appendChild(script); - }); + return $.ajax({ + url: "./config/controls-config_backup.json", + success: function (result) { + console.log("local controls-config file with default values fetched"); + window.__env.controlsConfig = result; + return; + }, + error: function (XMLHttpRequest, textStatus, errorThrown) { + console.log("Error parsing local controlsConfig.json backup file"); + } + }); +} +function loadAppConfigScriptDynamically(scriptUrl) { + return new Promise(function (res, rej) { + let script = document.createElement('script'); + script.src = scriptUrl; + script.type = 'text/javascript'; + script.onError = rej; + script.async = true; + script.onload = res; + script.addEventListener('error', rej); + script.addEventListener('load', res); + document.head.appendChild(script); + }); } - function ajaxCall_configServerFile() { - return $.ajax({ - url: "./config/config-storage-server.json", - success: function(result){ - window.__env = window.__env || {}; - window.__env.configStorageServerConfig = result; - - // inject script tag dynamically to DOM to load ENV variables - console.log("dynamically load env.js"); - const event = loadAppConfigScriptDynamically(window.__env.configStorageServerConfig.targetUrlToConfigStorageServer_appConfig) - .then(() => { console.log("loaded"); }) - .catch(() => { - console.log("Error while loading app config from client config storage server. Will use defaults instead"); - alert("Error while loading app config from client config storage server. Will use defaults instead."); - }); - - - return $.when(ajaxCall_keycloakConfig(window.__env.configStorageServerConfig), ajaxCall_controlsConfig(window.__env.configStorageServerConfig), ajaxCall_appConfig(window.__env.configStorageServerConfig)).then(function(ajax1Results,ajax2Results, ajax3Results){ - console.log("all configs have been loaded"); - - initAngularComponents(); - - bootstrapApplication(); - - return; - }, function(){ - // on fail - console.log("all configs have been loaded - at least some from local backup values. See console log for details"); - - initAngularComponents(); - - bootstrapApplication(); - - return; - }); - } - }); -} - -var loadConfigsThenApp = function(){ - - console.log("start loading required config files"); - - $.when(ajaxCall_keycloakConfig_localBackup(window.__env.configStorageServerConfig), ajaxCall_controlsConfig_localBackup(window.__env.configStorageServerConfig)).then(function(ajax1Results,ajax2Results){ - console.log("local backup configs have been loaded in case config server is not reachable."); - - ajaxCall_configServerFile(); - - }, function(){ - // on fail - console.log("all configs have been loaded - at least some from local backup values. See console log for details"); - - ajaxCall_configServerFile(); - }); - + return $.ajax({ + url: "./config/config-storage-server.json", + success: function (result) { + window.__env = window.__env || {}; + window.__env.configStorageServerConfig = result; + // inject script tag dynamically to DOM to load ENV variables + console.log("dynamically load env.js"); + const event = loadAppConfigScriptDynamically(window.__env.configStorageServerConfig.targetUrlToConfigStorageServer_appConfig) + .then(() => { console.log("loaded"); }) + .catch(() => { + console.log("Error while loading app config from client config storage server. Will use defaults instead"); + alert("Error while loading app config from client config storage server. Will use defaults instead."); + }); + return $.when(ajaxCall_keycloakConfig(window.__env.configStorageServerConfig), ajaxCall_controlsConfig(window.__env.configStorageServerConfig), ajaxCall_appConfig(window.__env.configStorageServerConfig)).then(function (ajax1Results, ajax2Results, ajax3Results) { + console.log("all configs have been loaded"); + initAngularComponents(); + bootstrapApplication(); + return; + }, function () { + // on fail + console.log("all configs have been loaded - at least some from local backup values. See console log for details"); + initAngularComponents(); + bootstrapApplication(); + return; + }); + } + }); +} +var loadConfigsThenApp = function () { + console.log("start loading required config files"); + $.when(ajaxCall_keycloakConfig_localBackup(window.__env.configStorageServerConfig), ajaxCall_controlsConfig_localBackup(window.__env.configStorageServerConfig)).then(function (ajax1Results, ajax2Results) { + console.log("local backup configs have been loaded in case config server is not reachable."); + ajaxCall_configServerFile(); + }, function () { + // on fail + console.log("all configs have been loaded - at least some from local backup values. See console log for details"); + ajaxCall_configServerFile(); + }); }; - -function initAngularComponents(){ - console.log("Start to initialize required AngularJS components"); - - // Import variables if present (from env.js) - if(window){ - Object.assign(env, window.__env); - } - - // Register environment in AngularJS as constant - appModule.constant('__env', env); - - // MathJx directive - appModule.directive("mathjaxBind", function () { - return { - restrict: "EA", - controller: [ - "$scope", - "$element", - "$attrs", - function ($scope, $element, $attrs) { - $scope.$watch($attrs.mathjaxBind, function (texExpression) { - $element.html(texExpression); - // only if texExpression contains the special character '$' which is used to mark tex code - // then call MathJax function - if(texExpression && texExpression.includes("$")){ - MathJax.typesetPromise([$element[0]]); - } - }); - }, - ], - }; - }); - - // custom unique filter - appModule.filter('unique', function() { - return function(collection, primaryKey) { //no need for secondary key - var output = [], - keys = []; - var splitKeys = primaryKey.split('.'); //split by period - - - angular.forEach(collection, function(item) { - var key = {}; - angular.copy(item, key); - for(var i=0; i', - resolve: { - controlsServiceName: function(ControlsConfigService){ - return ControlsConfigService.promise; - } - } - }). - when('/administration', { - template: '', - resolve: { - 'auth': function(Auth, $q, $location) { - if(window.__env.enableKeycloakSecurity){ - if (Auth.keycloak.authenticated) { - if(Auth.keycloak.tokenParsed - && Auth.keycloak.tokenParsed.realm_access - && Auth.keycloak.tokenParsed.realm_access.roles - && Auth.keycloak.tokenParsed.realm_access.roles.some(role => role.endsWith("-creator") || role.endsWith("-publisher") || role.endsWith("-editor"))){ - Auth.keycloak.showAdminView = true; - } - if (Auth.keycloak.showAdminView) { - return true; - } else { - return $q.reject('Not Authenticated'); + // custom unique filter + appModule.filter('unique', function () { + return function (collection, primaryKey) { + var output = [], keys = []; + var splitKeys = primaryKey.split('.'); //split by period + angular.forEach(collection, function (item) { + var key = {}; + angular.copy(item, key); + for (var i = 0; i < splitKeys.length; i++) { + key = key[splitKeys[i]]; //the beauty of loosely typed js :) + } + if (keys.indexOf(key) === -1) { + keys.push(key); + output.push(item); + } + }); + return output; + }; + }); + appModule.service(controlsServiceName, ['$http', function ($http) { + window.__env.config = null; + // var resourcePath = window.__env.configStorageServerConfig ? window.__env.configStorageServerConfig.targetUrlToConfigStorageServer_controlsConfig : './config/controls-config_backup.json'; + var resourcePath = './config/controls-config_backup.json'; + var promise = $http.get(resourcePath).then(function (response) { + // window.__env.config = response.data; + window.__env.config = window.__env.controlsConfig; + }); + return { + promise: promise, + setData: function (response) { + window.__env.config = window.__env.controlsConfig; + }, + getControlsConfig: function () { + return window.__env.config; + } + }; + }]); + appModule. + config(['$routeProvider', + function config($routeProvider) { + $routeProvider. + when('/', { + template: '', + resolve: { + controlsServiceName: function (ControlsConfigService) { + return ControlsConfigService.promise; } - } - else { - Auth.keycloak.login({ - redirectUri: $location.absUrl() - }); - } } - else{ - + }). + when('/administration', { + template: '', + resolve: { + 'auth': function (Auth, $q, $location) { + if (window.__env.enableKeycloakSecurity) { + if (Auth.keycloak.authenticated) { + if (Auth.keycloak.tokenParsed + && Auth.keycloak.tokenParsed.realm_access + && Auth.keycloak.tokenParsed.realm_access.roles + && Auth.keycloak.tokenParsed.realm_access.roles.some(role => role.endsWith("-creator") || role.endsWith("-publisher") || role.endsWith("-editor"))) { + Auth.keycloak.showAdminView = true; + } + if (Auth.keycloak.showAdminView) { + return true; + } + else { + return $q.reject('Not Authenticated'); + } + } + else { + Auth.keycloak.login({ + redirectUri: $location.absUrl() + }); + } + } + else { + } + } } - - } - } - }). - otherwise('/'); - } + }). + otherwise('/'); + } ]) - .run( function($rootScope, $location, Auth) { - // register listener to watch route changes - $rootScope.$on( "$routeChangeError", function(event, next, current) { - $location.path( "/" ); - }); + .run(function ($rootScope, $location, Auth) { + // register listener to watch route changes + $rootScope.$on("$routeChangeError", function (event, next, current) { + $location.path("/"); + }); }); - - if (!env.enableDebug) { - if(window){ - window.console.log=function(){}; - } + if (window) { + window.console.log = function () { }; + } } - - if(window.__env.enableKeycloakSecurity){ - appModule.factory('authInterceptor', ['$q', 'Auth', function ($q, Auth) { - return { - request: function (config) { - var deferred = $q.defer(); - if (Auth.keycloak.token && urlRequiresKeycloakAuthHeader(config.url)) { - Auth.keycloak.updateToken(5).then(function () { - config.headers = config.headers || {}; - config.headers.Authorization = 'Bearer ' + Auth.keycloak.token; - deferred.resolve(config); - }).catch(function () { - deferred.reject('Failed to refresh token'); - console.error('Failed to refresh token. Will redirect to Login screen'); - auth.keycloak.login(); - }); - return deferred.promise; - } else { - return config; - } - } - }; - }]); - - appModule.config(['$httpProvider', function ($httpProvider) { - $httpProvider.interceptors.push('authInterceptor'); - }]); + if (window.__env.enableKeycloakSecurity) { + appModule.factory('authInterceptor', ['$q', 'Auth', function ($q, Auth) { + return { + request: function (config) { + var deferred = $q.defer(); + if (Auth.keycloak.token && urlRequiresKeycloakAuthHeader(config.url)) { + Auth.keycloak.updateToken(5).then(function () { + config.headers = config.headers || {}; + config.headers.Authorization = 'Bearer ' + Auth.keycloak.token; + deferred.resolve(config); + }).catch(function () { + deferred.reject('Failed to refresh token'); + console.error('Failed to refresh token. Will redirect to Login screen'); + auth.keycloak.login(); + }); + return deferred.promise; + } + else { + return config; + } + } + }; + }]); + appModule.config(['$httpProvider', function ($httpProvider) { + $httpProvider.interceptors.push('authInterceptor'); + }]); } - - if(env.encryption.enabled){ - appModule.factory('encryptionInterceptor', ['$q', function ($q) { - return { - response: function (response) { - // if encrypted, then will look like: - // {encryptedData: encryptedData} - // using AES-CBC - - if(response.data.encryptedData){ - try { - var encryptedString = response.data.encryptedData; - - var decryptedJson = decryptAesCBC(encryptedString); - - response.data = decryptedJson; - - return response; - } catch (error) { - console.error(error); - return response; - } - } - - return response; - }, - }; - }]); - - appModule.config(['$httpProvider', function ($httpProvider) { - $httpProvider.interceptors.push('encryptionInterceptor'); - }]); + if (env.encryption.enabled) { + appModule.factory('encryptionInterceptor', ['$q', function ($q) { + return { + response: function (response) { + // if encrypted, then will look like: + // {encryptedData: encryptedData} + // using AES-CBC + if (response.data.encryptedData) { + try { + var encryptedString = response.data.encryptedData; + var decryptedJson = decryptAesCBC(encryptedString); + response.data = decryptedJson; + return response; + } + catch (error) { + console.error(error); + return response; + } + } + return response; + }, + }; + }]); + appModule.config(['$httpProvider', function ($httpProvider) { + $httpProvider.interceptors.push('encryptionInterceptor'); + }]); } - } - -function bootstrapApplication(){ - - if(window.__env.enableKeycloakSecurity){ - var keycloakAdapter = new Keycloak(window.__env.configStorageServerConfig.targetUrlToConfigStorageServer_keycloakConfig); - - // https://www.keycloak.org/docs/latest/securing_apps/#session-status-iframe - // https://www.keycloak.org/docs/latest/securing_apps/#_modern_browsers - - keycloakAdapter.init({ - onLoad: 'check-sso', - checkLoginIframe: false, - silentCheckSsoFallback: false - }).then(function (authenticated) { - console.log(authenticated ? 'User is authenticated!' : 'User is not authenticated!'); - auth.keycloak = keycloakAdapter; - appModule.factory('Auth', function () { - return auth; - }); - try { - console.debug('Trying to bootstrap application.'); - angular.bootstrap(document, [appModule.name]); - } - catch (e) { - console.error('Application bootstrapping failed.'); - console.error(e); - } - }).catch(function () { - console.log('Failed to initialize authentication adapter. Will try to bootstrap application without keycloak security'); - alert('Failed to initialize keycloak authentication adapter. Will try to bootstrap application without keycloak security'); - window.__env.enableKeycloakSecurity = false; - bootstrapApplication(); - }); - } - else{ - var keycloakAdapter = new Keycloak(keycloakConfig_forDirectInit); - auth.keycloak = keycloakAdapter; - appModule.factory('Auth', function () { - return auth; - }); - - try { - console.debug('Trying to bootstrap application.'); - angular.bootstrap(document, [appModule.name]); - } - catch (e) { - console.error('Application bootstrapping failed.'); - console.error(e); - } - } - +function bootstrapApplication() { + if (window.__env.enableKeycloakSecurity) { + var keycloakAdapter = new Keycloak(window.__env.configStorageServerConfig.targetUrlToConfigStorageServer_keycloakConfig); + // https://www.keycloak.org/docs/latest/securing_apps/#session-status-iframe + // https://www.keycloak.org/docs/latest/securing_apps/#_modern_browsers + keycloakAdapter.init({ + onLoad: 'check-sso', + checkLoginIframe: false, + silentCheckSsoFallback: false + }).then(function (authenticated) { + console.log(authenticated ? 'User is authenticated!' : 'User is not authenticated!'); + auth.keycloak = keycloakAdapter; + appModule.factory('Auth', function () { + return auth; + }); + try { + console.debug('Trying to bootstrap application.'); + angular.bootstrap(document, [appModule.name]); + } + catch (e) { + console.error('Application bootstrapping failed.'); + console.error(e); + } + }).catch(function () { + console.log('Failed to initialize authentication adapter. Will try to bootstrap application without keycloak security'); + alert('Failed to initialize keycloak authentication adapter. Will try to bootstrap application without keycloak security'); + window.__env.enableKeycloakSecurity = false; + bootstrapApplication(); + }); + } + else { + var keycloakAdapter = new Keycloak(keycloakConfig_forDirectInit); + auth.keycloak = keycloakAdapter; + appModule.factory('Auth', function () { + return auth; + }); + try { + console.debug('Trying to bootstrap application.'); + angular.bootstrap(document, [appModule.name]); + } + catch (e) { + console.error('Application bootstrapping failed.'); + console.error(e); + } + } } - angular.element(document).ready(function ($http) { - - // load configs before doing anything else - loadConfigsThenApp(); + // load configs before doing anything else + loadConfigsThenApp(); }); - -var urlRequiresKeycloakAuthHeader = function(url){ - // /admin/ is used to make admin requests against keycloak - if (url.includes("/admin/")){ - return false; - } - // ORS isochrones and directions requests - if (url.includes("isochrones")){ - return false; - } - if (url.includes("routes")){ - return false; - } - - // for KomMonitor public requests we do not need any authentication - if (url.includes("/public/")){ - return false; - } - - return true; +var urlRequiresKeycloakAuthHeader = function (url) { + // /admin/ is used to make admin requests against keycloak + if (url.includes("/admin/")) { + return false; + } + // ORS isochrones and directions requests + if (url.includes("isochrones")) { + return false; + } + if (url.includes("routes")) { + return false; + } + // for KomMonitor public requests we do not need any authentication + if (url.includes("/public/")) { + return false; + } + return true; }; - - - -var isBase64 = function(str) { - var notBase64 = /[^A-Z0-9+\/=]/i; - const isString = (typeof str === 'string' || str instanceof String); - - if (!isString) { - let invalidType; - if (str === null) { - invalidType = 'null'; - } else { - invalidType = typeof str; - if (invalidType === 'object' && str.constructor && str.constructor.hasOwnProperty('name')) { - invalidType = str.constructor.name; - } else { - invalidType = `a ${invalidType}`; - } +var isBase64 = function (str) { + var notBase64 = /[^A-Z0-9+\/=]/i; + const isString = (typeof str === 'string' || str instanceof String); + if (!isString) { + let invalidType; + if (str === null) { + invalidType = 'null'; + } + else { + invalidType = typeof str; + if (invalidType === 'object' && str.constructor && str.constructor.hasOwnProperty('name')) { + invalidType = str.constructor.name; + } + else { + invalidType = `a ${invalidType}`; + } + } + throw new TypeError(`Expected string but received ${invalidType}.`); + } + const len = str.length; + if (!len || len % 4 !== 0 || notBase64.test(str)) { + return false; } - throw new TypeError(`Expected string but received ${invalidType}.`); - } - - const len = str.length; - if (!len || len % 4 !== 0 || notBase64.test(str)) { - return false; - } - const firstPaddingChar = str.indexOf('='); - return firstPaddingChar === -1 || - firstPaddingChar === len - 1 || - (firstPaddingChar === len - 2 && str[len - 1] === '='); - + const firstPaddingChar = str.indexOf('='); + return firstPaddingChar === -1 || + firstPaddingChar === len - 1 || + (firstPaddingChar === len - 2 && str[len - 1] === '='); }; - -var decryptAesCBC = function(encryptedString){ - - var hashedKey = CryptoJS.SHA256(env.encryption.password); - +var decryptAesCBC = function (encryptedString) { + var hashedKey = CryptoJS.SHA256(env.encryption.password); // from BASE64 encoded encrypted string var encryptedWordArray = CryptoJS.enc.Base64.parse(encryptedString); - // get IV from beginning - var iv = CryptoJS.lib.WordArray.create( - encryptedWordArray.words.slice(0, (env.encryption.ivLength_byte) / 4 ) - ); - - var decrypted = CryptoJS.AES.decrypt( - { - ciphertext: CryptoJS.lib.WordArray.create( - encryptedWordArray.words.slice(env.encryption.ivLength_byte / 4) - ) - }, - hashedKey, - {iv: iv} - ); - + var iv = CryptoJS.lib.WordArray.create(encryptedWordArray.words.slice(0, (env.encryption.ivLength_byte) / 4)); + var decrypted = CryptoJS.AES.decrypt({ + ciphertext: CryptoJS.lib.WordArray.create(encryptedWordArray.words.slice(env.encryption.ivLength_byte / 4)) + }, hashedKey, { iv: iv }); var decryptedString = decrypted.toString(CryptoJS.enc.Utf8); - var decryptedJson = JSON.parse(decryptedString); - // sometimes a response might still be BASE64 encoded in addition // if so, then resolve that - if((typeof decryptedJson === 'string' || decryptedJson instanceof String) && isBase64(decryptedJson)){ - decryptedJson = CryptoJS.enc.Base64.parse(decryptedJson).toString(CryptoJS.enc.Utf8); - decryptedJson = JSON.parse(decryptedJson); + if ((typeof decryptedJson === 'string' || decryptedJson instanceof String) && isBase64(decryptedJson)) { + decryptedJson = CryptoJS.enc.Base64.parse(decryptedJson).toString(CryptoJS.enc.Utf8); + decryptedJson = JSON.parse(decryptedJson); } - - return decryptedJson; + return decryptedJson; }; - - +//# sourceMappingURL=app.ajs.js.map \ No newline at end of file diff --git a/app/app.ajs.js.map b/app/app.ajs.js.map new file mode 100644 index 000000000..d850c81a5 --- /dev/null +++ b/app/app.ajs.js.map @@ -0,0 +1 @@ +{"version":3,"file":"app.ajs.js","sourceRoot":"","sources":["app.ajs.ts"],"names":[],"mappings":";AAAA,IAAI,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE;IACrH,wCAAwC;IACxC,MAAM,CAAC,KAAK,CAAC,kIAAkI,CAAC,CAAC;CACpJ;AAGD,IAAI,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,EAAC;IACxC,yBAAyB;IAEzB,MAAM,CAAC,KAAK,CAAC,+HAA+H,CAAC,CAAC;CAChJ;AAED,IAAI,GAAG,GAAG,EAAE,CAAC;AAEb,8GAA8G;AAC9G,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC;AAElC,kEAAkE;AAClE,IAAI,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,CAAE,SAAS,EAAE,yBAAyB,EAAE,iBAAiB,CAAC,CAAC,CAAC;AAE/G,IAAI,mBAAmB,GAAG,uBAAuB,CAAC;AAClD,IAAI,IAAI,GAAG,EAAE,CAAC;AAGd;;EAEE;AACF,SAAS,uBAAuB,CAAC,yBAAyB;IACxD,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;IACjD,OAAQ,CAAC,CAAC,IAAI,CAAC;QACX,GAAG,EAAE,yBAAyB,CAAC,6CAA6C;QAC5E,OAAO,EAAE,UAAS,MAAM;YACtB,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;YAC5C,MAAM,CAAC,KAAK,CAAC,cAAc,GAAG,MAAM,CAAC;YACrC,OAAO;QACT,CAAC;QACD,KAAK,EAAE,UAAS,cAAc,EAAE,UAAU,EA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AAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;KAC3C;IAED,OAAO,aAAa,CAAC;AACzB,CAAC,CAAC"} \ No newline at end of file diff --git a/app/app.module.js b/app/app.module.js new file mode 100644 index 000000000..54a972858 --- /dev/null +++ b/app/app.module.js @@ -0,0 +1,20 @@ +import { __decorate } from "tslib"; +import { NgModule } from '@angular/core'; +import { BrowserModule } from '@angular/platform-browser'; +import { InfoModalModule } from 'components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.module'; +export let AppModule = class AppModule { + constructor(upgrade) { + this.upgrade = upgrade; + } + ngDoBootstrap() { + this.upgrade.bootstrap(document.documentElement, ['kommonitorClient']); + } +}; +AppModule = __decorate([ + NgModule({ + imports: [ + BrowserModule, InfoModalModule + ], + }) +], AppModule); +//# sourceMappingURL=app.module.js.map \ No newline at end of file diff --git a/app/app.module.js.map b/app/app.module.js.map new file mode 100644 index 000000000..de975f22e --- /dev/null +++ b/app/app.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"app.module.js","sourceRoot":"","sources":["app.module.ts"],"names":[],"mappings":";AAAA,OAAO,EAAe,QAAQ,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,MAAM,mFAAmF,CAAC;AAO7G,WAAM,SAAS,GAAf,MAAM,SAAS;IAClB,YAAoB,OAAsB;QAAtB,YAAO,GAAP,OAAO,CAAe;IAAI,CAAC;IAC/C,aAAa;QACT,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC;IACzE,CAAC;CACN,CAAA;AALY,SAAS;IANrB,QAAQ,CAAC;QACR,OAAO,EAAE;YACP,aAAa,EAAC,eAAe;SAC9B;KAEF,CAAC;GACW,SAAS,CAKrB"} \ No newline at end of file diff --git a/app/app.module.ts b/app/app.module.ts index d95fba0cb..f1d982a81 100644 --- a/app/app.module.ts +++ b/app/app.module.ts @@ -1,11 +1,13 @@ import { DoBootstrap, NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { UpgradeModule } from '@angular/upgrade/static'; - +import { InfoModalModule } from 'components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.module'; +import { VersionInfoModule } from 'components/kommonitorUserInterface/kommonitorControls/versionInfo/version-info.module'; @NgModule({ imports: [ - BrowserModule, + BrowserModule ], + }) export class AppModule implements DoBootstrap { constructor(private upgrade: UpgradeModule) { } diff --git a/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.component.css b/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.component.css new file mode 100644 index 000000000..e69de29bb diff --git a/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.component.js.map b/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.component.js.map deleted file mode 100644 index cbae76592..000000000 --- a/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"info-modal.component.js","sourceRoot":"","sources":["info-modal.component.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,SAAS,CAAC,WAAW,EAAE;IAClD,WAAW,EAAG,0FAA0F;IACxG,UAAU,EAAG;QACZ,+BAA+B,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU;QAC5E,SAAS,mBAAmB,CAAC,6BAA6B,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ;YAE/F,IAAI,CAAC,qCAAqC,GAAG,6BAA6B,CAAC;YAE3E,MAAM,CAAC,eAAe,GAAG,KAAK,CAAC;YAE/B,MAAM,CAAC,IAAI,GAAG;gBACb,IAAG,CAAE,CAAC,YAAY,CAAC,OAAO,CAAC,2BAA2B,CAAC,KAAK,MAAM,CAAC,EAAE;oBAEpE,MAAM,CAAC,eAAe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O,EAAE,UAAS,KAAK;gBAExD,IAAG,MAAM,CAAC,eAAe,EAAC;oBACzB,MAAM,CAAC,eAAe,GAAG,KAAK,CAAC;iBAC/B;qBACG;oBACH,MAAM,CAAC,eAAe,GAAG,IAAI,CAAC;iBAC9B;gBACD,qBAAqB,EAAE,CAAC;gBACxB,KAAK,CAAC,eAAe,EAAE,CAAC;YACvB,CAAC,CAAC,CAAC;YAEL,IAAI,mBAAmB,GAAG;gBACzB,CAAC,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;gBAC9B,UAAU,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC;YAC1C,CAAC,CAAC;YAEF,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,4BAA4B,EAAE,UAAU,CAAC;gBAChE,mBAAmB,EAAE,CAAC;YACrB,CAAC,CAAC,CAAC;YAEL,MAAM,CAAC,gBAAgB,GAAG;gBACzB,CAAC,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;gBAC9B,CAAC,CAAC,gBAAgB,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YACnC,CAAC,CAAC;YAEF,MAAM,CAAC,IAAI,EAAE,CAAC;QACf,CAAC;KACD;CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.component.ts b/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.component.ts index 90d76b4ef..b9331d2df 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.component.ts +++ b/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.component.ts @@ -1,81 +1,89 @@ -angular.module('infoModal').component('infoModal', { - templateUrl : "components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.template.html", - controller : [ - 'kommonitorDataExchangeService', '$scope', '$rootScope', '__env', '$timeout', - function InfoModalController(kommonitorDataExchangeService, $scope, $rootScope, __env, $timeout) { - - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - - $scope.isHideGreetings = false; - - $scope.init = function(){ - if(! (localStorage.getItem("hideKomMonitorAppGreeting") === "true")) { - - $scope.isHideGreetings = false; - - $('#infoModal').modal('show'); - } - else{ - $scope.isHideGreetings = true; - $("#changeHideGreetingsInput").prop('checked', true); - } - - let tab1 = document.getElementById("infoModalTab1"); - tab1.innerHTML = __env.standardInfoModalTabTitle; - tab1.click(); - tab1.focus(); - - if(__env.enableExtendedInfoModal) { - let tab3 = document.getElementById("infoModalTab3"); - let tab3content = document.getElementById("infoModalTab3Content"); - tab3.innerHTML = __env.extendedInfoModalTabTitle; - tab3content.innerHTML = __env.extendedInfoModalHTMLMessage; - } else { - document.getElementById("infoModalTab3").style.display = "none"; - } - - - $timeout(function(){ - $scope.$digest(); - }, 250); - - }; - - var onChangeHideGreetings = function(){ - if($scope.isHideGreetings){ - localStorage.setItem("hideKomMonitorAppGreeting", "true"); - } - else{ - localStorage.setItem("hideKomMonitorAppGreeting", "false"); - } - }; - - $('#changeHideGreetingsInput').on('click', function(event) { - - if($scope.isHideGreetings){ - $scope.isHideGreetings = false; - } - else{ - $scope.isHideGreetings = true; - } - onChangeHideGreetings(); - event.stopPropagation(); - }); - - var callStartGuidedTour = function(){ - $('#infoModal').modal('hide'); - $rootScope.$broadcast("startGuidedTour"); - }; - - $(document).on('click', '#callStartGuidedTourButton', function (e) { - callStartGuidedTour(); - }); - - $scope.showFeedbackForm = function(){ - $('#infoModal').modal('hide'); - $('#feedbackModal').modal('show'); - }; - - $scope.init(); - } -]}); + +import { DomSanitizer, SafeHtml } from "@angular/platform-browser"; +import { Component, OnInit } from '@angular/core'; +import { NgbModule} from '@ng-bootstrap/ng-bootstrap'; +import { Router } from '@angular/router'; +import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +@Component({ + selector: 'infoModal', + templateUrl: 'info-modal.template.html', + styleUrls: ['info-modal.component.css'] +}) +export class InfoModalComponent implements OnInit { + + isHideGreetings: boolean = false; + + customGreetingsContact_name: SafeHtml; + customGreetingsContact_organisation: SafeHtml; + customGreetingsContact_mail: string; + customGreetingsTextInfoMessage: SafeHtml; + sanitizer: any; + + + constructor(private modalService: NgbModal, private router: Router) { + this.customGreetingsContact_name = this.sanitizer.bypassSecurityTrustHtml(''); + this.customGreetingsContact_organisation = this.sanitizer.bypassSecurityTrustHtml(''); + this.customGreetingsContact_mail = ''; + this.customGreetingsTextInfoMessage = this.sanitizer.bypassSecurityTrustHtml(''); + + + } + + ngOnInit(): void { + if (!(localStorage.getItem('hideKomMonitorAppGreeting') === 'true')) { + this.isHideGreetings = false; + this.modalService.open('infoModal'); + } else { + this.isHideGreetings = true; + } + + } + dismissModal() { + this.modalService.dismissAll(); + } + + + onChangeHideGreetings(): void { + if (this.isHideGreetings) { + localStorage.setItem('hideKomMonitorAppGreeting', 'true'); + } else { + localStorage.setItem('hideKomMonitorAppGreeting', 'false'); + } + } + callStartGuidedTour(): void { + this.modalService.dismissAll('infoModal'); + this.router.navigate(['/guided-tour']); + } + showFeedbackForm(): void { + this.modalService.dismissAll('infoModal'); + this.router.navigate(['/feedback']); + } +} + + + + + + + + + + + + + + + + + + + + + + + + +function dismissModal() { + throw new Error("Function not implemented."); +} + diff --git a/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.module.js.map b/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.module.js.map deleted file mode 100644 index c10e24a3d..000000000 --- a/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"info-modal.module.js","sourceRoot":"","sources":["info-modal.module.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.module.ts b/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.module.ts index 3b47b77ce..35242685f 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.module.ts +++ b/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.module.ts @@ -1 +1,15 @@ -angular.module('infoModal', ['versionInfo']); +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { InfoModalComponent } from './info-modal.component'; +import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; +import { VersionInfoModule } from '../versionInfo/version-info.module'; +@NgModule({ +declarations:[InfoModalComponent], +imports:[CommonModule,NgbModule,VersionInfoModule], +exports:[InfoModalComponent] + +}) + +export class InfoModalModule{ + +} \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.template.html b/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.template.html index f77ca3f75..31b10a874 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.template.html +++ b/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.template.html @@ -1,134 +1,123 @@ - + @@ -79,11 +82,12 @@

        Neuerungen in KomMonitor V2.1.12

        Neuerungen in KomMonitor V2.1.11

        - +
        -
        +
        • @@ -118,11 +122,12 @@

          Neuerungen in KomMonitor V2.1.11

          Neuerungen in KomMonitor V2.1.10

          - +
        -
        +
        • @@ -158,11 +163,12 @@

          Neuerungen in KomMonitor V2.1.10

          Neuerungen in KomMonitor V2.1.9

          - +
        -
        +
        • @@ -199,11 +205,12 @@

          Neuerungen in KomMonitor V2.1.9

          Neuerungen in KomMonitor V2.1.8

          - +
        -
        +
        • @@ -238,11 +245,12 @@

          Neuerungen in KomMonitor V2.1.8

          Neuerungen in KomMonitor V2.1.7

          - +
        -
        +
        • @@ -287,11 +295,12 @@

          Neuerungen in KomMonitor V2.1.7

          Neuerungen in KomMonitor V2.1.6

          - +
        -
        +
        • @@ -316,11 +325,12 @@

          Neuerungen in KomMonitor V2.1.6

          Neuerungen in KomMonitor V2.1.5

          - +
        -
        +
        • @@ -343,11 +353,12 @@

          Neuerungen in KomMonitor V2.1.5

          Neuerungen in KomMonitor V2.1.4

          - +
        -
        +
        • @@ -368,11 +379,12 @@

          Neuerungen in KomMonitor V2.1.4

          Neuerungen in KomMonitor V2.1.3

          - +
        -
        +
        • @@ -392,11 +404,12 @@

          Neuerungen in KomMonitor V2.1.3

          Neuerungen in KomMonitor V2.1.2

          - +
        -
        +
        • @@ -419,11 +432,12 @@

          Neuerungen in KomMonitor V2.1.2

          Neuerungen in KomMonitor V2.1.1

          - +
        -
        +
        • @@ -443,11 +457,12 @@

          Neuerungen in KomMonitor V2.1.1

          Neuerungen in KomMonitor V2.1.0

          - +
        -
        +
        • @@ -526,11 +541,12 @@

          Neuerungen in KomMonitor V2.1.0

          Neuerungen in KomMonitor V2.0.1

          - +
        -
        +
        • @@ -550,11 +566,12 @@

          Neuerungen in KomMonitor V2.0.1

          Neuerungen in KomMonitor V2.0.0

          - +
        -
        +
        Grundlegende Erweiterung des Datenmodells und des Rollen- und Rechtemanagements

        Die Aktualisierung aller KomMonitor Komponenten auf eine Version >= V2.0.0 beinhaltet bedeutende @@ -677,7 +694,7 @@

        Upgradeempfehlung KomMonitor < V2.0.0

        -
        +
        KomMonitor wurde in Version 2.0.0 hinsichtlich des Datenmodells sowie Rechte- und Rollenkonzepts grundlegend erweitert. Es wird daher dringend empfohlen, alle Komponenten auf die neueste Version zu aktualisieren. diff --git a/app/config/config-storage-server.json b/app/config/config-storage-server.json index 7a86c3466..f83a94a60 100644 --- a/app/config/config-storage-server.json +++ b/app/config/config-storage-server.json @@ -1,5 +1,5 @@ { - "targetUrlToConfigStorageServer_appConfig" : "http://localhost:8088/config/client-app-config", - "targetUrlToConfigStorageServer_keycloakConfig" : "http://localhost:8088/config/client-keycloak-config", - "targetUrlToConfigStorageServer_controlsConfig" : "http://localhost:8088/config/client-controls-config" + "targetUrlToConfigStorageServer_appConfig" : "https://demo.kommonitor.de/client-config/config/client-app-config", + "targetUrlToConfigStorageServer_keycloakConfig" : "https://demo.kommonitor.de/client-config/config/client-keycloak-config", + "targetUrlToConfigStorageServer_controlsConfig" : "https://demo.kommonitor.de/client-config/config/client-controls-config" } \ No newline at end of file diff --git a/app/index.html b/app/index.html index b4a26234b..a38448108 100644 --- a/app/index.html +++ b/app/index.html @@ -130,23 +130,23 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + @@ -316,8 +316,8 @@ - - + + diff --git a/app/kommonitor-script-resources/km_georesource_share_byPropertyValue.js b/app/kommonitor-script-resources/km_georesource_share_byPropertyValue.js index 83e02d0aa..5574eff2d 100644 --- a/app/kommonitor-script-resources/km_georesource_share_byPropertyValue.js +++ b/app/kommonitor-script-resources/km_georesource_share_byPropertyValue.js @@ -133,9 +133,9 @@ async function computeIndicator(targetDate, targetSpatialUnit_geoJSON, baseIndic KmHelper.setIndicatorValue(spatialUnitFeat, targetDate, null); } } - } - if (featureIndex % logProgressIndexSeparator === 0) { - KmHelper.log("PROGRESS: Compared '" + featureIndex + "' of total '" + targetSpatialUnit_geoJSON.features.length + "' spatial units to point features."); + if (featureIndex % logProgressIndexSeparator === 0) { + KmHelper.log("PROGRESS: Compared '" + featureIndex + "' of total '" + targetSpatialUnit_geoJSON.features.length + "' spatial units to point features."); + } } KmHelper.log("Computation of indicator finished"); return targetSpatialUnit_geoJSON; diff --git a/app/kommonitor-script-resources/km_georesource_share_byPropertyValue.js.map b/app/kommonitor-script-resources/km_georesource_share_byPropertyValue.js.map index 57582b968..f54d54557 100644 --- a/app/kommonitor-script-resources/km_georesource_share_byPropertyValue.js.map +++ b/app/kommonitor-script-resources/km_georesource_share_byPropertyValue.js.map @@ -1 +1 @@ -{"version":3,"file":"km_georesource_share_byPropertyValue.js","sourceRoot":"","sources":["km_georesource_share_byPropertyValue.ts"],"names":[],"mappings":";AAAA,8JAA8J;AAC9J,yRAAyR;AACzR,8JAA8J;AAC9J,4GAA4G;AAC5G,8JAA8J;AAE9J;;;EAGE;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AAgC,GAAG,+BAA+B,GAAG,yBAAyB,CAAC,QAAQ,CAAC,MAAM,GAAG,iBAAiB,CAAC,CAAC;IAEjJ,IAAG,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAC;QAC9B,OAAO,CAAC,KAAK,CAAC,mDAAmD,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAC9F,MAAM,KAAK,CAAC,6DAA6D,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;KACvG;IAED,OAAO,yBAAyB,CAAC;AACnC,CAAC;AAAA,CAAC;AAGF,MAAM,CAAC,OAAO,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;AACnD,MAAM,CAAC,OAAO,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;AACvD,MAAM,CAAC,OAAO,CAAC,qBAAqB,GAAG,qBAAqB,CAAC"} \ No newline at end of file +{"version":3,"file":"km_georesource_share_byPropertyValue.js","sourceRoot":"","sources":["km_georesource_share_byPropertyValue.ts"],"names":[],"mappings":";AAAA,8JAA8J;AAC9J,yRAAyR;AACzR,8JAA8J;AAC9J,4GAA4G;AAC5G,8JAA8J;AAE9J;;;EAGE;AACF,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAGrC,8JAA8J;AAC9J,8JAA8J;AAC9J,6OAA6O;AAC7O,8JAA8J;AAE9J;;;;;;;EAOE;AACF,MAAM,mBAAmB,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AAE/C;;;;;;EAME;AACF,MAAM,eAAe,GAAG,KAAK,CAAC;AAC9B,MAAM,8BAA8B,GAAG,gBAAgB,CAAC;AACxD,MAAM,8BAA8B,GAAG,oBAAoB,CAAC;AAC5D,MAAM,mCAAmC,GAAG,mBAAmB,CAAC;AAGhE;;;;;;;;;;;;;;;;EAgBE;AACF,KAAK,UAAU,gBAAgB,CAAC,UAAU,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,eAAe,EAAE,iBAAiB;IAC3H,iEAAiE;I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"} \ No newline at end of file diff --git a/app/main.js b/app/main.js new file mode 100644 index 000000000..aa8164a25 --- /dev/null +++ b/app/main.js @@ -0,0 +1,5 @@ +/// +import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; +import { AppModule } from './app.module'; +platformBrowserDynamic().bootstrapModule(AppModule); +//# sourceMappingURL=main.js.map \ No newline at end of file diff --git a/app/main.js.map b/app/main.js.map new file mode 100644 index 000000000..a4d748217 --- /dev/null +++ b/app/main.js.map @@ -0,0 +1 @@ +{"version":3,"file":"main.js","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAE3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,sBAAsB,EAAE,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC"} \ No newline at end of file diff --git a/app/main.ts b/app/main.ts index 91a439a63..6b7380ce6 100644 --- a/app/main.ts +++ b/app/main.ts @@ -1,3 +1,5 @@ +/// + import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { AppModule } from './app.module'; diff --git a/package-lock.json b/package-lock.json index 9677e6c62..98f094d52 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,6 +19,8 @@ "@angular/router": "^16.1.3", "@angular/upgrade": "^16.1.3", "@fortawesome/fontawesome-free": "^6.1.1", + "@ng-bootstrap/ng-bootstrap": "^15.1.0", + "@popperjs/core": "^2.11.8", "@turf/turf": "^6.5.0", "admin-lte": "^2.4.15", "ag-grid-community": "^26.2.1", @@ -28,7 +30,7 @@ "angular-sanitize": "^1.7.8", "angular-ui-bootstrap": "^2.5.6", "angularjs-dropdown-multiselect": "^2.0.0-beta.10", - "bootstrap": "^3.3.7", + "bootstrap": "^3.4.1", "bootstrap-datepicker": "^1.7.0", "bootstrap-daterangepicker": "^2.1.25", "bootstrap-iconpicker-latest": "^1.12.0", @@ -37,6 +39,7 @@ "classybrew": "0.0.3", "code-prettify": "^0.1.0", "codemirror": "^5.59.1", + "colorbrewer": "^1.5.3", "crypto-js": "^4.0.0", "docx": "^7.3.0", "echarts": "^5.3.0", @@ -47,9 +50,9 @@ "html2pdf.js": "^0.10.1", "ion-rangeslider": "^2.3.0", "ionicons": "^3.0.0", - "jquery": "^3.5.1", + "jquery": "^3.7.0", "jquery-slimscroll": "^1.3.8", - "jquery-ui-dist": "^1.12.1", + "jquery-ui-dist": "^1.13.2", "jquery.easing": "^1.4.1", "js-xlsx": "^0.8.22", "jshint": "^2.13.5", @@ -96,6 +99,7 @@ "@types/angular-route": "^1.7.3", "@types/angular-sanitize": "^1.8.1", "@types/jasmine": "^4.3.5", + "@types/jquery": "^3.5.16", "babel-core": "^6.26.0", "babel-plugin-angularjs-annotate": "^0.10.0", "babel-plugin-transform-es2015-destructuring": "^6.23.0", @@ -132,7 +136,6 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", - "dev": true, "dependencies": { "@jridgewell/gen-mapping": "^0.3.0", "@jridgewell/trace-mapping": "^0.3.9" @@ -142,12 +145,12 @@ } }, "node_modules/@angular-devkit/architect": { - "version": "0.1601.3", - "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.1601.3.tgz", - "integrity": "sha512-HvW51cCEoIYe2mYqcmnm2RZiMMFbFn7iIdsjbCJe7etFhcG+Y3hGDZMh4IFSiQiss+pwPSYOvQY2zwGrndMgLw==", + "version": "0.1601.4", + "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.1601.4.tgz", + "integrity": "sha512-OOSbNlDy+Q3jY0oFHaq8kkna9HYI1zaS8IHeCIDP6T/ZIAVad4+HqXAL4SKQrKJikkoBQv1Z/eaDBL5XPFK9Bw==", "dev": true, "dependencies": { - "@angular-devkit/core": "16.1.3", + "@angular-devkit/core": "16.1.4", "rxjs": "7.8.1" }, "engines": { @@ -157,17 +160,17 @@ } }, "node_modules/@angular-devkit/build-angular": { - "version": "16.1.3", - "resolved": "https://registry.npmjs.org/@angular-devkit/build-angular/-/build-angular-16.1.3.tgz", - "integrity": "sha512-1scrdUdKRa9TkJ9jev/KRzFttbLUVACQvVRL0G67nUAdtJ/bQX8eui85axpCNPFihK4ReSW3R4lrgcVC2NUSoA==", + "version": "16.1.4", + "resolved": "https://registry.npmjs.org/@angular-devkit/build-angular/-/build-angular-16.1.4.tgz", + "integrity": "sha512-LiHM7R20fTHg/eM+Iabotj08edP5wVBQahRfVNLxERo8X6VJgSjVChnsh3AQJkRywlGuFe20AOQYpyLyN367Ug==", "dev": true, "dependencies": { "@ampproject/remapping": "2.2.1", - "@angular-devkit/architect": "0.1601.3", - "@angular-devkit/build-webpack": "0.1601.3", - "@angular-devkit/core": "16.1.3", + "@angular-devkit/architect": "0.1601.4", + "@angular-devkit/build-webpack": "0.1601.4", + "@angular-devkit/core": "16.1.4", "@babel/core": "7.22.5", - "@babel/generator": "7.22.5", + "@babel/generator": "7.22.7", "@babel/helper-annotate-as-pure": "7.22.5", "@babel/helper-split-export-declaration": "7.22.5", "@babel/plugin-proposal-async-generator-functions": "7.20.7", @@ -177,7 +180,7 @@ "@babel/runtime": "7.22.5", "@babel/template": "7.22.5", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "16.1.3", + "@ngtools/webpack": "16.1.4", "@vitejs/plugin-basic-ssl": "1.0.1", "ansi-colors": "4.1.3", "autoprefixer": "10.4.14", @@ -278,175 +281,91 @@ } } }, - "node_modules/@angular-devkit/build-angular/node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "dev": true, - "dependencies": { - "debug": "4" - }, - "engines": { - "node": ">= 6.0.0" - } - }, - "node_modules/@angular-devkit/build-angular/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/@angular-devkit/build-angular/node_modules/ajv-keywords": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", - "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.3" - }, - "peerDependencies": { - "ajv": "^8.8.2" - } - }, - "node_modules/@angular-devkit/build-angular/node_modules/ansi-escapes": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "node_modules/@angular-devkit/build-angular/node_modules/@babel/core": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.22.5.tgz", + "integrity": "sha512-SBuTAjg91A3eKOvD+bPEz3LlhHZRNu1nFOVts9lzDJTXshHTjII0BAtDS3Y2DAkdZdDKWVZGVwkDfc4Clxn1dg==", "dev": true, "dependencies": { - "type-fest": "^0.21.3" + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.22.5", + "@babel/generator": "^7.22.5", + "@babel/helper-compilation-targets": "^7.22.5", + "@babel/helper-module-transforms": "^7.22.5", + "@babel/helpers": "^7.22.5", + "@babel/parser": "^7.22.5", + "@babel/template": "^7.22.5", + "@babel/traverse": "^7.22.5", + "@babel/types": "^7.22.5", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.2", + "semver": "^6.3.0" }, "engines": { - "node": ">=8" + "node": ">=6.9.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "type": "opencollective", + "url": "https://opencollective.com/babel" } }, - "node_modules/@angular-devkit/build-angular/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "node_modules/@angular-devkit/build-angular/node_modules/@babel/core/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, - "engines": { - "node": ">=8" + "bin": { + "semver": "bin/semver.js" } }, - "node_modules/@angular-devkit/build-angular/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/@angular-devkit/build-angular/node_modules/acorn": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", "dev": true, - "dependencies": { - "color-convert": "^2.0.1" + "bin": { + "acorn": "bin/acorn" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@angular-devkit/build-angular/node_modules/bl": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", - "dev": true, - "dependencies": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" + "node": ">=0.4.0" } }, - "node_modules/@angular-devkit/build-angular/node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "node_modules/@angular-devkit/build-angular/node_modules/acorn-import-assertions": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz", + "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==", "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" + "peerDependencies": { + "acorn": "^8" } }, - "node_modules/@angular-devkit/build-angular/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "node_modules/@angular-devkit/build-angular/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" }, "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/@angular-devkit/build-angular/node_modules/cli-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", - "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", - "dev": true, - "dependencies": { - "restore-cursor": "^3.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@angular-devkit/build-angular/node_modules/cli-width": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", - "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", - "dev": true, - "engines": { - "node": ">= 10" + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/@angular-devkit/build-angular/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/@angular-devkit/build-angular/node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" + "peerDependencies": { + "ajv": "^6.9.1" } }, - "node_modules/@angular-devkit/build-angular/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, "node_modules/@angular-devkit/build-angular/node_modules/copy-webpack-plugin": { "version": "11.0.0", "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-11.0.0.tgz", @@ -471,44 +390,6 @@ "webpack": "^5.1.0" } }, - "node_modules/@angular-devkit/build-angular/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/@angular-devkit/build-angular/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/@angular-devkit/build-angular/node_modules/figures": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", - "dev": true, - "dependencies": { - "escape-string-regexp": "^1.0.5" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/@angular-devkit/build-angular/node_modules/glob-parent": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", @@ -522,14 +403,14 @@ } }, "node_modules/@angular-devkit/build-angular/node_modules/globby": { - "version": "13.2.1", - "resolved": "https://registry.npmjs.org/globby/-/globby-13.2.1.tgz", - "integrity": "sha512-DPCBxctI7dN4EeIqjW2KGqgdcUMbrhJ9AzON+PlxCtvppWhubTLD4+a0GFxiym14ZvacUydTPjLPc2DlKz7EIg==", + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.2.2.tgz", + "integrity": "sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==", "dev": true, "dependencies": { "dir-glob": "^3.0.1", - "fast-glob": "^3.2.11", - "ignore": "^5.2.0", + "fast-glob": "^3.3.0", + "ignore": "^5.2.4", "merge2": "^1.4.1", "slash": "^4.0.0" }, @@ -540,6357 +421,3576 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@angular-devkit/build-angular/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "node_modules/@angular-devkit/build-angular/node_modules/globby/node_modules/fast-glob": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.0.tgz", + "integrity": "sha512-ChDuvbOypPuNjO8yIDf36x7BlZX1smcUMTTcyoIjycexOxd6DFsKsg21qVBzEmr3G7fUKIRy2/psii+CIUt7FA==", "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, "engines": { - "node": ">=8" + "node": ">=8.6.0" } }, - "node_modules/@angular-devkit/build-angular/node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "node_modules/@angular-devkit/build-angular/node_modules/globby/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, "dependencies": { - "agent-base": "6", - "debug": "4" + "is-glob": "^4.0.1" }, "engines": { "node": ">= 6" } }, - "node_modules/@angular-devkit/build-angular/node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "node_modules/@angular-devkit/build-angular/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, - "node_modules/@angular-devkit/build-angular/node_modules/inquirer": { - "version": "8.2.4", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.4.tgz", - "integrity": "sha512-nn4F01dxU8VeKfq192IjLsxu0/OmMZ4Lg3xKAns148rCaXP6ntAoEkVYZThWjwON8AlzdZZi6oqnhNbxUG9hVg==", + "node_modules/@angular-devkit/build-angular/node_modules/serialize-javascript": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz", + "integrity": "sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==", "dev": true, "dependencies": { - "ansi-escapes": "^4.2.1", - "chalk": "^4.1.1", - "cli-cursor": "^3.1.0", - "cli-width": "^3.0.0", - "external-editor": "^3.0.3", - "figures": "^3.0.0", - "lodash": "^4.17.21", - "mute-stream": "0.0.8", - "ora": "^5.4.1", - "run-async": "^2.4.0", - "rxjs": "^7.5.5", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0", - "through": "^2.3.6", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/@angular-devkit/build-angular/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/@angular-devkit/build-angular/node_modules/is-interactive": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", - "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", - "dev": true, - "engines": { - "node": ">=8" + "randombytes": "^2.1.0" } }, - "node_modules/@angular-devkit/build-angular/node_modules/is-unicode-supported": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", - "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "node_modules/@angular-devkit/build-angular/node_modules/slash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", "dev": true, "engines": { - "node": ">=10" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@angular-devkit/build-angular/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "node_modules/@angular-devkit/build-angular/node_modules/tslib": { + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.3.tgz", + "integrity": "sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==", "dev": true }, - "node_modules/@angular-devkit/build-angular/node_modules/loader-utils": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-3.2.1.tgz", - "integrity": "sha512-ZvFw1KWS3GVyYBYb7qkmRM/WwL2TQQBxgCK62rlvm4WpVQ23Nb4tYjApUlfjrEGvOs7KHEsmyUn75OHZrJMWPw==", - "dev": true, - "engines": { - "node": ">= 12.13.0" - } - }, - "node_modules/@angular-devkit/build-angular/node_modules/log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "node_modules/@angular-devkit/build-angular/node_modules/webpack": { + "version": "5.86.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.86.0.tgz", + "integrity": "sha512-3BOvworZ8SO/D4GVP+GoRC3fVeg5MO4vzmq8TJJEkdmopxyazGDxN8ClqN12uzrZW9Tv8EED8v5VSb6Sqyi0pg==", "dev": true, "dependencies": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" + "@types/eslint-scope": "^3.7.3", + "@types/estree": "^1.0.0", + "@webassemblyjs/ast": "^1.11.5", + "@webassemblyjs/wasm-edit": "^1.11.5", + "@webassemblyjs/wasm-parser": "^1.11.5", + "acorn": "^8.7.1", + "acorn-import-assertions": "^1.9.0", + "browserslist": "^4.14.5", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^5.14.1", + "es-module-lexer": "^1.2.1", + "eslint-scope": "5.1.1", + "events": "^3.2.0", + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.2.9", + "json-parse-even-better-errors": "^2.3.1", + "loader-runner": "^4.2.0", + "mime-types": "^2.1.27", + "neo-async": "^2.6.2", + "schema-utils": "^3.1.2", + "tapable": "^2.1.1", + "terser-webpack-plugin": "^5.3.7", + "watchpack": "^2.4.0", + "webpack-sources": "^3.2.3" + }, + "bin": { + "webpack": "bin/webpack.js" }, "engines": { - "node": ">=10" + "node": ">=10.13.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@angular-devkit/build-angular/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" + "type": "opencollective", + "url": "https://opencollective.com/webpack" }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@angular-devkit/build-angular/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/@angular-devkit/build-angular/node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, - "engines": { - "node": ">=0.10.0" + "peerDependenciesMeta": { + "webpack-cli": { + "optional": true + } } }, - "node_modules/@angular-devkit/build-angular/node_modules/open": { - "version": "8.4.2", - "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", - "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", + "node_modules/@angular-devkit/build-angular/node_modules/webpack/node_modules/schema-utils": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", "dev": true, "dependencies": { - "define-lazy-prop": "^2.0.0", - "is-docker": "^2.1.1", - "is-wsl": "^2.2.0" + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" }, "engines": { - "node": ">=12" + "node": ">= 10.13.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "type": "opencollective", + "url": "https://opencollective.com/webpack" } }, - "node_modules/@angular-devkit/build-angular/node_modules/ora": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", - "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", + "node_modules/@angular-devkit/build-webpack": { + "version": "0.1601.4", + "resolved": "https://registry.npmjs.org/@angular-devkit/build-webpack/-/build-webpack-0.1601.4.tgz", + "integrity": "sha512-GC1y//ScAYbYQ68Wri2QgTEekC4hRxBC+xEkYL9OFiAMQ4mcN+eYvbkQBX8enJwDMXpkYfLR6VV8cChjAVYIgg==", "dev": true, "dependencies": { - "bl": "^4.1.0", - "chalk": "^4.1.0", - "cli-cursor": "^3.1.0", - "cli-spinners": "^2.5.0", - "is-interactive": "^1.0.0", - "is-unicode-supported": "^0.1.0", - "log-symbols": "^4.1.0", - "strip-ansi": "^6.0.0", - "wcwidth": "^1.0.1" + "@angular-devkit/architect": "0.1601.4", + "rxjs": "7.8.1" }, "engines": { - "node": ">=10" + "node": "^16.14.0 || >=18.10.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "peerDependencies": { + "webpack": "^5.30.0", + "webpack-dev-server": "^4.0.0" } }, - "node_modules/@angular-devkit/build-angular/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "node_modules/@angular-devkit/core": { + "version": "16.1.4", + "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-16.1.4.tgz", + "integrity": "sha512-WCAzNi9LxpFIi2WVPaJQd2kHPqCnCexWzUZN05ltJuBGCQL1O+LgRHGwnQ4WZoqmrF5tcWt2a3GFtJ3DgMc1hw==", "dev": true, "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" + "ajv": "8.12.0", + "ajv-formats": "2.1.1", + "jsonc-parser": "3.2.0", + "rxjs": "7.8.1", + "source-map": "0.7.4" }, "engines": { - "node": ">= 6" + "node": "^16.14.0 || >=18.10.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" + }, + "peerDependencies": { + "chokidar": "^3.5.2" + }, + "peerDependenciesMeta": { + "chokidar": { + "optional": true + } } }, - "node_modules/@angular-devkit/build-angular/node_modules/restore-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", - "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "node_modules/@angular-devkit/schematics": { + "version": "16.1.4", + "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-16.1.4.tgz", + "integrity": "sha512-yjRgwHAfFaeuimgbQtjwSUyXzEHpMSdTRb2zg+TOp6skoGvHOG8xXFJ7DjBkSMeAQdFF0fkxhPS9YmlxqNc+7A==", "dev": true, "dependencies": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" + "@angular-devkit/core": "16.1.4", + "jsonc-parser": "3.2.0", + "magic-string": "0.30.0", + "ora": "5.4.1", + "rxjs": "7.8.1" }, "engines": { - "node": ">=8" + "node": "^16.14.0 || >=18.10.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" } }, - "node_modules/@angular-devkit/build-angular/node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/@angular-devkit/build-angular/node_modules/schema-utils": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz", - "integrity": "sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==", - "dev": true, + "node_modules/@angular/animations": { + "version": "16.1.4", + "resolved": "https://registry.npmjs.org/@angular/animations/-/animations-16.1.4.tgz", + "integrity": "sha512-QdqmnMEYsrZK1BB+/TGteyoQVRwIpRdBP4Jg+hX/BDhVpt35dptSwvNZj7+9zoYLwNo5DuGlttljEaLOs1UcUw==", "dependencies": { - "@types/json-schema": "^7.0.9", - "ajv": "^8.9.0", - "ajv-formats": "^2.1.1", - "ajv-keywords": "^5.1.0" + "tslib": "^2.3.0" }, "engines": { - "node": ">= 12.13.0" + "node": "^16.14.0 || >=18.10.0" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" + "peerDependencies": { + "@angular/core": "16.1.4" } }, - "node_modules/@angular-devkit/build-angular/node_modules/semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "node_modules/@angular/cli": { + "version": "16.1.4", + "resolved": "https://registry.npmjs.org/@angular/cli/-/cli-16.1.4.tgz", + "integrity": "sha512-coSOLVLpOCOD5q9K9EAFFMrTES+HtdJiLy/iI9kdKNCKWUJpm8/svZ3JZOej3vPxYEp0AokXNOwORQnX21/qZQ==", "dev": true, "dependencies": { - "lru-cache": "^6.0.0" + "@angular-devkit/architect": "0.1601.4", + "@angular-devkit/core": "16.1.4", + "@angular-devkit/schematics": "16.1.4", + "@schematics/angular": "16.1.4", + "@yarnpkg/lockfile": "1.1.0", + "ansi-colors": "4.1.3", + "ini": "4.1.1", + "inquirer": "8.2.4", + "jsonc-parser": "3.2.0", + "npm-package-arg": "10.1.0", + "npm-pick-manifest": "8.0.1", + "open": "8.4.2", + "ora": "5.4.1", + "pacote": "15.2.0", + "resolve": "1.22.2", + "semver": "7.5.3", + "symbol-observable": "4.0.0", + "yargs": "17.7.2" }, "bin": { - "semver": "bin/semver.js" + "ng": "bin/ng.js" }, "engines": { - "node": ">=10" + "node": "^16.14.0 || >=18.10.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" } }, - "node_modules/@angular-devkit/build-angular/node_modules/serialize-javascript": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz", - "integrity": "sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==", - "dev": true, + "node_modules/@angular/common": { + "version": "16.1.4", + "resolved": "https://registry.npmjs.org/@angular/common/-/common-16.1.4.tgz", + "integrity": "sha512-SDA8GZVY0nXCJaNUy13L22jAKuk1LZgQ6QzqOpqQc50C25bfBQbYv68PKjHCjQ62VxGKnDSTT85xCMNx+y/U4g==", "dependencies": { - "randombytes": "^2.1.0" + "tslib": "^2.3.0" + }, + "engines": { + "node": "^16.14.0 || >=18.10.0" + }, + "peerDependencies": { + "@angular/core": "16.1.4", + "rxjs": "^6.5.3 || ^7.4.0" } }, - "node_modules/@angular-devkit/build-angular/node_modules/slash": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", - "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", - "dev": true, + "node_modules/@angular/compiler": { + "version": "16.1.4", + "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-16.1.4.tgz", + "integrity": "sha512-5iKx8g+6/LtiRhbqMS2Jw1AshFUb4M8LO9WQKfRoE+5mZrDOYkAQYgOlAO7fk0mOCXeZcHJBbq2nuwDfwsZIiw==", + "dependencies": { + "tslib": "^2.3.0" + }, "engines": { - "node": ">=12" + "node": "^16.14.0 || >=18.10.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "peerDependencies": { + "@angular/core": "16.1.4" + }, + "peerDependenciesMeta": { + "@angular/core": { + "optional": true + } } }, - "node_modules/@angular-devkit/build-angular/node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, + "node_modules/@angular/compiler-cli": { + "version": "16.1.4", + "resolved": "https://registry.npmjs.org/@angular/compiler-cli/-/compiler-cli-16.1.4.tgz", + "integrity": "sha512-JerJOZeOLaHFHrfWMm4m9tEw+MdNNIMPj3TSauJ6uZPbFokGeqS2GsUBMjuQlwh5xY4duh1HtRsohvshpl306A==", "dependencies": { - "safe-buffer": "~5.2.0" + "@babel/core": "7.22.5", + "@jridgewell/sourcemap-codec": "^1.4.14", + "chokidar": "^3.0.0", + "convert-source-map": "^1.5.1", + "reflect-metadata": "^0.1.2", + "semver": "^7.0.0", + "tslib": "^2.3.0", + "yargs": "^17.2.1" + }, + "bin": { + "ng-xi18n": "bundles/src/bin/ng_xi18n.js", + "ngc": "bundles/src/bin/ngc.js", + "ngcc": "bundles/ngcc/index.js" + }, + "engines": { + "node": "^16.14.0 || >=18.10.0" + }, + "peerDependencies": { + "@angular/compiler": "16.1.4", + "typescript": ">=4.9.3 <5.2" } }, - "node_modules/@angular-devkit/build-angular/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, + "node_modules/@angular/compiler-cli/node_modules/@babel/core": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.22.5.tgz", + "integrity": "sha512-SBuTAjg91A3eKOvD+bPEz3LlhHZRNu1nFOVts9lzDJTXshHTjII0BAtDS3Y2DAkdZdDKWVZGVwkDfc4Clxn1dg==", "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.22.5", + "@babel/generator": "^7.22.5", + "@babel/helper-compilation-targets": "^7.22.5", + "@babel/helper-module-transforms": "^7.22.5", + "@babel/helpers": "^7.22.5", + "@babel/parser": "^7.22.5", + "@babel/template": "^7.22.5", + "@babel/traverse": "^7.22.5", + "@babel/types": "^7.22.5", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.2", + "semver": "^6.3.0" }, "engines": { - "node": ">=8" + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" } }, - "node_modules/@angular-devkit/build-angular/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, + "node_modules/@angular/compiler-cli/node_modules/@babel/core/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@angular/core": { + "version": "16.1.4", + "resolved": "https://registry.npmjs.org/@angular/core/-/core-16.1.4.tgz", + "integrity": "sha512-eWs++peAp+Lm2SHGfMsHAye2IOmlDKkVJ4dFf4TaZXW+AEev3FXKXLFp+dBUq8YkCKly7iAV26NXEUBOFFtplQ==", "dependencies": { - "ansi-regex": "^5.0.1" + "tslib": "^2.3.0" }, "engines": { - "node": ">=8" + "node": "^16.14.0 || >=18.10.0" + }, + "peerDependencies": { + "rxjs": "^6.5.3 || ^7.4.0", + "zone.js": "~0.13.0" } }, - "node_modules/@angular-devkit/build-angular/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, + "node_modules/@angular/forms": { + "version": "16.1.4", + "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-16.1.4.tgz", + "integrity": "sha512-JLhO7gM0WyTfr6tEWZMiCGikWLgaC/a2+tuxWsSlXUjlrbE4DyLzSAA6JqyDCFTvm9B/QzRPDfgExLTTZJY4eQ==", "dependencies": { - "has-flag": "^4.0.0" + "tslib": "^2.3.0" }, "engines": { - "node": ">=8" + "node": "^16.14.0 || >=18.10.0" + }, + "peerDependencies": { + "@angular/common": "16.1.4", + "@angular/core": "16.1.4", + "@angular/platform-browser": "16.1.4", + "rxjs": "^6.5.3 || ^7.4.0" } }, - "node_modules/@angular-devkit/build-angular/node_modules/terser": { - "version": "5.17.7", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.17.7.tgz", - "integrity": "sha512-/bi0Zm2C6VAexlGgLlVxA0P2lru/sdLyfCVaRMfKVo9nWxbmz7f/sD8VPybPeSUJaJcwmCJis9pBIhcVcG1QcQ==", - "dev": true, + "node_modules/@angular/localize": { + "version": "16.1.4", + "resolved": "https://registry.npmjs.org/@angular/localize/-/localize-16.1.4.tgz", + "integrity": "sha512-owOzDzU8of6kFE8i82AM/ewjfciKsmzHAxaEGgUP1FdW9D9hEOoGQVoezGk6VKafhLWZ4Gu0i78jZ1/xhntMmw==", + "peer": true, "dependencies": { - "@jridgewell/source-map": "^0.3.3", - "acorn": "^8.8.2", - "commander": "^2.20.0", - "source-map-support": "~0.5.20" + "@babel/core": "7.22.5", + "fast-glob": "3.2.12", + "yargs": "^17.2.1" }, "bin": { - "terser": "bin/terser" + "localize-extract": "tools/bundles/src/extract/cli.js", + "localize-migrate": "tools/bundles/src/migrate/cli.js", + "localize-translate": "tools/bundles/src/translate/cli.js" }, "engines": { - "node": ">=10" + "node": "^16.14.0 || >=18.10.0" + }, + "peerDependencies": { + "@angular/compiler": "16.1.4", + "@angular/compiler-cli": "16.1.4" } }, - "node_modules/@angular-devkit/build-angular/node_modules/tslib": { - "version": "2.5.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.3.tgz", - "integrity": "sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==", - "dev": true - }, - "node_modules/@angular-devkit/build-angular/node_modules/type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", - "dev": true, + "node_modules/@angular/localize/node_modules/@babel/core": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.22.5.tgz", + "integrity": "sha512-SBuTAjg91A3eKOvD+bPEz3LlhHZRNu1nFOVts9lzDJTXshHTjII0BAtDS3Y2DAkdZdDKWVZGVwkDfc4Clxn1dg==", + "peer": true, + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.22.5", + "@babel/generator": "^7.22.5", + "@babel/helper-compilation-targets": "^7.22.5", + "@babel/helper-module-transforms": "^7.22.5", + "@babel/helpers": "^7.22.5", + "@babel/parser": "^7.22.5", + "@babel/template": "^7.22.5", + "@babel/traverse": "^7.22.5", + "@babel/types": "^7.22.5", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.2", + "semver": "^6.3.0" + }, "engines": { - "node": ">=10" + "node": ">=6.9.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "type": "opencollective", + "url": "https://opencollective.com/babel" } }, - "node_modules/@angular-devkit/build-angular/node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, + "node_modules/@angular/localize/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "peer": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@angular/platform-browser": { + "version": "16.1.4", + "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-16.1.4.tgz", + "integrity": "sha512-eQ1dBh/6ZwJVeiNGrcW6ePFmWeS+Oheu1RpuZSsvM/fI6qfsZE+or9IJ61SFvsMs65SbrO90Akc+ZXmpEidPdA==", "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" + "tslib": "^2.3.0" }, "engines": { - "node": ">=10" + "node": "^16.14.0 || >=18.10.0" }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + "peerDependencies": { + "@angular/animations": "16.1.4", + "@angular/common": "16.1.4", + "@angular/core": "16.1.4" + }, + "peerDependenciesMeta": { + "@angular/animations": { + "optional": true + } } }, - "node_modules/@angular-devkit/build-angular/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, - "node_modules/@angular-devkit/build-webpack": { - "version": "0.1601.3", - "resolved": "https://registry.npmjs.org/@angular-devkit/build-webpack/-/build-webpack-0.1601.3.tgz", - "integrity": "sha512-744+72vi/Vx010VxizGgilhpnDCOG29qyhMmu7BkUhtpq8E8eQn2HU3nPpxAqrg3bKVAwD7v3F111MVIhub8kA==", - "dev": true, + "node_modules/@angular/platform-browser-dynamic": { + "version": "16.1.4", + "resolved": "https://registry.npmjs.org/@angular/platform-browser-dynamic/-/platform-browser-dynamic-16.1.4.tgz", + "integrity": "sha512-OIszPs3NLCZWL8BEvn458JotNMdXPGyEVToNa2cEVgtakVxkhrhmoFlwJTWJN4GRkHNL5h2Vb0JLEYICwr7sgg==", "dependencies": { - "@angular-devkit/architect": "0.1601.3", - "rxjs": "7.8.1" + "tslib": "^2.3.0" }, "engines": { - "node": "^16.14.0 || >=18.10.0", - "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", - "yarn": ">= 1.13.0" + "node": "^16.14.0 || >=18.10.0" }, "peerDependencies": { - "webpack": "^5.30.0", - "webpack-dev-server": "^4.0.0" + "@angular/common": "16.1.4", + "@angular/compiler": "16.1.4", + "@angular/core": "16.1.4", + "@angular/platform-browser": "16.1.4" } }, - "node_modules/@angular-devkit/core": { - "version": "16.1.3", - "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-16.1.3.tgz", - "integrity": "sha512-cFhNdJHumNMZGD3NYxOtNuMGRQXeDnKbwvK+IJmKAttXt8na6EvURR/ZxZOI7rl/YRVX+vcNSdtXz3hE6g+Isw==", - "dev": true, + "node_modules/@angular/router": { + "version": "16.1.4", + "resolved": "https://registry.npmjs.org/@angular/router/-/router-16.1.4.tgz", + "integrity": "sha512-ooAK7XsY7fLW80htej9jHmct37biK77aNApCdiY+KlLdd45x//ObGxRYXcSSyvs7mRS0AMTGuA/G7/5AMcqcZg==", "dependencies": { - "ajv": "8.12.0", - "ajv-formats": "2.1.1", - "jsonc-parser": "3.2.0", - "rxjs": "7.8.1", - "source-map": "0.7.4" + "tslib": "^2.3.0" }, "engines": { - "node": "^16.14.0 || >=18.10.0", - "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", - "yarn": ">= 1.13.0" + "node": "^16.14.0 || >=18.10.0" }, "peerDependencies": { - "chokidar": "^3.5.2" - }, - "peerDependenciesMeta": { - "chokidar": { - "optional": true - } + "@angular/common": "16.1.4", + "@angular/core": "16.1.4", + "@angular/platform-browser": "16.1.4", + "rxjs": "^6.5.3 || ^7.4.0" } }, - "node_modules/@angular-devkit/core/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dev": true, + "node_modules/@angular/upgrade": { + "version": "16.1.4", + "resolved": "https://registry.npmjs.org/@angular/upgrade/-/upgrade-16.1.4.tgz", + "integrity": "sha512-VQ/LJ3dzove2VisfibO+4lXDjp4B3seBgZ6rAXc/J4g5Ym7umuZR9nOwaQnTufBjXAlnVfiJCb9r1ba+wN3ZOg==", "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" + "tslib": "^2.3.0" }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" + "engines": { + "node": "^16.14.0 || >=18.10.0" + }, + "peerDependencies": { + "@angular/compiler": "16.1.4", + "@angular/core": "16.1.4", + "@angular/platform-browser": "16.1.4", + "@angular/platform-browser-dynamic": "16.1.4" } }, - "node_modules/@angular-devkit/core/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "node_modules/@assemblyscript/loader": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@assemblyscript/loader/-/loader-0.10.1.tgz", + "integrity": "sha512-H71nDOOL8Y7kWRLqf6Sums+01Q5msqBW2KhDUTemh1tvY04eSkSXrK0uj/4mmY0Xr16/3zyZmsrxN7CKuRbNRg==", "dev": true }, - "node_modules/@angular-devkit/core/node_modules/source-map": { - "version": "0.7.4", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", - "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", + "node_modules/@babel/cli": { + "version": "7.22.9", + "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.22.9.tgz", + "integrity": "sha512-nb2O7AThqRo7/E53EGiuAkMaRbb7J5Qp3RvN+dmua1U+kydm0oznkhqbTEG15yk26G/C3yL6OdZjzgl+DMXVVA==", "dev": true, - "engines": { - "node": ">= 8" + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.17", + "commander": "^4.0.1", + "convert-source-map": "^1.1.0", + "fs-readdir-recursive": "^1.1.0", + "glob": "^7.2.0", + "make-dir": "^2.1.0", + "slash": "^2.0.0" + }, + "bin": { + "babel": "bin/babel.js", + "babel-external-helpers": "bin/babel-external-helpers.js" + }, + "engines": { + "node": ">=6.9.0" + }, + "optionalDependencies": { + "@nicolo-ribaudo/chokidar-2": "2.1.8-no-fsevents.3", + "chokidar": "^3.4.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@angular-devkit/schematics": { - "version": "16.1.3", - "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-16.1.3.tgz", - "integrity": "sha512-hWEuQnfQOgcSs4YX6iF4QR/34ROeSPaMi7lQOYg33hStg+pnk/JDdIU0f2nrIIz3t0jqAj+5VXVLBJvOCd84vg==", - "dev": true, + "node_modules/@babel/code-frame": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", + "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==", "dependencies": { - "@angular-devkit/core": "16.1.3", - "jsonc-parser": "3.2.0", - "magic-string": "0.30.0", - "ora": "5.4.1", - "rxjs": "7.8.1" + "@babel/highlight": "^7.22.5" }, "engines": { - "node": "^16.14.0 || >=18.10.0", - "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", - "yarn": ">= 1.13.0" + "node": ">=6.9.0" } }, - "node_modules/@angular-devkit/schematics/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, + "node_modules/@babel/compat-data": { + "version": "7.22.9", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.9.tgz", + "integrity": "sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ==", "engines": { - "node": ">=8" + "node": ">=6.9.0" } }, - "node_modules/@angular-devkit/schematics/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, + "node_modules/@babel/core": { + "version": "7.22.9", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.22.9.tgz", + "integrity": "sha512-G2EgeufBcYw27U4hhoIwFcgc1XU7TlXJ3mv04oOv1WCuo900U/anZSPzEqNjwdjgffkk2Gs0AN0dW1CKVLcG7w==", "dependencies": { - "color-convert": "^2.0.1" + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.22.5", + "@babel/generator": "^7.22.9", + "@babel/helper-compilation-targets": "^7.22.9", + "@babel/helper-module-transforms": "^7.22.9", + "@babel/helpers": "^7.22.6", + "@babel/parser": "^7.22.7", + "@babel/template": "^7.22.5", + "@babel/traverse": "^7.22.8", + "@babel/types": "^7.22.5", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.2", + "semver": "^6.3.1" }, "engines": { - "node": ">=8" + "node": ">=6.9.0" }, "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "type": "opencollective", + "url": "https://opencollective.com/babel" } }, - "node_modules/@angular-devkit/schematics/node_modules/bl": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", - "dev": true, + "node_modules/@babel/core/node_modules/@babel/generator": { + "version": "7.22.9", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.9.tgz", + "integrity": "sha512-KtLMbmicyuK2Ak/FTCJVbDnkN1SlT8/kceFTiuDiiRUUSMnHMidxSCdG4ndkTOHHpoomWe/4xkvHkEOncwjYIw==", "dependencies": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" + "@babel/types": "^7.22.5", + "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", + "jsesc": "^2.5.1" + }, + "engines": { + "node": ">=6.9.0" } }, - "node_modules/@angular-devkit/schematics/node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "bin": { + "semver": "bin/semver.js" } }, - "node_modules/@angular-devkit/schematics/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, + "node_modules/@babel/generator": { + "version": "7.22.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.7.tgz", + "integrity": "sha512-p+jPjMG+SI8yvIaxGgeW24u7q9+5+TGpZh8/CuB7RhBKd7RCy8FayNEFNNKrNK/eUcY/4ExQqLmyrvBXKsIcwQ==", "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "@babel/types": "^7.22.5", + "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", + "jsesc": "^2.5.1" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "node": ">=6.9.0" } }, - "node_modules/@angular-devkit/schematics/node_modules/cli-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", - "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "node_modules/@babel/helper-annotate-as-pure": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz", + "integrity": "sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==", "dev": true, "dependencies": { - "restore-cursor": "^3.1.0" + "@babel/types": "^7.22.5" }, "engines": { - "node": ">=8" + "node": ">=6.9.0" } }, - "node_modules/@angular-devkit/schematics/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/@babel/helper-builder-binary-assignment-operator-visitor": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.22.5.tgz", + "integrity": "sha512-m1EP3lVOPptR+2DwD125gziZNcmoNSHGmJROKoy87loWUQyJaVXDgpmruWqDARZSmtYQ+Dl25okU8+qhVzuykw==", "dev": true, "dependencies": { - "color-name": "~1.1.4" + "@babel/types": "^7.22.5" }, "engines": { - "node": ">=7.0.0" + "node": ">=6.9.0" } }, - "node_modules/@angular-devkit/schematics/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/@angular-devkit/schematics/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.22.9", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.9.tgz", + "integrity": "sha512-7qYrNM6HjpnPHJbopxmb8hSPoZ0gsX8IvUS32JGVoy+pU9e5N0nLr1VjJoR6kA4d9dmGLxNYOjeB8sUDal2WMw==", + "dependencies": { + "@babel/compat-data": "^7.22.9", + "@babel/helper-validator-option": "^7.22.5", + "browserslist": "^4.21.9", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, "engines": { - "node": ">=8" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" } }, - "node_modules/@angular-devkit/schematics/node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "node_modules/@angular-devkit/schematics/node_modules/is-interactive": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", - "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", - "dev": true, - "engines": { - "node": ">=8" + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "bin": { + "semver": "bin/semver.js" } }, - "node_modules/@angular-devkit/schematics/node_modules/is-unicode-supported": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", - "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "node_modules/@babel/helper-create-class-features-plugin": { + "version": "7.22.9", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.22.9.tgz", + "integrity": "sha512-Pwyi89uO4YrGKxL/eNJ8lfEH55DnRloGPOseaA8NFNL6jAUnn+KccaISiFazCj5IolPPDjGSdzQzXVzODVRqUQ==", "dev": true, + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-function-name": "^7.22.5", + "@babel/helper-member-expression-to-functions": "^7.22.5", + "@babel/helper-optimise-call-expression": "^7.22.5", + "@babel/helper-replace-supers": "^7.22.9", + "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "semver": "^6.3.1" + }, "engines": { - "node": ">=10" + "node": ">=6.9.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "peerDependencies": { + "@babel/core": "^7.0.0" } }, - "node_modules/@angular-devkit/schematics/node_modules/log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-split-export-declaration": { + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dev": true, "dependencies": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" + "@babel/types": "^7.22.5" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=6.9.0" } }, - "node_modules/@angular-devkit/schematics/node_modules/ora": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", - "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", + "node_modules/@babel/helper-create-class-features-plugin/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-create-regexp-features-plugin": { + "version": "7.22.9", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.22.9.tgz", + "integrity": "sha512-+svjVa/tFwsNSG4NEy1h85+HQ5imbT92Q5/bgtS7P0GTQlP8WuFdqsiABmQouhiFGyV66oGxZFpeYHza1rNsKw==", "dev": true, "dependencies": { - "bl": "^4.1.0", - "chalk": "^4.1.0", - "cli-cursor": "^3.1.0", - "cli-spinners": "^2.5.0", - "is-interactive": "^1.0.0", - "is-unicode-supported": "^0.1.0", - "log-symbols": "^4.1.0", - "strip-ansi": "^6.0.0", - "wcwidth": "^1.0.1" + "@babel/helper-annotate-as-pure": "^7.22.5", + "regexpu-core": "^5.3.1", + "semver": "^6.3.1" }, "engines": { - "node": ">=10" + "node": ">=6.9.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "peerDependencies": { + "@babel/core": "^7.0.0" } }, - "node_modules/@angular-devkit/schematics/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "node_modules/@babel/helper-create-regexp-features-plugin/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" + "bin": { + "semver": "bin/semver.js" } }, - "node_modules/@angular-devkit/schematics/node_modules/restore-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", - "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "node_modules/@babel/helper-define-polyfill-provider": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.4.1.tgz", + "integrity": "sha512-kX4oXixDxG197yhX+J3Wp+NpL2wuCFjWQAr6yX2jtCnflK9ulMI51ULFGIrWiX1jGfvAxdHp+XQCcP2bZGPs9A==", "dev": true, "dependencies": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" + "@babel/helper-compilation-targets": "^7.22.6", + "@babel/helper-plugin-utils": "^7.22.5", + "debug": "^4.1.1", + "lodash.debounce": "^4.0.8", + "resolve": "^1.14.2" }, - "engines": { - "node": ">=8" + "peerDependencies": { + "@babel/core": "^7.4.0-0" } }, - "node_modules/@angular-devkit/schematics/node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] + "node_modules/@babel/helper-environment-visitor": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz", + "integrity": "sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==", + "engines": { + "node": ">=6.9.0" + } }, - "node_modules/@angular-devkit/schematics/node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, + "node_modules/@babel/helper-function-name": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz", + "integrity": "sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==", "dependencies": { - "safe-buffer": "~5.2.0" + "@babel/template": "^7.22.5", + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" } }, - "node_modules/@angular-devkit/schematics/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, + "node_modules/@babel/helper-hoist-variables": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dependencies": { - "ansi-regex": "^5.0.1" + "@babel/types": "^7.22.5" }, "engines": { - "node": ">=8" + "node": ">=6.9.0" } }, - "node_modules/@angular-devkit/schematics/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/@babel/helper-member-expression-to-functions": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.22.5.tgz", + "integrity": "sha512-aBiH1NKMG0H2cGZqspNvsaBe6wNGjbJjuLy29aU+eDZjSbbN53BaxlpB02xm9v34pLTZ1nIQPFYn2qMZoa5BQQ==", "dev": true, "dependencies": { - "has-flag": "^4.0.0" + "@babel/types": "^7.22.5" }, "engines": { - "node": ">=8" + "node": ">=6.9.0" } }, - "node_modules/@angular/animations": { - "version": "16.1.3", - "resolved": "https://registry.npmjs.org/@angular/animations/-/animations-16.1.3.tgz", - "integrity": "sha512-ET6ahrlbOyTYXOTouKs2VJxx0CMTrYkfz0HfI6IHnSKBC6wguDxXYnamMouHgrCkDDEB5qClfGHyS9se0AOX4w==", + "node_modules/@babel/helper-module-imports": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz", + "integrity": "sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg==", "dependencies": { - "tslib": "^2.3.0" + "@babel/types": "^7.22.5" }, "engines": { - "node": "^16.14.0 || >=18.10.0" + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.22.9", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.22.9.tgz", + "integrity": "sha512-t+WA2Xn5K+rTeGtC8jCsdAH52bjggG5TKRuRrAGNM/mjIbO4GxvlLMFOEz9wXY5I2XQ60PMFsAG2WIcG82dQMQ==", + "dependencies": { + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-module-imports": "^7.22.5", + "@babel/helper-simple-access": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/helper-validator-identifier": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" }, "peerDependencies": { - "@angular/core": "16.1.3" + "@babel/core": "^7.0.0" } }, - "node_modules/@angular/cli": { - "version": "16.1.3", - "resolved": "https://registry.npmjs.org/@angular/cli/-/cli-16.1.3.tgz", - "integrity": "sha512-D0gU12z/N2oJ+s6pggAnWYrTUZ+2duGb3Y5oUyClsubz7JWpAwHjSZpb8exPUrgYhr+qIEMGO685y1JazJQ2tA==", - "dev": true, + "node_modules/@babel/helper-module-transforms/node_modules/@babel/helper-split-export-declaration": { + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dependencies": { - "@angular-devkit/architect": "0.1601.3", - "@angular-devkit/core": "16.1.3", - "@angular-devkit/schematics": "16.1.3", - "@schematics/angular": "16.1.3", - "@yarnpkg/lockfile": "1.1.0", - "ansi-colors": "4.1.3", - "ini": "4.1.1", - "inquirer": "8.2.4", - "jsonc-parser": "3.2.0", - "npm-package-arg": "10.1.0", - "npm-pick-manifest": "8.0.1", - "open": "8.4.2", - "ora": "5.4.1", - "pacote": "15.2.0", - "resolve": "1.22.2", - "semver": "7.5.3", - "symbol-observable": "4.0.0", - "yargs": "17.7.2" - }, - "bin": { - "ng": "bin/ng.js" + "@babel/types": "^7.22.5" }, "engines": { - "node": "^16.14.0 || >=18.10.0", - "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", - "yarn": ">= 1.13.0" + "node": ">=6.9.0" } }, - "node_modules/@angular/cli/node_modules/ansi-escapes": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "node_modules/@babel/helper-optimise-call-expression": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz", + "integrity": "sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==", "dev": true, "dependencies": { - "type-fest": "^0.21.3" + "@babel/types": "^7.22.5" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=6.9.0" } }, - "node_modules/@angular/cli/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "node_modules/@babel/helper-plugin-utils": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", + "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", "dev": true, "engines": { - "node": ">=8" + "node": ">=6.9.0" } }, - "node_modules/@angular/cli/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/@babel/helper-remap-async-to-generator": { + "version": "7.22.9", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.22.9.tgz", + "integrity": "sha512-8WWC4oR4Px+tr+Fp0X3RHDVfINGpF3ad1HIbrc8A77epiR6eMMc6jsgozkzT2uDiOOdoS9cLIQ+XD2XvI2WSmQ==", "dev": true, "dependencies": { - "color-convert": "^2.0.1" + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-wrap-function": "^7.22.9" }, "engines": { - "node": ">=8" + "node": ">=6.9.0" }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "peerDependencies": { + "@babel/core": "^7.0.0" } }, - "node_modules/@angular/cli/node_modules/bl": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "node_modules/@babel/helper-replace-supers": { + "version": "7.22.9", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.22.9.tgz", + "integrity": "sha512-LJIKvvpgPOPUThdYqcX6IXRuIcTkcAub0IaDRGCZH0p5GPUp7PhRU9QVgFcDDd51BaPkk77ZjqFwh6DZTAEmGg==", "dev": true, "dependencies": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-member-expression-to-functions": "^7.22.5", + "@babel/helper-optimise-call-expression": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" } }, - "node_modules/@angular/cli/node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], + "node_modules/@babel/helper-simple-access": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", + "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" } }, - "node_modules/@angular/cli/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "node_modules/@babel/helper-skip-transparent-expression-wrappers": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz", + "integrity": "sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q==", "dev": true, "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "@babel/types": "^7.22.5" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "node": ">=6.9.0" } }, - "node_modules/@angular/cli/node_modules/cli-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", - "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "node_modules/@babel/helper-split-export-declaration": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.5.tgz", + "integrity": "sha512-thqK5QFghPKWLhAV321lxF95yCg2K3Ob5yw+M3VHWfdia0IkPXUtoLH8x/6Fh486QUvzhb8YOWHChTVen2/PoQ==", "dev": true, "dependencies": { - "restore-cursor": "^3.1.0" + "@babel/types": "^7.22.5" }, "engines": { - "node": ">=8" + "node": ">=6.9.0" } }, - "node_modules/@angular/cli/node_modules/cli-width": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", - "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", - "dev": true, + "node_modules/@babel/helper-string-parser": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", + "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", "engines": { - "node": ">= 10" + "node": ">=6.9.0" } }, - "node_modules/@angular/cli/node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "dev": true, - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", + "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", "engines": { - "node": ">=12" + "node": ">=6.9.0" } }, - "node_modules/@angular/cli/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/@babel/helper-validator-option": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz", + "integrity": "sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-wrap-function": { + "version": "7.22.9", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.22.9.tgz", + "integrity": "sha512-sZ+QzfauuUEfxSEjKFmi3qDSHgLsTPK/pEpoD/qonZKOtTPTLbf59oabPQ4rKekt9lFcj/hTZaOhWwFYrgjk+Q==", "dev": true, "dependencies": { - "color-name": "~1.1.4" + "@babel/helper-function-name": "^7.22.5", + "@babel/template": "^7.22.5", + "@babel/types": "^7.22.5" }, "engines": { - "node": ">=7.0.0" + "node": ">=6.9.0" } }, - "node_modules/@angular/cli/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/@angular/cli/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/@angular/cli/node_modules/figures": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", - "dev": true, + "node_modules/@babel/helpers": { + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.22.6.tgz", + "integrity": "sha512-YjDs6y/fVOYFV8hAf1rxd1QvR9wJe1pDBZ2AREKq/SDayfPzgk0PBnVuTCE5X1acEpMMNOVUqoe+OwiZGJ+OaA==", "dependencies": { - "escape-string-regexp": "^1.0.5" + "@babel/template": "^7.22.5", + "@babel/traverse": "^7.22.6", + "@babel/types": "^7.22.5" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=6.9.0" } }, - "node_modules/@angular/cli/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, + "node_modules/@babel/highlight": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", + "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", + "dependencies": { + "@babel/helper-validator-identifier": "^7.22.5", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, "engines": { - "node": ">=8" + "node": ">=6.9.0" } }, - "node_modules/@angular/cli/node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "node_modules/@angular/cli/node_modules/ini": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.1.tgz", - "integrity": "sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==", - "dev": true, + "node_modules/@babel/parser": { + "version": "7.22.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.7.tgz", + "integrity": "sha512-7NF8pOkHP5o2vpmGgNGcfAeCvOYhGLyA3Z4eBQkT1RJlWu47n63bCs93QfJ2hIAFCil7L5P2IWhs1oToVgrL0Q==", + "bin": { + "parser": "bin/babel-parser.js" + }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": ">=6.0.0" } }, - "node_modules/@angular/cli/node_modules/inquirer": { - "version": "8.2.4", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.4.tgz", - "integrity": "sha512-nn4F01dxU8VeKfq192IjLsxu0/OmMZ4Lg3xKAns148rCaXP6ntAoEkVYZThWjwON8AlzdZZi6oqnhNbxUG9hVg==", + "node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.22.5.tgz", + "integrity": "sha512-NP1M5Rf+u2Gw9qfSO4ihjcTGW5zXTi36ITLd4/EoAcEhIZ0yjMqmftDNl3QC19CX7olhrjpyU454g/2W7X0jvQ==", "dev": true, "dependencies": { - "ansi-escapes": "^4.2.1", - "chalk": "^4.1.1", - "cli-cursor": "^3.1.0", - "cli-width": "^3.0.0", - "external-editor": "^3.0.3", - "figures": "^3.0.0", - "lodash": "^4.17.21", - "mute-stream": "0.0.8", - "ora": "^5.4.1", - "run-async": "^2.4.0", - "rxjs": "^7.5.5", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0", - "through": "^2.3.6", - "wrap-ansi": "^7.0.0" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { - "node": ">=12.0.0" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" } }, - "node_modules/@angular/cli/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.22.5.tgz", + "integrity": "sha512-31Bb65aZaUwqCbWMnZPduIZxCBngHFlzyN6Dq6KAJjtx+lx6ohKHubc61OomYi7XwVD4Ol0XCVz4h+pYFR048g==", "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", + "@babel/plugin-transform-optional-chaining": "^7.22.5" + }, "engines": { - "node": ">=8" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.13.0" } }, - "node_modules/@angular/cli/node_modules/is-interactive": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", - "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", + "node_modules/@babel/plugin-proposal-async-generator-functions": { + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.20.7.tgz", + "integrity": "sha512-xMbiLsn/8RK7Wq7VeVytytS2L6qE69bXPB10YCmMdDZbKF4okCqY74pI/jJQ/8U0b/F6NrT2+14b8/P9/3AMGA==", "dev": true, + "dependencies": { + "@babel/helper-environment-visitor": "^7.18.9", + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/helper-remap-async-to-generator": "^7.18.9", + "@babel/plugin-syntax-async-generators": "^7.8.4" + }, "engines": { - "node": ">=8" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@angular/cli/node_modules/is-unicode-supported": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", - "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "node_modules/@babel/plugin-proposal-private-property-in-object": { + "version": "7.21.0-placeholder-for-preset-env.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz", + "integrity": "sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==", "dev": true, "engines": { - "node": ">=10" + "node": ">=6.9.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@angular/cli/node_modules/log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "node_modules/@babel/plugin-proposal-unicode-property-regex": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.18.6.tgz", + "integrity": "sha512-2BShG/d5yoZyXZfVePH91urL5wTG6ASZU9M4o03lKK8u8UW1y08OMttBSOADTcJrnPMpvDXRG3G8fyLh4ovs8w==", "dev": true, "dependencies": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" + "@babel/helper-create-regexp-features-plugin": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" }, "engines": { - "node": ">=10" + "node": ">=4" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@angular/cli/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "node_modules/@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", "dev": true, "dependencies": { - "yallist": "^4.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, - "engines": { - "node": ">=10" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@angular/cli/node_modules/open": { - "version": "8.4.2", - "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", - "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", + "node_modules/@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", "dev": true, "dependencies": { - "define-lazy-prop": "^2.0.0", - "is-docker": "^2.1.1", - "is-wsl": "^2.2.0" - }, - "engines": { - "node": ">=12" + "@babel/helper-plugin-utils": "^7.12.13" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@angular/cli/node_modules/ora": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", - "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", + "node_modules/@babel/plugin-syntax-class-static-block": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", + "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", "dev": true, "dependencies": { - "bl": "^4.1.0", - "chalk": "^4.1.0", - "cli-cursor": "^3.1.0", - "cli-spinners": "^2.5.0", - "is-interactive": "^1.0.0", - "is-unicode-supported": "^0.1.0", - "log-symbols": "^4.1.0", - "strip-ansi": "^6.0.0", - "wcwidth": "^1.0.1" + "@babel/helper-plugin-utils": "^7.14.5" }, "engines": { - "node": ">=10" + "node": ">=6.9.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@angular/cli/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "node_modules/@babel/plugin-syntax-dynamic-import": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", + "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", "dev": true, "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" + "@babel/helper-plugin-utils": "^7.8.0" }, - "engines": { - "node": ">= 6" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@angular/cli/node_modules/resolve": { - "version": "1.22.2", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", - "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", + "node_modules/@babel/plugin-syntax-export-namespace-from": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz", + "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==", "dev": true, "dependencies": { - "is-core-module": "^2.11.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" + "@babel/helper-plugin-utils": "^7.8.3" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@angular/cli/node_modules/restore-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", - "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "node_modules/@babel/plugin-syntax-import-assertions": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.22.5.tgz", + "integrity": "sha512-rdV97N7KqsRzeNGoWUOK6yUsWarLjE5Su/Snk9IYPU9CwkWHs4t+rTGOvffTR8XGkJMTAdLfO0xVnXm8wugIJg==", "dev": true, "dependencies": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { - "node": ">=8" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@angular/cli/node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/@angular/cli/node_modules/semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "node_modules/@babel/plugin-syntax-import-attributes": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.22.5.tgz", + "integrity": "sha512-KwvoWDeNKPETmozyFE0P2rOLqh39EoQHNjqizrI5B8Vt0ZNS7M56s7dAiAqbYfiAYOuIzIh96z3iR2ktgu3tEg==", "dev": true, "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { - "node": ">=10" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@angular/cli/node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "node_modules/@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", "dev": true, "dependencies": { - "safe-buffer": "~5.2.0" + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@angular/cli/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "node_modules/@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", "dev": true, "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "@babel/helper-plugin-utils": "^7.8.0" }, - "engines": { - "node": ">=8" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@angular/cli/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "node_modules/@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", "dev": true, "dependencies": { - "ansi-regex": "^5.0.1" + "@babel/helper-plugin-utils": "^7.10.4" }, - "engines": { - "node": ">=8" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@angular/cli/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", "dev": true, "dependencies": { - "has-flag": "^4.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, - "engines": { - "node": ">=8" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@angular/cli/node_modules/type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "node_modules/@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", "dev": true, - "engines": { - "node": ">=10" + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@angular/cli/node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "node_modules/@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", "dev": true, "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" + "@babel/helper-plugin-utils": "^7.8.0" }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@angular/cli/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, - "node_modules/@angular/cli/node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "node_modules/@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", "dev": true, "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" + "@babel/helper-plugin-utils": "^7.8.0" }, - "engines": { - "node": ">=12" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@angular/cli/node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", "dev": true, - "engines": { - "node": ">=12" + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@angular/common": { - "version": "16.1.3", - "resolved": "https://registry.npmjs.org/@angular/common/-/common-16.1.3.tgz", - "integrity": "sha512-ZzJ6EwQHUkiZYV0zH/UxyUYW5uxomsyk7tdtqZIxAR5m2ktYkQ5XlqgPjBO8voF54Rs5Ot43RkPCLesbZyJDsw==", + "node_modules/@babel/plugin-syntax-private-property-in-object": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", + "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", + "dev": true, "dependencies": { - "tslib": "^2.3.0" + "@babel/helper-plugin-utils": "^7.14.5" }, "engines": { - "node": "^16.14.0 || >=18.10.0" + "node": ">=6.9.0" }, "peerDependencies": { - "@angular/core": "16.1.3", - "rxjs": "^6.5.3 || ^7.4.0" + "@babel/core": "^7.0.0-0" } }, - "node_modules/@angular/compiler": { - "version": "16.1.3", - "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-16.1.3.tgz", - "integrity": "sha512-7Ckvssk9+s5xLyXvp72IwAw5vd/Osa3tR6oiQatdbw+O3XjLO04QycoGXwkp/fYVexGsjFyOn6QJ5n1F/PYPbQ==", + "node_modules/@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "dev": true, "dependencies": { - "tslib": "^2.3.0" + "@babel/helper-plugin-utils": "^7.14.5" }, "engines": { - "node": "^16.14.0 || >=18.10.0" + "node": ">=6.9.0" }, "peerDependencies": { - "@angular/core": "16.1.3" - }, - "peerDependenciesMeta": { - "@angular/core": { - "optional": true - } + "@babel/core": "^7.0.0-0" } }, - "node_modules/@angular/compiler-cli": { - "version": "16.1.3", - "resolved": "https://registry.npmjs.org/@angular/compiler-cli/-/compiler-cli-16.1.3.tgz", - "integrity": "sha512-aUqnIV9rRTBNgiQRS0Gv6lhghaGj1vpVRyXgiE4VnTR9uBONSsGKMNALYBBhXRTSk2e0cvutt0ubLgmNpdyWyQ==", + "node_modules/@babel/plugin-syntax-unicode-sets-regex": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz", + "integrity": "sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg==", "dev": true, "dependencies": { - "@babel/core": "7.22.5", - "@jridgewell/sourcemap-codec": "^1.4.14", - "chokidar": "^3.0.0", - "convert-source-map": "^1.5.1", - "reflect-metadata": "^0.1.2", - "semver": "^7.0.0", - "tslib": "^2.3.0", - "yargs": "^17.2.1" - }, - "bin": { - "ng-xi18n": "bundles/src/bin/ng_xi18n.js", - "ngc": "bundles/src/bin/ngc.js", - "ngcc": "bundles/ngcc/index.js" + "@babel/helper-create-regexp-features-plugin": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" }, "engines": { - "node": "^16.14.0 || >=18.10.0" + "node": ">=6.9.0" }, "peerDependencies": { - "@angular/compiler": "16.1.3", - "typescript": ">=4.9.3 <5.2" + "@babel/core": "^7.0.0" } }, - "node_modules/@angular/compiler-cli/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "node_modules/@babel/plugin-transform-arrow-functions": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.22.5.tgz", + "integrity": "sha512-26lTNXoVRdAnsaDXPpvCNUq+OVWEVC6bx7Vvz9rC53F2bagUWW4u4ii2+h8Fejfh7RYqPxn+libeFBBck9muEw==", "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, "engines": { - "node": ">=8" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@angular/compiler-cli/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/@babel/plugin-transform-async-generator-functions": { + "version": "7.22.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.22.7.tgz", + "integrity": "sha512-7HmE7pk/Fmke45TODvxvkxRMV9RazV+ZZzhOL9AG8G29TLrr3jkjwF7uJfxZ30EoXpO+LJkq4oA8NjO2DTnEDg==", "dev": true, "dependencies": { - "color-convert": "^2.0.1" + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-remap-async-to-generator": "^7.22.5", + "@babel/plugin-syntax-async-generators": "^7.8.4" }, "engines": { - "node": ">=8" + "node": ">=6.9.0" }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@angular/compiler-cli/node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "node_modules/@babel/plugin-transform-async-to-generator": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.22.5.tgz", + "integrity": "sha512-b1A8D8ZzE/VhNDoV1MSJTnpKkCG5bJo+19R4o4oy03zM7ws8yEMK755j61Dc3EyvdysbqH5BOOTquJ7ZX9C6vQ==", "dev": true, "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" + "@babel/helper-module-imports": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-remap-async-to-generator": "^7.22.5" }, "engines": { - "node": ">=12" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@angular/compiler-cli/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/@babel/plugin-transform-block-scoped-functions": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.22.5.tgz", + "integrity": "sha512-tdXZ2UdknEKQWKJP1KMNmuF5Lx3MymtMN/pvA+p/VEkhK8jVcQ1fzSy8KM9qRYhAf2/lV33hoMPKI/xaI9sADA==", "dev": true, "dependencies": { - "color-name": "~1.1.4" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { - "node": ">=7.0.0" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@angular/compiler-cli/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/@angular/compiler-cli/node_modules/convert-source-map": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", - "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", - "dev": true - }, - "node_modules/@angular/compiler-cli/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/@angular/compiler-cli/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "node_modules/@babel/plugin-transform-block-scoping": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.22.5.tgz", + "integrity": "sha512-EcACl1i5fSQ6bt+YGuU/XGCeZKStLmyVGytWkpyhCLeQVA0eu6Wtiw92V+I1T/hnezUv7j74dA/Ro69gWcU+hg==", "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, "engines": { - "node": ">=8" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@angular/compiler-cli/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "node_modules/@babel/plugin-transform-class-properties": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.22.5.tgz", + "integrity": "sha512-nDkQ0NfkOhPTq8YCLiWNxp1+f9fCobEjCb0n8WdbNUBc4IB5V7P1QnX9IjpSoquKrXF5SKojHleVNs2vGeHCHQ==", "dev": true, "dependencies": { - "yallist": "^4.0.0" + "@babel/helper-create-class-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { - "node": ">=10" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@angular/compiler-cli/node_modules/semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "node_modules/@babel/plugin-transform-class-static-block": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.22.5.tgz", + "integrity": "sha512-SPToJ5eYZLxlnp1UzdARpOGeC2GbHvr9d/UV0EukuVx8atktg194oe+C5BqQ8jRTkgLRVOPYeXRSBg1IlMoVRA==", "dev": true, "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" + "@babel/helper-create-class-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-class-static-block": "^7.14.5" }, "engines": { - "node": ">=10" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.12.0" } }, - "node_modules/@angular/compiler-cli/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "node_modules/@babel/plugin-transform-classes": { + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.22.6.tgz", + "integrity": "sha512-58EgM6nuPNG6Py4Z3zSuu0xWu2VfodiMi72Jt5Kj2FECmaYk1RrTXA45z6KBFsu9tRgwQDwIiY4FXTt+YsSFAQ==", "dev": true, "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-compilation-targets": "^7.22.6", + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-function-name": "^7.22.5", + "@babel/helper-optimise-call-expression": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-replace-supers": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "globals": "^11.1.0" }, "engines": { - "node": ">=8" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@angular/compiler-cli/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "node_modules/@babel/plugin-transform-classes/node_modules/@babel/helper-split-export-declaration": { + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dev": true, "dependencies": { - "ansi-regex": "^5.0.1" + "@babel/types": "^7.22.5" }, "engines": { - "node": ">=8" + "node": ">=6.9.0" } }, - "node_modules/@angular/compiler-cli/node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "node_modules/@babel/plugin-transform-computed-properties": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.22.5.tgz", + "integrity": "sha512-4GHWBgRf0krxPX+AaPtgBAlTgTeZmqDynokHOX7aqqAB4tHs3U2Y02zH6ETFdLZGcg9UQSD1WCmkVrE9ErHeOg==", "dev": true, "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/template": "^7.22.5" }, "engines": { - "node": ">=10" + "node": ">=6.9.0" }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@angular/compiler-cli/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, - "node_modules/@angular/compiler-cli/node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "node_modules/@babel/plugin-transform-destructuring": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.22.5.tgz", + "integrity": "sha512-GfqcFuGW8vnEqTUBM7UtPd5A4q797LTvvwKxXTgRsFjoqaJiEg9deBG6kWeQYkVEL569NpnmpC0Pkr/8BLKGnQ==", "dev": true, "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { - "node": ">=12" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@angular/compiler-cli/node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "node_modules/@babel/plugin-transform-dotall-regex": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.22.5.tgz", + "integrity": "sha512-5/Yk9QxCQCl+sOIB1WelKnVRxTJDSAIxtJLL2/pqL14ZVlbH0fUQUZa/T5/UnQtBNgghR7mfB8ERBKyKPCi7Vw==", "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/@angular/core": { - "version": "16.1.3", - "resolved": "https://registry.npmjs.org/@angular/core/-/core-16.1.3.tgz", - "integrity": "sha512-yhRo9hVS8KhfcEgzciWuRWF4Pnnko98bmSJTqd7u8Kys6z3Uj0qgXMssXHIPUALe3mQKjVkdSZPLIZ9/CaVn/Q==", "dependencies": { - "tslib": "^2.3.0" + "@babel/helper-create-regexp-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { - "node": "^16.14.0 || >=18.10.0" + "node": ">=6.9.0" }, "peerDependencies": { - "rxjs": "^6.5.3 || ^7.4.0", - "zone.js": "~0.13.0" + "@babel/core": "^7.0.0-0" } }, - "node_modules/@angular/forms": { - "version": "16.1.3", - "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-16.1.3.tgz", - "integrity": "sha512-9tJHgoi/Jmeo30zfnReVZWFcd1WthR+QwYUNwPev+ys58u1mB0cDGORvROySmC2YUyXFSpXt8sxwyWCkYvaV2w==", + "node_modules/@babel/plugin-transform-duplicate-keys": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.22.5.tgz", + "integrity": "sha512-dEnYD+9BBgld5VBXHnF/DbYGp3fqGMsyxKbtD1mDyIA7AkTSpKXFhCVuj/oQVOoALfBs77DudA0BE4d5mcpmqw==", + "dev": true, "dependencies": { - "tslib": "^2.3.0" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { - "node": "^16.14.0 || >=18.10.0" + "node": ">=6.9.0" }, "peerDependencies": { - "@angular/common": "16.1.3", - "@angular/core": "16.1.3", - "@angular/platform-browser": "16.1.3", - "rxjs": "^6.5.3 || ^7.4.0" + "@babel/core": "^7.0.0-0" } }, - "node_modules/@angular/platform-browser": { - "version": "16.1.3", - "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-16.1.3.tgz", - "integrity": "sha512-qZA6Lua2fpBe+KD/QArY/4hilypSZFcTcJsPjZwIzo5pavXqYDI8BVghwh5dcZoUa56hVRDJjv+XW6kl8m9Tdw==", + "node_modules/@babel/plugin-transform-dynamic-import": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.22.5.tgz", + "integrity": "sha512-0MC3ppTB1AMxd8fXjSrbPa7LT9hrImt+/fcj+Pg5YMD7UQyWp/02+JWpdnCymmsXwIx5Z+sYn1bwCn4ZJNvhqQ==", + "dev": true, "dependencies": { - "tslib": "^2.3.0" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-dynamic-import": "^7.8.3" }, "engines": { - "node": "^16.14.0 || >=18.10.0" + "node": ">=6.9.0" }, "peerDependencies": { - "@angular/animations": "16.1.3", - "@angular/common": "16.1.3", - "@angular/core": "16.1.3" - }, - "peerDependenciesMeta": { - "@angular/animations": { - "optional": true - } + "@babel/core": "^7.0.0-0" } }, - "node_modules/@angular/platform-browser-dynamic": { - "version": "16.1.3", - "resolved": "https://registry.npmjs.org/@angular/platform-browser-dynamic/-/platform-browser-dynamic-16.1.3.tgz", - "integrity": "sha512-UHxSWpPB5+FSv8zm8T+4ZikLqyy+VE6GlOLp/DdgEz77j81rz2C1pMqozwTnVbD16XbI4rhTp+RFY3C9ArWOtw==", + "node_modules/@babel/plugin-transform-exponentiation-operator": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.22.5.tgz", + "integrity": "sha512-vIpJFNM/FjZ4rh1myqIya9jXwrwwgFRHPjT3DkUA9ZLHuzox8jiXkOLvwm1H+PQIP3CqfC++WPKeuDi0Sjdj1g==", + "dev": true, "dependencies": { - "tslib": "^2.3.0" + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { - "node": "^16.14.0 || >=18.10.0" + "node": ">=6.9.0" }, "peerDependencies": { - "@angular/common": "16.1.3", - "@angular/compiler": "16.1.3", - "@angular/core": "16.1.3", - "@angular/platform-browser": "16.1.3" + "@babel/core": "^7.0.0-0" } }, - "node_modules/@angular/router": { - "version": "16.1.3", - "resolved": "https://registry.npmjs.org/@angular/router/-/router-16.1.3.tgz", - "integrity": "sha512-bkn8cWGBKKZidDaP+R7g/S/6miSfH8iP24d2k86Awo+vaO+7G/5WWGfKJMKK8UNM/A5ueX6ugAZrMHpQ9e6Y4w==", + "node_modules/@babel/plugin-transform-export-namespace-from": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.22.5.tgz", + "integrity": "sha512-X4hhm7FRnPgd4nDA4b/5V280xCx6oL7Oob5+9qVS5C13Zq4bh1qq7LU0GgRU6b5dBWBvhGaXYVB4AcN6+ol6vg==", + "dev": true, "dependencies": { - "tslib": "^2.3.0" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3" }, "engines": { - "node": "^16.14.0 || >=18.10.0" + "node": ">=6.9.0" }, "peerDependencies": { - "@angular/common": "16.1.3", - "@angular/core": "16.1.3", - "@angular/platform-browser": "16.1.3", - "rxjs": "^6.5.3 || ^7.4.0" + "@babel/core": "^7.0.0-0" } }, - "node_modules/@angular/upgrade": { - "version": "16.1.3", - "resolved": "https://registry.npmjs.org/@angular/upgrade/-/upgrade-16.1.3.tgz", - "integrity": "sha512-LVYfixLlyVlHcXc28sDtBfszd1unmMuIlrjGB0CeewqGeutRiMJX3V4Avo6MfNNvRfkqAphXSCz9qZuPqu2aPA==", + "node_modules/@babel/plugin-transform-for-of": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.22.5.tgz", + "integrity": "sha512-3kxQjX1dU9uudwSshyLeEipvrLjBCVthCgeTp6CzE/9JYrlAIaeekVxRpCWsDDfYTfRZRoCeZatCQvwo+wvK8A==", + "dev": true, "dependencies": { - "tslib": "^2.3.0" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { - "node": "^16.14.0 || >=18.10.0" + "node": ">=6.9.0" }, "peerDependencies": { - "@angular/compiler": "16.1.3", - "@angular/core": "16.1.3", - "@angular/platform-browser": "16.1.3", - "@angular/platform-browser-dynamic": "16.1.3" + "@babel/core": "^7.0.0-0" } }, - "node_modules/@assemblyscript/loader": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/@assemblyscript/loader/-/loader-0.10.1.tgz", - "integrity": "sha512-H71nDOOL8Y7kWRLqf6Sums+01Q5msqBW2KhDUTemh1tvY04eSkSXrK0uj/4mmY0Xr16/3zyZmsrxN7CKuRbNRg==", - "dev": true - }, - "node_modules/@babel/cli": { - "version": "7.17.3", - "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.17.3.tgz", - "integrity": "sha512-1+WRlh1IqLocOp122CLx4if345RSHMspwIZNJTlqG/GA46HVZC6p49N1kolfdd2/GOdr+tu4nScbAR3ACJ2ZiA==", + "node_modules/@babel/plugin-transform-function-name": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.22.5.tgz", + "integrity": "sha512-UIzQNMS0p0HHiQm3oelztj+ECwFnj+ZRV4KnguvlsD2of1whUeM6o7wGNj6oLwcDoAXQ8gEqfgC24D+VdIcevg==", "dev": true, "dependencies": { - "@jridgewell/trace-mapping": "^0.3.4", - "commander": "^4.0.1", - "convert-source-map": "^1.1.0", - "fs-readdir-recursive": "^1.1.0", - "glob": "^7.0.0", - "make-dir": "^2.1.0", - "slash": "^2.0.0", - "source-map": "^0.5.0" - }, - "bin": { - "babel": "bin/babel.js", - "babel-external-helpers": "bin/babel-external-helpers.js" + "@babel/helper-compilation-targets": "^7.22.5", + "@babel/helper-function-name": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" }, - "optionalDependencies": { - "@nicolo-ribaudo/chokidar-2": "2.1.8-no-fsevents.3", - "chokidar": "^3.4.0" - }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/cli/node_modules/commander": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", - "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "node_modules/@babel/plugin-transform-json-strings": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.22.5.tgz", + "integrity": "sha512-DuCRB7fu8MyTLbEQd1ew3R85nx/88yMoqo2uPSjevMj3yoN7CDM8jkgrY0wmVxfJZyJ/B9fE1iq7EQppWQmR5A==", "dev": true, - "engines": { - "node": ">= 6" + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-json-strings": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/cli/node_modules/slash": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", - "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "node_modules/@babel/plugin-transform-literals": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.22.5.tgz", + "integrity": "sha512-fTLj4D79M+mepcw3dgFBTIDYpbcB9Sm0bpm4ppXPaO+U+PKFFyV9MGRvS0gvGw62sd10kT5lRMKXAADb9pWy8g==", "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, "engines": { - "node": ">=6" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/code-frame": { + "node_modules/@babel/plugin-transform-logical-assignment-operators": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", - "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.22.5.tgz", + "integrity": "sha512-MQQOUW1KL8X0cDWfbwYP+TbVbZm16QmQXJQ+vndPtH/BoO0lOKpVoEDMI7+PskYxH+IiE0tS8xZye0qr1lGzSA==", "dev": true, "dependencies": { - "@babel/highlight": "^7.22.5" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" }, "engines": { "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/compat-data": { + "node_modules/@babel/plugin-transform-member-expression-literals": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.5.tgz", - "integrity": "sha512-4Jc/YuIaYqKnDDz892kPIledykKg12Aw1PYX5i/TY28anJtacvM1Rrr8wbieB9GfEJwlzqT0hUEao0CxEebiDA==", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.22.5.tgz", + "integrity": "sha512-RZEdkNtzzYCFl9SE9ATaUMTj2hqMb4StarOJLrZRbqqU4HSBE7UlBw9WBWQiDzrJZJdUWiMTVDI6Gv/8DPvfew==", "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, "engines": { "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/core": { + "node_modules/@babel/plugin-transform-modules-amd": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.22.5.tgz", - "integrity": "sha512-SBuTAjg91A3eKOvD+bPEz3LlhHZRNu1nFOVts9lzDJTXshHTjII0BAtDS3Y2DAkdZdDKWVZGVwkDfc4Clxn1dg==", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.22.5.tgz", + "integrity": "sha512-R+PTfLTcYEmb1+kK7FNkhQ1gP4KgjpSO6HfH9+f8/yfp2Nt3ggBjiVpRwmwTlfqZLafYKJACy36yDXlEmI9HjQ==", "dev": true, "dependencies": { - "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.22.5", - "@babel/generator": "^7.22.5", - "@babel/helper-compilation-targets": "^7.22.5", "@babel/helper-module-transforms": "^7.22.5", - "@babel/helpers": "^7.22.5", - "@babel/parser": "^7.22.5", - "@babel/template": "^7.22.5", - "@babel/traverse": "^7.22.5", - "@babel/types": "^7.22.5", - "convert-source-map": "^1.7.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.2", - "json5": "^2.2.2", - "semver": "^6.3.0" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/babel" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/core/node_modules/convert-source-map": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", - "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", + "node_modules/@babel/plugin-transform-modules-commonjs": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.22.5.tgz", + "integrity": "sha512-B4pzOXj+ONRmuaQTg05b3y/4DuFz3WcCNAXPLb2Q0GT0TrGKGxNKV4jwsXts+StaM0LQczZbOpj8o1DLPDJIiA==", "dev": true, "dependencies": { - "safe-buffer": "~5.1.1" + "@babel/helper-module-transforms": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-simple-access": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/core/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "node_modules/@babel/plugin-transform-modules-systemjs": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.22.5.tgz", + "integrity": "sha512-emtEpoaTMsOs6Tzz+nbmcePl6AKVtS1yC4YNAeMun9U8YCsgadPNxnOPQ8GhHFB2qdx+LZu9LgoC0Lthuu05DQ==", "dev": true, "dependencies": { - "ms": "2.1.2" + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-module-transforms": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.5" }, "engines": { - "node": ">=6.0" + "node": ">=6.9.0" }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/core/node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "node_modules/@babel/plugin-transform-modules-umd": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.22.5.tgz", + "integrity": "sha512-+S6kzefN/E1vkSsKx8kmQuqeQsvCKCd1fraCM7zXm4SFoggI099Tr4G8U81+5gtMdUeMQ4ipdQffbKLX0/7dBQ==", "dev": true, - "bin": { - "json5": "lib/cli.js" + "dependencies": { + "@babel/helper-module-transforms": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { - "node": ">=6" - } - }, - "node_modules/@babel/core/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/@babel/core/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/generator": { + "node_modules/@babel/plugin-transform-named-capturing-groups-regex": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.5.tgz", - "integrity": "sha512-+lcUbnTRhd0jOewtFSedLyiPsD5tswKkbgcezOqqWFUVNEwoUTlpPOBmvhG7OXWLR4jMdv0czPGH5XbflnD1EA==", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.22.5.tgz", + "integrity": "sha512-YgLLKmS3aUBhHaxp5hi1WJTgOUb/NCuDHzGT9z9WTt3YG+CPRhJs6nprbStx6DnWM4dh6gt7SU3sZodbZ08adQ==", "dev": true, "dependencies": { - "@babel/types": "^7.22.5", - "@jridgewell/gen-mapping": "^0.3.2", - "@jridgewell/trace-mapping": "^0.3.17", - "jsesc": "^2.5.1" + "@babel/helper-create-regexp-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" } }, - "node_modules/@babel/generator/node_modules/jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "node_modules/@babel/plugin-transform-new-target": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.22.5.tgz", + "integrity": "sha512-AsF7K0Fx/cNKVyk3a+DW0JLo+Ua598/NxMRvxDnkpCIGFh43+h/v2xyhRUYf6oD8gE4QtL83C7zZVghMjHd+iw==", "dev": true, - "bin": { - "jsesc": "bin/jsesc" + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { - "node": ">=4" + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/helper-annotate-as-pure": { + "node_modules/@babel/plugin-transform-nullish-coalescing-operator": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz", - "integrity": "sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.22.5.tgz", + "integrity": "sha512-6CF8g6z1dNYZ/VXok5uYkkBBICHZPiGEl7oDnAx2Mt1hlHVHOSIKWJaXHjQJA5VB43KZnXZDIexMchY4y2PGdA==", "dev": true, "dependencies": { - "@babel/types": "^7.22.5" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" }, "engines": { "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/helper-builder-binary-assignment-operator-visitor": { + "node_modules/@babel/plugin-transform-numeric-separator": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.22.5.tgz", - "integrity": "sha512-m1EP3lVOPptR+2DwD125gziZNcmoNSHGmJROKoy87loWUQyJaVXDgpmruWqDARZSmtYQ+Dl25okU8+qhVzuykw==", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.22.5.tgz", + "integrity": "sha512-NbslED1/6M+sXiwwtcAB/nieypGw02Ejf4KtDeMkCEpP6gWFMX1wI9WKYua+4oBneCCEmulOkRpwywypVZzs/g==", "dev": true, "dependencies": { - "@babel/types": "^7.22.5" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-numeric-separator": "^7.10.4" }, "engines": { "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/helper-compilation-targets": { + "node_modules/@babel/plugin-transform-object-rest-spread": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.5.tgz", - "integrity": "sha512-Ji+ywpHeuqxB8WDxraCiqR0xfhYjiDE/e6k7FuIaANnoOFxAHskHChz4vA1mJC9Lbm01s1PVAGhQY4FUKSkGZw==", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.22.5.tgz", + "integrity": "sha512-Kk3lyDmEslH9DnvCDA1s1kkd3YWQITiBOHngOtDL9Pt6BZjzqb6hiOlb8VfjiiQJ2unmegBqZu0rx5RxJb5vmQ==", "dev": true, "dependencies": { "@babel/compat-data": "^7.22.5", - "@babel/helper-validator-option": "^7.22.5", - "browserslist": "^4.21.3", - "lru-cache": "^5.1.1", - "semver": "^6.3.0" + "@babel/helper-compilation-targets": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-transform-parameters": "^7.22.5" }, "engines": { "node": ">=6.9.0" }, "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/helper-compilation-targets/node_modules/lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "dependencies": { - "yallist": "^3.0.2" - } - }, - "node_modules/@babel/helper-compilation-targets/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" + "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/helper-compilation-targets/node_modules/yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true - }, - "node_modules/@babel/helper-create-class-features-plugin": { + "node_modules/@babel/plugin-transform-object-super": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.22.5.tgz", - "integrity": "sha512-xkb58MyOYIslxu3gKmVXmjTtUPvBU4odYzbiIQbWwLKIHCsx6UGZGX6F1IznMFVnDdirseUZopzN+ZRt8Xb33Q==", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.22.5.tgz", + "integrity": "sha512-klXqyaT9trSjIUrcsYIfETAzmOEZL3cBYqOYLJxBHfMFFggmXOv+NYSX/Jbs9mzMVESw/WycLFPRx8ba/b2Ipw==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.22.5", - "@babel/helper-environment-visitor": "^7.22.5", - "@babel/helper-function-name": "^7.22.5", - "@babel/helper-member-expression-to-functions": "^7.22.5", - "@babel/helper-optimise-call-expression": "^7.22.5", - "@babel/helper-replace-supers": "^7.22.5", - "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.5", - "semver": "^6.3.0" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-replace-supers": "^7.22.5" }, "engines": { "node": ">=6.9.0" }, "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/helper-create-class-features-plugin/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" + "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/helper-create-regexp-features-plugin": { + "node_modules/@babel/plugin-transform-optional-catch-binding": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.22.5.tgz", - "integrity": "sha512-1VpEFOIbMRaXyDeUwUfmTIxExLwQ+zkW+Bh5zXpApA3oQedBx9v/updixWxnx/bZpKw7u8VxWjb/qWpIcmPq8A==", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.22.5.tgz", + "integrity": "sha512-pH8orJahy+hzZje5b8e2QIlBWQvGpelS76C63Z+jhZKsmzfNaPQ+LaW6dcJ9bxTpo1mtXbgHwy765Ro3jftmUg==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.22.5", - "regexpu-core": "^5.3.1", - "semver": "^6.3.0" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" }, "engines": { "node": ">=6.9.0" }, "peerDependencies": { - "@babel/core": "^7.0.0" + "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/helper-create-regexp-features-plugin/node_modules/jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==", - "dev": true, - "bin": { - "jsesc": "bin/jsesc" - } - }, - "node_modules/@babel/helper-create-regexp-features-plugin/node_modules/regexpu-core": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.3.2.tgz", - "integrity": "sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ==", + "node_modules/@babel/plugin-transform-optional-chaining": { + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.22.6.tgz", + "integrity": "sha512-Vd5HiWml0mDVtcLHIoEU5sw6HOUW/Zk0acLs/SAeuLzkGNOPc9DB4nkUajemhCmTIz3eiaKREZn2hQQqF79YTg==", "dev": true, "dependencies": { - "@babel/regjsgen": "^0.8.0", - "regenerate": "^1.4.2", - "regenerate-unicode-properties": "^10.1.0", - "regjsparser": "^0.9.1", - "unicode-match-property-ecmascript": "^2.0.0", - "unicode-match-property-value-ecmascript": "^2.1.0" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", + "@babel/plugin-syntax-optional-chaining": "^7.8.3" }, "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/helper-create-regexp-features-plugin/node_modules/regjsparser": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.9.1.tgz", - "integrity": "sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ==", - "dev": true, - "dependencies": { - "jsesc": "~0.5.0" - }, - "bin": { - "regjsparser": "bin/parser" - } - }, - "node_modules/@babel/helper-create-regexp-features-plugin/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/@babel/helper-define-polyfill-provider": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.4.0.tgz", - "integrity": "sha512-RnanLx5ETe6aybRi1cO/edaRH+bNYWaryCEmjDDYyNr4wnSzyOp8T0dWipmqVHKEY3AbVKUom50AKSlj1zmKbg==", - "dev": true, - "dependencies": { - "@babel/helper-compilation-targets": "^7.17.7", - "@babel/helper-plugin-utils": "^7.16.7", - "debug": "^4.1.1", - "lodash.debounce": "^4.0.8", - "resolve": "^1.14.2", - "semver": "^6.1.2" + "node": ">=6.9.0" }, "peerDependencies": { - "@babel/core": "^7.4.0-0" + "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/helper-define-polyfill-provider/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "node_modules/@babel/plugin-transform-parameters": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.22.5.tgz", + "integrity": "sha512-AVkFUBurORBREOmHRKo06FjHYgjrabpdqRSwq6+C7R5iTCZOsM4QbcB27St0a4U6fffyAOqh3s/qEfybAhfivg==", "dev": true, "dependencies": { - "ms": "2.1.2" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { - "node": ">=6.0" + "node": ">=6.9.0" }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/helper-define-polyfill-provider/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/@babel/helper-define-polyfill-provider/node_modules/resolve": { - "version": "1.22.2", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", - "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", + "node_modules/@babel/plugin-transform-private-methods": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.22.5.tgz", + "integrity": "sha512-PPjh4gyrQnGe97JTalgRGMuU4icsZFnWkzicB/fUtzlKUqvsWBKEpPPfr5a2JiyirZkHxnAqkQMO5Z5B2kK3fA==", "dev": true, "dependencies": { - "is-core-module": "^2.11.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" + "@babel/helper-create-class-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" }, - "bin": { - "resolve": "bin/resolve" + "engines": { + "node": ">=6.9.0" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/@babel/helper-define-polyfill-provider/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/helper-environment-visitor": { + "node_modules/@babel/plugin-transform-private-property-in-object": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz", - "integrity": "sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.22.5.tgz", + "integrity": "sha512-/9xnaTTJcVoBtSSmrVyhtSvO3kbqS2ODoh2juEU72c3aYonNF0OMGiaz2gjukyKM2wBBYJP38S4JiE0Wfb5VMQ==", "dev": true, + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-create-class-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5" + }, "engines": { "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/helper-function-name": { + "node_modules/@babel/plugin-transform-property-literals": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz", - "integrity": "sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.22.5.tgz", + "integrity": "sha512-TiOArgddK3mK/x1Qwf5hay2pxI6wCZnvQqrFSqbtg1GLl2JcNMitVH/YnqjP+M31pLUeTfzY1HAXFDnUBV30rQ==", "dev": true, "dependencies": { - "@babel/template": "^7.22.5", - "@babel/types": "^7.22.5" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/helper-hoist-variables": { + "node_modules/@babel/plugin-transform-regenerator": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", - "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.22.5.tgz", + "integrity": "sha512-rR7KePOE7gfEtNTh9Qw+iO3Q/e4DEsoQ+hdvM6QUDH7JRJ5qxq5AA52ZzBWbI5i9lfNuvySgOGP8ZN7LAmaiPw==", "dev": true, "dependencies": { - "@babel/types": "^7.22.5" + "@babel/helper-plugin-utils": "^7.22.5", + "regenerator-transform": "^0.15.1" }, "engines": { "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/helper-member-expression-to-functions": { + "node_modules/@babel/plugin-transform-reserved-words": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.22.5.tgz", - "integrity": "sha512-aBiH1NKMG0H2cGZqspNvsaBe6wNGjbJjuLy29aU+eDZjSbbN53BaxlpB02xm9v34pLTZ1nIQPFYn2qMZoa5BQQ==", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.22.5.tgz", + "integrity": "sha512-DTtGKFRQUDm8svigJzZHzb/2xatPc6TzNvAIJ5GqOKDsGFYgAskjRulbR/vGsPKq3OPqtexnz327qYpP57RFyA==", "dev": true, "dependencies": { - "@babel/types": "^7.22.5" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/helper-module-imports": { + "node_modules/@babel/plugin-transform-runtime": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz", - "integrity": "sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg==", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.22.5.tgz", + "integrity": "sha512-bg4Wxd1FWeFx3daHFTWk1pkSWK/AyQuiyAoeZAOkAOUBjnZPH6KT7eMxouV47tQ6hl6ax2zyAWBdWZXbrvXlaw==", "dev": true, "dependencies": { - "@babel/types": "^7.22.5" + "@babel/helper-module-imports": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "babel-plugin-polyfill-corejs2": "^0.4.3", + "babel-plugin-polyfill-corejs3": "^0.8.1", + "babel-plugin-polyfill-regenerator": "^0.5.0", + "semver": "^6.3.0" }, "engines": { "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/helper-module-transforms": { + "node_modules/@babel/plugin-transform-runtime/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/plugin-transform-shorthand-properties": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.22.5.tgz", - "integrity": "sha512-+hGKDt/Ze8GFExiVHno/2dvG5IdstpzCq0y4Qc9OJ25D4q3pKfiIP/4Vp3/JvhDkLKsDK2api3q3fpIgiIF5bw==", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.22.5.tgz", + "integrity": "sha512-vM4fq9IXHscXVKzDv5itkO1X52SmdFBFcMIBZ2FRn2nqVYqw6dBexUgMvAjHW+KXpPPViD/Yo3GrDEBaRC0QYA==", "dev": true, "dependencies": { - "@babel/helper-environment-visitor": "^7.22.5", - "@babel/helper-module-imports": "^7.22.5", - "@babel/helper-simple-access": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.5", - "@babel/helper-validator-identifier": "^7.22.5", - "@babel/template": "^7.22.5", - "@babel/traverse": "^7.22.5", - "@babel/types": "^7.22.5" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/helper-optimise-call-expression": { + "node_modules/@babel/plugin-transform-spread": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz", - "integrity": "sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.22.5.tgz", + "integrity": "sha512-5ZzDQIGyvN4w8+dMmpohL6MBo+l2G7tfC/O2Dg7/hjpgeWvUx8FzfeOKxGog9IimPa4YekaQ9PlDqTLOljkcxg==", "dev": true, "dependencies": { - "@babel/types": "^7.22.5" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5" }, "engines": { "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/helper-plugin-utils": { + "node_modules/@babel/plugin-transform-sticky-regex": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", - "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.22.5.tgz", + "integrity": "sha512-zf7LuNpHG0iEeiyCNwX4j3gDg1jgt1k3ZdXBKbZSoA3BbGQGvMiSvfbZRR3Dr3aeJe3ooWFZxOOG3IRStYp2Bw==", "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, "engines": { "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/helper-remap-async-to-generator": { + "node_modules/@babel/plugin-transform-template-literals": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.22.5.tgz", - "integrity": "sha512-cU0Sq1Rf4Z55fgz7haOakIyM7+x/uCFwXpLPaeRzfoUtAEAuUZjZvFPjL/rk5rW693dIgn2hng1W7xbT7lWT4g==", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.22.5.tgz", + "integrity": "sha512-5ciOehRNf+EyUeewo8NkbQiUs4d6ZxiHo6BcBcnFlgiJfu16q0bQUw9Jvo0b0gBKFG1SMhDSjeKXSYuJLeFSMA==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.22.5", - "@babel/helper-environment-visitor": "^7.22.5", - "@babel/helper-wrap-function": "^7.22.5", - "@babel/types": "^7.22.5" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" }, "peerDependencies": { - "@babel/core": "^7.0.0" + "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/helper-replace-supers": { + "node_modules/@babel/plugin-transform-typeof-symbol": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.22.5.tgz", - "integrity": "sha512-aLdNM5I3kdI/V9xGNyKSF3X/gTyMUBohTZ+/3QdQKAA9vxIiy12E+8E2HoOP1/DjeqU+g6as35QHJNMDDYpuCg==", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.22.5.tgz", + "integrity": "sha512-bYkI5lMzL4kPii4HHEEChkD0rkc+nvnlR6+o/qdqR6zrm0Sv/nodmyLhlq2DO0YKLUNd2VePmPRjJXSBh9OIdA==", "dev": true, "dependencies": { - "@babel/helper-environment-visitor": "^7.22.5", - "@babel/helper-member-expression-to-functions": "^7.22.5", - "@babel/helper-optimise-call-expression": "^7.22.5", - "@babel/template": "^7.22.5", - "@babel/traverse": "^7.22.5", - "@babel/types": "^7.22.5" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/helper-simple-access": { + "node_modules/@babel/plugin-transform-unicode-escapes": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", - "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.22.5.tgz", + "integrity": "sha512-biEmVg1IYB/raUO5wT1tgfacCef15Fbzhkx493D3urBI++6hpJ+RFG4SrWMn0NEZLfvilqKf3QDrRVZHo08FYg==", "dev": true, "dependencies": { - "@babel/types": "^7.22.5" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/helper-skip-transparent-expression-wrappers": { + "node_modules/@babel/plugin-transform-unicode-property-regex": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz", - "integrity": "sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q==", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.22.5.tgz", + "integrity": "sha512-HCCIb+CbJIAE6sXn5CjFQXMwkCClcOfPCzTlilJ8cUatfzwHlWQkbtV0zD338u9dZskwvuOYTuuaMaA8J5EI5A==", "dev": true, "dependencies": { - "@babel/types": "^7.22.5" + "@babel/helper-create-regexp-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/helper-split-export-declaration": { + "node_modules/@babel/plugin-transform-unicode-regex": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.5.tgz", - "integrity": "sha512-thqK5QFghPKWLhAV321lxF95yCg2K3Ob5yw+M3VHWfdia0IkPXUtoLH8x/6Fh486QUvzhb8YOWHChTVen2/PoQ==", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.22.5.tgz", + "integrity": "sha512-028laaOKptN5vHJf9/Arr/HiJekMd41hOEZYvNsrsXqJ7YPYuX2bQxh31fkZzGmq3YqHRJzYFFAVYvKfMPKqyg==", "dev": true, "dependencies": { - "@babel/types": "^7.22.5" + "@babel/helper-create-regexp-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/helper-string-parser": { + "node_modules/@babel/plugin-transform-unicode-sets-regex": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", - "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.22.5.tgz", + "integrity": "sha512-lhMfi4FC15j13eKrh3DnYHjpGj6UKQHtNKTbtc1igvAhRy4+kLhV07OpLcsN0VgDEw/MjAvJO4BdMJsHwMhzCg==", "dev": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" + }, "engines": { "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" } }, - "node_modules/@babel/helper-validator-identifier": { + "node_modules/@babel/preset-env": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", - "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.22.5.tgz", + "integrity": "sha512-fj06hw89dpiZzGZtxn+QybifF07nNiZjZ7sazs2aVDcysAZVGjW7+7iFYxg6GLNM47R/thYfLdrXc+2f11Vi9A==", "dev": true, + "dependencies": { + "@babel/compat-data": "^7.22.5", + "@babel/helper-compilation-targets": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-validator-option": "^7.22.5", + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.22.5", + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.22.5", + "@babel/plugin-proposal-private-property-in-object": "7.21.0-placeholder-for-preset-env.2", + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-class-properties": "^7.12.13", + "@babel/plugin-syntax-class-static-block": "^7.14.5", + "@babel/plugin-syntax-dynamic-import": "^7.8.3", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3", + "@babel/plugin-syntax-import-assertions": "^7.22.5", + "@babel/plugin-syntax-import-attributes": "^7.22.5", + "@babel/plugin-syntax-import-meta": "^7.10.4", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5", + "@babel/plugin-syntax-top-level-await": "^7.14.5", + "@babel/plugin-syntax-unicode-sets-regex": "^7.18.6", + "@babel/plugin-transform-arrow-functions": "^7.22.5", + "@babel/plugin-transform-async-generator-functions": "^7.22.5", + "@babel/plugin-transform-async-to-generator": "^7.22.5", + "@babel/plugin-transform-block-scoped-functions": "^7.22.5", + "@babel/plugin-transform-block-scoping": "^7.22.5", + "@babel/plugin-transform-class-properties": "^7.22.5", + "@babel/plugin-transform-class-static-block": "^7.22.5", + "@babel/plugin-transform-classes": "^7.22.5", + "@babel/plugin-transform-computed-properties": "^7.22.5", + "@babel/plugin-transform-destructuring": "^7.22.5", + "@babel/plugin-transform-dotall-regex": "^7.22.5", + "@babel/plugin-transform-duplicate-keys": "^7.22.5", + "@babel/plugin-transform-dynamic-import": "^7.22.5", + "@babel/plugin-transform-exponentiation-operator": "^7.22.5", + "@babel/plugin-transform-export-namespace-from": "^7.22.5", + "@babel/plugin-transform-for-of": "^7.22.5", + "@babel/plugin-transform-function-name": "^7.22.5", + "@babel/plugin-transform-json-strings": "^7.22.5", + "@babel/plugin-transform-literals": "^7.22.5", + "@babel/plugin-transform-logical-assignment-operators": "^7.22.5", + "@babel/plugin-transform-member-expression-literals": "^7.22.5", + "@babel/plugin-transform-modules-amd": "^7.22.5", + "@babel/plugin-transform-modules-commonjs": "^7.22.5", + "@babel/plugin-transform-modules-systemjs": "^7.22.5", + "@babel/plugin-transform-modules-umd": "^7.22.5", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.22.5", + "@babel/plugin-transform-new-target": "^7.22.5", + "@babel/plugin-transform-nullish-coalescing-operator": "^7.22.5", + "@babel/plugin-transform-numeric-separator": "^7.22.5", + "@babel/plugin-transform-object-rest-spread": "^7.22.5", + "@babel/plugin-transform-object-super": "^7.22.5", + "@babel/plugin-transform-optional-catch-binding": "^7.22.5", + "@babel/plugin-transform-optional-chaining": "^7.22.5", + "@babel/plugin-transform-parameters": "^7.22.5", + "@babel/plugin-transform-private-methods": "^7.22.5", + "@babel/plugin-transform-private-property-in-object": "^7.22.5", + "@babel/plugin-transform-property-literals": "^7.22.5", + "@babel/plugin-transform-regenerator": "^7.22.5", + "@babel/plugin-transform-reserved-words": "^7.22.5", + "@babel/plugin-transform-shorthand-properties": "^7.22.5", + "@babel/plugin-transform-spread": "^7.22.5", + "@babel/plugin-transform-sticky-regex": "^7.22.5", + "@babel/plugin-transform-template-literals": "^7.22.5", + "@babel/plugin-transform-typeof-symbol": "^7.22.5", + "@babel/plugin-transform-unicode-escapes": "^7.22.5", + "@babel/plugin-transform-unicode-property-regex": "^7.22.5", + "@babel/plugin-transform-unicode-regex": "^7.22.5", + "@babel/plugin-transform-unicode-sets-regex": "^7.22.5", + "@babel/preset-modules": "^0.1.5", + "@babel/types": "^7.22.5", + "babel-plugin-polyfill-corejs2": "^0.4.3", + "babel-plugin-polyfill-corejs3": "^0.8.1", + "babel-plugin-polyfill-regenerator": "^0.5.0", + "core-js-compat": "^3.30.2", + "semver": "^6.3.0" + }, "engines": { "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/helper-validator-option": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz", - "integrity": "sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw==", + "node_modules/@babel/preset-env/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, - "engines": { - "node": ">=6.9.0" + "bin": { + "semver": "bin/semver.js" } }, - "node_modules/@babel/helper-wrap-function": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.22.5.tgz", - "integrity": "sha512-bYqLIBSEshYcYQyfks8ewYA8S30yaGSeRslcvKMvoUk6HHPySbxHq9YRi6ghhzEU+yhQv9bP/jXnygkStOcqZw==", + "node_modules/@babel/preset-modules": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.5.tgz", + "integrity": "sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA==", "dev": true, "dependencies": { - "@babel/helper-function-name": "^7.22.5", - "@babel/template": "^7.22.5", - "@babel/traverse": "^7.22.5", - "@babel/types": "^7.22.5" + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", + "@babel/plugin-transform-dotall-regex": "^7.4.4", + "@babel/types": "^7.4.4", + "esutils": "^2.0.2" }, - "engines": { - "node": ">=6.9.0" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/helpers": { + "node_modules/@babel/regjsgen": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@babel/regjsgen/-/regjsgen-0.8.0.tgz", + "integrity": "sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==", + "dev": true + }, + "node_modules/@babel/runtime": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.22.5.tgz", - "integrity": "sha512-pSXRmfE1vzcUIDFQcSGA5Mr+GxBV9oiRKDuDxXvWQQBCh8HoIjs/2DlDB7H8smac1IVrB9/xdXj2N3Wol9Cr+Q==", - "dev": true, + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.5.tgz", + "integrity": "sha512-ecjvYlnAaZ/KVneE/OdKYBYfgXV3Ptu6zQWmgEF7vwKhQnvVS6bjMD2XYgj+SNvQ1GfK/pjgokfPkC/2CO8CuA==", "dependencies": { - "@babel/template": "^7.22.5", - "@babel/traverse": "^7.22.5", - "@babel/types": "^7.22.5" + "regenerator-runtime": "^0.13.11" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/highlight": { + "node_modules/@babel/template": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", - "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", - "dev": true, + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.5.tgz", + "integrity": "sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw==", "dependencies": { - "@babel/helper-validator-identifier": "^7.22.5", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" + "@babel/code-frame": "^7.22.5", + "@babel/parser": "^7.22.5", + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/highlight/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, + "node_modules/@babel/traverse": { + "version": "7.22.8", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.8.tgz", + "integrity": "sha512-y6LPR+wpM2I3qJrsheCTwhIinzkETbplIgPBbwvqPKc+uljeA5gP+3nP8irdYt1mjQaDnlIcG+dw8OjAco4GXw==", "dependencies": { - "color-convert": "^1.9.0" + "@babel/code-frame": "^7.22.5", + "@babel/generator": "^7.22.7", + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-function-name": "^7.22.5", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.22.7", + "@babel/types": "^7.22.5", + "debug": "^4.1.0", + "globals": "^11.1.0" }, "engines": { - "node": ">=4" + "node": ">=6.9.0" } }, - "node_modules/@babel/highlight/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, + "node_modules/@babel/traverse/node_modules/@babel/helper-split-export-declaration": { + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "@babel/types": "^7.22.5" }, "engines": { - "node": ">=4" + "node": ">=6.9.0" } }, - "node_modules/@babel/highlight/node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "node_modules/@babel/highlight/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, + "node_modules/@babel/types": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", + "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dependencies": { - "has-flag": "^3.0.0" + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.5", + "to-fast-properties": "^2.0.0" }, "engines": { - "node": ">=4" + "node": ">=6.9.0" } }, - "node_modules/@babel/parser": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.5.tgz", - "integrity": "sha512-DFZMC9LJUG9PLOclRC32G63UXwzqS2koQC8dkx+PLdmt1xSePYpbT/NbsrJy8Q/muXz7o/h/d4A7Fuyixm559Q==", + "node_modules/@discoveryjs/json-ext": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", + "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", "dev": true, - "bin": { - "parser": "bin/babel-parser.js" - }, "engines": { - "node": ">=6.0.0" + "node": ">=10.0.0" } }, - "node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.22.5.tgz", - "integrity": "sha512-NP1M5Rf+u2Gw9qfSO4ihjcTGW5zXTi36ITLd4/EoAcEhIZ0yjMqmftDNl3QC19CX7olhrjpyU454g/2W7X0jvQ==", + "node_modules/@esbuild/android-arm": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.19.tgz", + "integrity": "sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==", + "cpu": [ + "arm" + ], "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" - }, + "optional": true, + "os": [ + "android" + ], "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" + "node": ">=12" } }, - "node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.22.5.tgz", - "integrity": "sha512-31Bb65aZaUwqCbWMnZPduIZxCBngHFlzyN6Dq6KAJjtx+lx6ohKHubc61OomYi7XwVD4Ol0XCVz4h+pYFR048g==", + "node_modules/@esbuild/android-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.19.tgz", + "integrity": "sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5", - "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", - "@babel/plugin-transform-optional-chaining": "^7.22.5" - }, + "optional": true, + "os": [ + "android" + ], "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.13.0" + "node": ">=12" } }, - "node_modules/@babel/plugin-proposal-async-generator-functions": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.20.7.tgz", - "integrity": "sha512-xMbiLsn/8RK7Wq7VeVytytS2L6qE69bXPB10YCmMdDZbKF4okCqY74pI/jJQ/8U0b/F6NrT2+14b8/P9/3AMGA==", + "node_modules/@esbuild/android-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.19.tgz", + "integrity": "sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-remap-async-to-generator": "^7.18.9", - "@babel/plugin-syntax-async-generators": "^7.8.4" - }, + "optional": true, + "os": [ + "android" + ], "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "node": ">=12" } }, - "node_modules/@babel/plugin-proposal-private-property-in-object": { - "version": "7.21.0-placeholder-for-preset-env.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz", - "integrity": "sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==", + "node_modules/@esbuild/darwin-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz", + "integrity": "sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==", + "cpu": [ + "arm64" + ], "dev": true, + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "node": ">=12" } }, - "node_modules/@babel/plugin-proposal-unicode-property-regex": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.18.6.tgz", - "integrity": "sha512-2BShG/d5yoZyXZfVePH91urL5wTG6ASZU9M4o03lKK8u8UW1y08OMttBSOADTcJrnPMpvDXRG3G8fyLh4ovs8w==", + "node_modules/@esbuild/darwin-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz", + "integrity": "sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" - }, + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "node": ">=12" } }, - "node_modules/@babel/plugin-syntax-async-generators": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", - "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.19.tgz", + "integrity": "sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" } }, - "node_modules/@babel/plugin-syntax-class-properties": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", - "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", + "node_modules/@esbuild/freebsd-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.19.tgz", + "integrity": "sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.12.13" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" } }, - "node_modules/@babel/plugin-syntax-class-static-block": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", - "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", + "node_modules/@esbuild/linux-arm": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.19.tgz", + "integrity": "sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==", + "cpu": [ + "arm" + ], "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "node": ">=12" } }, - "node_modules/@babel/plugin-syntax-dynamic-import": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", - "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", + "node_modules/@esbuild/linux-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.19.tgz", + "integrity": "sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" } }, - "node_modules/@babel/plugin-syntax-export-namespace-from": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz", - "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==", + "node_modules/@esbuild/linux-ia32": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.19.tgz", + "integrity": "sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==", + "cpu": [ + "ia32" + ], "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.3" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" } }, - "node_modules/@babel/plugin-syntax-import-assertions": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.22.5.tgz", - "integrity": "sha512-rdV97N7KqsRzeNGoWUOK6yUsWarLjE5Su/Snk9IYPU9CwkWHs4t+rTGOvffTR8XGkJMTAdLfO0xVnXm8wugIJg==", + "node_modules/@esbuild/linux-loong64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.19.tgz", + "integrity": "sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==", + "cpu": [ + "loong64" + ], "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "node": ">=12" } }, - "node_modules/@babel/plugin-syntax-import-attributes": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.22.5.tgz", - "integrity": "sha512-KwvoWDeNKPETmozyFE0P2rOLqh39EoQHNjqizrI5B8Vt0ZNS7M56s7dAiAqbYfiAYOuIzIh96z3iR2ktgu3tEg==", + "node_modules/@esbuild/linux-mips64el": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.19.tgz", + "integrity": "sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==", + "cpu": [ + "mips64el" + ], "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "node": ">=12" } }, - "node_modules/@babel/plugin-syntax-import-meta": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", - "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "node_modules/@esbuild/linux-ppc64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.19.tgz", + "integrity": "sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==", + "cpu": [ + "ppc64" + ], "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-syntax-json-strings": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", - "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" } }, - "node_modules/@babel/plugin-syntax-logical-assignment-operators": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", - "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "node_modules/@esbuild/linux-riscv64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.19.tgz", + "integrity": "sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==", + "cpu": [ + "riscv64" + ], "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" } }, - "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", - "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "node_modules/@esbuild/linux-s390x": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.19.tgz", + "integrity": "sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==", + "cpu": [ + "s390x" + ], "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" } }, - "node_modules/@babel/plugin-syntax-numeric-separator": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", - "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "node_modules/@esbuild/linux-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz", + "integrity": "sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" } }, - "node_modules/@babel/plugin-syntax-object-rest-spread": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", - "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "node_modules/@esbuild/netbsd-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.19.tgz", + "integrity": "sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" } }, - "node_modules/@babel/plugin-syntax-optional-catch-binding": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", - "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "node_modules/@esbuild/openbsd-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz", + "integrity": "sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" } }, - "node_modules/@babel/plugin-syntax-optional-chaining": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", - "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "node_modules/@esbuild/sunos-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.19.tgz", + "integrity": "sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" } }, - "node_modules/@babel/plugin-syntax-private-property-in-object": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", - "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", + "node_modules/@esbuild/win32-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.19.tgz", + "integrity": "sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" - }, + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "node": ">=12" } }, - "node_modules/@babel/plugin-syntax-top-level-await": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", - "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "node_modules/@esbuild/win32-ia32": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.19.tgz", + "integrity": "sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==", + "cpu": [ + "ia32" + ], "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" - }, + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "node": ">=12" } }, - "node_modules/@babel/plugin-syntax-unicode-sets-regex": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz", - "integrity": "sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg==", + "node_modules/@esbuild/win32-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz", + "integrity": "sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" - }, + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" + "node": ">=12" } }, - "node_modules/@babel/plugin-transform-arrow-functions": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.22.5.tgz", - "integrity": "sha512-26lTNXoVRdAnsaDXPpvCNUq+OVWEVC6bx7Vvz9rC53F2bagUWW4u4ii2+h8Fejfh7RYqPxn+libeFBBck9muEw==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" - }, + "node_modules/@fortawesome/fontawesome-free": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-6.4.0.tgz", + "integrity": "sha512-0NyytTlPJwB/BF5LtRV8rrABDbe3TdTXqNB3PdZ+UUUZAEIrdOJdmABqKjt4AXwIoJNaRVVZEXxpNrqvE1GAYQ==", + "hasInstallScript": true, "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "node": ">=6" } }, - "node_modules/@babel/plugin-transform-async-generator-functions": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.22.5.tgz", - "integrity": "sha512-gGOEvFzm3fWoyD5uZq7vVTD57pPJ3PczPUD/xCFGjzBpUosnklmXyKnGQbbbGs1NPNPskFex0j93yKbHt0cHyg==", - "dev": true, + "node_modules/@googlemaps/js-api-loader": { + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/@googlemaps/js-api-loader/-/js-api-loader-1.16.2.tgz", + "integrity": "sha512-psGw5u0QM6humao48Hn4lrChOM2/rA43ZCm3tKK9qQsEj1/VzqkCqnvGfEOshDbBQflydfaRovbKwZMF4AyqbA==", + "optional": true, "dependencies": { - "@babel/helper-environment-visitor": "^7.22.5", - "@babel/helper-plugin-utils": "^7.22.5", - "@babel/helper-remap-async-to-generator": "^7.22.5", - "@babel/plugin-syntax-async-generators": "^7.8.4" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "fast-deep-equal": "^3.1.3" } }, - "node_modules/@babel/plugin-transform-async-to-generator": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.22.5.tgz", - "integrity": "sha512-b1A8D8ZzE/VhNDoV1MSJTnpKkCG5bJo+19R4o4oy03zM7ws8yEMK755j61Dc3EyvdysbqH5BOOTquJ7ZX9C6vQ==", - "dev": true, - "dependencies": { - "@babel/helper-module-imports": "^7.22.5", - "@babel/helper-plugin-utils": "^7.22.5", - "@babel/helper-remap-async-to-generator": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-block-scoped-functions": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.22.5.tgz", - "integrity": "sha512-tdXZ2UdknEKQWKJP1KMNmuF5Lx3MymtMN/pvA+p/VEkhK8jVcQ1fzSy8KM9qRYhAf2/lV33hoMPKI/xaI9sADA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-block-scoping": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.22.5.tgz", - "integrity": "sha512-EcACl1i5fSQ6bt+YGuU/XGCeZKStLmyVGytWkpyhCLeQVA0eu6Wtiw92V+I1T/hnezUv7j74dA/Ro69gWcU+hg==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-class-properties": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.22.5.tgz", - "integrity": "sha512-nDkQ0NfkOhPTq8YCLiWNxp1+f9fCobEjCb0n8WdbNUBc4IB5V7P1QnX9IjpSoquKrXF5SKojHleVNs2vGeHCHQ==", - "dev": true, - "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.22.5", - "@babel/helper-plugin-utils": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-class-static-block": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.22.5.tgz", - "integrity": "sha512-SPToJ5eYZLxlnp1UzdARpOGeC2GbHvr9d/UV0EukuVx8atktg194oe+C5BqQ8jRTkgLRVOPYeXRSBg1IlMoVRA==", - "dev": true, - "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.22.5", - "@babel/helper-plugin-utils": "^7.22.5", - "@babel/plugin-syntax-class-static-block": "^7.14.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.12.0" - } - }, - "node_modules/@babel/plugin-transform-classes": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.22.5.tgz", - "integrity": "sha512-2edQhLfibpWpsVBx2n/GKOz6JdGQvLruZQfGr9l1qes2KQaWswjBzhQF7UDUZMNaMMQeYnQzxwOMPsbYF7wqPQ==", - "dev": true, - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.22.5", - "@babel/helper-compilation-targets": "^7.22.5", - "@babel/helper-environment-visitor": "^7.22.5", - "@babel/helper-function-name": "^7.22.5", - "@babel/helper-optimise-call-expression": "^7.22.5", - "@babel/helper-plugin-utils": "^7.22.5", - "@babel/helper-replace-supers": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.5", - "globals": "^11.1.0" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-classes/node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/plugin-transform-computed-properties": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.22.5.tgz", - "integrity": "sha512-4GHWBgRf0krxPX+AaPtgBAlTgTeZmqDynokHOX7aqqAB4tHs3U2Y02zH6ETFdLZGcg9UQSD1WCmkVrE9ErHeOg==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5", - "@babel/template": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-destructuring": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.22.5.tgz", - "integrity": "sha512-GfqcFuGW8vnEqTUBM7UtPd5A4q797LTvvwKxXTgRsFjoqaJiEg9deBG6kWeQYkVEL569NpnmpC0Pkr/8BLKGnQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-dotall-regex": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.22.5.tgz", - "integrity": "sha512-5/Yk9QxCQCl+sOIB1WelKnVRxTJDSAIxtJLL2/pqL14ZVlbH0fUQUZa/T5/UnQtBNgghR7mfB8ERBKyKPCi7Vw==", - "dev": true, - "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.22.5", - "@babel/helper-plugin-utils": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-duplicate-keys": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.22.5.tgz", - "integrity": "sha512-dEnYD+9BBgld5VBXHnF/DbYGp3fqGMsyxKbtD1mDyIA7AkTSpKXFhCVuj/oQVOoALfBs77DudA0BE4d5mcpmqw==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-dynamic-import": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.22.5.tgz", - "integrity": "sha512-0MC3ppTB1AMxd8fXjSrbPa7LT9hrImt+/fcj+Pg5YMD7UQyWp/02+JWpdnCymmsXwIx5Z+sYn1bwCn4ZJNvhqQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5", - "@babel/plugin-syntax-dynamic-import": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-exponentiation-operator": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.22.5.tgz", - "integrity": "sha512-vIpJFNM/FjZ4rh1myqIya9jXwrwwgFRHPjT3DkUA9ZLHuzox8jiXkOLvwm1H+PQIP3CqfC++WPKeuDi0Sjdj1g==", - "dev": true, - "dependencies": { - "@babel/helper-builder-binary-assignment-operator-visitor": "^7.22.5", - "@babel/helper-plugin-utils": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-export-namespace-from": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.22.5.tgz", - "integrity": "sha512-X4hhm7FRnPgd4nDA4b/5V280xCx6oL7Oob5+9qVS5C13Zq4bh1qq7LU0GgRU6b5dBWBvhGaXYVB4AcN6+ol6vg==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5", - "@babel/plugin-syntax-export-namespace-from": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-for-of": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.22.5.tgz", - "integrity": "sha512-3kxQjX1dU9uudwSshyLeEipvrLjBCVthCgeTp6CzE/9JYrlAIaeekVxRpCWsDDfYTfRZRoCeZatCQvwo+wvK8A==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } + "node_modules/@iarna/toml": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/@iarna/toml/-/toml-2.2.5.tgz", + "integrity": "sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==", + "dev": true }, - "node_modules/@babel/plugin-transform-function-name": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.22.5.tgz", - "integrity": "sha512-UIzQNMS0p0HHiQm3oelztj+ECwFnj+ZRV4KnguvlsD2of1whUeM6o7wGNj6oLwcDoAXQ8gEqfgC24D+VdIcevg==", + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", "dev": true, "dependencies": { - "@babel/helper-compilation-targets": "^7.22.5", - "@babel/helper-function-name": "^7.22.5", - "@babel/helper-plugin-utils": "^7.22.5" + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" }, "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "node": ">=12" } }, - "node_modules/@babel/plugin-transform-json-strings": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.22.5.tgz", - "integrity": "sha512-DuCRB7fu8MyTLbEQd1ew3R85nx/88yMoqo2uPSjevMj3yoN7CDM8jkgrY0wmVxfJZyJ/B9fE1iq7EQppWQmR5A==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5", - "@babel/plugin-syntax-json-strings": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-literals": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.22.5.tgz", - "integrity": "sha512-fTLj4D79M+mepcw3dgFBTIDYpbcB9Sm0bpm4ppXPaO+U+PKFFyV9MGRvS0gvGw62sd10kT5lRMKXAADb9pWy8g==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-logical-assignment-operators": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.22.5.tgz", - "integrity": "sha512-MQQOUW1KL8X0cDWfbwYP+TbVbZm16QmQXJQ+vndPtH/BoO0lOKpVoEDMI7+PskYxH+IiE0tS8xZye0qr1lGzSA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5", - "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-member-expression-literals": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.22.5.tgz", - "integrity": "sha512-RZEdkNtzzYCFl9SE9ATaUMTj2hqMb4StarOJLrZRbqqU4HSBE7UlBw9WBWQiDzrJZJdUWiMTVDI6Gv/8DPvfew==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-modules-amd": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.22.5.tgz", - "integrity": "sha512-R+PTfLTcYEmb1+kK7FNkhQ1gP4KgjpSO6HfH9+f8/yfp2Nt3ggBjiVpRwmwTlfqZLafYKJACy36yDXlEmI9HjQ==", - "dev": true, - "dependencies": { - "@babel/helper-module-transforms": "^7.22.5", - "@babel/helper-plugin-utils": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-modules-commonjs": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.22.5.tgz", - "integrity": "sha512-B4pzOXj+ONRmuaQTg05b3y/4DuFz3WcCNAXPLb2Q0GT0TrGKGxNKV4jwsXts+StaM0LQczZbOpj8o1DLPDJIiA==", - "dev": true, - "dependencies": { - "@babel/helper-module-transforms": "^7.22.5", - "@babel/helper-plugin-utils": "^7.22.5", - "@babel/helper-simple-access": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-modules-systemjs": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.22.5.tgz", - "integrity": "sha512-emtEpoaTMsOs6Tzz+nbmcePl6AKVtS1yC4YNAeMun9U8YCsgadPNxnOPQ8GhHFB2qdx+LZu9LgoC0Lthuu05DQ==", - "dev": true, - "dependencies": { - "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-module-transforms": "^7.22.5", - "@babel/helper-plugin-utils": "^7.22.5", - "@babel/helper-validator-identifier": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-modules-umd": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.22.5.tgz", - "integrity": "sha512-+S6kzefN/E1vkSsKx8kmQuqeQsvCKCd1fraCM7zXm4SFoggI099Tr4G8U81+5gtMdUeMQ4ipdQffbKLX0/7dBQ==", - "dev": true, - "dependencies": { - "@babel/helper-module-transforms": "^7.22.5", - "@babel/helper-plugin-utils": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.22.5.tgz", - "integrity": "sha512-YgLLKmS3aUBhHaxp5hi1WJTgOUb/NCuDHzGT9z9WTt3YG+CPRhJs6nprbStx6DnWM4dh6gt7SU3sZodbZ08adQ==", - "dev": true, - "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.22.5", - "@babel/helper-plugin-utils": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/plugin-transform-new-target": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.22.5.tgz", - "integrity": "sha512-AsF7K0Fx/cNKVyk3a+DW0JLo+Ua598/NxMRvxDnkpCIGFh43+h/v2xyhRUYf6oD8gE4QtL83C7zZVghMjHd+iw==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-nullish-coalescing-operator": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.22.5.tgz", - "integrity": "sha512-6CF8g6z1dNYZ/VXok5uYkkBBICHZPiGEl7oDnAx2Mt1hlHVHOSIKWJaXHjQJA5VB43KZnXZDIexMchY4y2PGdA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-numeric-separator": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.22.5.tgz", - "integrity": "sha512-NbslED1/6M+sXiwwtcAB/nieypGw02Ejf4KtDeMkCEpP6gWFMX1wI9WKYua+4oBneCCEmulOkRpwywypVZzs/g==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5", - "@babel/plugin-syntax-numeric-separator": "^7.10.4" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-object-rest-spread": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.22.5.tgz", - "integrity": "sha512-Kk3lyDmEslH9DnvCDA1s1kkd3YWQITiBOHngOtDL9Pt6BZjzqb6hiOlb8VfjiiQJ2unmegBqZu0rx5RxJb5vmQ==", - "dev": true, - "dependencies": { - "@babel/compat-data": "^7.22.5", - "@babel/helper-compilation-targets": "^7.22.5", - "@babel/helper-plugin-utils": "^7.22.5", - "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-transform-parameters": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-object-super": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.22.5.tgz", - "integrity": "sha512-klXqyaT9trSjIUrcsYIfETAzmOEZL3cBYqOYLJxBHfMFFggmXOv+NYSX/Jbs9mzMVESw/WycLFPRx8ba/b2Ipw==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5", - "@babel/helper-replace-supers": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-optional-catch-binding": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.22.5.tgz", - "integrity": "sha512-pH8orJahy+hzZje5b8e2QIlBWQvGpelS76C63Z+jhZKsmzfNaPQ+LaW6dcJ9bxTpo1mtXbgHwy765Ro3jftmUg==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-optional-chaining": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.22.5.tgz", - "integrity": "sha512-AconbMKOMkyG+xCng2JogMCDcqW8wedQAqpVIL4cOSescZ7+iW8utC6YDZLMCSUIReEA733gzRSaOSXMAt/4WQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5", - "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", - "@babel/plugin-syntax-optional-chaining": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-parameters": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.22.5.tgz", - "integrity": "sha512-AVkFUBurORBREOmHRKo06FjHYgjrabpdqRSwq6+C7R5iTCZOsM4QbcB27St0a4U6fffyAOqh3s/qEfybAhfivg==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-private-methods": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.22.5.tgz", - "integrity": "sha512-PPjh4gyrQnGe97JTalgRGMuU4icsZFnWkzicB/fUtzlKUqvsWBKEpPPfr5a2JiyirZkHxnAqkQMO5Z5B2kK3fA==", - "dev": true, - "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.22.5", - "@babel/helper-plugin-utils": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-private-property-in-object": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.22.5.tgz", - "integrity": "sha512-/9xnaTTJcVoBtSSmrVyhtSvO3kbqS2ODoh2juEU72c3aYonNF0OMGiaz2gjukyKM2wBBYJP38S4JiE0Wfb5VMQ==", - "dev": true, - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.22.5", - "@babel/helper-create-class-features-plugin": "^7.22.5", - "@babel/helper-plugin-utils": "^7.22.5", - "@babel/plugin-syntax-private-property-in-object": "^7.14.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-property-literals": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.22.5.tgz", - "integrity": "sha512-TiOArgddK3mK/x1Qwf5hay2pxI6wCZnvQqrFSqbtg1GLl2JcNMitVH/YnqjP+M31pLUeTfzY1HAXFDnUBV30rQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-regenerator": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.22.5.tgz", - "integrity": "sha512-rR7KePOE7gfEtNTh9Qw+iO3Q/e4DEsoQ+hdvM6QUDH7JRJ5qxq5AA52ZzBWbI5i9lfNuvySgOGP8ZN7LAmaiPw==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5", - "regenerator-transform": "^0.15.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-regenerator/node_modules/regenerator-transform": { - "version": "0.15.1", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.1.tgz", - "integrity": "sha512-knzmNAcuyxV+gQCufkYcvOqX/qIIfHLv0u5x79kRxuGojfYVky1f15TzZEu2Avte8QGepvUNTnLskf8E6X6Vyg==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.8.4" - } - }, - "node_modules/@babel/plugin-transform-reserved-words": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.22.5.tgz", - "integrity": "sha512-DTtGKFRQUDm8svigJzZHzb/2xatPc6TzNvAIJ5GqOKDsGFYgAskjRulbR/vGsPKq3OPqtexnz327qYpP57RFyA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-runtime": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.22.5.tgz", - "integrity": "sha512-bg4Wxd1FWeFx3daHFTWk1pkSWK/AyQuiyAoeZAOkAOUBjnZPH6KT7eMxouV47tQ6hl6ax2zyAWBdWZXbrvXlaw==", - "dev": true, - "dependencies": { - "@babel/helper-module-imports": "^7.22.5", - "@babel/helper-plugin-utils": "^7.22.5", - "babel-plugin-polyfill-corejs2": "^0.4.3", - "babel-plugin-polyfill-corejs3": "^0.8.1", - "babel-plugin-polyfill-regenerator": "^0.5.0", - "semver": "^6.3.0" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-runtime/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/@babel/plugin-transform-shorthand-properties": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.22.5.tgz", - "integrity": "sha512-vM4fq9IXHscXVKzDv5itkO1X52SmdFBFcMIBZ2FRn2nqVYqw6dBexUgMvAjHW+KXpPPViD/Yo3GrDEBaRC0QYA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-spread": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.22.5.tgz", - "integrity": "sha512-5ZzDQIGyvN4w8+dMmpohL6MBo+l2G7tfC/O2Dg7/hjpgeWvUx8FzfeOKxGog9IimPa4YekaQ9PlDqTLOljkcxg==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5", - "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-sticky-regex": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.22.5.tgz", - "integrity": "sha512-zf7LuNpHG0iEeiyCNwX4j3gDg1jgt1k3ZdXBKbZSoA3BbGQGvMiSvfbZRR3Dr3aeJe3ooWFZxOOG3IRStYp2Bw==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-template-literals": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.22.5.tgz", - "integrity": "sha512-5ciOehRNf+EyUeewo8NkbQiUs4d6ZxiHo6BcBcnFlgiJfu16q0bQUw9Jvo0b0gBKFG1SMhDSjeKXSYuJLeFSMA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-typeof-symbol": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.22.5.tgz", - "integrity": "sha512-bYkI5lMzL4kPii4HHEEChkD0rkc+nvnlR6+o/qdqR6zrm0Sv/nodmyLhlq2DO0YKLUNd2VePmPRjJXSBh9OIdA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-unicode-escapes": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.22.5.tgz", - "integrity": "sha512-biEmVg1IYB/raUO5wT1tgfacCef15Fbzhkx493D3urBI++6hpJ+RFG4SrWMn0NEZLfvilqKf3QDrRVZHo08FYg==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-unicode-property-regex": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.22.5.tgz", - "integrity": "sha512-HCCIb+CbJIAE6sXn5CjFQXMwkCClcOfPCzTlilJ8cUatfzwHlWQkbtV0zD338u9dZskwvuOYTuuaMaA8J5EI5A==", - "dev": true, - "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.22.5", - "@babel/helper-plugin-utils": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-unicode-regex": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.22.5.tgz", - "integrity": "sha512-028laaOKptN5vHJf9/Arr/HiJekMd41hOEZYvNsrsXqJ7YPYuX2bQxh31fkZzGmq3YqHRJzYFFAVYvKfMPKqyg==", - "dev": true, - "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.22.5", - "@babel/helper-plugin-utils": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-transform-unicode-sets-regex": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.22.5.tgz", - "integrity": "sha512-lhMfi4FC15j13eKrh3DnYHjpGj6UKQHtNKTbtc1igvAhRy4+kLhV07OpLcsN0VgDEw/MjAvJO4BdMJsHwMhzCg==", - "dev": true, - "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.22.5", - "@babel/helper-plugin-utils": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/@babel/preset-env": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.22.5.tgz", - "integrity": "sha512-fj06hw89dpiZzGZtxn+QybifF07nNiZjZ7sazs2aVDcysAZVGjW7+7iFYxg6GLNM47R/thYfLdrXc+2f11Vi9A==", - "dev": true, - "dependencies": { - "@babel/compat-data": "^7.22.5", - "@babel/helper-compilation-targets": "^7.22.5", - "@babel/helper-plugin-utils": "^7.22.5", - "@babel/helper-validator-option": "^7.22.5", - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.22.5", - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.22.5", - "@babel/plugin-proposal-private-property-in-object": "7.21.0-placeholder-for-preset-env.2", - "@babel/plugin-syntax-async-generators": "^7.8.4", - "@babel/plugin-syntax-class-properties": "^7.12.13", - "@babel/plugin-syntax-class-static-block": "^7.14.5", - "@babel/plugin-syntax-dynamic-import": "^7.8.3", - "@babel/plugin-syntax-export-namespace-from": "^7.8.3", - "@babel/plugin-syntax-import-assertions": "^7.22.5", - "@babel/plugin-syntax-import-attributes": "^7.22.5", - "@babel/plugin-syntax-import-meta": "^7.10.4", - "@babel/plugin-syntax-json-strings": "^7.8.3", - "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", - "@babel/plugin-syntax-numeric-separator": "^7.10.4", - "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", - "@babel/plugin-syntax-optional-chaining": "^7.8.3", - "@babel/plugin-syntax-private-property-in-object": "^7.14.5", - "@babel/plugin-syntax-top-level-await": "^7.14.5", - "@babel/plugin-syntax-unicode-sets-regex": "^7.18.6", - "@babel/plugin-transform-arrow-functions": "^7.22.5", - "@babel/plugin-transform-async-generator-functions": "^7.22.5", - "@babel/plugin-transform-async-to-generator": "^7.22.5", - "@babel/plugin-transform-block-scoped-functions": "^7.22.5", - "@babel/plugin-transform-block-scoping": "^7.22.5", - "@babel/plugin-transform-class-properties": "^7.22.5", - "@babel/plugin-transform-class-static-block": "^7.22.5", - "@babel/plugin-transform-classes": "^7.22.5", - "@babel/plugin-transform-computed-properties": "^7.22.5", - "@babel/plugin-transform-destructuring": "^7.22.5", - "@babel/plugin-transform-dotall-regex": "^7.22.5", - "@babel/plugin-transform-duplicate-keys": "^7.22.5", - "@babel/plugin-transform-dynamic-import": "^7.22.5", - "@babel/plugin-transform-exponentiation-operator": "^7.22.5", - "@babel/plugin-transform-export-namespace-from": "^7.22.5", - "@babel/plugin-transform-for-of": "^7.22.5", - "@babel/plugin-transform-function-name": "^7.22.5", - "@babel/plugin-transform-json-strings": "^7.22.5", - "@babel/plugin-transform-literals": "^7.22.5", - "@babel/plugin-transform-logical-assignment-operators": "^7.22.5", - "@babel/plugin-transform-member-expression-literals": "^7.22.5", - "@babel/plugin-transform-modules-amd": "^7.22.5", - "@babel/plugin-transform-modules-commonjs": "^7.22.5", - "@babel/plugin-transform-modules-systemjs": "^7.22.5", - "@babel/plugin-transform-modules-umd": "^7.22.5", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.22.5", - "@babel/plugin-transform-new-target": "^7.22.5", - "@babel/plugin-transform-nullish-coalescing-operator": "^7.22.5", - "@babel/plugin-transform-numeric-separator": "^7.22.5", - "@babel/plugin-transform-object-rest-spread": "^7.22.5", - "@babel/plugin-transform-object-super": "^7.22.5", - "@babel/plugin-transform-optional-catch-binding": "^7.22.5", - "@babel/plugin-transform-optional-chaining": "^7.22.5", - "@babel/plugin-transform-parameters": "^7.22.5", - "@babel/plugin-transform-private-methods": "^7.22.5", - "@babel/plugin-transform-private-property-in-object": "^7.22.5", - "@babel/plugin-transform-property-literals": "^7.22.5", - "@babel/plugin-transform-regenerator": "^7.22.5", - "@babel/plugin-transform-reserved-words": "^7.22.5", - "@babel/plugin-transform-shorthand-properties": "^7.22.5", - "@babel/plugin-transform-spread": "^7.22.5", - "@babel/plugin-transform-sticky-regex": "^7.22.5", - "@babel/plugin-transform-template-literals": "^7.22.5", - "@babel/plugin-transform-typeof-symbol": "^7.22.5", - "@babel/plugin-transform-unicode-escapes": "^7.22.5", - "@babel/plugin-transform-unicode-property-regex": "^7.22.5", - "@babel/plugin-transform-unicode-regex": "^7.22.5", - "@babel/plugin-transform-unicode-sets-regex": "^7.22.5", - "@babel/preset-modules": "^0.1.5", - "@babel/types": "^7.22.5", - "babel-plugin-polyfill-corejs2": "^0.4.3", - "babel-plugin-polyfill-corejs3": "^0.8.1", - "babel-plugin-polyfill-regenerator": "^0.5.0", - "core-js-compat": "^3.30.2", - "semver": "^6.3.0" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/preset-env/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/@babel/preset-modules": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.5.tgz", - "integrity": "sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", - "@babel/plugin-transform-dotall-regex": "^7.4.4", - "@babel/types": "^7.4.4", - "esutils": "^2.0.2" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/regjsgen": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/@babel/regjsgen/-/regjsgen-0.8.0.tgz", - "integrity": "sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==", - "dev": true - }, - "node_modules/@babel/runtime": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.5.tgz", - "integrity": "sha512-ecjvYlnAaZ/KVneE/OdKYBYfgXV3Ptu6zQWmgEF7vwKhQnvVS6bjMD2XYgj+SNvQ1GfK/pjgokfPkC/2CO8CuA==", - "dependencies": { - "regenerator-runtime": "^0.13.11" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/runtime/node_modules/regenerator-runtime": { - "version": "0.13.11", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", - "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==" - }, - "node_modules/@babel/template": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.5.tgz", - "integrity": "sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.22.5", - "@babel/parser": "^7.22.5", - "@babel/types": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/traverse": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.5.tgz", - "integrity": "sha512-7DuIjPgERaNo6r+PZwItpjCZEa5vyw4eJGufeLxrPdBXBoLcCJCIasvK6pK/9DVNrLZTLFhUGqaC6X/PA007TQ==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.22.5", - "@babel/generator": "^7.22.5", - "@babel/helper-environment-visitor": "^7.22.5", - "@babel/helper-function-name": "^7.22.5", - "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.5", - "@babel/parser": "^7.22.5", - "@babel/types": "^7.22.5", - "debug": "^4.1.0", - "globals": "^11.1.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/traverse/node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/@babel/traverse/node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/traverse/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/@babel/types": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", - "dev": true, - "dependencies": { - "@babel/helper-string-parser": "^7.22.5", - "@babel/helper-validator-identifier": "^7.22.5", - "to-fast-properties": "^2.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/types/node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/@discoveryjs/json-ext": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", - "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", - "dev": true, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/@esbuild/android-arm": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.19.tgz", - "integrity": "sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/android-arm64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.19.tgz", - "integrity": "sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/android-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.19.tgz", - "integrity": "sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz", - "integrity": "sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz", - "integrity": "sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.19.tgz", - "integrity": "sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.19.tgz", - "integrity": "sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-arm": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.19.tgz", - "integrity": "sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.19.tgz", - "integrity": "sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.19.tgz", - "integrity": "sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.19.tgz", - "integrity": "sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==", - "cpu": [ - "loong64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.19.tgz", - "integrity": "sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==", - "cpu": [ - "mips64el" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.19.tgz", - "integrity": "sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.19.tgz", - "integrity": "sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==", - "cpu": [ - "riscv64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.19.tgz", - "integrity": "sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==", - "cpu": [ - "s390x" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz", - "integrity": "sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.19.tgz", - "integrity": "sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz", - "integrity": "sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.19.tgz", - "integrity": "sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.19.tgz", - "integrity": "sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.19.tgz", - "integrity": "sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-x64": { - "version": "0.17.19", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz", - "integrity": "sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@fortawesome/fontawesome-free": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-6.1.1.tgz", - "integrity": "sha512-J/3yg2AIXc9wznaVqpHVX3Wa5jwKovVF0AMYSnbmcXTiL3PpRPfF58pzWucCwEiCJBp+hCNRLWClTomD8SseKg==", - "hasInstallScript": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/@iarna/toml": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/@iarna/toml/-/toml-2.2.5.tgz", - "integrity": "sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==", - "dev": true - }, - "node_modules/@isaacs/cliui": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", - "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", - "dev": true, - "dependencies": { - "string-width": "^5.1.2", - "string-width-cjs": "npm:string-width@^4.2.0", - "strip-ansi": "^7.0.1", - "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", - "wrap-ansi": "^8.1.0", - "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true - }, - "node_modules/@isaacs/cliui/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@isaacs/cliui/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/@istanbuljs/load-nyc-config": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", - "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", - "dev": true, - "dependencies": { - "camelcase": "^5.3.1", - "find-up": "^4.1.0", - "get-package-type": "^0.1.0", - "js-yaml": "^3.13.1", - "resolve-from": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/@istanbuljs/schema": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", - "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", - "dev": true, - "dependencies": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", - "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", - "dev": true, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", - "dev": true, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/source-map": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.3.tgz", - "integrity": "sha512-b+fsZXeLYi9fEULmfBrhxn4IrPlINf8fiNarzTof004v3lFdntdwa9PF7vFJqm3mg7s+ScJMxXaE3Acp1irZcg==", - "dev": true, - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", - "dev": true - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.18", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz", - "integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==", - "dev": true, - "dependencies": { - "@jridgewell/resolve-uri": "3.1.0", - "@jridgewell/sourcemap-codec": "1.4.14" - } - }, - "node_modules/@leichtgewicht/ip-codec": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz", - "integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==", - "dev": true - }, - "node_modules/@ngtools/webpack": { - "version": "16.1.3", - "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-16.1.3.tgz", - "integrity": "sha512-YTL1RzP7ErJqskx+ZwdC/nWsOSBfC4yYWmMyWL2J0d+oJ3N2XIzrKVoDcZ4IVzv3Du+3zoGp0ups/wWXvfzM/Q==", - "dev": true, - "engines": { - "node": "^16.14.0 || >=18.10.0", - "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", - "yarn": ">= 1.13.0" - }, - "peerDependencies": { - "@angular/compiler-cli": "^16.0.0", - "typescript": ">=4.9.3 <5.2", - "webpack": "^5.54.0" - } - }, - "node_modules/@nicolo-ribaudo/chokidar-2": { - "version": "2.1.8-no-fsevents.3", - "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz", - "integrity": "sha512-s88O1aVtXftvp5bCPB7WnmXc5IwOZZ7YPuwNPt+GtOOXpPvad1LfbmjYv+qII7zP6RU2QGnqve27dnLycEnyEQ==", - "dev": true, - "optional": true - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz", - "integrity": "sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "2.0.4", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz", - "integrity": "sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz", - "integrity": "sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow==", - "dev": true, - "dependencies": { - "@nodelib/fs.scandir": "2.1.4", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@npmcli/fs": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-3.1.0.tgz", - "integrity": "sha512-7kZUAaLscfgbwBQRbvdMYaZOWyMEcPTH/tJjnyAWJ/dvvs9Ef+CERx/qJb9GExJpl1qipaDGn7KqHnFGGixd0w==", - "dev": true, - "dependencies": { - "semver": "^7.3.5" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@npmcli/fs/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@npmcli/fs/node_modules/semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@npmcli/fs/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, - "node_modules/@npmcli/git": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-4.1.0.tgz", - "integrity": "sha512-9hwoB3gStVfa0N31ymBmrX+GuDGdVA/QWShZVqE0HK2Af+7QGGrCTbZia/SW0ImUTjTne7SP91qxDmtXvDHRPQ==", - "dev": true, - "dependencies": { - "@npmcli/promise-spawn": "^6.0.0", - "lru-cache": "^7.4.4", - "npm-pick-manifest": "^8.0.0", - "proc-log": "^3.0.0", - "promise-inflight": "^1.0.1", - "promise-retry": "^2.0.1", - "semver": "^7.3.5", - "which": "^3.0.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@npmcli/git/node_modules/lru-cache": { - "version": "7.18.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", - "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/@npmcli/git/node_modules/semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@npmcli/git/node_modules/semver/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@npmcli/git/node_modules/which": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/which/-/which-3.0.1.tgz", - "integrity": "sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/which.js" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@npmcli/git/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, - "node_modules/@npmcli/installed-package-contents": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@npmcli/installed-package-contents/-/installed-package-contents-2.0.2.tgz", - "integrity": "sha512-xACzLPhnfD51GKvTOOuNX2/V4G4mz9/1I2MfDoye9kBM3RYe5g2YbscsaGoTlaWqkxeiapBWyseULVKpSVHtKQ==", - "dev": true, - "dependencies": { - "npm-bundled": "^3.0.0", - "npm-normalize-package-bin": "^3.0.0" - }, - "bin": { - "installed-package-contents": "lib/index.js" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@npmcli/node-gyp": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@npmcli/node-gyp/-/node-gyp-3.0.0.tgz", - "integrity": "sha512-gp8pRXC2oOxu0DUE1/M3bYtb1b3/DbJ5aM113+XJBgfXdussRAsX0YOrOhdd8WvnAR6auDBvJomGAkLKA5ydxA==", - "dev": true, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@npmcli/promise-spawn": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-6.0.2.tgz", - "integrity": "sha512-gGq0NJkIGSwdbUt4yhdF8ZrmkGKVz9vAdVzpOfnom+V8PLSmSOVhZwbNvZZS1EYcJN5hzzKBxmmVVAInM6HQLg==", - "dev": true, - "dependencies": { - "which": "^3.0.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@npmcli/promise-spawn/node_modules/which": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/which/-/which-3.0.1.tgz", - "integrity": "sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/which.js" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@npmcli/run-script": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-6.0.2.tgz", - "integrity": "sha512-NCcr1uQo1k5U+SYlnIrbAh3cxy+OQT1VtqiAbxdymSlptbzBb62AjH2xXgjNCoP073hoa1CfCAcwoZ8k96C4nA==", - "dev": true, - "dependencies": { - "@npmcli/node-gyp": "^3.0.0", - "@npmcli/promise-spawn": "^6.0.0", - "node-gyp": "^9.0.0", - "read-package-json-fast": "^3.0.0", - "which": "^3.0.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@npmcli/run-script/node_modules/which": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/which/-/which-3.0.1.tgz", - "integrity": "sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/which.js" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@octokit/auth-token": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-3.0.1.tgz", - "integrity": "sha512-/USkK4cioY209wXRpund6HZzHo9GmjakpV9ycOkpMcMxMk7QVcVFVyCMtzvXYiHsB2crgDgrtNYSELYFBXhhaA==", - "dev": true, - "dependencies": { - "@octokit/types": "^7.0.0" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/@octokit/core": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/@octokit/core/-/core-4.0.5.tgz", - "integrity": "sha512-4R3HeHTYVHCfzSAi0C6pbGXV8UDI5Rk+k3G7kLVNckswN9mvpOzW9oENfjfH3nEmzg8y3AmKmzs8Sg6pLCeOCA==", - "dev": true, - "dependencies": { - "@octokit/auth-token": "^3.0.0", - "@octokit/graphql": "^5.0.0", - "@octokit/request": "^6.0.0", - "@octokit/request-error": "^3.0.0", - "@octokit/types": "^7.0.0", - "before-after-hook": "^2.2.0", - "universal-user-agent": "^6.0.0" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/@octokit/endpoint": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-7.0.2.tgz", - "integrity": "sha512-8/AUACfE9vpRpehE6ZLfEtzkibe5nfsSwFZVMsG8qabqRt1M81qZYUFRZa1B8w8lP6cdfDJfRq9HWS+MbmR7tw==", - "dev": true, - "dependencies": { - "@octokit/types": "^7.0.0", - "is-plain-object": "^5.0.0", - "universal-user-agent": "^6.0.0" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/@octokit/endpoint/node_modules/is-plain-object": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", - "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/@octokit/graphql": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-5.0.1.tgz", - "integrity": "sha512-sxmnewSwAixkP1TrLdE6yRG53eEhHhDTYUykUwdV9x8f91WcbhunIHk9x1PZLALdBZKRPUO2HRcm4kezZ79HoA==", - "dev": true, - "dependencies": { - "@octokit/request": "^6.0.0", - "@octokit/types": "^7.0.0", - "universal-user-agent": "^6.0.0" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/@octokit/openapi-types": { - "version": "13.9.1", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-13.9.1.tgz", - "integrity": "sha512-98zOxAAR8MDHjXI2xGKgn/qkZLwfcNjHka0baniuEpN1fCv3kDJeh5qc0mBwim5y31eaPaYer9QikzwOkQq3wQ==", - "dev": true - }, - "node_modules/@octokit/plugin-paginate-rest": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-4.2.3.tgz", - "integrity": "sha512-1RXJZ7hnxSANMtxKSVIEByjhYqqlu2GaKmLJJE/OVDya1aI++hdmXP4ORCUlsN2rt4hJzRYbWizBHlGYKz3dhQ==", - "dev": true, - "dependencies": { - "@octokit/types": "^7.3.1" - }, - "engines": { - "node": ">= 14" - }, - "peerDependencies": { - "@octokit/core": ">=4" - } - }, - "node_modules/@octokit/plugin-request-log": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz", - "integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==", - "dev": true, - "peerDependencies": { - "@octokit/core": ">=3" - } - }, - "node_modules/@octokit/plugin-rest-endpoint-methods": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-6.5.2.tgz", - "integrity": "sha512-zUscUePMC3KEKyTAfuG/dA6hw4Yn7CncVJs2kM9xc4931Iqk3ZiwHfVwTUnxkqQJIVgeBRYUk3rM4hMfgASUxg==", - "dev": true, - "dependencies": { - "@octokit/types": "^7.3.1", - "deprecation": "^2.3.1" - }, - "engines": { - "node": ">= 14" - }, - "peerDependencies": { - "@octokit/core": ">=3" - } - }, - "node_modules/@octokit/request": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-6.2.1.tgz", - "integrity": "sha512-gYKRCia3cpajRzDSU+3pt1q2OcuC6PK8PmFIyxZDWCzRXRSIBH8jXjFJ8ZceoygBIm0KsEUg4x1+XcYBz7dHPQ==", - "dev": true, - "dependencies": { - "@octokit/endpoint": "^7.0.0", - "@octokit/request-error": "^3.0.0", - "@octokit/types": "^7.0.0", - "is-plain-object": "^5.0.0", - "node-fetch": "^2.6.7", - "universal-user-agent": "^6.0.0" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/@octokit/request-error": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-3.0.1.tgz", - "integrity": "sha512-ym4Bp0HTP7F3VFssV88WD1ZyCIRoE8H35pXSKwLeMizcdZAYc/t6N9X9Yr9n6t3aG9IH75XDnZ6UeZph0vHMWQ==", - "dev": true, - "dependencies": { - "@octokit/types": "^7.0.0", - "deprecation": "^2.0.0", - "once": "^1.4.0" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/@octokit/request/node_modules/is-plain-object": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", - "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/@octokit/request/node_modules/node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "dev": true, - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/@octokit/rest": { - "version": "19.0.4", - "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-19.0.4.tgz", - "integrity": "sha512-LwG668+6lE8zlSYOfwPj4FxWdv/qFXYBpv79TWIQEpBLKA9D/IMcWsF/U9RGpA3YqMVDiTxpgVpEW3zTFfPFTA==", - "dev": true, - "dependencies": { - "@octokit/core": "^4.0.0", - "@octokit/plugin-paginate-rest": "^4.0.0", - "@octokit/plugin-request-log": "^1.0.4", - "@octokit/plugin-rest-endpoint-methods": "^6.0.0" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/@octokit/types": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-7.3.1.tgz", - "integrity": "sha512-Vefohn8pHGFYWbSc6du0wXMK/Pmy6h0H4lttBw5WqquEuxjdXwyYX07CeZpJDkzSzpdKxBoWRNuDJGTE+FvtqA==", - "dev": true, - "dependencies": { - "@octokit/openapi-types": "^13.9.1" - } - }, - "node_modules/@pkgjs/parseargs": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", - "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", - "dev": true, - "optional": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/@pnpm/network.ca-file": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@pnpm/network.ca-file/-/network.ca-file-1.0.1.tgz", - "integrity": "sha512-gkINruT2KUhZLTaiHxwCOh1O4NVnFT0wLjWFBHmTz9vpKag/C/noIMJXBxFe4F0mYpUVX2puLwAieLYFg2NvoA==", - "dev": true, - "dependencies": { - "graceful-fs": "4.2.10" - }, - "engines": { - "node": ">=12.22.0" - } - }, - "node_modules/@pnpm/network.ca-file/node_modules/graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", - "dev": true - }, - "node_modules/@pnpm/npm-conf": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@pnpm/npm-conf/-/npm-conf-1.0.5.tgz", - "integrity": "sha512-hD8ml183638O3R6/Txrh0L8VzGOrFXgRtRDG4qQC4tONdZ5Z1M+tlUUDUvrjYdmK6G+JTBTeaCLMna11cXzi8A==", - "dev": true, - "dependencies": { - "@pnpm/network.ca-file": "^1.0.1", - "config-chain": "^1.1.11" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@release-it/keep-a-changelog": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@release-it/keep-a-changelog/-/keep-a-changelog-3.1.0.tgz", - "integrity": "sha512-o8lxZCAFwFkFpo88aIIgS5dR3kDy6yLjJVpe9QAGNY6tpKMMRHxsiJ8MS5NvrEeIC2VTzOoOjN/CDvdd3a4+/A==", - "dev": true, - "dependencies": { - "detect-newline": "^4.0.0", - "string-template": "^1.0.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "release-it": "^15.0.0-esm.4" - } - }, - "node_modules/@release-it/keep-a-changelog/node_modules/string-template": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/string-template/-/string-template-1.0.0.tgz", - "integrity": "sha512-SLqR3GBUXuoPP5MmYtD7ompvXiG87QjT6lzOszyXjTM86Uu7At7vNnt2xgyTLq5o9T4IxTYFyGxcULqpsmsfdg==", - "dev": true - }, - "node_modules/@schematics/angular": { - "version": "16.1.3", - "resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-16.1.3.tgz", - "integrity": "sha512-bNSxCLf6f+/dsQ1k3PhcZhrC/qgJSCpM6h3m6ATpjR+tYW/v7WR1OyE5r3DQmDe7NJSazBvpbrRtg8xjRsMzvw==", - "dev": true, - "dependencies": { - "@angular-devkit/core": "16.1.3", - "@angular-devkit/schematics": "16.1.3", - "jsonc-parser": "3.2.0" - }, - "engines": { - "node": "^16.14.0 || >=18.10.0", - "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", - "yarn": ">= 1.13.0" - } - }, - "node_modules/@sigstore/protobuf-specs": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@sigstore/protobuf-specs/-/protobuf-specs-0.1.0.tgz", - "integrity": "sha512-a31EnjuIDSX8IXBUib3cYLDRlPMU36AWX4xS8ysLaNu4ZzUesDiPt83pgrW2X1YLMe5L2HbDyaKK5BrL4cNKaQ==", - "dev": true, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@sigstore/tuf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@sigstore/tuf/-/tuf-1.0.2.tgz", - "integrity": "sha512-vjwcYePJzM01Ha6oWWZ9gNcdIgnzyFxfqfWzph483DPJTH8Tb7f7bQRRll3CYVkyH56j0AgcPAcl6Vg95DPF+Q==", - "dev": true, - "dependencies": { - "@sigstore/protobuf-specs": "^0.1.0", - "tuf-js": "^1.1.7" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@sindresorhus/is": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.3.0.tgz", - "integrity": "sha512-CX6t4SYQ37lzxicAqsBtxA3OseeoVrh9cSJ5PFYam0GksYlupRfy1A+Q4aYD3zvcfECLc0zO2u+ZnR2UYKvCrw==", - "dev": true, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sindresorhus/is?sponsor=1" - } - }, - "node_modules/@szmarczak/http-timer": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", - "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", - "dev": true, - "dependencies": { - "defer-to-connect": "^2.0.1" - }, - "engines": { - "node": ">=14.16" - } - }, - "node_modules/@tootallnate/once": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", - "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", - "dev": true, - "engines": { - "node": ">= 6" - } - }, - "node_modules/@tufjs/canonical-json": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@tufjs/canonical-json/-/canonical-json-1.0.0.tgz", - "integrity": "sha512-QTnf++uxunWvG2z3UFNzAoQPHxnSXOwtaI3iJ+AohhV+5vONuArPjJE7aPXPVXfXJsqrVbZBu9b81AJoSd09IQ==", - "dev": true, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@tufjs/models": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@tufjs/models/-/models-1.0.4.tgz", - "integrity": "sha512-qaGV9ltJP0EO25YfFUPhxRVK0evXFIAGicsVXuRim4Ed9cjPxYhNnNJ49SFmbeLgtxpslIkX317IgpfcHPVj/A==", - "dev": true, - "dependencies": { - "@tufjs/canonical-json": "1.0.0", - "minimatch": "^9.0.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@tufjs/models/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/@tufjs/models/node_modules/minimatch": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.2.tgz", - "integrity": "sha512-PZOT9g5v2ojiTL7r1xF6plNHLtOeTpSlDI007As2NlA2aYBMfVom17yqa6QzhmDP8QOhn7LjHTg7DFCVSSa6yg==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@turf/along": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/along/-/along-6.5.0.tgz", - "integrity": "sha512-LLyWQ0AARqJCmMcIEAXF4GEu8usmd4Kbz3qk1Oy5HoRNpZX47+i5exQtmIWKdqJ1MMhW26fCTXgpsEs5zgJ5gw==", - "dependencies": { - "@turf/bearing": "^6.5.0", - "@turf/destination": "^6.5.0", - "@turf/distance": "^6.5.0", - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/along/node_modules/@turf/distance": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/distance/-/distance-6.5.0.tgz", - "integrity": "sha512-xzykSLfoURec5qvQJcfifw/1mJa+5UwByZZ5TZ8iaqjGYN0vomhV9aiSLeYdUGtYRESZ+DYC/OzY+4RclZYgMg==", - "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/along/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/along/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/angle": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/angle/-/angle-6.5.0.tgz", - "integrity": "sha512-4pXMbWhFofJJAOvTMCns6N4C8CMd5Ih4O2jSAG9b3dDHakj3O4yN1+Zbm+NUei+eVEZ9gFeVp9svE3aMDenIkw==", - "dependencies": { - "@turf/bearing": "^6.5.0", - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0", - "@turf/rhumb-bearing": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/angle/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/angle/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/area": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@turf/area/-/area-5.1.5.tgz", - "integrity": "sha1-79iZv9Jgzb0VQbKjwVX4pdLu+h0=", - "dependencies": { - "@turf/helpers": "^5.1.5", - "@turf/meta": "^5.1.5" - } - }, - "node_modules/@turf/area/node_modules/@turf/meta": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/@turf/meta/-/meta-5.2.0.tgz", - "integrity": "sha1-OxrUhe4MOwsXdRMqMsOE1T5LpT0=", - "dependencies": { - "@turf/helpers": "^5.1.5" - } - }, - "node_modules/@turf/bbox": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/bbox/-/bbox-6.5.0.tgz", - "integrity": "sha512-RBbLaao5hXTYyyg577iuMtDB8ehxMlUqHEJiMs8jT1GHkFhr6sYre3lmLsPeYEi/ZKj5TP5tt7fkzNdJ4GIVyw==", - "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/meta": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/bbox-clip": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/bbox-clip/-/bbox-clip-6.5.0.tgz", - "integrity": "sha512-F6PaIRF8WMp8EmgU/Ke5B1Y6/pia14UAYB5TiBC668w5rVVjy5L8rTm/m2lEkkDMHlzoP9vNY4pxpNthE7rLcQ==", - "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/bbox-clip/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/bbox-clip/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/bbox-polygon": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/bbox-polygon/-/bbox-polygon-6.5.0.tgz", - "integrity": "sha512-+/r0NyL1lOG3zKZmmf6L8ommU07HliP4dgYToMoTxqzsWzyLjaj/OzgQ8rBmv703WJX+aS6yCmLuIhYqyufyuw==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/bbox-polygon/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/bbox/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/bearing": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/bearing/-/bearing-6.5.0.tgz", - "integrity": "sha512-dxINYhIEMzgDOztyMZc20I7ssYVNEpSv04VbMo5YPQsqa80KO3TFvbuCahMsCAW5z8Tncc8dwBlEFrmRjJG33A==", - "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/bearing/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/bearing/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/bezier-spline": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/bezier-spline/-/bezier-spline-6.5.0.tgz", - "integrity": "sha512-vokPaurTd4PF96rRgGVm6zYYC5r1u98ZsG+wZEv9y3kJTuJRX/O3xIY2QnTGTdbVmAJN1ouOsD0RoZYaVoXORQ==", - "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/bezier-spline/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/bezier-spline/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/boolean-clockwise": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/boolean-clockwise/-/boolean-clockwise-6.5.0.tgz", - "integrity": "sha512-45+C7LC5RMbRWrxh3Z0Eihsc8db1VGBO5d9BLTOAwU4jR6SgsunTfRWR16X7JUwIDYlCVEmnjcXJNi/kIU3VIw==", - "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/boolean-clockwise/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/boolean-clockwise/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/boolean-contains": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/boolean-contains/-/boolean-contains-6.5.0.tgz", - "integrity": "sha512-4m8cJpbw+YQcKVGi8y0cHhBUnYT+QRfx6wzM4GI1IdtYH3p4oh/DOBJKrepQyiDzFDaNIjxuWXBh0ai1zVwOQQ==", - "dependencies": { - "@turf/bbox": "^6.5.0", - "@turf/boolean-point-in-polygon": "^6.5.0", - "@turf/boolean-point-on-line": "^6.5.0", - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/boolean-contains/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/boolean-contains/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/boolean-crosses": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/boolean-crosses/-/boolean-crosses-6.5.0.tgz", - "integrity": "sha512-gvshbTPhAHporTlQwBJqyfW+2yV8q/mOTxG6PzRVl6ARsqNoqYQWkd4MLug7OmAqVyBzLK3201uAeBjxbGw0Ng==", - "dependencies": { - "@turf/boolean-point-in-polygon": "^6.5.0", - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0", - "@turf/line-intersect": "^6.5.0", - "@turf/polygon-to-line": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/boolean-crosses/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/boolean-crosses/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/boolean-disjoint": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/boolean-disjoint/-/boolean-disjoint-6.5.0.tgz", - "integrity": "sha512-rZ2ozlrRLIAGo2bjQ/ZUu4oZ/+ZjGvLkN5CKXSKBcu6xFO6k2bgqeM8a1836tAW+Pqp/ZFsTA5fZHsJZvP2D5g==", - "dependencies": { - "@turf/boolean-point-in-polygon": "^6.5.0", - "@turf/helpers": "^6.5.0", - "@turf/line-intersect": "^6.5.0", - "@turf/meta": "^6.5.0", - "@turf/polygon-to-line": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/boolean-disjoint/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/boolean-equal": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/boolean-equal/-/boolean-equal-6.5.0.tgz", - "integrity": "sha512-cY0M3yoLC26mhAnjv1gyYNQjn7wxIXmL2hBmI/qs8g5uKuC2hRWi13ydufE3k4x0aNRjFGlg41fjoYLwaVF+9Q==", - "dependencies": { - "@turf/clean-coords": "^6.5.0", - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0", - "geojson-equality": "0.1.6" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/boolean-equal/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/boolean-equal/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/boolean-intersects": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/boolean-intersects/-/boolean-intersects-6.5.0.tgz", - "integrity": "sha512-nIxkizjRdjKCYFQMnml6cjPsDOBCThrt+nkqtSEcxkKMhAQj5OO7o2CecioNTaX8EayqwMGVKcsz27oP4mKPTw==", - "dependencies": { - "@turf/boolean-disjoint": "^6.5.0", - "@turf/helpers": "^6.5.0", - "@turf/meta": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/boolean-intersects/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/boolean-overlap": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/boolean-overlap/-/boolean-overlap-6.5.0.tgz", - "integrity": "sha512-8btMIdnbXVWUa1M7D4shyaSGxLRw6NjMcqKBcsTXcZdnaixl22k7ar7BvIzkaRYN3SFECk9VGXfLncNS3ckQUw==", - "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0", - "@turf/line-intersect": "^6.5.0", - "@turf/line-overlap": "^6.5.0", - "@turf/meta": "^6.5.0", - "geojson-equality": "0.1.6" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/boolean-overlap/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/boolean-overlap/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/boolean-parallel": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/boolean-parallel/-/boolean-parallel-6.5.0.tgz", - "integrity": "sha512-aSHJsr1nq9e5TthZGZ9CZYeXklJyRgR5kCLm5X4urz7+MotMOp/LsGOsvKvK9NeUl9+8OUmfMn8EFTT8LkcvIQ==", - "dependencies": { - "@turf/clean-coords": "^6.5.0", - "@turf/helpers": "^6.5.0", - "@turf/line-segment": "^6.5.0", - "@turf/rhumb-bearing": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/boolean-parallel/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/boolean-point-in-polygon": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/boolean-point-in-polygon/-/boolean-point-in-polygon-6.5.0.tgz", - "integrity": "sha512-DtSuVFB26SI+hj0SjrvXowGTUCHlgevPAIsukssW6BG5MlNSBQAo70wpICBNJL6RjukXg8d2eXaAWuD/CqL00A==", - "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/boolean-point-in-polygon/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/boolean-point-in-polygon/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/boolean-point-on-line": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/boolean-point-on-line/-/boolean-point-on-line-6.5.0.tgz", - "integrity": "sha512-A1BbuQ0LceLHvq7F/P7w3QvfpmZqbmViIUPHdNLvZimFNLo4e6IQunmzbe+8aSStH9QRZm3VOflyvNeXvvpZEQ==", - "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/boolean-point-on-line/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/boolean-point-on-line/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/boolean-within": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/boolean-within/-/boolean-within-6.5.0.tgz", - "integrity": "sha512-YQB3oU18Inx35C/LU930D36RAVe7LDXk1kWsQ8mLmuqYn9YdPsDQTMTkLJMhoQ8EbN7QTdy333xRQ4MYgToteQ==", - "dependencies": { - "@turf/bbox": "^6.5.0", - "@turf/boolean-point-in-polygon": "^6.5.0", - "@turf/boolean-point-on-line": "^6.5.0", - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/boolean-within/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/boolean-within/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/buffer": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/buffer/-/buffer-6.5.0.tgz", - "integrity": "sha512-qeX4N6+PPWbKqp1AVkBVWFerGjMYMUyencwfnkCesoznU6qvfugFHNAngNqIBVnJjZ5n8IFyOf+akcxnrt9sNg==", - "dependencies": { - "@turf/bbox": "^6.5.0", - "@turf/center": "^6.5.0", - "@turf/helpers": "^6.5.0", - "@turf/meta": "^6.5.0", - "@turf/projection": "^6.5.0", - "d3-geo": "1.7.1", - "turf-jsts": "*" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/buffer/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/center": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/center/-/center-6.5.0.tgz", - "integrity": "sha512-T8KtMTfSATWcAX088rEDKjyvQCBkUsLnK/Txb6/8WUXIeOZyHu42G7MkdkHRoHtwieLdduDdmPLFyTdG5/e7ZQ==", - "dependencies": { - "@turf/bbox": "^6.5.0", - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/center-mean": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/center-mean/-/center-mean-6.5.0.tgz", - "integrity": "sha512-AAX6f4bVn12pTVrMUiB9KrnV94BgeBKpyg3YpfnEbBpkN/znfVhL8dG8IxMAxAoSZ61Zt9WLY34HfENveuOZ7Q==", - "dependencies": { - "@turf/bbox": "^6.5.0", - "@turf/helpers": "^6.5.0", - "@turf/meta": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/center-mean/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/center-median": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/center-median/-/center-median-6.5.0.tgz", - "integrity": "sha512-dT8Ndu5CiZkPrj15PBvslpuf01ky41DEYEPxS01LOxp5HOUHXp1oJxsPxvc+i/wK4BwccPNzU1vzJ0S4emd1KQ==", - "dependencies": { - "@turf/center-mean": "^6.5.0", - "@turf/centroid": "^6.5.0", - "@turf/distance": "^6.5.0", - "@turf/helpers": "^6.5.0", - "@turf/meta": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/center-median/node_modules/@turf/distance": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/distance/-/distance-6.5.0.tgz", - "integrity": "sha512-xzykSLfoURec5qvQJcfifw/1mJa+5UwByZZ5TZ8iaqjGYN0vomhV9aiSLeYdUGtYRESZ+DYC/OzY+4RclZYgMg==", - "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/center-median/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/center-median/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/center-of-mass": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/center-of-mass/-/center-of-mass-6.5.0.tgz", - "integrity": "sha512-EWrriU6LraOfPN7m1jZi+1NLTKNkuIsGLZc2+Y8zbGruvUW+QV7K0nhf7iZWutlxHXTBqEXHbKue/o79IumAsQ==", - "dependencies": { - "@turf/centroid": "^6.5.0", - "@turf/convex": "^6.5.0", - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0", - "@turf/meta": "^6.5.0" + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" }, "funding": { - "url": "https://opencollective.com/turf" + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, - "node_modules/@turf/center-of-mass/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", + "node_modules/@isaacs/cliui/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, "funding": { - "url": "https://opencollective.com/turf" + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/@turf/center-of-mass/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, "dependencies": { - "@turf/helpers": "^6.5.0" + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" }, "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/center/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@turf/centroid": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/centroid/-/centroid-6.5.0.tgz", - "integrity": "sha512-MwE1oq5E3isewPprEClbfU5pXljIK/GUOMbn22UM3IFPDJX0KeoyLNwghszkdmFp/qMGL/M13MMWvU+GNLXP/A==", + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/meta": "^6.5.0" + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" }, "funding": { - "url": "https://opencollective.com/turf" + "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, - "node_modules/@turf/centroid/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, "funding": { - "url": "https://opencollective.com/turf" + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/@turf/circle": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/circle/-/circle-6.5.0.tgz", - "integrity": "sha512-oU1+Kq9DgRnoSbWFHKnnUdTmtcRUMmHoV9DjTXu9vOLNV5OWtAAh1VZ+mzsioGGzoDNT/V5igbFOkMfBQc0B6A==", + "node_modules/@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, "dependencies": { - "@turf/destination": "^6.5.0", - "@turf/helpers": "^6.5.0" + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" }, - "funding": { - "url": "https://opencollective.com/turf" + "engines": { + "node": ">=8" } }, - "node_modules/@turf/circle/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "engines": { + "node": ">=8" } }, - "node_modules/@turf/clean-coords": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/clean-coords/-/clean-coords-6.5.0.tgz", - "integrity": "sha512-EMX7gyZz0WTH/ET7xV8MyrExywfm9qUi0/MY89yNffzGIEHuFfqwhcCqZ8O00rZIPZHUTxpmsxQSTfzJJA1CPw==", + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" }, - "funding": { - "url": "https://opencollective.com/turf" + "engines": { + "node": ">=6.0.0" } }, - "node_modules/@turf/clean-coords/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", + "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "engines": { + "node": ">=6.0.0" } }, - "node_modules/@turf/clean-coords/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "engines": { + "node": ">=6.0.0" } }, - "node_modules/@turf/clone": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/clone/-/clone-6.5.0.tgz", - "integrity": "sha512-mzVtTFj/QycXOn6ig+annKrM6ZlimreKYz6f/GSERytOpgzodbQyOgkfwru100O1KQhhjSudKK4DsQ0oyi9cTw==", + "node_modules/@jridgewell/source-map": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.5.tgz", + "integrity": "sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==", + "dev": true, "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" } }, - "node_modules/@turf/clone/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" }, - "node_modules/@turf/clusters": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/clusters/-/clusters-6.5.0.tgz", - "integrity": "sha512-Y6gfnTJzQ1hdLfCsyd5zApNbfLIxYEpmDibHUqR5z03Lpe02pa78JtgrgUNt1seeO/aJ4TG1NLN8V5gOrHk04g==", + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.18", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz", + "integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==", "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/meta": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" + "@jridgewell/resolve-uri": "3.1.0", + "@jridgewell/sourcemap-codec": "1.4.14" } }, - "node_modules/@turf/clusters-dbscan": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/clusters-dbscan/-/clusters-dbscan-6.5.0.tgz", - "integrity": "sha512-SxZEE4kADU9DqLRiT53QZBBhu8EP9skviSyl+FGj08Y01xfICM/RR9ACUdM0aEQimhpu+ZpRVcUK+2jtiCGrYQ==", + "node_modules/@jridgewell/trace-mapping/node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.14", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", + "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==" + }, + "node_modules/@leichtgewicht/ip-codec": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz", + "integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==", + "dev": true + }, + "node_modules/@ng-bootstrap/ng-bootstrap": { + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/@ng-bootstrap/ng-bootstrap/-/ng-bootstrap-15.1.0.tgz", + "integrity": "sha512-4Z/sXYcAq22D15jtlnZV7qztuSnlSlOgO7EVp6rJ8dyGi3CPzX9PqMfetoM6K5sKQTiSW8IfsbdXCWN7rnzxWQ==", "dependencies": { - "@turf/clone": "^6.5.0", - "@turf/distance": "^6.5.0", - "@turf/helpers": "^6.5.0", - "@turf/meta": "^6.5.0", - "density-clustering": "1.3.0" + "tslib": "^2.3.0" }, - "funding": { - "url": "https://opencollective.com/turf" + "peerDependencies": { + "@angular/common": "^16.0.0", + "@angular/core": "^16.0.0", + "@angular/forms": "^16.0.0", + "@angular/localize": "^16.0.0", + "@popperjs/core": "^2.11.6", + "rxjs": "^6.5.3 || ^7.4.0" } }, - "node_modules/@turf/clusters-dbscan/node_modules/@turf/distance": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/distance/-/distance-6.5.0.tgz", - "integrity": "sha512-xzykSLfoURec5qvQJcfifw/1mJa+5UwByZZ5TZ8iaqjGYN0vomhV9aiSLeYdUGtYRESZ+DYC/OzY+4RclZYgMg==", - "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" + "node_modules/@ngtools/webpack": { + "version": "16.1.4", + "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-16.1.4.tgz", + "integrity": "sha512-+8bfavDH8eWxjlJFYr6bkjcRHhy95j+f8oNn7/sGLNu4L96nuE2AZ011XIu2dJahCnNiBvwc1EpkKa92t9rkaA==", + "dev": true, + "engines": { + "node": "^16.14.0 || >=18.10.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" }, - "funding": { - "url": "https://opencollective.com/turf" + "peerDependencies": { + "@angular/compiler-cli": "^16.0.0", + "typescript": ">=4.9.3 <5.2", + "webpack": "^5.54.0" } }, - "node_modules/@turf/clusters-dbscan/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } + "node_modules/@nicolo-ribaudo/chokidar-2": { + "version": "2.1.8-no-fsevents.3", + "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz", + "integrity": "sha512-s88O1aVtXftvp5bCPB7WnmXc5IwOZZ7YPuwNPt+GtOOXpPvad1LfbmjYv+qII7zP6RU2QGnqve27dnLycEnyEQ==", + "dev": true, + "optional": true }, - "node_modules/@turf/clusters-dbscan/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" + "node_modules/@nicolo-ribaudo/semver-v6": { + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/semver-v6/-/semver-v6-6.3.3.tgz", + "integrity": "sha512-3Yc1fUTs69MG/uZbJlLSI3JISMn2UV2rg+1D/vROUqZyh3l6iYHCs7GMp+M40ZD7yOdDbYjJcU1oTJhrc+dGKg==", + "dev": true, + "bin": { + "semver": "bin/semver.js" } }, - "node_modules/@turf/clusters-kmeans": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/clusters-kmeans/-/clusters-kmeans-6.5.0.tgz", - "integrity": "sha512-DwacD5+YO8kwDPKaXwT9DV46tMBVNsbi1IzdajZu1JDSWoN7yc7N9Qt88oi+p30583O0UPVkAK+A10WAQv4mUw==", + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dependencies": { - "@turf/clone": "^6.5.0", - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0", - "@turf/meta": "^6.5.0", - "skmeans": "0.9.7" + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" }, - "funding": { - "url": "https://opencollective.com/turf" + "engines": { + "node": ">= 8" } }, - "node_modules/@turf/clusters-kmeans/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "engines": { + "node": ">= 8" } }, - "node_modules/@turf/clusters-kmeans/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dependencies": { - "@turf/helpers": "^6.5.0" + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" }, - "funding": { - "url": "https://opencollective.com/turf" + "engines": { + "node": ">= 8" } }, - "node_modules/@turf/clusters/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" + "node_modules/@npmcli/fs": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-3.1.0.tgz", + "integrity": "sha512-7kZUAaLscfgbwBQRbvdMYaZOWyMEcPTH/tJjnyAWJ/dvvs9Ef+CERx/qJb9GExJpl1qipaDGn7KqHnFGGixd0w==", + "dev": true, + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/@turf/collect": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/collect/-/collect-6.5.0.tgz", - "integrity": "sha512-4dN/T6LNnRg099m97BJeOcTA5fSI8cu87Ydgfibewd2KQwBexO69AnjEFqfPX3Wj+Zvisj1uAVIZbPmSSrZkjg==", + "node_modules/@npmcli/git": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-4.1.0.tgz", + "integrity": "sha512-9hwoB3gStVfa0N31ymBmrX+GuDGdVA/QWShZVqE0HK2Af+7QGGrCTbZia/SW0ImUTjTne7SP91qxDmtXvDHRPQ==", + "dev": true, "dependencies": { - "@turf/bbox": "^6.5.0", - "@turf/boolean-point-in-polygon": "^6.5.0", - "@turf/helpers": "^6.5.0", - "rbush": "2.x" + "@npmcli/promise-spawn": "^6.0.0", + "lru-cache": "^7.4.4", + "npm-pick-manifest": "^8.0.0", + "proc-log": "^3.0.0", + "promise-inflight": "^1.0.1", + "promise-retry": "^2.0.1", + "semver": "^7.3.5", + "which": "^3.0.0" }, - "funding": { - "url": "https://opencollective.com/turf" + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/@turf/collect/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" + "node_modules/@npmcli/git/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "dev": true, + "engines": { + "node": ">=12" } }, - "node_modules/@turf/collect/node_modules/quickselect": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-1.1.1.tgz", - "integrity": "sha512-qN0Gqdw4c4KGPsBOQafj6yj/PA6c/L63f6CaZ/DCF/xF4Esu3jVmKLUDYxghFx8Kb/O7y9tI7x2RjTSXwdK1iQ==" + "node_modules/@npmcli/git/node_modules/which": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/which/-/which-3.0.1.tgz", + "integrity": "sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } }, - "node_modules/@turf/collect/node_modules/rbush": { + "node_modules/@npmcli/installed-package-contents": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/rbush/-/rbush-2.0.2.tgz", - "integrity": "sha512-XBOuALcTm+O/H8G90b6pzu6nX6v2zCKiFG4BJho8a+bY6AER6t8uQUZdi5bomQc0AprCWhEGa7ncAbbRap0bRA==", + "resolved": "https://registry.npmjs.org/@npmcli/installed-package-contents/-/installed-package-contents-2.0.2.tgz", + "integrity": "sha512-xACzLPhnfD51GKvTOOuNX2/V4G4mz9/1I2MfDoye9kBM3RYe5g2YbscsaGoTlaWqkxeiapBWyseULVKpSVHtKQ==", + "dev": true, "dependencies": { - "quickselect": "^1.0.1" + "npm-bundled": "^3.0.0", + "npm-normalize-package-bin": "^3.0.0" + }, + "bin": { + "installed-package-contents": "lib/index.js" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/@turf/combine": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/combine/-/combine-6.5.0.tgz", - "integrity": "sha512-Q8EIC4OtAcHiJB3C4R+FpB4LANiT90t17uOd851qkM2/o6m39bfN5Mv0PWqMZIHWrrosZqRqoY9dJnzz/rJxYQ==", + "node_modules/@npmcli/node-gyp": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/node-gyp/-/node-gyp-3.0.0.tgz", + "integrity": "sha512-gp8pRXC2oOxu0DUE1/M3bYtb1b3/DbJ5aM113+XJBgfXdussRAsX0YOrOhdd8WvnAR6auDBvJomGAkLKA5ydxA==", + "dev": true, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@npmcli/promise-spawn": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-6.0.2.tgz", + "integrity": "sha512-gGq0NJkIGSwdbUt4yhdF8ZrmkGKVz9vAdVzpOfnom+V8PLSmSOVhZwbNvZZS1EYcJN5hzzKBxmmVVAInM6HQLg==", + "dev": true, "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/meta": "^6.5.0" + "which": "^3.0.0" }, - "funding": { - "url": "https://opencollective.com/turf" + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/@turf/combine/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" + "node_modules/@npmcli/promise-spawn/node_modules/which": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/which/-/which-3.0.1.tgz", + "integrity": "sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/@turf/concave": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/concave/-/concave-6.5.0.tgz", - "integrity": "sha512-I/sUmUC8TC5h/E2vPwxVht+nRt+TnXIPRoztDFvS8/Y0+cBDple9inLSo9nnPXMXidrBlGXZ9vQx/BjZUJgsRQ==", + "node_modules/@npmcli/run-script": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-6.0.2.tgz", + "integrity": "sha512-NCcr1uQo1k5U+SYlnIrbAh3cxy+OQT1VtqiAbxdymSlptbzBb62AjH2xXgjNCoP073hoa1CfCAcwoZ8k96C4nA==", + "dev": true, "dependencies": { - "@turf/clone": "^6.5.0", - "@turf/distance": "^6.5.0", - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0", - "@turf/meta": "^6.5.0", - "@turf/tin": "^6.5.0", - "topojson-client": "3.x", - "topojson-server": "3.x" + "@npmcli/node-gyp": "^3.0.0", + "@npmcli/promise-spawn": "^6.0.0", + "node-gyp": "^9.0.0", + "read-package-json-fast": "^3.0.0", + "which": "^3.0.0" }, - "funding": { - "url": "https://opencollective.com/turf" + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/@turf/concave/node_modules/@turf/distance": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/distance/-/distance-6.5.0.tgz", - "integrity": "sha512-xzykSLfoURec5qvQJcfifw/1mJa+5UwByZZ5TZ8iaqjGYN0vomhV9aiSLeYdUGtYRESZ+DYC/OzY+4RclZYgMg==", + "node_modules/@npmcli/run-script/node_modules/which": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/which/-/which-3.0.1.tgz", + "integrity": "sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==", + "dev": true, "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" + "isexe": "^2.0.0" }, - "funding": { - "url": "https://opencollective.com/turf" + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/@turf/concave/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" + "node_modules/@octokit/auth-token": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-3.0.4.tgz", + "integrity": "sha512-TWFX7cZF2LXoCvdmJWY7XVPi74aSY0+FfBZNSXEXFkMpjcqsQwDSYVv5FhRFaI0V1ECnwbz4j59T/G+rXNWaIQ==", + "dev": true, + "engines": { + "node": ">= 14" } }, - "node_modules/@turf/concave/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", + "node_modules/@octokit/core": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-4.2.4.tgz", + "integrity": "sha512-rYKilwgzQ7/imScn3M9/pFfUf4I1AZEH3KhyJmtPdE2zfaXAn2mFfUy4FbKewzc2We5y/LlKLj36fWJLKC2SIQ==", + "dev": true, "dependencies": { - "@turf/helpers": "^6.5.0" + "@octokit/auth-token": "^3.0.0", + "@octokit/graphql": "^5.0.0", + "@octokit/request": "^6.0.0", + "@octokit/request-error": "^3.0.0", + "@octokit/types": "^9.0.0", + "before-after-hook": "^2.2.0", + "universal-user-agent": "^6.0.0" }, - "funding": { - "url": "https://opencollective.com/turf" + "engines": { + "node": ">= 14" } }, - "node_modules/@turf/convex": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/convex/-/convex-6.5.0.tgz", - "integrity": "sha512-x7ZwC5z7PJB0SBwNh7JCeCNx7Iu+QSrH7fYgK0RhhNop13TqUlvHMirMLRgf2db1DqUetrAO2qHJeIuasquUWg==", + "node_modules/@octokit/endpoint": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-7.0.6.tgz", + "integrity": "sha512-5L4fseVRUsDFGR00tMWD/Trdeeihn999rTMGRMC1G/Ldi1uWlWJzI98H4Iak5DB/RVvQuyMYKqSK/R6mbSOQyg==", + "dev": true, "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/meta": "^6.5.0", - "concaveman": "*" + "@octokit/types": "^9.0.0", + "is-plain-object": "^5.0.0", + "universal-user-agent": "^6.0.0" }, - "funding": { - "url": "https://opencollective.com/turf" + "engines": { + "node": ">= 14" } }, - "node_modules/@turf/convex/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" + "node_modules/@octokit/endpoint/node_modules/is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" } }, - "node_modules/@turf/destination": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/destination/-/destination-6.5.0.tgz", - "integrity": "sha512-4cnWQlNC8d1tItOz9B4pmJdWpXqS0vEvv65bI/Pj/genJnsL7evI0/Xw42RvEGROS481MPiU80xzvwxEvhQiMQ==", + "node_modules/@octokit/graphql": { + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-5.0.6.tgz", + "integrity": "sha512-Fxyxdy/JH0MnIB5h+UQ3yCoh1FG4kWXfFKkpWqjZHw/p+Kc8Y44Hu/kCgNBT6nU1shNumEchmW/sUO1JuQnPcw==", + "dev": true, "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" + "@octokit/request": "^6.0.0", + "@octokit/types": "^9.0.0", + "universal-user-agent": "^6.0.0" }, - "funding": { - "url": "https://opencollective.com/turf" + "engines": { + "node": ">= 14" } }, - "node_modules/@turf/destination/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } + "node_modules/@octokit/openapi-types": { + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.0.0.tgz", + "integrity": "sha512-V8GImKs3TeQRxRtXFpG2wl19V7444NIOTDF24AWuIbmNaNYOQMWRbjcGDXV5B+0n887fgDcuMNOmlul+k+oJtw==", + "dev": true }, - "node_modules/@turf/destination/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", + "node_modules/@octokit/plugin-paginate-rest": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-6.1.2.tgz", + "integrity": "sha512-qhrmtQeHU/IivxucOV1bbI/xZyC/iOBhclokv7Sut5vnejAIAEXVcGQeRpQlU39E0WwK9lNvJHphHri/DB6lbQ==", + "dev": true, "dependencies": { - "@turf/helpers": "^6.5.0" + "@octokit/tsconfig": "^1.0.2", + "@octokit/types": "^9.2.3" }, - "funding": { - "url": "https://opencollective.com/turf" + "engines": { + "node": ">= 14" + }, + "peerDependencies": { + "@octokit/core": ">=4" } }, - "node_modules/@turf/difference": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/difference/-/difference-6.5.0.tgz", - "integrity": "sha512-l8iR5uJqvI+5Fs6leNbhPY5t/a3vipUF/3AeVLpwPQcgmedNXyheYuy07PcMGH5Jdpi5gItOiTqwiU/bUH4b3A==", + "node_modules/@octokit/plugin-request-log": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz", + "integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==", + "dev": true, + "peerDependencies": { + "@octokit/core": ">=3" + } + }, + "node_modules/@octokit/plugin-rest-endpoint-methods": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-7.2.3.tgz", + "integrity": "sha512-I5Gml6kTAkzVlN7KCtjOM+Ruwe/rQppp0QU372K1GP7kNOYEKe8Xn5BW4sE62JAHdwpq95OQK/qGNyKQMUzVgA==", + "dev": true, "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0", - "polygon-clipping": "^0.15.3" + "@octokit/types": "^10.0.0" }, - "funding": { - "url": "https://opencollective.com/turf" + "engines": { + "node": ">= 14" + }, + "peerDependencies": { + "@octokit/core": ">=3" } }, - "node_modules/@turf/difference/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" + "node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-10.0.0.tgz", + "integrity": "sha512-Vm8IddVmhCgU1fxC1eyinpwqzXPEYu0NrYzD3YZjlGjyftdLBTeqNblRC0jmJmgxbJIsQlyogVeGnrNaaMVzIg==", + "dev": true, + "dependencies": { + "@octokit/openapi-types": "^18.0.0" } }, - "node_modules/@turf/difference/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", + "node_modules/@octokit/request": { + "version": "6.2.8", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-6.2.8.tgz", + "integrity": "sha512-ow4+pkVQ+6XVVsekSYBzJC0VTVvh/FCTUUgTsboGq+DTeWdyIFV8WSCdo0RIxk6wSkBTHqIK1mYuY7nOBXOchw==", + "dev": true, "dependencies": { - "@turf/helpers": "^6.5.0" + "@octokit/endpoint": "^7.0.0", + "@octokit/request-error": "^3.0.0", + "@octokit/types": "^9.0.0", + "is-plain-object": "^5.0.0", + "node-fetch": "^2.6.7", + "universal-user-agent": "^6.0.0" }, - "funding": { - "url": "https://opencollective.com/turf" + "engines": { + "node": ">= 14" } }, - "node_modules/@turf/dissolve": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/dissolve/-/dissolve-6.5.0.tgz", - "integrity": "sha512-WBVbpm9zLTp0Bl9CE35NomTaOL1c4TQCtEoO43YaAhNEWJOOIhZMFJyr8mbvYruKl817KinT3x7aYjjCMjTAsQ==", + "node_modules/@octokit/request-error": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-3.0.3.tgz", + "integrity": "sha512-crqw3V5Iy2uOU5Np+8M/YexTlT8zxCfI+qu+LxUB7SZpje4Qmx3mub5DfEKSO8Ylyk0aogi6TYdf6kxzh2BguQ==", + "dev": true, "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0", - "@turf/meta": "^6.5.0", - "polygon-clipping": "^0.15.3" + "@octokit/types": "^9.0.0", + "deprecation": "^2.0.0", + "once": "^1.4.0" }, - "funding": { - "url": "https://opencollective.com/turf" + "engines": { + "node": ">= 14" } }, - "node_modules/@turf/dissolve/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" + "node_modules/@octokit/request/node_modules/is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" } }, - "node_modules/@turf/dissolve/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", + "node_modules/@octokit/request/node_modules/node-fetch": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz", + "integrity": "sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g==", + "dev": true, "dependencies": { - "@turf/helpers": "^6.5.0" + "whatwg-url": "^5.0.0" }, - "funding": { - "url": "https://opencollective.com/turf" + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } } }, - "node_modules/@turf/distance": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@turf/distance/-/distance-5.1.5.tgz", - "integrity": "sha1-Oc8YIEu/h1h9cH5gmmARiQkVZAk=", + "node_modules/@octokit/rest": { + "version": "19.0.11", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-19.0.11.tgz", + "integrity": "sha512-m2a9VhaP5/tUw8FwfnW2ICXlXpLPIqxtg3XcAiGMLj/Xhw3RSBfZ8le/466ktO1Gcjr8oXudGnHhxV1TXJgFxw==", + "dev": true, "dependencies": { - "@turf/helpers": "^5.1.5", - "@turf/invariant": "^5.1.5" + "@octokit/core": "^4.2.1", + "@octokit/plugin-paginate-rest": "^6.1.2", + "@octokit/plugin-request-log": "^1.0.4", + "@octokit/plugin-rest-endpoint-methods": "^7.1.2" + }, + "engines": { + "node": ">= 14" } }, - "node_modules/@turf/distance-weight": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/distance-weight/-/distance-weight-6.5.0.tgz", - "integrity": "sha512-a8qBKkgVNvPKBfZfEJZnC3DV7dfIsC3UIdpRci/iap/wZLH41EmS90nM+BokAJflUHYy8PqE44wySGWHN1FXrQ==", + "node_modules/@octokit/tsconfig": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@octokit/tsconfig/-/tsconfig-1.0.2.tgz", + "integrity": "sha512-I0vDR0rdtP8p2lGMzvsJzbhdOWy405HcGovrspJ8RRibHnyRgggUSNO5AIox5LmqiwmatHKYsvj6VGFHkqS7lA==", + "dev": true + }, + "node_modules/@octokit/types": { + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.3.2.tgz", + "integrity": "sha512-D4iHGTdAnEEVsB8fl95m1hiz7D5YiRdQ9b/OEb3BYRVwbLsGHcRVPz+u+BgRLNk0Q0/4iZCBqDN96j2XNxfXrA==", + "dev": true, "dependencies": { - "@turf/centroid": "^6.5.0", - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0", - "@turf/meta": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" + "@octokit/openapi-types": "^18.0.0" } }, - "node_modules/@turf/distance-weight/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "optional": true, + "engines": { + "node": ">=14" } }, - "node_modules/@turf/distance-weight/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" + "node_modules/@pnpm/config.env-replace": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz", + "integrity": "sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==", + "dev": true, + "engines": { + "node": ">=12.22.0" } }, - "node_modules/@turf/ellipse": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/ellipse/-/ellipse-6.5.0.tgz", - "integrity": "sha512-kuXtwFviw/JqnyJXF1mrR/cb496zDTSbGKtSiolWMNImYzGGkbsAsFTjwJYgD7+4FixHjp0uQPzo70KDf3AIBw==", + "node_modules/@pnpm/network.ca-file": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@pnpm/network.ca-file/-/network.ca-file-1.0.2.tgz", + "integrity": "sha512-YcPQ8a0jwYU9bTdJDpXjMi7Brhkr1mXsXrUJvjqM2mQDgkRiz8jFaQGOdaLxgjtUfQgZhKy/O3cG/YwmgKaxLA==", + "dev": true, "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0", - "@turf/rhumb-destination": "^6.5.0", - "@turf/transform-rotate": "^6.5.0" + "graceful-fs": "4.2.10" }, - "funding": { - "url": "https://opencollective.com/turf" + "engines": { + "node": ">=12.22.0" } }, - "node_modules/@turf/ellipse/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } + "node_modules/@pnpm/network.ca-file/node_modules/graceful-fs": { + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "dev": true }, - "node_modules/@turf/ellipse/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", + "node_modules/@pnpm/npm-conf": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@pnpm/npm-conf/-/npm-conf-2.2.2.tgz", + "integrity": "sha512-UA91GwWPhFExt3IizW6bOeY/pQ0BkuNwKjk9iQW9KqxluGCrg4VenZ0/L+2Y0+ZOtme72EVvg6v0zo3AMQRCeA==", + "dev": true, "dependencies": { - "@turf/helpers": "^6.5.0" + "@pnpm/config.env-replace": "^1.1.0", + "@pnpm/network.ca-file": "^1.0.1", + "config-chain": "^1.1.11" }, - "funding": { - "url": "https://opencollective.com/turf" + "engines": { + "node": ">=12" } }, - "node_modules/@turf/envelope": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/envelope/-/envelope-6.5.0.tgz", - "integrity": "sha512-9Z+FnBWvOGOU4X+fMZxYFs1HjFlkKqsddLuMknRaqcJd6t+NIv5DWvPtDL8ATD2GEExYDiFLwMdckfr1yqJgHA==", - "dependencies": { - "@turf/bbox": "^6.5.0", - "@turf/bbox-polygon": "^6.5.0", - "@turf/helpers": "^6.5.0" - }, + "node_modules/@popperjs/core": { + "version": "2.11.8", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", + "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", "funding": { - "url": "https://opencollective.com/turf" + "type": "opencollective", + "url": "https://opencollective.com/popperjs" } }, - "node_modules/@turf/envelope/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" + "node_modules/@release-it/keep-a-changelog": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@release-it/keep-a-changelog/-/keep-a-changelog-3.1.0.tgz", + "integrity": "sha512-o8lxZCAFwFkFpo88aIIgS5dR3kDy6yLjJVpe9QAGNY6tpKMMRHxsiJ8MS5NvrEeIC2VTzOoOjN/CDvdd3a4+/A==", + "dev": true, + "dependencies": { + "detect-newline": "^4.0.0", + "string-template": "^1.0.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "release-it": "^15.0.0-esm.4" } }, - "node_modules/@turf/explode": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/explode/-/explode-6.5.0.tgz", - "integrity": "sha512-6cSvMrnHm2qAsace6pw9cDmK2buAlw8+tjeJVXMfMyY+w7ZUi1rprWMsY92J7s2Dar63Bv09n56/1V7+tcj52Q==", + "node_modules/@schematics/angular": { + "version": "16.1.4", + "resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-16.1.4.tgz", + "integrity": "sha512-XfoeL+aBVIR/DzgVKGVhHW/TGQnqWvngyJVuCwXEVWzNfjxHYFkchXa78OItpAvTEr6/Y0Me9FQVAGVA4mMUyg==", + "dev": true, "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/meta": "^6.5.0" + "@angular-devkit/core": "16.1.4", + "@angular-devkit/schematics": "16.1.4", + "jsonc-parser": "3.2.0" }, - "funding": { - "url": "https://opencollective.com/turf" + "engines": { + "node": "^16.14.0 || >=18.10.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" } }, - "node_modules/@turf/explode/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" + "node_modules/@sigstore/protobuf-specs": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@sigstore/protobuf-specs/-/protobuf-specs-0.1.0.tgz", + "integrity": "sha512-a31EnjuIDSX8IXBUib3cYLDRlPMU36AWX4xS8ysLaNu4ZzUesDiPt83pgrW2X1YLMe5L2HbDyaKK5BrL4cNKaQ==", + "dev": true, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/@turf/flatten": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/flatten/-/flatten-6.5.0.tgz", - "integrity": "sha512-IBZVwoNLVNT6U/bcUUllubgElzpMsNoCw8tLqBw6dfYg9ObGmpEjf9BIYLr7a2Yn5ZR4l7YIj2T7kD5uJjZADQ==", + "node_modules/@sigstore/tuf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@sigstore/tuf/-/tuf-1.0.2.tgz", + "integrity": "sha512-vjwcYePJzM01Ha6oWWZ9gNcdIgnzyFxfqfWzph483DPJTH8Tb7f7bQRRll3CYVkyH56j0AgcPAcl6Vg95DPF+Q==", + "dev": true, "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/meta": "^6.5.0" + "@sigstore/protobuf-specs": "^0.1.0", + "tuf-js": "^1.1.7" }, - "funding": { - "url": "https://opencollective.com/turf" + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/@turf/flatten/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", + "node_modules/@sindresorhus/is": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.4.1.tgz", + "integrity": "sha512-axlrvsHlHlFmKKMEg4VyvMzFr93JWJj4eIfXY1STVuO2fsImCa7ncaiG5gC8HKOX590AW5RtRsC41/B+OfrSqw==", + "dev": true, + "engines": { + "node": ">=14.16" + }, "funding": { - "url": "https://opencollective.com/turf" + "url": "https://github.com/sindresorhus/is?sponsor=1" } }, - "node_modules/@turf/flip": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/flip/-/flip-6.5.0.tgz", - "integrity": "sha512-oyikJFNjt2LmIXQqgOGLvt70RgE2lyzPMloYWM7OR5oIFGRiBvqVD2hA6MNw6JewIm30fWZ8DQJw1NHXJTJPbg==", + "node_modules/@szmarczak/http-timer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", + "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", + "dev": true, "dependencies": { - "@turf/clone": "^6.5.0", - "@turf/helpers": "^6.5.0", - "@turf/meta": "^6.5.0" + "defer-to-connect": "^2.0.1" }, - "funding": { - "url": "https://opencollective.com/turf" + "engines": { + "node": ">=14.16" } }, - "node_modules/@turf/flip/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" + "node_modules/@tootallnate/once": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "dev": true, + "engines": { + "node": ">= 10" } }, - "node_modules/@turf/great-circle": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/great-circle/-/great-circle-6.5.0.tgz", - "integrity": "sha512-7ovyi3HaKOXdFyN7yy1yOMa8IyOvV46RC1QOQTT+RYUN8ke10eyqExwBpL9RFUPvlpoTzoYbM/+lWPogQlFncg==", + "node_modules/@tufjs/canonical-json": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@tufjs/canonical-json/-/canonical-json-1.0.0.tgz", + "integrity": "sha512-QTnf++uxunWvG2z3UFNzAoQPHxnSXOwtaI3iJ+AohhV+5vONuArPjJE7aPXPVXfXJsqrVbZBu9b81AJoSd09IQ==", + "dev": true, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@tufjs/models": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tufjs/models/-/models-1.0.4.tgz", + "integrity": "sha512-qaGV9ltJP0EO25YfFUPhxRVK0evXFIAGicsVXuRim4Ed9cjPxYhNnNJ49SFmbeLgtxpslIkX317IgpfcHPVj/A==", + "dev": true, "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" + "@tufjs/canonical-json": "1.0.0", + "minimatch": "^9.0.0" }, - "funding": { - "url": "https://opencollective.com/turf" + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/@turf/great-circle/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" + "node_modules/@tufjs/models/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" } }, - "node_modules/@turf/great-circle/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", + "node_modules/@tufjs/models/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, "dependencies": { - "@turf/helpers": "^6.5.0" + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" }, "funding": { - "url": "https://opencollective.com/turf" + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@turf/helpers": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-5.1.5.tgz", - "integrity": "sha1-FTQFInq5M9AEpbuWQantmZ/L4M8=" - }, - "node_modules/@turf/hex-grid": { + "node_modules/@turf/along": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/hex-grid/-/hex-grid-6.5.0.tgz", - "integrity": "sha512-Ln3tc2tgZT8etDOldgc6e741Smg1CsMKAz1/Mlel+MEL5Ynv2mhx3m0q4J9IB1F3a4MNjDeVvm8drAaf9SF33g==", + "resolved": "https://registry.npmjs.org/@turf/along/-/along-6.5.0.tgz", + "integrity": "sha512-LLyWQ0AARqJCmMcIEAXF4GEu8usmd4Kbz3qk1Oy5HoRNpZX47+i5exQtmIWKdqJ1MMhW26fCTXgpsEs5zgJ5gw==", "dependencies": { + "@turf/bearing": "^6.5.0", + "@turf/destination": "^6.5.0", "@turf/distance": "^6.5.0", "@turf/helpers": "^6.5.0", - "@turf/intersect": "^6.5.0", "@turf/invariant": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/hex-grid/node_modules/@turf/distance": { + "node_modules/@turf/angle": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/distance/-/distance-6.5.0.tgz", - "integrity": "sha512-xzykSLfoURec5qvQJcfifw/1mJa+5UwByZZ5TZ8iaqjGYN0vomhV9aiSLeYdUGtYRESZ+DYC/OzY+4RclZYgMg==", + "resolved": "https://registry.npmjs.org/@turf/angle/-/angle-6.5.0.tgz", + "integrity": "sha512-4pXMbWhFofJJAOvTMCns6N4C8CMd5Ih4O2jSAG9b3dDHakj3O4yN1+Zbm+NUei+eVEZ9gFeVp9svE3aMDenIkw==", "dependencies": { + "@turf/bearing": "^6.5.0", "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" + "@turf/invariant": "^6.5.0", + "@turf/rhumb-bearing": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/hex-grid/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/hex-grid/node_modules/@turf/invariant": { + "node_modules/@turf/area": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", + "resolved": "https://registry.npmjs.org/@turf/area/-/area-6.5.0.tgz", + "integrity": "sha512-xCZdiuojokLbQ+29qR6qoMD89hv+JAgWjLrwSEWL+3JV8IXKeNFl6XkEJz9HGkVpnXvQKJoRz4/liT+8ZZ5Jyg==", "dependencies": { - "@turf/helpers": "^6.5.0" + "@turf/helpers": "^6.5.0", + "@turf/meta": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/interpolate": { + "node_modules/@turf/bbox": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/interpolate/-/interpolate-6.5.0.tgz", - "integrity": "sha512-LSH5fMeiGyuDZ4WrDJNgh81d2DnNDUVJtuFryJFup8PV8jbs46lQGfI3r1DJ2p1IlEJIz3pmAZYeTfMMoeeohw==", + "resolved": "https://registry.npmjs.org/@turf/bbox/-/bbox-6.5.0.tgz", + "integrity": "sha512-RBbLaao5hXTYyyg577iuMtDB8ehxMlUqHEJiMs8jT1GHkFhr6sYre3lmLsPeYEi/ZKj5TP5tt7fkzNdJ4GIVyw==", "dependencies": { - "@turf/bbox": "^6.5.0", - "@turf/centroid": "^6.5.0", - "@turf/clone": "^6.5.0", - "@turf/distance": "^6.5.0", "@turf/helpers": "^6.5.0", - "@turf/hex-grid": "^6.5.0", - "@turf/invariant": "^6.5.0", - "@turf/meta": "^6.5.0", - "@turf/point-grid": "^6.5.0", - "@turf/square-grid": "^6.5.0", - "@turf/triangle-grid": "^6.5.0" + "@turf/meta": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/interpolate/node_modules/@turf/distance": { + "node_modules/@turf/bbox-clip": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/distance/-/distance-6.5.0.tgz", - "integrity": "sha512-xzykSLfoURec5qvQJcfifw/1mJa+5UwByZZ5TZ8iaqjGYN0vomhV9aiSLeYdUGtYRESZ+DYC/OzY+4RclZYgMg==", + "resolved": "https://registry.npmjs.org/@turf/bbox-clip/-/bbox-clip-6.5.0.tgz", + "integrity": "sha512-F6PaIRF8WMp8EmgU/Ke5B1Y6/pia14UAYB5TiBC668w5rVVjy5L8rTm/m2lEkkDMHlzoP9vNY4pxpNthE7rLcQ==", "dependencies": { "@turf/helpers": "^6.5.0", "@turf/invariant": "^6.5.0" @@ -6899,257 +3999,271 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/interpolate/node_modules/@turf/helpers": { + "node_modules/@turf/bbox-polygon": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", + "resolved": "https://registry.npmjs.org/@turf/bbox-polygon/-/bbox-polygon-6.5.0.tgz", + "integrity": "sha512-+/r0NyL1lOG3zKZmmf6L8ommU07HliP4dgYToMoTxqzsWzyLjaj/OzgQ8rBmv703WJX+aS6yCmLuIhYqyufyuw==", + "dependencies": { + "@turf/helpers": "^6.5.0" + }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/interpolate/node_modules/@turf/invariant": { + "node_modules/@turf/bearing": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", + "resolved": "https://registry.npmjs.org/@turf/bearing/-/bearing-6.5.0.tgz", + "integrity": "sha512-dxINYhIEMzgDOztyMZc20I7ssYVNEpSv04VbMo5YPQsqa80KO3TFvbuCahMsCAW5z8Tncc8dwBlEFrmRjJG33A==", "dependencies": { - "@turf/helpers": "^6.5.0" + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/intersect": { + "node_modules/@turf/bezier-spline": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/intersect/-/intersect-6.5.0.tgz", - "integrity": "sha512-2legGJeKrfFkzntcd4GouPugoqPUjexPZnOvfez+3SfIMrHvulw8qV8u7pfVyn2Yqs53yoVCEjS5sEpvQ5YRQg==", + "resolved": "https://registry.npmjs.org/@turf/bezier-spline/-/bezier-spline-6.5.0.tgz", + "integrity": "sha512-vokPaurTd4PF96rRgGVm6zYYC5r1u98ZsG+wZEv9y3kJTuJRX/O3xIY2QnTGTdbVmAJN1ouOsD0RoZYaVoXORQ==", "dependencies": { "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0", - "polygon-clipping": "^0.15.3" + "@turf/invariant": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/intersect/node_modules/@turf/helpers": { + "node_modules/@turf/boolean-clockwise": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", + "resolved": "https://registry.npmjs.org/@turf/boolean-clockwise/-/boolean-clockwise-6.5.0.tgz", + "integrity": "sha512-45+C7LC5RMbRWrxh3Z0Eihsc8db1VGBO5d9BLTOAwU4jR6SgsunTfRWR16X7JUwIDYlCVEmnjcXJNi/kIU3VIw==", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0" + }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/intersect/node_modules/@turf/invariant": { + "node_modules/@turf/boolean-contains": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", + "resolved": "https://registry.npmjs.org/@turf/boolean-contains/-/boolean-contains-6.5.0.tgz", + "integrity": "sha512-4m8cJpbw+YQcKVGi8y0cHhBUnYT+QRfx6wzM4GI1IdtYH3p4oh/DOBJKrepQyiDzFDaNIjxuWXBh0ai1zVwOQQ==", "dependencies": { - "@turf/helpers": "^6.5.0" + "@turf/bbox": "^6.5.0", + "@turf/boolean-point-in-polygon": "^6.5.0", + "@turf/boolean-point-on-line": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/invariant": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-5.1.5.tgz", - "integrity": "sha1-9Z9P76CSJLFdzhZR+QPIaNV6JOE=", - "dependencies": { - "@turf/helpers": "^5.1.5" - } - }, - "node_modules/@turf/isobands": { + "node_modules/@turf/boolean-crosses": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/isobands/-/isobands-6.5.0.tgz", - "integrity": "sha512-4h6sjBPhRwMVuFaVBv70YB7eGz+iw0bhPRnp+8JBdX1UPJSXhoi/ZF2rACemRUr0HkdVB/a1r9gC32vn5IAEkw==", + "resolved": "https://registry.npmjs.org/@turf/boolean-crosses/-/boolean-crosses-6.5.0.tgz", + "integrity": "sha512-gvshbTPhAHporTlQwBJqyfW+2yV8q/mOTxG6PzRVl6ARsqNoqYQWkd4MLug7OmAqVyBzLK3201uAeBjxbGw0Ng==", "dependencies": { - "@turf/area": "^6.5.0", - "@turf/bbox": "^6.5.0", "@turf/boolean-point-in-polygon": "^6.5.0", - "@turf/explode": "^6.5.0", "@turf/helpers": "^6.5.0", "@turf/invariant": "^6.5.0", - "@turf/meta": "^6.5.0", - "object-assign": "*" + "@turf/line-intersect": "^6.5.0", + "@turf/polygon-to-line": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/isobands/node_modules/@turf/area": { + "node_modules/@turf/boolean-disjoint": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/area/-/area-6.5.0.tgz", - "integrity": "sha512-xCZdiuojokLbQ+29qR6qoMD89hv+JAgWjLrwSEWL+3JV8IXKeNFl6XkEJz9HGkVpnXvQKJoRz4/liT+8ZZ5Jyg==", + "resolved": "https://registry.npmjs.org/@turf/boolean-disjoint/-/boolean-disjoint-6.5.0.tgz", + "integrity": "sha512-rZ2ozlrRLIAGo2bjQ/ZUu4oZ/+ZjGvLkN5CKXSKBcu6xFO6k2bgqeM8a1836tAW+Pqp/ZFsTA5fZHsJZvP2D5g==", "dependencies": { + "@turf/boolean-point-in-polygon": "^6.5.0", "@turf/helpers": "^6.5.0", - "@turf/meta": "^6.5.0" + "@turf/line-intersect": "^6.5.0", + "@turf/meta": "^6.5.0", + "@turf/polygon-to-line": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/isobands/node_modules/@turf/helpers": { + "node_modules/@turf/boolean-equal": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", + "resolved": "https://registry.npmjs.org/@turf/boolean-equal/-/boolean-equal-6.5.0.tgz", + "integrity": "sha512-cY0M3yoLC26mhAnjv1gyYNQjn7wxIXmL2hBmI/qs8g5uKuC2hRWi13ydufE3k4x0aNRjFGlg41fjoYLwaVF+9Q==", + "dependencies": { + "@turf/clean-coords": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "geojson-equality": "0.1.6" + }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/isobands/node_modules/@turf/invariant": { + "node_modules/@turf/boolean-intersects": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", + "resolved": "https://registry.npmjs.org/@turf/boolean-intersects/-/boolean-intersects-6.5.0.tgz", + "integrity": "sha512-nIxkizjRdjKCYFQMnml6cjPsDOBCThrt+nkqtSEcxkKMhAQj5OO7o2CecioNTaX8EayqwMGVKcsz27oP4mKPTw==", "dependencies": { - "@turf/helpers": "^6.5.0" + "@turf/boolean-disjoint": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/meta": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/isolines": { + "node_modules/@turf/boolean-overlap": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/isolines/-/isolines-6.5.0.tgz", - "integrity": "sha512-6ElhiLCopxWlv4tPoxiCzASWt/jMRvmp6mRYrpzOm3EUl75OhHKa/Pu6Y9nWtCMmVC/RcWtiiweUocbPLZLm0A==", + "resolved": "https://registry.npmjs.org/@turf/boolean-overlap/-/boolean-overlap-6.5.0.tgz", + "integrity": "sha512-8btMIdnbXVWUa1M7D4shyaSGxLRw6NjMcqKBcsTXcZdnaixl22k7ar7BvIzkaRYN3SFECk9VGXfLncNS3ckQUw==", "dependencies": { - "@turf/bbox": "^6.5.0", "@turf/helpers": "^6.5.0", "@turf/invariant": "^6.5.0", + "@turf/line-intersect": "^6.5.0", + "@turf/line-overlap": "^6.5.0", "@turf/meta": "^6.5.0", - "object-assign": "*" + "geojson-equality": "0.1.6" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/isolines/node_modules/@turf/helpers": { + "node_modules/@turf/boolean-parallel": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", + "resolved": "https://registry.npmjs.org/@turf/boolean-parallel/-/boolean-parallel-6.5.0.tgz", + "integrity": "sha512-aSHJsr1nq9e5TthZGZ9CZYeXklJyRgR5kCLm5X4urz7+MotMOp/LsGOsvKvK9NeUl9+8OUmfMn8EFTT8LkcvIQ==", + "dependencies": { + "@turf/clean-coords": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/line-segment": "^6.5.0", + "@turf/rhumb-bearing": "^6.5.0" + }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/isolines/node_modules/@turf/invariant": { + "node_modules/@turf/boolean-point-in-polygon": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", + "resolved": "https://registry.npmjs.org/@turf/boolean-point-in-polygon/-/boolean-point-in-polygon-6.5.0.tgz", + "integrity": "sha512-DtSuVFB26SI+hj0SjrvXowGTUCHlgevPAIsukssW6BG5MlNSBQAo70wpICBNJL6RjukXg8d2eXaAWuD/CqL00A==", "dependencies": { - "@turf/helpers": "^6.5.0" + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/kinks": { + "node_modules/@turf/boolean-point-on-line": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/kinks/-/kinks-6.5.0.tgz", - "integrity": "sha512-ViCngdPt1eEL7hYUHR2eHR662GvCgTc35ZJFaNR6kRtr6D8plLaDju0FILeFFWSc+o8e3fwxZEJKmFj9IzPiIQ==", + "resolved": "https://registry.npmjs.org/@turf/boolean-point-on-line/-/boolean-point-on-line-6.5.0.tgz", + "integrity": "sha512-A1BbuQ0LceLHvq7F/P7w3QvfpmZqbmViIUPHdNLvZimFNLo4e6IQunmzbe+8aSStH9QRZm3VOflyvNeXvvpZEQ==", "dependencies": { - "@turf/helpers": "^6.5.0" + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/kinks/node_modules/@turf/helpers": { + "node_modules/@turf/boolean-within": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", + "resolved": "https://registry.npmjs.org/@turf/boolean-within/-/boolean-within-6.5.0.tgz", + "integrity": "sha512-YQB3oU18Inx35C/LU930D36RAVe7LDXk1kWsQ8mLmuqYn9YdPsDQTMTkLJMhoQ8EbN7QTdy333xRQ4MYgToteQ==", + "dependencies": { + "@turf/bbox": "^6.5.0", + "@turf/boolean-point-in-polygon": "^6.5.0", + "@turf/boolean-point-on-line": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0" + }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/length": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/@turf/length/-/length-5.1.5.tgz", - "integrity": "sha1-86X4ZMK5lqi7RxeUU1ofrxLuvvs=", - "dependencies": { - "@turf/distance": "^5.1.5", - "@turf/helpers": "^5.1.5", - "@turf/meta": "^5.1.5" - } - }, - "node_modules/@turf/length/node_modules/@turf/meta": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/@turf/meta/-/meta-5.2.0.tgz", - "integrity": "sha1-OxrUhe4MOwsXdRMqMsOE1T5LpT0=", - "dependencies": { - "@turf/helpers": "^5.1.5" - } - }, - "node_modules/@turf/line-arc": { + "node_modules/@turf/buffer": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/line-arc/-/line-arc-6.5.0.tgz", - "integrity": "sha512-I6c+V6mIyEwbtg9P9zSFF89T7QPe1DPTG3MJJ6Cm1MrAY0MdejwQKOpsvNl8LDU2ekHOlz2kHpPVR7VJsoMllA==", + "resolved": "https://registry.npmjs.org/@turf/buffer/-/buffer-6.5.0.tgz", + "integrity": "sha512-qeX4N6+PPWbKqp1AVkBVWFerGjMYMUyencwfnkCesoznU6qvfugFHNAngNqIBVnJjZ5n8IFyOf+akcxnrt9sNg==", "dependencies": { - "@turf/circle": "^6.5.0", - "@turf/destination": "^6.5.0", - "@turf/helpers": "^6.5.0" + "@turf/bbox": "^6.5.0", + "@turf/center": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/meta": "^6.5.0", + "@turf/projection": "^6.5.0", + "d3-geo": "1.7.1", + "turf-jsts": "*" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/line-arc/node_modules/@turf/helpers": { + "node_modules/@turf/center": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", + "resolved": "https://registry.npmjs.org/@turf/center/-/center-6.5.0.tgz", + "integrity": "sha512-T8KtMTfSATWcAX088rEDKjyvQCBkUsLnK/Txb6/8WUXIeOZyHu42G7MkdkHRoHtwieLdduDdmPLFyTdG5/e7ZQ==", + "dependencies": { + "@turf/bbox": "^6.5.0", + "@turf/helpers": "^6.5.0" + }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/line-chunk": { + "node_modules/@turf/center-mean": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/line-chunk/-/line-chunk-6.5.0.tgz", - "integrity": "sha512-i1FGE6YJaaYa+IJesTfyRRQZP31QouS+wh/pa6O3CC0q4T7LtHigyBSYjrbjSLfn2EVPYGlPCMFEqNWCOkC6zg==", + "resolved": "https://registry.npmjs.org/@turf/center-mean/-/center-mean-6.5.0.tgz", + "integrity": "sha512-AAX6f4bVn12pTVrMUiB9KrnV94BgeBKpyg3YpfnEbBpkN/znfVhL8dG8IxMAxAoSZ61Zt9WLY34HfENveuOZ7Q==", "dependencies": { + "@turf/bbox": "^6.5.0", "@turf/helpers": "^6.5.0", - "@turf/length": "^6.5.0", - "@turf/line-slice-along": "^6.5.0", "@turf/meta": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/line-chunk/node_modules/@turf/distance": { + "node_modules/@turf/center-median": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/distance/-/distance-6.5.0.tgz", - "integrity": "sha512-xzykSLfoURec5qvQJcfifw/1mJa+5UwByZZ5TZ8iaqjGYN0vomhV9aiSLeYdUGtYRESZ+DYC/OzY+4RclZYgMg==", + "resolved": "https://registry.npmjs.org/@turf/center-median/-/center-median-6.5.0.tgz", + "integrity": "sha512-dT8Ndu5CiZkPrj15PBvslpuf01ky41DEYEPxS01LOxp5HOUHXp1oJxsPxvc+i/wK4BwccPNzU1vzJ0S4emd1KQ==", "dependencies": { + "@turf/center-mean": "^6.5.0", + "@turf/centroid": "^6.5.0", + "@turf/distance": "^6.5.0", "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" + "@turf/meta": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/line-chunk/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/line-chunk/node_modules/@turf/invariant": { + "node_modules/@turf/center-of-mass": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", + "resolved": "https://registry.npmjs.org/@turf/center-of-mass/-/center-of-mass-6.5.0.tgz", + "integrity": "sha512-EWrriU6LraOfPN7m1jZi+1NLTKNkuIsGLZc2+Y8zbGruvUW+QV7K0nhf7iZWutlxHXTBqEXHbKue/o79IumAsQ==", "dependencies": { - "@turf/helpers": "^6.5.0" + "@turf/centroid": "^6.5.0", + "@turf/convex": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/meta": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/line-chunk/node_modules/@turf/length": { + "node_modules/@turf/centroid": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/length/-/length-6.5.0.tgz", - "integrity": "sha512-5pL5/pnw52fck3oRsHDcSGrj9HibvtlrZ0QNy2OcW8qBFDNgZ4jtl6U7eATVoyWPKBHszW3dWETW+iLV7UARig==", + "resolved": "https://registry.npmjs.org/@turf/centroid/-/centroid-6.5.0.tgz", + "integrity": "sha512-MwE1oq5E3isewPprEClbfU5pXljIK/GUOMbn22UM3IFPDJX0KeoyLNwghszkdmFp/qMGL/M13MMWvU+GNLXP/A==", "dependencies": { - "@turf/distance": "^6.5.0", "@turf/helpers": "^6.5.0", "@turf/meta": "^6.5.0" }, @@ -7157,33 +4271,34 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/line-intersect": { + "node_modules/@turf/circle": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/line-intersect/-/line-intersect-6.5.0.tgz", - "integrity": "sha512-CS6R1tZvVQD390G9Ea4pmpM6mJGPWoL82jD46y0q1KSor9s6HupMIo1kY4Ny+AEYQl9jd21V3Scz20eldpbTVA==", + "resolved": "https://registry.npmjs.org/@turf/circle/-/circle-6.5.0.tgz", + "integrity": "sha512-oU1+Kq9DgRnoSbWFHKnnUdTmtcRUMmHoV9DjTXu9vOLNV5OWtAAh1VZ+mzsioGGzoDNT/V5igbFOkMfBQc0B6A==", "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0", - "@turf/line-segment": "^6.5.0", - "@turf/meta": "^6.5.0", - "geojson-rbush": "3.x" + "@turf/destination": "^6.5.0", + "@turf/helpers": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/line-intersect/node_modules/@turf/helpers": { + "node_modules/@turf/clean-coords": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", + "resolved": "https://registry.npmjs.org/@turf/clean-coords/-/clean-coords-6.5.0.tgz", + "integrity": "sha512-EMX7gyZz0WTH/ET7xV8MyrExywfm9qUi0/MY89yNffzGIEHuFfqwhcCqZ8O00rZIPZHUTxpmsxQSTfzJJA1CPw==", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0" + }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/line-intersect/node_modules/@turf/invariant": { + "node_modules/@turf/clone": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", + "resolved": "https://registry.npmjs.org/@turf/clone/-/clone-6.5.0.tgz", + "integrity": "sha512-mzVtTFj/QycXOn6ig+annKrM6ZlimreKYz6f/GSERytOpgzodbQyOgkfwru100O1KQhhjSudKK4DsQ0oyi9cTw==", "dependencies": { "@turf/helpers": "^6.5.0" }, @@ -7191,135 +4306,145 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/line-offset": { + "node_modules/@turf/clusters": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/line-offset/-/line-offset-6.5.0.tgz", - "integrity": "sha512-CEXZbKgyz8r72qRvPchK0dxqsq8IQBdH275FE6o4MrBkzMcoZsfSjghtXzKaz9vvro+HfIXal0sTk2mqV1lQTw==", + "resolved": "https://registry.npmjs.org/@turf/clusters/-/clusters-6.5.0.tgz", + "integrity": "sha512-Y6gfnTJzQ1hdLfCsyd5zApNbfLIxYEpmDibHUqR5z03Lpe02pa78JtgrgUNt1seeO/aJ4TG1NLN8V5gOrHk04g==", "dependencies": { "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0", "@turf/meta": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/line-offset/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/line-offset/node_modules/@turf/invariant": { + "node_modules/@turf/clusters-dbscan": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", + "resolved": "https://registry.npmjs.org/@turf/clusters-dbscan/-/clusters-dbscan-6.5.0.tgz", + "integrity": "sha512-SxZEE4kADU9DqLRiT53QZBBhu8EP9skviSyl+FGj08Y01xfICM/RR9ACUdM0aEQimhpu+ZpRVcUK+2jtiCGrYQ==", "dependencies": { - "@turf/helpers": "^6.5.0" + "@turf/clone": "^6.5.0", + "@turf/distance": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/meta": "^6.5.0", + "density-clustering": "1.3.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/line-overlap": { + "node_modules/@turf/clusters-kmeans": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/line-overlap/-/line-overlap-6.5.0.tgz", - "integrity": "sha512-xHOaWLd0hkaC/1OLcStCpfq55lPHpPNadZySDXYiYjEz5HXr1oKmtMYpn0wGizsLwrOixRdEp+j7bL8dPt4ojQ==", + "resolved": "https://registry.npmjs.org/@turf/clusters-kmeans/-/clusters-kmeans-6.5.0.tgz", + "integrity": "sha512-DwacD5+YO8kwDPKaXwT9DV46tMBVNsbi1IzdajZu1JDSWoN7yc7N9Qt88oi+p30583O0UPVkAK+A10WAQv4mUw==", "dependencies": { - "@turf/boolean-point-on-line": "^6.5.0", + "@turf/clone": "^6.5.0", "@turf/helpers": "^6.5.0", "@turf/invariant": "^6.5.0", - "@turf/line-segment": "^6.5.0", "@turf/meta": "^6.5.0", - "@turf/nearest-point-on-line": "^6.5.0", - "deep-equal": "1.x", - "geojson-rbush": "3.x" + "skmeans": "0.9.7" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/line-overlap/node_modules/@turf/helpers": { + "node_modules/@turf/collect": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", + "resolved": "https://registry.npmjs.org/@turf/collect/-/collect-6.5.0.tgz", + "integrity": "sha512-4dN/T6LNnRg099m97BJeOcTA5fSI8cu87Ydgfibewd2KQwBexO69AnjEFqfPX3Wj+Zvisj1uAVIZbPmSSrZkjg==", + "dependencies": { + "@turf/bbox": "^6.5.0", + "@turf/boolean-point-in-polygon": "^6.5.0", + "@turf/helpers": "^6.5.0", + "rbush": "2.x" + }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/line-overlap/node_modules/@turf/invariant": { + "node_modules/@turf/combine": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", + "resolved": "https://registry.npmjs.org/@turf/combine/-/combine-6.5.0.tgz", + "integrity": "sha512-Q8EIC4OtAcHiJB3C4R+FpB4LANiT90t17uOd851qkM2/o6m39bfN5Mv0PWqMZIHWrrosZqRqoY9dJnzz/rJxYQ==", "dependencies": { - "@turf/helpers": "^6.5.0" + "@turf/helpers": "^6.5.0", + "@turf/meta": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/line-segment": { + "node_modules/@turf/concave": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/line-segment/-/line-segment-6.5.0.tgz", - "integrity": "sha512-jI625Ho4jSuJESNq66Mmi290ZJ5pPZiQZruPVpmHkUw257Pew0alMmb6YrqYNnLUuiVVONxAAKXUVeeUGtycfw==", + "resolved": "https://registry.npmjs.org/@turf/concave/-/concave-6.5.0.tgz", + "integrity": "sha512-I/sUmUC8TC5h/E2vPwxVht+nRt+TnXIPRoztDFvS8/Y0+cBDple9inLSo9nnPXMXidrBlGXZ9vQx/BjZUJgsRQ==", "dependencies": { + "@turf/clone": "^6.5.0", + "@turf/distance": "^6.5.0", "@turf/helpers": "^6.5.0", "@turf/invariant": "^6.5.0", - "@turf/meta": "^6.5.0" + "@turf/meta": "^6.5.0", + "@turf/tin": "^6.5.0", + "topojson-client": "3.x", + "topojson-server": "3.x" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/line-segment/node_modules/@turf/helpers": { + "node_modules/@turf/convex": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", + "resolved": "https://registry.npmjs.org/@turf/convex/-/convex-6.5.0.tgz", + "integrity": "sha512-x7ZwC5z7PJB0SBwNh7JCeCNx7Iu+QSrH7fYgK0RhhNop13TqUlvHMirMLRgf2db1DqUetrAO2qHJeIuasquUWg==", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/meta": "^6.5.0", + "concaveman": "*" + }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/line-segment/node_modules/@turf/invariant": { + "node_modules/@turf/destination": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", + "resolved": "https://registry.npmjs.org/@turf/destination/-/destination-6.5.0.tgz", + "integrity": "sha512-4cnWQlNC8d1tItOz9B4pmJdWpXqS0vEvv65bI/Pj/genJnsL7evI0/Xw42RvEGROS481MPiU80xzvwxEvhQiMQ==", "dependencies": { - "@turf/helpers": "^6.5.0" + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/line-slice": { + "node_modules/@turf/difference": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/line-slice/-/line-slice-6.5.0.tgz", - "integrity": "sha512-vDqJxve9tBHhOaVVFXqVjF5qDzGtKWviyjbyi2QnSnxyFAmLlLnBfMX8TLQCAf2GxHibB95RO5FBE6I2KVPRuw==", + "resolved": "https://registry.npmjs.org/@turf/difference/-/difference-6.5.0.tgz", + "integrity": "sha512-l8iR5uJqvI+5Fs6leNbhPY5t/a3vipUF/3AeVLpwPQcgmedNXyheYuy07PcMGH5Jdpi5gItOiTqwiU/bUH4b3A==", "dependencies": { "@turf/helpers": "^6.5.0", "@turf/invariant": "^6.5.0", - "@turf/nearest-point-on-line": "^6.5.0" + "polygon-clipping": "^0.15.3" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/line-slice-along": { + "node_modules/@turf/dissolve": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/line-slice-along/-/line-slice-along-6.5.0.tgz", - "integrity": "sha512-KHJRU6KpHrAj+BTgTNqby6VCTnDzG6a1sJx/I3hNvqMBLvWVA2IrkR9L9DtsQsVY63IBwVdQDqiwCuZLDQh4Ng==", + "resolved": "https://registry.npmjs.org/@turf/dissolve/-/dissolve-6.5.0.tgz", + "integrity": "sha512-WBVbpm9zLTp0Bl9CE35NomTaOL1c4TQCtEoO43YaAhNEWJOOIhZMFJyr8mbvYruKl817KinT3x7aYjjCMjTAsQ==", "dependencies": { - "@turf/bearing": "^6.5.0", - "@turf/destination": "^6.5.0", - "@turf/distance": "^6.5.0", - "@turf/helpers": "^6.5.0" + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/meta": "^6.5.0", + "polygon-clipping": "^0.15.3" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/line-slice-along/node_modules/@turf/distance": { + "node_modules/@turf/distance": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/distance/-/distance-6.5.0.tgz", "integrity": "sha512-xzykSLfoURec5qvQJcfifw/1mJa+5UwByZZ5TZ8iaqjGYN0vomhV9aiSLeYdUGtYRESZ+DYC/OzY+4RclZYgMg==", @@ -7331,90 +4456,89 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/line-slice-along/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/line-slice-along/node_modules/@turf/invariant": { + "node_modules/@turf/distance-weight": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", + "resolved": "https://registry.npmjs.org/@turf/distance-weight/-/distance-weight-6.5.0.tgz", + "integrity": "sha512-a8qBKkgVNvPKBfZfEJZnC3DV7dfIsC3UIdpRci/iap/wZLH41EmS90nM+BokAJflUHYy8PqE44wySGWHN1FXrQ==", "dependencies": { - "@turf/helpers": "^6.5.0" + "@turf/centroid": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/meta": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/line-slice/node_modules/@turf/helpers": { + "node_modules/@turf/ellipse": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", + "resolved": "https://registry.npmjs.org/@turf/ellipse/-/ellipse-6.5.0.tgz", + "integrity": "sha512-kuXtwFviw/JqnyJXF1mrR/cb496zDTSbGKtSiolWMNImYzGGkbsAsFTjwJYgD7+4FixHjp0uQPzo70KDf3AIBw==", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/rhumb-destination": "^6.5.0", + "@turf/transform-rotate": "^6.5.0" + }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/line-slice/node_modules/@turf/invariant": { + "node_modules/@turf/envelope": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", + "resolved": "https://registry.npmjs.org/@turf/envelope/-/envelope-6.5.0.tgz", + "integrity": "sha512-9Z+FnBWvOGOU4X+fMZxYFs1HjFlkKqsddLuMknRaqcJd6t+NIv5DWvPtDL8ATD2GEExYDiFLwMdckfr1yqJgHA==", "dependencies": { + "@turf/bbox": "^6.5.0", + "@turf/bbox-polygon": "^6.5.0", "@turf/helpers": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/line-split": { + "node_modules/@turf/explode": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/line-split/-/line-split-6.5.0.tgz", - "integrity": "sha512-/rwUMVr9OI2ccJjw7/6eTN53URtGThNSD5I0GgxyFXMtxWiloRJ9MTff8jBbtPWrRka/Sh2GkwucVRAEakx9Sw==", + "resolved": "https://registry.npmjs.org/@turf/explode/-/explode-6.5.0.tgz", + "integrity": "sha512-6cSvMrnHm2qAsace6pw9cDmK2buAlw8+tjeJVXMfMyY+w7ZUi1rprWMsY92J7s2Dar63Bv09n56/1V7+tcj52Q==", "dependencies": { - "@turf/bbox": "^6.5.0", "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0", - "@turf/line-intersect": "^6.5.0", - "@turf/line-segment": "^6.5.0", - "@turf/meta": "^6.5.0", - "@turf/nearest-point-on-line": "^6.5.0", - "@turf/square": "^6.5.0", - "@turf/truncate": "^6.5.0", - "geojson-rbush": "3.x" + "@turf/meta": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/line-split/node_modules/@turf/helpers": { + "node_modules/@turf/flatten": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", + "resolved": "https://registry.npmjs.org/@turf/flatten/-/flatten-6.5.0.tgz", + "integrity": "sha512-IBZVwoNLVNT6U/bcUUllubgElzpMsNoCw8tLqBw6dfYg9ObGmpEjf9BIYLr7a2Yn5ZR4l7YIj2T7kD5uJjZADQ==", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/meta": "^6.5.0" + }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/line-split/node_modules/@turf/invariant": { + "node_modules/@turf/flip": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", + "resolved": "https://registry.npmjs.org/@turf/flip/-/flip-6.5.0.tgz", + "integrity": "sha512-oyikJFNjt2LmIXQqgOGLvt70RgE2lyzPMloYWM7OR5oIFGRiBvqVD2hA6MNw6JewIm30fWZ8DQJw1NHXJTJPbg==", "dependencies": { - "@turf/helpers": "^6.5.0" + "@turf/clone": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/meta": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/line-to-polygon": { + "node_modules/@turf/great-circle": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/line-to-polygon/-/line-to-polygon-6.5.0.tgz", - "integrity": "sha512-qYBuRCJJL8Gx27OwCD1TMijM/9XjRgXH/m/TyuND4OXedBpIWlK5VbTIO2gJ8OCfznBBddpjiObLBrkuxTpN4Q==", + "resolved": "https://registry.npmjs.org/@turf/great-circle/-/great-circle-6.5.0.tgz", + "integrity": "sha512-7ovyi3HaKOXdFyN7yy1yOMa8IyOvV46RC1QOQTT+RYUN8ke10eyqExwBpL9RFUPvlpoTzoYbM/+lWPogQlFncg==", "dependencies": { - "@turf/bbox": "^6.5.0", - "@turf/clone": "^6.5.0", "@turf/helpers": "^6.5.0", "@turf/invariant": "^6.5.0" }, @@ -7422,7 +4546,7 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/line-to-polygon/node_modules/@turf/helpers": { + "node_modules/@turf/helpers": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", @@ -7430,41 +4554,58 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/line-to-polygon/node_modules/@turf/invariant": { + "node_modules/@turf/hex-grid": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", + "resolved": "https://registry.npmjs.org/@turf/hex-grid/-/hex-grid-6.5.0.tgz", + "integrity": "sha512-Ln3tc2tgZT8etDOldgc6e741Smg1CsMKAz1/Mlel+MEL5Ynv2mhx3m0q4J9IB1F3a4MNjDeVvm8drAaf9SF33g==", "dependencies": { - "@turf/helpers": "^6.5.0" + "@turf/distance": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/intersect": "^6.5.0", + "@turf/invariant": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/mask": { + "node_modules/@turf/interpolate": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/mask/-/mask-6.5.0.tgz", - "integrity": "sha512-RQha4aU8LpBrmrkH8CPaaoAfk0Egj5OuXtv6HuCQnHeGNOQt3TQVibTA3Sh4iduq4EPxnZfDjgsOeKtrCA19lg==", + "resolved": "https://registry.npmjs.org/@turf/interpolate/-/interpolate-6.5.0.tgz", + "integrity": "sha512-LSH5fMeiGyuDZ4WrDJNgh81d2DnNDUVJtuFryJFup8PV8jbs46lQGfI3r1DJ2p1IlEJIz3pmAZYeTfMMoeeohw==", "dependencies": { + "@turf/bbox": "^6.5.0", + "@turf/centroid": "^6.5.0", + "@turf/clone": "^6.5.0", + "@turf/distance": "^6.5.0", "@turf/helpers": "^6.5.0", - "polygon-clipping": "^0.15.3" + "@turf/hex-grid": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/meta": "^6.5.0", + "@turf/point-grid": "^6.5.0", + "@turf/square-grid": "^6.5.0", + "@turf/triangle-grid": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/mask/node_modules/@turf/helpers": { + "node_modules/@turf/intersect": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", + "resolved": "https://registry.npmjs.org/@turf/intersect/-/intersect-6.5.0.tgz", + "integrity": "sha512-2legGJeKrfFkzntcd4GouPugoqPUjexPZnOvfez+3SfIMrHvulw8qV8u7pfVyn2Yqs53yoVCEjS5sEpvQ5YRQg==", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "polygon-clipping": "^0.15.3" + }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/meta": { + "node_modules/@turf/invariant": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/meta/-/meta-6.5.0.tgz", - "integrity": "sha512-RrArvtsV0vdsCBegoBtOalgdSOfkBrTJ07VkpiCnq/491W67hnMWmDu7e6Ztw0C3WldRYTXkg3SumfdzZxLBHA==", + "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", + "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", "dependencies": { "@turf/helpers": "^6.5.0" }, @@ -7472,278 +4613,327 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/meta/node_modules/@turf/helpers": { + "node_modules/@turf/isobands": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", + "resolved": "https://registry.npmjs.org/@turf/isobands/-/isobands-6.5.0.tgz", + "integrity": "sha512-4h6sjBPhRwMVuFaVBv70YB7eGz+iw0bhPRnp+8JBdX1UPJSXhoi/ZF2rACemRUr0HkdVB/a1r9gC32vn5IAEkw==", + "dependencies": { + "@turf/area": "^6.5.0", + "@turf/bbox": "^6.5.0", + "@turf/boolean-point-in-polygon": "^6.5.0", + "@turf/explode": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/meta": "^6.5.0", + "object-assign": "*" + }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/midpoint": { + "node_modules/@turf/isolines": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/midpoint/-/midpoint-6.5.0.tgz", - "integrity": "sha512-MyTzV44IwmVI6ec9fB2OgZ53JGNlgOpaYl9ArKoF49rXpL84F9rNATndbe0+MQIhdkw8IlzA6xVP4lZzfMNVCw==", + "resolved": "https://registry.npmjs.org/@turf/isolines/-/isolines-6.5.0.tgz", + "integrity": "sha512-6ElhiLCopxWlv4tPoxiCzASWt/jMRvmp6mRYrpzOm3EUl75OhHKa/Pu6Y9nWtCMmVC/RcWtiiweUocbPLZLm0A==", "dependencies": { - "@turf/bearing": "^6.5.0", - "@turf/destination": "^6.5.0", - "@turf/distance": "^6.5.0", - "@turf/helpers": "^6.5.0" + "@turf/bbox": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/meta": "^6.5.0", + "object-assign": "*" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/midpoint/node_modules/@turf/distance": { + "node_modules/@turf/kinks": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/distance/-/distance-6.5.0.tgz", - "integrity": "sha512-xzykSLfoURec5qvQJcfifw/1mJa+5UwByZZ5TZ8iaqjGYN0vomhV9aiSLeYdUGtYRESZ+DYC/OzY+4RclZYgMg==", + "resolved": "https://registry.npmjs.org/@turf/kinks/-/kinks-6.5.0.tgz", + "integrity": "sha512-ViCngdPt1eEL7hYUHR2eHR662GvCgTc35ZJFaNR6kRtr6D8plLaDju0FILeFFWSc+o8e3fwxZEJKmFj9IzPiIQ==", "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" + "@turf/helpers": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/midpoint/node_modules/@turf/helpers": { + "node_modules/@turf/length": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", + "resolved": "https://registry.npmjs.org/@turf/length/-/length-6.5.0.tgz", + "integrity": "sha512-5pL5/pnw52fck3oRsHDcSGrj9HibvtlrZ0QNy2OcW8qBFDNgZ4jtl6U7eATVoyWPKBHszW3dWETW+iLV7UARig==", + "dependencies": { + "@turf/distance": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/meta": "^6.5.0" + }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/midpoint/node_modules/@turf/invariant": { + "node_modules/@turf/line-arc": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", + "resolved": "https://registry.npmjs.org/@turf/line-arc/-/line-arc-6.5.0.tgz", + "integrity": "sha512-I6c+V6mIyEwbtg9P9zSFF89T7QPe1DPTG3MJJ6Cm1MrAY0MdejwQKOpsvNl8LDU2ekHOlz2kHpPVR7VJsoMllA==", "dependencies": { + "@turf/circle": "^6.5.0", + "@turf/destination": "^6.5.0", "@turf/helpers": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/moran-index": { + "node_modules/@turf/line-chunk": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/moran-index/-/moran-index-6.5.0.tgz", - "integrity": "sha512-ItsnhrU2XYtTtTudrM8so4afBCYWNaB0Mfy28NZwLjB5jWuAsvyV+YW+J88+neK/ougKMTawkmjQqodNJaBeLQ==", + "resolved": "https://registry.npmjs.org/@turf/line-chunk/-/line-chunk-6.5.0.tgz", + "integrity": "sha512-i1FGE6YJaaYa+IJesTfyRRQZP31QouS+wh/pa6O3CC0q4T7LtHigyBSYjrbjSLfn2EVPYGlPCMFEqNWCOkC6zg==", "dependencies": { - "@turf/distance-weight": "^6.5.0", "@turf/helpers": "^6.5.0", + "@turf/length": "^6.5.0", + "@turf/line-slice-along": "^6.5.0", "@turf/meta": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/moran-index/node_modules/@turf/helpers": { + "node_modules/@turf/line-intersect": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", + "resolved": "https://registry.npmjs.org/@turf/line-intersect/-/line-intersect-6.5.0.tgz", + "integrity": "sha512-CS6R1tZvVQD390G9Ea4pmpM6mJGPWoL82jD46y0q1KSor9s6HupMIo1kY4Ny+AEYQl9jd21V3Scz20eldpbTVA==", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/line-segment": "^6.5.0", + "@turf/meta": "^6.5.0", + "geojson-rbush": "3.x" + }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/nearest-point": { + "node_modules/@turf/line-offset": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/nearest-point/-/nearest-point-6.5.0.tgz", - "integrity": "sha512-fguV09QxilZv/p94s8SMsXILIAMiaXI5PATq9d7YWijLxWUj6Q/r43kxyoi78Zmwwh1Zfqz9w+bCYUAxZ5+euA==", + "resolved": "https://registry.npmjs.org/@turf/line-offset/-/line-offset-6.5.0.tgz", + "integrity": "sha512-CEXZbKgyz8r72qRvPchK0dxqsq8IQBdH275FE6o4MrBkzMcoZsfSjghtXzKaz9vvro+HfIXal0sTk2mqV1lQTw==", "dependencies": { - "@turf/clone": "^6.5.0", - "@turf/distance": "^6.5.0", "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", "@turf/meta": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/nearest-point-on-line": { + "node_modules/@turf/line-overlap": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/nearest-point-on-line/-/nearest-point-on-line-6.5.0.tgz", - "integrity": "sha512-WthrvddddvmymnC+Vf7BrkHGbDOUu6Z3/6bFYUGv1kxw8tiZ6n83/VG6kHz4poHOfS0RaNflzXSkmCi64fLBlg==", + "resolved": "https://registry.npmjs.org/@turf/line-overlap/-/line-overlap-6.5.0.tgz", + "integrity": "sha512-xHOaWLd0hkaC/1OLcStCpfq55lPHpPNadZySDXYiYjEz5HXr1oKmtMYpn0wGizsLwrOixRdEp+j7bL8dPt4ojQ==", "dependencies": { - "@turf/bearing": "^6.5.0", - "@turf/destination": "^6.5.0", - "@turf/distance": "^6.5.0", + "@turf/boolean-point-on-line": "^6.5.0", "@turf/helpers": "^6.5.0", "@turf/invariant": "^6.5.0", - "@turf/line-intersect": "^6.5.0", - "@turf/meta": "^6.5.0" + "@turf/line-segment": "^6.5.0", + "@turf/meta": "^6.5.0", + "@turf/nearest-point-on-line": "^6.5.0", + "deep-equal": "1.x", + "geojson-rbush": "3.x" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/nearest-point-on-line/node_modules/@turf/distance": { + "node_modules/@turf/line-segment": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/distance/-/distance-6.5.0.tgz", - "integrity": "sha512-xzykSLfoURec5qvQJcfifw/1mJa+5UwByZZ5TZ8iaqjGYN0vomhV9aiSLeYdUGtYRESZ+DYC/OzY+4RclZYgMg==", + "resolved": "https://registry.npmjs.org/@turf/line-segment/-/line-segment-6.5.0.tgz", + "integrity": "sha512-jI625Ho4jSuJESNq66Mmi290ZJ5pPZiQZruPVpmHkUw257Pew0alMmb6YrqYNnLUuiVVONxAAKXUVeeUGtycfw==", "dependencies": { "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" + "@turf/invariant": "^6.5.0", + "@turf/meta": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/nearest-point-on-line/node_modules/@turf/helpers": { + "node_modules/@turf/line-slice": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", + "resolved": "https://registry.npmjs.org/@turf/line-slice/-/line-slice-6.5.0.tgz", + "integrity": "sha512-vDqJxve9tBHhOaVVFXqVjF5qDzGtKWviyjbyi2QnSnxyFAmLlLnBfMX8TLQCAf2GxHibB95RO5FBE6I2KVPRuw==", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/nearest-point-on-line": "^6.5.0" + }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/nearest-point-on-line/node_modules/@turf/invariant": { + "node_modules/@turf/line-slice-along": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", + "resolved": "https://registry.npmjs.org/@turf/line-slice-along/-/line-slice-along-6.5.0.tgz", + "integrity": "sha512-KHJRU6KpHrAj+BTgTNqby6VCTnDzG6a1sJx/I3hNvqMBLvWVA2IrkR9L9DtsQsVY63IBwVdQDqiwCuZLDQh4Ng==", "dependencies": { + "@turf/bearing": "^6.5.0", + "@turf/destination": "^6.5.0", + "@turf/distance": "^6.5.0", "@turf/helpers": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/nearest-point-to-line": { + "node_modules/@turf/line-split": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/nearest-point-to-line/-/nearest-point-to-line-6.5.0.tgz", - "integrity": "sha512-PXV7cN0BVzUZdjj6oeb/ESnzXSfWmEMrsfZSDRgqyZ9ytdiIj/eRsnOXLR13LkTdXVOJYDBuf7xt1mLhM4p6+Q==", + "resolved": "https://registry.npmjs.org/@turf/line-split/-/line-split-6.5.0.tgz", + "integrity": "sha512-/rwUMVr9OI2ccJjw7/6eTN53URtGThNSD5I0GgxyFXMtxWiloRJ9MTff8jBbtPWrRka/Sh2GkwucVRAEakx9Sw==", "dependencies": { + "@turf/bbox": "^6.5.0", "@turf/helpers": "^6.5.0", "@turf/invariant": "^6.5.0", + "@turf/line-intersect": "^6.5.0", + "@turf/line-segment": "^6.5.0", "@turf/meta": "^6.5.0", - "@turf/point-to-line-distance": "^6.5.0", - "object-assign": "*" + "@turf/nearest-point-on-line": "^6.5.0", + "@turf/square": "^6.5.0", + "@turf/truncate": "^6.5.0", + "geojson-rbush": "3.x" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/nearest-point-to-line/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/nearest-point-to-line/node_modules/@turf/invariant": { + "node_modules/@turf/line-to-polygon": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", + "resolved": "https://registry.npmjs.org/@turf/line-to-polygon/-/line-to-polygon-6.5.0.tgz", + "integrity": "sha512-qYBuRCJJL8Gx27OwCD1TMijM/9XjRgXH/m/TyuND4OXedBpIWlK5VbTIO2gJ8OCfznBBddpjiObLBrkuxTpN4Q==", "dependencies": { - "@turf/helpers": "^6.5.0" + "@turf/bbox": "^6.5.0", + "@turf/clone": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/nearest-point/node_modules/@turf/distance": { + "node_modules/@turf/mask": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/distance/-/distance-6.5.0.tgz", - "integrity": "sha512-xzykSLfoURec5qvQJcfifw/1mJa+5UwByZZ5TZ8iaqjGYN0vomhV9aiSLeYdUGtYRESZ+DYC/OzY+4RclZYgMg==", + "resolved": "https://registry.npmjs.org/@turf/mask/-/mask-6.5.0.tgz", + "integrity": "sha512-RQha4aU8LpBrmrkH8CPaaoAfk0Egj5OuXtv6HuCQnHeGNOQt3TQVibTA3Sh4iduq4EPxnZfDjgsOeKtrCA19lg==", "dependencies": { "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" + "polygon-clipping": "^0.15.3" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/nearest-point/node_modules/@turf/helpers": { + "node_modules/@turf/meta": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", + "resolved": "https://registry.npmjs.org/@turf/meta/-/meta-6.5.0.tgz", + "integrity": "sha512-RrArvtsV0vdsCBegoBtOalgdSOfkBrTJ07VkpiCnq/491W67hnMWmDu7e6Ztw0C3WldRYTXkg3SumfdzZxLBHA==", + "dependencies": { + "@turf/helpers": "^6.5.0" + }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/nearest-point/node_modules/@turf/invariant": { + "node_modules/@turf/midpoint": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", + "resolved": "https://registry.npmjs.org/@turf/midpoint/-/midpoint-6.5.0.tgz", + "integrity": "sha512-MyTzV44IwmVI6ec9fB2OgZ53JGNlgOpaYl9ArKoF49rXpL84F9rNATndbe0+MQIhdkw8IlzA6xVP4lZzfMNVCw==", "dependencies": { + "@turf/bearing": "^6.5.0", + "@turf/destination": "^6.5.0", + "@turf/distance": "^6.5.0", "@turf/helpers": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/planepoint": { + "node_modules/@turf/moran-index": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/planepoint/-/planepoint-6.5.0.tgz", - "integrity": "sha512-R3AahA6DUvtFbka1kcJHqZ7DMHmPXDEQpbU5WaglNn7NaCQg9HB0XM0ZfqWcd5u92YXV+Gg8QhC8x5XojfcM4Q==", + "resolved": "https://registry.npmjs.org/@turf/moran-index/-/moran-index-6.5.0.tgz", + "integrity": "sha512-ItsnhrU2XYtTtTudrM8so4afBCYWNaB0Mfy28NZwLjB5jWuAsvyV+YW+J88+neK/ougKMTawkmjQqodNJaBeLQ==", "dependencies": { + "@turf/distance-weight": "^6.5.0", "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" + "@turf/meta": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/planepoint/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/planepoint/node_modules/@turf/invariant": { + "node_modules/@turf/nearest-point": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", + "resolved": "https://registry.npmjs.org/@turf/nearest-point/-/nearest-point-6.5.0.tgz", + "integrity": "sha512-fguV09QxilZv/p94s8SMsXILIAMiaXI5PATq9d7YWijLxWUj6Q/r43kxyoi78Zmwwh1Zfqz9w+bCYUAxZ5+euA==", "dependencies": { - "@turf/helpers": "^6.5.0" + "@turf/clone": "^6.5.0", + "@turf/distance": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/meta": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/point-grid": { + "node_modules/@turf/nearest-point-on-line": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/point-grid/-/point-grid-6.5.0.tgz", - "integrity": "sha512-Iq38lFokNNtQJnOj/RBKmyt6dlof0yhaHEDELaWHuECm1lIZLY3ZbVMwbs+nXkwTAHjKfS/OtMheUBkw+ee49w==", + "resolved": "https://registry.npmjs.org/@turf/nearest-point-on-line/-/nearest-point-on-line-6.5.0.tgz", + "integrity": "sha512-WthrvddddvmymnC+Vf7BrkHGbDOUu6Z3/6bFYUGv1kxw8tiZ6n83/VG6kHz4poHOfS0RaNflzXSkmCi64fLBlg==", "dependencies": { - "@turf/boolean-within": "^6.5.0", + "@turf/bearing": "^6.5.0", + "@turf/destination": "^6.5.0", "@turf/distance": "^6.5.0", "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" + "@turf/invariant": "^6.5.0", + "@turf/line-intersect": "^6.5.0", + "@turf/meta": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/point-grid/node_modules/@turf/distance": { + "node_modules/@turf/nearest-point-to-line": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/distance/-/distance-6.5.0.tgz", - "integrity": "sha512-xzykSLfoURec5qvQJcfifw/1mJa+5UwByZZ5TZ8iaqjGYN0vomhV9aiSLeYdUGtYRESZ+DYC/OzY+4RclZYgMg==", + "resolved": "https://registry.npmjs.org/@turf/nearest-point-to-line/-/nearest-point-to-line-6.5.0.tgz", + "integrity": "sha512-PXV7cN0BVzUZdjj6oeb/ESnzXSfWmEMrsfZSDRgqyZ9ytdiIj/eRsnOXLR13LkTdXVOJYDBuf7xt1mLhM4p6+Q==", "dependencies": { "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" + "@turf/invariant": "^6.5.0", + "@turf/meta": "^6.5.0", + "@turf/point-to-line-distance": "^6.5.0", + "object-assign": "*" }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/point-grid/node_modules/@turf/helpers": { + "node_modules/@turf/planepoint": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", + "resolved": "https://registry.npmjs.org/@turf/planepoint/-/planepoint-6.5.0.tgz", + "integrity": "sha512-R3AahA6DUvtFbka1kcJHqZ7DMHmPXDEQpbU5WaglNn7NaCQg9HB0XM0ZfqWcd5u92YXV+Gg8QhC8x5XojfcM4Q==", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0" + }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/point-grid/node_modules/@turf/invariant": { + "node_modules/@turf/point-grid": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", + "resolved": "https://registry.npmjs.org/@turf/point-grid/-/point-grid-6.5.0.tgz", + "integrity": "sha512-Iq38lFokNNtQJnOj/RBKmyt6dlof0yhaHEDELaWHuECm1lIZLY3ZbVMwbs+nXkwTAHjKfS/OtMheUBkw+ee49w==", "dependencies": { - "@turf/helpers": "^6.5.0" + "@turf/boolean-within": "^6.5.0", + "@turf/distance": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" @@ -7764,14 +4954,6 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/point-on-feature/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, "node_modules/@turf/point-to-line-distance": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/point-to-line-distance/-/point-to-line-distance-6.5.0.tgz", @@ -7790,37 +4972,6 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/point-to-line-distance/node_modules/@turf/distance": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/distance/-/distance-6.5.0.tgz", - "integrity": "sha512-xzykSLfoURec5qvQJcfifw/1mJa+5UwByZZ5TZ8iaqjGYN0vomhV9aiSLeYdUGtYRESZ+DYC/OzY+4RclZYgMg==", - "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/point-to-line-distance/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/point-to-line-distance/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, "node_modules/@turf/points-within-polygon": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/points-within-polygon/-/points-within-polygon-6.5.0.tgz", @@ -7834,14 +4985,6 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/points-within-polygon/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, "node_modules/@turf/polygon-smooth": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/polygon-smooth/-/polygon-smooth-6.5.0.tgz", @@ -7854,14 +4997,6 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/polygon-smooth/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, "node_modules/@turf/polygon-tangents": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/polygon-tangents/-/polygon-tangents-6.5.0.tgz", @@ -7869,60 +5004,22 @@ "dependencies": { "@turf/bbox": "^6.5.0", "@turf/boolean-within": "^6.5.0", - "@turf/explode": "^6.5.0", - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0", - "@turf/nearest-point": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/polygon-tangents/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/polygon-tangents/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/polygon-to-line": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/polygon-to-line/-/polygon-to-line-6.5.0.tgz", - "integrity": "sha512-5p4n/ij97EIttAq+ewSnKt0ruvuM+LIDzuczSzuHTpq4oS7Oq8yqg5TQ4nzMVuK41r/tALCk7nAoBuw3Su4Gcw==", - "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/polygon-to-line/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", + "@turf/explode": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/nearest-point": "^6.5.0" + }, "funding": { "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/polygon-to-line/node_modules/@turf/invariant": { + "node_modules/@turf/polygon-to-line": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", + "resolved": "https://registry.npmjs.org/@turf/polygon-to-line/-/polygon-to-line-6.5.0.tgz", + "integrity": "sha512-5p4n/ij97EIttAq+ewSnKt0ruvuM+LIDzuczSzuHTpq4oS7Oq8yqg5TQ4nzMVuK41r/tALCk7nAoBuw3Su4Gcw==", "dependencies": { - "@turf/helpers": "^6.5.0" + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" @@ -7943,25 +5040,6 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/polygonize/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/polygonize/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, "node_modules/@turf/projection": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/projection/-/projection-6.5.0.tgz", @@ -7975,14 +5053,6 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/projection/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, "node_modules/@turf/random": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/random/-/random-6.5.0.tgz", @@ -7994,14 +5064,6 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/random/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, "node_modules/@turf/rectangle-grid": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/rectangle-grid/-/rectangle-grid-6.5.0.tgz", @@ -8015,37 +5077,6 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/rectangle-grid/node_modules/@turf/distance": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/distance/-/distance-6.5.0.tgz", - "integrity": "sha512-xzykSLfoURec5qvQJcfifw/1mJa+5UwByZZ5TZ8iaqjGYN0vomhV9aiSLeYdUGtYRESZ+DYC/OzY+4RclZYgMg==", - "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/rectangle-grid/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/rectangle-grid/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, "node_modules/@turf/rewind": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/rewind/-/rewind-6.5.0.tgz", @@ -8061,25 +5092,6 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/rewind/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/rewind/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, "node_modules/@turf/rhumb-bearing": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/rhumb-bearing/-/rhumb-bearing-6.5.0.tgz", @@ -8092,25 +5104,6 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/rhumb-bearing/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/rhumb-bearing/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, "node_modules/@turf/rhumb-destination": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/rhumb-destination/-/rhumb-destination-6.5.0.tgz", @@ -8123,25 +5116,6 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/rhumb-destination/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/rhumb-destination/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, "node_modules/@turf/rhumb-distance": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/rhumb-distance/-/rhumb-distance-6.5.0.tgz", @@ -8154,25 +5128,6 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/rhumb-distance/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/rhumb-distance/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, "node_modules/@turf/sample": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/sample/-/sample-6.5.0.tgz", @@ -8184,14 +5139,6 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/sample/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, "node_modules/@turf/sector": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/sector/-/sector-6.5.0.tgz", @@ -8207,25 +5154,6 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/sector/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/sector/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, "node_modules/@turf/shortest-path": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/shortest-path/-/shortest-path-6.5.0.tgz", @@ -8245,37 +5173,6 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/shortest-path/node_modules/@turf/distance": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/distance/-/distance-6.5.0.tgz", - "integrity": "sha512-xzykSLfoURec5qvQJcfifw/1mJa+5UwByZZ5TZ8iaqjGYN0vomhV9aiSLeYdUGtYRESZ+DYC/OzY+4RclZYgMg==", - "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/shortest-path/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/shortest-path/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, "node_modules/@turf/simplify": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/simplify/-/simplify-6.5.0.tgz", @@ -8290,14 +5187,6 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/simplify/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, "node_modules/@turf/square": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/square/-/square-6.5.0.tgz", @@ -8322,75 +5211,17 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/square-grid/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/square/node_modules/@turf/distance": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/distance/-/distance-6.5.0.tgz", - "integrity": "sha512-xzykSLfoURec5qvQJcfifw/1mJa+5UwByZZ5TZ8iaqjGYN0vomhV9aiSLeYdUGtYRESZ+DYC/OzY+4RclZYgMg==", - "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/square/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/square/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, "node_modules/@turf/standard-deviational-ellipse": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/standard-deviational-ellipse/-/standard-deviational-ellipse-6.5.0.tgz", "integrity": "sha512-02CAlz8POvGPFK2BKK8uHGUk/LXb0MK459JVjKxLC2yJYieOBTqEbjP0qaWhiBhGzIxSMaqe8WxZ0KvqdnstHA==", "dependencies": { - "@turf/center-mean": "^6.5.0", - "@turf/ellipse": "^6.5.0", - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0", - "@turf/meta": "^6.5.0", - "@turf/points-within-polygon": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/standard-deviational-ellipse/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/standard-deviational-ellipse/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" + "@turf/center-mean": "^6.5.0", + "@turf/ellipse": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/meta": "^6.5.0", + "@turf/points-within-polygon": "^6.5.0" }, "funding": { "url": "https://opencollective.com/turf" @@ -8410,14 +5241,6 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/tag/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, "node_modules/@turf/tesselate": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/tesselate/-/tesselate-6.5.0.tgz", @@ -8430,14 +5253,6 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/tesselate/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, "node_modules/@turf/tin": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/tin/-/tin-6.5.0.tgz", @@ -8449,14 +5264,6 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/tin/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, "node_modules/@turf/transform-rotate": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/transform-rotate/-/transform-rotate-6.5.0.tgz", @@ -8475,25 +5282,6 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/transform-rotate/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/transform-rotate/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, "node_modules/@turf/transform-scale": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/transform-scale/-/transform-scale-6.5.0.tgz", @@ -8514,25 +5302,6 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/transform-scale/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/transform-scale/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, "node_modules/@turf/transform-translate": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/transform-translate/-/transform-translate-6.5.0.tgz", @@ -8548,25 +5317,6 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/transform-translate/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/transform-translate/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, "node_modules/@turf/triangle-grid": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/triangle-grid/-/triangle-grid-6.5.0.tgz", @@ -8580,37 +5330,6 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/triangle-grid/node_modules/@turf/distance": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/distance/-/distance-6.5.0.tgz", - "integrity": "sha512-xzykSLfoURec5qvQJcfifw/1mJa+5UwByZZ5TZ8iaqjGYN0vomhV9aiSLeYdUGtYRESZ+DYC/OzY+4RclZYgMg==", - "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/triangle-grid/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/triangle-grid/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, "node_modules/@turf/truncate": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/truncate/-/truncate-6.5.0.tgz", @@ -8623,14 +5342,6 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/truncate/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, "node_modules/@turf/turf": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/turf/-/turf-6.5.0.tgz", @@ -8746,62 +5457,6 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/turf/node_modules/@turf/area": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/area/-/area-6.5.0.tgz", - "integrity": "sha512-xCZdiuojokLbQ+29qR6qoMD89hv+JAgWjLrwSEWL+3JV8IXKeNFl6XkEJz9HGkVpnXvQKJoRz4/liT+8ZZ5Jyg==", - "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/meta": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/turf/node_modules/@turf/distance": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/distance/-/distance-6.5.0.tgz", - "integrity": "sha512-xzykSLfoURec5qvQJcfifw/1mJa+5UwByZZ5TZ8iaqjGYN0vomhV9aiSLeYdUGtYRESZ+DYC/OzY+4RclZYgMg==", - "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/invariant": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/turf/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/turf/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/turf/node_modules/@turf/length": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/length/-/length-6.5.0.tgz", - "integrity": "sha512-5pL5/pnw52fck3oRsHDcSGrj9HibvtlrZ0QNy2OcW8qBFDNgZ4jtl6U7eATVoyWPKBHszW3dWETW+iLV7UARig==", - "dependencies": { - "@turf/distance": "^6.5.0", - "@turf/helpers": "^6.5.0", - "@turf/meta": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, "node_modules/@turf/union": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/union/-/union-6.5.0.tgz", @@ -8815,25 +5470,6 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/union/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/union/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, "node_modules/@turf/unkink-polygon": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/unkink-polygon/-/unkink-polygon-6.5.0.tgz", @@ -8849,39 +5485,6 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/unkink-polygon/node_modules/@turf/area": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/area/-/area-6.5.0.tgz", - "integrity": "sha512-xCZdiuojokLbQ+29qR6qoMD89hv+JAgWjLrwSEWL+3JV8IXKeNFl6XkEJz9HGkVpnXvQKJoRz4/liT+8ZZ5Jyg==", - "dependencies": { - "@turf/helpers": "^6.5.0", - "@turf/meta": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/unkink-polygon/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/unkink-polygon/node_modules/quickselect": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-1.1.1.tgz", - "integrity": "sha512-qN0Gqdw4c4KGPsBOQafj6yj/PA6c/L63f6CaZ/DCF/xF4Esu3jVmKLUDYxghFx8Kb/O7y9tI7x2RjTSXwdK1iQ==" - }, - "node_modules/@turf/unkink-polygon/node_modules/rbush": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/rbush/-/rbush-2.0.2.tgz", - "integrity": "sha512-XBOuALcTm+O/H8G90b6pzu6nX6v2zCKiFG4BJho8a+bY6AER6t8uQUZdi5bomQc0AprCWhEGa7ncAbbRap0bRA==", - "dependencies": { - "quickselect": "^1.0.1" - } - }, "node_modules/@turf/voronoi": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/voronoi/-/voronoi-6.5.0.tgz", @@ -8895,25 +5498,6 @@ "url": "https://opencollective.com/turf" } }, - "node_modules/@turf/voronoi/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" - } - }, - "node_modules/@turf/voronoi/node_modules/@turf/invariant": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", - "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", - "dependencies": { - "@turf/helpers": "^6.5.0" - }, - "funding": { - "url": "https://opencollective.com/turf" - } - }, "node_modules/@types/angular": { "version": "1.8.5", "resolved": "https://registry.npmjs.org/@types/angular/-/angular-1.8.5.tgz", @@ -9002,18 +5586,6 @@ "@types/node": "*" } }, - "node_modules/@types/cacheable-request": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.2.tgz", - "integrity": "sha512-B3xVo+dlKM6nnKTcmm5ZtY/OL8bOAOd2Olee9M1zft65ox50OzjEHW91sDiU9j6cvW8Ejg1/Qkf4xd2kugApUA==", - "dev": true, - "dependencies": { - "@types/http-cache-semantics": "*", - "@types/keyv": "*", - "@types/node": "*", - "@types/responselike": "*" - } - }, "node_modules/@types/connect": { "version": "3.4.35", "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", @@ -9034,9 +5606,9 @@ } }, "node_modules/@types/eslint": { - "version": "8.40.2", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.40.2.tgz", - "integrity": "sha512-PRVjQ4Eh9z9pmmtaq8nTjZjQwKFk7YIHIud3lRoKRBgUQjgjRmoGxxGEPXQkF+lH7QkHJRNr5F4aBgYCW0lqpQ==", + "version": "8.44.0", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.0.tgz", + "integrity": "sha512-gsF+c/0XOguWgaOgvFs+xnnRqt9GwgTvIks36WpE6ueeI4KCEHHd8K/CKHqhOqrJKsYH8m27kRzQEvWXAwXUTw==", "dev": true, "dependencies": { "@types/estree": "*", @@ -9115,21 +5687,21 @@ "integrity": "sha512-9YHUdvuNDDRJYXZwHqSsO72Ok0vmqoJbNn73ttyITQp/VA60SarnZ+MPLD37rJAhVoKp+9BWOvJP5tHIRfZylQ==", "dev": true }, + "node_modules/@types/jquery": { + "version": "3.5.16", + "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.16.tgz", + "integrity": "sha512-bsI7y4ZgeMkmpG9OM710RRzDFp+w4P1RGiIt30C1mSBT+ExCleeh4HObwgArnDFELmRrOpXgSYN9VF1hj+f1lw==", + "dev": true, + "dependencies": { + "@types/sizzle": "*" + } + }, "node_modules/@types/json-schema": { "version": "7.0.12", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz", "integrity": "sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==", "dev": true }, - "node_modules/@types/keyv": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz", - "integrity": "sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/mime": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", @@ -9137,16 +5709,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "14.14.31", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.31.tgz", - "integrity": "sha512-vFHy/ezP5qI0rFgJ7aQnjDXwAMrG0KqqIH7tQG5PPv3BWBayOPIQNBjVc/P6hhdZfMx51REc6tfDNXHUio893g==", - "dev": true - }, - "node_modules/@types/parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", - "dev": true + "version": "18.16.19", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.16.19.tgz", + "integrity": "sha512-IXl7o+R9iti9eBW4Wg2hx1xQDig183jj7YLn8F7udNceyfkbn1ZxmzZXuak20gR40D7pIkIY1kYGx5VIGbaHKA==" }, "node_modules/@types/qs": { "version": "6.9.7", @@ -9162,18 +5727,9 @@ }, "node_modules/@types/range-parser": { "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", - "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==", - "dev": true - }, - "node_modules/@types/responselike": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz", - "integrity": "sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==", - "dev": true, - "dependencies": { - "@types/node": "*" - } + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", + "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==", + "dev": true }, "node_modules/@types/retry": { "version": "0.12.0", @@ -9211,6 +5767,12 @@ "@types/node": "*" } }, + "node_modules/@types/sizzle": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.3.tgz", + "integrity": "sha512-JYM8x9EGF163bEyhdJBpR2QX1R5naCJHC8ucJylJ3w9/CVBaskdQ8WqBf8MmQrd1kRvp/a4TS8HJ+bxzR7ZJYQ==", + "dev": true + }, "node_modules/@types/sockjs": { "version": "0.3.33", "resolved": "https://registry.npmjs.org/@types/sockjs/-/sockjs-0.3.33.tgz", @@ -9230,9 +5792,9 @@ } }, "node_modules/@types/yauzl": { - "version": "2.9.1", - "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.9.1.tgz", - "integrity": "sha512-A1b8SU4D10uoPjwb0lnHmmu8wZhR9d+9o2PKBQT2jU5YPTKsxac6M2qGAdY7VcL+dHHhARVUDmeg0rOrcd9EjA==", + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==", "dev": true, "optional": true, "dependencies": { @@ -9398,9 +5960,9 @@ } }, "node_modules/@webpack-cli/configtest": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.0.1.tgz", - "integrity": "sha512-B+4uBUYhpzDXmwuo3V9yBH6cISwxEI4J+NO5ggDaGEEHb0osY/R7MzeKc0bHURXQuZjMM4qD+bSJCKIuI3eNBQ==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.2.0.tgz", + "integrity": "sha512-4FB8Tj6xyVkyqjj1OaTqCjXYULB9FMkqQ8yGrZjRDrYh0nOE+7Lhs45WioWQQMV+ceFlE368Ukhe6xdvJM9Egg==", "dev": true, "peerDependencies": { "webpack": "4.x.x || 5.x.x", @@ -9408,9 +5970,9 @@ } }, "node_modules/@webpack-cli/info": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.2.2.tgz", - "integrity": "sha512-5U9kUJHnwU+FhKH4PWGZuBC1hTEPYyxGSL5jjoBI96Gx8qcYJGOikpiIpFoTq8mmgX3im2zAo2wanv/alD74KQ==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.5.0.tgz", + "integrity": "sha512-e8tSXZpw2hPl2uMJY6fsMswaok5FdlGNRTktvFk2sD8RjH0hE2+XistawJx1vmKteh4NmGmNUrp+Tb2w+udPcQ==", "dev": true, "dependencies": { "envinfo": "^7.7.3" @@ -9420,9 +5982,9 @@ } }, "node_modules/@webpack-cli/serve": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.3.0.tgz", - "integrity": "sha512-k2p2VrONcYVX1wRRrf0f3X2VGltLWcv+JzXRBDmvCxGlCeESx4OXw91TsWeKOkp784uNoVQo313vxJFHXPPwfw==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.7.0.tgz", + "integrity": "sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q==", "dev": true, "peerDependencies": { "webpack-cli": "4.x.x" @@ -9477,10 +6039,9 @@ } }, "node_modules/acorn": { - "version": "8.8.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", - "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", - "dev": true, + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", "bin": { "acorn": "bin/acorn" }, @@ -9488,50 +6049,20 @@ "node": ">=0.4.0" } }, - "node_modules/acorn-import-assertions": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz", - "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==", - "dev": true, - "peerDependencies": { - "acorn": "^8" - } - }, "node_modules/acorn-node": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.7.0.tgz", - "integrity": "sha512-XhahLSsCB6X6CJbe+uNu3Mn9sJBNFxtBN9NLgAOQovfS6Kh0lDUtmlclhjn9CvEK7A7YyRU13PXlNcpSiLI9Yw==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.8.2.tgz", + "integrity": "sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A==", "dependencies": { - "acorn": "^6.1.1", - "acorn-dynamic-import": "^4.0.0", - "acorn-walk": "^6.1.1", - "xtend": "^4.0.1" - } - }, - "node_modules/acorn-node/node_modules/acorn": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", - "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-node/node_modules/acorn-dynamic-import": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz", - "integrity": "sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw==", - "deprecated": "This is probably built in to whatever tool you're using. If you still need it... idk", - "peerDependencies": { - "acorn": "^6.0.0" + "acorn": "^7.0.0", + "acorn-walk": "^7.0.0", + "xtend": "^4.0.2" } }, "node_modules/acorn-walk": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.2.0.tgz", - "integrity": "sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", + "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", "engines": { "node": ">=0.4.0" } @@ -9549,17 +6080,24 @@ "node": ">=8.9" } }, - "node_modules/adler-32": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/adler-32/-/adler-32-1.2.0.tgz", - "integrity": "sha1-aj5r8KY5ALoVZSgIyxXGgT0aXyU=", + "node_modules/adjust-sourcemap-loader/node_modules/loader-utils": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", + "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", + "dev": true, "dependencies": { - "exit-on-epipe": "~1.0.1", - "printj": "~1.1.0" - }, - "bin": { - "adler32": "bin/adler32.njs" + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" }, + "engines": { + "node": ">=8.9.0" + } + }, + "node_modules/adler-32": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/adler-32/-/adler-32-1.3.1.tgz", + "integrity": "sha512-ynZ4w/nUUv5rrsR8UUGoe1VC9hZj6V5hU9Qw1HlMDJGEJw5S7TfTErWTjMys6M7vr0YWcPqs3qAr4ss0nDfP+A==", "engines": { "node": ">=0.8" } @@ -9604,10 +6142,13 @@ "integrity": "sha512-aChSGNdPkBda4BhOUUEAmAkRlIG7rFU8UTXx3NPStavrCOHKLDRV90djIKuiXfM6ONBqKmeqw2as0yuLnSN8dw==" }, "node_modules/agent-base": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-5.1.1.tgz", - "integrity": "sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", "dev": true, + "dependencies": { + "debug": "4" + }, "engines": { "node": ">= 6.0.0" } @@ -9626,29 +6167,6 @@ "node": ">= 8.0.0" } }, - "node_modules/agentkeepalive/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/agentkeepalive/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "node_modules/aggregate-error": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", @@ -9662,24 +6180,15 @@ "node": ">=8" } }, - "node_modules/aggregate-error/node_modules/indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", "dev": true, "dependencies": { "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", "uri-js": "^4.2.2" }, "funding": { @@ -9704,41 +6213,22 @@ } } }, - "node_modules/ajv-formats/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "node_modules/ajv-keywords": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", + "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", "dev": true, "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" + "fast-deep-equal": "^3.1.3" }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ajv-formats/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, - "node_modules/ajv-keywords": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "dev": true, "peerDependencies": { - "ajv": "^6.9.1" + "ajv": "^8.8.2" } }, "node_modules/align-text": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", - "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "integrity": "sha512-GrTZLRpmp6wIC2ztrWW9MjjTgSKccffgFagbNDOX95/dcjEcYZibYTeaOntySQLcdw1ztBoFkviiUvTMbb9MYg==", "dev": true, "dependencies": { "kind-of": "^3.0.2", @@ -9749,6 +6239,18 @@ "node": ">=0.10.0" } }, + "node_modules/align-text/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/angular": { "version": "1.8.3", "resolved": "https://registry.npmjs.org/angular/-/angular-1.8.3.tgz", @@ -9764,15 +6266,15 @@ } }, "node_modules/angular-route": { - "version": "1.7.8", - "resolved": "https://registry.npmjs.org/angular-route/-/angular-route-1.7.8.tgz", - "integrity": "sha512-VVk89PH0fsY5kfbx+N7IVX1IwnaPWYhMGY0uA+rjej2v1sjvrTx1SLkxUK4E0UpW1hXeLJhN7ncBcwoBiPtAtA==", + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/angular-route/-/angular-route-1.8.3.tgz", + "integrity": "sha512-kpIcRmDR2+o1FxDVVYy8Rvfab86/7LDbOgTRb9T+X9ewPQiBRuDEnZtM3oJYBiQLvAXDYTJXHV48n/bGE9Mv2g==", "deprecated": "For the actively supported Angular, see https://www.npmjs.com/package/@angular/core. AngularJS support has officially ended. For extended AngularJS support options, see https://goo.gle/angularjs-path-forward." }, "node_modules/angular-sanitize": { - "version": "1.7.8", - "resolved": "https://registry.npmjs.org/angular-sanitize/-/angular-sanitize-1.7.8.tgz", - "integrity": "sha512-sVq51is1cVNiPytH4JIEd7iRW0OBIRQGNETWkz1c/jnLv2sBf9oDxEd8enwDz/W2ULBIpqJPK/3AsIxmZyh9pA==", + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/angular-sanitize/-/angular-sanitize-1.8.3.tgz", + "integrity": "sha512-2rxdqzlUVafUeWOwvY/FtyWk1pFTyCtzreeiTytG9m4smpuAEKaIJAjYeVwWsoV+nlTOcgpwV4W1OCmR+BQbUg==", "deprecated": "For the actively supported Angular, see https://www.npmjs.com/package/@angular/core. AngularJS support has officially ended. For extended AngularJS support options, see https://goo.gle/angularjs-path-forward." }, "node_modules/angular-ui-bootstrap": { @@ -9783,7 +6285,7 @@ "node_modules/angularjs-dropdown-multiselect": { "version": "2.0.0-beta.10", "resolved": "https://registry.npmjs.org/angularjs-dropdown-multiselect/-/angularjs-dropdown-multiselect-2.0.0-beta.10.tgz", - "integrity": "sha1-/7R63w33M/PalM5JyE+PBdJHKl8=", + "integrity": "sha512-dZosCLW0xO4s/yjGGShlBje/R+gPFjs5XO18XL6TujHSGr/Sq6I6snu28E5fLqdgGxYVfQn/yEXlM2n8QnM89Q==", "dependencies": { "angular": "~1" }, @@ -9800,56 +6302,6 @@ "string-width": "^4.1.0" } }, - "node_modules/ansi-align/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-align/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/ansi-align/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-align/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-align/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/ansi-colors": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", @@ -9860,15 +6312,15 @@ } }, "node_modules/ansi-escapes": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-5.0.0.tgz", - "integrity": "sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", "dev": true, "dependencies": { - "type-fest": "^1.0.2" + "type-fest": "^0.21.3" }, "engines": { - "node": ">=12" + "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -9887,28 +6339,28 @@ } }, "node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true, + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true, + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dependencies": { + "color-convert": "^1.9.0" + }, "engines": { - "node": ">=0.10.0" + "node": ">=4" } }, "node_modules/anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", - "dev": true, + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -9917,15 +6369,6 @@ "node": ">= 8" } }, - "node_modules/anymatch/node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/append-transform": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-1.0.0.tgz", @@ -9945,54 +6388,84 @@ "dev": true }, "node_modules/archiver": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/archiver/-/archiver-2.1.1.tgz", - "integrity": "sha1-/2YrSnggFJSj7lRNOjP+dJZQnrw=", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/archiver/-/archiver-5.3.1.tgz", + "integrity": "sha512-8KyabkmbYrH+9ibcTScQ1xCJC/CGcugdVIwB+53f5sZziXgwUh3iXlAlANMxcZyDEfTHMe6+Z5FofV8nopXP7w==", "dev": true, "dependencies": { - "archiver-utils": "^1.3.0", - "async": "^2.0.0", + "archiver-utils": "^2.1.0", + "async": "^3.2.3", "buffer-crc32": "^0.2.1", - "glob": "^7.0.0", - "lodash": "^4.8.0", - "readable-stream": "^2.0.0", - "tar-stream": "^1.5.0", - "zip-stream": "^1.2.0" + "readable-stream": "^3.6.0", + "readdir-glob": "^1.0.0", + "tar-stream": "^2.2.0", + "zip-stream": "^4.1.0" }, "engines": { - "node": ">= 4" + "node": ">= 10" } }, "node_modules/archiver-utils": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-1.3.0.tgz", - "integrity": "sha1-5QtMCccL89aA4y/xt5lOn52JUXQ=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-2.1.0.tgz", + "integrity": "sha512-bEL/yUb/fNNiNTuUz979Z0Yg5L+LzLxGJz8x79lYmR54fmTIb6ob/hNQgkQnIUDWIFjZVQwl9Xs356I6BAMHfw==", + "dev": true, + "dependencies": { + "glob": "^7.1.4", + "graceful-fs": "^4.2.0", + "lazystream": "^1.0.0", + "lodash.defaults": "^4.2.0", + "lodash.difference": "^4.5.0", + "lodash.flatten": "^4.4.0", + "lodash.isplainobject": "^4.0.6", + "lodash.union": "^4.6.0", + "normalize-path": "^3.0.0", + "readable-stream": "^2.0.0" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/archiver-utils/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true + }, + "node_modules/archiver-utils/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "dev": true, "dependencies": { - "glob": "^7.0.0", - "graceful-fs": "^4.1.0", - "lazystream": "^1.0.0", - "lodash": "^4.8.0", - "normalize-path": "^2.0.0", - "readable-stream": "^2.0.0" - }, - "engines": { - "node": ">= 0.10.0" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } }, - "node_modules/archiver/node_modules/async": { - "version": "2.6.4", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", - "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", + "node_modules/archiver-utils/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "dependencies": { - "lodash": "^4.17.14" + "safe-buffer": "~5.1.0" } }, + "node_modules/archiver/node_modules/async": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", + "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==", + "dev": true + }, "node_modules/archy": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", + "integrity": "sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==", "dev": true }, "node_modules/are-we-there-yet": { @@ -10008,49 +6481,6 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/are-we-there-yet/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/are-we-there-yet/node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/are-we-there-yet/node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, "node_modules/arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", @@ -10058,14 +6488,27 @@ "dev": true }, "node_modules/argparse": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", - "integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=", + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "dependencies": { "sprintf-js": "~1.0.2" } }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", + "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "is-array-buffer": "^3.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/array-each": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", @@ -10078,7 +6521,7 @@ "node_modules/array-find-index": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", - "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "integrity": "sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==", "dev": true, "engines": { "node": ">=0.10.0" @@ -10109,235 +6552,16 @@ } }, "node_modules/array.prototype.map": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/array.prototype.map/-/array.prototype.map-1.0.4.tgz", - "integrity": "sha512-Qds9QnX7A0qISY7JT5WuJO0NJPE9CMlC6JzHQfhpqAAQQzufVRoeH7EzUY5GcPTx72voG8LV/5eo+b8Qi8hmhA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.0", - "es-array-method-boxes-properly": "^1.0.0", - "is-string": "^1.0.7" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.map/node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.map/node_modules/es-abstract": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.2.tgz", - "integrity": "sha512-XxXQuVNrySBNlEkTYJoDNFe5+s2yIOpzq80sUHEdPdQr0S5nTLz4ZPPPswNIpKseDDUS5yghX1gfLIHQZ1iNuQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "function.prototype.name": "^1.1.5", - "get-intrinsic": "^1.1.2", - "get-symbol-description": "^1.0.0", - "has": "^1.0.3", - "has-property-descriptors": "^1.0.0", - "has-symbols": "^1.0.3", - "internal-slot": "^1.0.3", - "is-callable": "^1.2.4", - "is-negative-zero": "^2.0.2", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.2", - "is-string": "^1.0.7", - "is-weakref": "^1.0.2", - "object-inspect": "^1.12.2", - "object-keys": "^1.1.1", - "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.4.3", - "string.prototype.trimend": "^1.0.5", - "string.prototype.trimstart": "^1.0.5", - "unbox-primitive": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.map/node_modules/get-intrinsic": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", - "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.map/node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.map/node_modules/is-callable": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.5.tgz", - "integrity": "sha512-ZIWRujF6MvYGkEuHMYtFRkL2wAtFw89EHfKlXrkPkjQZZRWeh9L1q3SV13NIfHnqxugjLvAOkEHx9mb1zcMnEw==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.map/node_modules/is-negative-zero": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", - "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.map/node_modules/is-regex": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", - "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.map/node_modules/object-inspect": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", - "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.map/node_modules/object.assign": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", - "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "has-symbols": "^1.0.3", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.map/node_modules/object.assign/node_modules/define-properties": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", - "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", - "dev": true, - "dependencies": { - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.map/node_modules/string.prototype.trimend": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz", - "integrity": "sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.19.5" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.map/node_modules/string.prototype.trimend/node_modules/define-properties": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", - "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", - "dev": true, - "dependencies": { - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.map/node_modules/string.prototype.trimstart": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz", - "integrity": "sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg==", + "resolved": "https://registry.npmjs.org/array.prototype.map/-/array.prototype.map-1.0.5.tgz", + "integrity": "sha512-gfaKntvwqYIuC7mLLyv2wzZIJqrRhn5PZ9EfFejSx6a78sV7iDsGpG9P+3oUPtm1Rerqm6nrKS4FYuTIvWfo3g==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.19.5" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.map/node_modules/string.prototype.trimstart/node_modules/define-properties": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", - "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", - "dev": true, - "dependencies": { - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "es-array-method-boxes-properly": "^1.0.0", + "is-string": "^1.0.7" }, "engines": { "node": ">= 0.4" @@ -10349,40 +6573,47 @@ "node_modules/asap": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", - "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=", + "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", "dev": true }, "node_modules/asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", + "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", "dev": true, "dependencies": { "safer-buffer": "~2.1.0" } }, "node_modules/asn1.js": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", - "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", + "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", "dependencies": { "bn.js": "^4.0.0", "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" + "minimalistic-assert": "^1.0.0", + "safer-buffer": "^2.1.0" } }, + "node_modules/asn1.js/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, "node_modules/assert": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", - "integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", + "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", "dependencies": { + "object-assign": "^4.1.1", "util": "0.10.3" } }, "node_modules/assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", "dev": true, "engines": { "node": ">=0.8" @@ -10391,12 +6622,12 @@ "node_modules/assert/node_modules/inherits": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=" + "integrity": "sha512-8nWq2nLTAwd02jTqJExUYFSD/fKq6VH9Y/oG2accc/kdI0V98Bag8d5a4gi3XHz73rDWa2PvTtvcWYquKqSENA==" }, "node_modules/assert/node_modules/util": { "version": "0.10.3", "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", - "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "integrity": "sha512-5KiHfsmkqacuKjkRkdV7SsfDJ2EGiPsK92s2MhNSY0craxjTdKTtqKsJaCWp4LW33ZZ0OPUv1WO/TFvNQRiQxQ==", "dependencies": { "inherits": "2.0.1" } @@ -10416,7 +6647,7 @@ "node_modules/async": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "integrity": "sha512-nSVgobk4rv61R9PUSDtYt7mPVB2olxNR5RWJcAsH676/ef11bUZwvu7+RGYrYauVdDPcO519v68wRhXQtxsV9w==", "dev": true }, "node_modules/async-retry": { @@ -10428,10 +6659,19 @@ "retry": "0.13.1" } }, + "node_modules/async-retry/node_modules/retry": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", + "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "dev": true }, "node_modules/atob": { @@ -10479,12 +6719,9 @@ } }, "node_modules/available-typed-arrays": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.2.tgz", - "integrity": "sha512-XWX3OX8Onv97LMk/ftVyBibpGwY5a8SmuxZPzeOxqmuEqUCOM9ZE+uIaD1VNJ5QnvU2UQusvmKbuM1FR8QWGfQ==", - "dependencies": { - "array-filter": "^1.0.0" - }, + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", + "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", "engines": { "node": ">= 0.4" }, @@ -10492,30 +6729,25 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/available-typed-arrays/node_modules/array-filter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-1.0.0.tgz", - "integrity": "sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=" - }, "node_modules/aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", "dev": true, "engines": { "node": "*" } }, "node_modules/aws4": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", - "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.12.0.tgz", + "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==", "dev": true }, "node_modules/babel-code-frame": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "integrity": "sha512-XqYMR2dfdGMW+hd0IUZ2PwK+fGeFkOxZJ0wY+JaQAHzt1Zx8LcvpiZD2NiGkEG8qx0CfkAOr5xt76d1e8vG90g==", "dev": true, "dependencies": { "chalk": "^1.1.3", @@ -10523,6 +6755,67 @@ "js-tokens": "^3.0.2" } }, + "node_modules/babel-code-frame/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/babel-code-frame/node_modules/ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/babel-code-frame/node_modules/chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", + "dev": true, + "dependencies": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/babel-code-frame/node_modules/js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha512-RjTcuD4xjtthQkaWH7dFlH85L+QaVtSoOyGdZ3g6HFhS9dFNDfLyqgm2NFe2X6cQpeFmt0452FJjFG5UameExg==", + "dev": true + }, + "node_modules/babel-code-frame/node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/babel-code-frame/node_modules/supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/babel-core": { "version": "6.26.3", "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", @@ -10550,13 +6843,46 @@ "source-map": "^0.5.7" } }, - "node_modules/babel-core/node_modules/convert-source-map": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", - "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", + "node_modules/babel-core/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "dependencies": { - "safe-buffer": "~5.1.1" + "ms": "2.0.0" + } + }, + "node_modules/babel-core/node_modules/json5": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha512-4xrs1aW+6N5DalkqSVA8fxh458CXvR99WU8WLKmq4v8eWAL86Xo3BVqyd3SkA9wEVjCMqyvvRRkshAdOnBp5rw==", + "dev": true, + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/babel-core/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "node_modules/babel-core/node_modules/slash": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "integrity": "sha512-3TYDR7xWt4dIqV2JauJr+EJeW356RXijHeUlO+8djJ+uBXPn8/2dpzBc8yQhh583sVvc9CvFAeQVgijsH+PNNg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/babel-core/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" } }, "node_modules/babel-generator": { @@ -10575,10 +6901,28 @@ "trim-right": "^1.0.1" } }, + "node_modules/babel-generator/node_modules/jsesc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", + "integrity": "sha512-Mke0DA0QjUWuJlhsE0ZPPhYiJkRap642SmI/4ztCFaUs6V2AiH1sfecc+57NgaryfAA2VR3v6O+CSjC1jZJKOA==", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + } + }, + "node_modules/babel-generator/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/babel-helper-builder-binary-assignment-operator-visitor": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz", - "integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=", + "integrity": "sha512-gCtfYORSG1fUMX4kKraymq607FWgMWg+j42IFPc18kFQEsmtaibP4UrqsXt8FlEJle25HUd4tsoDR7H2wDhe9Q==", "dev": true, "dependencies": { "babel-helper-explode-assignable-expression": "^6.24.1", @@ -10589,7 +6933,7 @@ "node_modules/babel-helper-call-delegate": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz", - "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", + "integrity": "sha512-RL8n2NiEj+kKztlrVJM9JT1cXzzAdvWFh76xh/H1I4nKwunzE4INBXn8ieCZ+wh4zWszZk7NBS1s/8HR5jDkzQ==", "dev": true, "dependencies": { "babel-helper-hoist-variables": "^6.24.1", @@ -10601,7 +6945,7 @@ "node_modules/babel-helper-define-map": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz", - "integrity": "sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8=", + "integrity": "sha512-bHkmjcC9lM1kmZcVpA5t2om2nzT/xiZpo6TJq7UlZ3wqKfzia4veeXbIhKvJXAMzhhEBd3cR1IElL5AenWEUpA==", "dev": true, "dependencies": { "babel-helper-function-name": "^6.24.1", @@ -10613,7 +6957,7 @@ "node_modules/babel-helper-explode-assignable-expression": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz", - "integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=", + "integrity": "sha512-qe5csbhbvq6ccry9G7tkXbzNtcDiH4r51rrPUbwwoTzZ18AqxWYRZT6AOmxrpxKnQBW0pYlBI/8vh73Z//78nQ==", "dev": true, "dependencies": { "babel-runtime": "^6.22.0", @@ -10624,7 +6968,7 @@ "node_modules/babel-helper-function-name": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", - "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", + "integrity": "sha512-Oo6+e2iX+o9eVvJ9Y5eKL5iryeRdsIkwRYheCuhYdVHsdEQysbc2z2QkqCLIYnNxkT5Ss3ggrHdXiDI7Dhrn4Q==", "dev": true, "dependencies": { "babel-helper-get-function-arity": "^6.24.1", @@ -10637,7 +6981,7 @@ "node_modules/babel-helper-get-function-arity": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz", - "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", + "integrity": "sha512-WfgKFX6swFB1jS2vo+DwivRN4NB8XUdM3ij0Y1gnC21y1tdBoe6xjVnd7NSI6alv+gZXCtJqvrTeMW3fR/c0ng==", "dev": true, "dependencies": { "babel-runtime": "^6.22.0", @@ -10647,7 +6991,7 @@ "node_modules/babel-helper-hoist-variables": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz", - "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", + "integrity": "sha512-zAYl3tqerLItvG5cKYw7f1SpvIxS9zi7ohyGHaI9cgDUjAT6YcY9jIEH5CstetP5wHIVSceXwNS7Z5BpJg+rOw==", "dev": true, "dependencies": { "babel-runtime": "^6.22.0", @@ -10657,234 +7001,82 @@ "node_modules/babel-helper-optimise-call-expression": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz", - "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=", - "dev": true, - "dependencies": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "node_modules/babel-helper-regex": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz", - "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=", - "dev": true, - "dependencies": { - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "lodash": "^4.17.4" - } - }, - "node_modules/babel-helper-remap-async-to-generator": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz", - "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=", - "dev": true, - "dependencies": { - "babel-helper-function-name": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "node_modules/babel-helper-replace-supers": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz", - "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=", - "dev": true, - "dependencies": { - "babel-helper-optimise-call-expression": "^6.24.1", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "node_modules/babel-helpers": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", - "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", - "dev": true, - "dependencies": { - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, - "node_modules/babel-loader": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-9.1.2.tgz", - "integrity": "sha512-mN14niXW43tddohGl8HPu5yfQq70iUThvFL/4QzESA7GcZoC0eVOhvWdQ8+3UlSjaDE9MVtsW9mxDY07W7VpVA==", - "dev": true, - "dependencies": { - "find-cache-dir": "^3.3.2", - "schema-utils": "^4.0.0" - }, - "engines": { - "node": ">= 14.15.0" - }, - "peerDependencies": { - "@babel/core": "^7.12.0", - "webpack": ">=5" - } - }, - "node_modules/babel-loader/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "integrity": "sha512-Op9IhEaxhbRT8MDXx2iNuMgciu2V8lDvYCNQbDGjdBNCjaMvyLf4wl4A3b8IgndCyQF8TwfgsQ8T3VD8aX1/pA==", "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/babel-loader/node_modules/ajv-keywords": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", - "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.3" - }, - "peerDependencies": { - "ajv": "^8.8.2" - } - }, - "node_modules/babel-loader/node_modules/find-cache-dir": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", - "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", - "dev": true, - "dependencies": { - "commondir": "^1.0.1", - "make-dir": "^3.0.2", - "pkg-dir": "^4.1.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/avajs/find-cache-dir?sponsor=1" - } - }, - "node_modules/babel-loader/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/babel-loader/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, - "node_modules/babel-loader/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" + "dependencies": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" } }, - "node_modules/babel-loader/node_modules/make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "node_modules/babel-helper-regex": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz", + "integrity": "sha512-VlPiWmqmGJp0x0oK27Out1D+71nVVCTSdlbhIVoaBAj2lUgrNjBCRR9+llO4lTSb2O4r7PJg+RobRkhBrf6ofg==", "dev": true, "dependencies": { - "semver": "^6.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" } }, - "node_modules/babel-loader/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "node_modules/babel-helper-remap-async-to-generator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz", + "integrity": "sha512-RYqaPD0mQyQIFRu7Ho5wE2yvA/5jxqCIj/Lv4BXNq23mHYu/vxikOy2JueLiBxQknwapwrJeNCesvY0ZcfnlHg==", "dev": true, "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" } }, - "node_modules/babel-loader/node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "node_modules/babel-helper-replace-supers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz", + "integrity": "sha512-sLI+u7sXJh6+ToqDr57Bv973kCepItDhMou0xCP2YPVmR1jkHSCY+p1no8xErbV1Siz5QE8qKT1WIwybSWlqjw==", "dev": true, - "engines": { - "node": ">=8" + "dependencies": { + "babel-helper-optimise-call-expression": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" } }, - "node_modules/babel-loader/node_modules/pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "node_modules/babel-helpers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", + "integrity": "sha512-n7pFrqQm44TCYvrCDb0MqabAF+JUBq+ijBvNMUxpkLjJaAu32faIexewMumrH5KLLJ1HDyT0PTEqRyAe/GwwuQ==", "dev": true, "dependencies": { - "find-up": "^4.0.0" - }, - "engines": { - "node": ">=8" + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" } }, - "node_modules/babel-loader/node_modules/schema-utils": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz", - "integrity": "sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==", + "node_modules/babel-loader": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-9.1.2.tgz", + "integrity": "sha512-mN14niXW43tddohGl8HPu5yfQq70iUThvFL/4QzESA7GcZoC0eVOhvWdQ8+3UlSjaDE9MVtsW9mxDY07W7VpVA==", "dev": true, "dependencies": { - "@types/json-schema": "^7.0.9", - "ajv": "^8.9.0", - "ajv-formats": "^2.1.1", - "ajv-keywords": "^5.1.0" + "find-cache-dir": "^3.3.2", + "schema-utils": "^4.0.0" }, "engines": { - "node": ">= 12.13.0" + "node": ">= 14.15.0" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, - "node_modules/babel-loader/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" + "peerDependencies": { + "@babel/core": "^7.12.0", + "webpack": ">=5" } }, "node_modules/babel-messages": { "version": "6.23.0", "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", - "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", + "integrity": "sha512-Bl3ZiA+LjqaMtNYopA9TYE9HP1tQ+E5dLxE0XrAzcIJeK2UqF0/EaqXwBn9esd4UmTfEab+P+UYQ1GnioFIb/w==", "dev": true, "dependencies": { "babel-runtime": "^6.22.0" @@ -10904,7 +7096,7 @@ "node_modules/babel-plugin-check-es2015-constants": { "version": "6.22.0", "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", - "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", + "integrity": "sha512-B1M5KBP29248dViEo1owyY32lk1ZSH2DaNNrXLGt8lyjjHm7pBqAdQ7VKUPR6EEDO323+OvT3MQXbCin8ooWdA==", "dev": true, "dependencies": { "babel-runtime": "^6.22.0" @@ -10926,97 +7118,40 @@ "node": ">=8" } }, - "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-coverage": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", - "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", - "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", - "dev": true, - "dependencies": { - "@babel/core": "^7.12.3", - "@babel/parser": "^7.14.7", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-coverage": "^3.2.0", - "semver": "^6.3.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/babel-plugin-istanbul/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/babel-plugin-istanbul/node_modules/test-exclude": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", - "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", - "dev": true, - "dependencies": { - "@istanbuljs/schema": "^0.1.2", - "glob": "^7.1.4", - "minimatch": "^3.0.4" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/babel-plugin-polyfill-corejs2": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.3.tgz", - "integrity": "sha512-bM3gHc337Dta490gg+/AseNB9L4YLHxq1nGKZZSHbhXv4aTYU2MD2cjza1Ru4S6975YLTaL1K8uJf6ukJhhmtw==", + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.4.tgz", + "integrity": "sha512-9WeK9snM1BfxB38goUEv2FLnA6ja07UMfazFHzCXUb3NyDZAwfXvQiURQ6guTTMeHcOsdknULm1PDhs4uWtKyA==", "dev": true, "dependencies": { - "@babel/compat-data": "^7.17.7", - "@babel/helper-define-polyfill-provider": "^0.4.0", - "semver": "^6.1.1" + "@babel/compat-data": "^7.22.6", + "@babel/helper-define-polyfill-provider": "^0.4.1", + "@nicolo-ribaudo/semver-v6": "^6.3.3" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, - "node_modules/babel-plugin-polyfill-corejs2/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/babel-plugin-polyfill-corejs3": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.8.1.tgz", - "integrity": "sha512-ikFrZITKg1xH6pLND8zT14UPgjKHiGLqex7rGEZCH2EvhsneJaJPemmpQaIZV5AL03II+lXylw3UmddDK8RU5Q==", + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.8.2.tgz", + "integrity": "sha512-Cid+Jv1BrY9ReW9lIfNlNpsI53N+FN7gE+f73zLAUbr9C52W4gKLWSByx47pfDJsEysojKArqOtOKZSVIIUTuQ==", "dev": true, "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.4.0", - "core-js-compat": "^3.30.1" + "@babel/helper-define-polyfill-provider": "^0.4.1", + "core-js-compat": "^3.31.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "node_modules/babel-plugin-polyfill-regenerator": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.5.0.tgz", - "integrity": "sha512-hDJtKjMLVa7Z+LwnTCxoDLQj6wdc+B8dun7ayF2fYieI6OzfuvcLMB32ihJZ4UhCBwNYGl5bg/x/P9cMdnkc2g==", + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.5.1.tgz", + "integrity": "sha512-L8OyySuI6OSQ5hFy9O+7zFjyr4WhAfRjLIOkhQGYl+emwJkd/S4XXT1JpfrgR1jrQ1NcGiOh+yAdGlF8pnC3Jw==", "dev": true, "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.4.0" + "@babel/helper-define-polyfill-provider": "^0.4.1" }, "peerDependencies": { "@babel/core": "^7.0.0-0" @@ -11025,31 +7160,31 @@ "node_modules/babel-plugin-syntax-async-functions": { "version": "6.13.0", "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz", - "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=", + "integrity": "sha512-4Zp4unmHgw30A1eWI5EpACji2qMocisdXhAftfhXoSV9j0Tvj6nRFE3tOmRY912E0FMRm/L5xWE7MGVT2FoLnw==", "dev": true }, "node_modules/babel-plugin-syntax-exponentiation-operator": { "version": "6.13.0", "resolved": "https://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz", - "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=", + "integrity": "sha512-Z/flU+T9ta0aIEKl1tGEmN/pZiI1uXmCiGFRegKacQfEJzp7iNsKloZmyJlQr+75FCJtiFfGIK03SiCvCt9cPQ==", "dev": true }, "node_modules/babel-plugin-syntax-object-rest-spread": { "version": "6.13.0", "resolved": "https://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz", - "integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=", + "integrity": "sha512-C4Aq+GaAj83pRQ0EFgTvw5YO6T3Qz2KGrNRwIj9mSoNHVvdZY4KO2uA6HNtNXCw993iSZnckY1aLW8nOi8i4+w==", "dev": true }, "node_modules/babel-plugin-syntax-trailing-function-commas": { "version": "6.22.0", "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz", - "integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=", + "integrity": "sha512-Gx9CH3Q/3GKbhs07Bszw5fPTlU+ygrOGfAhEt7W2JICwufpC4SuO0mG0+4NykPBSYPMJhqvVlDBU17qB1D+hMQ==", "dev": true }, "node_modules/babel-plugin-transform-async-to-generator": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz", - "integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=", + "integrity": "sha512-7BgYJujNCg0Ti3x0c/DL3tStvnKS6ktIYOmo9wginv/dfZOrbSZ+qG4IRRHMBOzZ5Awb1skTiAsQXg/+IWkZYw==", "dev": true, "dependencies": { "babel-helper-remap-async-to-generator": "^6.24.1", @@ -11060,7 +7195,7 @@ "node_modules/babel-plugin-transform-es2015-arrow-functions": { "version": "6.22.0", "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", - "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=", + "integrity": "sha512-PCqwwzODXW7JMrzu+yZIaYbPQSKjDTAsNNlK2l5Gg9g4rz2VzLnZsStvp/3c46GfXpwkyufb3NCyG9+50FF1Vg==", "dev": true, "dependencies": { "babel-runtime": "^6.22.0" @@ -11069,7 +7204,7 @@ "node_modules/babel-plugin-transform-es2015-block-scoped-functions": { "version": "6.22.0", "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz", - "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=", + "integrity": "sha512-2+ujAT2UMBzYFm7tidUsYh+ZoIutxJ3pN9IYrF1/H6dCKtECfhmB8UkHVpyxDwkj0CYbQG35ykoz925TUnBc3A==", "dev": true, "dependencies": { "babel-runtime": "^6.22.0" @@ -11078,7 +7213,7 @@ "node_modules/babel-plugin-transform-es2015-block-scoping": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz", - "integrity": "sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8=", + "integrity": "sha512-YiN6sFAQ5lML8JjCmr7uerS5Yc/EMbgg9G8ZNmk2E3nYX4ckHR01wrkeeMijEf5WHNK5TW0Sl0Uu3pv3EdOJWw==", "dev": true, "dependencies": { "babel-runtime": "^6.26.0", @@ -11091,7 +7226,7 @@ "node_modules/babel-plugin-transform-es2015-classes": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz", - "integrity": "sha1-WkxYpQyclGHlZLSyo7+ryXolhNs=", + "integrity": "sha512-5Dy7ZbRinGrNtmWpquZKZ3EGY8sDgIVB4CU8Om8q8tnMLrD/m94cKglVcHps0BCTdZ0TJeeAWOq2TK9MIY6cag==", "dev": true, "dependencies": { "babel-helper-define-map": "^6.24.1", @@ -11108,7 +7243,7 @@ "node_modules/babel-plugin-transform-es2015-computed-properties": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz", - "integrity": "sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM=", + "integrity": "sha512-C/uAv4ktFP/Hmh01gMTvYvICrKze0XVX9f2PdIXuriCSvUmV9j+u+BB9f5fJK3+878yMK6dkdcq+Ymr9mrcLzw==", "dev": true, "dependencies": { "babel-runtime": "^6.22.0", @@ -11118,7 +7253,7 @@ "node_modules/babel-plugin-transform-es2015-destructuring": { "version": "6.23.0", "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", - "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", + "integrity": "sha512-aNv/GDAW0j/f4Uy1OEPZn1mqD+Nfy9viFGBfQ5bZyT35YqOiqx7/tXdyfZkJ1sC21NyEsBdfDY6PYmLHF4r5iA==", "dev": true, "dependencies": { "babel-runtime": "^6.22.0" @@ -11127,7 +7262,7 @@ "node_modules/babel-plugin-transform-es2015-duplicate-keys": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz", - "integrity": "sha1-c+s9MQypaePvnskcU3QabxV2Qj4=", + "integrity": "sha512-ossocTuPOssfxO2h+Z3/Ea1Vo1wWx31Uqy9vIiJusOP4TbF7tPs9U0sJ9pX9OJPf4lXRGj5+6Gkl/HHKiAP5ug==", "dev": true, "dependencies": { "babel-runtime": "^6.22.0", @@ -11137,7 +7272,7 @@ "node_modules/babel-plugin-transform-es2015-for-of": { "version": "6.23.0", "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz", - "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=", + "integrity": "sha512-DLuRwoygCoXx+YfxHLkVx5/NpeSbVwfoTeBykpJK7JhYWlL/O8hgAK/reforUnZDlxasOrVPPJVI/guE3dCwkw==", "dev": true, "dependencies": { "babel-runtime": "^6.22.0" @@ -11146,7 +7281,7 @@ "node_modules/babel-plugin-transform-es2015-function-name": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz", - "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", + "integrity": "sha512-iFp5KIcorf11iBqu/y/a7DK3MN5di3pNCzto61FqCNnUX4qeBwcV1SLqe10oXNnCaxBUImX3SckX2/o1nsrTcg==", "dev": true, "dependencies": { "babel-helper-function-name": "^6.24.1", @@ -11157,7 +7292,7 @@ "node_modules/babel-plugin-transform-es2015-literals": { "version": "6.22.0", "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz", - "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=", + "integrity": "sha512-tjFl0cwMPpDYyoqYA9li1/7mGFit39XiNX5DKC/uCNjBctMxyL1/PT/l4rSlbvBG1pOKI88STRdUsWXB3/Q9hQ==", "dev": true, "dependencies": { "babel-runtime": "^6.22.0" @@ -11166,7 +7301,7 @@ "node_modules/babel-plugin-transform-es2015-modules-amd": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz", - "integrity": "sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ=", + "integrity": "sha512-LnIIdGWIKdw7zwckqx+eGjcS8/cl8D74A3BpJbGjKTFFNJSMrjN4bIh22HY1AlkUbeLG6X6OZj56BDvWD+OeFA==", "dev": true, "dependencies": { "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", @@ -11189,7 +7324,7 @@ "node_modules/babel-plugin-transform-es2015-modules-systemjs": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz", - "integrity": "sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM=", + "integrity": "sha512-ONFIPsq8y4bls5PPsAWYXH/21Hqv64TBxdje0FvU3MhIV6QM2j5YS7KvAzg/nTIVLot2D2fmFQrFWCbgHlFEjg==", "dev": true, "dependencies": { "babel-helper-hoist-variables": "^6.24.1", @@ -11200,7 +7335,7 @@ "node_modules/babel-plugin-transform-es2015-modules-umd": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz", - "integrity": "sha1-rJl+YoXNGO1hdq22B9YCNErThGg=", + "integrity": "sha512-LpVbiT9CLsuAIp3IG0tfbVo81QIhn6pE8xBJ7XSeCtFlMltuar5VuBV6y6Q45tpui9QWcy5i0vLQfCfrnF7Kiw==", "dev": true, "dependencies": { "babel-plugin-transform-es2015-modules-amd": "^6.24.1", @@ -11211,7 +7346,7 @@ "node_modules/babel-plugin-transform-es2015-object-super": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz", - "integrity": "sha1-JM72muIcuDp/hgPa0CH1cusnj40=", + "integrity": "sha512-8G5hpZMecb53vpD3mjs64NhI1au24TAmokQ4B+TBFBjN9cVoGoOvotdrMMRmHvVZUEvqGUPWL514woru1ChZMA==", "dev": true, "dependencies": { "babel-helper-replace-supers": "^6.24.1", @@ -11221,7 +7356,7 @@ "node_modules/babel-plugin-transform-es2015-parameters": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz", - "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", + "integrity": "sha512-8HxlW+BB5HqniD+nLkQ4xSAVq3bR/pcYW9IigY+2y0dI+Y7INFeTbfAQr+63T3E4UDsZGjyb+l9txUnABWxlOQ==", "dev": true, "dependencies": { "babel-helper-call-delegate": "^6.24.1", @@ -11235,7 +7370,7 @@ "node_modules/babel-plugin-transform-es2015-shorthand-properties": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz", - "integrity": "sha1-JPh11nIch2YbvZmkYi5R8U3jiqA=", + "integrity": "sha512-mDdocSfUVm1/7Jw/FIRNw9vPrBQNePy6wZJlR8HAUBLybNp1w/6lr6zZ2pjMShee65t/ybR5pT8ulkLzD1xwiw==", "dev": true, "dependencies": { "babel-runtime": "^6.22.0", @@ -11245,7 +7380,7 @@ "node_modules/babel-plugin-transform-es2015-spread": { "version": "6.22.0", "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", - "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", + "integrity": "sha512-3Ghhi26r4l3d0Js933E5+IhHwk0A1yiutj9gwvzmFbVV0sPMYk2lekhOufHBswX7NCoSeF4Xrl3sCIuSIa+zOg==", "dev": true, "dependencies": { "babel-runtime": "^6.22.0" @@ -11254,7 +7389,7 @@ "node_modules/babel-plugin-transform-es2015-sticky-regex": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz", - "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=", + "integrity": "sha512-CYP359ADryTo3pCsH0oxRo/0yn6UsEZLqYohHmvLQdfS9xkf+MbCzE3/Kolw9OYIY4ZMilH25z/5CbQbwDD+lQ==", "dev": true, "dependencies": { "babel-helper-regex": "^6.24.1", @@ -11265,7 +7400,7 @@ "node_modules/babel-plugin-transform-es2015-template-literals": { "version": "6.22.0", "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz", - "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=", + "integrity": "sha512-x8b9W0ngnKzDMHimVtTfn5ryimars1ByTqsfBDwAqLibmuuQY6pgBQi5z1ErIsUOWBdw1bW9FSz5RZUojM4apg==", "dev": true, "dependencies": { "babel-runtime": "^6.22.0" @@ -11274,7 +7409,7 @@ "node_modules/babel-plugin-transform-es2015-typeof-symbol": { "version": "6.23.0", "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz", - "integrity": "sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I=", + "integrity": "sha512-fz6J2Sf4gYN6gWgRZaoFXmq93X+Li/8vf+fb0sGDVtdeWvxC9y5/bTD7bvfWMEq6zetGEHpWjtzRGSugt5kNqw==", "dev": true, "dependencies": { "babel-runtime": "^6.22.0" @@ -11283,7 +7418,7 @@ "node_modules/babel-plugin-transform-es2015-unicode-regex": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz", - "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=", + "integrity": "sha512-v61Dbbihf5XxnYjtBN04B/JBvsScY37R1cZT5r9permN1cp+b70DY3Ib3fIkgn1DI9U3tGgBJZVD8p/mE/4JbQ==", "dev": true, "dependencies": { "babel-helper-regex": "^6.24.1", @@ -11291,10 +7426,42 @@ "regexpu-core": "^2.0.0" } }, + "node_modules/babel-plugin-transform-es2015-unicode-regex/node_modules/jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + } + }, + "node_modules/babel-plugin-transform-es2015-unicode-regex/node_modules/regexpu-core": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", + "integrity": "sha512-tJ9+S4oKjxY8IZ9jmjnp/mtytu1u3iyIQAfmI51IKWH6bFf7XR1ybtaO6j7INhZKXOTYADk7V5qxaqLkmNxiZQ==", + "dev": true, + "dependencies": { + "regenerate": "^1.2.1", + "regjsgen": "^0.2.0", + "regjsparser": "^0.1.4" + } + }, + "node_modules/babel-plugin-transform-es2015-unicode-regex/node_modules/regjsparser": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", + "integrity": "sha512-jlQ9gYLfk2p3V5Ag5fYhA7fv7OHzd1KUH0PRP46xc3TgwjwgROIW572AfYg/X9kaNq/LJnu6oJcFRXlIrGoTRw==", + "dev": true, + "dependencies": { + "jsesc": "~0.5.0" + }, + "bin": { + "regjsparser": "bin/parser" + } + }, "node_modules/babel-plugin-transform-exponentiation-operator": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz", - "integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=", + "integrity": "sha512-LzXDmbMkklvNhprr20//RStKVcT8Cu+SQtX18eMHLhjHf2yFzwtQ0S2f0jQ+89rokoNdmwoSqYzAhq86FxlLSQ==", "dev": true, "dependencies": { "babel-helper-builder-binary-assignment-operator-visitor": "^6.24.1", @@ -11305,7 +7472,7 @@ "node_modules/babel-plugin-transform-object-rest-spread": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz", - "integrity": "sha1-DzZpLVD+9rfi1LOsFHgTepY7ewY=", + "integrity": "sha512-ocgA9VJvyxwt+qJB0ncxV8kb/CjfTcECUY4tQ5VT7nP6Aohzobm8CDFaQ5FHdvZQzLmf0sgDxB8iRXZXxwZcyA==", "dev": true, "dependencies": { "babel-plugin-syntax-object-rest-spread": "^6.8.0", @@ -11315,16 +7482,27 @@ "node_modules/babel-plugin-transform-regenerator": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz", - "integrity": "sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8=", + "integrity": "sha512-LS+dBkUGlNR15/5WHKe/8Neawx663qttS6AGqoOUhICc9d1KciBvtrQSuc0PI+CxQ2Q/S1aKuJ+u64GtLdcEZg==", "dev": true, "dependencies": { "regenerator-transform": "^0.10.0" } }, + "node_modules/babel-plugin-transform-regenerator/node_modules/regenerator-transform": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.10.1.tgz", + "integrity": "sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==", + "dev": true, + "dependencies": { + "babel-runtime": "^6.18.0", + "babel-types": "^6.19.0", + "private": "^0.1.6" + } + }, "node_modules/babel-plugin-transform-strict-mode": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", - "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", + "integrity": "sha512-j3KtSpjyLSJxNoCDrhwiJad8kw0gJ9REGj8/CqL0HeRyLnvUNYV9zcqluL6QJSXh3nfsLEmSLvwRfGzrgR96Pw==", "dev": true, "dependencies": { "babel-runtime": "^6.22.0", @@ -11334,7 +7512,7 @@ "node_modules/babel-polyfill": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz", - "integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=", + "integrity": "sha512-F2rZGQnAdaHWQ8YAoeRbukc7HS9QgdgeyJ0rQDd485v9opwuPvjpPFcOOT/WmkKTdgy9ESgSPXDcTNpzrGr6iQ==", "dev": true, "dependencies": { "babel-runtime": "^6.26.0", @@ -11345,7 +7523,7 @@ "node_modules/babel-polyfill/node_modules/regenerator-runtime": { "version": "0.10.5", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", - "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=", + "integrity": "sha512-02YopEIhAgiBHWeoTiA8aitHDt8z6w+rQqNuIftlM+ZtvSl/brTouaU7DW6GO/cHtvxJvS4Hwv2ibKdxIRi24w==", "dev": true }, "node_modules/babel-preset-env": { @@ -11399,6 +7577,15 @@ "browserslist": "cli.js" } }, + "node_modules/babel-preset-env/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, "node_modules/babel-register": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", @@ -11414,6 +7601,15 @@ "source-map-support": "^0.4.15" } }, + "node_modules/babel-register/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/babel-register/node_modules/source-map-support": { "version": "0.4.18", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", @@ -11426,17 +7622,23 @@ "node_modules/babel-runtime": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", - "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "integrity": "sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g==", "dev": true, "dependencies": { "core-js": "^2.4.0", "regenerator-runtime": "^0.11.0" } }, + "node_modules/babel-runtime/node_modules/regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "dev": true + }, "node_modules/babel-template": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", - "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", + "integrity": "sha512-PCOcLFW7/eazGUKIoqH97sO9A2UYMahsn/yRQ7uOk37iutwjq7ODtcTNF+iFDSHNfkctqsLRjLP7URnOx0T1fg==", "dev": true, "dependencies": { "babel-runtime": "^6.26.0", @@ -11449,7 +7651,7 @@ "node_modules/babel-traverse": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", - "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", + "integrity": "sha512-iSxeXx7apsjCHe9c7n8VtRXGzI2Bk1rBSOJgCCjfyXb6v1aCqE1KSEpq/8SXuVN8Ka/Rh1WDTF0MDzkvTA4MIA==", "dev": true, "dependencies": { "babel-code-frame": "^6.26.0", @@ -11463,10 +7665,34 @@ "lodash": "^4.17.4" } }, + "node_modules/babel-traverse/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/babel-traverse/node_modules/globals": { + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/babel-traverse/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, "node_modules/babel-types": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", - "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", + "integrity": "sha512-zhe3V/26rCWsEZK8kZN+HaQj5yQ1CilTObixFzKW1UWjqG7618Twz6YEsCnjfg5gBcJh02DrpCkS9h98ZqDY+g==", "dev": true, "dependencies": { "babel-runtime": "^6.26.0", @@ -11475,6 +7701,15 @@ "to-fast-properties": "^1.0.3" } }, + "node_modules/babel-types/node_modules/to-fast-properties": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha512-lxrWP8ejsq+7E3nNjwYmUBMAgjMTZoTI+sdBOpvNyijeDLa29LUn9QaoXAHv4+Z578hbmHHJKZknzxVtvo77og==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/babylon": { "version": "6.18.0", "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", @@ -11485,9 +7720,9 @@ } }, "node_modules/balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "node_modules/base64-arraybuffer": { "version": "1.0.2", @@ -11528,11 +7763,14 @@ "node": ">= 0.8" } }, - "node_modules/basic-auth/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "node_modules/basic-ftp": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.0.3.tgz", + "integrity": "sha512-QHX8HLlncOLpy54mh+k/sWIFd0ThmRqwe9ZjELybGZK+tZ8rUb9VO0saKJUROTbE+KhzDUT7xziGpGrW8Kmd+g==", + "dev": true, + "engines": { + "node": ">=10.0.0" + } }, "node_modules/batch": { "version": "0.6.1", @@ -11543,18 +7781,27 @@ "node_modules/bcrypt-pbkdf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", "dev": true, "dependencies": { "tweetnacl": "^0.14.3" } }, "node_modules/before-after-hook": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz", - "integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", + "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==", "dev": true }, + "node_modules/big-integer": { + "version": "1.6.51", + "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", + "integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==", + "dev": true, + "engines": { + "node": ">=0.6" + } + }, "node_modules/big.js": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", @@ -11568,65 +7815,41 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true, "engines": { "node": ">=8" } }, "node_modules/bind-obj-methods": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/bind-obj-methods/-/bind-obj-methods-2.0.0.tgz", - "integrity": "sha512-3/qRXczDi2Cdbz6jE+W3IflJOutRVica8frpBn14de1mBOkzDo+6tY33kNhvkw54Kn3PzRRD2VnGbGPcTAk4sw==", - "dev": true - }, - "node_modules/bl": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.3.tgz", - "integrity": "sha512-pvcNpa0UU69UT341rO6AYy4FVAIkUHuZXRIWbq+zHnsVcRzDDjIAhGuuYoi0d//cwIwtt4pkpKycWEfjdV+vww==", - "dev": true, - "dependencies": { - "readable-stream": "^2.3.5", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/bl/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/bind-obj-methods/-/bind-obj-methods-2.0.2.tgz", + "integrity": "sha512-bUkRdEOppT1Xg/jG0+bp0JSjUD9U0r7skxb/42WeBUjfBpW6COQTIgQmKX5J2Z3aMXcORKgN2N+d7IQwTK3pag==", + "dev": true }, - "node_modules/bl/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", "dev": true, "dependencies": { - "safe-buffer": "~5.1.0" + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" } }, "node_modules/blobjs": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/blobjs/-/blobjs-1.1.1.tgz", - "integrity": "sha1-VEr224h7HGL0XqjgfOtFwTtZlao=" + "integrity": "sha512-WmY2n/bRFkuPUJXx72sc21Z7n20qJ52qsN0pzxM4lYM5K7/kB1o0TYVjeMiC74/iUELdC/Gor8fTkLA5MR+eIQ==" }, "node_modules/bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" }, "node_modules/body": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/body/-/body-5.1.0.tgz", - "integrity": "sha1-5LoM5BCkaTYyM2dgnstOZVMSUGk=", + "integrity": "sha512-chUsBxGRtuElD6fmw1gHLpvnKdVLK302peeFa9ZqAEk8TyzZ3fygLyUEDDPTJvL9+Bor0dIwn6ePOsRM2y0zQQ==", "dev": true, "dependencies": { "continuable-cache": "^0.3.1", @@ -11668,6 +7891,33 @@ "node": ">= 0.8" } }, + "node_modules/body-parser/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/body-parser/node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/body-parser/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, "node_modules/body-parser/node_modules/qs": { "version": "6.11.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", @@ -11733,17 +7983,17 @@ } }, "node_modules/bootstrap-datepicker": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/bootstrap-datepicker/-/bootstrap-datepicker-1.9.0.tgz", - "integrity": "sha512-9rYYbaVOheGYxjOr/+bJCmRPihfy+LkLSg4fIFMT9Od8WwWB/MB50w0JO1eBgKUMbb7PFHQD5uAfI3ArAxZRXA==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/bootstrap-datepicker/-/bootstrap-datepicker-1.10.0.tgz", + "integrity": "sha512-lWxtSYddAQOpbAO8UhYhHLcK6425eWoSjb5JDvZU3ePHEPF6A3eUr51WKaFy4PccU19JRxUG6wEU3KdhtKfvpg==", "dependencies": { - "jquery": ">=1.7.1 <4.0.0" + "jquery": ">=3.4.0 <4.0.0" } }, "node_modules/bootstrap-daterangepicker": { "version": "2.1.30", "resolved": "https://registry.npmjs.org/bootstrap-daterangepicker/-/bootstrap-daterangepicker-2.1.30.tgz", - "integrity": "sha1-+JPb//Wk19+qt1Rg6OppabuJaJo=", + "integrity": "sha512-lZAmyQxwsthEbsIBKl2KVcUca+b/O8uAJxxY8AvlsCYF9dQlIY7WjskuqMJ3b/1YdXUgxHN/R6HFdVVNFSgeVQ==", "dependencies": { "jquery": ">=1.10", "moment": "^2.9.0" @@ -11757,7 +8007,7 @@ "node_modules/bootstrap-slider": { "version": "9.10.0", "resolved": "https://registry.npmjs.org/bootstrap-slider/-/bootstrap-slider-9.10.0.tgz", - "integrity": "sha1-EQPWvADPv6jPyaJZmrUYxVZD2j8=" + "integrity": "sha512-a9MtENtt4r3ttPW5mpIpOFmCaIsm37EGukOgw5cfHlxKvsUSN8AN9JtwKrKuqgEnxs86kUSsMvMn8kqewMorKw==" }, "node_modules/bootstrap-tour": { "version": "0.12.0", @@ -11774,22 +8024,22 @@ "node_modules/bootstrap-validator": { "version": "0.11.9", "resolved": "https://registry.npmjs.org/bootstrap-validator/-/bootstrap-validator-0.11.9.tgz", - "integrity": "sha1-+3BY7vU2I+ePWqeWcCb5j4dalAQ=" + "integrity": "sha512-BJlnaTeFNr5+SNtZ71DNaiFx7qY0X2c7m/KvZE1GiVXbyD8PihJlALvS6TeRGUs8mY8qga/LrhG80N9dw8UWqA==" }, "node_modules/boxen": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-7.0.0.tgz", - "integrity": "sha512-j//dBVuyacJbvW+tvZ9HuH03fZ46QcaKvvhZickZqtB271DxJ7SNRSNxrV/dZX0085m7hISRZWbzWlJvx/rHSg==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-7.1.1.tgz", + "integrity": "sha512-2hCgjEmP8YLWQ130n2FerGv7rYpfBmnmp9Uy2Le1vge6X3gZIfSmEzP5QTDElFxcvVcXlEn8Aq6MU/PZygIOog==", "dev": true, "dependencies": { "ansi-align": "^3.0.1", - "camelcase": "^7.0.0", - "chalk": "^5.0.1", + "camelcase": "^7.0.1", + "chalk": "^5.2.0", "cli-boxes": "^3.0.0", "string-width": "^5.1.2", "type-fest": "^2.13.0", "widest-line": "^4.0.1", - "wrap-ansi": "^8.0.1" + "wrap-ansi": "^8.1.0" }, "engines": { "node": ">=14.16" @@ -11811,9 +8061,9 @@ } }, "node_modules/boxen/node_modules/ansi-styles": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.1.1.tgz", - "integrity": "sha512-qDOv24WjnYuL+wbwHdlsYZFy+cgPtrYw0Tn7GLORicQp9BkQLzrgI3Pm4VyR9ERZ41YTn7KlMPuL1n05WdZvmg==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true, "engines": { "node": ">=12" @@ -11823,9 +8073,9 @@ } }, "node_modules/boxen/node_modules/camelcase": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-7.0.0.tgz", - "integrity": "sha512-JToIvOmz6nhGsUhAYScbo2d6Py5wojjNfoxoc2mEVLUdJ70gJK2gnd+ABY1Tc3sVMyK7QDPtN0T/XdlCQWITyQ==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-7.0.1.tgz", + "integrity": "sha512-xlx1yCK2Oc1APsPXDL2LdlNP6+uu8OCDdhOBSVT279M/S+y75O30C2VuD8T2ogdePBBl7PfPF4504tnLgX3zfw==", "dev": true, "engines": { "node": ">=14.16" @@ -11835,9 +8085,9 @@ } }, "node_modules/boxen/node_modules/chalk": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.1.tgz", - "integrity": "sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", "dev": true, "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" @@ -11870,9 +8120,9 @@ } }, "node_modules/boxen/node_modules/strip-ansi": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", - "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dev": true, "dependencies": { "ansi-regex": "^6.0.1" @@ -11897,9 +8147,9 @@ } }, "node_modules/boxen/node_modules/wrap-ansi": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.0.1.tgz", - "integrity": "sha512-QFF+ufAqhoYHvoHdajT/Po7KoXVBPXS2bgjIam5isfWJPfIOnQZ50JtUiVvCv/sjgacf3yRrt2ZKUZ/V4itN4g==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "dev": true, "dependencies": { "ansi-styles": "^6.1.0", @@ -11913,6 +8163,18 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/bplist-parser": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.2.0.tgz", + "integrity": "sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw==", + "dev": true, + "dependencies": { + "big-integer": "^1.6.44" + }, + "engines": { + "node": ">= 5.10.0" + } + }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -11926,7 +8188,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, "dependencies": { "fill-range": "^7.0.1" }, @@ -11937,7 +8198,7 @@ "node_modules/brorand": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==" }, "node_modules/browser-pack": { "version": "6.1.0", @@ -11961,279 +8222,135 @@ "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", "dev": true }, - "node_modules/browserify": { - "version": "17.0.0", - "resolved": "https://registry.npmjs.org/browserify/-/browserify-17.0.0.tgz", - "integrity": "sha512-SaHqzhku9v/j6XsQMRxPyBrSP3gnwmE27gLJYZgMT2GeK3J0+0toN+MnuNYDfHwVGQfLiMZ7KSNSIXHemy905w==", - "dependencies": { - "assert": "^1.4.0", - "browser-pack": "^6.0.1", - "browser-resolve": "^2.0.0", - "browserify-zlib": "~0.2.0", - "buffer": "~5.2.1", - "cached-path-relative": "^1.0.0", - "concat-stream": "^1.6.0", - "console-browserify": "^1.1.0", - "constants-browserify": "~1.0.0", - "crypto-browserify": "^3.0.0", - "defined": "^1.0.0", - "deps-sort": "^2.0.1", - "domain-browser": "^1.2.0", - "duplexer2": "~0.1.2", - "events": "^3.0.0", - "glob": "^7.1.0", - "has": "^1.0.0", - "htmlescape": "^1.1.0", - "https-browserify": "^1.0.0", - "inherits": "~2.0.1", - "insert-module-globals": "^7.2.1", - "JSONStream": "^1.0.3", - "labeled-stream-splicer": "^2.0.0", - "mkdirp-classic": "^0.5.2", - "module-deps": "^6.2.3", - "os-browserify": "~0.3.0", - "parents": "^1.0.1", - "path-browserify": "^1.0.0", - "process": "~0.11.0", - "punycode": "^1.3.2", - "querystring-es3": "~0.2.0", - "read-only-stream": "^2.0.0", - "readable-stream": "^2.0.2", - "resolve": "^1.1.4", - "shasum-object": "^1.0.0", - "shell-quote": "^1.6.1", - "stream-browserify": "^3.0.0", - "stream-http": "^3.0.0", - "string_decoder": "^1.1.1", - "subarg": "^1.0.0", - "syntax-error": "^1.1.1", - "through2": "^2.0.0", - "timers-browserify": "^1.0.1", - "tty-browserify": "0.0.1", - "url": "~0.11.0", - "util": "~0.12.0", - "vm-browserify": "^1.0.0", - "xtend": "^4.0.0" - }, - "bin": { - "browserify": "bin/cmd.js" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/browserify-aes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "dependencies": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/browserify-cipher": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", - "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", - "dependencies": { - "browserify-aes": "^1.0.4", - "browserify-des": "^1.0.0", - "evp_bytestokey": "^1.0.0" - } - }, - "node_modules/browserify-des": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", - "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", - "dependencies": { - "cipher-base": "^1.0.1", - "des.js": "^1.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "node_modules/browserify-des/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "node_modules/browserify-rsa": { - "version": "4.0.1", - "resolved": "http://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", - "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", - "dependencies": { - "bn.js": "^4.1.0", - "randombytes": "^2.0.1" - } - }, - "node_modules/browserify-sign": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", - "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", - "dependencies": { - "bn.js": "^4.1.1", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.2", - "elliptic": "^6.0.0", - "inherits": "^2.0.1", - "parse-asn1": "^5.0.0" - } - }, - "node_modules/browserify-zlib": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", - "integrity": "sha1-uzX4pRn2AOD6a4SFJByXnQFB+y0=", - "dev": true, - "dependencies": { - "pako": "~0.2.0" - } - }, - "node_modules/browserify/node_modules/browser-resolve": { + "node_modules/browser-resolve": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-2.0.0.tgz", - "integrity": "sha512-7sWsQlYL2rGLy2IWm8WL8DCTJvYLc/qlOnsakDac87SOoCd16WLsaAMdCiAqsTNHIe+SXfaqyxyo6THoWqs8WQ==", - "dependencies": { - "resolve": "^1.17.0" - } - }, - "node_modules/browserify/node_modules/browser-resolve/node_modules/resolve": { - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", - "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", - "dependencies": { - "is-core-module": "^2.1.0", - "path-parse": "^1.0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/browserify/node_modules/browserify-zlib": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", - "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", - "dependencies": { - "pako": "~1.0.5" - } - }, - "node_modules/browserify/node_modules/buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz", - "integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==", - "dependencies": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4" - } - }, - "node_modules/browserify/node_modules/cached-path-relative": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.1.0.tgz", - "integrity": "sha512-WF0LihfemtesFcJgO7xfOoOcnWzY/QHR4qeDqV44jPU3HTI54+LnfXK3SA27AVVGCdZFgjjFFaqUA9Jx7dMJZA==" - }, - "node_modules/browserify/node_modules/deps-sort": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.1.tgz", - "integrity": "sha512-1orqXQr5po+3KI6kQb9A4jnXT1PBwggGl2d7Sq2xsnOeI9GPcE/tGcF9UiSZtZBM7MukY4cAh7MemS6tZYipfw==", - "dependencies": { - "JSONStream": "^1.0.3", - "shasum-object": "^1.0.0", - "subarg": "^1.0.0", - "through2": "^2.0.0" - }, - "bin": { - "deps-sort": "bin/cmd.js" - } - }, - "node_modules/browserify/node_modules/insert-module-globals": { - "version": "7.2.1", - "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.2.1.tgz", - "integrity": "sha512-ufS5Qq9RZN+Bu899eA9QCAYThY+gGW7oRkmb0vC93Vlyu/CFGcH0OYPEjVkDXA5FEbTt1+VWzdoOD3Ny9N+8tg==", - "dependencies": { - "acorn-node": "^1.5.2", - "combine-source-map": "^0.8.0", - "concat-stream": "^1.6.1", - "is-buffer": "^1.1.0", - "JSONStream": "^1.0.3", - "path-is-absolute": "^1.0.1", - "process": "~0.11.0", - "through2": "^2.0.0", - "undeclared-identifiers": "^1.1.2", - "xtend": "^4.0.0" - }, - "bin": { - "insert-module-globals": "bin/cmd.js" - } - }, - "node_modules/browserify/node_modules/insert-module-globals/node_modules/concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "engines": [ - "node >= 0.8" - ], + "integrity": "sha512-7sWsQlYL2rGLy2IWm8WL8DCTJvYLc/qlOnsakDac87SOoCd16WLsaAMdCiAqsTNHIe+SXfaqyxyo6THoWqs8WQ==", "dependencies": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" + "resolve": "^1.17.0" } }, - "node_modules/browserify/node_modules/module-deps": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-6.2.3.tgz", - "integrity": "sha512-fg7OZaQBcL4/L+AK5f4iVqf9OMbCclXfy/znXRxTVhJSeW5AIlS9AwheYwDaXM3lVW7OBeaeUEY3gbaC6cLlSA==", + "node_modules/browserify": { + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/browserify/-/browserify-17.0.0.tgz", + "integrity": "sha512-SaHqzhku9v/j6XsQMRxPyBrSP3gnwmE27gLJYZgMT2GeK3J0+0toN+MnuNYDfHwVGQfLiMZ7KSNSIXHemy905w==", "dependencies": { + "assert": "^1.4.0", + "browser-pack": "^6.0.1", "browser-resolve": "^2.0.0", - "cached-path-relative": "^1.0.2", - "concat-stream": "~1.6.0", + "browserify-zlib": "~0.2.0", + "buffer": "~5.2.1", + "cached-path-relative": "^1.0.0", + "concat-stream": "^1.6.0", + "console-browserify": "^1.1.0", + "constants-browserify": "~1.0.0", + "crypto-browserify": "^3.0.0", "defined": "^1.0.0", - "detective": "^5.2.0", - "duplexer2": "^0.1.2", - "inherits": "^2.0.1", + "deps-sort": "^2.0.1", + "domain-browser": "^1.2.0", + "duplexer2": "~0.1.2", + "events": "^3.0.0", + "glob": "^7.1.0", + "has": "^1.0.0", + "htmlescape": "^1.1.0", + "https-browserify": "^1.0.0", + "inherits": "~2.0.1", + "insert-module-globals": "^7.2.1", "JSONStream": "^1.0.3", - "parents": "^1.0.0", + "labeled-stream-splicer": "^2.0.0", + "mkdirp-classic": "^0.5.2", + "module-deps": "^6.2.3", + "os-browserify": "~0.3.0", + "parents": "^1.0.1", + "path-browserify": "^1.0.0", + "process": "~0.11.0", + "punycode": "^1.3.2", + "querystring-es3": "~0.2.0", + "read-only-stream": "^2.0.0", "readable-stream": "^2.0.2", - "resolve": "^1.4.0", - "stream-combiner2": "^1.1.1", + "resolve": "^1.1.4", + "shasum-object": "^1.0.0", + "shell-quote": "^1.6.1", + "stream-browserify": "^3.0.0", + "stream-http": "^3.0.0", + "string_decoder": "^1.1.1", "subarg": "^1.0.0", + "syntax-error": "^1.1.1", "through2": "^2.0.0", + "timers-browserify": "^1.0.1", + "tty-browserify": "0.0.1", + "url": "~0.11.0", + "util": "~0.12.0", + "vm-browserify": "^1.0.0", "xtend": "^4.0.0" }, "bin": { - "module-deps": "bin/cmd.js" + "browserify": "bin/cmd.js" }, "engines": { - "node": ">= 0.8.0" + "node": ">= 0.8" } }, - "node_modules/browserify/node_modules/module-deps/node_modules/resolve": { - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", - "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", + "node_modules/browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", "dependencies": { - "is-core-module": "^2.1.0", - "path-parse": "^1.0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" } }, - "node_modules/browserify/node_modules/pako": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==" - }, - "node_modules/browserify/node_modules/path-browserify": { + "node_modules/browserify-cipher": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", - "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==" + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "dependencies": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "node_modules/browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "dependencies": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/browserify-rsa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz", + "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", + "dependencies": { + "bn.js": "^5.0.0", + "randombytes": "^2.0.1" + } + }, + "node_modules/browserify-sign": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", + "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", + "dependencies": { + "bn.js": "^5.1.1", + "browserify-rsa": "^4.0.1", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "elliptic": "^6.5.3", + "inherits": "^2.0.4", + "parse-asn1": "^5.1.5", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + } }, - "node_modules/browserify/node_modules/safe-buffer": { + "node_modules/browserify-sign/node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", @@ -12252,117 +8369,68 @@ } ] }, - "node_modules/browserify/node_modules/stream-browserify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-3.0.0.tgz", - "integrity": "sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA==", - "dependencies": { - "inherits": "~2.0.4", - "readable-stream": "^3.5.0" - } - }, - "node_modules/browserify/node_modules/stream-browserify/node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/browserify/node_modules/stream-browserify/node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "node_modules/browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" + "pako": "~1.0.5" } }, - "node_modules/browserify/node_modules/stream-http": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-3.1.1.tgz", - "integrity": "sha512-S7OqaYu0EkFpgeGFb/NPOoPLxFko7TPqtEeFg5DXPB4v/KETHG0Ln6fRFrNezoelpaDKmycEmmZ81cC9DAwgYg==", + "node_modules/browserify/node_modules/buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz", + "integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==", "dependencies": { - "builtin-status-codes": "^3.0.0", - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "xtend": "^4.0.2" + "base64-js": "^1.0.2", + "ieee754": "^1.1.4" } }, - "node_modules/browserify/node_modules/stream-http/node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/browserify/node_modules/stream-http/node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "node_modules/browserify/node_modules/concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "engines": [ + "node >= 0.8" + ], "dependencies": { + "buffer-from": "^1.0.0", "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/browserify/node_modules/stream-http/node_modules/xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "engines": { - "node": ">=0.4" + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" } }, - "node_modules/browserify/node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dependencies": { - "safe-buffer": "~5.2.0" - } + "node_modules/browserify/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" }, - "node_modules/browserify/node_modules/timers-browserify": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", - "integrity": "sha1-ycWLV1voQHN1y14kYtrO50NZ9B0=", + "node_modules/browserify/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "dependencies": { - "process": "~0.11.0" - }, - "engines": { - "node": ">=0.6.0" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } }, - "node_modules/browserify/node_modules/tty-browserify": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", - "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==" - }, - "node_modules/browserify/node_modules/util": { - "version": "0.12.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.12.3.tgz", - "integrity": "sha512-I8XkoQwE+fPQEhy9v012V+TSdH2kp9ts29i20TaaDUXsg7x/onePbhFJUExBfv/2ay1ZOp/Vsm3nDlmnFGSAog==", + "node_modules/browserify/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dependencies": { - "inherits": "^2.0.3", - "is-arguments": "^1.0.4", - "is-generator-function": "^1.0.7", - "is-typed-array": "^1.1.3", - "safe-buffer": "^5.1.2", - "which-typed-array": "^1.1.2" + "safe-buffer": "~5.1.0" } }, - "node_modules/browserify/node_modules/vm-browserify": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", - "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==" - }, "node_modules/browserslist": { - "version": "4.21.8", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.8.tgz", - "integrity": "sha512-j+7xYe+v+q2Id9qbBeCI8WX5NmZSRe8es1+0xntD/+gaWXznP8tFEkv5IgSaHf5dS1YwVMbX/4W6m937mj+wQw==", - "dev": true, + "version": "4.21.9", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.9.tgz", + "integrity": "sha512-M0MFoZzbUrRU4KNfCrDLnvyE7gub+peetoTid3TBIqtunaDJyXlwhakT+/VkvSXcfIzFfK/nkCs4nmyTmxdNSg==", "funding": [ { "type": "opencollective", @@ -12378,8 +8446,8 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001502", - "electron-to-chromium": "^1.4.428", + "caniuse-lite": "^1.0.30001503", + "electron-to-chromium": "^1.4.431", "node-releases": "^2.0.12", "update-browserslist-db": "^1.0.11" }, @@ -12402,9 +8470,9 @@ } }, "node_modules/buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "dev": true, "funding": [ { @@ -12422,41 +8490,32 @@ ], "dependencies": { "base64-js": "^1.3.1", - "ieee754": "^1.2.1" + "ieee754": "^1.1.13" } }, "node_modules/buffer-crc32": { "version": "0.2.13", "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", + "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", "dev": true, "engines": { "node": "*" } }, "node_modules/buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" }, "node_modules/buffer-xor": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" - }, - "node_modules/builtin-modules": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } + "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==" }, "node_modules/builtin-status-codes": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", - "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=" + "integrity": "sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==" }, "node_modules/builtins": { "version": "5.0.1", @@ -12467,43 +8526,25 @@ "semver": "^7.0.0" } }, - "node_modules/builtins/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/builtins/node_modules/semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "node_modules/bundle-name": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-3.0.0.tgz", + "integrity": "sha512-PKA4BeSvBpQKQ8iPOGCSiell+N8P+Tf1DlwqmYhpe2gAhKPHn8EYOxVT+ShuGmhg8lN8XiSlS80yiExKXrURlw==", "dev": true, "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" + "run-applescript": "^5.0.0" }, "engines": { - "node": ">=10" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/builtins/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/bytes": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/bytes/-/bytes-1.0.0.tgz", - "integrity": "sha1-NWnt6Lo0MV+rmcPpLLBMciDeH6g=", + "integrity": "sha512-/x68VkHLeTl3/Ll8IvxdwzhrT+IyKc52e/oyHhA2RwqPqswSnjVbSddfPRwAsJtbilMAPSRWwAlpxdYsSWOTKQ==", "dev": true }, "node_modules/cacache": { @@ -12538,20 +8579,6 @@ "balanced-match": "^1.0.0" } }, - "node_modules/cacache/node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/cacache/node_modules/foreground-child": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", @@ -12569,16 +8596,16 @@ } }, "node_modules/cacache/node_modules/glob": { - "version": "10.3.1", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.1.tgz", - "integrity": "sha512-9BKYcEeIs7QwlCYs+Y3GBvqAMISufUS0i2ELd11zpZjxI5V9iyRj0HgzB5/cLf2NY4vcYBTYzJ7GIui7j/4DOw==", + "version": "10.3.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.3.tgz", + "integrity": "sha512-92vPiMb/iqpmEgsOoIDvTjc50wf9CCCvMzsi6W0JLPeUKE8TWP1a73PgqSrqy7iAZxaSD1YdzU7QZR5LF51MJw==", "dev": true, "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^2.0.3", "minimatch": "^9.0.1", - "minipass": "^5.0.0 || ^6.0.2", - "path-scurry": "^1.10.0" + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" }, "bin": { "glob": "dist/cjs/src/bin.js" @@ -12600,9 +8627,9 @@ } }, "node_modules/cacache/node_modules/minimatch": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.2.tgz", - "integrity": "sha512-PZOT9g5v2ojiTL7r1xF6plNHLtOeTpSlDI007As2NlA2aYBMfVom17yqa6QzhmDP8QOhn7LjHTg7DFCVSSa6yg==", + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" @@ -12614,15 +8641,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/cacache/node_modules/minipass": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", - "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/cacache/node_modules/signal-exit": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.0.2.tgz", @@ -12635,57 +8653,50 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/cacache/node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/cacheable-lookup": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-6.1.0.tgz", - "integrity": "sha512-KJ/Dmo1lDDhmW2XDPMo+9oiy/CeqosPguPCrgcVzKyZrL6pM1gU2GmPY/xo6OQPTUaA/c0kwHuywB4E6nmT9ww==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", + "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", "dev": true, "engines": { - "node": ">=10.6.0" + "node": ">=14.16" } }, "node_modules/cacheable-request": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.2.tgz", - "integrity": "sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew==", + "version": "10.2.12", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.12.tgz", + "integrity": "sha512-qtWGB5kn2OLjx47pYUkWicyOpK1vy9XZhq8yRTXOy+KAmjjESSRLx6SiExnnaGGUP1NM6/vmygMu0fGylNh9tw==", "dev": true, "dependencies": { - "clone-response": "^1.0.2", - "get-stream": "^5.1.0", - "http-cache-semantics": "^4.0.0", - "keyv": "^4.0.0", - "lowercase-keys": "^2.0.0", - "normalize-url": "^6.0.1", - "responselike": "^2.0.0" + "@types/http-cache-semantics": "^4.0.1", + "get-stream": "^6.0.1", + "http-cache-semantics": "^4.1.1", + "keyv": "^4.5.2", + "mimic-response": "^4.0.0", + "normalize-url": "^8.0.0", + "responselike": "^3.0.0" }, "engines": { - "node": ">=8" + "node": ">=14.16" } }, - "node_modules/cacheable-request/node_modules/lowercase-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", + "node_modules/cacheable-request/node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/cached-path-relative": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.1.0.tgz", + "integrity": "sha512-WF0LihfemtesFcJgO7xfOoOcnWzY/QHR4qeDqV44jPU3HTI54+LnfXK3SA27AVVGCdZFgjjFFaqUA9Jx7dMJZA==" + }, "node_modules/caching-transform": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-3.0.2.tgz", @@ -12702,12 +8713,12 @@ } }, "node_modules/call-bind": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.0.tgz", - "integrity": "sha512-AEXsYIyyDY3MCzbwdhzG3Jx1R0J2wetQyUynn6dYHAO+bg8l1k7jwZtRv4ryryFs7EP+NDlikJlVe59jr0cM2w==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", "dependencies": { "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.0" + "get-intrinsic": "^1.0.2" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -12723,18 +8734,18 @@ } }, "node_modules/camelcase": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", - "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=6" } }, "node_modules/camelcase-keys": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", - "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", + "integrity": "sha512-bA/Z/DERHKqoEOrp+qeGKw1QlvEQkGZSc0XaY6VnTxZr+Kv1G5zFwttpjv8qxZ/sBPT4nthwZaAcsAZTJlSKXQ==", "dev": true, "dependencies": { "camelcase": "^2.0.0", @@ -12744,11 +8755,19 @@ "node": ">=0.10.0" } }, - "node_modules/caniuse-lite": { - "version": "1.0.30001502", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001502.tgz", - "integrity": "sha512-AZ+9tFXw1sS0o0jcpJQIXvFTOB/xGiQ4OQ2t98QX3NDn2EZTSRBC801gxrsGgViuq2ak/NLkNgSNEPtCr5lfKg==", + "node_modules/camelcase-keys/node_modules/camelcase": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "integrity": "sha512-DLIsRzJVBQu72meAKPkWQOLcujdXT32hwdfnkI1frSiSRMK1MofjKHf+MEx0SB6fjEFXL8fBDv1dKymBlOp4Qw==", "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001515", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001515.tgz", + "integrity": "sha512-eEFDwUOZbE24sb+Ecsx3+OvNETqjWIdabMy52oOkIgcUtAsQifjUG9q4U9dgTHJM2mfk4uEPxc0+xuFdJ629QA==", "funding": [ { "type": "opencollective", @@ -12784,9 +8803,9 @@ } }, "node_modules/canvg/node_modules/core-js": { - "version": "3.23.4", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.23.4.tgz", - "integrity": "sha512-vjsKqRc1RyAJC3Ye2kYqgfdThb3zYnx9CrqoCcjMOENMtQPC7ZViBvlDxwYU/2z2NI/IPuiXw5mT4hWhddqjzQ==", + "version": "3.31.1", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.31.1.tgz", + "integrity": "sha512-2sKLtfq1eFST7l7v62zaqXacPc7uG8ZAya8ogijLhTtaKNcpzpB4TMoTw2Si+8GYKRwFPMMtUT0263QFWFfqyQ==", "hasInstallScript": true, "optional": true, "funding": { @@ -12794,31 +8813,28 @@ "url": "https://opencollective.com/core-js" } }, - "node_modules/canvg/node_modules/regenerator-runtime": { - "version": "0.13.9", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", - "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==", - "optional": true - }, "node_modules/capture-stack-trace": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.1.tgz", - "integrity": "sha512-mYQLZnx5Qt1JgB1WEiMCf2647plpGeQ2NMR/5L0HNZzGQo4fuSPnK+wjfPnKZV0aiJDgzmWqqkV/g7JD+DW0qw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.2.tgz", + "integrity": "sha512-X/WM2UQs6VMHUtjUDnZTRI+i1crWteJySFzr9UpGoQa4WQffXVTTXuekjl7TjZRlcF2XfjgITT0HxZ9RnxeT0w==", "dev": true, "engines": { "node": ">=0.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", "dev": true }, "node_modules/center-align": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", - "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "integrity": "sha512-Baz3aNe2gd2LP2qk5U+sDk/m4oSuwSDcBfayTCTBoWpfIGO5XFxPmjILQII4NGiZjD6DoDI6kf7gKaxkf7s3VQ==", "dev": true, "dependencies": { "align-text": "^0.1.3", @@ -12840,28 +8856,17 @@ "node": ">=0.8" } }, - "node_modules/cfb/node_modules/adler-32": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/adler-32/-/adler-32-1.3.1.tgz", - "integrity": "sha512-ynZ4w/nUUv5rrsR8UUGoe1VC9hZj6V5hU9Qw1HlMDJGEJw5S7TfTErWTjMys6M7vr0YWcPqs3qAr4ss0nDfP+A==", - "engines": { - "node": ">=0.8" - } - }, "node_modules/chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dependencies": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=4" } }, "node_modules/chardet": { @@ -12873,7 +8878,7 @@ "node_modules/charm": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/charm/-/charm-0.1.2.tgz", - "integrity": "sha1-BsIe7RobBq62dVPNxT4jJ0usIpY=" + "integrity": "sha512-syedaZ9cPe7r3hoQA9twWYKu5AIyCswN5+szkmPBe9ccdLrj4bYaCnLVPTLd2kgVRc7+zoX4tyPgRnFKCj5YjQ==" }, "node_modules/chart.js": { "version": "1.1.1", @@ -12884,7 +8889,6 @@ "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", - "dev": true, "funding": [ { "type": "individual", @@ -12907,44 +8911,38 @@ "fsevents": "~2.3.2" } }, - "node_modules/chokidar/node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=10" } }, - "node_modules/chownr": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz", - "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==", - "dev": true - }, "node_modules/chrome-trace-event": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.2.tgz", - "integrity": "sha512-9e/zx1jw7B4CO+c/RXoCsfg/x1AfUBioy4owYH0bJprEYAx5hRFLRhWBqHAG57D0ZM4H7vxbP7bPe0VwhQRYDQ==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", + "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", "dev": true, - "dependencies": { - "tslib": "^1.9.0" - }, "engines": { "node": ">=6.0" } }, - "node_modules/chrome-trace-event/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, "node_modules/ci-info": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.4.0.tgz", - "integrity": "sha512-t5QdPT5jq3o262DOQ8zA6E1tlH2upmUc4Hlvrbx1pGYJuiiHl7O7rvVNI+l8HTVhd/q3Qc9vqimkNk5yiXsAug==", - "dev": true + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", + "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "engines": { + "node": ">=8" + } }, "node_modules/cipher-base": { "version": "1.0.4", @@ -12964,7 +8962,7 @@ "node_modules/classie": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/classie/-/classie-1.0.0.tgz", - "integrity": "sha1-/JsptH5k43SiBi+2JNBaYc1wOrI=", + "integrity": "sha512-r2RnvJXK9l5+NClh9exbgAdhJBl/nxGWFIhRhp2syqY1nT/Lt/ijELemTlGaoaFWVCrJ3eDDeDG6KM4WJw02NA==", "engines": { "node": ">=0.10.x" } @@ -12972,12 +8970,12 @@ "node_modules/classybrew": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/classybrew/-/classybrew-0.0.3.tgz", - "integrity": "sha1-fbkd9W3XCF8IZI/YL4PU7wMExzs=" + "integrity": "sha512-Z1ky+DGpSFKaUpmIcWEM31c8U9gj1e1/gAUb/PWT5gUJBz+8gtFeXnn7HVUgEuWxsRFhxgKB9fs3gf7sTWt0GQ==" }, "node_modules/clean-css": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.1.0.tgz", - "integrity": "sha512-98ALLW4NOhZpvUEoSc2dJO23xE4S4SXc4mLieCVFGo8DNLTFQ3gzi7msW1lqSYJeGZSF5r5+W3KF6cEnkILnFQ==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.3.2.tgz", + "integrity": "sha512-JVJbM+f3d3Q704rF4bqQ5UUyTtuJ0JRKNbTKVEeujCCBoMdkEi+V+e8oktO9qGQNSvHrFTM6JZRXrUvGR1czww==", "dev": true, "dependencies": { "source-map": "~0.6.0" @@ -13007,7 +9005,7 @@ "node_modules/clean-yaml-object": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/clean-yaml-object/-/clean-yaml-object-0.1.0.tgz", - "integrity": "sha1-Y/sRDcLOGoTcIfbZM0h20BCui2g=", + "integrity": "sha512-3yONmlN9CSAkzNwnRCiJQ7Q2xK5mWuEfL3PuTZcAUzhObbXsfsnMptJzXwz93nc5zn9V9TwCVMmV7w4xsm43dw==", "dev": true, "engines": { "node": ">=0.10.0" @@ -13016,7 +9014,7 @@ "node_modules/cli": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cli/-/cli-1.0.1.tgz", - "integrity": "sha1-IoF1NPJL+klQw01TLUjsvGIbjBQ=", + "integrity": "sha512-41U72MB56TfUMGndAKK8vJ78eooOD4Z5NOL4xEfjc0c23s+6EYKXlXsmACBVclLP1yOfWCgEganVzddVrSNoTg==", "dependencies": { "exit": "0.1.2", "glob": "^7.1.1" @@ -13038,24 +9036,21 @@ } }, "node_modules/cli-cursor": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", - "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", "dev": true, "dependencies": { - "restore-cursor": "^4.0.0" + "restore-cursor": "^3.1.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, "node_modules/cli-spinners": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.7.0.tgz", - "integrity": "sha512-qu3pN8Y3qHNgE2AFweciB1IfMnmZ/fsNTEE+NOFjmGB2F/7rLhnhzppvpCnN4FovtP26k8lHyy9ptEbNwWFLzw==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.0.tgz", + "integrity": "sha512-4/aL9X3Wh0yiMQlE+eeRhWP6vclO3QRtw1JHKIT0FFUs5FjpFmESqtMvYZ0+lbzBw900b95mS0hohy+qn2VK/g==", "dev": true, "engines": { "node": ">=6" @@ -13065,23 +9060,25 @@ } }, "node_modules/cli-width": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.0.0.tgz", - "integrity": "sha512-ZksGS2xpa/bYkNzN3BAw1wEjsLV/ZKOf/CCrJ/QOBsxx6fOARIkwTutxp1XIOIohi6HKmOFjMoK/XaqDVUpEEw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", + "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", "dev": true, "engines": { - "node": ">= 12" + "node": ">= 10" } }, "node_modules/cliui": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", - "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", - "dev": true, + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dependencies": { - "center-align": "^0.1.1", - "right-align": "^0.1.1", - "wordwrap": "0.0.2" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" } }, "node_modules/clone": { @@ -13107,44 +9104,24 @@ "node": ">=6" } }, - "node_modules/clone-deep/node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/clone-response": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.3.tgz", - "integrity": "sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==", - "dev": true, - "dependencies": { - "mimic-response": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/code-prettify": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/code-prettify/-/code-prettify-0.1.0.tgz", - "integrity": "sha1-RocMyMGlDQm61TmzOpg9vUqjSx4=" + "integrity": "sha512-tNOWwXoF3ycqtvLCGPLYds2hKekmZfsPWinbRcLk6BBHBaSf+v+HJOvfg33VfVzYzvQ6zmVq+WO88oKweiJSQg==" }, "node_modules/codemirror": { - "version": "5.59.1", - "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.59.1.tgz", - "integrity": "sha512-d0SSW/PCCD4LoSCBPdnP0BzmZB1v3emomCUtVlIWgZHJ06yVeBOvBtOH7vYz707pfAvEeWbO9aP6akh8vl1V3w==" + "version": "5.65.13", + "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.65.13.tgz", + "integrity": "sha512-SVWEzKXmbHmTQQWaz03Shrh4nybG0wXx2MEu3FO4ezbPW8IbnZEd5iGHGEffSUaitKYa3i+pHpBsSvw8sPHtzg==" }, "node_modules/codepage": { - "version": "1.14.0", - "resolved": "https://registry.npmjs.org/codepage/-/codepage-1.14.0.tgz", - "integrity": "sha1-jL4lSBMjVZ19MHVxsP/5HnodL5k=", + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/codepage/-/codepage-1.3.8.tgz", + "integrity": "sha512-cjAoQW5L/TCKWRbzt/xGBvhwJKQFhcIVO0jWQtpKQx4gr9qvXNkpRfq6gSmjjA8dB2Is/DPOb7gNwqQXP7UgTQ==", "dependencies": { - "commander": "~2.14.1", - "exit-on-epipe": "~1.0.1" + "commander": "", + "concat-stream": "", + "voc": "" }, "bin": { "codepage": "bin/codepage.njs" @@ -13153,16 +9130,10 @@ "node": ">=0.8" } }, - "node_modules/codepage/node_modules/commander": { - "version": "2.14.1", - "resolved": "http://registry.npmjs.org/commander/-/commander-2.14.1.tgz", - "integrity": "sha512-+YR16o3rK53SmWHU3rEM3tPAh2rwb1yPcQX5irVn7mb0gXbwuCCrnkbV5+PBfETdfg1vui07nM6PCG1zndcjQw==" - }, "node_modules/color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, "dependencies": { "color-name": "1.1.3" } @@ -13170,8 +9141,7 @@ "node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" }, "node_modules/color-support": { "version": "1.1.3", @@ -13182,10 +9152,15 @@ "color-support": "bin.js" } }, + "node_modules/colorbrewer": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/colorbrewer/-/colorbrewer-1.5.3.tgz", + "integrity": "sha512-ee4k+3P0rzHtikVcmBsO0N81J2JBjE93S9BM21WwdHS30oZe6Okp0VDJViS9y5aUL8kedEXzL7Yfi9WzO5ghYQ==" + }, "node_modules/colorette": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz", - "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==", + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", "dev": true }, "node_modules/colors": { @@ -13200,7 +9175,7 @@ "node_modules/combine-source-map": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.8.0.tgz", - "integrity": "sha1-pY0N8ELBhvz4IqjoAV9UUNLXmos=", + "integrity": "sha512-UlxQ9Vw0b/Bt/KYwCFqdEwsQ1eL8d1gibiFb7lxQJFdvTgc2hIZi6ugsg+kyhzhPV+QEpUiEIwInIAIrgoEkrg==", "dependencies": { "convert-source-map": "~1.1.0", "inline-source-map": "~0.6.0", @@ -13208,6 +9183,19 @@ "source-map": "~0.5.3" } }, + "node_modules/combine-source-map/node_modules/convert-source-map": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", + "integrity": "sha512-Y8L5rp6jo+g9VEPgvqNfEopjTR4OTYct8lXlS8iVQdmnjDvbdbzYe9rjtFCB9egC86JoNCU61WRY+ScjkZpnIg==" + }, + "node_modules/combine-source-map/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -13221,29 +9209,32 @@ } }, "node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "engines": { + "node": ">= 6" + } }, "node_modules/commondir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", "dev": true }, "node_modules/compress-commons": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-1.2.2.tgz", - "integrity": "sha1-UkqfEJA/OoEzibAiXSfEi7dRiQ8=", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-4.1.1.tgz", + "integrity": "sha512-QLdDLCKNV2dtoTorqgxngQCMA+gWXkM/Nwu7FpeBhk/RdkzimqC3jueb/FDmaZeXh+uby1jkBqE3xArsLBE5wQ==", "dev": true, "dependencies": { - "buffer-crc32": "^0.2.1", - "crc32-stream": "^2.0.0", - "normalize-path": "^2.0.0", - "readable-stream": "^2.0.0" + "buffer-crc32": "^0.2.13", + "crc32-stream": "^4.0.2", + "normalize-path": "^3.0.0", + "readable-stream": "^3.6.0" }, "engines": { - "node": ">= 0.10.0" + "node": ">= 10" } }, "node_modules/compressible": { @@ -13285,27 +9276,37 @@ "node": ">= 0.8" } }, - "node_modules/compression/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "node_modules/compression/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/compression/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, "node_modules/concat-stream": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz", - "integrity": "sha1-CqxmL9Ur54lk1VMvaUeE5wEQrPc=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", + "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", "engines": [ - "node >= 0.8" + "node >= 6.0" ], "dependencies": { + "buffer-from": "^1.0.0", "inherits": "^2.0.3", - "readable-stream": "^2.2.2", + "readable-stream": "^3.0.2", "typedarray": "^0.0.6" } }, @@ -13320,6 +9321,19 @@ "tinyqueue": "^2.0.3" } }, + "node_modules/concaveman/node_modules/quickselect": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-2.0.0.tgz", + "integrity": "sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw==" + }, + "node_modules/concaveman/node_modules/rbush": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/rbush/-/rbush-3.0.1.tgz", + "integrity": "sha512-XRaVO0YecOpEuIvbhbpTrZgoiI6xBlz6hnlr6EHhd+0x9ase6EmeN+hdwwUaJvLcsFFQ8iWVF1GAK1yB0BWi0w==", + "dependencies": { + "quickselect": "^2.0.0" + } + }, "node_modules/config-chain": { "version": "1.1.13", "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", @@ -13330,6 +9344,12 @@ "proto-list": "~1.2.1" } }, + "node_modules/config-chain/node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, "node_modules/configstore": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/configstore/-/configstore-6.0.0.tgz", @@ -13373,7 +9393,7 @@ "node_modules/console-browserify": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", - "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", + "integrity": "sha512-duS7VP5pvfsNLDvL1O4VOEbw37AI3A4ZUQYemvDlnpGrNu9tprR7BYWpDYwC0Xia0Zxz5ZupdiIrUp0GH1aXfg==", "dependencies": { "date-now": "^0.1.4" } @@ -13387,7 +9407,7 @@ "node_modules/constants-browserify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", - "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=" + "integrity": "sha512-xFxOwqIzR/e1k1gLiWEophSCMqXcwVHIH7akf7b/vxcUeGunlj3hvZaaqxwHsTgn+IndtkQJgSztIDWeumWJDQ==" }, "node_modules/content-disposition": { "version": "0.5.4", @@ -13433,13 +9453,13 @@ "node_modules/continuable-cache": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/continuable-cache/-/continuable-cache-0.3.1.tgz", - "integrity": "sha1-vXJ6f67XfnH/OYWskzUakSczrQ8=", + "integrity": "sha512-TF30kpKhTH8AGCG3dut0rdd/19B7Z+qCnrMoBLpyQu/2drZdNrrpcjPEoJeSVsQM+8KmWG5O56oPDjSSUsuTyA==", "dev": true }, "node_modules/convert-source-map": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", - "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=" + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==" }, "node_modules/cookie": { "version": "0.5.0", @@ -13494,45 +9514,84 @@ "webpack": "^5.1.0" } }, - "node_modules/copy-webpack-plugin/node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "node_modules/copy-webpack-plugin/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/copy-webpack-plugin/node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true, + "peerDependencies": { + "ajv": "^6.9.1" + } + }, + "node_modules/copy-webpack-plugin/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/copy-webpack-plugin/node_modules/loader-utils": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", + "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", "dev": true, + "dependencies": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + }, "engines": { - "node": ">=0.10.0" + "node": ">=8.9.0" } }, - "node_modules/copy-webpack-plugin/node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "node_modules/copy-webpack-plugin/node_modules/schema-utils": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", "dev": true, "dependencies": { - "yocto-queue": "^0.1.0" + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" }, "engines": { - "node": ">=10" + "node": ">= 10.13.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "type": "opencollective", + "url": "https://opencollective.com/webpack" } }, "node_modules/core-js": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.9.tgz", - "integrity": "sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A==", + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", "deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.", "dev": true, "hasInstallScript": true }, "node_modules/core-js-compat": { - "version": "3.31.0", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.31.0.tgz", - "integrity": "sha512-hM7YCu1cU6Opx7MXNu0NuumM0ezNeAeRKadixyiQELWY3vT3De9S4J5ZBMraWV2vZnrE1Cirl0GtFtDtMUXzPw==", + "version": "3.31.1", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.31.1.tgz", + "integrity": "sha512-wIDWd2s5/5aJSdpOJHfSibxNODxoGoWOBHt8JSPB41NOE94M7kuTPZCYLOlTtuoXTsBPKobpJ6T+y0SSy5L9SA==", "dev": true, "dependencies": { - "browserslist": "^4.21.5" + "browserslist": "^4.21.9" }, "funding": { "type": "opencollective", @@ -13542,58 +9601,51 @@ "node_modules/core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==" }, "node_modules/corser": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz", - "integrity": "sha1-jtolLsqrWEDc2XXOuQ2TcMgZ/4c=", + "integrity": "sha512-utCYNzRSQIZNPIcGZdQc92UVJYAhtGAteCFg0yRaFm8f0P+CPtyGyHXJcGXnffjCybUCEx3FQ2G7U3/o9eIkVQ==", "dev": true, "engines": { "node": ">= 0.4.0" } }, "node_modules/cosmiconfig": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.1.tgz", - "integrity": "sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.2.0.tgz", + "integrity": "sha512-3rTMnFJA1tCOPwRxtgF4wd7Ab2qvDbL8jX+3smjIbS4HlZBagTlpERbdN7iAbWlrfxE3M8c27kTwTawQ7st+OQ==", "dev": true, "dependencies": { - "@types/parse-json": "^4.0.0", "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.10.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/cosmiconfig/node_modules/parse-json": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", - "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" + "path-type": "^4.0.0" }, "engines": { - "node": ">=8" + "node": ">=14" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/d-fischer" } }, - "node_modules/cosmiconfig/node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "node_modules/cosmiconfig/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/cosmiconfig/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, - "engines": { - "node": ">=8" + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" } }, "node_modules/coveralls": { @@ -13631,29 +9683,10 @@ "node": ">=6" } }, - "node_modules/cp-file/node_modules/pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/crc": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/crc/-/crc-3.5.0.tgz", - "integrity": "sha1-mLi6fUiWZbo5efWbITgTdBAaGWQ=", - "dev": true - }, "node_modules/crc-32": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.0.tgz", - "integrity": "sha512-1uBwHxF+Y/4yF5G48fwnKq6QsIXheor3ZLPT80yGBV1oEUwpPojlEhQbWKVw1VwcTQyMGHK1/XMmTjmlsmTTGA==", - "dependencies": { - "exit-on-epipe": "~1.0.1", - "printj": "~1.1.0" - }, + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", + "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", "bin": { "crc32": "bin/crc32.njs" }, @@ -13662,27 +9695,32 @@ } }, "node_modules/crc32-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-2.0.0.tgz", - "integrity": "sha1-483TtN8xaN10494/u8t7KX/pCPQ=", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-4.0.2.tgz", + "integrity": "sha512-DxFZ/Hk473b/muq1VJ///PMNLj0ZMnzye9thBpmjpJKCc5eMgB95aK8zCGrGfQ90cWo561Te6HK9D+j4KPdM6w==", "dev": true, "dependencies": { - "crc": "^3.4.4", - "readable-stream": "^2.0.0" + "crc-32": "^1.2.0", + "readable-stream": "^3.4.0" }, "engines": { - "node": ">= 0.10.0" + "node": ">= 10" } }, "node_modules/create-ecdh": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", - "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", + "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", "dependencies": { "bn.js": "^4.1.0", - "elliptic": "^6.0.0" + "elliptic": "^6.5.3" } }, + "node_modules/create-ecdh/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, "node_modules/create-hash": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", @@ -13758,125 +9796,27 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/critters/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/critters/node_modules/dom-serializer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", - "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", - "dev": true, - "dependencies": { - "domelementtype": "^2.3.0", - "domhandler": "^5.0.2", - "entities": "^4.2.0" - }, - "funding": { - "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" - } - }, - "node_modules/critters/node_modules/domelementtype": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", - "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/fb55" - } - ] - }, - "node_modules/critters/node_modules/domhandler": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", - "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", - "dev": true, - "dependencies": { - "domelementtype": "^2.3.0" - }, - "engines": { - "node": ">= 4" - }, - "funding": { - "url": "https://github.com/fb55/domhandler?sponsor=1" - } - }, - "node_modules/critters/node_modules/domutils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", - "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", - "dev": true, - "dependencies": { - "dom-serializer": "^2.0.0", - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3" - }, - "funding": { - "url": "https://github.com/fb55/domutils?sponsor=1" - } - }, - "node_modules/critters/node_modules/entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "dev": true, - "engines": { - "node": ">=0.12" - }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, - "node_modules/critters/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/critters/node_modules/htmlparser2": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.2.tgz", - "integrity": "sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==", - "dev": true, - "funding": [ - "https://github.com/fb55/htmlparser2?sponsor=1", - { - "type": "github", - "url": "https://github.com/sponsors/fb55" - } - ], + "dev": true, "dependencies": { - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3", - "domutils": "^3.0.1", - "entities": "^4.4.0" + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" } }, - "node_modules/critters/node_modules/pretty-bytes": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", - "integrity": "sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==", + "node_modules/critters/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/critters/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, "node_modules/critters/node_modules/supports-color": { @@ -13892,13 +9832,17 @@ } }, "node_modules/cross-spawn": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.2.tgz", - "integrity": "sha1-e5JHYhwjrf3ThWAEqCPL45dCTUE=", + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, "dependencies": { - "lru-cache": "^4.0.1", - "which": "^1.2.9" + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" } }, "node_modules/crypto-browserify": { @@ -13923,9 +9867,9 @@ } }, "node_modules/crypto-js": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.0.0.tgz", - "integrity": "sha512-bzHZN8Pn+gS7DQA6n+iUmBfl0hO5DJq++QP3U6uTucDtk/0iGpXd/Gg7CGR0p8tJhofJyaKoWBuJI4eAO00BBg==" + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.1.1.tgz", + "integrity": "sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw==" }, "node_modules/crypto-random-string": { "version": "4.0.0", @@ -13942,6 +9886,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/crypto-random-string/node_modules/type-fest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/css-line-break": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/css-line-break/-/css-line-break-2.1.0.tgz", @@ -13976,39 +9932,6 @@ "webpack": "^5.0.0" } }, - "node_modules/css-loader/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/css-loader/node_modules/semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/css-loader/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/css-select": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", @@ -14025,73 +9948,6 @@ "url": "https://github.com/sponsors/fb55" } }, - "node_modules/css-select/node_modules/dom-serializer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", - "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", - "dev": true, - "dependencies": { - "domelementtype": "^2.3.0", - "domhandler": "^5.0.2", - "entities": "^4.2.0" - }, - "funding": { - "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" - } - }, - "node_modules/css-select/node_modules/domelementtype": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", - "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/fb55" - } - ] - }, - "node_modules/css-select/node_modules/domhandler": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", - "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", - "dev": true, - "dependencies": { - "domelementtype": "^2.3.0" - }, - "engines": { - "node": ">= 4" - }, - "funding": { - "url": "https://github.com/fb55/domhandler?sponsor=1" - } - }, - "node_modules/css-select/node_modules/domutils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", - "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", - "dev": true, - "dependencies": { - "dom-serializer": "^2.0.0", - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3" - }, - "funding": { - "url": "https://github.com/fb55/domutils?sponsor=1" - } - }, - "node_modules/css-select/node_modules/entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "dev": true, - "engines": { - "node": ">=0.12" - }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, "node_modules/css-what": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", @@ -14119,7 +9975,7 @@ "node_modules/currently-unhandled": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", - "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "integrity": "sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==", "dev": true, "dependencies": { "array-find-index": "^1.0.1" @@ -14154,7 +10010,7 @@ "node_modules/dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", "dev": true, "dependencies": { "assert-plus": "^1.0.0" @@ -14164,40 +10020,40 @@ } }, "node_modules/data-uri-to-buffer": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz", - "integrity": "sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", + "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", "dev": true, "engines": { "node": ">= 12" } }, "node_modules/datatables.net": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/datatables.net/-/datatables.net-1.12.1.tgz", - "integrity": "sha512-e6XAMUoV41JdQPS/r9YRfRcmTPcCVvyZbWI+xog1Zg+kjVliMQbEkvWK5XFItmi64Cvwg+IqsZbTUJ1KSY3umA==", + "version": "1.13.5", + "resolved": "https://registry.npmjs.org/datatables.net/-/datatables.net-1.13.5.tgz", + "integrity": "sha512-XoCQHkUM5MwbC3Wx7WpVvt4i880J8pIFDA9HIKD4GhvtalryBfmdd+bZvrc/rEbraZS7U4eR2k8/wFY0NeHVqQ==", "dependencies": { "jquery": ">=1.7" } }, "node_modules/datatables.net-bs": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/datatables.net-bs/-/datatables.net-bs-1.12.1.tgz", - "integrity": "sha512-oaX1mNhjnASo33mwv6QzgGxD3pAz69qAL+8YlCro3e7oMvszE6wJyprEt80vl8E/TiMp/UUvsaqsup1JZFfMBQ==", + "version": "1.13.5", + "resolved": "https://registry.npmjs.org/datatables.net-bs/-/datatables.net-bs-1.13.5.tgz", + "integrity": "sha512-ZIiQAKwwIV+BoGijH3MHm6Vc7WB0icFxAF8uxx7nyZr5WMw1R7Pt5pqU1MqwjyjWtu81OveXQdRuwHMijey6ww==", "dependencies": { - "datatables.net": ">=1.11.3", + "datatables.net": ">=1.13.4", "jquery": ">=1.7" } }, "node_modules/date-now": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", - "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=" + "integrity": "sha512-AsElvov3LoNB7tf5k37H2jYSB+ZZPMT5sG2QjJCcdlV5chIv6htBUBUui2IKRjgtKAKtCBN7Zbwa+MtwLjSeNw==" }, "node_modules/dateformat": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", - "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==", + "version": "4.6.3", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.6.3.tgz", + "integrity": "sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==", "dev": true, "engines": { "node": "*" @@ -14206,24 +10062,32 @@ "node_modules/dbf": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/dbf/-/dbf-0.1.4.tgz", - "integrity": "sha1-Fi8Nj9HbN8l2RYrG/m9VtIxy9GY=", + "integrity": "sha512-7tQ8w5NB74PL1f0Z/NQ6Y+URjBFhtEsFxzEQSzot2+VpLwWfrNnxFVhzWm6dJyEtFq0WkYWcGEMDf39fy8JFaw==", "dependencies": { "jdataview": "~2.5.0" } }, "node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dependencies": { - "ms": "2.0.0" + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, "node_modules/debuglog": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz", - "integrity": "sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI=", + "integrity": "sha512-syBZ+rnAK3EgMsH2aYEOLUW7mZSY9Gb+0wUMCFsZvcmiz+HigA0LOcq/HoQqVuGG+EKykunc7QG2bzrponfaSw==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", "dev": true, "engines": { "node": "*" @@ -14232,31 +10096,143 @@ "node_modules/decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "dev": true, + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/decompress-response/node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/deep-equal": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", + "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==", + "dependencies": { + "is-arguments": "^1.0.4", + "is-date-object": "^1.0.1", + "is-regex": "^1.0.4", + "object-is": "^1.0.1", + "object-keys": "^1.1.1", + "regexp.prototype.flags": "^1.2.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "node_modules/default-browser": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-4.0.0.tgz", + "integrity": "sha512-wX5pXO1+BrhMkSbROFsyxUm0i/cJEScyNhA4PPxc41ICuv05ZZB/MX28s8aZx6xjmatvebIapF6hLEKEcpneUA==", + "dev": true, + "dependencies": { + "bundle-name": "^3.0.0", + "default-browser-id": "^3.0.0", + "execa": "^7.1.1", + "titleize": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser-id": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-3.0.0.tgz", + "integrity": "sha512-OZ1y3y0SqSICtE8DE4S8YOE9UZOJ8wO16fKWVP5J1Qz42kV9jcnMVFrEE/noXb/ss3Q4pZIH79kxofzyNNtUNA==", "dev": true, + "dependencies": { + "bplist-parser": "^0.2.0", + "untildify": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-gateway": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/default-gateway/-/default-gateway-6.0.3.tgz", + "integrity": "sha512-fwSOJsbbNzZ/CUFpqFBqYfYNLj1NbMPm8MMCIzHjC83iSJRBEGmDUxU+WP661BaBQImeC2yHwXtz+P/O9o+XEg==", + "dev": true, + "dependencies": { + "execa": "^5.0.0" + }, "engines": { - "node": ">=0.10.0" + "node": ">= 10" } }, - "node_modules/decompress-response": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", - "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "node_modules/default-gateway/node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", "dev": true, "dependencies": { - "mimic-response": "^3.1.0" + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" }, "engines": { "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/decompress-response/node_modules/mimic-response": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", - "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "node_modules/default-gateway/node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true, "engines": { "node": ">=10" @@ -14265,53 +10241,76 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/deep-equal": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", - "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==", - "dependencies": { - "is-arguments": "^1.0.4", - "is-date-object": "^1.0.1", - "is-regex": "^1.0.4", - "object-is": "^1.0.1", - "object-keys": "^1.1.1", - "regexp.prototype.flags": "^1.2.0" + "node_modules/default-gateway/node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, + "engines": { + "node": ">=10.17.0" + } + }, + "node_modules/default-gateway/node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "engines": { + "node": ">=8" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "node_modules/default-gateway/node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true, "engines": { - "node": ">=4.0.0" + "node": ">=6" } }, - "node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true + "node_modules/default-gateway/node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } }, - "node_modules/default-gateway": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/default-gateway/-/default-gateway-6.0.3.tgz", - "integrity": "sha512-fwSOJsbbNzZ/CUFpqFBqYfYNLj1NbMPm8MMCIzHjC83iSJRBEGmDUxU+WP661BaBQImeC2yHwXtz+P/O9o+XEg==", + "node_modules/default-gateway/node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, "dependencies": { - "execa": "^5.0.0" + "mimic-fn": "^2.1.0" }, "engines": { - "node": ">= 10" + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-gateway/node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, + "engines": { + "node": ">=6" } }, "node_modules/default-require-extensions": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-2.0.0.tgz", - "integrity": "sha1-9fj7sYp9bVCyH2QfZJ67Uiz+JPc=", + "integrity": "sha512-B0n2zDIXpzLzKeoEozorDSa1cHc1t0NjmxP0zuAxbizNU2MBqYJJKYXrrFdKuQliojXynrxgd7l4ahfg/+aA5g==", "dev": true, "dependencies": { "strip-bom": "^3.0.0" @@ -14320,22 +10319,16 @@ "node": ">=4" } }, - "node_modules/default-require-extensions/node_modules/strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/defaults": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", - "integrity": "sha512-s82itHOnYrN0Ib8r+z7laQz3sdE+4FP3d9Q7VLO7U+KRT+CR0GsWuyHxzdAY82I7cXv0G/twrqomTJLOssO5HA==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", "dev": true, "dependencies": { "clone": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/defer-to-connect": { @@ -14357,40 +10350,47 @@ } }, "node_modules/define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", + "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", "dependencies": { - "object-keys": "^1.0.12" + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/defined": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", - "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.1.tgz", + "integrity": "sha512-hsBd2qSVCRE+5PmNdHt1uzyrFu5d3RwmFDKzyNZMFq/EwDNJF7Ee5+D5oEKF0hU6LhtoUF1macFvOe4AskQC1Q==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/degenerator": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/degenerator/-/degenerator-3.0.2.tgz", - "integrity": "sha512-c0mef3SNQo56t6urUU6tdQAs+ThoD0o9B9MJ8HEt7NQcGEILCRFqQb7ZbP9JAv+QF1Ky5plydhMR/IrqWDm+TQ==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/degenerator/-/degenerator-4.0.4.tgz", + "integrity": "sha512-MTZdZsuNxSBL92rsjx3VFWe57OpRlikyLbcx2B5Dmdv6oScqpMrvpY7zHLMymrUxo3U5+suPUMsNgW/+SZB1lg==", "dev": true, "dependencies": { - "ast-types": "^0.13.2", - "escodegen": "^1.8.1", - "esprima": "^4.0.0", - "vm2": "^3.9.8" + "ast-types": "^0.13.4", + "escodegen": "^1.14.3", + "esprima": "^4.0.1", + "vm2": "^3.9.19" }, "engines": { - "node": ">= 6" + "node": ">= 14" } }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "dev": true, "engines": { "node": ">=0.4.0" @@ -14422,10 +10422,24 @@ "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", "dev": true }, + "node_modules/deps-sort": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.1.tgz", + "integrity": "sha512-1orqXQr5po+3KI6kQb9A4jnXT1PBwggGl2d7Sq2xsnOeI9GPcE/tGcF9UiSZtZBM7MukY4cAh7MemS6tZYipfw==", + "dependencies": { + "JSONStream": "^1.0.3", + "shasum-object": "^1.0.0", + "subarg": "^1.0.0", + "through2": "^2.0.0" + }, + "bin": { + "deps-sort": "bin/cmd.js" + } + }, "node_modules/des.js": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", - "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.1.0.tgz", + "integrity": "sha512-r17GxjhUCjSRy8aiJpr8/UadFIzMzJGexI3Nmz4ADi9LYSFx4gTBp80+NaX/YsXWWLhpZ7v/v/ubEc/bCNfKwg==", "dependencies": { "inherits": "^2.0.1", "minimalistic-assert": "^1.0.0" @@ -14453,7 +10467,7 @@ "node_modules/detect-indent": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", - "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", + "integrity": "sha512-BDKtmHlOzwI7iRuEkhzsnPoi5ypEhWAJB5RvHWe1kMr06js3uK5B3734i3ui5Yd+wOJV1cpE4JnivPD283GU/A==", "dev": true, "dependencies": { "repeating": "^2.0.0" @@ -14481,13 +10495,13 @@ "dev": true }, "node_modules/detective": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/detective/-/detective-5.2.0.tgz", - "integrity": "sha512-6SsIx+nUUbuK0EthKjv0zrdnajCCXVYGmbYYiYjFVpzcjwEs/JMDZ8tPRG29J/HhN56t3GJp2cGSWDRjjot8Pg==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/detective/-/detective-5.2.1.tgz", + "integrity": "sha512-v9XE1zRnz1wRtgurGu0Bs8uHKFSTdteYZNbIPFVhUZ39L/S79ppMpdmVOZAnoz1jfEFodc48n6MX483Xo3t1yw==", "dependencies": { - "acorn-node": "^1.6.1", + "acorn-node": "^1.8.2", "defined": "^1.0.0", - "minimist": "^1.1.1" + "minimist": "^1.2.6" }, "bin": { "detective": "bin/detective.js" @@ -14497,9 +10511,9 @@ } }, "node_modules/dezalgo": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.3.tgz", - "integrity": "sha1-f3Qt4Gb8dIvI24IFad3c5Jvw1FY=", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.4.tgz", + "integrity": "sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==", "dev": true, "dependencies": { "asap": "^2.0.0", @@ -14525,6 +10539,11 @@ "randombytes": "^2.0.0" } }, + "node_modules/diffie-hellman/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, "node_modules/dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -14537,15 +10556,6 @@ "node": ">=8" } }, - "node_modules/dir-glob/node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/dns-equal": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/dns-equal/-/dns-equal-1.0.0.tgz", @@ -14565,11 +10575,11 @@ } }, "node_modules/docx": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/docx/-/docx-7.3.0.tgz", - "integrity": "sha512-OkSGlDNWMRFY07OEhUTx1ouuzYi8s1b67JDI6m5/5ek4xoshtP+/Rx8eRdY8LbhvpFkngvUantvTsxY4XW8Heg==", + "version": "7.8.2", + "resolved": "https://registry.npmjs.org/docx/-/docx-7.8.2.tgz", + "integrity": "sha512-ptaiVZunYO04z113E/jR3yZx7/VaeUap2CHM9V1YwlmGygJ2W8y2KBmAsVgzlzs+qT7+3d5W3Q7+57BgvGiL+Q==", "dependencies": { - "@types/node": "^17.0.0", + "@types/node": "^18.0.0", "jszip": "^3.1.5", "nanoid": "^3.1.20", "xml": "^1.0.1", @@ -14579,34 +10589,24 @@ "node": ">=10" } }, - "node_modules/docx/node_modules/@types/node": { - "version": "17.0.19", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.19.tgz", - "integrity": "sha512-PfeQhvcMR4cPFVuYfBN4ifG7p9c+Dlh3yUZR6k+5yQK7wX3gDgVxBly4/WkBRs9x4dmcy1TVl08SY67wwtEvmA==" - }, "node_modules/dom-serializer": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", - "integrity": "sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dev": true, "dependencies": { - "domelementtype": "^2.0.1", - "entities": "^2.0.0" + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" } }, - "node_modules/dom-serializer/node_modules/domelementtype": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.0.1.tgz", - "integrity": "sha512-5HOHUDsYZWV8FGWN0Njbr/Rn7f/eWSQi1v7+HsUVwXgn8nWWlL64zKDkS0n8ZmQ3mlWOMuXOnR+7Nx/5tMO5AQ==" - }, - "node_modules/dom-serializer/node_modules/entities": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.0.tgz", - "integrity": "sha512-D9f7V0JSRwIxlRI2mjMqufDrRDnx8p+eEOz7aUM9SuvF8gsBzra0/6tbjl1m8eQHrZlYj6PxqE00hZ1SAIKPLw==" - }, "node_modules/dom-to-image-more": { - "version": "2.9.5", - "resolved": "https://registry.npmjs.org/dom-to-image-more/-/dom-to-image-more-2.9.5.tgz", - "integrity": "sha512-7pr43ZY/Nk0k2z3NXDKN4GvnZqP/3iZvddLeIuGfNTyFJuzzr0UeLl+poZ1ewYt3YIK+WHCEZUkz+RNuocN3/Q==" + "version": "2.16.0", + "resolved": "https://registry.npmjs.org/dom-to-image-more/-/dom-to-image-more-2.16.0.tgz", + "integrity": "sha512-RyjtkaM/zVy90uJ20lT+/G7MwBZx6l/ePliq5CQOeAnPeew7aUGS6IqRWBkHpstU+POmhaKA8A9H9qf476gisQ==" }, "node_modules/domain-browser": { "version": "1.2.0", @@ -14618,22 +10618,36 @@ } }, "node_modules/domelementtype": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", - "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==" + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ] }, "node_modules/domhandler": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.3.0.tgz", - "integrity": "sha1-LeWaCCLVAn+r/28DLCsloqir5zg=", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dev": true, "dependencies": { - "domelementtype": "1" + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" } }, "node_modules/domhelper": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/domhelper/-/domhelper-0.9.1.tgz", - "integrity": "sha1-JlVOW6wsnpWF3KUAl431Bn1kvQA=", + "integrity": "sha512-TVyA6YHUnoMErPt1dGZ6vCwts+NzkIgHPTmYD1F9EcHebAlsQ3NSAsXLZh1oPMYlz4bPwptx/C8qF3pphMCyDw==", "dependencies": { "browserify": ">=3.46.0", "classie": ">=0.0.1", @@ -14644,18 +10658,23 @@ } }, "node_modules/dompurify": { - "version": "2.3.9", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.3.9.tgz", - "integrity": "sha512-3zOnuTwup4lPV/GfGS6UzG4ub9nhSYagR/5tB3AvDEwqyy5dtyCM2dVjwGDCnrPerXifBKTYh/UWCGKK7ydhhw==", + "version": "2.4.7", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.4.7.tgz", + "integrity": "sha512-kxxKlPEDa6Nc5WJi+qRgPbOAbgTpSULL+vI3NUXsZMlkJxTqYI9wg5ZTay2sFrdZRWHPWNi+EdAhcJf81WtoMQ==", "optional": true }, "node_modules/domutils": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", - "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", + "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", + "dev": true, "dependencies": { - "dom-serializer": "0", - "domelementtype": "1" + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" } }, "node_modules/dot-prop": { @@ -14682,11 +10701,38 @@ "node_modules/duplexer2": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", - "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", + "integrity": "sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==", "dependencies": { "readable-stream": "^2.0.2" } }, + "node_modules/duplexer2/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, + "node_modules/duplexer2/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/duplexer2/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, "node_modules/earcut": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/earcut/-/earcut-2.2.4.tgz", @@ -14701,7 +10747,7 @@ "node_modules/ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", "dev": true, "dependencies": { "jsbn": "~0.1.0", @@ -14709,12 +10755,12 @@ } }, "node_modules/echarts": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/echarts/-/echarts-5.3.0.tgz", - "integrity": "sha512-zENufmwFE6WjM+24tW3xQq4ICqQtI0CGj4bDVDNd3BK3LtaA/5wBp+64ykIyKy3QElz0cieKqSYP4FX9Lv9MwQ==", + "version": "5.4.2", + "resolved": "https://registry.npmjs.org/echarts/-/echarts-5.4.2.tgz", + "integrity": "sha512-2W3vw3oI2tWJdyAz+b8DuWS0nfXtSDqlDmqgin/lfzbkB01cuMEN66KWBlmur3YMp5nEDEEt5s23pllnAzB4EA==", "dependencies": { "tslib": "2.3.0", - "zrender": "5.3.0" + "zrender": "5.4.3" } }, "node_modules/echarts-stat": { @@ -14744,10 +10790,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.428", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.428.tgz", - "integrity": "sha512-L7uUknyY286of0AYC8CKfgWstD0Smk2DvHDi9F0GWQhSH90Bzi7iDrmCbZKz75tYJxeGSAc7TYeKpmbjMDoh1w==", - "dev": true + "version": "1.4.459", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.459.tgz", + "integrity": "sha512-XXRS5NFv8nCrBL74Rm3qhJjA2VCsRFx0OjHKBMPI0otij56aun8UWiKTDABmd5/7GTR021pA4wivs+Ri6XCElg==" }, "node_modules/elliptic": { "version": "6.5.4", @@ -14768,17 +10813,11 @@ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" }, - "node_modules/elliptic/node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, "node_modules/emojis-list": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", @@ -14807,32 +10846,19 @@ "iconv-lite": "^0.6.2" } }, - "node_modules/encoding/node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dev": true, - "optional": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/end-of-stream": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", "dev": true, "dependencies": { "once": "^1.4.0" } }, "node_modules/enhanced-resolve": { - "version": "5.14.1", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.14.1.tgz", - "integrity": "sha512-Vklwq2vDKtl0y/vtwjSesgJ5MYS7Etuk5txS8VdKL4AOS1aUlD96zqIfsOSLQsdv3xgMRbtkWM8eG9XDfKUPow==", + "version": "5.15.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz", + "integrity": "sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==", "dev": true, "dependencies": { "graceful-fs": "^4.2.4", @@ -14842,23 +10868,18 @@ "node": ">=10.13.0" } }, - "node_modules/enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", "dev": true, - "dependencies": { - "ansi-colors": "^4.1.1" - }, "engines": { - "node": ">=8.6" + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" } }, - "node_modules/entities": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz", - "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=" - }, "node_modules/env-paths": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", @@ -14869,9 +10890,9 @@ } }, "node_modules/envinfo": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.7.4.tgz", - "integrity": "sha512-TQXTYFVVwwluWSFis6K2XKxgrD22jEv0FTuLCQI+OjH7rn93+iY0fSSFM5lrSxFY+H1+B0/cvvlamr3UsBivdQ==", + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.10.0.tgz", + "integrity": "sha512-ZtUjZO6l5mwTHvc1L9+1q5p/R3wTopcfqMW8r5t8SJSKqeVI/LtajORwRFEKpEFuekjD0VBjwu1HMxL4UalIRw==", "dev": true, "bin": { "envinfo": "dist/cli.js" @@ -14909,31 +10930,61 @@ } }, "node_modules/error-ex": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", - "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, "dependencies": { "is-arrayish": "^0.2.1" } }, + "node_modules/error/node_modules/string-template": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/string-template/-/string-template-0.2.1.tgz", + "integrity": "sha512-Yptehjogou2xm4UJbxJ4CxgZx12HBfeystp0y3x7s4Dj32ltVVG1Gg8YhKjHZkHicuKpZX/ffilA8505VbUbpw==", + "dev": true + }, "node_modules/es-abstract": { - "version": "1.18.0-next.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz", - "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==", + "version": "1.21.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.21.3.tgz", + "integrity": "sha512-ZU4miiY1j3sGPFLJ34VJXEqhpmL+HGByCinGHv4HC+Fxl2fI2Z4yR6tl0mORnDr6PA8eihWo4LmSWDbvhALckg==", + "dev": true, "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "es-set-tostringtag": "^2.0.1", "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", + "function.prototype.name": "^1.1.5", + "get-intrinsic": "^1.2.1", + "get-symbol-description": "^1.0.0", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.2.2", - "is-negative-zero": "^2.0.0", - "is-regex": "^1.1.1", - "object-inspect": "^1.8.0", + "has-property-descriptors": "^1.0.0", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.5", + "is-array-buffer": "^3.0.2", + "is-callable": "^1.2.7", + "is-negative-zero": "^2.0.2", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.10", + "is-weakref": "^1.0.2", + "object-inspect": "^1.12.3", "object-keys": "^1.1.1", - "object.assign": "^4.1.1", - "string.prototype.trimend": "^1.0.1", - "string.prototype.trimstart": "^1.0.1" + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.5.0", + "safe-regex-test": "^1.0.0", + "string.prototype.trim": "^1.2.7", + "string.prototype.trimend": "^1.0.6", + "string.prototype.trimstart": "^1.0.6", + "typed-array-byte-offset": "^1.0.0", + "typed-array-length": "^1.0.4", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.10" }, "engines": { "node": ">= 0.4" @@ -14949,79 +11000,50 @@ "dev": true }, "node_modules/es-get-iterator": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.2.tgz", - "integrity": "sha512-+DTO8GYwbMCwbywjimwZMHp8AuYXOS2JZFWoi2AlPOS3ebnII9w/NLpNZtA7A0YLaVDw+O7KFCeoIV7OPvM7hQ==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.3.tgz", + "integrity": "sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.0", - "has-symbols": "^1.0.1", - "is-arguments": "^1.1.0", + "get-intrinsic": "^1.1.3", + "has-symbols": "^1.0.3", + "is-arguments": "^1.1.1", "is-map": "^2.0.2", "is-set": "^2.0.2", - "is-string": "^1.0.5", - "isarray": "^2.0.5" + "is-string": "^1.0.7", + "isarray": "^2.0.5", + "stop-iteration-iterator": "^1.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/es-get-iterator/node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } + "node_modules/es-module-lexer": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.3.0.tgz", + "integrity": "sha512-vZK7T0N2CBmBOixhmjdqx2gWVbFZ4DXZ/NyRMZVlJXPa7CyFS+/a4QQsDGDQy9ZfEzxFuNEsMLeQJnKP2p5/JA==", + "dev": true }, - "node_modules/es-get-iterator/node_modules/get-intrinsic": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", - "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", + "node_modules/es-set-tostringtag": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", + "integrity": "sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==", "dev": true, "dependencies": { - "function-bind": "^1.1.1", + "get-intrinsic": "^1.1.3", "has": "^1.0.3", - "has-symbols": "^1.0.3" + "has-tostringtag": "^1.0.0" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/es-get-iterator/node_modules/get-intrinsic/node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, "engines": { "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/es-get-iterator/node_modules/isarray": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "dev": true - }, - "node_modules/es-module-lexer": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.3.0.tgz", - "integrity": "sha512-vZK7T0N2CBmBOixhmjdqx2gWVbFZ4DXZ/NyRMZVlJXPa7CyFS+/a4QQsDGDQy9ZfEzxFuNEsMLeQJnKP2p5/JA==", - "dev": true - }, "node_modules/es-to-primitive": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, "dependencies": { "is-callable": "^1.1.4", "is-date-object": "^1.0.1", @@ -15098,7 +11120,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "dev": true, "engines": { "node": ">=6" } @@ -15124,8 +11145,7 @@ "node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true, + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "engines": { "node": ">=0.8.0" } @@ -15210,27 +11230,27 @@ } }, "node_modules/esrecurse/node_modules/estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, "engines": { "node": ">=4.0" } }, "node_modules/estraverse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=4.0" } }, "node_modules/esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true, "engines": { "node": ">=0.10.0" @@ -15248,7 +11268,7 @@ "node_modules/eve-raphael": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/eve-raphael/-/eve-raphael-0.5.0.tgz", - "integrity": "sha1-F8dUt5K+7z+maE15z1pHxjxM2jA=" + "integrity": "sha512-jrxnPsCGqng1UZuEp9DecX/AuSyAszATSjf4oEcRxvfxa1Oux4KkIPKBAAWWnpdwfARtr+Q0o9aPYWjsROD7ug==" }, "node_modules/eventemitter-asyncresource": { "version": "1.0.0", @@ -15269,9 +11289,9 @@ "dev": true }, "node_modules/events": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.2.0.tgz", - "integrity": "sha512-/46HWwbfCX2xTawVfkKLGxMifJYQBWMwY1mjywRtb4c9x8l5NP3KoJtnIOiL1hfdRkIuYhETxQlo62IF8tcnlg==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", "engines": { "node": ">=0.8.x" } @@ -15279,7 +11299,7 @@ "node_modules/events-to-array": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/events-to-array/-/events-to-array-1.1.2.tgz", - "integrity": "sha1-LUH1Y+H+QA7Uli/hpNXGp1Od9/Y=", + "integrity": "sha512-inRWzRY7nG+aXZxBzEqYKB3HPgwflZRopAjDCHv0whhRx+MTUr1ei0ICZUypdyE0HRm4L2d5VEcIqLD6yl+BFA==", "dev": true }, "node_modules/evp_bytestokey": { @@ -15292,46 +11312,32 @@ } }, "node_modules/execa": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.0.0.tgz", - "integrity": "sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-7.1.1.tgz", + "integrity": "sha512-wH0eMf/UXckdUYnO21+HDztteVv05rq2GXksxT4fCGeHkBhw1DROXh40wcjMcRqDOWE7iPJ4n3M7e2+YFP+76Q==", "dev": true, "dependencies": { "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", + "get-stream": "^6.0.1", + "human-signals": "^4.3.0", + "is-stream": "^3.0.0", "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^3.0.7", + "strip-final-newline": "^3.0.0" }, "engines": { - "node": ">=10" + "node": "^14.18.0 || ^16.14.0 || >=18.0.0" }, "funding": { "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/execa/node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/execa/node_modules/get-stream": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.0.tgz", - "integrity": "sha512-A1B3Bh1UmL0bidM/YX2NsCOTnGJePL9rO/M+Mw3m9f2gUpfokS0hi5Eah0WSUEWZdZhIZtMjkIYS7mDfOqNHbg==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true, "engines": { "node": ">=10" @@ -15340,34 +11346,10 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/execa/node_modules/is-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", - "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/execa/node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/exit": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", "engines": { "node": ">= 0.8.0" } @@ -15446,6 +11428,21 @@ "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", "dev": true }, + "node_modules/express/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/express/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, "node_modules/express/node_modules/qs": { "version": "6.11.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", @@ -15501,6 +11498,18 @@ "node": ">=4" } }, + "node_modules/external-editor/node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/extract-zip": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", @@ -15521,33 +11530,10 @@ "@types/yauzl": "^2.9.1" } }, - "node_modules/extract-zip/node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/extract-zip/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "node_modules/extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", "dev": true, "engines": [ "node >=0.6.0" @@ -15557,13 +11543,12 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true + "devOptional": true }, "node_modules/fast-glob": { "version": "3.2.12", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", - "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -15576,9 +11561,9 @@ } }, "node_modules/fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, "node_modules/fast-levenshtein": { @@ -15588,26 +11573,28 @@ "dev": true }, "node_modules/fast-safe-stringify": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz", - "integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA==" + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==" }, "node_modules/fastclick": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/fastclick/-/fastclick-1.0.6.tgz", - "integrity": "sha1-FhYlsnsaWAZAWTa9qaLBkm0Gvmo=" + "integrity": "sha512-cXyDBT4g0uWl/Xe75QspBDAgAWQ0lkPi/zgp6YFEUHj6WV6VIZl7R6TiDZhdOVU3W4ehp/8tG61Jev1jit+ztQ==" }, "node_modules/fastest-levenshtein": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz", - "integrity": "sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow==", - "dev": true + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", + "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", + "dev": true, + "engines": { + "node": ">= 4.9.1" + } }, "node_modules/fastq": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.0.tgz", - "integrity": "sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g==", - "dev": true, + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", "dependencies": { "reusify": "^1.0.4" } @@ -15615,7 +11602,7 @@ "node_modules/faye-websocket": { "version": "0.10.0", "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.10.0.tgz", - "integrity": "sha1-TkkvjQTftviQA1B/btvy1QHnxvQ=", + "integrity": "sha512-Xhj93RXbMSq8urNCUq4p9l0P6hnySJ/7YNRhYNug0bLOuii7pKO7xQFb5mx9xZXWCar88pLPb805PvUkwrLZpQ==", "dev": true, "dependencies": { "websocket-driver": ">=0.5.1" @@ -15627,7 +11614,7 @@ "node_modules/fd-slicer": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", - "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", + "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", "dev": true, "dependencies": { "pend": "~1.2.0" @@ -15662,16 +11649,18 @@ "integrity": "sha512-FJqqoDBR00Mdj9ppamLa/Y7vxm+PRmNWA67N846RvsoYVMKB4q3y/de5PA7gUmRMYK/8CMz2GDZQmCRN1wBcWA==" }, "node_modules/figures": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", - "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", "dev": true, "dependencies": { - "escape-string-regexp": "^1.0.5", - "object-assign": "^4.1.0" + "escape-string-regexp": "^1.0.5" }, "engines": { - "node": ">=0.10.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/file-saver": { @@ -15682,28 +11671,18 @@ "node_modules/file-saverjs": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/file-saverjs/-/file-saverjs-1.3.6.tgz", - "integrity": "sha1-t6RU4Sb1bPcfy3AVm4NWFCZU544=" + "integrity": "sha512-b8Re91Mmhc2i2wRGEhzeBp3Mbv+y/+uZt6Ty5Fld9LNDxS3bzESyvB0a4WTBk8U4vznmFaD5sQtBR90L6W6a0A==" }, "node_modules/file-sync-cmp": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/file-sync-cmp/-/file-sync-cmp-0.1.1.tgz", - "integrity": "sha1-peeo/7+kk7Q7kju9TKiaU7Y7YSs=", + "integrity": "sha512-0k45oWBokCqh2MOexeYKpyqmGKG+8mQ2Wd8iawx+uWd/weWJQAZ6SoPybagdCI4xFisag8iAR77WPm4h3pTfxA==", "dev": true }, - "node_modules/file-uri-to-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-2.0.0.tgz", - "integrity": "sha512-hjPFI8oE/2iQPVe4gbrJ73Pp+Xfub2+WI2LlXDbsaJBwT5wuMh35WNWVYYTpnz895shtwfyutMFLFywpQAFdLg==", - "dev": true, - "engines": { - "node": ">= 6" - } - }, "node_modules/fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -15729,59 +11708,88 @@ "node": ">= 0.8" } }, + "node_modules/finalhandler/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/finalhandler/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, "node_modules/find-cache-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", - "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", + "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", "dev": true, "dependencies": { "commondir": "^1.0.1", - "make-dir": "^2.0.0", - "pkg-dir": "^3.0.0" + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" }, "engines": { - "node": ">=6" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/avajs/find-cache-dir?sponsor=1" } }, - "node_modules/find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "node_modules/find-cache-dir/node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, "dependencies": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" + "semver": "^6.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/findup-sync": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.3.0.tgz", - "integrity": "sha1-N5MKpdgWt3fANEXhlmzGeQpMCxY=", + "node_modules/find-cache-dir/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "dependencies": { - "glob": "~5.0.0" + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" }, "engines": { - "node": ">= 0.6.0" + "node": ">=8" } }, - "node_modules/findup-sync/node_modules/glob": { - "version": "5.0.15", - "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", - "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "node_modules/findup-sync": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-5.0.0.tgz", + "integrity": "sha512-MzwXju70AuyflbgeOhzvQWAvvQdo1XL0A9bVvlXsYcFEBM87WR4OakL4OfZq+QRmr+duJubio+UtNQCPsVESzQ==", "dev": true, "dependencies": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "2 || 3", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "detect-file": "^1.0.0", + "is-glob": "^4.0.3", + "micromatch": "^4.0.4", + "resolve-dir": "^1.0.1" }, "engines": { - "node": "*" + "node": ">= 10.13.0" } }, "node_modules/fined": { @@ -15815,9 +11823,9 @@ "integrity": "sha512-xg2otcTJDvS+ERK+my4wxG/ASq90QURXtoM4LhacCq0jQW2jbyjdttbRNqU2cPykrpMvJ6b2uSp6SAgYAzj9tQ==" }, "node_modules/follow-redirects": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.0.tgz", - "integrity": "sha512-aExlJShTV4qOUOL7yF1U5tvLCB0xQuudbf6toyYA0E/acBNw71mvjFTnLaRp50aQaYocMR0a/RMMBIHeZnGyjQ==", + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", "dev": true, "funding": [ { @@ -15837,11 +11845,19 @@ "node_modules/font-awesome": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/font-awesome/-/font-awesome-4.7.0.tgz", - "integrity": "sha1-j6jPBBGhoxr9B7BtKQK7n8gVoTM=", + "integrity": "sha512-U6kGnykA/6bFmg1M/oT9EkFeIYv7JlX3bozwQJWiiLz6L0w3F5vBVPxHlwyX/vtNq1ckcpRKOB9f2Qal/VtFpg==", "engines": { "node": ">=0.10.3" } }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dependencies": { + "is-callable": "^1.1.3" + } + }, "node_modules/for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", @@ -15863,25 +11879,58 @@ "node": ">=0.10.0" } }, - "node_modules/foreach": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", - "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=" - }, "node_modules/foreground-child": { "version": "1.5.6", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-1.5.6.tgz", - "integrity": "sha1-T9ca0t/elnibmApcCilZN8svXOk=", + "integrity": "sha512-3TOY+4TKV0Ml83PXJQY+JFQaHNV38lzQDIzzXYg1kWdBLenGgoZhAs0CKgzI31vi2pWEpQMq/Yi4bpKwCPkw7g==", "dev": true, "dependencies": { "cross-spawn": "^4", "signal-exit": "^3.0.0" } }, + "node_modules/foreground-child/node_modules/cross-spawn": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.2.tgz", + "integrity": "sha512-yAXz/pA1tD8Gtg2S98Ekf/sewp3Lcp3YoFKJ4Hkp5h5yLWnKVTDU0kwjKJ8NDCYcfTLfyGkzTikst+jWypT1iA==", + "dev": true, + "dependencies": { + "lru-cache": "^4.0.1", + "which": "^1.2.9" + } + }, + "node_modules/foreground-child/node_modules/lru-cache": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "dev": true, + "dependencies": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "node_modules/foreground-child/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/foreground-child/node_modules/yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==", + "dev": true + }, "node_modules/forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", "dev": true, "engines": { "node": "*" @@ -15902,9 +11951,9 @@ } }, "node_modules/form-data-encoder": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-2.1.2.tgz", - "integrity": "sha512-FCaIOVTRA9E0siY6FeXid7D5yrCqpsErplUkE2a1BEiKj1BE9z6FbKB4ntDTwC4NVLie9p+4E9nX4mWwEOT05A==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-2.1.4.tgz", + "integrity": "sha512-yDYSgNMraqvnxiEXO4hi88+YZxaHC6QKzb5N84iRCTDeRO7ZALpir/lVmf/uXUhnwUr2O4HU8s/n6x+yNjQkHw==", "dev": true, "engines": { "node": ">= 14.17" @@ -15932,9 +11981,9 @@ } }, "node_modules/frac": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/frac/-/frac-1.1.2.tgz", - "integrity": "sha512-w/XBfkibaTl3YDqASwfDUqkna4Z2p9cFSr1aHDt0WoMTECnRfBOv2WArlZILlqgWlmdIlALXGpM2AOhEk5W3IA==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/frac/-/frac-0.3.1.tgz", + "integrity": "sha512-1Lzf2jOjhIkRaa013KlxNOn2D9FemmQNeYUDpEIyPeFXmpLvbZXJOlaayMBT6JKXx+afQFgQ1QJ4kaF7Z07QFQ==", "engines": { "node": ">=0.8" } @@ -15970,7 +12019,7 @@ "node_modules/fs-exists-cached": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-exists-cached/-/fs-exists-cached-1.0.0.tgz", - "integrity": "sha1-zyVVTKBQ3EmuZla0HeQiWJidy84=", + "integrity": "sha512-kSxoARUDn4F2RPXX48UXnaFKwVU7Ivd/6qpzZL29MCDmr9sTvybv4gFCp+qaI4fM9m0z9fgz/yJvi56GAz+BZg==", "dev": true }, "node_modules/fs-extra": { @@ -15999,15 +12048,6 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/fs-minipass/node_modules/minipass": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", - "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/fs-monkey": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.0.4.tgz", @@ -16023,13 +12063,12 @@ "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, "node_modules/fsevents": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, "hasInstallScript": true, "optional": true, "os": [ @@ -16039,47 +12078,10 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, - "node_modules/ftp": { - "version": "0.3.10", - "resolved": "https://registry.npmjs.org/ftp/-/ftp-0.3.10.tgz", - "integrity": "sha512-faFVML1aBx2UoDStmLwv2Wptt4vw5x03xxX172nhA5Y5HBshW5JweqQ2W4xL4dezQTG8inJsuYcpPHHU3X5OTQ==", - "dev": true, - "dependencies": { - "readable-stream": "1.1.x", - "xregexp": "2.0.0" - }, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/ftp/node_modules/isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", - "dev": true - }, - "node_modules/ftp/node_modules/readable-stream": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "node_modules/ftp/node_modules/string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==", - "dev": true - }, "node_modules/fullcalendar": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/fullcalendar/-/fullcalendar-3.10.0.tgz", - "integrity": "sha512-0OtsHhmdYhtFmQwXzyo8VqHzYgamg+zVOoytv5N13gI+iF6CGjevpCi/yBaQs0O4wY3OAp8I688IxdNYe0iAvw==", + "version": "3.10.5", + "resolved": "https://registry.npmjs.org/fullcalendar/-/fullcalendar-3.10.5.tgz", + "integrity": "sha512-JGWpECKgza/344bbF5QT0hBJpx04DZ/7QGPlR1ZbAwrG6Yz6mWEkQd+NnZUh1sK6HCBIPnPRW2x53aJxeLGvvQ==", "peerDependencies": { "jquery": "2 - 3", "moment": "^2.20.1" @@ -16101,61 +12103,167 @@ "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.0", - "functions-have-names": "^1.2.2" - }, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.0", + "functions-have-names": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gauge": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", + "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", + "dev": true, + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.3", + "console-control-strings": "^1.1.0", + "has-unicode": "^2.0.1", + "signal-exit": "^3.0.7", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.5" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/gaze": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/gaze/-/gaze-1.1.3.tgz", + "integrity": "sha512-BRdNm8hbWzFzWHERTrejLqwHDfS4GibPoq5wjTPIoJHoBtKGPg3xAFfxmM+9ztbXelxcf2hwQcaz1PtmFeue8g==", + "dev": true, + "dependencies": { + "globule": "^1.0.0" + }, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/geojson-equality": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/geojson-equality/-/geojson-equality-0.1.6.tgz", + "integrity": "sha512-TqG8YbqizP3EfwP5Uw4aLu6pKkg6JQK9uq/XZ1lXQntvTHD1BBKJWhNpJ2M0ax6TuWMP3oyx6Oq7FCIfznrgpQ==", + "dependencies": { + "deep-equal": "^1.0.0" + } + }, + "node_modules/geojson-rbush": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/geojson-rbush/-/geojson-rbush-3.2.0.tgz", + "integrity": "sha512-oVltQTXolxvsz1sZnutlSuLDEcQAKYC/uXt9zDzJJ6bu0W+baTI8LZBaTup5afzibEH4N3jlq2p+a152wlBJ7w==", + "dependencies": { + "@turf/bbox": "*", + "@turf/helpers": "6.x", + "@turf/meta": "6.x", + "@types/geojson": "7946.0.8", + "rbush": "^3.0.1" + } + }, + "node_modules/geojson-rbush/node_modules/quickselect": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-2.0.0.tgz", + "integrity": "sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw==" + }, + "node_modules/geojson-rbush/node_modules/rbush": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/rbush/-/rbush-3.0.1.tgz", + "integrity": "sha512-XRaVO0YecOpEuIvbhbpTrZgoiI6xBlz6hnlr6EHhd+0x9ase6EmeN+hdwwUaJvLcsFFQ8iWVF1GAK1yB0BWi0w==", + "dependencies": { + "quickselect": "^2.0.0" + } + }, + "node_modules/get-assigned-identifiers": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/get-assigned-identifiers/-/get-assigned-identifiers-1.2.0.tgz", + "integrity": "sha512-mBBwmeGTrxEMO4pMaaf/uUEFHnYtwr8FTe8Y/mer4rcV/bye0qGm6pw1bGZFGStxC5O76c5ZAVBGnqHmOaJpdQ==" + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha512-F5aQMywwJ2n85s4hJPTT9RPxGmubonuB10MNYo17/xph174n2MIR33HRguhzVag10O/npM7SPk73LMZNP+FaWw==", + "dev": true, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=0.10.0" } }, - "node_modules/function.prototype.name/node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "node_modules/get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", "dev": true, "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/function.prototype.name/node_modules/es-abstract": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.2.tgz", - "integrity": "sha512-XxXQuVNrySBNlEkTYJoDNFe5+s2yIOpzq80sUHEdPdQr0S5nTLz4ZPPPswNIpKseDDUS5yghX1gfLIHQZ1iNuQ==", + "node_modules/get-symbol-description": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", + "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "function.prototype.name": "^1.1.5", - "get-intrinsic": "^1.1.2", - "get-symbol-description": "^1.0.0", - "has": "^1.0.3", - "has-property-descriptors": "^1.0.0", - "has-symbols": "^1.0.3", - "internal-slot": "^1.0.3", - "is-callable": "^1.2.4", - "is-negative-zero": "^2.0.2", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.2", - "is-string": "^1.0.7", - "is-weakref": "^1.0.2", - "object-inspect": "^1.12.2", - "object-keys": "^1.1.1", - "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.4.3", - "string.prototype.trimend": "^1.0.5", - "string.prototype.trimstart": "^1.0.5", - "unbox-primitive": "^1.0.2" + "get-intrinsic": "^1.1.1" }, "engines": { "node": ">= 0.4" @@ -16164,107 +12272,190 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/function.prototype.name/node_modules/get-intrinsic": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", - "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", + "node_modules/get-uri": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.1.tgz", + "integrity": "sha512-7ZqONUVqaabogsYNWlYj0t3YZaL6dhuEueZXGF+/YVmf6dHmaFg8/6psJKqhx9QykIDKzpGcy2cn4oV4YC7V/Q==", "dev": true, "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" + "basic-ftp": "^5.0.2", + "data-uri-to-buffer": "^5.0.1", + "debug": "^4.3.4", + "fs-extra": "^8.1.0" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">= 14" } }, - "node_modules/function.prototype.name/node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "node_modules/get-uri/node_modules/data-uri-to-buffer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-5.0.1.tgz", + "integrity": "sha512-a9l6T1qqDogvvnw0nKlfZzqsyikEBZBClF39V3TFoKhDtGBqHu2HkuomJc02j5zft8zrUaXEuoicLeW54RkzPg==", "dev": true, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">= 14" } }, - "node_modules/function.prototype.name/node_modules/is-callable": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.5.tgz", - "integrity": "sha512-ZIWRujF6MvYGkEuHMYtFRkL2wAtFw89EHfKlXrkPkjQZZRWeh9L1q3SV13NIfHnqxugjLvAOkEHx9mb1zcMnEw==", + "node_modules/getobject": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/getobject/-/getobject-1.0.2.tgz", + "integrity": "sha512-2zblDBaFcb3rB4rF77XVnuINOE2h2k/OnqXAiy0IrTxUfV1iFp3la33oAQVY9pCpWU268WFYVt2t71hlMuLsOg==", "dev": true, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=10" } }, - "node_modules/function.prototype.name/node_modules/is-negative-zero": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", - "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", + "node_modules/getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", + "dev": true, + "dependencies": { + "assert-plus": "^1.0.0" + } + }, + "node_modules/git-up": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/git-up/-/git-up-7.0.0.tgz", + "integrity": "sha512-ONdIrbBCFusq1Oy0sC71F5azx8bVkvtZtMJAsv+a6lz5YAmbNnLD6HAB4gptHZVLPR8S2/kVN6Gab7lryq5+lQ==", + "dev": true, + "dependencies": { + "is-ssh": "^1.4.0", + "parse-url": "^8.1.0" + } + }, + "node_modules/git-url-parse": { + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/git-url-parse/-/git-url-parse-13.1.0.tgz", + "integrity": "sha512-5FvPJP/70WkIprlUZ33bm4UAaFdjcLkJLpWft1BeZKqwR0uhhNGoKwlUaPtVb4LxCSQ++erHapRak9kWGj+FCA==", "dev": true, + "dependencies": { + "git-up": "^7.0.0" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, "engines": { - "node": ">= 0.4" + "node": "*" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/function.prototype.name/node_modules/is-regex": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", - "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "dev": true + }, + "node_modules/global-dirs": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.1.tgz", + "integrity": "sha512-NBcGGFbBA9s1VzD41QXDG+3++t9Mn5t1FpLdhESY6oKY4gYTFpX4wO3sqGUa0Srjtbfj3szX0RnemmrVRUdULA==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" + "ini": "2.0.0" }, "engines": { - "node": ">= 0.4" + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/function.prototype.name/node_modules/object-inspect": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", - "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", + "node_modules/global-dirs/node_modules/ini": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", + "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">=10" } }, - "node_modules/function.prototype.name/node_modules/object.assign": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", - "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", + "node_modules/global-modules": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "has-symbols": "^1.0.3", - "object-keys": "^1.1.1" + "global-prefix": "^1.0.1", + "is-windows": "^1.0.1", + "resolve-dir": "^1.0.0" }, "engines": { - "node": ">= 0.4" + "node": ">=0.10.0" + } + }, + "node_modules/global-prefix": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", + "integrity": "sha512-5lsx1NUDHtSjfg0eHlmYvZKv8/nVqX4ckFbM+FrGcQ+04KWcWFo9P5MxPZYSzUvyzmdTbI7Eix8Q4IbELDqzKg==", + "dev": true, + "dependencies": { + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", + "ini": "^1.3.4", + "is-windows": "^1.0.1", + "which": "^1.2.14" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">=0.10.0" } }, - "node_modules/function.prototype.name/node_modules/object.assign/node_modules/define-properties": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", - "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", + "node_modules/global-prefix/node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, + "node_modules/global-prefix/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "dependencies": { - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "engines": { + "node": ">=4" + } + }, + "node_modules/globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "dev": true, + "dependencies": { + "define-properties": "^1.1.3" }, "engines": { "node": ">= 0.4" @@ -16273,557 +12464,607 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/function.prototype.name/node_modules/string.prototype.trimend": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz", - "integrity": "sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog==", + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.19.5" + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/function.prototype.name/node_modules/string.prototype.trimend/node_modules/define-properties": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", - "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", + "node_modules/globby/node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, - "dependencies": { - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" - }, "engines": { - "node": ">= 0.4" + "node": ">=8" + } + }, + "node_modules/globule": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/globule/-/globule-1.3.4.tgz", + "integrity": "sha512-OPTIfhMBh7JbBYDpa5b+Q5ptmMWKwcNcFSR/0c6t8V4f3ZAVBEsKNY37QdVqmLRYSMhOUGYrY0QhSoEpzGr/Eg==", + "dev": true, + "dependencies": { + "glob": "~7.1.1", + "lodash": "^4.17.21", + "minimatch": "~3.0.2" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">= 0.10" } }, - "node_modules/function.prototype.name/node_modules/string.prototype.trimstart": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz", - "integrity": "sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg==", + "node_modules/globule/node_modules/glob": { + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.19.5" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/function.prototype.name/node_modules/string.prototype.trimstart/node_modules/define-properties": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", - "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", + "node_modules/globule/node_modules/minimatch": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.8.tgz", + "integrity": "sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==", "dev": true, "dependencies": { - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" + "brace-expansion": "^1.1.7" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": "*" } }, - "node_modules/functions-have-names": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", - "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/gauge": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", - "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", + "node_modules/got": { + "version": "12.6.1", + "resolved": "https://registry.npmjs.org/got/-/got-12.6.1.tgz", + "integrity": "sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==", "dev": true, "dependencies": { - "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.3", - "console-control-strings": "^1.1.0", - "has-unicode": "^2.0.1", - "signal-exit": "^3.0.7", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "wide-align": "^1.1.5" + "@sindresorhus/is": "^5.2.0", + "@szmarczak/http-timer": "^5.0.1", + "cacheable-lookup": "^7.0.0", + "cacheable-request": "^10.2.8", + "decompress-response": "^6.0.0", + "form-data-encoder": "^2.1.2", + "get-stream": "^6.0.1", + "http2-wrapper": "^2.1.10", + "lowercase-keys": "^3.0.0", + "p-cancelable": "^3.0.0", + "responselike": "^3.0.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sindresorhus/got?sponsor=1" } }, - "node_modules/gauge/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "node_modules/got/node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/gauge/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, - "node_modules/gauge/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/gauge/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "node_modules/grunt": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.6.1.tgz", + "integrity": "sha512-/ABUy3gYWu5iBmrUSRBP97JLpQUm0GgVveDCp6t3yRNIoltIYw7rEj3g5y1o2PGPR2vfTRGa7WC/LZHLTXnEzA==", "dev": true, "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "dateformat": "~4.6.2", + "eventemitter2": "~0.4.13", + "exit": "~0.1.2", + "findup-sync": "~5.0.0", + "glob": "~7.1.6", + "grunt-cli": "~1.4.3", + "grunt-known-options": "~2.0.0", + "grunt-legacy-log": "~3.0.0", + "grunt-legacy-util": "~2.0.1", + "iconv-lite": "~0.6.3", + "js-yaml": "~3.14.0", + "minimatch": "~3.0.4", + "nopt": "~3.0.6" + }, + "bin": { + "grunt": "bin/grunt" }, "engines": { - "node": ">=8" + "node": ">=16" } }, - "node_modules/gauge/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "node_modules/grunt-babel": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/grunt-babel/-/grunt-babel-7.0.0.tgz", + "integrity": "sha512-AFilvH/iPbnIYhL4Wx36AJQCaVEvK55xh0tujAt1DIM5tuxYxRsgUPEpwijBU147B+as/ssGuY9/6JYfTiAWpw==", "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, "engines": { - "node": ">=8" + "node": ">=4" + }, + "peerDependencies": { + "babel-core": "^6.0.0 || ^7.0.0-alpha", + "grunt": ">=0.4.0" } }, - "node_modules/gaze": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/gaze/-/gaze-1.1.3.tgz", - "integrity": "sha512-BRdNm8hbWzFzWHERTrejLqwHDfS4GibPoq5wjTPIoJHoBtKGPg3xAFfxmM+9ztbXelxcf2hwQcaz1PtmFeue8g==", + "node_modules/grunt-cli": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.4.3.tgz", + "integrity": "sha512-9Dtx/AhVeB4LYzsViCjUQkd0Kw0McN2gYpdmGYKtE2a5Yt7v1Q+HYZVWhqXc/kGnxlMtqKDxSwotiGeFmkrCoQ==", "dev": true, "dependencies": { - "globule": "^1.0.0" + "grunt-known-options": "~2.0.0", + "interpret": "~1.1.0", + "liftup": "~3.0.1", + "nopt": "~4.0.1", + "v8flags": "~3.2.0" + }, + "bin": { + "grunt": "bin/grunt" }, "engines": { - "node": ">= 4.0.0" + "node": ">=10" } }, - "node_modules/gensync": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", - "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "node_modules/grunt-cli/node_modules/nopt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", + "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", "dev": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/geojson-equality": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/geojson-equality/-/geojson-equality-0.1.6.tgz", - "integrity": "sha512-TqG8YbqizP3EfwP5Uw4aLu6pKkg6JQK9uq/XZ1lXQntvTHD1BBKJWhNpJ2M0ax6TuWMP3oyx6Oq7FCIfznrgpQ==", - "dependencies": { - "deep-equal": "^1.0.0" - } - }, - "node_modules/geojson-rbush": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/geojson-rbush/-/geojson-rbush-3.2.0.tgz", - "integrity": "sha512-oVltQTXolxvsz1sZnutlSuLDEcQAKYC/uXt9zDzJJ6bu0W+baTI8LZBaTup5afzibEH4N3jlq2p+a152wlBJ7w==", "dependencies": { - "@turf/bbox": "*", - "@turf/helpers": "6.x", - "@turf/meta": "6.x", - "@types/geojson": "7946.0.8", - "rbush": "^3.0.1" - } - }, - "node_modules/geojson-rbush/node_modules/@turf/helpers": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", - "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", - "funding": { - "url": "https://opencollective.com/turf" + "abbrev": "1", + "osenv": "^0.1.4" + }, + "bin": { + "nopt": "bin/nopt.js" } }, - "node_modules/get-assigned-identifiers": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-assigned-identifiers/-/get-assigned-identifiers-1.2.0.tgz", - "integrity": "sha512-mBBwmeGTrxEMO4pMaaf/uUEFHnYtwr8FTe8Y/mer4rcV/bye0qGm6pw1bGZFGStxC5O76c5ZAVBGnqHmOaJpdQ==" - }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "node_modules/grunt-contrib-clean": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/grunt-contrib-clean/-/grunt-contrib-clean-1.1.0.tgz", + "integrity": "sha512-tET+TYTd8vCtKeGwbLjoH8+SdI8ngVzGbPr7vlWkewG7mYYHIccd2Ldxq+PK3DyBp5Www3ugdkfsjoNKUl5MTg==", "dev": true, + "dependencies": { + "async": "^1.5.2", + "rimraf": "^2.5.1" + }, "engines": { - "node": "6.* || 8.* || >= 10.*" + "node": ">= 0.10.0" + }, + "peerDependencies": { + "grunt": ">=0.4.5" } }, - "node_modules/get-intrinsic": { + "node_modules/grunt-contrib-concat": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.0.1.tgz", - "integrity": "sha512-ZnWP+AmS1VUaLgTRy47+zKtjTxz+0xMpx3I52i+aalBK1QP19ggLF3Db89KJX7kjfOfP2eoa01qc++GwPgufPg==", + "resolved": "https://registry.npmjs.org/grunt-contrib-concat/-/grunt-contrib-concat-1.0.1.tgz", + "integrity": "sha512-QdTmcxe8aim2Z0dFeuSJ+f7fHIeY7PZaTMZxgvosjXwyMhpy2GUR5WHkr12lksHfZVE80v2wUwqF56wyfPUwoQ==", + "dev": true, "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1" + "chalk": "^1.0.0", + "source-map": "^0.5.3" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-package-type": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", - "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", - "dev": true, "engines": { - "node": ">=8.0.0" + "node": ">=0.10.0" + }, + "peerDependencies": { + "grunt": ">=0.4.0" } }, - "node_modules/get-stdin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", - "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", + "node_modules/grunt-contrib-concat/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", "dev": true, "engines": { "node": ">=0.10.0" } }, - "node_modules/get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "node_modules/grunt-contrib-concat/node_modules/ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", "dev": true, - "dependencies": { - "pump": "^3.0.0" - }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=0.10.0" } }, - "node_modules/get-symbol-description": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", - "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "node_modules/grunt-contrib-concat/node_modules/chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.1" + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=0.10.0" } }, - "node_modules/get-symbol-description/node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "node_modules/grunt-contrib-concat/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">=0.10.0" } }, - "node_modules/get-symbol-description/node_modules/get-intrinsic": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", - "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", + "node_modules/grunt-contrib-concat/node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", "dev": true, "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" + "ansi-regex": "^2.0.0" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">=0.10.0" } }, - "node_modules/get-symbol-description/node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "node_modules/grunt-contrib-concat/node_modules/supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", "dev": true, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=0.8.0" } }, - "node_modules/get-uri": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-3.0.2.tgz", - "integrity": "sha512-+5s0SJbGoyiJTZZ2JTpFPLMPSch72KEqGOTvQsBqg0RBWvwhWUSYZFAtz3TPW0GXJuLBJPts1E241iHg+VRfhg==", + "node_modules/grunt-contrib-copy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/grunt-contrib-copy/-/grunt-contrib-copy-1.0.0.tgz", + "integrity": "sha512-gFRFUB0ZbLcjKb67Magz1yOHGBkyU6uL29hiEW1tdQ9gQt72NuMKIy/kS6dsCbV0cZ0maNCb0s6y+uT1FKU7jA==", "dev": true, "dependencies": { - "@tootallnate/once": "1", - "data-uri-to-buffer": "3", - "debug": "4", - "file-uri-to-path": "2", - "fs-extra": "^8.1.0", - "ftp": "^0.3.10" + "chalk": "^1.1.1", + "file-sync-cmp": "^0.1.0" }, "engines": { - "node": ">= 6" + "node": ">=0.10.0" } }, - "node_modules/get-uri/node_modules/data-uri-to-buffer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz", - "integrity": "sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og==", + "node_modules/grunt-contrib-copy/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", "dev": true, "engines": { - "node": ">= 6" + "node": ">=0.10.0" } }, - "node_modules/get-uri/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "node_modules/grunt-contrib-copy/node_modules/ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/grunt-contrib-copy/node_modules/chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", "dev": true, "dependencies": { - "ms": "2.1.2" + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" }, "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "node": ">=0.10.0" } }, - "node_modules/get-uri/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/getobject": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/getobject/-/getobject-1.0.2.tgz", - "integrity": "sha512-2zblDBaFcb3rB4rF77XVnuINOE2h2k/OnqXAiy0IrTxUfV1iFp3la33oAQVY9pCpWU268WFYVt2t71hlMuLsOg==", + "node_modules/grunt-contrib-copy/node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, "engines": { - "node": ">=10" + "node": ">=0.10.0" } }, - "node_modules/getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "node_modules/grunt-contrib-copy/node_modules/supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", "dev": true, - "dependencies": { - "assert-plus": "^1.0.0" + "engines": { + "node": ">=0.8.0" } }, - "node_modules/git-up": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/git-up/-/git-up-7.0.0.tgz", - "integrity": "sha512-ONdIrbBCFusq1Oy0sC71F5azx8bVkvtZtMJAsv+a6lz5YAmbNnLD6HAB4gptHZVLPR8S2/kVN6Gab7lryq5+lQ==", + "node_modules/grunt-contrib-cssmin": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/grunt-contrib-cssmin/-/grunt-contrib-cssmin-4.0.0.tgz", + "integrity": "sha512-jXU+Zlk8Q8XztOGNGpjYlD/BDQ0n95IHKrQKtFR7Gd8hZrzgqiG1Ra7cGYc8h2DD9vkSFGNlweb9Q00rBxOK2w==", "dev": true, "dependencies": { - "is-ssh": "^1.4.0", - "parse-url": "^8.1.0" + "chalk": "^4.1.0", + "clean-css": "^5.0.1", + "maxmin": "^3.0.0" + }, + "engines": { + "node": ">=10.0" } }, - "node_modules/git-url-parse": { - "version": "13.0.0", - "resolved": "https://registry.npmjs.org/git-url-parse/-/git-url-parse-13.0.0.tgz", - "integrity": "sha512-X1kozCqKL82dMrCLi4vie9SHDC+QugKskAMs4VUbIkhURKg5yDwxDmf6Ixg73J+/xVgK5TXKhzn8a94nHJHpnA==", + "node_modules/grunt-contrib-cssmin/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "git-up": "^7.0.0" + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "node_modules/grunt-contrib-cssmin/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": "*" + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "node_modules/grunt-contrib-cssmin/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "is-glob": "^4.0.1" + "color-name": "~1.1.4" }, "engines": { - "node": ">= 6" + "node": ">=7.0.0" } }, - "node_modules/glob-to-regexp": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", - "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "node_modules/grunt-contrib-cssmin/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/global-dirs": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.0.tgz", - "integrity": "sha512-v8ho2DS5RiCjftj1nD9NmnfaOzTdud7RRnVd9kFNOjqZbISlx5DQ+OrTkywgd0dIt7oFCvKetZSHoHcP3sDdiA==", + "node_modules/grunt-contrib-cssmin/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "dependencies": { - "ini": "2.0.0" - }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, - "node_modules/global-dirs/node_modules/ini": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", - "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", + "node_modules/grunt-contrib-cssmin/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, "engines": { - "node": ">=10" + "node": ">=8" } }, - "node_modules/global-modules": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", - "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", + "node_modules/grunt-contrib-jshint": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/grunt-contrib-jshint/-/grunt-contrib-jshint-1.1.0.tgz", + "integrity": "sha512-N8jtQ/FmvuRdJoEGphmGt+ov1oi5bJq4hPBPT/g54ed1glF34l2z5VAdHHhcgOaezBxur3kcMPChB0pfZxxcFw==", "dev": true, "dependencies": { - "global-prefix": "^1.0.1", - "is-windows": "^1.0.1", - "resolve-dir": "^1.0.0" + "chalk": "^1.1.1", + "hooker": "^0.2.3", + "jshint": "~2.9.4" + }, + "engines": { + "node": ">=0.10.0" }, + "peerDependencies": { + "grunt": ">=0.4.0" + } + }, + "node_modules/grunt-contrib-jshint/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true, "engines": { "node": ">=0.10.0" } }, - "node_modules/global-prefix": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", - "integrity": "sha512-5lsx1NUDHtSjfg0eHlmYvZKv8/nVqX4ckFbM+FrGcQ+04KWcWFo9P5MxPZYSzUvyzmdTbI7Eix8Q4IbELDqzKg==", + "node_modules/grunt-contrib-jshint/node_modules/ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", "dev": true, - "dependencies": { - "expand-tilde": "^2.0.2", - "homedir-polyfill": "^1.0.1", - "ini": "^1.3.4", - "is-windows": "^1.0.1", - "which": "^1.2.14" - }, "engines": { "node": ">=0.10.0" } }, - "node_modules/globals": { - "version": "9.18.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "node_modules/grunt-contrib-jshint/node_modules/chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", "dev": true, + "dependencies": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + }, "engines": { "node": ">=0.10.0" } }, - "node_modules/globby": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.2.tgz", - "integrity": "sha512-2ZThXDvvV8fYFRVIxnrMQBipZQDr7MxKAmQK1vujaj9/7eF0efG7BPUKJ7jP7G5SLF37xKDXvO4S/KKLj/Z0og==", + "node_modules/grunt-contrib-jshint/node_modules/dom-serializer": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", + "integrity": "sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==", "dev": true, "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.1.1", - "ignore": "^5.1.4", - "merge2": "^1.3.0", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, + "domelementtype": "^2.0.1", + "entities": "^2.0.0" + } + }, + "node_modules/grunt-contrib-jshint/node_modules/dom-serializer/node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ] + }, + "node_modules/grunt-contrib-jshint/node_modules/dom-serializer/node_modules/entities": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", + "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", + "dev": true, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/fb55/entities?sponsor=1" } }, - "node_modules/globby/node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "node_modules/grunt-contrib-jshint/node_modules/domelementtype": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", + "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==", + "dev": true + }, + "node_modules/grunt-contrib-jshint/node_modules/domhandler": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.3.0.tgz", + "integrity": "sha512-q9bUwjfp7Eif8jWxxxPSykdRZAb6GkguBGSgvvCrhI9wB71W2K/Kvv4E61CF/mcCfnVJDeDWx/Vb/uAqbDj6UQ==", "dev": true, - "engines": { - "node": ">=8" + "dependencies": { + "domelementtype": "1" } }, - "node_modules/globule": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/globule/-/globule-1.3.2.tgz", - "integrity": "sha512-7IDTQTIu2xzXkT+6mlluidnWo+BypnbSoEVVQCGfzqnl5Ik8d3e1d4wycb8Rj9tWW+Z39uPWsdlquqiqPCd/pA==", + "node_modules/grunt-contrib-jshint/node_modules/domutils": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", + "integrity": "sha512-gSu5Oi/I+3wDENBsOWBiRK1eoGxcywYSqg3rR960/+EfY0CF4EX1VPkgHOZ3WiS/Jg2DtliF6BhWcHlfpYUcGw==", "dev": true, "dependencies": { - "glob": "~7.1.1", - "lodash": "~4.17.10", - "minimatch": "~3.0.2" - }, - "engines": { - "node": ">= 0.10" + "dom-serializer": "0", + "domelementtype": "1" } }, - "node_modules/globule/node_modules/glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "node_modules/grunt-contrib-jshint/node_modules/entities": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz", + "integrity": "sha512-LbLqfXgJMmy81t+7c14mnulFHJ170cM6E+0vMXR9k/ZiZwgX8i5pNgjTCX3SO4VeUsFLV+8InixoretwU+MjBQ==", + "dev": true + }, + "node_modules/grunt-contrib-jshint/node_modules/htmlparser2": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", + "integrity": "sha512-hBxEg3CYXe+rPIua8ETe7tmG3XDn9B0edOE/e9wH2nLczxzgdu0m0aNHY+5wFZiviLWLdANPJTssa92dMcXQ5Q==", "dev": true, "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" + "domelementtype": "1", + "domhandler": "2.3", + "domutils": "1.5", + "entities": "1.0", + "readable-stream": "1.1" + } + }, + "node_modules/grunt-contrib-jshint/node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", + "dev": true + }, + "node_modules/grunt-contrib-jshint/node_modules/jshint": { + "version": "2.9.7", + "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.9.7.tgz", + "integrity": "sha512-Q8XN38hGsVQhdlM+4gd1Xl7OB1VieSuCJf+fEJjpo59JH99bVJhXRXAh26qQ15wfdd1VPMuDWNeSWoNl53T4YA==", + "dev": true, + "dependencies": { + "cli": "~1.0.0", + "console-browserify": "1.1.x", + "exit": "0.1.x", + "htmlparser2": "3.8.x", + "lodash": "~4.17.10", + "minimatch": "~3.0.2", + "shelljs": "0.3.x", + "strip-json-comments": "1.0.x" }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "bin": { + "jshint": "bin/jshint" } }, - "node_modules/globule/node_modules/minimatch": { + "node_modules/grunt-contrib-jshint/node_modules/minimatch": { "version": "3.0.8", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.8.tgz", "integrity": "sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==", @@ -16835,459 +13076,467 @@ "node": "*" } }, - "node_modules/got": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/got/-/got-12.3.1.tgz", - "integrity": "sha512-tS6+JMhBh4iXMSXF6KkIsRxmloPln31QHDlcb6Ec3bzxjjFJFr/8aXdpyuLmVc9I4i2HyBHYw1QU5K1ruUdpkw==", + "node_modules/grunt-contrib-jshint/node_modules/readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==", "dev": true, "dependencies": { - "@sindresorhus/is": "^5.2.0", - "@szmarczak/http-timer": "^5.0.1", - "@types/cacheable-request": "^6.0.2", - "@types/responselike": "^1.0.0", - "cacheable-lookup": "^6.0.4", - "cacheable-request": "^7.0.2", - "decompress-response": "^6.0.0", - "form-data-encoder": "^2.0.1", - "get-stream": "^6.0.1", - "http2-wrapper": "^2.1.10", - "lowercase-keys": "^3.0.0", - "p-cancelable": "^3.0.0", - "responselike": "^2.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sindresorhus/got?sponsor=1" + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" } }, - "node_modules/got/node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "node_modules/grunt-contrib-jshint/node_modules/shelljs": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.3.0.tgz", + "integrity": "sha512-Ny0KN4dyT8ZSCE0frtcbAJGoM/HTArpyPkeli1/00aYfm0sbD/Gk/4x7N2DP9QKGpBsiQH7n6rpm1L79RtviEQ==", "dev": true, - "engines": { - "node": ">=10" + "bin": { + "shjs": "bin/shjs" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": ">=0.8.0" } }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "node_modules/grunt-contrib-jshint/node_modules/string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==", "dev": true }, - "node_modules/grunt": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.5.3.tgz", - "integrity": "sha512-mKwmo4X2d8/4c/BmcOETHek675uOqw0RuA/zy12jaspWqvTp4+ZeQF1W+OTpcbncnaBsfbQJ6l0l4j+Sn/GmaQ==", + "node_modules/grunt-contrib-jshint/node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", "dev": true, "dependencies": { - "dateformat": "~3.0.3", - "eventemitter2": "~0.4.13", - "exit": "~0.1.2", - "findup-sync": "~0.3.0", - "glob": "~7.1.6", - "grunt-cli": "~1.4.3", - "grunt-known-options": "~2.0.0", - "grunt-legacy-log": "~3.0.0", - "grunt-legacy-util": "~2.0.1", - "iconv-lite": "~0.4.13", - "js-yaml": "~3.14.0", - "minimatch": "~3.0.4", - "mkdirp": "~1.0.4", - "nopt": "~3.0.6", - "rimraf": "~3.0.2" - }, - "bin": { - "grunt": "bin/grunt" + "ansi-regex": "^2.0.0" }, "engines": { - "node": ">=8" + "node": ">=0.10.0" } }, - "node_modules/grunt-babel": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/grunt-babel/-/grunt-babel-7.0.0.tgz", - "integrity": "sha512-AFilvH/iPbnIYhL4Wx36AJQCaVEvK55xh0tujAt1DIM5tuxYxRsgUPEpwijBU147B+as/ssGuY9/6JYfTiAWpw==", + "node_modules/grunt-contrib-jshint/node_modules/supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", "dev": true, "engines": { - "node": ">=4" - }, - "peerDependencies": { - "babel-core": "^6.0.0 || ^7.0.0-alpha", - "grunt": ">=0.4.0" + "node": ">=0.8.0" } }, - "node_modules/grunt-cli": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.2.0.tgz", - "integrity": "sha1-VisRnrsGndtGSs4oRVAb6Xs1tqg=", + "node_modules/grunt-contrib-nodeunit": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/grunt-contrib-nodeunit/-/grunt-contrib-nodeunit-2.1.0.tgz", + "integrity": "sha512-cg3+lf6T5tDmnOFFf4+78b8xa5tsrw9u1NSlfCHjUrjeO+S/Ly0Dpo1BUV3QgsJ4k/0bgMmhbVjNXoP4AyYHuA==", "dev": true, "dependencies": { - "findup-sync": "~0.3.0", - "grunt-known-options": "~1.1.0", - "nopt": "~3.0.6", - "resolve": "~1.1.0" - }, - "bin": { - "grunt": "bin/grunt" + "nodeunit-x": "^0.13.0" }, "engines": { "node": ">=0.10.0" } }, - "node_modules/grunt-contrib-clean": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/grunt-contrib-clean/-/grunt-contrib-clean-1.1.0.tgz", - "integrity": "sha1-Vkq/LQN4qYOhW54/MO51tzjEBjg=", + "node_modules/grunt-contrib-qunit": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/grunt-contrib-qunit/-/grunt-contrib-qunit-4.0.0.tgz", + "integrity": "sha512-XP9Ks+uoSQzic0eic6koD8kYAKQnSYfu2G1HBqvrvUyXaDDnSSXOKELND8j7dwudnJj4N6KgW6OU7AHeM5PGKA==", "dev": true, "dependencies": { - "async": "^1.5.2", - "rimraf": "^2.5.1" + "eventemitter2": "^6.4.2", + "p-each-series": "^2.1.0", + "puppeteer": "^4.0.0" }, "engines": { - "node": ">= 0.10.0" + "node": ">=10" + } + }, + "node_modules/grunt-contrib-qunit/node_modules/eventemitter2": { + "version": "6.4.9", + "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.9.tgz", + "integrity": "sha512-JEPTiaOt9f04oa6NOkc4aH+nVp5I3wEjpHbIPqfgCdD5v5bUzy7xQqwcVO2aDQgOWhI28da57HksMrzK9HlRxg==", + "dev": true + }, + "node_modules/grunt-contrib-uglify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/grunt-contrib-uglify/-/grunt-contrib-uglify-1.0.2.tgz", + "integrity": "sha512-p8bFuwILMWTRfpfrjZ5faBLOUZ3fFEUNCVoQ/d+7QV7h9Qd/FLhYhkb/Gwe3Vdaf8yvAXIykC5Oz2f/Js9FdAw==", + "dev": true, + "dependencies": { + "chalk": "^1.0.0", + "lodash": "^4.0.1", + "maxmin": "^1.1.0", + "uglify-js": "~2.6.2", + "uri-path": "^1.0.0" }, - "peerDependencies": { - "grunt": ">=0.4.5" + "engines": { + "node": ">=0.10.0" } }, - "node_modules/grunt-contrib-clean/node_modules/rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "node_modules/grunt-contrib-uglify-es": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/grunt-contrib-uglify-es/-/grunt-contrib-uglify-es-3.3.0.tgz", + "integrity": "sha512-E+9EbUQiBjFynaZp4wsdjktMo2oHEetGaBIhy9XTbhneHiXomXQWlfgY5Ib5c/FU9WiL/OfXbmo6nwgIN1hLAA==", + "deprecated": "deprecated", "dev": true, "dependencies": { - "glob": "^7.0.5" + "chalk": "^1.0.0", + "maxmin": "^1.1.0", + "uglify-es": "~3.3.0", + "uri-path": "^1.0.0" }, - "bin": { - "rimraf": "bin.js" + "engines": { + "node": ">=0.10.0" } }, - "node_modules/grunt-contrib-concat": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/grunt-contrib-concat/-/grunt-contrib-concat-1.0.1.tgz", - "integrity": "sha1-YVCYYwhOhx1+ht5IwBUlntl3Rb0=", + "node_modules/grunt-contrib-uglify-es/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/grunt-contrib-uglify-es/node_modules/ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/grunt-contrib-uglify-es/node_modules/browserify-zlib": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", + "integrity": "sha512-19OEpq7vWgsH6WkvkBJQDFvJS1uPcbFOQ4v9CU839dO+ZZXUZO6XpE6hNCqvlIIj+4fZvRiJ6DsAQ382GwiyTQ==", "dev": true, "dependencies": { - "chalk": "^1.0.0", - "source-map": "^0.5.3" - }, - "engines": { - "node": ">=0.10.0" - }, - "peerDependencies": { - "grunt": ">=0.4.0" + "pako": "~0.2.0" } }, - "node_modules/grunt-contrib-copy": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/grunt-contrib-copy/-/grunt-contrib-copy-1.0.0.tgz", - "integrity": "sha1-cGDGWB6QS4qw0A8HbgqPbj58NXM=", + "node_modules/grunt-contrib-uglify-es/node_modules/chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", "dev": true, "dependencies": { - "chalk": "^1.1.1", - "file-sync-cmp": "^0.1.0" + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" }, "engines": { "node": ">=0.10.0" } }, - "node_modules/grunt-contrib-cssmin": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/grunt-contrib-cssmin/-/grunt-contrib-cssmin-4.0.0.tgz", - "integrity": "sha512-jXU+Zlk8Q8XztOGNGpjYlD/BDQ0n95IHKrQKtFR7Gd8hZrzgqiG1Ra7cGYc8h2DD9vkSFGNlweb9Q00rBxOK2w==", + "node_modules/grunt-contrib-uglify-es/node_modules/concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", "dev": true, + "engines": [ + "node >= 0.8" + ], "dependencies": { - "chalk": "^4.1.0", - "clean-css": "^5.0.1", - "maxmin": "^3.0.0" - }, - "engines": { - "node": ">=10.0" + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" } }, - "node_modules/grunt-contrib-cssmin/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/grunt-contrib-uglify-es/node_modules/figures": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "integrity": "sha512-UxKlfCRuCBxSXU4C6t9scbDyWZ4VlaFFdojKtzJuSkuOBQ5CNFum+zZXFwHjo+CxBC1t6zlYPgHIgFjL8ggoEQ==", "dev": true, "dependencies": { - "color-convert": "^2.0.1" + "escape-string-regexp": "^1.0.5", + "object-assign": "^4.1.0" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "node": ">=0.10.0" } }, - "node_modules/grunt-contrib-cssmin/node_modules/chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "node_modules/grunt-contrib-uglify-es/node_modules/gzip-size": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-1.0.0.tgz", + "integrity": "sha512-mu66twX6zg8WB6IPfUtrquS7fjwGnDJ7kdVcggd5rpjwBItQKjHtvhu6VcQMkqPYAR7DjWpEaN3xiBSNmxvzPg==", "dev": true, "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "browserify-zlib": "^0.1.4", + "concat-stream": "^1.4.1" }, - "engines": { - "node": ">=10" + "bin": { + "gzip-size": "cli.js" }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "engines": { + "node": ">=0.10.0" } }, - "node_modules/grunt-contrib-cssmin/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/grunt-contrib-uglify-es/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true + }, + "node_modules/grunt-contrib-uglify-es/node_modules/maxmin": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/maxmin/-/maxmin-1.1.0.tgz", + "integrity": "sha512-jypoV6wTPuz/ngkc2sDZnFvpvx14QICNKS/jK9RbkmiQQJZ4JWstIszA8iT/z9tPSF/vXQ5qtG0h65N9tiLIKA==", "dev": true, "dependencies": { - "color-name": "~1.1.4" + "chalk": "^1.0.0", + "figures": "^1.0.1", + "gzip-size": "^1.0.0", + "pretty-bytes": "^1.0.0" }, "engines": { - "node": ">=7.0.0" + "node": ">=0.10.0" } }, - "node_modules/grunt-contrib-cssmin/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "node_modules/grunt-contrib-uglify-es/node_modules/pako": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", + "integrity": "sha512-NUcwaKxUxWrZLpDG+z/xZaCgQITkA/Dv4V/T6bw7VON6l1Xz/VnrBqrYjZQ12TamKHzITTfOEIYUj48y2KXImA==", "dev": true }, - "node_modules/grunt-contrib-cssmin/node_modules/figures": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "node_modules/grunt-contrib-uglify-es/node_modules/pretty-bytes": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-1.0.4.tgz", + "integrity": "sha512-LNisJvAjy+hruxp3GV4IkZZscTI34+ISfeM1hesB9V6ezIDfXYrBi9TIXVjjMcEB4QFN7tL+dFDEk4s8jMBMyA==", "dev": true, "dependencies": { - "escape-string-regexp": "^1.0.5" + "get-stdin": "^4.0.1", + "meow": "^3.1.0" }, - "engines": { - "node": ">=8" + "bin": { + "pretty-bytes": "cli.js" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": ">=0.10.0" } }, - "node_modules/grunt-contrib-cssmin/node_modules/gzip-size": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-5.1.1.tgz", - "integrity": "sha512-FNHi6mmoHvs1mxZAds4PpdCS6QG8B4C1krxJsMutgxl5t3+GlRTzzI3NEkifXx2pVsOvJdOGSmIgDhQ55FwdPA==", + "node_modules/grunt-contrib-uglify-es/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "dev": true, "dependencies": { - "duplexer": "^0.1.1", - "pify": "^4.0.1" - }, - "engines": { - "node": ">=6" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } }, - "node_modules/grunt-contrib-cssmin/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "node_modules/grunt-contrib-uglify-es/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, - "engines": { - "node": ">=8" + "dependencies": { + "safe-buffer": "~5.1.0" } }, - "node_modules/grunt-contrib-cssmin/node_modules/maxmin": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/maxmin/-/maxmin-3.0.0.tgz", - "integrity": "sha512-wcahMInmGtg/7c6a75fr21Ch/Ks1Tb+Jtoan5Ft4bAI0ZvJqyOw8kkM7e7p8hDSzY805vmxwHT50KcjGwKyJ0g==", + "node_modules/grunt-contrib-uglify-es/node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", "dev": true, "dependencies": { - "chalk": "^4.1.0", - "figures": "^3.2.0", - "gzip-size": "^5.1.1", - "pretty-bytes": "^5.3.0" + "ansi-regex": "^2.0.0" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=0.10.0" } }, - "node_modules/grunt-contrib-cssmin/node_modules/pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "node_modules/grunt-contrib-uglify-es/node_modules/supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", "dev": true, "engines": { - "node": ">=6" + "node": ">=0.8.0" } }, - "node_modules/grunt-contrib-cssmin/node_modules/pretty-bytes": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", - "integrity": "sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==", + "node_modules/grunt-contrib-uglify/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", "dev": true, "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=0.10.0" } }, - "node_modules/grunt-contrib-cssmin/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/grunt-contrib-uglify/node_modules/ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, "engines": { - "node": ">=8" + "node": ">=0.10.0" } }, - "node_modules/grunt-contrib-jshint": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/grunt-contrib-jshint/-/grunt-contrib-jshint-1.1.0.tgz", - "integrity": "sha512-N8jtQ/FmvuRdJoEGphmGt+ov1oi5bJq4hPBPT/g54ed1glF34l2z5VAdHHhcgOaezBxur3kcMPChB0pfZxxcFw==", + "node_modules/grunt-contrib-uglify/node_modules/browserify-zlib": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", + "integrity": "sha512-19OEpq7vWgsH6WkvkBJQDFvJS1uPcbFOQ4v9CU839dO+ZZXUZO6XpE6hNCqvlIIj+4fZvRiJ6DsAQ382GwiyTQ==", "dev": true, "dependencies": { - "chalk": "^1.1.1", - "hooker": "^0.2.3", - "jshint": "~2.9.4" - }, - "engines": { - "node": ">=0.10.0" - }, - "peerDependencies": { - "grunt": ">=0.4.0" + "pako": "~0.2.0" } }, - "node_modules/grunt-contrib-jshint/node_modules/jshint": { - "version": "2.9.7", - "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.9.7.tgz", - "integrity": "sha512-Q8XN38hGsVQhdlM+4gd1Xl7OB1VieSuCJf+fEJjpo59JH99bVJhXRXAh26qQ15wfdd1VPMuDWNeSWoNl53T4YA==", + "node_modules/grunt-contrib-uglify/node_modules/chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", "dev": true, "dependencies": { - "cli": "~1.0.0", - "console-browserify": "1.1.x", - "exit": "0.1.x", - "htmlparser2": "3.8.x", - "lodash": "~4.17.10", - "minimatch": "~3.0.2", - "shelljs": "0.3.x", - "strip-json-comments": "1.0.x" + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" }, - "bin": { - "jshint": "bin/jshint" + "engines": { + "node": ">=0.10.0" } }, - "node_modules/grunt-contrib-jshint/node_modules/minimatch": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.8.tgz", - "integrity": "sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==", + "node_modules/grunt-contrib-uglify/node_modules/concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", "dev": true, + "engines": [ + "node >= 0.8" + ], "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" } }, - "node_modules/grunt-contrib-nodeunit": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/grunt-contrib-nodeunit/-/grunt-contrib-nodeunit-2.1.0.tgz", - "integrity": "sha512-cg3+lf6T5tDmnOFFf4+78b8xa5tsrw9u1NSlfCHjUrjeO+S/Ly0Dpo1BUV3QgsJ4k/0bgMmhbVjNXoP4AyYHuA==", + "node_modules/grunt-contrib-uglify/node_modules/figures": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "integrity": "sha512-UxKlfCRuCBxSXU4C6t9scbDyWZ4VlaFFdojKtzJuSkuOBQ5CNFum+zZXFwHjo+CxBC1t6zlYPgHIgFjL8ggoEQ==", "dev": true, "dependencies": { - "nodeunit-x": "^0.13.0" + "escape-string-regexp": "^1.0.5", + "object-assign": "^4.1.0" }, "engines": { "node": ">=0.10.0" } }, - "node_modules/grunt-contrib-qunit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/grunt-contrib-qunit/-/grunt-contrib-qunit-4.0.0.tgz", - "integrity": "sha512-XP9Ks+uoSQzic0eic6koD8kYAKQnSYfu2G1HBqvrvUyXaDDnSSXOKELND8j7dwudnJj4N6KgW6OU7AHeM5PGKA==", + "node_modules/grunt-contrib-uglify/node_modules/gzip-size": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-1.0.0.tgz", + "integrity": "sha512-mu66twX6zg8WB6IPfUtrquS7fjwGnDJ7kdVcggd5rpjwBItQKjHtvhu6VcQMkqPYAR7DjWpEaN3xiBSNmxvzPg==", "dev": true, "dependencies": { - "eventemitter2": "^6.4.2", - "p-each-series": "^2.1.0", - "puppeteer": "^4.0.0" + "browserify-zlib": "^0.1.4", + "concat-stream": "^1.4.1" + }, + "bin": { + "gzip-size": "cli.js" }, "engines": { - "node": ">=10" + "node": ">=0.10.0" } }, - "node_modules/grunt-contrib-qunit/node_modules/eventemitter2": { - "version": "6.4.4", - "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.4.tgz", - "integrity": "sha512-HLU3NDY6wARrLCEwyGKRBvuWYyvW6mHYv72SJJAH3iJN3a6eVUvkjFkcxah1bcTgGVBBrFdIopBJPhCQFMLyXw==", + "node_modules/grunt-contrib-uglify/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", "dev": true }, - "node_modules/grunt-contrib-uglify": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/grunt-contrib-uglify/-/grunt-contrib-uglify-1.0.2.tgz", - "integrity": "sha1-rmekb5FT7dTLEYE6Vetpxw19svs=", + "node_modules/grunt-contrib-uglify/node_modules/maxmin": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/maxmin/-/maxmin-1.1.0.tgz", + "integrity": "sha512-jypoV6wTPuz/ngkc2sDZnFvpvx14QICNKS/jK9RbkmiQQJZ4JWstIszA8iT/z9tPSF/vXQ5qtG0h65N9tiLIKA==", "dev": true, "dependencies": { "chalk": "^1.0.0", - "lodash": "^4.0.1", - "maxmin": "^1.1.0", - "uglify-js": "~2.6.2", - "uri-path": "^1.0.0" + "figures": "^1.0.1", + "gzip-size": "^1.0.0", + "pretty-bytes": "^1.0.0" }, "engines": { "node": ">=0.10.0" } }, - "node_modules/grunt-contrib-uglify-es": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/grunt-contrib-uglify-es/-/grunt-contrib-uglify-es-3.3.0.tgz", - "integrity": "sha1-wV97Ef1BMgPU4MkTf10/r1Wo34A=", - "deprecated": "deprecated", + "node_modules/grunt-contrib-uglify/node_modules/pako": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", + "integrity": "sha512-NUcwaKxUxWrZLpDG+z/xZaCgQITkA/Dv4V/T6bw7VON6l1Xz/VnrBqrYjZQ12TamKHzITTfOEIYUj48y2KXImA==", + "dev": true + }, + "node_modules/grunt-contrib-uglify/node_modules/pretty-bytes": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-1.0.4.tgz", + "integrity": "sha512-LNisJvAjy+hruxp3GV4IkZZscTI34+ISfeM1hesB9V6ezIDfXYrBi9TIXVjjMcEB4QFN7tL+dFDEk4s8jMBMyA==", "dev": true, "dependencies": { - "chalk": "^1.0.0", - "maxmin": "^1.1.0", - "uglify-es": "~3.3.0", - "uri-path": "^1.0.0" + "get-stdin": "^4.0.1", + "meow": "^3.1.0" + }, + "bin": { + "pretty-bytes": "cli.js" }, "engines": { "node": ">=0.10.0" } }, - "node_modules/grunt-contrib-uglify-es/node_modules/commander": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.13.0.tgz", - "integrity": "sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==", - "dev": true + "node_modules/grunt-contrib-uglify/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } }, - "node_modules/grunt-contrib-uglify-es/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "node_modules/grunt-contrib-uglify/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, - "engines": { - "node": ">=0.10.0" + "dependencies": { + "safe-buffer": "~5.1.0" } }, - "node_modules/grunt-contrib-uglify-es/node_modules/uglify-es": { - "version": "3.3.9", - "resolved": "https://registry.npmjs.org/uglify-es/-/uglify-es-3.3.9.tgz", - "integrity": "sha512-r+MU0rfv4L/0eeW3xZrd16t4NZfK8Ld4SWVglYBb7ez5uXFWHuVRs6xCTrf1yirs9a4j4Y27nn7SRfO6v67XsQ==", - "deprecated": "support for ECMAScript is superseded by `uglify-js` as of v3.13.0", + "node_modules/grunt-contrib-uglify/node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", "dev": true, "dependencies": { - "commander": "~2.13.0", - "source-map": "~0.6.1" - }, - "bin": { - "uglifyjs": "bin/uglifyjs" + "ansi-regex": "^2.0.0" }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/grunt-contrib-uglify/node_modules/supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", + "dev": true, "engines": { "node": ">=0.8.0" } @@ -17319,7 +13568,7 @@ "node_modules/grunt-exec": { "version": "0.4.7", "resolved": "https://registry.npmjs.org/grunt-exec/-/grunt-exec-0.4.7.tgz", - "integrity": "sha1-QAUf+k6wyWV+BTuV6I1ENSocLCU=", + "integrity": "sha512-AJw+ccLkJnycdyiTXFpt1ELpRbiMDn0uj3b04W0kmmjEZCz3j1LSO2bH9GxgQniUZc2mQFMEew9Bw9tWCu+1zw==", "dev": true, "engines": { "node": ">=0.8.0" @@ -17329,9 +13578,9 @@ } }, "node_modules/grunt-known-options": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-1.1.0.tgz", - "integrity": "sha1-pCdO6zL6dl2lp6OxcSYXzjsUQUk=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-2.0.0.tgz", + "integrity": "sha512-GD7cTz0I4SAede1/+pAbmJRG44zFLPipVtdL9o3vqx9IEyb7b4/Y3s7r6ofI3CchR5GvYJ+8buCSioDv5dQLiA==", "dev": true, "engines": { "node": ">=0.10.0" @@ -17459,21 +13708,6 @@ "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==", "dev": true }, - "node_modules/grunt-legacy-util/node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/grunt-processhtml": { "version": "0.4.3", "resolved": "https://registry.npmjs.org/grunt-processhtml/-/grunt-processhtml-0.4.3.tgz", @@ -17497,13 +13731,13 @@ "node_modules/grunt-script-link-tags": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/grunt-script-link-tags/-/grunt-script-link-tags-1.0.2.tgz", - "integrity": "sha1-3QQbpneJRSp3RHnJ4sPvf+i+PiM=", + "integrity": "sha512-w0rBSheBIIExtoriQGOsD5Afv5qpQeFXMqFaXaHRthlpOCjv58vLuMC76fAMC1l551h3rMg18M0s6mNpL5uekw==", "dev": true }, "node_modules/grunt-war": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/grunt-war/-/grunt-war-0.5.1.tgz", - "integrity": "sha1-zpmwQUgtHbENeb6bJo5pkBUw9/U=", + "integrity": "sha512-RmrDhGlyKsZCtU2QF9r1IpBkZAdCGLYICrXduaHh8D4mgU6ILzTWPGW5SvFjmO+HLStEg7AN8PW3B9if/qETsg==", "dev": true, "dependencies": { "archiver": ">= 0.12.0" @@ -17532,47 +13766,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/grunt/node_modules/grunt-cli": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.4.3.tgz", - "integrity": "sha512-9Dtx/AhVeB4LYzsViCjUQkd0Kw0McN2gYpdmGYKtE2a5Yt7v1Q+HYZVWhqXc/kGnxlMtqKDxSwotiGeFmkrCoQ==", - "dev": true, - "dependencies": { - "grunt-known-options": "~2.0.0", - "interpret": "~1.1.0", - "liftup": "~3.0.1", - "nopt": "~4.0.1", - "v8flags": "~3.2.0" - }, - "bin": { - "grunt": "bin/grunt" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/grunt/node_modules/grunt-cli/node_modules/nopt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", - "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", - "dev": true, - "dependencies": { - "abbrev": "1", - "osenv": "^0.1.4" - }, - "bin": { - "nopt": "bin/nopt.js" - } - }, - "node_modules/grunt/node_modules/grunt-known-options": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-2.0.0.tgz", - "integrity": "sha512-GD7cTz0I4SAede1/+pAbmJRG44zFLPipVtdL9o3vqx9IEyb7b4/Y3s7r6ofI3CchR5GvYJ+8buCSioDv5dQLiA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/grunt/node_modules/minimatch": { "version": "3.0.8", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.8.tgz", @@ -17585,32 +13778,17 @@ "node": "*" } }, - "node_modules/grunt/node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "dev": true, - "bin": { - "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/gzip-size": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-1.0.0.tgz", - "integrity": "sha1-Zs+LEBBHInuVus5uodoMF37Vwi8=", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-5.1.1.tgz", + "integrity": "sha512-FNHi6mmoHvs1mxZAds4PpdCS6QG8B4C1krxJsMutgxl5t3+GlRTzzI3NEkifXx2pVsOvJdOGSmIgDhQ55FwdPA==", "dev": true, "dependencies": { - "browserify-zlib": "^0.1.4", - "concat-stream": "^1.4.1" - }, - "bin": { - "gzip-size": "cli.js" + "duplexer": "^0.1.1", + "pify": "^4.0.1" }, "engines": { - "node": ">=0.10.0" + "node": ">=6" } }, "node_modules/handle-thing": { @@ -17622,7 +13800,7 @@ "node_modules/har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==", "dev": true, "engines": { "node": ">=4" @@ -17642,6 +13820,28 @@ "node": ">=6" } }, + "node_modules/har-validator/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/har-validator/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -17656,7 +13856,7 @@ "node_modules/has-ansi": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==", "dev": true, "dependencies": { "ansi-regex": "^2.0.0" @@ -17665,6 +13865,15 @@ "node": ">=0.10.0" } }, + "node_modules/has-ansi/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/has-bigints": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", @@ -17677,7 +13886,7 @@ "node_modules/has-color": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz", - "integrity": "sha1-ZxRKUmDDT8PMpnfQQdr1L+e3iy8=", + "integrity": "sha512-kaNz5OTAYYmt646Hkqw50/qyxP2vFnTVu5AQ1Zmk22Kk5+4Qx6BpO8+u7IKsML5fOsFk0ZT0AcCJNYwcvaLBvw==", "engines": { "node": ">=0.10.0" } @@ -17685,8 +13894,7 @@ "node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true, + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "engines": { "node": ">=4" } @@ -17695,7 +13903,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", - "dev": true, "dependencies": { "get-intrinsic": "^1.1.1" }, @@ -17703,25 +13910,10 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-property-descriptors/node_modules/get-intrinsic": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", - "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-property-descriptors/node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", "engines": { "node": ">= 0.4" }, @@ -17730,9 +13922,9 @@ } }, "node_modules/has-symbols": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", - "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", "engines": { "node": ">= 0.4" }, @@ -17744,7 +13936,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", - "dev": true, "dependencies": { "has-symbols": "^1.0.2" }, @@ -17755,18 +13946,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-tostringtag/node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/has-unicode": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", @@ -17786,17 +13965,37 @@ } }, "node_modules/hash-base": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", - "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", "dependencies": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" }, "engines": { "node": ">=4" } }, + "node_modules/hash-base/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/hash.js": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", @@ -17809,7 +14008,7 @@ "node_modules/hasha": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/hasha/-/hasha-3.0.0.tgz", - "integrity": "sha1-UqMvq4Vp1BymmmH/GiFPjrfIvTk=", + "integrity": "sha512-w0Kz8lJFBoyaurBiNrIvxPqr/gJ6fOfSkpAPOepN3oECqGJag37xPbOv57izi/KP8auHgNYxn5fXtAb+1LsJ6w==", "dev": true, "dependencies": { "is-stream": "^1.0.1" @@ -17818,6 +14017,15 @@ "node": ">=4" } }, + "node_modules/hasha/node_modules/is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/hdr-histogram-js": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/hdr-histogram-js/-/hdr-histogram-js-2.0.3.tgz", @@ -17829,12 +14037,6 @@ "pako": "^1.0.3" } }, - "node_modules/hdr-histogram-js/node_modules/pako": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", - "dev": true - }, "node_modules/hdr-histogram-percentiles-obj": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/hdr-histogram-percentiles-obj/-/hdr-histogram-percentiles-obj-3.0.0.tgz", @@ -17853,7 +14055,7 @@ "node_modules/hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", "dependencies": { "hash.js": "^1.0.3", "minimalistic-assert": "^1.0.0", @@ -17863,7 +14065,7 @@ "node_modules/home-or-tmp": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", - "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", + "integrity": "sha512-ycURW7oUxE2sNiPVw1HVEFsW+ecOpJ5zaj7eC0RlwhibhRBod20muUN8qu/gzx956YrLolVvs1MTXwKgC2rVEg==", "dev": true, "dependencies": { "os-homedir": "^1.0.0", @@ -17888,17 +14090,32 @@ "node_modules/hooker": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/hooker/-/hooker-0.2.3.tgz", - "integrity": "sha1-uDT3I8xKJCqmWWNFnfbZhMXT2Vk=", + "integrity": "sha512-t+UerCsQviSymAInD01Pw+Dn/usmz1sRO+3Zk1+lx8eg+WKpD2ulcwWqHHL0+aseRBr+3+vIhiG1K1JTwaIcTA==", "dev": true, "engines": { "node": "*" } }, "node_modules/hosted-git-info": { - "version": "2.8.9", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", - "dev": true + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-6.1.1.tgz", + "integrity": "sha512-r0EI+HBMcXadMrugk0GCQ+6BQV39PiWAZVfq7oIckeGiN7sjRGyQxPdft3nQekFTCQbYxLBH+/axZMeH8UX6+w==", + "dev": true, + "dependencies": { + "lru-cache": "^7.5.1" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/hosted-git-info/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "dev": true, + "engines": { + "node": ">=12" + } }, "node_modules/hpack.js": { "version": "2.1.6", @@ -17912,6 +14129,36 @@ "wbuf": "^1.1.0" } }, + "node_modules/hpack.js/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true + }, + "node_modules/hpack.js/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/hpack.js/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, "node_modules/html-encoding-sniffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", @@ -17968,75 +14215,33 @@ "jspdf": "^2.3.1" } }, - "node_modules/html2pdf.js/node_modules/core-js": { - "version": "3.23.4", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.23.4.tgz", - "integrity": "sha512-vjsKqRc1RyAJC3Ye2kYqgfdThb3zYnx9CrqoCcjMOENMtQPC7ZViBvlDxwYU/2z2NI/IPuiXw5mT4hWhddqjzQ==", - "hasInstallScript": true, - "optional": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/core-js" - } - }, - "node_modules/html2pdf.js/node_modules/jspdf": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/jspdf/-/jspdf-2.5.1.tgz", - "integrity": "sha512-hXObxz7ZqoyhxET78+XR34Xu2qFGrJJ2I2bE5w4SM8eFaFEkW2xcGRVUss360fYelwRSid/jT078kbNvmoW0QA==", - "dependencies": { - "@babel/runtime": "^7.14.0", - "atob": "^2.1.2", - "btoa": "^1.2.1", - "fflate": "^0.4.8" - }, - "optionalDependencies": { - "canvg": "^3.0.6", - "core-js": "^3.6.0", - "dompurify": "^2.2.0", - "html2canvas": "^1.0.0-rc.5" - } - }, "node_modules/htmlescape": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", - "integrity": "sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E=", + "integrity": "sha512-eVcrzgbR4tim7c7soKQKtxa/kQM4TzjnlU83rcZ9bHU6t31ehfV7SktN6McWgwPWg+JYMA/O3qpGxBvFq1z2Jg==", "engines": { "node": ">=0.10" } }, "node_modules/htmlparser2": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", - "integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=", - "dependencies": { - "domelementtype": "1", - "domhandler": "2.3", - "domutils": "1.5", - "entities": "1.0", - "readable-stream": "1.1" - } - }, - "node_modules/htmlparser2/node_modules/isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" - }, - "node_modules/htmlparser2/node_modules/readable-stream": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.2.tgz", + "integrity": "sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==", + "dev": true, + "funding": [ + "https://github.com/fb55/htmlparser2?sponsor=1", + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1", + "entities": "^4.4.0" } }, - "node_modules/htmlparser2/node_modules/string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" - }, "node_modules/htmlprocessor": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/htmlprocessor/-/htmlprocessor-0.3.2.tgz", @@ -18077,16 +14282,10 @@ "node": ">= 0.8" } }, - "node_modules/http-errors/node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, "node_modules/http-parser-js": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.2.tgz", - "integrity": "sha512-opCO9ASqg5Wy2FNo7A0sxy71yGbbkJJXLdgMK04Tcypw9jr2MgWbyubb0+WdmDmGnFflO7fRbqbaihh/ENDlRQ==", + "version": "0.5.8", + "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.8.tgz", + "integrity": "sha512-SGeBX54F94Wgu5RH3X5jsDtf4eHyRogWX1XGT3b4HuW3tQPM4AaBzoUji/4AAJNXCEOWZ5O0DgZmJw1947gD5Q==", "dev": true }, "node_modules/http-proxy": { @@ -18104,12 +14303,12 @@ } }, "node_modules/http-proxy-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", - "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", "dev": true, "dependencies": { - "@tootallnate/once": "1", + "@tootallnate/once": "2", "agent-base": "6", "debug": "4" }, @@ -18117,41 +14316,6 @@ "node": ">= 6" } }, - "node_modules/http-proxy-agent/node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "dev": true, - "dependencies": { - "debug": "4" - }, - "engines": { - "node": ">= 6.0.0" - } - }, - "node_modules/http-proxy-agent/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/http-proxy-agent/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "node_modules/http-proxy-middleware": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz", @@ -18177,9 +14341,9 @@ } }, "node_modules/http-server": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/http-server/-/http-server-14.1.0.tgz", - "integrity": "sha512-5lYsIcZtf6pdR8tCtzAHTWrAveo4liUlJdWc7YafwK/maPgYHs+VNP6KpCClmUnSorJrARVMXqtT055zBv11Yg==", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/http-server/-/http-server-14.1.1.tgz", + "integrity": "sha512-+cbxadF40UXd9T01zUHgA+rlo2Bg1Srer4+B4NwIHdaGxAGGv59nYRnGGDJ9LBk7alpS0US+J+bLLdQOOkJq4A==", "dev": true, "dependencies": { "basic-auth": "^2.0.1", @@ -18189,7 +14353,7 @@ "html-encoding-sniffer": "^3.0.0", "http-proxy": "^1.18.1", "mime": "^1.6.0", - "minimist": "^1.2.5", + "minimist": "^1.2.6", "opener": "^1.5.1", "portfinder": "^1.0.28", "secure-compare": "3.0.1", @@ -18276,7 +14440,7 @@ "node_modules/http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", "dev": true, "dependencies": { "assert-plus": "^1.0.0", @@ -18289,9 +14453,9 @@ } }, "node_modules/http2-wrapper": { - "version": "2.1.11", - "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.1.11.tgz", - "integrity": "sha512-aNAk5JzLturWEUiuhAN73Jcbq96R7rTitAoXV54FYMatvihnpD2+6PUgU4ce3D/m5VDbw+F5CsyKSF176ptitQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.0.tgz", + "integrity": "sha512-kZB0wxMo0sh1PehyjJUWRFEd99KC5TLjZ2cULC4f9iqJBAmKQQXEICjxl5iPJRwP40dpeHFqqhm7tYCvODpqpQ==", "dev": true, "dependencies": { "quick-lru": "^5.1.1", @@ -18304,51 +14468,28 @@ "node_modules/https-browserify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", - "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=" + "integrity": "sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg==" }, "node_modules/https-proxy-agent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-4.0.0.tgz", - "integrity": "sha512-zoDhWrkR3of1l9QAL8/scJZyLu8j/gBkcwcaQOZh7Gyh/+uJQzGVETdgT30akuwkpL8HTRfssqI3BZuV18teDg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", "dev": true, "dependencies": { - "agent-base": "5", + "agent-base": "6", "debug": "4" }, "engines": { - "node": ">= 6.0.0" - } - }, - "node_modules/https-proxy-agent/node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "node": ">= 6" } }, - "node_modules/https-proxy-agent/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "node_modules/human-signals": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-4.3.1.tgz", + "integrity": "sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==", "dev": true, "engines": { - "node": ">=10.17.0" + "node": ">=14.18.0" } }, "node_modules/humanize-ms": { @@ -18361,11 +14502,12 @@ } }, "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" + "safer-buffer": ">= 2.1.2 < 3.0.0" }, "engines": { "node": ">=0.10.0" @@ -18433,9 +14575,9 @@ } }, "node_modules/ignore-walk/node_modules/minimatch": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.2.tgz", - "integrity": "sha512-PZOT9g5v2ojiTL7r1xF6plNHLtOeTpSlDI007As2NlA2aYBMfVom17yqa6QzhmDP8QOhn7LjHTg7DFCVSSa6yg==", + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" @@ -18457,362 +14599,310 @@ "image-size": "bin/image-size.js" }, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/immediate": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", - "integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps=" - }, - "node_modules/immutable": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.0.tgz", - "integrity": "sha512-0AOCmOip+xgJwEVTQj1EfiDDOkPmuyllDuTuEX+DDXUgapLAsBIfkg3sxCYyCEA8mQqZrrxPUGjcOQ2JS3WLkg==", - "dev": true - }, - "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/import-lazy": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", - "integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/import-local": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.2.tgz", - "integrity": "sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA==", - "dev": true, - "dependencies": { - "pkg-dir": "^4.2.0", - "resolve-cwd": "^3.0.0" - }, - "bin": { - "import-local-fixture": "fixtures/cli.js" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/import-local/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" + "node": ">=0.10.0" } }, - "node_modules/import-local/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "node_modules/immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==" + }, + "node_modules/immutable": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.1.tgz", + "integrity": "sha512-lj9cnmB/kVS0QHsJnYKD1uo3o39nrbKxszjnqS9Fr6NB7bZzW45U6WSGBPKXDL/CvDKqDNPA4r3DoDQ8GTxo2A==", + "dev": true + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, "dependencies": { - "p-locate": "^4.1.0" + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" }, "engines": { - "node": ">=8" + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/import-local/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "node_modules/import-fresh/node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true, - "dependencies": { - "p-limit": "^2.2.0" - }, "engines": { - "node": ">=8" + "node": ">=4" } }, - "node_modules/import-local/node_modules/path-exists": { + "node_modules/import-lazy": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", + "integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==", "dev": true, "engines": { "node": ">=8" } }, - "node_modules/import-local/node_modules/pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "node_modules/import-local": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", + "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", "dev": true, "dependencies": { - "find-up": "^4.0.0" + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true, "engines": { "node": ">=0.8.19" } }, "node_modules/indent-string": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", - "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "dev": true, - "dependencies": { - "repeating": "^2.0.0" - }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "dependencies": { "once": "^1.3.0", "wrappy": "1" } }, "node_modules/inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.1.tgz", + "integrity": "sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==", + "dev": true, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } }, "node_modules/inline-source-map": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz", - "integrity": "sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU=", + "integrity": "sha512-0mVWSSbNDvedDWIN4wxLsdPM4a7cIPcpyMxj3QZ406QRwQ6ePGB1YIHxVPjqpcUGbWQ5C+nHTwGNWAGvt7ggVA==", "dependencies": { "source-map": "~0.5.3" } }, + "node_modules/inline-source-map/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/inputmask": { "version": "3.3.11", "resolved": "https://registry.npmjs.org/inputmask/-/inputmask-3.3.11.tgz", - "integrity": "sha1-FCHJSuKMPc0bTSYze1CLs0mY4tg=" + "integrity": "sha512-qyqC+MmJjOZrqojwY5T6KvWbdlPW3BO+1W7+2Y5bdSmwv//gkF8A5nXjPpZHD+rk1KRRBvsZ5oNGpJAKfVnqjw==" }, "node_modules/inquirer": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-9.1.0.tgz", - "integrity": "sha512-eukdjrBljg9t55ZnvJjvGi1OyYEzVBFsO/8o5d2MV3mc28u3x4X2kS4eJ/+9U10KiREfPkEBSeCrU/S2G/uRtw==", + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.4.tgz", + "integrity": "sha512-nn4F01dxU8VeKfq192IjLsxu0/OmMZ4Lg3xKAns148rCaXP6ntAoEkVYZThWjwON8AlzdZZi6oqnhNbxUG9hVg==", "dev": true, "dependencies": { - "ansi-escapes": "^5.0.0", - "chalk": "^5.0.1", - "cli-cursor": "^4.0.0", - "cli-width": "^4.0.0", + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.1", + "cli-cursor": "^3.1.0", + "cli-width": "^3.0.0", "external-editor": "^3.0.3", - "figures": "^4.0.1", + "figures": "^3.0.0", "lodash": "^4.17.21", "mute-stream": "0.0.8", - "ora": "^6.1.2", + "ora": "^5.4.1", "run-async": "^2.4.0", - "rxjs": "^7.5.6", - "string-width": "^5.1.2", - "strip-ansi": "^7.0.1", + "rxjs": "^7.5.5", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", "through": "^2.3.6", - "wrap-ansi": "^8.0.1" + "wrap-ansi": "^7.0.0" }, "engines": { "node": ">=12.0.0" } }, - "node_modules/inquirer/node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, "node_modules/inquirer/node_modules/ansi-styles": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.1.1.tgz", - "integrity": "sha512-qDOv24WjnYuL+wbwHdlsYZFy+cgPtrYw0Tn7GLORicQp9BkQLzrgI3Pm4VyR9ERZ41YTn7KlMPuL1n05WdZvmg==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, "engines": { - "node": ">=12" + "node": ">=8" }, "funding": { "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/inquirer/node_modules/chalk": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.1.tgz", - "integrity": "sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" + "node": ">=10" }, "funding": { "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/inquirer/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true - }, - "node_modules/inquirer/node_modules/escape-string-regexp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", - "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "node_modules/inquirer/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, - "engines": { - "node": ">=12" + "dependencies": { + "color-name": "~1.1.4" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": ">=7.0.0" } }, - "node_modules/inquirer/node_modules/figures": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/figures/-/figures-4.0.1.tgz", - "integrity": "sha512-rElJwkA/xS04Vfg+CaZodpso7VqBknOYbzi6I76hI4X80RUjkSxO2oAyPmGbuXUppywjqndOrQDl817hDnI++w==", + "node_modules/inquirer/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/inquirer/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "dependencies": { - "escape-string-regexp": "^5.0.0", - "is-unicode-supported": "^1.2.0" - }, "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, - "node_modules/inquirer/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "node_modules/inquirer/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, - "node_modules/inquirer/node_modules/strip-ansi": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", - "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", - "dev": true, + "node_modules/insert-module-globals": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.2.1.tgz", + "integrity": "sha512-ufS5Qq9RZN+Bu899eA9QCAYThY+gGW7oRkmb0vC93Vlyu/CFGcH0OYPEjVkDXA5FEbTt1+VWzdoOD3Ny9N+8tg==", "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" + "acorn-node": "^1.5.2", + "combine-source-map": "^0.8.0", + "concat-stream": "^1.6.1", + "is-buffer": "^1.1.0", + "JSONStream": "^1.0.3", + "path-is-absolute": "^1.0.1", + "process": "~0.11.0", + "through2": "^2.0.0", + "undeclared-identifiers": "^1.1.2", + "xtend": "^4.0.0" }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" + "bin": { + "insert-module-globals": "bin/cmd.js" } }, - "node_modules/inquirer/node_modules/wrap-ansi": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.0.1.tgz", - "integrity": "sha512-QFF+ufAqhoYHvoHdajT/Po7KoXVBPXS2bgjIam5isfWJPfIOnQZ50JtUiVvCv/sjgacf3yRrt2ZKUZ/V4itN4g==", - "dev": true, + "node_modules/insert-module-globals/node_modules/concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "engines": [ + "node >= 0.8" + ], "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" } }, - "node_modules/internal-slot": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", - "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", - "dev": true, + "node_modules/insert-module-globals/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, + "node_modules/insert-module-globals/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "dependencies": { - "get-intrinsic": "^1.1.0", - "has": "^1.0.3", - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">= 0.4" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/insert-module-globals/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dependencies": { + "safe-buffer": "~5.1.0" } }, - "node_modules/internal-slot/node_modules/get-intrinsic": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", - "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", + "node_modules/internal-slot": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", + "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", "dev": true, "dependencies": { - "function-bind": "^1.1.1", + "get-intrinsic": "^1.2.0", "has": "^1.0.3", - "has-symbols": "^1.0.3" + "side-channel": "^1.0.4" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/internal-slot/node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, "engines": { "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" } }, "node_modules/interpret": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz", - "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=", + "integrity": "sha512-CLM8SNMDu7C5psFCn6Wg/tgpj/bKAg7hc2gWqcuR9OD5Ft9PhBpIu8PLicPeis+xDd6YX2ncI8MCA64I9tftIA==", "dev": true }, "node_modules/invariant": { @@ -18825,17 +14915,17 @@ } }, "node_modules/ion-rangeslider": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/ion-rangeslider/-/ion-rangeslider-2.3.0.tgz", - "integrity": "sha512-7TtH9/X4Aq/xCzboWxjwlv20gVqR90Ysc3aehMlTuH2/ULaSxpB80hq+yvD1N0FwWbPDtxQpjQrz/iX+LWXKmg==", - "dependencies": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/ion-rangeslider/-/ion-rangeslider-2.3.1.tgz", + "integrity": "sha512-6V+24FD13/feliI485gnRHZYD9Ev64M5NAFTxnVib516ATHa9PlXQrC+nOiPngouRYTCLPJyokAJEi3e1Umi5g==", + "peerDependencies": { "jquery": ">=1.8" } }, "node_modules/ionicons": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/ionicons/-/ionicons-3.0.0.tgz", - "integrity": "sha1-QLja9P16MRUL0AIWD2ZJbiKpjDw=", + "integrity": "sha512-aAxjhc681QPsjVPwar2CtbcOiw6SMI2zT21eoBIWrmCi8ZXc+thL3vdQU9eVfG9XPeHXri/XVjv/ydKkORb6+Q==", "engines": { "node": ">=0.10.3" } @@ -18869,11 +14959,12 @@ } }, "node_modules/is-arguments": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.0.tgz", - "integrity": "sha512-1Ij4lOMPl/xB5kBDn7I+b2ttPMKa8szhEIrXDuXQD/oe3HJLTLhqhgGspwgyGd6MOywBUqVvYicF72lkgDnIHg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", + "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", "dependencies": { - "call-bind": "^1.0.0" + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -18882,10 +14973,24 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-array-buffer": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", + "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.0", + "is-typed-array": "^1.1.10" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", "dev": true }, "node_modules/is-bigint": { @@ -18904,7 +15009,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, "dependencies": { "binary-extensions": "^2.0.0" }, @@ -18928,66 +15032,15 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-boolean-object/node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-boolean-object/node_modules/get-intrinsic": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", - "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-boolean-object/node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" }, - "node_modules/is-builtin-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", - "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", - "dev": true, - "dependencies": { - "builtin-modules": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-callable": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", - "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "engines": { "node": ">= 0.4" }, @@ -19019,9 +15072,12 @@ } }, "node_modules/is-date-object": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", - "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, "engines": { "node": ">= 0.4" }, @@ -19047,37 +15103,38 @@ "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true, + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "engines": { "node": ">=0.10.0" } }, "node_modules/is-finite": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", - "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", + "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==", "dev": true, - "dependencies": { - "number-is-nan": "^1.0.0" - }, "engines": { "node": ">=0.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true, + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/is-generator-function": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.8.tgz", - "integrity": "sha512-2Omr/twNtufVZFr1GhxjOMFPAj2sjc/dKaIqBhvo4qciXfJmITGH6ZGd8eZYNHza8t1y0e01AuqRhJwfWp26WQ==", + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", + "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, "engines": { "node": ">= 0.4" }, @@ -19089,7 +15146,6 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, "dependencies": { "is-extglob": "^2.1.1" }, @@ -19097,6 +15153,39 @@ "node": ">=0.10.0" } }, + "node_modules/is-inside-container": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", + "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", + "dev": true, + "dependencies": { + "is-docker": "^3.0.0" + }, + "bin": { + "is-inside-container": "cli.js" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-inside-container/node_modules/is-docker": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", + "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", + "dev": true, + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-installed-globally": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", @@ -19114,15 +15203,12 @@ } }, "node_modules/is-interactive": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz", - "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", "dev": true, "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, "node_modules/is-lambda": { @@ -19141,9 +15227,10 @@ } }, "node_modules/is-negative-zero": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", - "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", + "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", + "dev": true, "engines": { "node": ">= 0.4" }, @@ -19167,7 +15254,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, "engines": { "node": ">=0.12.0" } @@ -19230,11 +15316,12 @@ } }, "node_modules/is-regex": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", - "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", "dependencies": { - "has-symbols": "^1.0.1" + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -19276,45 +15363,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-shared-array-buffer/node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-shared-array-buffer/node_modules/get-intrinsic": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", - "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-shared-array-buffer/node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-ssh": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/is-ssh/-/is-ssh-1.4.0.tgz", @@ -19325,12 +15373,15 @@ } }, "node_modules/is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-string": { @@ -19349,11 +15400,12 @@ } }, "node_modules/is-symbol": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", - "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, "dependencies": { - "has-symbols": "^1.0.1" + "has-symbols": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -19363,15 +15415,15 @@ } }, "node_modules/is-typed-array": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.4.tgz", - "integrity": "sha512-ILaRgn4zaSrVNXNGtON6iFNotXW3hAPF3+0fB1usg2jFlWqo5fEDdmJkz0zBfoi7Dgskr8Khi2xZ8cXqZEfXNA==", + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.10.tgz", + "integrity": "sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==", "dependencies": { - "available-typed-arrays": "^1.0.2", - "call-bind": "^1.0.0", - "es-abstract": "^1.18.0-next.1", - "foreach": "^2.0.5", - "has-symbols": "^1.0.1" + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -19383,7 +15435,7 @@ "node_modules/is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", "dev": true }, "node_modules/is-unc-path": { @@ -19399,12 +15451,12 @@ } }, "node_modules/is-unicode-supported": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", - "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "dev": true, "engines": { - "node": ">=12" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -19413,7 +15465,7 @@ "node_modules/is-utf8": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "integrity": "sha512-rMYPYvCzsXywIsldgLaSoPlw5PfoB/ssr7hY4pLfcodrA5M/eArza1a9VmTiNIBNMjOGr1Ow9mTyU2o69U6U9Q==", "dev": true }, "node_modules/is-weakref": { @@ -19428,45 +15480,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-weakref/node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-weakref/node_modules/get-intrinsic": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", - "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-weakref/node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-what": { "version": "3.14.1", "resolved": "https://registry.npmjs.org/is-what/-/is-what-3.14.1.tgz", @@ -19495,29 +15508,30 @@ } }, "node_modules/is-yarn-global": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.4.0.tgz", - "integrity": "sha512-HneQBCrXGBy15QnaDfcn6OLoU8AQPAa0Qn0IeJR/QCo4E8dNZaGGwxpCwWyEBQC5QvFonP8d6t60iGpAHVAfNA==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.4.1.tgz", + "integrity": "sha512-/kppl+R+LO5VmhYSEWARUFjodS25D68gvj8W7z0I7OWhUla5xWu8KL6CtB2V0R6yqhnRgbcaREMr4EEM6htLPQ==", "dev": true, "engines": { "node": ">=12" } }, "node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, "node_modules/isobject": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", "dev": true, "engines": { "node": ">=0.10.0" @@ -19526,16 +15540,32 @@ "node_modules/isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", "dev": true }, + "node_modules/issue-parser": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/issue-parser/-/issue-parser-6.0.0.tgz", + "integrity": "sha512-zKa/Dxq2lGsBIXQ7CUZWTHfvxPC2ej0KfO7fIPqLlHB9J2hJ7rGhZ5rilhuufylr4RXYPzJUeFjKxz305OsNlA==", + "dev": true, + "dependencies": { + "lodash.capitalize": "^4.2.1", + "lodash.escaperegexp": "^4.1.2", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.uniqby": "^4.7.0" + }, + "engines": { + "node": ">=10.13" + } + }, "node_modules/istanbul-lib-coverage": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", - "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", + "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", "dev": true, "engines": { - "node": ">=6" + "node": ">=8" } }, "node_modules/istanbul-lib-hook": { @@ -19551,27 +15581,25 @@ } }, "node_modules/istanbul-lib-instrument": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz", - "integrity": "sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", + "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", "dev": true, "dependencies": { - "@babel/generator": "^7.4.0", - "@babel/parser": "^7.4.3", - "@babel/template": "^7.4.0", - "@babel/traverse": "^7.4.3", - "@babel/types": "^7.4.0", - "istanbul-lib-coverage": "^2.0.5", - "semver": "^6.0.0" + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" }, "engines": { - "node": ">=6" + "node": ">=8" } }, "node_modules/istanbul-lib-instrument/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -19591,6 +15619,15 @@ "node": ">=6" } }, + "node_modules/istanbul-lib-report/node_modules/istanbul-lib-coverage": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", + "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/istanbul-lib-report/node_modules/supports-color": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", @@ -19619,39 +15656,13 @@ "node": ">=6" } }, - "node_modules/istanbul-lib-source-maps/node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "node_modules/istanbul-lib-source-maps/node_modules/istanbul-lib-coverage": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", + "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==", "dev": true, - "dependencies": { - "ms": "2.1.2" - }, "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/istanbul-lib-source-maps/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/istanbul-lib-source-maps/node_modules/rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" + "node": ">=6" } }, "node_modules/istanbul-lib-source-maps/node_modules/source-map": { @@ -19718,7 +15729,7 @@ "node_modules/jdataview": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/jdataview/-/jdataview-2.5.0.tgz", - "integrity": "sha1-MIGz/qZR+TF+xr1P6y3cmKpB1ZU=" + "integrity": "sha512-ZJop3D5nyDcWPBPv4NPnhCvx3HgQNsCXMfw8gpNKY16BobgxmVF+kJ08aHuqk6bJQVeL2mkf6nDCcZPMompalw==" }, "node_modules/jest-worker": { "version": "27.5.1", @@ -19759,28 +15770,28 @@ } }, "node_modules/jiti": { - "version": "1.18.2", - "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.18.2.tgz", - "integrity": "sha512-QAdOptna2NYiSSpv0O/BwoHBSmz4YhpzJHyi+fnMRTXFjp7B8i/YG5Z8IfusxB1ufjcD2Sre1F3R+nX3fvy7gg==", + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.19.1.tgz", + "integrity": "sha512-oVhqoRDaBXf7sjkll95LHVS6Myyyb1zaunVwk4Z0+WPSW4gjS0pl01zYKHScTuyEhQsFxV5L4DR5r+YqSyqyyg==", "dev": true, "bin": { "jiti": "bin/jiti.js" } }, "node_modules/jquery": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz", - "integrity": "sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg==" + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.0.tgz", + "integrity": "sha512-umpJ0/k8X0MvD1ds0P9SfowREz2LenHsQaxSohMZ5OMNEU2r0tf8pdeEFTHMFxWVxKNyU9rTtK3CWzUCTKJUeQ==" }, "node_modules/jquery-knob": { "version": "1.2.11", "resolved": "https://registry.npmjs.org/jquery-knob/-/jquery-knob-1.2.11.tgz", - "integrity": "sha1-83w528HHpqbBLNsu1Pa/+2g/ENY=" + "integrity": "sha512-gyeWDmtr2x8XJLSNS2JGNYDUNmfmMrwmFcGPDJ074jnPPvMYf3PJFud4/6AubCT8ahOY7UL4YvALtSwCrxtBBQ==" }, "node_modules/jquery-slimscroll": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/jquery-slimscroll/-/jquery-slimscroll-1.3.8.tgz", - "integrity": "sha1-hIHETnpHaHZTkIoo9/cK7WTITjY=", + "integrity": "sha512-3cNGNCq6i3b+rZQOx1tSBlSFewk4X35eUuQmoRVSA4MSytw3rGPvCw6cEB2oEHf+u15RVzgfh4hN+/3dDNzwiQ==", "dependencies": { "jquery": ">= 1.7" } @@ -19788,7 +15799,7 @@ "node_modules/jquery-sparkline": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/jquery-sparkline/-/jquery-sparkline-2.4.0.tgz", - "integrity": "sha1-G+i3twTdOFcVJwiu+x1KSzpp+zM=" + "integrity": "sha512-SzjpMkOwlnqZpH4Ni2UbdRU5GxDl/BljgN8Smlun7CXUDqRhjPf2eolJ37KKcaG0/ufsMKY+XDERfPTV1hIcjg==" }, "node_modules/jquery-ui": { "version": "1.13.2", @@ -19799,14 +15810,17 @@ } }, "node_modules/jquery-ui-dist": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/jquery-ui-dist/-/jquery-ui-dist-1.12.1.tgz", - "integrity": "sha1-XAgV08xvkP9fqvWyaKbiO0ypBPo=" + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/jquery-ui-dist/-/jquery-ui-dist-1.13.2.tgz", + "integrity": "sha512-oVDRd1NLtTbBwpRKAYdIRgpWVDzeBhfy7Gu0RmY6JEaZtmBq6kDn1pm5SgDiAotrnDS+RoTRXO6xvcNTxA9tOA==", + "dependencies": { + "jquery": ">=1.8.0 <4.0.0" + } }, "node_modules/jquery.easing": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jquery.easing/-/jquery.easing-1.4.1.tgz", - "integrity": "sha1-R5gsWDa9dY/UhJSSPEoQHvbpPjs=" + "integrity": "sha512-BVpRacWCbNfo/ALWxnLkIY/WRa4Ydg/LtwzIJZvDm7vrhV8Txv+ACi6EGnU11zT19sTc3KEPathWx6CtjWLD1w==" }, "node_modules/js-sha256": { "version": "0.9.0", @@ -19814,10 +15828,9 @@ "integrity": "sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==" }, "node_modules/js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", - "dev": true + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "node_modules/js-xlsx": { "version": "0.8.22", @@ -19839,100 +15852,6 @@ "node": ">=0.8" } }, - "node_modules/js-xlsx/node_modules/adler-32": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/adler-32/-/adler-32-1.3.1.tgz", - "integrity": "sha512-ynZ4w/nUUv5rrsR8UUGoe1VC9hZj6V5hU9Qw1HlMDJGEJw5S7TfTErWTjMys6M7vr0YWcPqs3qAr4ss0nDfP+A==", - "engines": { - "node": ">=0.8" - } - }, - "node_modules/js-xlsx/node_modules/codepage": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/codepage/-/codepage-1.3.8.tgz", - "integrity": "sha1-Ty5dfAl13ij4hJgFjcta/KtqX3E=", - "dependencies": { - "commander": "", - "concat-stream": "", - "voc": "" - }, - "bin": { - "codepage": "bin/codepage.njs" - }, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/js-xlsx/node_modules/codepage/node_modules/concat-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", - "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", - "engines": [ - "node >= 6.0" - ], - "dependencies": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.0.2", - "typedarray": "^0.0.6" - } - }, - "node_modules/js-xlsx/node_modules/codepage/node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/js-xlsx/node_modules/codepage/node_modules/readable-stream/node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/js-xlsx/node_modules/colors": { - "version": "0.6.2", - "resolved": "http://registry.npmjs.org/colors/-/colors-0.6.2.tgz", - "integrity": "sha1-JCP+ZnisDF2uiFLl0OW+CMmXq8w=", - "engines": { - "node": ">=0.1.90" - } - }, - "node_modules/js-xlsx/node_modules/commander": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-9.2.0.tgz", - "integrity": "sha512-e2i4wANQiSXgnrBlIatyHtP1odfUp0BbV5Y5nEGbxtIrStkEOAAzCUirvLBNXHLr7kwLvJl6V+4V3XV9x7Wd9w==", - "engines": { - "node": "^12.20.0 || >=14" - } - }, - "node_modules/js-xlsx/node_modules/crc-32": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", - "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", - "bin": { - "crc32": "bin/crc32.njs" - }, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/js-xlsx/node_modules/frac": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/frac/-/frac-0.3.1.tgz", - "integrity": "sha1-V3Z3t/3L5vr3xGHxgB00E3zaQ1Q=", - "engines": { - "node": ">=0.8" - } - }, "node_modules/js-xlsx/node_modules/jszip": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/jszip/-/jszip-2.4.0.tgz", @@ -19941,51 +15860,10 @@ "pako": "~0.2.5" } }, - "node_modules/js-xlsx/node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/js-xlsx/node_modules/ssf": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/ssf/-/ssf-0.8.2.tgz", - "integrity": "sha1-udTcahwbz3b4q/qW19dlb7Kr7NY=", - "dependencies": { - "colors": "0.6.2", - "frac": "0.3.1", - "voc": "" - }, - "bin": { - "ssf": "bin/ssf.njs" - }, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/js-xlsx/node_modules/voc": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/voc/-/voc-1.2.0.tgz", - "integrity": "sha512-BOuDjFFYvJdZO6e/N65AlaDItXo2TgyLjeyRYcqgAPkXpp5yTJcvkL2n+syO1r9Qc5g96tfBD2tuiMhYDmaGcA==", - "bin": { - "voc": "voc.njs" - }, - "engines": { - "node": ">=0.8" - } + "node_modules/js-xlsx/node_modules/pako": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", + "integrity": "sha512-NUcwaKxUxWrZLpDG+z/xZaCgQITkA/Dv4V/T6bw7VON6l1Xz/VnrBqrYjZQ12TamKHzITTfOEIYUj48y2KXImA==" }, "node_modules/js-yaml": { "version": "3.14.1", @@ -20003,22 +15881,24 @@ "node_modules/jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", "dev": true }, "node_modules/jsesc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", - "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", - "dev": true, + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "bin": { "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" } }, "node_modules/jshint": { - "version": "2.13.5", - "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.13.5.tgz", - "integrity": "sha512-dB2n1w3OaQ35PLcBGIWXlszjbPZwsgZoxsg6G8PtNf2cFMC1l0fObkYLUuXqTTdi6tKw4sAjfUseTdmDMHQRcg==", + "version": "2.13.6", + "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.13.6.tgz", + "integrity": "sha512-IVdB4G0NTTeQZrBoM8C5JFVLjV2KtZ9APgybDA1MK73xb09qFs0jCXyQLnCOp1cSZZZbvhq/6mfXHUTaDkffuQ==", "dependencies": { "cli": "~1.0.0", "console-browserify": "1.1.x", @@ -20032,6 +15912,78 @@ "jshint": "bin/jshint" } }, + "node_modules/jshint/node_modules/dom-serializer": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", + "integrity": "sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==", + "dependencies": { + "domelementtype": "^2.0.1", + "entities": "^2.0.0" + } + }, + "node_modules/jshint/node_modules/dom-serializer/node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ] + }, + "node_modules/jshint/node_modules/dom-serializer/node_modules/entities": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", + "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/jshint/node_modules/domelementtype": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", + "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==" + }, + "node_modules/jshint/node_modules/domhandler": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.3.0.tgz", + "integrity": "sha512-q9bUwjfp7Eif8jWxxxPSykdRZAb6GkguBGSgvvCrhI9wB71W2K/Kvv4E61CF/mcCfnVJDeDWx/Vb/uAqbDj6UQ==", + "dependencies": { + "domelementtype": "1" + } + }, + "node_modules/jshint/node_modules/domutils": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", + "integrity": "sha512-gSu5Oi/I+3wDENBsOWBiRK1eoGxcywYSqg3rR960/+EfY0CF4EX1VPkgHOZ3WiS/Jg2DtliF6BhWcHlfpYUcGw==", + "dependencies": { + "dom-serializer": "0", + "domelementtype": "1" + } + }, + "node_modules/jshint/node_modules/entities": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz", + "integrity": "sha512-LbLqfXgJMmy81t+7c14mnulFHJ170cM6E+0vMXR9k/ZiZwgX8i5pNgjTCX3SO4VeUsFLV+8InixoretwU+MjBQ==" + }, + "node_modules/jshint/node_modules/htmlparser2": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", + "integrity": "sha512-hBxEg3CYXe+rPIua8ETe7tmG3XDn9B0edOE/e9wH2nLczxzgdu0m0aNHY+5wFZiviLWLdANPJTssa92dMcXQ5Q==", + "dependencies": { + "domelementtype": "1", + "domhandler": "2.3", + "domutils": "1.5", + "entities": "1.0", + "readable-stream": "1.1" + } + }, + "node_modules/jshint/node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" + }, "node_modules/jshint/node_modules/minimatch": { "version": "3.0.8", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.8.tgz", @@ -20043,6 +15995,22 @@ "node": "*" } }, + "node_modules/jshint/node_modules/readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "node_modules/jshint/node_modules/string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==" + }, "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", @@ -20061,25 +16029,33 @@ "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "dev": true }, + "node_modules/json-schema": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", + "dev": true + }, "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "dev": true }, "node_modules/json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", "dev": true }, "node_modules/json5": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", - "integrity": "sha512-4xrs1aW+6N5DalkqSVA8fxh458CXvR99WU8WLKmq4v8eWAL86Xo3BVqyd3SkA9wEVjCMqyvvRRkshAdOnBp5rw==", - "dev": true, + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "bin": { "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" } }, "node_modules/jsonc-parser": { @@ -20115,15 +16091,15 @@ "node_modules/jsonparse": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", - "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", + "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==", "engines": [ "node >= 0.2.0" ] }, "node_modules/JSONStream": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.4.tgz", - "integrity": "sha512-Y7vfi3I5oMOYIr+WxV8NZxDSwcbNgzdKYsTNInmycOq9bUYwGg9ryu57Wg5NLmCjqdFPNUmpMBo3kSJN9tCbXg==", + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", "dependencies": { "jsonparse": "^1.2.0", "through": ">=2.2.7 <3" @@ -20135,6 +16111,34 @@ "node": "*" } }, + "node_modules/jspdf": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/jspdf/-/jspdf-2.5.1.tgz", + "integrity": "sha512-hXObxz7ZqoyhxET78+XR34Xu2qFGrJJ2I2bE5w4SM8eFaFEkW2xcGRVUss360fYelwRSid/jT078kbNvmoW0QA==", + "dependencies": { + "@babel/runtime": "^7.14.0", + "atob": "^2.1.2", + "btoa": "^1.2.1", + "fflate": "^0.4.8" + }, + "optionalDependencies": { + "canvg": "^3.0.6", + "core-js": "^3.6.0", + "dompurify": "^2.2.0", + "html2canvas": "^1.0.0-rc.5" + } + }, + "node_modules/jspdf/node_modules/core-js": { + "version": "3.31.1", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.31.1.tgz", + "integrity": "sha512-2sKLtfq1eFST7l7v62zaqXacPc7uG8ZAya8ogijLhTtaKNcpzpB4TMoTw2Si+8GYKRwFPMMtUT0263QFWFfqyQ==", + "hasInstallScript": true, + "optional": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, "node_modules/jsprim": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", @@ -20150,21 +16154,15 @@ "node": ">=0.6.0" } }, - "node_modules/jsprim/node_modules/json-schema": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", - "dev": true - }, "node_modules/jstat": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/jstat/-/jstat-1.7.1.tgz", - "integrity": "sha512-lcWi9NKovcx8jdCvgsIzua3KB5rs+TK9cyH1NWyctj+e09jKZTk70vv/EdYSG5mp8MiID2TdepavXn4LUr8rZQ==" + "version": "1.9.6", + "resolved": "https://registry.npmjs.org/jstat/-/jstat-1.9.6.tgz", + "integrity": "sha512-rPBkJbK2TnA8pzs93QcDDPlKcrtZWuuCo2dVR0TFLOJSxhqfWOVCSp8aV3/oSbn+4uY4yw1URtLpHQedtmXfug==" }, "node_modules/JSV": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/JSV/-/JSV-4.0.2.tgz", - "integrity": "sha1-0Hf2glVx+CEy+d/67Vh7QCn+/1c=", + "integrity": "sha512-ZJ6wx9xaKJ3yFUhq5/sk82PJMuUyLk277I8mQeyDgCTjGdjWJIvPfaU5LIXaMuaN2UO1X3kZH4+lgphublZUHw==", "engines": { "node": "*" } @@ -20180,15 +16178,15 @@ "setimmediate": "^1.0.5" } }, - "node_modules/jszip/node_modules/pako": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==" + "node_modules/jszip/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" }, "node_modules/jszip/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -20210,7 +16208,7 @@ "node_modules/jvectormap": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/jvectormap/-/jvectormap-1.2.2.tgz", - "integrity": "sha1-LkQIskpgRz/xBsHnJD43WuXKhdo=", + "integrity": "sha512-rSNE/z2umGcDURvGgnE5Tgwxszw9CkgWQY/NY1LyM+CKGSui11mGTZf/zGrX4WxPwcietgWwMqIV67EJxmU0wQ==", "deprecated": "jvectormap is not maintened since Aug 2015. You can use jvectormap-next or jqvmap instead.", "dependencies": { "jquery": ">=1.5" @@ -20235,22 +16233,19 @@ } }, "node_modules/keyv": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.0.tgz", - "integrity": "sha512-2YvuMsA+jnFGtBareKqgANOEKe1mk3HKiXu2fRmAfyxG0MJAywNhi5ttWA3PMjl4NmpyjZNbFifR2vNjW1znfA==", + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.2.tgz", + "integrity": "sha512-5MHbFaKn8cNSmVW7BYnijeAVlE4cYA/SVkifVgrh7yotnfhKmjuXpDKjrABLnT0SfHWV21P8ow07OGfRrNDg8g==", "dev": true, "dependencies": { "json-buffer": "3.0.1" } }, "node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, "engines": { "node": ">=0.10.0" } @@ -20301,16 +16296,16 @@ "node_modules/lazy-cache": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", - "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "integrity": "sha512-RE2g0b5VGZsOCFOCgP7omTRYFqydmZkBwl5oNnQ1lDYC57uyO9KqNnNVxT7COSHTxrRCWVcAVOcbjk+tvh/rgQ==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/lazystream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz", - "integrity": "sha1-9plf4PggOS9hOWvolGJAe7dxaOQ=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz", + "integrity": "sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==", "dev": true, "dependencies": { "readable-stream": "^2.0.5" @@ -20319,10 +16314,40 @@ "node": ">= 0.6.3" } }, + "node_modules/lazystream/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true + }, + "node_modules/lazystream/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/lazystream/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, "node_modules/lcov-parse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-1.0.0.tgz", - "integrity": "sha1-6w1GtUER68VhrLTECO+TY73I9+A=", + "integrity": "sha512-aprLII/vPzuQvYZnDRU78Fns9I2Ag3gi4Ipga/hxnVMCZC8DnR2nI7XBqrPoywGfxqIx/DgarGvDJZAD3YBTgQ==", "dev": true, "bin": { "lcov-parse": "bin/cli.js" @@ -20339,17 +16364,18 @@ "integrity": "sha512-rsQ6saQO5ST5Aj6XRFylr5zvarWgzWnrg46zQ1MEOEIHsppdC/8hnN8qMoFvACsPvTioAuysya/TVtog15tyAQ==" }, "node_modules/leaflet-geosearch": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/leaflet-geosearch/-/leaflet-geosearch-3.6.0.tgz", - "integrity": "sha512-TkJOi+eVbsQB7wC0ssGzV9eGQv5BgEwDyb0QOunYA64qe53lB+ostUemvQD7Cmari0shtgBr3Patn5galjr3WA==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/leaflet-geosearch/-/leaflet-geosearch-3.8.0.tgz", + "integrity": "sha512-YYFigq2JkqaZrgEjxWyvyQy4seh0Il9xPlG+IP2Z3+K7DrQ+bYc7qDizmxKbAn2jSNUCvokz75gXj7wXcFDB9A==", "optionalDependencies": { + "@googlemaps/js-api-loader": "^1.14.3", "leaflet": "^1.6.0" } }, "node_modules/leaflet-groupedlayercontrol": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/leaflet-groupedlayercontrol/-/leaflet-groupedlayercontrol-0.6.1.tgz", - "integrity": "sha1-y3CXx5jGtN7mROirhMDnC2o+HKo=", + "integrity": "sha512-xkGeH6ygcryFQI0FUWn6Bz93zlwrOSpeXgJQ3jLRoUQJ5h/Qgrz+GqR9nhBFfikjUKtC1sCKL3eDR9wNTWhLlA==", "dependencies": { "leaflet": "^1.0.1" } @@ -20367,10 +16393,59 @@ "leaflet": "^1.0.0" } }, + "node_modules/leaflet-measure/node_modules/@turf/area": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/@turf/area/-/area-5.1.5.tgz", + "integrity": "sha512-lz16gqtvoz+j1jD9y3zj0Z5JnGNd3YfS0h+DQY1EcZymvi75Frm9i5YbEyth0RfxYZeOVufY7YIS3LXbJlI57g==", + "dependencies": { + "@turf/helpers": "^5.1.5", + "@turf/meta": "^5.1.5" + } + }, + "node_modules/leaflet-measure/node_modules/@turf/distance": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/@turf/distance/-/distance-5.1.5.tgz", + "integrity": "sha512-sYCAgYZ2MjNKMtx17EijHlK9qHwpA0MuuQWbR4P30LTCl52UlG/reBfV899wKyF3HuDL9ux78IbILwOfeQ4zgA==", + "dependencies": { + "@turf/helpers": "^5.1.5", + "@turf/invariant": "^5.1.5" + } + }, + "node_modules/leaflet-measure/node_modules/@turf/helpers": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-5.1.5.tgz", + "integrity": "sha512-/lF+JR+qNDHZ8bF9d+Cp58nxtZWJ3sqFe6n3u3Vpj+/0cqkjk4nXKYBSY0azm+GIYB5mWKxUXvuP/m0ZnKj1bw==" + }, + "node_modules/leaflet-measure/node_modules/@turf/invariant": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-5.2.0.tgz", + "integrity": "sha512-28RCBGvCYsajVkw2EydpzLdcYyhSA77LovuOvgCJplJWaNVyJYH6BOR3HR9w50MEkPqb/Vc/jdo6I6ermlRtQA==", + "dependencies": { + "@turf/helpers": "^5.1.5" + } + }, + "node_modules/leaflet-measure/node_modules/@turf/length": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/@turf/length/-/length-5.1.5.tgz", + "integrity": "sha512-0ryx68h512wCoNfwyksLdabxEfwkGNTPg61/QiY+QfGFUOUNhHbP+QimViFpwF5hyX7qmroaSHVclLUqyLGRbg==", + "dependencies": { + "@turf/distance": "^5.1.5", + "@turf/helpers": "^5.1.5", + "@turf/meta": "^5.1.5" + } + }, + "node_modules/leaflet-measure/node_modules/@turf/meta": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@turf/meta/-/meta-5.2.0.tgz", + "integrity": "sha512-ZjQ3Ii62X9FjnK4hhdsbT+64AYRpaI8XMBMcyftEOGSmPMUVnkbvuv3C9geuElAXfQU7Zk1oWGOcrGOD9zr78Q==", + "dependencies": { + "@turf/helpers": "^5.1.5" + } + }, "node_modules/leaflet-search": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/leaflet-search/-/leaflet-search-3.0.2.tgz", - "integrity": "sha512-DtI8LTthhjRzxfNQTgYNuvrk+5hLTISFdemSVrtvnyPA31/a8NGE3GInS19eLGZIgHAYtbUFOHO1/OLbxhi6Yw==", + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/leaflet-search/-/leaflet-search-3.0.9.tgz", + "integrity": "sha512-Jg6b9pwYNAeo67VxRKOunzH5BicscmG0Zp9sjyV2dO+lWEV+eq5N13H+q5vtTA9jcYCriOX1EN4UUxhVUs8n3g==", "dependencies": { "leaflet": "*" } @@ -20385,9 +16460,9 @@ } }, "node_modules/leaflet-wfst": { - "version": "2.0.1-beta.21", - "resolved": "https://registry.npmjs.org/leaflet-wfst/-/leaflet-wfst-2.0.1-beta.21.tgz", - "integrity": "sha512-OOLN+gHvIkLU8vojg1kyRGBwYlSLa52OJI6zoBGl98+4HuplciQUZZznazWPsvoBfopKT3M6/YDB6BTpiyUHnw==" + "version": "2.0.1-beta.27", + "resolved": "https://registry.npmjs.org/leaflet-wfst/-/leaflet-wfst-2.0.1-beta.27.tgz", + "integrity": "sha512-zqs+ooIw9mjqnUPytxt3nWVKda02ceWt2yR9FMNiZxRv/hNKgZq6/dvirT1TMWlFmULLIfkCKik+zIrjGIVNjQ==" }, "node_modules/leaflet.awesome-markers": { "version": "2.0.5", @@ -20413,7 +16488,7 @@ "node_modules/leaflet.pattern/node_modules/leaflet": { "version": "0.7.7", "resolved": "https://registry.npmjs.org/leaflet/-/leaflet-0.7.7.tgz", - "integrity": "sha1-HjUrpU5j0HZFH6NjyQCJDLLPde4=" + "integrity": "sha512-H1lR7J5VxhvQJQHlW2UywtxO63zilLrnwVsDvjKeyfntffj63Ml94gCk9YPYWBkiQgxisdiA8aJ30Zoou4VhEA==" }, "node_modules/less": { "version": "4.1.3", @@ -20505,52 +16580,19 @@ "license-checker": "bin/license-checker" } }, - "node_modules/license-checker/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/license-checker/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/license-checker/node_modules/debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "deprecated": "Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, "dependencies": { "ms": "^2.1.1" } }, - "node_modules/license-checker/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "node_modules/license-checker/node_modules/nopt": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", - "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", + "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", "dev": true, "dependencies": { "abbrev": "1", @@ -20560,16 +16602,13 @@ "nopt": "bin/nopt.js" } }, - "node_modules/license-checker/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "node_modules/license-checker/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" + "bin": { + "semver": "bin/semver" } }, "node_modules/license-webpack-plugin": { @@ -20631,35 +16670,6 @@ "node": ">= 8" } }, - "node_modules/liftup/node_modules/rechoir": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz", - "integrity": "sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==", - "dev": true, - "dependencies": { - "resolve": "^1.9.0" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/liftup/node_modules/resolve": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", - "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", - "dev": true, - "dependencies": { - "is-core-module": "^2.9.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", @@ -20675,7 +16685,7 @@ "node_modules/load-json-file": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "integrity": "sha512-cy7ZdNRXdablkXYNI049pthVeXFurRyb9+hA/dZzerZ0pGTx42z+y+ssxBaVV2l70t1muq5IdKhn4UtcoGUY9A==", "dev": true, "dependencies": { "graceful-fs": "^4.1.2", @@ -20688,61 +16698,67 @@ "node": ">=0.10.0" } }, - "node_modules/loader-runner": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz", - "integrity": "sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw==", + "node_modules/load-json-file/node_modules/parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==", "dev": true, + "dependencies": { + "error-ex": "^1.2.0" + }, "engines": { - "node": ">=6.11.5" + "node": ">=0.10.0" } }, - "node_modules/loader-utils": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", - "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", + "node_modules/load-json-file/node_modules/pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/load-json-file/node_modules/strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==", "dev": true, "dependencies": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^2.1.2" + "is-utf8": "^0.2.0" }, "engines": { - "node": ">=8.9.0" + "node": ">=0.10.0" + } + }, + "node_modules/loader-runner": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", + "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", + "dev": true, + "engines": { + "node": ">=6.11.5" } }, - "node_modules/loader-utils/node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "node_modules/loader-utils": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-3.2.1.tgz", + "integrity": "sha512-ZvFw1KWS3GVyYBYb7qkmRM/WwL2TQQBxgCK62rlvm4WpVQ23Nb4tYjApUlfjrEGvOs7KHEsmyUn75OHZrJMWPw==", "dev": true, - "bin": { - "json5": "lib/cli.js" - }, "engines": { - "node": ">=6" + "node": ">= 12.13.0" } }, "node_modules/locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "dependencies": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" + "p-locate": "^4.1.0" }, "engines": { - "node": ">=6" - } - }, - "node_modules/locate-path/node_modules/path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true, - "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/lodash": { @@ -20750,22 +16766,76 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, + "node_modules/lodash.capitalize": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/lodash.capitalize/-/lodash.capitalize-4.2.1.tgz", + "integrity": "sha512-kZzYOKspf8XVX5AvmQF94gQW0lejFVgb80G85bU4ZWzoJ6C03PQg3coYAUpSTpQWelrZELd3XWgHzw4Ck5kaIw==", + "dev": true + }, "node_modules/lodash.debounce": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", "dev": true }, + "node_modules/lodash.defaults": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", + "integrity": "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==", + "dev": true + }, + "node_modules/lodash.difference": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.difference/-/lodash.difference-4.5.0.tgz", + "integrity": "sha512-dS2j+W26TQ7taQBGN8Lbbq04ssV3emRw4NY58WErlTO29pIqS0HmoT5aJ9+TUQ1N3G+JOZSji4eugsWwGp9yPA==", + "dev": true + }, + "node_modules/lodash.escaperegexp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz", + "integrity": "sha512-TM9YBvyC84ZxE3rgfefxUWiQKLilstD6k7PTGt6wfbtXF8ixIJLOL3VYyV/z+ZiPLsVxAsKAFVwWlWeb2Y8Yyw==", + "dev": true + }, + "node_modules/lodash.flatten": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", + "integrity": "sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g==", + "dev": true + }, "node_modules/lodash.flattendeep": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", - "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", + "integrity": "sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ==", + "dev": true + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", + "dev": true + }, + "node_modules/lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", "dev": true }, "node_modules/lodash.memoize": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", - "integrity": "sha1-LcvSwofLwKVcxCMovQxzYVDVPj8=" + "integrity": "sha512-eDn9kqrAmVUC1wmZvlQ6Uhde44n+tXpqPrN8olQJbttgh0oKclk+SF54P47VEGE9CEiMeRwAP8BaM7UHvBkz2A==" + }, + "node_modules/lodash.union": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.6.0.tgz", + "integrity": "sha512-c4pB2CdGrGdjMKYLA+XiRDO7Y0PRQbm/Gzg8qMj+QH+pFVAoTp5sBpO0odL3FjoPCGjK96p6qsP+yQoiLoOBcw==", + "dev": true + }, + "node_modules/lodash.uniqby": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz", + "integrity": "sha512-e/zcLx6CSbmaEgFHCA7BnoQKyCtKMxnuWrJygbwPs/AIn+IMKl66L8/s+wBUn5LRw2pZx3bUHibiV1b6aTWIww==", + "dev": true }, "node_modules/log-driver": { "version": "1.2.7", @@ -20777,37 +16847,95 @@ } }, "node_modules/log-symbols": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-5.1.0.tgz", - "integrity": "sha512-l0x2DvrW294C9uDCoQe1VSU4gf529FkSZ6leBl4TiqZH/e+0R7hSfHQBNut2mNygDgHwvYHfFLn6Oxb3VWj2rA==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, "dependencies": { - "chalk": "^5.0.0", - "is-unicode-supported": "^1.1.0" + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" }, "engines": { - "node": ">=12" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/log-symbols/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/log-symbols/node_modules/chalk": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.1.tgz", - "integrity": "sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" + "node": ">=10" }, "funding": { "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/log-symbols/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/log-symbols/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/log-symbols/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/log-symbols/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/longest": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", - "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "integrity": "sha512-k+yt5n3l48JU4k8ftnKG6V7u32wyH2NfKzeMto9F/QRE0amxy/LayxwlvjjkZEIzqR+19IrtFO8p5kB9QaYUFg==", "dev": true, "engines": { "node": ">=0.10.0" @@ -20828,7 +16956,7 @@ "node_modules/loud-rejection": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", - "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "integrity": "sha512-RPNliZOFkqFumDhvYqOaNY4Uz9oJM2K9tC6JWsJJsNdhuONW4LQHRBpb0qf4pJApVffI5N39SwzWZJuEhfd7eQ==", "dev": true, "dependencies": { "currently-unhandled": "^0.4.1", @@ -20851,19 +16979,17 @@ } }, "node_modules/lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "dev": true, + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "dependencies": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" + "yallist": "^3.0.2" } }, "node_modules/macos-release": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-3.1.0.tgz", - "integrity": "sha512-/M/R0gCDgM+Cv1IuBG1XGdfTFnMEG6PZeT+KGWHO/OG+imqmaD9CH5vHBTycEM3+Kc4uG2Il+tFAuUWLqQOeUA==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-3.2.0.tgz", + "integrity": "sha512-fSErXALFNsnowREYZ49XCdOHF8wOPWuFOGQrAhP7x5J/BqQv+B02cNsTykGpDgRVx43EKg++6ANmTaGTtW+hUA==", "dev": true, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" @@ -20897,19 +17023,10 @@ "node": ">=6" } }, - "node_modules/make-dir/node_modules/pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/make-dir/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true, "bin": { "semver": "bin/semver" @@ -20947,166 +17064,136 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/make-fetch-happen/node_modules/@tootallnate/once": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", - "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "node_modules/make-fetch-happen/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", "dev": true, "engines": { - "node": ">= 10" + "node": ">=12" } }, - "node_modules/make-fetch-happen/node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "node_modules/make-iterator": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz", + "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==", "dev": true, "dependencies": { - "debug": "4" + "kind-of": "^6.0.2" }, "engines": { - "node": ">= 6.0.0" + "node": ">=0.10.0" } }, - "node_modules/make-fetch-happen/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "node_modules/map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg==", "dev": true, - "dependencies": { - "ms": "2.1.2" - }, "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "node": ">=0.10.0" } }, - "node_modules/make-fetch-happen/node_modules/http-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", - "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "node_modules/map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==", "dev": true, - "dependencies": { - "@tootallnate/once": "2", - "agent-base": "6", - "debug": "4" - }, "engines": { - "node": ">= 6" + "node": ">=0.10.0" } }, - "node_modules/make-fetch-happen/node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "node_modules/mathjax": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/mathjax/-/mathjax-3.2.2.tgz", + "integrity": "sha512-Bt+SSVU8eBG27zChVewOicYs7Xsdt40qm4+UpHyX7k0/O9NliPc+x77k1/FEsPsjKPZGJvtRZM1vO+geW0OhGw==" + }, + "node_modules/maxmin": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/maxmin/-/maxmin-3.0.0.tgz", + "integrity": "sha512-wcahMInmGtg/7c6a75fr21Ch/Ks1Tb+Jtoan5Ft4bAI0ZvJqyOw8kkM7e7p8hDSzY805vmxwHT50KcjGwKyJ0g==", "dev": true, "dependencies": { - "agent-base": "6", - "debug": "4" + "chalk": "^4.1.0", + "figures": "^3.2.0", + "gzip-size": "^5.1.1", + "pretty-bytes": "^5.3.0" }, "engines": { - "node": ">= 6" - } - }, - "node_modules/make-fetch-happen/node_modules/lru-cache": { - "version": "7.18.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", - "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/make-fetch-happen/node_modules/minipass": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", - "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", - "dev": true, - "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/make-fetch-happen/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/make-fetch-happen/node_modules/socks-proxy-agent": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-7.0.0.tgz", - "integrity": "sha512-Fgl0YPZ902wEsAyiQ+idGd1A7rSFx/ayC1CQVMw5P+EQx2V0SgpGtf6OKFhVjPflPUl9YMmEOnmfjCdMUsygww==", + "node_modules/maxmin/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "agent-base": "^6.0.2", - "debug": "^4.3.3", - "socks": "^2.6.2" + "color-convert": "^2.0.1" }, "engines": { - "node": ">= 10" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/make-iterator": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz", - "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==", + "node_modules/maxmin/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { - "kind-of": "^6.0.2" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/make-iterator/node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "node_modules/maxmin/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, "engines": { - "node": ">=0.10.0" + "node": ">=7.0.0" } }, - "node_modules/map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } + "node_modules/maxmin/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, - "node_modules/map-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "node_modules/maxmin/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/mathjax": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/mathjax/-/mathjax-3.1.2.tgz", - "integrity": "sha512-BojKspBv4nNWzO1wC6VEI+g9gHDOhkaGHGgLxXkasdU4pwjdO5AXD5M/wcLPkXYPjZ/N+6sU8rjQTlyvN2cWiQ==" - }, - "node_modules/maxmin": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/maxmin/-/maxmin-1.1.0.tgz", - "integrity": "sha1-cTZehKmd2Piz99X94vANHn9zvmE=", + "node_modules/maxmin/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { - "chalk": "^1.0.0", - "figures": "^1.0.1", - "gzip-size": "^1.0.0", - "pretty-bytes": "^1.0.0" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/md5.js": { @@ -21119,11 +17206,6 @@ "safe-buffer": "^5.1.2" } }, - "node_modules/md5.js/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -21148,7 +17230,7 @@ "node_modules/meow": { "version": "3.7.0", "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", - "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", + "integrity": "sha512-TNdwZs0skRlpPpCUK25StC4VH+tP5GgeY1HQOOGP+lQ2xtdkN2VtT/5tiX9k3IWpkBPV9b3LsAWXn4GGi/PrSA==", "dev": true, "dependencies": { "camelcase-keys": "^2.0.0", @@ -21166,6 +17248,33 @@ "node": ">=0.10.0" } }, + "node_modules/meow/node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, + "node_modules/meow/node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/meow/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, "node_modules/merge-descriptors": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", @@ -21200,7 +17309,6 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, "engines": { "node": ">= 8" } @@ -21217,13 +17325,12 @@ "node_modules/mgrs": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/mgrs/-/mgrs-1.0.0.tgz", - "integrity": "sha1-+5FYjnjJACVnI5XLQLJffNatGCk=" + "integrity": "sha512-awNbTOqCxK1DBGjalK3xqWIstBZgN6fxsMSiXLs9/spqWkF2pAhb2rrYCFSsr1/tT7PhcDGjZndG8SWYn0byYA==" }, "node_modules/micromatch": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, "dependencies": { "braces": "^3.0.2", "picomatch": "^2.3.1" @@ -21244,6 +17351,11 @@ "miller-rabin": "bin/miller-rabin" } }, + "node_modules/miller-rabin/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, "node_modules/mime": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", @@ -21278,21 +17390,27 @@ } }, "node_modules/mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", "dev": true, "engines": { - "node": ">=6" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/mimic-response": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", - "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", + "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", "dev": true, "engines": { - "node": ">=4" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/mini-css-extract-plugin": { @@ -21314,59 +17432,6 @@ "webpack": "^5.0.0" } }, - "node_modules/mini-css-extract-plugin/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/mini-css-extract-plugin/node_modules/ajv-keywords": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", - "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.3" - }, - "peerDependencies": { - "ajv": "^8.8.2" - } - }, - "node_modules/mini-css-extract-plugin/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, - "node_modules/mini-css-extract-plugin/node_modules/schema-utils": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz", - "integrity": "sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==", - "dev": true, - "dependencies": { - "@types/json-schema": "^7.0.9", - "ajv": "^8.9.0", - "ajv-formats": "^2.1.1", - "ajv-keywords": "^5.1.0" - }, - "engines": { - "node": ">= 12.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, "node_modules/minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -21375,7 +17440,7 @@ "node_modules/minimalistic-crypto-utils": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==" }, "node_modules/minimatch": { "version": "3.1.2", @@ -21389,18 +17454,20 @@ } }, "node_modules/minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/minipass": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", - "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", "dev": true, - "dependencies": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" + "engines": { + "node": ">=8" } }, "node_modules/minipass-collect": { @@ -21450,15 +17517,6 @@ "encoding": "^0.1.13" } }, - "node_modules/minipass-fetch/node_modules/minipass": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", - "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/minipass-flush": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", @@ -21577,32 +17635,6 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, - "node_modules/minipass/node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/minipass/node_modules/yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true - }, "node_modules/minizlib": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", @@ -21641,21 +17673,90 @@ "dev": true }, "node_modules/mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", "dev": true, "dependencies": { - "minimist": "^1.2.5" - }, - "bin": { - "mkdirp": "bin/cmd.js" + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==" + }, + "node_modules/module-deps": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-6.2.3.tgz", + "integrity": "sha512-fg7OZaQBcL4/L+AK5f4iVqf9OMbCclXfy/znXRxTVhJSeW5AIlS9AwheYwDaXM3lVW7OBeaeUEY3gbaC6cLlSA==", + "dependencies": { + "browser-resolve": "^2.0.0", + "cached-path-relative": "^1.0.2", + "concat-stream": "~1.6.0", + "defined": "^1.0.0", + "detective": "^5.2.0", + "duplexer2": "^0.1.2", + "inherits": "^2.0.1", + "JSONStream": "^1.0.3", + "parents": "^1.0.0", + "readable-stream": "^2.0.2", + "resolve": "^1.4.0", + "stream-combiner2": "^1.1.1", + "subarg": "^1.0.0", + "through2": "^2.0.0", + "xtend": "^4.0.0" + }, + "bin": { + "module-deps": "bin/cmd.js" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/module-deps/node_modules/concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "engines": [ + "node >= 0.8" + ], + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "node_modules/module-deps/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, + "node_modules/module-deps/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } }, - "node_modules/mkdirp-classic": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", - "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==" + "node_modules/module-deps/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dependencies": { + "safe-buffer": "~5.1.0" + } }, "node_modules/moment": { "version": "2.29.4", @@ -21666,10 +17767,9 @@ } }, "node_modules/morris.js": { - "version": "0.5.1", - "resolved": "git+ssh://git@github.com/morrisjs/morris.js.git#14530d0733801d5bef1264cf3d062ecace7e326b", - "integrity": "sha512-1QwL4R990HvQC4haEO9DVSbzK3IujWEcXiEbuICO7Gu6SqpXH03taEu8F2sW24ik0SNiDbLgPr9tHzuSOi1Gkg==", - "license": "BSD-2-Clause", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/morris.js/-/morris.js-0.5.0.tgz", + "integrity": "sha512-qNJUNEcJKzsQoE1OZNzJqmxsFVsuzgN72GUAcwfe6bBl7w381IzOYorRk0jsq2zEgCXC4DYnqQdYwzKjtvU1gg==", "engines": { "node": ">=0.8 <0.11" } @@ -21684,10 +17784,9 @@ } }, "node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/multicast-dns": { "version": "7.2.5", @@ -21753,26 +17852,6 @@ "ms": "^2.1.1" } }, - "node_modules/needle/node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dev": true, - "optional": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/needle/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, - "optional": true - }, "node_modules/negotiator": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", @@ -21789,9 +17868,9 @@ "dev": true }, "node_modules/nested-error-stacks": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-2.1.0.tgz", - "integrity": "sha512-AO81vsIO1k1sM4Zrd6Hu7regmJN1NSiAja10gc4bX3F0wd+9rQmcuHQaHVQCYIEC8iFXnE+mavh23GOt7wBgug==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-2.1.1.tgz", + "integrity": "sha512-9iN1ka/9zmX1ZvLV9ewJYEk9h7RyRRtqdK0woXcqohu8EWIerfPUjYJPg0ULy0UqP7cslmdGc8xKDJcojlKiaw==", "dev": true }, "node_modules/netmask": { @@ -21872,9 +17951,9 @@ } }, "node_modules/node-fetch": { - "version": "3.2.10", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.2.10.tgz", - "integrity": "sha512-MhuzNwdURnZ1Cp4XTazr69K0BTizsBroX7Zx3UgDSVcZYKF/6p0CBe4EUb/hLqmzVhl0UpYfgRljQ4yxE+iCxA==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.1.tgz", + "integrity": "sha512-cRVc/kyto/7E5shrWca1Wsea4y6tL9iYJE5FBCius3JQfb/4P4I295PfhgbJQBLTx6lATE4z+wK0rPM4VS2uow==", "dev": true, "dependencies": { "data-uri-to-buffer": "^4.0.0", @@ -21935,18 +18014,6 @@ "node-gyp-build-test": "build-test.js" } }, - "node_modules/node-gyp/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/node-gyp/node_modules/nopt": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/nopt/-/nopt-6.0.0.tgz", @@ -21962,47 +18029,25 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/node-gyp/node_modules/semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/node-gyp/node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "node_modules/node-gyp/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, "dependencies": { - "isexe": "^2.0.0" + "glob": "^7.1.3" }, "bin": { - "node-which": "bin/node-which" + "rimraf": "bin.js" }, - "engines": { - "node": ">= 8" + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/node-gyp/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/node-releases": { - "version": "2.0.12", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.12.tgz", - "integrity": "sha512-QzsYKWhXTWx8h1kIvqfnC++o0pEmpRQA/aenALsL2F4pqNVr7YzcdMlDij5WBnwftRbJCNJL/O7zdKaxKPHqgQ==", - "dev": true + "version": "2.0.13", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", + "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==" }, "node_modules/nodeunit-x": { "version": "0.13.0", @@ -22020,7 +18065,7 @@ "node_modules/nomnom": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/nomnom/-/nomnom-1.8.1.tgz", - "integrity": "sha1-IVH3Ikcrp55Qp2/BJbuMjy5Nwqc=", + "integrity": "sha512-5s0JxqhDx9/rksG2BTMVN1enjWSvPidpoSgViZU4ZXULyTe+7jxcCRLB6f42Z0l1xYJpleCBtSyY6Lwg3uu5CQ==", "deprecated": "Package no longer supported. Contact support@npmjs.com for more info.", "dependencies": { "chalk": "~0.4.0", @@ -22030,7 +18075,7 @@ "node_modules/nomnom/node_modules/ansi-styles": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.0.0.tgz", - "integrity": "sha1-yxAt8cVvUSPquLZ817mAJ6AnkXg=", + "integrity": "sha512-3iF4FIKdxaVYT3JqQuY3Wat/T2t7TRbbQ94Fu50ZUCbLy4TFbTzr90NOHQodQkNqmeEGCw8WbeP78WNi6SKYUA==", "engines": { "node": ">=0.8.0" } @@ -22038,7 +18083,7 @@ "node_modules/nomnom/node_modules/chalk": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-0.4.0.tgz", - "integrity": "sha1-UZmj3c0MHv4jvAjBsCewYXbgxk8=", + "integrity": "sha512-sQfYDlfv2DGVtjdoQqxS0cEZDroyG8h6TamA6rvxwlrU5BaSLDx9xhatBYl2pxZ7gmpNaPFVwBtdGdu5rQ+tYQ==", "dependencies": { "ansi-styles": "~1.0.0", "has-color": "~0.1.0", @@ -22051,7 +18096,7 @@ "node_modules/nomnom/node_modules/strip-ansi": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz", - "integrity": "sha1-OeipjQRNFQZgq+SmgIrPcLt7yZE=", + "integrity": "sha512-behete+3uqxecWlDAm5lmskaSaISA+ThQ4oNNBDTBJt0x2ppR6IPqfZNuj6BLaLJ/Sji4TPZlcRyOis8wXQTLg==", "bin": { "strip-ansi": "cli.js" }, @@ -22062,7 +18107,7 @@ "node_modules/nopt": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", - "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "integrity": "sha512-4GUt3kSEYmk4ITxzB/b9vaIDfUVWN/Ml1Fwl11IlnIG2iaJ9O6WXZ9SrYM9NLI8OCBieN2Y8SWC2oJV0RQ7qYg==", "dev": true, "dependencies": { "abbrev": "1" @@ -22072,25 +18117,24 @@ } }, "node_modules/normalize-package-data": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-5.0.0.tgz", + "integrity": "sha512-h9iPVIfrVZ9wVYQnxFgtw1ugSvGEMOlyPWWtm8BMJhnwyEL/FLbYbTY3V3PpjI/BUK67n9PEWDu6eHzu1fB15Q==", "dev": true, "dependencies": { - "hosted-git-info": "^2.1.4", - "is-builtin-module": "^1.0.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" + "hosted-git-info": "^6.0.0", + "is-core-module": "^2.8.1", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, "node_modules/normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "dependencies": { - "remove-trailing-separator": "^1.0.1" - }, + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "engines": { "node": ">=0.10.0" } @@ -22105,12 +18149,12 @@ } }, "node_modules/normalize-url": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", - "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.0.tgz", + "integrity": "sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw==", "dev": true, "engines": { - "node": ">=10" + "node": ">=14.16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -22140,39 +18184,6 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/npm-install-checks/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/npm-install-checks/node_modules/semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/npm-install-checks/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/npm-normalize-package-bin": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-3.0.1.tgz", @@ -22197,60 +18208,6 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/npm-package-arg/node_modules/hosted-git-info": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-6.1.1.tgz", - "integrity": "sha512-r0EI+HBMcXadMrugk0GCQ+6BQV39PiWAZVfq7oIckeGiN7sjRGyQxPdft3nQekFTCQbYxLBH+/axZMeH8UX6+w==", - "dev": true, - "dependencies": { - "lru-cache": "^7.5.1" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/npm-package-arg/node_modules/lru-cache": { - "version": "7.18.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", - "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/npm-package-arg/node_modules/semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/npm-package-arg/node_modules/semver/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/npm-package-arg/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/npm-packlist": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-7.0.4.tgz", @@ -22278,39 +18235,6 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/npm-pick-manifest/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/npm-pick-manifest/node_modules/semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/npm-pick-manifest/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/npm-registry-fetch": { "version": "14.0.5", "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-14.0.5.tgz", @@ -22329,25 +18253,31 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/npm-registry-fetch/node_modules/minipass": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", - "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/npm-run-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", + "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", "dev": true, "dependencies": { - "path-key": "^3.0.0" + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm-run-path/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/npmlog": { @@ -22377,15 +18307,6 @@ "url": "https://github.com/fb55/nth-check?sponsor=1" } }, - "node_modules/number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/nyc": { "version": "14.1.1", "resolved": "https://registry.npmjs.org/nyc/-/nyc-14.1.1.tgz", @@ -22445,13 +18366,24 @@ "wrap-ansi": "^5.1.0" } }, - "node_modules/nyc/node_modules/convert-source-map": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", - "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "node_modules/nyc/node_modules/emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "node_modules/nyc/node_modules/find-cache-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", + "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", "dev": true, "dependencies": { - "safe-buffer": "~5.1.1" + "commondir": "^1.0.1", + "make-dir": "^2.0.0", + "pkg-dir": "^3.0.0" + }, + "engines": { + "node": ">=6" } }, "node_modules/nyc/node_modules/find-up": { @@ -22466,539 +18398,527 @@ "node": ">=6" } }, - "node_modules/nyc/node_modules/rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "node_modules/nyc/node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, + "node_modules/nyc/node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" + "engines": { + "node": ">=4" } }, - "node_modules/nyc/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "node_modules/nyc/node_modules/istanbul-lib-coverage": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", + "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==", "dev": true, - "dependencies": { - "ansi-regex": "^4.1.0" - }, "engines": { "node": ">=6" } }, - "node_modules/nyc/node_modules/uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", + "node_modules/nyc/node_modules/istanbul-lib-instrument": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz", + "integrity": "sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA==", "dev": true, - "bin": { - "uuid": "bin/uuid" + "dependencies": { + "@babel/generator": "^7.4.0", + "@babel/parser": "^7.4.3", + "@babel/template": "^7.4.0", + "@babel/traverse": "^7.4.3", + "@babel/types": "^7.4.0", + "istanbul-lib-coverage": "^2.0.5", + "semver": "^6.0.0" + }, + "engines": { + "node": ">=6" } }, - "node_modules/nyc/node_modules/yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "node_modules/nyc/node_modules/load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==", "dev": true, "dependencies": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=4" } }, - "node_modules/nyc/node_modules/yargs/node_modules/y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", - "dev": true - }, - "node_modules/oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "node_modules/nyc/node_modules/locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", "dev": true, + "dependencies": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + }, "engines": { - "node": "*" + "node": ">=6" } }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "engines": { - "node": ">=0.10.0" + "node_modules/nyc/node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" } }, - "node_modules/object-inspect": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.9.0.tgz", - "integrity": "sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw==", - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node_modules/nyc/node_modules/normalize-package-data/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "bin": { + "semver": "bin/semver" } }, - "node_modules/object-is": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", - "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", + "node_modules/nyc/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "p-try": "^2.0.0" }, "engines": { - "node": ">= 0.4" + "node": ">=6" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/object-is/node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "node_modules/nyc/node_modules/p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "p-limit": "^2.0.0" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">=6" } }, - "node_modules/object-is/node_modules/get-intrinsic": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", - "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", + "node_modules/nyc/node_modules/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", + "dev": true, "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object-is/node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=4" } }, - "node_modules/object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "node_modules/nyc/node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "dev": true, "engines": { - "node": ">= 0.4" + "node": ">=4" } }, - "node_modules/object.assign": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", - "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "node_modules/nyc/node_modules/path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, "dependencies": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "has-symbols": "^1.0.1", - "object-keys": "^1.1.1" + "pify": "^3.0.0" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=4" } }, - "node_modules/object.defaults": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", - "integrity": "sha512-c/K0mw/F11k4dEUBMW8naXUuBuhxRCfG7W+yFy8EcijU/rSmazOUd1XAEEe6bC0OuXY4HUKjTJv7xbxIMqdxrA==", + "node_modules/nyc/node_modules/pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", "dev": true, - "dependencies": { - "array-each": "^1.0.1", - "array-slice": "^1.0.0", - "for-own": "^1.0.0", - "isobject": "^3.0.0" - }, "engines": { - "node": ">=0.10.0" + "node": ">=4" } }, - "node_modules/object.map": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz", - "integrity": "sha512-3+mAJu2PLfnSVGHwIWubpOFLscJANBKuB/6A4CxBstc4aqwQY0FWcsppuy4jU5GSB95yES5JHSI+33AWuS4k6w==", + "node_modules/nyc/node_modules/pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", "dev": true, "dependencies": { - "for-own": "^1.0.0", - "make-iterator": "^1.0.0" + "find-up": "^3.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=6" } }, - "node_modules/object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ==", + "node_modules/nyc/node_modules/read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==", "dev": true, "dependencies": { - "isobject": "^3.0.1" + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=4" } - }, - "node_modules/obuf": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", - "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==", - "dev": true - }, - "node_modules/on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + }, + "node_modules/nyc/node_modules/read-pkg-up": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-4.0.0.tgz", + "integrity": "sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA==", "dev": true, "dependencies": { - "ee-first": "1.1.1" + "find-up": "^3.0.0", + "read-pkg": "^3.0.0" }, "engines": { - "node": ">= 0.8" + "node": ">=6" } }, - "node_modules/on-headers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", - "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", + "node_modules/nyc/node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true, "engines": { - "node": ">= 0.8" + "node": ">=4" } }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dependencies": { - "wrappy": "1" + "node_modules/nyc/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" } }, - "node_modules/onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "node_modules/nyc/node_modules/string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "dev": true, "dependencies": { - "mimic-fn": "^2.1.0" + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" }, "engines": { "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/open": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/open/-/open-8.4.0.tgz", - "integrity": "sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==", + "node_modules/nyc/node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, "dependencies": { - "define-lazy-prop": "^2.0.0", - "is-docker": "^2.1.1", - "is-wsl": "^2.2.0" + "ansi-regex": "^4.1.0" }, "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/opener": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz", - "integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==", - "dev": true, - "bin": { - "opener": "bin/opener-bin.js" + "node": ">=6" } }, - "node_modules/optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "node_modules/nyc/node_modules/test-exclude": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-5.2.3.tgz", + "integrity": "sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g==", "dev": true, "dependencies": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" + "glob": "^7.1.3", + "minimatch": "^3.0.4", + "read-pkg-up": "^4.0.0", + "require-main-filename": "^2.0.0" }, "engines": { - "node": ">= 0.8.0" + "node": ">=6" } }, - "node_modules/ora": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/ora/-/ora-6.1.2.tgz", - "integrity": "sha512-EJQ3NiP5Xo94wJXIzAyOtSb0QEIAUu7m8t6UZ9krbz0vAJqr92JpcK/lEXg91q6B9pEGqrykkd2EQplnifDSBw==", + "node_modules/nyc/node_modules/wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", "dev": true, "dependencies": { - "bl": "^5.0.0", - "chalk": "^5.0.0", - "cli-cursor": "^4.0.0", - "cli-spinners": "^2.6.1", - "is-interactive": "^2.0.0", - "is-unicode-supported": "^1.1.0", - "log-symbols": "^5.1.0", - "strip-ansi": "^7.0.1", - "wcwidth": "^1.0.1" + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=6" } }, - "node_modules/ora/node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "node_modules/nyc/node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "dev": true + }, + "node_modules/nyc/node_modules/yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" + "dependencies": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" } }, - "node_modules/ora/node_modules/bl": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-5.0.0.tgz", - "integrity": "sha512-8vxFNZ0pflFfi0WXA3WQXlj6CaMEwsmh63I1CNp0q+wWv8sD0ARx1KovSQd0l2GkwrMIOyedq0EF1FxI+RCZLQ==", + "node_modules/nyc/node_modules/yargs-parser": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", "dev": true, "dependencies": { - "buffer": "^6.0.3", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" } }, - "node_modules/ora/node_modules/chalk": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.1.tgz", - "integrity": "sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==", + "node_modules/oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", "dev": true, "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "node": "*" } }, - "node_modules/ora/node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "node_modules/ora/node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", "engines": { - "node": ">= 6" + "node": ">=0.10.0" } }, - "node_modules/ora/node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/ora/node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" + "node_modules/object-inspect": { + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/ora/node_modules/strip-ansi": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", - "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", - "dev": true, + "node_modules/object-is": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", + "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", "dependencies": { - "ansi-regex": "^6.0.1" + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" }, "engines": { - "node": ">=12" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/os-browserify": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", - "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=" - }, - "node_modules/os-homedir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.1.tgz", - "integrity": "sha1-DWK99EuRb9O73PLKsZGUj7CU8Ac=", - "dev": true, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" } }, - "node_modules/os-name": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/os-name/-/os-name-5.0.1.tgz", - "integrity": "sha512-0EQpaHUHq7olp2/YFUr+0vZi9tMpDTblHGz+Ch5RntKxiRXOAY0JOz1UlxhSjMSksHvkm13eD6elJj3M8Ht/kw==", + "node_modules/object.assign": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", + "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", "dev": true, "dependencies": { - "macos-release": "^3.0.1", - "windows-release": "^5.0.1" + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "node_modules/object.defaults": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", + "integrity": "sha512-c/K0mw/F11k4dEUBMW8naXUuBuhxRCfG7W+yFy8EcijU/rSmazOUd1XAEEe6bC0OuXY4HUKjTJv7xbxIMqdxrA==", + "dev": true, + "dependencies": { + "array-each": "^1.0.1", + "array-slice": "^1.0.0", + "for-own": "^1.0.0", + "isobject": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object.map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz", + "integrity": "sha512-3+mAJu2PLfnSVGHwIWubpOFLscJANBKuB/6A4CxBstc4aqwQY0FWcsppuy4jU5GSB95yES5JHSI+33AWuS4k6w==", "dev": true, + "dependencies": { + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" + }, "engines": { "node": ">=0.10.0" } }, - "node_modules/osenv": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", + "node_modules/object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ==", "dev": true, "dependencies": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" } }, - "node_modules/own-or": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/own-or/-/own-or-1.0.0.tgz", - "integrity": "sha1-Tod/vtqaLsgAD7wLyuOWRe6L+Nw=", + "node_modules/obuf": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", + "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==", "dev": true }, - "node_modules/own-or-env": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/own-or-env/-/own-or-env-1.0.1.tgz", - "integrity": "sha512-y8qULRbRAlL6x2+M0vIe7jJbJx/kmUTzYonRAa2ayesR2qWLswninkVyeJe4x3IEXhdgoNodzjQRKAoEs6Fmrw==", + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "dev": true, "dependencies": { - "own-or": "^1.0.0" + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" } }, - "node_modules/p-cancelable": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", - "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", + "node_modules/on-headers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", "dev": true, "engines": { - "node": ">=12.20" + "node": ">= 0.8" } }, - "node_modules/p-each-series": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-2.2.0.tgz", - "integrity": "sha512-ycIL2+1V32th+8scbpTvyHNaHe02z0sjgh91XXjAk+ZeXoPN4Z46DVUnzdso0aX4KckKw0FNNFHdjZ2UsZvxiA==", + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", "dev": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, "engines": { - "node": ">=8" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "node_modules/open": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", + "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", "dev": true, "dependencies": { - "p-try": "^2.0.0" + "define-lazy-prop": "^2.0.0", + "is-docker": "^2.1.1", + "is-wsl": "^2.2.0" }, "engines": { - "node": ">=6" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "node_modules/opener": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz", + "integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==", + "dev": true, + "bin": { + "opener": "bin/opener-bin.js" + } + }, + "node_modules/optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", "dev": true, "dependencies": { - "p-limit": "^2.0.0" + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" }, "engines": { - "node": ">=6" + "node": ">= 0.8.0" } }, - "node_modules/p-map": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", - "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "node_modules/ora": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", "dev": true, "dependencies": { - "aggregate-error": "^3.0.0" + "bl": "^4.1.0", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" }, "engines": { "node": ">=10" @@ -23007,452 +18927,413 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/p-retry": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-4.6.2.tgz", - "integrity": "sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ==", + "node_modules/ora/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "@types/retry": "0.12.0", - "retry": "^0.13.1" + "color-convert": "^2.0.1" }, "engines": { "node": ">=8" - } - }, - "node_modules/p-try": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz", - "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/pac-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-5.0.0.tgz", - "integrity": "sha512-CcFG3ZtnxO8McDigozwE3AqAw15zDvGH+OjXO4kzf7IkEKkQ4gxQ+3sdF50WmhQ4P/bVusXcqNE2S3XrNURwzQ==", - "dev": true, - "dependencies": { - "@tootallnate/once": "1", - "agent-base": "6", - "debug": "4", - "get-uri": "3", - "http-proxy-agent": "^4.0.1", - "https-proxy-agent": "5", - "pac-resolver": "^5.0.0", - "raw-body": "^2.2.0", - "socks-proxy-agent": "5" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/pac-proxy-agent/node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "dev": true, - "dependencies": { - "debug": "4" }, - "engines": { - "node": ">= 6.0.0" - } - }, - "node_modules/pac-proxy-agent/node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "dev": true, - "engines": { - "node": ">= 0.8" + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/pac-proxy-agent/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "node_modules/ora/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { - "ms": "2.1.2" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">=6.0" + "node": ">=10" }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/pac-proxy-agent/node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "node_modules/ora/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "agent-base": "6", - "debug": "4" + "color-name": "~1.1.4" }, "engines": { - "node": ">= 6" + "node": ">=7.0.0" } }, - "node_modules/pac-proxy-agent/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "node_modules/ora/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/pac-proxy-agent/node_modules/raw-body": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", - "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "node_modules/ora/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "dependencies": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, "engines": { - "node": ">= 0.8" + "node": ">=8" } }, - "node_modules/pac-resolver": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-5.0.1.tgz", - "integrity": "sha512-cy7u00ko2KVgBAjuhevqpPeHIkCIqPe1v24cydhWjmeuzaBfmUWFCZJ1iAh5TuVzVZoUzXIW7K8sMYOZ84uZ9Q==", + "node_modules/ora/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { - "degenerator": "^3.0.2", - "ip": "^1.1.5", - "netmask": "^2.0.2" + "has-flag": "^4.0.0" }, "engines": { - "node": ">= 8" + "node": ">=8" } }, - "node_modules/pace": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/pace/-/pace-0.0.4.tgz", - "integrity": "sha1-1mQF1fW8EtJUQabibIeNvGnnenc=", - "dependencies": { - "charm": "~0.1.0" - }, - "engines": { - "node": "*" - } + "node_modules/os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A==" }, - "node_modules/package-hash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-3.0.0.tgz", - "integrity": "sha512-lOtmukMDVvtkL84rJHI7dpTYq+0rli8N2wlnqUcBuDWCfVhRUfOmnR9SsoHFMLpACvEV60dX7rd0rFaYDZI+FA==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.15", - "hasha": "^3.0.0", - "lodash.flattendeep": "^4.4.0", - "release-zalgo": "^1.0.0" - }, + "node_modules/os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha512-B5JU3cabzk8c67mRRd3ECmROafjYMXbuzlwtqdM8IbS8ktlTix8aFGb2bAGKrSRIlnfKwovGUUr72JUPyOb6kQ==", + "dev": true, "engines": { - "node": ">=6" + "node": ">=0.10.0" } }, - "node_modules/package-json": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/package-json/-/package-json-8.1.0.tgz", - "integrity": "sha512-hySwcV8RAWeAfPsXb9/HGSPn8lwDnv6fabH+obUZKX169QknRkRhPxd1yMubpKDskLFATkl3jHpNtVtDPFA0Wg==", + "node_modules/os-name": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/os-name/-/os-name-5.1.0.tgz", + "integrity": "sha512-YEIoAnM6zFmzw3PQ201gCVCIWbXNyKObGlVvpAVvraAeOHnlYVKFssbA/riRX5R40WA6kKrZ7Dr7dWzO3nKSeQ==", "dev": true, "dependencies": { - "got": "^12.1.0", - "registry-auth-token": "^5.0.1", - "registry-url": "^6.0.0", - "semver": "^7.3.7" + "macos-release": "^3.1.0", + "windows-release": "^5.0.1" }, "engines": { - "node": ">=14.16" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/package-json/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, "engines": { - "node": ">=10" + "node": ">=0.10.0" } }, - "node_modules/package-json/node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "node_modules/osenv": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "dev": true, "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" } }, - "node_modules/package-json/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "node_modules/own-or": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/own-or/-/own-or-1.0.0.tgz", + "integrity": "sha512-NfZr5+Tdf6MB8UI9GLvKRs4cXY8/yB0w3xtt84xFdWy8hkGjn+JFc60VhzS/hFRfbyxFcGYMTjnF4Me+RbbqrA==", "dev": true }, - "node_modules/pacote": { - "version": "15.2.0", - "resolved": "https://registry.npmjs.org/pacote/-/pacote-15.2.0.tgz", - "integrity": "sha512-rJVZeIwHTUta23sIZgEIM62WYwbmGbThdbnkt81ravBplQv+HjyroqnLRNH2+sLJHcGZmLRmhPwACqhfTcOmnA==", + "node_modules/own-or-env": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/own-or-env/-/own-or-env-1.0.2.tgz", + "integrity": "sha512-NQ7v0fliWtK7Lkb+WdFqe6ky9XAzYmlkXthQrBbzlYbmFKoAYbDDcwmOm6q8kOuwSRXW8bdL5ORksploUJmWgw==", "dev": true, "dependencies": { - "@npmcli/git": "^4.0.0", - "@npmcli/installed-package-contents": "^2.0.1", - "@npmcli/promise-spawn": "^6.0.1", - "@npmcli/run-script": "^6.0.0", - "cacache": "^17.0.0", - "fs-minipass": "^3.0.0", - "minipass": "^5.0.0", - "npm-package-arg": "^10.0.0", - "npm-packlist": "^7.0.0", - "npm-pick-manifest": "^8.0.0", - "npm-registry-fetch": "^14.0.0", - "proc-log": "^3.0.0", - "promise-retry": "^2.0.1", - "read-package-json": "^6.0.0", - "read-package-json-fast": "^3.0.0", - "sigstore": "^1.3.0", - "ssri": "^10.0.0", - "tar": "^6.1.11" - }, - "bin": { - "pacote": "lib/bin.js" - }, + "own-or": "^1.0.0" + } + }, + "node_modules/p-cancelable": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", + "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", + "dev": true, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": ">=12.20" } }, - "node_modules/pacote/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "node_modules/p-each-series": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-2.2.0.tgz", + "integrity": "sha512-ycIL2+1V32th+8scbpTvyHNaHe02z0sjgh91XXjAk+ZeXoPN4Z46DVUnzdso0aX4KckKw0FNNFHdjZ2UsZvxiA==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "dependencies": { - "balanced-match": "^1.0.0" + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/pacote/node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" + "p-limit": "^2.2.0" }, "engines": { - "node": ">= 8" + "node": ">=8" } }, - "node_modules/pacote/node_modules/foreground-child": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", - "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", + "node_modules/p-locate/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "dependencies": { - "cross-spawn": "^7.0.0", - "signal-exit": "^4.0.1" + "p-try": "^2.0.0" }, "engines": { - "node": ">=14" + "node": ">=6" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/pacote/node_modules/glob": { - "version": "10.3.1", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.1.tgz", - "integrity": "sha512-9BKYcEeIs7QwlCYs+Y3GBvqAMISufUS0i2ELd11zpZjxI5V9iyRj0HgzB5/cLf2NY4vcYBTYzJ7GIui7j/4DOw==", + "node_modules/p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", "dev": true, "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^2.0.3", - "minimatch": "^9.0.1", - "minipass": "^5.0.0 || ^6.0.2", - "path-scurry": "^1.10.0" - }, - "bin": { - "glob": "dist/cjs/src/bin.js" + "aggregate-error": "^3.0.0" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/pacote/node_modules/hosted-git-info": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-6.1.1.tgz", - "integrity": "sha512-r0EI+HBMcXadMrugk0GCQ+6BQV39PiWAZVfq7oIckeGiN7sjRGyQxPdft3nQekFTCQbYxLBH+/axZMeH8UX6+w==", + "node_modules/p-retry": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-4.6.2.tgz", + "integrity": "sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ==", "dev": true, "dependencies": { - "lru-cache": "^7.5.1" + "@types/retry": "0.12.0", + "retry": "^0.13.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": ">=8" } }, - "node_modules/pacote/node_modules/json-parse-even-better-errors": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-3.0.0.tgz", - "integrity": "sha512-iZbGHafX/59r39gPwVPRBGw0QQKnA7tte5pSMrhWOW7swGsVvVTjmfyAV9pNqk8YGT7tRCdxRu8uzcgZwoDooA==", + "node_modules/p-retry/node_modules/retry": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", + "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", "dev": true, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": ">= 4" } }, - "node_modules/pacote/node_modules/lru-cache": { - "version": "7.18.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", - "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true, "engines": { - "node": ">=12" + "node": ">=6" } }, - "node_modules/pacote/node_modules/minimatch": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.2.tgz", - "integrity": "sha512-PZOT9g5v2ojiTL7r1xF6plNHLtOeTpSlDI007As2NlA2aYBMfVom17yqa6QzhmDP8QOhn7LjHTg7DFCVSSa6yg==", + "node_modules/pac-proxy-agent": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-6.0.3.tgz", + "integrity": "sha512-5Hr1KgPDoc21Vn3rsXBirwwDnF/iac1jN/zkpsOYruyT+ZgsUhUOgVwq3v9+ukjZd/yGm/0nzO1fDfl7rkGoHQ==", "dev": true, "dependencies": { - "brace-expansion": "^2.0.1" + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "get-uri": "^6.0.1", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.0", + "pac-resolver": "^6.0.1", + "socks-proxy-agent": "^8.0.1" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": ">= 14" + } + }, + "node_modules/pac-proxy-agent/node_modules/agent-base": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", + "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", + "dev": true, + "dependencies": { + "debug": "^4.3.4" }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "engines": { + "node": ">= 14" } }, - "node_modules/pacote/node_modules/minipass": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", - "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "node_modules/pac-proxy-agent/node_modules/http-proxy-agent": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.0.tgz", + "integrity": "sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ==", "dev": true, + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, "engines": { - "node": ">=8" + "node": ">= 14" } }, - "node_modules/pacote/node_modules/normalize-package-data": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-5.0.0.tgz", - "integrity": "sha512-h9iPVIfrVZ9wVYQnxFgtw1ugSvGEMOlyPWWtm8BMJhnwyEL/FLbYbTY3V3PpjI/BUK67n9PEWDu6eHzu1fB15Q==", + "node_modules/pac-proxy-agent/node_modules/https-proxy-agent": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.1.tgz", + "integrity": "sha512-Eun8zV0kcYS1g19r78osiQLEFIRspRUDd9tIfBCTBPBeMieF/EsJNL8VI3xOIdYRDEkjQnqOYPsZ2DsWsVsFwQ==", "dev": true, "dependencies": { - "hosted-git-info": "^6.0.0", - "is-core-module": "^2.8.1", - "semver": "^7.3.5", - "validate-npm-package-license": "^3.0.4" + "agent-base": "^7.0.2", + "debug": "4" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": ">= 14" } }, - "node_modules/pacote/node_modules/read-package-json": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-6.0.4.tgz", - "integrity": "sha512-AEtWXYfopBj2z5N5PbkAOeNHRPUg5q+Nen7QLxV8M2zJq1ym6/lCz3fYNTCXe19puu2d06jfHhrP7v/S2PtMMw==", + "node_modules/pac-proxy-agent/node_modules/socks-proxy-agent": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.1.tgz", + "integrity": "sha512-59EjPbbgg8U3x62hhKOFVAmySQUcfRQ4C7Q/D5sEHnZTQRrQlNKINks44DMR1gwXp0p4LaVIeccX2KHTTcHVqQ==", "dev": true, "dependencies": { - "glob": "^10.2.2", - "json-parse-even-better-errors": "^3.0.0", - "normalize-package-data": "^5.0.0", - "npm-normalize-package-bin": "^3.0.0" + "agent-base": "^7.0.1", + "debug": "^4.3.4", + "socks": "^2.7.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": ">= 14" } }, - "node_modules/pacote/node_modules/semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "node_modules/pac-resolver": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-6.0.2.tgz", + "integrity": "sha512-EQpuJ2ifOjpZY5sg1Q1ZeAxvtLwR7Mj3RgY8cysPGbsRu3RBXyJFWxnMus9PScjxya/0LzvVDxNh/gl0eXBU4w==", "dev": true, "dependencies": { - "lru-cache": "^6.0.0" + "degenerator": "^4.0.4", + "ip": "^1.1.8", + "netmask": "^2.0.2" }, - "bin": { - "semver": "bin/semver.js" + "engines": { + "node": ">= 14" + } + }, + "node_modules/pace": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/pace/-/pace-0.0.4.tgz", + "integrity": "sha512-B1tKMCrHnTmMxaZTzK5+4HRisYaeH8WHMjeg21dbBXB9eFnrZ5uw9+grRnLmLzTcL4R4A8v/XDCnP2Qf+37rPw==", + "dependencies": { + "charm": "~0.1.0" }, "engines": { - "node": ">=10" + "node": "*" } }, - "node_modules/pacote/node_modules/semver/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "node_modules/package-hash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-3.0.0.tgz", + "integrity": "sha512-lOtmukMDVvtkL84rJHI7dpTYq+0rli8N2wlnqUcBuDWCfVhRUfOmnR9SsoHFMLpACvEV60dX7rd0rFaYDZI+FA==", "dev": true, "dependencies": { - "yallist": "^4.0.0" + "graceful-fs": "^4.1.15", + "hasha": "^3.0.0", + "lodash.flattendeep": "^4.4.0", + "release-zalgo": "^1.0.0" }, "engines": { - "node": ">=10" + "node": ">=6" } }, - "node_modules/pacote/node_modules/signal-exit": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.0.2.tgz", - "integrity": "sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q==", + "node_modules/package-json": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/package-json/-/package-json-8.1.1.tgz", + "integrity": "sha512-cbH9IAIJHNj9uXi196JVsRlt7cHKak6u/e6AkL/bkRelZ7rlL3X1YKxsZwa36xipOEKAsdtmaG6aAJoM1fx2zA==", "dev": true, + "dependencies": { + "got": "^12.1.0", + "registry-auth-token": "^5.0.1", + "registry-url": "^6.0.0", + "semver": "^7.3.7" + }, "engines": { - "node": ">=14" + "node": ">=14.16" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/pacote/node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "node_modules/pacote": { + "version": "15.2.0", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-15.2.0.tgz", + "integrity": "sha512-rJVZeIwHTUta23sIZgEIM62WYwbmGbThdbnkt81ravBplQv+HjyroqnLRNH2+sLJHcGZmLRmhPwACqhfTcOmnA==", "dev": true, "dependencies": { - "isexe": "^2.0.0" + "@npmcli/git": "^4.0.0", + "@npmcli/installed-package-contents": "^2.0.1", + "@npmcli/promise-spawn": "^6.0.1", + "@npmcli/run-script": "^6.0.0", + "cacache": "^17.0.0", + "fs-minipass": "^3.0.0", + "minipass": "^5.0.0", + "npm-package-arg": "^10.0.0", + "npm-packlist": "^7.0.0", + "npm-pick-manifest": "^8.0.0", + "npm-registry-fetch": "^14.0.0", + "proc-log": "^3.0.0", + "promise-retry": "^2.0.1", + "read-package-json": "^6.0.0", + "read-package-json-fast": "^3.0.0", + "sigstore": "^1.3.0", + "ssri": "^10.0.0", + "tar": "^6.1.11" }, "bin": { - "node-which": "bin/node-which" + "pacote": "lib/bin.js" }, "engines": { - "node": ">= 8" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/pacote/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/pako": { - "version": "0.2.9", - "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", - "integrity": "sha1-8/dSL073gjSNqBYbrZ7P1Rv4OnU=" + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==" }, "node_modules/parent-module": { "version": "1.0.1", @@ -23469,21 +19350,21 @@ "node_modules/parents": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", - "integrity": "sha1-/t1NK/GTp3dF/nHjcdc8MwfZx1E=", + "integrity": "sha512-mXKF3xkoUt5td2DoxpLmtOmZvko9VfFpwRwkKDHSNvgmpLAeBo18YDhcPbBzJq+QLCHMbGOfzia2cX4U+0v9Mg==", "dependencies": { "path-platform": "~0.11.15" } }, "node_modules/parse-asn1": { - "version": "5.1.1", - "resolved": "http://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.1.tgz", - "integrity": "sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", + "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", "dependencies": { - "asn1.js": "^4.0.0", + "asn1.js": "^5.2.0", "browserify-aes": "^1.0.0", - "create-hash": "^1.1.0", "evp_bytestokey": "^1.0.0", - "pbkdf2": "^3.0.3" + "pbkdf2": "^3.0.3", + "safe-buffer": "^5.1.1" } }, "node_modules/parse-filepath": { @@ -23501,15 +19382,21 @@ } }, "node_modules/parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", "dev": true, "dependencies": { - "error-ex": "^1.2.0" + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" }, "engines": { - "node": ">=0.10.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/parse-node-version": { @@ -23574,18 +19461,6 @@ "url": "https://github.com/inikulin/parse5?sponsor=1" } }, - "node_modules/parse5-html-rewriting-stream/node_modules/entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "dev": true, - "engines": { - "node": ">=0.12" - }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, "node_modules/parse5-sax-parser": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/parse5-sax-parser/-/parse5-sax-parser-7.0.0.tgz", @@ -23598,18 +19473,6 @@ "url": "https://github.com/inikulin/parse5?sponsor=1" } }, - "node_modules/parse5/node_modules/entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "dev": true, - "engines": { - "node": ">=0.12" - }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, "node_modules/parsedbf": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/parsedbf/-/parsedbf-1.1.1.tgz", @@ -23619,6 +19482,17 @@ "text-encoding-polyfill": "^0.6.7" } }, + "node_modules/parsedbf/node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -23628,22 +19502,24 @@ "node": ">= 0.8" } }, + "node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==" + }, "node_modules/path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, - "dependencies": { - "pinkie-promise": "^2.0.0" - }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "engines": { "node": ">=0.10.0" } @@ -23665,7 +19541,7 @@ "node_modules/path-platform": { "version": "0.11.15", "resolved": "https://registry.npmjs.org/path-platform/-/path-platform-0.11.15.tgz", - "integrity": "sha1-6GQhf3TDaFDwhSt43Hv31KVyG/I=", + "integrity": "sha512-Y30dB6rab1A/nfEKsZxmr01nUotHX0c/ZiIAsCTatEe1CmS5Pm5He7fZ195bPT7RdquoaL8lLxFCMQi/bS7IJg==", "engines": { "node": ">= 0.8.0" } @@ -23692,13 +19568,13 @@ } }, "node_modules/path-scurry": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.0.tgz", - "integrity": "sha512-tZFEaRQbMLjwrsmidsGJ6wDMv0iazJWk6SfIKnY4Xru8auXgmJkOBa5DUbYFcFD2Rzk2+KDlIiF0GVXNCbgC7g==", + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.1.tgz", + "integrity": "sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==", "dev": true, "dependencies": { "lru-cache": "^9.1.1 || ^10.0.0", - "minipass": "^5.0.0 || ^6.0.2" + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" }, "engines": { "node": ">=16 || 14 >=14.17" @@ -23716,15 +19592,6 @@ "node": "14 || >=16.14" } }, - "node_modules/path-scurry/node_modules/minipass": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-6.0.2.tgz", - "integrity": "sha512-MzWSV5nYVT7mVyWCwn2o7JH13w2TBRmmSqSRCKzTw+lmft9X4z+3wjvs06Tzijo5z4W/kahUCDpRXTF+ZrmF/w==", - "dev": true, - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, "node_modules/path-to-regexp": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", @@ -23732,23 +19599,18 @@ "dev": true }, "node_modules/path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/pbkdf2": { - "version": "3.0.17", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", - "integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", + "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", "dependencies": { "create-hash": "^1.1.2", "create-hmac": "^1.1.4", @@ -23763,26 +19625,24 @@ "node_modules/pend": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", + "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", "dev": true }, "node_modules/performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", "devOptional": true }, "node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "dev": true + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, "engines": { "node": ">=8.6" }, @@ -23791,18 +19651,18 @@ } }, "node_modules/pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=6" } }, "node_modules/pinkie": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "integrity": "sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==", "dev": true, "engines": { "node": ">=0.10.0" @@ -23811,7 +19671,7 @@ "node_modules/pinkie-promise": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "integrity": "sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==", "dev": true, "dependencies": { "pinkie": "^2.0.0" @@ -23835,27 +19695,15 @@ } }, "node_modules/pkg-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", - "dev": true, - "dependencies": { - "find-up": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/pkg-dir/node_modules/find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, "dependencies": { - "locate-path": "^3.0.0" + "find-up": "^4.0.0" }, "engines": { - "node": ">=6" + "node": ">=8" } }, "node_modules/point-in-polygon": { @@ -23872,14 +19720,14 @@ } }, "node_modules/portfinder": { - "version": "1.0.28", - "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.28.tgz", - "integrity": "sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA==", + "version": "1.0.32", + "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.32.tgz", + "integrity": "sha512-on2ZJVVDXRADWE6jnQaX0ioEylzgBpQk8r55NE4wjXW1ZxO+BgDlY6DXwj20i0V8eB4SenDQ00WEaxfiIQPcxg==", "dev": true, "dependencies": { - "async": "^2.6.2", - "debug": "^3.1.1", - "mkdirp": "^0.5.5" + "async": "^2.6.4", + "debug": "^3.2.7", + "mkdirp": "^0.5.6" }, "engines": { "node": ">= 0.12.0" @@ -23903,12 +19751,6 @@ "ms": "^2.1.1" } }, - "node_modules/portfinder/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, "node_modules/postcss": { "version": "8.4.24", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.24.tgz", @@ -23921,141 +19763,45 @@ }, { "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "dependencies": { - "nanoid": "^3.3.6", - "picocolors": "^1.0.0", - "source-map-js": "^1.0.2" - }, - "engines": { - "node": "^10 || ^12 || >=14" - } - }, - "node_modules/postcss-loader": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/postcss-loader/-/postcss-loader-7.3.2.tgz", - "integrity": "sha512-c7qDlXErX6n0VT+LUsW+nwefVtTu3ORtVvK8EXuUIDcxo+b/euYqpuHlJAvePb0Af5e8uMjR/13e0lTuYifaig==", - "dev": true, - "dependencies": { - "cosmiconfig": "^8.1.3", - "jiti": "^1.18.2", - "klona": "^2.0.6", - "semver": "^7.3.8" - }, - "engines": { - "node": ">= 14.15.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "postcss": "^7.0.0 || ^8.0.1", - "webpack": "^5.0.0" - } - }, - "node_modules/postcss-loader/node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, - "node_modules/postcss-loader/node_modules/cosmiconfig": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.2.0.tgz", - "integrity": "sha512-3rTMnFJA1tCOPwRxtgF4wd7Ab2qvDbL8jX+3smjIbS4HlZBagTlpERbdN7iAbWlrfxE3M8c27kTwTawQ7st+OQ==", - "dev": true, - "dependencies": { - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "parse-json": "^5.0.0", - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/d-fischer" - } - }, - "node_modules/postcss-loader/node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/postcss-loader/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], "dependencies": { - "yallist": "^4.0.0" + "nanoid": "^3.3.6", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" }, "engines": { - "node": ">=10" + "node": "^10 || ^12 || >=14" } }, - "node_modules/postcss-loader/node_modules/parse-json": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", - "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "node_modules/postcss-loader": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/postcss-loader/-/postcss-loader-7.3.2.tgz", + "integrity": "sha512-c7qDlXErX6n0VT+LUsW+nwefVtTu3ORtVvK8EXuUIDcxo+b/euYqpuHlJAvePb0Af5e8uMjR/13e0lTuYifaig==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" + "cosmiconfig": "^8.1.3", + "jiti": "^1.18.2", + "klona": "^2.0.6", + "semver": "^7.3.8" }, "engines": { - "node": ">=8" + "node": ">= 14.15.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/postcss-loader/node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/postcss-loader/node_modules/semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" + "type": "opencollective", + "url": "https://opencollective.com/webpack" }, - "engines": { - "node": ">=10" + "peerDependencies": { + "postcss": "^7.0.0 || ^8.0.1", + "webpack": "^5.0.0" } }, - "node_modules/postcss-loader/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/postcss-modules-extract-imports": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.0.0.tgz", @@ -24144,24 +19890,20 @@ } }, "node_modules/pretty-bytes": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-1.0.4.tgz", - "integrity": "sha1-CiLoIQYJrTVUL4yNXSFZr/B1HIQ=", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", + "integrity": "sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==", "dev": true, - "dependencies": { - "get-stdin": "^4.0.1", - "meow": "^3.1.0" - }, - "bin": { - "pretty-bytes": "cli.js" - }, "engines": { - "node": ">=0.10.0" + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/printj": { "version": "1.1.2", - "resolved": "http://registry.npmjs.org/printj/-/printj-1.1.2.tgz", + "resolved": "https://registry.npmjs.org/printj/-/printj-1.1.2.tgz", "integrity": "sha512-zA2SmoLaxZyArQTOPj5LXecR+RagfPSU5Kw1qP+jkWeNlrq+eJZyY2oS68SU1Z/7/myXM4lo9716laOFAVStCQ==", "bin": { "printj": "bin/printj.njs" @@ -24186,298 +19928,70 @@ "dev": true, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", - "engines": { - "node": ">= 0.6.0" - } - }, - "node_modules/process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" - }, - "node_modules/progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/proj4": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/proj4/-/proj4-2.4.3.tgz", - "integrity": "sha1-87t+Yxv/wEfDaho8wUUzoDu+mWk=", - "dependencies": { - "mgrs": "1.0.0", - "wkt-parser": "^1.1.3" - } - }, - "node_modules/promise-inflight": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", - "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==", - "dev": true - }, - "node_modules/promise-retry": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", - "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", - "dev": true, - "dependencies": { - "err-code": "^2.0.2", - "retry": "^0.12.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/promise-retry/node_modules/retry": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", - "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/promise.allsettled": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/promise.allsettled/-/promise.allsettled-1.0.5.tgz", - "integrity": "sha512-tVDqeZPoBC0SlzJHzWGZ2NKAguVq2oiYj7gbggbiTvH2itHohijTp7njOUA0aQ/nl+0lr/r6egmhoYu63UZ/pQ==", - "dev": true, - "dependencies": { - "array.prototype.map": "^1.0.4", - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1", - "get-intrinsic": "^1.1.1", - "iterate-value": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/promise.allsettled/node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/promise.allsettled/node_modules/es-abstract": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.2.tgz", - "integrity": "sha512-XxXQuVNrySBNlEkTYJoDNFe5+s2yIOpzq80sUHEdPdQr0S5nTLz4ZPPPswNIpKseDDUS5yghX1gfLIHQZ1iNuQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "function.prototype.name": "^1.1.5", - "get-intrinsic": "^1.1.2", - "get-symbol-description": "^1.0.0", - "has": "^1.0.3", - "has-property-descriptors": "^1.0.0", - "has-symbols": "^1.0.3", - "internal-slot": "^1.0.3", - "is-callable": "^1.2.4", - "is-negative-zero": "^2.0.2", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.2", - "is-string": "^1.0.7", - "is-weakref": "^1.0.2", - "object-inspect": "^1.12.2", - "object-keys": "^1.1.1", - "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.4.3", - "string.prototype.trimend": "^1.0.5", - "string.prototype.trimstart": "^1.0.5", - "unbox-primitive": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/promise.allsettled/node_modules/get-intrinsic": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", - "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/promise.allsettled/node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/promise.allsettled/node_modules/is-callable": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.5.tgz", - "integrity": "sha512-ZIWRujF6MvYGkEuHMYtFRkL2wAtFw89EHfKlXrkPkjQZZRWeh9L1q3SV13NIfHnqxugjLvAOkEHx9mb1zcMnEw==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/promise.allsettled/node_modules/is-negative-zero": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", - "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/promise.allsettled/node_modules/is-regex": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", - "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/promise.allsettled/node_modules/object-inspect": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", - "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/promise.allsettled/node_modules/object.assign": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", - "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "has-symbols": "^1.0.3", - "object-keys": "^1.1.1" - }, + } + }, + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">= 0.6.0" } }, - "node_modules/promise.allsettled/node_modules/object.assign/node_modules/define-properties": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", - "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true, - "dependencies": { - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" - }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=0.4.0" } }, - "node_modules/promise.allsettled/node_modules/string.prototype.trimend": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz", - "integrity": "sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog==", - "dev": true, + "node_modules/proj4": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/proj4/-/proj4-2.9.0.tgz", + "integrity": "sha512-BoDXEzCVnRJVZoOKA0QHTFtYoE8lUxtX1jST38DJ8U+v1ixY70Kpwi0Llu6YqSWEH2xqu4XMEBNGcgeRIEywoA==", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.19.5" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "mgrs": "1.0.0", + "wkt-parser": "^1.3.1" } }, - "node_modules/promise.allsettled/node_modules/string.prototype.trimend/node_modules/define-properties": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", - "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", + "node_modules/promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==", + "dev": true + }, + "node_modules/promise-retry": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", + "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", "dev": true, "dependencies": { - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" + "err-code": "^2.0.2", + "retry": "^0.12.0" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=10" } }, - "node_modules/promise.allsettled/node_modules/string.prototype.trimstart": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz", - "integrity": "sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg==", + "node_modules/promise.allsettled": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/promise.allsettled/-/promise.allsettled-1.0.6.tgz", + "integrity": "sha512-22wJUOD3zswWFqgwjNHa1965LvqTX87WPu/lreY2KSd7SVcERfuZ4GfUaOnJNnvtoIv2yXT/W00YIGMetXtFXg==", "dev": true, "dependencies": { + "array.prototype.map": "^1.0.5", "call-bind": "^1.0.2", "define-properties": "^1.1.4", - "es-abstract": "^1.19.5" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/promise.allsettled/node_modules/string.prototype.trimstart/node_modules/define-properties": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", - "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", - "dev": true, - "dependencies": { - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" + "es-abstract": "^1.20.4", + "get-intrinsic": "^1.1.3", + "iterate-value": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -24521,86 +20035,84 @@ } }, "node_modules/proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-5.0.0.tgz", - "integrity": "sha512-gkH7BkvLVkSfX9Dk27W6TyNOWWZWRilRfk1XxGNWOYJ2TuedAv1yFpCaU9QSBmBe716XOTNpYNOzhysyw8xn7g==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.2.1.tgz", + "integrity": "sha512-OIbBKlRAT+ycCm6wAYIzMwPejzRtjy8F3QiDX0eKOA3e4pe3U9F/IvzcHP42bmgQxVv97juG+J8/gx+JIeCX/Q==", "dev": true, "dependencies": { - "agent-base": "^6.0.0", - "debug": "4", - "http-proxy-agent": "^4.0.0", - "https-proxy-agent": "^5.0.0", - "lru-cache": "^5.1.1", - "pac-proxy-agent": "^5.0.0", - "proxy-from-env": "^1.0.0", - "socks-proxy-agent": "^5.0.0" + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.0", + "lru-cache": "^7.14.1", + "pac-proxy-agent": "^6.0.3", + "proxy-from-env": "^1.1.0", + "socks-proxy-agent": "^8.0.1" }, "engines": { - "node": ">= 8" + "node": ">= 14" } }, "node_modules/proxy-agent/node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", + "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", "dev": true, "dependencies": { - "debug": "4" + "debug": "^4.3.4" }, "engines": { - "node": ">= 6.0.0" + "node": ">= 14" } }, - "node_modules/proxy-agent/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "node_modules/proxy-agent/node_modules/http-proxy-agent": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.0.tgz", + "integrity": "sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ==", "dev": true, "dependencies": { - "ms": "2.1.2" + "agent-base": "^7.1.0", + "debug": "^4.3.4" }, "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "node": ">= 14" } }, "node_modules/proxy-agent/node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.1.tgz", + "integrity": "sha512-Eun8zV0kcYS1g19r78osiQLEFIRspRUDd9tIfBCTBPBeMieF/EsJNL8VI3xOIdYRDEkjQnqOYPsZ2DsWsVsFwQ==", "dev": true, "dependencies": { - "agent-base": "6", + "agent-base": "^7.0.2", "debug": "4" }, "engines": { - "node": ">= 6" + "node": ">= 14" } }, "node_modules/proxy-agent/node_modules/lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", "dev": true, - "dependencies": { - "yallist": "^3.0.2" + "engines": { + "node": ">=12" } }, - "node_modules/proxy-agent/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/proxy-agent/node_modules/yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true + "node_modules/proxy-agent/node_modules/socks-proxy-agent": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.1.tgz", + "integrity": "sha512-59EjPbbgg8U3x62hhKOFVAmySQUcfRQ4C7Q/D5sEHnZTQRrQlNKINks44DMR1gwXp0p4LaVIeccX2KHTTcHVqQ==", + "dev": true, + "dependencies": { + "agent-base": "^7.0.1", + "debug": "^4.3.4", + "socks": "^2.7.1" + }, + "engines": { + "node": ">= 14" + } }, "node_modules/proxy-from-env": { "version": "1.1.0", @@ -24618,13 +20130,13 @@ "node_modules/pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==", "dev": true }, "node_modules/psl": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", - "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", + "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", "dev": true }, "node_modules/public-encrypt": { @@ -24640,10 +20152,10 @@ "safe-buffer": "^5.1.2" } }, - "node_modules/public-encrypt/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "node_modules/public-encrypt/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" }, "node_modules/pump": { "version": "3.0.0", @@ -24658,7 +20170,7 @@ "node_modules/punycode": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==" }, "node_modules/pupa": { "version": "3.1.0", @@ -24699,27 +20211,32 @@ "node": ">=10.18.1" } }, - "node_modules/puppeteer/node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "node_modules/puppeteer/node_modules/agent-base": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-5.1.1.tgz", + "integrity": "sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g==", + "dev": true, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/puppeteer/node_modules/https-proxy-agent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-4.0.0.tgz", + "integrity": "sha512-zoDhWrkR3of1l9QAL8/scJZyLu8j/gBkcwcaQOZh7Gyh/+uJQzGVETdgT30akuwkpL8HTRfssqI3BZuV18teDg==", "dev": true, "dependencies": { - "ms": "2.1.2" + "agent-base": "5", + "debug": "4" }, "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "node": ">= 6.0.0" } }, "node_modules/puppeteer/node_modules/mime": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.5.2.tgz", - "integrity": "sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", + "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", "dev": true, "bin": { "mime": "cli.js" @@ -24728,11 +20245,20 @@ "node": ">=4.0.0" } }, - "node_modules/puppeteer/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "node_modules/puppeteer/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } }, "node_modules/qs": { "version": "6.5.3", @@ -24743,28 +20269,18 @@ "node": ">=0.6" } }, - "node_modules/querystring": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", - "deprecated": "The querystring API is considered Legacy. new code should use the URLSearchParams API instead.", - "engines": { - "node": ">=0.4.x" - } - }, "node_modules/querystring-es3": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", - "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", + "integrity": "sha512-773xhDQnZBMFobEiztv8LIl70ch5MSF/jUQVlhwFyBILqq96anmoctVIYz+ZRp0qbCKATTn6ev02M3r7Ga5vqA==", "engines": { "node": ">=0.4.x" } }, "node_modules/queue-microtask": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.2.tgz", - "integrity": "sha512-dB15eXv3p2jDlbOiNLyMabYg1/sXvppd8DP2J3EOCQ0AkuSXCW2tP7mnVouVLJKgUMY6yP0kcQDVpLCN13h4Xg==", - "dev": true, + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "funding": [ { "type": "github", @@ -24793,9 +20309,9 @@ } }, "node_modules/quickselect": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-2.0.0.tgz", - "integrity": "sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw==" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-1.1.1.tgz", + "integrity": "sha512-qN0Gqdw4c4KGPsBOQafj6yj/PA6c/L63f6CaZ/DCF/xF4Esu3jVmKLUDYxghFx8Kb/O7y9tI7x2RjTSXwdK1iQ==" }, "node_modules/raf": { "version": "3.4.1", @@ -24838,9 +20354,9 @@ "integrity": "sha512-4GL1TJoSjUuzYx2uGGt4wp/pRVcUVAqKIQn+t5lSmrqd+1Bvlk6W/CdaFCqMLGoWkE2u8ZNbMUV8IdduB9hufg==" }, "node_modules/raphael": { - "version": "2.2.8", - "resolved": "https://registry.npmjs.org/raphael/-/raphael-2.2.8.tgz", - "integrity": "sha512-0kWKcGn4lXTw4eUiOhjspYiG+v0m6zSmTmlO62E0hl2CYKUvCuHER9YKqXYvOn2nj24mYp8jzHOLeBuj/Gn28Q==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/raphael/-/raphael-2.3.0.tgz", + "integrity": "sha512-w2yIenZAQnp257XUWGni4bLMVxpUpcIl7qgxEgDIXtmSypYtlNxfXWpOBxs7LBTps5sDwhRnrToJrMUrivqNTQ==", "dependencies": { "eve-raphael": "0.5.0" } @@ -24848,7 +20364,7 @@ "node_modules/raw-body": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-1.1.7.tgz", - "integrity": "sha1-HQJ8K/oRasxmI7yo8AAWVyqH1CU=", + "integrity": "sha512-WmJJU2e9Y6M5UzTOkHaM7xJGAPQD8PNzx3bAd2+uhZAim6wDk6dAZxPVYLF67XhbR4hmKGh33Lpmh4XWrCH5Mg==", "dev": true, "dependencies": { "bytes": "1", @@ -24861,15 +20377,15 @@ "node_modules/raw-body/node_modules/string_decoder": { "version": "0.10.31", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==", "dev": true }, "node_modules/rbush": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/rbush/-/rbush-3.0.1.tgz", - "integrity": "sha512-XRaVO0YecOpEuIvbhbpTrZgoiI6xBlz6hnlr6EHhd+0x9ase6EmeN+hdwwUaJvLcsFFQ8iWVF1GAK1yB0BWi0w==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/rbush/-/rbush-2.0.2.tgz", + "integrity": "sha512-XBOuALcTm+O/H8G90b6pzu6nX6v2zCKiFG4BJho8a+bY6AER6t8uQUZdi5bomQc0AprCWhEGa7ncAbbRap0bRA==", "dependencies": { - "quickselect": "^2.0.0" + "quickselect": "^1.0.1" } }, "node_modules/rc": { @@ -24887,6 +20403,12 @@ "rc": "cli.js" } }, + "node_modules/rc/node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, "node_modules/rc/node_modules/strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", @@ -24899,7 +20421,7 @@ "node_modules/read-installed": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/read-installed/-/read-installed-4.0.3.tgz", - "integrity": "sha1-/5uLZ/GH0eTCm5/rMfayI6zRkGc=", + "integrity": "sha512-O03wg/IYuV/VtnK2h/KXEt9VIbMUFbk3ERG0Iu4FhLZw0EP0T9znqrYDGn6ncbEsXUFaUjiVAWXHzxwt3lhRPQ==", "dev": true, "dependencies": { "debuglog": "^1.0.1", @@ -24913,27 +20435,99 @@ "graceful-fs": "^4.1.2" } }, + "node_modules/read-installed/node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, + "node_modules/read-installed/node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/read-installed/node_modules/npm-normalize-package-bin": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", + "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", + "dev": true + }, + "node_modules/read-installed/node_modules/read-package-json": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-2.1.2.tgz", + "integrity": "sha512-D1KmuLQr6ZSJS0tW8hf3WGpRlwszJOXZ3E8Yd/DNRaM5d+1wVRZdHlpGBLAuovjr28LbWvjpWkBHMxpRGGjzNA==", + "dev": true, + "dependencies": { + "glob": "^7.1.1", + "json-parse-even-better-errors": "^2.3.0", + "normalize-package-data": "^2.0.0", + "npm-normalize-package-bin": "^1.0.0" + } + }, + "node_modules/read-installed/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, "node_modules/read-only-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz", - "integrity": "sha1-JyT9aoET1zdkrCiNQ4YnDB2/F/A=", + "integrity": "sha512-3ALe0bjBVZtkdWKIcThYpQCLbBMd/+Tbh2CDSrAIDO3UsZ4Xs+tnyjv2MjCOMMgBG+AsUOeuP1cgtY1INISc8w==", + "dependencies": { + "readable-stream": "^2.0.2" + } + }, + "node_modules/read-only-stream/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, + "node_modules/read-only-stream/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/read-only-stream/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dependencies": { - "readable-stream": "^2.0.2" + "safe-buffer": "~5.1.0" } }, "node_modules/read-package-json": { - "version": "2.0.13", - "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-2.0.13.tgz", - "integrity": "sha512-/1dZ7TRZvGrYqE0UAfN6qQb5GYBsNcqS1C0tNK601CFOJmtHI7NIGXwetEPU/OtoFHZL3hDxm4rolFFVE9Bnmg==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-6.0.4.tgz", + "integrity": "sha512-AEtWXYfopBj2z5N5PbkAOeNHRPUg5q+Nen7QLxV8M2zJq1ym6/lCz3fYNTCXe19puu2d06jfHhrP7v/S2PtMMw==", "dev": true, "dependencies": { - "glob": "^7.1.1", - "json-parse-better-errors": "^1.0.1", - "normalize-package-data": "^2.0.0", - "slash": "^1.0.0" + "glob": "^10.2.2", + "json-parse-even-better-errors": "^3.0.0", + "normalize-package-data": "^5.0.0", + "npm-normalize-package-bin": "^3.0.0" }, - "optionalDependencies": { - "graceful-fs": "^4.1.2" + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, "node_modules/read-package-json-fast": { @@ -24958,10 +20552,93 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/read-package-json/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/read-package-json/node_modules/foreground-child": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", + "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/read-package-json/node_modules/glob": { + "version": "10.3.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.3.tgz", + "integrity": "sha512-92vPiMb/iqpmEgsOoIDvTjc50wf9CCCvMzsi6W0JLPeUKE8TWP1a73PgqSrqy7iAZxaSD1YdzU7QZR5LF51MJw==", + "dev": true, + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.0.3", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/read-package-json/node_modules/json-parse-even-better-errors": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-3.0.0.tgz", + "integrity": "sha512-iZbGHafX/59r39gPwVPRBGw0QQKnA7tte5pSMrhWOW7swGsVvVTjmfyAV9pNqk8YGT7tRCdxRu8uzcgZwoDooA==", + "dev": true, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/read-package-json/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/read-package-json/node_modules/signal-exit": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.0.2.tgz", + "integrity": "sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/read-pkg": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "integrity": "sha512-7BGwRHqt4s/uVbuyoeejRn4YmFnYZiFl4AuaeXHlgZf3sONF0SOGlxs2Pw8g6hCKupo08RafIO5YXFNOKTfwsQ==", "dev": true, "dependencies": { "load-json-file": "^1.0.0", @@ -24975,7 +20652,7 @@ "node_modules/read-pkg-up": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "integrity": "sha512-WD9MTlNtI55IwYUS27iHh9tK3YoIVhxis8yKhLpTqWtml739uXc9NWTpxoHkfZf3+DkCCsXox94/VWZniuZm6A==", "dev": true, "dependencies": { "find-up": "^1.0.0", @@ -24985,18 +20662,122 @@ "node": ">=0.10.0" } }, + "node_modules/read-pkg-up/node_modules/find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha512-jvElSjyuo4EMQGoTwo1uJU5pQMwTW5lS1x05zzfJuTIyLR3zwO27LYrxNg+dlvKpGOuGy/MzBdXh80g0ve5+HA==", + "dev": true, + "dependencies": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/read-pkg-up/node_modules/path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha512-yTltuKuhtNeFJKa1PiRzfLAU5182q1y4Eb4XCJ3PBqyzEDkAZRzBrKKBct682ls9reBVHf9udYLN5Nd+K1B9BQ==", + "dev": true, + "dependencies": { + "pinkie-promise": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/read-pkg/node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, + "node_modules/read-pkg/node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/read-pkg/node_modules/path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha512-S4eENJz1pkiQn9Znv33Q+deTOKmbl+jj1Fl+qiP/vYezj+S8x+J3Uo0ISrx/QoEvIlOaDWJhPaRd1flJ9HXZqg==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/read-pkg/node_modules/pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/read-pkg/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, "node_modules/readable-stream": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.4.tgz", - "integrity": "sha512-vuYxeWYM+fde14+rajzqgeohAI7YoJcHE7kXDAc4Nk0EbuKnJfqtY9YtRkLo/tqkuF7MsBQRhPnPeyjYITp3ZQ==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.0.3", - "util-deprecate": "~1.0.1" + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/readdir-glob": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/readdir-glob/-/readdir-glob-1.1.3.tgz", + "integrity": "sha512-v05I2k7xN8zXvPD9N+z/uhXPaj0sUFCe2rcWZIpBsqxfP7xXFQ0tipAd/wjj1YxWyWtUS5IDJpOG82JKt2EAVA==", + "dev": true, + "dependencies": { + "minimatch": "^5.1.0" + } + }, + "node_modules/readdir-glob/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/readdir-glob/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" } }, "node_modules/readdir-scoped-modules": { @@ -25016,7 +20797,6 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, "dependencies": { "picomatch": "^2.2.1" }, @@ -25025,12 +20805,12 @@ } }, "node_modules/rechoir": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", - "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz", + "integrity": "sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==", "dev": true, "dependencies": { - "resolve": "^1.1.6" + "resolve": "^1.9.0" }, "engines": { "node": ">= 0.10" @@ -25039,7 +20819,7 @@ "node_modules/redent": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", - "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", + "integrity": "sha512-qtW5hKzGQZqKoh6JNSD+4lfitfPKGz42e6QwiRmPM5mmKtR0N41AbJRYu0xJi7nhOJ4WDgRkKvAk6tw4WIwR4g==", "dev": true, "dependencies": { "indent-string": "^2.1.0", @@ -25049,11 +20829,22 @@ "node": ">=0.10.0" } }, + "node_modules/redent/node_modules/indent-string": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", + "integrity": "sha512-aqwDFWSgSgfRaEwao5lg5KEcVd/2a+D1rvoG7NdilmYz0NwRk6StWpWdz/Hpk34MKPpx7s8XxUqimfcQK6gGlg==", + "dev": true, + "dependencies": { + "repeating": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/reflect-metadata": { "version": "0.1.13", "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", - "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==", - "dev": true + "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==" }, "node_modules/regenerate": { "version": "1.4.2", @@ -25074,20 +20865,17 @@ } }, "node_modules/regenerator-runtime": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", - "dev": true + "version": "0.13.11", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", + "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==" }, "node_modules/regenerator-transform": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.10.1.tgz", - "integrity": "sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==", + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.1.tgz", + "integrity": "sha512-knzmNAcuyxV+gQCufkYcvOqX/qIIfHLv0u5x79kRxuGojfYVky1f15TzZEu2Avte8QGepvUNTnLskf8E6X6Vyg==", "dev": true, "dependencies": { - "babel-runtime": "^6.18.0", - "babel-types": "^6.19.0", - "private": "^0.1.6" + "@babel/runtime": "^7.8.4" } }, "node_modules/regex-parser": { @@ -25095,52 +20883,16 @@ "resolved": "https://registry.npmjs.org/regex-parser/-/regex-parser-2.2.11.tgz", "integrity": "sha512-jbD/FT0+9MBU2XAZluI7w2OBs1RBi6p9M83nkoZayQXXU9e8Robt69FcZc7wU4eJD/YFTjn1JdCk3rbMJajz8Q==", "dev": true - }, - "node_modules/regexp.prototype.flags": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz", - "integrity": "sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==", - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "functions-have-names": "^1.2.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/regexp.prototype.flags/node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/regexp.prototype.flags/node_modules/get-intrinsic": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", - "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", - "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/regexp.prototype.flags/node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz", + "integrity": "sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "functions-have-names": "^1.2.3" + }, "engines": { "node": ">= 0.4" }, @@ -25149,23 +20901,29 @@ } }, "node_modules/regexpu-core": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", - "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.3.2.tgz", + "integrity": "sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ==", "dev": true, "dependencies": { - "regenerate": "^1.2.1", - "regjsgen": "^0.2.0", - "regjsparser": "^0.1.4" + "@babel/regjsgen": "^0.8.0", + "regenerate": "^1.4.2", + "regenerate-unicode-properties": "^10.1.0", + "regjsparser": "^0.9.1", + "unicode-match-property-ecmascript": "^2.0.0", + "unicode-match-property-value-ecmascript": "^2.1.0" + }, + "engines": { + "node": ">=4" } }, "node_modules/registry-auth-token": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.0.1.tgz", - "integrity": "sha512-UfxVOj8seK1yaIOiieV4FIP01vfBDLsY0H9sQzi9EbbUdJiuuBjJgLa1DpImXMNPnVkBD4eVxTEXcrZA6kfpJA==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.0.2.tgz", + "integrity": "sha512-o/3ikDxtXaA59BmZuZrJZDJv8NMDGSj+6j6XaeBmHw8eY1i1qd9+6H+LjVvQXx3HN6aRCGa1cUdJ9RaJZUugnQ==", "dev": true, "dependencies": { - "@pnpm/npm-conf": "^1.0.4" + "@pnpm/npm-conf": "^2.1.0" }, "engines": { "node": ">=14" @@ -25189,13 +20947,13 @@ "node_modules/regjsgen": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", - "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", + "integrity": "sha512-x+Y3yA24uF68m5GA+tBjbGYo64xXVJpbToBaWCoSNSc1hdk6dfctaRWrNFTVJZIIhL5GxW8zwjoixbnifnK59g==", "dev": true }, "node_modules/regjsparser": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", - "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.9.1.tgz", + "integrity": "sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ==", "dev": true, "dependencies": { "jsesc": "~0.5.0" @@ -25207,40 +20965,40 @@ "node_modules/regjsparser/node_modules/jsesc": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "integrity": "sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==", "dev": true, "bin": { "jsesc": "bin/jsesc" } }, "node_modules/release-it": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/release-it/-/release-it-15.4.1.tgz", - "integrity": "sha512-w6adXfE+bN/fdcG1KehgS7gYcTfZLYIPml4jPOUEtYQ6NJyaiCtCF/ks032w1jf6EUgvGgWruRP+2TyyyDDBgA==", + "version": "15.11.0", + "resolved": "https://registry.npmjs.org/release-it/-/release-it-15.11.0.tgz", + "integrity": "sha512-lZwoGEnKYKwGnfxxlA7vtR7vvozPrOSsIgQaHO4bgQ5ARbG3IA6Dmo0IVusv6nR1KmnjH70QIeNAgsWs6Ji/tw==", "dev": true, "dependencies": { "@iarna/toml": "2.2.5", - "@octokit/rest": "19.0.4", + "@octokit/rest": "19.0.11", "async-retry": "1.3.3", - "chalk": "5.0.1", - "cosmiconfig": "7.0.1", - "execa": "6.1.0", - "form-data": "4.0.0", - "git-url-parse": "13.0.0", - "globby": "13.1.2", - "got": "12.3.1", - "inquirer": "9.1.0", + "chalk": "5.2.0", + "cosmiconfig": "8.1.3", + "execa": "7.1.1", + "git-url-parse": "13.1.0", + "globby": "13.1.4", + "got": "12.6.1", + "inquirer": "9.2.6", "is-ci": "3.0.1", + "issue-parser": "6.0.0", "lodash": "4.17.21", "mime-types": "2.1.35", "new-github-release-url": "2.0.0", - "node-fetch": "3.2.10", - "open": "8.4.0", - "ora": "6.1.2", - "os-name": "5.0.1", - "promise.allsettled": "1.0.5", - "proxy-agent": "5.0.0", - "semver": "7.3.7", + "node-fetch": "3.3.1", + "open": "9.1.0", + "ora": "6.3.1", + "os-name": "5.1.0", + "promise.allsettled": "1.0.6", + "proxy-agent": "6.2.1", + "semver": "7.5.1", "shelljs": "0.8.5", "update-notifier": "6.0.2", "url-join": "5.0.0", @@ -25254,10 +21012,43 @@ "node": ">=14.9" } }, + "node_modules/release-it/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/release-it/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/release-it/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, "node_modules/release-it/node_modules/chalk": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.1.tgz", - "integrity": "sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.2.0.tgz", + "integrity": "sha512-ree3Gqw/nazQAPuJJEy+avdl7QfZMcUvmHIKgEZkGL+xOBzRvup5Hxo6LHuMceSxOabuJLJm5Yp/92R9eMmMvA==", "dev": true, "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" @@ -25266,80 +21057,286 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/release-it/node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "node_modules/release-it/node_modules/cli-width": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.0.0.tgz", + "integrity": "sha512-ZksGS2xpa/bYkNzN3BAw1wEjsLV/ZKOf/CCrJ/QOBsxx6fOARIkwTutxp1XIOIohi6HKmOFjMoK/XaqDVUpEEw==", + "dev": true, + "engines": { + "node": ">= 12" + } + }, + "node_modules/release-it/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/release-it/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/release-it/node_modules/cosmiconfig": { + "version": "8.1.3", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.1.3.tgz", + "integrity": "sha512-/UkO2JKI18b5jVMJUp0lvKFMpa/Gye+ZgZjKD+DGEN9y7NRcf/nK1A0sp67ONmKtnDCNMS44E6jrk0Yc3bDuUw==", + "dev": true, + "dependencies": { + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "parse-json": "^5.0.0", + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/d-fischer" + } + }, + "node_modules/release-it/node_modules/define-lazy-prop": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz", + "integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/release-it/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/release-it/node_modules/figures": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-5.0.0.tgz", + "integrity": "sha512-ej8ksPF4x6e5wvK9yevct0UCXh8TTFlWGVLlgjZuoBH1HwjIfKE/IdL5mq89sFA7zELi1VhKpmtDnrs7zWyeyg==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^5.0.0", + "is-unicode-supported": "^1.2.0" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/release-it/node_modules/figures/node_modules/is-unicode-supported": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", + "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/release-it/node_modules/globby": { + "version": "13.1.4", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.4.tgz", + "integrity": "sha512-iui/IiiW+QrJ1X1hKH5qwlMQyv34wJAYwH1vrf8b9kBA4sNiif3gKsMHa+BrdnOpEudWjpotfa7LrTzB1ERS/g==", + "dev": true, + "dependencies": { + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.11", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/release-it/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/release-it/node_modules/inquirer": { + "version": "9.2.6", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-9.2.6.tgz", + "integrity": "sha512-y71l237eJJKS4rl7sQcEUiMhrR0pB/ZnRMMTxLpjJhWL4hdWCT03a6jJnC1w6qIPSRZWEozuieGt3v7XaEJYFw==", + "dev": true, + "dependencies": { + "ansi-escapes": "^4.3.2", + "chalk": "^5.2.0", + "cli-cursor": "^3.1.0", + "cli-width": "^4.0.0", + "external-editor": "^3.0.3", + "figures": "^5.0.0", + "lodash": "^4.17.21", + "mute-stream": "1.0.0", + "ora": "^5.4.1", + "run-async": "^3.0.0", + "rxjs": "^7.8.1", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "through": "^2.3.6", + "wrap-ansi": "^6.0.1" + }, + "engines": { + "node": ">=14.18.0" + } + }, + "node_modules/release-it/node_modules/inquirer/node_modules/ora": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", + "dev": true, + "dependencies": { + "bl": "^4.1.0", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/release-it/node_modules/inquirer/node_modules/ora/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/release-it/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/release-it/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/release-it/node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/release-it/node_modules/mute-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-1.0.0.tgz", + "integrity": "sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==", "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, "engines": { - "node": ">= 8" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/release-it/node_modules/execa": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-6.1.0.tgz", - "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", + "node_modules/release-it/node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.1", - "human-signals": "^3.0.1", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^3.0.7", - "strip-final-newline": "^3.0.0" + "mimic-fn": "^2.1.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=6" }, "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/release-it/node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "node_modules/release-it/node_modules/open": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/open/-/open-9.1.0.tgz", + "integrity": "sha512-OS+QTnw1/4vrf+9hh1jc1jnYjzSG4ttTBB8UxOwAnInG3Uo4ssetzC1ihqaIHjLJnA5GGlRl6QlZXOTQhRBUvg==", "dev": true, "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" + "default-browser": "^4.0.0", + "define-lazy-prop": "^3.0.0", + "is-inside-container": "^1.0.0", + "is-wsl": "^2.2.0" }, "engines": { - "node": ">= 6" - } - }, - "node_modules/release-it/node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "dev": true, - "engines": { - "node": ">=10" + "node": ">=14.16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/release-it/node_modules/globby": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.2.tgz", - "integrity": "sha512-LKSDZXToac40u8Q1PQtZihbNdTYSNMuWe+K5l+oa6KgDzSvVrHXlJy40hUP522RjAIoNLJYBJi7ow+rbFpIhHQ==", + "node_modules/release-it/node_modules/ora": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-6.3.1.tgz", + "integrity": "sha512-ERAyNnZOfqM+Ao3RAvIXkYh5joP220yf59gVe2X/cI6SiCxIdi4c9HZKZD8R6q/RDXEje1THBju6iExiSsgJaQ==", "dev": true, "dependencies": { - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.11", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^4.0.0" + "chalk": "^5.0.0", + "cli-cursor": "^4.0.0", + "cli-spinners": "^2.6.1", + "is-interactive": "^2.0.0", + "is-unicode-supported": "^1.1.0", + "log-symbols": "^5.1.0", + "stdin-discarder": "^0.1.0", + "strip-ansi": "^7.0.1", + "wcwidth": "^1.0.1" }, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" @@ -25348,20 +21345,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/release-it/node_modules/human-signals": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-3.0.1.tgz", - "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", - "dev": true, - "engines": { - "node": ">=12.20.0" - } - }, - "node_modules/release-it/node_modules/is-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", - "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "node_modules/release-it/node_modules/ora/node_modules/cli-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", + "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", "dev": true, + "dependencies": { + "restore-cursor": "^4.0.0" + }, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -25369,22 +21360,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/release-it/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "node_modules/release-it/node_modules/ora/node_modules/is-interactive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz", + "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==", "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, "engines": { - "node": ">=10" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/release-it/node_modules/mimic-fn": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", - "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "node_modules/release-it/node_modules/ora/node_modules/is-unicode-supported": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz", + "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==", "dev": true, "engines": { "node": ">=12" @@ -25393,78 +21384,75 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/release-it/node_modules/npm-run-path": { + "node_modules/release-it/node_modules/ora/node_modules/log-symbols": { "version": "5.1.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", - "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-5.1.0.tgz", + "integrity": "sha512-l0x2DvrW294C9uDCoQe1VSU4gf529FkSZ6leBl4TiqZH/e+0R7hSfHQBNut2mNygDgHwvYHfFLn6Oxb3VWj2rA==", "dev": true, "dependencies": { - "path-key": "^4.0.0" + "chalk": "^5.0.0", + "is-unicode-supported": "^1.1.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/release-it/node_modules/npm-run-path/node_modules/path-key": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", - "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "node_modules/release-it/node_modules/ora/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, "engines": { "node": ">=12" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, - "node_modules/release-it/node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "node_modules/release-it/node_modules/restore-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", + "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", "dev": true, "dependencies": { - "mimic-fn": "^4.0.0" + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" }, "engines": { - "node": ">=12" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/release-it/node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "node_modules/release-it/node_modules/run-async": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-3.0.0.tgz", + "integrity": "sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==", "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, "engines": { - "node": ">=10" + "node": ">=0.12.0" } }, - "node_modules/release-it/node_modules/shelljs": { - "version": "0.8.5", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", - "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", + "node_modules/release-it/node_modules/semver": { + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz", + "integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==", "dev": true, "dependencies": { - "glob": "^7.0.0", - "interpret": "^1.0.0", - "rechoir": "^0.6.2" + "lru-cache": "^6.0.0" }, "bin": { - "shjs": "bin/shjs" + "semver": "bin/semver.js" }, "engines": { - "node": ">=4" + "node": ">=10" } }, "node_modules/release-it/node_modules/slash": { @@ -25479,16 +21467,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/release-it/node_modules/strip-final-newline": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "node_modules/release-it/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, - "engines": { - "node": ">=12" + "dependencies": { + "has-flag": "^4.0.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": ">=8" } }, "node_modules/release-it/node_modules/url-join": { @@ -25500,19 +21488,18 @@ "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, - "node_modules/release-it/node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "node_modules/release-it/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", "dev": true, "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" }, "engines": { - "node": ">= 8" + "node": ">=8" } }, "node_modules/release-it/node_modules/yallist": { @@ -25521,19 +21508,10 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, - "node_modules/release-it/node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "dev": true, - "engines": { - "node": ">=12" - } - }, "node_modules/release-zalgo": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", - "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", + "integrity": "sha512-gUAyHVHPPC5wdqX/LG4LWtRYtgjxyX78oanFNTMMyFEfOqdC54s3eE82imuWKbOeqYht2CrNf64Qb8vgmmtZGA==", "dev": true, "dependencies": { "es6-error": "^4.0.1" @@ -25542,16 +21520,10 @@ "node": ">=4" } }, - "node_modules/remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true - }, "node_modules/repeat-string": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", "dev": true, "engines": { "node": ">=0.10" @@ -25560,7 +21532,7 @@ "node_modules/repeating": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", - "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "integrity": "sha512-ZqtSMuVybkISo2OWvqvm7iHSWngvdaW3IpsT9/uP8v4gMi591LY6h35wdOfvQdWCKFWZWm2Y1Opp4kV7vQKT6A==", "dev": true, "dependencies": { "is-finite": "^1.0.0" @@ -25601,41 +21573,10 @@ "node": ">= 6" } }, - "node_modules/request/node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/request/node_modules/uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", - "dev": true, - "bin": { - "uuid": "bin/uuid" - } - }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true, + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "engines": { "node": ">=0.10.0" } @@ -25658,13 +21599,24 @@ "node_modules/requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", "dev": true }, "node_modules/resolve": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", - "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=" + "version": "1.22.2", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", + "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", + "dependencies": { + "is-core-module": "^2.11.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/resolve-alpn": { "version": "1.2.1", @@ -25684,15 +21636,6 @@ "node": ">=8" } }, - "node_modules/resolve-cwd/node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/resolve-dir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", @@ -25707,12 +21650,12 @@ } }, "node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true, "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/resolve-url-loader": { @@ -25731,12 +21674,20 @@ "node": ">=12" } }, - "node_modules/resolve-url-loader/node_modules/convert-source-map": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", - "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", - "dev": true - }, + "node_modules/resolve-url-loader/node_modules/loader-utils": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", + "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", + "dev": true, + "dependencies": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + }, + "engines": { + "node": ">=8.9.0" + } + }, "node_modules/resolve-url-loader/node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -25747,46 +21698,61 @@ } }, "node_modules/responselike": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.1.tgz", - "integrity": "sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", + "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", "dev": true, "dependencies": { - "lowercase-keys": "^2.0.0" + "lowercase-keys": "^3.0.0" + }, + "engines": { + "node": ">=14.16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/responselike/node_modules/lowercase-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", + "node_modules/restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", "dev": true, + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, "engines": { "node": ">=8" } }, - "node_modules/restore-cursor": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", - "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", + "node_modules/restore-cursor/node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/restore-cursor/node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, "dependencies": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" + "mimic-fn": "^2.1.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=6" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/retry": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", - "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", "dev": true, "engines": { "node": ">= 4" @@ -25796,7 +21762,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" @@ -25805,7 +21770,7 @@ "node_modules/rgbcolor": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/rgbcolor/-/rgbcolor-1.0.1.tgz", - "integrity": "sha1-1lBezbMEplldom+ktDMHMGd1lF0=", + "integrity": "sha512-9aZLIrhRaD97sgVhtJOW6ckOEh6/GnvQtdVNfdZ6s67+3/XwLS9lBcQYzEEhYVeUowN7pRzMLsyGhK2i/xvWbw==", "optional": true, "engines": { "node": ">= 0.8.15" @@ -25814,7 +21779,7 @@ "node_modules/right-align": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", - "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "integrity": "sha512-yqINtL/G7vs2v+dFIZmFUDbnVyFUJFKd6gK22Kgo6R4jfJGFtisKyncWDDULgjfqf4ASQuIQyjJ7XZ+3aWpsAg==", "dev": true, "dependencies": { "align-text": "^0.1.1" @@ -25824,18 +21789,15 @@ } }, "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", "dev": true, "dependencies": { "glob": "^7.1.3" }, "bin": { "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" } }, "node_modules/ripemd160": { @@ -25853,9 +21815,9 @@ "integrity": "sha512-l4NwboJM74Ilm4VKfbAtFeGq7aEjWL+5kVFcmgFA2MrdnQWx9iE/tUGvxY5HyMI7o/WpSIUFLbC5fbeaHgSCYg==" }, "node_modules/rollup": { - "version": "3.26.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.26.0.tgz", - "integrity": "sha512-YzJH0eunH2hr3knvF3i6IkLO/jTjAEwU4HoMUbQl4//Tnl3ou0e7P5SjxdDr8HQJdeUJShlbEHXrrnEHy1l7Yg==", + "version": "3.26.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.26.2.tgz", + "integrity": "sha512-6umBIGVz93er97pMgQO08LuH3m6PUb3jlDUUGFsNJB6VgTCUaDFpupf5JfU30529m/UKOgmiX+uY6Sx8cOYpLA==", "dev": true, "bin": { "rollup": "dist/bin/rollup" @@ -25868,6 +21830,122 @@ "fsevents": "~2.3.2" } }, + "node_modules/run-applescript": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-5.0.0.tgz", + "integrity": "sha512-XcT5rBksx1QdIhlFOCtgZkB99ZEouFZ1E2Kc2LHqNW13U3/74YGdkQRmThTwxy4QIyookibDKYZOPqX//6BlAg==", + "dev": true, + "dependencies": { + "execa": "^5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/run-applescript/node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/run-applescript/node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/run-applescript/node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, + "engines": { + "node": ">=10.17.0" + } + }, + "node_modules/run-applescript/node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/run-applescript/node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/run-applescript/node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/run-applescript/node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/run-applescript/node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/run-async": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", @@ -25881,7 +21959,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, "funding": [ { "type": "github", @@ -25909,16 +21986,30 @@ } }, "node_modules/safe-buffer": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "node_modules/safe-json-parse": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/safe-json-parse/-/safe-json-parse-1.0.1.tgz", - "integrity": "sha1-PnZyPjjf3aE8mx0poeB//uSzC1c=", + "integrity": "sha512-o0JmTu17WGUaUOHa1l0FPGXKBfijbxK6qoHzlkihsDXxzBHvJcA7zgviKR92Xs841rX9pK16unfphLq0/KqX7A==", "dev": true }, + "node_modules/safe-regex-test": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", + "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "is-regex": "^1.1.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -25985,17 +22076,18 @@ "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, "node_modules/schema-utils": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.2.0.tgz", - "integrity": "sha512-0zTyLGyDJYd/MBxG1AhJkKa6fpEBds4OQO2ut0w7OYG+ZGhGea09lijvzsqegYSik88zc7cUtIlnnO+/BvD6gQ==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz", + "integrity": "sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==", "dev": true, "dependencies": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" + "@types/json-schema": "^7.0.9", + "ajv": "^8.9.0", + "ajv-formats": "^2.1.1", + "ajv-keywords": "^5.1.0" }, "engines": { - "node": ">= 10.13.0" + "node": ">= 12.13.0" }, "funding": { "type": "opencollective", @@ -26005,7 +22097,7 @@ "node_modules/secure-compare": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/secure-compare/-/secure-compare-3.0.1.tgz", - "integrity": "sha1-8aAymzCLIh+uN7mXTz1XjQypmeM=", + "integrity": "sha512-AckIIV90rPDcBcglUwXPF3kg0P0qmPsPXAj6BBEENQE1p5yA1xfmDJzfi1Tappj37Pv2mVbKpL3Z1T+Nn7k1Qw==", "dev": true }, "node_modules/select-hose": { @@ -26015,9 +22107,9 @@ "dev": true }, "node_modules/select2": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/select2/-/select2-4.0.8.tgz", - "integrity": "sha512-H/I2mq71oiEe51S74hdUv4QubH1EJNLEMnjfQucftLa8GiuT5+RKIHwlV/7I/YUqZg0wsYQM946eFG/ntRPF/Q==" + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/select2/-/select2-4.0.13.tgz", + "integrity": "sha512-1JeB87s6oN/TDxQQYCvS5EFoQyvV6eYMZZ0AeA4tdFDYWN3BAGZ8npr17UBFddU0lgAt3H0yjX3X6/ekOj1yjw==" }, "node_modules/selfsigned": { "version": "2.1.1", @@ -26032,12 +22124,17 @@ } }, "node_modules/semver": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", - "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", - "dev": true, + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "dependencies": { + "lru-cache": "^6.0.0" + }, "bin": { - "semver": "bin/semver" + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" } }, "node_modules/semver-diff": { @@ -26055,11 +22152,10 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/semver-diff/node_modules/lru-cache": { + "node_modules/semver/node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, "dependencies": { "yallist": "^4.0.0" }, @@ -26067,26 +22163,10 @@ "node": ">=10" } }, - "node_modules/semver-diff/node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/semver-diff/node_modules/yallist": { + "node_modules/semver/node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/send": { "version": "0.18.0", @@ -26112,6 +22192,21 @@ "node": ">= 0.8.0" } }, + "node_modules/send/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/send/node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, "node_modules/send/node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -26145,6 +22240,15 @@ "node": ">= 0.8.0" } }, + "node_modules/serve-index/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, "node_modules/serve-index/node_modules/depd": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", @@ -26169,6 +22273,18 @@ "node": ">= 0.6" } }, + "node_modules/serve-index/node_modules/inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==", + "dev": true + }, + "node_modules/serve-index/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, "node_modules/serve-index/node_modules/setprototypeof": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", @@ -26202,7 +22318,7 @@ "node_modules/set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", "dev": true }, "node_modules/setimmediate": { @@ -26240,15 +22356,6 @@ "node": ">=8" } }, - "node_modules/shallow-clone/node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/shasum-object": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/shasum-object/-/shasum-object-1.0.0.tgz", @@ -26279,20 +22386,40 @@ } }, "node_modules/shell-quote": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.3.tgz", - "integrity": "sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw==" + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", + "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/shelljs": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.3.0.tgz", - "integrity": "sha512-Ny0KN4dyT8ZSCE0frtcbAJGoM/HTArpyPkeli1/00aYfm0sbD/Gk/4x7N2DP9QKGpBsiQH7n6rpm1L79RtviEQ==", + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", + "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", "dev": true, + "dependencies": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + }, "bin": { "shjs": "bin/shjs" }, "engines": { - "node": ">=0.8.0" + "node": ">=4" + } + }, + "node_modules/shelljs/node_modules/rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", + "dev": true, + "dependencies": { + "resolve": "^1.1.6" + }, + "engines": { + "node": ">= 0.10" } }, "node_modules/shp-write": { @@ -26312,6 +22439,11 @@ "pako": "~0.2.5" } }, + "node_modules/shp-write/node_modules/pako": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", + "integrity": "sha512-NUcwaKxUxWrZLpDG+z/xZaCgQITkA/Dv4V/T6bw7VON6l1Xz/VnrBqrYjZQ12TamKHzITTfOEIYUj48y2KXImA==" + }, "node_modules/shpjs": { "version": "3.6.3", "resolved": "https://registry.npmjs.org/shpjs/-/shpjs-3.6.3.tgz", @@ -26335,18 +22467,12 @@ "node_modules/shpjs/node_modules/lru-cache": { "version": "2.7.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", - "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=" - }, - "node_modules/shpjs/node_modules/pako": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==" + "integrity": "sha512-WpibWJ60c3AgAz8a2iYErDrcT2C7OmKnsWhIcHOjkUHFjkXncJhtLxNSqUmxRxRunpb5I8Vprd7aNSd2NtksJQ==" }, "node_modules/side-channel": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", - "dev": true, "dependencies": { "call-bind": "^1.0.0", "get-intrinsic": "^1.0.2", @@ -26356,32 +22482,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/side-channel/node_modules/get-intrinsic": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", - "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel/node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", @@ -26406,14 +22506,28 @@ } }, "node_modules/simple-concat": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.0.tgz", - "integrity": "sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY=" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, "node_modules/simple-is": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/simple-is/-/simple-is-0.2.0.tgz", - "integrity": "sha1-Krt1qt453rXMgVzhDmGRFkhQuvA=", + "integrity": "sha512-GJXhv3r5vdj5tGWO+rcrWgjU2azLB+fb7Ehh3SmZpXE0o4KrrFLti0w4mdDCbR29X/z0Ls20ApjZitlpAXhAeg==", "dev": true }, "node_modules/skmeans": { @@ -26422,18 +22536,18 @@ "integrity": "sha512-hNj1/oZ7ygsfmPZ7ZfN5MUBRoGg1gtpnImuJBgLO0ljQ67DtJuiQaiYdS4lUA6s0KCwnPhGivtC/WRwIZLkHyg==" }, "node_modules/slash": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", - "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=6" } }, "node_modules/slide": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", - "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=", + "integrity": "sha512-NwrtjCg+lZoqhFU8fOwl4ay2ei8PaqCBOUV3/ektPY9trO1yQ1oXEfmHAhKArUVUr/hOHvy5f6AdP17dCM0zMw==", "dev": true, "engines": { "node": "*" @@ -26442,7 +22556,7 @@ "node_modules/slimscroll": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/slimscroll/-/slimscroll-0.9.1.tgz", - "integrity": "sha1-9nXNxgHYCtog8WAE0ifRVv0Rh7I=", + "integrity": "sha512-3j8F/QCsJpuhPE1yZte3876WIYZ0WfhhzYLS1464hq4mSdQ9kQ4fcDXjLz2/vhwNv7Y9pKX+GzX3udTHKpR9Pw==", "dependencies": { "browserify": ">=3.46.0", "classie": ">=0.0.1", @@ -26486,10 +22600,19 @@ "node": ">=0.8.0" } }, + "node_modules/sockjs/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/socks": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.0.tgz", - "integrity": "sha512-scnOe9y4VuiNUULJN72GrM26BNOjVsfPXI+j+98PkyEfsIXroa5ofyjT+FzGvn/xHs73U2JtoBYAVx9Hl4quSA==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", + "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", "dev": true, "dependencies": { "ip": "^2.0.0", @@ -26501,54 +22624,19 @@ } }, "node_modules/socks-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-5.0.1.tgz", - "integrity": "sha512-vZdmnjb9a2Tz6WEQVIurybSwElwPxMZaIc7PzqbJTrezcKNznv6giT7J7tZDZ1BojVaa1jvO/UiUdhDVB0ACoQ==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-7.0.0.tgz", + "integrity": "sha512-Fgl0YPZ902wEsAyiQ+idGd1A7rSFx/ayC1CQVMw5P+EQx2V0SgpGtf6OKFhVjPflPUl9YMmEOnmfjCdMUsygww==", "dev": true, "dependencies": { "agent-base": "^6.0.2", - "debug": "4", - "socks": "^2.3.3" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/socks-proxy-agent/node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "dev": true, - "dependencies": { - "debug": "4" - }, - "engines": { - "node": ">= 6.0.0" - } - }, - "node_modules/socks-proxy-agent/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" + "debug": "^4.3.3", + "socks": "^2.6.2" }, "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "node": ">= 10" } }, - "node_modules/socks-proxy-agent/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "node_modules/socks/node_modules/ip": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", @@ -26556,16 +22644,17 @@ "dev": true }, "node_modules/sortablejs": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.13.0.tgz", - "integrity": "sha512-RBJirPY0spWCrU5yCmWM1eFs/XgX2J5c6b275/YyxFRgnzPhKl/TDeU2hNR8Dt7ITq66NRPM4UlOt+e5O4CFHg==" + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.15.0.tgz", + "integrity": "sha512-bv9qgVMjUMf89wAvM6AxVvS/4MX3sPeN0+agqShejLU5z5GX4C75ow1O2e5k4L6XItUyAK3gH6AxSbXrOM5e8w==" }, "node_modules/source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", + "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", + "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">= 8" } }, "node_modules/source-map-js": { @@ -26598,18 +22687,6 @@ "webpack": "^5.72.1" } }, - "node_modules/source-map-loader/node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dev": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/source-map-support": { "version": "0.5.21", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", @@ -26643,18 +22720,6 @@ "which": "^1.3.0" } }, - "node_modules/spawn-wrap/node_modules/rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - } - }, "node_modules/spawn-wrap/node_modules/which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", @@ -26689,9 +22754,9 @@ } }, "node_modules/spdx-exceptions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", - "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", "dev": true }, "node_modules/spdx-expression-parse": { @@ -26710,159 +22775,72 @@ "integrity": "sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w==", "dev": true }, - "node_modules/spdx-ranges": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/spdx-ranges/-/spdx-ranges-2.1.0.tgz", - "integrity": "sha512-OOWghvosfmECc9edy/A9j7GabERmn8bJWHc0J1knVytQtO5Rw7VfxK6CDqmivJhfMJqWhWWUfffNNMPYvyvyQA==", - "dev": true - }, - "node_modules/spdx-satisfies": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/spdx-satisfies/-/spdx-satisfies-4.0.1.tgz", - "integrity": "sha512-WVzZ/cXAzoNmjCWiEluEA3BjHp5tiUmmhn9MK+X0tBbR9sOqtC6UQwmgCNrAIZvNlMuBUYAaHYfb2oqlF9SwKA==", - "dev": true, - "dependencies": { - "spdx-compare": "^1.0.0", - "spdx-expression-parse": "^3.0.0", - "spdx-ranges": "^2.0.0" - } - }, - "node_modules/spdy": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/spdy/-/spdy-4.0.2.tgz", - "integrity": "sha512-r46gZQZQV+Kl9oItvl1JZZqJKGr+oEkB08A6BzkiR7593/7IbtuncXHd2YoYeTsG4157ZssMu9KYvUHLcjcDoA==", - "dev": true, - "dependencies": { - "debug": "^4.1.0", - "handle-thing": "^2.0.0", - "http-deceiver": "^1.2.7", - "select-hose": "^2.0.0", - "spdy-transport": "^3.0.0" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/spdy-transport": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdy-transport/-/spdy-transport-3.0.0.tgz", - "integrity": "sha512-hsLVFE5SjA6TCisWeJXFKniGGOpBgMLmerfO2aCyCU5s7nJ/rpAepqmFifv/GCbSbueEeAJJnmSQ2rKC/g8Fcw==", - "dev": true, - "dependencies": { - "debug": "^4.1.0", - "detect-node": "^2.0.4", - "hpack.js": "^2.1.6", - "obuf": "^1.1.2", - "readable-stream": "^3.0.6", - "wbuf": "^1.7.3" - } - }, - "node_modules/spdy-transport/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/spdy-transport/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/spdy-transport/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/spdy-transport/node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/spdy-transport/node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "node_modules/spdx-ranges": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/spdx-ranges/-/spdx-ranges-2.1.1.tgz", + "integrity": "sha512-mcdpQFV7UDAgLpXEE/jOMqvK4LBoO0uTQg0uvXUewmEFhpiZx5yJSZITHB8w1ZahKdhfZqP5GPEOKLyEq5p8XA==", + "dev": true + }, + "node_modules/spdx-satisfies": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/spdx-satisfies/-/spdx-satisfies-4.0.1.tgz", + "integrity": "sha512-WVzZ/cXAzoNmjCWiEluEA3BjHp5tiUmmhn9MK+X0tBbR9sOqtC6UQwmgCNrAIZvNlMuBUYAaHYfb2oqlF9SwKA==", "dev": true, "dependencies": { - "safe-buffer": "~5.2.0" + "spdx-compare": "^1.0.0", + "spdx-expression-parse": "^3.0.0", + "spdx-ranges": "^2.0.0" } }, - "node_modules/spdy/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "node_modules/spdy": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/spdy/-/spdy-4.0.2.tgz", + "integrity": "sha512-r46gZQZQV+Kl9oItvl1JZZqJKGr+oEkB08A6BzkiR7593/7IbtuncXHd2YoYeTsG4157ZssMu9KYvUHLcjcDoA==", "dev": true, "dependencies": { - "ms": "2.1.2" + "debug": "^4.1.0", + "handle-thing": "^2.0.0", + "http-deceiver": "^1.2.7", + "select-hose": "^2.0.0", + "spdy-transport": "^3.0.0" }, "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "node": ">=6.0.0" } }, - "node_modules/spdy/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "node_modules/spdy-transport": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdy-transport/-/spdy-transport-3.0.0.tgz", + "integrity": "sha512-hsLVFE5SjA6TCisWeJXFKniGGOpBgMLmerfO2aCyCU5s7nJ/rpAepqmFifv/GCbSbueEeAJJnmSQ2rKC/g8Fcw==", + "dev": true, + "dependencies": { + "debug": "^4.1.0", + "detect-node": "^2.0.4", + "hpack.js": "^2.1.6", + "obuf": "^1.1.2", + "readable-stream": "^3.0.6", + "wbuf": "^1.7.3" + } }, "node_modules/splaytree": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/splaytree/-/splaytree-3.1.1.tgz", - "integrity": "sha512-9FaQ18FF0+sZc/ieEeXHt+Jw2eSpUgUtTLDYB/HXKWvhYVyOc7h1hzkn5MMO3GPib9MmXG1go8+OsBBzs/NMww==" + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/splaytree/-/splaytree-3.1.2.tgz", + "integrity": "sha512-4OM2BJgC5UzrhVnnJA4BkHKGtjXNzzUfpQjCO8I05xYPsfS/VuQDwjCGGMi8rYQilHEV4j8NBqTFbls/PZEE7A==" }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", "dev": true }, "node_modules/ssf": { - "version": "0.10.2", - "resolved": "https://registry.npmjs.org/ssf/-/ssf-0.10.2.tgz", - "integrity": "sha512-rDhAPm9WyIsY8eZEKyE8Qsotb3j/wBdvMWBUsOhJdfhKGLfQidRjiBUV0y/MkyCLiXQ38FG6LWW/VYUtqlIDZQ==", + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/ssf/-/ssf-0.8.2.tgz", + "integrity": "sha512-+ZkFDAG+ImJ48DcZvabx6YTrZ67DKkM0kbyOOtH73mbUEvNhQWWgRZrHC8+k7GuGKWQnACYLi7bj0eCt1jmosQ==", "dependencies": { - "frac": "~1.1.2" + "colors": "0.6.2", + "frac": "0.3.1", + "voc": "" }, "bin": { "ssf": "bin/ssf.njs" @@ -26871,10 +22849,18 @@ "node": ">=0.8" } }, + "node_modules/ssf/node_modules/colors": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz", + "integrity": "sha512-OsSVtHK8Ir8r3+Fxw/b4jS1ZLPXkV6ZxDRJQzeD7qo0SqMXWrHDM71DgYzPMHY8SFJ0Ao+nNU2p1MmwdzKqPrw==", + "engines": { + "node": ">=0.1.90" + } + }, "node_modules/sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", + "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", "dev": true, "dependencies": { "asn1": "~0.2.3", @@ -26908,19 +22894,10 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/ssri/node_modules/minipass": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", - "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/stack-utils": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.4.tgz", - "integrity": "sha512-IPDJfugEGbfizBwBZRZ3xpccMdRyP5lqsBWXGQWimVjua/ccLCeMOAVjlc1R7LxFjo5sEDhyNIXd8mo/AiDS9w==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.5.tgz", + "integrity": "sha512-KZiTzuV3CnSnSvgMRrARVCj+Ht7rMbauGDK0LdVFRGyenwdylpajAp4Q0i6SX8rEmbTpMMf6ryq2gb8pPq2WgQ==", "dev": true, "dependencies": { "escape-string-regexp": "^2.0.0" @@ -26939,10 +22916,13 @@ } }, "node_modules/stackblur-canvas": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/stackblur-canvas/-/stackblur-canvas-2.2.0.tgz", - "integrity": "sha512-5Gf8dtlf8k6NbLzuly2NkGrkS/Ahh+I5VUjO7TnFizdJtgpfpLLEdQlLe9umbcnZlitU84kfYjXE67xlSXfhfQ==", - "optional": true + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/stackblur-canvas/-/stackblur-canvas-2.6.0.tgz", + "integrity": "sha512-8S1aIA+UoF6erJYnglGPug6MaHYGo1Ot7h5fuXx4fUPvcvQfcdw2o/ppCse63+eZf8PPidSu4v1JnmEVtEDnpg==", + "optional": true, + "engines": { + "node": ">=0.1.14" + } }, "node_modules/statuses": { "version": "2.0.1", @@ -26953,15 +22933,124 @@ "node": ">= 0.8" } }, + "node_modules/stdin-discarder": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.1.0.tgz", + "integrity": "sha512-xhV7w8S+bUwlPTb4bAOUQhv8/cSS5offJuX8GQGq32ONF0ZtDWKfkdomM3HMRA+LhX6um/FZ0COqlwsjD53LeQ==", + "dev": true, + "dependencies": { + "bl": "^5.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/stdin-discarder/node_modules/bl": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-5.1.0.tgz", + "integrity": "sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==", + "dev": true, + "dependencies": { + "buffer": "^6.0.3", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/stdin-discarder/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/stop-iteration-iterator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz", + "integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==", + "dev": true, + "dependencies": { + "internal-slot": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/stream-browserify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-3.0.0.tgz", + "integrity": "sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA==", + "dependencies": { + "inherits": "~2.0.4", + "readable-stream": "^3.5.0" + } + }, "node_modules/stream-combiner2": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", - "integrity": "sha1-+02KFCDqNidk4hrUeAOXvry0HL4=", + "integrity": "sha512-3PnJbYgS56AeWgtKF5jtJRT6uFJe56Z0Hc5Ngg/6sI6rIt8iiMBTa9cvdyFfpMQjaVHr8dusbNeFGIIonxOvKw==", "dependencies": { "duplexer2": "~0.1.0", "readable-stream": "^2.0.2" } }, + "node_modules/stream-combiner2/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, + "node_modules/stream-combiner2/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/stream-combiner2/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/stream-http": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-3.2.0.tgz", + "integrity": "sha512-Oq1bLqisTyK3TSCXpPbT4sdeYNdmyZJv1LxpEm2vu1ZhK89kSE5YXwZc3cWk0MagGaKriBh9mCFbVGtO+vY29A==", + "dependencies": { + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "xtend": "^4.0.2" + } + }, "node_modules/stream-splicer": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-2.0.1.tgz", @@ -26971,140 +23060,148 @@ "readable-stream": "^2.0.2" } }, - "node_modules/string_decoder": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "node_modules/stream-splicer/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, + "node_modules/stream-splicer/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "dependencies": { - "safe-buffer": "~5.1.0" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } }, - "node_modules/string-template": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/string-template/-/string-template-0.2.1.tgz", - "integrity": "sha1-QpMuWYo1LQH8IuwzZ9nYTuxsmt0=", - "dev": true - }, - "node_modules/string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, + "node_modules/stream-splicer/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dependencies": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - }, - "engines": { - "node": ">=6" + "safe-buffer": "~5.1.0" } }, - "node_modules/string-width-cjs": { - "name": "string-width", - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" + "safe-buffer": "~5.2.0" } }, - "node_modules/string-width-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } + "node_modules/string_decoder/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, - "node_modules/string-width-cjs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "node_modules/string-template": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/string-template/-/string-template-1.0.0.tgz", + "integrity": "sha512-SLqR3GBUXuoPP5MmYtD7ompvXiG87QjT6lzOszyXjTM86Uu7At7vNnt2xgyTLq5o9T4IxTYFyGxcULqpsmsfdg==", "dev": true }, - "node_modules/string-width-cjs/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/string-width-cjs/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dependencies": { - "ansi-regex": "^5.0.1" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" }, "engines": { "node": ">=8" } }, - "node_modules/string-width/node_modules/ansi-regex": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, "engines": { - "node": ">=6" + "node": ">=8" } }, - "node_modules/string-width/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "node_modules/string.prototype.trim": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz", + "integrity": "sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==", "dev": true, "dependencies": { - "ansi-regex": "^4.1.0" + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" }, "engines": { - "node": ">=6" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trimend": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.3.tgz", - "integrity": "sha512-ayH0pB+uf0U28CtjlLvL7NaohvR1amUvVZk+y3DYb0Ey2PUV5zPkkKy9+U1ndVEIXO8hNg18eIv9Jntbii+dKw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz", + "integrity": "sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==", + "dev": true, "dependencies": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3" + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trimstart": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.3.tgz", - "integrity": "sha512-oBIBUy5lea5tt0ovtOFiEQaBkoBBkyJhZXzJYrSmDo5IUUqbOPvVezuRs/agBIdZ2p2Eo1FD6bD9USyBLfl3xg==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz", + "integrity": "sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==", + "dev": true, "dependencies": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3" + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dependencies": { - "ansi-regex": "^2.0.0" + "ansi-regex": "^5.0.1" }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/strip-ansi-cjs": { @@ -27120,40 +23217,31 @@ "node": ">=8" } }, - "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "dev": true, - "dependencies": { - "is-utf8": "^0.2.0" - }, "engines": { - "node": ">=0.10.0" + "node": ">=4" } }, "node_modules/strip-final-newline": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", "dev": true, "engines": { - "node": ">=6" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/strip-indent": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", - "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", + "integrity": "sha512-I5iQq6aFMM62fBEAIB/hXzwJD6EEZ0xEGCX2t7oXqaKPIRgt4WruAQ285BISgdkP+HLGWyeGmNJcpIwFeRYRUA==", "dev": true, "dependencies": { "get-stdin": "^4.0.1" @@ -27168,7 +23256,7 @@ "node_modules/strip-json-comments": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz", - "integrity": "sha1-HhX7ysl9Pumb8tc7TGVrCCu6+5E=", + "integrity": "sha512-AOPG8EBc5wAikaG1/7uFCNFJwnKOuQwFTpYBdTW6OvWHeZBQBrAA/amefHGrEiOnCPcLFZK6FUPtWVKpQVIRgg==", "bin": { "strip-json-comments": "cli.js" }, @@ -27179,25 +23267,26 @@ "node_modules/subarg": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", - "integrity": "sha1-9izxdYHplrSPyWVpn1TAauJouNI=", + "integrity": "sha512-RIrIdRY0X1xojthNcVtgT9sjpOGagEUKpZdgBUi054OEPFo282yg+zE+t1Rj3+RqKq2xStL7uUHhY+AjbC4BXg==", "dependencies": { "minimist": "^1.1.0" } }, "node_modules/supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true, + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, "engines": { - "node": ">=0.8.0" + "node": ">=4" } }, "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -27315,6 +23404,54 @@ "readable-stream": "^2.1.5" } }, + "node_modules/tap-mocha-reporter/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/tap-mocha-reporter/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true, + "optional": true + }, + "node_modules/tap-mocha-reporter/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "node_modules/tap-mocha-reporter/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "optional": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/tap-mocha-reporter/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "optional": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, "node_modules/tap-mocha-reporter/node_modules/tap-parser": { "version": "5.4.0", "resolved": "https://registry.npmjs.org/tap-parser/-/tap-parser-5.4.0.tgz", @@ -27345,25 +23482,24 @@ "tap-parser": "bin/cmd.js" } }, - "node_modules/tap/node_modules/os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "node_modules/tap-parser/node_modules/minipass": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", + "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", "dev": true, - "engines": { - "node": ">=0.10.0" + "dependencies": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" } }, - "node_modules/tap/node_modules/rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "node_modules/tap/node_modules/minipass": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", + "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", "dev": true, "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" } }, "node_modules/tap/node_modules/typescript": { @@ -27417,91 +23553,13 @@ "tar-stream": "^2.1.4" } }, - "node_modules/tar-fs/node_modules/bl": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", - "dev": true, - "dependencies": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } - }, - "node_modules/tar-fs/node_modules/bl/node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "node_modules/tar-fs/node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", "dev": true }, - "node_modules/tar-fs/node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "node_modules/tar-fs/node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/tar-fs/node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/tar-fs/node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/tar-fs/node_modules/tar-stream": { + "node_modules/tar-stream": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", @@ -27517,30 +23575,6 @@ "node": ">=6" } }, - "node_modules/tar-stream": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.5.5.tgz", - "integrity": "sha512-mQdgLPc/Vjfr3VWqWbfxW8yQNiJCbAZ+Gf6GDu1Cy0bdb33ofyiNGBtAY96jHFhDuivCwgW1H9DgTON+INiXgg==", - "dev": true, - "dependencies": { - "bl": "^1.0.0", - "end-of-stream": "^1.0.0", - "readable-stream": "^2.0.0", - "xtend": "^4.0.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/tar/node_modules/chownr": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", - "dev": true, - "engines": { - "node": ">=10" - } - }, "node_modules/tar/node_modules/fs-minipass": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", @@ -27565,15 +23599,6 @@ "node": ">=8" } }, - "node_modules/tar/node_modules/minipass": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", - "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/tar/node_modules/mkdirp": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", @@ -27593,9 +23618,9 @@ "dev": true }, "node_modules/terser": { - "version": "5.18.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.18.0.tgz", - "integrity": "sha512-pdL757Ig5a0I+owA42l6tIuEycRuM7FPY4n62h44mRLRfnOxJkkOHd6i89dOpwZlpF6JXBwaAHF6yWzFrt+QyA==", + "version": "5.17.7", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.17.7.tgz", + "integrity": "sha512-/bi0Zm2C6VAexlGgLlVxA0P2lru/sdLyfCVaRMfKVo9nWxbmz7f/sD8VPybPeSUJaJcwmCJis9pBIhcVcG1QcQ==", "dev": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", @@ -27644,125 +23669,94 @@ } } }, - "node_modules/terser-webpack-plugin/node_modules/serialize-javascript": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz", - "integrity": "sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==", - "dev": true, - "dependencies": { - "randombytes": "^2.1.0" - } - }, - "node_modules/test-exclude": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-5.2.3.tgz", - "integrity": "sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g==", + "node_modules/terser-webpack-plugin/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, "dependencies": { - "glob": "^7.1.3", - "minimatch": "^3.0.4", - "read-pkg-up": "^4.0.0", - "require-main-filename": "^2.0.0" + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" }, - "engines": { - "node": ">=6" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/test-exclude/node_modules/find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "node_modules/terser-webpack-plugin/node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", "dev": true, - "dependencies": { - "locate-path": "^3.0.0" - }, - "engines": { - "node": ">=6" + "peerDependencies": { + "ajv": "^6.9.1" } }, - "node_modules/test-exclude/node_modules/load-json-file": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "parse-json": "^4.0.0", - "pify": "^3.0.0", - "strip-bom": "^3.0.0" - }, - "engines": { - "node": ">=4" - } + "node_modules/terser-webpack-plugin/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true }, - "node_modules/test-exclude/node_modules/parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "node_modules/terser-webpack-plugin/node_modules/schema-utils": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", "dev": true, "dependencies": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" }, "engines": { - "node": ">=4" - } - }, - "node_modules/test-exclude/node_modules/path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "dev": true, - "dependencies": { - "pify": "^3.0.0" + "node": ">= 10.13.0" }, - "engines": { - "node": ">=4" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" } }, - "node_modules/test-exclude/node_modules/pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "node_modules/terser-webpack-plugin/node_modules/serialize-javascript": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz", + "integrity": "sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==", "dev": true, - "engines": { - "node": ">=4" + "dependencies": { + "randombytes": "^2.1.0" } }, - "node_modules/test-exclude/node_modules/read-pkg": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", - "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "node_modules/terser/node_modules/acorn": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", "dev": true, - "dependencies": { - "load-json-file": "^4.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^3.0.0" + "bin": { + "acorn": "bin/acorn" }, "engines": { - "node": ">=4" + "node": ">=0.4.0" } }, - "node_modules/test-exclude/node_modules/read-pkg-up": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-4.0.0.tgz", - "integrity": "sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA==", + "node_modules/terser/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", "dev": true, "dependencies": { - "find-up": "^3.0.0", - "read-pkg": "^3.0.0" + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" }, "engines": { - "node": ">=6" - } - }, - "node_modules/test-exclude/node_modules/strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true, - "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/text-encoding-polyfill": { @@ -27787,7 +23781,7 @@ "node_modules/through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" }, "node_modules/through2": { "version": "2.0.5", @@ -27798,10 +23792,15 @@ "xtend": "~4.0.1" } }, + "node_modules/through2/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, "node_modules/through2/node_modules/readable-stream": { - "version": "2.3.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -27814,7 +23813,7 @@ }, "node_modules/through2/node_modules/string_decoder": { "version": "1.1.1", - "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dependencies": { "safe-buffer": "~5.1.0" @@ -27826,6 +23825,17 @@ "integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==", "dev": true }, + "node_modules/timers-browserify": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", + "integrity": "sha512-PIxwAupJZiYU4JmVZYwXp9FKsHMXb5h0ZEFyuXTAn8WLHOlcij+FEcbrvDsom1o5dr1YggEtFbECvGCW2sT53Q==", + "dependencies": { + "process": "~0.11.0" + }, + "engines": { + "node": ">=0.6.0" + } + }, "node_modules/tiny-lr": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/tiny-lr/-/tiny-lr-1.1.1.tgz", @@ -27849,29 +23859,23 @@ "ms": "^2.1.1" } }, - "node_modules/tiny-lr/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true + "node_modules/tinyqueue": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-2.0.3.tgz", + "integrity": "sha512-ppJZNDuKGgxzkHihX8v9v9G5f+18gzaTfrukGrq6ueg0lmH4nqVnA2IPG0AEH3jKEk2GRJCUhDoqpoiw3PHLBA==" }, - "node_modules/tiny-lr/node_modules/qs": { - "version": "6.9.4", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz", - "integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==", + "node_modules/titleize": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/titleize/-/titleize-3.0.0.tgz", + "integrity": "sha512-KxVu8EYHDPBdUYdKZdKtU2aj2XfEx9AfjXxE/Aj0vT06w2icA09Vus1rh6eSu1y01akYg6BjIK/hxyLJINoMLQ==", "dev": true, "engines": { - "node": ">=0.6" + "node": ">=12" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/tinyqueue": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-2.0.3.tgz", - "integrity": "sha512-ppJZNDuKGgxzkHihX8v9v9G5f+18gzaTfrukGrq6ueg0lmH4nqVnA2IPG0AEH3jKEk2GRJCUhDoqpoiw3PHLBA==" - }, "node_modules/tmatch": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/tmatch/-/tmatch-4.0.0.tgz", @@ -27891,19 +23895,17 @@ } }, "node_modules/to-fast-properties": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", - "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", - "dev": true, + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", "engines": { - "node": ">=0.10.0" + "node": ">=4" } }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, "dependencies": { "is-number": "^7.0.0" }, @@ -27933,6 +23935,11 @@ "topoquantize": "bin/topoquantize" } }, + "node_modules/topojson-client/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + }, "node_modules/topojson-server": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/topojson-server/-/topojson-server-3.0.1.tgz", @@ -27944,6 +23951,11 @@ "geo2topo": "bin/geo2topo" } }, + "node_modules/topojson-server/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + }, "node_modules/tough-cookie": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", @@ -27958,9 +23970,9 @@ } }, "node_modules/tough-cookie/node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", "dev": true, "engines": { "node": ">=6" @@ -28002,17 +24014,20 @@ "node_modules/trim-right": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", - "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", + "integrity": "sha512-WZGXGstmCWgeevgTL54hrCuw1dyMQIzWy7ZfqRJfSmJZBwklI15egmQytFP6bPidmw3M8d5yEowl1niq4vmqZw==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/trivial-deferred": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/trivial-deferred/-/trivial-deferred-1.0.1.tgz", - "integrity": "sha1-N21NKdlR1jaKb3oK6FwvTV4GWPM=", - "dev": true + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/trivial-deferred/-/trivial-deferred-1.1.2.tgz", + "integrity": "sha512-vDPiDBC3hyP6O4JrJYMImW3nl3c03Tsj9fEXc7Qc/XKa1O7gf5ZtFfIR/E0dun9SnDHdwjna1Z2rSzYgqpxh/g==", + "dev": true, + "engines": { + "node": ">= 8" + } }, "node_modules/ts-node": { "version": "8.10.2", @@ -28059,6 +24074,11 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.0.tgz", "integrity": "sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA==" }, + "node_modules/tty-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", + "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==" + }, "node_modules/tuf-js": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/tuf-js/-/tuf-js-1.1.7.tgz", @@ -28073,33 +24093,10 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/tuf-js/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/tuf-js/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "node_modules/tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", "dev": true, "dependencies": { "safe-buffer": "^5.0.1" @@ -28116,7 +24113,7 @@ "node_modules/tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", "dev": true }, "node_modules/type-check": { @@ -28132,9 +24129,9 @@ } }, "node_modules/type-fest": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", - "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", "dev": true, "engines": { "node": ">=10" @@ -28156,6 +24153,39 @@ "node": ">= 0.6" } }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz", + "integrity": "sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", + "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "is-typed-array": "^1.1.9" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/typed-assert": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/typed-assert/-/typed-assert-1.0.9.tgz", @@ -28165,7 +24195,7 @@ "node_modules/typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" }, "node_modules/typedarray-to-buffer": { "version": "3.1.5", @@ -28180,19 +24210,50 @@ "version": "5.1.6", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/uglify-es": { + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/uglify-es/-/uglify-es-3.3.9.tgz", + "integrity": "sha512-r+MU0rfv4L/0eeW3xZrd16t4NZfK8Ld4SWVglYBb7ez5uXFWHuVRs6xCTrf1yirs9a4j4Y27nn7SRfO6v67XsQ==", + "deprecated": "support for ECMAScript is superseded by `uglify-js` as of v3.13.0", "dev": true, + "dependencies": { + "commander": "~2.13.0", + "source-map": "~0.6.1" + }, "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" + "uglifyjs": "bin/uglifyjs" }, "engines": { - "node": ">=14.17" + "node": ">=0.8.0" + } + }, + "node_modules/uglify-es/node_modules/commander": { + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.13.0.tgz", + "integrity": "sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==", + "dev": true + }, + "node_modules/uglify-es/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" } }, "node_modules/uglify-js": { "version": "2.6.4", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.6.4.tgz", - "integrity": "sha1-ZeovswWck5RpLxX+2HwrNsFrmt8=", + "integrity": "sha512-5uPOZS1EDeuBIFwTYTlJefbQXWn+auebcRQpj5EtWr9E/7XwWVZ6YTgulZVSTHAEU9y/mYMYh2Mjt7TJ1iRNxQ==", "dev": true, "dependencies": { "async": "~0.2.6", @@ -28210,19 +24271,60 @@ "node_modules/uglify-js/node_modules/async": { "version": "0.2.10", "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", - "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=", + "integrity": "sha512-eAkdoKxU6/LkKDBzLpT+t6Ff5EtfSF4wx1WfJiPEEV7WNLnDaRXk0oVysiEPm262roaachGexwUv94WhSgN5TQ==", "dev": true }, + "node_modules/uglify-js/node_modules/camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha512-wzLkDa4K/mzI1OSITC+DUyjgIl/ETNHE9QvYgy6J6Jvqyyz4C0Xfd+lQhb19sX2jMpZV4IssUn0VDVmglV+s4g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/uglify-js/node_modules/cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha512-GIOYRizG+TGoc7Wgc1LiOTLare95R3mzKgoln+Q/lE4ceiYH19gUpl0l0Ffq4lJDEf3FxujMe6IBfOCs7pfqNA==", + "dev": true, + "dependencies": { + "center-align": "^0.1.1", + "right-align": "^0.1.1", + "wordwrap": "0.0.2" + } + }, + "node_modules/uglify-js/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/uglify-js/node_modules/yargs": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha512-QFzUah88GAGy9lyDKGBqZdkYApt63rCXYBGYnEP4xDJPXNqXXnBDACnbrXnViV6jRSqAePwrATi2i8mfYm4L1A==", + "dev": true, + "dependencies": { + "camelcase": "^1.0.2", + "cliui": "^2.1.0", + "decamelize": "^1.0.0", + "window-size": "0.1.0" + } + }, "node_modules/uglify-to-browserify": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", - "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "integrity": "sha512-vb2s1lYx2xBtUgy+ta+b2J/GLVUR+wmpINwHePmPRhOsIVCG2wDzKJ0n14GslH1BifsqVzSOwQhRaCAsZ/nI4Q==", "dev": true }, "node_modules/ui-select": { "version": "0.19.8", "resolved": "https://registry.npmjs.org/ui-select/-/ui-select-0.19.8.tgz", - "integrity": "sha1-dIYISKf9i8SU2YVtL2J3bqmGN8E=" + "integrity": "sha512-NSHm75s46oGph4BWUSQ4mgAGdZs0/YTP5nNo0efuwHBCPtTlye8zLSSxi3P5r1jI/BD9bJ8ODXyYWPoJZTRImQ==" }, "node_modules/umd": { "version": "3.0.3", @@ -28247,45 +24349,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/unbox-primitive/node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/unbox-primitive/node_modules/get-intrinsic": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", - "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/unbox-primitive/node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/unbzip2-stream": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz", @@ -28296,30 +24359,6 @@ "through": "^2.3.8" } }, - "node_modules/unbzip2-stream/node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, "node_modules/unc-path-regex": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", @@ -28380,13 +24419,34 @@ "node_modules/unicode-length": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/unicode-length/-/unicode-length-1.0.3.tgz", - "integrity": "sha1-Wtp6f+1RhBpBijKM8UlHisg1irs=", + "integrity": "sha512-rZKNhIqioUp7H49afr26tivLDCvUSqOXwmwEEnsCwnPX67S1CYbOL45Y5IP3K/XHN73/lg21HlrB8SNlYXKQTg==", "dev": true, "dependencies": { "punycode": "^1.3.2", "strip-ansi": "^3.0.1" } }, + "node_modules/unicode-length/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unicode-length/node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/unicode-match-property-ecmascript": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz", @@ -28493,11 +24553,19 @@ "node": ">= 0.8" } }, + "node_modules/untildify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", + "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/update-browserslist-db": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", "integrity": "sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==", - "dev": true, "funding": [ { "type": "opencollective", @@ -28552,9 +24620,9 @@ } }, "node_modules/update-notifier/node_modules/chalk": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.0.1.tgz", - "integrity": "sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", "dev": true, "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" @@ -28563,52 +24631,19 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/update-notifier/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/update-notifier/node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/update-notifier/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, "dependencies": { "punycode": "^2.1.0" } }, "node_modules/uri-js/node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", "dev": true, "engines": { "node": ">=6" @@ -28617,19 +24652,19 @@ "node_modules/uri-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/uri-path/-/uri-path-1.0.0.tgz", - "integrity": "sha1-l0fwGDWJM8Md4PzP2C0TjmcmLjI=", + "integrity": "sha512-8pMuAn4KacYdGMkFaoQARicp4HSw24/DHOVKWqVRJ8LhhAwPPFpdGvdL9184JVmUwe7vz7Z9n6IqI6t5n2ELdg==", "dev": true, "engines": { "node": ">= 0.10" } }, "node_modules/url": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.1.tgz", + "integrity": "sha512-rWS3H04/+mzzJkv0eZ7vEDGiQbgquI1fGfOad6zKvgYQi1SzMmhl7c/DdRGxhaWrVH6z0qWITo8rpnxK/RfEhA==", "dependencies": { - "punycode": "1.3.2", - "querystring": "0.2.0" + "punycode": "^1.4.1", + "qs": "^6.11.0" } }, "node_modules/url-join": { @@ -28638,20 +24673,41 @@ "integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==", "dev": true }, - "node_modules/url/node_modules/punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=" + "node_modules/url/node_modules/qs": { + "version": "6.11.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.2.tgz", + "integrity": "sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/util": { + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", + "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", + "dependencies": { + "inherits": "^2.0.3", + "is-arguments": "^1.0.4", + "is-generator-function": "^1.0.7", + "is-typed-array": "^1.1.3", + "which-typed-array": "^1.1.2" + } }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, "node_modules/util-extend": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/util-extend/-/util-extend-1.0.3.tgz", - "integrity": "sha1-p8IW0mdUUWljeztu3GypEZ4v+T8=" + "integrity": "sha512-mLs5zAK+ctllYBj+iAQvlDCwoxU/WDOUaJkcFudeiAX6OajC6BKXJUa9a+tbtkC11dz2Ufb7h0lyvIOVn4LADA==" }, "node_modules/utils-merge": { "version": "1.0.1", @@ -28671,20 +24727,15 @@ } }, "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", "dev": true, "bin": { - "uuid": "dist/bin/uuid" + "uuid": "bin/uuid" } }, - "node_modules/v8-compile-cache": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz", - "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==", - "dev": true - }, "node_modules/v8flags": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.2.0.tgz", @@ -28731,7 +24782,7 @@ "node_modules/verror": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", "dev": true, "engines": [ "node >=0.6.0" @@ -28790,10 +24841,16 @@ } } }, + "node_modules/vm-browserify": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", + "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==" + }, "node_modules/vm2": { "version": "3.9.19", "resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.19.tgz", "integrity": "sha512-J637XF0DHDMV57R6JyVsTak7nIL8gy5KH4r1HiwWLf/4GBbb5MKL5y7LpmF4A8E2nR6XmzpmMFQ7V7ppPTmUQg==", + "deprecated": "The library contains critical security issues and should not be used for production! The maintenance of the project has been discontinued. Consider migrating your code to isolated-vm.", "dev": true, "dependencies": { "acorn": "^8.7.0", @@ -28806,6 +24863,18 @@ "node": ">=6.0" } }, + "node_modules/vm2/node_modules/acorn": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/vm2/node_modules/acorn-walk": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", @@ -28815,6 +24884,17 @@ "node": ">=0.4.0" } }, + "node_modules/voc": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/voc/-/voc-1.2.0.tgz", + "integrity": "sha512-BOuDjFFYvJdZO6e/N65AlaDItXo2TgyLjeyRYcqgAPkXpp5yTJcvkL2n+syO1r9Qc5g96tfBD2tuiMhYDmaGcA==", + "bin": { + "voc": "voc.njs" + }, + "engines": { + "node": ">=0.8" + } + }, "node_modules/watchpack": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", @@ -28862,9 +24942,9 @@ "dev": true }, "node_modules/webpack": { - "version": "5.86.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.86.0.tgz", - "integrity": "sha512-3BOvworZ8SO/D4GVP+GoRC3fVeg5MO4vzmq8TJJEkdmopxyazGDxN8ClqN12uzrZW9Tv8EED8v5VSb6Sqyi0pg==", + "version": "5.88.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.88.1.tgz", + "integrity": "sha512-FROX3TxQnC/ox4N+3xQoWZzvGXSuscxR32rbzjpXgEzWudJFEJBpdlkkob2ylrv5yzzufD1zph1OoFsLtm6stQ==", "dev": true, "dependencies": { "@types/eslint-scope": "^3.7.3", @@ -28876,7 +24956,7 @@ "acorn-import-assertions": "^1.9.0", "browserslist": "^4.14.5", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.14.1", + "enhanced-resolve": "^5.15.0", "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", @@ -28886,7 +24966,7 @@ "loader-runner": "^4.2.0", "mime-types": "^2.1.27", "neo-async": "^2.6.2", - "schema-utils": "^3.1.2", + "schema-utils": "^3.2.0", "tapable": "^2.1.1", "terser-webpack-plugin": "^5.3.7", "watchpack": "^2.4.0", @@ -28909,24 +24989,22 @@ } }, "node_modules/webpack-cli": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.5.0.tgz", - "integrity": "sha512-wXg/ef6Ibstl2f50mnkcHblRPN/P9J4Nlod5Hg9HGFgSeF8rsqDGHJeVe4aR26q9l62TUJi6vmvC2Qz96YJw1Q==", + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.10.0.tgz", + "integrity": "sha512-NLhDfH/h4O6UOy+0LSso42xvYypClINuMNBVVzX4vX98TmTaTUxwRbXdhucbFMd2qLaCTcLq/PdYrvi8onw90w==", "dev": true, "dependencies": { "@discoveryjs/json-ext": "^0.5.0", - "@webpack-cli/configtest": "^1.0.1", - "@webpack-cli/info": "^1.2.2", - "@webpack-cli/serve": "^1.3.0", - "colorette": "^1.2.1", + "@webpack-cli/configtest": "^1.2.0", + "@webpack-cli/info": "^1.5.0", + "@webpack-cli/serve": "^1.7.0", + "colorette": "^2.0.14", "commander": "^7.0.0", - "enquirer": "^2.3.6", - "execa": "^5.0.0", + "cross-spawn": "^7.0.3", "fastest-levenshtein": "^1.0.12", "import-local": "^3.0.2", "interpret": "^2.2.0", "rechoir": "^0.7.0", - "v8-compile-cache": "^2.2.0", "webpack-merge": "^5.7.3" }, "bin": { @@ -28935,6 +25013,10 @@ "engines": { "node": ">=10.13.0" }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, "peerDependencies": { "webpack": "4.x.x || 5.x.x" }, @@ -28942,9 +25024,6 @@ "@webpack-cli/generators": { "optional": true }, - "@webpack-cli/init": { - "optional": true - }, "@webpack-cli/migrate": { "optional": true }, @@ -28957,46 +25036,21 @@ } }, "node_modules/webpack-cli/node_modules/commander": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.1.0.tgz", - "integrity": "sha512-pRxBna3MJe6HKnBGsDyMv8ETbptw3axEdYHoqNh7gu5oDcew8fs0xnivZGm06Ogk8zGAJ9VX+OPEr2GXEQK4dg==", - "dev": true, - "engines": { - "node": ">= 10" - } - }, - "node_modules/webpack-cli/node_modules/interpret": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz", - "integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==", - "dev": true, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/webpack-cli/node_modules/rechoir": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.0.tgz", - "integrity": "sha512-ADsDEH2bvbjltXEP+hTIAmeFekTFK0V2BTxMkok6qILyAJEXV0AFfoWcAq4yfll5VdIMd/RVXq0lR+wQi5ZU3Q==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", "dev": true, - "dependencies": { - "resolve": "^1.9.0" - }, "engines": { - "node": ">= 0.10" + "node": ">= 10" } }, - "node_modules/webpack-cli/node_modules/resolve": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", - "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "node_modules/webpack-cli/node_modules/interpret": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz", + "integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==", "dev": true, - "dependencies": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">= 0.10" } }, "node_modules/webpack-dev-middleware": { @@ -29027,65 +25081,6 @@ } } }, - "node_modules/webpack-dev-middleware/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/webpack-dev-middleware/node_modules/ajv-keywords": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", - "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.3" - }, - "peerDependencies": { - "ajv": "^8.8.2" - } - }, - "node_modules/webpack-dev-middleware/node_modules/colorette": { - "version": "2.0.20", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", - "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", - "dev": true - }, - "node_modules/webpack-dev-middleware/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, - "node_modules/webpack-dev-middleware/node_modules/schema-utils": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz", - "integrity": "sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==", - "dev": true, - "dependencies": { - "@types/json-schema": "^7.0.9", - "ajv": "^8.9.0", - "ajv-formats": "^2.1.1", - "ajv-keywords": "^5.1.0" - }, - "engines": { - "node": ">= 12.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, "node_modules/webpack-dev-server": { "version": "4.15.0", "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-4.15.0.tgz", @@ -29145,63 +25140,19 @@ } } }, - "node_modules/webpack-dev-server/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/webpack-dev-server/node_modules/ajv-keywords": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", - "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.3" - }, - "peerDependencies": { - "ajv": "^8.8.2" - } - }, - "node_modules/webpack-dev-server/node_modules/colorette": { - "version": "2.0.20", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", - "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", - "dev": true - }, - "node_modules/webpack-dev-server/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, - "node_modules/webpack-dev-server/node_modules/schema-utils": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz", - "integrity": "sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==", + "node_modules/webpack-dev-server/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, "dependencies": { - "@types/json-schema": "^7.0.9", - "ajv": "^8.9.0", - "ajv-formats": "^2.1.1", - "ajv-keywords": "^5.1.0" + "glob": "^7.1.3" }, - "engines": { - "node": ">= 12.13.0" + "bin": { + "rimraf": "bin.js" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/webpack-dev-server/node_modules/webpack-dev-middleware": { @@ -29291,6 +25242,76 @@ } } }, + "node_modules/webpack/node_modules/acorn": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/webpack/node_modules/acorn-import-assertions": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz", + "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==", + "dev": true, + "peerDependencies": { + "acorn": "^8" + } + }, + "node_modules/webpack/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/webpack/node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true, + "peerDependencies": { + "ajv": "^6.9.1" + } + }, + "node_modules/webpack/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/webpack/node_modules/schema-utils": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, "node_modules/websocket-driver": { "version": "0.7.4", "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz", @@ -29326,18 +25347,6 @@ "node": ">=12" } }, - "node_modules/whatwg-encoding/node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dev": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", @@ -29349,15 +25358,18 @@ } }, "node_modules/which": { - "version": "1.2.14", - "resolved": "https://registry.npmjs.org/which/-/which-1.2.14.tgz", - "integrity": "sha1-mofEN48D6CfOyvGs31bHNsAcFOU=", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "dependencies": { "isexe": "^2.0.0" }, "bin": { - "which": "bin/which" + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" } }, "node_modules/which-boxed-primitive": { @@ -29377,23 +25389,22 @@ } }, "node_modules/which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", "dev": true }, "node_modules/which-typed-array": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.4.tgz", - "integrity": "sha512-49E0SpUe90cjpoc7BOJwyPHRqSAd12c10Qm2amdEZrJPCY2NDxaW01zHITrem+rnETY3dwrbH3UUrUwagfCYDA==", + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.10.tgz", + "integrity": "sha512-uxoA5vLUfRPdjCuJ1h5LlYdmTLbYfums398v3WLkM+i/Wltl2/XyZpQWKbN++ck5L64SR/grOHqtXCUKmlZPNA==", "dependencies": { - "available-typed-arrays": "^1.0.2", - "call-bind": "^1.0.0", - "es-abstract": "^1.18.0-next.1", - "foreach": "^2.0.5", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.1", - "is-typed-array": "^1.1.3" + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0", + "is-typed-array": "^1.1.10" }, "engines": { "node": ">= 0.4" @@ -29462,9 +25473,9 @@ } }, "node_modules/widest-line/node_modules/strip-ansi": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", - "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dev": true, "dependencies": { "ansi-regex": "^6.0.1" @@ -29477,9 +25488,9 @@ } }, "node_modules/wildcard": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz", - "integrity": "sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.1.tgz", + "integrity": "sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==", "dev": true }, "node_modules/wildcard-match": { @@ -29491,16 +25502,16 @@ "node_modules/window-size": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", - "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "integrity": "sha512-1pTPQDKTdd61ozlKGNCjhNRd+KPmgLSGa3mZTHoOliaGcESD8G1PXhh7c1fgiPjVbNVfgy2Faw4BI8/m0cC8Mg==", "dev": true, "engines": { "node": ">= 0.8.0" } }, "node_modules/windows-release": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-5.0.1.tgz", - "integrity": "sha512-y1xFdFvdMiDXI3xiOhMbJwt1Y7dUxidha0CWPs1NgjZIjZANTcX7+7bMqNjuezhzb8s5JGEiBAbQjQQYYy7ulw==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-5.1.1.tgz", + "integrity": "sha512-NMD00arvqcq2nwqc5Q6KtrSRHK+fVD31erE5FEMahAw5PmVCgD7MUXodq3pdZSUkqA9Cda2iWx6s1XYwiJWRmw==", "dev": true, "dependencies": { "execa": "^5.1.1" @@ -29512,20 +25523,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/windows-release/node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/windows-release/node_modules/execa": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", @@ -29555,43 +25552,82 @@ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/windows-release/node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, + "engines": { + "node": ">=10.17.0" + } + }, + "node_modules/windows-release/node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/windows-release/node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "engines": { + "node": ">=6" } }, - "node_modules/windows-release/node_modules/is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "node_modules/windows-release/node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", "dev": true, + "dependencies": { + "path-key": "^3.0.0" + }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/windows-release/node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "node_modules/windows-release/node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, "dependencies": { - "isexe": "^2.0.0" + "mimic-fn": "^2.1.0" }, - "bin": { - "node-which": "bin/node-which" + "engines": { + "node": ">=6" }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/windows-release/node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, "engines": { - "node": ">= 8" + "node": ">=6" } }, "node_modules/wkt-parser": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/wkt-parser/-/wkt-parser-1.2.2.tgz", - "integrity": "sha512-2aCAsY3VIKraNfMnAU2HYQyPQUnyeBvwXZofBXTR/Cev1vbL5Q4/Nw47JEFvkLtBm96RtK6fQbdPmc1kk8uhMw==" + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/wkt-parser/-/wkt-parser-1.3.3.tgz", + "integrity": "sha512-ZnV3yH8/k58ZPACOXeiHaMuXIiaTk1t0hSUVisbO0t4RjA5wPpUytcxeyiN2h+LZRrmuHIh/1UlrR9e7DHDvTw==" }, "node_modules/word-wrap": { "version": "1.2.3", @@ -29605,24 +25641,26 @@ "node_modules/wordwrap": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", - "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "integrity": "sha512-xSBsCeh+g+dinoBv3GAOWM4LcVVO68wLXRanibtBSdUvkGWQRGeE9P7IwU9EmDDi4jA6L44lz15CGMwdw9N5+Q==", "dev": true, "engines": { "node": ">=0.4.0" } }, "node_modules/wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "dev": true, + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dependencies": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" }, "engines": { - "node": ">=6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, "node_modules/wrap-ansi-cjs": { @@ -29643,15 +25681,6 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -29685,84 +25714,40 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/wrap-ansi-cjs/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "color-convert": "^2.0.1" }, "engines": { "node": ">=8" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" }, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi/node_modules/ansi-regex": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", - "dev": true, - "engines": { - "node": ">=6" + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, + "node_modules/wrap-ansi/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dependencies": { - "color-convert": "^1.9.0" + "color-name": "~1.1.4" }, "engines": { - "node": ">=4" + "node": ">=7.0.0" } }, - "node_modules/wrap-ansi/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "dependencies": { - "ansi-regex": "^4.1.0" - }, - "engines": { - "node": ">=6" - } + "node_modules/wrap-ansi/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "node_modules/write-file-atomic": { "version": "2.4.3", @@ -29828,15 +25813,72 @@ "node": ">=0.8" } }, + "node_modules/xlsx/node_modules/adler-32": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/adler-32/-/adler-32-1.2.0.tgz", + "integrity": "sha512-/vUqU/UY4MVeFsg+SsK6c+/05RZXIHZMGJA+PX5JyWI0ZRcBpupnRuPLU/NXXoFwMYCPCoxIfElM2eS+DUXCqQ==", + "dependencies": { + "exit-on-epipe": "~1.0.1", + "printj": "~1.1.0" + }, + "bin": { + "adler32": "bin/adler32.njs" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/xlsx/node_modules/codepage": { + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/codepage/-/codepage-1.14.0.tgz", + "integrity": "sha512-iz3zJLhlrg37/gYRWgEPkaFTtzmnEv1h+r7NgZum2lFElYQPi0/5bnmuDfODHxfp0INEfnRqyfyeIJDbb7ahRw==", + "dependencies": { + "commander": "~2.14.1", + "exit-on-epipe": "~1.0.1" + }, + "bin": { + "codepage": "bin/codepage.njs" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/xlsx/node_modules/codepage/node_modules/commander": { + "version": "2.14.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.14.1.tgz", + "integrity": "sha512-+YR16o3rK53SmWHU3rEM3tPAh2rwb1yPcQX5irVn7mb0gXbwuCCrnkbV5+PBfETdfg1vui07nM6PCG1zndcjQw==" + }, "node_modules/xlsx/node_modules/commander": { "version": "2.17.1", "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==" }, + "node_modules/xlsx/node_modules/frac": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/frac/-/frac-1.1.2.tgz", + "integrity": "sha512-w/XBfkibaTl3YDqASwfDUqkna4Z2p9cFSr1aHDt0WoMTECnRfBOv2WArlZILlqgWlmdIlALXGpM2AOhEk5W3IA==", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/xlsx/node_modules/ssf": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/ssf/-/ssf-0.10.3.tgz", + "integrity": "sha512-pRuUdW0WwyB2doSqqjWyzwCD6PkfxpHAHdZp39K3dp/Hq7f+xfMwNAWIi16DyrRg4gg9c/RvLYkJTSawTPTm1w==", + "dependencies": { + "frac": "~1.1.2" + }, + "bin": { + "ssf": "bin/ssf.njs" + }, + "engines": { + "node": ">=0.8" + } + }, "node_modules/xml": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz", - "integrity": "sha1-eLpyAgApxbyHuKgaPPzXS0ovweU=" + "integrity": "sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw==" }, "node_modules/xml-js": { "version": "1.6.11", @@ -29849,19 +25891,10 @@ "xml-js": "bin/cli.js" } }, - "node_modules/xregexp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-2.0.0.tgz", - "integrity": "sha512-xl/50/Cf32VsGq/1R8jJE5ajH1yMCQkpmoS10QbFZWl2Oor4H0Me64Pu2yxvsRWK3m6soJbmGfzSR7BYmDcWAA==", - "dev": true, - "engines": { - "node": "*" - } - }, "node_modules/xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", "engines": { "node": ">=0.4" } @@ -29870,76 +25903,50 @@ "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true, "engines": { "node": ">=10" } }, "node_modules/yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", - "dev": true - }, - "node_modules/yaml": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", - "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", - "dev": true, - "engines": { - "node": ">= 6" - } + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" }, "node_modules/yapool": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/yapool/-/yapool-1.0.0.tgz", - "integrity": "sha1-9pPymjFbUNmp2iZGp6ZkXJaYW2o=", + "integrity": "sha512-RONBZndo8Lo8pKPfORRxr2DIk2NZKIml654o4kaIu7RXVxQCKsAN6AqrcoZsI3h+2H5YO2mD/04Wy4LbAgd+Pg==", "dev": true }, "node_modules/yargs": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", - "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", - "dev": true, - "dependencies": { - "camelcase": "^1.0.2", - "cliui": "^2.1.0", - "decamelize": "^1.0.0", - "window-size": "0.1.0" - } - }, - "node_modules/yargs-parser": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", - "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", - "dev": true, + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - }, - "node_modules/yargs-parser/node_modules/camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true, + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, "engines": { - "node": ">=6" + "node": ">=12" } }, - "node_modules/yargs/node_modules/camelcase": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", - "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", - "dev": true, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "engines": { - "node": ">=0.10.0" + "node": ">=12" } }, "node_modules/yauzl": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", + "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", "dev": true, "dependencies": { "buffer-crc32": "~0.2.3", @@ -29968,18 +25975,17 @@ } }, "node_modules/zip-stream": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-1.2.0.tgz", - "integrity": "sha1-qLxF9MG0lpnGuQGYuqyqzbzUugQ=", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-4.1.0.tgz", + "integrity": "sha512-zshzwQW7gG7hjpBlgeQP9RuyPGNxvJdzR8SUM3QhxCnLjWN2E7j3dOvpeDcQoETfHx0urRS7EtmVToql7YpU4A==", "dev": true, "dependencies": { - "archiver-utils": "^1.3.0", - "compress-commons": "^1.2.0", - "lodash": "^4.8.0", - "readable-stream": "^2.0.0" + "archiver-utils": "^2.1.0", + "compress-commons": "^4.1.0", + "readable-stream": "^3.6.0" }, "engines": { - "node": ">= 0.10.0" + "node": ">= 10" } }, "node_modules/zone.js": { @@ -29991,9 +25997,9 @@ } }, "node_modules/zrender": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/zrender/-/zrender-5.3.0.tgz", - "integrity": "sha512-Ln2QB5uqI1ftNYMtCRxd+XDq6MOttLgam2tmhKAVA+j0ko47UT+VNlDvKTkqe4K2sJhBvB0EhYNLebqlCTjatQ==", + "version": "5.4.3", + "resolved": "https://registry.npmjs.org/zrender/-/zrender-5.4.3.tgz", + "integrity": "sha512-DRUM4ZLnoaT0PBVvGBDO9oWIDBKFdAVieNWxWwK0niYzJCMwGchRk21/hsE+RKkIveH3XHCyvXcJDkgLVvfizQ==", "dependencies": { "tslib": "2.3.0" } diff --git a/package.json b/package.json index ef23539e5..20a90cd4a 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "@types/angular-route": "^1.7.3", "@types/angular-sanitize": "^1.8.1", "@types/jasmine": "^4.3.5", + "@types/jquery": "^3.5.16", "babel-core": "^6.26.0", "babel-plugin-angularjs-annotate": "^0.10.0", "babel-plugin-transform-es2015-destructuring": "^6.23.0", @@ -75,6 +76,8 @@ "@angular/router": "^16.1.3", "@angular/upgrade": "^16.1.3", "@fortawesome/fontawesome-free": "^6.1.1", + "@ng-bootstrap/ng-bootstrap": "^15.1.0", + "@popperjs/core": "^2.11.8", "@turf/turf": "^6.5.0", "admin-lte": "^2.4.15", "ag-grid-community": "^26.2.1", @@ -84,7 +87,7 @@ "angular-sanitize": "^1.7.8", "angular-ui-bootstrap": "^2.5.6", "angularjs-dropdown-multiselect": "^2.0.0-beta.10", - "bootstrap": "^3.3.7", + "bootstrap": "^3.4.1", "bootstrap-datepicker": "^1.7.0", "bootstrap-daterangepicker": "^2.1.25", "bootstrap-iconpicker-latest": "^1.12.0", @@ -93,6 +96,7 @@ "classybrew": "0.0.3", "code-prettify": "^0.1.0", "codemirror": "^5.59.1", + "colorbrewer": "^1.5.3", "crypto-js": "^4.0.0", "docx": "^7.3.0", "echarts": "^5.3.0", @@ -103,9 +107,9 @@ "html2pdf.js": "^0.10.1", "ion-rangeslider": "^2.3.0", "ionicons": "^3.0.0", - "jquery": "^3.5.1", + "jquery": "^3.7.0", "jquery-slimscroll": "^1.3.8", - "jquery-ui-dist": "^1.12.1", + "jquery-ui-dist": "^1.13.2", "jquery.easing": "^1.4.1", "js-xlsx": "^0.8.22", "jshint": "^2.13.5", diff --git a/tsconfig.app.json b/tsconfig.app.json index 3cd418e53..78a25acd9 100644 --- a/tsconfig.app.json +++ b/tsconfig.app.json @@ -3,7 +3,9 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "./out-tsc/app", - "types": [] + "types": [ + "@angular/localize" + ] }, "files": [ "app/main.ts" diff --git a/tsconfig.json b/tsconfig.json index 34e1344f6..28bfcbd0d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -22,12 +22,15 @@ "lib": [ "ES2022", "dom" - ] + ], + "types": ["jquery"], }, "angularCompilerOptions": { "enableI18nLegacyMessageIdFormat": false, "strictInjectionParameters": true, "strictInputAccessModifiers": true, - "strictTemplates": true + "strictTemplates": true, + + } } \ No newline at end of file From 09ac34cdccdc136d84df96828fa6f3ba3d471cc8 Mon Sep 17 00:00:00 2001 From: ashwanth511 Date: Thu, 3 Aug 2023 11:19:23 +0530 Subject: [PATCH 4/8] updated services and bootstrapping --- ...lement-visibility-helper-service.module.ts | 195 +++++++++--------- 1 file changed, 95 insertions(+), 100 deletions(-) diff --git a/app/util/genericServices/kommonitorElementVisibilityHelperService/kommonitor-element-visibility-helper-service.module.ts b/app/util/genericServices/kommonitorElementVisibilityHelperService/kommonitor-element-visibility-helper-service.module.ts index d2604eb61..c2511ae2a 100644 --- a/app/util/genericServices/kommonitorElementVisibilityHelperService/kommonitor-element-visibility-helper-service.module.ts +++ b/app/util/genericServices/kommonitorElementVisibilityHelperService/kommonitor-element-visibility-helper-service.module.ts @@ -1,4 +1,3 @@ -angular.module('kommonitorElementVisibilityHelper', ['kommonitorDataExchange', 'kommonitorKeycloakHelper']); /** * a common serviceInstance that holds all needed properties for a WPS service. @@ -9,112 +8,108 @@ angular.module('kommonitorElementVisibilityHelper', ['kommonitorDataExchange', ' * This way, one single service instance can be used to easily share values and * parameters for each WPS operation represented by different Angular components */ -angular - .module('kommonitorElementVisibilityHelper', []) - .service( - 'kommonitorElementVisibilityHelperService', ['$rootScope', '$timeout', '$http', '$httpParamSerializerJQLike', '__env', - 'ControlsConfigService', 'Auth', 'kommonitorDataExchangeService', 'kommonitorKeycloakHelperService', - function ($rootScope, $timeout, - $http, $httpParamSerializerJQLike, __env, ControlsConfigService, Auth, kommonitorDataExchangeService, kommonitorKeycloakHelperService) { - - var self = this; - this.elementVisibility = {}; - - this.isAdvancedMode = __env.isAdvancedMode; - this.showAdvancedModeSwitch = __env.showAdvancedModeSwitch; - - this.advancedModeRoleName = "fakeAdvancedModeRole"; - - this.initElementVisibility = function () { - kommonitorDataExchangeService.showDiagramExportButtons = true; - kommonitorDataExchangeService.showGeoresourceExportButtons = true; - - this.elementVisibility = {}; - var config = ControlsConfigService.getControlsConfig(); - config.forEach(element => { - self.elementVisibility[element.id] = checkElementVisibility(element.id); - }); - - $timeout(function(){ - $rootScope.$apply(); - - }); - - - }; - - this.onChangeIsAdvancedMode = function (){ - - this.initElementVisibility(); - - // if any sidebar was previously not displayed we must ensure that it is properly instantiated for current indicator - $rootScope.$broadcast("changeIndicatorDate"); - }; - - var checkElementVisibility = function(id) { - - var element = ControlsConfigService.getControlsConfig().filter(element => element.id === id)[0]; - - if(element.roles === undefined || element.roles.length === 0) { - return true; - } - else if(self.isAdvancedMode && element.roles && element.roles.includes(self.advancedModeRoleName)){ +// Import required modules and interfaces +import { Component } from '@angular/core'; +import { Injectable } from '@angular/core'; +import { ControlsConfigService } from '../kommonitorConfigStorageService/kommonitor-config-storage-service.module'; +import { kommonitorDataExchangeService } from '../kommonitorDataExchangeService/kommonitor-data-exchange-service.module' +import { kommonitorKeycloakHelperService } from '../kommonitorKeycloakHelperService/kommonitor-keycloak-helper-service.module''; + +// Define the Angular service +@Injectable({ + providedIn: 'root' +}) +export class KommonitorElementVisibilityHelperService { +const Auth; + elementVisibility: { [key: string]: boolean } = {}; + + isAdvancedMode = __env.isAdvancedMode; + showAdvancedModeSwitch = __env.showAdvancedModeSwitch; + advancedModeRoleName = "fakeAdvancedModeRole"; + + constructor( + private controlsConfigService: ControlsConfigService, + private auth: Auth, + private kommonitorDataExchangeService: kommonitorDataExchangeService, + private kommonitorKeycloakHelperService: kommonitorKeycloakHelperService + ) { + this.initElementVisibility(); + } + + initElementVisibility(): void { + this.kommonitorDataExchangeService.showDiagramExportButtons = true; + this.kommonitorDataExchangeService.showGeoresourceExportButtons = true; + + this.elementVisibility = {}; + const config = this.controlsConfigService.getControlsConfig(); + config.forEach(element => { + this.elementVisibility[element.id] = this.checkElementVisibility(element.id); + }); + } + + onChangeIsAdvancedMode(): void { + this.initElementVisibility(); + // if any sidebar was previously not displayed we must ensure that it is properly instantiated for the current indicator + $rootScope.$broadcast("changeIndicatorDate"); + } + + private checkElementVisibility(id: string): boolean { + const element = this.controlsConfigService.getControlsConfig().filter(element => element.id === id)[0]; + + if (element.roles === undefined || element.roles.length === 0) { + return true; + } else if (this.isAdvancedMode && element.roles && element.roles.includes(this.advancedModeRoleName)) { + return true; + } else if (this.auth.keycloak.authenticated) { + // admin role user always sees all data and widgets + if (this.auth.keycloak.showAdminView) { + return true; + } + let hasAllowedRole = false; + for (const role of element.roles) { + if (this.auth.keycloak.tokenParsed.realm_access.roles.includes(role)) { return true; } - else if(Auth.keycloak.authenticated) { - // admin role user always sees all data and widgets - if(Auth.keycloak.showAdminView){ - return true; - } - var hasAllowedRole = false; - for (var i = 0; i < element.roles.length; i++) { - if(Auth.keycloak.tokenParsed.realm_access.roles.includes(element.roles[i])){ - return true; - } - } + } + + // special case for diagram export buttons + if (!hasAllowedRole && element.id === "diagramExportButtons") { + this.kommonitorDataExchangeService.showDiagramExportButtons = false; + } + // special case for georesource export buttons + if (!hasAllowedRole && element.id === "georesourceExportButtons") { + this.kommonitorDataExchangeService.showGeoresourceExportButtons = false; + } + + return hasAllowedRole; + } else { + if (!this.kommonitorDataExchangeService.enableKeycloakSecurity) { + if (element.roles && element.roles.includes(this.advancedModeRoleName)) { // special case for diagram export buttons - if(! hasAllowedRole && element.id === "diagramExportButtons"){ - kommonitorDataExchangeService.showDiagramExportButtons = false; + if (element.id === "diagramExportButtons") { + this.kommonitorDataExchangeService.showDiagramExportButtons = false; } // special case for georesource export buttons - if(! hasAllowedRole && element.id === "georesourceExportButtons"){ - kommonitorDataExchangeService.showGeoresourceExportButtons = false; + if (element.id === "georesourceExportButtons") { + this.kommonitorDataExchangeService.showGeoresourceExportButtons = false; } - return hasAllowedRole; - } else { - if(! kommonitorDataExchangeService.enableKeycloakSecurity){ - if(element.roles && element.roles.includes(self.advancedModeRoleName)){ - - // special case for diagram export buttons - if(element.id === "diagramExportButtons"){ - kommonitorDataExchangeService.showDiagramExportButtons = false; - } - // special case for georesource export buttons - if(element.id === "georesourceExportButtons"){ - kommonitorDataExchangeService.showGeoresourceExportButtons = false; - } - - return false; - } - return true; - } - else{ - // special case for diagram export buttons - if(element.id === "diagramExportButtons"){ - kommonitorDataExchangeService.showDiagramExportButtons = false; - } - // special case for georesource export buttons - if(element.id === "georesourceExportButtons"){ - kommonitorDataExchangeService.showGeoresourceExportButtons = false; - } - - return false; - } + return false; + } + return true; + } else { + // special case for diagram export buttons + if (element.id === "diagramExportButtons") { + this.kommonitorDataExchangeService.showDiagramExportButtons = false; + } + // special case for georesource export buttons + if (element.id === "georesourceExportButtons") { + this.kommonitorDataExchangeService.showGeoresourceExportButtons = false; } - }; - this.initElementVisibility(); - - }]); + return false; + } + } + } +} From 850e1d2f2a0c2a7c0409a8ff8f8e6cd1436c9848 Mon Sep 17 00:00:00 2001 From: ashwanth511 Date: Thu, 3 Aug 2023 11:23:05 +0530 Subject: [PATCH 5/8] updated service and bootstrapping --- .../kommonitor-element-visibility-helper-service.module.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/app/util/genericServices/kommonitorElementVisibilityHelperService/kommonitor-element-visibility-helper-service.module.ts b/app/util/genericServices/kommonitorElementVisibilityHelperService/kommonitor-element-visibility-helper-service.module.ts index c2511ae2a..ad6c12cf1 100644 --- a/app/util/genericServices/kommonitorElementVisibilityHelperService/kommonitor-element-visibility-helper-service.module.ts +++ b/app/util/genericServices/kommonitorElementVisibilityHelperService/kommonitor-element-visibility-helper-service.module.ts @@ -9,7 +9,6 @@ * parameters for each WPS operation represented by different Angular components */ // Import required modules and interfaces -import { Component } from '@angular/core'; import { Injectable } from '@angular/core'; import { ControlsConfigService } from '../kommonitorConfigStorageService/kommonitor-config-storage-service.module'; import { kommonitorDataExchangeService } from '../kommonitorDataExchangeService/kommonitor-data-exchange-service.module' From 17501170dbc951f03271ce12fa9fe7228680619d Mon Sep 17 00:00:00 2001 From: ashwanth511 Date: Thu, 3 Aug 2023 18:04:43 +0530 Subject: [PATCH 6/8] updated bootstrapping code --- app/app.module.ts | 29 ++++++++++++++++++++--------- app/index.html | 4 ++-- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/app/app.module.ts b/app/app.module.ts index f1d982a81..3811314c4 100644 --- a/app/app.module.ts +++ b/app/app.module.ts @@ -1,17 +1,28 @@ -import { DoBootstrap, NgModule } from '@angular/core'; +import { DoBootstrap, NgModule, Injector } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; -import { UpgradeModule } from '@angular/upgrade/static'; +import { UpgradeModule, setAngularJSGlobal } from '@angular/upgrade/static'; import { InfoModalModule } from 'components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.module'; import { VersionInfoModule } from 'components/kommonitorUserInterface/kommonitorControls/versionInfo/version-info.module'; + +declare var angular: any; // Declare the AngularJS global variable + @NgModule({ imports: [ - BrowserModule + BrowserModule, + UpgradeModule, + InfoModalModule, + VersionInfoModule ], - + // ... }) export class AppModule implements DoBootstrap { - constructor(private upgrade: UpgradeModule) { } - ngDoBootstrap() { - this.upgrade.bootstrap(document.documentElement, ['kommonitorClient']); - } -} \ No newline at end of file + constructor(private upgrade: UpgradeModule, private injector: Injector) { + setAngularJSGlobal(angular); // Set the AngularJS global object for @angular/upgrade/static + } + + ngDoBootstrap() { + // Bootstrap the AngularJS application + const angularJSModule = angular.module('kommonitorClient', []); + this.upgrade.bootstrap(document.documentElement, [angularJSModule.name], { strictDi: false }); + } +} diff --git a/app/index.html b/app/index.html index a38448108..e9d4fb36f 100644 --- a/app/index.html +++ b/app/index.html @@ -316,8 +316,8 @@ - - + + From d570a36bc559acb7cadd536f23db733ad0b98719 Mon Sep 17 00:00:00 2001 From: ashwanth511 Date: Thu, 3 Aug 2023 18:10:37 +0530 Subject: [PATCH 7/8] updated bootstrap application function --- app/app.ajs.ts | 90 ++++++++++++++++++++++++++------------------------ 1 file changed, 47 insertions(+), 43 deletions(-) diff --git a/app/app.ajs.ts b/app/app.ajs.ts index caf0bf986..e7553d287 100644 --- a/app/app.ajs.ts +++ b/app/app.ajs.ts @@ -1,3 +1,6 @@ +import { enableProdMode } from '@angular/core'; +import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; + if (/MSIE 9/i.test(navigator.userAgent) || /MSIE 10/i.test(navigator.userAgent) || /rv:11.0/i.test(navigator.userAgent)) { // This is internet explorer 9, 10 or 11 window.alert('Internet Explorer erkannt. Für eine optimale Nutzung von KomMonitor nutzen Sie nach Möglichkeit die Browser Firefox oder Chrome.'); @@ -376,58 +379,59 @@ function initAngularComponents(){ } -function bootstrapApplication(){ - - if(window.__env.enableKeycloakSecurity){ - var keycloakAdapter = new Keycloak(window.__env.configStorageServerConfig.targetUrlToConfigStorageServer_keycloakConfig); - // https://www.keycloak.org/docs/latest/securing_apps/#session-status-iframe - // https://www.keycloak.org/docs/latest/securing_apps/#_modern_browsers - - keycloakAdapter.init({ - onLoad: 'check-sso', - checkLoginIframe: false, - silentCheckSsoFallback: false - }).then(function (authenticated) { - console.log(authenticated ? 'User is authenticated!' : 'User is not authenticated!'); - auth.keycloak = keycloakAdapter; - appModule.factory('Auth', function () { - return auth; + + + + + +async function bootstrapApplication() { + if (window.__env.enableKeycloakSecurity) { + try { + const keycloakAdapter = new Keycloak(window.__env.configStorageServerConfig.targetUrlToConfigStorageServer_keycloakConfig); + const authenticated = await keycloakAdapter.init({ + onLoad: 'check-sso', + checkLoginIframe: false, + silentCheckSsoFallback: false }); - try { - console.debug('Trying to bootstrap application.'); - angular.bootstrap(document, [appModule.name]); - } - catch (e) { - console.error('Application bootstrapping failed.'); - console.error(e); + + console.log(authenticated ? 'User is authenticated!' : 'User is not authenticated!'); + + if (authenticated) { + window.__env.keycloak = keycloakAdapter; + } else { + console.log('Failed to initialize authentication adapter. Will try to bootstrap application without keycloak security'); + alert('Failed to initialize keycloak authentication adapter. Will try to bootstrap application without keycloak security'); + window.__env.enableKeycloakSecurity = false; + await bootstrapApplication(); } - }).catch(function () { - console.log('Failed to initialize authentication adapter. Will try to bootstrap application without keycloak security'); - alert('Failed to initialize keycloak authentication adapter. Will try to bootstrap application without keycloak security'); - window.__env.enableKeycloakSecurity = false; - bootstrapApplication(); - }); + } catch (e) { + console.error('Application bootstrapping failed.'); + console.error(e); + } + } else { + window.__env.keycloak = new Keycloak(keycloakConfig_forDirectInit); } - else{ - var keycloakAdapter = new Keycloak(keycloakConfig_forDirectInit); - auth.keycloak = keycloakAdapter; - appModule.factory('Auth', function () { - return auth; - }); - try { - console.debug('Trying to bootstrap application.'); - angular.bootstrap(document, [appModule.name]); - } - catch (e) { - console.error('Application bootstrapping failed.'); - console.error(e); - } + if (environment.production) { + enableProdMode(); } + platformBrowserDynamic() + .bootstrapModule(AppModule) + .catch(err => console.error(err)); } + + + + + + + + + + angular.element(document).ready(function ($http) { // load configs before doing anything else From 0c5ea94b6ead1a026b73474f544abf757da479de Mon Sep 17 00:00:00 2001 From: ashwanth511 Date: Mon, 7 Aug 2023 13:21:15 +0530 Subject: [PATCH 8/8] bootstrapped angular js services to angular --- app/app-upgraded-providers.ts | 178 + app/app.ajs.ts | 6 +- app/app.module.ts | 8 + app/index.html | 34 +- ...itor-batch-update-helper-service.module.ts | 1275 ------- .../kommonitor-cache-helper-service.module.ts | 275 -- ...ommonitor-config-storage-service.module.ts | 157 - ...kommonitor-data-exchange-service.module.ts | 3088 ----------------- ...monitor-data-grid-helper-service.module.ts | 3017 ---------------- ...ommonitor-diagram-helper-service.module.ts | 2072 ----------- ...lement-visibility-helper-service.module.ts | 114 - ...ement-visibility-helper-service.service.ts | 53 + ...kommonitor-filter-helper-service.module.ts | 181 - ...mmonitor-importer-helper-service.module.ts | 730 ---- ...nitor-info-legend-helper-service.module.ts | 21 - ...mmonitor-keycloak-helper-service.module.ts | 283 -- ...r-multi-step-form-helper-service.module.ts | 166 - ...kommonitor-script-helper-service.module.ts | 495 --- .../kommonitor-share-helper-service.module.ts | 139 - ...ingle-feature-map-helper-service.module.ts | 431 --- ...itor-visual-style-helper-service.module.ts | 794 ----- package-lock.json | 13 +- package.json | 1 + webpack.config.js | 2 +- 24 files changed, 269 insertions(+), 13264 deletions(-) create mode 100644 app/app-upgraded-providers.ts delete mode 100644 app/util/genericServices/kommonitorBatchUpdateHelperService/kommonitor-batch-update-helper-service.module.ts delete mode 100644 app/util/genericServices/kommonitorCacheHelperService/kommonitor-cache-helper-service.module.ts delete mode 100644 app/util/genericServices/kommonitorConfigStorageService/kommonitor-config-storage-service.module.ts delete mode 100644 app/util/genericServices/kommonitorDataExchangeService/kommonitor-data-exchange-service.module.ts delete mode 100644 app/util/genericServices/kommonitorDataGridHelperService/kommonitor-data-grid-helper-service.module.ts delete mode 100644 app/util/genericServices/kommonitorDiagramHelperService/kommonitor-diagram-helper-service.module.ts delete mode 100644 app/util/genericServices/kommonitorElementVisibilityHelperService/kommonitor-element-visibility-helper-service.module.ts create mode 100644 app/util/genericServices/kommonitorElementVisibilityHelperService/kommonitor-element-visibility-helper-service.service.ts delete mode 100644 app/util/genericServices/kommonitorFilterHelperService/kommonitor-filter-helper-service.module.ts delete mode 100644 app/util/genericServices/kommonitorImporterHelperService/kommonitor-importer-helper-service.module.ts delete mode 100644 app/util/genericServices/kommonitorInfoLegendHelperService/kommonitor-info-legend-helper-service.module.ts delete mode 100644 app/util/genericServices/kommonitorKeycloakHelperService/kommonitor-keycloak-helper-service.module.ts delete mode 100644 app/util/genericServices/kommonitorMultiStepFormHelperService/kommonitor-multi-step-form-helper-service.module.ts delete mode 100644 app/util/genericServices/kommonitorScriptHelperService/kommonitor-script-helper-service.module.ts delete mode 100644 app/util/genericServices/kommonitorShareHelperService/kommonitor-share-helper-service.module.ts delete mode 100644 app/util/genericServices/kommonitorSingleFeatureMapHelperService/kommonitor-single-feature-map-helper-service.module.ts delete mode 100644 app/util/genericServices/kommonitorVisualStyleHelperService/kommonitor-visual-style-helper-service.module.ts diff --git a/app/app-upgraded-providers.ts b/app/app-upgraded-providers.ts new file mode 100644 index 000000000..025d6c4f0 --- /dev/null +++ b/app/app-upgraded-providers.ts @@ -0,0 +1,178 @@ +import { Injector, Injectable } from '@angular/core'; +import { KommonitorElementVisibilityHelperService } from "util/genericServices/kommonitorElementVisibilityHelperService/kommonitor-element-visibility-helper-service.service"; +import { kommonitorCacheHelperService } from 'util/genericServices/kommonitorCacheHelperService/kommonitor-cache-helper-service.module'; +import {kommonitorBatchUpdateHelperService} from 'util/genericServices/kommonitorBatchUpdateHelperService/kommonitor-batch-update-helper-service.module'; +import {kommonitorConfigStorageService} from 'util/genericServices/kommonitorConfigStorageService/kommonitor-config-storage-service.module'; +import {kommonitorDataExchangeService} from 'util/genericServices/kommonitorDataExchangeService/kommonitor-data-exchange-service.module'; +import {kommonitorDataGridHelperService} from 'util/genericServices/kommonitorDataGridHelperService/kommonitor-data-grid-helper-service.module'; +import {kommonitorDiagramHelperService} from 'util/genericServices/kommonitorDiagramHelperService/kommonitor-diagram-helper-service.module'; +import {kommonitorFilterHelperService} from 'util/genericServices/kommonitorFilterHelperService/kommonitor-filter-helper-service.module'; +import {kommonitorImporterHelperService} from 'util/genericServices/kommonitorImporterHelperService/kommonitor-importer-helper-service.module'; +import {kommonitorKeycloackHelperService} from 'util/genericServices/kommonitorKeycloakHelperService/kommonitor-keycloak-helper-service.module' +import {kommonitorMultistepFormHelperService} from 'util/genericServices/kommonitorMultiStepFormHelperService/kommonitor-multi-step-form-helper-service.module' +import {kommonitorScriptHelperService} from'util/genericServices/kommonitorScriptHelperService/kommonitor-script-helper-service.module'; +import {kommonitorShareHelperService} from 'util/genericServices/kommonitorShareHelperService/kommonitor-share-helper-service.module' +import {kommonitorSingleFeatureMapHelperService} from 'util/genericServices/kommonitorSingleFeatureMapHelperService/kommonitor-single-feature-map-helper-service.module' +import {kommonitorVisualStyleHelperService} from 'util/genericServices/kommonitorVisualStyleHelperService/kommonitor-visual-style-helper-service.module' + +export function kommonitorCacheHelperServiceFactory(injector:any){ + return injector.get('kommonitorCacheHelperService'); +} +export const ajskommonitorCacheHelperServiceProvider: any = { + deps: ['$injector'], + provide: 'kommonitorCacheHelperService', + useFactory:kommonitorCacheHelperServiceFactory , + }; + + +export function kommonitorBatchUpdateHelperServiceFactory (injector:any){ + return injector.get('kommonitorBatchUpdateHelperService') +} + +export const ajskommonitorBatchUpdateHelperServiceProvider: any = { + deps: ['$injector'], + provide: 'kommonitorBatchUpdateHelperService', + useFactory:kommonitorBatchUpdateHelperServiceFactory , + }; + + export function kommonitorConfigStorageServiceFactory (injector:any){ + return injector.get('kommonitorConfigStorageService') +} + +export const ajskommonitorConfigStorageServiceProvider: any = { + deps: ['$injector'], + provide: 'kommonitorConfigStorageService', + useFactory:kommonitorConfigStorageServiceFactory, + }; +//data exchange + export function kommonitorDataExchangeServiceFactory (injector:any){ + return injector.get('kommonitorDataExchangeService') +} + +export const ajskommonitorDataExchangeServiceeProvider: any = { + deps: ['$injector'], + provide: 'kommonitorDataExchangeService', + useFactory:kommonitorDataExchangeServiceFactory, + }; +//data grid helper + export function kommonitorDataGridHelperServiceFactory (injector:any){ + return injector.get('kommonitorDataGridHelperService') +} + +export const ajskommonitorDataGridHelperServiceProvider: any = { + deps: ['$injector'], + provide: 'kommonitorDataGridHelperService', + useFactory:kommonitorDataGridHelperServiceFactory, + }; +//diagram helper + export function kommonitorDiagramHelperServiceFactory (injector:any){ + return injector.get('kommonitorDiagramHelperService') +} + +export const ajskommonitorDiagramHelperServiceProvider: any = { + deps: ['$injector'], + provide: 'kommonitorDiagramHelperService', + useFactory:kommonitorDiagramHelperServiceFactory, + }; + + //filter helper + export function kommonitorFilterHelperServiceFactory (injector:any){ + return injector.get('kommonitorFilterHelperService') +} + +export const ajskommonitorFilterHelperServiceProvider: any = { + deps: ['$injector'], + provide: 'kommonitorFilterHelperService', + useFactory:kommonitorFilterHelperServiceFactory, + }; + +//keycloack helper + export function kommonitorKeycloackHelperServiceFactory (injector:any){ + return injector.get('kommonitorKeycloackHelperService') +} + +export const ajskommonitorKeycloackHelperServiceProvider: any = { + deps: ['$injector'], + provide: 'kommonitorKeycloackHelperService', + useFactory:kommonitorKeycloackHelperServiceFactory, + }; + + //multistep form + export function kommonitorMultiStepFormHelperServiceFactory (injector:any){ + return injector.get('kommonitorMultiStepFormHelperService') +} + +export const ajskommonitorMultiStepFormHelperServiceProvider: any = { + deps: ['$injector'], + provide: 'kommonitorMultiStepFormHelperService', + useFactory:kommonitorMultiStepFormHelperServiceFactory, + }; + +//script helpet + +export function kommonitorScriptHelperServiceFactory (injector:any){ + return injector.get('kommonitorScriptHelperService') +} + +export const ajskommonitorScriptHelperServiceProvider: any = { + deps: ['$injector'], + provide: 'kommonitorScriptHelperService', + useFactory:kommonitorScriptHelperServiceFactory, + }; +//share Helper +export function kommonitorShareHelperServiceFactory (injector:any){ + return injector.get('kommonitorShareHelperService') +} + +export const ajskommonitorShareHelperServiceProvider: any = { + deps: ['$injector'], + provide: 'kommonitorShareHelperService', + useFactory:kommonitorShareHelperServiceFactory, + }; + +//single feature map helper +export function kommonitorSingleFeatureMapServiceFactory (injector:any){ + return injector.get('kommonitorSingleFeatureMapService') +} + +export const ajskommonitorSingleFeatureMapServiceProvider: any = { + deps: ['$injector'], + provide: 'kommonitorSingleFeatureMapService', + useFactory:kommonitorSingleFeatureMapServiceFactory, + }; + + + +//visually style helper + +export function kommonitorVisualStyleHelperServiceFactory (injector:any){ + return injector.get('kommonitorVisualStyleHelperService') +} + +export const ajskommonitorVisualStyleHelperServiceProvider: any = { + deps: ['$injector'], + provide: 'kommonitorVisualStyleHelperService', + useFactory:kommonitorVisualStyleHelperServiceFactory, + }; + + + + + + + + export const serviceProviders: any[] = [ + ajskommonitorCacheHelperServiceProvider, + ajskommonitorBatchUpdateHelperServiceProvider, + ajskommonitorConfigStorageServiceProvider, + ajskommonitorDataExchangeServiceeProvider, + ajskommonitorDataGridHelperServiceProvider, + ajskommonitorDiagramHelperServiceProvider, + ajskommonitorFilterHelperServiceProvider, +ajskommonitorKeycloackHelperServiceProvider, +ajskommonitorMultiStepFormHelperServiceProvider, +ajskommonitorScriptHelperServiceProvider, +ajskommonitorShareHelperServiceProvider, +ajskommonitorSingleFeatureMapServiceProvider, +ajskommonitorVisualStyleHelperServiceProvider + ]; diff --git a/app/app.ajs.ts b/app/app.ajs.ts index e7553d287..7754630de 100644 --- a/app/app.ajs.ts +++ b/app/app.ajs.ts @@ -380,11 +380,6 @@ function initAngularComponents(){ } - - - - - async function bootstrapApplication() { if (window.__env.enableKeycloakSecurity) { try { @@ -432,6 +427,7 @@ async function bootstrapApplication() { + angular.element(document).ready(function ($http) { // load configs before doing anything else diff --git a/app/app.module.ts b/app/app.module.ts index 3811314c4..300f86616 100644 --- a/app/app.module.ts +++ b/app/app.module.ts @@ -3,6 +3,7 @@ import { BrowserModule } from '@angular/platform-browser'; import { UpgradeModule, setAngularJSGlobal } from '@angular/upgrade/static'; import { InfoModalModule } from 'components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.module'; import { VersionInfoModule } from 'components/kommonitorUserInterface/kommonitorControls/versionInfo/version-info.module'; +import { ajskommonitorCacheHelperServiceProvider,ajskommonitorBatchUpdateHelperServiceProvider,ajskommonitorConfigStorageServiceProvider,ajskommonitorDataExchangeServiceeProvider,ajskommonitorDataGridHelperServiceProvider,ajskommonitorDiagramHelperServiceProvider,ajskommonitorFilterHelperServiceProvider,ajskommonitorKeycloackHelperServiceProvider,ajskommonitorMultiStepFormHelperServiceProvider, ajskommonitorSingleFeatureMapServiceProvider } from 'app-upgraded-providers'; declare var angular: any; // Declare the AngularJS global variable @@ -13,6 +14,13 @@ declare var angular: any; // Declare the AngularJS global variable InfoModalModule, VersionInfoModule ], + providers:[ +ajskommonitorCacheHelperServiceProvider,ajskommonitorBatchUpdateHelperServiceProvider, +ajskommonitorConfigStorageServiceProvider,ajskommonitorKeycloackHelperServiceProvider, +ajskommonitorMultiStepFormHelperServiceProvider,ajskommonitorDataExchangeServiceeProvider, +ajskommonitorDataGridHelperServiceProvider,ajskommonitorSingleFeatureMapServiceProvider, +ajskommonitorDiagramHelperServiceProvider,ajskommonitorFilterHelperServiceProvider + ] // ... }) export class AppModule implements DoBootstrap { diff --git a/app/index.html b/app/index.html index e9d4fb36f..b4a26234b 100644 --- a/app/index.html +++ b/app/index.html @@ -130,23 +130,23 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/app/util/genericServices/kommonitorBatchUpdateHelperService/kommonitor-batch-update-helper-service.module.ts b/app/util/genericServices/kommonitorBatchUpdateHelperService/kommonitor-batch-update-helper-service.module.ts deleted file mode 100644 index 48cbb33fd..000000000 --- a/app/util/genericServices/kommonitorBatchUpdateHelperService/kommonitor-batch-update-helper-service.module.ts +++ /dev/null @@ -1,1275 +0,0 @@ -angular.module('kommonitorBatchUpdateHelper', ['kommonitorDataExchange', 'kommonitorImporterHelper']); - -angular - .module('kommonitorBatchUpdateHelper', []) - .service( - 'kommonitorBatchUpdateHelperService', ['$rootScope', '$timeout', 'kommonitorDataExchangeService', 'kommonitorImporterHelperService', '__env', - function ($rootScope, $timeout, kommonitorDataExchangeService, kommonitorImporterHelperService, __env) { - - let thisService = this; // to enable access to service methods from inside other functions (e. g. $timeout) where 'this' references something else - let timeseriesMappingReference; - - // Maps the values of the "name" property in the converter's parameter array to the property names used in the batch update - // We can't use the parameters array directly because we have to bind angularjs variables to object properties, not array elements - // Used in converterParametersArrayToProperties and converterPropertiesToParametersArray - const converterParametersToPropertiesMapping = { - "CRS": "crs", - "Hausnummer_Spaltenname": "hnrColumnName", - "Strasse_Spaltenname": "streetColumnName", - "Adresse_Spaltenname": "addressColumnName", - "Strasse_Hausnummer_Spaltenname": "streetHnrColumnName", - "X_Koordinatenspalte_Rechtswert": "xCoordColumnName", - "Y_Koordinatenspalte_Hochwert": "yCoordColumnName", - "Postleitzahl_Spaltenname": "plzColumnName", - "Stadt_Spaltenname": "cityColumnName", - "NAMESPACE": "schemaNamespace", - "SCHEMA_LOCATION": "schemaLocation", - "Trennzeichen": "separator", - } - const datasourceParametersToPropertiesMapping = { - "NAME": "name", - "URL": "url", - "payload": "payload" - } - - this.batchUpdate = async function (resourceType, batchList, keepMissingOrNullValueIndicator, keepMissingOrNullValueAttributes) { - - let startBtn = document.getElementById(resourceType + "-batch-update-btn"); - startBtn.innerHTML = "Update wird ausgeführt..."; - startBtn.setAttribute("disabled", "disabled"); - - - // clear result modal - document.getElementById("batch-update-result-table-tbody").innerHTML = ""; - - // create array to store response messages - var responses = []; - - // deep copy batch list - var batchListCopy = []; - for(let i=0; i= 0; i--) { - if (batchList[i].isSelected) - batchList.splice(i, 1); - } - - allRowsSelected = false; // in case it was true - } - - // examples - // mappingTable0 --> 0 - // mappingTable12 --> 12 - // but: 12mappingTable23 --> 12, returns first occurrence of number as index - this.getIndexFromId = function (id) { - var re = /\d+/g; // gets all numbers - var index = id.match(re); - if (index) { - index = index[0]; - } - return index; - } - - - // builds a converter definition with parameters array from the currently selected datasource - // selectedConverter = the currently selected converter in the dropdown - // oldConverter = the converter property from a mapping object. - this.buildConverterDefinition = function (selectedConverter, oldConverter) { - console.log("building converter definition"); - console.log("selected converter: ", selectedConverter); - console.log("old converter: ", oldConverter); - - if (! selectedConverter){ - return oldConverter; - } - - // Remove all properties that are not part of the selected converter. - // This is usually needed when the user switches to a different converter. - let paramNames = selectedConverter.parameters.map(obj => obj.name); - for(var i=oldConverter.parameters.length-1; i>=0; i--) { - if(!paramNames.includes(oldConverter.parameters[i].name)) { - oldConverter.parameters.splice(i, 1); - } - } - - let mimeTypeValue = oldConverter.mimeType ? oldConverter.mimeType : ""; - if (mimeTypeValue == "" && oldConverter.parameters){ - // check for another property already inserted as parameter - for (const parameter of oldConverter.parameters) { - if (parameter.name == "mimeType"){ - mimeTypeValue = parameter.value; - break; - } - } - } - - let encodingValue = oldConverter.encoding ? oldConverter.encoding : ""; - if (encodingValue == "" && oldConverter.parameters){ - // check for another property already inserted as parameter - for (const parameter of oldConverter.parameters) { - if (parameter.name == "encoding"){ - encodingValue = parameter.value; - break; - } - } - } - // set first encoding as fallback option - if(encodingValue == ""){ - encodingValue = selectedConverter.encodings[0]; - } - - var converterDefinition = { - encoding: encodingValue, - mimeType: mimeTypeValue, - name: selectedConverter.name, - parameters: oldConverter.parameters, - schema: undefined - } - - if (selectedConverter.name.includes("WFS_v1")) { - if (oldConverter.schema && oldConverter.schema.length > 0) - converterDefinition.schema = oldConverter.schema; - } - - return converterDefinition; - } - - - // builds a datasource definition with parameters array from the currently selected datasource - // selectedDatasourceType = the currently selected datasource in the dropdown - // oldDataSource = the datasource property from a mapping object. - this.buildDataSourceDefinition = function (selectedDatasourceType, oldDataSource, includeFileName) { - console.log("in buildDataSourceDefinition"); - console.log("selectedDatasourceType: ", selectedDatasourceType); - console.log("oldDataSource", oldDataSource); - if (! selectedDatasourceType){ - return oldDataSource; - } - - // Remove all properties that are not part of the selected datasource. - // This is usually needed when the user switches to a different datasource. - // let paramNames = selectedDatasourceType.parameters.map(obj => obj.name); - // for(var i=oldDataSource.parameters.length-1; i>=0; i--) { - // if(!paramNames.includes(oldDataSource.parameters[i].name)) { - // oldDataSource.parameters.splice(i, 1); - // } - // } - - var dataSourceDefinition = { - parameters: [], - type: selectedDatasourceType.type - } - - if (dataSourceDefinition.type === "FILE") { - dataSourceDefinition.parameters.push({ - name: "NAME", - value: includeFileName ? oldDataSource.name : "" - }); - } - - if (dataSourceDefinition.type === "HTTP") { - - let urlValue = oldDataSource.URL ? oldDataSource.URL : ""; - if (urlValue == "" && oldDataSource.parameters){ - // check for another property already inserted as parameter - for (const parameter of oldDataSource.parameters) { - if (parameter.name == "URL"){ - urlValue = parameter.value; - break; - } - } - } - - dataSourceDefinition.parameters.push({ - name: "URL", - value: urlValue - }); - } - - if (dataSourceDefinition.type === "INLINE") { - - let payloadValue = oldDataSource.payload ? oldDataSource.payload : ""; - if (payloadValue == "" && oldDataSource.parameters){ - // check for another property already inserted as parameter - for (const parameter of oldDataSource.parameters) { - if (parameter.name == "payload"){ - payloadValue = parameter.value; - break; - } - } - } - - dataSourceDefinition.parameters.push({ - name: "payload", - value: payloadValue - }); - } - - return dataSourceDefinition; - } - - // We need properties to bind model variables to them. - // Binding to unnamed objects in an array tricky (using the index is not reliable) - // It also creates other problems - this.converterParametersArrayToProperties = function (converter) { - var result = $.extend(true, {}, converter); - var array = converter.parameters; - // for each array element add a new property - for (var i = 0; i < array.length; i++) { - var paramName = array[i].name; - var propName = converterParametersToPropertiesMapping[paramName]; - var paramValue = array[i].value; - result[propName] = paramValue; - } - delete result.parameters; - return result; - } - - // This reverses the result of the method converterParametersArrayToProperties - this.converterPropertiesToParametersArray = function (converter) { - var result = $.extend(true, {}, converter); - result.parameters = []; - - for(const [prop, value] of Object.entries(result)) { - // If prop is in mapping table - Object.keys(converterParametersToPropertiesMapping).forEach(function(key) { - if (converterParametersToPropertiesMapping[key] == prop) { - result.parameters.push({ - name: key, - value: value - }); - delete result[prop]; - } - }); - } - return result; - } - - // We need properties to bind model variables to them. - // Binding to unnamed objects in an array is tricky (using the index is not reliable) - // It also creates other problems - this.dataSourceParametersArrayToProperty = function (dataSource) { - if(dataSource) { - var result = $.extend(true, {}, dataSource); - var array = dataSource.parameters; - // only one datasource can be selected for each row, so the array has to be of length one - var paramName = array[0].name; - var paramValue = array[0].value; - result[paramName] = paramValue; - delete result.parameters; - return result; - } - } - - // This reverses the result of the method dataSourceParametersArrayToProperty - this.dataSourcePropertyToParametersArray = function (dataSource) { - if (dataSource) { - var result = $.extend(true, {}, dataSource); - result.parameters = []; - - for(const [prop, value] of Object.entries(result)) { - // If prop is in mapping table - Object.keys(datasourceParametersToPropertiesMapping).forEach(function(key) { - if (datasourceParametersToPropertiesMapping[key] == prop) { - result.parameters.push({ - name: key, - value: value - }); - delete result[prop]; - } - }); - } - return result; - } - } - - - // helper function to get a converter object by full name. - // returns null if no converter was found - this.getConverterObjectByName = function (name) { - if(kommonitorImporterHelperService.availableConverters) { - for (const converter of kommonitorImporterHelperService.availableConverters) { - if (converter.name === name) { - return converter; - } - } - } - return null; - } - - - // helper function to get a datasourceType object by type. - // returns null if no datasourceType was found - this.getDatasourceTypeObjectByType = function (type) { - for (const datasourceType of kommonitorImporterHelperService.availableDatasourceTypes) { - if (datasourceType.type === type) { - return datasourceType; - } - } - return null; - } - - - // helper function to get a spatial unit object by full name. - // returns null if no spatial unit was found - this.getSpatialUnitObjectByName = function (name) { - for (const spatialUnit of kommonitorDataExchangeService.availableSpatialUnits) { - if (spatialUnit.spatialUnitLevel === name) { - return spatialUnit; - } - } - return null; - } - - this.createAttributeMappingsObject = function(row) { - var attributeMapping = []; - for (let i = 0; i < row.mappingObj.propertyMapping.attributes.length; i++) { - let attribute = row.mappingObj.propertyMapping.attributes[i]; - var tmpEntry = { - "sourceName": attribute.name, - "destinationName": attribute.mappingName - }; - - for (const dataType of kommonitorImporterHelperService.attributeMapping_attributeTypes) { - if (dataType.apiName === attribute.type) { - tmpEntry.dataType = dataType; - } - } - - attributeMapping.push(tmpEntry); - } - - return attributeMapping; - } - - this.uploadFileToImporter = async function(datasourceFileInputId) { - - // this should be defined since the update is only possible if a file was manually selected - var file = $("#" + datasourceFileInputId).get(0).files[0]; - - if(file === null || file === undefined) { - throw new Error("File was not defined. Did not start upload to importer.") - } - - // upload file to importer - var fileUploadName; - try { - fileUploadName = await kommonitorImporterHelperService.uploadNewFile(file, file.name); - } catch (error) { - throw error; - } - - return fileUploadName; - }; - - // loop through batch list and check if condition is true for at least one row - this.checkIfMappingTableIsSpecified = function(batchList) { - let mappingTableIsSpecified = false; - for(let i=0; i 0) { - if (converterName.includes("WFS_v1")) { - selectedConverterIsWfsV1 = true; - break; - } - } - } - } - return selectedConverterIsWfsV1; - } - - - // loop through batch list and check if condition is true for at least one row - this.checkIfSelectedDatasourceTypeIsFile = function(batchList) { - let selectedDatasourceTypeIsFile = false; - for (let i=0; i 0) { - if (datasourceType == "FILE") { - selectedDatasourceTypeIsFile = true; - break; - } - } - } - } - return selectedDatasourceTypeIsFile; - } - - - // loop through batch list and check if condition is true for at least one row - this.checkIfSelectedDatasourceTypeIsHttp = function(batchList) { - let selectedDatasourceTypeIsHttp = false; - for (let i=0; i 0) { - if (datasourceType == "HTTP") { - selectedDatasourceTypeIsHttp = true; - break; - } - } - } - } - return selectedDatasourceTypeIsHttp; - } - - - // loop through batch list and check if condition is true for at least one row - this.checkIfSelectedDatasourceTypeIsInline = function(batchList) { - let selectedDatasourceTypeIsInline = false; - for (let i=0; i 0) { - if (datasourceType == "INLINE") { - selectedDatasourceTypeIsInline = true; - break; - } - } - } - } - return selectedDatasourceTypeIsInline; - } - - - this.checkIfNameAndFilesChosenInEachRow = function(resourceType, batchList) { - - let updateBtn = document.getElementById(resourceType + "-batch-update-btn"); - updateBtn.title = "Update starten" // default title, might get overwritten later - - if(batchList.length == 0) { - updateBtn.title = "Die Batch-Liste is leer." - return false; - } - - for(let i=0; i 0) { - - if (datasourceType == "FILE") { - if(!dataSource.name) { - updateBtn.title = "Die Spalte Datei* ist nicht für alle Zeilen gesetzt, in denen die Spalte Datenquelltyp* auf FILE gesetzt ist." - return false; - } else { - if(dataSource.name == undefined || dataSource.name == "") { - updateBtn.title = "Die Spalte Datei* ist nicht für alle Zeilen gesetzt, in denen die Spalte Datenquelltyp* auf FILE gesetzt ist." - return false; - } - } - } - - if (datasourceType == "HTTP") { - if(!dataSource.URL) { - // property does not exist until user uses the input field for the first time - updateBtn.title = "Die Spalte URL* ist nicht für alle Zeilen gesetzt, in denen die Spalte Datenquelltyp* auf HTTP gesetzt ist." - return false; - } else { - // the field could still be empty (if it had input before) - if(dataSource.URL == undefined || dataSource.URL == "") { - updateBtn.title = "Die Spalte URL* ist nicht für alle Zeilen gesetzt, in denen die Spalte Datenquelltyp* auf HTTP gesetzt ist." - return false; - } - } - } - - if (datasourceType == "INLINE") { - if(!dataSource.payload) { - // property does not exist until user uses the input field for the first time - updateBtn.title = "Die Spalte Payload* ist nicht für alle Zeilen gesetzt, in denen die Spalte Datenquelltyp* auf INLINE gesetzt ist." - return false; - } else { - // the field could still be empty (if it had input before) - if(dataSource.payload == undefined || dataSource.payload == "") { - updateBtn.title = "Die Spalte Payload* ist nicht für alle Zeilen gesetzt, in denen die Spalte Datenquelltyp* auf INLINE gesetzt ist." - return false; - } - } - } - } - } else { - updateBtn.title = "Die Spalte Datenquelltyp* ist nicht für alle Zeilen gesetzt." - return false; - } - - - if (!batchList[i].selectedConverter) { - if(resourceType === "georesource") - updateBtn.title = "Die Spalte Geodaten-Quellformat* ist nicht für alle Zeilen gesetzt." - else - updateBtn.title = "Die Spalte Datensatz-Quellformat* ist nicht für alle Zeilen gesetzt." // for indicators - - return false; - } - } - - return true; - } - - - this.onDataSourceFileSelected = function(file, rowIndex, batchList) { - // set filename manually - let name = file.name; - $timeout(function() { - let dataSource = batchList[rowIndex].mappingObj.dataSource; - dataSource.parameters = []; - dataSource.name = name - batchList[rowIndex].mappingObj.dataSource = dataSource; - }); - } - - - this.onMappingTableSelected = function(resourceType, event, rowIndex, file, batchList) { - - let mappingObj = JSON.parse(event.target.result); - - batchList[rowIndex].mappingTableName = file.name; - - mappingObj.converter = this.converterParametersArrayToProperties(mappingObj.converter); - mappingObj.dataSource = this.dataSourceParametersArrayToProperty(mappingObj.dataSource); - - // set value of column "Datensatz-Quellformat*" by converter name - let converterName = mappingObj.converter.name - for(let i=0; i 0)) { - let fields = angular.element('[ng-model="' + resourceType + '.' + selectedCol + '"]'); - for(let i=0; i 0) { - // Only add if name isn't added already - if( !result.includes(converterName) ) { - result.push(converterName) - } - } - } - } - return result; - } - - // the variable availableGeoresources / availableIndicators (which is used to fill the ng-options) - // changes after each update, causing angularjs to loose the connection. - // this function restores the names - this.refreshNameColumn = function(resourceType, batchList) { - for(let i=0;i 0){ - // admin role is kommonitor-creator - if(keycloakRolesArray.includes(__env.keycloakKomMonitorAdminRoleName)){ - metadataKey += "_" + __env.keycloakKomMonitorAdminRoleName; - timestampKey += "_" + __env.keycloakKomMonitorAdminRoleName; - } - else{ - metadataKey += "_" + JSON.stringify(keycloakRolesArray); - timestampKey += "_" + JSON.stringify(keycloakRolesArray); - } - } - else{ - metadataKey += "_public"; - timestampKey += "_public"; - } - - - let lastModTimestamp_fromCache_string = localStorage.getItem(timestampKey); - - if (lastModTimestamp_fromCache_string) { - let lastModTimestamp_fromCache = JSON.parse(lastModTimestamp_fromCache_string); - - if (lastModTimestamp_fromCache) { - - let lastModTimestamp_fromServer = this.lastDatabaseModificationInfo[lastModificationResourceName]; - - if (lastModTimestamp_fromCache == lastModTimestamp_fromServer) { - let storageObject_string = localStorage.getItem(metadataKey); - - if (storageObject_string) { - let storageObject = JSON.parse(storageObject_string); - return storageObject; - } - } - } - } - - // when code reaches this place we must overwrite/set timestamp and actual metadata - - // persist last modification timestamp object as String in local storage - localStorage.setItem(timestampKey, JSON.stringify(this.lastDatabaseModificationInfo[lastModificationResourceName])); - - return await $http({ - url: this.baseUrlToKomMonitorDataAPI + resourceEndpoint, - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - localStorage.setItem(metadataKey, JSON.stringify(response.data)); - - return response.data; - }); - }; - - this.fetchAccessControlMetadata = async function (keycloakRolesArray) { - return await this.fetchResource_fromCacheOrServer(localStorageKey_accessControl, accessControlEndpoint, "access-control", keycloakRolesArray); - }; - - this.fetchTopicsMetadata = async function (keycloakRolesArray) { - return await this.fetchResource_fromCacheOrServer(localStorageKey_topics, topicsPublicEndpoint, "topics", keycloakRolesArray); - }; - - this.fetchSpatialUnitsMetadata = async function (keycloakRolesArray) { - return await this.fetchResource_fromCacheOrServer(localStorageKey_spatialUnits, spatialUnitsEndpoint, "spatial-units", keycloakRolesArray); - }; - - this.fetchIndicatorsMetadata = async function (keycloakRolesArray) { - return await this.fetchResource_fromCacheOrServer(localStorageKey_indicators, indicatorsEndpoint, "indicators", keycloakRolesArray); - }; - - this.fetchGeoresourceMetadata = async function (keycloakRolesArray) { - return await this.fetchResource_fromCacheOrServer(localStorageKey_georesources, georesourcesEndpoint, "georesources", keycloakRolesArray); - }; - - this.fetchProcessScriptsMetadata = async function (keycloakRolesArray) { - return await this.fetchResource_fromCacheOrServer(localStorageKey_processScripts, scriptsEndpoint, "process-scripts", keycloakRolesArray); - }; - - this.fetchSingleAccessControlMetadata = function (targetId, keycloakRolesArray) { - return $http({ - url: this.baseUrlToKomMonitorDataAPI + accessControlEndpoint + "/" + targetId, - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - // let cache be checked, but in the background, do not wait for it - self.fetchAccessControlMetadata(keycloakRolesArray); - return response.data; - }); - }; - - this.fetchSingleSpatialUnitMetadata = function (targetSpatialUnitId, keycloakRolesArray) { - return $http({ - url: this.baseUrlToKomMonitorDataAPI + spatialUnitsEndpoint + "/" + targetSpatialUnitId, - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - self.fetchSpatialUnitsMetadata(keycloakRolesArray); - return response.data; - - }); - }; - - this.fetchSingleGeoresourceMetadata = function (targetGeoresourceId, keycloakRolesArray) { - return $http({ - url: this.baseUrlToKomMonitorDataAPI + georesourcesEndpoint + "/" + targetGeoresourceId, - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - self.fetchGeoresourceMetadata(keycloakRolesArray); - return response.data; - - }); - }; - - this.fetchSingleIndicatorMetadata = function (targetIndicatorId, keycloakRolesArray) { - return $http({ - url: this.baseUrlToKomMonitorDataAPI + indicatorsEndpoint + "/" + targetIndicatorId, - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - self.fetchIndicatorsMetadata(keycloakRolesArray); - return response.data; - - }); - }; - - this.fetchSingleIndicatorScriptMetadata = function (targetScriptId, keycloakRolesArray) { - return $http({ - url: this.baseUrlToKomMonitorDataAPI + scriptsEndpoint + "/" + targetScriptId, - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - self.fetchProcessScriptsMetadata(keycloakRolesArray); - return response.data; - - }); - }; - - this.fetchSingleGeoresourceSchema = function (targetGeoresourceId) { - return $http({ - url: this.baseUrlToKomMonitorDataAPI + georesourcesEndpoint + "/" + targetGeoresourceId + "/schema", - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - return response.data; - - }); - }; - - this.fetchSingleGeoresourceWithoutGeometry = function (targetGeoresourceId) { - return $http({ - url: this.baseUrlToKomMonitorDataAPI + georesourcesEndpoint + "/" + targetGeoresourceId + "/allFeatures/without-geometry", - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - return response.data; - - }); - }; - - this.init = async function () { - this.checkAuthentication(); - - await this.fetchLastDatabaseModificationObject(); - }; - - this.init(); - - }]); diff --git a/app/util/genericServices/kommonitorConfigStorageService/kommonitor-config-storage-service.module.ts b/app/util/genericServices/kommonitorConfigStorageService/kommonitor-config-storage-service.module.ts deleted file mode 100644 index d199edc08..000000000 --- a/app/util/genericServices/kommonitorConfigStorageService/kommonitor-config-storage-service.module.ts +++ /dev/null @@ -1,157 +0,0 @@ -angular.module('kommonitorConfigStorage', ['kommonitorDataExchange']); - -angular - .module('kommonitorConfigStorage', []) - .service( - 'kommonitorConfigStorageService', ['$rootScope', '$timeout', 'kommonitorDataExchangeService', '$http', '__env', - function ($rootScope, $timeout, - kommonitorDataExchangeService, $http, __env) { - - this.postKeycloakConfig = async function(jsonString){ - - console.log("Trying to POST to config storage service to upload new keycloak config."); - - var formdata = new FormData(); - formdata.append("appConfig", new Blob([jsonString], { type: "application/json"})); - - return await $http({ - url: __env.configStorageServerConfig.targetUrlToConfigStorageServer_keycloakConfig, - method: "POST", - data: formdata, - // must set header content-type to undefined in order to send as multipart-formdata - headers: {"Content-Type": undefined, "Accept": "text/plain" }, - responseType: 'text' - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(response) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while posting to config storage service."); - throw response; - }); - }; - - this.postControlsConfig = async function(jsonString){ - - console.log("Trying to POST to config storage service to upload new controls config."); - - var formdata = new FormData(); - formdata.append("appConfig", new Blob([jsonString], { type: "application/json"})); - - return await $http({ - url: __env.configStorageServerConfig.targetUrlToConfigStorageServer_controlsConfig, - method: "POST", - data: formdata, - // must set header content-type to undefined in order to send as multipart-formdata - headers: {"Content-Type": undefined, "Accept": "text/plain" }, - responseType: 'text' - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(response) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while posting to config storage service."); - throw response; - }); - }; - - this.postAppConfig = async function(jsString){ - - console.log("Trying to POST to config storage service to upload new app config."); - - var formdata = new FormData(); - formdata.append("appConfig", new Blob([jsString], { type: "application/javascript"})); - - return await $http({ - url: __env.configStorageServerConfig.targetUrlToConfigStorageServer_appConfig, - method: "POST", - data: formdata, - // must set header content-type to undefined in order to send as multipart-formdata - headers: {"Content-Type": undefined, "Accept": "text/plain" }, - responseType: 'text' - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(response) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while posting to config storage service."); - throw response; - }); - }; - - this.getKeycloakConfig = async function(){ - return await $http({ - url: __env.configStorageServerConfig.targetUrlToConfigStorageServer_keycloakConfig, - method: "GET", - responseType: 'json' - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(response) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while getting keycloak config from config storage service."); - throw response; - }); - }; - - this.getControlsConfig = async function(){ - return await $http({ - url: __env.configStorageServerConfig.targetUrlToConfigStorageServer_controlsConfig, - method: "GET", - responseType: 'json' - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(response) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while getting keycloak config from config storage service."); - throw response; - }); - }; - - this.getAppConfig = async function(){ - return await $http({ - url: __env.configStorageServerConfig.targetUrlToConfigStorageServer_appConfig, - method: "GET", - responseType: 'text' - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(response) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while getting keycloak config from config storage service."); - throw response; - }); - }; - - }]); diff --git a/app/util/genericServices/kommonitorDataExchangeService/kommonitor-data-exchange-service.module.ts b/app/util/genericServices/kommonitorDataExchangeService/kommonitor-data-exchange-service.module.ts deleted file mode 100644 index 0cea61601..000000000 --- a/app/util/genericServices/kommonitorDataExchangeService/kommonitor-data-exchange-service.module.ts +++ /dev/null @@ -1,3088 +0,0 @@ -angular.module('kommonitorDataExchange', ['kommonitorMap', 'kommonitorKeycloakHelper']); - -/** - * a common serviceInstance that holds all needed properties for a WPS service. - * - * This service represents a shared object ´which is used across the different - * application tabs/components like Setup, Capabilities, Execute etc. - * - * This way, one single service instance can be used to easily share values and - * parameters for each WPS operation represented by different Angular components - */ -angular - .module('kommonitorDataExchange', ['kommonitorCacheHelper', 'angularjs-dropdown-multiselect']) - .service( - 'kommonitorDataExchangeService', ['$rootScope', '$timeout', '$interval', 'kommonitorMapService', 'kommonitorKeycloakHelperService', - 'kommonitorCacheHelperService', - '$http', '__env', '$q', 'Auth', - function($rootScope, $timeout, $interval, - kommonitorMapService, kommonitorKeycloakHelperService, kommonitorCacheHelperService, $http, __env, $q, Auth,) { - - let thisService = this; - this.appTitle = __env.appTitle; - - this.customLogoURL = __env.customLogoURL; - this.customLogo_onClickURL = __env.customLogo_onClickURL; - this.customLogoWidth = __env.customLogoWidth; - this.customGreetingsContact_name = __env.customGreetingsContact_name; - this.customGreetingsContact_organisation = __env.customGreetingsContact_organisation; - this.customGreetingsContact_mail = __env.customGreetingsContact_mail; - this.customGreetingsTextInfoMessage = __env.customGreetingsTextInfoMessage; // maybe undefined or empty string - - this.showDiagramExportButtons = true; - this.showGeoresourceExportButtons = true; - - var numberOfDecimals = __env.numberOfDecimals; - const DATE_PREFIX = __env.indicatorDatePrefix; - var defaultColorForZeroValues = __env.defaultColorForZeroValues; - var defaultColorForNoDataValues = __env.defaultColorForNoDataValues; - var defaultColorForFilteredValues = __env.defaultColorForFilteredValues; - - const defaultColorForOutliers_high = __env.defaultColorForOutliers_high; - const defaultBorderColorForOutliers_high = __env.defaultBorderColorForOutliers_high; - const defaultFillOpacityForOutliers_high = __env.defaultFillOpacityForOutliers_high; - const defaultColorForOutliers_low = __env.defaultColorForOutliers_low; - const defaultBorderColorForOutliers_low = __env.defaultBorderColorForOutliers_low; - const defaultFillOpacityForOutliers_low = __env.defaultFillOpacityForOutliers_low; - - - - var self = this; - - this.headlineIndicatorHierarchy = []; - this.computationIndicatorHierarchy = []; - this.topicIndicatorHierarchy = []; - this.topicIndicatorHierarchy_forOrderView = []; - - this.topicGeoresourceHierarchy = []; - this.topicGeoresourceHierarchy_unmappedEntries = {}; - this.georesourceMapKey_forUnmappedTopicReferences = "unmapped"; - - this.enableKeycloakSecurity = __env.enableKeycloakSecurity; - this.currentKeycloakLoginRoles = []; - this.currentKomMonitorLoginRoleNames = []; - this.currentKeycloakUser; - - // MAP objects for available resource metadata in order to have quick access to datasets by ID - this.availableIndicators_map = new Map(); - this.availableGeoresources_map = new Map(); - this.availableSpatialUnits_map = new Map(); - this.availableProcessScripts_map = new Map(); - - this.accessControl = []; - this.accessControl_map = new Map(); - - // Define translations, settings for dropdown-multiselect - this.multiselectDropdownTranslations = { checkAll: 'Alle auswählen', uncheckAll: 'Nichts auswählen', dynamicButtonTextSuffix: 'Werte ausgewählt', - buttonDefaultText: 'Objekteigenschaften auswählen', searchPlaceholder: 'Suchen...' - }; - - this.multiselectDropdownSettings = { - enableSearch: true, clearSearchOnClose: true, - scrollableHeight: '250px', scrollable: true, - buttonClasses: 'form-control btn-block', - template: '{{option}}', smartButtonTextConverter(skip, option) { return option; }, - styleActive: true - }; - - // Filter out roles unrelated to kommonitor - this.setCurrentKomMonitorLoginRoleNames = function() { - var possibleRoles = ["manage-realm"] - this.accessControl.forEach(organizationalUnit => { - organizationalUnit.roles.forEach(role => { - possibleRoles.push(organizationalUnit.name + "-" + role.permissionLevel) - }); - }); - this.currentKomMonitorLoginRoleNames = this.currentKeycloakLoginRoles.filter(role => possibleRoles.includes(role)); - } - - this.setCurrentKomMonitorLoginRoleIds = function() { - this.currentKomMonitorLoginRoleIds = []; - - // make a map of all role names currently logged in user according to pattern - // - - let roleNameMap_loggedIn = new Map(); - - for (const roleName of this.currentKeycloakLoginRoles) { - // roleName consists of - - roleNameMap_loggedIn.set(roleName, ""); - } - - // now iterate once over all possible KomMonitor roles and check if they are within previous map - this.accessControl.forEach(organizationalUnit => { - organizationalUnit.roles.forEach(role => { - if(roleNameMap_loggedIn.has(organizationalUnit.name + "-" + role.permissionLevel)){ - this.currentKomMonitorLoginRoleIds.push(role.roleId); - } - }); - }); - }; - - this.getCurrentKomMonitorLoginRoleIds = function() { - return this.currentKomMonitorLoginRoleIds; - }; - - - this.isAllowedSpatialUnitForCurrentIndicator = function(spatialUnitMetadata){ - if(! this.selectedIndicator){ - return false; - } - - if(! spatialUnitMetadata || ! spatialUnitMetadata.spatialUnitLevel){ - return false; - } - - var filteredApplicableUnits = this.selectedIndicator.applicableSpatialUnits.filter(function (applicableSpatialUnit) { - if (applicableSpatialUnit.spatialUnitId === spatialUnitMetadata.spatialUnitId){ - return true; - } - else{ - return false; - } - }); - - return filteredApplicableUnits.length > 0; - }; - - this.FEATURE_ID_PROPERTY_NAME = __env.FEATURE_ID_PROPERTY_NAME; - this.FEATURE_NAME_PROPERTY_NAME = __env.FEATURE_NAME_PROPERTY_NAME; - this.VALID_START_DATE_PROPERTY_NAME = __env.VALID_START_DATE_PROPERTY_NAME; - this.VALID_END_DATE_PROPERTY_NAME = __env.VALID_END_DATE_PROPERTY_NAME; - this.indicatorDatePrefix = __env.indicatorDatePrefix; - - this.datePickerOptions = { - autoclose: true, - language: 'de', - format: 'yyyy-mm-dd' - }; - - this.disableIndicatorDatePicker = false; - - this.getLimitedDatePickerOptions = function(availableDates){ - - var months = new Map(); - - var years = new Map(); - - var yearMonths = new Map(); - - for (const dateString of availableDates) { - var date = new Date(dateString); - var month = date.getMonth() + 1; - var year = date.getFullYear(); - var yearMonth = year + "-" + month; - - months.set(month, month); - years.set(year, year); - yearMonths.set(yearMonth, yearMonth); - } - - var newDatePickerOptions = { - autoclose: true, - language: 'de', - format: 'yyyy-mm-dd', - endDate: new Date(availableDates[availableDates.length - 1]), - startDate: new Date(availableDates[0]), - defaultViewDate: new Date(availableDates[availableDates.length - 1]), - beforeShowDay: function(date) { - var month = (date.getMonth()+1); - if (month < 10 ){ - month = "0" + month; - } - var day = (date.getDate()); - if (day < 10 ){ - day = "0" + day; - } - var dateString = date.getFullYear() + "-" + month + "-" + day; - - if (availableDates.includes(dateString)) { - - return "enabled-datepicker-item"; - - } else { - - return "disabled disabled-datepicker-item"; - - } - }, - beforeShowMonth: function(date) { - var month = date.getMonth()+1; - var year = date.getFullYear(); - var yearMonth = year + "-" + month; - - if (yearMonths.has(yearMonth)) { - - return "enabled-datepicker-item"; - - } else { - - return "disabled disabled-datepicker-item"; - - } - }, - beforeShowYear: function(date) { - var year = date.getFullYear(); - - if (years.has(year)) { - - return "enabled-datepicker-item"; - - } else { - - return "disabled disabled-datepicker-item"; - - } - }, - beforeShowDecade: function(date) { - var year = date.getFullYear(); - - if (years.has(year)) { - - return "enabled-datepicker-item"; - - } else { - - return "disabled disabled-datepicker-item"; - - } - }, - beforeShowCentury: function(date) { - var year = date.getFullYear(); - - if (years.has(year)) { - - return "enabled-datepicker-item"; - - } else { - - return "disabled disabled-datepicker-item"; - - } - } - }; - - return newDatePickerOptions; - }; - - this.adminUserName = __env.adminUserName; - this.adminPassword = __env.adminPassword; - this.adminIsLoggedIn = false; - - this.availablePoiMarkerColors = [ - { - "colorName" : "red", - "colorValue" : "rgb(205,59,40)" - }, - { - "colorName" : "white", - "colorValue" : "rgb(255,255,255)" - }, - { - "colorName" : "orange", - "colorValue" : "rgb(235,144,46)" - }, - { - "colorName" : "beige", - "colorValue" : "rgb(255,198,138)" - }, - { - "colorName" : "green", - "colorValue" : "rgb(108,166,36)" - }, - { - "colorName" : "blue", - "colorValue" : "rgb(53,161,209)" - }, - { - "colorName" : "purple", - "colorValue" : "rgb(198,77,175)" - }, - { - "colorName" : "pink", - "colorValue" : "rgb(255,138,232)" - }, - { - "colorName" : "gray", - "colorValue" : "rgb(163,163,163)" - }, - { - "colorName" : "black", - "colorValue" : "rgb(47,47,47)" - } - ]; - - this.availableLoiDashArrayObjects = [ - { - "svgString" : '', - "dashArrayValue" : "" - }, - { - "svgString" : '', - "dashArrayValue" : "20" - }, - { - "svgString" : '', - "dashArrayValue" : "20 10" - }, - { - "svgString" : '', - "dashArrayValue" : "20 10 5 10" - }, - { - "svgString" : '', - "dashArrayValue" : "5" - } - ]; - - this.getLoiDashSvgFromStringValue = function(loiDashArrayString){ - for (const loiDashArrayObject of this.availableLoiDashArrayObjects) { - if(loiDashArrayObject.dashArrayValue == loiDashArrayString){ - return loiDashArrayObject.svgString; - } - } - }; - - this.kommonitorMapServiceInstance = kommonitorMapService; - - this.updateIntervalOptions = __env.updateIntervalOptions; - this.indicatorTypeOptions = __env.indicatorTypeOptions; - this.indicatorUnitOptions = __env.indicatorUnitOptions.sort(); - this.indicatorCreationTypeOptions = __env.indicatorCreationTypeOptions; - this.geodataSourceFormats = __env.geodataSourceFormats; - - this.anySideBarIsShown = false; - - this.isMeasureOfValueChecked = false; - this.isBalanceChecked = false; - this.indicatorAndMetadataAsBalance; - this.tmpIndicatorGeoJSON = undefined; - - this.wmsUrlForSelectedIndicator = undefined; - this.wfsUrlForSelectedIndicator = undefined; - - this.baseUrlToKomMonitorDataAPI = __env.apiUrl + __env.basePath; - this.simplifyGeometriesParameterName = __env.simplifyGeometriesParameterName; - this.simplifyGeometriesOptions = __env.simplifyGeometriesOptions; - this.simplifyGeometries = __env.simplifyGeometries; - - this.wmsDatasets = __env.wmsDatasets.sort((a, b) => (a.title > b.title) ? 1 : -1); - this.wfsDatasets = __env.wfsDatasets.sort((a, b) => (a.title > b.title) ? 1 : -1); - this.wmsDatasets_keywordFiltered = JSON.parse(JSON.stringify(this.wmsDatasets)); - this.wfsDatasets_keywordFiltered = JSON.parse(JSON.stringify(this.wfsDatasets)); - - - this.fileDatasets = []; - - this.availableRoles = []; - this.availableUsers = []; - this.availableProcessScripts = []; - this.isochroneLegend; - - this.useOutlierDetectionOnIndicator = __env.useOutlierDetectionOnIndicator; - this.classifyZeroSeparately = __env.classifyZeroSeparately; - this.classifyUsingWholeTimeseries = __env.classifyUsingWholeTimeseries; - this.useNoDataToggle = __env.useNoDataToggle; - - this.getUpdateIntervalDisplayValue = function(apiValue){ - for (const updateIntervalOption of this.updateIntervalOptions) { - if(updateIntervalOption.apiName === apiValue){ - return updateIntervalOption.displayName - } - } - }; - - this.getBaseUrlToKomMonitorDataAPI_spatialResource = function(){ - return this.baseUrlToKomMonitorDataAPI + kommonitorCacheHelperService.spatialResourceGETUrlPath_forAuthentication; - }; - - this.setProcessScripts = function(scriptsArray){ - this.availableProcessScripts = scriptsArray; - this.availableProcessScripts_map = new Map(); - for (const scriptMetadata of scriptsArray) { - this.availableProcessScripts_map.set(scriptMetadata.scriptId, scriptMetadata); - } - }; - - this.addSingleProcessScriptMetadata = function(processScriptMetadata){ - let tmpArray = [processScriptMetadata]; - Array.prototype.push.apply(tmpArray, this.availableProcessScripts); - this.availableProcessScripts = tmpArray; - this.availableProcessScripts_map.set(processScriptMetadata.scriptId, processScriptMetadata); - }; - - this.replaceSingleProcessScriptMetadata = function(processScriptMetadata){ - for (let index = 0; index < this.availableProcessScripts.length; index++) { - let processScript = this.availableProcessScripts[index]; - if(processScript.scriptId == processScriptMetadata.scriptId){ - this.availableProcessScripts[index] = processScriptMetadata; - break; - } - } - this.availableProcessScripts_map.set(processScriptMetadata.scriptId, processScriptMetadata); - }; - - this.deleteSingleProcessScriptMetadata = function(processScriptId){ - for (let index = 0; index < this.availableProcessScripts.length; index++) { - const processScript = this.availableProcessScripts[index]; - if(processScript.scriptId == processScriptId){ - this.availableProcessScripts.splice(index, 1); - break; - } - } - this.availableProcessScripts_map.delete(processScriptId); - }; - - this.getProcessScriptMetadataById = function(scriptId){ - return this.availableProcessScripts_map.get(scriptId); - }; - - - // ERROR HANDLING - this.errorMessage = undefined; - this.hideErrorAlert = function(){ - $(".mapApplicationErrorAlert").hide(); - }; - - this.displayMapApplicationError = function(error){ - $timeout(function () { - if(error.data){ - self.errorMessage = self.syntaxHighlightJSON(error.data); - } - if(error.message){ - self.errorMessage = self.syntaxHighlightJSON(error.message); - } - else{ - self.errorMessage = self.syntaxHighlightJSON(error); - } - - // $rootScope.$apply(); - $rootScope.$broadcast("hideLoadingIconOnMap"); - - $(".mapApplicationErrorAlert").show(); - }, 1000); - - }; - - // SPATIAL UNITS - - this.availableSpatialUnits = []; - - this.selectedSpatialUnit; - this.selectedDate; - - this.setSpatialUnits = function(spatialUnitsArray){ - this.availableSpatialUnits = spatialUnitsArray; - this.availableSpatialUnits_map = new Map(); - for (const spatialUnitMetadata of spatialUnitsArray) { - this.availableSpatialUnits_map.set(spatialUnitMetadata.spatialUnitId, spatialUnitMetadata); - } - }; - - this.addSingleSpatialUnitMetadata = function(spatialUnitMetadata){ - let tmpArray = [spatialUnitMetadata]; - Array.prototype.push.apply(tmpArray, this.availableSpatialUnits); - this.availableSpatialUnits = tmpArray; - this.availableSpatialUnits_map.set(spatialUnitMetadata.spatialUnitId, spatialUnitMetadata); - }; - - this.replaceSingleSpatialUnitMetadata = function(spatialUnitMetadata){ - for (let index = 0; index < this.availableSpatialUnits.length; index++) { - let spatialUnit = this.availableSpatialUnits[index]; - if(spatialUnit.spatialUnitId == spatialUnitMetadata.spatialUnitId){ - this.availableSpatialUnits[index] = spatialUnitMetadata; - break; - } - } - this.availableSpatialUnits_map.set(spatialUnitMetadata.spatialUnitId, spatialUnitMetadata); - }; - - this.deleteSingleSpatialUnitMetadata = function(spatialUnitId){ - for (let index = 0; index < this.availableSpatialUnits.length; index++) { - const spatialUnit = this.availableSpatialUnits[index]; - if(spatialUnit.spatialUnitId == spatialUnitId){ - this.availableSpatialUnits.splice(index, 1); - break; - } - } - this.availableSpatialUnits_map.delete(spatialUnitId); - }; - - // GEORESOURCES - - this.availableGeoresources = []; - this.displayableGeoresources = []; - this.displayableGeoresources_keywordFiltered = []; - this.displayableGeoresources_keywordFiltered_forAlphabeticalDisplay = {}; - - this.selectedGeoresource; - - this.setGeoresources = function(georesourcesArray){ - this.availableGeoresources = georesourcesArray; - - this.availableGeoresources_map = new Map(); - for (const georesourceMetadata of georesourcesArray) { - this.availableGeoresources_map.set(georesourceMetadata.georesourceId, georesourceMetadata); - } - - this.displayableGeoresources = this.availableGeoresources.filter(item => self.isDisplayableGeoresource(item)); - this.displayableGeoresources_keywordFiltered = JSON.parse(JSON.stringify(this.displayableGeoresources)); - - this.wmsDatasets_keywordFiltered = JSON.parse(JSON.stringify(this.wmsDatasets)); - this.wfsDatasets_keywordFiltered = JSON.parse(JSON.stringify(this.wfsDatasets)); - - this.displayableGeoresources_keywordFiltered_forAlphabeticalDisplay = { - poiData: this.displayableGeoresources_keywordFiltered.filter(item => item.isPOI), - loiData: this.displayableGeoresources_keywordFiltered.filter(item => item.isLOI), - aoiData: this.displayableGeoresources_keywordFiltered.filter(item => item.isAOI), - wmsData: this.wmsDatasets_keywordFiltered, - wfsData: this.wfsDatasets_keywordFiltered - }; - }; - - this.addSingleGeoresourceMetadata = function(georesourceMetadata){ - let tmpArray = [georesourceMetadata]; - Array.prototype.push.apply(tmpArray, this.availableGeoresources); - this.availableGeoresources = tmpArray; - this.availableGeoresources_map.set(georesourceMetadata.georesourceId, georesourceMetadata); - }; - - this.replaceSingleGeoresourceMetadata = function(georesourceMetadata){ - for (let index = 0; index < this.availableGeoresources.length; index++) { - let georesource = this.availableGeoresources[index]; - if(georesource.georesourceId == georesourceMetadata.georesourceId){ - this.availableGeoresources[index] = georesourceMetadata; - break; - } - } - this.availableGeoresources_map.set(georesourceMetadata.georesourceId, georesourceMetadata); - }; - - this.deleteSingleGeoresourceMetadata = function(georesourceId){ - for (let index = 0; index < this.availableGeoresources.length; index++) { - const georesource = this.availableGeoresources[index]; - if(georesource.georesourceId == georesourceId){ - this.availableGeoresources.splice(index, 1); - break; - } - } - this.availableGeoresources_map.delete(georesourceId); - }; - - // INDICATORS - - this.availableIndicators = []; - this.displayableIndicators = []; - - this.selectedIndicator; - // backup used when switching themes --< this might make selectedIndicator undefined due to filtering list of theme-matching indicators - this.selectedIndicatorBackup; - this.wmsUrlForSelectedIndicator; - this.wfsUrlForSelectedIndicator; - - this.selectedIndicatorLegendURL; - - this.measureOfValue = 51; - - // updateInterval (from kommonitor data management api) = ['ARBITRARY', 'MONTHLY', 'QUARTERLY', 'HALF_YEARLY', 'YEARLY'] - this.updateInterval = new Map(); - this.updateInterval.set("ARBITRARY", "beliebig"); - this.updateInterval.set("YEARLY", "jährlich"); - this.updateInterval.set("HALF_YEARLY", "halbjährig"); - this.updateInterval.set("MONTHLY", "monatlich"); - this.updateInterval.set("QUARTERLY", "vierteljährlich"); - - this.setIndicators = function(indicatorsArray){ - this.availableIndicators = indicatorsArray; - this.availableIndicators_map = new Map(); - - for (const indicatorMetadata of indicatorsArray) { - this.availableIndicators_map.set(indicatorMetadata.indicatorId, indicatorMetadata); - } - }; - - this.addSingleIndicatorMetadata = function(indicatorMetadata){ - let tmpArray = [indicatorMetadata]; - Array.prototype.push.apply(tmpArray, this.availableIndicators); - this.availableIndicators = tmpArray; - this.availableIndicators_map.set(indicatorMetadata.indicatorId, indicatorMetadata); - }; - - this.replaceSingleIndicatorMetadata = function(indicatorMetadata){ - for (let index = 0; index < this.availableIndicators.length; index++) { - let indicator = this.availableIndicators[index]; - if(indicator.indicatorId == indicatorMetadata.indicatorId){ - this.availableIndicators[index] = indicatorMetadata; - break; - } - } - this.availableIndicators_map.set(indicatorMetadata.indicatorId, indicatorMetadata); - }; - - this.deleteSingleIndicatorMetadata = function(indicatorId){ - for (let index = 0; index < this.availableIndicators.length; index++) { - const indicator = this.availableIndicators[index]; - if(indicator.indicatorId == indicatorId){ - this.availableIndicators.splice(index, 1); - break; - } - } - this.availableIndicators_map.delete(indicatorId); - }; - - - // TOPICS - - this.availableTopics = []; - - this.selectedTopic; - - this.setTopics = function(topicsArray){ - this.availableTopics = topicsArray; - }; - - this.topicHierarchyContainsGeoresource = function(topic, georesourceMetadata){ - // luckily, the topicReference is defined exactly like for indicators - // hence we can simply refer to that method - - return this.topicHierarchyContainsIndicator(topic, georesourceMetadata); - }; - - this.topicHierarchyContainsWms = function(topic, wmsMetadata){ - // luckily, the topicReference is defined exactly like for indicators - // hence we can simply refer to that method - - return this.topicHierarchyContainsIndicator(topic, wmsMetadata); - }; - - this.topicHierarchyContainsWfs = function(topic, wfsMetadata){ - // luckily, the topicReference is defined exactly like for indicators - // hence we can simply refer to that method - - return this.topicHierarchyContainsIndicator(topic, wfsMetadata); - }; - - this.topicHierarchyContainsIndicator = function(topic, indicatorMetadata){ - if(topic === null || topic === ""){ - if (indicatorMetadata.topicReference === null || indicatorMetadata.topicReference === "" || ! this.referencedTopicIdExists(indicatorMetadata.topicReference)){ - return true; - } - else{ - return false; - } - } - - if (topic.topicId === indicatorMetadata.topicReference){ - return true; - } - else{ - return this.anySubTopicContainsIndicator(topic, indicatorMetadata); - } - }; - - this.anySubTopicContainsIndicator = function(topic, indicatorMetadata){ - var isContained = false; - - for (const subTopic of topic.subTopics) { - isContained = this.topicHierarchyContainsIndicator(subTopic, indicatorMetadata); - - if(isContained){ - break; - } - } - - return isContained; - }; - - // topic may be null - this.getGeoresourceDatasets = function(topic, georesourceNameFilter, showPOI, showLOI, showAOI, showWMS, showWFS){ - var availableGeoresources = this.getAvailableGeoresources(topic, georesourceNameFilter, showPOI, showLOI, showAOI); - var wmsDatasets = this.getAvailableWmsDatasets(topic, georesourceNameFilter, showWMS); - var wfsDatasets = this.getAvailableWfsDatasets(topic, georesourceNameFilter, showWFS); - - var datasets = availableGeoresources.concat(wmsDatasets).concat(wfsDatasets); - return datasets; - }; - - this.getNumberOfGeoresources = function(topic, georesourceNameFilter, showPOI, showLOI, showAOI, showWMS, showWFS){ - - var numberOfAvailableGeoresources = this.getNumberOfAvailableGeoresources(topic, georesourceNameFilter, showPOI, showLOI, showAOI); - var numberOfWmsDatasets = this.getNumberOfAvailableWmsDatasets(topic, georesourceNameFilter, showWMS); - var numberOfWfsDatasets = this.getNumberOfAvailableWfsDatasets(topic, georesourceNameFilter, showWFS); - - var numberOfResources = numberOfAvailableGeoresources + numberOfWmsDatasets + numberOfWfsDatasets; - return numberOfResources; - }; - - var filterGeoresourcesByTypes = function(georesourceMetadataArray, showPOI, showLOI, showAOI){ - - if(!showPOI && !showLOI && !showAOI){ - return []; - } - - return georesourceMetadataArray.filter(georesourceMetadata => { - if(georesourceMetadata.isPOI){ - if(showPOI){ - return true; - } - else{ - return false; - } - } - else if(georesourceMetadata.isLOI){ - if(showLOI){ - return true; - } - else{ - return false; - } - } - else if(georesourceMetadata.isAOI){ - if(showAOI){ - return true; - } - else{ - return false; - } - } - else{ - return false; - } - }); - }; - - this.getAvailableGeoresources = function(topic, georesourceNameFilter, showPOI, showLOI, showAOI){ - var georesources = []; - - var filteredGeoresources = this.availableGeoresources; - - filteredGeoresources = filterByGeoresourceNamesToHide(filteredGeoresources); - - if(georesourceNameFilter && georesourceNameFilter != ""){ - filteredGeoresources = filterArrayObjectsByValue(filteredGeoresources, georesourceNameFilter); - } - - filteredGeoresources = filterGeoresourcesByTypes(filteredGeoresources, showPOI, showLOI, showAOI); - - for (const georesourceMetadata of filteredGeoresources) { - if (this.topicHierarchyContainsGeoresource(topic, georesourceMetadata)){ - georesources.push(georesourceMetadata); - } - } - - return georesources; - }; - - this.getNumberOfAvailableGeoresources = function(topic, georesourceNameFilter, showPOI, showLOI, showAOI){ - return this.getAvailableGeoresources(topic, georesourceNameFilter, showPOI, showLOI, showAOI).length; - }; - - this.getAvailableWmsDatasets = function(topic, georesourceNameFilter, showWMS){ - if(!showWMS){ - return []; - } - - var wmsDatasets = []; - - var filteredWmsDatasets = this.wmsDatasets; - - if(georesourceNameFilter && georesourceNameFilter != ""){ - filteredWmsDatasets = filterArrayObjectsByValue(filteredWmsDatasets, georesourceNameFilter); - } - - for (const wmsMetadata of filteredWmsDatasets) { - if (this.topicHierarchyContainsWms(topic, wmsMetadata)){ - wmsDatasets.push(wmsMetadata); - } - } - - return wmsDatasets; - }; - - this.getNumberOfAvailableWmsDatasets = function(topic, georesourceNameFilter, showWMS){ - if(!showWMS){ - return 0; - } - - return this.getAvailableWmsDatasets(topic, georesourceNameFilter, showWMS).length; - }; - - this.getAvailableWfsDatasets = function(topic, georesourceNameFilter, showWFS){ - if(!showWFS){ - return []; - } - - var wfsDatasets = []; - - var filteredWfsDatasets = this.wfsDatasets; - - if(georesourceNameFilter && georesourceNameFilter != ""){ - filteredWfsDatasets = filterArrayObjectsByValue(filteredWfsDatasets, georesourceNameFilter); - } - - for (const wfsMetadata of filteredWfsDatasets) { - if (this.topicHierarchyContainsWms(topic, wfsMetadata)){ - wfsDatasets.push(wfsMetadata); - } - } - - return wfsDatasets; - }; - - this.getNumberOfAvailableWfsDatasets = function(topic, georesourceNameFilter, showWFS){ - if(!showWFS){ - return 0; - } - - return this.getAvailableWfsDatasets(topic, georesourceNameFilter, showWFS).length; - }; - - this.getNumberOfIndicators = function(topic, indicatorNameFilter){ - var numberOfIndicators = 0; - - var filteredIndicators = this.availableIndicators; - - if(indicatorNameFilter && indicatorNameFilter != ""){ - filteredIndicators = filterArrayObjectsByValue(this.availableIndicators, indicatorNameFilter); - } - - filteredIndicators = filterByIndicatorNamesToHide(filteredIndicators); - - for (const indicatorMetadata of filteredIndicators) { - if (this.topicHierarchyContainsIndicator(topic, indicatorMetadata)){ - numberOfIndicators++; - } - } - - return numberOfIndicators; - }; - - var filterByIndicatorNamesToHide = function(filteredIndicators){ - - return filteredIndicators.filter(indicatorMetadata => { - return isDisplayableIndicator(indicatorMetadata); - }); - }; - - var filterByGeoresourceNamesToHide = function(filteredGeoresources){ - - return filteredGeoresources.filter(georesourceMetadata => { - return self.isDisplayableGeoresource(georesourceMetadata); - }); - }; - - var filterArrayObjectsByValue = function (array, string) { - return array.filter(o => { - return Object.keys(o).some(k => { - if (typeof o[k] === 'string') - return o[k].toLowerCase().includes(string.toLowerCase()); - }); - }); - }; - - this.getIndicatorMetadataById = function(indicatorId){ - return this.availableIndicators_map.get(indicatorId); - }; - - this.getGeoresourceMetadataById = function(georesourceId){ - return this.availableGeoresources_map.get(georesourceId); - }; - - this.getSpatialUnitMetadataById = function(spatialUnitId){ - return this.availableSpatialUnits_map.get(spatialUnitId); - }; - - this.getIndicatorAbbreviationFromIndicatorId = function(indicatorId){ - for (var indicatorMetadata of this.availableIndicators) { - if (indicatorMetadata.indicatorId === indicatorId){ - return indicatorMetadata.abbreviation; - } - } - }; - - this.getIndicatorNameFromIndicatorId = function(indicatorId){ - for (var indicatorMetadata of this.availableIndicators) { - if (indicatorMetadata.indicatorId === indicatorId){ - return indicatorMetadata.indicatorName; - } - } - }; - - this.getGeoresourceNameFromGeoresourceId = function(georesourceId){ - for (var georesourceMetadata of this.availableGeoresources) { - if (georesourceMetadata.georesourceId === georesourceId){ - return georesourceMetadata.datasetName; - } - } - }; - - this.referencedTopicIdExists = function(topicId){ - var topicHierarchy = this.getTopicHierarchyForTopicId(topicId); - - if(topicHierarchy.length === 0){ - return false; - } - else{ - return true; - } - }; - - this.getTopicHierarchyForTopicId = function(topicReferenceId){ - // create an array respresenting the topic hierarchy - // i.e. [mainTopic_firstTier, subTopic_secondTier, subTopic_thirdTier, ...] - var topicHierarchyArray = []; - - for (var i = 0; i < this.availableTopics.length; i++) { - - var mainTopicCandidate = this.availableTopics[i]; - - if(mainTopicCandidate.topicId === topicReferenceId){ - topicHierarchyArray.push(mainTopicCandidate); - break; - } - - else if(this.findIdInAnySubTopicHierarchy(topicReferenceId, mainTopicCandidate.subTopics)){ - topicHierarchyArray.push(mainTopicCandidate); - topicHierarchyArray = this.addSubTopicHierarchy(topicHierarchyArray, topicReferenceId, mainTopicCandidate.subTopics); - } - } - - return topicHierarchyArray; - }; - - this.findIdInAnySubTopicHierarchy = function(topicReferenceId, subTopicsArray){ - for (let index = 0; index < subTopicsArray.length; index++) { - const subTopicCandidate = subTopicsArray[index]; - - if(subTopicCandidate.topicId === topicReferenceId){ - return true; - } - - else if(this.findIdInAnySubTopicHierarchy(topicReferenceId, subTopicCandidate.subTopics)){ - return true; - } - } - - return false; - }; - - this.addSubTopicHierarchy = function(topicHierarchyArray, topicReferenceId, subTopicsArray){ - for (let index = 0; index < subTopicsArray.length; index++) { - const subTopicCandidate = subTopicsArray[index]; - - if(subTopicCandidate.topicId === topicReferenceId){ - topicHierarchyArray.push(subTopicCandidate); - break; - } - - else if(this.findIdInAnySubTopicHierarchy(topicReferenceId, subTopicCandidate.subTopics)){ - topicHierarchyArray.push(subTopicCandidate); - topicHierarchyArray = this.addSubTopicHierarchy(topicHierarchyArray, topicReferenceId, subTopicCandidate.subTopics); - } - } - - return topicHierarchyArray; - }; - - this.syntaxHighlightJSON = function(json) { - if (typeof json != 'string') { - json = JSON.stringify(json, undefined, 2); - } - json = json.replace(/&/g, '&').replace(//g, '>'); - return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match) { - var cls = 'number'; - if (/^"/.test(match)) { - if (/:$/.test(match)) { - cls = 'key'; - } else { - cls = 'string'; - } - } else if (/true|false/.test(match)) { - cls = 'boolean'; - } else if (/null/.test(match)) { - cls = 'null'; - } - return '' + match + ''; - }); - }; - - - - this.extendKeycloakSession = function () { - // Auth.keycloak.updateToken(5).then(function () { - // console.log("keycloak token refreshed."); - // }).catch(function () { - // console.error('Failed to refresh token. Will redirect to Login screen'); - // Auth.keycloak.login(); - // }); - - Auth.keycloak.login(); - }; - - this.tryLogoutUser = function() { - Auth.keycloak.logout(); - }; - - var startCheckSessionExpiration = function(){ - $interval(function () { - // minutes until current browser session invalidates - // use refresh token as this is used when calling "updateToken" keycloak method. Only if that is invalid the whole session is invalid - self.keycloakTokenExpirationInfo = Math.round((Auth.keycloak.refreshTokenParsed.exp + Auth.keycloak.timeSkew - new Date().getTime() / 1000) / 60); - if(! self.keycloakTokenExpirationInfo){ - self.keycloakTokenExpirationInfo = 30; - } - - // if session is expired then show warning to User! - if (self.keycloakTokenExpirationInfo < 0){ - self.keycloakTokenExpirationInfo = 0; - self.displayMapApplicationError("Ihre aktuelle Login-Session ist abgelaufen. Sie müssen sich neu einloggen. Nutzen Sie dazu das User-Menü oben rechts."); - } - - }, 1000 * 60); - }; - - /* - * FETCH INITIAL METADATA ABOUT EACH RESOURCE - */ - - // $rootScope.$on("$locationChangeStart", function(event){ - // self.fetchAllMetadata(); - // self.adminIsLoggedIn = false; - // }); - - this.fetchAllMetadata = async function(){ - console.log("fetching all metadata from management component"); - - // var metadataPromises = [topicsPromise, usersPromise, rolesPromise, spatialUnitsPromise, georesourcesPromise, indicatorsPromise, scriptsPromise]; - var metadataPromises = []; - - if (Auth.keycloak.authenticated){ - await Auth.keycloak.loadUserProfile() - .then(function (profile) { - // set user profile - self.currentKeycloakUser = profile; - console.log("User logged in with email: " + profile.email); - - if(Auth.keycloak.tokenParsed && Auth.keycloak.tokenParsed.realm_access && Auth.keycloak.tokenParsed.realm_access.roles){ - self.currentKeycloakLoginRoles = Auth.keycloak.tokenParsed.realm_access.roles; - if (Auth.keycloak.tokenParsed.resource_access["realm-management"]) { - self.isRealmAdmin = true; - self.currentKeycloakLoginRoles = self.currentKeycloakLoginRoles.concat(Auth.keycloak.tokenParsed.resource_access["realm-management"].roles); - } - } else { - self.currentKeycloakLoginRoles = []; - } - - // set token expiration - startCheckSessionExpiration(); - }) - .catch(function () { - console.log('Failed to load user profile'); - }); - var promise = await this.fetchAccessControlMetadata(self.currentKeycloakLoginRoles); - metadataPromises.push(promise); - } - - //TODO revise metadata fecthing for protected endpoints - var scriptsPromise = await this.fetchIndicatorScriptsMetadata(self.currentKeycloakLoginRoles); - var topicsPromise = await this.fetchTopicsMetadata(self.currentKeycloakLoginRoles); - var spatialUnitsPromise = await this.fetchSpatialUnitsMetadata(self.currentKeycloakLoginRoles); - var georesourcesPromise = await this.fetchGeoresourcesMetadata(self.currentKeycloakLoginRoles); - var indicatorsPromise = await this.fetchIndicatorsMetadata(self.currentKeycloakLoginRoles); - metadataPromises.push(scriptsPromise); - metadataPromises.push(topicsPromise); - metadataPromises.push(spatialUnitsPromise); - metadataPromises.push(georesourcesPromise); - metadataPromises.push(indicatorsPromise); - - $q.all(metadataPromises).then(function successCallback(successArray) { - - self.modifyIndicatorApplicableSpatialUnitsForLoginRoles(); - - self.buildHeadlineIndicatorHierarchy(); - self.buildTopicIndicatorHierarchy(); - self.topicIndicatorHierarchy_forOrderView = JSON.parse(JSON.stringify(self.topicIndicatorHierarchy)); - self.buildComputationIndicatorHierarchy(); - - self.buildTopicGeoresourceHierarchy(); - - console.log("Metadata fetched. Call initialize event."); - onMetadataLoadingCompleted(); - - $timeout(function(){ - $('.list-group-item > .collapseTrigger').on('click', function() { - $('.glyphicon', this) - .toggleClass('glyphicon-chevron-right') - .toggleClass('glyphicon-chevron-down'); - - }); - }); - }, function errorCallback(errorArray) { - // todo error handling - self.displayMapApplicationError("Beim Laden der erforderlichen Anwendungsdaten ist ein Fehler aufgetreten. Bitte wenden Sie sich an Ihren Administrator."); - $rootScope.$broadcast("initialMetadataLoadingFailed", errorArray); - }); - - }; - - this.modifyIndicatorApplicableSpatialUnitsForLoginRoles = function(){ - var availableSpatialUnitNames = []; - for (const spatialUnit of this.availableSpatialUnits) { - availableSpatialUnitNames.push(spatialUnit.spatialUnitLevel); - } - for (const indicator of this.availableIndicators) { - indicator.applicableSpatialUnits = indicator.applicableSpatialUnits.filter(applicableSpatialUnit => availableSpatialUnitNames.includes(applicableSpatialUnit.spatialUnitName)); - } - - this.displayableIndicators = this.availableIndicators.filter(item => isDisplayableIndicator(item)); - this.displayableIndicators_keywordFiltered = JSON.parse(JSON.stringify(this.displayableIndicators)); - }; - - this.buildTopicsMap_indicators = function(indicatorTopics){ - var topicsMap = new Map(); - - for (const topic of indicatorTopics) { - topicsMap.set(topic.topicId, []); - if(topic.subTopics.length > 0){ - topicsMap = this.addSubTopicsToMap_indicators(topic.subTopics, topicsMap); - } - } - - return topicsMap; - }; - - this.buildTopicsMap_georesources = function(georesourceTopics){ - var topicsMap = new Map(); - - for (const topic of georesourceTopics) { - topicsMap.set(topic.topicId, { - poiDatasets: [], - loiDatasets: [], - aoiDatasets: [], - wmsDatasets: [], - wfsDatasets: [] - }); - if(topic.subTopics.length > 0){ - topicsMap = this.addSubTopicsToMap_georesources(topic.subTopics, topicsMap); - } - } - - topicsMap.set(this.georesourceMapKey_forUnmappedTopicReferences, { - poiDatasets: [], - loiDatasets: [], - aoiDatasets: [], - wmsDatasets: [], - wfsDatasets: [] - }); - - return topicsMap; - }; - - this.addSubTopicsToMap_indicators = function(subTopicsArray, topicsMap){ - - for (const subTopic of subTopicsArray) { - topicsMap.set(subTopic.topicId, []); - if(subTopic.subTopics.length > 0){ - topicsMap = this.addSubTopicsToMap_indicators(subTopic.subTopics, topicsMap); - } - } - - return topicsMap; - }; - - this.addSubTopicsToMap_georesources = function(subTopicsArray, topicsMap){ - - for (const subTopic of subTopicsArray) { - topicsMap.set(subTopic.topicId, { - poiDatasets: [], - loiDatasets: [], - aoiDatasets: [], - wmsDatasets: [], - wfsDatasets: [] - }); - if(subTopic.subTopics.length > 0){ - topicsMap = this.addSubTopicsToMap_georesources(subTopic.subTopics, topicsMap); - } - } - - return topicsMap; - }; - - this.buildTopicGeoresourceHierarchy = function(){ - - var georesourceTopics = JSON.parse(JSON.stringify(this.availableTopics)).filter(topic => topic.topicResource === "georesource"); - /* - topicsMap.set(topic.topicId, { - poiDatasets: [], - loiDatasets: [], - aoiDatasets: [], - wmsDatasets: [], - wfsDatasets: [] - }) - - + special entry with key "unmapped" for all datasets without valid topic reference - */ - var topicsMap = this.buildTopicsMap_georesources(georesourceTopics); - - - // PROCESS GEORESOURCES - var filteredGeoresources = this.displayableGeoresources_keywordFiltered; - - for (const georesourceMetadata of filteredGeoresources) { - if (topicsMap.has(georesourceMetadata.topicReference)){ - var georesourceDatasets = topicsMap.get(georesourceMetadata.topicReference); - - if(georesourceMetadata.isPOI){ - georesourceDatasets.poiDatasets.push(georesourceMetadata); - } - if(georesourceMetadata.isLOI){ - georesourceDatasets.loiDatasets.push(georesourceMetadata); - } - if(georesourceMetadata.isAOI){ - georesourceDatasets.aoiDatasets.push(georesourceMetadata); - } - - topicsMap.set(georesourceMetadata.topicReference, georesourceDatasets); - } - else{ - var georesourceDatasets_unmapped = topicsMap.get(this.georesourceMapKey_forUnmappedTopicReferences); - - if(georesourceMetadata.isPOI){ - georesourceDatasets_unmapped.poiDatasets.push(georesourceMetadata); - } - if(georesourceMetadata.isLOI){ - georesourceDatasets_unmapped.loiDatasets.push(georesourceMetadata); - } - if(georesourceMetadata.isAOI){ - georesourceDatasets_unmapped.aoiDatasets.push(georesourceMetadata); - } - - topicsMap.set(this.georesourceMapKey_forUnmappedTopicReferences, georesourceDatasets_unmapped); - } - } - - // PROCESS WMS and WFS - for (const wmsMetadata of this.wmsDatasets_keywordFiltered) { - if (topicsMap.has(wmsMetadata.topicReference)){ - var georesourceDatasets = topicsMap.get(wmsMetadata.topicReference); - georesourceDatasets.wmsDatasets.push(wmsMetadata); - - topicsMap.set(wmsMetadata.topicReference, georesourceDatasets); - } - else{ - var georesourceDatasets_unmapped = topicsMap.get(this.georesourceMapKey_forUnmappedTopicReferences); - - georesourceDatasets_unmapped.wmsDatasets.push(wmsMetadata); - - topicsMap.set(this.georesourceMapKey_forUnmappedTopicReferences, georesourceDatasets_unmapped); - } - } - - // PROCESS WMS and WFS - for (const wfsMetadata of this.wfsDatasets_keywordFiltered) { - if (topicsMap.has(wfsMetadata.topicReference)){ - var georesourceDatasets = topicsMap.get(wfsMetadata.topicReference); - georesourceDatasets.wfsDatasets.push(wfsMetadata); - - topicsMap.set(wfsMetadata.topicReference, georesourceDatasets); - } - else{ - var georesourceDatasets_unmapped = topicsMap.get(this.georesourceMapKey_forUnmappedTopicReferences); - - georesourceDatasets_unmapped.wfsDatasets.push(wfsMetadata); - - topicsMap.set(this.georesourceMapKey_forUnmappedTopicReferences, georesourceDatasets_unmapped); - } - } - - this.topicGeoresourceHierarchy = this.addGeoresourceDataToTopicHierarchy(georesourceTopics, topicsMap); - }; - - this.buildTopicIndicatorHierarchy = function(){ - - var indicatorTopics = JSON.parse(JSON.stringify(this.availableTopics)).filter(topic => topic.topicResource === "indicator"); - var topicsMap = this.buildTopicsMap_indicators(indicatorTopics); - - var filteredIndicators = this.displayableIndicators_keywordFiltered; - - for (const indicatorMetadata of filteredIndicators) { - if (topicsMap.has(indicatorMetadata.topicReference)){ - var indicatorArray = topicsMap.get(indicatorMetadata.topicReference); - indicatorArray.push(indicatorMetadata); - topicsMap.set(indicatorMetadata.topicReference, indicatorArray); - } - } - - this.topicIndicatorHierarchy = this.addIndicatorDataToTopicHierarchy(indicatorTopics, topicsMap); - }; - - this.addIndicatorDataToTopicHierarchy = function(topicsArray, topicsMap){ - for (var topic of topicsArray) { - topic.indicatorData = topicsMap.get(topic.topicId); - topic.indicatorData.sort((a,b) => (a.displayOrder > b.displayOrder) ? 1 : ((b.displayOrder > a.displayOrder) ? -1 : 0)); - topic.indicatorCount = topic.indicatorData.length; - if(topic.subTopics.length > 0){ - topic = this.addIndicatorDataToSubTopics(topic, topicsMap); - } - } - - return topicsArray; - }; - - this.addIndicatorDataToSubTopics = function(topic, topicsMap){ - for (var subTopic of topic.subTopics) { - subTopic.indicatorData = topicsMap.get(subTopic.topicId); - subTopic.indicatorData.sort((a,b) => (a.displayOrder > b.displayOrder) ? 1 : ((b.displayOrder > a.displayOrder) ? -1 : 0)); - subTopic.indicatorCount = subTopic.indicatorData.length; - if(subTopic.subTopics.length > 0){ - subTopic = this.addIndicatorDataToSubTopics(subTopic, topicsMap); - } - topic.indicatorCount = topic.indicatorCount + subTopic.indicatorCount; - } - - return topic; - }; - - this.addGeoresourceDataToTopicHierarchy = function(topicsArray, topicsMap){ - - /* - topicsMap.set(topic.topicId, { - poiDatasets: [], - loiDatasets: [], - aoiDatasets: [], - wmsDatasets: [], - wfsDatasets: [] - }) - - + special entry with key "unmapped" for all datasets without valid topic reference - */ - - for (var topic of topicsArray) { - var topicsDataEntry = topicsMap.get(topic.topicId); - topic.poiData = topicsDataEntry.poiDatasets; - topic.poiCount = topicsDataEntry.poiDatasets.length; - - topic.loiData = topicsDataEntry.loiDatasets; - topic.loiCount = topicsDataEntry.loiDatasets.length; - - topic.aoiData = topicsDataEntry.aoiDatasets; - topic.aoiCount = topicsDataEntry.aoiDatasets.length; - - topic.wmsData = topicsDataEntry.wmsDatasets; - topic.wmsCount = topicsDataEntry.wmsDatasets.length; - - topic.wfsData = topicsDataEntry.wfsDatasets; - topic.wfsCount = topicsDataEntry.wfsDatasets.length; - - topic.totalCount = topic.poiCount + topic.loiCount + topic.aoiCount + topic.wmsCount + topic.wfsCount; - topic.ownCount = topic.poiCount + topic.loiCount + topic.aoiCount + topic.wmsCount + topic.wfsCount; - - if(topic.subTopics.length > 0){ - topic = this.addGeoresourceDataToSubTopics(topic, topicsMap); - } - } - - // PROCESS UNMAPPED entries - this.topicGeoresourceHierarchy_unmappedEntries = {}; - var topicsDataEntry_unmapped = topicsMap.get(this.georesourceMapKey_forUnmappedTopicReferences); - this.topicGeoresourceHierarchy_unmappedEntries.poiData = topicsDataEntry_unmapped.poiDatasets; - this.topicGeoresourceHierarchy_unmappedEntries.poiCount = topicsDataEntry_unmapped.poiDatasets.length; - - this.topicGeoresourceHierarchy_unmappedEntries.loiData = topicsDataEntry_unmapped.loiDatasets; - this.topicGeoresourceHierarchy_unmappedEntries.loiCount = topicsDataEntry_unmapped.loiDatasets.length; - - this.topicGeoresourceHierarchy_unmappedEntries.aoiData = topicsDataEntry_unmapped.aoiDatasets; - this.topicGeoresourceHierarchy_unmappedEntries.aoiCount = topicsDataEntry_unmapped.aoiDatasets.length; - - this.topicGeoresourceHierarchy_unmappedEntries.wmsData = topicsDataEntry_unmapped.wmsDatasets; - this.topicGeoresourceHierarchy_unmappedEntries.wmsCount = topicsDataEntry_unmapped.wmsDatasets.length; - - this.topicGeoresourceHierarchy_unmappedEntries.wfsData = topicsDataEntry_unmapped.wfsDatasets; - this.topicGeoresourceHierarchy_unmappedEntries.wfsCount = topicsDataEntry_unmapped.wfsDatasets.length; - - this.topicGeoresourceHierarchy_unmappedEntries.totalCount = this.topicGeoresourceHierarchy_unmappedEntries.poiCount + - this.topicGeoresourceHierarchy_unmappedEntries.loiCount + - this.topicGeoresourceHierarchy_unmappedEntries.aoiCount + - this.topicGeoresourceHierarchy_unmappedEntries.wmsCount + - this.topicGeoresourceHierarchy_unmappedEntries.wfsCount; - - return topicsArray; - }; - - this.addGeoresourceDataToSubTopics = function(topic, topicsMap){ - for (var subTopic of topic.subTopics) { - - var topicsDataEntry = topicsMap.get(subTopic.topicId); - subTopic.poiData = topicsDataEntry.poiDatasets; - subTopic.poiCount = topicsDataEntry.poiDatasets.length; - - subTopic.loiData = topicsDataEntry.loiDatasets; - subTopic.loiCount = topicsDataEntry.loiDatasets.length; - - subTopic.aoiData = topicsDataEntry.aoiDatasets; - subTopic.aoiCount = topicsDataEntry.aoiDatasets.length; - - subTopic.wmsData = topicsDataEntry.wmsDatasets; - subTopic.wmsCount = topicsDataEntry.wmsDatasets.length; - - subTopic.wfsData = topicsDataEntry.wfsDatasets; - subTopic.wfsCount = topicsDataEntry.wfsDatasets.length; - - subTopic.totalCount = subTopic.poiCount + subTopic.loiCount + subTopic.aoiCount + subTopic.wmsCount + subTopic.wfsCount; - subTopic.ownCount = subTopic.poiCount + subTopic.loiCount + subTopic.aoiCount + subTopic.wmsCount + subTopic.wfsCount; - - if(subTopic.subTopics.length > 0){ - subTopic = this.addGeoresourceDataToSubTopics(subTopic, topicsMap); - } - topic.poiCount = topic.poiCount + subTopic.poiCount; - topic.loiCount = topic.loiCount + subTopic.loiCount; - topic.aoiCount = topic.aoiCount + subTopic.aoiCount; - topic.wmsCount = topic.wmsCount + subTopic.wmsCount; - topic.wfsCount = topic.wfsCount + subTopic.wfsCount; - topic.totalCount = topic.totalCount + subTopic.totalCount; - } - - return topic; - }; - - this.onChangeIndicatorKeywordFilter = function(indicatorNameFilter){ - this.displayableIndicators_keywordFiltered = JSON.parse(JSON.stringify(this.displayableIndicators)); - - if(indicatorNameFilter && indicatorNameFilter != ""){ - this.displayableIndicators_keywordFiltered = filterArrayObjectsByValue(this.displayableIndicators_keywordFiltered, indicatorNameFilter); - } - - this.buildTopicIndicatorHierarchy(); - this.buildHeadlineIndicatorHierarchy(); - this.buildComputationIndicatorHierarchy(); - }; - - this.onChangeGeoresourceKeywordFilter = function(georesourceNameFilter, showPOI, showLOI, showAOI, showWMS, showWFS){ - this.wmsDatasets_keywordFiltered = JSON.parse(JSON.stringify(this.wmsDatasets)); - this.wfsDatasets_keywordFiltered = JSON.parse(JSON.stringify(this.wfsDatasets)); - - this.displayableGeoresources_keywordFiltered = JSON.parse(JSON.stringify(this.displayableGeoresources)); - - if(georesourceNameFilter && georesourceNameFilter != ""){ - this.displayableGeoresources_keywordFiltered = filterArrayObjectsByValue(this.displayableGeoresources_keywordFiltered, georesourceNameFilter); - - this.wmsDatasets_keywordFiltered = filterArrayObjectsByValue(this.wmsDatasets_keywordFiltered, georesourceNameFilter); - this.wfsDatasets_keywordFiltered = filterArrayObjectsByValue(this.wfsDatasets_keywordFiltered, georesourceNameFilter); - } - - this.displayableGeoresources_keywordFiltered_forAlphabeticalDisplay = { - poiData: this.displayableGeoresources_keywordFiltered.filter(item => item.isPOI), - loiData: this.displayableGeoresources_keywordFiltered.filter(item => item.isLOI), - aoiData: this.displayableGeoresources_keywordFiltered.filter(item => item.isAOI), - wmsData: this.wmsDatasets_keywordFiltered, - wfsData: this.wfsDatasets_keywordFiltered - }; - - if(!showWMS){ - this.wmsDatasets_keywordFiltered = []; - } - if(!showWFS){ - this.wfsDatasets_keywordFiltered = []; - } - - if(! (showPOI && showLOI && showAOI)){ - this.displayableGeoresources_keywordFiltered = this.displayableGeoresources_keywordFiltered.filter(item => { - if (! showPOI && item.isPOI){ - return false; - } - if (! showLOI && item.isLOI){ - return false; - } - - if (! showAOI && item.isAOI){ - return false; - } - - return true; - }); - } - - this.buildTopicGeoresourceHierarchy(); - }; - - this.buildHeadlineIndicatorHierarchy = function(){ - - var indicatorsMap = new Map(); - - var filteredIndicators = this.displayableIndicators_keywordFiltered; - - for (const indicatorMetadata of filteredIndicators) { - indicatorsMap.set(indicatorMetadata.indicatorId, indicatorMetadata); - } - - var headlineIndicatorsArray = filteredIndicators.filter(indicatorMetadata => indicatorMetadata.isHeadlineIndicator == true); - - var headlineIndicatorsIdArray = headlineIndicatorsArray.map(indicatorMetadata => indicatorMetadata.indicatorId); - - var headlineIndicatorsMap = new Map(); - - for (const indicatorMetadata of headlineIndicatorsArray) { - headlineIndicatorsMap.set(indicatorMetadata.indicatorId, indicatorMetadata); - } - - var headlineIndicatorScriptsMap = new Map(); - for (const scriptMetadata of this.availableProcessScripts) { - if(headlineIndicatorsIdArray.includes(scriptMetadata.indicatorId)){ - headlineIndicatorScriptsMap.set(scriptMetadata.indicatorId, scriptMetadata); - } - } - - this.headlineIndicatorHierarchy = []; - - // var item = { - // headlineIndicator: {metadata} - // baseIndicators: [{metadata}] - // maybeSomeAnalysisItems? - // } - - for (const headlineIndicatorMetadata of headlineIndicatorsArray) { - var item = {}; - item.headlineIndicator = headlineIndicatorMetadata; - item.baseIndicators = []; - - if(headlineIndicatorScriptsMap.has(headlineIndicatorMetadata.indicatorId)){ - var targetScriptMetadata = headlineIndicatorScriptsMap.get(headlineIndicatorMetadata.indicatorId); - for (const requiredIndicatorId of targetScriptMetadata.requiredIndicatorIds) { - if (indicatorsMap.has(requiredIndicatorId)){ - item.baseIndicators.push(indicatorsMap.get(requiredIndicatorId)); - } - } - } - - this.headlineIndicatorHierarchy.push(item); - } - - }; - - this.buildComputationIndicatorHierarchy = function(){ - - var indicatorsMap = new Map(); - - var filteredIndicators = this.displayableIndicators_keywordFiltered; - - for (const indicatorMetadata of filteredIndicators) { - indicatorsMap.set(indicatorMetadata.indicatorId, indicatorMetadata); - } - - var computationIndicatorsArray = filteredIndicators.filter(indicatorMetadata => indicatorMetadata.creationType == "COMPUTATION"); - - var computationIndicatorsIdArray = computationIndicatorsArray.map(indicatorMetadata => indicatorMetadata.indicatorId); - - var computationIndicatorsMap = new Map(); - - for (const indicatorMetadata of computationIndicatorsArray) { - computationIndicatorsMap.set(indicatorMetadata.indicatorId, indicatorMetadata); - } - - var computationIndicatorScriptsMap = new Map(); - for (const scriptMetadata of this.availableProcessScripts) { - if(computationIndicatorsIdArray.includes(scriptMetadata.indicatorId)){ - computationIndicatorScriptsMap.set(scriptMetadata.indicatorId, scriptMetadata); - } - } - - this.computationIndicatorHierarchy = []; - - // var item = { - // computationIndicator: {metadata} - // baseIndicators: [{metadata}] - // maybeSomeAnalysisItems? - // } - - for (const computationIndicatorMetadata of computationIndicatorsArray) { - var item = {}; - item.computationIndicator = computationIndicatorMetadata; - item.baseIndicators = []; - - if(computationIndicatorScriptsMap.has(computationIndicatorMetadata.indicatorId)){ - var targetScriptMetadata = computationIndicatorScriptsMap.get(computationIndicatorMetadata.indicatorId); - for (const requiredIndicatorId of targetScriptMetadata.requiredIndicatorIds) { - if (indicatorsMap.has(requiredIndicatorId)){ - item.baseIndicators.push(indicatorsMap.get(requiredIndicatorId)); - } - } - } - - this.computationIndicatorHierarchy.push(item); - } - - }; - - this.filterCurrentlySelectedIndicator = function(){ - return function( item ) { - - if (item.indicatorMetadata.indicatorId === self.selectedIndicator.indicatorId){ - return true; - } - return false; - - }; - }; - - this.filterBaseIndicatorsOfCurrentHeadlineIndicator = function(){ - return function( item ) { - - var headlineIndicatorEntry = self.headlineIndicatorHierarchy.filter(element => element.headlineIndicator.indicatorId == self.selectedIndicator.indicatorId)[0]; - - if(headlineIndicatorEntry){ - var baseIndicators_filtered = headlineIndicatorEntry.baseIndicators.filter(element => element.indicatorId == item.indicatorMetadata.indicatorId); - if (baseIndicators_filtered.length > 0){ - return true; - } - } - - return false; - - }; - }; - - this.filterBaseIndicatorsOfCurrentComputationIndicator = function(){ - return function( item ) { - - var computationIndicatorEntry = self.computationIndicatorHierarchy.filter(element => element.computationIndicator.indicatorId == self.selectedIndicator.indicatorId)[0]; - - if(computationIndicatorEntry){ - var baseIndicators_filtered = computationIndicatorEntry.baseIndicators.filter(element => element.indicatorId == item.indicatorMetadata.indicatorId); - if (baseIndicators_filtered.length > 0){ - return true; - } - } - - return false; - - }; - }; - - var onMetadataLoadingCompleted = function(){ - - $timeout(function () { - $rootScope.$broadcast("initialMetadataLoadingCompleted"); - - $timeout(function () { - $("option").each(function (index, element) { - var text = $(element).text(); - $(element).attr("title", text); - }); - }, 1000); - }, 1000); - // setTimeout(() => { - // // $rootScope.$broadcast("initialMetadataLoadingCompleted"); - // }, 1000); - }; - - this.setAccessControl = function(input){ - this.accessControl = input; - this.accessControl_map = new Map(); - for (const entry of input) { - this.accessControl_map.set(entry.organizationalUnitId, entry); - } - this.updateAvailableRoles(); - }; - - this.fetchAccessControlMetadata = async function(keycloakRolesArray){ - self.setAccessControl(await kommonitorCacheHelperService.fetchAccessControlMetadata(keycloakRolesArray)); - self.setCurrentKomMonitorLoginRoleNames(); - self.setCurrentKomMonitorLoginRoleIds(); - }; - - this.replaceSingleAccessControlMetadata = function(targetRoleMetadata){ - for (let index = 0; index < this.accessControl.length; index++) { - let oldMetadata = this.accessControl[index]; - if(oldMetadata.organizationalUnitId == targetRoleMetadata.organizationalUnitId){ - this.accessControl[index] = targetRoleMetadata; - break; - } - } - this.accessControl_map.set(targetRoleMetadata.organizationalUnitId, targetRoleMetadata); - this.updateAvailableRoles(); - }; - - this.addSingleAccessControlMetadata = function(metadata){ - let tmpArray = [metadata]; - Array.prototype.push.apply(tmpArray, this.accessControl); - this.accessControl = tmpArray; - this.accessControl_map.set(metadata.organizationalUnitId, metadata); - this.updateAvailableRoles(); - }; - - this.deleteSingleAccessControlMetadata = function(id){ - for (let index = 0; index < this.accessControl.length; index++) { - const oldMetadata = this.accessControl[index]; - if(oldMetadata.organizationalUnitId == id){ - this.accessControl.splice(index, 1); - break; - } - } - this.accessControl_map.delete(id); - this.updateAvailableRoles(); - }; - - this.updateAvailableRoles = function() { - this.availableRoles = []; - for (let elem of this.accessControl) { - for (let role of elem.roles) { - let available = {...role, ...{"organizationalUnit": elem, "roleName": elem.name + "-" + role.permissionLevel}}; - this.availableRoles.push(available); - } - } - // we need to refresh all modals as roles have changed - $rootScope.$broadcast("availableRolesUpdate"); - } - - this.getAccessControlById = function(id){ - return this.accessControl_map.get(id); - }; - - this.fetchTopicsMetadata = async function(keycloakRolesArray){ - self.setTopics(await kommonitorCacheHelperService.fetchTopicsMetadata(keycloakRolesArray)); - }; - - this.fetchSpatialUnitsMetadata = async function(keycloakRolesArray){ - self.setSpatialUnits(await kommonitorCacheHelperService.fetchSpatialUnitsMetadata(keycloakRolesArray)); - }; - - this.fetchGeoresourcesMetadata = async function(keycloakRolesArray){ - self.setGeoresources(await kommonitorCacheHelperService.fetchGeoresourceMetadata(keycloakRolesArray)); - }; - - this.fetchIndicatorsMetadata = async function(keycloakRolesArray){ - self.setIndicators(await kommonitorCacheHelperService.fetchIndicatorsMetadata(keycloakRolesArray)); - }; - - this.fetchIndicatorScriptsMetadata = async function(keycloakRolesArray){ - self.setProcessScripts(await kommonitorCacheHelperService.fetchProcessScriptsMetadata(keycloakRolesArray)); - }; - - this.indicatorValueIsNoData = function(indicatorValue){ - if(Number.isNaN(indicatorValue) || indicatorValue === null || indicatorValue === undefined){ - return true; - } - return false; - }; - - this.getIndicatorValueFromArray_asNumber = function(propertiesArray, targetDateString){ - if(!targetDateString.includes(DATE_PREFIX)){ - targetDateString = DATE_PREFIX + targetDateString; - } - var indicatorValue = propertiesArray[targetDateString]; - var value; - if(this.indicatorValueIsNoData(indicatorValue)){ - value = "NoData"; - } - else{ - value = this.getIndicatorValue_asNumber(indicatorValue); - } - - return value; - }; - - this.getIndicatorValueFromArray_asFormattedText = function(propertiesArray, targetDateString){ - if(!targetDateString.includes(DATE_PREFIX)){ - targetDateString = DATE_PREFIX + targetDateString; - } - var indicatorValue = propertiesArray[targetDateString]; - var value; - if(this.indicatorValueIsNoData(indicatorValue)){ - value = "NoData"; - } - else{ - value = this.getIndicatorValue_asFormattedText(indicatorValue); - } - - return value; - }; - - this.getIndicatorValue_asNumber = function(indicatorValue){ - var value; - if(this.indicatorValueIsNoData(indicatorValue)){ - value = "NoData"; - } - else{ - value = +Number(indicatorValue).toFixed(numberOfDecimals); - } - - // if the original value is greater than zero but would be rounded as 0 then we must return the original result - if(Number(value) == 0 && indicatorValue > 0){ - value = Number(indicatorValue); - } - - return value; - }; - - this.getIndicatorValue_asFormattedText = function(indicatorValue){ - var value; - if(this.indicatorValueIsNoData(indicatorValue)){ - value = "NoData"; - } - else{ - value = Number(indicatorValue).toLocaleString('de-DE', {maximumFractionDigits: numberOfDecimals}); - } - - // if the original value is greater than zero but would be rounded as 0 then we must return the original result - if(Number(value) == 0 && indicatorValue > 0){ - value = Number(indicatorValue).toLocaleString('de-DE'); - } - - return value; - }; - - this.getTopicHierarchyDisplayString = function(topicReferenceId){ - var topicHierarchyArray = this.getTopicHierarchyForTopicId(topicReferenceId); - - var topicsString = ""; - for (let index = 0; index < topicHierarchyArray.length; index++) { - if (index === 0) { - // mainTopic --> first tier - topicsString += topicHierarchyArray[index].topicName; - } - else { - var numberOfWhitespaces = 2 * index; - var whitespaceString = ""; - for (let k = 0; k < numberOfWhitespaces; k++) { - whitespaceString += " "; - } - topicsString += whitespaceString + topicHierarchyArray[index].topicName; - } - - if (index < topicHierarchyArray.length) { - topicsString += "
        "; - } - - } - - return topicsString; - }; - - this.getIndicatorStringFromIndicatorType = function (indicatorType) { - var indicatorTypeString; - - for (const indicatorTypeOption of this.indicatorTypeOptions) { - if (indicatorType.includes(indicatorTypeOption.apiName)) { - indicatorTypeString = indicatorTypeOption.displayName; - break; - } - } - - return indicatorTypeString; - }; - - - this.labelAllFeatures = "alle Features"; - this.labelFilteredFeatures = "gefilterte Features"; - this.labelSelectedFeatures = "selektierte Features"; - this.labelNumberOfFeatures = "Anzahl:" - this.labelSum = "Summe:" - this.labelMean = "arith. Mittel:" - this.labelMin = "Minimalwert:" - this.labelMax = "Maximalwert" - - this.allFeaturesNumberOfFeatures; - this.allFeaturesSum; - this.allFeaturesMean; - this.allFeaturesMin; - this.allFeaturesMax; - this.selectedFeaturesNumberOfFeatures; - this.selectedFeaturesSum; - this.selectedFeaturesMean; - this.selectedFeaturesMin; - this.selectedFeaturesMax; - this.allFeaturesPropertyUnit; - - this.setAllFeaturesProperty = function(indicatorMetadataAndGeoJSON, propertyName){ - let sum = 0; - let count = 0; - let min = Number.MAX_VALUE; - let max = Number.MIN_VALUE; - - for (const feature of indicatorMetadataAndGeoJSON.geoJSON.features) { - if(! this.indicatorValueIsNoData(feature.properties[propertyName])){ - let value = this.getIndicatorValueFromArray_asNumber(feature.properties, propertyName) - sum += value; - if (value < min) min = value; - if (value > max) max = value; - count++; - } - } - - this.allFeaturesPropertyUnit = indicatorMetadataAndGeoJSON.unit; - this.allFeaturesNumberOfFeatures = count; - this.allFeaturesSum = this.getIndicatorValue_asFormattedText(sum); - // no division by zero - if (count > 0) - this.allFeaturesMean = this.getIndicatorValue_asFormattedText(sum / count); - else - this.allFeaturesMean = 0; - this.allFeaturesMin = this.getIndicatorValue_asFormattedText(min); - this.allFeaturesMax = this.getIndicatorValue_asFormattedText(max) - }; - - - this.setSelectedFeatureProperty = function(selectedFeaturesMap, propertyName) { - let sum = 0; - let count = 0 - let min = Number.MAX_VALUE; - let max = Number.MIN_VALUE; - - selectedFeaturesMap.forEach(function(feature, key, map) { - if(! thisService.indicatorValueIsNoData(feature.properties[propertyName])){ - let value = thisService.getIndicatorValueFromArray_asNumber(feature.properties, propertyName); - sum += value; - if (value < min) min = value; - if (value > max) max = value; - count++; - } - }); - - if(count === 0) { - // no feature selected, overwrite initial values for min and max - min = 0; - max = 0; - } - - - this.selectedFeaturesNumberOfFeatures = count; - this.selectedFeaturesSum = this.getIndicatorValue_asFormattedText(sum); - // no division by zero - if (count > 0) - this.selectedFeaturesMean = this.getIndicatorValue_asFormattedText(sum / count); - else - this.selectedFeaturesMean = 0; - this.selectedFeaturesMin = this.getIndicatorValue_asFormattedText(min); - this.selectedFeaturesMax = this.getIndicatorValue_asFormattedText(max); - }; - - - var containsNegativeValues = function(geoJSON, propertyName){ - - var containsNegativeValues = false; - for(var i=0; i< geoJSON.features.length; i++){ - if (geoJSON.features[i].properties[propertyName] < 0){ - containsNegativeValues = true; - break; - } - } - - return containsNegativeValues; - }; - - this.formatIndicatorNameForLabel = function(indicatorName, maxCharsPerLine){ - var arr = []; - var space = /\s/; - - const words = indicatorName.split(space); - // push first word into new array - if (words[0].length) { - arr.push(words[0]); - } - - for (let i = 1; i < words.length; i++) { - if (words[i].length + arr[arr.length - 1].length < maxCharsPerLine) { - arr[arr.length - 1] = `${arr[arr.length - 1]} ${words[i - ]}`; - } - else { - arr.push(words[i]); - } - } - return arr.join("\n"); - }; - - this.filterIndicators = function (){ - return function( item ) { - - return isDisplayableIndicator(item); - }; - }; - - this.filterGeoresources = function (){ - return function( item ) { - - return self.isDisplayableGeoresource(item); - }; - }; - - this.isDisplayableGeoresource = function(item){ - var arrayOfNameSubstringsForHidingGeoresources = __env.arrayOfNameSubstringsForHidingGeoresources; - - if(item.availablePeriodsOfValidity == undefined || item.availablePeriodsOfValidity.length === 0) - return false; - - var isGeoresourceThatShallNotBeDisplayed = arrayOfNameSubstringsForHidingGeoresources.some(substring => String(item.datasetName).includes(substring)); - - if(isGeoresourceThatShallNotBeDisplayed){ - return false; - } - return true; - }; - - this.selectedSpatialUnitIsRaster = function(){ - var spatialUnitName = this.selectedSpatialUnit ? this.selectedSpatialUnit.spatialUnitLevel : ""; - - return (spatialUnitName.includes("raster") || spatialUnitName.includes("Raster") || spatialUnitName.includes("RASTER") || spatialUnitName.includes("grid") || spatialUnitName.includes("GRID") || spatialUnitName.includes("Grid")); - }; - - // var roleMappingAllowsDisplay = function(indicatorMetadata){ - // //admin --> everything allowed - // if(self.currentKeycloakLoginRoles.includes(__env.keycloakKomMonitorAdminRoleName)){ - // return true; - // } - - // // public user - - - // // non-admin - // self.roleMetadataForCurrentKeycloakLoginRoles = self.availableRoles.filter(role => self.currentKeycloakLoginRoles.includes(role.roleName)); - - // var filteredApplicableUnits = indicatorMetadata.applicableSpatialUnits.filter(function (applicableSpatialUnit) { - // return applicableSpatialUnit.allowedRoles.length == 0 || applicableSpatialUnit.allowedRoles.some(allowedRoleId => self.roleMetadataForCurrentKeycloakLoginRoles.some(roleMetadata => roleMetadata.roleId === allowedRoleId) ); - // }); - - // return filteredApplicableUnits.length > 0; - // }; - - var isDisplayableIndicator = function(item){ - // var arrayOfNameSubstringsForHidingIndicators = ["Standardabweichung", "Prozentuale Ver"]; - var arrayOfNameSubstringsForHidingIndicators = __env.arrayOfNameSubstringsForHidingIndicators; - - // this is an item from i.e. indicatorRadar, that has a different structure - if(item.indicatorMetadata){ - if(item.indicatorMetadata.applicableDates == undefined || item.indicatorMetadata.applicableDates.length === 0) - return false; - - if(item.indicatorMetadata.applicableSpatialUnits == undefined || item.indicatorMetadata.applicableSpatialUnits.length === 0) - return false; - - var isIndicatorThatShallNotBeDisplayed = arrayOfNameSubstringsForHidingIndicators.some(substring => String(item.indicatorMetadata.indicatorName).includes(substring)); - - if(isIndicatorThatShallNotBeDisplayed){ - return false; - } - - // if(! roleMappingAllowsDisplay(item.indicatorMetadata)){ - // return false; - // } - - return true; - } - else{ - // - if(item.applicableDates == undefined || item.applicableDates.length === 0) - return false; - - if(item.applicableSpatialUnits == undefined || item.applicableSpatialUnits.length === 0) - return false; - - // var isIndicatorThatShallNotBeDisplayed = item.indicatorName.includes("Standardabweichung") || item.indicatorName.includes("Prozentuale Ver"); - var isIndicatorThatShallNotBeDisplayed = arrayOfNameSubstringsForHidingIndicators.some(substring => String(item.indicatorName).includes(substring)); - - if(isIndicatorThatShallNotBeDisplayed){ - return false; - } - - // if(! roleMappingAllowsDisplay(item)){ - // return false; - // } - - return true; - } - }; - - this.filterGeoresourcesByPoi = function(){ - return function( item ) { - - try{ - if(item.isPOI){ - return true; - } - return false; - } - catch(error){ - return false; - } - }; - }; - - this.filterPois = function(){ - return function( item ) { - - try{ - // if(item.datasetName.includes("Lebensmittel")){ - // return false; - // } - return true; - } - catch(error){ - return true; - } - }; - }; - - function getImageDimensions(file) { - return new Promise (function (resolved, rejected) { - var i = new Image(); - i.onload = function(){ - resolved({w: i.width, h: i.height}) - }; - i.src = file; - }); - } - - /** - * creates and returns a pdf for the indicator given as parameter - */ - this.createMetadataPDF_indicator = async function(indicator) { - - var jspdf = new jsPDF(); - jspdf.setFontSize(16); - // jspdf.text("Metadatenblatt", 70, 6); - - //insert logo - var img = new Image(); - var subPath = location.pathname; - img.src = subPath + 'logos/KM_Logo1.png'; - jspdf.addImage(img, 'PNG', 193, 5, 12, 12); - - jspdf.setFontSize(16); - jspdf.setFont('Helvetica', 'bolditalic', 'normal'); - var titleArray = jspdf.splitTextToSize("Indikator: " +indicator.indicatorName, 180); - jspdf.text(titleArray, 14, 25); - - if (indicator.characteristicValue && indicator.characteristicValue != "-" && indicator.characteristicValue != "") { - jspdf.setFontSize(14); - jspdf.text(indicator.characteristicValue, 14, 25); - } - - - jspdf.setFontSize(11); - - var initialStartY = 30; - - if (titleArray.length > 1) { - titleArray.forEach(function (item) { - initialStartY += 5; - }); - } - if (indicator.characteristicValue && indicator.characteristicValue != "-" && indicator.characteristicValue != "") { - initialStartY += 5; - } - - var headStyles = { - fontStyle: 'bold', - fontSize: 12, - fillColor: '#337ab7', - // auto or wrap - cellWidth: 'auto' - }; - - var bodyStyles = { - fontStyle: 'normal', - fontSize: 11, - // auto or wrap or number - cellWidth: 'auto' - }; - - // first column with fixed width - var columnStyles = { - 0: { cellWidth: 45, fontStyle: 'bold' }, - 1: { fontStyle: 'normal' } - }; - - var topicsString = ""; - - var topicReferenceId = indicator.topicReference; - - // will be an array representing the topic hierarchy - // i.e. [mainTopic, subTopicFirstTier, subTopicSecondTier, ...] - var topicHierarchyArray = this.getTopicHierarchyForTopicId(topicReferenceId); - - for (let index = 0; index < topicHierarchyArray.length; index++) { - if (index === 0) { - // mainTopic --> first tier - topicsString += topicHierarchyArray[index].topicName; - } - else { - var numberOfWhitespaces = 2 * index; - var whitespaceString = ""; - for (let k = 0; k < numberOfWhitespaces; k++) { - whitespaceString += " "; - } - topicsString += whitespaceString + topicHierarchyArray[index].topicName; - } - - if (index < topicHierarchyArray.length - 1) { - topicsString += "\n"; - } - - } - - var category = "Basisindikator"; - if (indicator.isHeadlineIndicator) { - category = "Leitindikator"; - } - - // Or JavaScript: - jspdf.autoTable({ - head: [['Themenfeld', 'Kategorie', 'Typ', 'Kennzeichen']], - body: [ - [topicsString, category, this.getIndicatorStringFromIndicatorType(indicator.indicatorType), indicator.abbreviation ? indicator.abbreviation : "-"] - // ... - ], - theme: 'grid', - headStyles: headStyles, - bodyStyles: bodyStyles, - startY: initialStartY - }); - - var linkedIndicatorsString = ""; - - for (var [index, linkedIndicator] of indicator.referencedIndicators.entries()) { - linkedIndicatorsString += linkedIndicator.referencedIndicatorName + " - \n " + linkedIndicator.referencedIndicatorDescription; - - if (index < indicator.referencedIndicators.length - 1) { - linkedIndicatorsString += "\n\n"; - } - } - - if (linkedIndicatorsString === "") { - linkedIndicatorsString = "-"; - } - - var linkedGeoresourcesString = ""; - - for (var [k, linkedGeoresource] of indicator.referencedGeoresources.entries()) { - linkedGeoresourcesString += linkedGeoresource.referencedGeoresourceName + " - \n " + linkedGeoresource.referencedGeoresourceDescription; - - if (k < indicator.referencedGeoresources.length - 1) { - linkedGeoresourcesString += "\n\n"; - } - } - - if (linkedGeoresourcesString === "") { - linkedGeoresourcesString = "-"; - } - - // jspdf.autoTable({ - // head: [], - // body: [ - // ["Beschreibung", indicator.metadata.description], - // ["Maßeinheit", indicator.unit], - // ["Definition des Leitindikators", "-"], - // ["Klassifizierung", "-"], - // ["Interpretation", "-"], - // ["Verknüpfte Indikatoren", linkedIndicatorsString], - // ["Verknüpfte Geodaten", linkedGeoresourcesString] - // // ... - // ], - // startY: jspdf.autoTable.previous.finalY + 20, - // }); - - var spatialUnitsString = ""; - var processedSpatialUnits = 0; - - for (var availableSpatialUnit of this.availableSpatialUnits) { - - for (var applicableSpatialUnit of indicator.applicableSpatialUnits) { - - if (availableSpatialUnit.spatialUnitLevel === applicableSpatialUnit.spatialUnitName) { - spatialUnitsString += applicableSpatialUnit.spatialUnitName; - processedSpatialUnits++; - - if (processedSpatialUnits < indicator.applicableSpatialUnits.length) { - spatialUnitsString += "\n"; - } - } - - } - } - - var datesString = ""; - - if(indicator.applicableDates.length <= 20){ - for (var [j, date] of indicator.applicableDates.entries()) { - var asDate = new Date(date); - - datesString += this.tsToDate_withOptionalUpdateInterval(this.dateToTS(asDate), indicator.metadata.updateInterval); - - if (j < indicator.applicableDates.length - 1) { - datesString += " "; - } - } - } - else{ - datesString += "Zeitreihe umfasst insgesamt " + indicator.applicableDates.length + " Zeitpunkte\n\n"; - - datesString += "frühester Zeitpunkt: " + this.tsToDate_withOptionalUpdateInterval(this.dateToTS(indicator.applicableDates[0]), indicator.metadata.updateInterval) + "\n"; - datesString += "spätester Zeitpunkt: " + this.tsToDate_withOptionalUpdateInterval(this.dateToTS(indicator.applicableDates[indicator.applicableDates.length - 1]), indicator.metadata.updateInterval); - - } - - var imgData; - var imgWidth; - var imgHeight; - - if(indicator.processDescription && indicator.processDescription.includes("$")){ - await html2canvas(document.querySelector("#indicatorProcessDescription")).then(canvas => { - // document.body.appendChild(canvas) - - imgData = canvas.toDataURL('image/png'); - - }); - - var dimensions = await getImageDimensions(imgData); - imgWidth = dimensions.w; - imgHeight = dimensions.h; - } - - jspdf.autoTable({ - head: [], - body: [ - ["Beschreibung", indicator.metadata.description], - ["Maßeinheit", indicator.unit], - ["Methodik", indicator.processDescription ? indicator.processDescription : "-"], - // ["Klassifizierung", "-"], - ["Interpretation", indicator.interpretation ? indicator.interpretation : "-"], - ["Tags", indicator.tags ? JSON.stringify(indicator.tags) : "-"], - ["Verknüpfte Indikatoren", linkedIndicatorsString], - ["Verknüpfte Geodaten", linkedGeoresourcesString] - ], - theme: 'grid', - headStyles: headStyles, - bodyStyles: bodyStyles, - columnStyles: columnStyles, - startY: jspdf.autoTable.previous.finalY + 10, - willDrawCell: function(data) { - if (imgData && data.row.index === 2 && data.column.index === 1 && data.cell.section === 'body') { - data.row.height = 2.5 * data.cell.height; - data.row.maxCellHeight = 2.5 * data.cell.height; - data.cell.height = 2.5 * data.cell.height; - data.cell.text = ""; - } - if (imgData && data.row.index === 2 && data.column.index === 0 && data.cell.section === 'body') { - data.row.height = 2.5 * data.cell.height; - data.row.maxCellHeight = 2.5 * data.cell.height; - data.cell.height = 2.5 * data.cell.height; - } - }, - didDrawCell: function(data) { - if (imgData && data.row.index === 2 && data.column.index === 1 && data.cell.section === 'body') { - var cellHeight = data.cell.height - data.cell.padding('vertical'); - var cellWidth = data.cell.width - data.cell.padding('horizontal'); - var textPos = data.cell.textPos; - - var imgScale = cellHeight / imgHeight; - var width = imgWidth * imgScale; - if (width > cellWidth){ - width = cellWidth; - } - - jspdf.addImage(imgData, "PNG", textPos.x, textPos.y, width, cellHeight); - } - } - }); - - // // linked elements - // jspdf.autoTable({ - // head: [], - // body: [ - // ["Verknüpfte Indikatoren", linkedIndicatorsString], - // ["Verknüpfte Geodaten", linkedGeoresourcesString] - // ], - // theme: 'grid', - // headStyles: headStyles, - // bodyStyles: bodyStyles, - // columnStyles: columnStyles, - // startY: jspdf.autoTable.previous.finalY + 10 - // }); - - // linked elements - jspdf.autoTable({ - head: [], - body: [ - ["Datengrundlage", indicator.metadata.databasis ? indicator.metadata.databasis : "-"], - ["Datenquelle", indicator.metadata.datasource ? indicator.metadata.datasource : "-"], - ["Datenhalter und Kontakt", indicator.metadata.contact ? indicator.metadata.contact : "-"], - ["Bemerkung", indicator.metadata.note ? indicator.metadata.note : "-"], - ["Raumbezug", spatialUnitsString], - // $scope.updateInteval is a map mapping the english KEYs to german expressions - ["Zeitbezug / Fortführungsintervall", this.updateInterval.get(indicator.metadata.updateInterval.toUpperCase())], - ["Hinweise zum Referenzdatum", indicator.referenceDateNote ? indicator.referenceDateNote : "-"], - ["Verfügbare Zeitreihen", datesString], - ["Datum der letzten Aktualisierung", this.tsToDate_withOptionalUpdateInterval(this.dateToTS(indicator.metadata.lastUpdate))], - ["Quellen / Literatur", indicator.metadata.literature ? indicator.metadata.literature : "-"] - ], - theme: 'grid', - headStyles: headStyles, - bodyStyles: bodyStyles, - columnStyles: columnStyles, - startY: jspdf.autoTable.previous.finalY + 10 - }); - - // - // jspdf.autoTable({ - // head: [], - // body: [ - // ["Quellen / Literatur", indicator.metadata.literature ? indicator.metadata.literature : "-"] - // // ... - // ], - // theme: 'grid', - // headStyles: headStyles, - // bodyStyles: bodyStyles, - // columnStyles: columnStyles, - // startY: jspdf.autoTable.previous.finalY + 10 - // }); - - return jspdf; - }; - - this.generateIndicatorMetadataPdf_asBlob = async function(){ - // create PDF from currently selected/displayed indicator! - var indicatorMetadata = this.selectedIndicator; - var pdfName = indicatorMetadata.indicatorName + ".pdf"; - var jspdf = await this.generateIndicatorMetadataPdf(indicatorMetadata, pdfName); - return jspdf.output("blob", {filename: pdfName}); - }; - - this.generateIndicatorMetadataPdf = async function(indicatorMetadata, pdfName){ - var jspdf = await this.createMetadataPDF_indicator(indicatorMetadata); - - jspdf.setProperties({ - title: 'KomMonitor Indikatorenblatt', - subject: pdfName, - author: 'KomMonitor', - keywords: 'Indikator, Metadatenblatt', - creator: 'KomMonitor' - }); - return jspdf; - }; - - /** - * creates and returns a pdf for the georesource given as parameter - */ - this.createMetadataPDF_georesource = async function(georesource, pdfName) { - - var jspdf = new jsPDF(); - jspdf.setFontSize(16); - // jspdf.text("Metadatenblatt", 70, 6); - - //insert logo - var img = new Image(); - var subPath = location.pathname; - img.src = subPath + 'logos/KM_Logo1.png'; - jspdf.addImage(img, 'PNG', 193, 5, 12, 12); - - jspdf.setFontSize(16); - jspdf.setFont('Helvetica', 'bolditalic', 'normal'); - var titleArray = jspdf.splitTextToSize("Geodatensatz: " + georesource.datasetName, 180); - jspdf.text(titleArray, 14, 25); - - - jspdf.setFontSize(11); - - var initialStartY = 30; - - if (titleArray.length > 1) { - titleArray.forEach(function (item) { - initialStartY += 5; - }); - } - - var headStyles = { - fontStyle: 'bold', - fontSize: 12, - fillColor: '#337ab7', - // auto or wrap - cellWidth: 'auto' - }; - - var bodyStyles = { - fontStyle: 'normal', - fontSize: 11, - // auto or wrap or number - cellWidth: 'auto' - }; - - // first column with fixed width - var columnStyles = { - 0: { cellWidth: 45, fontStyle: 'bold' }, - 1: { fontStyle: 'normal' } - }; - - var topicsString = ""; - - var topicReferenceId = georesource.topicReference; - - // will be an array representing the topic hierarchy - // i.e. [mainTopic, subTopicFirstTier, subTopicSecondTier, ...] - var topicHierarchyArray = this.getTopicHierarchyForTopicId(topicReferenceId); - - for (let index = 0; index < topicHierarchyArray.length; index++) { - if (index === 0) { - // mainTopic --> first tier - topicsString += topicHierarchyArray[index].topicName; - } - else { - var numberOfWhitespaces = 2 * index; - var whitespaceString = ""; - for (let k = 0; k < numberOfWhitespaces; k++) { - whitespaceString += " "; - } - topicsString += whitespaceString + topicHierarchyArray[index].topicName; - } - - if (index < topicHierarchyArray.length - 1) { - topicsString += "\n"; - } - - } - - var category = "Punkt"; - if (georesource.isLOI) { - category = "Linie"; - } - else if(georesource.isAOI){ - category = "Fläche"; - } - - // Or JavaScript: - jspdf.autoTable({ - head: [['Themenfeld', 'Datentyp', 'letzte Aktualisierung']], - body: [ - [topicsString, category, this.tsToDate_withOptionalUpdateInterval(this.dateToTS(georesource.metadata.lastUpdate))] - // ... - ], - theme: 'grid', - headStyles: headStyles, - bodyStyles: bodyStyles, - startY: initialStartY - }); - - var datesString = ""; - - if(georesource.availablePeriodsOfValidity.length <= 10){ - for (var [j, period] of georesource.availablePeriodsOfValidity.entries()) { - - var startDate = new Date(period.startDate); - var endDate = period.endDate? new Date(period.endDate) : undefined; - - datesString += "Zeitspanne: " + this.tsToDate_withOptionalUpdateInterval(this.dateToTS(startDate)); - if(endDate){ - datesString += " - " + this.tsToDate_withOptionalUpdateInterval(this.dateToTS(endDate)); - } - else{ - datesString += "- 'null' (demnach gültig bis auf weiteres)"; - } - - if (j < georesource.availablePeriodsOfValidity.length - 1) { - datesString += "\n"; - } - } - } - else{ - datesString += "insgesamt " + georesource.availablePeriodsOfValidity.length + " Zeitspannen\n\n"; - - var earliestStartDate; - var latestEndDate = -1; // my be null --> enc init with -1 - - for (var [j, period] of georesource.availablePeriodsOfValidity.entries()) { - - if(! earliestStartDate){ - earliestStartDate = new Date(period.startDate); - } - else{ - if(new Date(period.startDate) < earliestStartDate){ - earliestStartDate = new Date(period.startDate); - } - } - - if(latestEndDate == -1){ - if(period.endDate){ - latestEndDate = new Date(period.endDate); - } - else if(period.endDate == null){ - latestEndDate = null; - } - - } - else{ - if(latestEndDate && period.endDate && new Date(period.endDate) > latestEndDate){ - latestEndDate = new Date(period.endDate); - } - } - } - - datesString += "frühestes Startdatum: " + this.tsToDate_withOptionalUpdateInterval(this.dateToTS(earliestStartDate)) + "\n"; - if(latestEndDate != null && latestEndDate != -1){ - datesString += "spätestes Enddatum: " + this.tsToDate_withOptionalUpdateInterval(this.dateToTS(latestEndDate)) + "\n"; - } - else{ - datesString += "spätestes Enddatum: ohne explizites Enddatum (demnach gültig bis auf weiteres)\n"; - } - - - } - - // linked elements - jspdf.autoTable({ - head: [], - body: [ - ["Beschreibung", georesource.metadata.description], - ["Datengrundlage", georesource.metadata.databasis ? georesource.metadata.databasis : "-"], - ["Datenquelle", georesource.metadata.datasource ? georesource.metadata.datasource : "-"], - ["Datenhalter und Kontakt", georesource.metadata.contact ? georesource.metadata.contact : "-"], - ["Bemerkung", georesource.metadata.note ? georesource.metadata.note : "-"], - // $scope.updateInteval is a map mapping the english KEYs to german expressions - ["Zeitbezug / Fortführungsintervall", this.updateInterval.get(georesource.metadata.updateInterval.toUpperCase())], - ["Verfügbare Gültigkeitszeiträume", datesString], - ["Quellen / Literatur", georesource.metadata.literature ? georesource.metadata.literature : "-"] - ], - theme: 'grid', - headStyles: headStyles, - bodyStyles: bodyStyles, - columnStyles: columnStyles, - startY: jspdf.autoTable.previous.finalY + 10 - }); - - jspdf.setProperties({ - title: 'KomMonitor Geodatenblatt', - subject: pdfName, - author: 'KomMonitor', - keywords: 'Geodaten, Metadatenblatt', - creator: 'KomMonitor' - }); - return jspdf; - }; - - this.generateGeoresourceMetadataPdf_asBlob = async function(georesourceMetadata){ - var pdfName = georesourceMetadata.datasetName + ".pdf"; - var jspdf = await this.createMetadataPDF_georesource(georesourceMetadata, pdfName); - return jspdf.output("blob", {filename: pdfName}); - }; - - this.downloadMetadataPDF_georesource = async function(georesourceMetadata){ - var pdfName = georesourceMetadata.datasetName + ".pdf"; - var jspdf = await this.createMetadataPDF_georesource(georesourceMetadata, pdfName); - return jspdf.save(pdfName); - }; - - // this.getIndicatorStringFromIndicatorType = function (indicator) { - // var indicatorTypeString; - // if (indicator.indicatorType.includes("DYNAMIC_ABSOLUTE")) { - // indicatorTypeString = "Dynamik-Indikator (absolute)"; - // } - // else if (indicator.indicatorType.includes("DYNAMIC_RELATIVE")) { - // indicatorTypeString = "Dynamik-Indikator (relativ)"; - // } - // else if (indicator.indicatorType.includes("DYNAMIC_STANDARDIZED")) { - // indicatorTypeString = "Dynamik-Indikator (standardisiert)"; - // } - // else if (indicator.indicatorType.includes("STATUS_ABSOLUTE")) { - // indicatorTypeString = "Status-Indikator (absolut)"; - // } - // else if (indicator.indicatorType.includes("STATUS_RELATIVE")) { - // indicatorTypeString = "Status-Indikator (relativ)"; - // } - // else if (indicator.indicatorType.includes("STATUS_STANDARDIZED")) { - // indicatorTypeString = "Status-Indikator (standardisiert)"; - // } - - // return indicatorTypeString; - // }; - - this.dateToTS = function(date) { - if(date){ - return date.valueOf(); - } - - }; - - this.tsToDate = function(ts) { - if(ts){ - var date = new Date(ts); - - return date.toLocaleDateString("de-DE", { - year: 'numeric', - month: 'long', - day: 'numeric' - }); - } - }; - - this.tsToDate_withOptionalUpdateInterval = function(ts, updateIntervalApiName) { - if(ts){ - var date = new Date(ts); - - /** - * TODO FIXME dateSLider formatter will return only year for now to prevent misleading month and day settings - */ - - // return date.getFullYear(); - - if(updateIntervalApiName){ - if(updateIntervalApiName.toLowerCase() === "yearly"){ - return date.getFullYear(); - } - else if(updateIntervalApiName.toLowerCase() === "half_yearly"){ - return (date.getMonth() + 1) + "/" + date.getFullYear(); - } - else if(updateIntervalApiName.toLowerCase() === "monthly"){ - return (date.getMonth() + 1) + "/" + date.getFullYear(); - } - // else if(updateIntervalApiName.toLowerCase() === "weekly"){ - // return date.toLocaleDateString("de-DE", { - // year: 'numeric', - // month: 'short', - // day: 'numeric' - // }); - // } - // else if(updateIntervalApiName.toLowerCase() === "daily"){ - // return date.toLocaleDateString("de-DE", { - // year: 'numeric', - // month: 'short', - // day: 'numeric' - // }); - // } - else if(updateIntervalApiName.toLowerCase() === "quarterly"){ - var year = date.getFullYear(); - var month = date.getMonth(); - if(month < 4){ - return "Q1/" + year; - } - else if(month < 7){ - return "Q2/" + year; - } - else if(month < 10){ - return "Q3/" + year; - } - else { - return "Q4/" + year; - } - } - else{ - // includes daily and weekly, as they are presented equally - return date.toLocaleDateString("de-DE", { - year: 'numeric', - month: 'short', - day: 'numeric' - }); - } - } - else{ - return date.toLocaleDateString("de-DE", { - year: 'numeric', - month: 'short', - day: 'numeric' - }); - } - - } - }; - - this.getSpatialUnitIdFromSpatialUnitName = function(name) { - let result = null; - $(this.availableSpatialUnits).each( (id, obj) => { - if (obj.spatialUnitLevel === name) { - result = obj.spatialUnitId; - return false; - } - }); - return result; - } - - /** - * creates an array of objects from an array of strings. - * each object in the result has the properties "category" and "name" - * - * example: - * convert ["s1", "s2", ...] ===> [{category: "s1",name: "s1"}, {category: "s2", name: "s2"}, ...] - * @param {array} array - */ - this.createDualListInputArray = function(array, nameProperty, idProperty) { - var result = []; - - if(array && Array.isArray(array)){ - for (var i=0;i { - return el.type === type; - }); - if(typeof(result) === "undefined") { - throw "No DefaultReportingTemplatePageElement exists for type " + type + "." - } else { - return result[0]; - } - } - - - this.generateAndDownloadIndicatorZIP = async function(indicatorData, fileName, fileEnding, jsZipOptions){ - // generate metadata file and include actual dataset and metadata file in download - - var metadataPdf = await this.generateIndicatorMetadataPdf_asBlob(); - var zip = new JSZip(); - zip.file(fileName + fileEnding, indicatorData, jsZipOptions); - zip.file(fileName + "_Metadata.pdf", metadataPdf); - zip.generateAsync({type:"blob"}) - .then(function(content) { - // see FileSaver.js - saveAs(content, fileName + ".zip"); - }); - }; - - this.generateAndDownloadGeoresourceZIP = async function(georesourceMetadata, georesourceData, fileName, fileEnding, jsZipOptions){ - // generate metadata file and include actual dataset and metadata file in download - - var metadataPdf = await this.generateGeoresourceMetadataPdf_asBlob(georesourceMetadata); - var zip = new JSZip(); - zip.file(fileName + fileEnding, georesourceData, jsZipOptions); - zip.file(fileName + "_Metadata.pdf", metadataPdf); - zip.generateAsync({type:"blob"}) - .then(function(content) { - // see FileSaver.js - saveAs(content, fileName + ".zip"); - }); - }; -}]); diff --git a/app/util/genericServices/kommonitorDataGridHelperService/kommonitor-data-grid-helper-service.module.ts b/app/util/genericServices/kommonitorDataGridHelperService/kommonitor-data-grid-helper-service.module.ts deleted file mode 100644 index 72262fa72..000000000 --- a/app/util/genericServices/kommonitorDataGridHelperService/kommonitor-data-grid-helper-service.module.ts +++ /dev/null @@ -1,3017 +0,0 @@ -angular.module('kommonitorDataGridHelper', ['kommonitorDataExchange']); - -angular - .module('kommonitorDataGridHelper', []) - .service( - 'kommonitorDataGridHelperService', ['kommonitorDataExchangeService', '$rootScope', '$timeout', '$http', '$httpParamSerializerJQLike', '__env', - function (kommonitorDataExchangeService, $rootScope, $timeout, - $http, $httpParamSerializerJQLike, __env) { - - var self = this; - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeService; - - this.resourceType_georesource = "georesource"; - this.resourceType_spatialUnit = "spatialUnit"; - this.resourceType_indicator = "indicator"; - - this.featureTable_spatialUnit_lastUpdate_timestamp_success = undefined; - this.featureTable_spatialUnit_lastUpdate_timestamp_failure = undefined; - this.featureTable_georesource_lastUpdate_timestamp_success = undefined; - this.featureTable_georesource_lastUpdate_timestamp_failure = undefined; - this.featureTable_indicator_lastUpdate_timestamp_success = undefined; - this.featureTable_indicator_lastUpdate_timestamp_failure = undefined; - - this.dataGridOptions_indicators; - this.dataGridOptions_georesources_poi; - this.dataGridOptions_georesources_loi; - this.dataGridOptions_georesources_aoi; - this.dataGridOptions_spatialUnits; - this.dataGridOptions_accessControl; - - function getCurrentTimestampString(){ - let date = new Date(); - let hours = date.getHours(); - if(hours < 10){ - hours = "0" + hours; - } - let minutes = date.getMinutes(); - if(minutes < 10){ - minutes = "0" + minutes; - } - let seconds = date.getSeconds(); - if(seconds < 10){ - seconds = "0" + seconds; - } - return "" + hours + ":" + minutes + ":" + seconds; - } - - function headerHeightGetter() { - var columnHeaderTexts = [ - ...document.querySelectorAll('.ag-header-cell-text'), - ]; - var clientHeights = columnHeaderTexts.map( - headerText => headerText.clientHeight - ); - var tallestHeaderTextHeight = Math.max(...clientHeights); - - return tallestHeaderTextHeight; - } - - function headerHeightSetter(gridOptions) { - var padding = 20; - var height = headerHeightGetter() + padding; - gridOptions.api.setHeaderHeight(height); - } - - var displayEditButtons_indicators = function (params) { - let disabledEditButtons = !params.data.userPermissions.includes("editor") - let editMetadataButtonId = 'btn_georesource_editMetadata_' + params.data.indicatorId; - let editFeaturesButtonId = 'btn_georesource_editFeatures_' + params.data.indicatorId; - - let html = '
        '; - html += ''; - html += ''; - - if(!disabledEditButtons){ - html = html.replaceAll("disabled", "") //enabled - } - - if (kommonitorDataExchangeService.enableKeycloakSecurity) { - // disable button if there is no applicable spatial unit or user has no creator rights - let disabled = params.data.applicableSpatialUnits.length == 0 || !params.data.userPermissions.includes("editor"); - html += ''; - html += ''; - html += '' - html += '
        '; - - return html; - }; - - var displayEditButtons_spatialUnits = function (params) { - - let html = '
        '; - html += ''; - html += ''; - html += '' - html += '
        '; - - return html; - }; - - var displayEditButtons_accessControl = function (params) { - - let html = '
        '; - html += ''; - html += '
        '; - - return html; - }; - - function getDatePicker() { - // function to act as a class - function Datepicker() {} - - // gets called once before the renderer is used - Datepicker.prototype.init = function (params) { - // create the cell - this.eInput = document.createElement('input'); - this.eInput.value = params.value; - this.eInput.classList.add('ag-input'); - this.eInput.style.height = '100%'; - - // https://jqueryui.com/datepicker/ - // $(this.eInput).datepicker({ - // dateFormat: 'yyyy-mm-dd', - // }); - $(this.eInput).datepicker(kommonitorDataExchangeService.datePickerOptions); - - }; - - // gets called once when grid ready to insert the element - Datepicker.prototype.getGui = function () { - return this.eInput; - }; - - // focus and select can be done after the gui is attached - Datepicker.prototype.afterGuiAttached = function () { - this.eInput.focus(); - this.eInput.select(); - }; - - // returns the new value after editing - Datepicker.prototype.getValue = function () { - return this.eInput.value; - }; - - // any cleanup we need to be done here - Datepicker.prototype.destroy = () => { - // but this example is simple, no cleanup, we could - // even leave this method out as it's optional - }; - - // if true, then this editor will appear in a popup - Datepicker.prototype.isPopup = () => { - // and we could leave this method out also, false is the default - return false; - }; - - return Datepicker; - } - - this.buildDataGridColumnConfig_indicators = function (indicatorMetadataArray) { - const columnDefs = [ - { headerName: 'Editierfunktionen', pinned: 'left', maxWidth: 150, checkboxSelection: false, filter: false, sortable: false, cellRenderer: 'displayEditButtons_indicators' }, - { headerName: 'Id', field: "indicatorId", pinned: 'left', maxWidth: 125 }, - { headerName: 'Name', field: "indicatorName", pinned: 'left', minWidth: 300 }, - { headerName: 'Einheit', field: "unit", minWidth: 200 }, - { headerName: 'Beschreibung', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.description; }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + params.data.metadata.description; - } - }, - { - headerName: 'Methodik', minWidth: 400, - cellRenderer: function (params) { - - if(params.data.processDescription && params.data.processDescription.includes("$$")){ - let splitArray = params.data.processDescription.split("$$"); - - for (let index = 0; index < splitArray.length; index++) { - if((index % 2) == 0){ - params.data.processDescription += "
        "; - } - } - } - return params.data.processDescription; - }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + params.data.processDescription; - } - }, - { - headerName: 'Verfügbare Raumeinheiten', field: "applicableSpatialUnits", minWidth: 400, - cellRenderer: function (params) { - /* -
          -
        • - {{::applicableSpatialUnit.spatialUnitName}} -
        • -
        - */ - let html = '
          '; - for (const applicableSpatialUnit of params.data.applicableSpatialUnits) { - html += '
        • '; - html += applicableSpatialUnit.spatialUnitName; - html += '
        • '; - } - html += '
        '; - return html; - }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - if (params.data.applicableSpatialUnits && params.data.applicableSpatialUnits.length > 1){ - return "" + JSON.stringify(params.data.applicableSpatialUnits); - } - return params.data.applicableSpatialUnits; - } - }, - { - headerName: 'Verfügbare Zeitschnitte', field: "applicableDates", minWidth: 400, - cellRenderer: function (params) { - /* -
          -
        • - {{::timestamp}} -
        • -
        - */ - let html = '
          '; - for (const timestamp of params.data.applicableDates) { - html += '
        • '; - html += timestamp; - html += '
        • '; - } - html += '
        '; - return html; - }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - if (params.data.applicableDates && params.data.applicableDates.length > 1){ - return "" + JSON.stringify(params.data.applicableDates); - } - return params.data.applicableDates; - } - }, - { headerName: 'Kürzel', field: "abbreviation" }, - { headerName: 'Leitindikator', field: "isHeadlineIndicator" }, - { headerName: 'Indikator-Typ', minWidth: 200, - cellRenderer: function (params) { return kommonitorDataExchangeService.getIndicatorStringFromIndicatorType(params.data.indicatorType); }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + kommonitorDataExchangeService.getIndicatorStringFromIndicatorType(params.data.indicatorType); - } - }, - { headerName: 'Merkmal', field: "characteristicValue", minWidth: 200 }, - { headerName: 'Art der Fortführung', field: "creationType", minWidth: 200 }, - // { headerName: 'Interpretation', minWidth: 400, cellRenderer: function(params){ return params.data.interpretation; } }, - - { headerName: 'Tags/Stichworte', field: "tags", minWidth: 250 }, - { headerName: 'Themenhierarchie', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getTopicHierarchyDisplayString(params.data.topicReference); }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + kommonitorDataExchangeService.getTopicHierarchyDisplayString(params.data.topicReference); - } - }, - { headerName: 'Datenquelle', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.datasource; }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + params.data.metadata.datasource; - } - }, - { headerName: 'Datenhalter und Kontakt', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.contact; }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + params.data.metadata.contact; - } - }, - { headerName: 'Rollen', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); - } - } - ]; - - return columnDefs; - }; - - this.buildDataGridRowData_indicators = function (indicatorMetadataArray) { - return indicatorMetadataArray; - }; - - - this.buildDataGridColumnConfig_georesources_poi = function (georesourceMetadataArray) { - const columnDefs = [ - { headerName: 'Editierfunktionen', pinned: 'left', maxWidth: 150, checkboxSelection: false, - headerCheckboxSelection: false, - headerCheckboxSelectionFilteredOnly: true, - filter: false, - sortable: false, cellRenderer: 'displayEditButtons_georesources' }, - { headerName: 'Id', field: "georesourceId", pinned: 'left', maxWidth: 125 }, - { headerName: 'Name', field: "datasetName", pinned: 'left', minWidth: 300 }, - { headerName: 'Symbolfarbe', filter: false, sortable: false, maxWidth: 125, cellRenderer: function (params) { return "
        " + params.data.poiSymbolColor+ "

        "; } }, - { headerName: 'Symbolname', maxWidth: 125, - cellRenderer: function (params) { return params.data.poiSymbolBootstrap3Name + "

        "; }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + params.data.poiSymbolBootstrap3Name; - } - }, - { headerName: 'Markerfarbe', filter: false, sortable: false, maxWidth: 125, cellRenderer: function (params) { return "
        " + params.data.poiMarkerColor+ "

        "; } }, - { headerName: 'Beschreibung', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.description; }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + params.data.metadata.description; - } - }, - { - headerName: 'Gültigkeitszeitraum', minWidth: 400, - cellRenderer: function (params) { - /* -
          -
        • -

          {{::periodOfValidity.startDate}} - {{::periodOfValidity.endDate}}

          -

          {{::periodOfValidity.startDate}} - heute

          -
        • -
        - */ - let html = '
          '; - for (const periodOfValidity of params.data.availablePeriodsOfValidity) { - html += '
        • '; - - if(periodOfValidity.endDate){ - html += "

          " + periodOfValidity.startDate + " ‐ " + periodOfValidity.endDate + "

          " ; - } - else{ - html += "

          " + periodOfValidity.startDate + " ‐ heute

          "; - } - html += '
        • '; - } - html += '
        '; - return html; - }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - if (params.data.availablePeriodsOfValidity && params.data.availablePeriodsOfValidity.length > 1){ - return "" + JSON.stringify(params.data.availablePeriodsOfValidity); - } - return params.data.availablePeriodsOfValidity; - } - }, - { headerName: 'Themenhierarchie', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getTopicHierarchyDisplayString(params.data.topicReference); }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + kommonitorDataExchangeService.getTopicHierarchyDisplayString(params.data.topicReference); - } - }, - { headerName: 'Datenquelle', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.datasource; }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + params.data.metadata.datasource; - } - }, - { headerName: 'Datenhalter und Kontakt', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.contact; }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + params.data.metadata.contact; - } - }, - { headerName: 'Rollen', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); - } - } - ]; - - return columnDefs; - }; - - this.buildDataGridColumnConfig_georesources_loi = function (georesourceMetadataArray) { - const columnDefs = [ - { headerName: 'Editierfunktionen', pinned: 'left', maxWidth: 150, checkboxSelection: false, headerCheckboxSelection: false, - headerCheckboxSelectionFilteredOnly: true, filter: false, sortable: false, cellRenderer: 'displayEditButtons_georesources' }, - { headerName: 'Id', field: "georesourceId", pinned: 'left', maxWidth: 125 }, - { headerName: 'Name', field: "datasetName", pinned: 'left', minWidth: 300 }, - { headerName: 'Linienfarbe', filter: false, sortable: false, maxWidth: 125, cellRenderer: function (params) { return "
        " + params.data.loiColor+ "

        "; } }, - { headerName: 'Linienbreite', maxWidth: 125, field: "loiWidth"}, - { headerName: 'Linienmuster', filter: false, sortable: false, maxWidth: 125, cellRenderer: function (params) { return "
        " + kommonitorDataExchangeService.getLoiDashSvgFromStringValue(params.data.loiDashArrayString) + "
        "; } }, - { headerName: 'Beschreibung', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.description; }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + params.data.metadata.description; - } - }, - { - headerName: 'Gültigkeitszeitraum', minWidth: 400, - cellRenderer: function (params) { - /* -
          -
        • -

          {{::periodOfValidity.startDate}} - {{::periodOfValidity.endDate}}

          -

          {{::periodOfValidity.startDate}} - heute

          -
        • -
        - */ - let html = '
          '; - for (const periodOfValidity of params.data.availablePeriodsOfValidity) { - html += '
        • '; - - if(periodOfValidity.endDate){ - html += "

          " + periodOfValidity.startDate + " ‐ " + periodOfValidity.endDate + "

          " ; - } - else{ - html += "

          " + periodOfValidity.startDate + " ‐ heute

          "; - } - html += '
        • '; - } - html += '
        '; - return html; - }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - if (params.data.availablePeriodsOfValidity && params.data.availablePeriodsOfValidity.length > 1){ - return "" + JSON.stringify(params.data.availablePeriodsOfValidity); - } - return params.data.availablePeriodsOfValidity; - } - }, - { headerName: 'Themenhierarchie', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getTopicHierarchyDisplayString(params.data.topicReference); }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + kommonitorDataExchangeService.getTopicHierarchyDisplayString(params.data.topicReference); - } - }, - { headerName: 'Datenquelle', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.datasource; }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + params.data.metadata.datasource; - } - }, - { headerName: 'Datenhalter und Kontakt', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.contact; }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + params.data.metadata.contact; - } - }, - { headerName: 'Rollen', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); - } - } - ]; - - return columnDefs; - }; - - this.buildDataGridColumnConfig_georesources_aoi = function (georesourceMetadataArray) { - const columnDefs = [ - { headerName: 'Editierfunktionen', pinned: 'left', maxWidth: 150, checkboxSelection: false, headerCheckboxSelection: false, - headerCheckboxSelectionFilteredOnly: true, filter: false, sortable: false, cellRenderer: 'displayEditButtons_georesources' }, - { headerName: 'Id', field: "georesourceId", pinned: 'left', maxWidth: 125 }, - { headerName: 'Name', field: "datasetName", pinned: 'left', minWidth: 300 }, - { headerName: 'Polygonfarbe', filter: false, sortable: false, maxWidth: 125, cellRenderer: function (params) { return "
        " + params.data.aoiColor+ "

        "; } }, - { headerName: 'Beschreibung', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.description; }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + params.data.metadata.description; - } - }, - { - headerName: 'Gültigkeitszeitraum', minWidth: 400, - cellRenderer: function (params) { - /* -
          -
        • -

          {{::periodOfValidity.startDate}} - {{::periodOfValidity.endDate}}

          -

          {{::periodOfValidity.startDate}} - heute

          -
        • -
        - */ - let html = '
          '; - for (const periodOfValidity of params.data.availablePeriodsOfValidity) { - html += '
        • '; - - if(periodOfValidity.endDate){ - html += "

          " + periodOfValidity.startDate + " ‐ " + periodOfValidity.endDate + "

          " ; - } - else{ - html += "

          " + periodOfValidity.startDate + " ‐ heute

          "; - } - html += '
        • '; - } - html += '
        '; - return html; - }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - if (params.data.availablePeriodsOfValidity && params.data.availablePeriodsOfValidity.length > 1){ - return "" + JSON.stringify(params.data.availablePeriodsOfValidity); - } - return params.data.availablePeriodsOfValidity; - } - }, - { headerName: 'Themenhierarchie', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getTopicHierarchyDisplayString(params.data.topicReference); }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + kommonitorDataExchangeService.getTopicHierarchyDisplayString(params.data.topicReference); - } - }, - { headerName: 'Datenquelle', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.datasource; }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + params.data.metadata.datasource; - } - }, - { headerName: 'Datenhalter und Kontakt', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.contact; }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + params.data.metadata.contact; - } - }, - { headerName: 'Rollen', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); - } - } - ]; - - return columnDefs; - }; - - this.buildDataGridRowData_georesources_poi = function (georesourceMetadataArray) { - return georesourceMetadataArray.filter(georesourceMetadata => georesourceMetadata.isPOI); - }; - - this.buildDataGridRowData_georesources_loi = function (georesourceMetadataArray) { - return georesourceMetadataArray.filter(georesourceMetadata => georesourceMetadata.isLOI); - }; - - this.buildDataGridRowData_georesources_aoi = function (georesourceMetadataArray) { - return georesourceMetadataArray.filter(georesourceMetadata => georesourceMetadata.isAOI); - }; - - this.getSelectedGeoresourcesMetadata = function(){ - let georesourceMetadataArray = []; - - //POI - if (this.dataGridOptions_georesources_poi && this.dataGridOptions_georesources_poi.api){ - let selectedPoiNodes = this.dataGridOptions_georesources_poi.api.getSelectedNodes(); - - for (const selectedPoiNode of selectedPoiNodes) { - georesourceMetadataArray.push(selectedPoiNode.data); - } - } - - //LOI - if (this.dataGridOptions_georesources_loi && this.dataGridOptions_georesources_loi.api){ - let selectedLoiNodes = this.dataGridOptions_georesources_loi.api.getSelectedNodes(); - - for (const selectedLoiNode of selectedLoiNodes) { - georesourceMetadataArray.push(selectedLoiNode.data); - } - } - - //AOI - if (this.dataGridOptions_georesources_aoi && this.dataGridOptions_georesources_aoi.api){ - let selectedAoiNodes = this.dataGridOptions_georesources_aoi.api.getSelectedNodes(); - - for (const selectedAoiNode of selectedAoiNodes) { - georesourceMetadataArray.push(selectedAoiNode.data); - } - } - - return georesourceMetadataArray; - }; - - this.buildDataGridRowData_spatialUnits = function (spatialUnitMetadataArray) { - return spatialUnitMetadataArray; - }; - - this.buildDataGridColumnConfig_spatialUnits = function (spatialUnitMetadataArray) { - const columnDefs = [ - { headerName: 'Editierfunktionen', pinned: 'left', maxWidth: 150, checkboxSelection: false, headerCheckboxSelection: false, - headerCheckboxSelectionFilteredOnly: true, filter: false, sortable: false, cellRenderer: 'displayEditButtons_spatialUnits' }, - { headerName: 'Id', field: "spatialUnitId", pinned: 'left', maxWidth: 125 }, - { headerName: 'Name', field: "spatialUnitLevel", pinned: 'left', minWidth: 300 }, - { headerName: 'Beschreibung', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.description; }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + params.data.metadata.description; - } - }, - { headerName: 'Nächst niedrigere Raumebene', field: "nextLowerHierarchyLevel", minWidth: 250 }, - { headerName: 'Nächst höhere Raumebene', field: "nextUpperHierarchyLevel", minWidth: 250 }, - { - headerName: 'Gültigkeitszeitraum', minWidth: 400, - cellRenderer: function (params) { - /* -
          -
        • -

          {{::periodOfValidity.startDate}} - {{::periodOfValidity.endDate}}

          -

          {{::periodOfValidity.startDate}} - heute

          -
        • -
        - */ - let html = '
          '; - for (const periodOfValidity of params.data.availablePeriodsOfValidity) { - html += '
        • '; - - if(periodOfValidity.endDate){ - html += "

          " + periodOfValidity.startDate + " ‐ " + periodOfValidity.endDate + "

          " ; - } - else{ - html += "

          " + periodOfValidity.startDate + " ‐ heute

          "; - } - html += '
        • '; - } - html += '
        '; - return html; - }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - if (params.data.availablePeriodsOfValidity && params.data.availablePeriodsOfValidity.length > 1){ - return "" + JSON.stringify(params.data.availablePeriodsOfValidity); - } - return params.data.availablePeriodsOfValidity; - } - }, - { headerName: 'Datenquelle', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.datasource; }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + params.data.metadata.datasource; - } - }, - { headerName: 'Datenhalter und Kontakt', minWidth: 400, cellRenderer: function (params) { return params.data.metadata.contact; }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + params.data.metadata.contact; - } - }, - { headerName: 'Rollen', minWidth: 400, cellRenderer: function (params) { return kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return "" + kommonitorDataExchangeService.getAllowedRolesString(params.data.allowedRoles); - } - } - ]; - - return columnDefs; - }; - - this.getSelectedSpatialUnitsMetadata = function(){ - let spatialUnitsMetadataArray = []; - - if (this.dataGridOptions_spatialUnits && this.dataGridOptions_spatialUnits.api){ - let selectedNodes = this.dataGridOptions_spatialUnits.api.getSelectedNodes(); - - for (const selectedNode of selectedNodes) { - spatialUnitsMetadataArray.push(selectedNode.data); - } - } - - return spatialUnitsMetadataArray; - }; - - this.getSelectedAccessControlMetadata = function(){ - let accessControlMetadataArray = []; - - if (this.dataGridOptions_accessControl && this.dataGridOptions_accessControl.api){ - let selectedNodes = this.dataGridOptions_accessControl.api.getSelectedNodes(); - - for (const selectedNode of selectedNodes) { - accessControlMetadataArray.push(selectedNode.data); - } - } - - return accessControlMetadataArray; - }; - - this.getSelectedScriptsMetadata = function(){ - let scriptsMetadataArray = []; - - if (this.dataGridOptions_scripts && this.dataGridOptions_scripts.api){ - let selectedNodes = this.dataGridOptions_scripts.api.getSelectedNodes(); - - for (const selectedNode of selectedNodes) { - scriptsMetadataArray.push(selectedNode.data); - } - } - - return scriptsMetadataArray; - }; - - this.buildDataGridOptions_indicators = function (indicatorMetadataArray) { - let columnDefs = this.buildDataGridColumnConfig_indicators(indicatorMetadataArray); - let rowData = this.buildDataGridRowData_indicators(indicatorMetadataArray); - - let gridOptions = { - defaultColDef: { - editable: false, - sortable: true, - flex: 1, - minWidth: 200, - filter: true, - floatingFilter: true, - // filterParams: { - // newRowsAction: 'keep' - // }, - resizable: true, - wrapText: true, - autoHeight: true, - cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, - headerComponentParams: { - template: - '', - }, - }, - components: { - displayEditButtons_indicators: displayEditButtons_indicators - }, - columnDefs: columnDefs, - rowData: rowData, - enableCellTextSelection: true, - ensureDomOrder: true, - pagination: true, - paginationPageSize: 10, - suppressColumnVirtualisation: true, - // rowHeight: 200, - onGridReady: function () { - // self.registerClickHandler_indicators(indicatorMetadataArray); - }, - onFirstDataRendered: function () { - headerHeightSetter(self.dataGridOptions_indicators); - // self.registerClickHandler_indicators(indicatorMetadataArray); - }, - onColumnResized: function () { - headerHeightSetter(self.dataGridOptions_indicators); - // self.registerClickHandler_indicators(indicatorMetadataArray); - }, - onModelUpdated: function () { - self.registerClickHandler_indicators(indicatorMetadataArray); - - }, - onRowDataChanged: function () { - self.registerClickHandler_indicators(indicatorMetadataArray); - }, - // onPaginationChanged: function () { - // self.registerClickHandler_indicators(indicatorMetadataArray); - // }, - onViewportChanged: function () { - self.registerClickHandler_indicators(indicatorMetadataArray); - setTimeout(function () { - let domNode = document.querySelector('#indicatorOverviewTable'); - // if (domNode) { - // MathJax.typesetPromise(); - // } - MathJax.typesetPromise().then(function (){ - // setTimeout(function () { - // self.dataGridOptions_indicators.api.resetRowHeights(); - // }, 1000); - // self.dataGridOptions_indicators.api.resetRowHeights(); - }); - - // setTimeout(function () { - // self.dataGridOptions_indicators.api.resetRowHeights(); - // }, 1000); - }, 250); - }, - - }; - - return gridOptions; - }; - - this.registerClickHandler_indicators = function (indicatorMetadataArray) { - - // for (const indicatorMetadata of indicatorMetadataArray) { - // $( "#btn_indicator_editMetadata_" + indicatorMetadata.indicatorId).click(function() { - // let indicatorId = this.id.split("_")[3]; - - // let indicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(indicatorId); - - // $rootScope.$broadcast("onEditIndicatorMetadata", indicatorMetadata); - // }); - // } - - //first unbind previous click events - $(".indicatorEditMetadataBtn").off(); - $(".indicatorEditMetadataBtn").on("click", function (event) { - // ensure that only the target button gets clicked - // manually open modal - event.stopPropagation(); - let modalId = document.getElementById(this.id).getAttribute("data-target"); - $(modalId).modal('show'); - - let indicatorId = this.id.split("_")[3]; - - let indicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(indicatorId); - - $rootScope.$broadcast("onEditIndicatorMetadata", indicatorMetadata); - }); - - //first unbind previous click events - $(".indicatorEditFeaturesBtn").off(); - $(".indicatorEditFeaturesBtn").on("click", function (event) { - // ensure that only the target button gets clicked - // manually open modal - event.stopPropagation(); - let modalId = document.getElementById(this.id).getAttribute("data-target"); - $(modalId).modal('show'); - - let indicatorId = this.id.split("_")[3]; - - let indicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(indicatorId); - - $rootScope.$broadcast("onEditIndicatorFeatures", indicatorMetadata); - }); - - $(".indicatorEditRoleBasedAccessBtn").off(); - $(".indicatorEditRoleBasedAccessBtn").on("click", function (event) { - // ensure that only the target button gets clicked - // manually open modal - event.stopPropagation(); - let modalId = document.getElementById(this.id).getAttribute("data-target"); - $(modalId).modal('show'); - - let indicatorId = this.id.split("_")[3]; - - let indicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(indicatorId); - - $rootScope.$broadcast("onEditIndicatorSpatialUnitRoles", indicatorMetadata); - }); - - }; - - this.registerClickHandler_georesources = function (georesourceMetadataArray) { - - $(".georesourceEditMetadataBtn").off(); - $(".georesourceEditMetadataBtn").on("click", function (event) { - // ensure that only the target button gets clicked - // manually open modal - event.stopPropagation(); - let modalId = document.getElementById(this.id).getAttribute("data-target"); - $(modalId).modal('show'); - - let georesourceId = this.id.split("_")[3]; - - let georesourceMetadata = kommonitorDataExchangeService.getGeoresourceMetadataById(georesourceId); - - $rootScope.$broadcast("onEditGeoresourceMetadata", georesourceMetadata); - }); - - $(".georesourceEditFeaturesBtn").off(); - $(".georesourceEditFeaturesBtn").on("click", function (event) { - // ensure that only the target button gets clicked - // manually open modal - event.stopPropagation(); - let modalId = document.getElementById(this.id).getAttribute("data-target"); - $(modalId).modal('show'); - - let georesourceId = this.id.split("_")[3]; - - let georesourceMetadata = kommonitorDataExchangeService.getGeoresourceMetadataById(georesourceId); - - $rootScope.$broadcast("onEditGeoresourceFeatures", georesourceMetadata); - }); - - $(".georesourceDeleteBtn").off(); - $(".georesourceDeleteBtn").on("click", function (event) { - // ensure that only the target button gets clicked - // manually open modal - event.stopPropagation(); - let modalId = document.getElementById(this.id).getAttribute("data-target"); - $(modalId).modal('show'); - - let spatialUnitId = this.id.split("_")[3]; - - let spatialUnitMetadata = kommonitorDataExchangeService.getGeoresourceMetadataById(spatialUnitId); - - $rootScope.$broadcast("onDeleteGeoresources", [spatialUnitMetadata]); //handler function takes an array - }); - - }; - - this.buildDataGrid_indicators = function (indicatorMetadataArray) { - if (this.dataGridOptions_indicators && this.dataGridOptions_indicators.api && document.querySelector('#indicatorOverviewTable').childElementCount > 0) { - - this.saveGridStore(this.dataGridOptions_indicators); - let newRowData = this.buildDataGridRowData_indicators(indicatorMetadataArray); - this.dataGridOptions_indicators.api.setRowData(newRowData); - this.restoreGridStore(this.dataGridOptions_indicators); - } - else { - this.dataGridOptions_indicators = this.buildDataGridOptions_indicators(indicatorMetadataArray); - let gridDiv = document.querySelector('#indicatorOverviewTable'); - new agGrid.Grid(gridDiv, this.dataGridOptions_indicators); - } - }; - - this.buildDataGridOptions_georesources_poi = function (georesourceMetadataArray) { - let columnDefs = this.buildDataGridColumnConfig_georesources_poi(georesourceMetadataArray); - let rowData = this.buildDataGridRowData_georesources_poi(georesourceMetadataArray); - - let gridOptions = { - defaultColDef: { - editable: false, - sortable: true, - flex: 1, - minWidth: 200, - filter: true, - floatingFilter: true, - // filterParams: { - // newRowsAction: 'keep' - // }, - resizable: true, - wrapText: true, - autoHeight: true, - cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, - headerComponentParams: { - template: - '', - }, - }, - components: { - displayEditButtons_georesources: displayEditButtons_georesources - }, - columnDefs: columnDefs, - rowData: rowData, - suppressRowClickSelection: true, - rowSelection: 'multiple', - enableCellTextSelection: true, - ensureDomOrder: true, - pagination: true, - paginationPageSize: 10, - suppressColumnVirtualisation: true, - onFirstDataRendered: function () { - headerHeightSetter(self.dataGridOptions_georesources_poi); - }, - onColumnResized: function () { - headerHeightSetter(self.dataGridOptions_georesources_poi); - }, - onRowDataChanged: function () { - self.registerClickHandler_georesources(georesourceMetadataArray); - }, - onModelUpdated: function () { - self.registerClickHandler_georesources(georesourceMetadataArray); - }, - onViewportChanged: function () { - self.registerClickHandler_georesources(georesourceMetadataArray); - }, - - }; - - return gridOptions; - }; - - this.buildDataGridOptions_georesources_loi = function (georesourceMetadataArray) { - let columnDefs = this.buildDataGridColumnConfig_georesources_loi(georesourceMetadataArray); - let rowData = this.buildDataGridRowData_georesources_loi(georesourceMetadataArray); - - let gridOptions = { - defaultColDef: { - editable: false, - sortable: true, - flex: 1, - minWidth: 200, - filter: true, - floatingFilter: true, - // filterParams: { - // newRowsAction: 'keep' - // }, - resizable: true, - wrapText: true, - autoHeight: true, - cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, - headerComponentParams: { - template: - '', - }, - }, - components: { - displayEditButtons_georesources: displayEditButtons_georesources - }, - columnDefs: columnDefs, - rowData: rowData, - suppressRowClickSelection: true, - rowSelection: 'multiple', - enableCellTextSelection: true, - ensureDomOrder: true, - pagination: true, - paginationPageSize: 10, - suppressColumnVirtualisation: true, - onFirstDataRendered: function () { - headerHeightSetter(self.dataGridOptions_georesources_loi); - }, - onColumnResized: function () { - headerHeightSetter(self.dataGridOptions_georesources_loi); - }, - onRowDataChanged: function () { - self.registerClickHandler_georesources(georesourceMetadataArray); - }, - onModelUpdated: function () { - self.registerClickHandler_georesources(georesourceMetadataArray); - }, - onViewportChanged: function () { - self.registerClickHandler_georesources(georesourceMetadataArray); - }, - - }; - - return gridOptions; - }; - - this.buildDataGridOptions_georesources_aoi = function (georesourceMetadataArray) { - let columnDefs = this.buildDataGridColumnConfig_georesources_aoi(georesourceMetadataArray); - let rowData = this.buildDataGridRowData_georesources_aoi(georesourceMetadataArray); - - let gridOptions = { - defaultColDef: { - editable: false, - sortable: true, - flex: 1, - minWidth: 200, - filter: true, - floatingFilter: true, - // filterParams: { - // newRowsAction: 'keep' - // }, - resizable: true, - wrapText: true, - autoHeight: true, - cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, - headerComponentParams: { - template: - '', - }, - }, - components: { - displayEditButtons_georesources: displayEditButtons_georesources - }, - columnDefs: columnDefs, - rowData: rowData, - suppressRowClickSelection: true, - rowSelection: 'multiple', - enableCellTextSelection: true, - ensureDomOrder: true, - pagination: true, - paginationPageSize: 10, - suppressColumnVirtualisation: true, - onFirstDataRendered: function () { - headerHeightSetter(self.dataGridOptions_georesources_aoi); - }, - onColumnResized: function () { - headerHeightSetter(self.dataGridOptions_georesources_aoi); - }, - onRowDataChanged: function () { - self.registerClickHandler_georesources(georesourceMetadataArray); - }, - onModelUpdated: function () { - self.registerClickHandler_georesources(georesourceMetadataArray); - }, - onViewportChanged: function () { - self.registerClickHandler_georesources(georesourceMetadataArray); - }, - - }; - - return gridOptions; - }; - - this.buildDataGridOptions_spatialUnits = function (spatialUnitMetadataArray) { - let columnDefs = this.buildDataGridColumnConfig_spatialUnits(spatialUnitMetadataArray); - let rowData = this.buildDataGridRowData_spatialUnits(spatialUnitMetadataArray); - - let gridOptions = { - defaultColDef: { - editable: false, - sortable: true, - flex: 1, - minWidth: 200, - filter: true, - floatingFilter: true, - // filterParams: { - // newRowsAction: 'keep' - // }, - resizable: true, - wrapText: true, - autoHeight: true, - cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, - headerComponentParams: { - template: - '', - }, - }, - components: { - displayEditButtons_spatialUnits: displayEditButtons_spatialUnits - }, - columnDefs: columnDefs, - rowData: rowData, - suppressRowClickSelection: true, - rowSelection: 'multiple', - enableCellTextSelection: true, - ensureDomOrder: true, - pagination: true, - paginationPageSize: 10, - suppressColumnVirtualisation: true, - onFirstDataRendered: function () { - headerHeightSetter(self.dataGridOptions_spatialUnits); - }, - onColumnResized: function () { - headerHeightSetter(self.dataGridOptions_spatialUnits); - }, - onRowDataChanged: function () { - self.registerClickHandler_spatialUnits(spatialUnitMetadataArray); - }, - onModelUpdated: function () { - self.registerClickHandler_spatialUnits(spatialUnitMetadataArray); - - }, - onViewportChanged: function () { - self.registerClickHandler_spatialUnits(spatialUnitMetadataArray); - }, - - }; - - return gridOptions; - }; - - this.registerClickHandler_spatialUnits = function (spatialUnitMetadataArray) { - - $(".spatialUnitEditMetadataBtn").off(); - $(".spatialUnitEditMetadataBtn").on("click", function (event) { - // ensure that only the target button gets clicked - // manually open modal - event.stopPropagation(); - let modalId = document.getElementById(this.id).getAttribute("data-target"); - $(modalId).modal('show'); - - let spatialUnitId = this.id.split("_")[3]; - - let spatialUnitMetadata = kommonitorDataExchangeService.getSpatialUnitMetadataById(spatialUnitId); - - $rootScope.$broadcast("onEditSpatialUnitMetadata", spatialUnitMetadata); - }); - - $(".spatialUnitEditFeaturesBtn").off(); - $(".spatialUnitEditFeaturesBtn").on("click", function (event) { - // ensure that only the target button gets clicked - // manually open modal - event.stopPropagation(); - let modalId = document.getElementById(this.id).getAttribute("data-target"); - $(modalId).modal('show'); - - let spatialUnitId = this.id.split("_")[3]; - - let spatialUnitMetadata = kommonitorDataExchangeService.getSpatialUnitMetadataById(spatialUnitId); - - $rootScope.$broadcast("onEditSpatialUnitFeatures", spatialUnitMetadata); - }); - - $(".spatialUnitDeleteBtn").off(); - $(".spatialUnitDeleteBtn").on("click", function (event) { - // ensure that only the target button gets clicked - // manually open modal - event.stopPropagation(); - let modalId = document.getElementById(this.id).getAttribute("data-target"); - $(modalId).modal('show'); - - let spatialUnitId = this.id.split("_")[3]; - - let spatialUnitMetadata = kommonitorDataExchangeService.getSpatialUnitMetadataById(spatialUnitId); - - $rootScope.$broadcast("onDeleteSpatialUnits", [spatialUnitMetadata]); //handler function takes an array - }); - - }; - - this.buildDataGrid_georesources = function (georesourceMetadataArray) { - // POI - if (this.dataGridOptions_georesources_poi && this.dataGridOptions_georesources_poi.api && document.querySelector('#poiOverviewTable').childElementCount > 0) { - - this.saveGridStore(this.dataGridOptions_georesources_poi); - let newRowData = this.buildDataGridRowData_georesources_poi(georesourceMetadataArray); - this.dataGridOptions_georesources_poi.api.setRowData(newRowData); - this.restoreGridStore(this.dataGridOptions_georesources_poi); - } - else { - this.dataGridOptions_georesources_poi = this.buildDataGridOptions_georesources_poi(georesourceMetadataArray); - let gridDiv = document.querySelector('#poiOverviewTable'); - new agGrid.Grid(gridDiv, this.dataGridOptions_georesources_poi); - } - - // LOI - if (this.dataGridOptions_georesources_loi && this.dataGridOptions_georesources_loi.api && document.querySelector('#loiOverviewTable').childElementCount > 0) { - - this.saveGridStore(this.dataGridOptions_georesources_loi); - let newRowData = this.buildDataGridRowData_georesources_loi(georesourceMetadataArray); - this.dataGridOptions_georesources_loi.api.setRowData(newRowData); - this.restoreGridStore(this.dataGridOptions_georesources_loi); - } - else { - this.dataGridOptions_georesources_loi = this.buildDataGridOptions_georesources_loi(georesourceMetadataArray); - let gridDiv = document.querySelector('#loiOverviewTable'); - new agGrid.Grid(gridDiv, this.dataGridOptions_georesources_loi); - } - - // AOI - if (this.dataGridOptions_georesources_aoi && this.dataGridOptions_georesources_aoi.api && document.querySelector('#aoiOverviewTable').childElementCount > 0) { - - this.saveGridStore(this.dataGridOptions_georesources_aoi); - let newRowData = this.buildDataGridRowData_georesources_aoi(georesourceMetadataArray); - this.dataGridOptions_georesources_aoi.api.setRowData(newRowData); - this.restoreGridStore(this.dataGridOptions_georesources_aoi); - } - else { - this.dataGridOptions_georesources_aoi = this.buildDataGridOptions_georesources_aoi(georesourceMetadataArray); - let gridDiv = document.querySelector('#aoiOverviewTable'); - new agGrid.Grid(gridDiv, this.dataGridOptions_georesources_aoi); - } - }; - - this.buildDataGrid_spatialUnits = function (spatialUnitMetadataArray) { - - if (this.dataGridOptions_spatialUnits && this.dataGridOptions_spatialUnits.api && document.querySelector('#spatialUnitOverviewTable').childElementCount > 0) { - - this.saveGridStore(this.dataGridOptions_spatialUnits); - let newRowData = this.buildDataGridRowData_spatialUnits(spatialUnitMetadataArray); - this.dataGridOptions_spatialUnits.api.setRowData(newRowData); - this.restoreGridStore(this.dataGridOptions_spatialUnits); - } - else { - this.dataGridOptions_spatialUnits = this.buildDataGridOptions_spatialUnits(spatialUnitMetadataArray); - let gridDiv = document.querySelector('#spatialUnitOverviewTable'); - new agGrid.Grid(gridDiv, this.dataGridOptions_spatialUnits); - } - }; - - // FEATURE TABLES - - const isDate = (date) => { - return (new Date(date) !== "Invalid Date") && !isNaN(new Date(date)); - } - - this.buildDataGridColumnConfig_featureTable_spatialResource = function(specificHeadersArray, datasetId, resourceType, deleteButtonEnabled){ - const columnDefs = [ - { headerName: 'DB-Record-Id', field: "kommonitorRecordId", pinned: 'left', editable: false, cellClass: "grid-non-editable", maxWidth: 125, - cellRenderer: function (params) { - let html = ""; - - // only show delete button, if user has the permission to delete the dataset - // if only editor rights, then user may edit cells, but shall not remove data entries - // if(params.data.userPermissions.includes("creator")){ - // if (resourceType == self.resourceType_spatialUnit){ - // html += ''; - // } - // else { - // html += ''; - // } - - // } - - if (resourceType == self.resourceType_spatialUnit){ - html += ''; - } - else { - html += ''; - } - - html += "
        "; - - html += params.data.kommonitorRecordId; - - return html; - } - }, - { headerName: 'Feature-Id', field: __env.FEATURE_ID_PROPERTY_NAME, pinned: 'left', editable: false, cellClass: "grid-non-editable", maxWidth: 125 }, - { headerName: 'Name', field: __env.FEATURE_NAME_PROPERTY_NAME, pinned: 'left', minWidth: 150 }, - // { headerName: 'Geometrie', field: "kommonitorGeometry", autoHeight: false, wrapText: false, - // cellRenderer: function (params) { - // let html = JSON.stringify(params.data.kommonitorGeometry); - - // return html; - // }, - // filter: 'agTextColumnFilter', - // filterValueGetter: (params) => { - // return JSON.stringify(params.data.kommonitorGeometry); - // }, - // valueGetter: params => { - // return JSON.stringify(params.data.kommonitorGeometry); - // }, - // valueSetter: params => { - // try { - // params.data.kommonitorGeometry = JSON.parse(params.newValue); - // } catch (error) { - // try { - // params.data.kommonitorGeometry = JSON.parse(params.oldValue); - // } catch (error) { - // params.data.kommonitorGeometry = params.oldValue; - // } - - // } - // return true; - // }, - // minWidth: 200 - // }, - { headerName: 'Lebenszeitbeginn', field: __env.VALID_START_DATE_PROPERTY_NAME, minWidth: 150, cellEditor: getDatePicker() }, - { headerName: 'Lebenszeitende', field: __env.VALID_END_DATE_PROPERTY_NAME, cellEditor: getDatePicker(), - // cellRenderer: function (params) { - // let html = '

        '; - - // if (params.data.validEndDate){ - // html += params.data.validEndDate; - // } - // else{ - // html += "uneingeschränkt gültig"; - // } - - // html += "

        "; - - // return html; - // }, - // filter: 'agTextColumnFilter', - // filterValueGetter: (params) => { - // if (params.data.validEndDate){ - // return "" + params.data.validEndDate; - // } - // return "uneingeschränkt gültig"; - // }, - minWidth: 150 } - ]; - - for (const header of specificHeadersArray) { - columnDefs.push({ headerName: "" + header, field: "" + header, minWidth: 125 }); - } - - return columnDefs; - }; - - this.buildDataGridRowData_featureTable_spatialResource = function(dataArray){ - - - if(dataArray[0] && dataArray[0].properties){ - return dataArray.map(dataItem => { - // add geometry and database record ID to properties to be available within data grid object - dataItem.properties.kommonitorGeometry = dataItem.geometry; - dataItem.properties.kommonitorRecordId = dataItem.id; - return dataItem.properties; - } - ); - } - - return dataArray; - }; - - this.buildDataGridOptions_featureTable_spatialResource = function(specificHeadersArray, dataArray, datasetId, resourceType, deleteButtonEnabled){ - let columnDefs = this.buildDataGridColumnConfig_featureTable_spatialResource(specificHeadersArray, datasetId, resourceType, deleteButtonEnabled); - let rowData = this.buildDataGridRowData_featureTable_spatialResource(dataArray); - - let gridOptions = { - defaultColDef: { - editable: true, - // enables the fill handle - enableFillHandle: false, - cellEditor: 'agLargeTextCellEditor', - onCellValueChanged: function(newValueParams){ - /* https://www.ag-grid.com/javascript-data-grid/cell-editing/ - interface NewValueParams { - // The value before the change - oldValue: any; - // The value after the change - newValue: any; - // Row node for the given row - node: RowNode | null; - // Data associated with the node - data: any; - // Column for this callback - column: Column; - // ColDef provided for this column - colDef: ColDef; - api: GridApi; - columnApi: ColumnApi; - // The context as provided on `gridOptions.context` - context: any; - } - */ - - // make sure that date properties are actually set - if (! newValueParams.data.validStartDate){ - newValueParams.data.validStartDate = newValueParams.oldValue; - } - if (!isDate(newValueParams.data.validStartDate)){ - newValueParams.data.validStartDate = newValueParams.oldValue; - } - if(newValueParams.data.validEndDate == ""){ - newValueParams.data.validEndDate = undefined; - } - if(newValueParams.data.validEndDate){ - if (!isDate(newValueParams.data.validEndDate)){ - newValueParams.data.validEndDate = newValueParams.oldValue; - } - } - - // take the modified data from newValueParams.data - // take geometry info from newValueParams.data.geometry and remove that property afterwards - // take kommonitorRecordId info from newValueParams.data.kommonitorRecordId and remove that property afterwards - // then build GeoJSON and send modification request to data Management component - let geoJSON = { - "type": "Feature", - geometry: "", - properties: "", - id: "" - }; - - // clone properties - geoJSON.geometry = JSON.parse(JSON.stringify(newValueParams.data.kommonitorGeometry)); - geoJSON.id = JSON.parse(JSON.stringify(newValueParams.data.kommonitorRecordId)); - geoJSON.properties = JSON.parse(JSON.stringify(newValueParams.data)); - - // now delete information - delete geoJSON.properties.kommonitorGeometry; - delete geoJSON.properties.kommonitorRecordId; - - let url = __env.apiUrl + __env.basePath; - if(resourceType == self.resourceType_georesource){ - url += "/georesources/"; - } - else { - url += "/spatial-units/"; - } - - url += datasetId + "/singleFeature/" + newValueParams.data[__env.FEATURE_ID_PROPERTY_NAME] + "/singleFeatureRecord/" + newValueParams.data.kommonitorRecordId; - - $http({ - url: url, - method: "PUT", - data: geoJSON, - headers: { - 'Content-Type': "application/json" - } - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - console.log("Successfully updated database record"); - - // on success mark grid cell with green background and set update information - newValueParams.colDef.cellStyle = (p) => - p.rowIndex.toString() === newValueParams.node.id ? {'background-color': '#9DC89F'} : ""; - - newValueParams.api.refreshCells({ - force: true, - columns: [newValueParams.column.getId()], - rowNodes: [newValueParams.node] - }); - - if(resourceType == self.resourceType_georesource){ - self.featureTable_georesource_lastUpdate_timestamp_success = getCurrentTimestampString(); - } - else { - self.featureTable_spatialUnit_lastUpdate_timestamp_success = getCurrentTimestampString(); - } - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while updating database record. Error is:\n" + error); - - // reset cell value as an error occurred - newValueParams.data[newValueParams.column.colId] = newValueParams.oldValue; - - // on failure mark grid cell with red background and set update failure information - newValueParams.colDef.cellStyle = (p) => - p.rowIndex.toString() === newValueParams.node.id ? {'background-color': '#E79595'} : ""; - - newValueParams.api.refreshCells({ - force: true, - columns: [newValueParams.column.getId()], - rowNodes: [newValueParams.node] - }); - if(resourceType == self.resourceType_georesource){ - self.featureTable_georesource_lastUpdate_timestamp_failure = timestamp_string; - } - else { - self.featureTable_spatialUnit_lastUpdate_timestamp_failure = timestamp_string; - } - throw error; - }); - }, - sortable: true, - flex: 1, - minWidth: 200, - filter: true, - floatingFilter: true, - // filterParams: { - // newRowsAction: 'keep' - // }, - resizable: true, - wrapText: true, - autoHeight: true, - cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, - headerComponentParams: { - template: - '', - }, - }, - columnDefs: columnDefs, - rowData: rowData, - // enables undo / redo - undoRedoCellEditing: true, - // restricts the number of undo / redo steps to 10 - undoRedoCellEditingLimit: 10, - // enables flashing to help see cell changes - enableCellChangeFlash: true, - suppressRowClickSelection: true, - // rowSelection: 'multiple', - enableCellTextSelection: true, - ensureDomOrder: true, - pagination: true, - paginationPageSize: 10, - suppressColumnVirtualisation: true, - // onFirstDataRendered: function () { - // headerHeightSetter(this); - // }, - // onColumnResized: function () { - // headerHeightSetter(this); - // } - onRowDataChanged: function () { - self.registerClickHandler_featureTable_spatialResource(resourceType); - }, - onModelUpdated: function () { - self.registerClickHandler_featureTable_spatialResource(resourceType); - - }, - onViewportChanged: function () { - self.registerClickHandler_featureTable_spatialResource(resourceType); - }, - - }; - - return gridOptions; - }; - - this.registerClickHandler_featureTable_spatialResource = function (resourceType) { - - let className = ""; - let url = __env.apiUrl + __env.basePath; - - if (resourceType == this.resourceType_georesource){ - className = ".georesourceDeleteFeatureRecordBtn"; - url += "/georesources/"; - } - else{ - className = ".spatialUnitDeleteFeatureRecordBtn"; - url += "/spatial-units/"; - } - - $(className).off(); - $(className).on("click", function (event) { - - // ensure that only the target button gets clicked - event.stopPropagation(); - event.stopImmediatePropagation(); - $rootScope.$broadcast("showLoadingIcon_" + resourceType); - - // id example is id="btn__spatialUnit__deleteFeatureEntry__' + datasetId + '__' + params.data[__env.FEATURE_ID_PROPERTY_NAME] + '__' + params.data.kommonitorRecordId + '" - let idArray = this.id.split("__"); - - let datasetId = idArray[3]; - let featureId = idArray[4]; - let recordId = idArray[5]; - - url += datasetId + "/singleFeature/" + featureId + "/singleFeatureRecord/" + recordId; - - $http({ - url: url, - method: "DELETE" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - console.log("Successfully deleted database record"); - - if(resourceType == self.resourceType_georesource){ - self.featureTable_georesource_lastUpdate_timestamp_success = getCurrentTimestampString(); - } - else { - self.featureTable_spatialUnit_lastUpdate_timestamp_success = getCurrentTimestampString(); - } - - $rootScope.$broadcast("onDeleteFeatureEntry_" + resourceType); - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while deleting database record. Error is:\n" + error); - $rootScope.$broadcast("hideLoadingIcon_" + resourceType); - if(resourceType == self.resourceType_georesource){ - self.featureTable_georesource_lastUpdate_timestamp_failure = getCurrentTimestampString(); - } - else { - self.featureTable_spatialUnit_lastUpdate_timestamp_failure = getCurrentTimestampString(); - } - throw error; - }); - }); - - }; - - this.buildDataGrid_featureTable_spatialResource = function (domElementId, specificHeadersArray, dataArray, datasetId, resourceType, deleteButtonEnabled) { - - let dataGridOptions_featureTable; - - dataGridOptions_featureTable = this.buildDataGridOptions_featureTable_spatialResource(specificHeadersArray, dataArray, datasetId, resourceType, deleteButtonEnabled); - - let gridDiv = document.querySelector('#' + domElementId); - while (gridDiv.firstChild) { - gridDiv.removeChild(gridDiv.firstChild); - } - new agGrid.Grid(gridDiv, dataGridOptions_featureTable); - }; - - // INDICATORS FEATURE TABLE - this.buildDataGridColumnConfig_featureTable_indicatorResource = function(specificHeadersArray, datasetId, resourceType, deleteButtonEnabled, spatialUnitId){ - const columnDefs = [ - { headerName: 'DB-Record-Id', field: "fid", pinned: 'left', editable: false, cellClass: "grid-non-editable", maxWidth: 125, - cellRenderer: function (params) { - let html = ""; - - // only show delete button, if user has the permission to delete the dataset - // if only editor rights, then user may edit cells, but shall not remove data entries - // if(params.data.userPermissions.includes("creator")){ - // html += ''; - - - // } - - html += ''; - - html += "  "; - html += params.data.fid; - - return html; - } - }, - { headerName: 'Feature-Id', field: __env.FEATURE_ID_PROPERTY_NAME, pinned: 'left', editable: false, cellClass: "grid-non-editable", maxWidth: 125 }, - { headerName: 'Name', field: __env.FEATURE_NAME_PROPERTY_NAME, pinned: 'left', minWidth: 200, editable: false, cellClass: "grid-non-editable", }, - // { headerName: 'Id', field: __env.FEATURE_ID_PROPERTY_NAME, maxWidth: 125 }, - // { headerName: 'Name', field: __env.FEATURE_NAME_PROPERTY_NAME, minWidth: 300 }, - { headerName: 'Lebenszeitbeginn', field: __env.VALID_START_DATE_PROPERTY_NAME, minWidth: 125, editable: false, cellClass: "grid-non-editable" }, - { headerName: 'Lebenszeitende', field: __env.VALID_END_DATE_PROPERTY_NAME, editable: false, cellClass: "grid-non-editable", - minWidth: 125 } - ]; - - for (const header of specificHeadersArray) { - columnDefs.push({ headerName: "" + header, field: "" + header, minWidth: 125 }); - } - - return columnDefs; - }; - - this.buildDataGridRowData_featureTable_indicatorResource = function(dataArray){ - - return dataArray.map(dataItem => { - // remove arisonFrom property as this is currently never used - delete dataItem.arisenFrom; - return dataItem; - } - ); - }; - - this.buildDataGridOptions_featureTable_indicatorResource = function(specificHeadersArray, dataArray, datasetId, resourceType, deleteButtonEnabled, spatialUnitId){ - let columnDefs = this.buildDataGridColumnConfig_featureTable_indicatorResource(specificHeadersArray, datasetId, resourceType, deleteButtonEnabled, spatialUnitId); - let rowData = this.buildDataGridRowData_featureTable_indicatorResource(dataArray); - - let gridOptions = { - defaultColDef: { - editable: true, - // enables the fill handle - enableFillHandle: false, - cellEditor: 'agLargeTextCellEditor', - onCellValueChanged: function(newValueParams){ - /* https://www.ag-grid.com/javascript-data-grid/cell-editing/ - interface NewValueParams { - // The value before the change - oldValue: any; - // The value after the change - newValue: any; - // Row node for the given row - node: RowNode | null; - // Data associated with the node - data: any; - // Column for this callback - column: Column; - // ColDef provided for this column - colDef: ColDef; - api: GridApi; - columnApi: ColumnApi; - // The context as provided on `gridOptions.context` - context: any; - } - */ - - // take the modified data from newValueParams.data - // then build JSON and send modification request to data Management component - let json = JSON.parse(JSON.stringify(newValueParams.data)); - - // now delete information - only ID and fid shall remain for indicator record update - delete json[__env.VALID_START_DATE_PROPERTY_NAME]; - delete json[__env.VALID_END_DATE_PROPERTY_NAME]; - delete json[__env.FEATURE_NAME_PROPERTY_NAME]; - - /* - for indicators we should check if an empty/null/undefined value has been set by user and transmit it as null value - */ - for (const key in json) { - if (Object.hasOwnProperty.call(json, key)) { - const element = json[key]; - - if(key.includes(__env.indicatorDatePrefix)){ - if (element == ""){ - json[key] = null; - } - } - - } - } - - let url = __env.apiUrl + __env.basePath + "/indicators/"; - - url += datasetId + "/" + spatialUnitId + "/singleFeature/" + newValueParams.data[__env.FEATURE_ID_PROPERTY_NAME] + "/singleFeatureRecord/" + newValueParams.data.fid; - - $http({ - url: url, - method: "PUT", - data: json, - headers: { - 'Content-Type': "application/json" - } - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - console.log("Successfully updated database record"); - - // on success mark grid cell with green background and set update information - newValueParams.colDef.cellStyle = (p) => - p.rowIndex.toString() === newValueParams.node.id ? {'background-color': '#9DC89F'} : ""; - - newValueParams.api.refreshCells({ - force: true, - columns: [newValueParams.column.getId()], - rowNodes: [newValueParams.node] - }); - - self.featureTable_indicator_lastUpdate_timestamp_success = getCurrentTimestampString(); - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while updating database record. Error is:\n" + error); - - // reset cell value as an error occurred - newValueParams.data[newValueParams.column.colId] = newValueParams.oldValue; - - // on failure mark grid cell with red background and set update failure information - newValueParams.colDef.cellStyle = (p) => - p.rowIndex.toString() === newValueParams.node.id ? {'background-color': '#E79595'} : ""; - - newValueParams.api.refreshCells({ - force: true, - columns: [newValueParams.column.getId()], - rowNodes: [newValueParams.node] - }); - self.featureTable_indicator_lastUpdate_timestamp_failure = timestamp_string; - throw error; - }); - }, - sortable: true, - flex: 1, - minWidth: 200, - filter: true, - floatingFilter: true, - // filterParams: { - // newRowsAction: 'keep' - // }, - resizable: true, - wrapText: true, - autoHeight: true, - cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, - headerComponentParams: { - template: - '', - }, - }, - columnDefs: columnDefs, - rowData: rowData, - // enables undo / redo - undoRedoCellEditing: true, - // restricts the number of undo / redo steps to 10 - undoRedoCellEditingLimit: 10, - // enables flashing to help see cell changes - enableCellChangeFlash: true, - suppressRowClickSelection: true, - // rowSelection: 'multiple', - enableCellTextSelection: true, - ensureDomOrder: true, - pagination: true, - paginationPageSize: 10, - suppressColumnVirtualisation: true, - onViewportChanged: function () { - self.registerClickHandler_featureTable_indicatorResource(resourceType); - }, - - }; - - return gridOptions; - }; - - this.registerClickHandler_featureTable_indicatorResource = function (resourceType) { - - let className = ".indicatorDeleteFeatureRecordBtn"; - let url = __env.apiUrl + __env.basePath + "/indicators/"; - - $(className).off(); - $(className).on("click", function (event) { - - // ensure that only the target button gets clicked - event.stopPropagation(); - event.stopImmediatePropagation(); - $rootScope.$broadcast("showLoadingIcon_" + resourceType); - - // id example is "btn__indicator__deleteFeatureEntry__' + datasetId + '__' + spatialUnitId + '__' + params.data[__env.FEATURE_ID_PROPERTY_NAME] + '__' + params.data.kommonitorRecordId + '" class="btn btn-danger btn-sm indicatorDeleteFeatureRecordBtn" - let idArray = this.id.split("__"); - - let datasetId = idArray[3]; - let spatialUnitId = idArray[4]; - let featureId = idArray[5]; - let recordId = idArray[6]; - - url += datasetId + "/" + spatialUnitId + "/singleFeature/" + featureId + "/singleFeatureRecord/" + recordId; - - $http({ - url: url, - method: "DELETE" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - console.log("Successfully deleted database record"); - - $rootScope.$broadcast("onDeleteFeatureEntry_" + resourceType); - self.featureTable_indicator_lastUpdate_timestamp_success = getCurrentTimestampString(); - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while deleting database record. Error is:\n" + error); - $rootScope.$broadcast("hideLoadingIcon_" + resourceType); - self.featureTable_indicator_lastUpdate_timestamp_failure = getCurrentTimestampString(); - throw error; - }); - }); - - }; - - this.buildDataGrid_featureTable_indicatorResource = function (domElementId, specificHeadersArray, dataArray, datasetId, resourceType, deleteButtonEnabled, spatialUnitId) { - - let dataGridOptions_featureTable = this.buildDataGridOptions_featureTable_indicatorResource(specificHeadersArray, dataArray, datasetId, resourceType, deleteButtonEnabled, spatialUnitId); - - let gridDiv = document.querySelector('#' + domElementId); - while (gridDiv.firstChild) { - gridDiv.removeChild(gridDiv.firstChild); - } - new agGrid.Grid(gridDiv, dataGridOptions_featureTable); - }; - - - // ROLE OVERVIEW TABLE - - this.buildDataGridColumnConfig_accessControl = function(isRealmAdmin){ - let columnDefs = []; - // Only show edit column if user is Realm Admin - if (isRealmAdmin) { - columnDefs.push({ headerName: 'Editierfunktionen', maxWidth: 200, checkboxSelection: (row) => {return row.data.name != "public" && row.data.name != "kommonitor"}, filter: false, sortable: false, cellRenderer: 'displayEditButtons_accessControl' }); - } - - return columnDefs.concat([ - //{ headerName: 'Id', field: "organizationalUnitId", minWidth: 400 }, - { headerName: 'Organisationseinheit', field: "name", minWidth: 300 }, - { headerName: 'Rollen', field: "roleString", minWidth: 300 }, - { headerName: 'Beschreibung', field: "description", minWidth: 400 }, - { headerName: 'Kontakt', field: "contact", minWidth: 400 }, - ]); - }; - - this.buildDataGridRowData_accessControl = function(dataArray){ - let data = JSON.parse(JSON.stringify(dataArray)); - for (let elem of data) { - elem.roleString = ""; - for (let role of elem.roles) { - elem.roleString += role.permissionLevel + ", "; - } - elem.roleString = elem.roleString.substring(0, elem.roleString.length - 2); - } - return data; - }; - - this.buildDataGridOptions_accessControl = function(accessControlArray){ - let columnDefs = this.buildDataGridColumnConfig_accessControl(kommonitorDataExchangeService.isRealmAdmin); - let rowData = this.buildDataGridRowData_accessControl(accessControlArray); - - let components = {}; - if (kommonitorDataExchangeService.isRealmAdmin) { - components = {displayEditButtons_accessControl: displayEditButtons_accessControl}; - } else { - components = {} - } - - let gridOptions = { - defaultColDef: { - editable: false, - sortable: true, - flex: 1, - minWidth: 200, - filter: true, - floatingFilter: true, - // filterParams: { - // newRowsAction: 'keep' - // }, - resizable: true, - wrapText: true, - autoHeight: true, - cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, - headerComponentParams: { - template: - '', - }, - }, - components: components, - columnDefs: columnDefs, - rowData: rowData, - suppressRowClickSelection: true, - rowSelection: 'multiple', - enableCellTextSelection: true, - ensureDomOrder: true, - pagination: true, - paginationPageSize: 10, - suppressColumnVirtualisation: true, - onFirstDataRendered: function () { - headerHeightSetter(self.dataGridOptions_accessControl); - }, - onColumnResized: function () { - headerHeightSetter(self.dataGridOptions_accessControl); - }, - onRowDataChanged: function () { - self.registerClickHandler_accessControl(accessControlArray); - }, - onModelUpdated: function () { - self.registerClickHandler_accessControl(accessControlArray); - }, - - onViewportChanged: function () { - self.registerClickHandler_accessControl(accessControlArray); - }, - - }; - - return gridOptions; - }; - - this.registerClickHandler_accessControl = function (roleMetadataArray) { - - $(".roleEditMetadataBtn").off(); - $(".roleEditMetadataBtn").on("click", function (event) { - // ensure that only the target button gets clicked - // manually open modal - event.stopPropagation(); - let modalId = document.getElementById(this.id).getAttribute("data-target"); - $(modalId).modal('show'); - - let id = this.id.split("_")[3]; - - let roleMetadata = kommonitorDataExchangeService.getAccessControlById(id); - - $rootScope.$broadcast("onEditRoleMetadata", roleMetadata); - }); - }; - - this.buildDataGrid_accessControl = function (accessControlArray) { - - if (this.dataGridOptions_accessControl && this.dataGridOptions_accessControl.api && document.querySelector('#roleOverviewTable').childElementCount > 0) { - - this.saveGridStore(this.dataGridOptions_accessControl); - let newRowData = this.buildDataGridRowData_accessControl(accessControlArray); - this.dataGridOptions_accessControl.api.setRowData(newRowData); - this.restoreGridStore(this.dataGridOptions_accessControl); - } - else { - this.dataGridOptions_accessControl = this.buildDataGridOptions_accessControl(accessControlArray); - let gridDiv = document.querySelector('#roleOverviewTable'); - new agGrid.Grid(gridDiv, this.dataGridOptions_accessControl); - } - }; - - - // SCRIPT OVERVIEW TABLE - - this.buildDataGridColumnConfig_scripts = function(){ - const columnDefs = [ - { headerName: 'Id', field: "scriptId", pinned: 'left', maxWidth: 125, checkboxSelection: true, headerCheckboxSelection: true, - headerCheckboxSelectionFilteredOnly: true }, - { headerName: 'Name', field: "name", pinned: 'left', maxWidth: 300 }, - { headerName: 'Ziel-Indikatoren-Id', field: "indicatorId", maxWidth: 125 }, - { headerName: 'Ziel-Indikatoren-Name', minWidth: 200, cellRenderer: function (params) { - return kommonitorDataExchangeService.getIndicatorNameFromIndicatorId(params.data.indicatorId); - }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return kommonitorDataExchangeService.getIndicatorNameFromIndicatorId(params.data.indicatorId); - } - }, - { headerName: 'Beschreibung', field: "description", minWidth: 300 }, - { headerName: 'notwendige Basis-Indikatoren', minWidth: 300, cellRenderer: function (params) { - - /* - - - - - - - - - - - - - -
        IdName
        {{::baseIndicatorId}}{{::$ctrl.kommonitorDataExchangeServiceInstance.getIndicatorNameFromIndicatorId(baseIndicatorId)}}
        - */ - if(params.data && params.data.requiredIndicatorIds && params.data.requiredIndicatorIds.length > 0){ - let html = ''; - - for (const baseIndicatorId of params.data.requiredIndicatorIds) { - html += ""; - html += ""; - html += ""; - html += ""; - } - - html += "
        IdName
        " + baseIndicatorId + "" + kommonitorDataExchangeService.getIndicatorNameFromIndicatorId(baseIndicatorId) + "
        "; - return html; - } - else{ - return "keine"; - } - - }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - - if(params.data && params.data.requiredIndicatorIds && params.data.requiredIndicatorIds.length > 0){ - let string = JSON.stringify(params.data.requiredIndicatorIds); - - for (const baseIndicatorId of params.data.requiredIndicatorIds) { - string += kommonitorDataExchangeService.getIndicatorNameFromIndicatorId(baseIndicatorId); - } - - return string; - } - else{ - return "keine"; - } - } - }, - { headerName: 'notwendige Basis-Georessourcen', minWidth: 300, cellRenderer: function (params) { - if(params.data && params.data.requiredGeoresourceIds && params.data.requiredGeoresourceIds.length > 0){ - let html = ''; - - for (const baseGeoresourceId of params.data.requiredGeoresourceIds) { - html += ""; - html += ""; - html += ""; - html += ""; - } - - html += "
        IdName
        " + baseGeoresourceId + "" + kommonitorDataExchangeService.getGeoresourceNameFromGeoresourceId(baseGeoresourceId) + "
        "; - return html; - } - else{ - return "keine"; - } - }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - if(params.data && params.data.requiredGeoresourceIds && params.data.requiredGeoresourceIds.length > 0){ - let string = JSON.stringify(params.data.requiredGeoresourceIds); - - for (const baseIndicatorId of params.data.requiredGeoresourceIds) { - string += kommonitorDataExchangeService.getGeoresourceNameFromGeoresourceId(baseIndicatorId); - } - - return string; - } - else{ - return "keine"; - } - } - }, - { headerName: 'Prozessparameter', field: "", minWidth: 1000, cellRenderer: function (params) { - /* - - - - - - - - - - - - - - - - - - - -
        NameBeschreibungDatentypStandard-Werterlaubter Wertebereich
        {{::processParameter.name}}{{::processParameter.description}}{{::processParameter.dataType}}{{::processParameter.defaultValue}}
        erlaubter Wertebereich {{::processParameter.minParameterValueForNumericInputs}} - {{::processParameter.maxParameterValueForNumericInputs}}
        - */ - if(params.data && params.data.variableProcessParameters && params.data.variableProcessParameters.length > 0){ - let html = ''; - - for (const processParameter of params.data.variableProcessParameters) { - html += ""; - html += ""; - html += ""; - html += ""; - html += ""; - html += ""; - html += ""; - } - - html += "
        NameBeschreibungDatentypStandard-Werterlaubter Wertebereich
        " + processParameter.name + "" + processParameter.description + "" + processParameter.dataType + "" + processParameter.defaultValue + "" ; - - if(processParameter.dataType == "integer" || processParameter.dataType == "double"){ - html += "erlaubter Wertebereich

        "; - html += "" + processParameter.minParameterValueForNumericInputs + " ‐ " + processParameter.maxParameterValueForNumericInputs; - } - - html += "
        "; - return html; - } - else{ - return "keine"; - } - }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - if(params.data && params.data.variableProcessParameters && params.data.variableProcessParameters.length > 0){ - return JSON.stringify(params.data.variableProcessParameters); - } - else{ - return "keine"; - } - } - } - ]; - - return columnDefs; - }; - - this.buildDataGridRowData_scripts = function(dataArray){ - - return dataArray; - }; - - this.buildDataGridOptions_scripts = function(scriptsArray){ - let columnDefs = this.buildDataGridColumnConfig_scripts(); - let rowData = this.buildDataGridRowData_scripts(scriptsArray); - - let gridOptions = { - defaultColDef: { - editable: false, - sortable: true, - flex: 1, - minWidth: 200, - filter: true, - floatingFilter: true, - // filterParams: { - // newRowsAction: 'keep' - // }, - resizable: true, - wrapText: true, - autoHeight: true, - cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, - headerComponentParams: { - template: - '', - }, - }, - columnDefs: columnDefs, - rowData: rowData, - suppressRowClickSelection: true, - rowSelection: 'multiple', - enableCellTextSelection: true, - ensureDomOrder: true, - pagination: true, - paginationPageSize: 10, - suppressColumnVirtualisation: true, - onFirstDataRendered: function () { - headerHeightSetter(self.dataGridOptions_scripts); - }, - onColumnResized: function () { - headerHeightSetter(self.dataGridOptions_scripts); - } - - }; - - return gridOptions; - }; - - this.buildDataGrid_scripts = function (scriptsArray) { - - if (this.dataGridOptions_scripts && this.dataGridOptions_scripts.api && document.querySelector('#scriptOverviewTable').childElementCount > 0) { - - this.saveGridStore(this.dataGridOptions_scripts); - let newRowData = this.buildDataGridRowData_scripts(scriptsArray); - this.dataGridOptions_scripts.api.setRowData(newRowData); - this.restoreGridStore(this.dataGridOptions_scripts); - } - else { - this.dataGridOptions_scripts = this.buildDataGridOptions_scripts(scriptsArray); - let gridDiv = document.querySelector('#scriptOverviewTable'); - new agGrid.Grid(gridDiv, this.dataGridOptions_scripts); - } - }; - - // DEFAULT JOBS OVERVIEW TABLE - - this.buildDataGridColumnConfig_defaultJobs = function(){ - const columnDefs = [ - { headerName: 'Job-Id', field: "jobId", pinned: 'left', maxWidth: 125, checkboxSelection: true, headerCheckboxSelection: true, - headerCheckboxSelectionFilteredOnly: true }, - { headerName: 'Script-Id', field: "jobData.scriptId", pinned: 'left', maxWidth: 125 }, - { headerName: 'Ziel-Indikator', pinned: 'left', maxWidth: 250, cellRenderer: function (params) { - if(params.data.jobData && params.data.jobData.targetIndicatorId){ - let indicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(params.data.jobData.targetIndicatorId); - if (indicatorMetadata){ - return indicatorMetadata.indicatorName; - } - } - return ""; - }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - if(params.data.jobData && params.data.jobData.targetIndicatorId){ - let indicatorMetadata = kommonitorDataExchangeService.getIndicatorMetadataById(params.data.jobData.targetIndicatorId); - if (indicatorMetadata){ - return indicatorMetadata.indicatorName; - } - } - return ""; - } - }, - { headerName: 'Job-Status', field: "status", maxWidth: 125 }, - { headerName: 'Job-Fortschritt', field: "progress", maxWidth: 125 }, - { headerName: 'Job-Data', minWidth: 500, cellRenderer: function (params) { - return kommonitorDataExchangeService.syntaxHighlightJSON(params.data.jobData); - }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return params.data.jobData; - } - }, - { headerName: 'Job-Logs', maxWidth: 150, cellRenderer: function (params) { - if(params.data.logs){ - - var logJSON = JSON.stringify(params.data.logs); - - var blob = new Blob([logJSON], {type: "application/json"}); - var data = URL.createObjectURL(blob); - - let html = ''; - return html; - } - else{ - return "Dieser Job umfasst keine Logs"; - } - }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return params.data.logs; - } - }, - { headerName: 'Job-Summary', minWidth: 1000, cellRenderer: function (params) { - - let html = ""; - if(params.data.spatialUnitIntegrationSummary && params.data.spatialUnitIntegrationSummary.length > 0){ - html += ''; - - for (const item of params.data.spatialUnitIntegrationSummary) { - html += ""; - html += ""; - html += ""; - html += ""; - html += ""; - html += ""; - if(item.errorsOccurred && item.errorsOccurred.length > 0){ - html += ""; - } - else{ - html += ""; - } - - html += ""; - } - html += "
        Raumeinheits-IdRaumeinheits-NameAnzahl integrierter Indikatoren-FeaturesAnzahl integrierter Zeitstempelintegrierte ZeitstempelFehlermeldung
        " + item.spatialUnitId + "" + item.spatialUnitName + "" + item.numberOfIntegratedIndicatorFeatures + "" + item.numberOfIntegratedTargetDates + "" + item.integratedTargetDates + "" + kommonitorDataExchangeService.syntaxHighlightJSON(item.errorsOccurred) + "keine Fehlermeldungen vorhanden
        "; - } - else{ - html += "Dieser Job umfasst keine Informationen zur erfolgreichen/gescheiterten Datenintegration"; - } - - return html; - }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return JSON.stringify(params.data.spatialUnitIntegrationSummary); - } - } - - ]; - - return columnDefs; - }; - - this.buildDataGridRowData_defaultJobs = function(dataArray){ - - dataArray.sort((a, b) => b.jobId - a.jobId); - - return dataArray; - }; - - this.buildDataGridOptions_defaultJobs = function(jobsArray){ - let columnDefs = this.buildDataGridColumnConfig_defaultJobs(); - let rowData = this.buildDataGridRowData_defaultJobs(jobsArray); - - let gridOptions = { - defaultColDef: { - editable: false, - sortable: true, - flex: 1, - minWidth: 200, - filter: true, - floatingFilter: true, - // filterParams: { - // newRowsAction: 'keep' - // }, - resizable: true, - wrapText: true, - autoHeight: true, - cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, - headerComponentParams: { - template: - '', - }, - }, - columnDefs: columnDefs, - rowData: rowData, - suppressRowClickSelection: true, - rowSelection: 'multiple', - enableCellTextSelection: true, - ensureDomOrder: true, - pagination: true, - paginationPageSize: 10, - suppressColumnVirtualisation: true, - onFirstDataRendered: function () { - headerHeightSetter(self.dataGridOptions_scripts); - }, - onColumnResized: function () { - headerHeightSetter(self.dataGridOptions_scripts); - } - - }; - - return gridOptions; - }; - - this.buildDataGrid_defaultJobs = function (jobsArray) { - - if (this.dataGridOptions_defaultJobs && this.dataGridOptions_defaultJobs.api && document.querySelector('#jobExecutionTable_defaultComputation').childElementCount > 0) { - - this.saveGridStore(this.dataGridOptions_defaultJobs); - let newRowData = this.buildDataGridRowData_defaultJobs(jobsArray); - this.dataGridOptions_defaultJobs.api.setRowData(newRowData); - this.restoreGridStore(this.dataGridOptions_defaultJobs); - } - else { - this.dataGridOptions_defaultJobs = this.buildDataGridOptions_defaultJobs(jobsArray); - let gridDiv = document.querySelector('#jobExecutionTable_defaultComputation'); - new agGrid.Grid(gridDiv, this.dataGridOptions_defaultJobs); - } - }; - - // CUSTOMIZED JOBS OVERVIEW TABLE - - this.buildDataGridColumnConfig_customizedJobs = function(){ - const columnDefs = [ - { headerName: 'Job-Id', field: "jobId", pinned: 'left', maxWidth: 125, checkboxSelection: true, headerCheckboxSelection: true, - headerCheckboxSelectionFilteredOnly: true}, - { headerName: 'Job-Status', field: "status", maxWidth: 125 }, - { headerName: 'Job-Fortschritt', field: "progress", maxWidth: 125 }, - { headerName: 'Job-Data', minWidth: 500, cellRenderer: function (params) { - return kommonitorDataExchangeService.syntaxHighlightJSON(params.data.jobData); - }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return params.data.jobData; - } - }, - { headerName: 'Job-Logs', maxWidth: 150, cellRenderer: function (params) { - if(params.data.logs){ - - var logJSON = JSON.stringify(params.data.logs); - - var blob = new Blob([logJSON], {type: "application/json"}); - var data = URL.createObjectURL(blob); - - let html = ''; - return html; - } - else{ - return "Dieser Job umfasst keine Logs"; - } - }, - filter: 'agTextColumnFilter', - filterValueGetter: (params) => { - return params.data.logs; - } - } - - ]; - - return columnDefs; - }; - - this.buildDataGridRowData_customizedJobs = function(dataArray){ - - dataArray.sort((a, b) => b.jobId - a.jobId); - - return dataArray; - }; - - this.buildDataGridOptions_customizedJobs = function(jobsArray){ - let columnDefs = this.buildDataGridColumnConfig_customizedJobs(); - let rowData = this.buildDataGridRowData_customizedJobs(jobsArray); - - let gridOptions = { - defaultColDef: { - editable: false, - sortable: true, - flex: 1, - minWidth: 200, - filter: true, - floatingFilter: true, - // filterParams: { - // newRowsAction: 'keep' - // }, - resizable: true, - wrapText: true, - autoHeight: true, - cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, - headerComponentParams: { - template: - '', - }, - }, - columnDefs: columnDefs, - rowData: rowData, - suppressRowClickSelection: true, - rowSelection: 'multiple', - enableCellTextSelection: true, - ensureDomOrder: true, - pagination: true, - paginationPageSize: 10, - suppressColumnVirtualisation: true, - onFirstDataRendered: function () { - headerHeightSetter(self.dataGridOptions_scripts); - }, - onColumnResized: function () { - headerHeightSetter(self.dataGridOptions_scripts); - } - - }; - - return gridOptions; - }; - - this.buildDataGrid_customizedJobs = function (jobsArray) { - - if (this.dataGridOptions_customizedJobs && this.dataGridOptions_customizedJobs.api && document.querySelector('#jobExecutionTable_customizedComputation').childElementCount > 0) { - - this.saveGridStore(this.dataGridOptions_customizedJobs); - let newRowData = this.buildDataGridRowData_customizedJobs(jobsArray); - this.dataGridOptions_customizedJobs.api.setRowData(newRowData); - this.restoreGridStore(this.dataGridOptions_customizedJobs); - } - else { - this.dataGridOptions_customizedJobs = this.buildDataGridOptions_customizedJobs(jobsArray); - let gridDiv = document.querySelector('#jobExecutionTable_customizedComputation'); - new agGrid.Grid(gridDiv, this.dataGridOptions_customizedJobs); - } - }; - - function anyHigherRoleIsChecked(roles, roleSuffix){ - let filteresRoles = []; - - if(roleSuffix == "viewer"){ - filteresRoles = roles.filter(function(role){ - if (role.isChecked && (role.permissionLevel == "editor" || role.permissionLevel == "creator")){ - return true; - } - }); - } - else if (roleSuffix == "editor"){ - filteresRoles = roles.filter(function(role){ - if (role.isChecked && role.permissionLevel == "creator"){ - return true; - } - }); - } - - return filteresRoles.length > 0; - }; - - function CheckboxRenderer_viewer() {} - - CheckboxRenderer_viewer.prototype.init = function(params) { - this.params = params; - - let isChecked = false; - let exists = false; - let className; - for (const role of params.data.roles) { - if (role.permissionLevel == "viewer"){ - exists = true; - isChecked = role.isChecked; - className = role.roleId; - break; - } - } - - if(exists){ - this.eGui = document.createElement('input'); - this.eGui.className = className; - this.eGui.type = 'checkbox'; - this.eGui.checked = isChecked; - - this.checkedHandler = this.checkedHandler.bind(this); - this.eGui.addEventListener('click', this.checkedHandler); - // if higher role rights are checked as well - if(isChecked && anyHigherRoleIsChecked(params.data.roles, "viewer")){ - this.eGui.disabled = true; - } - } - }; - - CheckboxRenderer_viewer.prototype.checkedHandler = function(e) { - let checked = e.target.checked; - for (const role of this.params.data.roles) { - if (role.permissionLevel == "viewer"){ - role.isChecked = checked; - break; - } - } - }; - - CheckboxRenderer_viewer.prototype.getGui = function(params) { - return this.eGui; - }; - - CheckboxRenderer_viewer.prototype.destroy = function(params) { - if(this.eGui){ - this.eGui.removeEventListener('click', this.checkedHandler); - } - }; - - function CheckboxRenderer_editor() {} - - CheckboxRenderer_editor.prototype.init = function(params) { - this.params = params; - - let isChecked = false; - let exists = false; - let className; - for (const role of params.data.roles) { - if (role.permissionLevel == "editor"){ - exists = true; - isChecked = role.isChecked; - className = role.roleId; - break; - } - } - - if(exists){ - this.eGui = document.createElement('input'); - this.eGui.className = className; - this.eGui.type = 'checkbox'; - this.eGui.checked = isChecked; - - this.checkedHandler = this.checkedHandler.bind(this); - this.eGui.addEventListener('click', this.checkedHandler); - // if higher role rights are checked as well - if(isChecked && anyHigherRoleIsChecked(params.data.roles, "editor")){ - this.eGui.disabled = true; - } - } - }; - - CheckboxRenderer_editor.prototype.checkedHandler = function(e) { - let checked = e.target.checked; - for (const role of this.params.data.roles) { - if (role.permissionLevel == "viewer"){ - if (checked){ - role.isChecked = true; - $('.' + role.roleId).attr('disabled', true); - $('.' + role.roleId).prop("checked", true); - } - else{ - $('.' + role.roleId).attr('disabled', false); - } - } - else if (role.permissionLevel == "editor"){ - role.isChecked = checked; - } - } - }; - - CheckboxRenderer_editor.prototype.getGui = function(params) { - return this.eGui; - }; - - CheckboxRenderer_editor.prototype.destroy = function(params) { - if(this.eGui){ - this.eGui.removeEventListener('click', this.checkedHandler); - } - }; - - function CheckboxRenderer_creator() {} - - CheckboxRenderer_creator.prototype.init = function(params) { - this.params = params; - - let isChecked = false; - let exists = false; - let className; - for (const role of params.data.roles) { - if (role.permissionLevel == "creator"){ - exists = true; - isChecked = role.isChecked; - className = role.roleId; - break; - } - } - - if(exists){ - this.eGui = document.createElement('input'); - this.eGui.className = className; - this.eGui.type = 'checkbox'; - this.eGui.checked = isChecked; - - this.checkedHandler = this.checkedHandler.bind(this); - this.eGui.addEventListener('click', this.checkedHandler); - } - }; - - CheckboxRenderer_creator.prototype.checkedHandler = function(e) { - let checked = e.target.checked; - for (const role of this.params.data.roles) { - if (role.permissionLevel == "editor"){ - if (checked){ - role.isChecked = true; - $('.' + role.roleId).attr('disabled', true); - $('.' + role.roleId).prop("checked", true); - } - else{ - $('.' + role.roleId).attr('disabled', false); - } - } - else if (role.permissionLevel == "viewer"){ - if (checked){ - role.isChecked = true; - $('.' + role.roleId).attr('disabled', true); - $('.' + role.roleId).prop("checked", true); - } - else{ - $('.' + role.roleId).attr('disabled', true); - } - } - else if (role.permissionLevel == "creator" || role.permissionLevel == "editor" || role.permissionLevel == "viewer"){ - role.isChecked = checked; - } - } - }; - - CheckboxRenderer_creator.prototype.getGui = function(params) { - return this.eGui; - }; - - CheckboxRenderer_creator.prototype.destroy = function(params) { - if(this.eGui){ - this.eGui.removeEventListener('click', this.checkedHandler); - } - }; - - this.buildRoleManagementGridRowData = function(accessControlMetadata, selectedRoleIds){ - let data = JSON.parse(JSON.stringify(accessControlMetadata)); - for (let elem of data) { - for (let role of elem.roles) { - role.isChecked = false; - if (selectedRoleIds && selectedRoleIds.includes(role.roleId)){ - role.isChecked = true; - } - } - } - - let array = []; - array.push(data[0]); - array.push(data[1]); - - data.splice(0,2); - data.sort(function (a, b) { - if (a.name < b.name) { - return -1; - } - if (a.name > b.name) { - return 1; - } - return 0; - }); - - array = array.concat(data); - - return array; - }; - - this.buildRoleManagementGridColumnConfig = function(){ - let columnDefs = []; - - return columnDefs.concat([ - { headerName: 'Organisationseinheit', field: "name", minWidth: 200 }, - { headerName: 'lesen', field: "roles", filter: false, sortable: false, maxWidth: 100, cellRenderer: 'checkboxRenderer_viewer', }, - { headerName: 'editieren', field: "roles", filter: false, sortable: false, maxWidth: 100, cellRenderer: 'checkboxRenderer_editor', }, - { headerName: 'löschen', field: "roles", filter: false, sortable: false, maxWidth: 100, cellRenderer: 'checkboxRenderer_creator', } - ]); - }; - - this.buildRoleManagementGridOptions = function(accessControlMetadata, selectedRoleIds){ - let columnDefs = this.buildRoleManagementGridColumnConfig(); - let rowData = this.buildRoleManagementGridRowData(accessControlMetadata, selectedRoleIds); - - let components = { - checkboxRenderer_viewer: CheckboxRenderer_viewer, - checkboxRenderer_editor: CheckboxRenderer_editor, - checkboxRenderer_creator: CheckboxRenderer_creator - }; - - let gridOptions = { - defaultColDef: { - editable: false, - sortable: true, - flex: 1, - minWidth: 200, - filter: true, - floatingFilter: false, - // filterParams: { - // newRowsAction: 'keep' - // }, - resizable: true, - wrapText: true, - autoHeight: true, - cellStyle: { 'font-size': '12px;', 'white-space': 'normal !important', "line-height": "20px !important", "word-break": "break-word !important", "padding-top": "17px", "padding-bottom": "17px" }, - headerComponentParams: { - template: - '', - }, - }, - components: components, - floatingFilter: false, - columnDefs: columnDefs, - rowData: rowData, - rowHeight: 10, - suppressRowClickSelection: true, - rowSelection: 'multiple', - enableCellTextSelection: false, - ensureDomOrder: true, - pagination: true, - paginationPageSize: 5, - suppressColumnVirtualisation: true, - onFirstDataRendered: function () { - }, - onColumnResized: function () { - self.registerClickHandler_accessControl(accessControlMetadata); - }, - onRowDataChanged: function () { - self.registerClickHandler_accessControl(accessControlMetadata); - }, - onModelUpdated: function () { - self.registerClickHandler_accessControl(accessControlMetadata); - }, - onViewportChanged: function () { - self.registerClickHandler_accessControl(accessControlMetadata); - }, - - }; - - return gridOptions; - }; - - this.buildRoleManagementGrid = function(tableDOMId, currentTableOptionsObject, accessControlMetadata, selectedRoleIds){ - if (currentTableOptionsObject && currentTableOptionsObject.api) { - - let newRowData = this.buildRoleManagementGridRowData(accessControlMetadata, selectedRoleIds); - currentTableOptionsObject.api.setRowData(newRowData); - } - else { - currentTableOptionsObject = this.buildRoleManagementGridOptions(accessControlMetadata, selectedRoleIds); - let gridDiv = document.querySelector('#' + tableDOMId); - new agGrid.Grid(gridDiv, currentTableOptionsObject); - } - return currentTableOptionsObject; - }; - - this.getSelectedRoleIds_roleManagementGrid = function(roleManagementTableOptions){ - let ids = []; - if (roleManagementTableOptions && roleManagementTableOptions.api){ - - roleManagementTableOptions.api.forEachNode(function(node, index){ - for (const role of node.data.roles) { - if(role && role.isChecked){ - ids.push(role.roleId); - } - } - }) - } - return ids; - }; - - this.saveGridStore = function (gridOptions) { - window.colState = gridOptions.columnApi.getColumnState(); - window.filterState = gridOptions.api.getFilterModel(); - - }; - - this.restoreGridStore = function (gridOptions) { - // gridOptions.columnApi.setColumnState(window.colState); - // gridOptions.columnApi.setColumnGroupState(window.groupState); - if (window.colState) { - gridOptions.columnApi.applyColumnState({ state: window.colState, applyOrder: true }); - } - - if (window.filterState) { - gridOptions.api.setFilterModel(window.filterState); - } - }; - - }]); diff --git a/app/util/genericServices/kommonitorDiagramHelperService/kommonitor-diagram-helper-service.module.ts b/app/util/genericServices/kommonitorDiagramHelperService/kommonitor-diagram-helper-service.module.ts deleted file mode 100644 index b25aaf9af..000000000 --- a/app/util/genericServices/kommonitorDiagramHelperService/kommonitor-diagram-helper-service.module.ts +++ /dev/null @@ -1,2072 +0,0 @@ -angular.module('kommonitorDiagramHelper', ['kommonitorMap', 'kommonitorDataExchange']); - -/** - * a common serviceInstance that holds all needed properties for a WPS service. - * - * This service represents a shared object ´which is used across the different - * application tabs/components like Setup, Capabilities, Execute etc. - * - * This way, one single service instance can be used to easily share values and - * parameters for each WPS operation represented by different Angular components - */ -angular - .module('kommonitorDiagramHelper', ["kommonitorFilterHelper"]) - .service( - 'kommonitorDiagramHelperService', ['$rootScope', '$timeout', 'kommonitorMapService', 'kommonitorDataExchangeService', - 'kommonitorFilterHelperService', '$http', '__env', '$q', - function ($rootScope, $timeout, - kommonitorMapService, kommonitorDataExchangeService, kommonitorFilterHelperService, $http, __env, $q) { - - const INDICATOR_DATE_PREFIX = __env.indicatorDatePrefix; - const defaultColorForHoveredFeatures = __env.defaultColorForHoveredFeatures; - const defaultColorForClickedFeatures = __env.defaultColorForClickedFeatures; - - var numberOfDecimals = __env.numberOfDecimals; - var defaultColorForZeroValues = __env.defaultColorForZeroValues; - var defaultColorForNoDataValues = __env.defaultColorForNoDataValues; - var defaultColorForFilteredValues = __env.defaultColorForFilteredValues; - - const defaultColorForOutliers_high = __env.defaultColorForOutliers_high; - const defaultBorderColorForOutliers_high = __env.defaultBorderColorForOutliers_high; - const defaultFillOpacityForOutliers_high = __env.defaultFillOpacityForOutliers_high; - const defaultColorForOutliers_low = __env.defaultColorForOutliers_low; - const defaultBorderColorForOutliers_low = __env.defaultBorderColorForOutliers_low; - const defaultFillOpacityForOutliers_low = __env.defaultFillOpacityForOutliers_low; - - this.indicatorPropertyName = ""; - - this.barChartOptions = {}; - this.lineChartOptions = {}; - this.histogramChartOptions = {}; - this.radarChartOptions = {}; - this.regressionChartOptions = {}; - - this.isCloserToTargetDate = function(date, closestDate, targetDate){ - var targetYear = targetDate.split("-")[0]; - var targetMonth = targetDate.split("-")[1]; - var targetDay = targetDate.split("-")[2]; - - var closestDateComps = closestDate.split("-"); - var closestDateYear = closestDateComps[0]; - var closestDateMonth = closestDateComps[1]; - var closestDateDay = closestDateComps[2]; - - var dateComps = date.split("-"); - var year = dateComps[0]; - var month = dateComps[1]; - var day = dateComps[2]; - - var monthDiff_closestDate = Math.abs(targetMonth - closestDateMonth); - var monthDiff_date = Math.abs(targetMonth - month); - - if(monthDiff_date <= monthDiff_closestDate){ - var dayDiff_closestDate = Math.abs(targetDay - closestDateDay); - var dayDiff_date = Math.abs(targetDay - day); - - if(dayDiff_date < dayDiff_closestDate){ - return true; - } - } - return false; - }; - - this.findClostestTimestamForTargetDate = function(indicatorForRadar, targetDate){ - var applicableDates = indicatorForRadar.indicatorMetadata.applicableDates; - - var targetYear = targetDate.split("-")[0]; - var targetMonth = targetDate.split("-")[1]; - var targetDay = targetDate.split("-")[2]; - - var closestDate = undefined; - - for (var date of applicableDates) { - var dateComps = date.split("-"); - var year = dateComps[0]; - var month = dateComps[1]; - var day = dateComps[2]; - - if(targetDate.includes(year)){ - if(! closestDate){ - closestDate = date; - } - else{ - if(this.isCloserToTargetDate(date, closestDate, targetDate)){ - closestDate = date; - } - } - - } - } - - return closestDate; - }; - - // an array of only the properties and metadata of all indicatorFeatures - this.indicatorPropertiesForCurrentSpatialUnitAndTime; - - this.filterSameUnitAndSameTime = false; - - this.setupIndicatorPropertiesForCurrentSpatialUnitAndTime = function (filterBySameUnitAndSameTime) { - - $rootScope.$broadcast("allIndicatorPropertiesForCurrentSpatialUnitAndTime setup begin"); - - this.indicatorPropertiesForCurrentSpatialUnitAndTime = []; - - kommonitorDataExchangeService.displayableIndicators.forEach(indicatorMetadata => { - var targetYear = kommonitorDataExchangeService.selectedDate.split("-")[0]; - var indicatorCandidateYears = [] - indicatorMetadata.applicableDates.forEach((date, i) => { - indicatorCandidateYears.push(date.split("-")[0]); - }); - - - // if (indicatorCandidateYears.includes(targetYear) && indicatorMetadata.applicableSpatialUnits.some(o => o.spatialUnitName === kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel)) { - // var selectableIndicatorEntry = {}; - // selectableIndicatorEntry.indicatorProperties = null; - // // per default show no indicators on radar - // selectableIndicatorEntry.isSelected = false; - // selectableIndicatorEntry.indicatorMetadata = indicatorMetadata; - // selectableIndicatorEntry.closestTimestamp = undefined; - - // this.indicatorPropertiesForCurrentSpatialUnitAndTime.push(selectableIndicatorEntry); - // } - - if (indicatorMetadata.applicableSpatialUnits.some(o => o.spatialUnitName === kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel)) { - var canBeAdded = true; - - if(filterBySameUnitAndSameTime){ - if(indicatorCandidateYears.includes(targetYear)){ - canBeAdded = true; - } - else{ - canBeAdded = false; - } - } - - if (canBeAdded){ - var selectableIndicatorEntry = {}; - selectableIndicatorEntry.indicatorProperties = null; - // per default show no indicators on radar - selectableIndicatorEntry.isSelected = false; - selectableIndicatorEntry.indicatorMetadata = indicatorMetadata; - // selectableIndicatorEntry.closestTimestamp = undefined; - - this.indicatorPropertiesForCurrentSpatialUnitAndTime.push(selectableIndicatorEntry); - } - - } - }); - - $rootScope.$broadcast("allIndicatorPropertiesForCurrentSpatialUnitAndTime setup completed"); - }; - - this.fetchIndicatorPropertiesIfNotExists = async function(index){ - if(this.indicatorPropertiesForCurrentSpatialUnitAndTime[index].indicatorProperties === null || this.indicatorPropertiesForCurrentSpatialUnitAndTime[index].indicatorProperties === undefined){ - // var dateComps = kommonitorDataExchangeService.selectedDate.split("-"); - // - // var year = dateComps[0]; - // var month = dateComps[1]; - // var day = dateComps[2]; - - this.indicatorPropertiesForCurrentSpatialUnitAndTime[index].indicatorProperties = await this.fetchIndicatorProperties(this.indicatorPropertiesForCurrentSpatialUnitAndTime[index].indicatorMetadata, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitId); - } - }; - - this.fetchIndicatorProperties = function (indicatorMetadata, spatialUnitId) { - return $http({ - url: kommonitorDataExchangeService.getBaseUrlToKomMonitorDataAPI_spatialResource() + "/indicators/" + indicatorMetadata.indicatorId + "/" + spatialUnitId + "/without-geometry", - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - return response.data; - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - kommonitorDataExchangeService.displayMapApplicationError(error); - }); - }; - - this.getColorFromBrewInstance = function(brewInstance, feature, targetDate){ - var color; - for (var index=0; index < brewInstance.breaks.length; index++){ - - if(kommonitorDataExchangeService.getIndicatorValueFromArray_asNumber(feature.properties, targetDate) == kommonitorDataExchangeService.getIndicatorValue_asNumber(brewInstance.breaks[index])){ - if(index < brewInstance.breaks.length -1){ - // min value - color = brewInstance.colors[index]; - break; - } - else { - //max value - if (brewInstance.colors[index]){ - color = brewInstance.colors[index]; - } - else{ - color = brewInstance.colors[index - 1]; - } - break; - } - } - else{ - if(kommonitorDataExchangeService.getIndicatorValueFromArray_asNumber(feature.properties, targetDate) < kommonitorDataExchangeService.getIndicatorValue_asNumber(brewInstance.breaks[index + 1])) { - color = brewInstance.colors[index]; - break; - } - } - } - - return color; - }; - - this.getColorForFeature = function(feature, indicatorMetadataAndGeoJSON, targetDate, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue){ - var color; - - if(!targetDate.includes(INDICATOR_DATE_PREFIX)){ - targetDate = INDICATOR_DATE_PREFIX + targetDate; - } - - if(kommonitorDataExchangeService.indicatorValueIsNoData(feature.properties[targetDate])){ - color = defaultColorForNoDataValues; - } - else if(kommonitorFilterHelperService.featureIsCurrentlyFiltered(feature.properties[__env.FEATURE_ID_PROPERTY_NAME])){ - color = defaultColorForFilteredValues; - } - else if(kommonitorDataExchangeService.classifyZeroSeparately && kommonitorDataExchangeService.getIndicatorValueFromArray_asNumber(feature.properties, targetDate) === 0 ){ - color = defaultColorForZeroValues; - } - else if(feature.properties["outlier"] !== undefined && feature.properties["outlier"].includes("low") && kommonitorDataExchangeService.useOutlierDetectionOnIndicator){ - color = defaultColorForOutliers_low; - } - else if(feature.properties["outlier"] !== undefined && feature.properties["outlier"].includes("high") && kommonitorDataExchangeService.useOutlierDetectionOnIndicator){ - color = defaultColorForOutliers_high; - } - else if(isMeasureOfValueChecked){ - - if(kommonitorDataExchangeService.getIndicatorValueFromArray_asNumber(feature.properties, targetDate) >= +Number(measureOfValue).toFixed(numberOfDecimals)){ - color = this.getColorFromBrewInstance(gtMeasureOfValueBrew, feature, targetDate); - } - else { - color = this.getColorFromBrewInstance(ltMeasureOfValueBrew, feature, targetDate); - } - - } - else{ - if(indicatorMetadataAndGeoJSON.indicatorType.includes('DYNAMIC')){ - - if(feature.properties[targetDate] < 0){ - - color = this.getColorFromBrewInstance(dynamicDecreaseBrew, feature, targetDate); - } - else{ - color = this.getColorFromBrewInstance(dynamicIncreaseBrew, feature, targetDate); - } - - } - else{ - - if(containsNegativeValues(indicatorMetadataAndGeoJSON.geoJSON, targetDate)){ - if(kommonitorDataExchangeService.getIndicatorValue_asNumber(feature.properties[targetDate]) >= 0){ - if(kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[targetDate] == 0 || feature.properties[targetDate] == "0")){ - color = defaultColorForZeroValues; - // if(__env.useTransparencyOnIndicator){ - // fillOpacity = __env.defaultFillOpacityForZeroFeatures; - // } - } - else{ - color = this.getColorFromBrewInstance(dynamicIncreaseBrew, feature, targetDate); - } - } - else{ - if(kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[targetDate] == 0 || feature.properties[targetDate] == "0")){ - color = defaultColorForZeroValues; - // if(__env.useTransparencyOnIndicator){ - // fillOpacity = __env.defaultFillOpacityForZeroFeatures; - // } - } - else{ - color = this.getColorFromBrewInstance(dynamicDecreaseBrew, feature, targetDate); - } - } - } - else{ - color = this.getColorFromBrewInstance(defaultBrew, feature, targetDate); - } - } - } - - return color; - }; - - this.getBarChartOptions = function () { - return self.barChartOptions; - }; - - this.getGeoMapChartOptions = function () { - return self.geoMapChartOptions; - }; - - this.getHistogramChartOptions = function () { - return self.histogramChartOptions; - }; - - this.getLineChartOptions = function () { - return self.lineChartOptions; - }; - - this.prepareAllDiagramResources_forCurrentMapIndicator = function (indicatorMetadataAndGeoJSON, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue, filterOutFutureDates) { - this.prepareAllDiagramResources(indicatorMetadataAndGeoJSON, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue, filterOutFutureDates, false); - }; - - this.prepareAllDiagramResources_forReportingIndicator = function (indicatorMetadataAndGeoJSON, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue, filterOutFutureDates) { - this.prepareAllDiagramResources(indicatorMetadataAndGeoJSON, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue, filterOutFutureDates, true); - }; - - this.prepareAllDiagramResources = function (indicatorMetadataAndGeoJSON, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue, filterOutFutureDates, forceUseSubmittedIndicatorForTimeseries) { - - self.indicatorPropertyName = INDICATOR_DATE_PREFIX + date; - - var featureNamesArray = new Array(); - var indicatorValueArray = new Array(); - var indicatorValueBarChartArray = new Array(); - - //sort array of features - var cartographicFeatures = indicatorMetadataAndGeoJSON.geoJSON.features; - cartographicFeatures.sort(compareFeaturesByIndicatorValue); - - for (var j = 0; j < cartographicFeatures.length; j++) { - // diff occurs when balance mode is activated - // then, cartographicFeatures display balance over time period, which shall be reflected in bar chart and histogram - // the other diagrams must use the "normal" unbalanced indicator instead --> selectedFeatures - var cartographicFeature = cartographicFeatures[j]; - - var indicatorValue; - if (kommonitorDataExchangeService.indicatorValueIsNoData(cartographicFeature.properties[self.indicatorPropertyName])) { - indicatorValue = null; - } - else { - indicatorValue = kommonitorDataExchangeService.getIndicatorValue_asNumber(cartographicFeature.properties[self.indicatorPropertyName]); - } - - var featureName = cartographicFeature.properties[__env.FEATURE_NAME_PROPERTY_NAME] - featureNamesArray.push(featureName); - indicatorValueArray.push(indicatorValue); - - var color = this.getColorForFeature(cartographicFeature, indicatorMetadataAndGeoJSON, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue); - - var seriesItem = { - value: indicatorValue, - name: featureName, - itemStyle: { - color: color - // borderWidth: 1, - // borderColor: 'black' - } - }; - - indicatorValueBarChartArray.push(seriesItem); - - } - - // TIMESERIES - var indicatorTimeSeriesDatesArray = indicatorMetadataAndGeoJSON.applicableDates; - - if(filterOutFutureDates){ - // remove all timestamps that are newer than the given date - var dateInDateFormat = Date.parse(date); - indicatorTimeSeriesDatesArray = indicatorTimeSeriesDatesArray.filter( t => { - var tInDateFormat = Date.parse(t); - if (tInDateFormat <= dateInDateFormat) { - return true; - } else { - return false; - } - }); - } - - var indicatorTimeSeriesAverageArray = new Array(indicatorTimeSeriesDatesArray.length); - var indicatorTimeSeriesMaxArray = new Array(indicatorTimeSeriesDatesArray.length); - var indicatorTimeSeriesMinArray = new Array(indicatorTimeSeriesDatesArray.length); - var indicatorTimeSeriesCountArray = new Array(indicatorTimeSeriesDatesArray.length); - - // initialize timeSeries arrays - for (var i = 0; i < indicatorTimeSeriesDatesArray.length; i++) { - indicatorTimeSeriesAverageArray[i] = 0; - indicatorTimeSeriesCountArray[i] = 0; - } - - let indicatorMetadataForTimeseries = indicatorMetadataAndGeoJSON; - - if(!forceUseSubmittedIndicatorForTimeseries && kommonitorDataExchangeService.isBalanceChecked){ - indicatorMetadataForTimeseries = kommonitorDataExchangeService.selectedIndicator; - } - // we must use the original selectedIndicator in case balance mode is active - // otherwise balance timestamp will have balance values - for (var t = 0; t < indicatorMetadataForTimeseries.geoJSON.features.length; t++) { - var indicatorFeature = indicatorMetadataForTimeseries.geoJSON.features[t]; - // continue timeSeries arrays by adding and counting all time series values - for (var i = 0; i < indicatorTimeSeriesDatesArray.length; i++) { - var datePropertyName = INDICATOR_DATE_PREFIX + indicatorTimeSeriesDatesArray[i]; - if (!kommonitorDataExchangeService.indicatorValueIsNoData(indicatorFeature.properties[datePropertyName])) { - // indicatorTimeSeriesAverageArray[i] += selectedFeature.properties[datePropertyName]; - indicatorTimeSeriesAverageArray[i] += indicatorFeature.properties[datePropertyName]; - indicatorTimeSeriesCountArray[i]++; - - // min stack - if (indicatorTimeSeriesMinArray[i] === undefined || indicatorTimeSeriesMinArray[i] === null){ - indicatorTimeSeriesMinArray[i] = indicatorFeature.properties[datePropertyName]; - } - else{ - if(indicatorFeature.properties[datePropertyName] < indicatorTimeSeriesMinArray[i]){ - indicatorTimeSeriesMinArray[i] = indicatorFeature.properties[datePropertyName]; - } - } - - // max stack - if (indicatorTimeSeriesMaxArray[i] === undefined || indicatorTimeSeriesMaxArray[i] === null){ - indicatorTimeSeriesMaxArray[i] = indicatorFeature.properties[datePropertyName]; - } - else{ - if(indicatorFeature.properties[datePropertyName] > indicatorTimeSeriesMaxArray[i]){ - indicatorTimeSeriesMaxArray[i] = indicatorFeature.properties[datePropertyName]; - } - } - } - } - } - - // finish timeSeries arrays by computing averages of all time series values - for (var i = 0; i < indicatorTimeSeriesDatesArray.length; i++) { - indicatorTimeSeriesAverageArray[i] = kommonitorDataExchangeService.getIndicatorValue_asNumber(indicatorTimeSeriesAverageArray[i] / indicatorTimeSeriesCountArray[i]); - } - - // setHistogramChartOptions(indicatorMetadataAndGeoJSON, indicatorValueArray, spatialUnitName, date); - - setLineChartOptions(indicatorMetadataAndGeoJSON, indicatorTimeSeriesDatesArray, indicatorTimeSeriesAverageArray, indicatorTimeSeriesMaxArray, indicatorTimeSeriesMinArray, spatialUnitName, date); - - setBarChartOptions(indicatorMetadataAndGeoJSON, featureNamesArray, indicatorValueBarChartArray, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue); - - setGeoMapChartOptions(indicatorMetadataAndGeoJSON, featureNamesArray, indicatorValueBarChartArray, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue); - }; - - var compareFeaturesByIndicatorValue = function (featureA, featureB) { - if (featureA.properties[self.indicatorPropertyName] < featureB.properties[self.indicatorPropertyName]) - return -1; - if (featureA.properties[self.indicatorPropertyName] > featureB.properties[self.indicatorPropertyName]) - return 1; - return 0; - }; - - var setBarChartOptions = function (indicatorMetadataAndGeoJSON, featureNamesArray, indicatorValueBarChartArray, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue) { - - // specify chart configuration item and data - var labelOption = { - normal: { - show: true, - position: 'insideBottom', - align: 'left', - verticalAlign: 'middle', - rotate: 90, - formatter: '{c}', - } - }; - - // default fontSize of echarts - var fontSize = 18; - var barChartTitel = 'Ranking - ' + spatialUnitName + ' - '; - if (indicatorMetadataAndGeoJSON.fromDate) { - barChartTitel += "Bilanz " + indicatorMetadataAndGeoJSON.fromDate + " - " + indicatorMetadataAndGeoJSON.toDate; - fontSize = 14; - } - else { - barChartTitel += date; - } - - var legendConfig = setupVisualMap(indicatorMetadataAndGeoJSON, featureNamesArray, - indicatorValueBarChartArray, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, - ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, - measureOfValue); - - var barOption = { - // grid get rid of whitespace around chart - grid: { - left: '4%', - top: 32, - right: '4%', - bottom: 32, - containLabel: true - }, - title: { - text: barChartTitel, - left: 'center', - textStyle: { - fontSize: fontSize - }, - show: false - // top: 15 - }, - tooltip: { - trigger: 'item', - confine: 'true', - formatter: function (params) { - var value = kommonitorDataExchangeService.getIndicatorValue_asFormattedText(params.value); - return "" + params.name + ": " + value + " [" + indicatorMetadataAndGeoJSON.unit + "]"; - }, - axisPointer: { - type: 'line', - crossStyle: { - color: '#999' - } - } - }, - toolbox: { - show: true, - right: '15', - feature: { - // mark : {show: true}, - dataView: { - show: kommonitorDataExchangeService.showDiagramExportButtons, readOnly: true, title: "Datenansicht", lang: ['Datenansicht - Feature-Vergleich', 'schließen', 'refresh'], optionToContent: function (opt) { - - var barData = opt.series[0].data; - var featureNames = opt.xAxis[0].data; - - var dataTableId = "barDataTable_" + Math.random(); - var tableExportName = opt.xAxis[0].name + " - " + opt.title[0].text; - - var htmlString = ''; - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - - htmlString += ""; - - for (var i = 0; i < barData.length; i++) { - var value = kommonitorDataExchangeService.getIndicatorValue_asNumber(barData[i].value); - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - } - - htmlString += ""; - htmlString += "
        Feature-Name" + opt.xAxis[0].name + " [" + opt.yAxis[0].name + "]
        " + featureNames[i] + "" + value + "
        "; - - $rootScope.$broadcast("AppendExportButtonsForTable", dataTableId, tableExportName); - - return htmlString; - } - }, - restore: { show: false, title: "Erneuern" }, - saveAsImage: { show: true, title: "Export", pixelRatio: 4 } - } - }, - // legend: { - // //data:[indicatorMetadataAndGeoJSON.indicatorName] - // }, - xAxis: { - name: indicatorMetadataAndGeoJSON.indicatorName, - nameLocation: 'center', - nameGap: 15, - axisLabel: { - rotate: 90, - interval: 0, - inside: true, - show: false - }, - axisTick: { - show: false - }, - z: 6, - zlevel: 6, - data: featureNamesArray - }, - yAxis: { - type: 'value', - name: indicatorMetadataAndGeoJSON.unit, - // splitArea: { - // show: true - // } - }, - series: [{ - // name: indicatorMetadataAndGeoJSON.indicatorName, - type: 'bar', - emphasis: { - itemStyle: { - borderWidth: 4, - borderColor: defaultColorForClickedFeatures - } - }, - data: indicatorValueBarChartArray - }], - visualMap: [{ - left: 'left', - type: "piecewise", - pieces: legendConfig, - precision: 2, - show: false - }] - }; - - // if (indicatorMetadataAndGeoJSON.geoJSON.features.length > 50) { - // // barOption.xAxis.data = undefined; - // barOption.xAxis.axisLabel.show = false; - // } - - // use configuration item and data specified to show chart - self.barChartOptions = barOption; - }; - - var containsNegativeValues = function (geoJSON, date) { - - var propertyName = date; - - if(! propertyName.includes(kommonitorDataExchangeService.indicatorDatePrefix)){ - propertyName = kommonitorDataExchangeService.indicatorDatePrefix + propertyName; - } - - var containsNegativeValues = false; - for (var i = 0; i < geoJSON.features.length; i++) { - if (geoJSON.features[i].properties[propertyName] < 0) { - containsNegativeValues = true; - break; - } - } - - return containsNegativeValues; - }; - - var containsZeroValues = function (geoJSON, date) { - - var propertyName = date; - - if(! propertyName.includes(kommonitorDataExchangeService.indicatorDatePrefix)){ - propertyName = kommonitorDataExchangeService.indicatorDatePrefix + propertyName; - } - - var containsZeroValues = false; - for (var i = 0; i < geoJSON.features.length; i++) { - if (geoJSON.features[i].properties[propertyName] === 0 || geoJSON.features[i].properties[propertyName] === "0") { - containsZeroValues = true; - break; - } - } - - return containsZeroValues; - }; - - var setupVisualMap = function(indicatorMetadataAndGeoJSON, featureNamesArray, indicatorValueBarChartArray, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue){ - /* - pieces: [ - // Range of a piece can be specified by property min and max, - // where min will be set as -Infinity if ignored, - // and max will be set as Infinity if ignored. - {min: 1500}, - {min: 900, max: 1500}, - {min: 310, max: 1000}, - {min: 200, max: 300}, - // Label of the piece can be specified. - {min: 10, max: 200, label: '10 to 200 (custom label) '}, - // Color of the piece can be specified. - {value: 123, label: '123 (custom special color) ', color: 'grey'}, - {max: 5} - ] - */ - - var indicatorType = indicatorMetadataAndGeoJSON.indicatorType; - - var pieces = []; - - if(containsZeroValues(indicatorMetadataAndGeoJSON.geoJSON, date)){ - pieces.push({ - min: 0, - opacity: 0.8, - max: 0, - color: defaultColorForZeroValues - }); - } - - // if(containsOutlierValues(indicatorMetadataAndGeoJSON.geoJSON, date)){ - // pieces.push({ - // min: 0, - // opacity: 0.8, - // max: 0, - // color: defaultColorForZeroValues - // }); - // } - - if(isMeasureOfValueChecked){ - - if(gtMeasureOfValueBrew && gtMeasureOfValueBrew.breaks && gtMeasureOfValueBrew.colors){ - // measure of value brew - var gtBreaks = gtMeasureOfValueBrew.breaks; - var gtColors = gtMeasureOfValueBrew.colors; - - for (var j = 0; j < gtColors.length; j++) { - - var legendItem_gtMov = { - min: gtBreaks[j], - opacity: 0.8, - color: gtColors[j] - }; - if(gtBreaks[j + 1]){ - legendItem_gtMov.max = gtBreaks[j + 1]; - } - - pieces.push(legendItem_gtMov); - - } - } - - if(ltMeasureOfValueBrew && ltMeasureOfValueBrew.breaks && ltMeasureOfValueBrew.colors){ - var ltBreaks = ltMeasureOfValueBrew.breaks; - var ltColors = ltMeasureOfValueBrew.colors; - - for (var j = 0; j < ltColors.length; j++) { - - var legendItem_ltMov = { - min: ltBreaks[j], - opacity: 0.8, - color: ltColors[ltColors.length - 1 - j] - }; - if(ltBreaks[j + 1]){ - legendItem_ltMov.max = ltBreaks[j + 1]; - } - - pieces.push(legendItem_ltMov); - - } - } - - - - } - else if(indicatorType.includes("DYNAMIC")){ - // dynamic brew - - if(dynamicDecreaseBrew){ - var dynamicDecreaseBreaks = dynamicDecreaseBrew.breaks; - var dynamicDecreaseColors = dynamicDecreaseBrew.colors; - - for (var j = 0; j < dynamicDecreaseColors.length; j++) { - - var legendItem_dynamicDecreaseMov = { - min: dynamicDecreaseBreaks[j], - opacity: 0.8, - // color: dynamicDecreaseColors[dynamicDecreaseColors.length - 1 - j] - color: dynamicDecreaseColors[j] - }; - if(dynamicDecreaseBreaks[j + 1]){ - legendItem_dynamicDecreaseMov.max = dynamicDecreaseBreaks[j + 1]; - legendItem_dynamicDecreaseMov.label = "" + dynamicDecreaseBreaks[j] + " - < " + dynamicDecreaseBreaks[j + 1]; - - // in negative scala we must ensure that smallest value near 0 (here max) is included in range - if(j == dynamicDecreaseColors.length - 1){ - legendItem_dynamicDecreaseMov.max = -0.01; - } - } - else{ - legendItem_dynamicDecreaseMov.max = -0.01; - legendItem_dynamicDecreaseMov.label = dynamicDecreaseBreaks[j]; - } - - pieces.push(legendItem_dynamicDecreaseMov); - - } - } - - if(dynamicIncreaseBrew){ - var dynamicIncreaseBreaks = dynamicIncreaseBrew.breaks; - var dynamicIncreaseColors = dynamicIncreaseBrew.colors; - - for (var j = 0; j < dynamicIncreaseColors.length; j++) { - - var legendItem_dynamicIncreaseMov = { - min: dynamicIncreaseBreaks[j], - opacity: 0.8, - color: dynamicIncreaseColors[j] - }; - if(dynamicIncreaseBreaks[j + 1]){ - legendItem_dynamicIncreaseMov.max = dynamicIncreaseBreaks[j + 1]; - legendItem_dynamicIncreaseMov.label = "" + dynamicIncreaseBreaks[j] + " - < " + dynamicIncreaseBreaks[j + 1]; - } - else{ - legendItem_dynamicIncreaseMov.max = dynamicIncreaseBreaks[j]; - } - - pieces.push(legendItem_dynamicIncreaseMov); - - } - } - - } - else { - // default brew - - if(containsNegativeValues(indicatorMetadataAndGeoJSON.geoJSON, date)){ - // dynamic brew - if(dynamicDecreaseBrew){ - var dynamicDecreaseBreaks = dynamicDecreaseBrew.breaks; - var dynamicDecreaseColors = dynamicDecreaseBrew.colors; - - for (var j = 0; j < dynamicDecreaseColors.length; j++) { - - var legendItem_dynamicDecreaseMov = { - min: dynamicDecreaseBreaks[j], - opacity: 0.8, - // color: dynamicDecreaseColors[dynamicDecreaseColors.length - 1 - j] - color: dynamicDecreaseColors[j] - }; - if(dynamicDecreaseBreaks[j + 1]){ - legendItem_dynamicDecreaseMov.max = dynamicDecreaseBreaks[j + 1]; - legendItem_dynamicDecreaseMov.label = "" + dynamicDecreaseBreaks[j] + " - < " + dynamicDecreaseBreaks[j + 1]; - - // in negative scala we must ensure that smallest value near 0 (here max) is included in range - if(j == dynamicDecreaseColors.length - 1){ - legendItem_dynamicDecreaseMov.max = -0.01; - } - } - else{ - legendItem_dynamicDecreaseMov.max = -0.01; - legendItem_dynamicDecreaseMov.label = dynamicDecreaseBreaks[j]; - } - - pieces.push(legendItem_dynamicDecreaseMov); - - } - } - - if(dynamicIncreaseBrew){ - var dynamicIncreaseBreaks = dynamicIncreaseBrew.breaks; - var dynamicIncreaseColors = dynamicIncreaseBrew.colors; - - for (var j = 0; j < dynamicIncreaseColors.length; j++) { - - var legendItem_dynamicIncreaseMov = { - min: dynamicIncreaseBreaks[j], - opacity: 0.8, - color: dynamicIncreaseColors[j] - }; - if(dynamicIncreaseBreaks[j + 1]){ - legendItem_dynamicIncreaseMov.max = dynamicIncreaseBreaks[j + 1]; - legendItem_dynamicIncreaseMov.label = "" + dynamicIncreaseBreaks[j] + " - < " + dynamicIncreaseBreaks[j + 1]; - } - else{ - legendItem_dynamicIncreaseMov.max = dynamicIncreaseBreaks[j]; - } - - pieces.push(legendItem_dynamicIncreaseMov); - - } - } - - } - else{ - if(defaultBrew && defaultBrew.breaks && defaultBrew.colors){ - var breaks = defaultBrew.breaks; - var colors = defaultBrew.colors; - - for (var j = 0; j < colors.length; j++) { - - var legendItem_default = { - min: breaks[j], - opacity: 0.8, - max: breaks[j + 1], - color: colors[j] - }; - - pieces.push(legendItem_default); - - } - } - - } - - - } - - return pieces; - - }; - - - var setGeoMapChartOptions = function (indicatorMetadataAndGeoJSON, featureNamesArray, indicatorValueBarChartArray, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue) { - - indicatorMetadataAndGeoJSON.geoJSON.features.forEach(feature => { - feature.properties.name= feature.properties[kommonitorDataExchangeService.FEATURE_NAME_PROPERTY_NAME]; - }); - - var uniqueMapRef = 'geoMapChart'; - - echarts.registerMap(uniqueMapRef, indicatorMetadataAndGeoJSON.geoJSON); - - // specify chart configuration item and data - - var legendConfig = setupVisualMap(indicatorMetadataAndGeoJSON, featureNamesArray, indicatorValueBarChartArray, spatialUnitName, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue); - - // default fontSize of echarts - var fontSize = 18; - var geoMapChartTitel = indicatorMetadataAndGeoJSON.indicatorName + ' - ' + spatialUnitName + ' - ' + date; - - var seriesData = []; - - for (let index = 0; index < featureNamesArray.length; index++) { - var featureName = featureNamesArray[index]; - - /* - var seriesItem = { - value: indicatorValue, - itemStyle: { - color: color - // borderWidth: 1, - // borderColor: 'black' - } - }; - */ - var featureValue = indicatorValueBarChartArray[index].value; - - seriesData.push({ - name: featureName, - value: featureValue - }); - } - - // needed for reporting - for(let feature of indicatorMetadataAndGeoJSON.geoJSON.features) { - bbox = turf.bbox(feature); // calculate bbox for each feature - feature.properties.bbox = bbox; - } - var bbox = calculateOverallBoundingBoxFromGeoJSON(indicatorMetadataAndGeoJSON.geoJSON.features) - // change format of bbox to match the format needed for echarts - bbox = [ - [bbox[0], bbox[3]], // north-west lon lat - [bbox[2], bbox[1]] // south-east lon lat - ] - - var geoMapOption = { - // grid get rid of whitespace around chart - // grid: { - // left: '4%', - // top: 32, - // right: '4%', - // bottom: 32, - // containLabel: true - // }, - title: { - text: geoMapChartTitel, - left: 'center', - textStyle: { - fontSize: fontSize - }, - show: true - // top: 15 - }, - tooltip: { - trigger: 'item', - confine: 'true', - showDelay: 0, - transitionDuration: 0.2, - formatter: function (params) { - var value = kommonitorDataExchangeService.getIndicatorValue_asFormattedText(params.value); - return "" + params.name + ": " + value + " [" + indicatorMetadataAndGeoJSON.unit + "]"; - } - }, - toolbox: { - show: true, - right: '15', - feature: { - // mark : {show: true}, - dataView: { - show: kommonitorDataExchangeService.showDiagramExportButtons, readOnly: true, title: "Datenansicht", lang: ['Datenansicht - Geo Map Chart', 'schließen', 'refresh'], optionToContent: function (opt) { - - var dataTableId = "geoMapDataTable_" + Math.random(); - var tableExportName = indicatorMetadataAndGeoJSON.indicatorName + " - " + opt.title[0].text; - - var htmlString = ''; - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - - htmlString += ""; - - for (var i = 0; i < seriesData.length; i++) { - var value = kommonitorDataExchangeService.getIndicatorValue_asNumber(seriesData[i].value); - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - } - - htmlString += ""; - htmlString += "
        Feature-Name" + indicatorMetadataAndGeoJSON.indicatorName + " [" + indicatorMetadataAndGeoJSON.indicatorName + "]
        " + seriesData[i].name + "" + value + "
        "; - - $rootScope.$broadcast("AppendExportButtonsForTable", dataTableId, tableExportName); - - return htmlString; - } - }, - restore: { show: false, title: "Erneuern" }, - saveAsImage: { show: true, title: "Export", pixelRatio: 4 } - } - }, - // legend: { - // //data:[indicatorMetadataAndGeoJSON.indicatorName] - // }, - visualMap: { - left: 'left', - type: "piecewise", - pieces: legendConfig, - // selectedMode: 'multiple', - precision: 2, - show: true - }, - series: [{ - name: indicatorMetadataAndGeoJSON.indicatorName, - type: 'map', - roam: true, - boundingCoords: bbox, - map: uniqueMapRef, - emphasis: { - label: { - show: true - } - }, - data: seriesData - }] - }; - - // use configuration item and data specified to show chart - self.geoMapChartOptions = geoMapOption; - }; - - - var setLineChartOptions = function (indicatorMetadataAndGeoJSON, indicatorTimeSeriesDatesArray, indicatorTimeSeriesAverageArray, indicatorTimeSeriesMaxArray, indicatorTimeSeriesMinArray, spatialUnitName, date) { - - var lineOption = { - // grid get rid of whitespace around chart - grid: { - left: '4%', - top: 32, - right: '4%', - bottom: 55, - containLabel: true - }, - title: { - text: 'Zeitreihe - ' + spatialUnitName, - left: 'center', - show: false, - textStyle: { - fontSize: 18 - }, - // top: 15 - }, - tooltip: { - trigger: 'axis', - confine: 'true', - formatter: function (params) { - - var string = "" + params[0].axisValueLabel + "
        "; - - params.forEach(function (paramObj) { - - if(! paramObj.seriesName.includes("Stack")){ - var value = kommonitorDataExchangeService.getIndicatorValue_asFormattedText(paramObj.value); - string += paramObj.seriesName + ": " + value + " [" + indicatorMetadataAndGeoJSON.unit + "]" + "
        "; - } - }); - - return string; - }, - axisPointer: { - type: 'line', - crossStyle: { - color: '#999' - } - } - }, - toolbox: { - show: true, - right: '15', - feature: { - // mark : {show: true}, - dataView: { - show: kommonitorDataExchangeService.showDiagramExportButtons, readOnly: true, title: "Datenansicht", lang: ['Datenansicht - Zeitreihe', 'schließen', 'refresh'], optionToContent: function (opt) { - - // - // - // - // - // - // - // - // - // - // - // - // - // - //
        Indikator-NameBeschreibung der Verknüpfung
        {{indicator.referencedIndicatorName}}{{indicator.referencedIndicatorDescription}}
        - - var lineSeries = opt.series; - var timestamps = opt.xAxis[0].data; - - var dataTableId = "lineDataTable_" + Math.random(); - var tableExportName = opt.xAxis[0].name + " - " + opt.title[0].text; - - var htmlString = ''; - htmlString += ""; - htmlString += ""; - htmlString += ""; - - for (var i = 0; i < lineSeries.length; i++) { - htmlString += ""; - } - - htmlString += ""; - htmlString += ""; - - htmlString += ""; - - for (var j = 0; j < timestamps.length; j++) { - htmlString += ""; - htmlString += ""; - for (var k = 0; k < lineSeries.length; k++) { - var value = kommonitorDataExchangeService.getIndicatorValue_asNumber(lineSeries[k].data[j]); - htmlString += ""; - } - htmlString += ""; - } - - htmlString += ""; - htmlString += "
        Zeitpunkt" + lineSeries[i].name + " [" + opt.yAxis[0].name + "]
        " + timestamps[j] + "" + value + "
        "; - - $rootScope.$broadcast("AppendExportButtonsForTable", dataTableId, tableExportName); - - return htmlString; - } - }, - restore: { show: false, title: "Erneuern" }, - saveAsImage: { show: true, title: "Export", pixelRatio: 4 } - } - }, - legend: { - type: "scroll", - bottom: 0, - data: ['Arithmetisches Mittel'] - }, - xAxis: { - name: indicatorMetadataAndGeoJSON.indicatorName, - nameLocation: 'center', - nameGap: 22, - // axisLabel: { - // rotate: 90, - // interval: 0, - // inside: true - // }, - // z: 6, - // zlevel: 6, - type: 'category', - axisTick: { - show: false - }, - data: indicatorTimeSeriesDatesArray - }, - yAxis: { - type: 'value', - name: indicatorMetadataAndGeoJSON.unit, - // splitArea: { - // show: true - // } - }, - series: [ - { - name: "Arithmetisches Mittel", - type: 'line', - data: indicatorTimeSeriesAverageArray, - lineStyle: { - normal: { - color: 'gray', - width: 2, - type: 'dashed' - } - }, - itemStyle: { - normal: { - borderWidth: 3, - color: 'gray' - } - } - }] - }; - - // SETTING FOR MIN AND MAX STACK - - // default for min value of 0 - var minStack = { - name: "MinStack", - type: 'line', - data: indicatorTimeSeriesMinArray, - stack: "MinMax", - // areaStyle:{ - // color: "#d6d6d6" - // }, - lineStyle: { - opacity: 0 - }, - itemStyle: { - opacity: 0 - }, - silent: true - }; - - var minLine = { - name: "Min", - type: 'line', - data: indicatorTimeSeriesMinArray, - lineStyle: { - opacity: 0, - color: "#d6d6d6" - }, - itemStyle: { - opacity: 0 - } - }; - - var maxStack = { - name: "MaxStack", - type: 'line', - data: indicatorTimeSeriesMaxArray, - stack: "MinMax", - areaStyle:{ - color: "#d6d6d6" - }, - lineStyle: { - opacity: 0 - }, - itemStyle: { - opacity: 0 - }, - silent: true - }; - - var maxLine = { - name: "Max", - type: 'line', - data: indicatorTimeSeriesMaxArray, - lineStyle: { - opacity: 0, - color: "#d6d6d6" - }, - itemStyle: { - opacity: 0 - } - }; - - // perform checks if there are negative values or only > 0 values - // then stacks must be adjusted to be correctly displayed - var minStack_minValue = Math.min(...indicatorTimeSeriesMinArray); - if(minStack_minValue < 0){ - minStack.areaStyle = { - color: "#d6d6d6" - }; - } - - let indicatorTimeSeriesMaxArray_copy = JSON.parse(JSON.stringify(indicatorTimeSeriesMaxArray)); - - if ((indicatorTimeSeriesMinArray.filter(item => item > 0))){ - for (let index = 0; index < indicatorTimeSeriesMaxArray_copy.length; index++) { - - if(indicatorTimeSeriesMinArray[index] > 0){ - indicatorTimeSeriesMaxArray_copy[index] = indicatorTimeSeriesMaxArray_copy[index] - indicatorTimeSeriesMinArray[index]; - } - } - maxStack.data = indicatorTimeSeriesMaxArray_copy; - } - - lineOption.series.push(minLine); - lineOption.series.push(maxLine); - lineOption.series.push(minStack); - lineOption.series.push(maxStack); - - - // use configuration item and data specified to show chart - self.lineChartOptions = lineOption; - }; - - - var setHistogramChartOptions = function (indicatorMetadataAndGeoJSON, indicatorValueArray, spatialUnitName, date) { - var bins; - try { - bins = ecStat.histogram(indicatorValueArray); - } - catch (error) { - console.log("Histogram chart cannot be drawn - error in bins creation"); - // kommonitorDataExchangeService.displayMapApplicationError(error); - } - - // default fontSize of echarts title - var fontSize = 18; - var histogramChartTitel = 'Histogramm - ' + spatialUnitName + ' - '; - if (indicatorMetadataAndGeoJSON.fromDate) { - histogramChartTitel += "Bilanz " + indicatorMetadataAndGeoJSON.fromDate + " - " + indicatorMetadataAndGeoJSON.toDate; - fontSize = 14; - } - else { - histogramChartTitel += date; - } - - var histogramOption = { - // grid get rid of whitespace around chart - grid: { - left: '4%', - top: 32, - right: '4%', - bottom: 35, - containLabel: true - }, - title: { - text: histogramChartTitel, - left: 'center', - textStyle: { - fontSize: fontSize - }, - show: false - // top: 15 - }, - tooltip: { - trigger: 'item', - confine: 'true', - axisPointer: { - type: 'line', - crossStyle: { - color: '#999' - } - } - }, - toolbox: { - show: true, - right: '15', - feature: { - // mark : {show: true}, - dataView: { - show: kommonitorDataExchangeService.showDiagramExportButtons, readOnly: true, title: "Datenansicht", lang: ['Datenansicht - Histogramm', 'schließen', 'refresh'], optionToContent: function (opt) { - - // - // - // - // - // - // - // - // - // - // - // - // - // - //
        Indikator-NameBeschreibung der Verknüpfung
        {{indicator.referencedIndicatorName}}{{indicator.referencedIndicatorDescription}}
        - - var histogramData = opt.series[0].data; - - var dataTableId = "histogramDataTable_" + Math.random(); - var tableExportName = opt.xAxis[0].name + " - " + opt.title[0].text; - - var htmlString = ''; - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - - htmlString += ""; - - for (var i = 0; i < histogramData.length; i++) { - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - } - - htmlString += ""; - htmlString += "
        WertintervallHäufigkeit
        " + histogramData[i][0] + " — " + histogramData[i][1] + "" + histogramData[i][2] + "
        "; - - $rootScope.$broadcast("AppendExportButtonsForTable", dataTableId, tableExportName); - - return htmlString; - } - }, - restore: { show: false, title: "Erneuern" }, - saveAsImage: { show: true, title: "Export", pixelRatio: 4 } - } - }, - xAxis: [{ - name: indicatorMetadataAndGeoJSON.indicatorName, - nameLocation: 'center', - nameGap: 22, - scale: true, - }], - yAxis: { - name: 'Anzahl Features', - // nameGap: 35, - // nameLocation: 'center', - // nameRotate: 90, - }, - series: [{ - type: 'custom', - name: indicatorMetadataAndGeoJSON.indicatorName, - renderItem: function (params, api) { - var yValue = api.value(2); - var start = api.coord([api.value(0), yValue]); - var size = api.size([api.value(1) - api.value(0), yValue]); - return { - type: 'rect', - shape: { - x: start[0], - y: start[1], - width: size[0] * 0.99, - height: size[1] - }, - style: api.style() - }; - }, - itemStyle: { - color: '#337ab7' - }, - // label: { - // normal: { - // show: true, - // position: 'insideTop' - // } - // }, - dimensions: ['untere Intervallgrenze', 'obere Intervallgrenze', 'Anzahl'], - encode: { - x: [0, 1], - y: 2, - tooltip: [0, 1, 2] - }, - data: bins ? bins.customData : undefined - }] - }; - - // var option = { - // title: { - // text: 'Histogram Chart', - // left: 'center', - // top: 20 - // }, - // tooltip: { - // trigger: 'axis', - // axisPointer: { - // type: 'line', - // crossStyle: { - // color: '#999' - // } - // } - // }, - // color: ['rgb(25, 183, 207)'], - // grid: { - // left: '3%', - // right: '3%', - // bottom: '3%', - // containLabel: true - // }, - // xAxis: [{ - // type: 'value', - // name: 'Wertintervalle', - // nameLocation: 'center', - // nameGap: 15, - // scale: true, - // }], - // yAxis: { - // type: 'value', - // name: 'Anzahl Features', - // nameGap: 22, - // nameLocation: 'center', - // nameRotate: 90, - // }, - // series: [{ - // name: 'Anzahl', - // type: 'bar', - // barWidth: '99,3%', - // // label: { - // // normal: { - // // show: true, - // // position: 'insideTop', - // // formatter: function (params) { - // // return params.value[1]; - // // } - // // } - // // }, - // data: bins.data - // }] - // }; - - if (onlyContainsPositiveNumbers(indicatorValueArray)) { - histogramOption.xAxis.min = 0; - } - - self.histogramChartOptions = histogramOption; - }; - - var onlyContainsPositiveNumbers = function (indicatorValueArray) { - indicatorValueArray.forEach(function (element) { - if (element < 0) { - return false; - } - }); - - return true; - }; - - - var appendSeriesToLineChart = function (featureProperties) { - - // in case of activated balance mode, we must use the properties of kommonitorDataExchangeService.selectedIndicator, to aquire the correct time series item! - if (kommonitorDataExchangeService.isBalanceChecked) { - featureProperties = findPropertiesForTimeSeries(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); - } - - // append feature name to legend - $scope.lineOption.legend.data.push(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); - - // create feature data series - var featureSeries = {}; - featureSeries.name = featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]; - featureSeries.type = 'line'; - featureSeries.data = new Array(); - - // for each date create series data entry for feature - for (var date of $scope.lineOption.xAxis.data) { - var value; - if (kommonitorDataExchangeService.indicatorValueIsNoData(featureProperties[INDICATOR_DATE_PREFIX + date])) { - value = null; - } - else { - value = kommonitorDataExchangeService.getIndicatorValue_asNumber(featureProperties[INDICATOR_DATE_PREFIX + date]); - } - featureSeries.data.push(value); - } - - $scope.lineOption.series.push(featureSeries); - - $scope.lineChart.setOption($scope.lineOption); - setTimeout(function () { - $scope.lineChart.resize(); - }, 350); - }; - - var findPropertiesForTimeSeries = function (spatialUnitFeatureName) { - for (var feature of kommonitorDataExchangeService.selectedIndicator.geoJSON.features) { - if (feature.properties[__env.FEATURE_NAME_PROPERTY_NAME] == spatialUnitFeatureName) { - return feature.properties; - } - } - } - - var getSeriesIndexByFeatureName = function (featureName) { - for (var index = 0; index < $scope.lineOption.series.length; index++) { - if ($scope.lineOption.series[index].name === featureName) - return index; - } - - //return -1 if none was found - return -1; - }; - - var removeSeriesFromLineChart = function (featureProperties) { - // remove feature from legend - var legendIndex = $scope.lineOption.legend.data.indexOf(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); - if (legendIndex > -1) { - $scope.lineOption.legend.data.splice(legendIndex, 1); - } - - // remove feature data series - var seriesIndex = getSeriesIndexByFeatureName(featureProperties[__env.FEATURE_NAME_PROPERTY_NAME]); - if (seriesIndex > -1) { - $scope.lineOption.series.splice(seriesIndex, 1); - } - - // second parameter tells echarts to not merge options with previous data. hence really remove series from graphic - $scope.lineChart.setOption($scope.lineOption, true); - setTimeout(function () { - $scope.lineChart.resize(); - }, 350); - }; - - this.makeFeatureNameForPoiInIsochroneDiagram = function(poiGeoresource, geoJSONFeatureCollection, date){ - return poiGeoresource.datasetName + " - " + date + " (" + geoJSONFeatureCollection.features.length + ")"; - }; - - this.createInitialReachabilityAnalysisPieOptions = function(poiGeoresource, geoJSONFeatureCollection, rangeValue, date){ - var option = { - grid: { - left: '4%', - top: 0, - right: '4%', - bottom: 30, - containLabel: true - }, - title: { - text: 'Analyse Einzugsgebiet ' + rangeValue, - left: 'center', - show: false - // top: 15 - }, - toolbox: { - show: true, - right: '15', - feature: { - // mark : {show: true}, - dataView: { - show: kommonitorDataExchangeService.showDiagramExportButtons, readOnly: true, title: "Datenansicht", lang: ['Datenansicht - Punkte im Einzugsgebiet ' + rangeValue, 'schließen', 'refresh'], optionToContent: function (opt) { - - var poiData = opt.series[0].data; - - var dataTableId = "poiInIsochroneTable_" + Math.random(); - var tableExportName = opt.title[0].text; - - var htmlString = ''; - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - - htmlString += ""; - - for (var i = 0; i < poiData.length; i++) { - htmlString += ""; - htmlString += ""; - htmlString += ""; - htmlString += ""; - } - - htmlString += ""; - htmlString += "
        PunktlayerAnzahl Punkte im Einzugsgebiet
        " + poiData[i].name + "" + poiData[i].value + "
        "; - - $rootScope.$broadcast("AppendExportButtonsForTable", dataTableId, tableExportName); - - return htmlString; - } - }, - restore: { show: false, title: "Erneuern" }, - saveAsImage: { show: true, title: "Export", pixelRatio: 4 } - } - }, - tooltip: { - trigger: 'item', - formatter: '{a}
        {b}: {c} ({d}%)', - confine: true - }, - legend: { - orient: 'vertical', - type: "scroll", - left: 0, - data: [this.makeFeatureNameForPoiInIsochroneDiagram(poiGeoresource, geoJSONFeatureCollection, date)] - // data: [legendText] - }, - series: [ - { - name: "Punkte im Einzugsgebiet " + rangeValue, - type: 'pie', - radius: ['50%', '70%'], - center: ["70%", "50%"], - avoidLabelOverlap: true, - label: { - show: false, - position: 'center' - }, - - emphasis: { - label: { - show: true, - fontSize: '10', - // fontWeight: 'bold' - } - }, - labelLine: { - show: true - }, - data: [ - {value: geoJSONFeatureCollection.features.length, name: this.makeFeatureNameForPoiInIsochroneDiagram(poiGeoresource, geoJSONFeatureCollection, date)} - ] - } - ] - }; - - return option; - }; - - this.appendToReachabilityAnalysisOptions = function(poiGeoresource, geoJSONFeatureCollection, eChartsOptions, date){ - eChartsOptions.legend[0].data.push(this.makeFeatureNameForPoiInIsochroneDiagram(poiGeoresource, geoJSONFeatureCollection, date)); - eChartsOptions.series[0].data.push({value: geoJSONFeatureCollection.features.length, name: this.makeFeatureNameForPoiInIsochroneDiagram(poiGeoresource, geoJSONFeatureCollection, date)}); - - return eChartsOptions; - }; - - this.removePoiFromReachabilityAnalysisOption = function(eChartOptions, poiGeoresource){ - for (let index = 0; index < eChartOptions.legend[0].data.length; index++) { - const legendItem = eChartOptions.legend[0].data[index]; - if(legendItem.includes(poiGeoresource.datasetName)){ - eChartOptions.legend[0].data.splice(index, 1); - } - } - - for (let index2 = 0; index2 < eChartOptions.series[0].data.length; index2++) { - const dataItem = eChartOptions.series[0].data[index2]; - if(dataItem.name.includes(poiGeoresource.datasetName)){ - eChartOptions.series[0].data.splice(index2, 1); - } - } - - return eChartOptions; - }; - - this.makeTrendChartOptions_forAllFeatures = function(indicatorMetadataAndGeoJSON, fromDateAsPropertyString, toDateAsPropertyString, showMinMax, showCompleteTimeseries, computationType){ - // we may base on the the precomputed timeseries lineOptions and modify that from a cloned instance - - var timeseriesOptions = JSON.parse(JSON.stringify(this.getLineChartOptions())); - - // remove any additional lines for concrete features - timeseriesOptions.series.length = 3; - - // add markedAreas for periods out of scope - - var fromDateString = fromDateAsPropertyString.split(__env.indicatorDatePrefix)[1]; - var fromDate_date = new Date(fromDateString); - var toDateString = toDateAsPropertyString.split(__env.indicatorDatePrefix)[1]; - var toDate_date = new Date(toDateString); - - if(showCompleteTimeseries){ - timeseriesOptions.series[0].markArea = { - silent: true, - itemStyle: { - color: '#b50b0b', - opacity: 0.3 - }, - data: [[{ - xAxis: indicatorMetadataAndGeoJSON.applicableDates[0] - }, { - xAxis: fromDateString - }], - [{ - xAxis: toDateString - }, { - xAxis: indicatorMetadataAndGeoJSON.applicableDates[indicatorMetadataAndGeoJSON.applicableDates.length - 1] - }]] - }; - } - - // hide data points - timeseriesOptions.series[0].itemStyle.normal.opacity = 0; - timeseriesOptions.series[0].lineStyle.normal.width = 3; - timeseriesOptions.series[0].lineStyle.normal.type = "solid"; - - var trendData = []; - - var timeseriesData = timeseriesOptions.series[0].data; - var minSeriesData = timeseriesOptions.series[1].data; - var maxSeriesData = timeseriesOptions.series[2].data; - - if(! showCompleteTimeseries){ - var xData = []; - var timeData = []; - var minData = []; - var maxData = []; - for (let index = 0; index < timeseriesData.length; index++) { - var date_candidate = new Date(indicatorMetadataAndGeoJSON.applicableDates[index]); - if(date_candidate >= fromDate_date && date_candidate <= toDate_date){ - const value = timeseriesData[index]; - // const date = indicatorMetadataAndGeoJSON.applicableDates[index]; - - timeData.push(value); - xData.push(indicatorMetadataAndGeoJSON.applicableDates[index]); - minData.push(minSeriesData[index]); - maxData.push(maxSeriesData[index]); - } - } - - timeseriesOptions.series[0].data = timeData; - timeseriesOptions.series[1].data = minData; - timeseriesOptions.series[2].data = maxData; - - timeseriesOptions.xAxis.data = xData; - } - - // update value if it has changed - timeseriesData = timeseriesOptions.series[0].data; - var xAxisData = timeseriesOptions.xAxis.data; - for (let index = 0; index < timeseriesData.length; index++) { - var dateCandidate = new Date(xAxisData[index]); - if(dateCandidate >= fromDate_date && dateCandidate <= toDate_date){ - const value = timeseriesData[index]; - // const date = indicatorMetadataAndGeoJSON.applicableDates[index]; - - trendData.push([index, value]); - } - } - - // add regression line according to option - - var trendLine; - if (computationType.includes("linear")){ - trendLine = ecStat.regression('linear', trendData); - } - else if (computationType.includes("exponential")){ - trendLine = ecStat.regression('exponential', trendData); - } - else if (computationType.includes("polynomial_3")){ - trendLine = ecStat.regression('polynomial', trendData, 3); - } - else{ - trendLine = ecStat.regression('linear', trendData); - } - - timeseriesOptions.legend.data.push("Trendlinie"); - - timeseriesOptions.series.push({ - name: 'Trendlinie', - type: 'line', - showSymbol: false, - data: trendLine.points, - lineStyle: { - normal: { - color: 'red', - width: 4, - type: 'dashed' - } - }, - itemStyle: { - normal: { - borderWidth: 3, - color: 'red', - opacity: 0 - } - }, - markPoint: { - itemStyle: { - normal: { - color: 'transparent' - } - }, - // label: { - // normal: { - // show: true, - // position: 'left', - // formatter: trendLine.expression, - // textStyle: { - // color: '#333', - // fontSize: 14 - // } - // } - // }, - data: [{ - coord: trendLine.points[trendLine.points.length - 1] - }] - } - }); - - if(! showMinMax){ - timeseriesOptions.series.splice(1, 1); - timeseriesOptions.series.splice(1, 1); - } - - return timeseriesOptions; - }; - - // Returns an image. - // Attribution has to be converted to an image anyway for report generation. - this.createReportingReachabilityMapAttribution = async function() { - let attributionText = "Leaflet | Map data @ OpenStreetMap contributors" - let canvas = document.createElement("canvas") - canvas.width = 800; - let ctx = canvas.getContext('2d') - ctx.font = "8pt Arial"; - ctx.textBaseline = 'top'; - ctx.fillStyle = "rgb(60, 60, 60)"; - ctx.fillText(attributionText, 0, 0); - canvas = trimCanvas(canvas, 5) - - let image = new Image(canvas.width, canvas.height) - image.style.backgroundColor = "white"; - return await new Promise( (resolve, reject) => { - image.onload = function() { - resolve(image); - } - image.src = canvas.toDataURL(); - }); - } - - // Returns an image. - // Legend has to be converted to an image anyway for report generation. - this.createReportingReachabilityMapLegend = async function(echartsOptions, selectedSpatialUnit, isochronesRangeType, isochronesRangeUnits) { - let legendEntries = []; - let isochronesHeadingAdded = false; - for(let i=0; i { - return entry.isIsochroneEntry - }); - // layer isochrone icons on top of each other unitl we reach the current one - for(let isochroneEntry of isochroneEntries.reverse()) { - if(isochroneEntry === entry) { - break; - } - ctx.fillStyle = isochroneEntry.iconColor; - ctx.globalAlpha = isochroneEntry.iconOpacity; - ctx.fillRect(xPos, yPos + ( (12-entry.iconHeight) / 2), iconWidth, isochroneEntry.iconHeight) - ctx.globalAlpha = 1; - } - } - - ctx.fillStyle = entry.iconColor; - ctx.globalAlpha = entry.iconOpacity ? entry.iconOpacity : 1; - ctx.fillRect(xPos, yPos + ( (12-entry.iconHeight) / 2), iconWidth, entry.iconHeight) - ctx.globalAlpha = 1; - // and label - ctx.font = fontStyle; - ctx.fillStyle = "black"; - ctx.textBaseline = "top"; - if(entry.isIsochroneEntry) { - let text = entry.label + " " + isochronesRangeUnits - ctx.fillText(text, xPos + iconWidth + 5, yPos) - } else { - ctx.fillText(entry.label, xPos + iconWidth + 5, yPos) - } - yPos += rowHeight - } - } - - canvas = trimCanvas(canvas, 5) - let image = new Image(canvas.width, canvas.height) - image.style.backgroundColor = "white"; - return await new Promise( (resolve, reject) => { - image.onload = function() { - resolve(image); - } - image.src = canvas.toDataURL(); - }); - } - - var calculateOverallBoundingBoxFromGeoJSON = function(features) { - let result = []; - for(var i=0; i result[2]) ? bbox[2] : result[2]; - result[3] = (bbox[3] > result[3]) ? bbox[3] : result[3]; - } - } - return result; - }; - - function trimCanvas(canvas, padding=0) { - function rowBlank(imageData, width, y) { - for (var x = 0; x < width; ++x) { - if (imageData.data[y * width * 4 + x * 4 + 3] !== 0) return false; - } - return true; - } - - function columnBlank(imageData, width, x, top, bottom) { - for (var y = top; y < bottom; ++y) { - if (imageData.data[y * width * 4 + x * 4 + 3] !== 0) return false; - } - return true; - } - - - var ctx = canvas.getContext("2d"); - var width = canvas.width; - var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height); - var top = 0, bottom = imageData.height, left = 0, right = imageData.width; - - while (top < bottom && rowBlank(imageData, width, top)) ++top; - while (bottom - 1 > top && rowBlank(imageData, width, bottom - 1)) --bottom; - while (left < right && columnBlank(imageData, width, left, top, bottom)) ++left; - while (right - 1 > left && columnBlank(imageData, width, right - 1, top, bottom)) --right; - - var trimmed = ctx.getImageData(left, top, right - left, bottom - top); - var copy = canvas.ownerDocument.createElement("canvas"); - var copyCtx = copy.getContext("2d"); - copy.width = trimmed.width + padding*2; - copy.height = trimmed.height + padding*2; - copyCtx.putImageData(trimmed, padding, padding); - - return copy; - }; - - }]); diff --git a/app/util/genericServices/kommonitorElementVisibilityHelperService/kommonitor-element-visibility-helper-service.module.ts b/app/util/genericServices/kommonitorElementVisibilityHelperService/kommonitor-element-visibility-helper-service.module.ts deleted file mode 100644 index ad6c12cf1..000000000 --- a/app/util/genericServices/kommonitorElementVisibilityHelperService/kommonitor-element-visibility-helper-service.module.ts +++ /dev/null @@ -1,114 +0,0 @@ - -/** - * a common serviceInstance that holds all needed properties for a WPS service. - * - * This service represents a shared object ´which is used across the different - * application tabs/components like Setup, Capabilities, Execute etc. - * - * This way, one single service instance can be used to easily share values and - * parameters for each WPS operation represented by different Angular components - */ -// Import required modules and interfaces -import { Injectable } from '@angular/core'; -import { ControlsConfigService } from '../kommonitorConfigStorageService/kommonitor-config-storage-service.module'; -import { kommonitorDataExchangeService } from '../kommonitorDataExchangeService/kommonitor-data-exchange-service.module' -import { kommonitorKeycloakHelperService } from '../kommonitorKeycloakHelperService/kommonitor-keycloak-helper-service.module''; - -// Define the Angular service -@Injectable({ - providedIn: 'root' -}) -export class KommonitorElementVisibilityHelperService { -const Auth; - elementVisibility: { [key: string]: boolean } = {}; - - isAdvancedMode = __env.isAdvancedMode; - showAdvancedModeSwitch = __env.showAdvancedModeSwitch; - advancedModeRoleName = "fakeAdvancedModeRole"; - - constructor( - private controlsConfigService: ControlsConfigService, - private auth: Auth, - private kommonitorDataExchangeService: kommonitorDataExchangeService, - private kommonitorKeycloakHelperService: kommonitorKeycloakHelperService - ) { - this.initElementVisibility(); - } - - initElementVisibility(): void { - this.kommonitorDataExchangeService.showDiagramExportButtons = true; - this.kommonitorDataExchangeService.showGeoresourceExportButtons = true; - - this.elementVisibility = {}; - const config = this.controlsConfigService.getControlsConfig(); - config.forEach(element => { - this.elementVisibility[element.id] = this.checkElementVisibility(element.id); - }); - } - - onChangeIsAdvancedMode(): void { - this.initElementVisibility(); - // if any sidebar was previously not displayed we must ensure that it is properly instantiated for the current indicator - $rootScope.$broadcast("changeIndicatorDate"); - } - - private checkElementVisibility(id: string): boolean { - const element = this.controlsConfigService.getControlsConfig().filter(element => element.id === id)[0]; - - if (element.roles === undefined || element.roles.length === 0) { - return true; - } else if (this.isAdvancedMode && element.roles && element.roles.includes(this.advancedModeRoleName)) { - return true; - } else if (this.auth.keycloak.authenticated) { - // admin role user always sees all data and widgets - if (this.auth.keycloak.showAdminView) { - return true; - } - let hasAllowedRole = false; - for (const role of element.roles) { - if (this.auth.keycloak.tokenParsed.realm_access.roles.includes(role)) { - return true; - } - } - - // special case for diagram export buttons - if (!hasAllowedRole && element.id === "diagramExportButtons") { - this.kommonitorDataExchangeService.showDiagramExportButtons = false; - } - // special case for georesource export buttons - if (!hasAllowedRole && element.id === "georesourceExportButtons") { - this.kommonitorDataExchangeService.showGeoresourceExportButtons = false; - } - - return hasAllowedRole; - } else { - if (!this.kommonitorDataExchangeService.enableKeycloakSecurity) { - if (element.roles && element.roles.includes(this.advancedModeRoleName)) { - - // special case for diagram export buttons - if (element.id === "diagramExportButtons") { - this.kommonitorDataExchangeService.showDiagramExportButtons = false; - } - // special case for georesource export buttons - if (element.id === "georesourceExportButtons") { - this.kommonitorDataExchangeService.showGeoresourceExportButtons = false; - } - - return false; - } - return true; - } else { - // special case for diagram export buttons - if (element.id === "diagramExportButtons") { - this.kommonitorDataExchangeService.showDiagramExportButtons = false; - } - // special case for georesource export buttons - if (element.id === "georesourceExportButtons") { - this.kommonitorDataExchangeService.showGeoresourceExportButtons = false; - } - - return false; - } - } - } -} diff --git a/app/util/genericServices/kommonitorElementVisibilityHelperService/kommonitor-element-visibility-helper-service.service.ts b/app/util/genericServices/kommonitorElementVisibilityHelperService/kommonitor-element-visibility-helper-service.service.ts new file mode 100644 index 000000000..93ccef89e --- /dev/null +++ b/app/util/genericServices/kommonitorElementVisibilityHelperService/kommonitor-element-visibility-helper-service.service.ts @@ -0,0 +1,53 @@ +import { Injectable } from '@angular/core'; +import { ControlsConfigService } from './ControlsConfigService'; // Import necessary services and dependencies + +@Injectable({ + providedIn: 'root' +}) +export class KommonitorElementVisibilityHelperService { + elementVisibility: any = {}; + isAdvancedMode = __env.isAdvancedMode; + showAdvancedModeSwitch = __env.showAdvancedModeSwitch; + advancedModeRoleName = 'fakeAdvancedModeRole'; + diagramExportButtonsVisible = true; + georesourceExportButtonsVisible = true; + + constructor( + private controlsConfigService: ControlsConfigService // Inject the required services + ) { + this.initElementVisibility(); + } + + private checkElementVisibility(id: string): boolean { + const element = this.controlsConfigService.getControlsConfig().find((element) => element.id === id); + + if (!element.roles || element.roles.length === 0) { + return true; + } else if (this.isAdvancedMode && element.roles && element.roles.includes(this.advancedModeRoleName)) { + return true; + } else { + // Implement the logic to check user roles and permissions + // Replace this with your actual authentication logic + // Example: return this.authService.hasPermission(element.roles); + return true; // Temporary value for demonstration purposes + } + } + + initElementVisibility(): void { + this.diagramExportButtonsVisible = true; + this.georesourceExportButtonsVisible = true; + + const config = this.controlsConfigService.getControlsConfig(); + + config.forEach((element) => { + this.elementVisibility[element.id] = this.checkElementVisibility(element.id); + }); + } + + onChangeIsAdvancedMode(): void { + this.initElementVisibility(); + // If any sidebar was previously not displayed, we must ensure that it is properly instantiated for the current indicator + // Replace this with your actual logic + // ... + } +} diff --git a/app/util/genericServices/kommonitorFilterHelperService/kommonitor-filter-helper-service.module.ts b/app/util/genericServices/kommonitorFilterHelperService/kommonitor-filter-helper-service.module.ts deleted file mode 100644 index 31c3719e1..000000000 --- a/app/util/genericServices/kommonitorFilterHelperService/kommonitor-filter-helper-service.module.ts +++ /dev/null @@ -1,181 +0,0 @@ -angular.module('kommonitorFilterHelper', []); - -angular - .module('kommonitorFilterHelper', ['kommonitorMap', 'kommonitorDataExchange']) - .service( - 'kommonitorFilterHelperService', ['$rootScope', '$timeout', '__env', 'kommonitorMapService', "kommonitorDataExchangeService", - function ($rootScope, $timeout, - __env, kommonitorMapService, kommonitorDataExchangeService) { - - var self = this; - - this.filteredIndicatorFeatureIds = new Map(); - this.selectedIndicatorFeatureIds = new Map(); - - this.completelyRemoveFilteredFeaturesFromDisplay = true; - - this.onChangeFilterBehaviourToggle = function(){ - this.performSpatialFilter(); - }; - - // FEATURE SELECTION - - this.featureIsCurrentlySelected = function(featureId){ - return this.selectedIndicatorFeatureIds.has("" + featureId); - }; - - this.clearSelectedFeatures = function(){ - this.selectedIndicatorFeatureIds = new Map(); - }; - - this.addFeatureToSelection = function(feature){ - if(feature.properties){ - this.selectedIndicatorFeatureIds.set("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME], feature); - } - else{ - this.selectedIndicatorFeatureIds.set("" + feature[__env.FEATURE_ID_PROPERTY_NAME], feature); - } - $rootScope.$broadcast("onAddedFeatureToSelection", this.selectedIndicatorFeatureIds); - }; - - this.removeFeatureFromSelection = function(featureId){ - this.selectedIndicatorFeatureIds.delete("" + featureId); - $rootScope.$broadcast("onRemovedFeatureFromSelection", this.selectedIndicatorFeatureIds); - }; - - - // FEATURE FILTER - - this.featureIsCurrentlyFiltered = function(featureId){ - return this.filteredIndicatorFeatureIds.has("" + featureId); - }; - - this.clearFilteredFeatures = function(){ - this.filteredIndicatorFeatureIds = new Map(); - }; - - this.applyRangeFilter = function(features, targetDateProperty, minFilterValue, maxFilterValue){ - if(!this.filteredIndicatorFeatureIds){ - this.filteredIndicatorFeatureIds = new Map(); - } - for (const feature of features) { - var value = +Number(feature.properties[targetDateProperty]).toFixed(__env.numberOfDecimals); - - if(value >= minFilterValue && value <= maxFilterValue){ - // feature must not be filtered - make sure it is not marked as filtered - if (this.filteredIndicatorFeatureIds.has("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME])){ - this.filteredIndicatorFeatureIds.delete("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME]); - } - } - else{ - // feature must be filtered - if (!this.filteredIndicatorFeatureIds.has("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME])){ - this.filteredIndicatorFeatureIds.set("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME], feature); - } - } - } - - // range filter should only display filtered items as filtered, not remove them totally, as this qould require either - // more complicated management of all features or direct update of range min/max values - kommonitorMapService.restyleCurrentLayer(); - - }; - - this.performSpatialFilter = function(){ - if(! this.completelyRemoveFilteredFeaturesFromDisplay){ - // kommonitorMapService.restyleCurrentLayer(); - if(kommonitorDataExchangeService.isBalanceChecked){ - kommonitorMapService.replaceIndicatorGeoJSON(kommonitorDataExchangeService.indicatorAndMetadataAsBalance, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, kommonitorDataExchangeService.selectedDate, false); - } - else{ - kommonitorMapService.replaceIndicatorGeoJSON(kommonitorDataExchangeService.selectedIndicator, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, kommonitorDataExchangeService.selectedDate, false); - } - } - else{ - this.filterAndReplaceDataset(); - } - - this.checkFeatureSelection(); - }; - - this.checkFeatureSelection = function(){ - // remove any selected items that are not visible in current filtered dataset - // only if features are fully removed from dataset - if(this.completelyRemoveFilteredFeaturesFromDisplay){ - let oldSelectionMap = this.selectedIndicatorFeatureIds; - - for (let key of this.selectedIndicatorFeatureIds.keys()) { - if (this.filteredIndicatorFeatureIds.has("" + key)){ - this.selectedIndicatorFeatureIds.delete("" + key); - } - } - } - - $rootScope.$broadcast("onRemovedFeatureFromSelection", this.selectedIndicatorFeatureIds); - }; - - this.filterAndReplaceDataset = function(){ - let indicatorMetadataAndGeoJSON; - if(kommonitorDataExchangeService.isBalanceChecked){ - let filteredIndicatorFeatures = kommonitorDataExchangeService.indicatorAndMetadataAsBalance.geoJSON.features.filter(feature => !self.filteredIndicatorFeatureIds.has("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME])); - - indicatorMetadataAndGeoJSON = JSON.parse(JSON.stringify(kommonitorDataExchangeService.indicatorAndMetadataAsBalance)); - indicatorMetadataAndGeoJSON.geoJSON.features = filteredIndicatorFeatures; - kommonitorMapService.replaceIndicatorGeoJSON(indicatorMetadataAndGeoJSON, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, kommonitorDataExchangeService.selectedDate, false); - - } - else{ - let filteredIndicatorFeatures = kommonitorDataExchangeService.selectedIndicator.geoJSON.features.filter(feature => !self.filteredIndicatorFeatureIds.has("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME])); - - indicatorMetadataAndGeoJSON = JSON.parse(JSON.stringify(kommonitorDataExchangeService.selectedIndicator)); - indicatorMetadataAndGeoJSON.geoJSON.features = filteredIndicatorFeatures; - kommonitorMapService.replaceIndicatorGeoJSON(indicatorMetadataAndGeoJSON, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, kommonitorDataExchangeService.selectedDate, false); - - } - - $rootScope.$broadcast("updateIndicatorValueRangeFilter", kommonitorDataExchangeService.selectedDate, indicatorMetadataAndGeoJSON); - $rootScope.$broadcast("updateMeasureOfValueBar", kommonitorDataExchangeService.selectedDate, indicatorMetadataAndGeoJSON); - }; - - this.applySpatialFilter_higherSpatialUnitFeatures = function(higherSpatialUnitFilterFeatureGeoJSON, targetFeatureNames){ - - // if(!this.filteredIndicatorFeatureIds){ - - // } - this.filteredIndicatorFeatureIds = new Map(); - - // manage map of filtered features - let targetHigherSpatialUnitFilterFeatures = higherSpatialUnitFilterFeatureGeoJSON.features.filter(feature => targetFeatureNames.includes(feature.properties[__env.FEATURE_NAME_PROPERTY_NAME])); - - for (const feature of kommonitorDataExchangeService.selectedIndicator.geoJSON.features) { - this.filteredIndicatorFeatureIds.set("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME], feature); - for (const higherSpatialUnitFeature of targetHigherSpatialUnitFilterFeatures) { - if(turf.booleanPointInPolygon(turf.pointOnFeature(feature), higherSpatialUnitFeature)){ - this.filteredIndicatorFeatureIds.delete("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME]); - break; - } - } - } - - // apply filter - this.performSpatialFilter(); - }; - - this.applySpatialFilter_currentSpatialUnitFeatures = function(targetFeatureNames){ - // if(!this.filteredIndicatorFeatureIds){ - - // } - this.filteredIndicatorFeatureIds = new Map(); - - // manage map of filtered features - for (const feature of kommonitorDataExchangeService.selectedIndicator.geoJSON.features) { - if(!targetFeatureNames.includes(feature.properties[__env.FEATURE_NAME_PROPERTY_NAME])){ - this.filteredIndicatorFeatureIds.set("" + feature.properties[__env.FEATURE_ID_PROPERTY_NAME], feature); - } - } - - // apply filter - this.performSpatialFilter(); - }; - - }]); diff --git a/app/util/genericServices/kommonitorImporterHelperService/kommonitor-importer-helper-service.module.ts b/app/util/genericServices/kommonitorImporterHelperService/kommonitor-importer-helper-service.module.ts deleted file mode 100644 index 66f177d46..000000000 --- a/app/util/genericServices/kommonitorImporterHelperService/kommonitor-importer-helper-service.module.ts +++ /dev/null @@ -1,730 +0,0 @@ -angular.module('kommonitorImporterHelper', ['kommonitorDataExchange']); - -/** - * a common serviceInstance that holds all needed properties for a WPS service. - * - * This service represents a shared object ´which is used across the different - * application tabs/components like Setup, Capabilities, Execute etc. - * - * This way, one single service instance can be used to easily share values and - * parameters for each WPS operation represented by different Angular components - */ -angular - .module('kommonitorImporterHelper', []) - .service( - 'kommonitorImporterHelperService', ['$rootScope', '$timeout', 'kommonitorDataExchangeService', '$http', '__env', - function ($rootScope, $timeout, - kommonitorDataExchangeService, $http, __env) { - - this.targetUrlToImporterService = __env.targetUrlToImporterService; - - this.availableConverters = undefined; - - this.availableDatasourceTypes = undefined; - - this.attributeMapping_attributeTypes = [ - { - displayName: "Text/String", - apiName: "string" - }, - { - displayName: "Ganzzahl", - apiName: "integer" - }, - { - displayName: "Gleitkommazahl", - apiName: "float" - }, - { - displayName: "Datum", - apiName: "date" - }, - ]; - - this.mappingConfigStructure = { - "converter": { - "encoding": "string", - "mimeType": "string", - "name": "string", - "parameters": [ - { - "name": "string", - "value": "string" - } - ], - "schema": "string" - }, - "dataSource": { - "parameters": [ - { - "name": "string", - "value": "string" - } - ], - "type": "FILE" // FILE|HTTP|INLINE - }, - "propertyMapping": { - "arisenFromProperty": "string", - "attributes": [ - { - "mappingName": "string", // target name - "name": "string", // source name - "type": "string" // dataType, [string|integer|float|date] - } - ], - "identifierProperty": "string", - "keepAttributes": true, // if true, then mapping under attributes is ignored and all attributes are imported with the same attribute name - "nameProperty": "string", - "validEndDateProperty": "string", - "validStartDateProperty": "string" - }, - "periodOfValidity":{ - "startDate": "yyyy-mm-tt", - "endDate": "yyyy-mm-tt" - } - }; - - this.mappingConfigStructure_indicator = { - "converter": { - "encoding": "string", - "mimeType": "string", - "name": "string", - "parameters": [ - { - "name": "string", - "value": "string" - } - ], - "schema": "string" - }, - "dataSource": { - "parameters": [ - { - "name": "string", - "value": "string" - } - ], - "type": "FILE" // FILE|HTTP|INLINE - }, - "propertyMapping": { - "attributeMappings": [ - { - "mappingName": "string", - "name": "string", - "type": "string" - } - ], - "spatialReferenceKeyProperty": "string", - "timeseriesMappings": [ - { - "indicatorValueProperty": "string", - "timestamp": "string", - "timestampProperty": "string" - } - ] - }, - "targetSpatialUnitName": "string" - }; - - this.converterDefinition_singleFeatureImport = { - "encoding": "UTF-8", - "mimeType": "application/geo+json", - "name": "GeoJSON", - "parameters": [ - { - "name": "CRS", - "value": "EPSG:4326" - } - ] - }; - - this.datasourceDefinition_singleFeatureImport = { - "parameters": [ - { - "name": "payload", - "value": "geojsonValue" - } - ], - "type": "INLINE" - }; - - this.propertyMappingDefinition_singleFeatureImport = { - "identifierProperty": "ID", - "nameProperty": "NAME", - "keepAttributes": true, - "keepMissingOrNullValueAttributes": true, - "attributes": [] - }; - - this.fetchResourcesFromImporter = async function(){ - console.log("Trying to fetch converters and datasourceTypes from importer service"); - this.availableConverters = await this.fetchConverters(); - this.availableDatasourceTypes = await this.fetchDatasourceTypes(); - - if(! this.availableConverters || ! this.availableDatasourceTypes){ - - kommonitorDataExchangeService.displayMapApplicationError("Notwendige Anbindung an Importer-Service ist fehlerhaft. Bitte wenden Sie sich an Ihren Administrator."); - - return; - } - - for (let index = 0; index < this.availableConverters.length; index++) { - var converter = this.availableConverters[index]; - - converter = await this.fetchConverterDetails(converter); - this.availableConverters[index] = converter; - } - - for (let k = 0; k < this.availableDatasourceTypes.length; k++) { - this.availableDatasourceTypes[k] = await this.fetchDatasourceTypeDetails(this.availableDatasourceTypes[k]); - } - - setTimeout(() => { - $rootScope.$apply(); - }, 1500); - - }; - - this.filterConverters = function(resourceType) { - // remove csvLatLon for indicators - // and csv_onlyIndicator for georesources - return function (converter) { - if(resourceType === "georesource" && converter.name.includes("Indikator")) - return false; - if(resourceType === "spatialUnit" && (converter.name.includes("Indikator") || converter.name.includes("Tabelle"))) - return false; - if(resourceType === "indicator" && (converter.name.includes("Geokodierung") || converter.name.includes("Koordinate")) ) - return false; - - return true; - }; - }; - - this.fetchConverters = async function(){ - return await $http({ - url: this.targetUrlToImporterService + "converters", - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while fetching converters from importer."); - kommonitorDataExchangeService.displayMapApplicationError(error); - - }); - }; - - this.fetchConverterDetails = async function(converter){ - return await $http({ - url: this.targetUrlToImporterService + "converters/" + converter.name, - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(response) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while fetching converter for name '" + converter.name + "' from importer."); - - }); - }; - - this.fetchDatasourceTypes = async function(){ - return await $http({ - url: this.targetUrlToImporterService + "datasourceTypes", - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while fetching datasourceTypes from importer."); - kommonitorDataExchangeService.displayMapApplicationError(error); - }); - }; - - this.fetchDatasourceTypeDetails = async function(datasourceType){ - return await $http({ - url: this.targetUrlToImporterService + "datasourceTypes/" + datasourceType.type, - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(response) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while fetching datasourceType for type '" + datasource.type + "' from importer."); - }); - }; - - // load data - this.fetchResourcesFromImporter(); - - - this.uploadNewFile = async function(fileData, fileName){ - console.log("Trying to POST to importer service to upload a new file."); - - var formdata = new FormData(); - formdata.append("filename", fileName); - formdata.append("file", fileData); - - return await $http({ - url: this.targetUrlToImporterService + "upload", - method: "POST", - data: formdata, - // must set header content-type to undefined in order to send as multipart-formdata - headers: {"Content-Type": undefined, "Accept": "text/plain" }, - responseType: 'text' - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(response) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while posting to importer service."); - throw response; - }); - }; - - this.buildConverterDefinition = function(selectedConverter, converterParameterPrefix, schema, mimeType){ - var converterDefinition = { - "encoding": selectedConverter.encodings[0], - "mimeType": selectedConverter.mimeTypes.filter(element => element == mimeType)[0], - "name": selectedConverter.name, - "parameters": [ - - ], - "schema": undefined - }; - - if(selectedConverter.schemas){ - if (schema === undefined || schema === null){ - return null; - } - else{ - converterDefinition.schema = schema; - } - } - - if(selectedConverter.parameters.length > 0){ - for (const parameter of selectedConverter.parameters) { - var parameterName = parameter.name; - var parameterValue = $("#" + converterParameterPrefix + parameterName).val(); - - if(parameter.mandatory){ - - } - - if (parameter.mandatory && (parameterValue === undefined || parameterValue === null || parameterValue === "")){ - return null; - } - else{ - if(parameterValue && !(parameterValue === "")){ - converterDefinition.parameters.push({ - "name": parameterName, - "value": parameterValue - }); - } - - } - } - } - - return converterDefinition; - }; - - this.buildDatasourceTypeDefinition = async function(selectedDatasourceType, datasourceTypeParameterPrefix, datasourceFileInputId){ - var datasourceTypeDefinition = { - "parameters": [ - - ], - "type": selectedDatasourceType.type - }; - - if(selectedDatasourceType.type === "FILE"){ - // get file if present - - // upload it to importer - - // use file reference name for datasourceType definition - - - var file = document.getElementById(datasourceFileInputId).files[0]; - - if(file === null || file === undefined){ - return null; - } - - var fileUploadName; - try { - fileUploadName = await this.uploadNewFile(file, file.name); - } catch (error) { - console.error("Error while uploading file to importer."); - console.error(error); - kommonitorDataExchangeService.displayMapApplicationError(error); - throw error; - } - - datasourceTypeDefinition.parameters.push({ - "name": "NAME", - "value": fileUploadName - }); - } - else{ - if(selectedDatasourceType.parameters.length > 0){ - for (const parameter of selectedDatasourceType.parameters) { - var parameterName = parameter.name; - var parameterValue = $("#" + datasourceTypeParameterPrefix + parameterName).val(); - - if (parameterValue === undefined || parameterValue === null){ - return null; - } - else{ - datasourceTypeDefinition.parameters.push({ - "name": parameterName, - "value": parameterValue - }); - } - } - } - } - - return datasourceTypeDefinition; - }; - - this.buildPutBody_georesources = function(scopeProperties) { - - var putBody = - { - "geoJsonString": "", - "periodOfValidity": { - "endDate": scopeProperties.periodOfValidity.endDate, - "startDate": scopeProperties.periodOfValidity.startDate - }, - "isPartialUpdate": scopeProperties.isPartialUpdate - }; - - return putBody; - } - - this.buildPutBody_indicators = function(scopeProperties){ - - var putBody = - { - "indicatorValues": [], - "applicableSpatialUnit": scopeProperties.targetSpatialUnitMetadata.spatialUnitLevel, - "defaultClassificationMapping": scopeProperties.currentIndicatorDataset.defaultClassificationMapping, - "allowedRoles": scopeProperties.allowedRoles - }; - - return putBody; - }; - - this.buildPropertyMapping_spatialResource = function(nameProperty, idPropety, validStartDateProperty, validEndDateProperty, arisenFromProperty, keepAttributes, keepMissingValues, attributeMappings_adminView){ - if(validStartDateProperty === ""){ - validStartDateProperty = undefined; - } - if(validEndDateProperty === ""){ - validEndDateProperty = undefined; - } - if(arisenFromProperty === ""){ - arisenFromProperty = undefined; - } - - var propertyMapping = { - "arisenFromProperty": arisenFromProperty, - "identifierProperty": idPropety, - "nameProperty": nameProperty, - "validEndDateProperty": validEndDateProperty, - "validStartDateProperty": validStartDateProperty, - "keepAttributes": keepAttributes, - "keepMissingOrNullValueAttributes": keepMissingValues, - "attributes": [] - }; - - if (! keepAttributes){ - // add attribute mappings - attributeMappings_adminView.forEach(attributeMapping_adminView => { - propertyMapping.attributes.push({ - name: attributeMapping_adminView.sourceName, - mappingName: attributeMapping_adminView.destinationName, - type: attributeMapping_adminView.dataType.apiName - }); - }); - } - - return propertyMapping; - - }; - - this.buildPropertyMapping_indicatorResource = function(spatialReferenceKeyProperty, timeseriesMappings, keepMissingOrNullValueIndicator){ - console.log(spatialReferenceKeyProperty); - console.log(timeseriesMappings); - console.log(keepMissingOrNullValueIndicator); - // attributeMapping is undefined for indicators - return { - "spatialReferenceKeyProperty": spatialReferenceKeyProperty, - "timeseriesMappings": timeseriesMappings, - "keepMissingOrNullValueIndicator": keepMissingOrNullValueIndicator, - "attributeMappings": undefined - }; - }; - - this.registerNewSpatialUnit = async function(converterDefinition, datasourceTypeDefinition, propertyMappingDefinition, spatiaUnitPostBody_managementAPI, isDryRun){ - console.log("Trying to POST to importer service to register new spatial unit."); - - var postBody = { - "converter": converterDefinition, - "dataSource": datasourceTypeDefinition, - "propertyMapping": propertyMappingDefinition, - "spatialUnitPostBody": spatiaUnitPostBody_managementAPI, - "dryRun": isDryRun - }; - - return await $http({ - url: this.targetUrlToImporterService + "spatial-units", - method: "POST", - data: postBody, - headers: { - 'Content-Type': "application/json" - } - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(response) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while posting to importer service."); - throw response; - }); - }; - - this.updateSpatialUnit = async function(converterDefinition, datasourceTypeDefinition, propertyMappingDefinition, spatialUnitId, spatialUnitPutBody_managementAPI, isDryRun){ - console.log("Trying to POST to importer service to update spatial unit with id '" + spatialUnitId + "'."); - - var postBody = { - "converter": converterDefinition, - "dataSource": datasourceTypeDefinition, - "propertyMapping": propertyMappingDefinition, - "spatialUnitId": spatialUnitId, - "spatialUnitPutBody": spatialUnitPutBody_managementAPI, - "dryRun": isDryRun - }; - - return await $http({ - url: this.targetUrlToImporterService + "spatial-units/update", - method: "POST", - data: postBody, - headers: { - 'Content-Type': "application/json" - } - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(response) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while posting to importer service."); - throw response; - }); - }; - - - - this.registerNewGeoresource = async function(converterDefinition, datasourceTypeDefinition, propertyMappingDefinition, georesourcePostBody_managementAPI, isDryRun){ - console.log("Trying to POST to importer service to register new georesource."); - - var postBody = { - "converter": converterDefinition, - "dataSource": datasourceTypeDefinition, - "propertyMapping": propertyMappingDefinition, - "georesourcePostBody": georesourcePostBody_managementAPI, - "dryRun": isDryRun - }; - - return await $http({ - url: this.targetUrlToImporterService + "georesources", - method: "POST", - data: postBody, - headers: { - 'Content-Type': "application/json" - } - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(response) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while posting to importer service."); - throw response; - }); - }; - - this.updateGeoresource = async function(converterDefinition, datasourceTypeDefinition, propertyMappingDefinition, georesourceId, georesourcePutBody_managementAPI, isDryRun){ - console.log("Trying to POST to importer service to update georesource with id '" + georesourceId + "'."); - - var postBody = { - "converter": converterDefinition, - "dataSource": datasourceTypeDefinition, - "propertyMapping": propertyMappingDefinition, - "georesourceId": georesourceId, - "georesourcePutBody": georesourcePutBody_managementAPI, - "dryRun": isDryRun - }; - - return await $http({ - url: this.targetUrlToImporterService + "georesources/update", - method: "POST", - data: postBody, - headers: { - 'Content-Type': "application/json" - } - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(response) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while posting to importer service."); - throw response; - }); - }; - - - - this.registerNewIndicator = async function(converterDefinition, datasourceTypeDefinition, propertyMappingDefinition, indicatorPostBody_managementAPI, isDryRun){ - console.log("Trying to POST to importer service to register new indicator."); - - var postBody = { - "converter": converterDefinition, - "dataSource": datasourceTypeDefinition, - "propertyMapping": propertyMappingDefinition, - "indicatorPostBody": indicatorPostBody_managementAPI, - "dryRun": isDryRun - }; - - return await $http({ - url: this.targetUrlToImporterService + "indicators", - method: "POST", - data: postBody, - headers: { - 'Content-Type': "application/json" - } - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(response) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while posting to importer service."); - throw response; - }); - }; - - this.updateIndicator = async function(converterDefinition, datasourceTypeDefinition, propertyMappingDefinition, indicatorId, indicatorPutBody_managementAPI, isDryRun){ - console.log("Trying to POST to importer service to update indicator with id '" + indicatorId + "'."); - - var postBody = { - "converter": converterDefinition, - "dataSource": datasourceTypeDefinition, - "propertyMapping": propertyMappingDefinition, - "indicatorId": indicatorId, - "indicatorPutBody": indicatorPutBody_managementAPI, - "dryRun": isDryRun - }; - - return await $http({ - url: this.targetUrlToImporterService + "indicators/update", - method: "POST", - data: postBody, - headers: { - 'Content-Type': "application/json" - } - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(response) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while posting to importer service."); - throw response; - }); - }; - - this.importerResponseContainsErrors = function (importerResponse){ - if (importerResponse.errors && importerResponse.errors.length > 0){ - return true; - } - return false; - }; - - this.getIdFromImporterResponse = function (importerResponse){ - if (importerResponse.uri){ - return importerResponse.uri; - } - return undefined; - }; - - this.getErrorsFromImporterResponse = function (importerResponse){ - if (importerResponse.errors){ - return importerResponse.errors; - } - return undefined; - }; - - this.getImportedFeaturesFromImporterResponse = function (importerResponse){ - if (importerResponse.importedFeatures){ - return importerResponse.importedFeatures; - } - return undefined; - }; - - - }]); diff --git a/app/util/genericServices/kommonitorInfoLegendHelperService/kommonitor-info-legend-helper-service.module.ts b/app/util/genericServices/kommonitorInfoLegendHelperService/kommonitor-info-legend-helper-service.module.ts deleted file mode 100644 index 9f1bb46a3..000000000 --- a/app/util/genericServices/kommonitorInfoLegendHelperService/kommonitor-info-legend-helper-service.module.ts +++ /dev/null @@ -1,21 +0,0 @@ -angular.module('kommonitorInfoLegendHelper', ['kommonitorDataExchange']); - -/** - * a common serviceInstance that holds all needed properties for a WPS service. - * - * This service represents a shared object ´which is used across the different - * application tabs/components like Setup, Capabilities, Execute etc. - * - * This way, one single service instance can be used to easily share values and - * parameters for each WPS operation represented by different Angular components - */ -angular - .module('kommonitorInfoLegendHelper', []) - .service( - 'kommonitorInfoLegendHelperService', ['$rootScope', '$timeout', 'kommonitorDataExchangeService', '$http', '__env', - function ($rootScope, $timeout, - kommonitorDataExchangeService, $http, __env) { - - - - }]); diff --git a/app/util/genericServices/kommonitorKeycloakHelperService/kommonitor-keycloak-helper-service.module.ts b/app/util/genericServices/kommonitorKeycloakHelperService/kommonitor-keycloak-helper-service.module.ts deleted file mode 100644 index 9b8049394..000000000 --- a/app/util/genericServices/kommonitorKeycloakHelperService/kommonitor-keycloak-helper-service.module.ts +++ /dev/null @@ -1,283 +0,0 @@ -angular.module('kommonitorKeycloakHelper', ['kommonitorDataExchange']); - -angular - .module('kommonitorKeycloakHelper', []) - .service( - 'kommonitorKeycloakHelperService', ['$rootScope', '$timeout', '$http', '$httpParamSerializerJQLike', 'Auth', '__env', - function ($rootScope, $timeout, $http, $httpParamSerializerJQLike, Auth, __env) { - - var self = this; - this.availableKeycloakRoles = []; - this.targetUrlToKeycloakInstance = ""; - this.targetRealmUrlToKeycloakInstance = ""; - this.realm = ""; - this.clientId = ""; - - this.roleSuffixes = ["viewer", "editor", "publisher", "creator"]; - - this.init = async function () { - try { - if (window.__env.keycloakConfig) { - this.configureKeycloakParameters(window.__env.keycloakConfig); - } - else { - await $http.get('./config/keycloak_backup.json').then(async function (response) { - self.configureKeycloakParameters(response.data); - }); - } - } catch (error) { - console.error("Error while initializing kommonitorKeycloakHelperService. Error while fetching and interpreting config file. Error is: " + error); - } - }; - - this.configureKeycloakParameters = function (keycloakConfig) { - // // https:///auth/ - self.targetUrlToKeycloakInstance = keycloakConfig['auth-server-url']; - self.realm = keycloakConfig['realm']; - self.clientId = keycloakConfig['resource']; - - // https:///auth/admin//console - self.targetRealmUrlToKeycloakInstance = self.targetUrlToKeycloakInstance + "admin/" + self.realm + "/console"; - }; - - this.fetchRoles = async function () { - - console.log = "Fetching roles from Keycloak instance at " + this.targetUrlToKeycloakInstance; - return await $http({ - url: this.targetUrlToKeycloakInstance + this.realm + "/clients/" + this.clientId + "/roles", - method: "GET" - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while fetching roles from keycloak."); - - }); - }; - - this.postNewRole_withToken = async function (bearerToken, rolesBody) { - - return await $http({ - url: this.targetUrlToKeycloakInstance + "admin/realms/" + this.realm + "/roles", - method: 'POST', - data: rolesBody, - headers: { - 'Content-Type': 'application/json', - 'Authorization': "Bearer " + bearerToken // Note the appropriate header - } - }).then(function successCallback(response) { - // return created response location - return response.data; - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while posting role to keycloak."); - throw error; - }); - }; - - this.renameExistingRole_withToken = async function (bearerToken, oldRoleName, newRoleName) { - var rolesBody = { - "name": newRoleName - }; - - return await $http({ - url: this.targetUrlToKeycloakInstance + "admin/realms/" + this.realm + "/roles/" + oldRoleName, - method: 'PUT', - data: rolesBody, - headers: { - 'Content-Type': 'application/json', - 'Authorization': "Bearer " + bearerToken // Note the appropriate header - } - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while posting role to keycloak."); - throw error; - - }); - }; - - this.deleteRole_withToken = async function (bearerToken, roleName) { - - return await $http({ - url: this.targetUrlToKeycloakInstance + "admin/realms/" + this.realm + "/roles/" + roleName, - method: 'DELETE', - headers: { - 'Authorization': "Bearer " + bearerToken // Note the appropriate header - } - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while deleting role from keycloak."); - throw error; - - }); - }; - - this.getAllRoles_withToken = async function (bearerToken) { - - return await $http({ - url: this.targetUrlToKeycloakInstance + "admin/realms/" + this.realm + "/roles", - method: 'GET', - headers: { - 'Authorization': "Bearer " + bearerToken // Note the appropriate header - } - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while adding role to keycloak."); - throw error; - - }); - }; - - this.addCompositeRole_withToken = async function (bearerToken, baseRole, composite) { - let data = [{ - "id": composite.id, - "name": composite.name - }]; - return await $http({ - url: this.targetUrlToKeycloakInstance + "admin/realms/" + this.realm + "/roles/" + baseRole.name + "/composites", - method: 'POST', - data: data, - headers: { - 'Authorization': "Bearer " + bearerToken // Note the appropriate header - } - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - return response.data; - }, function errorCallback(error) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while creating composite role in keycloak."); - throw error; - }); - } - - this.postNewRoles = async function (organizationalUnitName) { - try { - // get auth token to make admin requests - var bearerToken = Auth.keycloak.token; - - // post individual roles - for (let suffix of this.roleSuffixes) { - // post individual role - await this.postNewRole_withToken(bearerToken, { "name": organizationalUnitName + "-" + suffix }); - } - const allRoles = await this.getAllRoles_withToken(bearerToken); - var roleMap = allRoles.filter(role => role.name.startsWith(organizationalUnitName + "-")) - .reduce((prev, curr) => (prev[curr.name] = curr, prev), {}); - - // Add composites - await this.addCompositeRole_withToken( - bearerToken, - roleMap[organizationalUnitName + "-editor"], - roleMap[organizationalUnitName + "-viewer"] - ); - await this.addCompositeRole_withToken( - bearerToken, - roleMap[organizationalUnitName + "-publisher"], - roleMap[organizationalUnitName + "-editor"] - ); - await this.addCompositeRole_withToken( - bearerToken, - roleMap[organizationalUnitName + "-creator"], - roleMap[organizationalUnitName + "-publisher"] - ); - } catch (error) { - throw error; - } - }; - - this.renameExistingRoles = async function (oldOrganizationalUnitName, newOrganizationalUnitName) { - try { - // first get auth token to make admin requests - var bearerToken = Auth.keycloak.token; - - for (let suffix of this.roleSuffixes) { - await this.renameExistingRole_withToken(bearerToken, oldOrganizationalUnitName + "-" + suffix, newOrganizationalUnitName + "-" + suffix); - } - } catch (error) { - throw error; - } - - }; - - this.deleteRoles = async function (organizationalUnitName) { - try { - // first get auth token to make admin requests - var bearerToken = Auth.keycloak.token; - - for (let suffix of this.roleSuffixes) { - await this.deleteRole_withToken(bearerToken, organizationalUnitName + "-" + suffix); - } - } catch (error) { - throw error; - } - }; - - this.getAllRoles = async function () { - try { - // first get auth token to make admin requests - var bearerToken = Auth.keycloak.token; - - // then make admin request - return await this.getAllRoles_withToken(bearerToken); - } catch (error) { - throw error; - } - - }; - - this.setAvailableKeycloakRoles = function (roles) { - this.availableKeycloakRoles = roles; - }; - - this.fetchAndSetKeycloakRoles = async function (username, password) { - this.setAvailableKeycloakRoles(await this.getAllRoles(username, password)); - }; - - this.isRoleInKeycloak = function (roleName) { - for (const keycloakRole of this.availableKeycloakRoles) { - if (keycloakRole.name === roleName) { - return true; - } - } - return false; - }; - - var self = this; - this.init(); - - }]); diff --git a/app/util/genericServices/kommonitorMultiStepFormHelperService/kommonitor-multi-step-form-helper-service.module.ts b/app/util/genericServices/kommonitorMultiStepFormHelperService/kommonitor-multi-step-form-helper-service.module.ts deleted file mode 100644 index f97d6d1e3..000000000 --- a/app/util/genericServices/kommonitorMultiStepFormHelperService/kommonitor-multi-step-form-helper-service.module.ts +++ /dev/null @@ -1,166 +0,0 @@ -angular.module('kommonitorMultiStepFormHelper', ['kommonitorSingleFeatureMapHelper']); - -angular - .module('kommonitorMultiStepFormHelper', []) - .service( - 'kommonitorMultiStepFormHelperService', [ - '$http', '__env', '$timeout', 'kommonitorSingleFeatureMapHelperService', - function ($http, __env, $timeout, kommonitorSingleFeatureMapHelperService) { - - /* - MULTI STEP FORM STUFF - */ - //jQuery time - this.current_fs; - this.next_fs; - this.previous_fs; //fieldsets - this.opacity; - this.scale; //fieldset properties which we will animate - this.animating; //flag to prevent quick multi-click glitches - - let self = this; - - this.registerClickHandler = function(){ - this.registerNextButtonClick(); - this.registerPreviousButtonClick(); - this.registerProgressBarItemClick(); - }; - - this.registerProgressBarItemClick = function(){ - $timeout(function(){ - $("#progressbar > li").click(function(){ - let newIndex = $("#progressbar > li").index(this); - let oldIndex; - let allFs = $($(this).parent().parent().parent().children("fieldset")); - let activeFs; - - for (const fsCandidate of allFs) { - if(fsCandidate.style["display"] != "none"){ - activeFs = fsCandidate; - break; - } - } - oldIndex = $("fieldset").index(activeFs); - - self.current_fs = $($("fieldset").get(oldIndex)); - - - if(newIndex == oldIndex){ - return; - } - else if(newIndex < oldIndex){ - - self.previous_fs = $($("fieldset").get(newIndex)); - - //de-activate current step on progressbar - for (let index = oldIndex; index > newIndex; index--) { - $($("#progressbar > li").get(index)).removeClass("active"); - } - - //show the previous fieldset - self.previous_fs.show(); - - self.previous_fs.css({ - 'position': 'relative' - }); - self.current_fs.css({ - 'position': 'absolute' - }); - - self.current_fs.hide(); - } - else { - self.animating = true; - self.next_fs = $($("fieldset").get(newIndex)); - - //activate next step on progressbar using the index of self.next_fs - for (let index = oldIndex; index <= newIndex; index++) { - $($("#progressbar > li").get(index)).addClass("active"); - } - - //show the next fieldset - self.next_fs.show(); - - self.next_fs.css({ - 'position': 'relative' - }); - self.current_fs.css({ - 'position': 'absolute' - }); - - self.current_fs.hide(); - } - - // should any page be shown, where there is a single feature edit map then we must ensure that content is zoomed to - kommonitorSingleFeatureMapHelperService.invalidateMap(); - kommonitorSingleFeatureMapHelperService.zoomToDataLayer(); - }); - - }, 500); - }; - - - this.registerNextButtonClick = function(){ - $timeout(function(){ - - $(".next").click(function(){ - - self.current_fs = $(this).parent(); - self.next_fs = $(this).parent().next(); - - //activate next step on progressbar using the index of self.next_fs - $("#progressbar li").eq($("fieldset").index(self.next_fs)).addClass("active"); - - //show the next fieldset - self.next_fs.show(); - - self.next_fs.css({ - 'position': 'relative' - }); - self.current_fs.css({ - 'position': 'absolute' - }); - - self.current_fs.hide(); - - // should any page be shown, where there is a single feature edit map then we must ensure that content is zoomed to - kommonitorSingleFeatureMapHelperService.invalidateMap(); - kommonitorSingleFeatureMapHelperService.zoomToDataLayer(); - }); - - }, 500); - }; - - this.registerPreviousButtonClick = function(){ - $timeout(function(){ - - $(".previous").click(function(){ - - self.current_fs = $(this).parent(); - self.previous_fs = $(this).parent().prev(); - - //de-activate current step on progressbar - $("#progressbar li").eq($("fieldset").index(self.current_fs)).removeClass("active"); - - //show the previous fieldset - self.previous_fs.show(); - self.previous_fs.css({ - 'position': 'relative' - }); - self.current_fs.css({ - 'position': 'absolute' - }); - self.current_fs.hide(); - - // should any page be shown, where there is a single feature edit map then we must ensure that content is zoomed to - kommonitorSingleFeatureMapHelperService.invalidateMap(); - kommonitorSingleFeatureMapHelperService.zoomToDataLayer(); - }); - - }, 500); - }; - - - - - }]); diff --git a/app/util/genericServices/kommonitorScriptHelperService/kommonitor-script-helper-service.module.ts b/app/util/genericServices/kommonitorScriptHelperService/kommonitor-script-helper-service.module.ts deleted file mode 100644 index d1fcef1cb..000000000 --- a/app/util/genericServices/kommonitorScriptHelperService/kommonitor-script-helper-service.module.ts +++ /dev/null @@ -1,495 +0,0 @@ -angular.module('kommonitorScriptHelper', ['kommonitorDataExchange']); - -angular - .module('kommonitorScriptHelper', []) - .service( - 'kommonitorScriptHelperService', ['$rootScope', '$timeout', 'kommonitorDataExchangeService', '$http', '__env', - function ($rootScope, $timeout, - kommonitorDataExchangeService, $http, __env) { - - var self = this; - - this.targetUrlToManagementService = __env.apiUrl + __env.basePath + "/"; - - this.availableScriptDataTypes = [ - { - "displayName": "Textuell (String)", - "apiName": "string" - }, - { - "displayName": "Wahrheitswert (Boolean)", - "apiName": "boolean" - }, - { - "displayName": "Ganzzahl (Integer)", - "apiName": "integer" - }, - { - "displayName": "Gleitkommazahl (Double)", - "apiName": "double" - } - ]; - - this.availableScriptTypeOptions = [ - { - "displayName": "Generische Definition", - "apiName": "generic" - }, - { - "displayName": "Indikatoren - Summe aller Indikatoren", - "apiName": "indicator_sum" - }, - { - "displayName": "Indikatoren - Subtraktion von Basis-Indikatoren von einem Referenzindikator", - "apiName": "indicator_subtract" - }, - { - "displayName": "Indikatoren - Prozentualer Anteil (Quotient zwischen Basis-Indikatoren und einem Referenzindikator)", - "apiName": "indicator_percentage" - }, - { - "displayName": "Indikatoren - Anteil (Quotient zwischen Basis-Indikatoren und einem Referenzindikator)", - "apiName": "indicator_share" - }, - { - "displayName": "Indikatoren - Division (Quotient zweier Indikatoren)", - "apiName": "indicator_division" - }, - { - "displayName": "Indikatoren - Trend (mittels linearer Regression)", - "apiName": "indicator_trend" - }, - { - "displayName": "Indikatoren - Kontinuität (mittels Pearson Korrelation)", - "apiName": "indicator_continuity" - }, - { - "displayName": "Indikatoren - Veränderung absolut", - "apiName": "indicator_change_absolute" - }, - { - "displayName": "Indikatoren - Veränderung absolut mit festem Referenz-Zeitpunkt", - "apiName": "indicator_change_absolute_refDate" - }, - { - "displayName": "Indikatoren - Veränderung prozentual mit festem Referenz-Zeitpunkt", - "apiName": "indicator_change_relative_refDate" - }, - { - "displayName": "Indikatoren - Veränderung prozentual", - "apiName": "indicator_change_relative" - }, - { - "displayName": "Indikatoren - Promille-Wert (Quotient zwischen Basis-Indikatoren und einem Referenzindikator)", - "apiName": "indicator_promille" - }, - { - "displayName": "Leitindikator - verkettete Berechnung (Rank, Min-Max-Normalisierung, Aggregation)", - "apiName": "indicator_headlineIndicator" - }, - { - "displayName": "Indikatoren - Produkt aller Indikatoren", - "apiName": "indicator_multiplication" - }, - { - "displayName": "Georessourcen - Anzahl Punkte in Polygon", - "apiName": "georesource_pointsInPolygon" - }, - { - "displayName": "Georessourcen - Statistiken anhand Objekteigenschaft (Punktdatensätze)", - "apiName": "georesource_statistics" - }, - { - "displayName": "Georessourcen - Prozentualer Anteil anhand Objekteigenschaft (Punktdatensätze)", - "apiName": "georesource_subsetShare" - }, - { - "displayName": "Georessourcen - Summierte Linienlänge je Polygon", - "apiName": "lineSegmentInPolygon" - } - ]; - - this.temporalOptions = [ - { - "apiName": "YEARS", - "displayName": "Jahr(e)" - }, - { - "apiName": "MONTHS", - "displayName": "Monat(e)" - }, - { - "apiName": "DAYS", - "displayName": "Tag(e)" - } - ]; - - this.requiredIndicators_tmp = []; - this.requiredGeoresources_tmp = []; - this.requiredScriptParameters_tmp = []; - this.scriptCode_base64String = undefined; - this.scriptCode_readableString = undefined; - - this.scriptFormulaHTML = undefined; - this.scriptFormulaHTML_successToastDisplay = this.scriptFormulaHTML; - this.scriptFormulaHTML_overwriteTargetIndicatorMethod = false; - - this.scriptFormulaExplanation = undefined; - - this.targetIndicatorOldProcessDescription = undefined; - - this.reset = function(){ - this.requiredIndicators_tmp = []; - this.requiredGeoresources_tmp = []; - this.requiredScriptParameters_tmp = []; - this.scriptCode_base64String = undefined; - this.scriptCode_readableString = undefined; - this.scriptFormulaHTML = undefined; - this.scriptFormulaHTML_overwriteTargetIndicatorMethod = false; - this.scriptFormulaExplanation = undefined; - this.targetIndicatorOldProcessDescription = undefined; - }; - - this.addBaseIndicator = function(indicatorMetadata){ - if(!indicatorMetadata){ - return; - } - // for (const baseIndicator of this.requiredIndicators_tmp) { - // if (baseIndicator.indicatorId === indicatorMetadata.indicatorId){ - // // already inserted as base indicator, hence add not allowed - // return; - // } - // } - this.requiredIndicators_tmp.push(indicatorMetadata); - }; - - this.removeBaseIndicator = function(indicatorMetadata){ - for (let index = 0; index < this.requiredIndicators_tmp.length; index++) { - - if (this.requiredIndicators_tmp[index].indicatorId === indicatorMetadata.indicatorId){ - // remove object - this.requiredIndicators_tmp.splice(index, 1); - break; - } - } - }; - - this.addBaseGeoresource = function(georesourceMetadata){ - // for (const baseGeoresource of this.requiredGeoresources_tmp) { - // if (baseGeoresource.georesourceId === georesourceMetadata.georesourceId){ - // // already inserted as base georesource, hence add not allowed - // return; - // } - // } - this.requiredGeoresources_tmp.push(georesourceMetadata); - }; - - this.removeBaseGeoresource = function(georesourceMetadata){ - for (let index = 0; index < this.requiredGeoresources_tmp.length; index++) { - - if (this.requiredGeoresources_tmp[index].georesourceId === georesourceMetadata.georesourceId){ - // remove object - this.requiredGeoresources_tmp.splice(index, 1); - break; - } - } - }; - - this.addScriptParameter = function(parameterName, parameterDescription, parameterDataType, parameterDefaultValue, parameterNumericMinValue, parameterNumericMaxValue){ - for (const scriptParameter of this.requiredScriptParameters_tmp) { - if (scriptParameter.name === parameterName){ - // already inserted as script parameter, hence add not allowed - return; - } - } - - var scriptParameter = { - "name": parameterName, - "description": parameterDescription, - "dataType": parameterDataType.apiName, - "defaultValue": parameterDefaultValue, - "minParameterValueForNumericInputs": parameterNumericMinValue || 0, - "maxParameterValueForNumericInputs": parameterNumericMaxValue || 1 - - }; - this.requiredScriptParameters_tmp.push(scriptParameter); - }; - - this.removeScriptParameter = function(scriptParameter){ - for (let index = 0; index < this.requiredScriptParameters_tmp.length; index++) { - - if (this.requiredScriptParameters_tmp[index].name === scriptParameter.name){ - // remove object - this.requiredScriptParameters_tmp.splice(index, 1); - break; - } - } - }; - - this.removeScriptParameter_byName = function(scriptParameterName){ - for (let index = 0; index < this.requiredScriptParameters_tmp.length; index++) { - - if (this.requiredScriptParameters_tmp[index].name === scriptParameterName){ - // remove object - this.requiredScriptParameters_tmp.splice(index, 1); - break; - } - } - }; - - this.prettifyScriptCodePreview = function(htmlDomElementId){ - - $timeout(function(){ - - $(htmlDomElementId).removeClass("prettyprinted"); - - PR.prettyPrint(); - - }, 250); - - }; - - this.buildPatchBody_indicators = function(targetIndicatorMetadata){ - var patchBody = - { - "metadata": { - "note": targetIndicatorMetadata.metadata.note || null, - "literature": targetIndicatorMetadata.metadata.literature || null, - "updateInterval": targetIndicatorMetadata.metadata.updateInterval, - "sridEPSG": targetIndicatorMetadata.metadata.sridEPSG || 4326, - "datasource": targetIndicatorMetadata.metadata.datasource, - "contact": targetIndicatorMetadata.metadata.contact, - "lastUpdate": targetIndicatorMetadata.metadata.lastUpdate, - "description": targetIndicatorMetadata.metadata.description || null, - "databasis": targetIndicatorMetadata.metadata.databasis || null - }, - "refrencesToOtherIndicators": [], // filled directly after - "allowedRoles": targetIndicatorMetadata.allowedRoles, - "datasetName": targetIndicatorMetadata.indicatorName, - "abbreviation": targetIndicatorMetadata.abbreviation || null, - "characteristicValue": targetIndicatorMetadata.characteristicValue || null, - "tags": targetIndicatorMetadata.tags, - "creationType": targetIndicatorMetadata.creationType, - "unit": targetIndicatorMetadata.unit, - "topicReference": targetIndicatorMetadata.topicReference, - "refrencesToGeoresources": [], // filled directly after - "indicatorType": targetIndicatorMetadata.indicatorType, - "interpretation": targetIndicatorMetadata.interpretation || "", - "isHeadlineIndicator": targetIndicatorMetadata.isHeadlineIndicator || false, - "processDescription": this.scriptFormulaHTML || targetIndicatorMetadata.processDescription, - "lowestSpatialUnitForComputation": targetIndicatorMetadata.lowestSpatialUnitForComputation, - "defaultClassificationMapping": targetIndicatorMetadata.defaultClassificationMapping - }; - - // REFERENCES - - if(targetIndicatorMetadata.referencedIndicators && targetIndicatorMetadata.referencedIndicators.length > 0){ - patchBody.refrencesToOtherIndicators = []; - - for (const indicRef of targetIndicatorMetadata.referencedIndicators) { - patchBody.refrencesToOtherIndicators.push({ - "indicatorId": indicRef.referencedIndicatorId, - "referenceDescription": indicRef.referencedIndicatorDescription - }); - } - } - - if(targetIndicatorMetadata.referencedGeoresources && targetIndicatorMetadata.referencedGeoresources.length > 0){ - patchBody.refrencesToGeoresources = []; - - for (const geoRef of targetIndicatorMetadata.referencedGeoresources) { - patchBody.refrencesToGeoresources.push({ - "georesourceId": geoRef.referencedGeoresourceId, - "referenceDescription": geoRef.referencedGeoresourceDescription - }); - } - } - - return patchBody; - }; - - this.replaceMethodMetadataForTargetIndicator = async function(targetIndicatorMetadata){ - var patchBody = this.buildPatchBody_indicators(targetIndicatorMetadata); - - this.targetIndicatorOldProcessDescription = targetIndicatorMetadata.processDescription; - - $http({ - url: kommonitorDataExchangeService.baseUrlToKomMonitorDataAPI + "/indicators/" + targetIndicatorMetadata.indicatorId, - method: "PATCH", - data: patchBody - // headers: { - // 'Content-Type': undefined - // } - }).then(function successCallback(response) { - - $rootScope.$broadcast("refreshIndicatorOverviewTable", "edit", targetIndicatorMetadata.indicatorId); - - }, function errorCallback(error) { - - }); - }; - - this.postNewScript = async function(scriptName, description, targetIndicatorMetadata){ - console.log("Trying to POST to management service to register new script."); - - /* POST BODY - { - "scriptCodeBase64": "scriptCodeBase64", - "requiredIndicatorIds": [ - "requiredIndicatorIds", - "requiredIndicatorIds" - ], - "variableProcessParameters": [ - { - "minParameterValueForNumericInputs": 6.027456183070403, - "maxParameterValueForNumericInputs": 0.8008281904610115, - "defaultValue": "defaultValue", - "dataType": "string", - "name": "name", - "description": "description" - }, - { - "minParameterValueForNumericInputs": 6.027456183070403, - "maxParameterValueForNumericInputs": 0.8008281904610115, - "defaultValue": "defaultValue", - "dataType": "string", - "name": "name", - "description": "description" - } - ], - "associatedIndicatorId": "associatedIndicatorId", - "name": "name", - "description": "description", - "requiredGeoresourceIds": [ - "requiredGeoresourceIds", - "requiredGeoresourceIds" - ] - } - */ - - var postBody = { - "name": scriptName, - "description": description, - "associatedIndicatorId": targetIndicatorMetadata.indicatorId, - "requiredIndicatorIds": this.requiredIndicators_tmp.map(indicatorMetadata => indicatorMetadata.indicatorId), - "requiredGeoresourceIds": this.requiredGeoresources_tmp.map(georesourceMetadata => georesourceMetadata.georesourceId), - "variableProcessParameters": this.requiredScriptParameters_tmp, - "scriptCodeBase64": window.btoa(this.scriptCode_readableString) - }; - - return await $http({ - url: this.targetUrlToManagementService + "process-scripts", - method: "POST", - data: postBody, - headers: { - 'Content-Type': "application/json" - } - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(response) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while posting to importer service."); - throw response; - }); - }; - - this.updateScript = async function(scriptName, description, scriptId){ - console.log("Trying to POST to importer service to update spatial unit with id '" + spatialUnitId + "'."); - - var putBody = { - "name": scriptName, - "description": description, - "requiredIndicatorIds": this.requiredIndicators_tmp, - "requiredGeoresourceIds": this.requiredGeoresources_tmp, - "variableProcessParameters": this.requiredScriptParameters_tmp, - "scriptCodeBase64": window.btoa(this.scriptCode_readableString) - }; - - return await $http({ - url: this.targetUrlToManagementService + "process-scripts/" + scriptId, - method: "PUT", - data: putBody, - headers: { - 'Content-Type': "application/json" - } - }).then(function successCallback(response) { - // this callback will be called asynchronously - // when the response is available - - return response.data; - - }, function errorCallback(response) { - // called asynchronously if an error occurs - // or server returns response with an error status. - //$scope.error = response.statusText; - console.error("Error while posting to importer service."); - throw response; - }); - }; - - this.getAlphabetLetterFromNumber = function(number){ - return String.fromCharCode(Number(number) + 'A'.charCodeAt(0)); - }; - - this.styleMathFormula = function(domOutputElementId){ - var output = document.getElementById(domOutputElementId); - output.innerHTML = this.scriptFormulaHTML; - - // MathJax.texReset(); - // MathJax.typesetClear(); - MathJax.typesetPromise([output]).then(function(){ - - }).catch(function (err) { - output.innerHTML = ''; - output.appendChild(document.createTextNode(err.message)); - console.error(err); - }).then(function () { - - }); - }; - - this.styleMathFormula_forExplanation = function(domOutputElementId){ - var output = document.getElementById(domOutputElementId); - - // MathJax.texReset(); - // MathJax.typesetClear(); - MathJax.typesetPromise([output]).then(function(){ - $timeout(function(){ - self.scriptFormulaExplanation = "" + output.innerHTML; - $rootScope.$apply(); - }); - }).catch(function (err) { - output.innerHTML = ''; - output.appendChild(document.createTextNode(err.message)); - console.error(err); - }).then(function () { - $timeout(function(){ - self.scriptFormulaExplanation = "" + output.innerHTML; - $rootScope.$apply(); - }); - }); - }; - - this.typesetContainerByClass = function(className){ - var domElements = document.getElementsByClassName(className); - - for (const domElement of domElements) { - MathJax.typesetPromise([domElement]).then(function(){ - $timeout(function(){ - }); - }).catch(function (err) { - console.error(err); - }).then(function () { - $timeout(function(){ - }); - }); - } - }; - - }]); diff --git a/app/util/genericServices/kommonitorShareHelperService/kommonitor-share-helper-service.module.ts b/app/util/genericServices/kommonitorShareHelperService/kommonitor-share-helper-service.module.ts deleted file mode 100644 index 4639a9bae..000000000 --- a/app/util/genericServices/kommonitorShareHelperService/kommonitor-share-helper-service.module.ts +++ /dev/null @@ -1,139 +0,0 @@ -angular.module('kommonitorShareHelper', ['kommonitorDataExchange']); - - -angular - .module('kommonitorShareHelper', []) - .service( - 'kommonitorShareHelperService', [ - '$http', '__env', 'Auth', '$routeParams', '$location', 'kommonitorDataExchangeService', - function ($http, __env, Auth, $routeParams, $location, kommonitorDataExchangeService) { - - this.baseUrlToKomMonitorDataAPI = __env.apiUrl + __env.basePath; - let self = this; - - this.queryParamMap = new Map(); - this.currentShareLink = ""; - - this.paramName_loginRequired = "login"; - this.paramName_indicatorId = "ind"; - this.paramName_spatialUnitName = "spu"; - this.paramName_zoomLevel = "zoom"; - this.paramName_latitude = "lat"; - this.paramName_longitude = "lon"; - - this.initParamsMap = function(){ - // set map content from params - this.queryParamMap = new Map(); - - for (const key in $routeParams) { - if (Object.hasOwnProperty.call($routeParams, key)) { - const value = $routeParams[key]; - this.queryParamMap.set(key, value); - } - } - }; - - this.applyQueryParams = function(){ - if ($routeParams[this.paramName_indicatorId]){ - __env.initialIndicatorId = $routeParams[this.paramName_indicatorId]; - } - if ($routeParams[this.paramName_spatialUnitName]){ - __env.initialSpatialUnitName = $routeParams[this.paramName_spatialUnitName]; - } - if ($routeParams[this.paramName_latitude]){ - __env.initialLatitude = $routeParams[this.paramName_latitude]; - } - if ($routeParams[this.paramName_longitude]){ - __env.initialLongitude = $routeParams[this.paramName_longitude]; - } - if ($routeParams[this.paramName_zoomLevel]){ - __env.initialZoomLevel = $routeParams[this.paramName_zoomLevel]; - } - }; - - this.init = function(){ - // parse query params - this.initParamsMap(); - - // if login required then route to login page with same link as redirect URL - if ($routeParams[this.paramName_loginRequired] && JSON.parse($routeParams[this.paramName_loginRequired])){ - // login required - if(window.__env.enableKeycloakSecurity){ - if (Auth.keycloak.authenticated) { - // if (Auth.keycloak.showAdminView) { - // return true; - // } else { - // return $q.reject('Not Authenticated'); - // } - } - else { - Auth.keycloak.login({ - redirectUri: this.currentShareLink - }); - } - } - } - - // set config and data options from params - this.applyQueryParams(); - }; - - this.generateCurrentShareLink = function(){ - - this.setShareLinkParam_mapExtent(); - this.setShareLinkParam_currentIndicatorId(); - this.setShareLinkParam_currentSpatialUnitName(); - - // regerenate the share link from all current parameters - this.currentShareLink = $location.absUrl(); - - if(this.currentShareLink.includes("?")){ - this.currentShareLink = this.currentShareLink.split("?")[0]; - } - - this.currentShareLink += "?"; - - this.queryParamMap.forEach((value, key) => { - self.currentShareLink += "" + key + "=" + value + "&"; - } - ); - - }; - - this.setShareLinkParam = function(paramName, value){ - this.queryParamMap.set(paramName, value); - }; - - this.setShareLinkParam_currentIndicatorId = function(){ - this.setShareLinkParam(this.paramName_indicatorId, kommonitorDataExchangeService.selectedIndicator.indicatorId); - - if(kommonitorDataExchangeService.selectedIndicator.allowedRoles.length > 0){ - this.setShareLinkParam(this.paramName_loginRequired, "true"); - } - else{ - for (const spatialUnit of kommonitorDataExchangeService.selectedIndicator.applicableSpatialUnits) { - if(spatialUnit.spatialUnitName == kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel){ - if (spatialUnit.allowedRoles.length > 0){ - this.setShareLinkParam(this.paramName_loginRequired, "true"); - } - } - } - } - - }; - - this.setShareLinkParam_currentSpatialUnitName = function(){ - this.setShareLinkParam(this.paramName_spatialUnitName, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel); - if(kommonitorDataExchangeService.selectedSpatialUnit.allowedRoles.length > 0){ - this.setShareLinkParam(this.paramName_loginRequired, "true"); - } - }; - - this.setShareLinkParam_mapExtent = function(){ - this.setShareLinkParam(this.paramName_latitude, __env.currentLatitude); - this.setShareLinkParam(this.paramName_longitude, __env.currentLongitude); - this.setShareLinkParam(this.paramName_zoomLevel, __env.currentZoomLevel); - __env.centerMapInitially = false; - }; - - }]); diff --git a/app/util/genericServices/kommonitorSingleFeatureMapHelperService/kommonitor-single-feature-map-helper-service.module.ts b/app/util/genericServices/kommonitorSingleFeatureMapHelperService/kommonitor-single-feature-map-helper-service.module.ts deleted file mode 100644 index 3abfd1b00..000000000 --- a/app/util/genericServices/kommonitorSingleFeatureMapHelperService/kommonitor-single-feature-map-helper-service.module.ts +++ /dev/null @@ -1,431 +0,0 @@ -angular.module('kommonitorSingleFeatureMapHelper', ['kommonitorDataExchange']); - -angular - .module('kommonitorSingleFeatureMapHelper', []) - .service( - 'kommonitorSingleFeatureMapHelperService', ['$rootScope', '__env', '$timeout', - function ($rootScope, __env, $timeout) { - - var self = this; - - this.resourceType_point = "POINT"; - this.resourceType_line = "LINE"; - this.resourceType_polygon = "POLYGON"; - - //leaflet map instance - this.map; - this.layerControl; - // layer holding the editable feature - this.featureLayer; - this.drawControl; - this.geosearchControl; - - // backgroundLayer - this.backgroundLayer; - - /* - * L.TileLayer.Grayscale is a regular tilelayer with grayscale makeover. - */ - - L.TileLayer.Grayscale = L.TileLayer.extend({ - options: { - quotaRed: 21, - quotaGreen: 71, - quotaBlue: 8, - quotaDividerTune: 0, - quotaDivider: function () { - return this.quotaRed + this.quotaGreen + this.quotaBlue + this.quotaDividerTune; - } - }, - - initialize: function (url, options) { - options = options || {}; - options.crossOrigin = true; - L.TileLayer.prototype.initialize.call(this, url, options); - - this.on('tileload', function (e) { - this._makeGrayscale(e.tile); - }); - }, - - _createTile: function () { - var tile = L.TileLayer.prototype._createTile.call(this); - tile.crossOrigin = "Anonymous"; - return tile; - }, - - _makeGrayscale: function (img) { - if (img.getAttribute('data-grayscaled')) - return; - - img.crossOrigin = ''; - var canvas = document.createElement("canvas"); - canvas.width = img.width; - canvas.height = img.height; - var ctx = canvas.getContext("2d"); - ctx.drawImage(img, 0, 0); - - var imgd = ctx.getImageData(0, 0, canvas.width, canvas.height); - var pix = imgd.data; - for (var i = 0, n = pix.length; i < n; i += 4) { - pix[i] = pix[i + 1] = pix[i + 2] = (this.options.quotaRed * pix[i] + this.options.quotaGreen * pix[i + 1] + this.options.quotaBlue * pix[i + 2]) / this.options.quotaDivider(); - } - ctx.putImageData(imgd, 0, 0); - img.setAttribute('data-grayscaled', true); - img.src = canvas.toDataURL(); - } - }); - - this.invalidateMap = function(){ - if (this.map){ - // just wait a bit in order to ensure that map element is visible to make invalidateSize actually work - $timeout(function(){ - self.map.invalidateSize(true); - }, 500); - } - }; - - this.zoomToDataLayer = function(){ - if (this.map && this.dataLayer){ - // just wait a bit in order to ensure that map element is visible to make invalidateSize actually work - $timeout(function(){ - self.map.fitBounds(self.dataLayer.getBounds()); - }, 750); - } - }; - - this.initSingleFeatureGeoMap = function(domId, resourceType){ - // init leaflet map - - // add geometry editing tool for the respective RESOURCE TYPE - - // add geocoding plugin if it is POINT resource - - // register events that broadcast new geometry to other components - - if(this.map){ - this.map.off(); - this.map.remove(); - - // var domNode = document.getElementById(domId); - - // while (domNode.hasChildNodes()) { - // domNode.removeChild(domNode.lastChild); - // } - } - - // backgroundLayer - this.backgroundLayer = new L.TileLayer.Grayscale("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", { minZoom: __env.minZoomLevel, maxZoom: __env.maxZoomLevel, attribution: "Map data © OpenStreetMap contributors" }); - - this.map = L.map(domId, { - center: [__env.initialLatitude, __env.initialLongitude], - zoom: __env.initialZoomLevel, - zoomDelta: 0.5, - zoomSnap: 0.5, - layers: [this.backgroundLayer] - }); - - L.control.scale().addTo(this.map); - - // this.initLayerControl(); - - if(resourceType == this.resourceType_point){ - this.initGeosearchControl(); - } - - this.initDrawControl(resourceType); - - this.invalidateMap(); - }; - - this.initLayerControl = function(){ - let baseLayers = { - "OpenStreetMap Graustufen": this.backgroundLayer - }; - let overlays = {}; - - this.layerControl = L.control.layers(baseLayers, overlays, {position: "topleft"}).addTo(this.map); - }; - - this.initGeosearchControl = function(){ - ///////////////////////////////////////////////////// - ///// LEAFLET GEOSEARCH SETUP - ///////////////////////////////////////////////////// - var GeoSearchControl = window.GeoSearch.GeoSearchControl; - var OpenStreetMapProvider = window.GeoSearch.OpenStreetMapProvider; - - // remaining is the same as in the docs, accept for the var instead of const declarations - var provider = new OpenStreetMapProvider( - { - params: { - 'accept-language': 'de', // render results in Dutch - countrycodes: 'de', // limit search results to the Netherlands - addressdetails: 1, // include additional address detail parts - viewbox: "" + (Number(__env.initialLongitude) - 0.001) + "," + (Number(__env.initialLatitude) - 0.001) + "," + (Number(__env.initialLongitude) + 0.001) + "," + (Number(__env.initialLatitude) + 0.001) - }, - searchUrl: __env.targetUrlToGeocoderService + '/search', - reverseUrl: __env.targetUrlToGeocoderService + '/reverse' - } - ); - - console.log(provider); - - this.geosearchControl = new GeoSearchControl({ - position: "topright", - provider: provider, - style: 'button', - autoComplete: true, - autoCompleteDelay: 250, - showMarker: false, // optional: true|false - default true - showPopup: false, // optional: true|false - default false - marker: { // optional: L.Marker - default L.Icon.Default - icon: new L.Icon.Default(), - draggable: false, - }, - popupFormat: ({ query, result }) => result.label, // optional: function - default returns result label - maxMarkers: 1, // optional: number - default 1 - retainZoomLevel: false, // optional: true|false - default false - animateZoom: true, // optional: true|false - default true - autoClose: false, // optional: true|false - default false - searchLabel: 'Suche nach Adressen ...', // optional: string - default 'Enter address' - keepResult: false // optional: true|false - default false - }); - - this.map.addControl(this.geosearchControl); - // this.map.on('geosearch/showlocation', function(event){ - // console.log(event); - // let geoJSON = { - // type: "Feature", - // geometry: { - // type: "Point", - // coordinates: [event.x, event.y] - // }, - // properties: { - - // } - // }; - // $rootScope.$broadcast("onUpdateSingleFeatureGeometry", geoJSON); - // }); - }; - - this.initDrawControlOptions = function(resourceType, enableDrawToolbar){ - let options = { - edit: { - featureGroup: this.featureLayer - }, - position: 'bottomright' - }; - - if(enableDrawToolbar){ - options.draw = { - polyline: resourceType == this.resourceType_line ? true : false, - polygon: resourceType == this.resourceType_polygon ? true : false, - rectangle: false, - circle: false, - circlemarker: false, - marker: resourceType == this.resourceType_point ? true : false - }; - } - else{ - options.draw = false; - } - - return options; - }; - - this.initDrawControl = function(resourceType){ - // FeatureGroup is to store editable layers - this.featureLayer = new L.FeatureGroup(); - - L.drawLocal = { - edit: { - toolbar: { - actions: { - save: { - title: "Bearbeitung speichern.", - text: "Speichern", - }, - cancel: { - title: "Bearbeitung verwerfen.", - text: "Abbrechen", - }, - clearAll: { - title: "Alle Features entfernen.", - text: "Alle Features entfernen", - }, - }, - buttons: { - edit: "Layer editieren.", - editDisabled: "Keine Layer zum editieren vorhanden.", - remove: "Layer entfernen.", - removeDisabled: "Keine Layer zum entfernen vorhanden.", - }, - }, - handlers: { - edit: { - tooltip: { - text: "Bearbeitungspunkte oder Punktmarker ziehen, um Feature zu editieren.", - subtext: "Abbrechen klicken, um Bearbeitung zu verwefen.", - }, - }, - remove: { - tooltip: { - text: "Feature anklicken, um es zu entfernen", - }, - }, - } - }, - draw: { - toolbar: { - actions: { - title: "Zeichnen abbrechen", - text: "Abbrechen", - }, - finish: { - title: "Zeichnen beenden", - text: "Beenden", - }, - undo: { - title: "Zuletzt gezeichneten Punkt entfernen", - text: "Letzten Punkt entfernen", - }, - buttons: { - polyline: "Polylinie zeichnen", - polygon: "Polygon zeichnen", - rectangle: "Rechteck zeichnen", - circle: "Kreis zeichnen", - marker: "Punkt zeichnen", - circlemarker: "Kreispunkt zeichnen", - }, - }, - handlers: { - circle: { - tooltip: { - start: "Klicken und halten, um Kreis zu zeichnen.", - }, - radius: "Radius", - }, - circlemarker: { - tooltip: { - start: "Klicken, um einen Punkt zu markieren.", - }, - }, - marker: { - tooltip: { - start: "Klicken, um einen Punkt zu markieren.", - }, - }, - polygon: { - tooltip: { - start: "Klicken, um ein Polygon zu beginnen.", - cont: "Klicken, um das Polygon weiter zu zeichnen.", - end: "Ersten Punkt anklicken, um Polygon zu beenden.", - }, - }, - polyline: { - error: "Fehler: Selbstueberschneidung!", - tooltip: { - start: "Klicken, um eine Polylinie zu beginnen.", - cont: "Klicken, um die Polylinie weiter zu zeichnen.", - end: "Letzten Punkt erneut anklicken, um Polylinie zu beenden.", - }, - }, - rectangle: { - tooltip: { - start: "Klicken und halten, um Rechteck zu zeichnen.", - }, - }, - simpleshape: { - tooltip: { - end: "Maus loslassen, um Zeichnung zu beenden.", - }, - }, - } - } - - }; - - this.map.addLayer(this.featureLayer); - this.drawControlOptions = this.initDrawControlOptions(resourceType, true); - this.drawControl = new L.Control.Draw(this.drawControlOptions); - - this.map.addControl(this.drawControl); - - this.map.on(L.Draw.Event.CREATED, function (event) { - var layer = event.layer; - - self.featureLayer.addLayer(layer); - - // disable draw tools - self.map.removeControl(self.drawControl); - self.drawControl = new L.Control.Draw(self.initDrawControlOptions(resourceType, false)); - self.map.addControl(self.drawControl); - - $rootScope.$broadcast("onUpdateSingleFeatureGeometry", self.featureLayer.toGeoJSON()); - }); - - this.map.on(L.Draw.Event.EDITED, function (event) { - - $rootScope.$broadcast("onUpdateSingleFeatureGeometry", self.featureLayer.toGeoJSON()); - }); - - this.map.on(L.Draw.Event.DELETED, function (event) { - - // reinit featureGroupLayer - self.featureLayer = new L.FeatureGroup(); - - // enable draw tools - self.map.removeControl(self.drawControl); - self.drawControl = new L.Control.Draw(self.initDrawControlOptions(resourceType, true)); - self.map.addControl(self.drawControl); - - $rootScope.$broadcast("onUpdateSingleFeatureGeometry", undefined); - }); - }; - - /** - * binds the popup of a clicked output - * to layer.feature.properties.popupContent - */ - this.onEachFeatureGeoresource = function(feature, layer) { - layer.on({ - click: function () { - - var popupContent = '
        '; - for (var p in feature.properties) { - popupContent += ''; - } - popupContent += '
        ' + p + ''+ feature.properties[p] + '
        '; - - layer.bindPopup(popupContent); - } - }); - }; - - this.addDataLayertoSingleFeatureGeoMap = function(geoJSON){ - if(this.map){ - this.dataLayer = L.geoJSON(geoJSON, { - pointToLayer: function(geoJsonPoint, latlng) { - return L.circleMarker(latlng, { - radius: 6 - }); - }, - style: function (feature) { - return { - color: "red", - weight: 1, - opacity: 1 - }; - }, - onEachFeature: self.onEachFeatureGeoresource - }); - - // this.layerControl.addOverlay(this.dataLayer, "weitere Objekte des Datensatzes"); - this.dataLayer.addTo(this.map); - this.map.fitBounds(this.dataLayer.getBounds()); - this.invalidateMap(); - } - }; - - - }]); diff --git a/app/util/genericServices/kommonitorVisualStyleHelperService/kommonitor-visual-style-helper-service.module.ts b/app/util/genericServices/kommonitorVisualStyleHelperService/kommonitor-visual-style-helper-service.module.ts deleted file mode 100644 index 158544890..000000000 --- a/app/util/genericServices/kommonitorVisualStyleHelperService/kommonitor-visual-style-helper-service.module.ts +++ /dev/null @@ -1,794 +0,0 @@ -angular.module('kommonitorVisualStyleHelper', ['kommonitorDataExchange']); - -/** - * a common serviceInstance that holds all needed properties for a WPS service. - * - * This service represents a shared object ´which is used across the different - * application tabs/components like Setup, Capabilities, Execute etc. - * - * This way, one single service instance can be used to easily share values and - * parameters for each WPS operation represented by different Angular components - */ -angular - .module('kommonitorVisualStyleHelper', []) - .service( - 'kommonitorVisualStyleHelperService', ['$rootScope', '$timeout', 'kommonitorDataExchangeService', '$http', '__env', - function ($rootScope, $timeout, - kommonitorDataExchangeService, $http, __env) { - - const INDICATOR_DATE_PREFIX = __env.indicatorDatePrefix; - - this.defaultBrew = undefined; - this.measureOfValueBrew = undefined; - this.dynamicBrew = undefined; - - //allowesValues: equal_interval, quantile, jenks - this.classifyMethods = [{ - name: "Jenks", - value: "jenks" - }, { - name: "Gleiches Intervall", - value: "equal_interval" - }, { - name: "Quantile", - value: "quantile" - }]; - - this.classifyMethod = __env.defaultClassifyMethod || "jenks"; - - this.isCustomComputation = false; - - const numberOfDecimals = __env.numberOfDecimals; - var defaultColorForFilteredValues = __env.defaultColorForFilteredValues; - var defaultBorderColorForFilteredValues = __env.defaultBorderColorForFilteredValues; - var defaultBorderColor = __env.defaultBorderColor; - var defaultFillOpacity = __env.defaultFillOpacity; - var defaultFillOpacityForFilteredFeatures = __env.defaultFillOpacityForFilteredFeatures; - var defaultFillOpacityForHighlightedFeatures = __env.defaultFillOpacityForHighlightedFeatures; - var defaultFillOpacityForZeroFeatures = __env.defaultFillOpacityForZeroFeatures; - var defaultColorBrewerPaletteForBalanceIncreasingValues = __env.defaultColorBrewerPaletteForBalanceIncreasingValues; - var defaultColorBrewerPaletteForBalanceDecreasingValues = __env.defaultColorBrewerPaletteForBalanceDecreasingValues; - var defaultColorBrewerPaletteForGtMovValues = __env.defaultColorBrewerPaletteForGtMovValues; - var defaultColorBrewerPaletteForLtMovValues = __env.defaultColorBrewerPaletteForLtMovValues; - var defaultColorForHoveredFeatures = __env.defaultColorForHoveredFeatures; - var defaultColorForClickedFeatures = __env.defaultColorForClickedFeatures; - var defaultBorderColorForNoDataValues = __env.defaultBorderColorForNoDataValues; - var defaultColorForNoDataValues = __env.defaultColorForNoDataValues; - var defaultFillOpacityForNoDataValues = __env.defaultFillOpacityForNoDataValues; - - this.indicatorTransparency = 1 - __env.defaultFillOpacity; - this.currentIndicatorOpacity = __env.defaultFillOpacity; - - var defaultColorForZeroValues = __env.defaultColorForZeroValues; - - - var defaultColorForOutliers_high = __env.defaultColorForOutliers_high; - var defaultBorderColorForOutliers_high = __env.defaultBorderColorForOutliers_high; - var defaultFillOpacityForOutliers_high = __env.defaultFillOpacityForOutliers_high; - var defaultColorForOutliers_low = __env.defaultColorForOutliers_low; - var defaultBorderColorForOutliers_low = __env.defaultBorderColorForOutliers_low; - var defaultFillOpacityForOutliers_low = __env.defaultFillOpacityForOutliers_low; - var useOutlierDetectionOnIndicator = __env.useOutlierDetectionOnIndicator; - - const outlierPropertyName = "outlier"; - const outlierPropertyValue_high_soft = "high-soft"; - const outlierPropertyValue_low_soft = "low-soft"; - const outlierPropertyValue_high_extreme = "high-extreme"; - const outlierPropertyValue_low_extreme = "low-extreme"; - const outlierPropertyValue_no = "no"; - - this.outlierFillPattern_low = new L.StripePattern({ weight: 1, spaceweight: 1, patternTransform: "rotate(45)" }); - - this.outlierFillPattern_high = new L.StripePattern({ weight: 1, spaceweight: 1, patternTransform: "rotate(-45)" }); - - var shape = new L.PatternCircle({ - x: 5, - y: 5, - radius: 1, - fill: true, - color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultColorForNoDataValues - }); - this.noDataFillPattern = new L.Pattern({ width: 8, height: 8 }); - this.noDataFillPattern.addShape(shape); - - var outliers_high = undefined; - var outliers_low = undefined; - - this.outlierStyle_high = { - weight: 1, - opacity: 1, - color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColorForOutliers_high, - dashArray: '', - fillOpacity: defaultFillOpacityForOutliers_high, - fillColor: defaultColorForOutliers_high, - fillPattern: this.outlierFillPattern_high - }; - - this.outlierStyle_low = { - weight: 1, - opacity: 1, - color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColorForOutliers_low, - dashArray: '', - fillOpacity: defaultFillOpacityForOutliers_low, - fillColor: defaultColorForOutliers_low, - fillPattern: this.outlierFillPattern_low - }; - - this.noDataStyle = { - weight: 1, - opacity: 1, - color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColorForNoDataValues, - dashArray: '', - fillOpacity: defaultFillOpacityForNoDataValues, - fillColor: defaultColorForNoDataValues, - // fillPattern: this.noDataFillPattern - }; - - this.filteredStyle = { - weight: 1, - opacity: 1, - color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColorForFilteredValues, - dashArray: '', - fillOpacity: defaultFillOpacityForFilteredFeatures, - fillColor: defaultColorForFilteredValues - }; - - this.featuresPerColorMap = new Map(); - this.featuresPerNoData = 0; - this.featuresPerZero = 0; - this.featuresPerOutlierHigh = 0; - this.featuresPerOutlierLow = 0; - - this.resetFeaturesPerColorObjects = function(){ - this.featuresPerColorMap = new Map(); - this.featuresPerNoData = 0; - this.featuresPerZero = 0; - this.featuresPerOutlierLow = 0; - this.featuresPerOutlierHigh = 0; - }; - - this.incrementFeaturesPerColor = function(color){ - if(this.featuresPerColorMap.has(color)){ - this.featuresPerColorMap.set(color, this.featuresPerColorMap.get(color) + 1); - } - else{ - this.featuresPerColorMap.set(color, 1); - } - }; - - this.getFillColorForZero = function(){ - this.featuresPerZero ++; - return defaultColorForZeroValues; - }; - - this.setupDefaultBrew = function (geoJSON, propertyName, numClasses, colorCode, classifyMethod, forceProvidedIndicator, indicator) { - this.resetFeaturesPerColorObjects(); - - var values = new Array(); - - if(kommonitorDataExchangeService.classifyUsingWholeTimeseries){ - values = this.setupDefaultBrewValues_wholeTimeseries(geoJSON, values, forceProvidedIndicator, indicator); - } - else{ - values = this.setupDefaultBrewValues_singleTimestamp(geoJSON, propertyName, values); - } - - this.defaultBrew = setupClassyBrew_usingFeatureCount(values, colorCode, classifyMethod, numClasses); - return this.defaultBrew; - }; - - this.setupDefaultBrewValues_singleTimestamp = function(geoJSON, propertyName, values){ - for (var i = 0; i < geoJSON.features.length; i++) { - if (kommonitorDataExchangeService.indicatorValueIsNoData(geoJSON.features[i].properties[propertyName])) - continue; - - if(kommonitorDataExchangeService.classifyZeroSeparately && (geoJSON.features[i].properties[propertyName] == 0 || geoJSON.features[i].properties[propertyName] == "0")){ - continue; - } - - // check if is outlier, then do not use within classification, as it will be marked on map with special color - if (geoJSON.features[i].properties[outlierPropertyName] && geoJSON.features[i].properties[outlierPropertyName] !== outlierPropertyValue_no && kommonitorDataExchangeService.useOutlierDetectionOnIndicator) { - continue; - } - - if(! values.includes(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName]))){ - values.push(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName])); - } - } - - return values; - }; - - this.setupDefaultBrewValues_wholeTimeseries = function(geoJSON, values, forceProvidedIndicator, indicator){ - var indicatorTimeSeriesDatesArray; - if(forceProvidedIndicator) { - indicatorTimeSeriesDatesArray = indicator.applicableDates; - } else { - indicatorTimeSeriesDatesArray = kommonitorDataExchangeService.selectedIndicator.applicableDates; - } - - - for (const date of indicatorTimeSeriesDatesArray) { - var propertyName = __env.indicatorDatePrefix + date; - values = this.setupDefaultBrewValues_singleTimestamp(geoJSON, propertyName, values); - } - - return values; - }; - - /** - * Returns and array of color brewer instances for greater and lesser than measure of value colors - * - * [gtMeasureOfValueBrew, ltMeasureOfValueBrew] - */ - this.setupMeasureOfValueBrew = function (geoJSON, propertyName, colorCodeForGreaterThanValues, colorCodeForLesserThanValues, classifyMethod, measureOfValue) { - - /* - * Idea: Analyse the complete geoJSON property array for each feature and make conclusion about how to build the legend - - e.g. if there are only positive values then display only positive values within 5 categories - same for only negative values - - e.g. if there are equally many positive as negative values then display both using 3 categories each - - e.g. if there are way more positive than negative values, then display both with 2 (negative) and 4 (positive) classes - - --> implement special cases (0, 1 or 2 negative/positive values --> apply colors manually) - --> treat all other cases equally to measureOfValue - */ - - this.resetFeaturesPerColorObjects(); - - this.greaterThanValues = []; - this.lesserThanValues = []; - - if(kommonitorDataExchangeService.classifyUsingWholeTimeseries){ - this.setupMovBrewValues_wholeTimeseries(geoJSON, measureOfValue); - } - else{ - this.setupMovBrewValues_singleTimestamp(geoJSON, propertyName, measureOfValue); - } - - var gtMeasureOfValueBrew = this.setupGtMeasureOfValueBrew(this.greaterThanValues, colorCodeForGreaterThanValues, classifyMethod); - var ltMeasureOfValueBrew = this.setupLtMeasureOfValueBrew(this.lesserThanValues, colorCodeForLesserThanValues, classifyMethod); - - this.measureOfValueBrew = [gtMeasureOfValueBrew, ltMeasureOfValueBrew]; - return this.measureOfValueBrew; - }; - - this.setupMovBrewValues_singleTimestamp = function(geoJSON, propertyName, measureOfValue){ - for (var i = 0; i < geoJSON.features.length; i++) { - - if (kommonitorDataExchangeService.indicatorValueIsNoData(geoJSON.features[i].properties[propertyName])) - continue; - - if(kommonitorDataExchangeService.classifyZeroSeparately && (geoJSON.features[i].properties[propertyName] == 0 || geoJSON.features[i].properties[propertyName] == "0")){ - continue; - } - - // check if is outlier, then do not use within classification, as it will be marked on map with special color - if (geoJSON.features[i].properties[outlierPropertyName] && geoJSON.features[i].properties[outlierPropertyName] !== outlierPropertyValue_no && kommonitorDataExchangeService.useOutlierDetectionOnIndicator) { - continue; - } - - else if (kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName]) >= kommonitorDataExchangeService.getIndicatorValue_asNumber(measureOfValue)){ - if(! this.greaterThanValues.includes(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName]))){ - this.greaterThanValues.push(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName])); - } - } - else{ - if(! this.lesserThanValues.includes(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName]))){ - this.lesserThanValues.push(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName])); - } - } - } - }; - - this.setupMovBrewValues_wholeTimeseries = function(geoJSON, measureOfValue){ - var indicatorTimeSeriesDatesArray = kommonitorDataExchangeService.selectedIndicator.applicableDates; - - for (const date of indicatorTimeSeriesDatesArray) { - var propertyName = __env.indicatorDatePrefix + date; - this.setupMovBrewValues_singleTimestamp(geoJSON, propertyName, measureOfValue); - } - }; - - function setupClassyBrew_usingFeatureCount(valuesArray, colorCode, classifyMethod, maxNumberOfClasses){ - - var tempBrew = new classyBrew(); - var colorBrewerInstance = new classyBrew(); - - if (valuesArray.length >= 5) { - // pass array to our classyBrew series - tempBrew.setSeries(valuesArray); - // define number of classes - tempBrew.setNumClasses(maxNumberOfClasses); - // set color ramp code - tempBrew.setColorCode(colorCode); - // classify by passing in statistical method - // i.e. equal_interval, jenks, quantile - tempBrew.classify(classifyMethod); - - colorBrewerInstance.colors = tempBrew.getColors(); - colorBrewerInstance.breaks = tempBrew.getBreaks(); - } - - else if (valuesArray.length === 4) { - valuesArray.sort((a, b) => a - b); - - colorBrewerInstance.colors = tempBrew.colorSchemes[colorCode]['4']; - colorBrewerInstance.breaks = valuesArray; - } - - else if (valuesArray.length === 3) { - valuesArray.sort((a, b) => a - b); - - colorBrewerInstance.colors = tempBrew.colorSchemes[colorCode]['3']; - colorBrewerInstance.breaks = valuesArray; - } - else if (valuesArray.length === 2) { - valuesArray.sort((a, b) => a - b); - - colorBrewerInstance.colors = tempBrew.colorSchemes[colorCode]['3']; - colorBrewerInstance.breaks = valuesArray; - - colorBrewerInstance.colors.shift(); // remove first element of array - } - else if (valuesArray.length === 1) { - valuesArray.sort((a, b) => a - b); - - colorBrewerInstance.colors = tempBrew.colorSchemes[colorCode]['3']; - colorBrewerInstance.breaks = valuesArray; - - colorBrewerInstance.colors.shift(); // remove first element of array - colorBrewerInstance.colors.shift(); // remove first element of array - } - else { - // no positive values - colorBrewerInstance = undefined; - } - - // round values - if (colorBrewerInstance && colorBrewerInstance.breaks){ - for (let index = 0; index < colorBrewerInstance.breaks.length; index++) { - colorBrewerInstance.breaks[index] = kommonitorDataExchangeService.getIndicatorValue_asNumber(colorBrewerInstance.breaks[index]); - } - } - - return colorBrewerInstance; - } - - this.setupGtMeasureOfValueBrew = function (greaterThanValues, colorCodeForGreaterThanValues, classifyMethod) { - - return setupClassyBrew_usingFeatureCount(greaterThanValues, colorCodeForGreaterThanValues, classifyMethod, 3); - - }; - - this.setupLtMeasureOfValueBrew = function (lesserThanValues, colorCodeForLesserThanValues, classifyMethod) { - - var brew = setupClassyBrew_usingFeatureCount(lesserThanValues, colorCodeForLesserThanValues, classifyMethod, 3); - if(brew && brew.colors && brew.colors.length > 1){ - brew.colors = brew.colors.reverse(); - } - return brew; - }; - - /** - * Returns and array of color brewer instances for dynamic increase and decrease colors - * - * [dynamicIncreaseBrew, dynamicDecreaseBrew] - */ - this.setupDynamicIndicatorBrew = function (geoJSON, propertyName, colorCodeForPositiveValues, colorCodeForNegativeValues, classifyMethod) { - - /* - * Idea: Analyse the complete geoJSON property array for each feature and make conclusion about how to build the legend - - e.g. if there are only positive values then display only positive values within 5 categories - same for only negative values - - e.g. if there are equally many positive as negative values then display both using 3 categories each - - e.g. if there are way more positive than negative values, then display both with 2 (negative) and 4 (positive) classes - - --> implement special cases (0, 1 or 2 negative/positive values --> apply colors manually) - --> treat all other cases equally to measureOfValue - */ - - this.resetFeaturesPerColorObjects(); - - this.positiveValues = []; - this.negativeValues = []; - - if(kommonitorDataExchangeService.classifyUsingWholeTimeseries){ - this.setupDynamicBrewValues_wholeTimeseries(geoJSON); - } - else{ - this.setupDynamicBrewValues_singleTimestamp(geoJSON, propertyName); - } - - var dynamicIncreaseBrew = setupDynamicIncreaseBrew(this.positiveValues, colorCodeForPositiveValues, classifyMethod); - var dynamicDecreaseBrew = setupDynamicDecreaseBrew(this.negativeValues, colorCodeForNegativeValues, classifyMethod); - - this.dynamicBrew = [dynamicIncreaseBrew, dynamicDecreaseBrew]; - return this.dynamicBrew; - }; - - this.setupDynamicBrewValues_wholeTimeseries = function(geoJSON){ - var indicatorTimeSeriesDatesArray = kommonitorDataExchangeService.selectedIndicator.applicableDates; - - for (const date of indicatorTimeSeriesDatesArray) { - var propertyName = __env.indicatorDatePrefix + date; - this.setupDynamicBrewValues_singleTimestamp(geoJSON, propertyName); - } - }; - - this.setupDynamicBrewValues_singleTimestamp = function(geoJSON, propertyName){ - for (var i = 0; i < geoJSON.features.length; i++) { - if (kommonitorDataExchangeService.indicatorValueIsNoData(geoJSON.features[i].properties[propertyName])) - continue; - - if(kommonitorDataExchangeService.classifyZeroSeparately && (geoJSON.features[i].properties[propertyName] == 0 || geoJSON.features[i].properties[propertyName] == "0")){ - continue; - } - - // check if is outlier, then do not use within classification, as it will be marked on map with special color - if (geoJSON.features[i].properties[outlierPropertyName] && geoJSON.features[i].properties[outlierPropertyName] !== outlierPropertyValue_no && kommonitorDataExchangeService.useOutlierDetectionOnIndicator) { - continue; - } - - else if (kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName]) >= 0){ - if(! this.positiveValues.includes(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName]))){ - this.positiveValues.push(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName])); - } - } - else if (kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName]) < 0){ - if(! this.negativeValues.includes(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName]))){ - this.negativeValues.push(kommonitorDataExchangeService.getIndicatorValue_asNumber(geoJSON.features[i].properties[propertyName])); - } - } - } - }; - - function setupDynamicIncreaseBrew(positiveValues, colorCodeForPositiveValues, classifyMethod) { - return setupClassyBrew_usingFeatureCount(positiveValues, colorCodeForPositiveValues, classifyMethod, 3); - } - - function setupDynamicDecreaseBrew(negativeValues, colorCodeForNegativeValues, classifyMethod) { - var brew = setupClassyBrew_usingFeatureCount(negativeValues, colorCodeForNegativeValues, classifyMethod, 3); - if(brew && brew.colors && brew.colors.length > 1){ - brew.colors = brew.colors.reverse(); - } - return brew; - } - - this.styleNoData = function(feature) { - this.featuresPerNoData ++; - return this.noDataStyle; - }; - - this.styleOutlier = function(feature) { - if ((feature.properties[outlierPropertyName] === outlierPropertyValue_low_soft) || (feature.properties[outlierPropertyName] === outlierPropertyValue_low_extreme)) { - - this.featuresPerOutlierLow ++; - return this.outlierStyle_low; - } - else { - - this.featuresPerOutlierHigh ++; - return this.outlierStyle_high; - } - }; - - this.getOpacity = function(opacity){ - - return defaultFillOpacity; - }; - - this.setOpacity = function(opacity){ - - opacity = Number(opacity); - this.indicatorTransparency = Number((1 - opacity).toFixed(numberOfDecimals)); - this.currentIndicatorOpacity = opacity; - - defaultFillOpacity = opacity; - defaultFillOpacityForOutliers_low = opacity; - defaultFillOpacityForOutliers_high = opacity; - defaultFillOpacityForZeroFeatures = opacity; - defaultFillOpacityForNoDataValues = opacity; - defaultFillOpacityForFilteredFeatures = opacity; - - $timeout(function(){ - $rootScope.$apply(); - }); - }; - - // style function to return - this.styleDefault = function(feature, defaultBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, propertyName, useTransparencyOnIndicator, datasetContainsNegativeValues) { - - // check if feature is NoData - if (kommonitorDataExchangeService.indicatorValueIsNoData(feature.properties[propertyName])) { - return this.styleNoData(feature); - } - - // check if feature is outlier - if ((feature.properties[outlierPropertyName] !== outlierPropertyValue_no) && kommonitorDataExchangeService.useOutlierDetectionOnIndicator) { - return this.styleOutlier(feature); - } - - var fillOpacity = 1; - if (useTransparencyOnIndicator) { - fillOpacity = defaultFillOpacity; - } - - var fillColor; - if (kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[propertyName] == 0 || feature.properties[propertyName] == "0")) { - fillColor = this.getFillColorForZero(); - if (useTransparencyOnIndicator) { - fillOpacity = defaultFillOpacityForZeroFeatures; - } - - } - else { - if (datasetContainsNegativeValues) { - if (kommonitorDataExchangeService.getIndicatorValue_asNumber(feature.properties[propertyName]) >= 0) { - if (kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[propertyName] == 0 || feature.properties[propertyName] == "0")) { - fillColor = this.getFillColorForZero(); - if (useTransparencyOnIndicator) { - fillOpacity = defaultFillOpacityForZeroFeatures; - } - } - else { - fillColor = this.findColorInRange(feature, propertyName, dynamicIncreaseBrew); - } - - return { - weight: 1, - opacity: 1, - color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColor, - dashArray: '', - fillOpacity: fillOpacity, - fillColor: fillColor, - fillPattern: undefined - }; - } - else { - - if (kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[propertyName] == 0 || feature.properties[propertyName] == "0")) { - fillColor = this.getFillColorForZero(); - if (useTransparencyOnIndicator) { - fillOpacity = defaultFillOpacityForZeroFeatures; - } - } - else { - // invert colors, so that lowest values will become strong colored! - fillColor = this.findColorInRange(feature, propertyName, dynamicDecreaseBrew); - } - - return { - weight: 1, - opacity: 1, - color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColor, - dashArray: '', - fillOpacity: fillOpacity, - fillColor: fillColor, - fillPattern: undefined - }; - } - } - else { - fillColor = this.findColorInRange(feature, propertyName, defaultBrew); - } - } - - return { - weight: 1, - opacity: 1, - color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColor, - dashArray: '', - fillOpacity: fillOpacity, - fillColor: fillColor, - fillPattern: undefined - }; - }; - - this.findColorInRange = function(feature, propertyName, colorBrewInstance){ - var color; - - for (var index = 0; index < colorBrewInstance.breaks.length; index++) { - if (kommonitorDataExchangeService.getIndicatorValue_asNumber(feature.properties[propertyName]) == kommonitorDataExchangeService.getIndicatorValue_asNumber(colorBrewInstance.breaks[index])) { - if (index < colorBrewInstance.breaks.length - 1) { - // min value - color = colorBrewInstance.colors[index]; - break; - } - else { - //max value - if (colorBrewInstance.colors[index]) { - color = colorBrewInstance.colors[index]; - } - else { - color = colorBrewInstance.colors[index - 1]; - } - break; - } - } - else { - if (kommonitorDataExchangeService.getIndicatorValue_asNumber(feature.properties[propertyName]) < kommonitorDataExchangeService.getIndicatorValue_asNumber(colorBrewInstance.breaks[index + 1])) { - color = colorBrewInstance.colors[index]; - break; - } - } - } - - this.incrementFeaturesPerColor(color); - - return color; - }; - - // this.findColorInRange_invertedColorGradient = function (feature, propertyName, colorBrewInstance){ - // var color; - - // for (var k = 0; k < colorBrewInstance.breaks.length; k++) { - // if (kommonitorDataExchangeService.getIndicatorValue_asNumber(feature.properties[propertyName]) == kommonitorDataExchangeService.getIndicatorValue_asNumber(colorBrewInstance.breaks[k])) { - // if (k < colorBrewInstance.breaks.length - 1) { - // // min value - // color = colorBrewInstance.colors[colorBrewInstance.colors.length - k - 1]; - // break; - // } - // else { - // //max value - // if (colorBrewInstance.colors[colorBrewInstance.colors.length - k]) { - // color = colorBrewInstance.colors[colorBrewInstance.colors.length - k]; - // } - // else { - // color = colorBrewInstance.colors[colorBrewInstance.colors.length - k - 1]; - // } - // break; - // } - // } - // else { - // if (kommonitorDataExchangeService.getIndicatorValue_asNumber(feature.properties[propertyName]) < kommonitorDataExchangeService.getIndicatorValue_asNumber(colorBrewInstance.breaks[k + 1])) { - // color = colorBrewInstance.colors[colorBrewInstance.colors.length - k - 1]; - // break; - // } - // } - // } - - // this.incrementFeaturesPerColor(color); - - // return color; - // }; - - this.styleMeasureOfValue = function(feature, gtMeasureOfValueBrew, ltMeasureOfValueBrew, propertyName, useTransparencyOnIndicator) { - - - // check if feature is NoData - if (kommonitorDataExchangeService.indicatorValueIsNoData(feature.properties[propertyName])) { - return this.styleNoData(feature); - } - - // check if feature is outlier - if ((feature.properties[outlierPropertyName] !== outlierPropertyValue_no) && kommonitorDataExchangeService.useOutlierDetectionOnIndicator) { - return this.styleOutlier(feature); - } - - var fillOpacity = 1; - if (useTransparencyOnIndicator) { - fillOpacity = defaultFillOpacity; - } - - var fillColor; - if (kommonitorDataExchangeService.getIndicatorValue_asNumber(feature.properties[propertyName]) >= kommonitorDataExchangeService.measureOfValue) { - - if (kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[propertyName] == 0 || feature.properties[propertyName] == "0")) { - fillColor = this.getFillColorForZero(); - if (useTransparencyOnIndicator) { - fillOpacity = defaultFillOpacityForZeroFeatures; - } - } - else { - - fillColor = this.findColorInRange(feature, propertyName, gtMeasureOfValueBrew); - } - - return { - weight: 1, - opacity: 1, - color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColor, - dashArray: '', - fillOpacity: fillOpacity, - fillColor: fillColor, - fillPattern: undefined - }; - } - else { - if (kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[propertyName] == 0 || feature.properties[propertyName] == "0")) { - fillColor = this.getFillColorForZero(); - if (useTransparencyOnIndicator) { - fillOpacity = defaultFillOpacityForZeroFeatures; - } - } - else { - // invert colors, so that lowest values will become strong colored! - fillColor = this.findColorInRange(feature, propertyName, ltMeasureOfValueBrew); - } - - return { - weight: 1, - opacity: 1, - color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColor, - dashArray: '', - fillOpacity: fillOpacity, - fillColor: fillColor, - fillPattern: undefined - }; - } - - }; - - this.styleDynamicIndicator = function(feature, dynamicIncreaseBrew, dynamicDecreaseBrew, propertyName, useTransparencyOnIndicator) { - - - - // check if feature is NoData - if (kommonitorDataExchangeService.indicatorValueIsNoData(feature.properties[propertyName])) { - return this.styleNoData(feature); - } - - // check if feature is outlier - if ((feature.properties[outlierPropertyName] !== outlierPropertyValue_no) && kommonitorDataExchangeService.useOutlierDetectionOnIndicator) { - return this.styleOutlier(feature); - } - - var fillOpacity = 1; - if (useTransparencyOnIndicator) { - fillOpacity = defaultFillOpacity; - } - - var fillColor; - if (kommonitorDataExchangeService.getIndicatorValue_asNumber(feature.properties[propertyName]) >= 0) { - - if (kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[propertyName] == 0 || feature.properties[propertyName] == "0")) { - fillColor = this.getFillColorForZero(); - if (useTransparencyOnIndicator) { - fillOpacity = defaultFillOpacityForZeroFeatures; - } - } - else { - fillColor = this.findColorInRange(feature, propertyName, dynamicIncreaseBrew); - } - - return { - weight: 1, - opacity: 1, - color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColor, - dashArray: '', - fillOpacity: fillOpacity, - fillColor: fillColor, - fillPattern: undefined - }; - } - else { - if (kommonitorDataExchangeService.classifyZeroSeparately && (feature.properties[propertyName] == 0 || feature.properties[propertyName] == "0")) { - fillColor = this.getFillColorForZero(); - if (useTransparencyOnIndicator) { - fillOpacity = defaultFillOpacityForZeroFeatures; - } - } - else { - // invert colors, so that lowest values will become strong colored! - fillColor = this.findColorInRange(feature, propertyName, dynamicDecreaseBrew); - } - - return { - weight: 1, - opacity: 1, - color: kommonitorDataExchangeService.selectedSpatialUnitIsRaster() ? undefined : defaultBorderColor, - dashArray: '', - fillOpacity: fillOpacity, - fillColor: fillColor, - fillPattern: undefined - }; - } - - }; - - }]); diff --git a/package-lock.json b/package-lock.json index 98f094d52..d1dcd2ebf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -100,6 +100,7 @@ "@types/angular-sanitize": "^1.8.1", "@types/jasmine": "^4.3.5", "@types/jquery": "^3.5.16", + "@types/node": "^20.4.8", "babel-core": "^6.26.0", "babel-plugin-angularjs-annotate": "^0.10.0", "babel-plugin-transform-es2015-destructuring": "^6.23.0", @@ -5709,9 +5710,10 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.16.19", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.16.19.tgz", - "integrity": "sha512-IXl7o+R9iti9eBW4Wg2hx1xQDig183jj7YLn8F7udNceyfkbn1ZxmzZXuak20gR40D7pIkIY1kYGx5VIGbaHKA==" + "version": "20.4.8", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.4.8.tgz", + "integrity": "sha512-0mHckf6D2DiIAzh8fM8f3HQCvMKDpK94YQ0DSVkfWTG9BZleYIWudw9cJxX8oCk9bM+vAkDyujDV6dmKHbvQpg==", + "dev": true }, "node_modules/@types/qs": { "version": "6.9.7", @@ -10589,6 +10591,11 @@ "node": ">=10" } }, + "node_modules/docx/node_modules/@types/node": { + "version": "18.17.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.3.tgz", + "integrity": "sha512-2x8HWtFk0S99zqVQABU9wTpr8wPoaDHZUcAkoTKH+nL7kPv3WUI9cRi/Kk5Mz4xdqXSqTkKP7IWNoQQYCnDsTA==" + }, "node_modules/dom-serializer": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", diff --git a/package.json b/package.json index 20a90cd4a..7d92f6a03 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "@types/angular-sanitize": "^1.8.1", "@types/jasmine": "^4.3.5", "@types/jquery": "^3.5.16", + "@types/node": "^20.4.8", "babel-core": "^6.26.0", "babel-plugin-angularjs-annotate": "^0.10.0", "babel-plugin-transform-es2015-destructuring": "^6.23.0", diff --git a/webpack.config.js b/webpack.config.js index c3df2f239..c90de5566 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -6,7 +6,7 @@ const nodeModulePathConstant = './node_modules/'; module.exports = { entry: { - app: "./app/app.js", + app: "./app/app.ajs.js", }, output: { path: __dirname + "/app/dependencies",