diff --git a/app/app-upgraded-providers.js b/app/app-upgraded-providers.js new file mode 100644 index 000000000..af96cf9e4 --- /dev/null +++ b/app/app-upgraded-providers.js @@ -0,0 +1,130 @@ +export function kommonitorCacheHelperServiceFactory(injector) { + return injector.get('kommonitorCacheHelperService'); +} +export const ajskommonitorCacheHelperServiceProvider = { + deps: ['$injector'], + provide: 'kommonitorCacheHelperService', + useFactory: kommonitorCacheHelperServiceFactory, +}; +export function kommonitorBatchUpdateHelperServiceFactory(injector) { + return injector.get('kommonitorBatchUpdateHelperService'); +} +export const ajskommonitorBatchUpdateHelperServiceProvider = { + deps: ['$injector'], + provide: 'kommonitorBatchUpdateHelperService', + useFactory: kommonitorBatchUpdateHelperServiceFactory, +}; +export function kommonitorConfigStorageServiceFactory(injector) { + return injector.get('kommonitorConfigStorageService'); +} +export const ajskommonitorConfigStorageServiceProvider = { + deps: ['$injector'], + provide: 'kommonitorConfigStorageService', + useFactory: kommonitorConfigStorageServiceFactory, +}; +//data exchange +export function kommonitorDataExchangeServiceFactory(injector) { + return injector.get('kommonitorDataExchangeService'); +} +export const ajskommonitorDataExchangeServiceeProvider = { + deps: ['$injector'], + provide: 'kommonitorDataExchangeService', + useFactory: kommonitorDataExchangeServiceFactory, +}; +//data grid helper +export function kommonitorDataGridHelperServiceFactory(injector) { + return injector.get('kommonitorDataGridHelperService'); +} +export const ajskommonitorDataGridHelperServiceProvider = { + deps: ['$injector'], + provide: 'kommonitorDataGridHelperService', + useFactory: kommonitorDataGridHelperServiceFactory, +}; +//diagram helper +export function kommonitorDiagramHelperServiceFactory(injector) { + return injector.get('kommonitorDiagramHelperService'); +} +export const ajskommonitorDiagramHelperServiceProvider = { + deps: ['$injector'], + provide: 'kommonitorDiagramHelperService', + useFactory: kommonitorDiagramHelperServiceFactory, +}; +//filter helper +export function kommonitorFilterHelperServiceFactory(injector) { + return injector.get('kommonitorFilterHelperService'); +} +export const ajskommonitorFilterHelperServiceProvider = { + deps: ['$injector'], + provide: 'kommonitorFilterHelperService', + useFactory: kommonitorFilterHelperServiceFactory, +}; +//keycloack helper +export function kommonitorKeycloackHelperServiceFactory(injector) { + return injector.get('kommonitorKeycloackHelperService'); +} +export const ajskommonitorKeycloackHelperServiceProvider = { + deps: ['$injector'], + provide: 'kommonitorKeycloackHelperService', + useFactory: kommonitorKeycloackHelperServiceFactory, +}; +//multistep form +export function kommonitorMultiStepFormHelperServiceFactory(injector) { + return injector.get('kommonitorMultiStepFormHelperService'); +} +export const ajskommonitorMultiStepFormHelperServiceProvider = { + deps: ['$injector'], + provide: 'kommonitorMultiStepFormHelperService', + useFactory: kommonitorMultiStepFormHelperServiceFactory, +}; +//script helpet +export function kommonitorScriptHelperServiceFactory(injector) { + return injector.get('kommonitorScriptHelperService'); +} +export const ajskommonitorScriptHelperServiceProvider = { + deps: ['$injector'], + provide: 'kommonitorScriptHelperService', + useFactory: kommonitorScriptHelperServiceFactory, +}; +//share Helper +export function kommonitorShareHelperServiceFactory(injector) { + return injector.get('kommonitorShareHelperService'); +} +export const ajskommonitorShareHelperServiceProvider = { + deps: ['$injector'], + provide: 'kommonitorShareHelperService', + useFactory: kommonitorShareHelperServiceFactory, +}; +//single feature map helper +export function kommonitorSingleFeatureMapServiceFactory(injector) { + return injector.get('kommonitorSingleFeatureMapService'); +} +export const ajskommonitorSingleFeatureMapServiceProvider = { + deps: ['$injector'], + provide: 'kommonitorSingleFeatureMapService', + useFactory: kommonitorSingleFeatureMapServiceFactory, +}; +//visually style helper +export function kommonitorVisualStyleHelperServiceFactory(injector) { + return injector.get('kommonitorVisualStyleHelperService'); +} +export const ajskommonitorVisualStyleHelperServiceProvider = { + deps: ['$injector'], + provide: 'kommonitorVisualStyleHelperService', + useFactory: kommonitorVisualStyleHelperServiceFactory, +}; +export const serviceProviders = [ + ajskommonitorCacheHelperServiceProvider, + ajskommonitorBatchUpdateHelperServiceProvider, + ajskommonitorConfigStorageServiceProvider, + ajskommonitorDataExchangeServiceeProvider, + ajskommonitorDataGridHelperServiceProvider, + ajskommonitorDiagramHelperServiceProvider, + ajskommonitorFilterHelperServiceProvider, + ajskommonitorKeycloackHelperServiceProvider, + ajskommonitorMultiStepFormHelperServiceProvider, + ajskommonitorScriptHelperServiceProvider, + ajskommonitorShareHelperServiceProvider, + ajskommonitorSingleFeatureMapServiceProvider, + ajskommonitorVisualStyleHelperServiceProvider +]; +//# sourceMappingURL=app-upgraded-providers.js.map \ No newline at end of file diff --git a/app/app-upgraded-providers.js.map b/app/app-upgraded-providers.js.map new file mode 100644 index 000000000..2bada0d1b --- /dev/null +++ b/app/app-upgraded-providers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"app-upgraded-providers.js","sourceRoot":"","sources":["app-upgraded-providers.ts"],"names":[],"mappings":"AAiBA,MAAM,UAAU,mCAAmC,CAAC,QAAY;IAC5D,OAAO,QAAQ,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;AACxD,CAAC;AACD,MAAM,CAAC,MAAM,uCAAuC,GAAQ;IACxD,IAAI,EAAE,CAAC,WAAW,CAAC;IACnB,OAAO,EAAE,8BAA8B;IACvC,UAAU,EAAC,mCAAmC;CAC/C,CAAC;AAGJ,MAAM,UAAU,yCAAyC,CAAE,QAAY;IACnE,OAAO,QAAQ,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAA;AAC7D,CAAC;AAED,MAAM,CAAC,MAAM,6CAA6C,GAAQ;IAC9D,IAAI,EAAE,CAAC,WAAW,CAAC;IACnB,OAAO,EAAE,oCAAoC;IAC7C,UAAU,EAAC,yCAAyC;CACrD,CAAC;AAEF,MAAM,UAAU,qCAAqC,CAAE,QAAY;IACjE,OAAO,QAAQ,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAA;AACzD,CAAC;AAED,MAAM,CAAC,MAAM,yCAAyC,GAAQ;IAC1D,IAAI,EAAE,CAAC,WAAW,CAAC;IACnB,OAAO,EAAE,gCAAgC;IACzC,UAAU,EAAC,qCAAqC;CACjD,CAAC;AACJ,eAAe;AACb,MAAM,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7D,CAAC;AAED,MAAM,CAAC,MAAM,6CAA6C,GAAQ;IAC9D,IAAI,EAAE,CAAC,WAAW,CAAC;IACnB,OAAO,EAAE,oCAAoC;IAC7C,UAAU,EAAC,yCAAyC;CACrD,CAAC;AAQF,MAAM,CAAC,MAAM,gBAAgB,GAAU;IACrC,uCAAuC;IACxC,6CAA6C;IAC5C,yCAAyC;IACzC,yCAAyC;IACzC,0CAA0C;IAC1C,yCAAyC;IACzC,wCAAwC;IAC5C,2CAA2C;IAC3C,+CAA+C;IAC/C,wCAAwC;IACxC,uCAAuC;IACvC,4CAA4C;IAC5C,6CAA6C;CAC1C,CAAC"} \ No newline at end of file diff --git a/app/app-upgraded-providers.ts b/app/app-upgraded-providers.ts index 025d6c4f0..d11794ce1 100644 --- a/app/app-upgraded-providers.ts +++ b/app/app-upgraded-providers.ts @@ -15,6 +15,9 @@ import {kommonitorShareHelperService} from 'util/genericServices/kommonitorShare 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' + +//cache helper service + export function kommonitorCacheHelperServiceFactory(injector:any){ return injector.get('kommonitorCacheHelperService'); } @@ -24,7 +27,7 @@ export const ajskommonitorCacheHelperServiceProvider: any = { useFactory:kommonitorCacheHelperServiceFactory , }; - + //batch update helper service export function kommonitorBatchUpdateHelperServiceFactory (injector:any){ return injector.get('kommonitorBatchUpdateHelperService') } @@ -35,6 +38,7 @@ export const ajskommonitorBatchUpdateHelperServiceProvider: any = { useFactory:kommonitorBatchUpdateHelperServiceFactory , }; + //config storage export function kommonitorConfigStorageServiceFactory (injector:any){ return injector.get('kommonitorConfigStorageService') } @@ -65,9 +69,8 @@ export const ajskommonitorDataGridHelperServiceProvider: any = { useFactory:kommonitorDataGridHelperServiceFactory, }; //diagram helper - export function kommonitorDiagramHelperServiceFactory (injector:any){ - return injector.get('kommonitorDiagramHelperService') -} + +export const kommonitorDiagramHelperServiceFactory = (injector: any) => injector.get('KommonitorDiagramHelperService'); export const ajskommonitorDiagramHelperServiceProvider: any = { deps: ['$injector'], diff --git a/app/app.module.js b/app/app.module.js new file mode 100644 index 000000000..8ce767982 --- /dev/null +++ b/app/app.module.js @@ -0,0 +1,453 @@ +import { __decorate } from "tslib"; +import { NgModule } from '@angular/core'; +import { BrowserModule } from '@angular/platform-browser'; +import { UpgradeModule } from '@angular/upgrade/static'; +import { downgradeComponent } from '@angular/upgrade/static'; +import * as $ from 'jquery'; +import Keycloak from 'keycloak-js'; +import angular from "angular"; +import { RouterModule } from '@angular/router'; +import { HashLocationStrategy, LocationStrategy } from '@angular/common'; +import { NgxEchartsModule } from 'ngx-echarts'; +import { EchartsxModule } from 'echarts-for-angular'; +import { InfoModalComponent } from 'components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.component'; +import { VersionInfoComponent } from 'components/kommonitorUserInterface/kommonitorControls/versionInfo/version-info.component'; +import { KommonitorDiagramsComponent } from 'components/kommonitorUserInterface/kommonitorControls/kommonitorDiagrams/kommonitor-diagrams.component'; +// 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'; +// currently the AngularJS routing is still used as part of kommonitorClient module +const routes = []; +export let AppModule = class AppModule { + constructor(upgrade) { + this.upgrade = upgrade; + this.env = {}; + } + async ngDoBootstrap() { + this.checkBrowser(); + await this.loadConfigs(); + // instantiate env variable + this.env = window.__env || {}; + this.downgradeDependencies(); + // initialize kommonitorClient module + await this.initKomMonitorClientModule(); + // init keycloak authentication + await this.initKeycloak(); + this.upgrade.bootstrap(document.documentElement, ['kommonitorClient']); + // setUpLocationSync(this.upgrade); + } + downgradeDependencies() { + // to inject already upgraded KomMonitor Angular components into "old" AngluarJS components, we must do 2 things + // 1. downgrade the new Angular component and register it as directive within each requiring AngularJS module/component + // --> this especially means all components, where the downgraded component is used within the HTML part as directive + // 2. in order to prevent no module errors we must remove the old module reference within the .module file of the AngularJS modules/components + angular.module('kommonitorUserInterface') + .directive('infoModal', downgradeComponent({ component: InfoModalComponent })); + angular.module('kommonitorUserInterface') + .directive('versionInfo', downgradeComponent({ component: VersionInfoComponent })); + angular.module('kommonitorUserInterface') + .directive('kommonitor-diagrams', downgradeComponent({ component: KommonitorDiagramsComponent })); + console.log("registered downgraded Angular components for AngularJS usage"); + } + checkBrowser() { + 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.'); + } + } + async loadConfigs() { + console.log("start loading required config files"); + let self = this; + await $.when(this.ajaxCall_keycloakConfig_localBackup(window.__env.configStorageServerConfig), this.ajaxCall_controlsConfig_localBackup(window.__env.configStorageServerConfig)).then(async function (ajax1Results, ajax2Results) { + console.log("local backup configs have been loaded in case config server is not reachable."); + await self.ajaxCall_configServerFile(); + }, async function () { + // on fail + console.log("all configs have been loaded - at least some from local backup values. See console log for details"); + await self.ajaxCall_configServerFile(); + }); + } + ; + /* + LOAD CONFIG FILES FROM CONFIG STORAGE SERVER + */ + 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"); + } + }); + } + 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"); + } + }); + } + 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 + */ + 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"); + } + }); + } + 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"); + } + }); + } + 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); + }); + } + initEnvVariables() { + // Import variables if present (from env.js) + if (window) { + Object.assign(this.env, window.__env); + } + if (!this.env.enableDebug) { + if (window) { + window.console.log = function () { }; + } + } + } + ajaxCall_configServerFile() { + let self = this; + 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 = self.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(self.ajaxCall_keycloakConfig(window.__env.configStorageServerConfig), self.ajaxCall_controlsConfig(window.__env.configStorageServerConfig), self.ajaxCall_appConfig(window.__env.configStorageServerConfig)).then(function (ajax1Results, ajax2Results, ajax3Results) { + console.log("all configs have been loaded"); + self.initEnvVariables(); + return; + }, function () { + // on fail + console.log("all configs have been loaded - at least some from local backup values. See console log for details"); + self.initEnvVariables(); + return; + }); + } + }); + } + initKomMonitorClientModule() { + let self = this; + // Register environment in AngularJS as constant + angular.module('kommonitorClient').constant('__env', window.__env); + // MathJx directive + angular.module('kommonitorClient').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 + angular.module('kommonitorClient').filter('unique', function () { + return function (collection, primaryKey) { + var output = [], keys = []; + var splitKeys = primaryKey.split('.'); //split by period + angular.forEach(collection, function (item) { + let key = ""; + angular.copy(item, key); + for (var i = 0; i < splitKeys.length; i++) { + key = key[splitKeys[i]]; + } + if (keys.indexOf(key) === -1) { + keys.push(key); + output.push(item); + } + }); + return output; + }; + }); + angular.module('kommonitorClient').service("ControlsConfigService", ['$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; + } + }; + }]); + // init/configure SPA routing + angular.module('kommonitorClient'). + config(['$routeProvider', '$locationProvider', + function config($routeProvider, $locationProvider) { + $locationProvider.hashPrefix('!'); + $routeProvider. + when('/', { + template: '', + resolve: { + "ControlsConfigService": 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() + }); + } + } + } + } + }) + .otherwise('/'); + } + ]); + // register auth interceptor to refresh Keycloak login on each user request + angular.module('kommonitorClient').factory('authInterceptor', ['$q', 'Auth', function ($q, Auth) { + return { + request: function (config) { + var deferred = $q.defer(); + if (Auth.keycloak.token && self.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; + } + } + }; + }]); + angular.module('kommonitorClient').config(['$httpProvider', function ($httpProvider) { + $httpProvider.interceptors.push('authInterceptor'); + }]); + } + urlRequiresKeycloakAuthHeader(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; + } + ; + isBase64(str) { + var notBase64 = /[^A-Z0-9+\/=]/i; + 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] === '='); + } + ; + // private decryptAesCBC(encryptedString: string) { + // var hashedKey = CryptoJS.SHA256(this.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, (this.env.encryption.ivLength_byte) / 4) + // ); + // var decrypted = CryptoJS.AES.decrypt( + // { + // ciphertext: CryptoJS.lib.WordArray.create( + // encryptedWordArray.words.slice(this.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' && this.isBase64(decryptedJson)) { + // decryptedJson = CryptoJS.enc.Base64.parse(decryptedJson).toString(CryptoJS.enc.Utf8); + // decryptedJson = JSON.parse(decryptedJson); + // } + // return decryptedJson; + // }; + async initKeycloak() { + let auth = { + keycloak: {} + }; + 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 + return await 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; + angular.module('kommonitorClient').factory('Auth', function () { + return auth; + }); + try { + console.debug('Trying to bootstrap application.'); + } + 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'); + }); + } + } +}; +AppModule = __decorate([ + NgModule({ + imports: [ + BrowserModule, + UpgradeModule, + RouterModule.forRoot(routes, { useHash: true }), + NgxEchartsModule.forRoot({ + echarts: () => import('echarts') + }), + EchartsxModule, + // InfoModalModule, + // VersionInfoModule + ], + providers: [ + { provide: LocationStrategy, useClass: HashLocationStrategy }, + ajskommonitorCacheHelperServiceProvider, ajskommonitorBatchUpdateHelperServiceProvider, + ajskommonitorConfigStorageServiceProvider, ajskommonitorKeycloackHelperServiceProvider, + ajskommonitorMultiStepFormHelperServiceProvider, ajskommonitorDataExchangeServiceeProvider, + ajskommonitorDataGridHelperServiceProvider, ajskommonitorSingleFeatureMapServiceProvider, + ajskommonitorDiagramHelperServiceProvider, ajskommonitorFilterHelperServiceProvider, + ], + declarations: [ + InfoModalComponent, + VersionInfoComponent, + KommonitorDiagramsComponent + ] + }) +], 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..2c0ce8637 ---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AO,IAAI,CAAC;gBACd,CAAC,CAAC,CAAC;gBACH,IAAI;oBACF,OAAO,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;iBACnD;gBACD,OAAO,CAAC,EAAE;oBACR,OAAO,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;oBACnD,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;iBAClB;YACH,CAAC,CAAC,CAAC,KAAK,CAAC;gBACP,OAAO,CAAC,GAAG,CAAC,0GAA0G,CAAC,CAAC;gBACxH,KAAK,CAAC,mHAAmH,CAAC,CAAC;YAC7H,CAAC,CAAC,CAAC;SACJ;IACH,CAAC;CAEF,CAAA;AAteY,SAAS;IA5BrB,QAAQ,CAAC;QACR,OAAO,EAAE;YACP,aAAa;YACb,aAAa;YACb,YAAY,CAAC,OAAO,CAAC,MAAM,EAAG,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;YAClD,gBAAgB,CAAC,OAAO,CAAC;gBACvB,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC;aACjC,CAAC;YACF,cAAc;YACZ,mBAAmB;YACnB,oBAAoB;SACrB;QACD,SAAS,EAAC;YACR,EAAC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,oBAAoB,EAAC;YAC3D,uCAAuC,EAAC,6CAA6C;YACrF,yCAAyC,EAAC,2CAA2C;YACrF,+CAA+C,EAAC,yCAAyC;YACzF,0CAA0C,EAAC,4CAA4C;YACvF,yCAAyC,EAAC,wCAAwC;SACnF;QAED,YAAY,EAAE;YACZ,kBAAkB;YAClB,oBAAoB;YACtB,2BAA2B;SAC1B;KACF,CAAC;GAEW,SAAS,CAserB"} \ No newline at end of file diff --git a/app/app.module.ts b/app/app.module.ts index dcbea29be..26aea6d48 100644 --- a/app/app.module.ts +++ b/app/app.module.ts @@ -13,11 +13,14 @@ import { NgxEchartsModule } from 'ngx-echarts'; import { EchartsDirective, EchartsxModule } from 'echarts-for-angular'; import { InfoModalComponent } from 'components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.component'; import { VersionInfoComponent } from 'components/kommonitorUserInterface/kommonitorControls/versionInfo/version-info.component'; +import { KommonitorDiagramsComponent } from 'components/kommonitorUserInterface/kommonitorControls/kommonitorDiagrams/kommonitor-diagrams.component'; +import { IndicatorRadarComponent } from 'components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar'; // import { InfoModalModule } from 'components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.module'; // import { VersionInfoModule } from 'components/kommonitorUserInterface/kommonitorControls/versionInfo/version-info.module'; +import { RegressionDiagramComponent } from 'components/kommonitorUserInterface/kommonitorControls/regressionDiagram/regression-diagram.component'; import { ajskommonitorCacheHelperServiceProvider,ajskommonitorBatchUpdateHelperServiceProvider,ajskommonitorConfigStorageServiceProvider,ajskommonitorDataExchangeServiceeProvider,ajskommonitorDataGridHelperServiceProvider,ajskommonitorDiagramHelperServiceProvider,ajskommonitorFilterHelperServiceProvider,ajskommonitorKeycloackHelperServiceProvider,ajskommonitorMultiStepFormHelperServiceProvider, ajskommonitorSingleFeatureMapServiceProvider } from 'app-upgraded-providers'; //import { KommonitorDiagramsComponent } from 'components/kommonitorUserInterface/kommonitorControls/kommonitorDiagrams/kommonitor-diagrams.component'; -import { KommonitorDiagramsModule } from 'components/kommonitorUserInterface/kommonitorControls/kommonitorDiagrams/kommonitor-diagrams.module'; + // currently the AngularJS routing is still used as part of kommonitorClient module const routes: Routes = []; @@ -28,7 +31,6 @@ declare var MathJax; BrowserModule, UpgradeModule, RouterModule.forRoot(routes , { useHash: true }), - KommonitorDiagramsModule, NgxEchartsModule.forRoot({ echarts: () => import('echarts') }), @@ -47,17 +49,28 @@ declare var MathJax; declarations: [ InfoModalComponent, - + VersionInfoComponent, + KommonitorDiagramsComponent, + IndicatorRadarComponent, + RegressionDiagramComponent + + + ] }) export class AppModule implements DoBootstrap { + + + + private env: any = {}; constructor(private upgrade: UpgradeModule) { } + async ngDoBootstrap() { this.checkBrowser(); @@ -90,9 +103,11 @@ export class AppModule implements DoBootstrap { angular.module('kommonitorUserInterface') .directive('versionInfo', downgradeComponent({ component: VersionInfoComponent }) as angular.IDirectiveFactory); + + - //angular.module('kommonitorUserInterface') - //.directive('kommonitor-diagrams', downgradeComponent({ component: KommonitorDiagramsComponent }) as angular.IDirectiveFactory); + angular.module('kommonitorUserInterface') + .directive('kommonitorDiagrams', downgradeComponent({ component: KommonitorDiagramsComponent }) as angular.IDirectiveFactory); console.log("registered downgraded Angular components for AngularJS usage"); } @@ -534,4 +549,8 @@ export class AppModule implements DoBootstrap { } } + + + + } \ No newline at end of file diff --git a/app/components/kommonitorUserInterface/kommonitor-user-interface.module.js b/app/components/kommonitorUserInterface/kommonitor-user-interface.module.js index 38c7f98b4..310280377 100644 --- a/app/components/kommonitorUserInterface/kommonitor-user-interface.module.js +++ b/app/components/kommonitorUserInterface/kommonitor-user-interface.module.js @@ -1,6 +1,6 @@ "use strict"; -angular.module('kommonitorUserInterface', ['kommonitorMap', 'kommonitorDataSetup', +angular.module('kommonitorUserInterface', ['kommonitorMap', 'kommonitorDataSetup', 'kommonitorAdmin', 'kommonitorIndividualIndicatorComputation', 'kommonitorDiagrams', 'indicatorRadar', 'regressionDiagram', 'kommonitorFilter', 'kommonitorBalance', - 'kommonitorReachability', 'poi', 'spatialUnitNotificationModal', 'feedbackModal', 'reportingModal', 'wmsModal', 'wfsModal', 'kommonitorDataImport', + '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/kommonitorControls/indicatorRadar/indicator-radar.component.js b/app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.component.js index 57b899a81..6f79825e1 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.component.js +++ b/app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.component.js @@ -77,6 +77,7 @@ angular } modifyRadarContent(kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime); }; + //here $scope.onChangeSelectedDate = function (input) { if (input.isSelected) { modifyRadarContent(kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime); diff --git a/app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.component.ts b/app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.component.ts deleted file mode 100644 index 95cceef81..000000000 --- a/app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.component.ts +++ /dev/null @@ -1,612 +0,0 @@ -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.ts b/app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.module.ts index 4358673cd..5ffb451cc 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.module.ts +++ b/app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.module.ts @@ -1 +1,16 @@ -angular.module('indicatorRadar', [ 'kommonitorDataExchange', 'kommonitorDiagramHelper']); +// indicator-radar.module.ts + +import { NgModule } from '@angular/core'; +import { ajskommonitorDiagramHelperServiceProvider } from 'app-upgraded-providers'; +import { ajskommonitorDataExchangeServiceeProvider } from 'app-upgraded-providers'; +import { ajskommonitorFilterHelperServiceProvider } from 'app-upgraded-providers'; +import { IndicatorRadarComponent } from './indicator-radar'; +@NgModule({ + imports: [ + + ], + providers: [ajskommonitorDiagramHelperServiceProvider,ajskommonitorDataExchangeServiceeProvider,ajskommonitorFilterHelperServiceProvider], + declarations: [IndicatorRadarComponent], + exports: [] +}) +export class IndicatorRadarModule { } diff --git a/app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.ts b/app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.ts new file mode 100644 index 000000000..2c9eda4c1 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/indicatorRadar/indicator-radar.ts @@ -0,0 +1,571 @@ +import { Component, OnInit, OnDestroy, ViewChild, ElementRef, Inject,AfterViewInit } from '@angular/core'; +import { Subscription, fromEvent } from 'rxjs'; +import { environment } from 'env_backup'; +import * as echarts from 'echarts'; +import { Subject } from 'rxjs'; +import { takeUntil } from 'rxjs/operators'; +import { ajskommonitorDataExchangeServiceeProvider, ajskommonitorDiagramHelperServiceProvider, ajskommonitorFilterHelperServiceProvider } from 'app-upgraded-providers'; +@Component({ + selector: 'app-indicator-radar', + templateUrl: 'indicator-radar.template.html', + providers:[ajskommonitorDataExchangeServiceeProvider,ajskommonitorDiagramHelperServiceProvider,ajskommonitorFilterHelperServiceProvider] +}) +export class IndicatorRadarComponent implements OnInit, OnDestroy, AfterViewInit { + @ViewChild('radarDiagram', { static: false }) radarDiagram: ElementRef | undefined; + private destroy$ = new Subject(); + setupCompleted = false; + private ngUnsubscribe: Subject = new Subject(); + eventsRegistered=false + private resizeSubscription= new Subscription; + public activeTab = 0; + // public radarChart; + radarOption; + private DATE_PREFIX = environment.indicatorDatePrefix; + public indicatorNameFilter = undefined; + private numberOfDecimals = environment.numberOfDecimals; + public date=''; + public spatialUnitName:string | undefined; + public indicatorPropertiesForCurrentSpatialUnitAndTime: any[] = []; + @ViewChild('radarChart') radarChart: any; + + FEATURE_ID_PROPERTY_NAME = environment.FEATURE_ID_PROPERTY_NAME; + defaultSeriesValueArray: any[] = []; + resizeTimeout: any; + + + constructor( + @Inject('ajsKommonitorDataExchangeService') private kommonitorDataExchangeService:any, + @Inject('ajsKommonitorDiagramHelperService') private kommonitorDiagramHelperService:any, + @Inject('ajsKommonitorFilterHelperService') private kommonitorFilterHelperService:any, + + ) { + + } + + ngOnInit() { + // Your initialization logic + $('.box').boxWidget(); + + $(window).on('resize', this.resizeChart.bind(this)); + + // subscribe to the "resizeDiagrams" event + // assuming that it's a Subject in your service + this.kommonitorDiagramHelperService.resizeDiagrams.subscribe(() => { + this.resizeTimeout = setTimeout(this.resizeChart.bind(this), 350); + }); + + this.kommonitorDiagramHelperService.allIndicatorPropertiesForCurrentSpatialUnitAndTimeSetupBegin$ + .pipe(takeUntil(this.destroy$)) + .subscribe(async () => { + await this.wait(130); + this.setupCompleted = false; + setTimeout(() => this.filterDisplayedIndicatorsOnRadar(), 500); + }); + + this.kommonitorDiagramHelperService.allIndicatorPropertiesForCurrentSpatialUnitAndTimeSetupCompleted$ + .pipe(takeUntil(this.destroy$)) + .subscribe(async () => { + await this.wait(130); + this.setupCompleted = true; + setTimeout(() => this.filterDisplayedIndicatorsOnRadar(), 500); + }); + + + } + resizeChart() { + if (this.radarChart) { + this.radarChart.resize(); + } + } + + ngAfterViewInit() { + this.resizeSubscription = fromEvent(window, 'resize').subscribe(e => { + if (this.radarChart) { + this.radarChart.resize(); + } + }); + } + + + ngOnDestroy() { + this.resizeSubscription.unsubscribe(); + this.destroy$.next(); + this.destroy$.complete(); + $(window).off('resize', this.resizeChart.bind(this)); + if (this.resizeTimeout) { + clearTimeout(this.resizeTimeout); + } + } + + onChangeFilterSameUnitAndSameTime() { + if (this.radarChart && this.radarDiagram && this.radarDiagram.nativeElement) { + this.radarChart.dispose(); + this.radarChart = echarts.init(this.radarDiagram.nativeElement); + } + + this.kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime = []; + this.kommonitorDiagramHelperService.setupIndicatorPropertiesForCurrentSpatialUnitAndTime(this.kommonitorDiagramHelperService.filterSameUnitAndSameTime); + } + + updateDiagrams(event, indicatorMetadataAndGeoJSON, spatialUnitName, spatialUnitId, date, defaultBrew, gtMeasureOfValueBrew, ltMeasureOfValueBrew, dynamicIncreaseBrew, dynamicDecreaseBrew, isMeasureOfValueChecked, measureOfValue, justRestyling) { + if (justRestyling) { + return; + } + console.log("updating radar diagram"); + this.setupCompleted = false; + this.updateRadarChart(indicatorMetadataAndGeoJSON, spatialUnitName, spatialUnitId, date); + // this.preserveHighlightedFeatures.emit(); + } + + async updateRadarChart(indicatorMetadataAndGeoJSON: any, spatialUnitName: string, spatialUnitId: string, date: any) { + this.date = date; + this.spatialUnitName = spatialUnitName; + + if (!this.radarChart) { + this.radarChart = echarts.init(document.getElementById('radarDiagram')); + } else { + this.radarChart.dispose(); + this.radarChart = echarts.init(document.getElementById('radarDiagram')); + this.indicatorPropertiesForCurrentSpatialUnitAndTime = []; + } + + await this.radarChart.showLoading(); + this.kommonitorDiagramHelperService.setupIndicatorPropertiesForCurrentSpatialUnitAndTime(); + + this.activeTab = 0; + + if (this.kommonitorDataExchangeService.selectedIndicator.creationType === 'COMPUTATION') { + this.activeTab = 1; + } + + if (this.kommonitorDataExchangeService.selectedIndicator.isHeadlineIndicator) { + this.activeTab = 2; + } + + this.modifyRadarContent(this.indicatorPropertiesForCurrentSpatialUnitAndTime); + } + + private wait(ms: number): Promise { + return new Promise(resolve => setTimeout(resolve, ms)); + } + onChangeSelectedDate(input: any): void { + if (input.isSelected) { + this.modifyRadarContent(this.kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime); + } + } + appendSelectedFeaturesIfNecessary(sampleProperties: any[]) { // adjust the type of sampleProperties + for (const propertiesInstance of sampleProperties) { + if (this.kommonitorFilterHelperService.featureIsCurrentlySelected(propertiesInstance[environment.FEATURE_ID_PROPERTY_NAME])) { + this.appendSeriesToRadarChart(propertiesInstance); + } + } + } + async modifyRadarContent(indicatorsForRadar: any[]): Promise { + const indicatorArrayForRadarChart:any[] = []; + const defaultSeriesValueArray: any[] = []; + let sampleProperties:any = undefined; + + + for (let i = 0; i < indicatorsForRadar.length; i++) { + if (indicatorsForRadar[i].isSelected) { + await this.kommonitorDiagramHelperService.fetchIndicatorPropertiesIfNotExists(i); + let indicatorProperties = indicatorsForRadar[i].indicatorProperties; + if (this.kommonitorFilterHelperService.completelyRemoveFilteredFeaturesFromDisplay && this.kommonitorFilterHelperService.filteredIndicatorFeatureIds.size > 0) { + indicatorProperties = indicatorProperties.filter(featureProperties => !this.kommonitorFilterHelperService.featureIsCurrentlyFiltered(featureProperties[this.FEATURE_ID_PROPERTY_NAME])); + } + sampleProperties = indicatorsForRadar[i].indicatorProperties; + const sample = indicatorProperties[0]; + let maxValue = sample[this.DATE_PREFIX + indicatorsForRadar[i].selectedDate]; + let minValue = sample[this.DATE_PREFIX + indicatorsForRadar[i].selectedDate]; + let valueSum = 0; + + for (const indicatorPropertyInstance of indicatorProperties) { + if (!this.kommonitorDataExchangeService.indicatorValueIsNoData(indicatorPropertyInstance[this.DATE_PREFIX + indicatorsForRadar[i].selectedDate])) { + const value = this.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; + } + let object = { + name: indicatorsForRadar[i].indicatorMetadata.indicatorName + " - " + indicatorsForRadar[i].selectedDate, + unit: indicatorsForRadar[i].indicatorMetadata.unit, + max:maxValue, + min: minValue + }; + indicatorArrayForRadarChart.push(object); + defaultSeriesValueArray.push(this.kommonitorDataExchangeService.getIndicatorValue_asNumber(Number(valueSum / indicatorProperties.length))); + } + };//end of for loop + if (this.defaultSeriesValueArray.length === 0) { + this.disposeRadarChart(); + } + else + { + if (!this.radarChart) { + this.radarChart = echarts.init(document.getElementById('radarDiagram')); + } + this.radarOption = { + grid: { + left: '4%', + top: 0, + right: '4%', + bottom: 30, + containLabel: true + }, + title: { + text: 'Indikatorenradar - ' + this.spatialUnitName + ' - ' + this.date, + left: 'center', + top: 0, + show: false + }, + tooltip: { + confine: 'true', + formatter: (params) => { + let string = "" + params.name + "
"; + for (let index = 0; index < params.value.length; index++) { + string += this.radarOption.radar.indicator[index].name + ": " + this.kommonitorDataExchangeService.getIndicatorValue_asFormattedText(params.value[index]) + " [" + this.radarOption.radar.indicator[index].unit + "]
"; + } + return string; + } + }, + toolbox :{ + show: true, + right: '15', + feature: { + dataView: { + show: this.kommonitorDataExchangeService.showDiagramExportButtons, + readOnly: true, + title: "Datenansicht", + lang: ['Datenansicht - Indikatorenradar', 'schließen', 'refresh'], + optionToContent: (opt: any) => { + let radarSeries = opt.series[0].data; + let indicators = opt.radar[0].indicator; + let dataTableId = "radarDataTable"; + let tableExportName = opt.title[0].text; + let htmlString = ''; + htmlString += ""; + htmlString += ""; + htmlString += ""; + for (let i = 0; i < indicators.length; i++) { + htmlString += ""; + } + htmlString += ""; + htmlString += ""; + htmlString += ""; + for (let j = 0; j < radarSeries.length; j++) { + htmlString += ""; + htmlString += ""; + for (let k = 0; k < indicators.length; k++) { + htmlString += ""; + } + htmlString += ""; + } + htmlString += ""; + htmlString += "
Feature-Name" + indicators[i].name + " [" + indicators[i].unit + "]
" + radarSeries[j].name + "" + this.kommonitorDataExchangeService.getIndicatorValue_asNumber(radarSeries[j].value[k]) + "
"; + // Broadcast event to append export buttons for table + // $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 : { + name: { + formatter: (value: any, indicator: any) => { + return this.kommonitorDataExchangeService.formatIndicatorNameForLabel(value, 15); + }, + textStyle: { + color: '#525252' + }, + fontSize: 11 + }, + indicator: [] // indicatorArrayForRadarChart + }, + series:[{ + name: 'Indikatorvergleich', + type: 'radar', + symbolSize: 8, + data: [ + { + value: this.defaultSeriesValueArray, + name: 'Arithmetisches Mittel', + lineStyle: { + color: 'gray', + type: 'dashed', + width: 3 + }, + itemStyle: { + borderWidth: 2, + color: 'gray' + }, + emphasis: { + lineStyle: { + width: 4 + }, + itemStyle: { + borderType: 'dashed' + } + } + } + ] + }] + + + + // Add other options here + }//end of radar options + }// end of else + this.appendSelectedFeaturesIfNecessary(sampleProperties); + this.radarChart.setOption(this.radarChart.nativeElement, this.radarOption); // Assuming you have a method to set the option + this.radarChart.hideLoading(this.radarChart.nativeElement); // Assuming you have a method to hide loading + setTimeout(() => { + this.radarChart.resize(this.radarChart.nativeElement); // Assuming you have a method to resize the chart + }, 350); + this.registerEventsIfNecessary(); // Assuming you have this method + + + + } // endof modifycharater + + + + registerEventsIfNecessary() { + if (!this.eventsRegistered) { + this.radarChart.on('mouseOver', (params: any) => { // adjust the type of params + const spatialFeatureName = params.data.name; + if (spatialFeatureName) { + // broadcast event + } + }); + + this.radarChart.on('mouseOut', (params: any) => { // adjust the type of params + const spatialFeatureName = params.data.name; + if (spatialFeatureName) { + // broadcast event + } + }); + + this.eventsRegistered = true; + } + } + + updateDiagramsForHoveredFeature(featureProperties: any) { // adjust the type of featureProperties + if (!this.radarChart || !this.radarOption || !this.radarOption.legend || !this.radarOption.series) { + return; + } + if (!this.kommonitorFilterHelperService.featureIsCurrentlySelected(featureProperties[environment.FEATURE_ID_PROPERTY_NAME])) { + this.appendSeriesToRadarChart(featureProperties); + } + this.highlightFeatureInRadarChart(featureProperties); + } + + appendSeriesToRadarChart(featureProperties: any): void { + this.radarOption.legend.data.push(featureProperties[environment.FEATURE_NAME_PROPERTY_NAME]); + let valueArray: any[] = []; + let featureSeries = { + name: featureProperties[environment.FEATURE_NAME_PROPERTY_NAME], + value: valueArray, + emphasis: { + lineStyle: { + width: 4, + type: 'dotted' + } + }, + lineStyle: { + width: 3, + type: 'solid' + }, + itemStyle: { + borderWidth: 2 + } + }; + + for (let i = 0; i < this.kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime.length; i++) { + if (this.kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime[i].isSelected) { + let indicatorProperties = this.kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime[i].indicatorProperties; + let date = this.kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime[i].selectedDate; + for (let indicatorPropertyInstance of indicatorProperties) { + if (indicatorPropertyInstance[environment.FEATURE_NAME_PROPERTY_NAME] == featureProperties[environment.FEATURE_NAME_PROPERTY_NAME]) { + if (!this.kommonitorDataExchangeService.indicatorValueIsNoData(indicatorPropertyInstance[date])) { + featureSeries.value.push(this.kommonitorDataExchangeService.getIndicatorValueFromArray_asNumber(indicatorPropertyInstance, date)); + } + else { + featureSeries.value.push(); + } + break; + } + } + } + } + + this.radarOption.series[0].data.push(featureSeries); + this.radarChart.setOption(this.radarOption); + setTimeout(() => { + this.radarChart.resize(); + }, 350); + this.registerEventsIfNecessary(); + } + + highlightFeatureInRadarChart(featureProperties: any): void { + let dataIndex = this.getSeriesDataIndexByFeatureName(featureProperties[environment.FEATURE_NAME_PROPERTY_NAME]); + if (dataIndex > -1) { + this.radarChart.dispatchAction({ + type: 'highlight', + seriesIndex: 0, + dataIndex: dataIndex + }); + } + } + + updateDiagramsForUnhoveredFeature(event: any, featureProperties: any): void { + if (!this.radarChart || !this.radarOption || !this.radarOption.legend || !this.radarOption.series) { + return; + } + this.unhighlightFeatureInRadarChart(featureProperties); + if (!this.kommonitorFilterHelperService.featureIsCurrentlySelected(featureProperties[environment.FEATURE_ID_PROPERTY_NAME])) { + this.removeSeriesFromRadarChart(featureProperties); + } + } + + + getSeriesDataIndexByFeatureName(featureName: string): number { + for (let index = 0; index < this.radarOption.series[0].data.length; index++) { + if (this.radarOption.series[0].data[index].name == featureName) + return index; + } + //return -1 if none was found + return -1; + } + + removeSeriesFromRadarChart(featureProperties: any): void { + // remove feature from legend + let legendIndex = this.radarOption.legend.data.indexOf(featureProperties[environment.FEATURE_NAME_PROPERTY_NAME]); + if (legendIndex > -1) { + this.radarOption.legend.data.splice(legendIndex, 1); + } + // remove feature data series + let dataIndex = this.getSeriesDataIndexByFeatureName(featureProperties[environment.FEATURE_NAME_PROPERTY_NAME]); + if (dataIndex > -1) { + this.radarOption.series[0].data.splice(dataIndex, 1); + } + // second parameter tells echarts to not merge options with previous data. hence really remove series from graphic + this.radarChart.setOption(this.radarOption, true); + setTimeout(() => { + this.radarChart.resize(); + }, 350); + this.registerEventsIfNecessary(); + } + + unhighlightFeatureInRadarChart(featureProperties: any): void { + // highlight the corresponding bar diagram item + // get series index of series + let dataIndex = this.getSeriesDataIndexByFeatureName(featureProperties[environment.FEATURE_NAME_PROPERTY_NAME]); + if (dataIndex > -1) { + this.radarChart.dispatchAction({ + type: 'downplay', + seriesIndex: 0, + dataIndex: dataIndex + }); + } + } + + filterDisplayedIndicatorsOnRadar(): void { + console.log("Filtering indicator radar"); + this.modifyRadarContent(this.kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime); + } + + selectAllIndicatorsForRadar() { + for (let indicator of this.kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime) { + indicator.isSelected = true; + } + this.modifyRadarContent(this.kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime); +} + +deselectAllIndicatorsForRadar() { + for (let indicator of this.kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime) { + indicator.isSelected = false; + } + this.modifyRadarContent(this.kommonitorDiagramHelperService.indicatorPropertiesForCurrentSpatialUnitAndTime); +} + + + + + + + + + + + + + disposeRadarChart() { + if (this.radarChart) { + this.radarChart.dispose(); + this.radarChart = undefined; + } + } + + + + + + + + + + + + + + +} // class ending of IndicatorRadarComponent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.component.js b/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.component.js new file mode 100644 index 000000000..634cc1722 --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.component.js @@ -0,0 +1,85 @@ +import { __decorate } from "tslib"; +import { Component } from '@angular/core'; +import { environment } from 'env_backup'; +import { kommonitorDataExchangeServiceFactory } from 'app-upgraded-providers'; +export let InfoModalComponent = class InfoModalComponent { + constructor(modalService) { + this.modalService = modalService; + this.isHideGreetings = false; + this.tab1 = 'null'; + this.customGreetingsContact_name = "Test"; + this.customGreetingsContact_organisation = "Test"; + this.customGreetingsContact_mail = "Test"; + this.customGreetingsTextInfoMessage = "Test"; + this.customGreetingsContact_name = "Test"; + this.customGreetingsContact_organisation = "Test"; + this.customGreetingsContact_mail = "Test"; + this.customGreetingsTextInfoMessage = "Test"; + } + ngOnInit() { + this.modalService.startGuidedTour$.subscribe(() => { + // Call a method to handle the guided tour event + this.callStartGuidedTour(); + }); + this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeServiceFactory; + if (!(localStorage.getItem("hideKomMonitorAppGreeting") === "true")) { + this.isHideGreetings = false; + $('#infoModal').modal('show'); + } + else { + this.isHideGreetings = true; + $("#changeHideGreetingsInput").prop('checked', true); + } + const tab1 = document.getElementById("infoModalTab1"); + if (tab1) { + tab1.innerHTML = environment.standardInfoModalTabTitle; + tab1.click(); + tab1.focus(); + if (environment.enableExtendedInfoModal) { + const tab3 = document.getElementById("infoModalTab3"); + const tab3content = document.getElementById("infoModalTab3Content"); + if (tab3 && tab3content) { + tab3.innerHTML = environment.extendedInfoModalTabTitle; + tab3content.innerHTML = environment.extendedInfoModalHTMLMessage; + } + else { + alert("not founde"); + } + } + else { + console.log("content hasnt be loaded"); + } + } + setTimeout(() => { + // You might need to use Angular's change detection instead of $digest + }, 250); + } + onChangeHideGreetings() { + if (this.isHideGreetings) { + localStorage.setItem("hideKomMonitorAppGreeting", "true"); + } + else { + localStorage.setItem("hideKomMonitorAppGreeting", "false"); + } + } + onToggleHideGreetings() { + this.isHideGreetings = !this.isHideGreetings; + localStorage.setItem("hideKomMonitorAppGreeting", this.isHideGreetings ? "true" : "false"); + } + callStartGuidedTour() { + $('#infoModal').modal('hide'); + this.modalService.startGuidedTour(); + } + showFeedbackForm() { + $('#infoModal').modal('hide'); + $('#feedbackModal').modal('show'); + } +}; +InfoModalComponent = __decorate([ + Component({ + selector: 'info-modal', + templateUrl: 'info-modal.template.html', + styleUrls: ['info-modal.component.css'], + }) +], InfoModalComponent); +//# 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..70883bd9f --- /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,EAAE,SAAS,EAAwB,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,oCAAoC,EAAE,MAAM,wBAAwB,CAAC;AASvE,WAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAU7B,YAAoB,YAA0B;QAA1B,iBAAY,GAAZ,YAAY,CAAc;QAR9C,oBAAe,GAAY,KAAK,CAAC;QAClC,SAAI,GAAK,MAAM,CAAC;QAGf,gCAA2B,GAAG,MAAM,CAAC;QACrC,wCAAmC,GAAG,MAAM,CAAC;QAC7C,gCAA2B,GAAG,MAAM,CAAC;QACrC,mCAA8B,GAAG,MAAM,CAAC;QAEtC,IAAI,CAAC,2BAA2B,GAAG,MAAM,CAAC;QAC1C,IAAI,CAAC,mCAAmC,GAAG,MAAM,CAAC;QAClD,IAAI,CAAC,2BAA2B,GAAG,MAAM,CAAC;QAC1C,IAAI,CAAC,8BAA8B,GAAG,MAAM,CAAC;IAC9C,CAAC;IAGF,QAAQ;QAIN,IAAI,CAAC,YAAY,CAAC,gBAAgB,CAAC,SAAS,CAAC,GAAG,EAAE;YAChD,gDAAgD;YAChD,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC7B,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,qCAAqC,GAAI,oCAAoC,CAAC;QAEnF,IAAI,CAAC,CAAC,YAAY,C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2BAA2B,EAAE,OAAO,CAAC,CAAC;SAC5D;IACH,CAAC;IAED,qBAAqB;QACnB,IAAI,CAAC,eAAe,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC;QAC7C,YAAY,CAAC,OAAO,CAAC,2BAA2B,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IAC7F,CAAC;IAED,mBAAmB;QACjB,CAAC,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC9B,IAAI,CAAC,YAAY,CAAC,eAAe,EAAE,CAAC;IAEtC,CAAC;IAED,gBAAgB;QACd,CAAC,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC9B,CAAC,CAAC,gBAAgB,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC;CACF,CAAA;AAjGY,kBAAkB;IAN9B,SAAS,CAAC;QACT,QAAQ,EAAE,YAAY;QACtB,WAAW,EAAE,0BAA0B;QACvC,SAAS,EAAE,CAAC,0BAA0B,CAAC;KAExC,CAAC;GACW,kBAAkB,CAiG9B"} \ 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 03905f2a2..dc26139bb 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.component.ts +++ b/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.component.ts @@ -1,25 +1,23 @@ -import { Component, OnInit,AfterViewInit } from '@angular/core'; +import { Component, OnInit,AfterViewInit, Inject } from '@angular/core'; import { environment } from 'env_backup'; -import { kommonitorDataExchangeServiceFactory } from 'app-upgraded-providers'; +import { ajskommonitorDataExchangeServiceeProvider, kommonitorDataExchangeServiceFactory } from 'app-upgraded-providers'; import { ModalService } from 'util/genericServices/modal.service'; import { VersionInfoComponent } from '../versionInfo/version-info.component'; @Component({ selector: 'info-modal', templateUrl: 'info-modal.template.html', styleUrls: ['info-modal.component.css'], - + providers:[ModalService,ajskommonitorDataExchangeServiceeProvider] }) export class InfoModalComponent implements OnInit{ - kommonitorDataExchangeServiceInstance: any; + isHideGreetings: boolean = false; tab1:any='null'; - - customGreetingsContact_name = "Test"; customGreetingsContact_organisation = "Test"; customGreetingsContact_mail = "Test"; customGreetingsTextInfoMessage = "Test"; - constructor(private modalService: ModalService) { + constructor(private modalService: ModalService,@Inject('ajsKommonitorDataExchangeService') public kommonitorDataExchangeService: any) { this.customGreetingsContact_name = "Test"; this.customGreetingsContact_organisation = "Test"; this.customGreetingsContact_mail = "Test"; @@ -35,7 +33,7 @@ export class InfoModalComponent implements OnInit{ // Call a method to handle the guided tour event this.callStartGuidedTour(); }); - this.kommonitorDataExchangeServiceInstance = kommonitorDataExchangeServiceFactory; + this.kommonitorDataExchangeService = kommonitorDataExchangeServiceFactory(this.kommonitorDataExchangeService); if (!(localStorage.getItem("hideKomMonitorAppGreeting") === "true")) { this.isHideGreetings = false; @@ -75,11 +73,6 @@ export class InfoModalComponent implements OnInit{ }, 250); - - - - - } diff --git a/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.module.js b/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.module.js new file mode 100644 index 000000000..69738db8d --- /dev/null +++ b/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.module.js @@ -0,0 +1,16 @@ +import { __decorate } from "tslib"; +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { InfoModalComponent } from './info-modal.component'; +import { VersionInfoModule } from '../versionInfo/version-info.module'; +export let InfoModalModule = class InfoModalModule { +}; +InfoModalModule = __decorate([ + NgModule({ + declarations: [InfoModalComponent], + imports: [CommonModule, VersionInfoModule], + exports: [InfoModalComponent], + bootstrap: [InfoModalComponent] + }) +], InfoModalModule); +//# 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..8f295cf72 --- /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,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAShE,WAAM,eAAe,GAArB,MAAM,eAAe;CAE3B,CAAA;AAFY,eAAe;IAR3B,QAAQ,CAAC;QACV,YAAY,EAAC,CAAC,kBAAkB,CAAC;QACjC,OAAO,EAAC,CAAC,YAAY,EAAC,iBAAiB,CAAC;QACxC,OAAO,EAAC,CAAC,kBAAkB,CAAC;QAC5B,SAAS,EAAC,CAAC,kBAAkB,CAAC;KAE7B,CAAC;GAEW,eAAe,CAE3B"} \ 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 f862dfcd0..50e84e70f 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.module.ts +++ b/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.module.ts @@ -2,12 +2,14 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { InfoModalComponent } from './info-modal.component'; import { VersionInfoModule } from '../versionInfo/version-info.module'; +import { ajskommonitorDataExchangeServiceeProvider } from 'app-upgraded-providers'; + @NgModule({ declarations:[InfoModalComponent], imports:[CommonModule,VersionInfoModule], exports:[InfoModalComponent], -bootstrap:[InfoModalComponent] - +bootstrap:[InfoModalComponent], +providers:[ajskommonitorDataExchangeServiceeProvider] }) export class InfoModalModule{ diff --git a/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.template.html b/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.template.html index b7396f364..e3f89c3d3 100644 --- a/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.template.html +++ b/app/components/kommonitorUserInterface/kommonitorControls/infoModal/info-modal.template.html @@ -63,8 +63,8 @@