From ddd48ef317d4b89311e0e5991d35457c8fca244c Mon Sep 17 00:00:00 2001 From: coni2k Date: Fri, 8 Jul 2016 22:12:26 +0200 Subject: [PATCH] 0.62.0 This closes #88 and closes #89 --- .gitignore | 5 +- CHANGELOG.md | 6 +- .../_system/js/app/config/authorization.js | 61 - .../{ts => js}/app/config/authorization.ts | 0 ngClient/_system/js/app/config/breeze.js | 52 - .../_system/{ts => js}/app/config/breeze.ts | 0 .../app/config/exceptionHandlerExtension.js | 110 - .../app/config/exceptionHandlerExtension.ts | 0 .../_system/js/app/config/googleAnalytics.js | 14 - .../{ts => js}/app/config/googleAnalytics.ts | 0 ngClient/_system/js/app/config/route.js | 126 - .../_system/{ts => js}/app/config/route.ts | 0 .../controllers/account/AccountController.js | 28 - .../controllers/account/AccountController.ts | 16 +- .../account/AccountEditController.js | 52 - .../account/AccountEditController.ts | 27 +- .../account/AddPasswordController.js | 43 - .../account/AddPasswordController.ts | 45 + .../account/ChangeEmailController.js | 51 - .../account/ChangeEmailController.ts | 58 + .../account/ChangePasswordController.js | 44 - .../account/ChangePasswordController.ts | 50 + .../account/ChangeUserNameController.js | 66 - .../account/ChangeUserNameController.ts | 69 + .../account/ConfirmEmailController.js | 56 - .../account/ConfirmEmailController.ts | 66 + .../controllers/account/LoginController.js | 88 - .../controllers/account/LoginController.ts | 105 + .../controllers/account/ProfileController.js | 51 - .../controllers/account/ProfileController.ts | 57 + .../controllers/account/RegisterController.js | 51 - .../controllers/account/RegisterController.ts | 65 + .../account/ResetPasswordController.js | 62 - .../account/ResetPasswordController.ts | 69 + .../account/SocialLoginsController.js | 26 - .../account/SocialLoginsController.ts | 36 + .../controllers/content/AllInOneController.js | 60 - .../controllers/content/AllInOneController.ts | 71 + .../controllers/content/BasicsController.js | 59 - .../controllers/content/BasicsController.ts | 70 + .../content/ContributorsController.js | 20 - .../content/ContributorsController.ts | 25 + .../controllers/content/DefaultController.js | 161 - .../controllers/content/DefaultController.ts | 193 + .../content/IntroductionController.js | 49 - .../content/IntroductionController.ts | 60 + .../content/KnowledgeIndexController.js | 160 - .../content/KnowledgeIndexController.ts | 184 + .../controllers/content/NotFoundController.js | 24 - .../controllers/content/NotFoundController.ts | 29 + .../content/PriorityIndexController.js | 76 - .../content/PriorityIndexController.ts | 92 + .../content/TotalCostIndexController.js | 56 - .../content/TotalCostIndexController.ts | 66 + .../obsolete/ClosingNotesController.js | 31 - .../obsolete/ClosingNotesController.ts | 41 + .../FairShareIndexSampleController.js | 14 - .../FairShareIndexSampleController.ts | 19 + .../ResourcePoolRateSampleController.js | 15 - .../ResourcePoolRateSampleController.ts | 20 + .../ResourcePoolManageController.js | 444 -- .../ResourcePoolManageController.ts | 473 ++ .../ResourcePoolSearchController.js | 38 - .../ResourcePoolSearchController.ts | 48 + .../ResourcePoolViewController.js | 38 - .../ResourcePoolViewController.ts | 47 + .../resourcePoolEditor/resourcePoolEditor.js | 381 -- .../resourcePoolEditor/resourcePoolEditor.ts | 13 +- ngClient/_system/js/app/entities/Element.js | 387 -- .../{ts => js}/app/entities/Element.ts | 17 +- .../_system/js/app/entities/ElementCell.js | 550 -- .../{ts => js}/app/entities/ElementCell.ts | 38 +- .../_system/js/app/entities/ElementField.js | 581 -- .../{ts => js}/app/entities/ElementField.ts | 41 +- .../_system/js/app/entities/ElementItem.js | 314 - .../{ts => js}/app/entities/ElementItem.ts | 29 +- ngClient/_system/js/app/entities/Enums.js | 102 - .../_system/{ts => js}/app/entities/Enums.ts | 14 +- .../_system/js/app/entities/ResourcePool.js | 590 -- .../{ts => js}/app/entities/ResourcePool.ts | 30 +- ngClient/_system/js/app/entities/User.js | 56 - ngClient/_system/js/app/entities/User.ts | 37 + .../js/app/entities/UserElementCell.js | 47 - .../js/app/entities/UserElementCell.ts | 64 + .../js/app/entities/UserElementField.js | 26 - .../js/app/entities/UserElementField.ts | 36 + .../js/app/entities/UserResourcePool.js | 26 - .../js/app/entities/UserResourcePool.ts | 35 + .../js/app/factories/applicationFactory.js | 45 - .../app/factories/applicationFactory.ts | 11 +- .../_system/js/app/factories/dataContext.js | 765 --- .../{ts => js}/app/factories/dataContext.ts | 82 +- ...agerFactory.js => entityManagerFactory.ts} | 60 +- ...{locationHistory.js => locationHistory.ts} | 35 +- ngClient/_system/js/app/factories/logger.js | 93 - .../{ts => js}/app/factories/logger.ts | 35 +- .../js/app/factories/resourcePoolFactory.js | 805 --- .../app/factories/resourcePoolFactory.ts | 90 +- .../app/filters/enumConverter.ts} | 14 +- ngClient/_system/js/app/filters/ngEnum.js | 24 - .../_system/js/app/filters/numberSymbol.js | 44 - .../{ts => js}/app/filters/numberSymbol.ts | 8 +- ngClient/_system/js/app/filters/percentage.js | 19 - .../{ts => js}/app/filters/percentage.ts | 9 +- ngClient/_system/js/app/main.js | 21 - ngClient/_system/{ts => js}/app/main.ts | 4 +- .../{ts => js}/lib/angularjs/angular.d.ts | 0 .../_system/{ts => js}/lib/breeze/breeze.d.ts | 0 .../_system/{ts => js}/lib/jquery/jquery.d.ts | 0 .../_system/{ts => js}/lib/toastr/toastr.d.ts | 0 ngClient/_system/{ts => js}/tsconfig.json | 2 - ngClient/_system/ts/app/app.js | 5301 ----------------- ngClient/_system/ts/app/app.js.map | 1 - .../account/AddPasswordController.ts | 60 - .../account/ChangeEmailController.ts | 72 - .../account/ChangePasswordController.ts | 45 - .../account/ChangeUserNameController.ts | 67 - .../account/ConfirmEmailController.ts | 57 - .../controllers/account/LoginController.ts | 95 - .../controllers/account/ProfileController.ts | 53 - .../controllers/account/RegisterController.ts | 59 - .../account/ResetPasswordController.ts | 63 - .../account/SocialLoginsController.ts | 28 - .../controllers/content/AllInOneController.ts | 62 - .../controllers/content/BasicsController.ts | 61 - .../content/ContributorsController.ts | 22 - .../controllers/content/DefaultController.ts | 172 - .../content/IntroductionController.ts | 55 - .../content/KnowledgeIndexController.ts | 166 - .../controllers/content/NotFoundController.ts | 25 - .../content/PriorityIndexController.ts | 78 - .../content/TotalCostIndexController.ts | 58 - .../obsolete/ClosingNotesController.ts | 33 - .../FairShareIndexSampleController.ts | 15 - .../ResourcePoolRateSampleController.ts | 16 - .../ResourcePoolManageController.ts | 461 -- .../ResourcePoolSearchController.ts | 44 - .../ResourcePoolViewController.ts | 43 - .../resourcePoolEditor/resourcePoolEditor.css | 92 - .../resourcePoolEditor.html | 251 - ngClient/_system/ts/app/entities/User.ts | 57 - .../ts/app/entities/UserElementCell.ts | 48 - .../ts/app/entities/UserElementField.ts | 27 - .../ts/app/entities/UserResourcePool.ts | 27 - .../ts/app/factories/entityManagerFactory.ts | 85 - .../ts/app/factories/locationHistory.ts | 68 - .../_system/ts/appSettings/Setup/0 Readme.txt | 3 - .../ts/appSettings/Setup/appSettings.js | 13 - .../_system/ts/appSettings/appSettings.js | 13 - ngClient/_system/views/account/account.html | 2 +- .../_system/views/account/accountEdit.html | 2 +- .../_system/views/account/addPassword.html | 2 +- .../resourcePool/resourcePoolManage.html | 2 +- ngClient/default.aspx | 4 +- ngClient/gulpfile.js | 66 +- ngClient/ngClient.csproj | 176 +- 156 files changed, 2559 insertions(+), 15509 deletions(-) delete mode 100644 ngClient/_system/js/app/config/authorization.js rename ngClient/_system/{ts => js}/app/config/authorization.ts (100%) delete mode 100644 ngClient/_system/js/app/config/breeze.js rename ngClient/_system/{ts => js}/app/config/breeze.ts (100%) delete mode 100644 ngClient/_system/js/app/config/exceptionHandlerExtension.js rename ngClient/_system/{ts => js}/app/config/exceptionHandlerExtension.ts (100%) delete mode 100644 ngClient/_system/js/app/config/googleAnalytics.js rename ngClient/_system/{ts => js}/app/config/googleAnalytics.ts (100%) delete mode 100644 ngClient/_system/js/app/config/route.js rename ngClient/_system/{ts => js}/app/config/route.ts (100%) delete mode 100644 ngClient/_system/js/app/controllers/account/AccountController.js rename ngClient/_system/{ts => js}/app/controllers/account/AccountController.ts (67%) delete mode 100644 ngClient/_system/js/app/controllers/account/AccountEditController.js rename ngClient/_system/{ts => js}/app/controllers/account/AccountEditController.ts (67%) delete mode 100644 ngClient/_system/js/app/controllers/account/AddPasswordController.js create mode 100644 ngClient/_system/js/app/controllers/account/AddPasswordController.ts delete mode 100644 ngClient/_system/js/app/controllers/account/ChangeEmailController.js create mode 100644 ngClient/_system/js/app/controllers/account/ChangeEmailController.ts delete mode 100644 ngClient/_system/js/app/controllers/account/ChangePasswordController.js create mode 100644 ngClient/_system/js/app/controllers/account/ChangePasswordController.ts delete mode 100644 ngClient/_system/js/app/controllers/account/ChangeUserNameController.js create mode 100644 ngClient/_system/js/app/controllers/account/ChangeUserNameController.ts delete mode 100644 ngClient/_system/js/app/controllers/account/ConfirmEmailController.js create mode 100644 ngClient/_system/js/app/controllers/account/ConfirmEmailController.ts delete mode 100644 ngClient/_system/js/app/controllers/account/LoginController.js create mode 100644 ngClient/_system/js/app/controllers/account/LoginController.ts delete mode 100644 ngClient/_system/js/app/controllers/account/ProfileController.js create mode 100644 ngClient/_system/js/app/controllers/account/ProfileController.ts delete mode 100644 ngClient/_system/js/app/controllers/account/RegisterController.js create mode 100644 ngClient/_system/js/app/controllers/account/RegisterController.ts delete mode 100644 ngClient/_system/js/app/controllers/account/ResetPasswordController.js create mode 100644 ngClient/_system/js/app/controllers/account/ResetPasswordController.ts delete mode 100644 ngClient/_system/js/app/controllers/account/SocialLoginsController.js create mode 100644 ngClient/_system/js/app/controllers/account/SocialLoginsController.ts delete mode 100644 ngClient/_system/js/app/controllers/content/AllInOneController.js create mode 100644 ngClient/_system/js/app/controllers/content/AllInOneController.ts delete mode 100644 ngClient/_system/js/app/controllers/content/BasicsController.js create mode 100644 ngClient/_system/js/app/controllers/content/BasicsController.ts delete mode 100644 ngClient/_system/js/app/controllers/content/ContributorsController.js create mode 100644 ngClient/_system/js/app/controllers/content/ContributorsController.ts delete mode 100644 ngClient/_system/js/app/controllers/content/DefaultController.js create mode 100644 ngClient/_system/js/app/controllers/content/DefaultController.ts delete mode 100644 ngClient/_system/js/app/controllers/content/IntroductionController.js create mode 100644 ngClient/_system/js/app/controllers/content/IntroductionController.ts delete mode 100644 ngClient/_system/js/app/controllers/content/KnowledgeIndexController.js create mode 100644 ngClient/_system/js/app/controllers/content/KnowledgeIndexController.ts delete mode 100644 ngClient/_system/js/app/controllers/content/NotFoundController.js create mode 100644 ngClient/_system/js/app/controllers/content/NotFoundController.ts delete mode 100644 ngClient/_system/js/app/controllers/content/PriorityIndexController.js create mode 100644 ngClient/_system/js/app/controllers/content/PriorityIndexController.ts delete mode 100644 ngClient/_system/js/app/controllers/content/TotalCostIndexController.js create mode 100644 ngClient/_system/js/app/controllers/content/TotalCostIndexController.ts delete mode 100644 ngClient/_system/js/app/controllers/content/obsolete/ClosingNotesController.js create mode 100644 ngClient/_system/js/app/controllers/content/obsolete/ClosingNotesController.ts delete mode 100644 ngClient/_system/js/app/controllers/content/obsolete/FairShareIndexSampleController.js create mode 100644 ngClient/_system/js/app/controllers/content/obsolete/FairShareIndexSampleController.ts delete mode 100644 ngClient/_system/js/app/controllers/content/obsolete/ResourcePoolRateSampleController.js create mode 100644 ngClient/_system/js/app/controllers/content/obsolete/ResourcePoolRateSampleController.ts delete mode 100644 ngClient/_system/js/app/controllers/resourcePool/ResourcePoolManageController.js create mode 100644 ngClient/_system/js/app/controllers/resourcePool/ResourcePoolManageController.ts delete mode 100644 ngClient/_system/js/app/controllers/resourcePool/ResourcePoolSearchController.js create mode 100644 ngClient/_system/js/app/controllers/resourcePool/ResourcePoolSearchController.ts delete mode 100644 ngClient/_system/js/app/controllers/resourcePool/ResourcePoolViewController.js create mode 100644 ngClient/_system/js/app/controllers/resourcePool/ResourcePoolViewController.ts delete mode 100644 ngClient/_system/js/app/directives/resourcePoolEditor/resourcePoolEditor.js rename ngClient/_system/{ts => js}/app/directives/resourcePoolEditor/resourcePoolEditor.ts (97%) delete mode 100644 ngClient/_system/js/app/entities/Element.js rename ngClient/_system/{ts => js}/app/entities/Element.ts (96%) delete mode 100644 ngClient/_system/js/app/entities/ElementCell.js rename ngClient/_system/{ts => js}/app/entities/ElementCell.ts (95%) delete mode 100644 ngClient/_system/js/app/entities/ElementField.js rename ngClient/_system/{ts => js}/app/entities/ElementField.ts (94%) delete mode 100644 ngClient/_system/js/app/entities/ElementItem.js rename ngClient/_system/{ts => js}/app/entities/ElementItem.ts (92%) delete mode 100644 ngClient/_system/js/app/entities/Enums.js rename ngClient/_system/{ts => js}/app/entities/Enums.ts (92%) delete mode 100644 ngClient/_system/js/app/entities/ResourcePool.js rename ngClient/_system/{ts => js}/app/entities/ResourcePool.ts (96%) delete mode 100644 ngClient/_system/js/app/entities/User.js create mode 100644 ngClient/_system/js/app/entities/User.ts delete mode 100644 ngClient/_system/js/app/entities/UserElementCell.js create mode 100644 ngClient/_system/js/app/entities/UserElementCell.ts delete mode 100644 ngClient/_system/js/app/entities/UserElementField.js create mode 100644 ngClient/_system/js/app/entities/UserElementField.ts delete mode 100644 ngClient/_system/js/app/entities/UserResourcePool.js create mode 100644 ngClient/_system/js/app/entities/UserResourcePool.ts delete mode 100644 ngClient/_system/js/app/factories/applicationFactory.js rename ngClient/_system/{ts => js}/app/factories/applicationFactory.ts (80%) delete mode 100644 ngClient/_system/js/app/factories/dataContext.js rename ngClient/_system/{ts => js}/app/factories/dataContext.ts (91%) rename ngClient/_system/js/app/factories/{entityManagerFactory.js => entityManagerFactory.ts} (52%) rename ngClient/_system/js/app/factories/{locationHistory.js => locationHistory.ts} (64%) delete mode 100644 ngClient/_system/js/app/factories/logger.js rename ngClient/_system/{ts => js}/app/factories/logger.ts (73%) delete mode 100644 ngClient/_system/js/app/factories/resourcePoolFactory.js rename ngClient/_system/{ts => js}/app/factories/resourcePoolFactory.ts (90%) rename ngClient/_system/{ts/app/filters/ngEnum.ts => js/app/filters/enumConverter.ts} (67%) delete mode 100644 ngClient/_system/js/app/filters/ngEnum.js delete mode 100644 ngClient/_system/js/app/filters/numberSymbol.js rename ngClient/_system/{ts => js}/app/filters/numberSymbol.ts (87%) delete mode 100644 ngClient/_system/js/app/filters/percentage.js rename ngClient/_system/{ts => js}/app/filters/percentage.ts (62%) delete mode 100644 ngClient/_system/js/app/main.js rename ngClient/_system/{ts => js}/app/main.ts (92%) rename ngClient/_system/{ts => js}/lib/angularjs/angular.d.ts (100%) rename ngClient/_system/{ts => js}/lib/breeze/breeze.d.ts (100%) rename ngClient/_system/{ts => js}/lib/jquery/jquery.d.ts (100%) rename ngClient/_system/{ts => js}/lib/toastr/toastr.d.ts (100%) rename ngClient/_system/{ts => js}/tsconfig.json (77%) delete mode 100644 ngClient/_system/ts/app/app.js delete mode 100644 ngClient/_system/ts/app/app.js.map delete mode 100644 ngClient/_system/ts/app/controllers/account/AddPasswordController.ts delete mode 100644 ngClient/_system/ts/app/controllers/account/ChangeEmailController.ts delete mode 100644 ngClient/_system/ts/app/controllers/account/ChangePasswordController.ts delete mode 100644 ngClient/_system/ts/app/controllers/account/ChangeUserNameController.ts delete mode 100644 ngClient/_system/ts/app/controllers/account/ConfirmEmailController.ts delete mode 100644 ngClient/_system/ts/app/controllers/account/LoginController.ts delete mode 100644 ngClient/_system/ts/app/controllers/account/ProfileController.ts delete mode 100644 ngClient/_system/ts/app/controllers/account/RegisterController.ts delete mode 100644 ngClient/_system/ts/app/controllers/account/ResetPasswordController.ts delete mode 100644 ngClient/_system/ts/app/controllers/account/SocialLoginsController.ts delete mode 100644 ngClient/_system/ts/app/controllers/content/AllInOneController.ts delete mode 100644 ngClient/_system/ts/app/controllers/content/BasicsController.ts delete mode 100644 ngClient/_system/ts/app/controllers/content/ContributorsController.ts delete mode 100644 ngClient/_system/ts/app/controllers/content/DefaultController.ts delete mode 100644 ngClient/_system/ts/app/controllers/content/IntroductionController.ts delete mode 100644 ngClient/_system/ts/app/controllers/content/KnowledgeIndexController.ts delete mode 100644 ngClient/_system/ts/app/controllers/content/NotFoundController.ts delete mode 100644 ngClient/_system/ts/app/controllers/content/PriorityIndexController.ts delete mode 100644 ngClient/_system/ts/app/controllers/content/TotalCostIndexController.ts delete mode 100644 ngClient/_system/ts/app/controllers/content/obsolete/ClosingNotesController.ts delete mode 100644 ngClient/_system/ts/app/controllers/content/obsolete/FairShareIndexSampleController.ts delete mode 100644 ngClient/_system/ts/app/controllers/content/obsolete/ResourcePoolRateSampleController.ts delete mode 100644 ngClient/_system/ts/app/controllers/resourcePool/ResourcePoolManageController.ts delete mode 100644 ngClient/_system/ts/app/controllers/resourcePool/ResourcePoolSearchController.ts delete mode 100644 ngClient/_system/ts/app/controllers/resourcePool/ResourcePoolViewController.ts delete mode 100644 ngClient/_system/ts/app/directives/resourcePoolEditor/resourcePoolEditor.css delete mode 100644 ngClient/_system/ts/app/directives/resourcePoolEditor/resourcePoolEditor.html delete mode 100644 ngClient/_system/ts/app/entities/User.ts delete mode 100644 ngClient/_system/ts/app/entities/UserElementCell.ts delete mode 100644 ngClient/_system/ts/app/entities/UserElementField.ts delete mode 100644 ngClient/_system/ts/app/entities/UserResourcePool.ts delete mode 100644 ngClient/_system/ts/app/factories/entityManagerFactory.ts delete mode 100644 ngClient/_system/ts/app/factories/locationHistory.ts delete mode 100644 ngClient/_system/ts/appSettings/Setup/0 Readme.txt delete mode 100644 ngClient/_system/ts/appSettings/Setup/appSettings.js delete mode 100644 ngClient/_system/ts/appSettings/appSettings.js diff --git a/.gitignore b/.gitignore index 442f8578a..b41282457 100644 --- a/.gitignore +++ b/.gitignore @@ -27,9 +27,8 @@ ngClient/_system/js/appSettings/*.js WebApi/Configs/*.config # Gulp generated files -ngClient/_system/js/app/app.js -ngClient/_system/js/app/app.min.js -ngClient/_system/js/app/app.min.js.map +ngClient/_system/js/app/*.js +ngClient/_system/js/app/*.map ngClient/_system/js/lib/*.js ngClient/_system/js/lib/*.map ngClient/_system/css/app.css diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a191ea78..d39a823fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,10 @@ **0.62.0** -* Typescript was introduced -* Resharper was installed +* Typescript +https://github.com/forCrowd/WealthEconomy/issues/88 +* Resharper +https://github.com/forCrowd/WealthEconomy/issues/89 * Comments signature update - coni2k **0.61.3** diff --git a/ngClient/_system/js/app/config/authorization.js b/ngClient/_system/js/app/config/authorization.js deleted file mode 100644 index 4250e98c9..000000000 --- a/ngClient/_system/js/app/config/authorization.js +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Authorization interceptors for angular & OData - */ - -(function () { - 'use strict'; - - angular.module('main') - .config(['$httpProvider', authorizationConfig]); - - angular.module('main') - .run(['logger', '$window', authorizationRun]); - - var interceptorId = 'angularInterceptor'; - angular.module('main') - .factory(interceptorId, ['logger', '$q', '$window', angularInterceptor]); - - function authorizationConfig($httpProvider) { - $httpProvider.interceptors.push(interceptorId); - } - - function authorizationRun(logger, $window) { - - // Logger - logger = logger.forSource('authorizationRun'); - - // OData interceptor - var oldClient = $window.OData.defaultHttpClient; - var newClient = { - request: function (request, success, error) { - request.headers = request.headers || {}; - var token = angular.fromJson($window.localStorage.getItem('token')); - request.headers.Authorization = token !== null ? 'Bearer ' + token.access_token : ''; - return oldClient.request(request, success, error); - } - }; - $window.OData.defaultHttpClient = newClient; - } - - // angular - function angularInterceptor(logger, $q, $window) { - - // Logger - logger = logger.forSource(interceptorId); - - return { - request: function (config) { - config.headers = config.headers || {}; - var token = angular.fromJson($window.localStorage.getItem('token')); - config.headers.Authorization = token !== null ? 'Bearer ' + token.access_token : ''; - return config; - }, - response: function (response) { - if (response.status === 401) { - // handle the case where the user is not authenticated - } - return response || $q.when(response); - } - }; - } -})(); diff --git a/ngClient/_system/ts/app/config/authorization.ts b/ngClient/_system/js/app/config/authorization.ts similarity index 100% rename from ngClient/_system/ts/app/config/authorization.ts rename to ngClient/_system/js/app/config/authorization.ts diff --git a/ngClient/_system/js/app/config/breeze.js b/ngClient/_system/js/app/config/breeze.js deleted file mode 100644 index b51c01a7e..000000000 --- a/ngClient/_system/js/app/config/breeze.js +++ /dev/null @@ -1,52 +0,0 @@ -(function () { - 'use strict'; - - angular.module('main') - .config(['breezeProvider', breezeConfig]) - .config(['zDirectivesConfigProvider', breezeConfigDirective]); - - function breezeConfig(breezeProvider) { - - breeze.config.initializeAdapterInstance('uriBuilder', 'odata'); - - // Use Web API OData to query and save - var adapter = breeze.config.initializeAdapterInstance('dataService', 'webApiOData', true); - adapter.getRoutePrefix = getRoutePrefix_Microsoft_AspNet_WebApi_OData_5_3_x; - - // convert between server-side PascalCase and client-side camelCase - // breeze.NamingConvention.camelCase.setAsDefault(); - - function getRoutePrefix_Microsoft_AspNet_WebApi_OData_5_3_x(dataService) { - - // Copied from breeze.debug and modified for Web API OData v.5.3.1. - var parser = null; - if (typeof document === 'object') { // browser - parser = document.createElement('a'); - parser.href = dataService.serviceName; - } else { // node - parser = url.parse(dataService.serviceName); - } - - // THE CHANGE FOR 5.3.1: Add '/' prefix to pathname - var prefix = parser.pathname; - if (prefix[0] !== '/') { - prefix = '/' + prefix; - } // add leading '/' (only in IE) - if (prefix.substr(-1) !== '/') { - prefix += '/'; - } // ensure trailing '/' - - return prefix; - } - } - - // Configure the Breeze Validation Directive for bootstrap - function breezeConfigDirective(config) { - - // Custom template with warning icon before the error message - config.zRequiredTemplate = ''; - config.zValidateTemplate = '%error%!'; - - } - -})(); diff --git a/ngClient/_system/ts/app/config/breeze.ts b/ngClient/_system/js/app/config/breeze.ts similarity index 100% rename from ngClient/_system/ts/app/config/breeze.ts rename to ngClient/_system/js/app/config/breeze.ts diff --git a/ngClient/_system/js/app/config/exceptionHandlerExtension.js b/ngClient/_system/js/app/config/exceptionHandlerExtension.js deleted file mode 100644 index 194599b50..000000000 --- a/ngClient/_system/js/app/config/exceptionHandlerExtension.js +++ /dev/null @@ -1,110 +0,0 @@ -(function () { - 'use strict'; - - var factoryId = 'exceptionHandlerExtension'; - angular.module('main') - .config(['$provide', extendHandler]); - - function extendHandler($provide) { - $provide.decorator('$exceptionHandler', ['logger', 'serviceAppUrl', '$delegate', '$injector', '$window', exceptionHandlerExtension]); - } - - function exceptionHandlerExtension(logger, serviceAppUrl, $delegate, $injector, $window) { - logger = logger.forSource(factoryId); - - var exceptionUrl = serviceAppUrl + '/api/Exception/Record'; - - return function (exception, cause) { - - // No need to call the base, will be logged here - // $delegate(exception, cause); - - // Show a generic error to the user, except for 'not found' - var $location = $injector.get('$location'); - if ($location.path().substring($location.path().lastIndexOf('/') + 1) !== 'notFound') { - logger.logError('Something went wrong, please try again later!', null, true); - } - - getSourceMappedStackTrace(exception) - .then(function (sourceMappedStack) { - - // Send the exception to the server - var exceptionModel = { - Message: exception.message, - Cause: cause, - Url: $location.url(), - Stack: sourceMappedStack - }; - - var $http = $injector.get('$http'); - $http.post(exceptionUrl, exceptionModel); - - // Rethrow the exception - setTimeout(function () { - throw exception; - }); - }); - }; - - function getSourceMappedStackTrace(exception) { - var $q = $injector.get('$q'), - $http = $injector.get('$http'), - SMConsumer = $window.sourceMap.SourceMapConsumer, - cache = {}; - - if (exception.stack) { // not all browsers support stack traces - return $q.all($.map(exception.stack.split(/\n/), function (stackLine) { - var match = stackLine.match(/^(.+)(http.+):(\d+):(\d+)/); - if (match) { - var prefix = match[1], url = match[2], line = match[3], col = match[4]; - - return getMapForScript(url).then(function (map) { - - var pos = map.originalPositionFor({ - line: parseInt(line, 10), - column: parseInt(col, 10) - }); - - var mangledName = prefix.match(/\s*(at)?\s*(.*?)\s*(\(|@)/); - mangledName = (mangledName && mangledName[2]) || ''; - - return ' at ' + (pos.name ? pos.name : mangledName) + ' ' + - $window.location.origin + pos.source + ':' + pos.line + ':' + - pos.column; - }, function () { - return stackLine; - }); - } else { - return $q.when(stackLine); - } - })).then(function (lines) { - return lines.join('\n'); - }); - } else { - return $q.when(''); - } - - // Retrieve a SourceMap object for a minified script URL - function getMapForScript(url) { - if (cache[url]) { - return cache[url]; - } else { - var promise = $http.get(url).then(function (response) { - var m = response.data.match(/\/\/# sourceMappingURL=(.+\.map)/); - if (m) { - var path = url.match(/^(.+)\/[^/]+$/); - path = path && path[1]; - return $http.get(path + '/' + m[1]).then(function (response) { - return new SMConsumer(response.data); - }); - } else { - return $q.reject(); - } - }); - cache[url] = promise; - return promise; - } - } - } - } -})(); diff --git a/ngClient/_system/ts/app/config/exceptionHandlerExtension.ts b/ngClient/_system/js/app/config/exceptionHandlerExtension.ts similarity index 100% rename from ngClient/_system/ts/app/config/exceptionHandlerExtension.ts rename to ngClient/_system/js/app/config/exceptionHandlerExtension.ts diff --git a/ngClient/_system/js/app/config/googleAnalytics.js b/ngClient/_system/js/app/config/googleAnalytics.js deleted file mode 100644 index 14495852e..000000000 --- a/ngClient/_system/js/app/config/googleAnalytics.js +++ /dev/null @@ -1,14 +0,0 @@ -(function () { - 'use strict'; - - angular.module('main') - .config(['AnalyticsProvider', 'analyticsTrackingCode', 'analyticsDomainName', analyticsConfig]); - - angular.module('main').run(['Analytics', function (Analytics) { }]); - - function analyticsConfig(AnalyticsProvider, analyticsTrackingCode, analyticsDomainName) { - AnalyticsProvider.setAccount(analyticsTrackingCode) - .setDomainName(analyticsDomainName) - .ignoreFirstPageLoad(true); - } -})(); diff --git a/ngClient/_system/ts/app/config/googleAnalytics.ts b/ngClient/_system/js/app/config/googleAnalytics.ts similarity index 100% rename from ngClient/_system/ts/app/config/googleAnalytics.ts rename to ngClient/_system/js/app/config/googleAnalytics.ts diff --git a/ngClient/_system/js/app/config/route.js b/ngClient/_system/js/app/config/route.js deleted file mode 100644 index abc1ca965..000000000 --- a/ngClient/_system/js/app/config/route.js +++ /dev/null @@ -1,126 +0,0 @@ -(function () { - 'use strict'; - - angular.module('main') - .config(['$locationProvider', '$routeProvider', routeConfig]); - - angular.module('main') - .run(['locationHistory', 'logger', '$location', '$rootScope', routeRun]); - - function routeConfig($locationProvider, $routeProvider) { - - // Routes - $routeProvider - - /* Content */ - .when('/', { title: 'Home', templateUrl: '/_system/views/content/home.html?v=0.53.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/default.aspx', { title: 'Home', templateUrl: '/_system/views/content/home.html?v=0.53.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - // Different than other content pages, enableDisqus: false - .when('/_system/content/notFound', { title: 'Not Found', templateUrl: '/_system/views/content/notFound.html?v=0.52.0', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/content/allInOne', { title: 'All in One', templateUrl: '/_system/views/content/allInOne.html?v=0.49.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/content/basics', { title: 'Basics', templateUrl: '/_system/views/content/basics.html?v=0.53.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/content/home', { title: 'Home', templateUrl: '/_system/views/content/home.html?v=0.53.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/content/implementation', { title: 'Implementation', templateUrl: '/_system/views/content/implementation.html?v=0.49.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/content/introduction', { title: 'Introduction', templateUrl: '/_system/views/content/introduction.html?v=0.53.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/content/knowledgeIndex', { title: 'Knowledge Index', templateUrl: '/_system/views/content/knowledgeIndex.html?v=0.51.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/content/priorityIndex', { title: 'Priority Index', templateUrl: '/_system/views/content/priorityIndex.html?v=0.49.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/content/prologue', { title: 'Prologue', templateUrl: '/_system/views/content/prologue.html?v=0.51.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/content/reason', { title: 'Reason', templateUrl: '/_system/views/content/reason.html?v=0.58.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/content/totalCostIndex', { title: 'Total Cost Index', templateUrl: '/_system/views/content/totalCostIndex.html?v=0.49.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/content/contributors', { title: 'Contributors', templateUrl: '/_system/views/content/contributors.html?v=0.60.1', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - - /* Account */ - .when('/_system/account', { title: 'Account', templateUrl: '/_system/views/account/account.html?v=0.55.0', accessType: 'authenticatedRequired', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/account/accountEdit', { title: 'Account Edit', templateUrl: '/_system/views/account/accountEdit.html?v=0.55.0', accessType: 'authenticatedRequired', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/account/addPassword', { title: 'Add Password', templateUrl: '/_system/views/account/addPassword.html?v=0.55.0', accessType: 'authenticatedRequired', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/account/changeEmail', { title: 'Change Email', templateUrl: '/_system/views/account/changeEmail.html?v=0.55.0', accessType: 'authenticatedRequired', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/account/changePassword', { title: 'Change Password', templateUrl: '/_system/views/account/changePassword.html?v=0.55.0', accessType: 'authenticatedRequired', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/account/changeUserName', { title: 'Change Username', templateUrl: '/_system/views/account/changeUsername.html?v=0.55.0', accessType: 'authenticatedRequired', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/account/confirmEmail', { title: 'Confirm Email', templateUrl: '/_system/views/account/confirmEmail.html?v=0.51.0', accessType: 'authenticatedRequired', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/account/login', { title: 'Login', templateUrl: '/_system/views/account/login.html?v=0.58.0', accessType: 'unauthenticatedRequired', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/account/register', { title: 'Register', templateUrl: '/_system/views/account/register.html?v=0.58.0', accessType: 'unauthenticatedRequired', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/account/resetPassword', { title: 'Reset Password', templateUrl: '/_system/views/account/resetPassword.html?v=0.55.0', accessType: 'unauthenticatedRequired', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - - /* CMRP Search */ - .when('/_system/resourcePool/search', { title: 'CMRP Search', templateUrl: '/_system/views/resourcePool/resourcePoolSearch.html?v=0.57.0', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - - /* User */ - .when('/:userName', { title: 'Profile', templateUrl: '/_system/views/account/profile.html?v=0.57.0', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/:userName/new', { title: 'New CMRP', templateUrl: '/_system/views/resourcePool/resourcePoolManage.html?v=0.58.0', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/:userName/:resourcePoolKey/edit', { title: 'Edit CMRP', templateUrl: '/_system/views/resourcePool/resourcePoolManage.html?v=0.58.0', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/:userName/:resourcePoolKey', { title: 'View CMRP', templateUrl: '/_system/views/resourcePool/resourcePoolView.html?v=0.57.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - - /* Otherwise */ - .otherwise({ redirectTo: getNotFound }) - ; - - // Html5Mode is on, if supported (# will not be used) - if (window.history && window.history.pushState) { - $locationProvider.html5Mode({ enabled: true }); - } - - function getNotFound(routeParams, path, search) { - - var invalidUrl = path; - var keys = Object.keys(search); - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - invalidUrl += (i === 0 ? '?' : '&') + key + '=' + search[key]; - } - - return '/_system/content/notFound?url=' + invalidUrl; - } - - function validateAccess(dataContext, locationHistory, logger, $location, $q, $route) { - - logger = logger.forSource('validateAccess'); - - var deferred = $q.defer(); - - locationHistory.createItem($location, $route.current); - - dataContext.initializeCurrentUser() - .then(function (currentUser) { - if ($route.current.accessType !== 'undefined') { - - // Invalid access cases - if (($route.current.accessType === 'unauthenticatedRequired' && currentUser.isAuthenticated() && !currentUser.IsAnonymous) || - ($route.current.accessType === 'authenticatedRequired' && !currentUser.isAuthenticated())) { - deferred.reject({ accessType: $route.current.accessType }); - } - } - - deferred.resolve(); - }) - .catch(function () { - deferred.reject(); // TODO Handle? - }); - - return deferred.promise; - } - } - - function routeRun(locationHistory, logger, $location, $rootScope) { - - // Logger - logger = logger.forSource('routeRun'); - - $rootScope.$on('$routeChangeError', routeChangeError); - $rootScope.$on('$routeChangeSuccess', routeChangeSuccess); - - // Navigate to correct page in 'Invalid access' cases - function routeChangeError(event, current, previous, eventObj) { - if (eventObj.accessType === 'unauthenticatedRequired') { - $location.url('/'); - } else if (eventObj.accessType === 'authenticatedRequired') { - $location.url('/_system/account/login?error=To be able to continue, please login first'); - } - } - - function routeChangeSuccess(event, current, previous) { - - // View title - $rootScope.viewTitle = typeof current.title !== 'undefined' ? current.title : ''; - } - } -})(); diff --git a/ngClient/_system/ts/app/config/route.ts b/ngClient/_system/js/app/config/route.ts similarity index 100% rename from ngClient/_system/ts/app/config/route.ts rename to ngClient/_system/js/app/config/route.ts diff --git a/ngClient/_system/js/app/controllers/account/AccountController.js b/ngClient/_system/js/app/controllers/account/AccountController.js deleted file mode 100644 index 9a50eed33..000000000 --- a/ngClient/_system/js/app/controllers/account/AccountController.js +++ /dev/null @@ -1,28 +0,0 @@ -(function () { - 'use strict'; - - var controllerId = 'AccountController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', '$routeParams', '$scope', AccountController]); - - function AccountController(dataContext, logger, $routeParams, $scope) { - - // Logger - logger = logger.forSource(controllerId); - - var vm = this; - vm.currentUser = dataContext.getCurrentUser(); - - // Events - $scope.$on('dataContext_currentUserChanged', currentUserChanged); - - _init(); - - function _init() { - } - - function currentUserChanged(event, newUser) { - vm.currentUser = newUser; - } - } -})(); diff --git a/ngClient/_system/ts/app/controllers/account/AccountController.ts b/ngClient/_system/js/app/controllers/account/AccountController.ts similarity index 67% rename from ngClient/_system/ts/app/controllers/account/AccountController.ts rename to ngClient/_system/js/app/controllers/account/AccountController.ts index 8c44d4e37..a824d8d22 100644 --- a/ngClient/_system/ts/app/controllers/account/AccountController.ts +++ b/ngClient/_system/js/app/controllers/account/AccountController.ts @@ -3,25 +3,17 @@ var controllerId = 'AccountController'; - class AccountViewModel { - currentUser: any = null; - } - - interface IAccountController extends ng.IScope { - vm: AccountViewModel; - } - export class AccountController { static $inject = ['dataContext', 'logger', '$routeParams', '$scope']; - constructor(dataContext: any, logger: any, $routeParams: any, $scope: IAccountController) { + constructor(dataContext: any, logger: any, $routeParams: any, $scope: any) { // Logger logger = logger.forSource(controllerId); - $scope.vm = new AccountViewModel(); - $scope.vm.currentUser = dataContext.getCurrentUser(); + var vm: any = this; + vm.currentUser = dataContext.getCurrentUser(); // Events $scope.$on('dataContext_currentUserChanged', currentUserChanged); @@ -33,7 +25,7 @@ function currentUserChanged(event: any, newUser: any); function currentUserChanged(event, newUser) { - $scope.vm.currentUser = newUser; + vm.currentUser = newUser; } } } diff --git a/ngClient/_system/js/app/controllers/account/AccountEditController.js b/ngClient/_system/js/app/controllers/account/AccountEditController.js deleted file mode 100644 index 0ee213b6a..000000000 --- a/ngClient/_system/js/app/controllers/account/AccountEditController.js +++ /dev/null @@ -1,52 +0,0 @@ -(function () { - 'use strict'; - - var controllerId = 'AccountEditController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', '$location', AccountEditController]); - - function AccountEditController(dataContext, logger, $location) { - logger = logger.forSource(controllerId); - - var isSaving = false; - - // Controller methods (alphabetically) - var vm = this; - vm.cancel = cancel; - vm.isSaveDisabled = isSaveDisabled; - vm.currentUser = dataContext.getCurrentUser(); - vm.saveChanges = saveChanges; - - /*** Implementations ***/ - - function cancel() { - vm.currentUser.entityAspect.rejectChanges(); - $location.url('/_system/account'); - } - - function isSaveDisabled() { - //return isSaving || (!dataContext.hasChanges()); - return isSaving; - } - - function saveChanges() { - - isSaving = true; - dataContext.saveChanges() - .then(function (result) { - logger.logSuccess('Your changes have been saved!', null, true); - $location.url('/_system/account'); - }) - .catch(function (error) { - - // Conflict (Concurrency exception) - if (error.status === '409') { - // TODO Try to recover! - } - }) - .finally(function () { - isSaving = false; - }); - } - } -})(); diff --git a/ngClient/_system/ts/app/controllers/account/AccountEditController.ts b/ngClient/_system/js/app/controllers/account/AccountEditController.ts similarity index 67% rename from ngClient/_system/ts/app/controllers/account/AccountEditController.ts rename to ngClient/_system/js/app/controllers/account/AccountEditController.ts index ca3b4788b..b425d6efa 100644 --- a/ngClient/_system/ts/app/controllers/account/AccountEditController.ts +++ b/ngClient/_system/js/app/controllers/account/AccountEditController.ts @@ -3,22 +3,11 @@ var controllerId = 'AccountEditController'; - class AccountEditViewModel { - cancel: Function; - currentUser: any = null; - isSaveDisabled: Function; - saveChanges: Function; - } - - interface IAccountEditController extends ng.IScope { - vm: AccountEditViewModel - } - export class AccountEditController { - static $inject = ['dataContext', 'logger', '$location', '$scope']; + static $inject = ['dataContext', 'logger', '$location']; - constructor(dataContext: any, logger: any, $location: any, $scope: IAccountEditController) { + constructor(dataContext: any, logger: any, $location: any) { // Logger logger = logger.forSource(controllerId); @@ -26,16 +15,16 @@ var isSaving = false; // Controller methods (alphabetically) - $scope.vm = new AccountEditViewModel(); - $scope.vm.cancel = cancel; - $scope.vm.currentUser = dataContext.getCurrentUser(); - $scope.vm.isSaveDisabled = isSaveDisabled; - $scope.vm.saveChanges = saveChanges; + var vm: any = this; + vm.cancel = cancel; + vm.currentUser = dataContext.getCurrentUser(); + vm.isSaveDisabled = isSaveDisabled; + vm.saveChanges = saveChanges; /*** Implementations ***/ function cancel() { - $scope.vm.currentUser.entityAspect.rejectChanges(); + vm.currentUser.entityAspect.rejectChanges(); $location.url('/_system/account'); } diff --git a/ngClient/_system/js/app/controllers/account/AddPasswordController.js b/ngClient/_system/js/app/controllers/account/AddPasswordController.js deleted file mode 100644 index cfc0b880e..000000000 --- a/ngClient/_system/js/app/controllers/account/AddPasswordController.js +++ /dev/null @@ -1,43 +0,0 @@ -(function () { - 'use strict'; - - var controllerId = 'AddPasswordController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', '$location', AddPasswordController]); - - function AddPasswordController(dataContext, logger, $location) { - logger = logger.forSource(controllerId); - - var vm = this; - vm.addPassword = addPassword; - vm.bindingModel = { - Password: '', - ConfirmPassword: '' - }; - vm.cancel = cancel; - vm.isSaving = false; - vm.isSaveDisabled = isSaveDisabled; - - function addPassword() { - - vm.isSaving = true; - - dataContext.addPassword(vm.bindingModel) - .success(function () { - logger.logSuccess('Your password has been set!', null, true); - $location.url('/_system/account'); - }) - .finally(function () { - vm.isSaving = false; - }); - } - - function cancel() { - $location.url('/_system/account'); - } - - function isSaveDisabled() { - return vm.isSaving; - } - } -})(); diff --git a/ngClient/_system/js/app/controllers/account/AddPasswordController.ts b/ngClient/_system/js/app/controllers/account/AddPasswordController.ts new file mode 100644 index 000000000..87431bc45 --- /dev/null +++ b/ngClient/_system/js/app/controllers/account/AddPasswordController.ts @@ -0,0 +1,45 @@ +module Main.Controller { + 'use strict'; + + var controllerId = 'AddPasswordController'; + + export class AddPasswordController { + + static $inject = ['dataContext', 'logger', '$location']; + + constructor(dataContext: any, logger: any, $location: any) { + + // Logger + logger = logger.forSource(controllerId); + + var vm: any = this; + vm.addPassword = addPassword; + vm.cancel = cancel; + vm.isSaveDisabled = isSaveDisabled; + + function addPassword() { + + vm.isSaving = true; + + dataContext.addPassword(vm.bindingModel) + .success(() => { + logger.logSuccess('Your password has been set!', null, true); + $location.url('/_system/account'); + }) + .finally(() => { + vm.isSaving = false; + }); + } + + function cancel() { + $location.url('/_system/account'); + } + + function isSaveDisabled(): boolean { + return vm.isSaving; + } + } + } + + angular.module('main').controller(controllerId, AddPasswordController); +} \ No newline at end of file diff --git a/ngClient/_system/js/app/controllers/account/ChangeEmailController.js b/ngClient/_system/js/app/controllers/account/ChangeEmailController.js deleted file mode 100644 index 50544cbaa..000000000 --- a/ngClient/_system/js/app/controllers/account/ChangeEmailController.js +++ /dev/null @@ -1,51 +0,0 @@ -(function () { - 'use strict'; - - var controllerId = 'ChangeEmailController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', '$location', ChangeEmailController]); - - function ChangeEmailController(dataContext, logger, $location) { - logger = logger.forSource(controllerId); - - var vm = this; - vm.bindingModel = { - Email: '' - }; - vm.cancel = cancel; - vm.changeEmail = changeEmail; - vm.isSaving = false; - vm.isSaveDisabled = isSaveDisabled; - - _init(); - - function _init() { - - // Generate test data if localhost - if ($location.host() === 'localhost') { - vm.bindingModel.Email = dataContext.getUniqueEmail(); - } - } - - function cancel() { - $location.url('/_system/account'); - } - - function changeEmail() { - - vm.isSaving = true; - - dataContext.changeEmail(vm.bindingModel) - .success(function () { - $location.url('/_system/account/confirmEmail'); - }) - .finally(function () { - vm.isSaving = false; - }); - } - - function isSaveDisabled() { - return vm.isSaving; - } - } -})(); diff --git a/ngClient/_system/js/app/controllers/account/ChangeEmailController.ts b/ngClient/_system/js/app/controllers/account/ChangeEmailController.ts new file mode 100644 index 000000000..375677e4f --- /dev/null +++ b/ngClient/_system/js/app/controllers/account/ChangeEmailController.ts @@ -0,0 +1,58 @@ +module Main.Controller { + 'use strict'; + + var controllerId = 'ChangeEmailController'; + + export class ChangeEmailController { + + static $inject = ['dataContext', 'logger', '$location']; + + constructor(dataContext, logger, $location) { + + // Logger + logger = logger.forSource(controllerId); + + var vm: any = this; + vm.bindingModel = { + Email: '' + }; + vm.cancel = cancel; + vm.changeEmail = changeEmail; + vm.isSaving = false; + vm.isSaveDisabled = isSaveDisabled; + + _init(); + + function _init() { + + // Generate test data if localhost + if ($location.host() === 'localhost') { + vm.bindingModel.Email = dataContext.getUniqueEmail(); + } + } + + function cancel() { + $location.url('/_system/account'); + } + + function changeEmail() { + + vm.isSaving = true; + + dataContext.changeEmail(vm.bindingModel) + .success(() => { + $location.url('/_system/account/confirmEmail'); + }) + .finally(() => { + vm.isSaving = false; + }); + } + + function isSaveDisabled() { + return vm.isSaving; + } + } + } + + angular.module('main').controller(controllerId, ChangeEmailController); +} \ No newline at end of file diff --git a/ngClient/_system/js/app/controllers/account/ChangePasswordController.js b/ngClient/_system/js/app/controllers/account/ChangePasswordController.js deleted file mode 100644 index 1333d106c..000000000 --- a/ngClient/_system/js/app/controllers/account/ChangePasswordController.js +++ /dev/null @@ -1,44 +0,0 @@ -(function () { - 'use strict'; - - var controllerId = 'ChangePasswordController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', '$location', ChangePasswordController]); - - function ChangePasswordController(dataContext, logger, $location) { - logger = logger.forSource(controllerId); - - var vm = this; - vm.bindingModel = { - CurrentPassword: '', - NewPassword: '', - ConfirmPassword: '' - }; - vm.cancel = cancel; - vm.changePassword = changePassword; - vm.isSaving = false; - vm.isSaveDisabled = isSaveDisabled; - - function cancel() { - $location.url('/_system/account'); - } - - function changePassword() { - - vm.isSaving = true; - - dataContext.changePassword(vm.bindingModel) - .success(function () { - logger.logSuccess('Your password has been changed!', null, true); - $location.url('/_system/account'); - }) - .finally(function () { - vm.isSaving = false; - }); - } - - function isSaveDisabled() { - return vm.isSaving; - } - } -})(); diff --git a/ngClient/_system/js/app/controllers/account/ChangePasswordController.ts b/ngClient/_system/js/app/controllers/account/ChangePasswordController.ts new file mode 100644 index 000000000..324a09b6d --- /dev/null +++ b/ngClient/_system/js/app/controllers/account/ChangePasswordController.ts @@ -0,0 +1,50 @@ +module Main.Controller { + 'use strict'; + + var controllerId = 'ChangePasswordController'; + + export class ChangePasswordController { + + static $inject = ['dataContext', 'logger', '$location']; + + constructor(dataContext: any, logger: any, $location: any) { + + logger = logger.forSource(controllerId); + + var vm:any = this; + vm.bindingModel = { + CurrentPassword: '', + NewPassword: '', + ConfirmPassword: '' + }; + vm.cancel = cancel; + vm.changePassword = changePassword; + vm.isSaving = false; + vm.isSaveDisabled = isSaveDisabled; + + function cancel() { + $location.url('/_system/account'); + } + + function changePassword() { + + vm.isSaving = true; + + dataContext.changePassword(vm.bindingModel) + .success(() => { + logger.logSuccess('Your password has been changed!', null, true); + $location.url('/_system/account'); + }) + .finally(() => { + vm.isSaving = false; + }); + } + + function isSaveDisabled() { + return vm.isSaving; + } + } + } + + angular.module('main').controller(controllerId, ChangePasswordController); +} \ No newline at end of file diff --git a/ngClient/_system/js/app/controllers/account/ChangeUserNameController.js b/ngClient/_system/js/app/controllers/account/ChangeUserNameController.js deleted file mode 100644 index a5b1065f7..000000000 --- a/ngClient/_system/js/app/controllers/account/ChangeUserNameController.js +++ /dev/null @@ -1,66 +0,0 @@ -(function () { - 'use strict'; - - var controllerId = 'ChangeUserNameController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', '$location', ChangeUserNameController]); - - function ChangeUserNameController(dataContext, logger, $location) { - - // Logger - logger = logger.forSource(controllerId); - - var vm = this; - vm.bindingModel = { - UserName: '' - }; - vm.cancel = cancel; - vm.changeUserName = changeUserName; - vm.currentUser = { UserName: '' }; - vm.externalLoginInit = $location.search().init; // For external login's - vm.isSaving = false; - vm.isSaveDisabled = isSaveDisabled; - - _init(); - - function _init() { - - vm.currentUser = dataContext.getCurrentUser(); - vm.bindingModel.UserName = vm.currentUser.UserName; - - // Generate test data if localhost - if ($location.host() === 'localhost') { - vm.bindingModel.UserName = dataContext.getUniqueUserName(); - } - } - - function cancel() { - $location.url(getReturnUrl()); - } - - function changeUserName() { - - vm.isSaving = true; - - dataContext.changeUserName(vm.bindingModel) - .success(function () { - logger.logSuccess('Your username has been changed!', null, true); - $location.url(getReturnUrl()); - }) - .finally(function () { - vm.isSaving = false; - }); - } - - function getReturnUrl() { - var clientReturnUrl = $location.search().clientReturnUrl; - return typeof clientReturnUrl !== 'undefined' ? - clientReturnUrl : - '/_system/account'; - } - - function isSaveDisabled() { - return vm.bindingModel.UserName === vm.currentUser.UserName || vm.isSaving; - } - } -})(); diff --git a/ngClient/_system/js/app/controllers/account/ChangeUserNameController.ts b/ngClient/_system/js/app/controllers/account/ChangeUserNameController.ts new file mode 100644 index 000000000..f7f5ddac8 --- /dev/null +++ b/ngClient/_system/js/app/controllers/account/ChangeUserNameController.ts @@ -0,0 +1,69 @@ +module Main.Controller { + 'use strict'; + + var controllerId = 'ChangeUserNameController'; + + export class ChangeUserNameController { + + static $inject = ['dataContext', 'logger', '$location']; + + constructor(dataContext: any, logger: any, $location: any) { + + // Logger + logger = logger.forSource(controllerId); + + var vm:any = this; + vm.bindingModel = { + UserName: '' + }; + vm.cancel = cancel; + vm.changeUserName = changeUserName; + vm.currentUser = { UserName: '' }; + vm.externalLoginInit = $location.search().init; // For external login's + vm.isSaving = false; + vm.isSaveDisabled = isSaveDisabled; + + _init(); + + function _init() { + + vm.currentUser = dataContext.getCurrentUser(); + vm.bindingModel.UserName = vm.currentUser.UserName; + + // Generate test data if localhost + if ($location.host() === 'localhost') { + vm.bindingModel.UserName = dataContext.getUniqueUserName(); + } + } + + function cancel() { + $location.url(getReturnUrl()); + } + + function changeUserName() { + + vm.isSaving = true; + + dataContext.changeUserName(vm.bindingModel) + .success(() => { + logger.logSuccess('Your username has been changed!', null, true); + $location.url(getReturnUrl()); + }) + .finally(() => { + vm.isSaving = false; + }); + } + + function getReturnUrl() { + var clientReturnUrl = $location.search().clientReturnUrl; + return typeof clientReturnUrl !== 'undefined' ? clientReturnUrl : '/_system/account'; + } + + function isSaveDisabled() { + return vm.bindingModel.UserName === vm.currentUser.UserName || vm.isSaving; + } + } + } + + angular.module('main').controller(controllerId, ChangeUserNameController); +} \ No newline at end of file diff --git a/ngClient/_system/js/app/controllers/account/ConfirmEmailController.js b/ngClient/_system/js/app/controllers/account/ConfirmEmailController.js deleted file mode 100644 index e3fbbab82..000000000 --- a/ngClient/_system/js/app/controllers/account/ConfirmEmailController.js +++ /dev/null @@ -1,56 +0,0 @@ -(function () { - 'use strict'; - - var controllerId = 'ConfirmEmailController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', '$location', '$rootScope', ConfirmEmailController]); - - function ConfirmEmailController(dataContext, logger, $location, $rootScope) { - - // Logger - logger = logger.forSource(controllerId); - - var vm = this; - vm.currentUser = { EmailConfirmed: false, isAuthenticated: function () { return false; } }; - vm.isResendDisabled = false; - vm.resendConfirmationEmail = resendConfirmationEmail; - - _init(); - - /*** Implementations ***/ - - function _init() { - - vm.currentUser = dataContext.getCurrentUser(); - - if (!vm.currentUser.isAuthenticated()) { - return; - } - - // If there is no token, no need to continue - var token = $location.search().token; - if (typeof token === 'undefined') { - return; - } - - dataContext.confirmEmail({ Token: token }) - .then(function () { - logger.logSuccess('Your email address has been confirmed!', null, true); - $location.url('/_system/account'); - }); - } - - function resendConfirmationEmail() { - - vm.isResendDisabled = true; - - dataContext.resendConfirmationEmail() - .then(function () { - logger.logSuccess('Confirmation email has been resent to your email address!', null, true); - }) - .finally(function () { - vm.isResendDisabled = false; - }); - } - } -})(); diff --git a/ngClient/_system/js/app/controllers/account/ConfirmEmailController.ts b/ngClient/_system/js/app/controllers/account/ConfirmEmailController.ts new file mode 100644 index 000000000..081cb18f1 --- /dev/null +++ b/ngClient/_system/js/app/controllers/account/ConfirmEmailController.ts @@ -0,0 +1,66 @@ +module Main.Controller { + 'use strict'; + + var controllerId = 'ConfirmEmailController'; + + export class ConfirmEmailController { + + static $inject = ['dataContext', 'logger', '$location', '$rootScope']; + + constructor(dataContext: any, logger: any, $location: any, $rootScope: any) { + + // Logger + logger = logger.forSource(controllerId); + + var vm:any = this; + vm.currentUser = { + EmailConfirmed: false, + isAuthenticated() { + return false; + } + }; + vm.isResendDisabled = false; + vm.resendConfirmationEmail = resendConfirmationEmail; + + _init(); + + /*** Implementations ***/ + + function _init() { + + vm.currentUser = dataContext.getCurrentUser(); + + if (!vm.currentUser.isAuthenticated()) { + return; + } + + // If there is no token, no need to continue + var token = $location.search().token; + if (typeof token === 'undefined') { + return; + } + + dataContext.confirmEmail({ Token: token }) + .then(() => { + logger.logSuccess('Your email address has been confirmed!', null, true); + $location.url('/_system/account'); + }); + } + + function resendConfirmationEmail() { + + vm.isResendDisabled = true; + + dataContext.resendConfirmationEmail() + .then(() => { + logger.logSuccess('Confirmation email has been resent to your email address!', null, true); + }) + .finally(() => { + vm.isResendDisabled = false; + }); + } + } + } + + angular.module('main').controller(controllerId, ConfirmEmailController); +} \ No newline at end of file diff --git a/ngClient/_system/js/app/controllers/account/LoginController.js b/ngClient/_system/js/app/controllers/account/LoginController.js deleted file mode 100644 index cc3462ef4..000000000 --- a/ngClient/_system/js/app/controllers/account/LoginController.js +++ /dev/null @@ -1,88 +0,0 @@ -(function () { - 'use strict'; - - var controllerId = 'LoginController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'locationHistory', 'logger', 'serviceAppUrl', '$location', '$rootScope', '$scope', LoginController]); - - function LoginController(dataContext, locationHistory, logger, serviceAppUrl, $location, $rootScope, $scope) { - logger = logger.forSource(controllerId); - - var vm = this; - vm.isSaving = false; - vm.isSaveDisabled = isSaveDisabled; - vm.login = login; - vm.password = ''; - vm.rememberMe = true; - vm.showHeader = typeof $scope.showHeader !== 'undefined' ? $scope.showHeader : true; - vm.userName = ''; - - _init(); - - function _init() { - - // Error - var error = $location.search().error; - if (typeof error !== 'undefined') { - logger.logError(error, null, true); - return; - } - - login(); - } - - function getReturnUrl() { - // If login pages called after a result from server, it will have "clientReturnUrl" param, which will have a higher priority than locationHistory - var clientReturnUrl = $location.search().clientReturnUrl; - return typeof clientReturnUrl !== 'undefined' ? clientReturnUrl : locationHistory.previousItem().url(); - } - - function isSaveDisabled() { - return vm.isSaving; - } - - function login() { - - // External (single use token) login - var singleUseToken = $location.search().token; - var init = $location.search().init; - if (typeof singleUseToken !== 'undefined') { - vm.isSaving = true; - dataContext.login('', '', vm.rememberMe, singleUseToken).then(successExternal).catch(failedExternal).finally(function () { - vm.isSaving = false; - }); - } else { // Internal login - if (vm.userName !== '' && vm.password !== '') { - vm.isSaving = true; - dataContext.login(vm.userName, vm.password, vm.rememberMe).then(successInternal).finally(function () { - vm.isSaving = false; - }); - } - } - - function failedExternal() { - logger.logError('Invalid token', null, true); - } - - function successExternal() { - logger.logSuccess('You have been logged in!', null, true); - - // First time - if (typeof init !== 'undefined' && init) { - var url = '/_system/account/changeUserName?init=true&clientReturnUrl=' + getReturnUrl(); - $location.url(url); - } else { - $location.url(getReturnUrl()); - } - } - - function successInternal() { - logger.logSuccess('You have been logged in!', null, true); - - if ($location.path() === '/_system/account/login') { - $location.url(getReturnUrl()); - } - } - } - } -})(); diff --git a/ngClient/_system/js/app/controllers/account/LoginController.ts b/ngClient/_system/js/app/controllers/account/LoginController.ts new file mode 100644 index 000000000..e0103fd0e --- /dev/null +++ b/ngClient/_system/js/app/controllers/account/LoginController.ts @@ -0,0 +1,105 @@ +module Main.Controller { + 'use strict'; + + var controllerId = 'LoginController'; + + export class LoginController { + + static $inject = ['dataContext', 'locationHistory', 'logger', 'serviceAppUrl', '$location', '$rootScope', '$scope']; + + constructor(dataContext: any, + locationHistory: any, + logger: any, + serviceAppUrl: any, + $location: any, + $rootScope: any, + $scope: any) { + + logger = logger.forSource(controllerId); + + var vm:any = this; + vm.isSaving = false; + vm.isSaveDisabled = isSaveDisabled; + vm.login = login; + vm.password = ''; + vm.rememberMe = true; + vm.showHeader = typeof $scope.showHeader !== 'undefined' ? $scope.showHeader : true; + vm.userName = ''; + + _init(); + + function _init() { + + // Error + var error = $location.search().error; + if (typeof error !== 'undefined') { + logger.logError(error, null, true); + return; + } + + login(); + } + + function getReturnUrl() { + // If login pages called after a result from server, it will have "clientReturnUrl" param, which will have a higher priority than locationHistory + var clientReturnUrl = $location.search().clientReturnUrl; + return typeof clientReturnUrl !== 'undefined' ? clientReturnUrl : locationHistory.previousItem().url(); + } + + function isSaveDisabled() { + return vm.isSaving; + } + + function login() { + + // External (single use token) login + var singleUseToken = $location.search().token; + var init = $location.search().init; + if (typeof singleUseToken !== 'undefined') { + vm.isSaving = true; + dataContext.login('', '', vm.rememberMe, singleUseToken) + .then(successExternal) + .catch(failedExternal) + .finally(() => { + vm.isSaving = false; + }); + } else { // Internal login + if (vm.userName !== '' && vm.password !== '') { + vm.isSaving = true; + dataContext.login(vm.userName, vm.password, vm.rememberMe) + .then(successInternal) + .finally(() => { + vm.isSaving = false; + }); + } + } + + function failedExternal() { + logger.logError('Invalid token', null, true); + } + + function successExternal() { + logger.logSuccess('You have been logged in!', null, true); + + // First time + if (typeof init !== 'undefined' && init) { + var url = '/_system/account/changeUserName?init=true&clientReturnUrl=' + getReturnUrl(); + $location.url(url); + } else { + $location.url(getReturnUrl()); + } + } + + function successInternal() { + logger.logSuccess('You have been logged in!', null, true); + + if ($location.path() === '/_system/account/login') { + $location.url(getReturnUrl()); + } + } + } + } + } + + angular.module('main').controller(controllerId, LoginController); +} \ No newline at end of file diff --git a/ngClient/_system/js/app/controllers/account/ProfileController.js b/ngClient/_system/js/app/controllers/account/ProfileController.js deleted file mode 100644 index 7e7abdddb..000000000 --- a/ngClient/_system/js/app/controllers/account/ProfileController.js +++ /dev/null @@ -1,51 +0,0 @@ -(function () { - 'use strict'; - - var controllerId = 'ProfileController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', '$location', '$routeParams', '$scope', ProfileController]); - - function ProfileController(dataContext, logger, $location, $routeParams, $scope) { - - // Logger - logger = logger.forSource(controllerId); - - var userName = $routeParams.userName; - var vm = this; - vm.currentUser = { Id: 0 }; - vm.user = { Id: 0, UserName: '', Email: '' }; - - // Events - $scope.$on('dataContext_currentUserChanged', currentUserChanged); - - _init(); - - function _init() { - - vm.currentUser = dataContext.getCurrentUser(); - - // If userName equals to current user - if (userName === vm.currentUser.UserName) { - vm.user = vm.currentUser; - } else { - - // If not, then check it against remote - dataContext.getUser(userName) - .then(function (user) { - - // Not found, navigate to 404 - if (user === null) { - $location.url('/_system/content/notFound?url=' + $location.url()); - return; - } - - vm.user = user; - }); - } - } - - function currentUserChanged(event, newUser) { - vm.currentUser = newUser; - } - } -})(); diff --git a/ngClient/_system/js/app/controllers/account/ProfileController.ts b/ngClient/_system/js/app/controllers/account/ProfileController.ts new file mode 100644 index 000000000..2a4fb1e04 --- /dev/null +++ b/ngClient/_system/js/app/controllers/account/ProfileController.ts @@ -0,0 +1,57 @@ +module Main.Controller { + 'use strict'; + + var controllerId = 'ProfileController'; + + export class ProfileController { + + static $inject = ['dataContext', 'logger', '$location', '$routeParams', '$scope']; + + constructor(dataContext: any, logger: any, $location: any, $routeParams: any, $scope: any) { + + // Logger + logger = logger.forSource(controllerId); + + var userName = $routeParams.userName; + var vm:any = this; + vm.currentUser = { Id: 0 }; + vm.user = { Id: 0, UserName: '', Email: '' }; + + // Events + $scope.$on('dataContext_currentUserChanged', currentUserChanged); + + _init(); + + function _init() { + + vm.currentUser = dataContext.getCurrentUser(); + + // If userName equals to current user + if (userName === vm.currentUser.UserName) { + vm.user = vm.currentUser; + } else { + + // If not, then check it against remote + dataContext.getUser(userName) + .then(user => { + + // Not found, navigate to 404 + if (user === null) { + $location.url('/_system/content/notFound?url=' + $location.url()); + return; + } + + vm.user = user; + }); + } + } + + function currentUserChanged(event: any, newUser: any); + function currentUserChanged(event, newUser) { + vm.currentUser = newUser; + } + } + } + + angular.module('main').controller(controllerId, ProfileController); +} \ No newline at end of file diff --git a/ngClient/_system/js/app/controllers/account/RegisterController.js b/ngClient/_system/js/app/controllers/account/RegisterController.js deleted file mode 100644 index 7d8049313..000000000 --- a/ngClient/_system/js/app/controllers/account/RegisterController.js +++ /dev/null @@ -1,51 +0,0 @@ -(function () { - 'use strict'; - - var controllerId = 'RegisterController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'locationHistory', 'logger', 'serviceAppUrl', '$location', '$rootScope', '$scope', RegisterController]); - - function RegisterController(dataContext, locationHistory, logger, serviceAppUrl, $location, $rootScope, $scope) { - - // Logger - logger = logger.forSource(controllerId); - - var vm = this; - vm.bindingModel = { - UserName: '', - Email: '', - Password: '', - ConfirmPassword: '' - }; - vm.isSaving = false; - vm.isSaveDisabled = isSaveDisabled; - vm.register = register; - vm.rememberMe = true; - vm.showHeader = typeof $scope.showHeader !== 'undefined' ? $scope.showHeader : true; - - function isSaveDisabled() { - return vm.isSaving; - } - - function register() { - - vm.isSaving = true; - - dataContext.register(vm.bindingModel, vm.rememberMe) - .then(function () { - logger.logSuccess('You have been registered!', null, true); - $location.url('/_system/account/confirmEmail'); - }) - .catch(failed) - .finally(function () { - vm.isSaving = false; - }); - - function failed(response) { - if (typeof response.error_description !== 'undefined') { - logger.logError(response.error_description, null, true); - } - } - } - } -})(); diff --git a/ngClient/_system/js/app/controllers/account/RegisterController.ts b/ngClient/_system/js/app/controllers/account/RegisterController.ts new file mode 100644 index 000000000..f716156e3 --- /dev/null +++ b/ngClient/_system/js/app/controllers/account/RegisterController.ts @@ -0,0 +1,65 @@ +module Main.Controller { + 'use strict'; + + var controllerId = 'RegisterController'; + + export class RegisterController { + + static $inject = [ + 'dataContext', 'locationHistory', 'logger', 'serviceAppUrl', '$location', '$rootScope', '$scope' + ]; + + constructor(dataContext: any, + locationHistory: any, + logger: any, + serviceAppUrl: any, + $location: any, + $rootScope: any, + $scope: any) { + + // Logger + logger = logger.forSource(controllerId); + + var vm:any = this; + vm.bindingModel = { + UserName: '', + Email: '', + Password: '', + ConfirmPassword: '' + }; + vm.isSaving = false; + vm.isSaveDisabled = isSaveDisabled; + vm.register = register; + vm.rememberMe = true; + vm.showHeader = typeof $scope.showHeader !== 'undefined' ? $scope.showHeader : true; + + function isSaveDisabled() { + return vm.isSaving; + } + + function register() { + + vm.isSaving = true; + + dataContext.register(vm.bindingModel, vm.rememberMe) + .then(() => { + logger.logSuccess('You have been registered!', null, true); + $location.url('/_system/account/confirmEmail'); + }) + .catch(failed) + .finally(() => { + vm.isSaving = false; + }); + + function failed(response: any); + function failed(response) { + if (typeof response.error_description !== 'undefined') { + logger.logError(response.error_description, null, true); + } + } + } + } + } + + angular.module('main').controller(controllerId, RegisterController); +} \ No newline at end of file diff --git a/ngClient/_system/js/app/controllers/account/ResetPasswordController.js b/ngClient/_system/js/app/controllers/account/ResetPasswordController.js deleted file mode 100644 index c8fcd035b..000000000 --- a/ngClient/_system/js/app/controllers/account/ResetPasswordController.js +++ /dev/null @@ -1,62 +0,0 @@ -(function () { - 'use strict'; - - var controllerId = 'ResetPasswordController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', '$location', ResetPasswordController]); - - function ResetPasswordController(dataContext, logger, $location) { - logger = logger.forSource(controllerId); - - var vm = this; - vm.bindingModel = { - Email: $location.search().email, - Token: $location.search().token, - NewPassword: '', - ConfirmPassword: '' - }; - vm.isSaving = false; - vm.isSaveDisabled = isSaveDisabled; - vm.requestBindingModel = { - Email: '' - }; - vm.resetPassword = resetPassword; - vm.resetPasswordRequest = resetPasswordRequest; - vm.viewMode = typeof $location.search().email === 'undefined' || typeof $location.search().token === 'undefined' ? - 'initial' : - 'received'; // initial | sent | received - - /*** Implementations ***/ - - function isSaveDisabled() { - return vm.isSaving; - } - - function resetPassword() { - - vm.isSaving = true; - - dataContext.resetPassword(vm.bindingModel) - .success(function () { - logger.logSuccess('Your password has been reset!', null, true); - $location.url('/_system/account/login'); - }) - .finally(function () { - vm.isSaving = false; - }); - } - - function resetPasswordRequest() { - - vm.isSaving = true; - - dataContext.resetPasswordRequest(vm.requestBindingModel) - .success(function () { - vm.viewMode = 'sent'; - }) - .finally(function () { - vm.isSaving = false; - }); - } - } -})(); diff --git a/ngClient/_system/js/app/controllers/account/ResetPasswordController.ts b/ngClient/_system/js/app/controllers/account/ResetPasswordController.ts new file mode 100644 index 000000000..e76e8963e --- /dev/null +++ b/ngClient/_system/js/app/controllers/account/ResetPasswordController.ts @@ -0,0 +1,69 @@ +module Main.Controller { + 'use strict'; + + var controllerId = 'ResetPasswordController'; + + export class ResetPasswordController { + + static $inject = ['dataContext', 'logger', '$location']; + + constructor(dataContext: any, logger: any, $location: any) { + + logger = logger.forSource(controllerId); + + var vm:any = this; + vm.bindingModel = { + Email: $location.search().email, + Token: $location.search().token, + NewPassword: '', + ConfirmPassword: '' + }; + vm.isSaving = false; + vm.isSaveDisabled = isSaveDisabled; + vm.requestBindingModel = { + Email: '' + }; + vm.resetPassword = resetPassword; + vm.resetPasswordRequest = resetPasswordRequest; + vm.viewMode = typeof $location.search().email === 'undefined' || + typeof $location.search().token === 'undefined' + ? 'initial' + : 'received'; // initial | sent | received + + /*** Implementations ***/ + + function isSaveDisabled() { + return vm.isSaving; + } + + function resetPassword() { + + vm.isSaving = true; + + dataContext.resetPassword(vm.bindingModel) + .success(() => { + logger.logSuccess('Your password has been reset!', null, true); + $location.url('/_system/account/login'); + }) + .finally(() => { + vm.isSaving = false; + }); + } + + function resetPasswordRequest() { + + vm.isSaving = true; + + dataContext.resetPasswordRequest(vm.requestBindingModel) + .success(() => { + vm.viewMode = 'sent'; + }) + .finally(() => { + vm.isSaving = false; + }); + } + } + } + + angular.module('main').controller(controllerId, ResetPasswordController); +} \ No newline at end of file diff --git a/ngClient/_system/js/app/controllers/account/SocialLoginsController.js b/ngClient/_system/js/app/controllers/account/SocialLoginsController.js deleted file mode 100644 index 689e99942..000000000 --- a/ngClient/_system/js/app/controllers/account/SocialLoginsController.js +++ /dev/null @@ -1,26 +0,0 @@ -(function () { - 'use strict'; - - var controllerId = 'SocialLoginsController'; - angular.module('main') - .controller(controllerId, ['locationHistory', 'logger', 'serviceAppUrl', '$location', SocialLoginsController]); - - function SocialLoginsController(locationHistory, logger, serviceAppUrl, $location) { - - // Logger - logger = logger.forSource(controllerId); - - var vm = this; - vm.getExternalLoginUrl = getExternalLoginUrl; - - function getExternalLoginUrl(provider) { - return serviceAppUrl + '/api/Account/ExternalLogin?provider=' + provider + '&clientReturnUrl=' + getReturnUrl(); - } - - function getReturnUrl() { - // If login pages called after a result from server, it will have "clientReturnUrl" param, which will have a higher priority than locationHistory - var clientReturnUrl = $location.search().clientReturnUrl; - return typeof clientReturnUrl !== 'undefined' ? clientReturnUrl : locationHistory.previousItem().url(); - } - } -})(); diff --git a/ngClient/_system/js/app/controllers/account/SocialLoginsController.ts b/ngClient/_system/js/app/controllers/account/SocialLoginsController.ts new file mode 100644 index 000000000..80b13382b --- /dev/null +++ b/ngClient/_system/js/app/controllers/account/SocialLoginsController.ts @@ -0,0 +1,36 @@ +module Main.Controller { + 'use strict'; + + var controllerId = 'SocialLoginsController'; + + export class SocialLoginsController { + + static $inject = ['locationHistory', 'logger', 'serviceAppUrl', '$location']; + + constructor(locationHistory: any, logger: any, serviceAppUrl: any, $location: any) { + + // Logger + logger = logger.forSource(controllerId); + + var vm:any = this; + vm.getExternalLoginUrl = getExternalLoginUrl; + + function getExternalLoginUrl(provider: any); + function getExternalLoginUrl(provider) { + return serviceAppUrl + + '/api/Account/ExternalLogin?provider=' + + provider + + '&clientReturnUrl=' + + getReturnUrl(); + } + + function getReturnUrl() { + // If login pages called after a result from server, it will have "clientReturnUrl" param, which will have a higher priority than locationHistory + var clientReturnUrl = $location.search().clientReturnUrl; + return typeof clientReturnUrl !== 'undefined' ? clientReturnUrl : locationHistory.previousItem().url(); + } + } + } + + angular.module('main').controller(controllerId, SocialLoginsController); +} \ No newline at end of file diff --git a/ngClient/_system/js/app/controllers/content/AllInOneController.js b/ngClient/_system/js/app/controllers/content/AllInOneController.js deleted file mode 100644 index 372ec7dc1..000000000 --- a/ngClient/_system/js/app/controllers/content/AllInOneController.js +++ /dev/null @@ -1,60 +0,0 @@ -(function () { - 'use strict'; - - var controllerId = 'AllInOneController'; - angular.module('main') - .controller(controllerId, ['logger', 'resourcePoolFactory', '$scope', AllInOneController]); - - function AllInOneController(logger, resourcePoolFactory, $scope) { - - logger = logger.forSource(controllerId); - - var vm = this; - vm.allInOneConfig = { userName: 'sample', resourcePoolKey: 'All-in-One' }; - - // Event listeners - $scope.$on('resourcePoolEditor_elementCellNumericValueIncreased', processNewInteraction); - $scope.$on('resourcePoolEditor_elementCellNumericValueDecreased', processNewInteraction); - $scope.$on('resourcePoolEditor_elementCellNumericValueReset', processNewInteraction); - - _init(); - - function _init() { - processExistingInteraction(); - } - - // Processes whether the current user had already interacted with this example - function processExistingInteraction() { - // Priority & Knowledge Index examples copy their ratings to this one - // However if the user starts directly playing .. - resourcePoolFactory.getResourcePoolExpanded(vm.allInOneConfig) - .then(function (resourcePool) { - // Elements - for (var elementIndex = 0; elementIndex < resourcePool.ElementSet.length; elementIndex++) { - var element = resourcePool.ElementSet[elementIndex]; - // Element fields - for (var elementFieldIndex = 0; elementFieldIndex < element.ElementFieldSet.length; elementFieldIndex++) { - var elementField = element.ElementFieldSet[elementFieldIndex]; - // Element cells - for (var elementCellIndex = 0; elementCellIndex < elementField.ElementCellSet.length; elementCellIndex++) { - var elementCell = elementField.ElementCellSet[elementCellIndex]; - - if (elementCell.currentUserCell()) { - resourcePool.userInteracted = true; - return; - } - } - } - } - }); - } - - // Processes whether the user is currently interacting with this example - function processNewInteraction(event, cell) { - if (cell.ElementField.Element.ResourcePool.User.UserName === vm.allInOneConfig.userName && cell.ElementField.Element.ResourcePool.Key === vm.allInOneConfig.resourcePoolKey) { - cell.ElementField.Element.ResourcePool.userInteracted = true; - return; - } - } - } -})(); diff --git a/ngClient/_system/js/app/controllers/content/AllInOneController.ts b/ngClient/_system/js/app/controllers/content/AllInOneController.ts new file mode 100644 index 000000000..34c7b55bc --- /dev/null +++ b/ngClient/_system/js/app/controllers/content/AllInOneController.ts @@ -0,0 +1,71 @@ +module Main.Controller { + 'use strict'; + + var controllerId = 'AllInOneController'; + + export class AllInOneController { + + static $inject = ['logger', 'resourcePoolFactory', '$scope']; + + constructor(logger: any, resourcePoolFactory: any, $scope: any) { + + logger = logger.forSource(controllerId); + + var vm:any = this; + vm.allInOneConfig = { userName: 'sample', resourcePoolKey: 'All-in-One' }; + + // Event listeners + $scope.$on('resourcePoolEditor_elementCellNumericValueIncreased', processNewInteraction); + $scope.$on('resourcePoolEditor_elementCellNumericValueDecreased', processNewInteraction); + $scope.$on('resourcePoolEditor_elementCellNumericValueReset', processNewInteraction); + + _init(); + + function _init() { + processExistingInteraction(); + } + + // Processes whether the current user had already interacted with this example + function processExistingInteraction() { + // Priority & Knowledge Index examples copy their ratings to this one + // However if the user starts directly playing .. + resourcePoolFactory.getResourcePoolExpanded(vm.allInOneConfig) + .then(resourcePool => { + // Elements + for (var elementIndex = 0; elementIndex < resourcePool.ElementSet.length; elementIndex++) { + var element = resourcePool.ElementSet[elementIndex]; + // Element fields + for (var elementFieldIndex = 0; + elementFieldIndex < element.ElementFieldSet.length; + elementFieldIndex++) { + var elementField = element.ElementFieldSet[elementFieldIndex]; + // Element cells + for (var elementCellIndex = 0; + elementCellIndex < elementField.ElementCellSet.length; + elementCellIndex++) { + var elementCell = elementField.ElementCellSet[elementCellIndex]; + + if (elementCell.currentUserCell()) { + resourcePool.userInteracted = true; + return; + } + } + } + } + }); + } + + // Processes whether the user is currently interacting with this example + function processNewInteraction(event: any, cell: any); + function processNewInteraction(event, cell) { + if (cell.ElementField.Element.ResourcePool.User.UserName === vm.allInOneConfig.userName && + cell.ElementField.Element.ResourcePool.Key === vm.allInOneConfig.resourcePoolKey) { + cell.ElementField.Element.ResourcePool.userInteracted = true; + return; + } + } + } + } + + angular.module('main').controller(controllerId, AllInOneController); +} \ No newline at end of file diff --git a/ngClient/_system/js/app/controllers/content/BasicsController.js b/ngClient/_system/js/app/controllers/content/BasicsController.js deleted file mode 100644 index 6bc6bc540..000000000 --- a/ngClient/_system/js/app/controllers/content/BasicsController.js +++ /dev/null @@ -1,59 +0,0 @@ -(function () { - 'use strict'; - - var controllerId = 'BasicsController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', 'resourcePoolFactory', '$scope', BasicsController]); - - function BasicsController(dataContext, logger, resourcePoolFactory, $scope) { - - // Logger - logger = logger.forSource(controllerId); - - var vm = this; - vm.existingModelConfig = { userName: 'sample', resourcePoolKey: 'Basics-Existing-Model' }; - vm.newModelConfig = { userName: 'sample', resourcePoolKey: 'Basics-New-Model' }; - - // Listen resource pool updated event - $scope.$on('resourcePoolEditor_elementMultiplierIncreased', updateOppositeResourcePool); - $scope.$on('resourcePoolEditor_elementMultiplierDecreased', updateOppositeResourcePool); - $scope.$on('resourcePoolEditor_elementMultiplierReset', updateOppositeResourcePool); - - /*** Implementations ***/ - - function updateOppositeResourcePool(event, element) { - - var oppositeKey = null; - - if (element.ResourcePool.User.UserName === vm.existingModelConfig.userName && element.ResourcePool.Key === vm.existingModelConfig.resourcePoolKey) { - oppositeKey = vm.newModelConfig; - } else if (element.ResourcePool.User.UserName === vm.newModelConfig.userName && element.ResourcePool.Key === vm.newModelConfig.resourcePoolKey) { - oppositeKey = vm.existingModelConfig; - } - - // Call the service to increase the multiplier - if (oppositeKey !== null) { - resourcePoolFactory.getResourcePoolExpanded(oppositeKey) - .then(function (resourcePool) { - - switch (event.name) { - case 'resourcePoolEditor_elementMultiplierIncreased': { - resourcePoolFactory.updateElementMultiplier(resourcePool.mainElement(), 'increase'); - break; - } - case 'resourcePoolEditor_elementMultiplierDecreased': { - resourcePoolFactory.updateElementMultiplier(resourcePool.mainElement(), 'decrease'); - break; - } - case 'resourcePoolEditor_elementMultiplierReset': { - resourcePoolFactory.updateElementMultiplier(resourcePool.mainElement(), 'reset'); - break; - } - } - - dataContext.saveChanges(1500); - }); - } - } - } -})(); diff --git a/ngClient/_system/js/app/controllers/content/BasicsController.ts b/ngClient/_system/js/app/controllers/content/BasicsController.ts new file mode 100644 index 000000000..8f9ee2484 --- /dev/null +++ b/ngClient/_system/js/app/controllers/content/BasicsController.ts @@ -0,0 +1,70 @@ +module Main.Controller { + 'use strict'; + + var controllerId = 'BasicsController'; + + export class BasicsController { + + static $inject = ['dataContext', 'logger', 'resourcePoolFactory', '$scope']; + + constructor(dataContext: any, logger: any, resourcePoolFactory: any, $scope: any) { + + // Logger + logger = logger.forSource(controllerId); + + var vm:any = this; + vm.existingModelConfig = { userName: 'sample', resourcePoolKey: 'Basics-Existing-Model' }; + vm.newModelConfig = { userName: 'sample', resourcePoolKey: 'Basics-New-Model' }; + + // Listen resource pool updated event + $scope.$on('resourcePoolEditor_elementMultiplierIncreased', updateOppositeResourcePool); + $scope.$on('resourcePoolEditor_elementMultiplierDecreased', updateOppositeResourcePool); + $scope.$on('resourcePoolEditor_elementMultiplierReset', updateOppositeResourcePool); + + /*** Implementations ***/ + + function updateOppositeResourcePool(event: any, element: any); + function updateOppositeResourcePool(event, element) { + + var oppositeKey = null; + + if (element.ResourcePool.User.UserName === vm.existingModelConfig.userName && + element.ResourcePool.Key === vm.existingModelConfig.resourcePoolKey) { + oppositeKey = vm.newModelConfig; + } else if (element.ResourcePool.User.UserName === vm.newModelConfig.userName && + element.ResourcePool.Key === vm.newModelConfig.resourcePoolKey) { + oppositeKey = vm.existingModelConfig; + } + + // Call the service to increase the multiplier + if (oppositeKey !== null) { + resourcePoolFactory.getResourcePoolExpanded(oppositeKey) + .then(resourcePool => { + + switch (event.name) { + case 'resourcePoolEditor_elementMultiplierIncreased': + { + resourcePoolFactory.updateElementMultiplier(resourcePool.mainElement(), 'increase'); + break; + } + case 'resourcePoolEditor_elementMultiplierDecreased': + { + resourcePoolFactory.updateElementMultiplier(resourcePool.mainElement(), 'decrease'); + break; + } + case 'resourcePoolEditor_elementMultiplierReset': + { + resourcePoolFactory.updateElementMultiplier(resourcePool.mainElement(), 'reset'); + break; + } + } + + dataContext.saveChanges(1500); + }); + } + } + } + } + + angular.module('main').controller(controllerId, BasicsController); +} \ No newline at end of file diff --git a/ngClient/_system/js/app/controllers/content/ContributorsController.js b/ngClient/_system/js/app/controllers/content/ContributorsController.js deleted file mode 100644 index dc0d72637..000000000 --- a/ngClient/_system/js/app/controllers/content/ContributorsController.js +++ /dev/null @@ -1,20 +0,0 @@ -(function () { - 'use strict'; - - var controllerId = 'ContributorsController'; - angular.module('main') - .controller(controllerId, ['logger', ContributorsController]); - - function ContributorsController(logger) { - - // Logger - logger = logger.forSource(controllerId); - - var vm = this; - vm.getDate = getDate; - - function getDate(day, month, year) { - return new Date(year, month - 1, day); - } - } -})(); diff --git a/ngClient/_system/js/app/controllers/content/ContributorsController.ts b/ngClient/_system/js/app/controllers/content/ContributorsController.ts new file mode 100644 index 000000000..ffb74007f --- /dev/null +++ b/ngClient/_system/js/app/controllers/content/ContributorsController.ts @@ -0,0 +1,25 @@ +module Main.Controller { + 'use strict'; + + var controllerId = 'ContributorsController'; + + export class ContributorsController { + + static $inject = ['logger']; + + constructor(logger: any) { + + // Logger + logger = logger.forSource(controllerId); + + var vm:any = this; + vm.getDate = getDate; + + function getDate(day: any, month: any, year: any) { + return new Date(year, month - 2, day); + } + } + } + + angular.module('main').controller(controllerId, ContributorsController); +} \ No newline at end of file diff --git a/ngClient/_system/js/app/controllers/content/DefaultController.js b/ngClient/_system/js/app/controllers/content/DefaultController.js deleted file mode 100644 index c1c7c31da..000000000 --- a/ngClient/_system/js/app/controllers/content/DefaultController.js +++ /dev/null @@ -1,161 +0,0 @@ -(function () { - 'use strict'; - - var controllerId = 'DefaultController'; - angular.module('main') - .controller(controllerId, ['applicationFactory', 'dataContext', 'disqusShortname', 'logger', '$location', '$rootScope', '$scope', '$uibModal', DefaultController]); - - function DefaultController(applicationFactory, dataContext, disqusShortname, logger, $location, $rootScope, $scope, $uibModal) { - - // Logger - logger = logger.forSource(controllerId); - - // View model - var vm = this; - vm.applicationInfo = null; - vm.currentUser = { Email: '', isAuthenticated: function () { return false; }, HasPassword: false }; - vm.currentDate = new Date(); - vm.currentUserText = currentUserText; - vm.displayBankTransfer = false; - vm.displayFooterIcons = false; - vm.disqusConfig = { - disqus_shortname: disqusShortname, - disqus_identifier: '', - disqus_url: '' - }; - vm.guestAccountInfoVisible = false; - vm.logout = logout; - vm.openGuestAccountInfo = openGuestAccountInfo; - vm.toggleBankTransfer = toggleBankTransfer; - - // Events - $scope.$on('dataContext_currentUserChanged', currentUserChanged); - $scope.$on('dataContext_currentUserEmailAddressChanged', currentUserEmailAddressChanged); - $scope.$on('guestAccountCreated', guestAccountCreated); - $scope.$on('$locationChangeStart', locationChangeStart); - $scope.$on('$routeChangeSuccess', routeChangeSuccess); - - _init(); - - /*** Implementations ***/ - - function _init() { - getApplicationInfo(); - } - - function currentUserChanged(event, newUser) { - vm.currentUser = newUser; - vm.guestAccountInfoVisible = newUser.isAuthenticated() && newUser.IsAnonymous; - } - - function currentUserText() { - var userText = vm.currentUser.UserName; - - if (vm.currentUser.IsAnonymous) { - userText += ' (Guest)'; - } - - return userText; - } - - function currentUserEmailAddressChanged() { - vm.guestAccountInfoVisible = false; - } - - function getApplicationInfo() { - applicationFactory.getApplicationInfo() - .then(function (applicationInfo) { - vm.applicationInfo = applicationInfo; - vm.applicationInfo.CurrentVersionText = vm.applicationInfo.CurrentVersion + ' - Alpha ~ Beta'; - }); - } - - function guestAccountCreated() { - vm.guestAccountInfoVisible = true; - } - - function logout() { - dataContext.logout() - .then(function () { - $location.url('/'); - }); - } - - function locationChangeStart(event, newUrl, oldUrl) { - - if (dataContext.hasChanges()) { - - var modalInstance = $uibModal.open({ - controller: ['$scope', '$uibModalInstance', function ($scope, $uibModalInstance) { - - var vm = this; - vm.cancel = cancel; - vm.leave = leave; - - function cancel() { - $uibModalInstance.dismiss('cancel'); - } - - function leave() { - $uibModalInstance.close(); - } - }], - controllerAs: 'vm', - templateUrl: '/_system/views/account/confirmNavigateAway.html?v=0.53.0' - }); - - modalInstance.result.then(function () { - - // User choose to cancel the changes & navigate away - dataContext.rejectChanges(); - $location.path(newUrl.substring($location.absUrl().length - $location.url().length)); - - }, function () { }); - - // Always cancel route changes - event.preventDefault(); - return; - } - } - - function openGuestAccountInfo() { - - var modalInstance = $uibModal.open({ - controller: ['$scope', '$uibModalInstance', function ($scope, $uibModalInstance) { - - var vm = this; - vm.close = closeModal; - - $scope.$on('dataContext_currentUserChanged', closeModal); - - function closeModal() { - $uibModalInstance.close(); - } - }], - controllerAs: 'vm', - templateUrl: '/_system/views/account/guestAccountInfo.html?v=0.58.0' - }); - - modalInstance.result.then(function () { }, - function () { }); - } - - function routeChangeSuccess(event, current, previous) { - - // Footer icons - vm.displayFooterIcons = $location.path() === '/'; - - // Load related disqus - if (typeof current.enableDisqus !== 'undefined' && current.enableDisqus && vm.disqusConfig.disqus_shortname !== '') { - vm.disqusConfig.disqus_identifier = vm.disqusConfig.disqus_shortname + $location.path().replace(/\//g, '_'); - vm.disqusConfig.disqus_url = $location.absUrl().substring(0, $location.absUrl().length - $location.url().length + $location.path().length); - } else { - vm.disqusConfig.disqus_identifier = ''; - } - } - - function toggleBankTransfer() { - vm.displayBankTransfer = !vm.displayBankTransfer; - } - } -})(); diff --git a/ngClient/_system/js/app/controllers/content/DefaultController.ts b/ngClient/_system/js/app/controllers/content/DefaultController.ts new file mode 100644 index 000000000..35ed48892 --- /dev/null +++ b/ngClient/_system/js/app/controllers/content/DefaultController.ts @@ -0,0 +1,193 @@ +module Main.Controller { + 'use strict'; + + var controllerId = 'DefaultController'; + + export class DefaultController { + + static $inject = [ + 'applicationFactory', 'dataContext', 'disqusShortname', 'logger', '$location', '$rootScope', '$scope', + '$uibModal' + ]; + + constructor(applicationFactory: any, + dataContext: any, + disqusShortname: any, + logger: any, + $location: any, + $rootScope: any, + $scope: any, + $uibModal: any) { + // Logger + logger = logger.forSource(controllerId); + + // View model + var vm:any = this; + vm.applicationInfo = null; + vm.currentUser = { + Email: '', + isAuthenticated() { + return false; + }, + HasPassword: false + }; + vm.currentDate = new Date(); + vm.currentUserText = currentUserText; + vm.displayBankTransfer = false; + vm.displayFooterIcons = false; + vm.disqusConfig = { + disqus_shortname: disqusShortname, + disqus_identifier: '', + disqus_url: '' + }; + vm.guestAccountInfoVisible = false; + vm.logout = logout; + vm.openGuestAccountInfo = openGuestAccountInfo; + vm.toggleBankTransfer = toggleBankTransfer; + + // Events + $scope.$on('dataContext_currentUserChanged', currentUserChanged); + $scope.$on('dataContext_currentUserEmailAddressChanged', currentUserEmailAddressChanged); + $scope.$on('guestAccountCreated', guestAccountCreated); + $scope.$on('$locationChangeStart', locationChangeStart); + $scope.$on('$routeChangeSuccess', routeChangeSuccess); + + _init(); + + /*** Implementations ***/ + + function _init() { + getApplicationInfo(); + } + + function currentUserChanged(event: any, newUser: any); + function currentUserChanged(event, newUser) { + vm.currentUser = newUser; + vm.guestAccountInfoVisible = newUser.isAuthenticated() && newUser.IsAnonymous; + } + + function currentUserText() { + var userText = vm.currentUser.UserName; + + if (vm.currentUser.IsAnonymous) { + userText += ' (Guest)'; + } + + return userText; + } + + function currentUserEmailAddressChanged() { + vm.guestAccountInfoVisible = false; + } + + function getApplicationInfo() { + applicationFactory.getApplicationInfo() + .then(applicationInfo => { + vm.applicationInfo = applicationInfo; + vm.applicationInfo.CurrentVersionText = vm.applicationInfo.CurrentVersion + ' - Alpha ~ Beta'; + }); + } + + function guestAccountCreated() { + vm.guestAccountInfoVisible = true; + } + + function logout() { + dataContext.logout() + .then(() => { + $location.url('/'); + }); + } + + function locationChangeStart(event: any, newUrl: any, oldUrl: any); + function locationChangeStart(event, newUrl, oldUrl) { + + if (dataContext.hasChanges()) { + + var modalInstance = $uibModal.open({ + controller: [ + '$scope', '$uibModalInstance', function($scope, $uibModalInstance) { + + var vm:any = this; + vm.cancel = cancel; + vm.leave = leave; + + function cancel() { + $uibModalInstance.dismiss('cancel'); + } + + function leave() { + $uibModalInstance.close(); + } + } + ], + controllerAs: 'vm', + templateUrl: '/_system/views/account/confirmNavigateAway.html?v=0.53.0' + }); + + modalInstance.result.then(() => { + + // User choose to cancel the changes & navigate away + dataContext.rejectChanges(); + $location.path(newUrl.substring($location.absUrl().length - $location.url().length)); + + }, + () => {}); + + // Always cancel route changes + event.preventDefault(); + return; + } + } + + function openGuestAccountInfo() { + + var modalInstance = $uibModal.open({ + controller: [ + '$scope', '$uibModalInstance', function($scope, $uibModalInstance) { + + var vm:any = this; + vm.close = closeModal; + + $scope.$on('dataContext_currentUserChanged', closeModal); + + function closeModal() { + $uibModalInstance.close(); + } + } + ], + controllerAs: 'vm', + templateUrl: '/_system/views/account/guestAccountInfo.html?v=0.58.0' + }); + + modalInstance.result.then(() => {}, + () => {}); + } + + function routeChangeSuccess(event: any, current: any, previous: any); + function routeChangeSuccess(event, current, previous) { + + // Footer icons + vm.displayFooterIcons = $location.path() === '/'; + + // Load related disqus + if (typeof current.enableDisqus !== 'undefined' && + current.enableDisqus && + vm.disqusConfig.disqus_shortname !== '') { + vm.disqusConfig.disqus_identifier = vm.disqusConfig.disqus_shortname + + $location.path().replace(/\//g, '_'); + vm.disqusConfig.disqus_url = $location.absUrl() + .substring(0, $location.absUrl().length - $location.url().length + $location.path().length); + } else { + vm.disqusConfig.disqus_identifier = ''; + } + } + + function toggleBankTransfer() { + vm.displayBankTransfer = !vm.displayBankTransfer; + } + } + } + + angular.module('main').controller(controllerId, DefaultController); +} \ No newline at end of file diff --git a/ngClient/_system/js/app/controllers/content/IntroductionController.js b/ngClient/_system/js/app/controllers/content/IntroductionController.js deleted file mode 100644 index d12faac23..000000000 --- a/ngClient/_system/js/app/controllers/content/IntroductionController.js +++ /dev/null @@ -1,49 +0,0 @@ -(function () { - 'use strict'; - - var controllerId = 'IntroductionController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', 'resourcePoolFactory', '$scope', '$timeout', IntroductionController]); - - function IntroductionController(dataContext, logger, resourcePoolFactory, $scope, $timeout) { - - // Logger - logger = logger.forSource(controllerId); - - var vm = this; - vm.upoConfig = { userName: 'sample', resourcePoolKey: 'Unidentified-Profiting-Object' }; - - // TODO Disabled for the moment, since it automatically triggers 'anonymous user interacted' / coni2k - 07 Jun. '16 - //_init(); - - /*** Implementations ***/ - - function _init() { - - resourcePoolFactory.getResourcePoolExpanded(vm.upoConfig) - .then(function (resourcePool) { - - var increaseMultiplierTimeout = $timeout(increaseMultiplier, 500); - - function increaseMultiplier() { - - // Increase the multiplier - resourcePool.ElementSet.forEach(function (element) { - resourcePoolFactory.updateElementMultiplier(element, 'increase'); - }); - - // Then increase recursively - increaseMultiplierTimeout = $timeout(increaseMultiplier, 2500); - } - - // When the DOM element is removed from the page, - // AngularJS will trigger the $destroy event on - // the scope. This gives us a chance to cancel any - // pending timer that we may have. - $scope.$on("$destroy", function (event) { - $timeout.cancel(increaseMultiplierTimeout); - }); - }); - } - } -})(); diff --git a/ngClient/_system/js/app/controllers/content/IntroductionController.ts b/ngClient/_system/js/app/controllers/content/IntroductionController.ts new file mode 100644 index 000000000..a98362933 --- /dev/null +++ b/ngClient/_system/js/app/controllers/content/IntroductionController.ts @@ -0,0 +1,60 @@ +module Main.Controller { + 'use strict'; + + var controllerId = 'IntroductionController'; + + export class IntroductionController { + + static $inject = ['dataContext', 'logger', 'resourcePoolFactory', '$scope', '$timeout']; + + constructor(dataContext: any, + logger: any, + resourcePoolFactory: any, + $scope: any, + $timeout: + any) { + + // Logger + logger = logger.forSource(controllerId); + + var vm:any = this; + vm.upoConfig = { userName: 'sample', resourcePoolKey: 'Unidentified-Profiting-Object' }; + + // TODO Disabled for the moment, since it automatically triggers 'anonymous user interacted' / coni2k - 07 Jun. '16 + //_init(); + + /*** Implementations ***/ + + function _init() { + + resourcePoolFactory.getResourcePoolExpanded(vm.upoConfig) + .then(resourcePool => { + + var increaseMultiplierTimeout = $timeout(increaseMultiplier, 500); + + function increaseMultiplier() { + + // Increase the multiplier + resourcePool.ElementSet.forEach(element => { + resourcePoolFactory.updateElementMultiplier(element, 'increase'); + }); + + // Then increase recursively + increaseMultiplierTimeout = $timeout(increaseMultiplier, 2500); + } + + // When the DOM element is removed from the page, + // AngularJS will trigger the $destroy event on + // the scope. This gives us a chance to cancel any + // pending timer that we may have. + $scope.$on("$destroy", + event => { + $timeout.cancel(increaseMultiplierTimeout); + }); + }); + } + } + } + + angular.module('main').controller(controllerId, IntroductionController); +} \ No newline at end of file diff --git a/ngClient/_system/js/app/controllers/content/KnowledgeIndexController.js b/ngClient/_system/js/app/controllers/content/KnowledgeIndexController.js deleted file mode 100644 index 63d09dc30..000000000 --- a/ngClient/_system/js/app/controllers/content/KnowledgeIndexController.js +++ /dev/null @@ -1,160 +0,0 @@ -(function () { - 'use strict'; - - var controllerId = 'KnowledgeIndexController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', 'resourcePoolFactory', '$scope', '$timeout', KnowledgeIndexController]); - - function KnowledgeIndexController(dataContext, logger, resourcePoolFactory, $scope, $timeout) { - - logger = logger.forSource(controllerId); - - var vm = this; - vm.oldModelChartConfig = { - title: { - text: '' - }, - options: { - chart: { - type: 'column', - height: 358 - }, - plotOptions: { - column: { - allowPointSelect: true, - pointWidth: 15 - } - }, - xAxis: { categories: ['Knowledge'] }, - yAxis: { - title: { - text: 'Development process' - }, - allowDecimals: false, - min: 0 - } - }, - size: {}, - series: [ - { name: "My Precious Jewelry", data: [0] }, - { name: 'Death Star Architecture', data: [0] }, - { name: "Christina's Secret", data: [0] }, - { name: 'Nuka Cola Company', data: [0] } - ] - }; - vm.newModelChartConfig = { - title: { - text: '' - }, - options: { - chart: { - type: 'column', - height: 300 - }, - plotOptions: { - column: { - allowPointSelect: true, - pointWidth: 15 - } - }, - xAxis: { categories: ['Knowledge'] }, - yAxis: { - title: { - text: 'Development process' - }, - allowDecimals: false, - min: 0 - } - }, - size: {}, - series: [ - { name: 'Global Knowledge Database', data: [0] } - ] - }; - vm.knowledgeIndexConfig = { userName: 'sample', resourcePoolKey: 'Knowledge-Index-Sample' }; - vm.popularSoftwareLicensesConfig = { userName: 'sample', resourcePoolKey: 'Knowledge-Index-Popular-Software-Licenses' }; - - // Event listeners - $scope.$on('resourcePoolEditor_elementCellNumericValueIncreased', updateAllInOne); - $scope.$on('resourcePoolEditor_elementCellNumericValueDecreased', updateAllInOne); - $scope.$on('resourcePoolEditor_elementCellNumericValueReset', updateAllInOne); - - _init(); - - function _init() { - var timeout = $timeout(refreshPage, 10000); - - function refreshPage() { - var organizationIndex = Math.floor(Math.random() * 4); - vm.oldModelChartConfig.series[organizationIndex].data[0] += 1; - vm.newModelChartConfig.series[0].data[0] += 1; - - timeout = $timeout(refreshPage, 1000); - } - - // When the DOM element is removed from the page, - // AngularJS will trigger the $destroy event on - // the scope. This gives us a chance to cancel any - // pending timer that we may have. - $scope.$on("$destroy", function (event) { - $timeout.cancel(timeout); - }); - } - - // Sync this example's values with 'All in One' - function updateAllInOne(event, cell) { - - if (cell.ElementField.Element.ResourcePool.User.UserName !== vm.knowledgeIndexConfig.userName && - cell.ElementField.Element.ResourcePool.Key !== vm.knowledgeIndexConfig.resourcePoolKey) { - return; - } - - var allInOneUniqueKey = { userName: 'sample', resourcePoolKey: 'All-in-One' }; - resourcePoolFactory.getResourcePoolExpanded(allInOneUniqueKey) - .then(function (resourcePool) { - - // If the current user already interacted with 'All in One', stop copying ratings - if (typeof resourcePool.userInteracted !== 'undefined' && resourcePool.userInteracted) { - return; - } - - // Elements - for (var elementIndex = 0; elementIndex < resourcePool.ElementSet.length; elementIndex++) { - var element = resourcePool.ElementSet[elementIndex]; - if (element.Name === cell.ElementField.Element.Name) { - // Element fields - for (var elementFieldIndex = 0; elementFieldIndex < element.ElementFieldSet.length; elementFieldIndex++) { - var elementField = element.ElementFieldSet[elementFieldIndex]; - if (elementField.Name === cell.ElementField.Name) { - // Element cells - for (var elementCellIndex = 0; elementCellIndex < elementField.ElementCellSet.length; elementCellIndex++) { - var elementCell = elementField.ElementCellSet[elementCellIndex]; - if (elementCell.ElementItem.Name === cell.ElementItem.Name) { - switch (event.name) { - case 'resourcePoolEditor_elementCellNumericValueIncreased': { - resourcePoolFactory.updateElementCellDecimalValue(elementCell, 'increase'); - break; - } - case 'resourcePoolEditor_elementCellNumericValueDecreased': { - resourcePoolFactory.updateElementCellDecimalValue(elementCell, 'decrease'); - break; - } - case 'resourcePoolEditor_elementCellNumericValueReset': { - resourcePoolFactory.updateElementCellDecimalValue(elementCell, 'reset'); - break; - } - } - - // Save changes - dataContext.saveChanges(1500); - break; - } - } - } - } - } - } - }); - } - } -})(); diff --git a/ngClient/_system/js/app/controllers/content/KnowledgeIndexController.ts b/ngClient/_system/js/app/controllers/content/KnowledgeIndexController.ts new file mode 100644 index 000000000..5f69ae340 --- /dev/null +++ b/ngClient/_system/js/app/controllers/content/KnowledgeIndexController.ts @@ -0,0 +1,184 @@ +module Main.Controller { + 'use strict'; + + var controllerId = 'KnowledgeIndexController'; + + export class KnowledgeIndexController { + + static $inject = ['dataContext', 'logger', 'resourcePoolFactory', '$scope', '$timeout']; + + constructor(dataContext: any, + logger: any, + resourcePoolFactory: any, + $scope: any, + $timeout: any) { + + logger = logger.forSource(controllerId); + + var vm:any = this; + vm.oldModelChartConfig = { + title: { + text: '' + }, + options: { + chart: { + type: 'column', + height: 358 + }, + plotOptions: { + column: { + allowPointSelect: true, + pointWidth: 15 + } + }, + xAxis: { categories: ['Knowledge'] }, + yAxis: { + title: { + text: 'Development process' + }, + allowDecimals: false, + min: 0 + } + }, + size: {}, + series: [ + { name: "My Precious Jewelry", data: [0] }, + { name: 'Death Star Architecture', data: [0] }, + { name: "Christina's Secret", data: [0] }, + { name: 'Nuka Cola Company', data: [0] } + ] + }; + vm.newModelChartConfig = { + title: { + text: '' + }, + options: { + chart: { + type: 'column', + height: 300 + }, + plotOptions: { + column: { + allowPointSelect: true, + pointWidth: 15 + } + }, + xAxis: { categories: ['Knowledge'] }, + yAxis: { + title: { + text: 'Development process' + }, + allowDecimals: false, + min: 0 + } + }, + size: {}, + series: [ + { name: 'Global Knowledge Database', data: [0] } + ] + }; + vm.knowledgeIndexConfig = { userName: 'sample', resourcePoolKey: 'Knowledge-Index-Sample' }; + vm.popularSoftwareLicensesConfig = { + userName: 'sample', + resourcePoolKey: 'Knowledge-Index-Popular-Software-Licenses' + }; + + // Event listeners + $scope.$on('resourcePoolEditor_elementCellNumericValueIncreased', updateAllInOne); + $scope.$on('resourcePoolEditor_elementCellNumericValueDecreased', updateAllInOne); + $scope.$on('resourcePoolEditor_elementCellNumericValueReset', updateAllInOne); + + _init(); + + function _init() { + var timeout = $timeout(refreshPage, 10000); + + function refreshPage() { + var organizationIndex = Math.floor(Math.random() * 4); + vm.oldModelChartConfig.series[organizationIndex].data[0] += 1; + vm.newModelChartConfig.series[0].data[0] += 1; + + timeout = $timeout(refreshPage, 1000); + } + + // When the DOM element is removed from the page, + // AngularJS will trigger the $destroy event on + // the scope. This gives us a chance to cancel any + // pending timer that we may have. + $scope.$on("$destroy", + event => { + $timeout.cancel(timeout); + }); + } + + // Sync this example's values with 'All in One' + function updateAllInOne(event: any, cell: any); + function updateAllInOne(event, cell) { + + if (cell.ElementField.Element.ResourcePool.User.UserName !== vm.knowledgeIndexConfig.userName && + cell.ElementField.Element.ResourcePool.Key !== vm.knowledgeIndexConfig.resourcePoolKey) { + return; + } + + var allInOneUniqueKey = { userName: 'sample', resourcePoolKey: 'All-in-One' }; + resourcePoolFactory.getResourcePoolExpanded(allInOneUniqueKey) + .then(resourcePool => { + + // If the current user already interacted with 'All in One', stop copying ratings + if (typeof resourcePool.userInteracted !== 'undefined' && resourcePool.userInteracted) { + return; + } + + // Elements + for (var elementIndex = 0; elementIndex < resourcePool.ElementSet.length; elementIndex++) { + var element = resourcePool.ElementSet[elementIndex]; + if (element.Name === cell.ElementField.Element.Name) { + // Element fields + for (var elementFieldIndex = 0; + elementFieldIndex < element.ElementFieldSet.length; + elementFieldIndex++) { + var elementField = element.ElementFieldSet[elementFieldIndex]; + if (elementField.Name === cell.ElementField.Name) { + // Element cells + for (var elementCellIndex = 0; + elementCellIndex < elementField.ElementCellSet.length; + elementCellIndex++) { + var elementCell = elementField.ElementCellSet[elementCellIndex]; + if (elementCell.ElementItem.Name === cell.ElementItem.Name) { + switch (event.name) { + case 'resourcePoolEditor_elementCellNumericValueIncreased': + { + resourcePoolFactory + .updateElementCellDecimalValue(elementCell, 'increase'); + break; + } + case 'resourcePoolEditor_elementCellNumericValueDecreased': + { + resourcePoolFactory + .updateElementCellDecimalValue(elementCell, 'decrease'); + break; + } + case 'resourcePoolEditor_elementCellNumericValueReset': + { + resourcePoolFactory + .updateElementCellDecimalValue(elementCell, 'reset'); + break; + } + } + + // Save changes + dataContext.saveChanges(1500); + break; + } + } + } + } + } + } + }); + } + } + } + + angular.module('main').controller(controllerId, KnowledgeIndexController); +} \ No newline at end of file diff --git a/ngClient/_system/js/app/controllers/content/NotFoundController.js b/ngClient/_system/js/app/controllers/content/NotFoundController.js deleted file mode 100644 index 63a11ff56..000000000 --- a/ngClient/_system/js/app/controllers/content/NotFoundController.js +++ /dev/null @@ -1,24 +0,0 @@ -(function () { - 'use strict'; - - var controllerId = 'NotFoundController'; - angular.module('main') - .controller(controllerId, ['logger', '$location', NotFoundController]); - - function NotFoundController(logger, $location) { - - // Logger - logger = logger.forSource(controllerId); - - _init(); - - /*** Implementations ***/ - - function _init() { - var url = $location.search().url; - if (typeof url !== 'undefined') { - throw new Error('Not found: ' + url); - } - } - } -})(); diff --git a/ngClient/_system/js/app/controllers/content/NotFoundController.ts b/ngClient/_system/js/app/controllers/content/NotFoundController.ts new file mode 100644 index 000000000..18e3208b4 --- /dev/null +++ b/ngClient/_system/js/app/controllers/content/NotFoundController.ts @@ -0,0 +1,29 @@ +module Main.Controller { + 'use strict'; + + var controllerId = 'NotFoundController'; + + export class NotFoundController { + + static $inject = ['logger', '$location']; + + constructor(logger: any, $location: any) { + + // Logger + logger = logger.forSource(controllerId); + + _init(); + + /*** Implementations ***/ + + function _init() { + var url = $location.search().url; + if (typeof url !== 'undefined') { + throw new Error('Not found: ' + url); + } + } + } + } + + angular.module('main').controller(controllerId, NotFoundController); +} \ No newline at end of file diff --git a/ngClient/_system/js/app/controllers/content/PriorityIndexController.js b/ngClient/_system/js/app/controllers/content/PriorityIndexController.js deleted file mode 100644 index 49935af31..000000000 --- a/ngClient/_system/js/app/controllers/content/PriorityIndexController.js +++ /dev/null @@ -1,76 +0,0 @@ -(function () { - 'use strict'; - - var controllerId = 'PriorityIndexController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', 'resourcePoolFactory', '$scope', PriorityIndexController]); - - function PriorityIndexController(dataContext, logger, resourcePoolFactory, $scope) { - - logger = logger.forSource(controllerId); - - var vm = this; - vm.priorityIndexConfig = { userName: 'sample', resourcePoolKey: 'Priority-Index-Sample' }; - - // Event listeners - $scope.$on('resourcePoolEditor_elementCellNumericValueIncreased', updateAllInOne); - $scope.$on('resourcePoolEditor_elementCellNumericValueDecreased', updateAllInOne); - $scope.$on('resourcePoolEditor_elementCellNumericValueReset', updateAllInOne); - - // Sync this example's values with 'All in One' - function updateAllInOne(event, cell) { - - if (cell.ElementField.Element.ResourcePool.User.UserName !== vm.priorityIndexConfig.userName && - cell.ElementField.Element.ResourcePool.Key !== vm.priorityIndexConfig.resourcePoolKey) { - return; - } - - var allInOneUniqueKey = { userName: 'sample', resourcePoolKey: 'All-in-One' }; - resourcePoolFactory.getResourcePoolExpanded(allInOneUniqueKey) - .then(function (resourcePool) { - - // If the current user already interacted with 'All in One', stop copying ratings - if (typeof resourcePool.userInteracted !== 'undefined' && resourcePool.userInteracted) { - return; - } - - // Elements - for (var elementIndex = 0; elementIndex < resourcePool.ElementSet.length; elementIndex++) { - var element = resourcePool.ElementSet[elementIndex]; - if (element.Name === cell.ElementField.Element.Name) { - // Element fields - for (var elementFieldIndex = 0; elementFieldIndex < element.ElementFieldSet.length; elementFieldIndex++) { - var elementField = element.ElementFieldSet[elementFieldIndex]; - if (elementField.Name === cell.ElementField.Name) { - // Element cells - for (var elementCellIndex = 0; elementCellIndex < elementField.ElementCellSet.length; elementCellIndex++) { - var elementCell = elementField.ElementCellSet[elementCellIndex]; - if (elementCell.ElementItem.Name === cell.ElementItem.Name) { - switch (event.name) { - case 'resourcePoolEditor_elementCellNumericValueIncreased': { - resourcePoolFactory.updateElementCellDecimalValue(elementCell, 'increase'); - break; - } - case 'resourcePoolEditor_elementCellNumericValueDecreased': { - resourcePoolFactory.updateElementCellDecimalValue(elementCell, 'decrease'); - break; - } - case 'resourcePoolEditor_elementCellNumericValueReset': { - resourcePoolFactory.updateElementCellDecimalValue(elementCell, 'reset'); - break; - } - } - - // Save changes - dataContext.saveChanges(1500); - break; - } - } - } - } - } - } - }); - } - } -})(); diff --git a/ngClient/_system/js/app/controllers/content/PriorityIndexController.ts b/ngClient/_system/js/app/controllers/content/PriorityIndexController.ts new file mode 100644 index 000000000..8082fa16f --- /dev/null +++ b/ngClient/_system/js/app/controllers/content/PriorityIndexController.ts @@ -0,0 +1,92 @@ +module Main.Controller { + 'use strict'; + + var controllerId = 'PriorityIndexController'; + + export class PriorityIndexController { + + static $inject = ['dataContext', 'logger', 'resourcePoolFactory', '$scope']; + + constructor(dataContext: any, logger: any, resourcePoolFactory: any, $scope: any) { + + logger = logger.forSource(controllerId); + + var vm:any = this; + vm.priorityIndexConfig = { userName: 'sample', resourcePoolKey: 'Priority-Index-Sample' }; + + // Event listeners + $scope.$on('resourcePoolEditor_elementCellNumericValueIncreased', updateAllInOne); + $scope.$on('resourcePoolEditor_elementCellNumericValueDecreased', updateAllInOne); + $scope.$on('resourcePoolEditor_elementCellNumericValueReset', updateAllInOne); + + // Sync this example's values with 'All in One' + function updateAllInOne(event: any, cell: any); + function updateAllInOne(event, cell) { + + if (cell.ElementField.Element.ResourcePool.User.UserName !== vm.priorityIndexConfig.userName && + cell.ElementField.Element.ResourcePool.Key !== vm.priorityIndexConfig.resourcePoolKey) { + return; + } + + var allInOneUniqueKey = { userName: 'sample', resourcePoolKey: 'All-in-One' }; + resourcePoolFactory.getResourcePoolExpanded(allInOneUniqueKey) + .then(resourcePool => { + + // If the current user already interacted with 'All in One', stop copying ratings + if (typeof resourcePool.userInteracted !== 'undefined' && resourcePool.userInteracted) { + return; + } + + // Elements + for (var elementIndex = 0; elementIndex < resourcePool.ElementSet.length; elementIndex++) { + var element = resourcePool.ElementSet[elementIndex]; + if (element.Name === cell.ElementField.Element.Name) { + // Element fields + for (var elementFieldIndex = 0; + elementFieldIndex < element.ElementFieldSet.length; + elementFieldIndex++) { + var elementField = element.ElementFieldSet[elementFieldIndex]; + if (elementField.Name === cell.ElementField.Name) { + // Element cells + for (var elementCellIndex = 0; + elementCellIndex < elementField.ElementCellSet.length; + elementCellIndex++) { + var elementCell = elementField.ElementCellSet[elementCellIndex]; + if (elementCell.ElementItem.Name === cell.ElementItem.Name) { + switch (event.name) { + case 'resourcePoolEditor_elementCellNumericValueIncreased': + { + resourcePoolFactory + .updateElementCellDecimalValue(elementCell, 'increase'); + break; + } + case 'resourcePoolEditor_elementCellNumericValueDecreased': + { + resourcePoolFactory + .updateElementCellDecimalValue(elementCell, 'decrease'); + break; + } + case 'resourcePoolEditor_elementCellNumericValueReset': + { + resourcePoolFactory + .updateElementCellDecimalValue(elementCell, 'reset'); + break; + } + } + + // Save changes + dataContext.saveChanges(1500); + break; + } + } + } + } + } + } + }); + } + } + } + + angular.module('main').controller(controllerId, PriorityIndexController); +} \ No newline at end of file diff --git a/ngClient/_system/js/app/controllers/content/TotalCostIndexController.js b/ngClient/_system/js/app/controllers/content/TotalCostIndexController.js deleted file mode 100644 index 2e0fc54ef..000000000 --- a/ngClient/_system/js/app/controllers/content/TotalCostIndexController.js +++ /dev/null @@ -1,56 +0,0 @@ -(function () { - 'use strict'; - - var controllerId = 'TotalCostIndexController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', 'resourcePoolFactory', '$scope', TotalCostIndexController]); - - function TotalCostIndexController(dataContext, logger, resourcePoolFactory, $scope) { - - logger = logger.forSource(controllerId); - - var vm = this; - vm.existingModelConfig = { userName: 'sample', resourcePoolKey: 'Total-Cost-Index-Existing-Model' }; - vm.newModelConfig = { userName: 'sample', resourcePoolKey: 'Total-Cost-Index-New-Model' }; - - // Listen resource pool updated event - $scope.$on('resourcePoolEditor_elementMultiplierIncreased', updateOppositeResourcePool); - $scope.$on('resourcePoolEditor_elementMultiplierDecreased', updateOppositeResourcePool); - $scope.$on('resourcePoolEditor_elementMultiplierReset', updateOppositeResourcePool); - - function updateOppositeResourcePool(event, element) { - - var oppositeKey = null; - - if (element.ResourcePool.User.UserName === vm.existingModelConfig.userName && element.ResourcePool.Key === vm.existingModelConfig.resourcePoolKey) { - oppositeKey = vm.newModelConfig; - } else if (element.ResourcePool.User.UserName === vm.newModelConfig.userName && element.ResourcePool.Key === vm.newModelConfig.resourcePoolKey) { - oppositeKey = vm.existingModelConfig; - } - - // Call the service to increase the multiplier - if (oppositeKey !== null) { - resourcePoolFactory.getResourcePoolExpanded(oppositeKey) - .then(function (resourcePool) { - - switch (event.name) { - case 'resourcePoolEditor_elementMultiplierIncreased': { - resourcePoolFactory.updateElementMultiplier(resourcePool.mainElement(), 'increase'); - break; - } - case 'resourcePoolEditor_elementMultiplierDecreased': { - resourcePoolFactory.updateElementMultiplier(resourcePool.mainElement(), 'decrease'); - break; - } - case 'resourcePoolEditor_elementMultiplierReset': { - resourcePoolFactory.updateElementMultiplier(resourcePool.mainElement(), 'reset'); - break; - } - } - - dataContext.saveChanges(1500); - }); - } - } - } -})(); diff --git a/ngClient/_system/js/app/controllers/content/TotalCostIndexController.ts b/ngClient/_system/js/app/controllers/content/TotalCostIndexController.ts new file mode 100644 index 000000000..b3d6d83d6 --- /dev/null +++ b/ngClient/_system/js/app/controllers/content/TotalCostIndexController.ts @@ -0,0 +1,66 @@ +module Main.Controller { + 'use strict'; + + var controllerId = 'TotalCostIndexController'; + + export class TotalCostIndexController { + + static $inject = ['dataContext', 'logger', 'resourcePoolFactory', '$scope']; + + constructor(dataContext: any, logger: any, resourcePoolFactory: any, $scope: any) { + logger = logger.forSource(controllerId); + + var vm:any = this; + vm.existingModelConfig = { userName: 'sample', resourcePoolKey: 'Total-Cost-Index-Existing-Model' }; + vm.newModelConfig = { userName: 'sample', resourcePoolKey: 'Total-Cost-Index-New-Model' }; + + // Listen resource pool updated event + $scope.$on('resourcePoolEditor_elementMultiplierIncreased', updateOppositeResourcePool); + $scope.$on('resourcePoolEditor_elementMultiplierDecreased', updateOppositeResourcePool); + $scope.$on('resourcePoolEditor_elementMultiplierReset', updateOppositeResourcePool); + + function updateOppositeResourcePool(event: any, element: any); + function updateOppositeResourcePool(event, element) { + + var oppositeKey = null; + + if (element.ResourcePool.User.UserName === vm.existingModelConfig.userName && + element.ResourcePool.Key === vm.existingModelConfig.resourcePoolKey) { + oppositeKey = vm.newModelConfig; + } else if (element.ResourcePool.User.UserName === vm.newModelConfig.userName && + element.ResourcePool.Key === vm.newModelConfig.resourcePoolKey) { + oppositeKey = vm.existingModelConfig; + } + + // Call the service to increase the multiplier + if (oppositeKey !== null) { + resourcePoolFactory.getResourcePoolExpanded(oppositeKey) + .then(resourcePool => { + + switch (event.name) { + case 'resourcePoolEditor_elementMultiplierIncreased': + { + resourcePoolFactory.updateElementMultiplier(resourcePool.mainElement(), 'increase'); + break; + } + case 'resourcePoolEditor_elementMultiplierDecreased': + { + resourcePoolFactory.updateElementMultiplier(resourcePool.mainElement(), 'decrease'); + break; + } + case 'resourcePoolEditor_elementMultiplierReset': + { + resourcePoolFactory.updateElementMultiplier(resourcePool.mainElement(), 'reset'); + break; + } + } + + dataContext.saveChanges(1500); + }); + } + } + } + } + + angular.module('main').controller(controllerId, TotalCostIndexController); +} \ No newline at end of file diff --git a/ngClient/_system/js/app/controllers/content/obsolete/ClosingNotesController.js b/ngClient/_system/js/app/controllers/content/obsolete/ClosingNotesController.js deleted file mode 100644 index 9f7d5d189..000000000 --- a/ngClient/_system/js/app/controllers/content/obsolete/ClosingNotesController.js +++ /dev/null @@ -1,31 +0,0 @@ -(function () { - 'use strict'; - - var controllerId = 'ClosingNotesController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', '$location', '$rootScope', '$scope', ClosingNotesController]); - - function ClosingNotesController(dataContext, logger, $location, $rootScope, $scope) { - - // Logger - logger = logger.forSource(controllerId); - - // View model - var vm = this; - vm.currentUser = { isAuthenticated: function () { return false; } }; - - $scope.$on('dataContext_currentUserChanged', currentUserChanged); - - _init(); - - /*** Implementations ***/ - - function _init() { - vm.currentUser = dataContext.getCurrentUser(); - } - - function currentUserChanged(event, newUser) { - vm.currentUser = newUser; - } - } -})(); diff --git a/ngClient/_system/js/app/controllers/content/obsolete/ClosingNotesController.ts b/ngClient/_system/js/app/controllers/content/obsolete/ClosingNotesController.ts new file mode 100644 index 000000000..33f38029e --- /dev/null +++ b/ngClient/_system/js/app/controllers/content/obsolete/ClosingNotesController.ts @@ -0,0 +1,41 @@ +module Main.Controller { + 'use strict'; + + var controllerId = 'ClosingNotesController'; + + export class ClosingNotesController { + + static $inject = ['dataContext', 'logger', '$location', '$rootScope', '$scope']; + + constructor(dataContext: any, logger: any, $location: any, $rootScope: any, $scope: any) { + + // Logger + logger = logger.forSource(controllerId); + + // View model + var vm:any = this; + vm.currentUser = { + isAuthenticated() { + return false; + } + }; + + $scope.$on('dataContext_currentUserChanged', currentUserChanged); + + _init(); + + /*** Implementations ***/ + + function _init() { + vm.currentUser = dataContext.getCurrentUser(); + } + + function currentUserChanged(event: any, newUser: any); + function currentUserChanged(event, newUser) { + vm.currentUser = newUser; + } + } + } + + angular.module('main').controller(controllerId, ClosingNotesController); +} \ No newline at end of file diff --git a/ngClient/_system/js/app/controllers/content/obsolete/FairShareIndexSampleController.js b/ngClient/_system/js/app/controllers/content/obsolete/FairShareIndexSampleController.js deleted file mode 100644 index b406ee38b..000000000 --- a/ngClient/_system/js/app/controllers/content/obsolete/FairShareIndexSampleController.js +++ /dev/null @@ -1,14 +0,0 @@ -(function () { - 'use strict'; - - var controllerId = 'FairShareIndexSampleController'; - angular.module('main') - .controller(controllerId, ['logger', FairShareIndexSampleController]); - - function FairShareIndexSampleController(logger) { - - logger = logger.forSource(controllerId); - - var vm = this; - } -})(); diff --git a/ngClient/_system/js/app/controllers/content/obsolete/FairShareIndexSampleController.ts b/ngClient/_system/js/app/controllers/content/obsolete/FairShareIndexSampleController.ts new file mode 100644 index 000000000..b4547a825 --- /dev/null +++ b/ngClient/_system/js/app/controllers/content/obsolete/FairShareIndexSampleController.ts @@ -0,0 +1,19 @@ +module Main.Controller { + 'use strict'; + + var controllerId = 'FairShareIndexSampleController'; + + export class FairShareIndexSampleController { + + static $inject = ['logger']; + + constructor(logger: any) { + + logger = logger.forSource(controllerId); + + var vm:any = this; + } + } + + angular.module('main').controller(controllerId, FairShareIndexSampleController); +} \ No newline at end of file diff --git a/ngClient/_system/js/app/controllers/content/obsolete/ResourcePoolRateSampleController.js b/ngClient/_system/js/app/controllers/content/obsolete/ResourcePoolRateSampleController.js deleted file mode 100644 index f12362031..000000000 --- a/ngClient/_system/js/app/controllers/content/obsolete/ResourcePoolRateSampleController.js +++ /dev/null @@ -1,15 +0,0 @@ -(function () { - 'use strict'; - - var controllerId = 'ResourcePoolRateSampleController'; - angular.module('main') - .controller(controllerId, ['logger', ResourcePoolRateSampleController]); - - function ResourcePoolRateSampleController(logger) { - - logger = logger.forSource(controllerId); - - var vm = this; - vm.resourcePoolRate_SampleResourcePoolId = 12; - } -})(); diff --git a/ngClient/_system/js/app/controllers/content/obsolete/ResourcePoolRateSampleController.ts b/ngClient/_system/js/app/controllers/content/obsolete/ResourcePoolRateSampleController.ts new file mode 100644 index 000000000..bbaaf8066 --- /dev/null +++ b/ngClient/_system/js/app/controllers/content/obsolete/ResourcePoolRateSampleController.ts @@ -0,0 +1,20 @@ +module Main.Controller { + 'use strict'; + + var controllerId = 'ResourcePoolRateSampleController'; + + export class ResourcePoolRateSampleController { + + static $inject = ['logger']; + + constructor(logger: any) { + + logger = logger.forSource(controllerId); + + var vm:any = this; + vm.resourcePoolRate_SampleResourcePoolId = 12; + } + } + + angular.module('main').controller(controllerId, ResourcePoolRateSampleController); +} \ No newline at end of file diff --git a/ngClient/_system/js/app/controllers/resourcePool/ResourcePoolManageController.js b/ngClient/_system/js/app/controllers/resourcePool/ResourcePoolManageController.js deleted file mode 100644 index 945926910..000000000 --- a/ngClient/_system/js/app/controllers/resourcePool/ResourcePoolManageController.js +++ /dev/null @@ -1,444 +0,0 @@ -(function () { - 'use strict'; - - var controllerId = 'ResourcePoolManageController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'Enums', 'logger', 'resourcePoolFactory', '$location', '$rootScope', '$routeParams', '$uibModal', ResourcePoolManageController]); - - function ResourcePoolManageController(dataContext, Enums, logger, resourcePoolFactory, $location, $rootScope, $routeParams, $uibModal) { - - // Logger - logger = logger.forSource(controllerId); - - var vm = this; - vm.addElement = addElement; - vm.addElementField = addElementField; - vm.addElementItem = addElementItem; - vm.cancelElement = cancelElement; - vm.cancelElementCell = cancelElementCell; - vm.cancelElementField = cancelElementField; - vm.cancelElementItem = cancelElementItem; - vm.cancelResourcePool = cancelResourcePool; - vm.editElement = editElement; - vm.editElementCell = editElementCell; - vm.editElementField = editElementField; - vm.editElementItem = editElementItem; - vm.element = null; - vm.elementMaster = null; - vm.elementCell = null; - vm.elementCellMaster = null; - vm.elementCellSet = elementCellSet; - vm.elementField = null; - vm.elementFieldMaster = null; - vm.elementFieldSet = elementFieldSet; - vm.elementFieldDataTypeFiltered = elementFieldDataTypeFiltered; - vm.elementItem = null; - vm.elementItemMaster = null; - vm.elementItemSet = elementItemSet; - vm.isElementEdit = false; - vm.isElementNew = true; - vm.isElementFieldEdit = false; - vm.isElementFieldNew = true; - vm.isElementItemEdit = false; - vm.isElementItemNew = true; - vm.isNew = $location.path().substring($location.path().lastIndexOf('/') + 1) === 'new'; - vm.isSaveEnabled = isSaveEnabled; - vm.isSaving = false; - vm.openRemoveResourcePoolModal = openRemoveResourcePoolModal; - vm.removeElement = removeElement; - vm.removeElementField = removeElementField; - vm.removeElementItem = removeElementItem; - vm.removeResourcePool = removeResourcePool; - vm.resourcePool = { ElementSet: [] }; - vm.resourcePoolKey = $routeParams.resourcePoolKey; - vm.saveResourcePool = saveResourcePool; - vm.saveElement = saveElement; - vm.saveElementCell = saveElementCell; - vm.saveElementField = saveElementField; - vm.saveElementItem = saveElementItem; - vm.userName = $routeParams.userName; - - // Enums - vm.ElementFieldDataType = Enums.ElementFieldDataType; - vm.ElementFieldIndexCalculationType = Enums.ElementFieldIndexCalculationType; - vm.ElementFieldIndexSortType = Enums.ElementFieldIndexSortType; - - _init(); - - /*** Implementations ***/ - - function _init() { - - if (vm.isNew) { - - var currentUser = dataContext.getCurrentUser(); - - // If userName equals to current user - if (vm.userName === currentUser.UserName) { - vm.user = currentUser; - - vm.resourcePool = resourcePoolFactory.createResourcePoolBasic(); - - // Title - // TODO viewTitle was also set in route.js? - $rootScope.viewTitle = vm.resourcePool.Name; - - } else { - $location.url('/_system/content/notFound?url=' + $location.url()); - return; - } - - } else { - - var resourcePoolUniqueKey = { userName: vm.userName, resourcePoolKey: vm.resourcePoolKey }; - - resourcePoolFactory.getResourcePoolExpanded(resourcePoolUniqueKey) - .then(function (resourcePool) { - - // Not found, navigate to 404 - if (resourcePool === null) { - $location.url('/_system/content/notFound?url=' + $location.url()); - return; - } - - vm.resourcePool = resourcePool; - - // Title - // TODO viewTitle was also set in route.js? - $rootScope.viewTitle = vm.resourcePool.Name; - }); - } - } - - function addElement() { - vm.element = resourcePoolFactory.createElement({ - ResourcePool: vm.resourcePool, - Name: 'New element', - IsMainElement: false - }); - - vm.isElementEdit = true; - vm.isElementNew = true; - } - - function addElementField() { - - var element = vm.resourcePool.ElementSet[0]; - - // A temp fix for default value of 'SortOrder' - // Later handle 'SortOrder' by UI, not by asking - var sortOrder = element.ElementFieldSet.length + 1; - - vm.elementField = resourcePoolFactory.createElementField({ - Element: element, - Name: 'New field', - DataType: 1, - SortOrder: sortOrder - }); - - vm.isElementFieldEdit = true; - vm.isElementFieldNew = true; - } - - function addElementItem() { - vm.elementItem = resourcePoolFactory.createElementItem({ - Element: vm.resourcePool.ElementSet[0], - Name: 'New item' - }); - vm.isElementItemEdit = true; - vm.isElementItemNew = true; - } - - function cancelElement() { - - // TODO Find a better way? - // Can't use reject changes because in 'New CMRP' case, these are newly added entities and reject changes removes them / coni2k - 23 Nov. '15 - if (vm.isElementNew) { - resourcePoolFactory.removeElement(vm.element); - } else { - vm.element.Name = vm.elementMaster.Name; - } - - vm.isElementEdit = false; - vm.element = null; - vm.elementMaster = null; - } - - function cancelElementCell() { - - // TODO Find a better way? - // Can't use reject changes because in 'New CMRP' case, these are newly added entities and reject changes removes them / coni2k - 23 Nov. '15 - vm.elementCell.SelectedElementItemId = vm.elementCellMaster.SelectedElementItemId; - vm.elementCell.UserElementCellSet[0].StringValue = vm.elementCellMaster.UserElementCellSet[0].StringValue; - vm.elementCell.UserElementCellSet[0].BooleanValue = vm.elementCellMaster.UserElementCellSet[0].BooleanValue; - vm.elementCell.UserElementCellSet[0].IntegerValue = vm.elementCellMaster.UserElementCellSet[0].IntegerValue; - vm.elementCell.UserElementCellSet[0].DecimalValue = vm.elementCellMaster.UserElementCellSet[0].DecimalValue; - vm.elementCell.UserElementCellSet[0].DateTimeValue = vm.elementCellMaster.UserElementCellSet[0].DateTimeValue; - - vm.isElementCellEdit = false; - vm.elementCell = null; - vm.elementCellMaster = null; - } - - function cancelElementField() { - - // TODO Find a better way? - // Can't use reject changes because in 'New CMRP' case, these are newly added entities and reject changes removes them / coni2k - 23 Nov. '15 - if (vm.isElementFieldNew) { - resourcePoolFactory.removeElementField(vm.elementField); - } else { - vm.elementField.Name = vm.elementFieldMaster.Name; - vm.elementField.DataType = vm.elementFieldMaster.DataType; - vm.elementField.SelectedElementId = vm.elementFieldMaster.SelectedElementId; - vm.elementField.UseFixedValue = vm.elementFieldMaster.UseFixedValue; - vm.elementField.IndexEnabled = vm.elementFieldMaster.IndexEnabled; - vm.elementField.IndexCalculationType = vm.elementFieldMaster.IndexCalculationType; - vm.elementField.IndexSortType = vm.elementFieldMaster.IndexSortType; - vm.elementField.SortOrder = vm.elementFieldMaster.SortOrder; - } - - vm.isElementFieldEdit = false; - vm.elementField = null; - vm.elementFieldMaster = null; - } - - function cancelElementItem() { - - // TODO Find a better way? - // Can't use reject changes because in 'New CMRP' case, these are newly added entities and reject changes removes them / coni2k - 23 Nov. '15 - if (!vm.isElementItemNew) { - vm.elementItem.Name = vm.elementItemMaster.Name; - } - - vm.isElementItemEdit = false; - vm.elementItem = null; - vm.elementItemMaster = null; - } - - function cancelResourcePool() { - - dataContext.rejectChanges(); - - var locationPath = vm.isNew ? - '/' + dataContext.getCurrentUser().UserName : - vm.resourcePool.urlView(); - - $location.url(locationPath); - } - - function editElement(element) { - vm.elementMaster = angular.copy(element); - vm.element = element; - vm.isElementEdit = true; - vm.isElementNew = false; - } - - function editElementCell(elementCell) { - vm.elementCellMaster = angular.copy(elementCell); - vm.elementCell = elementCell; - vm.isElementCellEdit = true; - } - - function editElementField(elementField) { - vm.elementFieldMaster = angular.copy(elementField); - vm.elementField = elementField; - vm.isElementFieldEdit = true; - vm.isElementFieldNew = false; - } - - function editElementItem(elementItem) { - vm.elementItemMaster = angular.copy(elementItem); - vm.elementItem = elementItem; - vm.isElementItemEdit = true; - vm.isElementItemNew = false; - } - - function elementCellSet() { - - var elementItems = elementItemSet(); - - var list = []; - elementItems.forEach(function (elementItem) { - elementItem.ElementCellSet.forEach(function (elementCell) { - list.push(elementCell); - }); - }); - return list; - } - - function elementFieldSet() { - var list = []; - vm.resourcePool.ElementSet.forEach(function (element) { - element.ElementFieldSet.forEach(function (elementField) { - list.push(elementField); - }); - }); - return list; - } - - function elementFieldDataTypeFiltered() { - - var filtered = {}; - for (var key in vm.ElementFieldDataType) { - - // These types can be added only once at the moment - if (key === 'DirectIncome' || key === 'Multiplier') { - var exists = vm.elementField.Element.ElementFieldSet.some(fieldExists); - - if (!exists) { - filtered[key] = vm.ElementFieldDataType[key]; - } - } else if (key === 'Element') { // Element type can only be added if there are more than one element in the pool - if (vm.elementField.Element.ResourcePool.ElementSet.length > 1) { - filtered[key] = vm.ElementFieldDataType[key]; - } - } else { - filtered[key] = vm.ElementFieldDataType[key]; - } - } - - function fieldExists(field) { - return vm.ElementFieldDataType[key] === field.ElementFieldDataType; - } - - return filtered; - } - - function elementItemSet() { - var list = []; - vm.resourcePool.ElementSet.forEach(function (element) { - element.ElementItemSet.forEach(function (elementItem) { - list.push(elementItem); - }); - }); - return list; - } - - function isSaveEnabled() { - var value = !vm.isSaving && - typeof vm.resourcePoolForm !== 'undefined' && - vm.resourcePoolForm.$valid; - - return value; - } - - function openRemoveResourcePoolModal() { - var modalInstance = $uibModal.open({ - controller: ['$scope', '$uibModalInstance', ResourcePoolRemoveController], - controllerAs: 'vm', - keyboard: false, - templateUrl: '/_system/views/resourcePool/resourcePoolRemove.html?v=0.53.0' - }); - - modalInstance.result.then(function () { - removeResourcePool(); - }, function () { }); - } - - function removeElement(element) { - resourcePoolFactory.removeElement(element); - } - - function removeElementField(elementField) { - resourcePoolFactory.removeElementField(elementField); - } - - function removeElementItem(elementItem) { - resourcePoolFactory.removeElementItem(elementItem); - } - - function removeResourcePool() { - - vm.isSaving = true; - - resourcePoolFactory.removeResourcePool(vm.resourcePool); - - dataContext.saveChanges() - .then(function () { - $location.url('/' + dataContext.getCurrentUser().UserName); - }) - .finally(function () { - vm.isSaving = false; - }); - } - - function saveElement() { - vm.isElementEdit = false; - vm.element = null; - vm.elementMaster = null; - } - - function saveElementCell() { - vm.isElementCellEdit = false; - vm.elementCell = null; - vm.elementCellMaster = null; - } - - function saveElementField() { - - // Fixes - // a. UseFixedValue must be null for String & Element types - if (vm.elementField.DataType === vm.ElementFieldDataType.String || - vm.elementField.DataType === vm.ElementFieldDataType.Element) { - vm.elementField.UseFixedValue = null; - } - - // b. UseFixedValue must be 'false' for Multiplier type - if (vm.elementField.DataType === vm.ElementFieldDataType.Multiplier) { - vm.elementField.UseFixedValue = false; - } - - // c. DirectIncome cannot be Use Fixed Value false at the moment - if (vm.elementField.DataType === vm.ElementFieldDataType.DirectIncome) { - vm.elementField.UseFixedValue = true; - } - - vm.isElementFieldEdit = false; - vm.elementField = null; - vm.elementFieldMaster = null; - } - - function saveElementItem() { - - if (vm.isElementItemNew) { - vm.elementItem = resourcePoolFactory.createElementItem(vm.elementItem); - } - - vm.isElementItemEdit = false; - vm.elementItem = null; - vm.elementItemMaster = null; - } - - function saveResourcePool() { - - vm.isSaving = true; - - // TODO Try to move this to a better place? - vm.resourcePool.updateCache(); - - dataContext.saveChanges() - .then(function () { - $location.url(vm.resourcePool.urlView()); - }) - .finally(function () { - vm.isSaving = false; - }); - } - } - - function ResourcePoolRemoveController($scope, $uibModalInstance) { - - var vm = this; - vm.cancel = cancel; - vm.remove = remove; - - function cancel() { - $uibModalInstance.dismiss('cancel'); - } - - function remove() { - $uibModalInstance.close(); - } - } - -})(); diff --git a/ngClient/_system/js/app/controllers/resourcePool/ResourcePoolManageController.ts b/ngClient/_system/js/app/controllers/resourcePool/ResourcePoolManageController.ts new file mode 100644 index 000000000..129313cb2 --- /dev/null +++ b/ngClient/_system/js/app/controllers/resourcePool/ResourcePoolManageController.ts @@ -0,0 +1,473 @@ +module Main.Controller { + 'use strict'; + + var controllerId = 'ResourcePoolManageController'; + + export class ResourcePoolManageController { + + static $inject = ['dataContext', 'Enums', 'logger', 'resourcePoolFactory', '$location', '$rootScope', '$routeParams', '$uibModal']; + + constructor(dataContext: any, + Enums: any, + logger: any, + resourcePoolFactory: any, + $location: any, + $rootScope: any, + $routeParams: any, + $uibModal: any) { + + // Logger + logger = logger.forSource(controllerId); + + var vm:any = this; + vm.addElement = addElement; + vm.addElementField = addElementField; + vm.addElementItem = addElementItem; + vm.cancelElement = cancelElement; + vm.cancelElementCell = cancelElementCell; + vm.cancelElementField = cancelElementField; + vm.cancelElementItem = cancelElementItem; + vm.cancelResourcePool = cancelResourcePool; + vm.editElement = editElement; + vm.editElementCell = editElementCell; + vm.editElementField = editElementField; + vm.editElementItem = editElementItem; + vm.element = null; + vm.elementMaster = null; + vm.elementCell = null; + vm.elementCellMaster = null; + vm.elementCellSet = elementCellSet; + vm.elementField = null; + vm.elementFieldMaster = null; + vm.elementFieldSet = elementFieldSet; + vm.elementFieldDataTypeFiltered = elementFieldDataTypeFiltered; + vm.elementItem = null; + vm.elementItemMaster = null; + vm.elementItemSet = elementItemSet; + vm.isElementEdit = false; + vm.isElementNew = true; + vm.isElementFieldEdit = false; + vm.isElementFieldNew = true; + vm.isElementItemEdit = false; + vm.isElementItemNew = true; + vm.isNew = $location.path().substring($location.path().lastIndexOf('/') + 1) === 'new'; + vm.isSaveEnabled = isSaveEnabled; + vm.isSaving = false; + vm.openRemoveResourcePoolModal = openRemoveResourcePoolModal; + vm.removeElement = removeElement; + vm.removeElementField = removeElementField; + vm.removeElementItem = removeElementItem; + vm.removeResourcePool = removeResourcePool; + vm.resourcePool = { ElementSet: [] }; + vm.resourcePoolKey = $routeParams.resourcePoolKey; + vm.saveResourcePool = saveResourcePool; + vm.saveElement = saveElement; + vm.saveElementCell = saveElementCell; + vm.saveElementField = saveElementField; + vm.saveElementItem = saveElementItem; + vm.userName = $routeParams.userName; + + // Enums + vm.ElementFieldDataType = Enums.ElementFieldDataType; + vm.ElementFieldIndexCalculationType = Enums.ElementFieldIndexCalculationType; + vm.ElementFieldIndexSortType = Enums.ElementFieldIndexSortType; + + _init(); + + /*** Implementations ***/ + + function _init() { + + if (vm.isNew) { + + var currentUser = dataContext.getCurrentUser(); + + // If userName equals to current user + if (vm.userName === currentUser.UserName) { + vm.user = currentUser; + + vm.resourcePool = resourcePoolFactory.createResourcePoolBasic(); + + // Title + // TODO viewTitle was also set in route.js? + $rootScope.viewTitle = vm.resourcePool.Name; + + } else { + $location.url('/_system/content/notFound?url=' + $location.url()); + return; + } + + } else { + + var resourcePoolUniqueKey = { userName: vm.userName, resourcePoolKey: vm.resourcePoolKey }; + + resourcePoolFactory.getResourcePoolExpanded(resourcePoolUniqueKey) + .then(resourcePool => { + + // Not found, navigate to 404 + if (resourcePool === null) { + $location.url('/_system/content/notFound?url=' + $location.url()); + return; + } + + vm.resourcePool = resourcePool; + + // Title + // TODO viewTitle was also set in route.js? + $rootScope.viewTitle = vm.resourcePool.Name; + }); + } + } + + function addElement() { + vm.element = resourcePoolFactory.createElement({ + ResourcePool: vm.resourcePool, + Name: 'New element', + IsMainElement: false + }); + + vm.isElementEdit = true; + vm.isElementNew = true; + } + + function addElementField() { + + var element = vm.resourcePool.ElementSet[0]; + + // A temp fix for default value of 'SortOrder' + // Later handle 'SortOrder' by UI, not by asking + var sortOrder = element.ElementFieldSet.length + 1; + + vm.elementField = resourcePoolFactory.createElementField({ + Element: element, + Name: 'New field', + DataType: 1, + SortOrder: sortOrder + }); + + vm.isElementFieldEdit = true; + vm.isElementFieldNew = true; + } + + function addElementItem() { + vm.elementItem = resourcePoolFactory.createElementItem({ + Element: vm.resourcePool.ElementSet[0], + Name: 'New item' + }); + vm.isElementItemEdit = true; + vm.isElementItemNew = true; + } + + function cancelElement() { + + // TODO Find a better way? + // Can't use reject changes because in 'New CMRP' case, these are newly added entities and reject changes removes them / coni2k - 23 Nov. '15 + if (vm.isElementNew) { + resourcePoolFactory.removeElement(vm.element); + } else { + vm.element.Name = vm.elementMaster.Name; + } + + vm.isElementEdit = false; + vm.element = null; + vm.elementMaster = null; + } + + function cancelElementCell() { + + // TODO Find a better way? + // Can't use reject changes because in 'New CMRP' case, these are newly added entities and reject changes removes them / coni2k - 23 Nov. '15 + vm.elementCell.SelectedElementItemId = vm.elementCellMaster.SelectedElementItemId; + vm.elementCell.UserElementCellSet[0] + .StringValue = vm.elementCellMaster.UserElementCellSet[0].StringValue; + vm.elementCell.UserElementCellSet[0] + .BooleanValue = vm.elementCellMaster.UserElementCellSet[0].BooleanValue; + vm.elementCell.UserElementCellSet[0] + .IntegerValue = vm.elementCellMaster.UserElementCellSet[0].IntegerValue; + vm.elementCell.UserElementCellSet[0] + .DecimalValue = vm.elementCellMaster.UserElementCellSet[0].DecimalValue; + vm.elementCell.UserElementCellSet[0] + .DateTimeValue = vm.elementCellMaster.UserElementCellSet[0].DateTimeValue; + + vm.isElementCellEdit = false; + vm.elementCell = null; + vm.elementCellMaster = null; + } + + function cancelElementField() { + + // TODO Find a better way? + // Can't use reject changes because in 'New CMRP' case, these are newly added entities and reject changes removes them / coni2k - 23 Nov. '15 + if (vm.isElementFieldNew) { + resourcePoolFactory.removeElementField(vm.elementField); + } else { + vm.elementField.Name = vm.elementFieldMaster.Name; + vm.elementField.DataType = vm.elementFieldMaster.DataType; + vm.elementField.SelectedElementId = vm.elementFieldMaster.SelectedElementId; + vm.elementField.UseFixedValue = vm.elementFieldMaster.UseFixedValue; + vm.elementField.IndexEnabled = vm.elementFieldMaster.IndexEnabled; + vm.elementField.IndexCalculationType = vm.elementFieldMaster.IndexCalculationType; + vm.elementField.IndexSortType = vm.elementFieldMaster.IndexSortType; + vm.elementField.SortOrder = vm.elementFieldMaster.SortOrder; + } + + vm.isElementFieldEdit = false; + vm.elementField = null; + vm.elementFieldMaster = null; + } + + function cancelElementItem() { + + // TODO Find a better way? + // Can't use reject changes because in 'New CMRP' case, these are newly added entities and reject changes removes them / coni2k - 23 Nov. '15 + if (!vm.isElementItemNew) { + vm.elementItem.Name = vm.elementItemMaster.Name; + } + + vm.isElementItemEdit = false; + vm.elementItem = null; + vm.elementItemMaster = null; + } + + function cancelResourcePool() { + + dataContext.rejectChanges(); + + var locationPath = vm.isNew ? '/' + dataContext.getCurrentUser().UserName : vm.resourcePool.urlView(); + + $location.url(locationPath); + } + + function editElement(element: any); + function editElement(element) { + vm.elementMaster = angular.copy(element); + vm.element = element; + vm.isElementEdit = true; + vm.isElementNew = false; + } + + function editElementCell(elementCell: any); + function editElementCell(elementCell) { + vm.elementCellMaster = angular.copy(elementCell); + vm.elementCell = elementCell; + vm.isElementCellEdit = true; + } + + function editElementField(elementField: any); + function editElementField(elementField) { + vm.elementFieldMaster = angular.copy(elementField); + vm.elementField = elementField; + vm.isElementFieldEdit = true; + vm.isElementFieldNew = false; + } + + function editElementItem(elementItem: any); + function editElementItem(elementItem) { + vm.elementItemMaster = angular.copy(elementItem); + vm.elementItem = elementItem; + vm.isElementItemEdit = true; + vm.isElementItemNew = false; + } + + function elementCellSet() { + + var elementItems = elementItemSet(); + + var list = []; + elementItems.forEach(elementItem => { + elementItem.ElementCellSet.forEach(elementCell => { + list.push(elementCell); + }); + }); + return list; + } + + function elementFieldSet() { + var list = []; + vm.resourcePool.ElementSet.forEach(element => { + element.ElementFieldSet.forEach(elementField => { + list.push(elementField); + }); + }); + return list; + } + + function elementFieldDataTypeFiltered() { + + var filtered = {}; + for (var key in vm.ElementFieldDataType) { + + // These types can be added only once at the moment + if (key === 'DirectIncome' || key === 'Multiplier') { + var exists = vm.elementField.Element.ElementFieldSet.some(fieldExists); + + if (!exists) { + filtered[key] = vm.ElementFieldDataType[key]; + } + } else if (key === 'Element') { +// Element type can only be added if there are more than one element in the pool + if (vm.elementField.Element.ResourcePool.ElementSet.length > 1) { + filtered[key] = vm.ElementFieldDataType[key]; + } + } else { + filtered[key] = vm.ElementFieldDataType[key]; + } + } + + function fieldExists(field: any); + function fieldExists(field) { + return vm.ElementFieldDataType[key] === field.ElementFieldDataType; + } + + return filtered; + } + + function elementItemSet() { + var list = []; + vm.resourcePool.ElementSet.forEach(element => { + element.ElementItemSet.forEach(elementItem => { + list.push(elementItem); + }); + }); + return list; + } + + function isSaveEnabled() { + var value = !vm.isSaving && + typeof vm.resourcePoolForm !== 'undefined' && + vm.resourcePoolForm.$valid; + + return value; + } + + function openRemoveResourcePoolModal() { + var modalInstance = $uibModal.open({ + controller: ResourcePoolRemoveController, + controllerAs: 'vm', + keyboard: false, + templateUrl: '/_system/views/resourcePool/resourcePoolRemove.html?v=0.53.0' + }); + + modalInstance.result.then(() => { + removeResourcePool(); + }, + () => {}); + } + + function removeElement(element: any); + function removeElement(element) { + resourcePoolFactory.removeElement(element); + } + + function removeElementField(elementField: any); + function removeElementField(elementField) { + resourcePoolFactory.removeElementField(elementField); + } + + function removeElementItem(elementItem: any); + function removeElementItem(elementItem) { + resourcePoolFactory.removeElementItem(elementItem); + } + + function removeResourcePool() { + + vm.isSaving = true; + + resourcePoolFactory.removeResourcePool(vm.resourcePool); + + dataContext.saveChanges() + .then(() => { + $location.url('/' + dataContext.getCurrentUser().UserName); + }) + .finally(() => { + vm.isSaving = false; + }); + } + + function saveElement() { + vm.isElementEdit = false; + vm.element = null; + vm.elementMaster = null; + } + + function saveElementCell() { + vm.isElementCellEdit = false; + vm.elementCell = null; + vm.elementCellMaster = null; + } + + function saveElementField() { + + // Fixes + // a. UseFixedValue must be null for String & Element types + if (vm.elementField.DataType === vm.ElementFieldDataType.String || + vm.elementField.DataType === vm.ElementFieldDataType.Element) { + vm.elementField.UseFixedValue = null; + } + + // b. UseFixedValue must be 'false' for Multiplier type + if (vm.elementField.DataType === vm.ElementFieldDataType.Multiplier) { + vm.elementField.UseFixedValue = false; + } + + // c. DirectIncome cannot be Use Fixed Value false at the moment + if (vm.elementField.DataType === vm.ElementFieldDataType.DirectIncome) { + vm.elementField.UseFixedValue = true; + } + + vm.isElementFieldEdit = false; + vm.elementField = null; + vm.elementFieldMaster = null; + } + + function saveElementItem() { + + if (vm.isElementItemNew) { + vm.elementItem = resourcePoolFactory.createElementItem(vm.elementItem); + } + + vm.isElementItemEdit = false; + vm.elementItem = null; + vm.elementItemMaster = null; + } + + function saveResourcePool() { + + vm.isSaving = true; + + // TODO Try to move this to a better place? + vm.resourcePool.updateCache(); + + dataContext.saveChanges() + .then(() => { + $location.url(vm.resourcePool.urlView()); + }) + .finally(() => { + vm.isSaving = false; + }); + } + } + } + + class ResourcePoolRemoveController { + + static $inject = ['$scope', '$uibModalInstance']; + + constructor($scope: any, $uibModalInstance: any) { + + var vm: any = this; + vm.cancel = cancel; + vm.remove = remove; + + function cancel() { + $uibModalInstance.dismiss('cancel'); + } + + function remove() { + $uibModalInstance.close(); + } + } + } + + angular.module('main').controller(controllerId, ResourcePoolManageController); +} \ No newline at end of file diff --git a/ngClient/_system/js/app/controllers/resourcePool/ResourcePoolSearchController.js b/ngClient/_system/js/app/controllers/resourcePool/ResourcePoolSearchController.js deleted file mode 100644 index 50c8bfef3..000000000 --- a/ngClient/_system/js/app/controllers/resourcePool/ResourcePoolSearchController.js +++ /dev/null @@ -1,38 +0,0 @@ -(function () { - 'use strict'; - - var controllerId = 'ResourcePoolSearchController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', 'resourcePoolFactory', '$location', '$rootScope', '$scope', ResourcePoolSearchController]); - - function ResourcePoolSearchController(dataContext, logger, resourcePoolFactory, $location, $rootScope, $scope) { - - // Logger - logger = logger.forSource(controllerId); - - var vm = this; - vm.resourcePoolSet = []; - vm.searchKey = ''; - vm.searchKeyChanged = searchKeyChanged; - vm.showResults = false; - - _init(); - - function _init() { - } - - function searchKeyChanged() { - - if (vm.searchKey.length <= 2) { - vm.showResults = false; - return; - } - - resourcePoolFactory.getResourcePoolSet(vm.searchKey) - .then(function (data) { - vm.resourcePoolSet = data; - vm.showResults = true; - }); - } - } -})(); diff --git a/ngClient/_system/js/app/controllers/resourcePool/ResourcePoolSearchController.ts b/ngClient/_system/js/app/controllers/resourcePool/ResourcePoolSearchController.ts new file mode 100644 index 000000000..ef0b53c7d --- /dev/null +++ b/ngClient/_system/js/app/controllers/resourcePool/ResourcePoolSearchController.ts @@ -0,0 +1,48 @@ +module Main.Controller { + 'use strict'; + + var controllerId = 'ResourcePoolSearchController'; + + export class ResourcePoolSearchController { + + static $inject = ['dataContext', 'logger', 'resourcePoolFactory', '$location', '$rootScope', '$scope']; + + constructor(dataContext: any, + logger: any, + resourcePoolFactory: any, + $location: any, + $rootScope: any, + $scope: any) { + + // Logger + logger = logger.forSource(controllerId); + + var vm:any = this; + vm.resourcePoolSet = []; + vm.searchKey = ''; + vm.searchKeyChanged = searchKeyChanged; + vm.showResults = false; + + _init(); + + function _init() { + } + + function searchKeyChanged() { + + if (vm.searchKey.length <= 2) { + vm.showResults = false; + return; + } + + resourcePoolFactory.getResourcePoolSet(vm.searchKey) + .then(data => { + vm.resourcePoolSet = data; + vm.showResults = true; + }); + } + } + } + + angular.module('main').controller(controllerId, ResourcePoolSearchController); +} \ No newline at end of file diff --git a/ngClient/_system/js/app/controllers/resourcePool/ResourcePoolViewController.js b/ngClient/_system/js/app/controllers/resourcePool/ResourcePoolViewController.js deleted file mode 100644 index 081754b4a..000000000 --- a/ngClient/_system/js/app/controllers/resourcePool/ResourcePoolViewController.js +++ /dev/null @@ -1,38 +0,0 @@ -(function () { - 'use strict'; - - var controllerId = 'ResourcePoolViewController'; - angular.module('main') - .controller(controllerId, ['logger', 'resourcePoolFactory', '$location', '$rootScope', '$routeParams', ResourcePoolViewController]); - - function ResourcePoolViewController(logger, resourcePoolFactory, $location, $rootScope, $routeParams) { - - // Logger - logger = logger.forSource(controllerId); - - var vm = this; - vm.editorConfig = { - resourcePoolKey: $routeParams.resourcePoolKey, - userName: $routeParams.userName - }; - - _init(); - - function _init() { - - // Title - resourcePoolFactory.getResourcePoolExpanded(vm.editorConfig) - .then(function (resourcePool) { - - // Not found, navigate to 404 - if (resourcePool === null) { - $location.url('/_system/content/notFound?url=' + $location.url()); - return; - } - - // TODO viewTitle was also set in route.js? - $rootScope.viewTitle = resourcePool.Name; - }); - } - } -})(); diff --git a/ngClient/_system/js/app/controllers/resourcePool/ResourcePoolViewController.ts b/ngClient/_system/js/app/controllers/resourcePool/ResourcePoolViewController.ts new file mode 100644 index 000000000..989e8d91e --- /dev/null +++ b/ngClient/_system/js/app/controllers/resourcePool/ResourcePoolViewController.ts @@ -0,0 +1,47 @@ +module Main.Controller { + 'use strict'; + + var controllerId = 'ResourcePoolViewController'; + + export class ResourcePoolViewController { + + static $inject = ['logger', 'resourcePoolFactory', '$location', '$rootScope', '$routeParams']; + + constructor(logger: any, + resourcePoolFactory: any, + $location: any, + $rootScope: any, + $routeParams: any) { + + // Logger + logger = logger.forSource(controllerId); + + var vm:any = this; + vm.editorConfig = { + resourcePoolKey: $routeParams.resourcePoolKey, + userName: $routeParams.userName + }; + + _init(); + + function _init() { + + // Title + resourcePoolFactory.getResourcePoolExpanded(vm.editorConfig) + .then(resourcePool => { + + // Not found, navigate to 404 + if (resourcePool === null) { + $location.url('/_system/content/notFound?url=' + $location.url()); + return; + } + + // TODO viewTitle was also set in route.js? + $rootScope.viewTitle = resourcePool.Name; + }); + } + } + } + + angular.module('main').controller(controllerId, ResourcePoolViewController); +} \ No newline at end of file diff --git a/ngClient/_system/js/app/directives/resourcePoolEditor/resourcePoolEditor.js b/ngClient/_system/js/app/directives/resourcePoolEditor/resourcePoolEditor.js deleted file mode 100644 index 61a87abea..000000000 --- a/ngClient/_system/js/app/directives/resourcePoolEditor/resourcePoolEditor.js +++ /dev/null @@ -1,381 +0,0 @@ -(function () { - 'use strict'; - - var directiveId = 'resourcePoolEditor'; - - angular.module('main') - .directive(directiveId, ['dataContext', 'Enums', 'logger', 'resourcePoolFactory', '$location', '$rootScope', resourcePoolEditor]); - - function resourcePoolEditor(dataContext, Enums, logger, resourcePoolFactory, $location, $rootScope) { - - // Logger - logger = logger.forSource(directiveId); - - function link(scope, elm, attrs) { - - // Scope variables - scope.currentUser = null; - scope.displayDescription = true; - scope.displayIndexDetails = false; - scope.errorMessage = ''; - scope.isSaving = false; - scope.resourcePool = { Name: 'Loading...' }; - scope.resourcePoolKey = ''; - scope.userName = ''; - - // Functions - scope.changeSelectedElement = changeSelectedElement; - scope.decreaseElementCellNumericValue = decreaseElementCellNumericValue; - scope.decreaseElementMultiplier = decreaseElementMultiplier; - scope.decreaseIndexRating = decreaseIndexRating; - scope.decreaseResourcePoolRate = decreaseResourcePoolRate; - scope.editResourcePool = editResourcePool; - scope.increaseElementCellNumericValue = increaseElementCellNumericValue; - scope.increaseElementMultiplier = increaseElementMultiplier; - scope.increaseIndexRating = increaseIndexRating; - scope.increaseResourcePoolRate = increaseResourcePoolRate; - scope.resetElementCellNumericValue = resetElementCellNumericValue; - scope.resetElementMultiplier = resetElementMultiplier; - scope.resetIndexRating = resetIndexRating; - scope.resetResourcePoolRate = resetResourcePoolRate; - scope.toggleDescription = toggleDescription; - scope.toggleIndexDetails = toggleIndexDetails; - - // Event handlers - scope.$watch('config', configChanged, true); - scope.$on('saveChangesStart', saveChangesStart); - scope.$on('saveChangesCompleted', saveChangesCompleted); - scope.$on('dataContext_currentUserChanged', currentUserChanged); - - /*** Implementations ***/ - - function changeSelectedElement(element) { - scope.resourcePool.selectedElement(element); - loadChartData(); - } - - function configChanged() { - var userName = typeof scope.config.userName === 'undefined' ? '' : scope.config.userName; - var resourcePoolKey = typeof scope.config.resourcePoolKey === 'undefined' ? '' : scope.config.resourcePoolKey; - - initialize(dataContext.getCurrentUser(), userName, resourcePoolKey); - } - - function decreaseElementCellNumericValue(cell) { - resourcePoolFactory.updateElementCellDecimalValue(cell, 'decrease'); - $rootScope.$broadcast('resourcePoolEditor_elementCellNumericValueDecreased', cell); - saveChanges(); - } - - function decreaseElementMultiplier(element) { - resourcePoolFactory.updateElementMultiplier(element, 'decrease'); - $rootScope.$broadcast('resourcePoolEditor_elementMultiplierDecreased', element); - saveChanges(); - } - - function decreaseIndexRating(field) { - resourcePoolFactory.updateElementFieldIndexRating(field, 'decrease'); - saveChanges(); - } - - function decreaseResourcePoolRate() { - resourcePoolFactory.updateResourcePoolRate(scope.resourcePool, 'decrease'); - saveChanges(); - } - - function editResourcePool() { - // TODO Instead of having fixed url here, broadcast an 'edit request'? - $location.url(scope.resourcePool.urlEdit()); - } - - function increaseElementCellNumericValue(cell) { - resourcePoolFactory.updateElementCellDecimalValue(cell, 'increase'); - $rootScope.$broadcast('resourcePoolEditor_elementCellNumericValueIncreased', cell); - saveChanges(); - } - - function increaseElementMultiplier(element) { - resourcePoolFactory.updateElementMultiplier(element, 'increase'); - $rootScope.$broadcast('resourcePoolEditor_elementMultiplierIncreased', element); - saveChanges(); - } - - function increaseIndexRating(field) { - resourcePoolFactory.updateElementFieldIndexRating(field, 'increase'); - saveChanges(); - } - - function increaseResourcePoolRate() { - resourcePoolFactory.updateResourcePoolRate(scope.resourcePool, 'increase'); - saveChanges(); - } - - function initialize(user, userName, resourcePoolKey) { - - if (scope.currentUser !== user || scope.userName !== userName || scope.resourcePoolKey !== resourcePoolKey) { - scope.currentUser = user; - scope.userName = userName; - scope.resourcePoolKey = resourcePoolKey; - - // Clear previous error messages - scope.errorMessage = ''; - - scope.chartConfig = { - credits: { - enabled: false - }, - loading: true, - options: { - plotOptions: { - column: { - allowPointSelect: true, - pointWidth: 15 - }, - pie: { - allowPointSelect: true, - cursor: 'pointer', - dataLabels: { - enabled: false - }, - showInLegend: true - } - }, - tooltip: { - headerFormat: '' - }, - xAxis: { categories: [''] }, - yAxis: { - allowDecimals: false, - min: 0 - } - }, - size: {}, - title: { text: '' } - }; - - // Validate - if (scope.userName === '' || scope.resourcePoolKey === '') { - scope.errorMessage = 'CMRP Id cannot be null'; - scope.chartConfig.loading = false; - return; - } - - var resourcePoolUniqueKey = { userName: scope.userName, resourcePoolKey: scope.resourcePoolKey }; - - // Get resource pool - resourcePoolFactory.getResourcePoolExpanded(resourcePoolUniqueKey) - .then(function (resourcePool) { - - if (typeof resourcePool === 'undefined' || resourcePool === null) { - scope.errorMessage = 'Invalid CMRP'; - return; - } - - // It returns an array, set the first item in the list - scope.resourcePool = resourcePool; - - if (scope.resourcePool.selectedElement() !== null) { - loadChartData(); - } - }) - .catch(function () { - // TODO scope.errorMessage ? - }) - .finally(function () { - scope.chartConfig.loading = false; - }); - } - } - - function loadChartData() { - - // Current element - var element = scope.resourcePool.selectedElement(); - var chartData = null; - - if (element === null) { - return; - } - - // Item length check - if (element.ElementItemSet.length > 20) { - return; - } - - scope.chartConfig.title = { text: element.Name }; - scope.chartConfig.series = []; - - if (scope.displayIndexDetails) { - - // Pie type - scope.chartConfig.title = { text: 'Indexes' }; - scope.chartConfig.options.chart = { type: 'pie' }; - scope.chartConfig.options.yAxis.title = { text: '' }; - - chartData = []; - element.elementFieldIndexSet().forEach(function (elementFieldIndex) { - var chartItem = new ElementFieldIndexChartItem(elementFieldIndex); - chartData.push(chartItem); - }); - scope.chartConfig.series = [{ data: chartData }]; - - } else { - - scope.chartConfig.title = { text: element.Name }; - - // TODO Check this rule? - if (element === element.ResourcePool.mainElement() && (element.totalIncome() > 0 || element.directIncomeField() !== null)) { - - // Column type - scope.chartConfig.options.chart = { type: 'column' }; - scope.chartConfig.options.yAxis.title = { text: 'Total Income' }; - - element.ElementItemSet.forEach(function (elementItem) { - var chartItem = new ColumnChartItem(elementItem); - scope.chartConfig.series.push(chartItem); - }); - } else { - - // Pie type - scope.chartConfig.options.chart = { type: 'pie' }; - scope.chartConfig.options.yAxis.title = { text: '' }; - - chartData = []; - element.ElementItemSet.forEach(function (elementItem) { - elementItem.ElementCellSet.forEach(function (elementCell) { - if (elementCell.ElementField.IndexEnabled) { - var chartItem = new PieChartItem(elementCell); - chartData.push(chartItem); - } - }); - }); - scope.chartConfig.series = [{ data: chartData }]; - } - } - } - - function resetElementCellNumericValue(cell) { - resourcePoolFactory.updateElementCellDecimalValue(cell, 'reset'); - $rootScope.$broadcast('resourcePoolEditor_elementCellNumericValueReset', cell); - saveChanges(); - } - - function resetElementMultiplier(element) { - resourcePoolFactory.updateElementMultiplier(element, 'reset'); - $rootScope.$broadcast('resourcePoolEditor_elementMultiplierReset', element); - saveChanges(); - } - - function resetIndexRating(field) { - resourcePoolFactory.updateElementFieldIndexRating(field, 'reset'); - saveChanges(); - } - - function resetResourcePoolRate() { - resourcePoolFactory.updateResourcePoolRate(scope.resourcePool, 'reset'); - saveChanges(); - } - - function saveChanges() { - dataContext.saveChanges(1500); - } - - function saveChangesStart() { - scope.isSaving = true; - } - - function saveChangesCompleted() { - scope.isSaving = false; - } - - function toggleDescription() { - scope.displayDescription = !scope.displayDescription; - } - - // Index Details - function toggleIndexDetails() { - scope.displayIndexDetails = !scope.displayIndexDetails; - loadChartData(); - } - - function currentUserChanged(event, newUser) { - initialize(newUser, scope.userName, scope.resourcePoolKey); - } - - /* Chart objects */ - - // TODO Store these in a better place? - // TODO Also test these better, by comparing it with resourcePool.selectedElement() property! - function ColumnChartItem(elementItem) { - var self = this; - - Object.defineProperty(self, "name", { - enumerable: true, - configurable: true, - get: function () { - return elementItem.Name; - } - }); - - Object.defineProperty(self, "data", { - enumerable: true, - configurable: true, - get: function () { - return [elementItem.totalIncome()]; - } - }); - } - - function ElementFieldIndexChartItem(elementFieldIndex) { - var self = this; - - Object.defineProperty(self, "name", { - enumerable: true, - configurable: true, - get: function () { return elementFieldIndex.Name; } - }); - - Object.defineProperty(self, "y", { - enumerable: true, - configurable: true, - get: function () { - var indexRating = elementFieldIndex.indexRating(); - // TODO Make rounding better, instead of toFixed + number - return Number(indexRating.toFixed(2)); - } - }); - } - - function PieChartItem(elementCell) { - var self = this; - - Object.defineProperty(self, "name", { - enumerable: true, - configurable: true, - get: function () { - return elementCell.ElementItem.Name; - } - }); - - Object.defineProperty(self, "y", { - enumerable: true, - configurable: true, - get: function () { - var numericValue = elementCell.numericValue(); - // TODO Make rounding better, instead of toFixed + number - return Number(numericValue.toFixed(2)); - } - }); - } - } - - return { - restrict: 'E', - templateUrl: '/_system/js/app/directives/resourcePoolEditor/resourcePoolEditor.html?v=0.6.0', - scope: { - config: '=' - }, - link: link - }; - } -})(); diff --git a/ngClient/_system/ts/app/directives/resourcePoolEditor/resourcePoolEditor.ts b/ngClient/_system/js/app/directives/resourcePoolEditor/resourcePoolEditor.ts similarity index 97% rename from ngClient/_system/ts/app/directives/resourcePoolEditor/resourcePoolEditor.ts rename to ngClient/_system/js/app/directives/resourcePoolEditor/resourcePoolEditor.ts index 9c449a09a..834d2b3b6 100644 --- a/ngClient/_system/ts/app/directives/resourcePoolEditor/resourcePoolEditor.ts +++ b/ngClient/_system/js/app/directives/resourcePoolEditor/resourcePoolEditor.ts @@ -3,16 +3,7 @@ var directiveId = 'resourcePoolEditor'; - angular.module('main') - .directive(directiveId, ['dataContext', 'Enums', 'logger', 'resourcePoolFactory', '$location', '$rootScope', resourcePoolEditor]); - - function resourcePoolEditor(dataContext: any, - Enums: any, - logger: any, - resourcePoolFactory: any, - $location: any, - $rootScope: any); - function resourcePoolEditor(dataContext, Enums, logger, resourcePoolFactory, $location, $rootScope) { + function resourcePoolEditor(dataContext: any, Enums: any, logger: any, resourcePoolFactory: any, $location: any, $rootScope: any) { // Logger logger = logger.forSource(directiveId); @@ -400,4 +391,6 @@ link: link }; } + + angular.module('main').directive(directiveId, ['dataContext', 'Enums', 'logger', 'resourcePoolFactory', '$location', '$rootScope', resourcePoolEditor]); } \ No newline at end of file diff --git a/ngClient/_system/js/app/entities/Element.js b/ngClient/_system/js/app/entities/Element.js deleted file mode 100644 index 43ac1ed23..000000000 --- a/ngClient/_system/js/app/entities/Element.js +++ /dev/null @@ -1,387 +0,0 @@ -(function () { - 'use strict'; - - var factoryId = 'Element'; - angular.module('main') - .factory(factoryId, ['logger', '$rootScope', elementFactory]); - - function elementFactory(logger, $rootScope) { - - // Logger - logger = logger.forSource(factoryId); - - // Server-side - Object.defineProperty(Element.prototype, 'IsMainElement', { - enumerable: true, - configurable: true, - get: function () { return this.backingFields._IsMainElement; }, - set: function (value) { - - var self = this; - - if (self.backingFields._IsMainElement !== value) { - self.backingFields._IsMainElement = value; - - // TODO When this prop set in constructor, ResourcePool is null, in such case, ignore - // However, it would be better to always have a ResourcePool? / coni2k - 29 Nov. '15 - if (typeof self.ResourcePool === 'undefined' || self.ResourcePool === null) { - return; - } - - // Main element check: If there is another element that its IsMainElement flag is true, make it false - if (value) { - self.ResourcePool.ElementSet.forEach(function (element) { - if (element !== self && element.IsMainElement) { - element.IsMainElement = false; - } - }); - - // Update selectedElement of resourcePool - self.ResourcePool.selectedElement(self); - } - } - } - }); - - // Return - return Element; - - function Element() { - - var self = this; - - // Server-side - self.Id = 0; - self.Name = ''; - // TODO breezejs - Cannot assign a navigation property in an entity ctor - //self.ResourcePool = null; - //self.ElementFieldSet = []; - //self.ElementItemSet = []; - //self.ParentFieldSet = []; - - // Local variables - self.backingFields = { - // Server-side - _IsMainElement: false, - - // Client-side - _parent: null, - _familyTree: null, - _elementFieldIndexSet: null, - _indexRating: null, - _directIncomeField: null, - _multiplierField: null, - _totalResourcePoolAmount: null - }; - - // Functions - self.directIncome = directIncome; - self.directIncomeField = directIncomeField; - self.directIncomeIncludingResourcePoolAmount = directIncomeIncludingResourcePoolAmount; - self.elementFieldIndexSet = elementFieldIndexSet; - self.familyTree = familyTree; - self.fullSize = fullSize; - self.indexRating = indexRating; - self.multiplier = multiplier; - self.multiplierField = multiplierField; - self.parent = parent; - self.resourcePoolAmount = resourcePoolAmount; - self.setDirectIncomeField = setDirectIncomeField; - self.setElementFieldIndexSet = setElementFieldIndexSet; - self.setFamilyTree = setFamilyTree; - self.setIndexRating = setIndexRating; - self.setMultiplierField = setMultiplierField; - self.setParent = setParent; - self.totalDirectIncome = totalDirectIncome; - self.totalDirectIncomeIncludingResourcePoolAmount = totalDirectIncomeIncludingResourcePoolAmount; - self.totalIncome = totalIncome; - self.totalIncomeAverage = totalIncomeAverage; - self.totalResourcePoolAmount = totalResourcePoolAmount; - - /*** Implementations ***/ - - function directIncome() { - - // TODO Check totalIncome notes - - var value = 0; - self.ElementItemSet.forEach(function (item) { - value += item.directIncome(); - }); - - return value; - } - - function directIncomeField() { - - // TODO In case of add / remove fields? - if (self.backingFields._directIncomeField === null) { - self.setDirectIncomeField(); - } - - return self.backingFields._directIncomeField; - } - - function directIncomeIncludingResourcePoolAmount() { - - // TODO Check totalIncome notes - - var value = 0; - self.ElementItemSet.forEach(function (item) { - value += item.directIncomeIncludingResourcePoolAmount(); - }); - - return value; - } - - function elementFieldIndexSet() { - if (self.backingFields._elementFieldIndexSet === null) { - self.setElementFieldIndexSet(); - } - return self.backingFields._elementFieldIndexSet; - } - - function familyTree() { - - // TODO In case of add / remove elements? - if (self.backingFields._familyTree === null) { - self.setFamilyTree(); - } - - return self.backingFields._familyTree; - } - - // UI related: Determines whether the chart & element details will use full row (col-md-4 vs col-md-12 etc.) - // TODO Obsolete for the moment! - function fullSize() { - return (self.ElementFieldSet.length > 4) || self.elementFieldIndexSet().length > 2; - } - - function getElementFieldIndexSet(element) { - - var sortedElementFieldSet = element.ElementFieldSet.sort(function (a, b) { return a.SortOrder - b.SortOrder; }); - var indexSet = []; - - // Validate - sortedElementFieldSet.forEach(function (field) { - if (field.IndexEnabled) { - indexSet.push(field); - } - - if (field.DataType === 6 && field.SelectedElement !== null) { - var childIndexSet = getElementFieldIndexSet(field.SelectedElement); - - childIndexSet.forEach(function (childIndex) { - indexSet.push(childIndex); - }); - } - }); - - return indexSet; - } - - function indexRating() { - - if (self.backingFields._indexRating === null) { - self.setIndexRating(false); - } - - return self.backingFields._indexRating; - } - - function multiplier() { - - // TODO Check totalIncome notes - - var value = 0; - self.ElementItemSet.forEach(function (item) { - value += item.multiplier(); - }); - - return value; - } - - function multiplierField() { - - // TODO In case of add / remove field? - if (self.backingFields._multiplierField !== null) { - self.setMultiplierField(); - } - - return self.backingFields._multiplierField; - } - - function parent() { - - // TODO In case of add / remove elements? - if (self.backingFields._parent === null) { - self.setParent(); - } - - return self.backingFields._parent; - } - - function resourcePoolAmount() { - - // TODO Check totalIncome notes - - var value = 0; - self.ElementItemSet.forEach(function (item) { - value += item.resourcePoolAmount(); - }); - - return value; - } - - function setDirectIncomeField() { - var result = self.ElementFieldSet.filter(function (field) { - return field.DataType === 11; - }); - - if (result.length > 0) { - self.backingFields._directIncomeField = result[0]; - } - } - - function setElementFieldIndexSet() { - self.backingFields._elementFieldIndexSet = getElementFieldIndexSet(self); - } - - function setFamilyTree() { - - self.backingFields._familyTree = []; - - var element = self; - while (element !== null) { - self.backingFields._familyTree.unshift(element); - element = element.parent(); - } - - // TODO At the moment it's only upwards, later include children? - } - - function setIndexRating(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - - var indexSet = self.elementFieldIndexSet(); - - var value = 0; - indexSet.forEach(function (index) { - value += index.indexRating(); - }); - - if (self.backingFields._indexRating !== value) { - self.backingFields._indexRating = value; - - // Update related - if (updateRelated) { - self.elementFieldIndexSet().forEach(function (index) { - index.setIndexRatingPercentage(); - }); - } - } - } - - function setMultiplierField() { - var result = self.ElementFieldSet.filter(function (field) { - return field.DataType === 12; - }); - - if (result.length > 0) { - self.backingFields._multiplierField = result[0]; - } - } - - function setParent() { - if (self.ParentFieldSet.length > 0) { - self.backingFields._parent = self.ParentFieldSet[0].Element; - } - } - - function totalDirectIncome() { - - // TODO Check totalIncome notes - - var value = 0; - self.ElementItemSet.forEach(function (item) { - value += item.totalDirectIncome(); - }); - - return value; - } - - function totalDirectIncomeIncludingResourcePoolAmount() { - - // TODO Check totalIncome notes - - var value = 0; - self.ElementItemSet.forEach(function (item) { - value += item.totalDirectIncomeIncludingResourcePoolAmount(); - }); - - return value; - } - - function totalIncome() { - - // TODO If elementItems could set their parent element's totalIncome when their totalIncome changes, it wouldn't be necessary to sum this result everytime? - - var value = 0; - self.ElementItemSet.forEach(function (item) { - value += item.totalIncome(); - }); - - return value; - } - - function totalIncomeAverage() { - - // Validate - if (self.ElementItemSet.length === 0) { - return 0; - } - - return self.totalIncome() / self.ElementItemSet.length; - } - - // TODO This is out of pattern! - function totalResourcePoolAmount() { - - // TODO Check totalIncome notes - - var value; - - if (self === self.ResourcePool.mainElement()) { - - value = self.ResourcePool.InitialValue; - - self.ElementItemSet.forEach(function (item) { - value += item.totalResourcePoolAmount(); - }); - - } else { - if (self.ResourcePool.mainElement() !== null) { - value = self.ResourcePool.mainElement().totalResourcePoolAmount(); - } - } - - //logger.log('TRPA-A ' + value.toFixed(2)); - - if (self.backingFields._totalResourcePoolAmount !== value) { - self.backingFields._totalResourcePoolAmount = value; - - //logger.log('TRPA-B ' + value.toFixed(2)); - - self.elementFieldIndexSet().forEach(function (field) { - // TODO How about this check? - // if (field.DataType === 11) { - - field.setIndexIncome(); - // } - }); - } - - return value; - } - } - } -})(); \ No newline at end of file diff --git a/ngClient/_system/ts/app/entities/Element.ts b/ngClient/_system/js/app/entities/Element.ts similarity index 96% rename from ngClient/_system/ts/app/entities/Element.ts rename to ngClient/_system/js/app/entities/Element.ts index ab18ce773..6d1c132c6 100644 --- a/ngClient/_system/ts/app/entities/Element.ts +++ b/ngClient/_system/js/app/entities/Element.ts @@ -1,12 +1,9 @@ -module M31 { +module Main.Entities { 'use strict'; var factoryId = 'Element'; - angular.module('main') - .factory(factoryId, ['logger', '$rootScope', elementFactory]); - function elementFactory(logger: any, $rootScope: any); - function elementFactory(logger, $rootScope) { + function elementFactory(logger: any, $rootScope: any) { // Logger logger = logger.forSource(factoryId); @@ -158,8 +155,7 @@ return (self.ElementFieldSet.length > 4) || self.elementFieldIndexSet().length > 2; } - function getElementFieldIndexSet(element: any); - function getElementFieldIndexSet(element) { + function getElementFieldIndexSet(element: any) { var sortedElementFieldSet = element.ElementFieldSet.sort((a, b) => (a.SortOrder - b.SortOrder)); var indexSet = []; @@ -260,8 +256,7 @@ // TODO At the moment it's only upwards, later include children? } - function setIndexRating(updateRelated: any); - function setIndexRating(updateRelated) { + function setIndexRating(updateRelated: any) { updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; var indexSet = self.elementFieldIndexSet(); @@ -383,4 +378,8 @@ } } } + + elementFactory.$inject = ['logger', '$rootScope']; + + angular.module('main').factory(factoryId, elementFactory); } \ No newline at end of file diff --git a/ngClient/_system/js/app/entities/ElementCell.js b/ngClient/_system/js/app/entities/ElementCell.js deleted file mode 100644 index 81d1fb34a..000000000 --- a/ngClient/_system/js/app/entities/ElementCell.js +++ /dev/null @@ -1,550 +0,0 @@ -(function () { - 'use strict'; - - var factoryId = 'ElementCell'; - angular.module('main') - .factory(factoryId, ['logger', elementCellFactory]); - - function elementCellFactory(logger) { - - // Logger - logger = logger.forSource(factoryId); - - // Return - return ElementCell; - - function ElementCell() { - - var self = this; - - // Server-side - self.Id = 0; - self.ElementFieldId = 0; - self.ElementItemId = 0; - self.StringValue = ''; // Computed value - Used in: resourcePoolEditor.html - self.NumericValueTotal = 0; // Computed value - Used in: setOtherUsersNumericValueTotal, setCurrentUserNumericValue - self.NumericValueCount = 0; // Computed value - Used in: setOtherUsersNumericValueCount - self.SelectedElementItemId = null; - // TODO breezejs - Cannot assign a navigation property in an entity ctor - //self.ElementField = null; - //self.ElementItem = null; - //self.SelectedElementItem = null; - //self.UserElementCellSet = []; - - // Local variables - self.backingFields = { - _currentUserNumericValue: null, - _otherUsersNumericValueTotal: null, - _otherUsersNumericValueCount: null, - _numericValue: null, - _numericValueMultiplied: null, - _numericValueMultipliedPercentage: null, - _passiveRating: null, - _aggressiveRating: null, - _rating: null, - _ratingPercentage: null, - _indexIncome: null - }; - - // Functions - self.aggressiveRating = aggressiveRating; - self.currentUserCell = currentUserCell; - self.currentUserNumericValue = currentUserNumericValue; - self.indexIncome = indexIncome; - self.numericValue = numericValue; - self.numericValueAverage = numericValueAverage; - self.numericValueCount = numericValueCount; - self.numericValueMultiplied = numericValueMultiplied; - self.numericValueMultipliedPercentage = numericValueMultipliedPercentage; - self.numericValueTotal = numericValueTotal; - self.otherUsersNumericValueCount = otherUsersNumericValueCount; - self.otherUsersNumericValueTotal = otherUsersNumericValueTotal; - self.passiveRating = passiveRating; - self.rating = rating; - self.ratingPercentage = ratingPercentage; - self.setAggressiveRating = setAggressiveRating; - self.setCurrentUserNumericValue = setCurrentUserNumericValue; - self.setIndexIncome = setIndexIncome; - self.setNumericValue = setNumericValue; - self.setNumericValueMultiplied = setNumericValueMultiplied; - self.setNumericValueMultipliedPercentage = setNumericValueMultipliedPercentage; - self.setOtherUsersNumericValueCount = setOtherUsersNumericValueCount; - self.setOtherUsersNumericValueTotal = setOtherUsersNumericValueTotal; - self.setPassiveRating = setPassiveRating; - self.setRating = setRating; - self.setRatingPercentage = setRatingPercentage; - self.value = value; - - /*** Implementations ***/ - - function aggressiveRating() { - - if (self.backingFields._aggressiveRating === null) { - self.setAggressiveRating(false); - } - - return self.backingFields._aggressiveRating; - } - - function currentUserCell() { - return self.UserElementCellSet.length > 0 ? - self.UserElementCellSet[0] : - null; - } - - function currentUserNumericValue() { - - if (self.backingFields._currentUserNumericValue === null) { - self.setCurrentUserNumericValue(false); - } - - return self.backingFields._currentUserNumericValue; - } - - // TODO This is out of pattern! - function indexIncome() { - - //if (self.backingFields._indexIncome === null) { - self.setIndexIncome(); - //} - - return self.backingFields._indexIncome; - } - - function numericValue() { - - if (self.backingFields._numericValue === null) { - self.setNumericValue(false); - } - - return self.backingFields._numericValue; - } - - function numericValueAverage() { - - if (self.numericValueCount() === null) { - return null; - } - - return self.numericValueCount() === 0 ? - 0 : - self.numericValueTotal() / self.numericValueCount(); - } - - function numericValueCount() { - return self.ElementField.UseFixedValue ? - self.currentUserCell() !== null && self.currentUserCell().UserId === self.ElementField.Element.ResourcePool.UserId ? // If it belongs to current user - 1 : - self.otherUsersNumericValueCount() : - self.otherUsersNumericValueCount() + 1; // There is always default value, increase count by 1 - } - - function numericValueMultiplied() { - - if (self.backingFields._numericValueMultiplied === null) { - self.setNumericValueMultiplied(false); - } - - return self.backingFields._numericValueMultiplied; - } - - function numericValueMultipliedPercentage() { - if (self.backingFields._numericValueMultipliedPercentage === null) { - self.setNumericValueMultipliedPercentage(false); - } - - return self.backingFields._numericValueMultipliedPercentage; - } - - function numericValueTotal() { - return self.ElementField.UseFixedValue ? - self.currentUserCell() !== null && self.currentUserCell().UserId === self.ElementField.Element.ResourcePool.UserId ? // If it belongs to current user - self.currentUserNumericValue() : - self.otherUsersNumericValueTotal() : - self.otherUsersNumericValueTotal() + self.currentUserNumericValue(); - } - - // TODO Since this is a fixed value based on NumericValueCount & current user's rate, - // it could be calculated on server, check it later again / coni2k - 03 Aug. '15 - function otherUsersNumericValueCount() { - - // Set other users' value on the initial call - if (self.backingFields._otherUsersNumericValueCount === null) { - self.setOtherUsersNumericValueCount(); - } - - return self.backingFields._otherUsersNumericValueCount; - } - - // TODO Since this is a fixed value based on NumericValueTotal & current user's rate, - // it could be calculated on server, check it later again / coni2k - 03 Aug. '15 - function otherUsersNumericValueTotal() { - - // Set other users' value on the initial call - if (self.backingFields._otherUsersNumericValueTotal === null) { - self.setOtherUsersNumericValueTotal(); - } - - return self.backingFields._otherUsersNumericValueTotal; - } - - function passiveRating() { - if (self.backingFields._passiveRating === null) { - self.setPassiveRating(false); - } - - return self.backingFields._passiveRating; - } - - function rating() { - - if (self.backingFields._rating === null) { - self.setRating(false); - } - - return self.backingFields._rating; - } - - function ratingPercentage() { - - if (self.backingFields._ratingPercentage === null) { - self.setRatingPercentage(false); - } - - return self.backingFields._ratingPercentage; - } - - // TODO Currently updateRelated is always 'false'? - function setAggressiveRating(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - - var value = 0; // Default value? - - if (self.ElementField.IndexEnabled && self.ElementField.referenceRatingMultiplied() > 0) { - switch (self.ElementField.IndexSortType) { - case 1: { // HighestToLowest (High rating is better) - value = (1 - self.numericValueMultipliedPercentage()) / self.ElementField.referenceRatingMultiplied(); - break; - } - case 2: { // LowestToHighest (Low rating is better) - value = self.numericValueMultiplied() / self.ElementField.referenceRatingMultiplied(); - break; - } - } - - if (!self.ElementField.referenceRatingAllEqualFlag()) { - value = 1 - value; - } - } - - if (self.backingFields._aggressiveRating !== value) { - self.backingFields._aggressiveRating = value; - - // Update related values - if (updateRelated) { - // TODO ? - } - } - } - - function setCurrentUserNumericValue(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - - var value; - var userCell = self.currentUserCell(); - - switch (self.ElementField.DataType) { - case 2: { value = userCell !== null ? userCell.BooleanValue : 0; break; } - case 3: { value = userCell !== null ? userCell.IntegerValue : 0; break; } - case 4: { value = userCell !== null ? userCell.DecimalValue : 50; /* Default value? */ break; } - // TODO 5 (DateTime?) - case 11: { - // DirectIncome: No need to try user's cell, always return all users', which will be CMRP owner's value - value = self.NumericValueTotal !== null ? self.NumericValueTotal : 0; - break; - } - case 12: { value = userCell !== null ? userCell.DecimalValue : 0; /* Default value? */ break; } - // default: { throw 'currentUserNumericValue() - Not supported element field type: ' + self.ElementField.DataType; } - } - - if (self.backingFields._currentUserNumericValue !== value) { - self.backingFields._currentUserNumericValue = value; - - // Update related - if (updateRelated) { - self.setNumericValue(); - } - } - } - - function setIndexIncome(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - - var value = 0; // Default value? - - if (self.ElementField.DataType === 6 && self.SelectedElementItem !== null) { - // item's index income / how many times this item has been selected (used) by higher items - // TODO Check whether ParentCellSet gets updated when selecting / deselecting an item - value = self.SelectedElementItem.totalResourcePoolIncome() / self.SelectedElementItem.ParentCellSet.length; - } else { - if (self.ElementField.IndexEnabled) { - value = self.ElementField.indexIncome() * self.ratingPercentage(); - } - } - - if (self.backingFields._indexIncome !== value) { - self.backingFields._indexIncome = value; - - // TODO Update related? - // item.totalResourcePoolIncome - } - } - - function setNumericValue(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - - var value; - - if (typeof self.ElementField !== 'undefined') { - switch (self.ElementField.Element.ResourcePool.RatingMode) { - case 1: { value = self.currentUserNumericValue(); break; } // Current user's - case 2: { value = self.numericValueAverage(); break; } // All - } - - } - - // If it's different... - if (self.backingFields._numericValue !== value) { - self.backingFields._numericValue = value; - - // Update related - if (updateRelated) { - - if (self.ElementField.DataType === 11) { - self.ElementItem.setDirectIncome(); - } - - self.setNumericValueMultiplied(); - } - } - } - - function setNumericValueMultiplied(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - - var value; - - // if (typeof self.ElementField === 'undefined' || !self.ElementField.IndexEnabled) { - if (typeof self.ElementField === 'undefined') { - value = 0; // ? - } else { - value = self.numericValue() * self.ElementItem.multiplier(); - //logger.log(self.ElementField.Name[0] + '-' + self.ElementItem.Name[0] + ' NVMA ' + self.numericValue()); - //logger.log(self.ElementField.Name[0] + '-' + self.ElementItem.Name[0] + ' NVMB ' + self.ElementItem.multiplier()); - } - - if (self.backingFields._numericValueMultiplied !== value) { - self.backingFields._numericValueMultiplied = value; - - // Update related - if (updateRelated) { - self.ElementField.setNumericValueMultiplied(); - } - - // IMPORTANT REMARK: If the field is using IndexSortType 1, - // then it would be better to directly call field.setReferenceRatingMultiplied() method. - // It would be quicker to calculate. - // However, since field.setNumericValueMultiplied() will make 'numericValueMultipliedPercentage' calculations - // which meanwhile will call referenceRatingMultiplied() method anyway. So it becomes redundant. - // This code block could possibly be improved with a IndexSortType switch case, - // but it seems it would be bit overkill. - // Still something to think about it later? / coni2k - 22 Oct. '15 - //self.ElementField.setReferenceRatingMultiplied(); - } - } - - function setNumericValueMultipliedPercentage(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - - var value = 0; - - if (self.ElementField.IndexEnabled && self.ElementField.numericValueMultiplied() > 0) { - value = self.numericValueMultiplied() / self.ElementField.numericValueMultiplied(); - } - - if (self.backingFields._numericValueMultipliedPercentage !== value) { - self.backingFields._numericValueMultipliedPercentage = value; - - // Update related - if (updateRelated) { - // TODO ? - } - } - } - - function setOtherUsersNumericValueCount() { - self.backingFields._otherUsersNumericValueCount = self.NumericValueCount; - - // Exclude current user's - if (self.UserElementCellSet.length > 0) { - self.backingFields._otherUsersNumericValueCount--; - } - } - - function setOtherUsersNumericValueTotal() { - - self.backingFields._otherUsersNumericValueTotal = self.NumericValueTotal !== null ? - self.NumericValueTotal : - 0; - - // Exclude current user's - if (self.UserElementCellSet.length > 0) { - - var userValue = 0; - switch (self.ElementField.DataType) { - // TODO Check bool to decimal conversion? - case 2: { userValue = self.UserElementCellSet[0].BooleanValue; break; } - case 3: { userValue = self.UserElementCellSet[0].IntegerValue; break; } - case 4: { userValue = self.UserElementCellSet[0].DecimalValue; break; } - // TODO 5 - DateTime? - case 11: { userValue = self.UserElementCellSet[0].DecimalValue; break; } - // TODO 12 - Multiplier? - //default: { - // throw 'setOtherUsersNumericValueTotal - Not supported element field type: ' + self.ElementField.DataType; - //} - } - - self.backingFields._otherUsersNumericValueTotal -= userValue; - } - } - - function setPassiveRating(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - - var value = 0; - - if (self.ElementField.IndexEnabled) { - - switch (self.ElementField.IndexSortType) { - case 1: { // HightestToLowest (High rating is better) - value = self.numericValueMultipliedPercentage(); - break; - } - case 2: { // LowestToHighest (Low rating is better) - if (self.ElementField.passiveRating() > 0) { - value = (1 - self.numericValueMultipliedPercentage()) / self.ElementField.passiveRating(); - } - break; - } - } - } - - if (self.backingFields._passiveRating !== value) { - self.backingFields._passiveRating = value; - - // Update related - if (updateRelated) { - // TODO ? - } - } - } - - function setRating(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - - var value = 0; - - // If there is only one item, then always %100 - if (self.ElementField.ElementCellSet.length === 1) { - value = 1; - } else { - switch (self.ElementField.IndexCalculationType) { - case 1: // Aggressive rating - { - value = self.aggressiveRating(); - break; - } - case 2: // Passive rating - { - value = self.passiveRating(); - break; - } - } - } - - if (self.backingFields._rating !== value) { - self.backingFields._rating = value; - - // Update related - if (updateRelated) { - // TODO ? - } - } - } - - function setRatingPercentage(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - - var value = 0; - - if (self.ElementField.IndexEnabled && self.ElementField.rating() > 0) { - value = self.rating() / self.ElementField.rating(); - } - - if (self.backingFields._ratingPercentage !== value) { - self.backingFields._ratingPercentage = value; - - // Update related - if (updateRelated) { - // TODO ? - } - } - } - - function value() { - - var value = null; - //var currentUserCell = self.UserElementCellSet.length > 0 - // ? self.UserElementCellSet[0] - // : null; - - switch (self.ElementField.DataType) { - case 1: { - if (self.UserElementCellSet.length > 0) { - value = self.UserElementCellSet[0].StringValue; - } - break; - } - case 2: { - if (self.UserElementCellSet.length > 0) { - value = self.UserElementCellSet[0].BooleanValue ? 'True' : 'False'; - } - break; - } - case 3: { - if (self.UserElementCellSet.length > 0) { - value = self.UserElementCellSet[0].IntegerValue; - } - break; - } - // TODO 5 (DateTime?) - case 4: - case 11: - case 12: { - if (self.UserElementCellSet.length > 0) { - value = self.UserElementCellSet[0].DecimalValue; - } - break; - } - case 6: { - if (self.SelectedElementItem !== null) { - value = self.SelectedElementItem.Name; - } - } - } - - return value; - } - } - } -})(); \ No newline at end of file diff --git a/ngClient/_system/ts/app/entities/ElementCell.ts b/ngClient/_system/js/app/entities/ElementCell.ts similarity index 95% rename from ngClient/_system/ts/app/entities/ElementCell.ts rename to ngClient/_system/js/app/entities/ElementCell.ts index 492db7c15..cc312a5c5 100644 --- a/ngClient/_system/ts/app/entities/ElementCell.ts +++ b/ngClient/_system/js/app/entities/ElementCell.ts @@ -1,12 +1,9 @@ -module M32 { +module Main.Entities { 'use strict'; var factoryId = 'ElementCell'; - angular.module('main') - .factory(factoryId, ['logger', elementCellFactory]); - function elementCellFactory(logger: any); - function elementCellFactory(logger) { + function elementCellFactory(logger: any) { // Logger logger = logger.forSource(factoryId); @@ -216,8 +213,7 @@ } // TODO Currently updateRelated is always 'false'? - function setAggressiveRating(updateRelated: any); - function setAggressiveRating(updateRelated) { + function setAggressiveRating(updateRelated: any) { updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; var value = 0; // Default value? @@ -249,8 +245,7 @@ } } - function setCurrentUserNumericValue(updateRelated: any); - function setCurrentUserNumericValue(updateRelated) { + function setCurrentUserNumericValue(updateRelated: any) { updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; var value; @@ -280,8 +275,7 @@ } } - function setIndexIncome(updateRelated: any); - function setIndexIncome(updateRelated) { + function setIndexIncome(updateRelated: any) { updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; var value = 0; // Default value? @@ -304,8 +298,7 @@ } } - function setNumericValue(updateRelated: any); - function setNumericValue(updateRelated) { + function setNumericValue(updateRelated: any) { updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; var value; @@ -334,8 +327,7 @@ } } - function setNumericValueMultiplied(updateRelated: any); - function setNumericValueMultiplied(updateRelated) { + function setNumericValueMultiplied(updateRelated: any) { updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; var value; @@ -369,8 +361,7 @@ } } - function setNumericValueMultipliedPercentage(updateRelated: any); - function setNumericValueMultipliedPercentage(updateRelated) { + function setNumericValueMultipliedPercentage(updateRelated: any) { updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; var value = 0; @@ -425,8 +416,7 @@ } } - function setPassiveRating(updateRelated: any); - function setPassiveRating(updateRelated) { + function setPassiveRating(updateRelated: any) { updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; var value = 0; @@ -457,8 +447,7 @@ } } - function setRating(updateRelated: any); - function setRating(updateRelated) { + function setRating(updateRelated: any) { updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; var value = 0; @@ -491,8 +480,7 @@ } } - function setRatingPercentage(updateRelated: any); - function setRatingPercentage(updateRelated) { + function setRatingPercentage(updateRelated: any) { updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; var value = 0; @@ -557,4 +545,8 @@ } } } + + elementCellFactory.$inject = ['logger']; + + angular.module('main').factory(factoryId, ['logger', elementCellFactory]); } \ No newline at end of file diff --git a/ngClient/_system/js/app/entities/ElementField.js b/ngClient/_system/js/app/entities/ElementField.js deleted file mode 100644 index b6728c5c5..000000000 --- a/ngClient/_system/js/app/entities/ElementField.js +++ /dev/null @@ -1,581 +0,0 @@ -(function () { - 'use strict'; - - var factoryId = 'ElementField'; - angular.module('main') - .factory(factoryId, ['logger', '$rootScope', elementFieldFactory]); - - function elementFieldFactory(logger, $rootScope) { - - // Logger - logger = logger.forSource(factoryId); - - // Server-side - Object.defineProperty(ElementField.prototype, 'DataType', { - enumerable: true, - configurable: true, - get: function () { return this.backingFields._dataType; }, - set: function (value) { - - var self = this; - if (self.backingFields._dataType !== value) { - - // Finally, set it - self.backingFields._dataType = value; - - $rootScope.$broadcast('ElementField_DataTypeChanged', this); - } - } - }); - - Object.defineProperty(ElementField.prototype, 'IndexEnabled', { - enumerable: true, - configurable: true, - get: function () { return this.backingFields._indexEnabled; }, - set: function (value) { - - if (this.backingFields._indexEnabled !== value) { - this.backingFields._indexEnabled = value; - - this.IndexCalculationType = value ? 1 : 0; - this.IndexSortType = value ? 1 : 0; - - $rootScope.$broadcast('ElementField_IndexEnabledChanged', this); - - // TODO Complete this block! - - //// Update related - //// a. Element - //this.Element.setElementFieldIndexSet(); - - //// b. Item(s) - //this.ElementCellSet.forEach(function(cell) { - // var item = cell.ElementItem; - // item.setElementCellIndexSet(); - //}); - - //// c. Cells - //this.ElementCellSet.forEach(function(cell) { - // cell.setNumericValueMultipliedPercentage(false); - //}); - //this.setReferenceRatingMultiplied(); - - /* IndexEnabled related functions */ - //cell.setAggressiveRating(); - //cell.setratingPercentage(); - //cell.setIndexIncome(); - } - } - }); - - // Return - return ElementField; - - function ElementField() { - - var self = this; - - // Server-side - self.Id = 0; - self.ElementId = 0; - self.Name = ''; - //self.DataType = 1; - self.SelectedElementId = null; - self.UseFixedValue = null; - self.IndexCalculationType = 0; - self.IndexSortType = 0; - self.SortOrder = 0; - self.IndexRatingTotal = 0; // Computed value - Used in: setOtherUsersIndexRatingTotal - self.IndexRatingCount = 0; // Computed value - Used in: setOtherUsersIndexRatingCount - // TODO breezejs - Cannot assign a navigation property in an entity ctor - //self.Element = null; - //self.SelectedElement = null; - //self.ElementCellSet = []; - //self.UserElementFieldSet = []; - - // Local variables - self.backingFields = { - _dataType: 1, - _indexEnabled: false, - _currentUserIndexRating: null, - _otherUsersIndexRatingTotal: null, - _otherUsersIndexRatingCount: null, - _indexRating: null, - _indexRatingPercentage: null, - _numericValueMultiplied: null, - _passiveRating: null, - _referenceRatingMultiplied: null, - // Aggressive rating formula prevents the organizations with the worst rating to get any income. - // However, in case all ratings are equal, then no one can get any income from the pool. - // This flag is used to determine this special case and let all organizations get a same share from the pool. - // See the usage in aggressiveRating() in elementCell.js - // TODO Usage of this field is correct? - _referenceRatingAllEqualFlag: true, - _aggressiveRating: null, - _rating: null, - _indexIncome: null - }; - - // Functions - self.currentUserElementField = currentUserElementField; - self.currentUserIndexRating = currentUserIndexRating; - self.indexIncome = indexIncome; - self.indexRating = indexRating; - self.indexRatingAverage = indexRatingAverage; - self.indexRatingCount = indexRatingCount; - self.indexRatingPercentage = indexRatingPercentage; - self.indexRatingTotal = indexRatingTotal; - self.numericValueMultiplied = numericValueMultiplied; - self.otherUsersIndexRatingCount = otherUsersIndexRatingCount; - self.otherUsersIndexRatingTotal = otherUsersIndexRatingTotal; - self.passiveRating = passiveRating; - self.rating = rating; - self.referenceRatingAllEqualFlag = referenceRatingAllEqualFlag; - self.referenceRatingMultiplied = referenceRatingMultiplied; - self.setCurrentUserIndexRating = setCurrentUserIndexRating; - self.setIndexIncome = setIndexIncome; - self.setIndexRating = setIndexRating; - self.setIndexRatingPercentage = setIndexRatingPercentage; - self.setNumericValueMultiplied = setNumericValueMultiplied; - self.setOtherUsersIndexRatingCount = setOtherUsersIndexRatingCount; - self.setOtherUsersIndexRatingTotal = setOtherUsersIndexRatingTotal; - self.setPassiveRating = setPassiveRating; - self.setRating = setRating; - self.setReferenceRatingAllEqualFlag = setReferenceRatingAllEqualFlag; - self.setReferenceRatingMultiplied = setReferenceRatingMultiplied; - - /*** Implementations ***/ - - function currentUserElementField() { - return self.UserElementFieldSet.length > 0 ? - self.UserElementFieldSet[0] : - null; - } - - function currentUserIndexRating() { - - if (self.backingFields._currentUserIndexRating === null) { - self.setCurrentUserIndexRating(false); - } - - return self.backingFields._currentUserIndexRating; - } - - function indexIncome() { - - if (self.backingFields._indexIncome === null) { - self.setIndexIncome(false); - } - - return self.backingFields._indexIncome; - } - - function indexRating() { - - if (self.backingFields._indexRating === null) { - self.setIndexRating(false); - } - - return self.backingFields._indexRating; - } - - function indexRatingAverage() { - - if (self.indexRatingCount() === null) { - return null; - } - - return self.indexRatingCount() === 0 ? - 0 : - self.indexRatingTotal() / self.indexRatingCount(); - } - - function indexRatingCount() { - return self.otherUsersIndexRatingCount() + 1; - } - - function indexRatingPercentage() { - - if (self.backingFields._indexRatingPercentage === null) { - self.setIndexRatingPercentage(false); - } - - return self.backingFields._indexRatingPercentage; - } - - function indexRatingTotal() { - return self.otherUsersIndexRatingTotal() + self.currentUserIndexRating(); - } - - function numericValueMultiplied() { - - if (self.backingFields._numericValueMultiplied === null) { - self.setNumericValueMultiplied(false); - } - - return self.backingFields._numericValueMultiplied; - } - - // TODO Since this is a fixed value based on IndexRatingCount & current user's rate, - // it could be calculated on server, check it later again / coni2k - 03 Aug. '15 - function otherUsersIndexRatingCount() { - - // Set other users' value on the initial call - if (self.backingFields._otherUsersIndexRatingCount === null) { - self.setOtherUsersIndexRatingCount(); - } - - return self.backingFields._otherUsersIndexRatingCount; - } - - // TODO Since this is a fixed value based on IndexRatingTotal & current user's rate, - // it could be calculated on server, check it later again / coni2k - 03 Aug. '15 - function otherUsersIndexRatingTotal() { - - // Set other users' value on the initial call - if (self.backingFields._otherUsersIndexRatingTotal === null) { - self.setOtherUsersIndexRatingTotal(); - } - - return self.backingFields._otherUsersIndexRatingTotal; - } - - // Helper function for Index Rating Type 1 case (low rating is better) - function passiveRating() { - if (self.backingFields._passiveRating === null) { - self.setPassiveRating(false); - } - - return self.backingFields._passiveRating; - } - - function rating() { - - if (self.backingFields._rating === null) { - self.setRating(false); - } - - return self.backingFields._rating; - } - - function referenceRatingAllEqualFlag(value) { - return self.backingFields._referenceRatingAllEqualFlag; - } - - function referenceRatingMultiplied() { - - if (self.backingFields._referenceRatingMultiplied === null) { - self.setReferenceRatingMultiplied(false); - } - - return self.backingFields._referenceRatingMultiplied; - } - - function setCurrentUserIndexRating(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - - var value = self.currentUserElementField() !== null ? - self.currentUserElementField().Rating : - 50; // If there is no rating, this is the default value? - - if (self.backingFields._currentUserIndexRating !== value) { - self.backingFields._currentUserIndexRating = value; - - // Update related - if (updateRelated) { - self.setIndexRating(); - } - } - } - - function setIndexIncome(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - - var value = self.Element.totalResourcePoolAmount() * self.indexRatingPercentage(); - - //if (self.IndexEnabled) { - //logger.log(self.Name[0] + ' II ' + value.toFixed(2)); - //} - - if (self.backingFields._indexIncome !== value) { - self.backingFields._indexIncome = value; - - // Update related - if (updateRelated) { - self.ElementCellSet.forEach(function (cell) { - cell.setIndexIncome(); - }); - } - } - } - - function setIndexRating(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - - var value = 0; // Default value? - - switch (self.Element.ResourcePool.RatingMode) { - case 1: { value = self.currentUserIndexRating(); break; } // Current user's - case 2: { value = self.indexRatingAverage(); break; } // All - } - - //logger.log(self.Name[0] + ' IR ' + value.toFixed(2)); - - if (self.backingFields._indexRating !== value) { - self.backingFields._indexRating = value; - - // TODO Update related - if (updateRelated) { - self.Element.ResourcePool.mainElement().setIndexRating(); - } - } - } - - function setIndexRatingPercentage(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - - var value = 0; // Default value? - - var elementIndexRating = self.Element.ResourcePool.mainElement().indexRating(); - - if (elementIndexRating === 0) { - value = 0; - } else { - value = self.indexRating() / elementIndexRating; - } - - //logger.log(self.Name[0] + ' IRP ' + value.toFixed(2)); - - if (self.backingFields._indexRatingPercentage !== value) { - self.backingFields._indexRatingPercentage = value; - - // Update related - if (updateRelated) { - self.setIndexIncome(); - } - } - } - - function setNumericValueMultiplied(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - - var value = 0; // Default value? - - // Validate - if (self.ElementCellSet.length === 0) { - value = 0; // ? - } else { - self.ElementCellSet.forEach(function (cell) { - value += cell.numericValueMultiplied(); - //logger.log(self.Name[0] + '-' + cell.ElementItem.Name[0] + ' NVMA ' + cell.numericValueMultiplied()); - }); - } - - if (self.backingFields._numericValueMultiplied !== value) { - self.backingFields._numericValueMultiplied = value; - - //logger.log(self.Name[0] + ' NVMB ' + value.toFixed(2)); - - // Update related? - if (updateRelated && self.IndexEnabled) { - - self.ElementCellSet.forEach(function (cell) { - cell.setNumericValueMultipliedPercentage(false); - }); - - self.setPassiveRating(false); - - self.ElementCellSet.forEach(function (cell) { - cell.setPassiveRating(false); - }); - - self.setReferenceRatingMultiplied(false); - - self.ElementCellSet.forEach(function (cell) { - cell.setAggressiveRating(false); - }); - - self.ElementCellSet.forEach(function (cell) { - cell.setRating(false); - }); - - self.setRating(false); - - self.ElementCellSet.forEach(function (cell) { - cell.setRatingPercentage(false); - }); - - //self.setIndexIncome(false); - - self.ElementCellSet.forEach(function (cell) { - cell.setIndexIncome(false); - }); - } - } - } - - function setOtherUsersIndexRatingCount() { - self.backingFields._otherUsersIndexRatingCount = self.IndexRatingCount; - - // Exclude current user's - if (self.currentUserElementField() !== null) { - self.backingFields._otherUsersIndexRatingCount--; - } - } - - function setOtherUsersIndexRatingTotal() { - self.backingFields._otherUsersIndexRatingTotal = self.IndexRatingTotal !== null ? - self.IndexRatingTotal : - 0; - - // Exclude current user's - if (self.currentUserElementField() !== null) { - self.backingFields._otherUsersIndexRatingTotal -= self.currentUserElementField().Rating; - } - } - - function setPassiveRating(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - - var value = 0; - - self.ElementCellSet.forEach(function (cell) { - value += 1 - cell.numericValueMultipliedPercentage(); - }); - - if (self.backingFields._passiveRating !== value) { - self.backingFields._passiveRating = value; - - if (updateRelated) { - // TODO ? - } - } - } - - function setRating(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - - var value = 0; // Default value? - - // Validate - self.ElementCellSet.forEach(function (cell) { - value += cell.rating(); - }); - - //logger.log(self.Name[0] + ' AR ' + value.toFixed(2)); - - if (self.backingFields._rating !== value) { - self.backingFields._rating = value; - - //logger.log(self.Name[0] + ' AR OK'); - - if (updateRelated) { - - // Update related - self.ElementCellSet.forEach(function (cell) { - cell.setRatingPercentage(false); - }); - - self.setIndexIncome(); - } - } - } - - function setReferenceRatingAllEqualFlag(value) { - - if (self.backingFields._referenceRatingAllEqualFlag !== value) { - self.backingFields._referenceRatingAllEqualFlag = value; - return true; - } - return false; - } - - // TODO Currently updateRelated is always 'false'? - function setReferenceRatingMultiplied(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - - var value = null; - var allEqualFlag = true; - - // Validate - if (self.ElementCellSet.length === 0) { - value = 0; // ? - } else { - - self.ElementCellSet.forEach(function (cell) { - - if (value === null) { - - switch (self.IndexSortType) { - case 1: { // HighestToLowest (High number is better) - value = (1 - cell.numericValueMultipliedPercentage()); - break; - } - case 2: { // LowestToHighest (Low number is better) - value = cell.numericValueMultiplied(); - break; - } - } - - } else { - - switch (self.IndexSortType) { - case 1: { // HighestToLowest (High number is better) - - if (1 - cell.numericValueMultipliedPercentage() !== value) { - allEqualFlag = false; - } - - if (1 - cell.numericValueMultipliedPercentage() > value) { - value = 1 - cell.numericValueMultipliedPercentage(); - } - break; - } - case 2: { // LowestToHighest (Low number is better) - - if (cell.numericValueMultiplied() !== value) { - allEqualFlag = false; - } - - if (cell.numericValueMultiplied() > value) { - value = cell.numericValueMultiplied(); - } - - break; - } - } - } - }); - } - - //logger.log(self.Name[0] + '-' + cell.ElementItem.Name[0] + ' RRMA ' + value.toFixed(2)); - - // Set all equal flag - var flagUpdated = self.setReferenceRatingAllEqualFlag(allEqualFlag); - var ratingUpdated = false; - - // Only if it's different.. - if (self.backingFields._referenceRatingMultiplied !== value) { - self.backingFields._referenceRatingMultiplied = value; - - ratingUpdated = true; - - //logger.log(self.Name[0] + ' RRMB ' + value.toFixed(2)); - } - - // Update related - if ((flagUpdated || ratingUpdated) && updateRelated) { - - // TODO ?! - - self.ElementCellSet.forEach(function (cell) { - cell.setAggressiveRating(false); - }); - - // self.setAggressiveRating(); - } - } - - } - } -})(); \ No newline at end of file diff --git a/ngClient/_system/ts/app/entities/ElementField.ts b/ngClient/_system/js/app/entities/ElementField.ts similarity index 94% rename from ngClient/_system/ts/app/entities/ElementField.ts rename to ngClient/_system/js/app/entities/ElementField.ts index 2405a7126..c121099c7 100644 --- a/ngClient/_system/ts/app/entities/ElementField.ts +++ b/ngClient/_system/js/app/entities/ElementField.ts @@ -1,12 +1,9 @@ -module M33 { +module Main.Entities { 'use strict'; var factoryId = 'ElementField'; - angular.module('main') - .factory(factoryId, ['logger', '$rootScope', elementFieldFactory]); - function elementFieldFactory(logger: any, $rootScope: any); - function elementFieldFactory(logger, $rootScope) { + function elementFieldFactory(logger: any, $rootScope: any) { // Logger logger = logger.forSource(factoryId); @@ -259,8 +256,7 @@ return self.backingFields._rating; } - function referenceRatingAllEqualFlag(value: any); - function referenceRatingAllEqualFlag(value) { + function referenceRatingAllEqualFlag(value: any) { return self.backingFields._referenceRatingAllEqualFlag; } @@ -273,8 +269,7 @@ return self.backingFields._referenceRatingMultiplied; } - function setCurrentUserIndexRating(updateRelated: any); - function setCurrentUserIndexRating(updateRelated) { + function setCurrentUserIndexRating(updateRelated: any) { updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; var value = self.currentUserElementField() !== null ? @@ -291,8 +286,7 @@ } } - function setIndexIncome(updateRelated: any); - function setIndexIncome(updateRelated) { + function setIndexIncome(updateRelated: any) { updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; var value = self.Element.totalResourcePoolAmount() * self.indexRatingPercentage(); @@ -313,8 +307,7 @@ } } - function setIndexRating(updateRelated: any); - function setIndexRating(updateRelated) { + function setIndexRating(updateRelated: any) { updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; var value = 0; // Default value? @@ -336,8 +329,7 @@ } } - function setIndexRatingPercentage(updateRelated: any); - function setIndexRatingPercentage(updateRelated) { + function setIndexRatingPercentage(updateRelated: any) { updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; var value = 0; // Default value? @@ -362,8 +354,7 @@ } } - function setNumericValueMultiplied(updateRelated: any); - function setNumericValueMultiplied(updateRelated) { + function setNumericValueMultiplied(updateRelated: any) { updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; var value = 0; // Default value? @@ -441,8 +432,7 @@ } } - function setPassiveRating(updateRelated: any); - function setPassiveRating(updateRelated) { + function setPassiveRating(updateRelated: any) { updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; var value = 0; @@ -460,8 +450,7 @@ } } - function setRating(updateRelated: any); - function setRating(updateRelated) { + function setRating(updateRelated: any) { updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; var value = 0; // Default value? @@ -490,8 +479,7 @@ } } - function setReferenceRatingAllEqualFlag(value: any); - function setReferenceRatingAllEqualFlag(value) { + function setReferenceRatingAllEqualFlag(value: any) { if (self.backingFields._referenceRatingAllEqualFlag !== value) { self.backingFields._referenceRatingAllEqualFlag = value; @@ -501,8 +489,7 @@ } // TODO Currently updateRelated is always 'false'? - function setReferenceRatingMultiplied(updateRelated: any); - function setReferenceRatingMultiplied(updateRelated) { + function setReferenceRatingMultiplied(updateRelated: any) { updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; var value = null; @@ -589,4 +576,8 @@ } } + + elementFieldFactory.$inject = ['logger', '$rootScope']; + + angular.module('main').factory(factoryId, elementFieldFactory); } \ No newline at end of file diff --git a/ngClient/_system/js/app/entities/ElementItem.js b/ngClient/_system/js/app/entities/ElementItem.js deleted file mode 100644 index af0f47f28..000000000 --- a/ngClient/_system/js/app/entities/ElementItem.js +++ /dev/null @@ -1,314 +0,0 @@ -(function () { - 'use strict'; - - var factoryId = 'ElementItem'; - angular.module('main') - .factory(factoryId, ['logger', elementItemFactory]); - - function elementItemFactory(logger) { - - // Logger - logger = logger.forSource(factoryId); - - // Return - return ElementItem; - - function ElementItem() { - - var self = this; - - // Server-side - self.Id = 0; - self.ElementId = 0; - self.Name = ''; - // TODO breezejs - Cannot assign a navigation property in an entity ctor - //self.Element = null; - //self.ElementCellSet = []; - //self.ParentCellSet = []; - - // Local variables - self.backingFields = { - _elementCellIndexSet: null, - _directIncome: null, - _multiplier: null, - _totalDirectIncome: null, - _resourcePoolAmount: null, - _totalResourcePoolAmount: null, - _totalResourcePoolIncome: null - }; - - // Functions - self.directIncome = directIncome; - self.directIncomeIncludingResourcePoolAmount = directIncomeIncludingResourcePoolAmount; - self.elementCellIndexSet = elementCellIndexSet; - self.incomeStatus = incomeStatus; - self.multiplier = multiplier; - self.resourcePoolAmount = resourcePoolAmount; - self.setDirectIncome = setDirectIncome; - self.setElementCellIndexSet = setElementCellIndexSet; - self.setMultiplier = setMultiplier; - self.setResourcePoolAmount = setResourcePoolAmount; - self.setTotalDirectIncome = setTotalDirectIncome; - self.setTotalResourcePoolAmount = setTotalResourcePoolAmount; - self.totalDirectIncome = totalDirectIncome; - self.totalDirectIncomeIncludingResourcePoolAmount = totalDirectIncomeIncludingResourcePoolAmount; - self.totalIncome = totalIncome; - self.totalResourcePoolAmount = totalResourcePoolAmount; - self.totalResourcePoolIncome = totalResourcePoolIncome; - - /*** Implementations ***/ - - function directIncome() { - - if (self.backingFields._directIncome === null) { - self.setDirectIncome(false); - } - - return self.backingFields._directIncome; - } - - function directIncomeIncludingResourcePoolAmount() { // A.k.a Sales Price incl. VAT - return self.directIncome() + self.resourcePoolAmount(); - } - - function elementCellIndexSet() { - - if (self.backingFields._elementCellIndexSet === null) { - self.setElementCellIndexSet(); - } - - return self.backingFields._elementCellIndexSet; - } - - function getElementCellIndexSet(elementItem) { - - var indexSet = []; - var sortedElementCellSet = elementItem.ElementCellSet.sort(function (a, b) { - return a.ElementField.SortOrder - b.ElementField.SortOrder; - }); - - sortedElementCellSet.forEach(function (cell) { - - if (cell.ElementField.IndexEnabled) { - indexSet.push(cell); - } - - if (cell.ElementField.DataType === 6 && cell.SelectedElementItem !== null) { - var childIndexSet = getElementCellIndexSet(cell.SelectedElementItem); - - if (childIndexSet.length > 0) { - indexSet.push(cell); - } - } - }); - - return indexSet; - } - - function incomeStatus() { - - var totalIncome = self.totalIncome(); - // TODO Make rounding better, instead of toFixed + number - var averageIncome = Number(self.Element.totalIncomeAverage().toFixed(2)); - - if (totalIncome === averageIncome) { - return 'average'; - } else if (totalIncome < averageIncome) { - return 'low'; - } else if (totalIncome > averageIncome) { - return 'high'; - } - } - - function multiplier() { - - if (self.backingFields._multiplier === null) { - self.setMultiplier(false); - } - - return self.backingFields._multiplier; - } - - function resourcePoolAmount() { - - if (self.backingFields._resourcePoolAmount === null) { - self.setResourcePoolAmount(false); - } - - return self.backingFields._resourcePoolAmount; - } - - function setDirectIncome(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - - // First, find direct income cell - var directIncomeCell = null; - - var result = self.ElementCellSet.filter(function (elementCell) { - return elementCell.ElementField.DataType === 11; - }); - - if (result.length > 0) { - directIncomeCell = result[0]; - } - - var value; - if (directIncomeCell === null) { - value = 0; - } else { - value = directIncomeCell.numericValue(); - } - - if (self.backingFields._directIncome !== value) { - self.backingFields._directIncome = value; - - // Update related - if (updateRelated) { - self.setTotalDirectIncome(); - self.setResourcePoolAmount(); - } - } - } - - function setElementCellIndexSet() { - self.backingFields._elementCellIndexSet = getElementCellIndexSet(self); - } - - function setMultiplier(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - - // First, find the multiplier cell - var multiplierCell = null; - - var result = self.ElementCellSet.filter(function(elementCell) { - return elementCell.ElementField.DataType === 12; - }); - - if (result.length > 0) { - multiplierCell = result[0]; - } - - var value = 0; - - // If there is no multiplier field defined on this element, return 1, so it can return calculate the income correctly - // TODO Cover 'add new multiplier field' case as well! - if (multiplierCell === null) { - value = 1; - } else { - - // If there is a multiplier field on the element but user is not set any value, return 0 as the default value - if (multiplierCell.currentUserCell() === null || - multiplierCell.currentUserCell().DecimalValue === null) { - value = 0; - } else { // Else, user's - value = multiplierCell.currentUserCell().DecimalValue; - } - } - - if (self.backingFields._multiplier !== value) { - self.backingFields._multiplier = value; - - // Update related - self.setTotalDirectIncome(); - self.setTotalResourcePoolAmount(); - } - } - - function setResourcePoolAmount(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - - var value = self.directIncome() * self.Element.ResourcePool.resourcePoolRatePercentage(); - - if (self.backingFields._resourcePoolAmount !== value) { - self.backingFields._resourcePoolAmount = value; - - // TODO Update related - if (updateRelated) { - self.setTotalResourcePoolAmount(); - } - } - } - - function setTotalDirectIncome(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - - var value = self.directIncome() * self.multiplier(); - - if (self.backingFields._totalDirectIncome !== value) { - self.backingFields._totalDirectIncome = value; - - // TODO Update related - if (updateRelated) { - - } - } - } - - function setTotalResourcePoolAmount(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - - var value = self.resourcePoolAmount() * self.multiplier(); - - if (self.backingFields._totalResourcePoolAmount !== value) { - self.backingFields._totalResourcePoolAmount = value; - - // TODO Update related - if (updateRelated) { - - } - } - } - - function totalDirectIncome() { - - if (self.backingFields._totalDirectIncome === null) { - self.setTotalDirectIncome(false); - } - - return self.backingFields._totalDirectIncome; - } - - function totalDirectIncomeIncludingResourcePoolAmount() { // A.k.a Total Sales Price incl. VAT - return self.directIncomeIncludingResourcePoolAmount() * self.multiplier(); - } - - function totalIncome() { - var totalIncome = self.totalDirectIncome() + self.totalResourcePoolIncome(); - // TODO Make rounding better, instead of toFixed + number - return Number(totalIncome.toFixed(2)); - } - - function totalResourcePoolAmount() { - - if (self.backingFields._totalResourcePoolAmount === null) { - self.setTotalResourcePoolAmount(false); - } - - return self.backingFields._totalResourcePoolAmount; - } - - // TODO This is out of pattern! - function totalResourcePoolIncome() { - - var value = 0; - - self.ElementCellSet.forEach(function (cell) { - value += cell.indexIncome(); - }); - - if (self.backingFields._totalResourcePoolIncome !== value) { - self.backingFields._totalResourcePoolIncome = value; - - // Update related - // TODO Is this correct? It looks like it didn't affect anything? - self.ParentCellSet.forEach(function (parentCell) { - parentCell.setIndexIncome(); - }); - } - - return value; - } - - } - } -})(); \ No newline at end of file diff --git a/ngClient/_system/ts/app/entities/ElementItem.ts b/ngClient/_system/js/app/entities/ElementItem.ts similarity index 92% rename from ngClient/_system/ts/app/entities/ElementItem.ts rename to ngClient/_system/js/app/entities/ElementItem.ts index e9e876011..8cc402be1 100644 --- a/ngClient/_system/ts/app/entities/ElementItem.ts +++ b/ngClient/_system/js/app/entities/ElementItem.ts @@ -1,12 +1,9 @@ -module M34 { +module Main.Entities { 'use strict'; var factoryId = 'ElementItem'; - angular.module('main') - .factory(factoryId, ['logger', elementItemFactory]); - function elementItemFactory(logger: any); - function elementItemFactory(logger) { + function elementItemFactory(logger: any) { // Logger logger = logger.forSource(factoryId); @@ -81,8 +78,7 @@ return self.backingFields._elementCellIndexSet; } - function getElementCellIndexSet(elementItem: any); - function getElementCellIndexSet(elementItem) { + function getElementCellIndexSet(elementItem: any) { var indexSet = []; var sortedElementCellSet = elementItem.ElementCellSet.sort((a, b) => (a.ElementField.SortOrder - b.ElementField.SortOrder)); @@ -138,8 +134,7 @@ return self.backingFields._resourcePoolAmount; } - function setDirectIncome(updateRelated: any); - function setDirectIncome(updateRelated) { + function setDirectIncome(updateRelated: any) { updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; // First, find direct income cell @@ -173,8 +168,7 @@ self.backingFields._elementCellIndexSet = getElementCellIndexSet(self); } - function setMultiplier(updateRelated: any); - function setMultiplier(updateRelated) { + function setMultiplier(updateRelated: any) { updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; // First, find the multiplier cell @@ -212,8 +206,7 @@ } } - function setResourcePoolAmount(updateRelated: any); - function setResourcePoolAmount(updateRelated) { + function setResourcePoolAmount(updateRelated: any) { updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; var value = self.directIncome() * self.Element.ResourcePool.resourcePoolRatePercentage(); @@ -228,8 +221,7 @@ } } - function setTotalDirectIncome(updateRelated: any); - function setTotalDirectIncome(updateRelated) { + function setTotalDirectIncome(updateRelated: any) { updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; var value = self.directIncome() * self.multiplier(); @@ -244,8 +236,7 @@ } } - function setTotalResourcePoolAmount(updateRelated: any); - function setTotalResourcePoolAmount(updateRelated) { + function setTotalResourcePoolAmount(updateRelated: any) { updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; var value = self.resourcePoolAmount() * self.multiplier(); @@ -312,4 +303,8 @@ } } + + elementItemFactory.$inject = ['logger']; + + angular.module('main').factory(factoryId, elementItemFactory); } \ No newline at end of file diff --git a/ngClient/_system/js/app/entities/Enums.js b/ngClient/_system/js/app/entities/Enums.js deleted file mode 100644 index 02e537ac4..000000000 --- a/ngClient/_system/js/app/entities/Enums.js +++ /dev/null @@ -1,102 +0,0 @@ -(function () { - 'use strict'; - - var factoryId = 'Enums'; - angular.module('main') - .factory(factoryId, ['logger', enumsFactory]); - - function enumsFactory(logger) { - - // Logger - logger = logger.forSource(factoryId); - - var self = { - ElementFieldDataType: {}, - ElementFieldIndexCalculationType: {}, - ElementFieldIndexSortType: {}, - getEnumKey: getEnumKey - }; - - self.ElementFieldDataType = { - - // A field that holds string value. - // Use StringValue property to set its value on ElementItem level. - 'String': 1, - - // A field that holds boolean value. - // Use BooleanValue property to set its value on ElementItem level. - 'Boolean': 2, - - // A field that holds integer value. - // Use IntegerValue property to set its value on ElementItem level. - 'Integer': 3, - - // A field that holds decimal value. - // Use DecimalValue property to set its value on ElementItem level. - 'Decimal': 4, - - //// A field that holds DateTime value. - //// Use DateTimeValue property to set its value on ElementItem level. - //'DateTime': 5, - - // A field that holds another defined Element object within the resource pool. - // Use SelectedElementItem property to set its value on ElementItem level. - 'Element': 6, - - // The field that presents each item's main income (e.g. Sales Price). - // Also resource pool amount will be calculated based on this field. - // Defined once per Element (at the moment, can be changed to per Resource Pool). - // Use DecimalValue property to set its value on ElementItem level. - 'DirectIncome': 11, - - // The multiplier of the resource pool (e.g. Number of sales, number of users). - // Defined once per Element (at the moment, can be changed to per Resource Pool). - // Use DecimalValue property to set its value on ElementItem level. - 'Multiplier': 12 - }; - - self.ElementFieldIndexCalculationType = { - // Default type. - // Uses the lowest score as the base (reference) rating in the group, then calculates the difference from that base. - // Base rating (lowest) gets 0 from the pool and other items get an amount based on their difference. - // Aims to maximize the benefit of the pool. - 'Aggressive': 1, - - // Sums all ratings and calculates the percentages. - // All items get an amount, including the lowest scored item. - // Good for cases that only use 'Resource Pool - Initial Amount' feature. - 'Passive': 2 - }; - - self.ElementFieldIndexSortType = { - - // Default type. - // High rating is better. - 'Highest': 1, - - // Low rating is better. - 'Lowest': 2 - }; - - function getEnumKey(enumTableKey, value) { - for (var tableKey in self) { - - // Ignore these tables - if (enumTableKey === '$get' || enumTableKey === 'getEnumKey') { - return; - } - - // Search through enum tables & their values - if (tableKey === enumTableKey) { - for (var valueKey in self[tableKey]) { - if (self[tableKey][valueKey] === value) { - return valueKey; - } - } - } - } - } - - return self; - } -})(); diff --git a/ngClient/_system/ts/app/entities/Enums.ts b/ngClient/_system/js/app/entities/Enums.ts similarity index 92% rename from ngClient/_system/ts/app/entities/Enums.ts rename to ngClient/_system/js/app/entities/Enums.ts index 6197cfc01..946103d14 100644 --- a/ngClient/_system/ts/app/entities/Enums.ts +++ b/ngClient/_system/js/app/entities/Enums.ts @@ -1,12 +1,9 @@ -module M35 { +module Main.Entities { 'use strict'; var factoryId = 'Enums'; - angular.module('main') - .factory(factoryId, ['logger', enumsFactory]); - function enumsFactory(logger: any); - function enumsFactory(logger) { + function enumsFactory(logger: any) { // Logger logger = logger.forSource(factoryId); @@ -79,8 +76,7 @@ 'Lowest': 2 }; - function getEnumKey(enumTableKey: any, value: any); - function getEnumKey(enumTableKey, value) { + function getEnumKey(enumTableKey: any, value: any) { for (var tableKey in self) { // Ignore these tables @@ -101,4 +97,8 @@ return self; } + + enumsFactory.$inject = ['logger']; + + angular.module('main').factory(factoryId, enumsFactory); } \ No newline at end of file diff --git a/ngClient/_system/js/app/entities/ResourcePool.js b/ngClient/_system/js/app/entities/ResourcePool.js deleted file mode 100644 index dd8db4b64..000000000 --- a/ngClient/_system/js/app/entities/ResourcePool.js +++ /dev/null @@ -1,590 +0,0 @@ -(function () { - 'use strict'; - - var factoryId = 'ResourcePool'; - angular.module('main') - .factory(factoryId, ['logger', resourcePoolFactory]); - - function resourcePoolFactory(logger) { - - // Logger - logger = logger.forSource(factoryId); - - // Server-side properties - Object.defineProperty(ResourcePool.prototype, 'Name', { - enumerable: true, - configurable: true, - get: function () { - return this.backingFields._name; - }, - set: function (value) { - - var oldStripped = this.stripInvalidChars(this.backingFields._name); - - if (this.backingFields._name !== value) { - this.backingFields._name = value; - - // If 'Key' is not a custom value (generated through Name), then keep updating it - if (this.Key === oldStripped) { - this.Key = value; - } - } - } - }); - - Object.defineProperty(ResourcePool.prototype, 'Key', { - enumerable: true, - configurable: true, - get: function () { - return this.backingFields._key; - }, - set: function (value) { - - var newValue = this.stripInvalidChars(value); - - if (this.backingFields._key !== newValue) { - this.backingFields._key = newValue; - } - } - }); - - Object.defineProperty(ResourcePool.prototype, 'UseFixedResourcePoolRate', { - enumerable: true, - configurable: true, - get: function () { return this.backingFields._useFixedResourcePoolRate; }, - set: function (value) { - - if (this.backingFields._useFixedResourcePoolRate !== value) { - this.backingFields._useFixedResourcePoolRate = value; - - this.setResourcePoolRate(); - } - } - }); - - // Client-side properties - Object.defineProperty(ResourcePool.prototype, 'RatingMode', { - enumerable: true, - configurable: true, - get: function () { return this.backingFields._ratingMode; }, - set: function (value) { - if (this.backingFields._ratingMode !== value) { - this.backingFields._ratingMode = value; - - this.setResourcePoolRate(); - - this.ElementSet.forEach(function (element) { - - element.ElementFieldSet.forEach(function (field) { - - // Field calculations - if (field.IndexEnabled) { - field.setIndexRating(); - } - - if (!field.UseFixedValue) { - field.ElementCellSet.forEach(function (cell) { - - // Cell calculations - switch (field.DataType) { - case 2: - case 3: - case 4: - // TODO 5 (DateTime?) - case 11: - case 12: { - cell.setNumericValue(); - break; - } - } - }); - } - }); - }); - } - } - }); - - // Return - return ResourcePool; - - function ResourcePool() { - - var self = this; - - // Server-side - self.Id = 0; - self.UserId = 0; - self.InitialValue = 0; - self.ResourcePoolRateTotal = 0; // Computed value - Used in: setOtherUsersResourcePoolRateTotal - self.ResourcePoolRateCount = 0; // Computed value - Used in: setOtherUsersResourcePoolRateCount - self.RatingCount = 0; // Computed value - Used in: resourcePoolEditor.html - // TODO breezejs - Cannot assign a navigation property in an entity ctor - //self.User = null; - //self.ElementSet = []; - //self.UserResourcePoolSet = []; - - // Local variables - self.backingFields = { - _currentUserResourcePoolRate: null, - _isAdded: false, - _name: '', - _key: '', - _otherUsersResourcePoolRateTotal: null, - _otherUsersResourcePoolRateCount: null, - _ratingMode: 1, // Only my ratings vs. All users' ratings - _resourcePoolRate: null, - _resourcePoolRatePercentage: null, - _selectedElement: null, - _useFixedResourcePoolRate: false - }; - // TODO Move this to field.js? - self.displayMultiplierFunctions = true; // In some cases, it's not necessary for the user to change multiplier - - // Functions - self._init = _init; - self.currentUserResourcePool = currentUserResourcePool; - self.currentUserResourcePoolRate = currentUserResourcePoolRate; - self.displayResourcePoolDetails = displayResourcePoolDetails; - self.displayRatingMode = displayRatingMode; - self.mainElement = mainElement; - self.name = name; - self.otherUsersResourcePoolRateCount = otherUsersResourcePoolRateCount; - self.otherUsersResourcePoolRateTotal = otherUsersResourcePoolRateTotal; - self.resourcePoolRate = resourcePoolRate; - self.resourcePoolRateAverage = resourcePoolRateAverage; - self.resourcePoolRateCount = resourcePoolRateCount; - self.resourcePoolRatePercentage = resourcePoolRatePercentage; - self.resourcePoolRateTotal = resourcePoolRateTotal; - self.selectedElement = selectedElement; - self.setCurrentUserResourcePoolRate = setCurrentUserResourcePoolRate; - self.setOtherUsersResourcePoolRateCount = setOtherUsersResourcePoolRateCount; - self.setOtherUsersResourcePoolRateTotal = setOtherUsersResourcePoolRateTotal; - self.setResourcePoolRate = setResourcePoolRate; - self.setResourcePoolRatePercentage = setResourcePoolRatePercentage; - self.stripInvalidChars = stripInvalidChars; - self.toggleRatingMode = toggleRatingMode; - self.updateCache = updateCache; - self.urlEdit = urlEdit; - self.urlView = urlView; - - /*** Implementations ***/ - - // Should be called after createEntity or retrieving it from server - function _init(setComputedFields) { - setComputedFields = typeof setComputedFields !== 'undefined' ? setComputedFields : false; - - // Set initial values of computed fields - if (setComputedFields) { - - var userRatings = []; - - // ResourcePool - self.UserResourcePoolSet.forEach(function (userResourcePool) { - self.ResourcePoolRateTotal += userResourcePool.ResourcePoolRate; - self.ResourcePoolRateCount += 1; - - if (userRatings.indexOf(userResourcePool.UserId) === -1) { - userRatings.push(userResourcePool.UserId); - } - }); - - // Fields - self.ElementSet.forEach(function (element) { - element.ElementFieldSet.forEach(function (elementField) { - elementField.UserElementFieldSet.forEach(function (userElementField) { - elementField.IndexRatingTotal += userElementField.IndexRating; - elementField.IndexRatingCount += 1; - - if (userRatings.indexOf(userElementField.UserId) === -1) { - userRatings.push(userElementField.UserId); - } - }); - - // Cells - elementField.ElementCellSet.forEach(function (elementCell) { - elementCell.UserElementCellSet.forEach(function (userElementCell) { - elementCell.StringValue = ''; // TODO ? - elementCell.NumericValueTotal += userElementCell.DecimalValue; // TODO Correct approach? - elementCell.NumericValueCount += 1; - - if (elementField.IndexEnabled) { - if (userRatings.indexOf(userElementCell.UserId) === -1) { - userRatings.push(userElementCell.UserId); - } - } - }); - }); - }); - }); - - // Rating count - self.RatingCount = userRatings.length; - } - - // Set otherUsers' data - self.setOtherUsersResourcePoolRateTotal(); - self.setOtherUsersResourcePoolRateCount(); - - // Elements - if (typeof self.ElementSet !== 'undefined') { - self.ElementSet.forEach(function (element) { - - // Fields - if (typeof element.ElementFieldSet !== 'undefined') { - element.ElementFieldSet.forEach(function (field) { - - field.setOtherUsersIndexRatingTotal(); - field.setOtherUsersIndexRatingCount(); - - // Cells - if (typeof field.ElementCellSet !== 'undefined') { - field.ElementCellSet.forEach(function (cell) { - - cell.setOtherUsersNumericValueTotal(); - cell.setOtherUsersNumericValueCount(); - }); - } - }); - } - }); - } - - updateCache(); - } - - function currentUserResourcePool() { - return self.UserResourcePoolSet.length > 0 ? - self.UserResourcePoolSet[0] : - null; - } - - function currentUserResourcePoolRate() { - - if (self.backingFields._currentUserResourcePoolRate === null) { - self.setCurrentUserResourcePoolRate(false); - } - - return self.backingFields._currentUserResourcePoolRate; - } - - function displayResourcePoolDetails() { - return self.selectedElement().directIncomeField() !== null && - self.selectedElement().elementFieldIndexSet().length > 0; - } - - // Checks whether resource pool has any item that can be rateable - // Obsolete: Replaced with RatingCount > 0 / coni2k - 21 Feb. '16 - function displayRatingMode() { - - // Check resource pool level first - if (!self.UseFixedResourcePoolRate) { - return true; - } - - // Field index level - for (var elementIndex = 0; elementIndex < self.ElementSet.length; elementIndex++) { - var element = self.ElementSet[elementIndex]; - - // If there are multiple indexes, then the users can set index rating - if (element.elementFieldIndexSet().length > 1) { - return true; - } - - // If there is an index without a fixed value - if (element.elementFieldIndexSet().length > 0 && !element.elementFieldIndexSet()[0].UseFixedValue) { - return true; - } - } - - return false; - } - - function mainElement() { - var result = self.ElementSet.filter(function (element) { - return element.IsMainElement; - }); - - return result.length > 0 ? result[0] : null; - } - - // TODO Since this is a fixed value based on ResourcePoolRateCount & current user's rate, - // it could be calculated on server, check it later again / coni2k - 03 Aug. '15 - function otherUsersResourcePoolRateCount() { - - // Set other users' value on the initial call - if (self.backingFields._otherUsersResourcePoolRateCount === null) { - self.setOtherUsersResourcePoolRateCount(); - } - - return self.backingFields._otherUsersResourcePoolRateCount; - } - - // TODO Since this is a fixed value based on ResourcePoolRateTotal & current user's rate, - // it could be calculated on server, check it later again / coni2k - 03 Aug. '15 - function otherUsersResourcePoolRateTotal() { - - // Set other users' value on the initial call - if (self.backingFields._otherUsersResourcePoolRateTotal === null) { - self.setOtherUsersResourcePoolRateTotal(); - } - - return self.backingFields._otherUsersResourcePoolRateTotal; - } - - function resourcePoolRate() { - - if (self.backingFields._resourcePoolRate === null) { - self.setResourcePoolRate(false); - } - - return self.backingFields._resourcePoolRate; - } - - function resourcePoolRateAverage() { - - if (self.resourcePoolRateCount() === null) { - return null; - } - - return self.resourcePoolRateCount() === 0 ? - 0 : - self.resourcePoolRateTotal() / self.resourcePoolRateCount(); - } - - function resourcePoolRateCount() { - return self.UseFixedResourcePoolRate ? - self.currentUserResourcePool() !== null && self.currentUserResourcePool().UserId === self.UserId ? // If it belongs to current user - 1 : - self.otherUsersResourcePoolRateCount() : - self.otherUsersResourcePoolRateCount() + 1; // There is always default value, increase count by 1 - } - - function resourcePoolRatePercentage() { - - if (self.backingFields._resourcePoolRatePercentage === null) { - self.setResourcePoolRatePercentage(false); - } - - return self.backingFields._resourcePoolRatePercentage; - } - - function resourcePoolRateTotal() { - return self.UseFixedResourcePoolRate ? - self.currentUserResourcePool() !== null && self.currentUserResourcePool().UserId === self.UserId ? // If it belongs to current user - self.currentUserResourcePoolRate() : - self.otherUsersResourcePoolRateTotal() : - self.otherUsersResourcePoolRateTotal() + self.currentUserResourcePoolRate(); - } - - function selectedElement(value) { - - // Set new value - if (typeof value !== 'undefined' && self.backingFields._selectedElement !== value) { - self.backingFields._selectedElement = value; - } - - // If there is no existing value (initial state), use mainElement() as the selected - if (self.backingFields._selectedElement === null && self.mainElement()) { - self.backingFields._selectedElement = self.mainElement(); - } - - return self.backingFields._selectedElement; - } - - function setCurrentUserResourcePoolRate(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - - var value = self.currentUserResourcePool() !== null ? - self.currentUserResourcePool().ResourcePoolRate : - 10; // Default value? - - if (self.backingFields._currentUserResourcePoolRate !== value) { - self.backingFields._currentUserResourcePoolRate = value; - - // Update related - if (updateRelated) { - self.setResourcePoolRate(); - } - } - } - - function setOtherUsersResourcePoolRateCount() { - - self.backingFields._otherUsersResourcePoolRateCount = self.ResourcePoolRateCount; - - // Exclude current user's - if (self.currentUserResourcePool() !== null) { - self.backingFields._otherUsersResourcePoolRateCount--; - } - } - - function setOtherUsersResourcePoolRateTotal() { - self.backingFields._otherUsersResourcePoolRateTotal = self.ResourcePoolRateTotal !== null ? - self.ResourcePoolRateTotal : - 0; - - // Exclude current user's - if (self.currentUserResourcePool() !== null) { - self.backingFields._otherUsersResourcePoolRateTotal -= self.currentUserResourcePool().ResourcePoolRate; - } - } - - function setResourcePoolRate(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - - var value; - - if (self.UseFixedResourcePoolRate) { - value = self.resourcePoolRateAverage(); - } else { - switch (self.RatingMode) { - case 1: { value = self.currentUserResourcePoolRate(); break; } // Current user's - case 2: { value = self.resourcePoolRateAverage(); break; } // All - } - } - - if (self.backingFields._resourcePoolRate !== value) { - self.backingFields._resourcePoolRate = value; - - // Update related - if (updateRelated) { - self.setResourcePoolRatePercentage(); - } - } - } - - function setResourcePoolRatePercentage(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - - var value = self.resourcePoolRate() === 0 ? - 0 : - self.resourcePoolRate() / 100; - - if (self.backingFields._resourcePoolRatePercentage !== value) { - self.backingFields._resourcePoolRatePercentage = value; - - // Update related - if (updateRelated) { - self.ElementSet.forEach(function (element) { - - element.ElementItemSet.forEach(function (item) { - item.setResourcePoolAmount(); - }); - }); - } - } - } - - function stripInvalidChars(value) { - - // Trim, remove special chars and replace space with dash - if (value !== null) { - value = value.trim() - .replace(/[^-\w\s]/gi, '') - .replace(/\s+/g, '-'); - } - - return value; - } - - function toggleRatingMode() { - self.RatingMode = self.RatingMode === 1 ? 2 : 1; - } - - // TODO Most of these functions are related with userService.js - updateX functions - // Try to merge these two - Actually try to handle these actions within the related entity / coni2k - 27 Nov. '15 - function updateCache() { - - var isUnchanged = false; - - self.setCurrentUserResourcePoolRate(); - - // Elements - if (typeof self.ElementSet !== 'undefined') { - self.ElementSet.forEach(function (element) { - - // TODO Review this later / coni2k - 24 Nov. '15 - element.setElementFieldIndexSet(); - - // Fields - if (typeof element.ElementFieldSet !== 'undefined') { - element.ElementFieldSet.forEach(function (field) { - - if (field.IndexEnabled) { - // TODO Actually index rating can't be set through resourcePoolEdit page and no need to update this cache - // But still keep it as a reminder? / coni2k - 29 Nov. '15 - field.setCurrentUserIndexRating(); - } - - // Cells - if (typeof field.ElementCellSet !== 'undefined') { - field.ElementCellSet.forEach(function (cell) { - - switch (cell.ElementField.DataType) { - case 1: { - // TODO Again what a mess! - // StringValue is a computed value, it should normally come from the server - // But in case resource pool was just created, then it should be directly set like this. - // Otherwise, it doesn't show its value on editor. - // And on top of it, since it changes, breeze thinks that 'cell' is modified and tries to send it server - // which results an error. So that's why modified check & acceptChanges parts were added. - // coni2k - 01 Dec. '15 - if (cell.UserElementCellSet.length > 0) { - isUnchanged = cell.entityAspect.entityState.isUnchanged(); - cell.StringValue = cell.UserElementCellSet[0].StringValue; - if (isUnchanged) { cell.entityAspect.acceptChanges(); } - } - break; - } - case 2: - case 3: - case 4: - // TODO DateTime? - { - cell.setCurrentUserNumericValue(); - break; - } - case 11: - { - // TODO DirectIncome is always calculated from NumericValueTotal - // Which is actually not correct but till that its fixed, update it like this / coni2k - 29 Nov. '15 - // Also check 'What a mess' of StringValue - if (cell.UserElementCellSet.length > 0) { - isUnchanged = cell.entityAspect.entityState.isUnchanged(); - cell.NumericValueTotal = cell.UserElementCellSet[0].DecimalValue; - if (isUnchanged) { cell.entityAspect.acceptChanges(); } - } - - cell.setCurrentUserNumericValue(); - break; - } - case 12: - { - cell.ElementItem.setMultiplier(); - - if (cell.ElementField.IndexEnabled) { - cell.setNumericValueMultiplied(); - } - - break; - } - } - }); - } - }); - } - }); - } - } - - function urlEdit() { - return self.urlView() + '/edit'; - } - - function urlView() { - return '/' + self.User.UserName + '/' + self.Key; - } - } - } -})(); \ No newline at end of file diff --git a/ngClient/_system/ts/app/entities/ResourcePool.ts b/ngClient/_system/js/app/entities/ResourcePool.ts similarity index 96% rename from ngClient/_system/ts/app/entities/ResourcePool.ts rename to ngClient/_system/js/app/entities/ResourcePool.ts index 86101d415..0f07eb408 100644 --- a/ngClient/_system/ts/app/entities/ResourcePool.ts +++ b/ngClient/_system/js/app/entities/ResourcePool.ts @@ -1,12 +1,9 @@ -module M36 { +module Main.Entities { 'use strict'; var factoryId = 'ResourcePool'; - angular.module('main') - .factory(factoryId, ['logger', resourcePoolFactory]); - function resourcePoolFactory(logger: any); - function resourcePoolFactory(logger) { + function resourcePoolFactory(logger: any) { // Logger logger = logger.forSource(factoryId); @@ -172,8 +169,7 @@ /*** Implementations ***/ // Should be called after createEntity or retrieving it from server - function _init(setComputedFields: any); - function _init(setComputedFields) { + function _init(setComputedFields: any) { setComputedFields = typeof setComputedFields !== 'undefined' ? setComputedFields : false; // Set initial values of computed fields @@ -377,8 +373,7 @@ self.otherUsersResourcePoolRateTotal() + self.currentUserResourcePoolRate(); } - function selectedElement(value: any); - function selectedElement(value) { + function selectedElement(value: any) { // Set new value if (typeof value !== 'undefined' && self.backingFields._selectedElement !== value) { @@ -393,8 +388,7 @@ return self.backingFields._selectedElement; } - function setCurrentUserResourcePoolRate(updateRelated: any); - function setCurrentUserResourcePoolRate(updateRelated) { + function setCurrentUserResourcePoolRate(updateRelated: any) { updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; var value = self.currentUserResourcePool() !== null ? @@ -432,8 +426,7 @@ } } - function setResourcePoolRate(updateRelated: any); - function setResourcePoolRate(updateRelated) { + function setResourcePoolRate(updateRelated: any) { updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; var value; @@ -457,8 +450,7 @@ } } - function setResourcePoolRatePercentage(updateRelated: any); - function setResourcePoolRatePercentage(updateRelated) { + function setResourcePoolRatePercentage(updateRelated: any) { updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; var value = self.resourcePoolRate() === 0 ? @@ -480,9 +472,7 @@ } } - function stripInvalidChars(value: Object); - function stripInvalidChars(value: any); - function stripInvalidChars(value) { + function stripInvalidChars(value: string) { // Trim, remove special chars and replace space with dash if (value !== null) { @@ -593,4 +583,8 @@ } } } + + resourcePoolFactory.$inject = ['logger']; + + angular.module('main').factory(factoryId, resourcePoolFactory); } \ No newline at end of file diff --git a/ngClient/_system/js/app/entities/User.js b/ngClient/_system/js/app/entities/User.js deleted file mode 100644 index e28624ba7..000000000 --- a/ngClient/_system/js/app/entities/User.js +++ /dev/null @@ -1,56 +0,0 @@ -(function () { - 'use strict'; - - var factoryId = 'User'; - angular.module('main') - .factory(factoryId, ['logger', userFactory]); - - function userFactory(logger) { - - // Logger - logger = logger.forSource(factoryId); - - // Return - return User; - - function User() { - - var self = this; - - // Server-side - self.Id = 0; - self.Email = ''; - self.EmailConfirmed = false; - self.IsAnonymous = false; - self.UserName = ''; - self.SingleUseToken = null; - self.HasPassword = false; - self.FirstName = ''; - self.MiddleName = ''; - self.LastName = ''; - self.PhoneNumber = ''; - self.PhoneNumberConfirmed = false; - self.TwoFactorEnabled = false; - self.AccessFailedCount = 0; - self.LockoutEnabled = false; - self.LockoutEndDateUtc = null; - self.Notes = ''; - self.CreatedOn = new Date(); - self.ModifiedOn = new Date(); - self.DeletedOn = null; - // TODO breezejs - Cannot assign a navigation property in an entity ctor - //self.Claims = null; - //self.Logins = []; - //self.Roles = []; - - // Functions - self.isAuthenticated = isAuthenticated; - - /*** Implementations ***/ - - function isAuthenticated() { - return self.Id > 0; - } - } - } -})(); \ No newline at end of file diff --git a/ngClient/_system/js/app/entities/User.ts b/ngClient/_system/js/app/entities/User.ts new file mode 100644 index 000000000..abd5c7f70 --- /dev/null +++ b/ngClient/_system/js/app/entities/User.ts @@ -0,0 +1,37 @@ +module Main.Entities { + 'use strict'; + + export class User { + + // Server-side + Id = 0; + Email = ''; + EmailConfirmed = false; + IsAnonymous = false; + UserName = ''; + SingleUseToken = null; + HasPassword = false; + FirstName = ''; + MiddleName = ''; + LastName = ''; + PhoneNumber = ''; + PhoneNumberConfirmed = false; + TwoFactorEnabled = false; + AccessFailedCount = 0; + LockoutEnabled = false; + LockoutEndDateUtc = null; + Notes = ''; + CreatedOn = new Date(); + ModifiedOn = new Date(); + DeletedOn = null; + // TODO breezejs - Cannot assign a navigation property in an entity ctor + //Claims = null; + //Logins = []; + //Roles = []; + + // Functions + isAuthenticated() { + return this.Id > 0; + } + } +} \ No newline at end of file diff --git a/ngClient/_system/js/app/entities/UserElementCell.js b/ngClient/_system/js/app/entities/UserElementCell.js deleted file mode 100644 index 13e8b0300..000000000 --- a/ngClient/_system/js/app/entities/UserElementCell.js +++ /dev/null @@ -1,47 +0,0 @@ -(function () { - 'use strict'; - - var factoryId = 'UserElementCell'; - angular.module('main') - .factory(factoryId, ['logger', userElementCellFactory]); - - function userElementCellFactory(logger) { - - // Logger - logger = logger.forSource(factoryId); - - // Properties - Object.defineProperty(UserElementCell.prototype, 'DecimalValue', { - enumerable: true, - configurable: true, - get: function () { return this.backingFields._DecimalValue; }, - set: function (value) { - if (this.backingFields._DecimalValue !== value) { - this.backingFields._DecimalValue = value; - } - } - }); - - // Return - return UserElementCell; - - function UserElementCell() { - - var self = this; - - // Server-side - self.UserId = 0; - self.ElementCellId = 0; - self.StringValue = null; - self.BooleanValue = null; - self.IntegerValue = null; - // - self.DateTimeValue = null; - - // Local variables - self.backingFields = { - _DecimalValue: null - }; - } - } -})(); \ No newline at end of file diff --git a/ngClient/_system/js/app/entities/UserElementCell.ts b/ngClient/_system/js/app/entities/UserElementCell.ts new file mode 100644 index 000000000..14a65cc69 --- /dev/null +++ b/ngClient/_system/js/app/entities/UserElementCell.ts @@ -0,0 +1,64 @@ +module Main.Entities { + 'use strict'; + + export class UserElementCell { + + // Server-side + UserId = 0; + ElementCellId = 0; + StringValue = null; + BooleanValue = null; + IntegerValue = null; + DateTimeValue = null; + DecimalValue = null; + } + + //angular.module('main').controller('x', UserElementCell); + //angular.module('main').controller(controllerId, AccountController); + + //var factoryId = 'UserElementCell'; + + //function userElementCellFactory(logger: any) { + + // // Logger + // logger = logger.forSource(factoryId); + + // // Properties + // Object.defineProperty(UserElementCellx.prototype, 'DecimalValue', { + // enumerable: true, + // configurable: true, + // get() { return this.backingFields._DecimalValue; }, + // set(value) { + // if (this.backingFields._DecimalValue !== value) { + // this.backingFields._DecimalValue = value; + // } + // } + // }); + + // // Return + // return UserElementCellx; + + // function UserElementCellx() { + + // var self = this; + + // // Server-side + // self.UserId = 0; + // self.ElementCellId = 0; + // self.StringValue = null; + // self.BooleanValue = null; + // self.IntegerValue = null; + // // + // self.DateTimeValue = null; + + // // Local variables + // self.backingFields = { + // _DecimalValue: null + // }; + // } + //} + + //// userElementCellFactory.$inject = ['logger']; + + //// angular.module('main').factory(factoryId, userElementCellFactory); +} \ No newline at end of file diff --git a/ngClient/_system/js/app/entities/UserElementField.js b/ngClient/_system/js/app/entities/UserElementField.js deleted file mode 100644 index dd4c901ea..000000000 --- a/ngClient/_system/js/app/entities/UserElementField.js +++ /dev/null @@ -1,26 +0,0 @@ -(function () { - 'use strict'; - - var factoryId = 'UserElementField'; - angular.module('main') - .factory(factoryId, ['logger', userElementFieldFactory]); - - function userElementFieldFactory(logger) { - - // Logger - logger = logger.forSource(factoryId); - - // Return - return UserElementField; - - function UserElementField() { - - var self = this; - - // Server-side - self.UserId = 0; - self.ElementFieldId = 0; - self.Rating = 0; - } - } -})(); \ No newline at end of file diff --git a/ngClient/_system/js/app/entities/UserElementField.ts b/ngClient/_system/js/app/entities/UserElementField.ts new file mode 100644 index 000000000..b5f6fbf4d --- /dev/null +++ b/ngClient/_system/js/app/entities/UserElementField.ts @@ -0,0 +1,36 @@ +module Main.Entities { + 'use strict'; + + export class UserElementField { + + // Server-side + UserId: number; + UserElementFieldId: number; + Rating: number; + } + + //var factoryId = 'UserElementField'; + + //function userElementFieldFactory(logger: any) { + + // // Logger + // logger = logger.forSource(factoryId); + + // // Return + // return UserElementFieldX; + + // function UserElementFieldX() { + + // var self = this; + + // // Server-side + // self.UserId = 0; + // self.ElementFieldId = 0; + // self.Rating = 0; + // } + //} + + //userElementFieldFactory.$inject = ['logger']; + + //angular.module('main').factory(factoryId, userElementFieldFactory); +} \ No newline at end of file diff --git a/ngClient/_system/js/app/entities/UserResourcePool.js b/ngClient/_system/js/app/entities/UserResourcePool.js deleted file mode 100644 index f8c834794..000000000 --- a/ngClient/_system/js/app/entities/UserResourcePool.js +++ /dev/null @@ -1,26 +0,0 @@ -(function () { - 'use strict'; - - var factoryId = 'UserResourcePool'; - angular.module('main') - .factory(factoryId, ['logger', userResourcePoolFactory]); - - function userResourcePoolFactory(logger) { - - // Logger - logger = logger.forSource(factoryId); - - // Return - return UserResourcePool; - - function UserResourcePool() { - - var self = this; - - // Server-side - self.UserId = 0; - self.ResourcePoolId = 0; - self.ResourcePoolRate = 0; - } - } -})(); \ No newline at end of file diff --git a/ngClient/_system/js/app/entities/UserResourcePool.ts b/ngClient/_system/js/app/entities/UserResourcePool.ts new file mode 100644 index 000000000..790945288 --- /dev/null +++ b/ngClient/_system/js/app/entities/UserResourcePool.ts @@ -0,0 +1,35 @@ +module Main.Entities { + 'use strict'; + + export class UserResourcePool { + + UserId: number; + ResourcePoolId: number; + ResourcePoolRate: number; + } + + //var factoryId = 'UserResourcePool'; + + //function userResourcePoolFactory(logger: any) { + + // // Logger + // logger = logger.forSource(factoryId); + + // // Return + // return UserResourcePoolX; + + // function UserResourcePoolX() { + + // var self = this; + + // // Server-side + // self.UserId = 0; + // self.ResourcePoolId = 0; + // self.ResourcePoolRate = 0; + // } + //} + + //userResourcePoolFactory.$inject = ['logger']; + + //angular.module('main').factory(factoryId, userResourcePoolFactory); +} \ No newline at end of file diff --git a/ngClient/_system/js/app/factories/applicationFactory.js b/ngClient/_system/js/app/factories/applicationFactory.js deleted file mode 100644 index 424ea8e77..000000000 --- a/ngClient/_system/js/app/factories/applicationFactory.js +++ /dev/null @@ -1,45 +0,0 @@ -(function () { - 'use strict'; - - var factoryId = 'applicationFactory'; - angular.module('main') - .factory(factoryId, ['logger', 'serviceAppUrl', '$http', '$q', applicationFactory]); - - function applicationFactory(logger, serviceAppUrl, $http, $q) { - logger = logger.forSource(factoryId); - - var applicationInfoUrl = serviceAppUrl + '/api/Application/ApplicationInfo'; - var applicationInfo = null; - - // Factory methods - var factory = { - getApplicationInfo: getApplicationInfo - }; - - return factory; - - /*** Implementations ***/ - - function getApplicationInfo() { - - var deferred = $q.defer(); - - if (applicationInfo !== null) { - deferred.resolve(applicationInfo); - } - else { - $http.get(applicationInfoUrl) - .success(function (data) { - applicationInfo = data; - deferred.resolve(applicationInfo); - }) - .error(function (data, status, headers, config) { - // TODO Check this approach? - Just return 'Something went wrong'? - deferred.reject({ data: data, status: status, headers: headers, config: config }); - }); - } - - return deferred.promise; - } - } -})(); diff --git a/ngClient/_system/ts/app/factories/applicationFactory.ts b/ngClient/_system/js/app/factories/applicationFactory.ts similarity index 80% rename from ngClient/_system/ts/app/factories/applicationFactory.ts rename to ngClient/_system/js/app/factories/applicationFactory.ts index 195475988..f93ba6577 100644 --- a/ngClient/_system/ts/app/factories/applicationFactory.ts +++ b/ngClient/_system/js/app/factories/applicationFactory.ts @@ -1,12 +1,9 @@ -module M41 { +module Main.Factories { 'use strict'; var factoryId = 'applicationFactory'; - angular.module('main') - .factory(factoryId, ['logger', 'serviceAppUrl', '$http', '$q', applicationFactory]); - function applicationFactory(logger: any, serviceAppUrl: any, $http: any, $q: any); - function applicationFactory(logger, serviceAppUrl, $http, $q) { + export function applicationFactory(logger: any, serviceAppUrl: any, $http: any, $q: any) { logger = logger.forSource(factoryId); var applicationInfoUrl = serviceAppUrl + '/api/Application/ApplicationInfo'; @@ -43,4 +40,8 @@ return deferred.promise; } } + + applicationFactory.$inject = ['logger', 'serviceAppUrl', '$http', '$q']; + + angular.module('main').factory(factoryId, applicationFactory); } \ No newline at end of file diff --git a/ngClient/_system/js/app/factories/dataContext.js b/ngClient/_system/js/app/factories/dataContext.js deleted file mode 100644 index 567dd4ba1..000000000 --- a/ngClient/_system/js/app/factories/dataContext.js +++ /dev/null @@ -1,765 +0,0 @@ -/*** - * Service: dataContext - * - * Handles all persistence and creation/deletion of app entities - * using BreezeJS. - * - ***/ -(function () { - 'use strict'; - - var factoryId = 'dataContext'; - angular.module('main') - .factory(factoryId, ['entityManagerFactory', 'logger', 'serviceAppUrl', '$http', '$q', '$rootScope', '$timeout', '$window', dataContext]); - - function dataContext(entityManagerFactory, logger, serviceAppUrl, $http, $q, $rootScope, $timeout, $window) { - - // Logger - logger = logger.forSource(factoryId); - - // Service urls - var addPasswordUrl = serviceAppUrl + '/api/Account/AddPassword'; - var changeEmailUrl = serviceAppUrl + '/api/Account/ChangeEmail'; - var changePasswordUrl = serviceAppUrl + '/api/Account/ChangePassword'; - var changeUserNameUrl = serviceAppUrl + '/api/Account/ChangeUserName'; - var confirmEmailUrl = serviceAppUrl + '/api/Account/ConfirmEmail'; - var registerUrl = serviceAppUrl + '/api/Account/Register'; - var registerAnonymousUrl = serviceAppUrl + '/api/Account/RegisterAnonymous'; - var resendConfirmationEmailUrl = serviceAppUrl + '/api/Account/ResendConfirmationEmail'; - var resetPasswordUrl = serviceAppUrl + '/api/Account/ResetPassword'; - var resetPasswordRequestUrl = serviceAppUrl + '/api/Account/ResetPasswordRequest'; - var tokenUrl = serviceAppUrl + '/api/Token'; - - var currentUser = null; - var fetchedUsers = []; - var initializeCurrentUserPromise = null; - var manager = null; - var metadataReadyPromise = null; - var saveTimer = null; - - // Factory methods - var factory = { - addPassword: addPassword, - changeEmail: changeEmail, - changePassword: changePassword, - changeUserName: changeUserName, - confirmEmail: confirmEmail, - createEntity: createEntity, - executeQuery: executeQuery, - fetchEntityByKey: fetchEntityByKey, - getChanges: getChanges, - getChangesCount: getChangesCount, - getCurrentUser: getCurrentUser, - getEntities: getEntities, - getEntityByKey: getEntityByKey, - getToken: getToken, - getUniqueEmail: getUniqueEmail, - getUniqueUserName: getUniqueUserName, - getUser: getUser, - hasChanges: hasChanges, - initializeCurrentUser: initializeCurrentUser, - login: login, - logout: logout, - metadataReady: metadataReady, - register: register, - registerAnonymous: registerAnonymous, - rejectChanges: rejectChanges, - resendConfirmationEmail: resendConfirmationEmail, - resetPassword: resetPassword, - resetPasswordRequest: resetPasswordRequest, - saveChanges: saveChanges - }; - - _init(); - - return factory; - - /*** Implementations ***/ - - function _init() { - manager = entityManagerFactory.newManager(); - } - - function addPassword(addPasswordBindingModel) { - return $http.post(addPasswordUrl, addPasswordBindingModel) - .success(function (updatedUser) { - - currentUser.HasPassword = null; - - // Sync RowVersion fields - syncRowVersion(currentUser, updatedUser); - - currentUser.entityAspect.acceptChanges(); - }) - .error(handleErrorResult); - } - - function changeEmail(changeEmailBindingModel) { - return $http.post(changeEmailUrl, changeEmailBindingModel) - .success(function (updatedUser) { - - currentUser.Email = updatedUser.Email; - currentUser.EmailConfirmed = false; - currentUser.IsAnonymous = false; - currentUser.UserName = updatedUser.UserName; - - // Sync RowVersion fields - syncRowVersion(currentUser, updatedUser); - - currentUser.entityAspect.acceptChanges(); - - $rootScope.$broadcast('dataContext_currentUserEmailAddressChanged'); - }) - .error(handleErrorResult); - } - - function changePassword(changePasswordBindingModel) { - return $http.post(changePasswordUrl, changePasswordBindingModel) - .success(function (updatedUser) { - - // Sync RowVersion fields - syncRowVersion(currentUser, updatedUser); - - currentUser.entityAspect.acceptChanges(); - }) - .error(handleErrorResult); - } - - function changeUserName(changeUserNameBindingModel) { - return $http.post(changeUserNameUrl, changeUserNameBindingModel) - .success(function (updatedUser) { - - currentUser.UserName = updatedUser.UserName; - - // Update token as well - var token = angular.fromJson($window.localStorage.getItem('token')); - token.userName = updatedUser.UserName; - $window.localStorage.setItem('token', angular.toJson(token)); - - // Sync RowVersion fields - syncRowVersion(currentUser, updatedUser); - - currentUser.entityAspect.acceptChanges(); - }) - .error(handleErrorResult); - } - - function confirmEmail(confirmEmailBindingModel) { - return $http.post(confirmEmailUrl, confirmEmailBindingModel) - .success(function (updatedUser) { - - currentUser.EmailConfirmed = true; - - // Sync RowVersion fields - syncRowVersion(currentUser, updatedUser); - - currentUser.entityAspect.acceptChanges(); - }) - .error(handleErrorResult); - } - - function createEntity(entityType, initialValues, entityState, mergeStrategy) { - return manager.createEntity(entityType, initialValues, entityState, mergeStrategy); - } - - function createGuestUser() { - var user = createEntity('User', { - Email: getUniqueEmail(), - UserName: getUniqueUserName(), - FirstName: '', - MiddleName: '', - LastName: '', - IsAnonymous: true - }); - user.entityAspect.acceptChanges(); - return user; - } - - function executeQuery(query) { - return manager.executeQuery(query); - } - - function fetchEntityByKey(typeName, keyValues, checkLocalCacheFirst) { - return manager.fetchEntityByKey(typeName, keyValues, checkLocalCacheFirst); - } - - function getChanges(entityTypeName, entityState) { - entityTypeName = typeof entityTypeName !== 'undefined' ? entityTypeName : null; - entityState = typeof entityState !== 'undefined' ? entityState : null; - - var all = manager.getChanges(); - var changes = []; - - // Filters - all.forEach(function (change) { - if ((entityTypeName === null || change.entityType.shortName === entityTypeName) && - (entityState === null || change.entityAspect.entityState === entityState)) { - changes.push(change); - } - }); - - return changes; - // return manager.getChanges(); - } - - function getChangesCount() { - return getChanges().length; - // return manager.getChanges().length; - } - - function getCurrentUser() { - return currentUser; - } - - function getEntities(entityTypes, entityStates) { - return manager.getEntities(entityTypes, entityStates); - } - - function getEntityByKey(entityType, entityKey) { - return manager.getEntityByKey(entityType, entityKey); - } - - function getToken(userName, password, rememberMe, singleUseToken) { - - var deferred = $q.defer(); - - var tokenData = 'grant_type=password' + - '&username=' + userName + - '&password=' + password + - '&rememberMe=' + rememberMe + - '&singleUseToken=' + singleUseToken; - - $http.post(tokenUrl, tokenData, { 'Content-Type': 'application/x-www-form-urlencoded' }) - .success(function (token) { - - // Set token to the session - $window.localStorage.setItem('token', angular.toJson(token)); - deferred.resolve(); - }) - .error(function (data, status, headers, config) { - handleErrorResult(data, status, headers, config); - deferred.reject(data); - }); - - return deferred.promise; - } - - function getUniqueEmail() { - return getUniqueUserName() + '@forcrowd.org'; - } - - function getUniqueUserName() { - - var now = new Date(); - var year = now.getFullYear().toString().substring(2); - var month = now.getMonth() + 1; - var day = now.getDate(); - var hour = now.getHours(); - var minute = now.getMinutes(); - var second = now.getSeconds(); - - return 'guest' + year + month + day + hour + minute + second; - } - - function getUser(userName) { - - // Already fetched, then query locally - var alreadyFetched = fetchedUsers.some(function (fetched) { - return userName === fetched; - }); - - var query = breeze.EntityQuery - .from('Users') - .expand('ResourcePoolSet') - .where('UserName', 'eq', userName); - - // From server or local? - if (alreadyFetched) { - query = query.using(breeze.FetchStrategy.FromLocalCache); - } else { - query = query.using(breeze.FetchStrategy.FromServer); - } - - return executeQuery(query) - .then(success) - .catch(failed); - - function success(response) { - - // If there is no result - if (response.results.length === 0) { - return null; - } - - var user = response.results[0]; - - // Add to fetched list - fetchedUsers.push(user.UserName); - - return user; - } - - function failed(error) { - var message = error.message || 'ResourcePool query failed'; - logger.logError(message, error, true); - } - } - - function handleErrorResult(data, status, headers, config) { - - // TODO Can this be done on a higher level? - var message = ''; - - if (typeof data.ModelState !== 'undefined') { - for (var key in data.ModelState) { - var array = data.ModelState[key]; - array.forEach(addErrorMessage); - } - } - - function addErrorMessage(error) { - message += error + '
'; - } - - if (message === '' && typeof data.Message !== 'undefined') { - message = data.Message; - } - - if (message === '' && typeof data.error_description !== 'undefined') { - message = data.error_description; - } - - logger.logError(message, null, true); - } - - function hasChanges() { - return getChanges().length > 0; - //return manager.hasChanges(); - } - - // Returns either unauthenticated or logged in user - function initializeCurrentUser(resetPromise) { - resetPromise = typeof resetPromise !== 'undefined' ? resetPromise : false; - - if (initializeCurrentUserPromise === null || resetPromise) { - - var deferred = $q.defer(); - initializeCurrentUserPromise = deferred.promise; - - if ($window.localStorage.getItem('token') === null) { - - metadataReady() - .then(function () { - currentUser = createGuestUser(); - $rootScope.$broadcast('dataContext_currentUserChanged', currentUser); - deferred.resolve(currentUser); - }) - .catch(function () { - // TODO Handle? - deferred.reject(); - }); - - } else { - - var token = angular.fromJson($window.localStorage.getItem('token')); - var userName = token.userName; - var query = breeze.EntityQuery - .from('Users') - .expand('ResourcePoolSet') - .where('UserName', 'eq', userName) - .using(breeze.FetchStrategy.FromServer); - - executeQuery(query) - .then(success) - .catch(failed); - } - } - - return initializeCurrentUserPromise; - - function success(response) { - - // If the response has an entity, use that, otherwise create an anonymous user - if (response.results.length > 0) { - currentUser = response.results[0]; - } else { - $window.localStorage.removeItem('token'); // TODO Invalid token, expired? - - if (currentUser === null) { - currentUser = createGuestUser(); - } - } - - $rootScope.$broadcast('dataContext_currentUserChanged', currentUser); - deferred.resolve(currentUser); - } - - function failed(error) { - var message = error.message || 'User query failed'; - // TODO Handle this case better! - deferred.reject(message); - throw new Error(message); - } - } - - function login(userName, password, rememberMe, singleUseToken) { - - return getToken(userName, password, rememberMe, singleUseToken) - .then(function () { - - // Clear breeze's metadata store etc. - manager.clear(); - fetchedUsers = []; - - return initializeCurrentUser(true); - }); - } - - function logout() { - - // Remove token from the session - $window.localStorage.removeItem('token'); - - // Clear breeze's metadata store - manager.clear(); - fetchedUsers = []; - - // Raise logged out event - return initializeCurrentUser(true); - } - - function metadataReady() { - - if (metadataReadyPromise === null) { - - var deferred = $q.defer(); - - metadataReadyPromise = deferred.promise; - - if (manager.metadataStore.isEmpty()) { - manager.fetchMetadata() - .then(function () { - deferred.resolve(); - }, - function (error) { - deferred.reject(error); - }); - } else { - deferred.resolve(); - } - } - - return metadataReadyPromise; - } - - function register(registerBindingModel, rememberMe) { - - var deferred = $q.defer(); - - $http.post(registerUrl, registerBindingModel, rememberMe) - .success(function (updatedUser) { - - // breeze context user entity fix-up! - // TODO Try to make this part better, use OData method? - currentUser.Id = updatedUser.Id; - currentUser.UserName = updatedUser.UserName; - currentUser.Email = updatedUser.Email; - currentUser.IsAnonymous = updatedUser.IsAnonymous; - currentUser.HasPassword = updatedUser.HasPassword; - currentUser.SingleUseToken = updatedUser.SingleUseToken; - - // Sync RowVersion fields - syncRowVersion(currentUser, updatedUser); - - currentUser.entityAspect.acceptChanges(); - - getToken(registerBindingModel.UserName, registerBindingModel.Password, rememberMe) - .then(function () { - - // Save the changes that's been done before the registration - saveChanges() - .then(function () { - deferred.resolve(); - }) - .catch(function () { - deferred.reject(); - }); - }) - .catch(function () { - deferred.reject(); - }); - }) - .error(function (data, status, headers, config) { - handleErrorResult(data, status, headers, config); - deferred.reject(data); - }); - - return deferred.promise; - } - - function registerAnonymous(registerAnonymousBindingModel, rememberMe) { - - var deferred = $q.defer(); - - $http.post(registerAnonymousUrl, registerAnonymousBindingModel) - .success(function (updatedUser) { - - // breeze context user entity fix-up! - // TODO Try to make this part better, use OData method? - currentUser.Id = updatedUser.Id; - currentUser.Email = updatedUser.Email; - currentUser.UserName = updatedUser.UserName; - currentUser.IsAnonymous = updatedUser.IsAnonymous; - currentUser.HasPassword = updatedUser.HasPassword; - currentUser.SingleUseToken = updatedUser.SingleUseToken; - - // Sync RowVersion fields - syncRowVersion(currentUser, updatedUser); - - currentUser.entityAspect.acceptChanges(); - - getToken('', '', rememberMe, updatedUser.SingleUseToken) - .then(function () { - - // Save the changes that's been done before the registration - saveChanges() - .then(function () { - deferred.resolve(); - }) - .catch(function () { - deferred.reject(); - }); - }) - .catch(function () { - deferred.reject(); - }); - }) - .error(function (data, status, headers, config) { - handleErrorResult(data, status, headers, config); - deferred.reject(data); - }); - - return deferred.promise; - } - - function rejectChanges() { - manager.rejectChanges(); - } - - function resendConfirmationEmail() { - return $http.post(resendConfirmationEmailUrl).error(handleErrorResult); - } - - function resetPassword(resetPasswordBindingModel) { - return $http.post(resetPasswordUrl, resetPasswordBindingModel) - .success(function (updatedUser) { - - // Sync RowVersion fields - syncRowVersion(currentUser, updatedUser); - - currentUser.entityAspect.acceptChanges(); - }) - .error(handleErrorResult); - } - - function resetPasswordRequest(resetPasswordRequestBindingModel) { - return $http.post(resetPasswordRequestUrl, resetPasswordRequestBindingModel).error(handleErrorResult); - } - - function ensureAuthenticatedUser() { - - var deferred = $q.defer(); - - if (currentUser.isAuthenticated()) { - deferred.resolve(); - - } else { - - var bindingModel = { - UserName: currentUser.UserName, - Email: currentUser.Email - }; - - registerAnonymous(bindingModel, true) - .then(function () { - $rootScope.$broadcast('guestAccountCreated'); - deferred.resolve(); - }) - .catch(function () { - deferred.reject(); - }); - } - - return deferred.promise; - } - - function saveChanges(delay) { - delay = typeof delay !== 'undefined' ? delay : 0; - - // Cancel existing timers (delay the save) - if (saveTimer !== null) { - $timeout.cancel(saveTimer); - } - - // Save immediately or wait based on delay - if (delay === 0) { - return saveChangesInternal(); - } else { - saveTimer = $timeout(function () { - saveChangesInternal(); - }, delay); - return saveTimer; - } - - // TODO Is it necessary to cancel the timer at the end of the service, like this ? - - //// When the DOM element is removed from the page, - //// AngularJS will trigger the $destroy event on - //// the scope. This gives us a chance to cancel any - //// pending timer that we may have. - //$scope.$on("$destroy", function (event) { - // $timeout.cancel(increaseMultiplierTimeoutInitial); - // $timeout.cancel(increaseMultiplierTimeoutRecursive); - //}); - } - - function saveChangesInternal() { - - return ensureAuthenticatedUser() - .then(function () { - - var promise = null; - var count = getChangesCount(); - var saveBatches = prepareSaveBatches(); - saveBatches.forEach(function (batch) { - - // ignore empty batches (except 'null' which means "save everything else") - if (batch === null || batch.length > 0) { - - // Broadcast, so UI can block - $rootScope.$broadcast('saveChangesStart'); - - promise = promise ? - promise.then(function () { return manager.saveChanges(batch); }) : - manager.saveChanges(batch); - } - }); - - // There is nothing to save? - if (promise === null) { - promise = $q.resolve(null); - } - - return promise.then(success).catch(failed).finally(completed); - - function success(result) { - logger.logSuccess('Saved ' + count + ' change(s)'); - return result; - } - - function failed(error, status, headers, config) { - - //console.log('error', error); - //for (var keyx in error) { - // console.log(keyx + ': ' + error[keyx]); - //} - - var errorMessage = ''; - - if (typeof error.status !== 'undefined' && error.status === '409') { - errorMessage = typeof error.body !== 'undefined' ? - 'Save failed!
' + error.body : - 'Save failed!
The record you attempted to edit was modified by another user after you got the original value. The edit operation was canceled.'; - - logger.logError(errorMessage, error, true); - } else if (typeof error.entityErrors !== 'undefined') { - - errorMessage = 'Save failed!
'; - - for (var key in error.entityErrors) { - var entityError = error.entityErrors[key]; - errorMessage += entityError.errorMessage + '
'; - } - - logger.logError(errorMessage, null, true); - - } else { - logger.logError('Save failed!', error, true); - } - - return $q.reject(error); // pass error along to next handler - } - - function completed() { - - // Broadcast, so UI can unblock - $rootScope.$broadcast('saveChangesCompleted'); - } - - function prepareSaveBatches() { - - var batches = []; - - // RowVersion fix - // TODO How about Deleted state? - var modifiedEntities = getChanges(null, breeze.EntityState.Modified); - modifiedEntities.forEach(function (entity) { - var rowVersion = entity.RowVersion; - entity.RowVersion = ''; - entity.RowVersion = rowVersion; - }); - batches.push(modifiedEntities); - - /* Aaargh! - * Web API OData doesn't calculate the proper save order - * which means, if we aren't careful on the client, - * we could save a new TodoItem before we saved its parent new TodoList - * or delete the parent TodoList before saving its deleted child TodoItems. - * OData says it is up to the client to save entities in the order - * required by referential constraints of the database. - * While we could save each time you make a change, that sucks. - * So we'll divvy up the pending changes into 4 batches - * 1. Deleted Todos - * 2. Deleted TodoLists - * 3. Added TodoLists - * 4. Every other change - */ - - batches.push(getChanges('UserElementCell', breeze.EntityState.Deleted)); - batches.push(getChanges('ElementCell', breeze.EntityState.Deleted)); - batches.push(getChanges('ElementItem', breeze.EntityState.Deleted)); - batches.push(getChanges('UserElementField', breeze.EntityState.Deleted)); - batches.push(getChanges('ElementField', breeze.EntityState.Deleted)); - batches.push(getChanges('Element', breeze.EntityState.Deleted)); - batches.push(getChanges('UserResourcePool', breeze.EntityState.Deleted)); - batches.push(getChanges('ResourcePool', breeze.EntityState.Deleted)); - - batches.push(getChanges('ResourcePool', breeze.EntityState.Added)); - batches.push(getChanges('UserResourcePool', breeze.EntityState.Added)); - batches.push(getChanges('Element', breeze.EntityState.Added)); - batches.push(getChanges('ElementField', breeze.EntityState.Added)); - batches.push(getChanges('UserElementField', breeze.EntityState.Added)); - batches.push(getChanges('ElementItem', breeze.EntityState.Added)); - batches.push(getChanges('ElementCell', breeze.EntityState.Added)); - batches.push(getChanges('UserElementCell', breeze.EntityState.Added)); - - // batches.push(null); // empty = save all remaining pending changes - - return batches; - /* - * No we can't flatten into one request because Web API OData reorders - * arbitrarily, causing the database failure we're trying to avoid. - */ - } - }); - } - - // When an entity gets updated through angular, unlike breeze updates, it doesn't sync RowVersion automatically - // After each update, call this function to sync the entities RowVersion with the server's. Otherwise it'll get Conflict error - // coni2k - 05 Jan. '16 - function syncRowVersion(oldEntity, newEntity) { - // TODO Validations? - oldEntity.RowVersion = newEntity.RowVersion; - } - } -})(); diff --git a/ngClient/_system/ts/app/factories/dataContext.ts b/ngClient/_system/js/app/factories/dataContext.ts similarity index 91% rename from ngClient/_system/ts/app/factories/dataContext.ts rename to ngClient/_system/js/app/factories/dataContext.ts index 6d2569368..a07b78e1c 100644 --- a/ngClient/_system/ts/app/factories/dataContext.ts +++ b/ngClient/_system/js/app/factories/dataContext.ts @@ -5,22 +5,19 @@ * using BreezeJS. * ***/ -module M42 { +module Main.Factories { 'use strict'; var factoryId = 'dataContext'; - angular.module('main') - .factory(factoryId, ['entityManagerFactory', 'logger', 'serviceAppUrl', '$http', '$q', '$rootScope', '$timeout', '$window', dataContext]); - function dataContext(entityManagerFactory: any, + export function dataContext(entityManagerFactory: any, logger: any, serviceAppUrl: any, $http: any, $q: any, $rootScope: any, $timeout: any, - $window: any); - function dataContext(entityManagerFactory, logger, serviceAppUrl, $http, $q, $rootScope, $timeout, $window) { + $window: any) { // Logger logger = logger.forSource(factoryId); @@ -88,8 +85,7 @@ module M42 { manager = entityManagerFactory.newManager(); } - function addPassword(addPasswordBindingModel: any); - function addPassword(addPasswordBindingModel) { + function addPassword(addPasswordBindingModel: any) { return $http.post(addPasswordUrl, addPasswordBindingModel) .success(updatedUser => { @@ -103,8 +99,7 @@ module M42 { .error(handleErrorResult); } - function changeEmail(changeEmailBindingModel: any); - function changeEmail(changeEmailBindingModel) { + function changeEmail(changeEmailBindingModel: any) { return $http.post(changeEmailUrl, changeEmailBindingModel) .success(updatedUser => { @@ -123,8 +118,7 @@ module M42 { .error(handleErrorResult); } - function changePassword(changePasswordBindingModel: any); - function changePassword(changePasswordBindingModel) { + function changePassword(changePasswordBindingModel: any) { return $http.post(changePasswordUrl, changePasswordBindingModel) .success(updatedUser => { @@ -136,8 +130,7 @@ module M42 { .error(handleErrorResult); } - function changeUserName(changeUserNameBindingModel: any); - function changeUserName(changeUserNameBindingModel) { + function changeUserName(changeUserNameBindingModel: any) { return $http.post(changeUserNameUrl, changeUserNameBindingModel) .success(updatedUser => { @@ -156,8 +149,7 @@ module M42 { .error(handleErrorResult); } - function confirmEmail(confirmEmailBindingModel: any); - function confirmEmail(confirmEmailBindingModel) { + function confirmEmail(confirmEmailBindingModel: any) { return $http.post(confirmEmailUrl, confirmEmailBindingModel) .success(updatedUser => { @@ -188,13 +180,11 @@ module M42 { return user; } - function executeQuery(query: any); - function executeQuery(query) { + function executeQuery(query: any) { return manager.executeQuery(query); } - function fetchEntityByKey(typeName: any, keyValues: any, checkLocalCacheFirst: any); - function fetchEntityByKey(typeName, keyValues, checkLocalCacheFirst) { + function fetchEntityByKey(typeName: any, keyValues: any, checkLocalCacheFirst: any) { return manager.fetchEntityByKey(typeName, keyValues, checkLocalCacheFirst); } @@ -226,13 +216,11 @@ module M42 { return currentUser; } - function getEntities(entityTypes: any, entityStates: any); - function getEntities(entityTypes, entityStates) { + function getEntities(entityTypes: any, entityStates: any) { return manager.getEntities(entityTypes, entityStates); } - function getEntityByKey(entityType: any, entityKey: any); - function getEntityByKey(entityType, entityKey) { + function getEntityByKey(entityType: any, entityKey: any) { return manager.getEntityByKey(entityType, entityKey); } @@ -278,8 +266,7 @@ module M42 { return 'guest' + year + month + day + hour + minute + second; } - function getUser(userName: any); - function getUser(userName) { + function getUser(userName: any) { // Already fetched, then query locally var alreadyFetched = fetchedUsers.some(fetched => (userName === fetched)); @@ -323,8 +310,7 @@ module M42 { } } - function handleErrorResult(data: any, status: any, headers: any, config: any); - function handleErrorResult(data, status, headers, config) { + function handleErrorResult(data: any, status: any, headers: any, config: any) { // TODO Can this be done on a higher level? var message = ''; @@ -336,8 +322,7 @@ module M42 { } } - function addErrorMessage(error: any); - function addErrorMessage(error) { + function addErrorMessage(error: any) { message += error + '
'; } @@ -358,8 +343,7 @@ module M42 { } // Returns either unauthenticated or logged in user - function initializeCurrentUser(resetPromise: any); - function initializeCurrentUser(resetPromise) { + function initializeCurrentUser(resetPromise: any) { resetPromise = typeof resetPromise !== 'undefined' ? resetPromise : false; if (initializeCurrentUserPromise === null || resetPromise) { @@ -398,8 +382,7 @@ module M42 { return initializeCurrentUserPromise; - function success(response: any); - function success(response) { + function success(response: any) { // If the response has an entity, use that, otherwise create an anonymous user if (response.results.length > 0) { @@ -416,8 +399,7 @@ module M42 { deferred.resolve(currentUser); } - function failed(error: any); - function failed(error) { + function failed(error: any) { var message = error.message || 'User query failed'; // TODO Handle this case better! deferred.reject(message); @@ -425,8 +407,7 @@ module M42 { } } - function login(userName: any, password: any, rememberMe: any, singleUseToken: any); - function login(userName, password, rememberMe, singleUseToken) { + function login(userName: any, password: any, rememberMe: any, singleUseToken: any) { return getToken(userName, password, rememberMe, singleUseToken) .then(() => { @@ -476,8 +457,7 @@ module M42 { return metadataReadyPromise; } - function register(registerBindingModel: any, rememberMe: any); - function register(registerBindingModel, rememberMe) { + function register(registerBindingModel: any, rememberMe: any) { var deferred = $q.defer(); @@ -522,8 +502,7 @@ module M42 { return deferred.promise; } - function registerAnonymous(registerAnonymousBindingModel: any, rememberMe: any); - function registerAnonymous(registerAnonymousBindingModel, rememberMe) { + function registerAnonymous(registerAnonymousBindingModel: any, rememberMe: any) { var deferred = $q.defer(); @@ -576,8 +555,7 @@ module M42 { return $http.post(resendConfirmationEmailUrl).error(handleErrorResult); } - function resetPassword(resetPasswordBindingModel: any); - function resetPassword(resetPasswordBindingModel) { + function resetPassword(resetPasswordBindingModel: any) { return $http.post(resetPasswordUrl, resetPasswordBindingModel) .success(updatedUser => { @@ -589,8 +567,7 @@ module M42 { .error(handleErrorResult); } - function resetPasswordRequest(resetPasswordRequestBindingModel: any); - function resetPasswordRequest(resetPasswordRequestBindingModel) { + function resetPasswordRequest(resetPasswordRequestBindingModel: any) { return $http.post(resetPasswordRequestUrl, resetPasswordRequestBindingModel).error(handleErrorResult); } @@ -680,14 +657,12 @@ module M42 { return promise.then(success).catch(failed).finally(completed); - function success(result: any); - function success(result) { + function success(result: any) { logger.logSuccess('Saved ' + count + ' change(s)'); return result; } - function failed(error: any, status: any, headers: any, config: any); - function failed(error, status, headers, config) { + function failed(error: any, status: any, headers: any, config: any) { //console.log('error', error); //for (var keyx in error) { @@ -787,10 +762,13 @@ module M42 { // When an entity gets updated through angular, unlike breeze updates, it doesn't sync RowVersion automatically // After each update, call this function to sync the entities RowVersion with the server's. Otherwise it'll get Conflict error // coni2k - 05 Jan. '16 - function syncRowVersion(oldEntity: any, newEntity: any); - function syncRowVersion(oldEntity, newEntity) { + function syncRowVersion(oldEntity: any, newEntity: any) { // TODO Validations? oldEntity.RowVersion = newEntity.RowVersion; } } + + dataContext.$inject = ['entityManagerFactory', 'logger', 'serviceAppUrl', '$http', '$q', '$rootScope', '$timeout', '$window']; + + angular.module('main').factory(factoryId, dataContext); } \ No newline at end of file diff --git a/ngClient/_system/js/app/factories/entityManagerFactory.js b/ngClient/_system/js/app/factories/entityManagerFactory.ts similarity index 52% rename from ngClient/_system/js/app/factories/entityManagerFactory.js rename to ngClient/_system/js/app/factories/entityManagerFactory.ts index 6691ce24d..49edc8d2d 100644 --- a/ngClient/_system/js/app/factories/entityManagerFactory.js +++ b/ngClient/_system/js/app/factories/entityManagerFactory.ts @@ -5,39 +5,19 @@ * BreezeJS EntityManager for use in a 'dataContext' service * ***/ -(function () { +module Main.Factories { 'use strict'; var factoryId = 'entityManagerFactory'; - angular.module('main') - .factory(factoryId, ['breeze', - 'Element', - 'ElementCell', - 'ElementField', - 'ElementItem', - 'logger', - 'ResourcePool', - 'serviceAppUrl', - 'User', - 'UserElementCell', - 'UserElementField', - 'UserResourcePool', - '$rootScope', - entityManagerFactory]); - function entityManagerFactory(breeze, - Element, - ElementCell, - ElementField, - ElementItem, - logger, - ResourcePool, - serviceAppUrl, - User, - UserElementCell, - UserElementField, - UserResourcePool, - $rootScope) { + export function entityManagerFactory(breeze: any, + Element: any, + ElementCell: any, + ElementField: any, + ElementItem: any, + logger: any, + ResourcePool: any, + serviceAppUrl: any) { // Logger logger = logger.forSource(factoryId); @@ -61,12 +41,24 @@ store.registerEntityTypeCtor('ElementField', ElementField); store.registerEntityTypeCtor('ElementItem', ElementItem); store.registerEntityTypeCtor('ResourcePool', ResourcePool); - store.registerEntityTypeCtor('User', User); - store.registerEntityTypeCtor('UserElementCell', UserElementCell); - store.registerEntityTypeCtor('UserElementField', UserElementField); - store.registerEntityTypeCtor('UserResourcePool', UserResourcePool); + + store.registerEntityTypeCtor('User', Entities.User); + store.registerEntityTypeCtor('UserElementCell', Entities.UserElementCell); + store.registerEntityTypeCtor('UserElementField', Entities.UserElementField); + store.registerEntityTypeCtor('UserResourcePool', Entities.UserResourcePool); return manager; } } -})(); \ No newline at end of file + + entityManagerFactory.$inject = ['breeze', + 'Element', + 'ElementCell', + 'ElementField', + 'ElementItem', + 'logger', + 'ResourcePool', + 'serviceAppUrl']; + + angular.module('main').factory(factoryId, entityManagerFactory); +} \ No newline at end of file diff --git a/ngClient/_system/js/app/factories/locationHistory.js b/ngClient/_system/js/app/factories/locationHistory.ts similarity index 64% rename from ngClient/_system/js/app/factories/locationHistory.js rename to ngClient/_system/js/app/factories/locationHistory.ts index e1ade0da6..e560f4f36 100644 --- a/ngClient/_system/js/app/factories/locationHistory.js +++ b/ngClient/_system/js/app/factories/locationHistory.ts @@ -1,11 +1,11 @@ -(function () { +module Main.Factories { 'use strict'; var factoryId = 'locationHistory'; - angular.module('main') - .factory(factoryId, ['logger', locationHistory]); - function locationHistory(logger) { + angular.module('main').factory(factoryId, ['logger', locationHistory]); + + export function locationHistory(logger: any) { // Logger logger = logger.forSource(factoryId); @@ -26,7 +26,7 @@ /*** Implementations ***/ - function createItem($location, $routeCurrent) { + function createItem($location: any, $routeCurrent: any) { var itemUrl = $location.url(); var accessType = $routeCurrent.accessType; @@ -47,20 +47,23 @@ for (var i = self.history.length - 2; i >= 0; i--) { return self.history[i]; } + + return null; } + } - function LocationItem(itemUrl, accessType) { - itemUrl = typeof itemUrl !== 'undefined' ? itemUrl : ''; - accessType = typeof accessType !== 'undefined' ? accessType : 'undefined'; + class LocationItem { - var self = this; - self.itemUrl = itemUrl; - self.accessType = accessType; - self.url = url; + itemUrl: string; + accessType: any; - function url() { - return self.itemUrl; - } + constructor(itemUrl: any, accessType?: any) { + this.itemUrl = typeof itemUrl !== 'undefined' ? itemUrl : ''; + this.accessType = typeof accessType !== 'undefined' ? accessType : 'undefined'; + } + + url() { + return this.itemUrl; } } -})(); \ No newline at end of file +} \ No newline at end of file diff --git a/ngClient/_system/js/app/factories/logger.js b/ngClient/_system/js/app/factories/logger.js deleted file mode 100644 index 2214cf18e..000000000 --- a/ngClient/_system/js/app/factories/logger.js +++ /dev/null @@ -1,93 +0,0 @@ -/*** - * Service: logger - * - * Provides semantic logging services with help of - * Angular's $log service that writes to the console and - * John Papa's 'toastr.js': https://github.com/CodeSeven/toastr - * - ***/ -(function () { - 'use strict'; - - angular.module('main') - .factory('logger', ['$log', logger]); - - function logger($log) { - configureToastr(); - - var factory = { - forSource: forSource, - log: log, - logError: logError, - logInfo: logInfo, - logSuccess: logSuccess, - logWarning: logWarning - }; - - return factory; - - function configureToastr() { - toastr.options = { - "positionClass": "toast-bottom-right" - }; - } - - function forSource(src) { - return { - log: function (m, d, s, t, o) { return log(m, d, src, s, t, o); }, - logError: function (m, d, s, t, o) { return logError(m, d, src, s, t, o); }, - logInfo: function (m, d, s, t, o) { return logInfo(m, d, src, s, t, o); }, - logSuccess: function (m, d, s, t, o) { return logSuccess(m, d, src, s, t, o); }, - logWarning: function (m, d, s, t, o) { return logWarning(m, d, src, s, t, o); }, - }; - } - - function log(message, data, source, showToast, title, optionsOverride) { - return logIt(message, data, source, showToast, title, optionsOverride, 'debug'); - } - - function logError(message, data, source, showToast, title, optionsOverride) { - return logIt(message, data, source, showToast, title, optionsOverride, 'error'); - } - - function logInfo(message, data, source, showToast, title, optionsOverride) { - return logIt(message, data, source, showToast, title, optionsOverride, 'info'); - } - - function logSuccess(message, data, source, showToast, title, optionsOverride) { - return logIt(message, data, source, showToast, title, optionsOverride, 'success'); - } - - function logWarning(message, data, source, showToast, title, optionsOverride) { - return logIt(message, data, source, showToast, title, optionsOverride, 'warning'); - } - - function logIt(message, data, source, showToast, title, optionsOverride, toastType) { - showToast = typeof showToast === 'undefined' ? false : showToast; - var currentDateTime = new Date().getHours() + ':' + - new Date().getMinutes() + ':' + - new Date().getSeconds(); - source = source ? '[' + source + '] ' : ''; - var write; - switch (toastType) { - case 'debug': write = $log.debug; break; - case 'error': write = $log.error; break; - case 'info': write = $log.info; break; - case 'success': write = $log.log; break; - case 'warning': write = $log.warn; break; - } - write(currentDateTime, source, message, data); - var toast = null; - if (showToast) { - switch (toastType) { - case 'debug': toast = toastr.info(message, title, optionsOverride); break; - case 'error': toast = toastr.error(message, title, optionsOverride); break; - case 'info': toast = toastr.info(message, title, optionsOverride); break; - case 'success': toast = toastr.success(message, title, optionsOverride); break; - case 'warning': toast = toastr.warning(message, title, optionsOverride); break; - } - } - return toast; - } - } -})(); \ No newline at end of file diff --git a/ngClient/_system/ts/app/factories/logger.ts b/ngClient/_system/js/app/factories/logger.ts similarity index 73% rename from ngClient/_system/ts/app/factories/logger.ts rename to ngClient/_system/js/app/factories/logger.ts index 040b54738..2e08579e2 100644 --- a/ngClient/_system/ts/app/factories/logger.ts +++ b/ngClient/_system/js/app/factories/logger.ts @@ -6,14 +6,12 @@ * John Papa's 'toastr.js': https://github.com/CodeSeven/toastr * ***/ -module M45 { +module Main.Factories { 'use strict'; - angular.module('main') - .factory('logger', ['$log', logger]); + angular.module('main').factory('logger', ['$log', logger]); - function logger($log: any); - function logger($log) { + function logger($log: any) { configureToastr(); var factory = { @@ -33,8 +31,7 @@ module M45 { }; } - function forSource(src: any); - function forSource(src) { + function forSource(src: any) { return { log(m, d, s, t, o) { return log(m, d, src, s, t, o); }, logError(m, d, s, t, o) { return logError(m, d, src, s, t, o); }, @@ -44,39 +41,27 @@ module M45 { }; } - function log(message: any, data: any, source: any, showToast: any, title: any, optionsOverride: any); - function log(message, data, source, showToast, title, optionsOverride) { + function log(message: any, data: any, source: any, showToast: any, title: any, optionsOverride: any) { return logIt(message, data, source, showToast, title, optionsOverride, 'debug'); } - function logError(message: any, data: any, source: any, showToast: any, title: any, optionsOverride: any); - function logError(message, data, source, showToast, title, optionsOverride) { + function logError(message: any, data: any, source: any, showToast: any, title: any, optionsOverride: any) { return logIt(message, data, source, showToast, title, optionsOverride, 'error'); } - function logInfo(message: any, data: any, source: any, showToast: any, title: any, optionsOverride: any); - function logInfo(message, data, source, showToast, title, optionsOverride) { + function logInfo(message: any, data: any, source: any, showToast: any, title: any, optionsOverride: any) { return logIt(message, data, source, showToast, title, optionsOverride, 'info'); } - function logSuccess(message: any, data: any, source: any, showToast: any, title: any, optionsOverride: any); - function logSuccess(message, data, source, showToast, title, optionsOverride) { + function logSuccess(message: any, data: any, source: any, showToast: any, title: any, optionsOverride: any) { return logIt(message, data, source, showToast, title, optionsOverride, 'success'); } - function logWarning(message: any, data: any, source: any, showToast: any, title: any, optionsOverride: any); - function logWarning(message, data, source, showToast, title, optionsOverride) { + function logWarning(message: any, data: any, source: any, showToast: any, title: any, optionsOverride: any) { return logIt(message, data, source, showToast, title, optionsOverride, 'warning'); } - function logIt(message: any, - data: any, - source: any, - showToast: any, - title: any, - optionsOverride: any, - toastType: any); - function logIt(message, data, source, showToast, title, optionsOverride, toastType) { + function logIt(message: any, data: any, source: any, showToast: any, title: any, optionsOverride: any, toastType: any) { showToast = typeof showToast === 'undefined' ? false : showToast; var currentDateTime = new Date().getHours() + ':' + new Date().getMinutes() + ':' + diff --git a/ngClient/_system/js/app/factories/resourcePoolFactory.js b/ngClient/_system/js/app/factories/resourcePoolFactory.js deleted file mode 100644 index 4e833db91..000000000 --- a/ngClient/_system/js/app/factories/resourcePoolFactory.js +++ /dev/null @@ -1,805 +0,0 @@ -(function () { - 'use strict'; - - var factoryId = 'resourcePoolFactory'; - angular.module('main') - .factory(factoryId, ['dataContext', 'Element', 'logger', 'ResourcePool', '$rootScope', resourcePoolFactory]); - - function resourcePoolFactory(dataContext, Element, logger, ResourcePool, $rootScope) { - - // Logger - logger = logger.forSource(factoryId); - - // Factory methods (alphabetically) - var factory = { - copyResourcePool: copyResourcePool, - createElement: createElement, - createElementField: createElementField, - createElementItem: createElementItem, - createResourcePoolBasic: createResourcePoolBasic, - createResourcePoolDirectIncomeAndMultiplier: createResourcePoolDirectIncomeAndMultiplier, - createResourcePoolTwoElements: createResourcePoolTwoElements, - getResourcePoolExpanded: getResourcePoolExpanded, - getResourcePoolSet: getResourcePoolSet, - removeElement: removeElement, - removeElementField: removeElementField, - removeElementItem: removeElementItem, - removeResourcePool: removeResourcePool, - removeUserElementField: removeUserElementField, - updateElementMultiplier: updateElementMultiplier, - updateElementCellMultiplier: updateElementCellMultiplier, - updateElementCellDecimalValue: updateElementCellDecimalValue, - updateElementFieldIndexRating: updateElementFieldIndexRating, - updateResourcePoolRate: updateResourcePoolRate - }; - var fetchedList = []; - var fetchFromServer = true; - - // Events - $rootScope.$on('dataContext_currentUserChanged', function () { - fetchedList = []; - fetchFromServer = true; - }); - $rootScope.$on('ElementField_DataTypeChanged', elementField_DataTypeChanged); - $rootScope.$on('ElementField_IndexEnabledChanged', elementField_IndexEnabledChanged); - - return factory; - - /*** Implementations ***/ - - function copyResourcePool(resourcePoolSource) { - // TODO - } - - function createElement(element) { - return dataContext.createEntity('Element', element); - } - - function createElementCell(elementCellInitial) { - - var elementCell = dataContext.createEntity('ElementCell', elementCellInitial); - - // User element cell - if (elementCell.ElementField.DataType !== 6) { - createUserElementCell(elementCell, null, false); - } - - return elementCell; - } - - function createElementField(elementField) { - - elementField = dataContext.createEntity('ElementField', elementField); - - // Related user element field, if IndexEnabled - if (elementField.IndexEnabled) { - createUserElementField(elementField); - } - - // Related cells - elementField.Element.ElementItemSet.forEach(function (elementItem) { - createElementCell({ - ElementField: elementField, - ElementItem: elementItem - }); - }); - - return elementField; - } - - function createElementItem(elementItem) { - - elementItem = dataContext.createEntity('ElementItem', elementItem); - - // Related cells - elementItem.Element.ElementFieldSet.forEach(function (elementField) { - createElementCell({ - ElementField: elementField, - ElementItem: elementItem - }); - }); - - return elementItem; - } - - function createResourcePoolBasic(initializeResourcePool) { - initializeResourcePool = typeof initializeResourcePool !== 'undefined' ? initializeResourcePool : false; - - var currentUser = dataContext.getCurrentUser(); - var resourcePoolRate = 10; - - var resourcePool = dataContext.createEntity('ResourcePool', { - User: currentUser, - Name: 'New CMRP', - Key: 'New-CMRP', - Description: 'Description for CMRP', - InitialValue: 100, - UseFixedResourcePoolRate: true - }); - - createUserResourcePool(resourcePool); - - var element = createElement({ - ResourcePool: resourcePool, - Name: 'New element' - }); - element.IsMainElement = true; - - // Importance field (index) - createElementField({ - Element: element, - Name: 'Importance', - DataType: 4, - UseFixedValue: false, - IndexEnabled: true, - IndexCalculationType: 2, - IndexSortType: 1, - SortOrder: 1 - }); - - // Item 1 - createElementItem({ - Element: element, - Name: 'New item 1' - }); - - // Item 2 - createElementItem({ - Element: element, - Name: 'New item 2' - }); - - // Initialize - if (initializeResourcePool) { - resourcePool._init(true); - } - - return resourcePool; - } - - function createResourcePoolDirectIncomeAndMultiplier(initializeResourcePool) { - initializeResourcePool = typeof initializeResourcePool !== 'undefined' ? initializeResourcePool : false; - - var resourcePool = createResourcePoolBasic(); - - // Convert Importance field to Sales Price field - var salesPriceField = resourcePool.mainElement().ElementFieldSet[0]; - salesPriceField.Name = 'Sales Price'; - salesPriceField.DataType = 11; - salesPriceField.UseFixedValue = true; - salesPriceField.IndexEnabled = false; - salesPriceField.IndexCalculationType = 0; - salesPriceField.IndexSortType = 0; - - // Number of Sales field - var numberOfSalesField = createElementField({ - Element: resourcePool.mainElement(), - Name: 'Number of Sales', - DataType: 12, - UseFixedValue: false, - SortOrder: 2 - }); - - if (initializeResourcePool) { - resourcePool._init(true); - } - - return resourcePool; - } - - function createResourcePoolTwoElements(initializeResourcePool) { - initializeResourcePool = typeof initializeResourcePool !== 'undefined' ? initializeResourcePool : false; - - var resourcePool = createResourcePoolBasic(); - - // Element 2 & items - var element2 = resourcePool.ElementSet[0]; - element2.Name = 'Child'; - - var element2Item1 = element2.ElementItemSet[0]; - var element2Item2 = element2.ElementItemSet[1]; - - // Element 1 - var element1 = createElement({ - ResourcePool: resourcePool, - Name: 'Parent' - }); - element1.IsMainElement = true; - - // Child field (second element) - createElementField({ - Element: element1, - Name: 'Child', - DataType: 6, - SelectedElement: element2, - UseFixedValue: true, - SortOrder: 1 - }); - - // Item 1 - var item1 = createElementItem({ - Element: element1, - Name: 'Parent 1' - }); - - // Item 1 Cell - item1.ElementCellSet[0].SelectedElementItem = element2Item1; - - // Item 2 - var item2 = createElementItem({ - Element: element1, - Name: 'Parent 2' - }); - - // Item 2 Cell - item2.ElementCellSet[0].SelectedElementItem = element2Item2; - - if (initializeResourcePool) { - resourcePool._init(true); - } - - return resourcePool; - } - - function createUserElementCell(elementCell, value, updateCache) { - updateCache = typeof updateCache !== 'undefined' ? updateCache : true; - - var currentUser = dataContext.getCurrentUser(); - - // Search for an existing entity: deleted but not synced with remote entities are still in metadataStore - var existingKey = [currentUser.Id, elementCell.Id]; - var userElementCell = dataContext.getEntityByKey('UserElementCell', existingKey); - - if (typeof userElementCell !== 'undefined' && userElementCell !== null) { - - // If it's deleted, restore it - if (userElementCell.entityAspect.entityState.isDeleted()) { - userElementCell.entityAspect.rejectChanges(); - } - - switch (elementCell.ElementField.DataType) { - case 1: { userElementCell.StringValue = value !== null ? value : ''; break; } - case 2: { userElementCell.BooleanValue = value !== null ? value : false; break; } - case 3: { userElementCell.IntegerValue = value !== null ? value : 0; break; } - case 4: { userElementCell.DecimalValue = value !== null ? value : 50; break; } - case 6: { break; } - case 11: { userElementCell.DecimalValue = value !== null ? value : 100; break; } - case 12: { userElementCell.DecimalValue = value !== null ? value : 0; break; } - } - - } else { - - userElementCell = { - User: currentUser, - ElementCell: elementCell - }; - - switch (elementCell.ElementField.DataType) { - case 1: { userElementCell.StringValue = value !== null ? value : ''; break; } - case 2: { userElementCell.BooleanValue = value !== null ? value : false; break; } - case 3: { userElementCell.IntegerValue = value !== null ? value : 0; break; } - case 4: { userElementCell.DecimalValue = value !== null ? value : 50; break; } - case 6: { break; } - case 11: { userElementCell.DecimalValue = value !== null ? value : 100; break; } - case 12: { userElementCell.DecimalValue = value !== null ? value : 0; break; } - } - - userElementCell = dataContext.createEntity('UserElementCell', userElementCell); - } - - // Update the cache - if (updateCache) { - elementCell.setCurrentUserNumericValue(); - } - - return userElementCell; - } - - function createUserElementField(elementField, rating) { - rating = typeof rating !== 'undefined' ? rating : 50; - - var currentUser = dataContext.getCurrentUser(); - - // Search for an existing entity: deleted but not synced with remote entities are still in metadataStore - var existingKey = [currentUser.Id, elementField.Id]; - var userElementField = dataContext.getEntityByKey('UserElementField', existingKey); - - if (typeof userElementField !== 'undefined' && userElementField !== null) { - - // If it's deleted, restore it - if (userElementField.entityAspect.entityState.isDeleted()) { - userElementField.entityAspect.rejectChanges(); - } - - userElementField.Rating = rating; - - } else { - - userElementField = { - User: currentUser, - ElementField: elementField, - Rating: rating - }; - - userElementField = dataContext.createEntity('UserElementField', userElementField); - } - - // Update the cache - elementField.setCurrentUserIndexRating(); - - return userElementField; - } - - function createUserResourcePool(resourcePool, resourcePoolRate) { - resourcePoolRate = typeof resourcePoolRate !== 'undefined' ? resourcePoolRate : 10; - - var currentUser = dataContext.getCurrentUser(); - - // Search for an existing entity: deleted but not synced with remote entities are still in metadataStore - var existingKey = [currentUser.Id, resourcePool.Id]; - var userResourcePool = dataContext.getEntityByKey('UserResourcePool', existingKey); - - if (typeof userResourcePool !== 'undefined' && userResourcePool !== null) { - - // If it's deleted, restore it - if (userResourcePool.entityAspect.entityState.isDeleted()) { - userResourcePool.entityAspect.rejectChanges(); - } - - userResourcePool.ResourcePoolRate = resourcePoolRate; - - } else { - - userResourcePool = { - User: currentUser, - ResourcePool: resourcePool, - ResourcePoolRate: resourcePoolRate - }; - - userResourcePool = dataContext.createEntity('UserResourcePool', userResourcePool); - } - - // Update the cache - resourcePool.setCurrentUserResourcePoolRate(); - - return userResourcePool; - } - - function elementField_DataTypeChanged(event, elementField) { - - // Related element cells: Clear old values and set default values if necessary - elementField.ElementCellSet.forEach(function (elementCell) { - - elementCell.SelectedElementItemId = null; - - removeUserElementCell(elementCell, false); - - if (elementCell.ElementField.DataType !== 6) { - createUserElementCell(elementCell, null, false); - } - }); - } - - function elementField_IndexEnabledChanged(event, elementField) { - - if (elementField.Element === null) { - return; - } - - // Add user element field, if IndexEnabled and there is none - if (elementField.IndexEnabled) { - createUserElementField(elementField); - } else { - removeUserElementField(elementField); - } - } - - function getResourcePoolExpanded(resourcePoolUniqueKey) { - - // TODO Validations? - - var currentUser = dataContext.getCurrentUser(); - - var fetchedEarlier = false; - - // If it's not newly created, check the fetched list - fetchedEarlier = fetchedList.some(function (fetched) { - return resourcePoolUniqueKey === fetched; - }); - - // Prepare the query - var query = breeze.EntityQuery.from('ResourcePool'); - - // Is authorized? No, then get only the public data, yes, then get include user's own records - if (currentUser.isAuthenticated()) { - query = query.expand('User, UserResourcePoolSet, ElementSet.ElementFieldSet.UserElementFieldSet, ElementSet.ElementItemSet.ElementCellSet.UserElementCellSet'); - } else { - query = query.expand('User, ElementSet.ElementFieldSet, ElementSet.ElementItemSet.ElementCellSet'); - } - - var userNamePredicate = new breeze.Predicate('User.UserName', 'eq', resourcePoolUniqueKey.userName); - var resourcePoolKeyPredicate = new breeze.Predicate('Key', 'eq', resourcePoolUniqueKey.resourcePoolKey); - - query = query.where(userNamePredicate.and(resourcePoolKeyPredicate)); - - // From server or local? - if (!fetchedEarlier) { - query = query.using(breeze.FetchStrategy.FromServer); - } else { - query = query.using(breeze.FetchStrategy.FromLocalCache); - } - - return dataContext.executeQuery(query) - .then(success) - .catch(failed); - - function success(response) { - - // If there is no cmrp with this Id, return null - if (response.results.length === 0) { - return null; - } - - // ResourcePool - var resourcePool = response.results[0]; - - // Init - if (!fetchedEarlier) { - resourcePool._init(); - } - - // Add the record into fetched list - fetchedList.push(resourcePool.Id); - - return resourcePool; - } - - function failed(error) { - var message = error.message || 'ResourcePool query failed'; - logger.logError(message, error, true); - } - } - - function getResourcePoolSet(searchKey) { - searchKey = typeof searchKey !== 'undefined' ? searchKey : ''; - - var query = breeze.EntityQuery - .from('ResourcePool') - .expand(['User']); - - if (searchKey !== '') { - var resourcePoolNamePredicate = new breeze.Predicate('Name', 'contains', searchKey); - var userNamePredicate = new breeze.Predicate('User.UserName', 'contains', searchKey); - query = query.where(resourcePoolNamePredicate.or(userNamePredicate)); - } - - // Prepare the query - //if (fetchFromServer) { // From remote - query = query.using(breeze.FetchStrategy.FromServer); - // fetchFromServer = false; // Do it only once per user - //} - //else { // From local - //query = query.using(breeze.FetchStrategy.FromLocalCache); - //} - - return dataContext.executeQuery(query) - .then(success).catch(failed); - - function success(response) { - return response.results; - } - - function failed(error) { - var message = error.message || 'ResourcePool query failed'; - logger.logError(message, error, true); - } - } - - function removeElement(element) { - - // Remove from selectedElement - if (element.ResourcePool.selectedElement() === element) { - element.ResourcePool.selectedElement(null); - } - - // Related items - var elementItemSet = element.ElementItemSet.slice(); - elementItemSet.forEach(function (elementItem) { - removeElementItem(elementItem); - }); - - // Related fields - var elementFieldSet = element.ElementFieldSet.slice(); - elementFieldSet.forEach(function (elementField) { - removeElementField(elementField); - }); - - element.entityAspect.setDeleted(); - } - - function removeElementCell(elementCell) { - - // Related user cells - removeUserElementCell(elementCell); - - elementCell.entityAspect.setDeleted(); - } - - function removeElementField(elementField) { - - // Related cells - var elementCellSet = elementField.ElementCellSet.slice(); - elementCellSet.forEach(function (elementCell) { - removeElementCell(elementCell); - }); - - // Related user element fields - removeUserElementField(elementField); - - elementField.entityAspect.setDeleted(); - } - - function removeElementItem(elementItem) { - - // Related cells - var elementCellSet = elementItem.ElementCellSet.slice(); - elementCellSet.forEach(function (elementCell) { - removeElementCell(elementCell); - }); - - elementItem.entityAspect.setDeleted(); - } - - function removeResourcePool(resourcePool) { - - // Related elements - var elementSet = resourcePool.ElementSet.slice(); - elementSet.forEach(function (element) { - removeElement(element); - }); - - // Related user resource pools - removeUserResourcePool(resourcePool); - - resourcePool.entityAspect.setDeleted(); - } - - function removeUserElementCell(elementCell, updateCache) { - updateCache = typeof updateCache !== 'undefined' ? updateCache : true; - - var currentUserElementCell = elementCell.currentUserCell(); - - if (currentUserElementCell !== null) { - currentUserElementCell.entityAspect.setDeleted(); - - if (updateCache) { - elementCell.setCurrentUserNumericValue(); - } - } - } - - function removeUserElementField(elementField) { - - var currentUserElementField = elementField.currentUserElementField(); - - if (currentUserElementField !== null) { - currentUserElementField.entityAspect.setDeleted(); - - // Update the cache - elementField.setCurrentUserIndexRating(); - } - } - - function removeUserResourcePool(resourcePool) { - - var currentUserResourcePool = resourcePool.currentUserResourcePool(); - - if (currentUserResourcePool !== null) { - currentUserResourcePool.entityAspect.setDeleted(); - - // Update the cache - resourcePool.setCurrentUserResourcePoolRate(); - } - } - - // When an entity gets updated through angular, unlike breeze updates, it doesn't sync RowVersion automatically - // After each update, call this function to sync the entities RowVersion with the server's. Otherwise it'll get Conflict error - // coni2k - 05 Jan. '16 - function syncRowVersion(oldEntity, newEntity) { - // TODO Validations? - oldEntity.RowVersion = newEntity.RowVersion; - } - - // These 'updateX' functions were defined in their related entities (user.js). - // Only because they had to use createEntity() on dataContext, it was moved to this service. - // Try do handle them in a better way, maybe by using broadcast? - function updateElementCellDecimalValue(elementCell, updateType) { - - switch (updateType) { - case 'increase': - case 'decrease': { - - var userElementCell = elementCell.currentUserCell(); - - if (userElementCell === null) { // If there is no item, create it - - var decimalValue = updateType === 'increase' ? 55 : 45; - createUserElementCell(elementCell, decimalValue); - - } else { // If there is an item, update DecimalValue, but cannot be smaller than zero and cannot be bigger than 100 - - userElementCell.DecimalValue = updateType === 'increase' ? - userElementCell.DecimalValue + 5 > 100 ? 100 : userElementCell.DecimalValue + 5 : - userElementCell.DecimalValue - 5 < 0 ? 0 : userElementCell.DecimalValue - 5; - - // Update the cache - elementCell.setCurrentUserNumericValue(); - } - - break; - } - case 'reset': { - - removeUserElementCell(elementCell); - break; - } - } - } - - function updateElementCellMultiplier(elementCell, updateType) { - - updateElementCellMultiplierInternal(elementCell, updateType); - - // Update items - elementCell.ElementField.Element.ElementItemSet.forEach(function (item) { - item.setMultiplier(); - }); - - if (elementCell.ElementField.IndexEnabled) { - // Update numeric value cells - elementCell.ElementField.ElementCellSet.forEach(function (cell) { - cell.setNumericValueMultiplied(false); - }); - - // Update fields - elementCell.ElementField.setNumericValueMultiplied(); - } - } - - function updateElementCellMultiplierInternal(elementCell, updateType) { - - switch (updateType) { - case 'increase': - case 'decrease': { - - var userElementCell = elementCell.currentUserCell(); - - if (userElementCell === null) { // If there is no item, create it - - var decimalValue = updateType === 'increase' ? 1 : 0; - createUserElementCell(elementCell, decimalValue, false); - - } else { // If there is an item, update DecimalValue, but cannot be lower than zero - - userElementCell.DecimalValue = updateType === 'increase' ? - userElementCell.DecimalValue + 1 : - userElementCell.DecimalValue - 1 < 0 ? 0 : userElementCell.DecimalValue - 1; - } - - break; - } - case 'reset': { - - removeUserElementCell(elementCell, false); - break; - } - } - } - - function updateElementFieldIndexRating(elementField, updateType) { - - switch (updateType) { - case 'increase': - case 'decrease': { - - var userElementField = elementField.currentUserElementField(); - - // If there is no item, create it - if (userElementField === null) { - - var rating = updateType === 'increase' ? 55 : 45; - createUserElementField(elementField, rating); - - } else { // If there is an item, update Rating, but cannot be smaller than zero and cannot be bigger than 100 - - userElementField.Rating = updateType === 'increase' ? - userElementField.Rating + 5 > 100 ? 100 : userElementField.Rating + 5 : - userElementField.Rating - 5 < 0 ? 0 : userElementField.Rating - 5; - - // Update the cache - elementField.setCurrentUserIndexRating(); - } - - break; - } - case 'reset': { - - removeUserElementField(elementField); - break; - } - } - } - - function updateElementMultiplier(element, updateType) { - - // Find user element cell - element.ElementItemSet.forEach(function (item) { - - var multiplierCell; - for (var cellIndex = 0; cellIndex < item.ElementCellSet.length; cellIndex++) { - var elementCell = item.ElementCellSet[cellIndex]; - if (elementCell.ElementField.DataType === 12) { - multiplierCell = elementCell; - break; - } - } - - updateElementCellMultiplierInternal(multiplierCell, updateType); - }); - - // Update related - - // Update items - element.ElementItemSet.forEach(function (item) { - item.setMultiplier(); - }); - - element.ElementFieldSet.forEach(function (field) { - - if (field.IndexEnabled) { - // Update numeric value cells - field.ElementCellSet.forEach(function (cell) { - cell.setNumericValueMultiplied(false); - }); - - // Update fields - field.setNumericValueMultiplied(); - } - }); - } - - function updateResourcePoolRate(resourcePool, updateType) { - - switch (updateType) { - case 'increase': - case 'decrease': { - - var userResourcePool = resourcePool.currentUserResourcePool(); - - // If there is no item, create it - if (userResourcePool === null) { - - var resourcePoolRate = updateType === 'increase' ? 15 : 5; - createUserResourcePool(resourcePool, resourcePoolRate); - - } else { // If there is an item, update Rating, but cannot be smaller than zero and cannot be bigger than 1000 - - userResourcePool.ResourcePoolRate = updateType === 'increase' ? - userResourcePool.ResourcePoolRate + 5 > 1000 ? 1000 : userResourcePool.ResourcePoolRate + 5 : - userResourcePool.ResourcePoolRate - 5 < 0 ? 0 : userResourcePool.ResourcePoolRate - 5; - - // Update the cache - resourcePool.setCurrentUserResourcePoolRate(); - } - - break; - } - case 'reset': { - - removeUserResourcePool(resourcePool); - break; - } - } - } - } -})(); diff --git a/ngClient/_system/ts/app/factories/resourcePoolFactory.ts b/ngClient/_system/js/app/factories/resourcePoolFactory.ts similarity index 90% rename from ngClient/_system/ts/app/factories/resourcePoolFactory.ts rename to ngClient/_system/js/app/factories/resourcePoolFactory.ts index fb3564f93..13918eff1 100644 --- a/ngClient/_system/ts/app/factories/resourcePoolFactory.ts +++ b/ngClient/_system/js/app/factories/resourcePoolFactory.ts @@ -1,12 +1,12 @@ -module M46 { +module Main.Factories { 'use strict'; var factoryId = 'resourcePoolFactory'; + angular.module('main') .factory(factoryId, ['dataContext', 'Element', 'logger', 'ResourcePool', '$rootScope', resourcePoolFactory]); - function resourcePoolFactory(dataContext: any, Element: any, logger: any, ResourcePool: any, $rootScope: any); - function resourcePoolFactory(dataContext, Element, logger, ResourcePool, $rootScope) { + function resourcePoolFactory(dataContext: any, Element: any, logger: any, ResourcePool: any, $rootScope: any) { // Logger logger = logger.forSource(factoryId); @@ -52,13 +52,11 @@ // TODO } - function createElement(element: any); - function createElement(element) { + function createElement(element: any) { return dataContext.createEntity('Element', element); } - function createElementCell(elementCellInitial: any); - function createElementCell(elementCellInitial) { + function createElementCell(elementCellInitial: any) { var elementCell = dataContext.createEntity('ElementCell', elementCellInitial); @@ -70,8 +68,7 @@ return elementCell; } - function createElementField(elementField: any); - function createElementField(elementField) { + function createElementField(elementField: any) { elementField = dataContext.createEntity('ElementField', elementField); @@ -91,8 +88,7 @@ return elementField; } - function createElementItem(elementItem: any); - function createElementItem(elementItem) { + function createElementItem(elementItem: any) { elementItem = dataContext.createEntity('ElementItem', elementItem); @@ -162,8 +158,7 @@ return resourcePool; } - function createResourcePoolDirectIncomeAndMultiplier(initializeResourcePool: any); - function createResourcePoolDirectIncomeAndMultiplier(initializeResourcePool) { + function createResourcePoolDirectIncomeAndMultiplier(initializeResourcePool: any) { initializeResourcePool = typeof initializeResourcePool !== 'undefined' ? initializeResourcePool : false; var resourcePool = createResourcePoolBasic(); @@ -193,8 +188,7 @@ return resourcePool; } - function createResourcePoolTwoElements(initializeResourcePool: any); - function createResourcePoolTwoElements(initializeResourcePool) { + function createResourcePoolTwoElements(initializeResourcePool: any) { initializeResourcePool = typeof initializeResourcePool !== 'undefined' ? initializeResourcePool : false; var resourcePool = createResourcePoolBasic(); @@ -372,8 +366,7 @@ return userResourcePool; } - function elementField_DataTypeChanged(event: any, elementField: any); - function elementField_DataTypeChanged(event, elementField) { + function elementField_DataTypeChanged(event: any, elementField: any) { // Related element cells: Clear old values and set default values if necessary elementField.ElementCellSet.forEach(elementCell => { @@ -388,8 +381,7 @@ }); } - function elementField_IndexEnabledChanged(event: any, elementField: any); - function elementField_IndexEnabledChanged(event, elementField) { + function elementField_IndexEnabledChanged(event: any, elementField: any) { if (elementField.Element === null) { return; @@ -403,8 +395,7 @@ } } - function getResourcePoolExpanded(resourcePoolUniqueKey: any); - function getResourcePoolExpanded(resourcePoolUniqueKey) { + function getResourcePoolExpanded(resourcePoolUniqueKey: any) { // TODO Validations? @@ -441,8 +432,7 @@ .then(success) .catch(failed); - function success(response: any); - function success(response) { + function success(response: any) { // If there is no cmrp with this Id, return null if (response.results.length === 0) { @@ -463,15 +453,13 @@ return resourcePool; } - function failed(error: any); - function failed(error) { + function failed(error: any) { var message = error.message || 'ResourcePool query failed'; logger.logError(message, error, true); } } - function getResourcePoolSet(searchKey: any); - function getResourcePoolSet(searchKey) { + function getResourcePoolSet(searchKey: any) { searchKey = typeof searchKey !== 'undefined' ? searchKey : ''; var query = breeze.EntityQuery @@ -496,20 +484,17 @@ return dataContext.executeQuery(query) .then(success).catch(failed); - function success(response: any); - function success(response) { + function success(response: any) { return response.results; } - function failed(error: any); - function failed(error) { + function failed(error: any) { var message = error.message || 'ResourcePool query failed'; logger.logError(message, error, true); } } - function removeElement(element: any); - function removeElement(element) { + function removeElement(element: any) { // Remove from selectedElement if (element.ResourcePool.selectedElement() === element) { @@ -531,8 +516,7 @@ element.entityAspect.setDeleted(); } - function removeElementCell(elementCell: any); - function removeElementCell(elementCell) { + function removeElementCell(elementCell: any) { // Related user cells removeUserElementCell(elementCell); @@ -540,8 +524,7 @@ elementCell.entityAspect.setDeleted(); } - function removeElementField(elementField: any); - function removeElementField(elementField) { + function removeElementField(elementField: any) { // Related cells var elementCellSet = elementField.ElementCellSet.slice(); @@ -555,8 +538,7 @@ elementField.entityAspect.setDeleted(); } - function removeElementItem(elementItem: any); - function removeElementItem(elementItem) { + function removeElementItem(elementItem: any) { // Related cells var elementCellSet = elementItem.ElementCellSet.slice(); @@ -567,8 +549,7 @@ elementItem.entityAspect.setDeleted(); } - function removeResourcePool(resourcePool: any); - function removeResourcePool(resourcePool) { + function removeResourcePool(resourcePool: any) { // Related elements var elementSet = resourcePool.ElementSet.slice(); @@ -596,8 +577,7 @@ } } - function removeUserElementField(elementField: any); - function removeUserElementField(elementField) { + function removeUserElementField(elementField: any) { var currentUserElementField = elementField.currentUserElementField(); @@ -609,8 +589,7 @@ } } - function removeUserResourcePool(resourcePool: any); - function removeUserResourcePool(resourcePool) { + function removeUserResourcePool(resourcePool: any) { var currentUserResourcePool = resourcePool.currentUserResourcePool(); @@ -625,8 +604,7 @@ // When an entity gets updated through angular, unlike breeze updates, it doesn't sync RowVersion automatically // After each update, call this function to sync the entities RowVersion with the server's. Otherwise it'll get Conflict error // coni2k - 05 Jan. '16 - function syncRowVersion(oldEntity: any, newEntity: any); - function syncRowVersion(oldEntity, newEntity) { + function syncRowVersion(oldEntity: any, newEntity: any) { // TODO Validations? oldEntity.RowVersion = newEntity.RowVersion; } @@ -634,8 +612,7 @@ // These 'updateX' functions were defined in their related entities (user.js). // Only because they had to use createEntity() on dataContext, it was moved to this service. // Try do handle them in a better way, maybe by using broadcast? - function updateElementCellDecimalValue(elementCell: any, updateType: any); - function updateElementCellDecimalValue(elementCell, updateType) { + function updateElementCellDecimalValue(elementCell: any, updateType: any) { switch (updateType) { case 'increase': @@ -668,8 +645,7 @@ } } - function updateElementCellMultiplier(elementCell: any, updateType: any); - function updateElementCellMultiplier(elementCell, updateType) { + function updateElementCellMultiplier(elementCell: any, updateType: any) { updateElementCellMultiplierInternal(elementCell, updateType); @@ -689,8 +665,7 @@ } } - function updateElementCellMultiplierInternal(elementCell: any, updateType: any); - function updateElementCellMultiplierInternal(elementCell, updateType) { + function updateElementCellMultiplierInternal(elementCell: any, updateType: any) { switch (updateType) { case 'increase': @@ -720,8 +695,7 @@ } } - function updateElementFieldIndexRating(elementField: any, updateType: any); - function updateElementFieldIndexRating(elementField, updateType) { + function updateElementFieldIndexRating(elementField: any, updateType: any) { switch (updateType) { case 'increase': @@ -755,8 +729,7 @@ } } - function updateElementMultiplier(element: any, updateType: any); - function updateElementMultiplier(element, updateType) { + function updateElementMultiplier(element: any, updateType: any) { // Find user element cell element.ElementItemSet.forEach(item => { @@ -794,8 +767,7 @@ }); } - function updateResourcePoolRate(resourcePool: any, updateType: any); - function updateResourcePoolRate(resourcePool, updateType) { + function updateResourcePoolRate(resourcePool: any, updateType: any) { switch (updateType) { case 'increase': diff --git a/ngClient/_system/ts/app/filters/ngEnum.ts b/ngClient/_system/js/app/filters/enumConverter.ts similarity index 67% rename from ngClient/_system/ts/app/filters/ngEnum.ts rename to ngClient/_system/js/app/filters/enumConverter.ts index 87e840fd9..23c360ea9 100644 --- a/ngClient/_system/ts/app/filters/ngEnum.ts +++ b/ngClient/_system/js/app/filters/enumConverter.ts @@ -1,5 +1,5 @@ /*** - * Filter: ngEnum + * Filter: enumConverter * * Converts the enum value to its key by searching through tables in Enums.js * @@ -7,11 +7,7 @@ module Main.Filters { 'use strict'; - angular.module('main') - .filter('ngEnum', ['Enums', 'logger', ngEnum]); - - function ngEnum(Enums: any, logger: any) { - + function enumConverter(Enums: any, logger: any) { return (input, enumTableKey) => { if (typeof input === 'undefined' || typeof enumTableKey === 'undefined' || enumTableKey === '') { @@ -21,4 +17,8 @@ module Main.Filters { return Enums.getEnumKey(enumTableKey, input); }; } -} \ No newline at end of file + + enumConverter.$inject = ['Enums', 'logger']; + + angular.module('main').filter('enumConverter', enumConverter); +} diff --git a/ngClient/_system/js/app/filters/ngEnum.js b/ngClient/_system/js/app/filters/ngEnum.js deleted file mode 100644 index 33148b06a..000000000 --- a/ngClient/_system/js/app/filters/ngEnum.js +++ /dev/null @@ -1,24 +0,0 @@ -/*** - * Filter: ngEnum - * - * Converts the enum value to its key by searching through tables in Enums.js - * - ***/ -(function () { - 'use strict'; - - angular.module('main') - .filter('ngEnum', ['Enums', 'logger', ngEnum]); - - function ngEnum(Enums, logger) { - - return function (input, enumTableKey) { - - if (typeof input === 'undefined' || typeof enumTableKey === 'undefined' || enumTableKey === '') { - return null; - } - - return Enums.getEnumKey(enumTableKey, input); - }; - } -})(); diff --git a/ngClient/_system/js/app/filters/numberSymbol.js b/ngClient/_system/js/app/filters/numberSymbol.js deleted file mode 100644 index ea9cddccd..000000000 --- a/ngClient/_system/js/app/filters/numberSymbol.js +++ /dev/null @@ -1,44 +0,0 @@ -/*** - * Filter: numberSymbol - * - * Convert the number to a short format with symbol format. - * - ***/ -(function () { - 'use strict'; - - angular.module('main') - .filter('numberSymbol', ['logger', '$filter', numberSymbol]); - - function numberSymbol(logger, $filter) { - return function (input, decimals) { - - if (typeof input === 'undefined') - return null; - - decimals = typeof decimals === 'undefined' ? 0 : decimals; - - var number = Number(input); - number = decimals > 0 ? number.toFixed(decimals) : number; - var symbol = ''; - - if (number / Math.pow(10, 12) >= 1) { // Trillion - number = number / Math.pow(10, 12); - symbol = 'T'; - } else if (number / Math.pow(10, 9) >= 1) { // Billion - number = number / Math.pow(10, 9); - symbol = 'B'; - } else if (number / Math.pow(10, 6) >= 1) { // Million - number = number / Math.pow(10, 6); - symbol = 'M'; - } else if (number / Math.pow(10, 3) >= 1) { // Thousand - number = number / Math.pow(10, 3); - symbol = 'K'; - } else { - number = number; - } - - return $filter('number')(number, decimals) + symbol; - }; - } -})(); diff --git a/ngClient/_system/ts/app/filters/numberSymbol.ts b/ngClient/_system/js/app/filters/numberSymbol.ts similarity index 87% rename from ngClient/_system/ts/app/filters/numberSymbol.ts rename to ngClient/_system/js/app/filters/numberSymbol.ts index d6c0acea2..bd55ff4f8 100644 --- a/ngClient/_system/ts/app/filters/numberSymbol.ts +++ b/ngClient/_system/js/app/filters/numberSymbol.ts @@ -7,10 +7,8 @@ module Main.Filters { 'use strict'; - angular.module('main') - .filter('numberSymbol', ['logger', '$filter', numberSymbol]); + function numberSymbol(logger, $filter) { - function numberSymbol(logger: any, $filter: any) { return (input, decimals) => { if (typeof input === 'undefined') @@ -39,4 +37,8 @@ module Main.Filters { return $filter('number')(number, decimals) + symbol; }; } + + numberSymbol.$inject = ['logger', '$filter']; + + angular.module('main').filter('numberSymbol', numberSymbol); } \ No newline at end of file diff --git a/ngClient/_system/js/app/filters/percentage.js b/ngClient/_system/js/app/filters/percentage.js deleted file mode 100644 index 10b340bf9..000000000 --- a/ngClient/_system/js/app/filters/percentage.js +++ /dev/null @@ -1,19 +0,0 @@ -/*** - * Filter: percentage - * - * Convert the number to a percentage format. - * - ***/ -(function () { - 'use strict'; - - angular.module('main') - .filter('percentage', ['$filter', percentage]); - - function percentage($filter) { - return function (input, decimals) { - // TODO Whether Percentage symbol should be in front or behind of the value differs based on cultural settings - return $filter('number')(input * 100, decimals) + '%'; - }; - } -})(); diff --git a/ngClient/_system/ts/app/filters/percentage.ts b/ngClient/_system/js/app/filters/percentage.ts similarity index 62% rename from ngClient/_system/ts/app/filters/percentage.ts rename to ngClient/_system/js/app/filters/percentage.ts index cb34e59d1..89dfda8d6 100644 --- a/ngClient/_system/ts/app/filters/percentage.ts +++ b/ngClient/_system/js/app/filters/percentage.ts @@ -7,10 +7,11 @@ module Main.Filters { 'use strict'; - angular.module('main') - .filter('percentage', ['$filter', percentage]); - - function percentage($filter: any) { + function percentage($filter) { return (input, decimals) => ($filter('number')(input * 100, decimals) + '%'); } + + percentage.$inject = ['$filter']; + + angular.module('main').filter('percentage', percentage); } \ No newline at end of file diff --git a/ngClient/_system/js/app/main.js b/ngClient/_system/js/app/main.js deleted file mode 100644 index 52fc96bc0..000000000 --- a/ngClient/_system/js/app/main.js +++ /dev/null @@ -1,21 +0,0 @@ -/*** - * App module: main - * - * Bootstrap the app. - * - ***/ -(function () { - 'use strict'; - - angular.module('main', [ - 'angularMoment', - 'angularUtils.directives.dirDisqus', - 'angular-google-analytics', - 'breeze.angular', - 'breeze.directives', - 'highcharts-ng', - 'ngRoute', - 'ngSanitize', - 'ui.bootstrap' - ]); -})(); diff --git a/ngClient/_system/ts/app/main.ts b/ngClient/_system/js/app/main.ts similarity index 92% rename from ngClient/_system/ts/app/main.ts rename to ngClient/_system/js/app/main.ts index 15888034b..12370c210 100644 --- a/ngClient/_system/ts/app/main.ts +++ b/ngClient/_system/js/app/main.ts @@ -13,8 +13,6 @@ module Main { 'use strict'; - console.log('Initializing: ' + new Date()); - angular.module('main', [ 'angularMoment', 'angularUtils.directives.dirDisqus', @@ -27,3 +25,5 @@ module Main { 'ui.bootstrap' ]); } + + diff --git a/ngClient/_system/ts/lib/angularjs/angular.d.ts b/ngClient/_system/js/lib/angularjs/angular.d.ts similarity index 100% rename from ngClient/_system/ts/lib/angularjs/angular.d.ts rename to ngClient/_system/js/lib/angularjs/angular.d.ts diff --git a/ngClient/_system/ts/lib/breeze/breeze.d.ts b/ngClient/_system/js/lib/breeze/breeze.d.ts similarity index 100% rename from ngClient/_system/ts/lib/breeze/breeze.d.ts rename to ngClient/_system/js/lib/breeze/breeze.d.ts diff --git a/ngClient/_system/ts/lib/jquery/jquery.d.ts b/ngClient/_system/js/lib/jquery/jquery.d.ts similarity index 100% rename from ngClient/_system/ts/lib/jquery/jquery.d.ts rename to ngClient/_system/js/lib/jquery/jquery.d.ts diff --git a/ngClient/_system/ts/lib/toastr/toastr.d.ts b/ngClient/_system/js/lib/toastr/toastr.d.ts similarity index 100% rename from ngClient/_system/ts/lib/toastr/toastr.d.ts rename to ngClient/_system/js/lib/toastr/toastr.d.ts diff --git a/ngClient/_system/ts/tsconfig.json b/ngClient/_system/js/tsconfig.json similarity index 77% rename from ngClient/_system/ts/tsconfig.json rename to ngClient/_system/js/tsconfig.json index 4b7227914..7b330fd2e 100644 --- a/ngClient/_system/ts/tsconfig.json +++ b/ngClient/_system/js/tsconfig.json @@ -2,9 +2,7 @@ "compilerOptions": { "noImplicitAny": false, "noEmitOnError": true, - "outFile": "./app/app.js", "removeComments": true, - "sourceMap": true, "target": "es5" }, "exclude": [ diff --git a/ngClient/_system/ts/app/app.js b/ngClient/_system/ts/app/app.js deleted file mode 100644 index 72c2c71d5..000000000 --- a/ngClient/_system/ts/app/app.js +++ /dev/null @@ -1,5301 +0,0 @@ -var Main; -(function (Main) { - 'use strict'; - console.log('Initializing: ' + new Date()); - angular.module('main', [ - 'angularMoment', - 'angularUtils.directives.dirDisqus', - 'angular-google-analytics', - 'breeze.angular', - 'breeze.directives', - 'highcharts-ng', - 'ngRoute', - 'ngSanitize', - 'ui.bootstrap' - ]); -})(Main || (Main = {})); -var Main; -(function (Main) { - var Config; - (function (Config) { - 'use strict'; - var angularInterceptorId = 'AngularInterceptor'; - angular.module('main') - .config(['$httpProvider', authorizationConfig]) - .run(['logger', '$window', authorizationRun]) - .factory(angularInterceptorId, ['logger', '$q', '$window', angularInterceptor]); - function authorizationConfig($httpProvider) { - $httpProvider.interceptors.push(angularInterceptorId); - } - function authorizationRun(logger, $window) { - logger = logger.forSource('authorizationRun'); - var oldClient = $window.OData.defaultHttpClient; - var newClient = { - request: function (request, success, error) { - request.headers = request.headers || {}; - var token = angular.fromJson($window.localStorage.getItem('token')); - request.headers.Authorization = token !== null ? 'Bearer ' + token.access_token : ''; - return oldClient.request(request, success, error); - } - }; - $window.OData.defaultHttpClient = newClient; - } - function angularInterceptor(logger, $q, $window) { - logger = logger.forSource(angularInterceptorId); - return { - request: function (config) { - config.headers = config.headers || {}; - var token = angular.fromJson($window.localStorage.getItem('token')); - config.headers.Authorization = token !== null ? 'Bearer ' + token.access_token : ''; - return config; - }, - response: function (response) { - if (response.status === 401) { - } - return response || $q.when(response); - } - }; - } - })(Config = Main.Config || (Main.Config = {})); -})(Main || (Main = {})); -var Main; -(function (Main) { - var Config; - (function (Config) { - 'use strict'; - angular.module('main') - .config(['breezeProvider', breezeConfig]) - .config(['zDirectivesConfigProvider', breezeDirectiveConfig]); - function breezeConfig(breezeProvider) { - breeze.config.initializeAdapterInstance('uriBuilder', 'odata'); - var adapter = breeze.config.initializeAdapterInstance('dataService', 'webApiOData', true); - adapter.getRoutePrefix = getRoutePrefix_Microsoft_AspNet_WebApi_OData_5_3_x; - function getRoutePrefix_Microsoft_AspNet_WebApi_OData_5_3_x(dataService) { - var parser = document.createElement('a'); - parser.href = dataService.serviceName; - var prefix = parser.pathname; - if (prefix[0] !== '/') { - prefix = '/' + prefix; - } - if (prefix.substr(-1) !== '/') { - prefix += '/'; - } - return prefix; - } - } - function breezeDirectiveConfig(config) { - config.zRequiredTemplate = ''; - config.zValidateTemplate = '%error%!'; - } - })(Config = Main.Config || (Main.Config = {})); -})(Main || (Main = {})); -var Main; -(function (Main) { - var Config; - (function (Config) { - 'use strict'; - angular.module('main') - .config(['$provide', extendHandler]); - function extendHandler($provide) { - $provide.decorator('$exceptionHandler', ['logger', 'serviceAppUrl', '$delegate', '$injector', '$window', exceptionHandlerExtension]); - } - function exceptionHandlerExtension(logger, serviceAppUrl, $delegate, $injector, $window) { - logger = logger.forSource('exceptionHandlerExtension'); - var exceptionUrl = serviceAppUrl + '/api/Exception/Record'; - return function (exception, cause) { - var $location = $injector.get('$location'); - if ($location.path().substring($location.path().lastIndexOf('/') + 1) !== 'notFound') { - logger.logError('Something went wrong, please try again later!', null, true); - } - getSourceMappedStackTrace(exception) - .then(function (sourceMappedStack) { - var exceptionModel = { - Message: exception.message, - Cause: cause, - Url: $location.url(), - Stack: sourceMappedStack - }; - var $http = $injector.get('$http'); - $http.post(exceptionUrl, exceptionModel); - setTimeout(function () { - throw exception; - }); - }); - }; - function getSourceMappedStackTrace(exception) { - var $q = $injector.get('$q'), $http = $injector.get('$http'), SMConsumer = $window.sourceMap.SourceMapConsumer, cache = {}; - if (exception.stack) { - return $q.all($.map(exception.stack.split(/\n/), function (stackLine) { - var match = stackLine.match(/^(.+)(http.+):(\d+):(\d+)/); - if (match) { - var prefix = match[1], url = match[2], line = match[3], col = match[4]; - return getMapForScript(url).then(function (map) { - var pos = map.originalPositionFor({ - line: parseInt(line, 10), - column: parseInt(col, 10) - }); - var mangledName = prefix.match(/\s*(at)?\s*(.*?)\s*(\(|@)/); - mangledName = (mangledName && mangledName[2]) || ''; - return ' at ' + (pos.name ? pos.name : mangledName) + ' ' + - $window.location.origin + pos.source + ':' + pos.line + ':' + - pos.column; - }, function () { return stackLine; }); - } - else { - return $q.when(stackLine); - } - })).then(function (lines) { return lines.join('\n'); }); - } - else { - return $q.when(''); - } - function getMapForScript(url) { - if (cache[url]) { - return cache[url]; - } - else { - var promise = $http.get(url).then(function (response) { - var m = response.data.match(/\/\/# sourceMappingURL=(.+\.map)/); - if (m) { - var path = url.match(/^(.+)\/[^/]+$/); - path = path && path[1]; - return $http.get(path + '/' + m[1]).then(function (response) { return new SMConsumer(response.data); }); - } - else { - return $q.reject(); - } - }); - cache[url] = promise; - return promise; - } - } - } - } - })(Config = Main.Config || (Main.Config = {})); -})(Main || (Main = {})); -var Main; -(function (Main) { - var Config; - (function (Config) { - 'use strict'; - angular.module('main') - .config(['AnalyticsProvider', 'analyticsTrackingCode', 'analyticsDomainName', analyticsConfig]); - angular.module('main').run(['Analytics', function (analytics) { }]); - function analyticsConfig(analyticsProvider, analyticsTrackingCode, analyticsDomainName) { - analyticsProvider.setAccount(analyticsTrackingCode) - .setDomainName(analyticsDomainName) - .ignoreFirstPageLoad(true); - } - })(Config = Main.Config || (Main.Config = {})); -})(Main || (Main = {})); -var Main; -(function (Main) { - var Config; - (function (Config) { - 'use strict'; - angular.module('main') - .config(['$locationProvider', '$routeProvider', routeConfig]); - angular.module('main') - .run(['locationHistory', 'logger', '$location', '$rootScope', routeRun]); - function routeConfig($locationProvider, $routeProvider) { - $routeProvider - .when('/', { title: 'Home', templateUrl: '/_system/views/content/home.html?v=0.53.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/default.aspx', { title: 'Home', templateUrl: '/_system/views/content/home.html?v=0.53.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/content/notFound', { title: 'Not Found', templateUrl: '/_system/views/content/notFound.html?v=0.52.0', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/content/allInOne', { title: 'All in One', templateUrl: '/_system/views/content/allInOne.html?v=0.49.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/content/basics', { title: 'Basics', templateUrl: '/_system/views/content/basics.html?v=0.53.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/content/home', { title: 'Home', templateUrl: '/_system/views/content/home.html?v=0.53.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/content/implementation', { title: 'Implementation', templateUrl: '/_system/views/content/implementation.html?v=0.49.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/content/introduction', { title: 'Introduction', templateUrl: '/_system/views/content/introduction.html?v=0.53.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/content/knowledgeIndex', { title: 'Knowledge Index', templateUrl: '/_system/views/content/knowledgeIndex.html?v=0.51.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/content/priorityIndex', { title: 'Priority Index', templateUrl: '/_system/views/content/priorityIndex.html?v=0.49.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/content/prologue', { title: 'Prologue', templateUrl: '/_system/views/content/prologue.html?v=0.51.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/content/reason', { title: 'Reason', templateUrl: '/_system/views/content/reason.html?v=0.58.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/content/totalCostIndex', { title: 'Total Cost Index', templateUrl: '/_system/views/content/totalCostIndex.html?v=0.49.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/content/contributors', { title: 'Contributors', templateUrl: '/_system/views/content/contributors.html?v=0.60.1', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/account', { title: 'Account', templateUrl: '/_system/views/account/account.html?v=0.55.0', accessType: 'authenticatedRequired', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/account/accountEdit', { title: 'Account Edit', templateUrl: '/_system/views/account/accountEdit.html?v=0.55.0', accessType: 'authenticatedRequired', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/account/addPassword', { title: 'Add Password', templateUrl: '/_system/views/account/addPassword.html?v=0.55.0', accessType: 'authenticatedRequired', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/account/changeEmail', { title: 'Change Email', templateUrl: '/_system/views/account/changeEmail.html?v=0.55.0', accessType: 'authenticatedRequired', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/account/changePassword', { title: 'Change Password', templateUrl: '/_system/views/account/changePassword.html?v=0.55.0', accessType: 'authenticatedRequired', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/account/changeUserName', { title: 'Change Username', templateUrl: '/_system/views/account/changeUsername.html?v=0.55.0', accessType: 'authenticatedRequired', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/account/confirmEmail', { title: 'Confirm Email', templateUrl: '/_system/views/account/confirmEmail.html?v=0.51.0', accessType: 'authenticatedRequired', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/account/login', { title: 'Login', templateUrl: '/_system/views/account/login.html?v=0.58.0', accessType: 'unauthenticatedRequired', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/account/register', { title: 'Register', templateUrl: '/_system/views/account/register.html?v=0.58.0', accessType: 'unauthenticatedRequired', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/account/resetPassword', { title: 'Reset Password', templateUrl: '/_system/views/account/resetPassword.html?v=0.55.0', accessType: 'unauthenticatedRequired', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/_system/resourcePool/search', { title: 'CMRP Search', templateUrl: '/_system/views/resourcePool/resourcePoolSearch.html?v=0.57.0', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/:userName', { title: 'Profile', templateUrl: '/_system/views/account/profile.html?v=0.57.0', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/:userName/new', { title: 'New CMRP', templateUrl: '/_system/views/resourcePool/resourcePoolManage.html?v=0.58.0', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/:userName/:resourcePoolKey/edit', { title: 'Edit CMRP', templateUrl: '/_system/views/resourcePool/resourcePoolManage.html?v=0.58.0', resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .when('/:userName/:resourcePoolKey', { title: 'View CMRP', templateUrl: '/_system/views/resourcePool/resourcePoolView.html?v=0.57.0', enableDisqus: true, resolve: { validateAccess: ['dataContext', 'locationHistory', 'logger', '$location', '$q', '$route', validateAccess] } }) - .otherwise({ redirectTo: getNotFound }); - if (window.history && window.history.pushState) { - $locationProvider.html5Mode({ enabled: true }); - } - function getNotFound(routeParams, path, search) { - var invalidUrl = path; - var keys = Object.keys(search); - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - invalidUrl += (i === 0 ? '?' : '&') + key + '=' + search[key]; - } - return '/_system/content/notFound?url=' + invalidUrl; - } - function validateAccess(dataContext, locationHistory, logger, $location, $q, $route) { - logger = logger.forSource('validateAccess'); - var deferred = $q.defer(); - locationHistory.createItem($location, $route.current); - dataContext.initializeCurrentUser() - .then(function (currentUser) { - if ($route.current.accessType !== 'undefined') { - if (($route.current.accessType === 'unauthenticatedRequired' && currentUser.isAuthenticated() && !currentUser.IsAnonymous) || - ($route.current.accessType === 'authenticatedRequired' && !currentUser.isAuthenticated())) { - deferred.reject({ accessType: $route.current.accessType }); - } - } - deferred.resolve(); - }) - .catch(function () { - deferred.reject(); - }); - return deferred.promise; - } - } - function routeRun(locationHistory, logger, $location, $rootScope) { - logger = logger.forSource('routeRun'); - $rootScope.$on('$routeChangeError', routeChangeError); - $rootScope.$on('$routeChangeSuccess', routeChangeSuccess); - function routeChangeError(event, current, previous, eventObj) { - if (eventObj.accessType === 'unauthenticatedRequired') { - $location.url('/'); - } - else if (eventObj.accessType === 'authenticatedRequired') { - $location.url('/_system/account/login?error=To be able to continue, please login first'); - } - } - function routeChangeSuccess(event, current, previous) { - $rootScope.viewTitle = typeof current.title !== 'undefined' ? current.title : ''; - } - } - })(Config = Main.Config || (Main.Config = {})); -})(Main || (Main = {})); -var M31; -(function (M31) { - 'use strict'; - var factoryId = 'Element'; - angular.module('main') - .factory(factoryId, ['logger', '$rootScope', elementFactory]); - function elementFactory(logger, $rootScope) { - logger = logger.forSource(factoryId); - Object.defineProperty(Element.prototype, 'IsMainElement', { - enumerable: true, - configurable: true, - get: function () { return this.backingFields._IsMainElement; }, - set: function (value) { - var _this = this; - var self = this; - if (self.backingFields._IsMainElement !== value) { - self.backingFields._IsMainElement = value; - if (typeof self.ResourcePool === 'undefined' || self.ResourcePool === null) { - return; - } - if (value) { - self.ResourcePool.ElementSet.forEach(function (element) { - if (element !== _this && element.IsMainElement) { - element.IsMainElement = false; - } - }); - self.ResourcePool.selectedElement(self); - } - } - } - }); - return Element; - function Element() { - var self = this; - self.Id = 0; - self.Name = ''; - self.backingFields = { - _IsMainElement: false, - _parent: null, - _familyTree: null, - _elementFieldIndexSet: null, - _indexRating: null, - _directIncomeField: null, - _multiplierField: null, - _totalResourcePoolAmount: null - }; - self.directIncome = directIncome; - self.directIncomeField = directIncomeField; - self.directIncomeIncludingResourcePoolAmount = directIncomeIncludingResourcePoolAmount; - self.elementFieldIndexSet = elementFieldIndexSet; - self.familyTree = familyTree; - self.fullSize = fullSize; - self.indexRating = indexRating; - self.multiplier = multiplier; - self.multiplierField = multiplierField; - self.parent = parent; - self.resourcePoolAmount = resourcePoolAmount; - self.setDirectIncomeField = setDirectIncomeField; - self.setElementFieldIndexSet = setElementFieldIndexSet; - self.setFamilyTree = setFamilyTree; - self.setIndexRating = setIndexRating; - self.setMultiplierField = setMultiplierField; - self.setParent = setParent; - self.totalDirectIncome = totalDirectIncome; - self.totalDirectIncomeIncludingResourcePoolAmount = totalDirectIncomeIncludingResourcePoolAmount; - self.totalIncome = totalIncome; - self.totalIncomeAverage = totalIncomeAverage; - self.totalResourcePoolAmount = totalResourcePoolAmount; - function directIncome() { - var value = 0; - self.ElementItemSet.forEach(function (item) { - value += item.directIncome(); - }); - return value; - } - function directIncomeField() { - if (self.backingFields._directIncomeField === null) { - self.setDirectIncomeField(); - } - return self.backingFields._directIncomeField; - } - function directIncomeIncludingResourcePoolAmount() { - var value = 0; - self.ElementItemSet.forEach(function (item) { - value += item.directIncomeIncludingResourcePoolAmount(); - }); - return value; - } - function elementFieldIndexSet() { - if (self.backingFields._elementFieldIndexSet === null) { - self.setElementFieldIndexSet(); - } - return self.backingFields._elementFieldIndexSet; - } - function familyTree() { - if (self.backingFields._familyTree === null) { - self.setFamilyTree(); - } - return self.backingFields._familyTree; - } - function fullSize() { - return (self.ElementFieldSet.length > 4) || self.elementFieldIndexSet().length > 2; - } - function getElementFieldIndexSet(element) { - var sortedElementFieldSet = element.ElementFieldSet.sort(function (a, b) { return (a.SortOrder - b.SortOrder); }); - var indexSet = []; - sortedElementFieldSet.forEach(function (field) { - if (field.IndexEnabled) { - indexSet.push(field); - } - if (field.DataType === 6 && field.SelectedElement !== null) { - var childIndexSet = getElementFieldIndexSet(field.SelectedElement); - childIndexSet.forEach(function (childIndex) { - indexSet.push(childIndex); - }); - } - }); - return indexSet; - } - function indexRating() { - if (self.backingFields._indexRating === null) { - self.setIndexRating(false); - } - return self.backingFields._indexRating; - } - function multiplier() { - var value = 0; - self.ElementItemSet.forEach(function (item) { - value += item.multiplier(); - }); - return value; - } - function multiplierField() { - if (self.backingFields._multiplierField !== null) { - self.setMultiplierField(); - } - return self.backingFields._multiplierField; - } - function parent() { - if (self.backingFields._parent === null) { - self.setParent(); - } - return self.backingFields._parent; - } - function resourcePoolAmount() { - var value = 0; - self.ElementItemSet.forEach(function (item) { - value += item.resourcePoolAmount(); - }); - return value; - } - function setDirectIncomeField() { - var result = self.ElementFieldSet.filter(function (field) { return (field.DataType === 11); }); - if (result.length > 0) { - self.backingFields._directIncomeField = result[0]; - } - } - function setElementFieldIndexSet() { - self.backingFields._elementFieldIndexSet = getElementFieldIndexSet(self); - } - function setFamilyTree() { - self.backingFields._familyTree = []; - var element = self; - while (element !== null) { - self.backingFields._familyTree.unshift(element); - element = element.parent(); - } - } - function setIndexRating(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - var indexSet = self.elementFieldIndexSet(); - var value = 0; - indexSet.forEach(function (index) { - value += index.indexRating(); - }); - if (self.backingFields._indexRating !== value) { - self.backingFields._indexRating = value; - if (updateRelated) { - self.elementFieldIndexSet().forEach(function (index) { - index.setIndexRatingPercentage(); - }); - } - } - } - function setMultiplierField() { - var result = self.ElementFieldSet.filter(function (field) { return (field.DataType === 12); }); - if (result.length > 0) { - self.backingFields._multiplierField = result[0]; - } - } - function setParent() { - if (self.ParentFieldSet.length > 0) { - self.backingFields._parent = self.ParentFieldSet[0].Element; - } - } - function totalDirectIncome() { - var value = 0; - self.ElementItemSet.forEach(function (item) { - value += item.totalDirectIncome(); - }); - return value; - } - function totalDirectIncomeIncludingResourcePoolAmount() { - var value = 0; - self.ElementItemSet.forEach(function (item) { - value += item.totalDirectIncomeIncludingResourcePoolAmount(); - }); - return value; - } - function totalIncome() { - var value = 0; - self.ElementItemSet.forEach(function (item) { - value += item.totalIncome(); - }); - return value; - } - function totalIncomeAverage() { - if (self.ElementItemSet.length === 0) { - return 0; - } - return self.totalIncome() / self.ElementItemSet.length; - } - function totalResourcePoolAmount() { - var value; - if (self === self.ResourcePool.mainElement()) { - value = self.ResourcePool.InitialValue; - self.ElementItemSet.forEach(function (item) { - value += item.totalResourcePoolAmount(); - }); - } - else { - if (self.ResourcePool.mainElement() !== null) { - value = self.ResourcePool.mainElement().totalResourcePoolAmount(); - } - } - if (self.backingFields._totalResourcePoolAmount !== value) { - self.backingFields._totalResourcePoolAmount = value; - self.elementFieldIndexSet().forEach(function (field) { - field.setIndexIncome(); - }); - } - return value; - } - } - } -})(M31 || (M31 = {})); -var M32; -(function (M32) { - 'use strict'; - var factoryId = 'ElementCell'; - angular.module('main') - .factory(factoryId, ['logger', elementCellFactory]); - function elementCellFactory(logger) { - logger = logger.forSource(factoryId); - return ElementCell; - function ElementCell() { - var self = this; - self.Id = 0; - self.ElementFieldId = 0; - self.ElementItemId = 0; - self.StringValue = ''; - self.NumericValueTotal = 0; - self.NumericValueCount = 0; - self.SelectedElementItemId = null; - self.backingFields = { - _currentUserNumericValue: null, - _otherUsersNumericValueTotal: null, - _otherUsersNumericValueCount: null, - _numericValue: null, - _numericValueMultiplied: null, - _numericValueMultipliedPercentage: null, - _passiveRating: null, - _aggressiveRating: null, - _rating: null, - _ratingPercentage: null, - _indexIncome: null - }; - self.aggressiveRating = aggressiveRating; - self.currentUserCell = currentUserCell; - self.currentUserNumericValue = currentUserNumericValue; - self.indexIncome = indexIncome; - self.numericValue = numericValue; - self.numericValueAverage = numericValueAverage; - self.numericValueCount = numericValueCount; - self.numericValueMultiplied = numericValueMultiplied; - self.numericValueMultipliedPercentage = numericValueMultipliedPercentage; - self.numericValueTotal = numericValueTotal; - self.otherUsersNumericValueCount = otherUsersNumericValueCount; - self.otherUsersNumericValueTotal = otherUsersNumericValueTotal; - self.passiveRating = passiveRating; - self.rating = rating; - self.ratingPercentage = ratingPercentage; - self.setAggressiveRating = setAggressiveRating; - self.setCurrentUserNumericValue = setCurrentUserNumericValue; - self.setIndexIncome = setIndexIncome; - self.setNumericValue = setNumericValue; - self.setNumericValueMultiplied = setNumericValueMultiplied; - self.setNumericValueMultipliedPercentage = setNumericValueMultipliedPercentage; - self.setOtherUsersNumericValueCount = setOtherUsersNumericValueCount; - self.setOtherUsersNumericValueTotal = setOtherUsersNumericValueTotal; - self.setPassiveRating = setPassiveRating; - self.setRating = setRating; - self.setRatingPercentage = setRatingPercentage; - self.value = value; - function aggressiveRating() { - if (self.backingFields._aggressiveRating === null) { - self.setAggressiveRating(false); - } - return self.backingFields._aggressiveRating; - } - function currentUserCell() { - return self.UserElementCellSet.length > 0 ? - self.UserElementCellSet[0] : - null; - } - function currentUserNumericValue() { - if (self.backingFields._currentUserNumericValue === null) { - self.setCurrentUserNumericValue(false); - } - return self.backingFields._currentUserNumericValue; - } - function indexIncome() { - self.setIndexIncome(); - return self.backingFields._indexIncome; - } - function numericValue() { - if (self.backingFields._numericValue === null) { - self.setNumericValue(false); - } - return self.backingFields._numericValue; - } - function numericValueAverage() { - if (self.numericValueCount() === null) { - return null; - } - return self.numericValueCount() === 0 ? - 0 : - self.numericValueTotal() / self.numericValueCount(); - } - function numericValueCount() { - return self.ElementField.UseFixedValue ? - self.currentUserCell() !== null && self.currentUserCell().UserId === self.ElementField.Element.ResourcePool.UserId ? - 1 : - self.otherUsersNumericValueCount() : - self.otherUsersNumericValueCount() + 1; - } - function numericValueMultiplied() { - if (self.backingFields._numericValueMultiplied === null) { - self.setNumericValueMultiplied(false); - } - return self.backingFields._numericValueMultiplied; - } - function numericValueMultipliedPercentage() { - if (self.backingFields._numericValueMultipliedPercentage === null) { - self.setNumericValueMultipliedPercentage(false); - } - return self.backingFields._numericValueMultipliedPercentage; - } - function numericValueTotal() { - return self.ElementField.UseFixedValue ? - self.currentUserCell() !== null && self.currentUserCell().UserId === self.ElementField.Element.ResourcePool.UserId ? - self.currentUserNumericValue() : - self.otherUsersNumericValueTotal() : - self.otherUsersNumericValueTotal() + self.currentUserNumericValue(); - } - function otherUsersNumericValueCount() { - if (self.backingFields._otherUsersNumericValueCount === null) { - self.setOtherUsersNumericValueCount(); - } - return self.backingFields._otherUsersNumericValueCount; - } - function otherUsersNumericValueTotal() { - if (self.backingFields._otherUsersNumericValueTotal === null) { - self.setOtherUsersNumericValueTotal(); - } - return self.backingFields._otherUsersNumericValueTotal; - } - function passiveRating() { - if (self.backingFields._passiveRating === null) { - self.setPassiveRating(false); - } - return self.backingFields._passiveRating; - } - function rating() { - if (self.backingFields._rating === null) { - self.setRating(false); - } - return self.backingFields._rating; - } - function ratingPercentage() { - if (self.backingFields._ratingPercentage === null) { - self.setRatingPercentage(false); - } - return self.backingFields._ratingPercentage; - } - function setAggressiveRating(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - var value = 0; - if (self.ElementField.IndexEnabled && self.ElementField.referenceRatingMultiplied() > 0) { - switch (self.ElementField.IndexSortType) { - case 1: { - value = (1 - self.numericValueMultipliedPercentage()) / self.ElementField.referenceRatingMultiplied(); - break; - } - case 2: { - value = self.numericValueMultiplied() / self.ElementField.referenceRatingMultiplied(); - break; - } - } - if (!self.ElementField.referenceRatingAllEqualFlag()) { - value = 1 - value; - } - } - if (self.backingFields._aggressiveRating !== value) { - self.backingFields._aggressiveRating = value; - if (updateRelated) { - } - } - } - function setCurrentUserNumericValue(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - var value; - var userCell = self.currentUserCell(); - switch (self.ElementField.DataType) { - case 2: { - value = userCell !== null ? userCell.BooleanValue : 0; - break; - } - case 3: { - value = userCell !== null ? userCell.IntegerValue : 0; - break; - } - case 4: { - value = userCell !== null ? userCell.DecimalValue : 50; - break; - } - case 11: { - value = self.NumericValueTotal !== null ? self.NumericValueTotal : 0; - break; - } - case 12: { - value = userCell !== null ? userCell.DecimalValue : 0; - break; - } - } - if (self.backingFields._currentUserNumericValue !== value) { - self.backingFields._currentUserNumericValue = value; - if (updateRelated) { - self.setNumericValue(); - } - } - } - function setIndexIncome(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - var value = 0; - if (self.ElementField.DataType === 6 && self.SelectedElementItem !== null) { - value = self.SelectedElementItem.totalResourcePoolIncome() / self.SelectedElementItem.ParentCellSet.length; - } - else { - if (self.ElementField.IndexEnabled) { - value = self.ElementField.indexIncome() * self.ratingPercentage(); - } - } - if (self.backingFields._indexIncome !== value) { - self.backingFields._indexIncome = value; - } - } - function setNumericValue(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - var value; - if (typeof self.ElementField !== 'undefined') { - switch (self.ElementField.Element.ResourcePool.RatingMode) { - case 1: { - value = self.currentUserNumericValue(); - break; - } - case 2: { - value = self.numericValueAverage(); - break; - } - } - } - if (self.backingFields._numericValue !== value) { - self.backingFields._numericValue = value; - if (updateRelated) { - if (self.ElementField.DataType === 11) { - self.ElementItem.setDirectIncome(); - } - self.setNumericValueMultiplied(); - } - } - } - function setNumericValueMultiplied(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - var value; - if (typeof self.ElementField === 'undefined') { - value = 0; - } - else { - value = self.numericValue() * self.ElementItem.multiplier(); - } - if (self.backingFields._numericValueMultiplied !== value) { - self.backingFields._numericValueMultiplied = value; - if (updateRelated) { - self.ElementField.setNumericValueMultiplied(); - } - } - } - function setNumericValueMultipliedPercentage(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - var value = 0; - if (self.ElementField.IndexEnabled && self.ElementField.numericValueMultiplied() > 0) { - value = self.numericValueMultiplied() / self.ElementField.numericValueMultiplied(); - } - if (self.backingFields._numericValueMultipliedPercentage !== value) { - self.backingFields._numericValueMultipliedPercentage = value; - if (updateRelated) { - } - } - } - function setOtherUsersNumericValueCount() { - self.backingFields._otherUsersNumericValueCount = self.NumericValueCount; - if (self.UserElementCellSet.length > 0) { - self.backingFields._otherUsersNumericValueCount--; - } - } - function setOtherUsersNumericValueTotal() { - self.backingFields._otherUsersNumericValueTotal = self.NumericValueTotal !== null ? - self.NumericValueTotal : - 0; - if (self.UserElementCellSet.length > 0) { - var userValue = 0; - switch (self.ElementField.DataType) { - case 2: { - userValue = self.UserElementCellSet[0].BooleanValue; - break; - } - case 3: { - userValue = self.UserElementCellSet[0].IntegerValue; - break; - } - case 4: { - userValue = self.UserElementCellSet[0].DecimalValue; - break; - } - case 11: { - userValue = self.UserElementCellSet[0].DecimalValue; - break; - } - } - self.backingFields._otherUsersNumericValueTotal -= userValue; - } - } - function setPassiveRating(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - var value = 0; - if (self.ElementField.IndexEnabled) { - switch (self.ElementField.IndexSortType) { - case 1: { - value = self.numericValueMultipliedPercentage(); - break; - } - case 2: { - if (self.ElementField.passiveRating() > 0) { - value = (1 - self.numericValueMultipliedPercentage()) / self.ElementField.passiveRating(); - } - break; - } - } - } - if (self.backingFields._passiveRating !== value) { - self.backingFields._passiveRating = value; - if (updateRelated) { - } - } - } - function setRating(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - var value = 0; - if (self.ElementField.ElementCellSet.length === 1) { - value = 1; - } - else { - switch (self.ElementField.IndexCalculationType) { - case 1: - { - value = self.aggressiveRating(); - break; - } - case 2: - { - value = self.passiveRating(); - break; - } - } - } - if (self.backingFields._rating !== value) { - self.backingFields._rating = value; - if (updateRelated) { - } - } - } - function setRatingPercentage(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - var value = 0; - if (self.ElementField.IndexEnabled && self.ElementField.rating() > 0) { - value = self.rating() / self.ElementField.rating(); - } - if (self.backingFields._ratingPercentage !== value) { - self.backingFields._ratingPercentage = value; - if (updateRelated) { - } - } - } - function value() { - var value = null; - switch (self.ElementField.DataType) { - case 1: { - if (self.UserElementCellSet.length > 0) { - value = self.UserElementCellSet[0].StringValue; - } - break; - } - case 2: { - if (self.UserElementCellSet.length > 0) { - value = self.UserElementCellSet[0].BooleanValue ? 'True' : 'False'; - } - break; - } - case 3: { - if (self.UserElementCellSet.length > 0) { - value = self.UserElementCellSet[0].IntegerValue; - } - break; - } - case 4: - case 11: - case 12: { - if (self.UserElementCellSet.length > 0) { - value = self.UserElementCellSet[0].DecimalValue; - } - break; - } - case 6: { - if (self.SelectedElementItem !== null) { - value = self.SelectedElementItem.Name; - } - } - } - return value; - } - } - } -})(M32 || (M32 = {})); -var M33; -(function (M33) { - 'use strict'; - var factoryId = 'ElementField'; - angular.module('main') - .factory(factoryId, ['logger', '$rootScope', elementFieldFactory]); - function elementFieldFactory(logger, $rootScope) { - logger = logger.forSource(factoryId); - Object.defineProperty(ElementField.prototype, 'DataType', { - enumerable: true, - configurable: true, - get: function () { return this.backingFields._dataType; }, - set: function (value) { - var self = this; - if (self.backingFields._dataType !== value) { - self.backingFields._dataType = value; - $rootScope.$broadcast('ElementField_DataTypeChanged', this); - } - } - }); - Object.defineProperty(ElementField.prototype, 'IndexEnabled', { - enumerable: true, - configurable: true, - get: function () { return this.backingFields._indexEnabled; }, - set: function (value) { - if (this.backingFields._indexEnabled !== value) { - this.backingFields._indexEnabled = value; - this.IndexCalculationType = value ? 1 : 0; - this.IndexSortType = value ? 1 : 0; - $rootScope.$broadcast('ElementField_IndexEnabledChanged', this); - } - } - }); - return ElementField; - function ElementField() { - var self = this; - self.Id = 0; - self.ElementId = 0; - self.Name = ''; - self.SelectedElementId = null; - self.UseFixedValue = null; - self.IndexCalculationType = 0; - self.IndexSortType = 0; - self.SortOrder = 0; - self.IndexRatingTotal = 0; - self.IndexRatingCount = 0; - self.backingFields = { - _dataType: 1, - _indexEnabled: false, - _currentUserIndexRating: null, - _otherUsersIndexRatingTotal: null, - _otherUsersIndexRatingCount: null, - _indexRating: null, - _indexRatingPercentage: null, - _numericValueMultiplied: null, - _passiveRating: null, - _referenceRatingMultiplied: null, - _referenceRatingAllEqualFlag: true, - _aggressiveRating: null, - _rating: null, - _indexIncome: null - }; - self.currentUserElementField = currentUserElementField; - self.currentUserIndexRating = currentUserIndexRating; - self.indexIncome = indexIncome; - self.indexRating = indexRating; - self.indexRatingAverage = indexRatingAverage; - self.indexRatingCount = indexRatingCount; - self.indexRatingPercentage = indexRatingPercentage; - self.indexRatingTotal = indexRatingTotal; - self.numericValueMultiplied = numericValueMultiplied; - self.otherUsersIndexRatingCount = otherUsersIndexRatingCount; - self.otherUsersIndexRatingTotal = otherUsersIndexRatingTotal; - self.passiveRating = passiveRating; - self.rating = rating; - self.referenceRatingAllEqualFlag = referenceRatingAllEqualFlag; - self.referenceRatingMultiplied = referenceRatingMultiplied; - self.setCurrentUserIndexRating = setCurrentUserIndexRating; - self.setIndexIncome = setIndexIncome; - self.setIndexRating = setIndexRating; - self.setIndexRatingPercentage = setIndexRatingPercentage; - self.setNumericValueMultiplied = setNumericValueMultiplied; - self.setOtherUsersIndexRatingCount = setOtherUsersIndexRatingCount; - self.setOtherUsersIndexRatingTotal = setOtherUsersIndexRatingTotal; - self.setPassiveRating = setPassiveRating; - self.setRating = setRating; - self.setReferenceRatingAllEqualFlag = setReferenceRatingAllEqualFlag; - self.setReferenceRatingMultiplied = setReferenceRatingMultiplied; - function currentUserElementField() { - return self.UserElementFieldSet.length > 0 ? - self.UserElementFieldSet[0] : - null; - } - function currentUserIndexRating() { - if (self.backingFields._currentUserIndexRating === null) { - self.setCurrentUserIndexRating(false); - } - return self.backingFields._currentUserIndexRating; - } - function indexIncome() { - if (self.backingFields._indexIncome === null) { - self.setIndexIncome(false); - } - return self.backingFields._indexIncome; - } - function indexRating() { - if (self.backingFields._indexRating === null) { - self.setIndexRating(false); - } - return self.backingFields._indexRating; - } - function indexRatingAverage() { - if (self.indexRatingCount() === null) { - return null; - } - return self.indexRatingCount() === 0 ? - 0 : - self.indexRatingTotal() / self.indexRatingCount(); - } - function indexRatingCount() { - return self.otherUsersIndexRatingCount() + 1; - } - function indexRatingPercentage() { - if (self.backingFields._indexRatingPercentage === null) { - self.setIndexRatingPercentage(false); - } - return self.backingFields._indexRatingPercentage; - } - function indexRatingTotal() { - return self.otherUsersIndexRatingTotal() + self.currentUserIndexRating(); - } - function numericValueMultiplied() { - if (self.backingFields._numericValueMultiplied === null) { - self.setNumericValueMultiplied(false); - } - return self.backingFields._numericValueMultiplied; - } - function otherUsersIndexRatingCount() { - if (self.backingFields._otherUsersIndexRatingCount === null) { - self.setOtherUsersIndexRatingCount(); - } - return self.backingFields._otherUsersIndexRatingCount; - } - function otherUsersIndexRatingTotal() { - if (self.backingFields._otherUsersIndexRatingTotal === null) { - self.setOtherUsersIndexRatingTotal(); - } - return self.backingFields._otherUsersIndexRatingTotal; - } - function passiveRating() { - if (self.backingFields._passiveRating === null) { - self.setPassiveRating(false); - } - return self.backingFields._passiveRating; - } - function rating() { - if (self.backingFields._rating === null) { - self.setRating(false); - } - return self.backingFields._rating; - } - function referenceRatingAllEqualFlag(value) { - return self.backingFields._referenceRatingAllEqualFlag; - } - function referenceRatingMultiplied() { - if (self.backingFields._referenceRatingMultiplied === null) { - self.setReferenceRatingMultiplied(false); - } - return self.backingFields._referenceRatingMultiplied; - } - function setCurrentUserIndexRating(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - var value = self.currentUserElementField() !== null ? - self.currentUserElementField().Rating : - 50; - if (self.backingFields._currentUserIndexRating !== value) { - self.backingFields._currentUserIndexRating = value; - if (updateRelated) { - self.setIndexRating(); - } - } - } - function setIndexIncome(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - var value = self.Element.totalResourcePoolAmount() * self.indexRatingPercentage(); - if (self.backingFields._indexIncome !== value) { - self.backingFields._indexIncome = value; - if (updateRelated) { - self.ElementCellSet.forEach(function (cell) { - cell.setIndexIncome(); - }); - } - } - } - function setIndexRating(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - var value = 0; - switch (self.Element.ResourcePool.RatingMode) { - case 1: { - value = self.currentUserIndexRating(); - break; - } - case 2: { - value = self.indexRatingAverage(); - break; - } - } - if (self.backingFields._indexRating !== value) { - self.backingFields._indexRating = value; - if (updateRelated) { - self.Element.ResourcePool.mainElement().setIndexRating(); - } - } - } - function setIndexRatingPercentage(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - var value = 0; - var elementIndexRating = self.Element.ResourcePool.mainElement().indexRating(); - if (elementIndexRating === 0) { - value = 0; - } - else { - value = self.indexRating() / elementIndexRating; - } - if (self.backingFields._indexRatingPercentage !== value) { - self.backingFields._indexRatingPercentage = value; - if (updateRelated) { - self.setIndexIncome(); - } - } - } - function setNumericValueMultiplied(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - var value = 0; - if (self.ElementCellSet.length === 0) { - value = 0; - } - else { - self.ElementCellSet.forEach(function (cell) { - value += cell.numericValueMultiplied(); - }); - } - if (self.backingFields._numericValueMultiplied !== value) { - self.backingFields._numericValueMultiplied = value; - if (updateRelated && self.IndexEnabled) { - self.ElementCellSet.forEach(function (cell) { - cell.setNumericValueMultipliedPercentage(false); - }); - self.setPassiveRating(false); - self.ElementCellSet.forEach(function (cell) { - cell.setPassiveRating(false); - }); - self.setReferenceRatingMultiplied(false); - self.ElementCellSet.forEach(function (cell) { - cell.setAggressiveRating(false); - }); - self.ElementCellSet.forEach(function (cell) { - cell.setRating(false); - }); - self.setRating(false); - self.ElementCellSet.forEach(function (cell) { - cell.setRatingPercentage(false); - }); - self.ElementCellSet.forEach(function (cell) { - cell.setIndexIncome(false); - }); - } - } - } - function setOtherUsersIndexRatingCount() { - self.backingFields._otherUsersIndexRatingCount = self.IndexRatingCount; - if (self.currentUserElementField() !== null) { - self.backingFields._otherUsersIndexRatingCount--; - } - } - function setOtherUsersIndexRatingTotal() { - self.backingFields._otherUsersIndexRatingTotal = self.IndexRatingTotal !== null ? - self.IndexRatingTotal : - 0; - if (self.currentUserElementField() !== null) { - self.backingFields._otherUsersIndexRatingTotal -= self.currentUserElementField().Rating; - } - } - function setPassiveRating(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - var value = 0; - self.ElementCellSet.forEach(function (cell) { - value += 1 - cell.numericValueMultipliedPercentage(); - }); - if (self.backingFields._passiveRating !== value) { - self.backingFields._passiveRating = value; - if (updateRelated) { - } - } - } - function setRating(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - var value = 0; - self.ElementCellSet.forEach(function (cell) { - value += cell.rating(); - }); - if (self.backingFields._rating !== value) { - self.backingFields._rating = value; - if (updateRelated) { - self.ElementCellSet.forEach(function (cell) { - cell.setRatingPercentage(false); - }); - self.setIndexIncome(); - } - } - } - function setReferenceRatingAllEqualFlag(value) { - if (self.backingFields._referenceRatingAllEqualFlag !== value) { - self.backingFields._referenceRatingAllEqualFlag = value; - return true; - } - return false; - } - function setReferenceRatingMultiplied(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - var value = null; - var allEqualFlag = true; - if (self.ElementCellSet.length === 0) { - value = 0; - } - else { - self.ElementCellSet.forEach(function (cell) { - if (value === null) { - switch (self.IndexSortType) { - case 1: { - value = (1 - cell.numericValueMultipliedPercentage()); - break; - } - case 2: { - value = cell.numericValueMultiplied(); - break; - } - } - } - else { - switch (self.IndexSortType) { - case 1: { - if (1 - cell.numericValueMultipliedPercentage() !== value) { - allEqualFlag = false; - } - if (1 - cell.numericValueMultipliedPercentage() > value) { - value = 1 - cell.numericValueMultipliedPercentage(); - } - break; - } - case 2: { - if (cell.numericValueMultiplied() !== value) { - allEqualFlag = false; - } - if (cell.numericValueMultiplied() > value) { - value = cell.numericValueMultiplied(); - } - break; - } - } - } - }); - } - var flagUpdated = self.setReferenceRatingAllEqualFlag(allEqualFlag); - var ratingUpdated = false; - if (self.backingFields._referenceRatingMultiplied !== value) { - self.backingFields._referenceRatingMultiplied = value; - ratingUpdated = true; - } - if ((flagUpdated || ratingUpdated) && updateRelated) { - self.ElementCellSet.forEach(function (cell) { - cell.setAggressiveRating(false); - }); - } - } - } - } -})(M33 || (M33 = {})); -var M34; -(function (M34) { - 'use strict'; - var factoryId = 'ElementItem'; - angular.module('main') - .factory(factoryId, ['logger', elementItemFactory]); - function elementItemFactory(logger) { - logger = logger.forSource(factoryId); - return ElementItem; - function ElementItem() { - var self = this; - self.Id = 0; - self.ElementId = 0; - self.Name = ''; - self.backingFields = { - _elementCellIndexSet: null, - _directIncome: null, - _multiplier: null, - _totalDirectIncome: null, - _resourcePoolAmount: null, - _totalResourcePoolAmount: null, - _totalResourcePoolIncome: null - }; - self.directIncome = directIncome; - self.directIncomeIncludingResourcePoolAmount = directIncomeIncludingResourcePoolAmount; - self.elementCellIndexSet = elementCellIndexSet; - self.incomeStatus = incomeStatus; - self.multiplier = multiplier; - self.resourcePoolAmount = resourcePoolAmount; - self.setDirectIncome = setDirectIncome; - self.setElementCellIndexSet = setElementCellIndexSet; - self.setMultiplier = setMultiplier; - self.setResourcePoolAmount = setResourcePoolAmount; - self.setTotalDirectIncome = setTotalDirectIncome; - self.setTotalResourcePoolAmount = setTotalResourcePoolAmount; - self.totalDirectIncome = totalDirectIncome; - self.totalDirectIncomeIncludingResourcePoolAmount = totalDirectIncomeIncludingResourcePoolAmount; - self.totalIncome = totalIncome; - self.totalResourcePoolAmount = totalResourcePoolAmount; - self.totalResourcePoolIncome = totalResourcePoolIncome; - function directIncome() { - if (self.backingFields._directIncome === null) { - self.setDirectIncome(false); - } - return self.backingFields._directIncome; - } - function directIncomeIncludingResourcePoolAmount() { - return self.directIncome() + self.resourcePoolAmount(); - } - function elementCellIndexSet() { - if (self.backingFields._elementCellIndexSet === null) { - self.setElementCellIndexSet(); - } - return self.backingFields._elementCellIndexSet; - } - function getElementCellIndexSet(elementItem) { - var indexSet = []; - var sortedElementCellSet = elementItem.ElementCellSet.sort(function (a, b) { return (a.ElementField.SortOrder - b.ElementField.SortOrder); }); - sortedElementCellSet.forEach(function (cell) { - if (cell.ElementField.IndexEnabled) { - indexSet.push(cell); - } - if (cell.ElementField.DataType === 6 && cell.SelectedElementItem !== null) { - var childIndexSet = getElementCellIndexSet(cell.SelectedElementItem); - if (childIndexSet.length > 0) { - indexSet.push(cell); - } - } - }); - return indexSet; - } - function incomeStatus() { - var totalIncome = self.totalIncome(); - var averageIncome = Number(self.Element.totalIncomeAverage().toFixed(2)); - if (totalIncome === averageIncome) { - return 'average'; - } - else if (totalIncome < averageIncome) { - return 'low'; - } - else if (totalIncome > averageIncome) { - return 'high'; - } - } - function multiplier() { - if (self.backingFields._multiplier === null) { - self.setMultiplier(false); - } - return self.backingFields._multiplier; - } - function resourcePoolAmount() { - if (self.backingFields._resourcePoolAmount === null) { - self.setResourcePoolAmount(false); - } - return self.backingFields._resourcePoolAmount; - } - function setDirectIncome(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - var directIncomeCell = null; - var result = self.ElementCellSet.filter(function (elementCell) { return (elementCell.ElementField.DataType === 11); }); - if (result.length > 0) { - directIncomeCell = result[0]; - } - var value; - if (directIncomeCell === null) { - value = 0; - } - else { - value = directIncomeCell.numericValue(); - } - if (self.backingFields._directIncome !== value) { - self.backingFields._directIncome = value; - if (updateRelated) { - self.setTotalDirectIncome(); - self.setResourcePoolAmount(); - } - } - } - function setElementCellIndexSet() { - self.backingFields._elementCellIndexSet = getElementCellIndexSet(self); - } - function setMultiplier(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - var multiplierCell = null; - var result = self.ElementCellSet.filter(function (elementCell) { return (elementCell.ElementField.DataType === 12); }); - if (result.length > 0) { - multiplierCell = result[0]; - } - var value = 0; - if (multiplierCell === null) { - value = 1; - } - else { - if (multiplierCell.currentUserCell() === null || - multiplierCell.currentUserCell().DecimalValue === null) { - value = 0; - } - else { - value = multiplierCell.currentUserCell().DecimalValue; - } - } - if (self.backingFields._multiplier !== value) { - self.backingFields._multiplier = value; - self.setTotalDirectIncome(); - self.setTotalResourcePoolAmount(); - } - } - function setResourcePoolAmount(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - var value = self.directIncome() * self.Element.ResourcePool.resourcePoolRatePercentage(); - if (self.backingFields._resourcePoolAmount !== value) { - self.backingFields._resourcePoolAmount = value; - if (updateRelated) { - self.setTotalResourcePoolAmount(); - } - } - } - function setTotalDirectIncome(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - var value = self.directIncome() * self.multiplier(); - if (self.backingFields._totalDirectIncome !== value) { - self.backingFields._totalDirectIncome = value; - if (updateRelated) { - } - } - } - function setTotalResourcePoolAmount(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - var value = self.resourcePoolAmount() * self.multiplier(); - if (self.backingFields._totalResourcePoolAmount !== value) { - self.backingFields._totalResourcePoolAmount = value; - if (updateRelated) { - } - } - } - function totalDirectIncome() { - if (self.backingFields._totalDirectIncome === null) { - self.setTotalDirectIncome(false); - } - return self.backingFields._totalDirectIncome; - } - function totalDirectIncomeIncludingResourcePoolAmount() { - return self.directIncomeIncludingResourcePoolAmount() * self.multiplier(); - } - function totalIncome() { - var totalIncome = self.totalDirectIncome() + self.totalResourcePoolIncome(); - return Number(totalIncome.toFixed(2)); - } - function totalResourcePoolAmount() { - if (self.backingFields._totalResourcePoolAmount === null) { - self.setTotalResourcePoolAmount(false); - } - return self.backingFields._totalResourcePoolAmount; - } - function totalResourcePoolIncome() { - var value = 0; - self.ElementCellSet.forEach(function (cell) { - value += cell.indexIncome(); - }); - if (self.backingFields._totalResourcePoolIncome !== value) { - self.backingFields._totalResourcePoolIncome = value; - self.ParentCellSet.forEach(function (parentCell) { - parentCell.setIndexIncome(); - }); - } - return value; - } - } - } -})(M34 || (M34 = {})); -var M35; -(function (M35) { - 'use strict'; - var factoryId = 'Enums'; - angular.module('main') - .factory(factoryId, ['logger', enumsFactory]); - function enumsFactory(logger) { - logger = logger.forSource(factoryId); - var self = { - ElementFieldDataType: {}, - ElementFieldIndexCalculationType: {}, - ElementFieldIndexSortType: {}, - getEnumKey: getEnumKey - }; - self.ElementFieldDataType = { - 'String': 1, - 'Boolean': 2, - 'Integer': 3, - 'Decimal': 4, - 'Element': 6, - 'DirectIncome': 11, - 'Multiplier': 12 - }; - self.ElementFieldIndexCalculationType = { - 'Aggressive': 1, - 'Passive': 2 - }; - self.ElementFieldIndexSortType = { - 'Highest': 1, - 'Lowest': 2 - }; - function getEnumKey(enumTableKey, value) { - for (var tableKey in self) { - if (enumTableKey === '$get' || enumTableKey === 'getEnumKey') { - return; - } - if (tableKey === enumTableKey) { - for (var valueKey in self[tableKey]) { - if (self[tableKey][valueKey] === value) { - return valueKey; - } - } - } - } - } - return self; - } -})(M35 || (M35 = {})); -var M36; -(function (M36) { - 'use strict'; - var factoryId = 'ResourcePool'; - angular.module('main') - .factory(factoryId, ['logger', resourcePoolFactory]); - function resourcePoolFactory(logger) { - logger = logger.forSource(factoryId); - Object.defineProperty(ResourcePool.prototype, 'Name', { - enumerable: true, - configurable: true, - get: function () { - return this.backingFields._name; - }, - set: function (value) { - var oldStripped = this.stripInvalidChars(this.backingFields._name); - if (this.backingFields._name !== value) { - this.backingFields._name = value; - if (this.Key === oldStripped) { - this.Key = value; - } - } - } - }); - Object.defineProperty(ResourcePool.prototype, 'Key', { - enumerable: true, - configurable: true, - get: function () { - return this.backingFields._key; - }, - set: function (value) { - var newValue = this.stripInvalidChars(value); - if (this.backingFields._key !== newValue) { - this.backingFields._key = newValue; - } - } - }); - Object.defineProperty(ResourcePool.prototype, 'UseFixedResourcePoolRate', { - enumerable: true, - configurable: true, - get: function () { return this.backingFields._useFixedResourcePoolRate; }, - set: function (value) { - if (this.backingFields._useFixedResourcePoolRate !== value) { - this.backingFields._useFixedResourcePoolRate = value; - this.setResourcePoolRate(); - } - } - }); - Object.defineProperty(ResourcePool.prototype, 'RatingMode', { - enumerable: true, - configurable: true, - get: function () { return this.backingFields._ratingMode; }, - set: function (value) { - if (this.backingFields._ratingMode !== value) { - this.backingFields._ratingMode = value; - this.setResourcePoolRate(); - this.ElementSet.forEach(function (element) { - element.ElementFieldSet.forEach(function (field) { - if (field.IndexEnabled) { - field.setIndexRating(); - } - if (!field.UseFixedValue) { - field.ElementCellSet.forEach(function (cell) { - switch (field.DataType) { - case 2: - case 3: - case 4: - case 11: - case 12: { - cell.setNumericValue(); - break; - } - } - }); - } - }); - }); - } - } - }); - return ResourcePool; - function ResourcePool() { - var self = this; - self.Id = 0; - self.UserId = 0; - self.InitialValue = 0; - self.ResourcePoolRateTotal = 0; - self.ResourcePoolRateCount = 0; - self.RatingCount = 0; - self.backingFields = { - _currentUserResourcePoolRate: null, - _isAdded: false, - _name: '', - _key: '', - _otherUsersResourcePoolRateTotal: null, - _otherUsersResourcePoolRateCount: null, - _ratingMode: 1, - _resourcePoolRate: null, - _resourcePoolRatePercentage: null, - _selectedElement: null, - _useFixedResourcePoolRate: false - }; - self.displayMultiplierFunctions = true; - self._init = _init; - self.currentUserResourcePool = currentUserResourcePool; - self.currentUserResourcePoolRate = currentUserResourcePoolRate; - self.displayResourcePoolDetails = displayResourcePoolDetails; - self.displayRatingMode = displayRatingMode; - self.mainElement = mainElement; - self.name = name; - self.otherUsersResourcePoolRateCount = otherUsersResourcePoolRateCount; - self.otherUsersResourcePoolRateTotal = otherUsersResourcePoolRateTotal; - self.resourcePoolRate = resourcePoolRate; - self.resourcePoolRateAverage = resourcePoolRateAverage; - self.resourcePoolRateCount = resourcePoolRateCount; - self.resourcePoolRatePercentage = resourcePoolRatePercentage; - self.resourcePoolRateTotal = resourcePoolRateTotal; - self.selectedElement = selectedElement; - self.setCurrentUserResourcePoolRate = setCurrentUserResourcePoolRate; - self.setOtherUsersResourcePoolRateCount = setOtherUsersResourcePoolRateCount; - self.setOtherUsersResourcePoolRateTotal = setOtherUsersResourcePoolRateTotal; - self.setResourcePoolRate = setResourcePoolRate; - self.setResourcePoolRatePercentage = setResourcePoolRatePercentage; - self.stripInvalidChars = stripInvalidChars; - self.toggleRatingMode = toggleRatingMode; - self.updateCache = updateCache; - self.urlEdit = urlEdit; - self.urlView = urlView; - function _init(setComputedFields) { - setComputedFields = typeof setComputedFields !== 'undefined' ? setComputedFields : false; - if (setComputedFields) { - var userRatings = []; - self.UserResourcePoolSet.forEach(function (userResourcePool) { - self.ResourcePoolRateTotal += userResourcePool.ResourcePoolRate; - self.ResourcePoolRateCount += 1; - if (userRatings.indexOf(userResourcePool.UserId) === -1) { - userRatings.push(userResourcePool.UserId); - } - }); - self.ElementSet.forEach(function (element) { - element.ElementFieldSet.forEach(function (elementField) { - elementField.UserElementFieldSet.forEach(function (userElementField) { - elementField.IndexRatingTotal += userElementField.IndexRating; - elementField.IndexRatingCount += 1; - if (userRatings.indexOf(userElementField.UserId) === -1) { - userRatings.push(userElementField.UserId); - } - }); - elementField.ElementCellSet.forEach(function (elementCell) { - elementCell.UserElementCellSet.forEach(function (userElementCell) { - elementCell.StringValue = ''; - elementCell.NumericValueTotal += userElementCell.DecimalValue; - elementCell.NumericValueCount += 1; - if (elementField.IndexEnabled) { - if (userRatings.indexOf(userElementCell.UserId) === -1) { - userRatings.push(userElementCell.UserId); - } - } - }); - }); - }); - }); - self.RatingCount = userRatings.length; - } - self.setOtherUsersResourcePoolRateTotal(); - self.setOtherUsersResourcePoolRateCount(); - if (typeof self.ElementSet !== 'undefined') { - self.ElementSet.forEach(function (element) { - if (typeof element.ElementFieldSet !== 'undefined') { - element.ElementFieldSet.forEach(function (field) { - field.setOtherUsersIndexRatingTotal(); - field.setOtherUsersIndexRatingCount(); - if (typeof field.ElementCellSet !== 'undefined') { - field.ElementCellSet.forEach(function (cell) { - cell.setOtherUsersNumericValueTotal(); - cell.setOtherUsersNumericValueCount(); - }); - } - }); - } - }); - } - updateCache(); - } - function currentUserResourcePool() { - return self.UserResourcePoolSet.length > 0 ? - self.UserResourcePoolSet[0] : - null; - } - function currentUserResourcePoolRate() { - if (self.backingFields._currentUserResourcePoolRate === null) { - self.setCurrentUserResourcePoolRate(false); - } - return self.backingFields._currentUserResourcePoolRate; - } - function displayResourcePoolDetails() { - return self.selectedElement().directIncomeField() !== null && - self.selectedElement().elementFieldIndexSet().length > 0; - } - function displayRatingMode() { - if (!self.UseFixedResourcePoolRate) { - return true; - } - for (var elementIndex = 0; elementIndex < self.ElementSet.length; elementIndex++) { - var element = self.ElementSet[elementIndex]; - if (element.elementFieldIndexSet().length > 1) { - return true; - } - if (element.elementFieldIndexSet().length > 0 && !element.elementFieldIndexSet()[0].UseFixedValue) { - return true; - } - } - return false; - } - function mainElement() { - var result = self.ElementSet.filter(function (element) { return element.IsMainElement; }); - return result.length > 0 ? result[0] : null; - } - function otherUsersResourcePoolRateCount() { - if (self.backingFields._otherUsersResourcePoolRateCount === null) { - self.setOtherUsersResourcePoolRateCount(); - } - return self.backingFields._otherUsersResourcePoolRateCount; - } - function otherUsersResourcePoolRateTotal() { - if (self.backingFields._otherUsersResourcePoolRateTotal === null) { - self.setOtherUsersResourcePoolRateTotal(); - } - return self.backingFields._otherUsersResourcePoolRateTotal; - } - function resourcePoolRate() { - if (self.backingFields._resourcePoolRate === null) { - self.setResourcePoolRate(false); - } - return self.backingFields._resourcePoolRate; - } - function resourcePoolRateAverage() { - if (self.resourcePoolRateCount() === null) { - return null; - } - return self.resourcePoolRateCount() === 0 ? - 0 : - self.resourcePoolRateTotal() / self.resourcePoolRateCount(); - } - function resourcePoolRateCount() { - return self.UseFixedResourcePoolRate ? - self.currentUserResourcePool() !== null && self.currentUserResourcePool().UserId === self.UserId ? - 1 : - self.otherUsersResourcePoolRateCount() : - self.otherUsersResourcePoolRateCount() + 1; - } - function resourcePoolRatePercentage() { - if (self.backingFields._resourcePoolRatePercentage === null) { - self.setResourcePoolRatePercentage(false); - } - return self.backingFields._resourcePoolRatePercentage; - } - function resourcePoolRateTotal() { - return self.UseFixedResourcePoolRate ? - self.currentUserResourcePool() !== null && self.currentUserResourcePool().UserId === self.UserId ? - self.currentUserResourcePoolRate() : - self.otherUsersResourcePoolRateTotal() : - self.otherUsersResourcePoolRateTotal() + self.currentUserResourcePoolRate(); - } - function selectedElement(value) { - if (typeof value !== 'undefined' && self.backingFields._selectedElement !== value) { - self.backingFields._selectedElement = value; - } - if (self.backingFields._selectedElement === null && self.mainElement()) { - self.backingFields._selectedElement = self.mainElement(); - } - return self.backingFields._selectedElement; - } - function setCurrentUserResourcePoolRate(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - var value = self.currentUserResourcePool() !== null ? - self.currentUserResourcePool().ResourcePoolRate : - 10; - if (self.backingFields._currentUserResourcePoolRate !== value) { - self.backingFields._currentUserResourcePoolRate = value; - if (updateRelated) { - self.setResourcePoolRate(); - } - } - } - function setOtherUsersResourcePoolRateCount() { - self.backingFields._otherUsersResourcePoolRateCount = self.ResourcePoolRateCount; - if (self.currentUserResourcePool() !== null) { - self.backingFields._otherUsersResourcePoolRateCount--; - } - } - function setOtherUsersResourcePoolRateTotal() { - self.backingFields._otherUsersResourcePoolRateTotal = self.ResourcePoolRateTotal !== null ? - self.ResourcePoolRateTotal : - 0; - if (self.currentUserResourcePool() !== null) { - self.backingFields._otherUsersResourcePoolRateTotal -= self.currentUserResourcePool().ResourcePoolRate; - } - } - function setResourcePoolRate(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - var value; - if (self.UseFixedResourcePoolRate) { - value = self.resourcePoolRateAverage(); - } - else { - switch (self.RatingMode) { - case 1: { - value = self.currentUserResourcePoolRate(); - break; - } - case 2: { - value = self.resourcePoolRateAverage(); - break; - } - } - } - if (self.backingFields._resourcePoolRate !== value) { - self.backingFields._resourcePoolRate = value; - if (updateRelated) { - self.setResourcePoolRatePercentage(); - } - } - } - function setResourcePoolRatePercentage(updateRelated) { - updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated; - var value = self.resourcePoolRate() === 0 ? - 0 : - self.resourcePoolRate() / 100; - if (self.backingFields._resourcePoolRatePercentage !== value) { - self.backingFields._resourcePoolRatePercentage = value; - if (updateRelated) { - self.ElementSet.forEach(function (element) { - element.ElementItemSet.forEach(function (item) { - item.setResourcePoolAmount(); - }); - }); - } - } - } - function stripInvalidChars(value) { - if (value !== null) { - value = value.trim() - .replace(/[^-\w\s]/gi, '') - .replace(/\s+/g, '-'); - } - return value; - } - function toggleRatingMode() { - self.RatingMode = self.RatingMode === 1 ? 2 : 1; - } - function updateCache() { - var isUnchanged = false; - self.setCurrentUserResourcePoolRate(); - if (typeof self.ElementSet !== 'undefined') { - self.ElementSet.forEach(function (element) { - element.setElementFieldIndexSet(); - if (typeof element.ElementFieldSet !== 'undefined') { - element.ElementFieldSet.forEach(function (field) { - if (field.IndexEnabled) { - field.setCurrentUserIndexRating(); - } - if (typeof field.ElementCellSet !== 'undefined') { - field.ElementCellSet.forEach(function (cell) { - switch (cell.ElementField.DataType) { - case 1: { - if (cell.UserElementCellSet.length > 0) { - isUnchanged = cell.entityAspect.entityState.isUnchanged(); - cell.StringValue = cell.UserElementCellSet[0].StringValue; - if (isUnchanged) { - cell.entityAspect.acceptChanges(); - } - } - break; - } - case 2: - case 3: - case 4: - { - cell.setCurrentUserNumericValue(); - break; - } - case 11: - { - if (cell.UserElementCellSet.length > 0) { - isUnchanged = cell.entityAspect.entityState.isUnchanged(); - cell.NumericValueTotal = cell.UserElementCellSet[0].DecimalValue; - if (isUnchanged) { - cell.entityAspect.acceptChanges(); - } - } - cell.setCurrentUserNumericValue(); - break; - } - case 12: - { - cell.ElementItem.setMultiplier(); - if (cell.ElementField.IndexEnabled) { - cell.setNumericValueMultiplied(); - } - break; - } - } - }); - } - }); - } - }); - } - } - function urlEdit() { - return self.urlView() + '/edit'; - } - function urlView() { - return '/' + self.User.UserName + '/' + self.Key; - } - } - } -})(M36 || (M36 = {})); -var M37; -(function (M37) { - 'use strict'; - var factoryId = 'User'; - angular.module('main') - .factory(factoryId, ['logger', userFactory]); - function userFactory(logger) { - logger = logger.forSource(factoryId); - return User; - function User() { - var self = this; - self.Id = 0; - self.Email = ''; - self.EmailConfirmed = false; - self.IsAnonymous = false; - self.UserName = ''; - self.SingleUseToken = null; - self.HasPassword = false; - self.FirstName = ''; - self.MiddleName = ''; - self.LastName = ''; - self.PhoneNumber = ''; - self.PhoneNumberConfirmed = false; - self.TwoFactorEnabled = false; - self.AccessFailedCount = 0; - self.LockoutEnabled = false; - self.LockoutEndDateUtc = null; - self.Notes = ''; - self.CreatedOn = new Date(); - self.ModifiedOn = new Date(); - self.DeletedOn = null; - self.isAuthenticated = isAuthenticated; - function isAuthenticated() { - return self.Id > 0; - } - } - } -})(M37 || (M37 = {})); -var M38; -(function (M38) { - 'use strict'; - var factoryId = 'UserElementCell'; - angular.module('main') - .factory(factoryId, ['logger', userElementCellFactory]); - function userElementCellFactory(logger) { - logger = logger.forSource(factoryId); - Object.defineProperty(UserElementCell.prototype, 'DecimalValue', { - enumerable: true, - configurable: true, - get: function () { return this.backingFields._DecimalValue; }, - set: function (value) { - if (this.backingFields._DecimalValue !== value) { - this.backingFields._DecimalValue = value; - } - } - }); - return UserElementCell; - function UserElementCell() { - var self = this; - self.UserId = 0; - self.ElementCellId = 0; - self.StringValue = null; - self.BooleanValue = null; - self.IntegerValue = null; - self.DateTimeValue = null; - self.backingFields = { - _DecimalValue: null - }; - } - } -})(M38 || (M38 = {})); -var M39; -(function (M39) { - 'use strict'; - var factoryId = 'UserElementField'; - angular.module('main') - .factory(factoryId, ['logger', userElementFieldFactory]); - function userElementFieldFactory(logger) { - logger = logger.forSource(factoryId); - return UserElementField; - function UserElementField() { - var self = this; - self.UserId = 0; - self.ElementFieldId = 0; - self.Rating = 0; - } - } -})(M39 || (M39 = {})); -var M40; -(function (M40) { - 'use strict'; - var factoryId = 'UserResourcePool'; - angular.module('main') - .factory(factoryId, ['logger', userResourcePoolFactory]); - function userResourcePoolFactory(logger) { - logger = logger.forSource(factoryId); - return UserResourcePool; - function UserResourcePool() { - var self = this; - self.UserId = 0; - self.ResourcePoolId = 0; - self.ResourcePoolRate = 0; - } - } -})(M40 || (M40 = {})); -var M41; -(function (M41) { - 'use strict'; - var factoryId = 'applicationFactory'; - angular.module('main') - .factory(factoryId, ['logger', 'serviceAppUrl', '$http', '$q', applicationFactory]); - function applicationFactory(logger, serviceAppUrl, $http, $q) { - logger = logger.forSource(factoryId); - var applicationInfoUrl = serviceAppUrl + '/api/Application/ApplicationInfo'; - var applicationInfo = null; - var factory = { - getApplicationInfo: getApplicationInfo - }; - return factory; - function getApplicationInfo() { - var deferred = $q.defer(); - if (applicationInfo !== null) { - deferred.resolve(applicationInfo); - } - else { - $http.get(applicationInfoUrl) - .success(function (data) { - applicationInfo = data; - deferred.resolve(applicationInfo); - }) - .error(function (data, status, headers, config) { - deferred.reject({ data: data, status: status, headers: headers, config: config }); - }); - } - return deferred.promise; - } - } -})(M41 || (M41 = {})); -var M42; -(function (M42) { - 'use strict'; - var factoryId = 'dataContext'; - angular.module('main') - .factory(factoryId, ['entityManagerFactory', 'logger', 'serviceAppUrl', '$http', '$q', '$rootScope', '$timeout', '$window', dataContext]); - function dataContext(entityManagerFactory, logger, serviceAppUrl, $http, $q, $rootScope, $timeout, $window) { - logger = logger.forSource(factoryId); - var addPasswordUrl = serviceAppUrl + '/api/Account/AddPassword'; - var changeEmailUrl = serviceAppUrl + '/api/Account/ChangeEmail'; - var changePasswordUrl = serviceAppUrl + '/api/Account/ChangePassword'; - var changeUserNameUrl = serviceAppUrl + '/api/Account/ChangeUserName'; - var confirmEmailUrl = serviceAppUrl + '/api/Account/ConfirmEmail'; - var registerUrl = serviceAppUrl + '/api/Account/Register'; - var registerAnonymousUrl = serviceAppUrl + '/api/Account/RegisterAnonymous'; - var resendConfirmationEmailUrl = serviceAppUrl + '/api/Account/ResendConfirmationEmail'; - var resetPasswordUrl = serviceAppUrl + '/api/Account/ResetPassword'; - var resetPasswordRequestUrl = serviceAppUrl + '/api/Account/ResetPasswordRequest'; - var tokenUrl = serviceAppUrl + '/api/Token'; - var currentUser = null; - var fetchedUsers = []; - var initializeCurrentUserPromise = null; - var manager = null; - var metadataReadyPromise = null; - var saveTimer = null; - var factory = { - addPassword: addPassword, - changeEmail: changeEmail, - changePassword: changePassword, - changeUserName: changeUserName, - confirmEmail: confirmEmail, - createEntity: createEntity, - executeQuery: executeQuery, - fetchEntityByKey: fetchEntityByKey, - getChanges: getChanges, - getChangesCount: getChangesCount, - getCurrentUser: getCurrentUser, - getEntities: getEntities, - getEntityByKey: getEntityByKey, - getToken: getToken, - getUniqueEmail: getUniqueEmail, - getUniqueUserName: getUniqueUserName, - getUser: getUser, - hasChanges: hasChanges, - initializeCurrentUser: initializeCurrentUser, - login: login, - logout: logout, - metadataReady: metadataReady, - register: register, - registerAnonymous: registerAnonymous, - rejectChanges: rejectChanges, - resendConfirmationEmail: resendConfirmationEmail, - resetPassword: resetPassword, - resetPasswordRequest: resetPasswordRequest, - saveChanges: saveChanges - }; - _init(); - return factory; - function _init() { - manager = entityManagerFactory.newManager(); - } - function addPassword(addPasswordBindingModel) { - return $http.post(addPasswordUrl, addPasswordBindingModel) - .success(function (updatedUser) { - currentUser.HasPassword = null; - syncRowVersion(currentUser, updatedUser); - currentUser.entityAspect.acceptChanges(); - }) - .error(handleErrorResult); - } - function changeEmail(changeEmailBindingModel) { - return $http.post(changeEmailUrl, changeEmailBindingModel) - .success(function (updatedUser) { - currentUser.Email = updatedUser.Email; - currentUser.EmailConfirmed = false; - currentUser.IsAnonymous = false; - currentUser.UserName = updatedUser.UserName; - syncRowVersion(currentUser, updatedUser); - currentUser.entityAspect.acceptChanges(); - $rootScope.$broadcast('dataContext_currentUserEmailAddressChanged'); - }) - .error(handleErrorResult); - } - function changePassword(changePasswordBindingModel) { - return $http.post(changePasswordUrl, changePasswordBindingModel) - .success(function (updatedUser) { - syncRowVersion(currentUser, updatedUser); - currentUser.entityAspect.acceptChanges(); - }) - .error(handleErrorResult); - } - function changeUserName(changeUserNameBindingModel) { - return $http.post(changeUserNameUrl, changeUserNameBindingModel) - .success(function (updatedUser) { - currentUser.UserName = updatedUser.UserName; - var token = angular.fromJson($window.localStorage.getItem('token')); - token.userName = updatedUser.UserName; - $window.localStorage.setItem('token', angular.toJson(token)); - syncRowVersion(currentUser, updatedUser); - currentUser.entityAspect.acceptChanges(); - }) - .error(handleErrorResult); - } - function confirmEmail(confirmEmailBindingModel) { - return $http.post(confirmEmailUrl, confirmEmailBindingModel) - .success(function (updatedUser) { - currentUser.EmailConfirmed = true; - syncRowVersion(currentUser, updatedUser); - currentUser.entityAspect.acceptChanges(); - }) - .error(handleErrorResult); - } - function createEntity(entityType, initialValues, entityState, mergeStrategy) { - return manager.createEntity(entityType, initialValues, entityState, mergeStrategy); - } - function createGuestUser() { - var user = createEntity('User', { - Email: getUniqueEmail(), - UserName: getUniqueUserName(), - FirstName: '', - MiddleName: '', - LastName: '', - IsAnonymous: true - }); - user.entityAspect.acceptChanges(); - return user; - } - function executeQuery(query) { - return manager.executeQuery(query); - } - function fetchEntityByKey(typeName, keyValues, checkLocalCacheFirst) { - return manager.fetchEntityByKey(typeName, keyValues, checkLocalCacheFirst); - } - function getChanges(entityTypeName, entityState) { - entityTypeName = typeof entityTypeName !== 'undefined' ? entityTypeName : null; - entityState = typeof entityState !== 'undefined' ? entityState : null; - var all = manager.getChanges(); - var changes = []; - all.forEach(function (change) { - if ((entityTypeName === null || change.entityType.shortName === entityTypeName) && - (entityState === null || change.entityAspect.entityState === entityState)) { - changes.push(change); - } - }); - return changes; - } - function getChangesCount() { - return getChanges().length; - } - function getCurrentUser() { - return currentUser; - } - function getEntities(entityTypes, entityStates) { - return manager.getEntities(entityTypes, entityStates); - } - function getEntityByKey(entityType, entityKey) { - return manager.getEntityByKey(entityType, entityKey); - } - function getToken(userName, password, rememberMe, singleUseToken) { - var deferred = $q.defer(); - var tokenData = 'grant_type=password' + - '&username=' + userName + - '&password=' + password + - '&rememberMe=' + rememberMe + - '&singleUseToken=' + singleUseToken; - $http.post(tokenUrl, tokenData, { 'Content-Type': 'application/x-www-form-urlencoded' }) - .success(function (token) { - $window.localStorage.setItem('token', angular.toJson(token)); - deferred.resolve(); - }) - .error(function (data, status, headers, config) { - handleErrorResult(data, status, headers, config); - deferred.reject(data); - }); - return deferred.promise; - } - function getUniqueEmail() { - return getUniqueUserName() + '@forcrowd.org'; - } - function getUniqueUserName() { - var now = new Date(); - var year = now.getFullYear().toString().substring(2); - var month = now.getMonth() + 1; - var day = now.getDate(); - var hour = now.getHours(); - var minute = now.getMinutes(); - var second = now.getSeconds(); - return 'guest' + year + month + day + hour + minute + second; - } - function getUser(userName) { - var alreadyFetched = fetchedUsers.some(function (fetched) { return (userName === fetched); }); - var query = breeze.EntityQuery - .from('Users') - .expand('ResourcePoolSet') - .where('UserName', 'eq', userName); - if (alreadyFetched) { - query = query.using(breeze.FetchStrategy.FromLocalCache); - } - else { - query = query.using(breeze.FetchStrategy.FromServer); - } - return executeQuery(query) - .then(success) - .catch(failed); - function success(response) { - if (response.results.length === 0) { - return null; - } - var user = response.results[0]; - fetchedUsers.push(user.UserName); - return user; - } - function failed(error) { - var message = error.message || 'ResourcePool query failed'; - logger.logError(message, error, true); - } - } - function handleErrorResult(data, status, headers, config) { - var message = ''; - if (typeof data.ModelState !== 'undefined') { - for (var key in data.ModelState) { - var array = data.ModelState[key]; - array.forEach(addErrorMessage); - } - } - function addErrorMessage(error) { - message += error + '
'; - } - if (message === '' && typeof data.Message !== 'undefined') { - message = data.Message; - } - if (message === '' && typeof data.error_description !== 'undefined') { - message = data.error_description; - } - logger.logError(message, null, true); - } - function hasChanges() { - return getChanges().length > 0; - } - function initializeCurrentUser(resetPromise) { - resetPromise = typeof resetPromise !== 'undefined' ? resetPromise : false; - if (initializeCurrentUserPromise === null || resetPromise) { - var deferred = $q.defer(); - initializeCurrentUserPromise = deferred.promise; - if ($window.localStorage.getItem('token') === null) { - metadataReady() - .then(function () { - currentUser = createGuestUser(); - $rootScope.$broadcast('dataContext_currentUserChanged', currentUser); - deferred.resolve(currentUser); - }) - .catch(function () { - deferred.reject(); - }); - } - else { - var token = angular.fromJson($window.localStorage.getItem('token')); - var userName = token.userName; - var query = breeze.EntityQuery - .from('Users') - .expand('ResourcePoolSet') - .where('UserName', 'eq', userName) - .using(breeze.FetchStrategy.FromServer); - executeQuery(query) - .then(success) - .catch(failed); - } - } - return initializeCurrentUserPromise; - function success(response) { - if (response.results.length > 0) { - currentUser = response.results[0]; - } - else { - $window.localStorage.removeItem('token'); - if (currentUser === null) { - currentUser = createGuestUser(); - } - } - $rootScope.$broadcast('dataContext_currentUserChanged', currentUser); - deferred.resolve(currentUser); - } - function failed(error) { - var message = error.message || 'User query failed'; - deferred.reject(message); - throw new Error(message); - } - } - function login(userName, password, rememberMe, singleUseToken) { - return getToken(userName, password, rememberMe, singleUseToken) - .then(function () { - manager.clear(); - fetchedUsers = []; - return initializeCurrentUser(true); - }); - } - function logout() { - $window.localStorage.removeItem('token'); - manager.clear(); - fetchedUsers = []; - return initializeCurrentUser(true); - } - function metadataReady() { - if (metadataReadyPromise === null) { - var deferred = $q.defer(); - metadataReadyPromise = deferred.promise; - if (manager.metadataStore.isEmpty()) { - manager.fetchMetadata() - .then(function () { - deferred.resolve(); - }, function (error) { - deferred.reject(error); - }); - } - else { - deferred.resolve(); - } - } - return metadataReadyPromise; - } - function register(registerBindingModel, rememberMe) { - var deferred = $q.defer(); - $http.post(registerUrl, registerBindingModel, rememberMe) - .success(function (updatedUser) { - currentUser.Id = updatedUser.Id; - currentUser.UserName = updatedUser.UserName; - currentUser.Email = updatedUser.Email; - currentUser.IsAnonymous = updatedUser.IsAnonymous; - currentUser.HasPassword = updatedUser.HasPassword; - currentUser.SingleUseToken = updatedUser.SingleUseToken; - syncRowVersion(currentUser, updatedUser); - currentUser.entityAspect.acceptChanges(); - getToken(registerBindingModel.UserName, registerBindingModel.Password, rememberMe) - .then(function () { - saveChanges() - .then(function () { - deferred.resolve(); - }) - .catch(function () { - deferred.reject(); - }); - }) - .catch(function () { - deferred.reject(); - }); - }) - .error(function (data, status, headers, config) { - handleErrorResult(data, status, headers, config); - deferred.reject(data); - }); - return deferred.promise; - } - function registerAnonymous(registerAnonymousBindingModel, rememberMe) { - var deferred = $q.defer(); - $http.post(registerAnonymousUrl, registerAnonymousBindingModel) - .success(function (updatedUser) { - currentUser.Id = updatedUser.Id; - currentUser.Email = updatedUser.Email; - currentUser.UserName = updatedUser.UserName; - currentUser.IsAnonymous = updatedUser.IsAnonymous; - currentUser.HasPassword = updatedUser.HasPassword; - currentUser.SingleUseToken = updatedUser.SingleUseToken; - syncRowVersion(currentUser, updatedUser); - currentUser.entityAspect.acceptChanges(); - getToken('', '', rememberMe, updatedUser.SingleUseToken) - .then(function () { - saveChanges() - .then(function () { - deferred.resolve(); - }) - .catch(function () { - deferred.reject(); - }); - }) - .catch(function () { - deferred.reject(); - }); - }) - .error(function (data, status, headers, config) { - handleErrorResult(data, status, headers, config); - deferred.reject(data); - }); - return deferred.promise; - } - function rejectChanges() { - manager.rejectChanges(); - } - function resendConfirmationEmail() { - return $http.post(resendConfirmationEmailUrl).error(handleErrorResult); - } - function resetPassword(resetPasswordBindingModel) { - return $http.post(resetPasswordUrl, resetPasswordBindingModel) - .success(function (updatedUser) { - syncRowVersion(currentUser, updatedUser); - currentUser.entityAspect.acceptChanges(); - }) - .error(handleErrorResult); - } - function resetPasswordRequest(resetPasswordRequestBindingModel) { - return $http.post(resetPasswordRequestUrl, resetPasswordRequestBindingModel).error(handleErrorResult); - } - function ensureAuthenticatedUser() { - var deferred = $q.defer(); - if (currentUser.isAuthenticated()) { - deferred.resolve(); - } - else { - var bindingModel = { - UserName: currentUser.UserName, - Email: currentUser.Email - }; - registerAnonymous(bindingModel, true) - .then(function () { - $rootScope.$broadcast('guestAccountCreated'); - deferred.resolve(); - }) - .catch(function () { - deferred.reject(); - }); - } - return deferred.promise; - } - function saveChanges(delay) { - delay = typeof delay !== 'undefined' ? delay : 0; - if (saveTimer !== null) { - $timeout.cancel(saveTimer); - } - if (delay === 0) { - return saveChangesInternal(); - } - else { - saveTimer = $timeout(function () { - saveChangesInternal(); - }, delay); - return saveTimer; - } - } - function saveChangesInternal() { - return ensureAuthenticatedUser() - .then(function () { - var promise = null; - var count = getChangesCount(); - var saveBatches = prepareSaveBatches(); - saveBatches.forEach(function (batch) { - if (batch === null || batch.length > 0) { - $rootScope.$broadcast('saveChangesStart'); - promise = promise ? - promise.then(function () { return manager.saveChanges(batch); }) : - manager.saveChanges(batch); - } - }); - if (promise === null) { - promise = $q.resolve(null); - } - return promise.then(success).catch(failed).finally(completed); - function success(result) { - logger.logSuccess('Saved ' + count + ' change(s)'); - return result; - } - function failed(error, status, headers, config) { - var errorMessage = ''; - if (typeof error.status !== 'undefined' && error.status === '409') { - errorMessage = typeof error.body !== 'undefined' ? - 'Save failed!
' + error.body : - 'Save failed!
The record you attempted to edit was modified by another user after you got the original value. The edit operation was canceled.'; - logger.logError(errorMessage, error, true); - } - else if (typeof error.entityErrors !== 'undefined') { - errorMessage = 'Save failed!
'; - for (var key in error.entityErrors) { - var entityError = error.entityErrors[key]; - errorMessage += entityError.errorMessage + '
'; - } - logger.logError(errorMessage, null, true); - } - else { - logger.logError('Save failed!', error, true); - } - return $q.reject(error); - } - function completed() { - $rootScope.$broadcast('saveChangesCompleted'); - } - function prepareSaveBatches() { - var batches = []; - var modifiedEntities = getChanges(null, breeze.EntityState.Modified); - modifiedEntities.forEach(function (entity) { - var rowVersion = entity.RowVersion; - entity.RowVersion = ''; - entity.RowVersion = rowVersion; - }); - batches.push(modifiedEntities); - batches.push(getChanges('UserElementCell', breeze.EntityState.Deleted)); - batches.push(getChanges('ElementCell', breeze.EntityState.Deleted)); - batches.push(getChanges('ElementItem', breeze.EntityState.Deleted)); - batches.push(getChanges('UserElementField', breeze.EntityState.Deleted)); - batches.push(getChanges('ElementField', breeze.EntityState.Deleted)); - batches.push(getChanges('Element', breeze.EntityState.Deleted)); - batches.push(getChanges('UserResourcePool', breeze.EntityState.Deleted)); - batches.push(getChanges('ResourcePool', breeze.EntityState.Deleted)); - batches.push(getChanges('ResourcePool', breeze.EntityState.Added)); - batches.push(getChanges('UserResourcePool', breeze.EntityState.Added)); - batches.push(getChanges('Element', breeze.EntityState.Added)); - batches.push(getChanges('ElementField', breeze.EntityState.Added)); - batches.push(getChanges('UserElementField', breeze.EntityState.Added)); - batches.push(getChanges('ElementItem', breeze.EntityState.Added)); - batches.push(getChanges('ElementCell', breeze.EntityState.Added)); - batches.push(getChanges('UserElementCell', breeze.EntityState.Added)); - return batches; - } - }); - } - function syncRowVersion(oldEntity, newEntity) { - oldEntity.RowVersion = newEntity.RowVersion; - } - } -})(M42 || (M42 = {})); -var M43; -(function (M43) { - 'use strict'; - var factoryId = 'entityManagerFactory'; - angular.module('main') - .factory(factoryId, ['breeze', - 'Element', - 'ElementCell', - 'ElementField', - 'ElementItem', - 'logger', - 'ResourcePool', - 'serviceAppUrl', - 'User', - 'UserElementCell', - 'UserElementField', - 'UserResourcePool', - '$rootScope', - entityManagerFactory]); - function entityManagerFactory(breeze, Element, ElementCell, ElementField, ElementItem, logger, ResourcePool, serviceAppUrl, User, UserElementCell, UserElementField, UserResourcePool, $rootScope) { - logger = logger.forSource(factoryId); - var serviceRoot = serviceAppUrl; - var serviceName = serviceRoot + '/odata'; - var factory = { - newManager: newManager, - serviceName: serviceName - }; - return factory; - function newManager() { - var manager = new breeze.EntityManager(serviceName); - var store = manager.metadataStore; - store.registerEntityTypeCtor('Element', Element); - store.registerEntityTypeCtor('ElementCell', ElementCell); - store.registerEntityTypeCtor('ElementField', ElementField); - store.registerEntityTypeCtor('ElementItem', ElementItem); - store.registerEntityTypeCtor('ResourcePool', ResourcePool); - store.registerEntityTypeCtor('User', User); - store.registerEntityTypeCtor('UserElementCell', UserElementCell); - store.registerEntityTypeCtor('UserElementField', UserElementField); - store.registerEntityTypeCtor('UserResourcePool', UserResourcePool); - return manager; - } - } -})(M43 || (M43 = {})); -var M44; -(function (M44) { - 'use strict'; - var factoryId = 'locationHistory'; - angular.module('main') - .factory(factoryId, ['logger', locationHistory]); - function locationHistory(logger) { - logger = logger.forSource(factoryId); - var self = { - history: [new LocationItem('/')], - historyLimit: 10 - }; - var factory = { - createItem: createItem, - getHistory: getHistory, - previousItem: previousItem - }; - return factory; - function createItem($location, $routeCurrent) { - var itemUrl = $location.url(); - var accessType = $routeCurrent.accessType; - var item = new LocationItem(itemUrl, accessType); - self.history.push(item); - if (self.history.length > self.historyLimit) { - self.history.splice(0, self.history.length - self.historyLimit); - } - } - function getHistory() { - return self.history.slice(); - } - function previousItem() { - for (var i = self.history.length - 2; i >= 0; i--) { - return self.history[i]; - } - } - function LocationItem(itemUrl, accessType) { - itemUrl = typeof itemUrl !== 'undefined' ? itemUrl : ''; - accessType = typeof accessType !== 'undefined' ? accessType : 'undefined'; - var self = this; - self.itemUrl = itemUrl; - self.accessType = accessType; - self.url = url; - function url() { - return self.itemUrl; - } - } - } -})(M44 || (M44 = {})); -var M45; -(function (M45) { - 'use strict'; - angular.module('main') - .factory('logger', ['$log', logger]); - function logger($log) { - configureToastr(); - var factory = { - forSource: forSource, - log: log, - logError: logError, - logInfo: logInfo, - logSuccess: logSuccess, - logWarning: logWarning - }; - return factory; - function configureToastr() { - toastr.options = { - "positionClass": "toast-bottom-right" - }; - } - function forSource(src) { - return { - log: function (m, d, s, t, o) { return log(m, d, src, s, t, o); }, - logError: function (m, d, s, t, o) { return logError(m, d, src, s, t, o); }, - logInfo: function (m, d, s, t, o) { return logInfo(m, d, src, s, t, o); }, - logSuccess: function (m, d, s, t, o) { return logSuccess(m, d, src, s, t, o); }, - logWarning: function (m, d, s, t, o) { return logWarning(m, d, src, s, t, o); }, - }; - } - function log(message, data, source, showToast, title, optionsOverride) { - return logIt(message, data, source, showToast, title, optionsOverride, 'debug'); - } - function logError(message, data, source, showToast, title, optionsOverride) { - return logIt(message, data, source, showToast, title, optionsOverride, 'error'); - } - function logInfo(message, data, source, showToast, title, optionsOverride) { - return logIt(message, data, source, showToast, title, optionsOverride, 'info'); - } - function logSuccess(message, data, source, showToast, title, optionsOverride) { - return logIt(message, data, source, showToast, title, optionsOverride, 'success'); - } - function logWarning(message, data, source, showToast, title, optionsOverride) { - return logIt(message, data, source, showToast, title, optionsOverride, 'warning'); - } - function logIt(message, data, source, showToast, title, optionsOverride, toastType) { - showToast = typeof showToast === 'undefined' ? false : showToast; - var currentDateTime = new Date().getHours() + ':' + - new Date().getMinutes() + ':' + - new Date().getSeconds(); - source = source ? '[' + source + '] ' : ''; - var write; - switch (toastType) { - case 'debug': - write = $log.debug; - break; - case 'error': - write = $log.error; - break; - case 'info': - write = $log.info; - break; - case 'success': - write = $log.log; - break; - case 'warning': - write = $log.warn; - break; - } - write(currentDateTime, source, message, data); - var toast = null; - if (showToast) { - switch (toastType) { - case 'debug': - toast = toastr.info(message, title, optionsOverride); - break; - case 'error': - toast = toastr.error(message, title, optionsOverride); - break; - case 'info': - toast = toastr.info(message, title, optionsOverride); - break; - case 'success': - toast = toastr.success(message, title, optionsOverride); - break; - case 'warning': - toast = toastr.warning(message, title, optionsOverride); - break; - } - } - return toast; - } - } -})(M45 || (M45 = {})); -var M46; -(function (M46) { - 'use strict'; - var factoryId = 'resourcePoolFactory'; - angular.module('main') - .factory(factoryId, ['dataContext', 'Element', 'logger', 'ResourcePool', '$rootScope', resourcePoolFactory]); - function resourcePoolFactory(dataContext, Element, logger, ResourcePool, $rootScope) { - logger = logger.forSource(factoryId); - var factory = { - copyResourcePool: copyResourcePool, - createElement: createElement, - createElementField: createElementField, - createElementItem: createElementItem, - createResourcePoolBasic: createResourcePoolBasic, - createResourcePoolDirectIncomeAndMultiplier: createResourcePoolDirectIncomeAndMultiplier, - createResourcePoolTwoElements: createResourcePoolTwoElements, - getResourcePoolExpanded: getResourcePoolExpanded, - getResourcePoolSet: getResourcePoolSet, - removeElement: removeElement, - removeElementField: removeElementField, - removeElementItem: removeElementItem, - removeResourcePool: removeResourcePool, - removeUserElementField: removeUserElementField, - updateElementMultiplier: updateElementMultiplier, - updateElementCellMultiplier: updateElementCellMultiplier, - updateElementCellDecimalValue: updateElementCellDecimalValue, - updateElementFieldIndexRating: updateElementFieldIndexRating, - updateResourcePoolRate: updateResourcePoolRate - }; - var fetchedList = []; - var fetchFromServer = true; - $rootScope.$on('dataContext_currentUserChanged', function () { - fetchedList = []; - fetchFromServer = true; - }); - $rootScope.$on('ElementField_DataTypeChanged', elementField_DataTypeChanged); - $rootScope.$on('ElementField_IndexEnabledChanged', elementField_IndexEnabledChanged); - return factory; - function copyResourcePool(resourcePoolSource) { - } - function createElement(element) { - return dataContext.createEntity('Element', element); - } - function createElementCell(elementCellInitial) { - var elementCell = dataContext.createEntity('ElementCell', elementCellInitial); - if (elementCell.ElementField.DataType !== 6) { - createUserElementCell(elementCell, null, false); - } - return elementCell; - } - function createElementField(elementField) { - elementField = dataContext.createEntity('ElementField', elementField); - if (elementField.IndexEnabled) { - createUserElementField(elementField); - } - elementField.Element.ElementItemSet.forEach(function (elementItem) { - createElementCell({ - ElementField: elementField, - ElementItem: elementItem - }); - }); - return elementField; - } - function createElementItem(elementItem) { - elementItem = dataContext.createEntity('ElementItem', elementItem); - elementItem.Element.ElementFieldSet.forEach(function (elementField) { - createElementCell({ - ElementField: elementField, - ElementItem: elementItem - }); - }); - return elementItem; - } - function createResourcePoolBasic(initializeResourcePool) { - initializeResourcePool = typeof initializeResourcePool !== 'undefined' ? initializeResourcePool : false; - var currentUser = dataContext.getCurrentUser(); - var resourcePoolRate = 10; - var resourcePool = dataContext.createEntity('ResourcePool', { - User: currentUser, - Name: 'New CMRP', - Key: 'New-CMRP', - Description: 'Description for CMRP', - InitialValue: 100, - UseFixedResourcePoolRate: true - }); - createUserResourcePool(resourcePool); - var element = createElement({ - ResourcePool: resourcePool, - Name: 'New element' - }); - element.IsMainElement = true; - createElementField({ - Element: element, - Name: 'Importance', - DataType: 4, - UseFixedValue: false, - IndexEnabled: true, - IndexCalculationType: 2, - IndexSortType: 1, - SortOrder: 1 - }); - createElementItem({ - Element: element, - Name: 'New item 1' - }); - createElementItem({ - Element: element, - Name: 'New item 2' - }); - if (initializeResourcePool) { - resourcePool._init(true); - } - return resourcePool; - } - function createResourcePoolDirectIncomeAndMultiplier(initializeResourcePool) { - initializeResourcePool = typeof initializeResourcePool !== 'undefined' ? initializeResourcePool : false; - var resourcePool = createResourcePoolBasic(); - var salesPriceField = resourcePool.mainElement().ElementFieldSet[0]; - salesPriceField.Name = 'Sales Price'; - salesPriceField.DataType = 11; - salesPriceField.UseFixedValue = true; - salesPriceField.IndexEnabled = false; - salesPriceField.IndexCalculationType = 0; - salesPriceField.IndexSortType = 0; - var numberOfSalesField = createElementField({ - Element: resourcePool.mainElement(), - Name: 'Number of Sales', - DataType: 12, - UseFixedValue: false, - SortOrder: 2 - }); - if (initializeResourcePool) { - resourcePool._init(true); - } - return resourcePool; - } - function createResourcePoolTwoElements(initializeResourcePool) { - initializeResourcePool = typeof initializeResourcePool !== 'undefined' ? initializeResourcePool : false; - var resourcePool = createResourcePoolBasic(); - var element2 = resourcePool.ElementSet[0]; - element2.Name = 'Child'; - var element2Item1 = element2.ElementItemSet[0]; - var element2Item2 = element2.ElementItemSet[1]; - var element1 = createElement({ - ResourcePool: resourcePool, - Name: 'Parent' - }); - element1.IsMainElement = true; - createElementField({ - Element: element1, - Name: 'Child', - DataType: 6, - SelectedElement: element2, - UseFixedValue: true, - SortOrder: 1 - }); - var item1 = createElementItem({ - Element: element1, - Name: 'Parent 1' - }); - item1.ElementCellSet[0].SelectedElementItem = element2Item1; - var item2 = createElementItem({ - Element: element1, - Name: 'Parent 2' - }); - item2.ElementCellSet[0].SelectedElementItem = element2Item2; - if (initializeResourcePool) { - resourcePool._init(true); - } - return resourcePool; - } - function createUserElementCell(elementCell, value, updateCache) { - updateCache = typeof updateCache !== 'undefined' ? updateCache : true; - var currentUser = dataContext.getCurrentUser(); - var existingKey = [currentUser.Id, elementCell.Id]; - var userElementCell = dataContext.getEntityByKey('UserElementCell', existingKey); - if (typeof userElementCell !== 'undefined' && userElementCell !== null) { - if (userElementCell.entityAspect.entityState.isDeleted()) { - userElementCell.entityAspect.rejectChanges(); - } - switch (elementCell.ElementField.DataType) { - case 1: { - userElementCell.StringValue = value !== null ? value : ''; - break; - } - case 2: { - userElementCell.BooleanValue = value !== null ? value : false; - break; - } - case 3: { - userElementCell.IntegerValue = value !== null ? value : 0; - break; - } - case 4: { - userElementCell.DecimalValue = value !== null ? value : 50; - break; - } - case 6: { - break; - } - case 11: { - userElementCell.DecimalValue = value !== null ? value : 100; - break; - } - case 12: { - userElementCell.DecimalValue = value !== null ? value : 0; - break; - } - } - } - else { - userElementCell = { - User: currentUser, - ElementCell: elementCell - }; - switch (elementCell.ElementField.DataType) { - case 1: { - userElementCell.StringValue = value !== null ? value : ''; - break; - } - case 2: { - userElementCell.BooleanValue = value !== null ? value : false; - break; - } - case 3: { - userElementCell.IntegerValue = value !== null ? value : 0; - break; - } - case 4: { - userElementCell.DecimalValue = value !== null ? value : 50; - break; - } - case 6: { - break; - } - case 11: { - userElementCell.DecimalValue = value !== null ? value : 100; - break; - } - case 12: { - userElementCell.DecimalValue = value !== null ? value : 0; - break; - } - } - userElementCell = dataContext.createEntity('UserElementCell', userElementCell); - } - if (updateCache) { - elementCell.setCurrentUserNumericValue(); - } - return userElementCell; - } - function createUserElementField(elementField, rating) { - rating = typeof rating !== 'undefined' ? rating : 50; - var currentUser = dataContext.getCurrentUser(); - var existingKey = [currentUser.Id, elementField.Id]; - var userElementField = dataContext.getEntityByKey('UserElementField', existingKey); - if (typeof userElementField !== 'undefined' && userElementField !== null) { - if (userElementField.entityAspect.entityState.isDeleted()) { - userElementField.entityAspect.rejectChanges(); - } - userElementField.Rating = rating; - } - else { - userElementField = { - User: currentUser, - ElementField: elementField, - Rating: rating - }; - userElementField = dataContext.createEntity('UserElementField', userElementField); - } - elementField.setCurrentUserIndexRating(); - return userElementField; - } - function createUserResourcePool(resourcePool, resourcePoolRate) { - resourcePoolRate = typeof resourcePoolRate !== 'undefined' ? resourcePoolRate : 10; - var currentUser = dataContext.getCurrentUser(); - var existingKey = [currentUser.Id, resourcePool.Id]; - var userResourcePool = dataContext.getEntityByKey('UserResourcePool', existingKey); - if (typeof userResourcePool !== 'undefined' && userResourcePool !== null) { - if (userResourcePool.entityAspect.entityState.isDeleted()) { - userResourcePool.entityAspect.rejectChanges(); - } - userResourcePool.ResourcePoolRate = resourcePoolRate; - } - else { - userResourcePool = { - User: currentUser, - ResourcePool: resourcePool, - ResourcePoolRate: resourcePoolRate - }; - userResourcePool = dataContext.createEntity('UserResourcePool', userResourcePool); - } - resourcePool.setCurrentUserResourcePoolRate(); - return userResourcePool; - } - function elementField_DataTypeChanged(event, elementField) { - elementField.ElementCellSet.forEach(function (elementCell) { - elementCell.SelectedElementItemId = null; - removeUserElementCell(elementCell, false); - if (elementCell.ElementField.DataType !== 6) { - createUserElementCell(elementCell, null, false); - } - }); - } - function elementField_IndexEnabledChanged(event, elementField) { - if (elementField.Element === null) { - return; - } - if (elementField.IndexEnabled) { - createUserElementField(elementField); - } - else { - removeUserElementField(elementField); - } - } - function getResourcePoolExpanded(resourcePoolUniqueKey) { - var currentUser = dataContext.getCurrentUser(); - var fetchedEarlier = false; - fetchedEarlier = fetchedList.some(function (fetched) { return (resourcePoolUniqueKey === fetched); }); - var query = breeze.EntityQuery.from('ResourcePool'); - if (currentUser.isAuthenticated()) { - query = query.expand('User, UserResourcePoolSet, ElementSet.ElementFieldSet.UserElementFieldSet, ElementSet.ElementItemSet.ElementCellSet.UserElementCellSet'); - } - else { - query = query.expand('User, ElementSet.ElementFieldSet, ElementSet.ElementItemSet.ElementCellSet'); - } - var userNamePredicate = new breeze.Predicate('User.UserName', 'eq', resourcePoolUniqueKey.userName); - var resourcePoolKeyPredicate = new breeze.Predicate('Key', 'eq', resourcePoolUniqueKey.resourcePoolKey); - query = query.where(userNamePredicate.and(resourcePoolKeyPredicate)); - if (!fetchedEarlier) { - query = query.using(breeze.FetchStrategy.FromServer); - } - else { - query = query.using(breeze.FetchStrategy.FromLocalCache); - } - return dataContext.executeQuery(query) - .then(success) - .catch(failed); - function success(response) { - if (response.results.length === 0) { - return null; - } - var resourcePool = response.results[0]; - if (!fetchedEarlier) { - resourcePool._init(); - } - fetchedList.push(resourcePool.Id); - return resourcePool; - } - function failed(error) { - var message = error.message || 'ResourcePool query failed'; - logger.logError(message, error, true); - } - } - function getResourcePoolSet(searchKey) { - searchKey = typeof searchKey !== 'undefined' ? searchKey : ''; - var query = breeze.EntityQuery - .from('ResourcePool') - .expand(['User']); - if (searchKey !== '') { - var resourcePoolNamePredicate = new breeze.Predicate('Name', 'contains', searchKey); - var userNamePredicate = new breeze.Predicate('User.UserName', 'contains', searchKey); - query = query.where(resourcePoolNamePredicate.or(userNamePredicate)); - } - query = query.using(breeze.FetchStrategy.FromServer); - return dataContext.executeQuery(query) - .then(success).catch(failed); - function success(response) { - return response.results; - } - function failed(error) { - var message = error.message || 'ResourcePool query failed'; - logger.logError(message, error, true); - } - } - function removeElement(element) { - if (element.ResourcePool.selectedElement() === element) { - element.ResourcePool.selectedElement(null); - } - var elementItemSet = element.ElementItemSet.slice(); - elementItemSet.forEach(function (elementItem) { - removeElementItem(elementItem); - }); - var elementFieldSet = element.ElementFieldSet.slice(); - elementFieldSet.forEach(function (elementField) { - removeElementField(elementField); - }); - element.entityAspect.setDeleted(); - } - function removeElementCell(elementCell) { - removeUserElementCell(elementCell); - elementCell.entityAspect.setDeleted(); - } - function removeElementField(elementField) { - var elementCellSet = elementField.ElementCellSet.slice(); - elementCellSet.forEach(function (elementCell) { - removeElementCell(elementCell); - }); - removeUserElementField(elementField); - elementField.entityAspect.setDeleted(); - } - function removeElementItem(elementItem) { - var elementCellSet = elementItem.ElementCellSet.slice(); - elementCellSet.forEach(function (elementCell) { - removeElementCell(elementCell); - }); - elementItem.entityAspect.setDeleted(); - } - function removeResourcePool(resourcePool) { - var elementSet = resourcePool.ElementSet.slice(); - elementSet.forEach(function (element) { - removeElement(element); - }); - removeUserResourcePool(resourcePool); - resourcePool.entityAspect.setDeleted(); - } - function removeUserElementCell(elementCell, updateCache) { - updateCache = typeof updateCache !== 'undefined' ? updateCache : true; - var currentUserElementCell = elementCell.currentUserCell(); - if (currentUserElementCell !== null) { - currentUserElementCell.entityAspect.setDeleted(); - if (updateCache) { - elementCell.setCurrentUserNumericValue(); - } - } - } - function removeUserElementField(elementField) { - var currentUserElementField = elementField.currentUserElementField(); - if (currentUserElementField !== null) { - currentUserElementField.entityAspect.setDeleted(); - elementField.setCurrentUserIndexRating(); - } - } - function removeUserResourcePool(resourcePool) { - var currentUserResourcePool = resourcePool.currentUserResourcePool(); - if (currentUserResourcePool !== null) { - currentUserResourcePool.entityAspect.setDeleted(); - resourcePool.setCurrentUserResourcePoolRate(); - } - } - function syncRowVersion(oldEntity, newEntity) { - oldEntity.RowVersion = newEntity.RowVersion; - } - function updateElementCellDecimalValue(elementCell, updateType) { - switch (updateType) { - case 'increase': - case 'decrease': { - var userElementCell = elementCell.currentUserCell(); - if (userElementCell === null) { - var decimalValue = updateType === 'increase' ? 55 : 45; - createUserElementCell(elementCell, decimalValue); - } - else { - userElementCell.DecimalValue = updateType === 'increase' ? - userElementCell.DecimalValue + 5 > 100 ? 100 : userElementCell.DecimalValue + 5 : - userElementCell.DecimalValue - 5 < 0 ? 0 : userElementCell.DecimalValue - 5; - elementCell.setCurrentUserNumericValue(); - } - break; - } - case 'reset': { - removeUserElementCell(elementCell); - break; - } - } - } - function updateElementCellMultiplier(elementCell, updateType) { - updateElementCellMultiplierInternal(elementCell, updateType); - elementCell.ElementField.Element.ElementItemSet.forEach(function (item) { - item.setMultiplier(); - }); - if (elementCell.ElementField.IndexEnabled) { - elementCell.ElementField.ElementCellSet.forEach(function (cell) { - cell.setNumericValueMultiplied(false); - }); - elementCell.ElementField.setNumericValueMultiplied(); - } - } - function updateElementCellMultiplierInternal(elementCell, updateType) { - switch (updateType) { - case 'increase': - case 'decrease': { - var userElementCell = elementCell.currentUserCell(); - if (userElementCell === null) { - var decimalValue = updateType === 'increase' ? 1 : 0; - createUserElementCell(elementCell, decimalValue, false); - } - else { - userElementCell.DecimalValue = updateType === 'increase' ? - userElementCell.DecimalValue + 1 : - userElementCell.DecimalValue - 1 < 0 ? 0 : userElementCell.DecimalValue - 1; - } - break; - } - case 'reset': { - removeUserElementCell(elementCell, false); - break; - } - } - } - function updateElementFieldIndexRating(elementField, updateType) { - switch (updateType) { - case 'increase': - case 'decrease': { - var userElementField = elementField.currentUserElementField(); - if (userElementField === null) { - var rating = updateType === 'increase' ? 55 : 45; - createUserElementField(elementField, rating); - } - else { - userElementField.Rating = updateType === 'increase' ? - userElementField.Rating + 5 > 100 ? 100 : userElementField.Rating + 5 : - userElementField.Rating - 5 < 0 ? 0 : userElementField.Rating - 5; - elementField.setCurrentUserIndexRating(); - } - break; - } - case 'reset': { - removeUserElementField(elementField); - break; - } - } - } - function updateElementMultiplier(element, updateType) { - element.ElementItemSet.forEach(function (item) { - var multiplierCell; - for (var cellIndex = 0; cellIndex < item.ElementCellSet.length; cellIndex++) { - var elementCell = item.ElementCellSet[cellIndex]; - if (elementCell.ElementField.DataType === 12) { - multiplierCell = elementCell; - break; - } - } - updateElementCellMultiplierInternal(multiplierCell, updateType); - }); - element.ElementItemSet.forEach(function (item) { - item.setMultiplier(); - }); - element.ElementFieldSet.forEach(function (field) { - if (field.IndexEnabled) { - field.ElementCellSet.forEach(function (cell) { - cell.setNumericValueMultiplied(false); - }); - field.setNumericValueMultiplied(); - } - }); - } - function updateResourcePoolRate(resourcePool, updateType) { - switch (updateType) { - case 'increase': - case 'decrease': { - var userResourcePool = resourcePool.currentUserResourcePool(); - if (userResourcePool === null) { - var resourcePoolRate = updateType === 'increase' ? 15 : 5; - createUserResourcePool(resourcePool, resourcePoolRate); - } - else { - userResourcePool.ResourcePoolRate = updateType === 'increase' ? - userResourcePool.ResourcePoolRate + 5 > 1000 ? 1000 : userResourcePool.ResourcePoolRate + 5 : - userResourcePool.ResourcePoolRate - 5 < 0 ? 0 : userResourcePool.ResourcePoolRate - 5; - resourcePool.setCurrentUserResourcePoolRate(); - } - break; - } - case 'reset': { - removeUserResourcePool(resourcePool); - break; - } - } - } - } -})(M46 || (M46 = {})); -var Main; -(function (Main) { - var Filters; - (function (Filters) { - 'use strict'; - angular.module('main') - .filter('ngEnum', ['Enums', 'logger', ngEnum]); - function ngEnum(Enums, logger) { - return function (input, enumTableKey) { - if (typeof input === 'undefined' || typeof enumTableKey === 'undefined' || enumTableKey === '') { - return null; - } - return Enums.getEnumKey(enumTableKey, input); - }; - } - })(Filters = Main.Filters || (Main.Filters = {})); -})(Main || (Main = {})); -var Main; -(function (Main) { - var Filters; - (function (Filters) { - 'use strict'; - angular.module('main') - .filter('numberSymbol', ['logger', '$filter', numberSymbol]); - function numberSymbol(logger, $filter) { - return function (input, decimals) { - if (typeof input === 'undefined') - return null; - decimals = typeof decimals === 'undefined' ? 0 : decimals; - var number = Number(input); - number = decimals > 0 ? Number(number.toFixed(decimals)) : number; - var symbol = ''; - if (number / Math.pow(10, 12) >= 1) { - number = number / Math.pow(10, 12); - symbol = 'T'; - } - else if (number / Math.pow(10, 9) >= 1) { - number = number / Math.pow(10, 9); - symbol = 'B'; - } - else if (number / Math.pow(10, 6) >= 1) { - number = number / Math.pow(10, 6); - symbol = 'M'; - } - else if (number / Math.pow(10, 3) >= 1) { - number = number / Math.pow(10, 3); - symbol = 'K'; - } - return $filter('number')(number, decimals) + symbol; - }; - } - })(Filters = Main.Filters || (Main.Filters = {})); -})(Main || (Main = {})); -var Main; -(function (Main) { - var Filters; - (function (Filters) { - 'use strict'; - angular.module('main') - .filter('percentage', ['$filter', percentage]); - function percentage($filter) { - return function (input, decimals) { return ($filter('number')(input * 100, decimals) + '%'); }; - } - })(Filters = Main.Filters || (Main.Filters = {})); -})(Main || (Main = {})); -var Main; -(function (Main) { - var Controllers; - (function (Controllers) { - 'use strict'; - var controllerId = 'AccountController'; - var AccountViewModel = (function () { - function AccountViewModel() { - this.currentUser = null; - } - return AccountViewModel; - }()); - var AccountController = (function () { - function AccountController(dataContext, logger, $routeParams, $scope) { - logger = logger.forSource(controllerId); - $scope.vm = new AccountViewModel(); - $scope.vm.currentUser = dataContext.getCurrentUser(); - $scope.$on('dataContext_currentUserChanged', currentUserChanged); - _init(); - function _init() { - } - function currentUserChanged(event, newUser) { - $scope.vm.currentUser = newUser; - } - } - AccountController.$inject = ['dataContext', 'logger', '$routeParams', '$scope']; - return AccountController; - }()); - Controllers.AccountController = AccountController; - angular.module('main').controller(controllerId, AccountController); - })(Controllers = Main.Controllers || (Main.Controllers = {})); -})(Main || (Main = {})); -var Main; -(function (Main) { - var Controller; - (function (Controller) { - 'use strict'; - var controllerId = 'AccountEditController'; - var AccountEditViewModel = (function () { - function AccountEditViewModel() { - this.currentUser = null; - } - return AccountEditViewModel; - }()); - var AccountEditController = (function () { - function AccountEditController(dataContext, logger, $location, $scope) { - logger = logger.forSource(controllerId); - var isSaving = false; - $scope.vm = new AccountEditViewModel(); - $scope.vm.cancel = cancel; - $scope.vm.currentUser = dataContext.getCurrentUser(); - $scope.vm.isSaveDisabled = isSaveDisabled; - $scope.vm.saveChanges = saveChanges; - function cancel() { - $scope.vm.currentUser.entityAspect.rejectChanges(); - $location.url('/_system/account'); - } - function isSaveDisabled() { - return isSaving; - } - function saveChanges() { - isSaving = true; - dataContext.saveChanges() - .then(function (result) { - logger.logSuccess('Your changes have been saved!', null, true); - $location.url('/_system/account'); - }) - .catch(function (error) { - if (error.status === '409') { - } - }) - .finally(function () { - isSaving = false; - }); - } - } - AccountEditController.$inject = ['dataContext', 'logger', '$location', '$scope']; - return AccountEditController; - }()); - Controller.AccountEditController = AccountEditController; - angular.module('main').controller(controllerId, AccountEditController); - })(Controller = Main.Controller || (Main.Controller = {})); -})(Main || (Main = {})); -var Main; -(function (Main) { - var Controller; - (function (Controller) { - 'use strict'; - var controllerId = 'AddPasswordController'; - var AddPasswordViewModel = (function () { - function AddPasswordViewModel() { - this.bindingModel = { - Password: String, - ConfirmPassword: String - }; - this.isSaving = false; - } - return AddPasswordViewModel; - }()); - var AddPasswordController = (function () { - function AddPasswordController(dataContext, logger, $location, $scope) { - logger = logger.forSource(controllerId); - $scope.vm = new AddPasswordViewModel(); - $scope.vm.addPassword = addPassword; - $scope.vm.cancel = cancel; - $scope.vm.isSaveDisabled = isSaveDisabled; - function addPassword() { - $scope.vm.isSaving = true; - dataContext.addPassword($scope.vm.bindingModel) - .success(function () { - logger.logSuccess('Your password has been set!', null, true); - $location.url('/_system/account'); - }) - .finally(function () { - $scope.vm.isSaving = false; - }); - } - function cancel() { - $location.url('/_system/account'); - } - function isSaveDisabled() { - return $scope.vm.isSaving; - } - } - AddPasswordController.$inject = ['dataContext', 'logger', '$location', '$scope']; - return AddPasswordController; - }()); - Controller.AddPasswordController = AddPasswordController; - angular.module('main').controller(controllerId, AddPasswordController); - })(Controller = Main.Controller || (Main.Controller = {})); -})(Main || (Main = {})); -var Main; -(function (Main) { - var Controller; - (function (Controller) { - 'use strict'; - var controllerId = 'ChangeEmailController'; - var ChangeEmailViewModel = (function () { - function ChangeEmailViewModel() { - this.bindingModel = { - Email: String - }; - } - return ChangeEmailViewModel; - }()); - var ChangeEmailController = (function () { - function ChangeEmailController(dataContext, logger, $location, $scope) { - logger = logger.forSource(controllerId); - $scope.vm = new ChangeEmailViewModel(); - $scope.vm.bindingModel = { - Email: '' - }; - $scope.vm.cancel = cancel; - $scope.vm.changeEmail = changeEmail; - $scope.vm.isSaving = false; - $scope.vm.isSaveDisabled = isSaveDisabled; - _init(); - function _init() { - if ($location.host() === 'localhost') { - $scope.vm.bindingModel.Email = dataContext.getUniqueEmail(); - } - } - function cancel() { - $location.url('/_system/account'); - } - function changeEmail() { - $scope.vm.isSaving = true; - dataContext.changeEmail($scope.vm.bindingModel) - .success(function () { - $location.url('/_system/account/confirmEmail'); - }) - .finally(function () { - $scope.vm.isSaving = false; - }); - } - function isSaveDisabled() { - return $scope.vm.isSaving; - } - } - ChangeEmailController.$inject = ['dataContext', 'logger', '$location', '$scope']; - return ChangeEmailController; - }()); - Controller.ChangeEmailController = ChangeEmailController; - angular.module('main').controller(controllerId, ChangeEmailController); - })(Controller = Main.Controller || (Main.Controller = {})); -})(Main || (Main = {})); -var Main; -(function (Main) { - var Controller; - (function (Controller) { - 'use strict'; - var controllerId = 'ChangePasswordController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', '$location', ChangePasswordController]); - function ChangePasswordController(dataContext, logger, $location) { - logger = logger.forSource(controllerId); - var vm = this; - vm.bindingModel = { - CurrentPassword: '', - NewPassword: '', - ConfirmPassword: '' - }; - vm.cancel = cancel; - vm.changePassword = changePassword; - vm.isSaving = false; - vm.isSaveDisabled = isSaveDisabled; - function cancel() { - $location.url('/_system/account'); - } - function changePassword() { - vm.isSaving = true; - dataContext.changePassword(vm.bindingModel) - .success(function () { - logger.logSuccess('Your password has been changed!', null, true); - $location.url('/_system/account'); - }) - .finally(function () { - vm.isSaving = false; - }); - } - function isSaveDisabled() { - return vm.isSaving; - } - } - })(Controller = Main.Controller || (Main.Controller = {})); -})(Main || (Main = {})); -var Main; -(function (Main) { - var Controller; - (function (Controller) { - 'use strict'; - var controllerId = 'ChangeUserNameController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', '$location', ChangeUserNameController]); - function ChangeUserNameController(dataContext, logger, $location) { - logger = logger.forSource(controllerId); - var vm = this; - vm.bindingModel = { - UserName: '' - }; - vm.cancel = cancel; - vm.changeUserName = changeUserName; - vm.currentUser = { UserName: '' }; - vm.externalLoginInit = $location.search().init; - vm.isSaving = false; - vm.isSaveDisabled = isSaveDisabled; - _init(); - function _init() { - vm.currentUser = dataContext.getCurrentUser(); - vm.bindingModel.UserName = vm.currentUser.UserName; - if ($location.host() === 'localhost') { - vm.bindingModel.UserName = dataContext.getUniqueUserName(); - } - } - function cancel() { - $location.url(getReturnUrl()); - } - function changeUserName() { - vm.isSaving = true; - dataContext.changeUserName(vm.bindingModel) - .success(function () { - logger.logSuccess('Your username has been changed!', null, true); - $location.url(getReturnUrl()); - }) - .finally(function () { - vm.isSaving = false; - }); - } - function getReturnUrl() { - var clientReturnUrl = $location.search().clientReturnUrl; - return typeof clientReturnUrl !== 'undefined' ? - clientReturnUrl : - '/_system/account'; - } - function isSaveDisabled() { - return vm.bindingModel.UserName === vm.currentUser.UserName || vm.isSaving; - } - } - })(Controller = Main.Controller || (Main.Controller = {})); -})(Main || (Main = {})); -var Main; -(function (Main) { - var Controller; - (function (Controller) { - 'use strict'; - var controllerId = 'ConfirmEmailController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', '$location', '$rootScope', ConfirmEmailController]); - function ConfirmEmailController(dataContext, logger, $location, $rootScope) { - logger = logger.forSource(controllerId); - var vm = this; - vm.currentUser = { EmailConfirmed: false, isAuthenticated: function () { return false; } }; - vm.isResendDisabled = false; - vm.resendConfirmationEmail = resendConfirmationEmail; - _init(); - function _init() { - vm.currentUser = dataContext.getCurrentUser(); - if (!vm.currentUser.isAuthenticated()) { - return; - } - var token = $location.search().token; - if (typeof token === 'undefined') { - return; - } - dataContext.confirmEmail({ Token: token }) - .then(function () { - logger.logSuccess('Your email address has been confirmed!', null, true); - $location.url('/_system/account'); - }); - } - function resendConfirmationEmail() { - vm.isResendDisabled = true; - dataContext.resendConfirmationEmail() - .then(function () { - logger.logSuccess('Confirmation email has been resent to your email address!', null, true); - }) - .finally(function () { - vm.isResendDisabled = false; - }); - } - } - })(Controller = Main.Controller || (Main.Controller = {})); -})(Main || (Main = {})); -var Main; -(function (Main) { - var Controller; - (function (Controller) { - 'use strict'; - var controllerId = 'LoginController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'locationHistory', 'logger', 'serviceAppUrl', '$location', '$rootScope', '$scope', LoginController]); - function LoginController(dataContext, locationHistory, logger, serviceAppUrl, $location, $rootScope, $scope) { - logger = logger.forSource(controllerId); - var vm = this; - vm.isSaving = false; - vm.isSaveDisabled = isSaveDisabled; - vm.login = login; - vm.password = ''; - vm.rememberMe = true; - vm.showHeader = typeof $scope.showHeader !== 'undefined' ? $scope.showHeader : true; - vm.userName = ''; - _init(); - function _init() { - var error = $location.search().error; - if (typeof error !== 'undefined') { - logger.logError(error, null, true); - return; - } - login(); - } - function getReturnUrl() { - var clientReturnUrl = $location.search().clientReturnUrl; - return typeof clientReturnUrl !== 'undefined' ? clientReturnUrl : locationHistory.previousItem().url(); - } - function isSaveDisabled() { - return vm.isSaving; - } - function login() { - var singleUseToken = $location.search().token; - var init = $location.search().init; - if (typeof singleUseToken !== 'undefined') { - vm.isSaving = true; - dataContext.login('', '', vm.rememberMe, singleUseToken).then(successExternal).catch(failedExternal).finally(function () { - vm.isSaving = false; - }); - } - else { - if (vm.userName !== '' && vm.password !== '') { - vm.isSaving = true; - dataContext.login(vm.userName, vm.password, vm.rememberMe).then(successInternal).finally(function () { - vm.isSaving = false; - }); - } - } - function failedExternal() { - logger.logError('Invalid token', null, true); - } - function successExternal() { - logger.logSuccess('You have been logged in!', null, true); - if (typeof init !== 'undefined' && init) { - var url = '/_system/account/changeUserName?init=true&clientReturnUrl=' + getReturnUrl(); - $location.url(url); - } - else { - $location.url(getReturnUrl()); - } - } - function successInternal() { - logger.logSuccess('You have been logged in!', null, true); - if ($location.path() === '/_system/account/login') { - $location.url(getReturnUrl()); - } - } - } - } - })(Controller = Main.Controller || (Main.Controller = {})); -})(Main || (Main = {})); -var Main; -(function (Main) { - var Controller; - (function (Controller) { - 'use strict'; - var controllerId = 'ProfileController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', '$location', '$routeParams', '$scope', ProfileController]); - function ProfileController(dataContext, logger, $location, $routeParams, $scope) { - logger = logger.forSource(controllerId); - var userName = $routeParams.userName; - var vm = this; - vm.currentUser = { Id: 0 }; - vm.user = { Id: 0, UserName: '', Email: '' }; - $scope.$on('dataContext_currentUserChanged', currentUserChanged); - _init(); - function _init() { - vm.currentUser = dataContext.getCurrentUser(); - if (userName === vm.currentUser.UserName) { - vm.user = vm.currentUser; - } - else { - dataContext.getUser(userName) - .then(function (user) { - if (user === null) { - $location.url('/_system/content/notFound?url=' + $location.url()); - return; - } - vm.user = user; - }); - } - } - function currentUserChanged(event, newUser) { - vm.currentUser = newUser; - } - } - })(Controller = Main.Controller || (Main.Controller = {})); -})(Main || (Main = {})); -var Main; -(function (Main) { - var Controller; - (function (Controller) { - 'use strict'; - var controllerId = 'RegisterController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'locationHistory', 'logger', 'serviceAppUrl', '$location', '$rootScope', '$scope', RegisterController]); - function RegisterController(dataContext, locationHistory, logger, serviceAppUrl, $location, $rootScope, $scope) { - logger = logger.forSource(controllerId); - var vm = this; - vm.bindingModel = { - UserName: '', - Email: '', - Password: '', - ConfirmPassword: '' - }; - vm.isSaving = false; - vm.isSaveDisabled = isSaveDisabled; - vm.register = register; - vm.rememberMe = true; - vm.showHeader = typeof $scope.showHeader !== 'undefined' ? $scope.showHeader : true; - function isSaveDisabled() { - return vm.isSaving; - } - function register() { - vm.isSaving = true; - dataContext.register(vm.bindingModel, vm.rememberMe) - .then(function () { - logger.logSuccess('You have been registered!', null, true); - $location.url('/_system/account/confirmEmail'); - }) - .catch(failed) - .finally(function () { - vm.isSaving = false; - }); - function failed(response) { - if (typeof response.error_description !== 'undefined') { - logger.logError(response.error_description, null, true); - } - } - } - } - })(Controller = Main.Controller || (Main.Controller = {})); -})(Main || (Main = {})); -var Main; -(function (Main) { - var Controller; - (function (Controller) { - 'use strict'; - var controllerId = 'ResetPasswordController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', '$location', ResetPasswordController]); - function ResetPasswordController(dataContext, logger, $location) { - logger = logger.forSource(controllerId); - var vm = this; - vm.bindingModel = { - Email: $location.search().email, - Token: $location.search().token, - NewPassword: '', - ConfirmPassword: '' - }; - vm.isSaving = false; - vm.isSaveDisabled = isSaveDisabled; - vm.requestBindingModel = { - Email: '' - }; - vm.resetPassword = resetPassword; - vm.resetPasswordRequest = resetPasswordRequest; - vm.viewMode = typeof $location.search().email === 'undefined' || typeof $location.search().token === 'undefined' ? - 'initial' : - 'received'; - function isSaveDisabled() { - return vm.isSaving; - } - function resetPassword() { - vm.isSaving = true; - dataContext.resetPassword(vm.bindingModel) - .success(function () { - logger.logSuccess('Your password has been reset!', null, true); - $location.url('/_system/account/login'); - }) - .finally(function () { - vm.isSaving = false; - }); - } - function resetPasswordRequest() { - vm.isSaving = true; - dataContext.resetPasswordRequest(vm.requestBindingModel) - .success(function () { - vm.viewMode = 'sent'; - }) - .finally(function () { - vm.isSaving = false; - }); - } - } - })(Controller = Main.Controller || (Main.Controller = {})); -})(Main || (Main = {})); -var Main; -(function (Main) { - var Controller; - (function (Controller) { - 'use strict'; - var controllerId = 'SocialLoginsController'; - angular.module('main') - .controller(controllerId, ['locationHistory', 'logger', 'serviceAppUrl', '$location', SocialLoginsController]); - function SocialLoginsController(locationHistory, logger, serviceAppUrl, $location) { - logger = logger.forSource(controllerId); - var vm = this; - vm.getExternalLoginUrl = getExternalLoginUrl; - function getExternalLoginUrl(provider) { - return serviceAppUrl + '/api/Account/ExternalLogin?provider=' + provider + '&clientReturnUrl=' + getReturnUrl(); - } - function getReturnUrl() { - var clientReturnUrl = $location.search().clientReturnUrl; - return typeof clientReturnUrl !== 'undefined' ? clientReturnUrl : locationHistory.previousItem().url(); - } - } - })(Controller = Main.Controller || (Main.Controller = {})); -})(Main || (Main = {})); -var Main; -(function (Main) { - var Controller; - (function (Controller) { - 'use strict'; - var controllerId = 'AllInOneController'; - angular.module('main') - .controller(controllerId, ['logger', 'resourcePoolFactory', '$scope', AllInOneController]); - function AllInOneController(logger, resourcePoolFactory, $scope) { - logger = logger.forSource(controllerId); - var vm = this; - vm.allInOneConfig = { userName: 'sample', resourcePoolKey: 'All-in-One' }; - $scope.$on('resourcePoolEditor_elementCellNumericValueIncreased', processNewInteraction); - $scope.$on('resourcePoolEditor_elementCellNumericValueDecreased', processNewInteraction); - $scope.$on('resourcePoolEditor_elementCellNumericValueReset', processNewInteraction); - _init(); - function _init() { - processExistingInteraction(); - } - function processExistingInteraction() { - resourcePoolFactory.getResourcePoolExpanded(vm.allInOneConfig) - .then(function (resourcePool) { - for (var elementIndex = 0; elementIndex < resourcePool.ElementSet.length; elementIndex++) { - var element = resourcePool.ElementSet[elementIndex]; - for (var elementFieldIndex = 0; elementFieldIndex < element.ElementFieldSet.length; elementFieldIndex++) { - var elementField = element.ElementFieldSet[elementFieldIndex]; - for (var elementCellIndex = 0; elementCellIndex < elementField.ElementCellSet.length; elementCellIndex++) { - var elementCell = elementField.ElementCellSet[elementCellIndex]; - if (elementCell.currentUserCell()) { - resourcePool.userInteracted = true; - return; - } - } - } - } - }); - } - function processNewInteraction(event, cell) { - if (cell.ElementField.Element.ResourcePool.User.UserName === vm.allInOneConfig.userName && cell.ElementField.Element.ResourcePool.Key === vm.allInOneConfig.resourcePoolKey) { - cell.ElementField.Element.ResourcePool.userInteracted = true; - return; - } - } - } - })(Controller = Main.Controller || (Main.Controller = {})); -})(Main || (Main = {})); -var Main; -(function (Main) { - var Controller; - (function (Controller) { - 'use strict'; - var controllerId = 'BasicsController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', 'resourcePoolFactory', '$scope', BasicsController]); - function BasicsController(dataContext, logger, resourcePoolFactory, $scope) { - logger = logger.forSource(controllerId); - var vm = this; - vm.existingModelConfig = { userName: 'sample', resourcePoolKey: 'Basics-Existing-Model' }; - vm.newModelConfig = { userName: 'sample', resourcePoolKey: 'Basics-New-Model' }; - $scope.$on('resourcePoolEditor_elementMultiplierIncreased', updateOppositeResourcePool); - $scope.$on('resourcePoolEditor_elementMultiplierDecreased', updateOppositeResourcePool); - $scope.$on('resourcePoolEditor_elementMultiplierReset', updateOppositeResourcePool); - function updateOppositeResourcePool(event, element) { - var oppositeKey = null; - if (element.ResourcePool.User.UserName === vm.existingModelConfig.userName && element.ResourcePool.Key === vm.existingModelConfig.resourcePoolKey) { - oppositeKey = vm.newModelConfig; - } - else if (element.ResourcePool.User.UserName === vm.newModelConfig.userName && element.ResourcePool.Key === vm.newModelConfig.resourcePoolKey) { - oppositeKey = vm.existingModelConfig; - } - if (oppositeKey !== null) { - resourcePoolFactory.getResourcePoolExpanded(oppositeKey) - .then(function (resourcePool) { - switch (event.name) { - case 'resourcePoolEditor_elementMultiplierIncreased': { - resourcePoolFactory.updateElementMultiplier(resourcePool.mainElement(), 'increase'); - break; - } - case 'resourcePoolEditor_elementMultiplierDecreased': { - resourcePoolFactory.updateElementMultiplier(resourcePool.mainElement(), 'decrease'); - break; - } - case 'resourcePoolEditor_elementMultiplierReset': { - resourcePoolFactory.updateElementMultiplier(resourcePool.mainElement(), 'reset'); - break; - } - } - dataContext.saveChanges(1500); - }); - } - } - } - })(Controller = Main.Controller || (Main.Controller = {})); -})(Main || (Main = {})); -var Main; -(function (Main) { - var Controller; - (function (Controller) { - 'use strict'; - var controllerId = 'ContributorsController'; - angular.module('main') - .controller(controllerId, ['logger', ContributorsController]); - function ContributorsController(logger) { - logger = logger.forSource(controllerId); - var vm = this; - vm.getDate = getDate; - function getDate(day, month, year) { - return new Date(year, month - 1, day); - } - } - })(Controller = Main.Controller || (Main.Controller = {})); -})(Main || (Main = {})); -var Main; -(function (Main) { - var Controller; - (function (Controller) { - 'use strict'; - var controllerId = 'DefaultController'; - angular.module('main') - .controller(controllerId, ['applicationFactory', 'dataContext', 'disqusShortname', 'logger', '$location', '$rootScope', '$scope', '$uibModal', DefaultController]); - function DefaultController(applicationFactory, dataContext, disqusShortname, logger, $location, $rootScope, $scope, $uibModal) { - logger = logger.forSource(controllerId); - var vm = this; - vm.applicationInfo = null; - vm.currentUser = { Email: '', isAuthenticated: function () { return false; }, HasPassword: false }; - vm.currentDate = new Date(); - vm.currentUserText = currentUserText; - vm.displayBankTransfer = false; - vm.displayFooterIcons = false; - vm.disqusConfig = { - disqus_shortname: disqusShortname, - disqus_identifier: '', - disqus_url: '' - }; - vm.guestAccountInfoVisible = false; - vm.logout = logout; - vm.openGuestAccountInfo = openGuestAccountInfo; - vm.toggleBankTransfer = toggleBankTransfer; - $scope.$on('dataContext_currentUserChanged', currentUserChanged); - $scope.$on('dataContext_currentUserEmailAddressChanged', currentUserEmailAddressChanged); - $scope.$on('guestAccountCreated', guestAccountCreated); - $scope.$on('$locationChangeStart', locationChangeStart); - $scope.$on('$routeChangeSuccess', routeChangeSuccess); - _init(); - function _init() { - getApplicationInfo(); - } - function currentUserChanged(event, newUser) { - vm.currentUser = newUser; - vm.guestAccountInfoVisible = newUser.isAuthenticated() && newUser.IsAnonymous; - } - function currentUserText() { - var userText = vm.currentUser.UserName; - if (vm.currentUser.IsAnonymous) { - userText += ' (Guest)'; - } - return userText; - } - function currentUserEmailAddressChanged() { - vm.guestAccountInfoVisible = false; - } - function getApplicationInfo() { - applicationFactory.getApplicationInfo() - .then(function (applicationInfo) { - vm.applicationInfo = applicationInfo; - vm.applicationInfo.CurrentVersionText = vm.applicationInfo.CurrentVersion + ' - Alpha ~ Beta'; - }); - } - function guestAccountCreated() { - vm.guestAccountInfoVisible = true; - } - function logout() { - dataContext.logout() - .then(function () { - $location.url('/'); - }); - } - function locationChangeStart(event, newUrl, oldUrl) { - if (dataContext.hasChanges()) { - var modalInstance = $uibModal.open({ - controller: ['$scope', '$uibModalInstance', function ($scope, $uibModalInstance) { - var vm = this; - vm.cancel = cancel; - vm.leave = leave; - function cancel() { - $uibModalInstance.dismiss('cancel'); - } - function leave() { - $uibModalInstance.close(); - } - }], - controllerAs: 'vm', - templateUrl: '/_system/views/account/confirmNavigateAway.html?v=0.53.0' - }); - modalInstance.result.then(function () { - dataContext.rejectChanges(); - $location.path(newUrl.substring($location.absUrl().length - $location.url().length)); - }, function () { }); - event.preventDefault(); - return; - } - } - function openGuestAccountInfo() { - var modalInstance = $uibModal.open({ - controller: ['$scope', '$uibModalInstance', function ($scope, $uibModalInstance) { - var vm = this; - vm.close = closeModal; - $scope.$on('dataContext_currentUserChanged', closeModal); - function closeModal() { - $uibModalInstance.close(); - } - }], - controllerAs: 'vm', - templateUrl: '/_system/views/account/guestAccountInfo.html?v=0.58.0' - }); - modalInstance.result.then(function () { }, function () { }); - } - function routeChangeSuccess(event, current, previous) { - vm.displayFooterIcons = $location.path() === '/'; - if (typeof current.enableDisqus !== 'undefined' && current.enableDisqus && vm.disqusConfig.disqus_shortname !== '') { - vm.disqusConfig.disqus_identifier = vm.disqusConfig.disqus_shortname + $location.path().replace(/\//g, '_'); - vm.disqusConfig.disqus_url = $location.absUrl().substring(0, $location.absUrl().length - $location.url().length + $location.path().length); - } - else { - vm.disqusConfig.disqus_identifier = ''; - } - } - function toggleBankTransfer() { - vm.displayBankTransfer = !vm.displayBankTransfer; - } - } - })(Controller = Main.Controller || (Main.Controller = {})); -})(Main || (Main = {})); -var Main; -(function (Main) { - var Controller; - (function (Controller) { - 'use strict'; - var controllerId = 'IntroductionController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', 'resourcePoolFactory', '$scope', '$timeout', IntroductionController]); - function IntroductionController(dataContext, logger, resourcePoolFactory, $scope, $timeout) { - logger = logger.forSource(controllerId); - var vm = this; - vm.upoConfig = { userName: 'sample', resourcePoolKey: 'Unidentified-Profiting-Object' }; - function _init() { - resourcePoolFactory.getResourcePoolExpanded(vm.upoConfig) - .then(function (resourcePool) { - var increaseMultiplierTimeout = $timeout(increaseMultiplier, 500); - function increaseMultiplier() { - resourcePool.ElementSet.forEach(function (element) { - resourcePoolFactory.updateElementMultiplier(element, 'increase'); - }); - increaseMultiplierTimeout = $timeout(increaseMultiplier, 2500); - } - $scope.$on("$destroy", function (event) { - $timeout.cancel(increaseMultiplierTimeout); - }); - }); - } - } - })(Controller = Main.Controller || (Main.Controller = {})); -})(Main || (Main = {})); -var Main; -(function (Main) { - var Controller; - (function (Controller) { - 'use strict'; - var controllerId = 'KnowledgeIndexController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', 'resourcePoolFactory', '$scope', '$timeout', KnowledgeIndexController]); - function KnowledgeIndexController(dataContext, logger, resourcePoolFactory, $scope, $timeout) { - logger = logger.forSource(controllerId); - var vm = this; - vm.oldModelChartConfig = { - title: { - text: '' - }, - options: { - chart: { - type: 'column', - height: 358 - }, - plotOptions: { - column: { - allowPointSelect: true, - pointWidth: 15 - } - }, - xAxis: { categories: ['Knowledge'] }, - yAxis: { - title: { - text: 'Development process' - }, - allowDecimals: false, - min: 0 - } - }, - size: {}, - series: [ - { name: "My Precious Jewelry", data: [0] }, - { name: 'Death Star Architecture', data: [0] }, - { name: "Christina's Secret", data: [0] }, - { name: 'Nuka Cola Company', data: [0] } - ] - }; - vm.newModelChartConfig = { - title: { - text: '' - }, - options: { - chart: { - type: 'column', - height: 300 - }, - plotOptions: { - column: { - allowPointSelect: true, - pointWidth: 15 - } - }, - xAxis: { categories: ['Knowledge'] }, - yAxis: { - title: { - text: 'Development process' - }, - allowDecimals: false, - min: 0 - } - }, - size: {}, - series: [ - { name: 'Global Knowledge Database', data: [0] } - ] - }; - vm.knowledgeIndexConfig = { userName: 'sample', resourcePoolKey: 'Knowledge-Index-Sample' }; - vm.popularSoftwareLicensesConfig = { userName: 'sample', resourcePoolKey: 'Knowledge-Index-Popular-Software-Licenses' }; - $scope.$on('resourcePoolEditor_elementCellNumericValueIncreased', updateAllInOne); - $scope.$on('resourcePoolEditor_elementCellNumericValueDecreased', updateAllInOne); - $scope.$on('resourcePoolEditor_elementCellNumericValueReset', updateAllInOne); - _init(); - function _init() { - var timeout = $timeout(refreshPage, 10000); - function refreshPage() { - var organizationIndex = Math.floor(Math.random() * 4); - vm.oldModelChartConfig.series[organizationIndex].data[0] += 1; - vm.newModelChartConfig.series[0].data[0] += 1; - timeout = $timeout(refreshPage, 1000); - } - $scope.$on("$destroy", function (event) { - $timeout.cancel(timeout); - }); - } - function updateAllInOne(event, cell) { - if (cell.ElementField.Element.ResourcePool.User.UserName !== vm.knowledgeIndexConfig.userName && - cell.ElementField.Element.ResourcePool.Key !== vm.knowledgeIndexConfig.resourcePoolKey) { - return; - } - var allInOneUniqueKey = { userName: 'sample', resourcePoolKey: 'All-in-One' }; - resourcePoolFactory.getResourcePoolExpanded(allInOneUniqueKey) - .then(function (resourcePool) { - if (typeof resourcePool.userInteracted !== 'undefined' && resourcePool.userInteracted) { - return; - } - for (var elementIndex = 0; elementIndex < resourcePool.ElementSet.length; elementIndex++) { - var element = resourcePool.ElementSet[elementIndex]; - if (element.Name === cell.ElementField.Element.Name) { - for (var elementFieldIndex = 0; elementFieldIndex < element.ElementFieldSet.length; elementFieldIndex++) { - var elementField = element.ElementFieldSet[elementFieldIndex]; - if (elementField.Name === cell.ElementField.Name) { - for (var elementCellIndex = 0; elementCellIndex < elementField.ElementCellSet.length; elementCellIndex++) { - var elementCell = elementField.ElementCellSet[elementCellIndex]; - if (elementCell.ElementItem.Name === cell.ElementItem.Name) { - switch (event.name) { - case 'resourcePoolEditor_elementCellNumericValueIncreased': { - resourcePoolFactory.updateElementCellDecimalValue(elementCell, 'increase'); - break; - } - case 'resourcePoolEditor_elementCellNumericValueDecreased': { - resourcePoolFactory.updateElementCellDecimalValue(elementCell, 'decrease'); - break; - } - case 'resourcePoolEditor_elementCellNumericValueReset': { - resourcePoolFactory.updateElementCellDecimalValue(elementCell, 'reset'); - break; - } - } - dataContext.saveChanges(1500); - break; - } - } - } - } - } - } - }); - } - } - })(Controller = Main.Controller || (Main.Controller = {})); -})(Main || (Main = {})); -var Main; -(function (Main) { - var Controller; - (function (Controller) { - 'use strict'; - var controllerId = 'NotFoundController'; - angular.module('main') - .controller(controllerId, ['logger', '$location', NotFoundController]); - function NotFoundController(logger, $location) { - logger = logger.forSource(controllerId); - _init(); - function _init() { - var url = $location.search().url; - if (typeof url !== 'undefined') { - throw new Error('Not found: ' + url); - } - } - } - })(Controller = Main.Controller || (Main.Controller = {})); -})(Main || (Main = {})); -var Main; -(function (Main) { - var Controller; - (function (Controller) { - 'use strict'; - var controllerId = 'PriorityIndexController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', 'resourcePoolFactory', '$scope', PriorityIndexController]); - function PriorityIndexController(dataContext, logger, resourcePoolFactory, $scope) { - logger = logger.forSource(controllerId); - var vm = this; - vm.priorityIndexConfig = { userName: 'sample', resourcePoolKey: 'Priority-Index-Sample' }; - $scope.$on('resourcePoolEditor_elementCellNumericValueIncreased', updateAllInOne); - $scope.$on('resourcePoolEditor_elementCellNumericValueDecreased', updateAllInOne); - $scope.$on('resourcePoolEditor_elementCellNumericValueReset', updateAllInOne); - function updateAllInOne(event, cell) { - if (cell.ElementField.Element.ResourcePool.User.UserName !== vm.priorityIndexConfig.userName && - cell.ElementField.Element.ResourcePool.Key !== vm.priorityIndexConfig.resourcePoolKey) { - return; - } - var allInOneUniqueKey = { userName: 'sample', resourcePoolKey: 'All-in-One' }; - resourcePoolFactory.getResourcePoolExpanded(allInOneUniqueKey) - .then(function (resourcePool) { - if (typeof resourcePool.userInteracted !== 'undefined' && resourcePool.userInteracted) { - return; - } - for (var elementIndex = 0; elementIndex < resourcePool.ElementSet.length; elementIndex++) { - var element = resourcePool.ElementSet[elementIndex]; - if (element.Name === cell.ElementField.Element.Name) { - for (var elementFieldIndex = 0; elementFieldIndex < element.ElementFieldSet.length; elementFieldIndex++) { - var elementField = element.ElementFieldSet[elementFieldIndex]; - if (elementField.Name === cell.ElementField.Name) { - for (var elementCellIndex = 0; elementCellIndex < elementField.ElementCellSet.length; elementCellIndex++) { - var elementCell = elementField.ElementCellSet[elementCellIndex]; - if (elementCell.ElementItem.Name === cell.ElementItem.Name) { - switch (event.name) { - case 'resourcePoolEditor_elementCellNumericValueIncreased': { - resourcePoolFactory.updateElementCellDecimalValue(elementCell, 'increase'); - break; - } - case 'resourcePoolEditor_elementCellNumericValueDecreased': { - resourcePoolFactory.updateElementCellDecimalValue(elementCell, 'decrease'); - break; - } - case 'resourcePoolEditor_elementCellNumericValueReset': { - resourcePoolFactory.updateElementCellDecimalValue(elementCell, 'reset'); - break; - } - } - dataContext.saveChanges(1500); - break; - } - } - } - } - } - } - }); - } - } - })(Controller = Main.Controller || (Main.Controller = {})); -})(Main || (Main = {})); -var Main; -(function (Main) { - var Controller; - (function (Controller) { - 'use strict'; - var controllerId = 'TotalCostIndexController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', 'resourcePoolFactory', '$scope', TotalCostIndexController]); - function TotalCostIndexController(dataContext, logger, resourcePoolFactory, $scope) { - logger = logger.forSource(controllerId); - var vm = this; - vm.existingModelConfig = { userName: 'sample', resourcePoolKey: 'Total-Cost-Index-Existing-Model' }; - vm.newModelConfig = { userName: 'sample', resourcePoolKey: 'Total-Cost-Index-New-Model' }; - $scope.$on('resourcePoolEditor_elementMultiplierIncreased', updateOppositeResourcePool); - $scope.$on('resourcePoolEditor_elementMultiplierDecreased', updateOppositeResourcePool); - $scope.$on('resourcePoolEditor_elementMultiplierReset', updateOppositeResourcePool); - function updateOppositeResourcePool(event, element) { - var oppositeKey = null; - if (element.ResourcePool.User.UserName === vm.existingModelConfig.userName && element.ResourcePool.Key === vm.existingModelConfig.resourcePoolKey) { - oppositeKey = vm.newModelConfig; - } - else if (element.ResourcePool.User.UserName === vm.newModelConfig.userName && element.ResourcePool.Key === vm.newModelConfig.resourcePoolKey) { - oppositeKey = vm.existingModelConfig; - } - if (oppositeKey !== null) { - resourcePoolFactory.getResourcePoolExpanded(oppositeKey) - .then(function (resourcePool) { - switch (event.name) { - case 'resourcePoolEditor_elementMultiplierIncreased': { - resourcePoolFactory.updateElementMultiplier(resourcePool.mainElement(), 'increase'); - break; - } - case 'resourcePoolEditor_elementMultiplierDecreased': { - resourcePoolFactory.updateElementMultiplier(resourcePool.mainElement(), 'decrease'); - break; - } - case 'resourcePoolEditor_elementMultiplierReset': { - resourcePoolFactory.updateElementMultiplier(resourcePool.mainElement(), 'reset'); - break; - } - } - dataContext.saveChanges(1500); - }); - } - } - } - })(Controller = Main.Controller || (Main.Controller = {})); -})(Main || (Main = {})); -var Main; -(function (Main) { - var Controller; - (function (Controller) { - 'use strict'; - var controllerId = 'ResourcePoolManageController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'Enums', 'logger', 'resourcePoolFactory', '$location', '$rootScope', '$routeParams', '$uibModal', ResourcePoolManageController]); - function ResourcePoolManageController(dataContext, Enums, logger, resourcePoolFactory, $location, $rootScope, $routeParams, $uibModal) { - logger = logger.forSource(controllerId); - var vm = this; - vm.addElement = addElement; - vm.addElementField = addElementField; - vm.addElementItem = addElementItem; - vm.cancelElement = cancelElement; - vm.cancelElementCell = cancelElementCell; - vm.cancelElementField = cancelElementField; - vm.cancelElementItem = cancelElementItem; - vm.cancelResourcePool = cancelResourcePool; - vm.editElement = editElement; - vm.editElementCell = editElementCell; - vm.editElementField = editElementField; - vm.editElementItem = editElementItem; - vm.element = null; - vm.elementMaster = null; - vm.elementCell = null; - vm.elementCellMaster = null; - vm.elementCellSet = elementCellSet; - vm.elementField = null; - vm.elementFieldMaster = null; - vm.elementFieldSet = elementFieldSet; - vm.elementFieldDataTypeFiltered = elementFieldDataTypeFiltered; - vm.elementItem = null; - vm.elementItemMaster = null; - vm.elementItemSet = elementItemSet; - vm.isElementEdit = false; - vm.isElementNew = true; - vm.isElementFieldEdit = false; - vm.isElementFieldNew = true; - vm.isElementItemEdit = false; - vm.isElementItemNew = true; - vm.isNew = $location.path().substring($location.path().lastIndexOf('/') + 1) === 'new'; - vm.isSaveEnabled = isSaveEnabled; - vm.isSaving = false; - vm.openRemoveResourcePoolModal = openRemoveResourcePoolModal; - vm.removeElement = removeElement; - vm.removeElementField = removeElementField; - vm.removeElementItem = removeElementItem; - vm.removeResourcePool = removeResourcePool; - vm.resourcePool = { ElementSet: [] }; - vm.resourcePoolKey = $routeParams.resourcePoolKey; - vm.saveResourcePool = saveResourcePool; - vm.saveElement = saveElement; - vm.saveElementCell = saveElementCell; - vm.saveElementField = saveElementField; - vm.saveElementItem = saveElementItem; - vm.userName = $routeParams.userName; - vm.ElementFieldDataType = Enums.ElementFieldDataType; - vm.ElementFieldIndexCalculationType = Enums.ElementFieldIndexCalculationType; - vm.ElementFieldIndexSortType = Enums.ElementFieldIndexSortType; - _init(); - function _init() { - if (vm.isNew) { - var currentUser = dataContext.getCurrentUser(); - if (vm.userName === currentUser.UserName) { - vm.user = currentUser; - vm.resourcePool = resourcePoolFactory.createResourcePoolBasic(); - $rootScope.viewTitle = vm.resourcePool.Name; - } - else { - $location.url('/_system/content/notFound?url=' + $location.url()); - return; - } - } - else { - var resourcePoolUniqueKey = { userName: vm.userName, resourcePoolKey: vm.resourcePoolKey }; - resourcePoolFactory.getResourcePoolExpanded(resourcePoolUniqueKey) - .then(function (resourcePool) { - if (resourcePool === null) { - $location.url('/_system/content/notFound?url=' + $location.url()); - return; - } - vm.resourcePool = resourcePool; - $rootScope.viewTitle = vm.resourcePool.Name; - }); - } - } - function addElement() { - vm.element = resourcePoolFactory.createElement({ - ResourcePool: vm.resourcePool, - Name: 'New element', - IsMainElement: false - }); - vm.isElementEdit = true; - vm.isElementNew = true; - } - function addElementField() { - var element = vm.resourcePool.ElementSet[0]; - var sortOrder = element.ElementFieldSet.length + 1; - vm.elementField = resourcePoolFactory.createElementField({ - Element: element, - Name: 'New field', - DataType: 1, - SortOrder: sortOrder - }); - vm.isElementFieldEdit = true; - vm.isElementFieldNew = true; - } - function addElementItem() { - vm.elementItem = resourcePoolFactory.createElementItem({ - Element: vm.resourcePool.ElementSet[0], - Name: 'New item' - }); - vm.isElementItemEdit = true; - vm.isElementItemNew = true; - } - function cancelElement() { - if (vm.isElementNew) { - resourcePoolFactory.removeElement(vm.element); - } - else { - vm.element.Name = vm.elementMaster.Name; - } - vm.isElementEdit = false; - vm.element = null; - vm.elementMaster = null; - } - function cancelElementCell() { - vm.elementCell.SelectedElementItemId = vm.elementCellMaster.SelectedElementItemId; - vm.elementCell.UserElementCellSet[0].StringValue = vm.elementCellMaster.UserElementCellSet[0].StringValue; - vm.elementCell.UserElementCellSet[0].BooleanValue = vm.elementCellMaster.UserElementCellSet[0].BooleanValue; - vm.elementCell.UserElementCellSet[0].IntegerValue = vm.elementCellMaster.UserElementCellSet[0].IntegerValue; - vm.elementCell.UserElementCellSet[0].DecimalValue = vm.elementCellMaster.UserElementCellSet[0].DecimalValue; - vm.elementCell.UserElementCellSet[0].DateTimeValue = vm.elementCellMaster.UserElementCellSet[0].DateTimeValue; - vm.isElementCellEdit = false; - vm.elementCell = null; - vm.elementCellMaster = null; - } - function cancelElementField() { - if (vm.isElementFieldNew) { - resourcePoolFactory.removeElementField(vm.elementField); - } - else { - vm.elementField.Name = vm.elementFieldMaster.Name; - vm.elementField.DataType = vm.elementFieldMaster.DataType; - vm.elementField.SelectedElementId = vm.elementFieldMaster.SelectedElementId; - vm.elementField.UseFixedValue = vm.elementFieldMaster.UseFixedValue; - vm.elementField.IndexEnabled = vm.elementFieldMaster.IndexEnabled; - vm.elementField.IndexCalculationType = vm.elementFieldMaster.IndexCalculationType; - vm.elementField.IndexSortType = vm.elementFieldMaster.IndexSortType; - vm.elementField.SortOrder = vm.elementFieldMaster.SortOrder; - } - vm.isElementFieldEdit = false; - vm.elementField = null; - vm.elementFieldMaster = null; - } - function cancelElementItem() { - if (!vm.isElementItemNew) { - vm.elementItem.Name = vm.elementItemMaster.Name; - } - vm.isElementItemEdit = false; - vm.elementItem = null; - vm.elementItemMaster = null; - } - function cancelResourcePool() { - dataContext.rejectChanges(); - var locationPath = vm.isNew ? - '/' + dataContext.getCurrentUser().UserName : - vm.resourcePool.urlView(); - $location.url(locationPath); - } - function editElement(element) { - vm.elementMaster = angular.copy(element); - vm.element = element; - vm.isElementEdit = true; - vm.isElementNew = false; - } - function editElementCell(elementCell) { - vm.elementCellMaster = angular.copy(elementCell); - vm.elementCell = elementCell; - vm.isElementCellEdit = true; - } - function editElementField(elementField) { - vm.elementFieldMaster = angular.copy(elementField); - vm.elementField = elementField; - vm.isElementFieldEdit = true; - vm.isElementFieldNew = false; - } - function editElementItem(elementItem) { - vm.elementItemMaster = angular.copy(elementItem); - vm.elementItem = elementItem; - vm.isElementItemEdit = true; - vm.isElementItemNew = false; - } - function elementCellSet() { - var elementItems = elementItemSet(); - var list = []; - elementItems.forEach(function (elementItem) { - elementItem.ElementCellSet.forEach(function (elementCell) { - list.push(elementCell); - }); - }); - return list; - } - function elementFieldSet() { - var list = []; - vm.resourcePool.ElementSet.forEach(function (element) { - element.ElementFieldSet.forEach(function (elementField) { - list.push(elementField); - }); - }); - return list; - } - function elementFieldDataTypeFiltered() { - var filtered = {}; - for (var key in vm.ElementFieldDataType) { - if (key === 'DirectIncome' || key === 'Multiplier') { - var exists = vm.elementField.Element.ElementFieldSet.some(fieldExists); - if (!exists) { - filtered[key] = vm.ElementFieldDataType[key]; - } - } - else if (key === 'Element') { - if (vm.elementField.Element.ResourcePool.ElementSet.length > 1) { - filtered[key] = vm.ElementFieldDataType[key]; - } - } - else { - filtered[key] = vm.ElementFieldDataType[key]; - } - } - function fieldExists(field) { - return vm.ElementFieldDataType[key] === field.ElementFieldDataType; - } - return filtered; - } - function elementItemSet() { - var list = []; - vm.resourcePool.ElementSet.forEach(function (element) { - element.ElementItemSet.forEach(function (elementItem) { - list.push(elementItem); - }); - }); - return list; - } - function isSaveEnabled() { - var value = !vm.isSaving && - typeof vm.resourcePoolForm !== 'undefined' && - vm.resourcePoolForm.$valid; - return value; - } - function openRemoveResourcePoolModal() { - var modalInstance = $uibModal.open({ - controller: ['$scope', '$uibModalInstance', ResourcePoolRemoveController], - controllerAs: 'vm', - keyboard: false, - templateUrl: '/_system/views/resourcePool/resourcePoolRemove.html?v=0.53.0' - }); - modalInstance.result.then(function () { - removeResourcePool(); - }, function () { }); - } - function removeElement(element) { - resourcePoolFactory.removeElement(element); - } - function removeElementField(elementField) { - resourcePoolFactory.removeElementField(elementField); - } - function removeElementItem(elementItem) { - resourcePoolFactory.removeElementItem(elementItem); - } - function removeResourcePool() { - vm.isSaving = true; - resourcePoolFactory.removeResourcePool(vm.resourcePool); - dataContext.saveChanges() - .then(function () { - $location.url('/' + dataContext.getCurrentUser().UserName); - }) - .finally(function () { - vm.isSaving = false; - }); - } - function saveElement() { - vm.isElementEdit = false; - vm.element = null; - vm.elementMaster = null; - } - function saveElementCell() { - vm.isElementCellEdit = false; - vm.elementCell = null; - vm.elementCellMaster = null; - } - function saveElementField() { - if (vm.elementField.DataType === vm.ElementFieldDataType.String || - vm.elementField.DataType === vm.ElementFieldDataType.Element) { - vm.elementField.UseFixedValue = null; - } - if (vm.elementField.DataType === vm.ElementFieldDataType.Multiplier) { - vm.elementField.UseFixedValue = false; - } - if (vm.elementField.DataType === vm.ElementFieldDataType.DirectIncome) { - vm.elementField.UseFixedValue = true; - } - vm.isElementFieldEdit = false; - vm.elementField = null; - vm.elementFieldMaster = null; - } - function saveElementItem() { - if (vm.isElementItemNew) { - vm.elementItem = resourcePoolFactory.createElementItem(vm.elementItem); - } - vm.isElementItemEdit = false; - vm.elementItem = null; - vm.elementItemMaster = null; - } - function saveResourcePool() { - vm.isSaving = true; - vm.resourcePool.updateCache(); - dataContext.saveChanges() - .then(function () { - $location.url(vm.resourcePool.urlView()); - }) - .finally(function () { - vm.isSaving = false; - }); - } - } - function ResourcePoolRemoveController($scope, $uibModalInstance) { - var vm = this; - vm.cancel = cancel; - vm.remove = remove; - function cancel() { - $uibModalInstance.dismiss('cancel'); - } - function remove() { - $uibModalInstance.close(); - } - } - })(Controller = Main.Controller || (Main.Controller = {})); -})(Main || (Main = {})); -var Main; -(function (Main) { - var Controller; - (function (Controller) { - 'use strict'; - var controllerId = 'ResourcePoolSearchController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', 'resourcePoolFactory', '$location', '$rootScope', '$scope', ResourcePoolSearchController]); - function ResourcePoolSearchController(dataContext, logger, resourcePoolFactory, $location, $rootScope, $scope) { - logger = logger.forSource(controllerId); - var vm = this; - vm.resourcePoolSet = []; - vm.searchKey = ''; - vm.searchKeyChanged = searchKeyChanged; - vm.showResults = false; - _init(); - function _init() { - } - function searchKeyChanged() { - if (vm.searchKey.length <= 2) { - vm.showResults = false; - return; - } - resourcePoolFactory.getResourcePoolSet(vm.searchKey) - .then(function (data) { - vm.resourcePoolSet = data; - vm.showResults = true; - }); - } - } - })(Controller = Main.Controller || (Main.Controller = {})); -})(Main || (Main = {})); -var Main; -(function (Main) { - var Controller; - (function (Controller) { - 'use strict'; - var controllerId = 'ResourcePoolViewController'; - angular.module('main') - .controller(controllerId, ['logger', 'resourcePoolFactory', '$location', '$rootScope', '$routeParams', ResourcePoolViewController]); - function ResourcePoolViewController(logger, resourcePoolFactory, $location, $rootScope, $routeParams) { - logger = logger.forSource(controllerId); - var vm = this; - vm.editorConfig = { - resourcePoolKey: $routeParams.resourcePoolKey, - userName: $routeParams.userName - }; - _init(); - function _init() { - resourcePoolFactory.getResourcePoolExpanded(vm.editorConfig) - .then(function (resourcePool) { - if (resourcePool === null) { - $location.url('/_system/content/notFound?url=' + $location.url()); - return; - } - $rootScope.viewTitle = resourcePool.Name; - }); - } - } - })(Controller = Main.Controller || (Main.Controller = {})); -})(Main || (Main = {})); -var M30; -(function (M30) { - 'use strict'; - var directiveId = 'resourcePoolEditor'; - angular.module('main') - .directive(directiveId, ['dataContext', 'Enums', 'logger', 'resourcePoolFactory', '$location', '$rootScope', resourcePoolEditor]); - function resourcePoolEditor(dataContext, Enums, logger, resourcePoolFactory, $location, $rootScope) { - logger = logger.forSource(directiveId); - function link(scope, elm, attrs) { - scope.currentUser = null; - scope.displayDescription = true; - scope.displayIndexDetails = false; - scope.errorMessage = ''; - scope.isSaving = false; - scope.resourcePool = { Name: 'Loading...' }; - scope.resourcePoolKey = ''; - scope.userName = ''; - scope.changeSelectedElement = changeSelectedElement; - scope.decreaseElementCellNumericValue = decreaseElementCellNumericValue; - scope.decreaseElementMultiplier = decreaseElementMultiplier; - scope.decreaseIndexRating = decreaseIndexRating; - scope.decreaseResourcePoolRate = decreaseResourcePoolRate; - scope.editResourcePool = editResourcePool; - scope.increaseElementCellNumericValue = increaseElementCellNumericValue; - scope.increaseElementMultiplier = increaseElementMultiplier; - scope.increaseIndexRating = increaseIndexRating; - scope.increaseResourcePoolRate = increaseResourcePoolRate; - scope.resetElementCellNumericValue = resetElementCellNumericValue; - scope.resetElementMultiplier = resetElementMultiplier; - scope.resetIndexRating = resetIndexRating; - scope.resetResourcePoolRate = resetResourcePoolRate; - scope.toggleDescription = toggleDescription; - scope.toggleIndexDetails = toggleIndexDetails; - scope.$watch('config', configChanged, true); - scope.$on('saveChangesStart', saveChangesStart); - scope.$on('saveChangesCompleted', saveChangesCompleted); - scope.$on('dataContext_currentUserChanged', currentUserChanged); - function changeSelectedElement(element) { - scope.resourcePool.selectedElement(element); - loadChartData(); - } - function configChanged() { - var userName = typeof scope.config.userName === 'undefined' ? '' : scope.config.userName; - var resourcePoolKey = typeof scope.config.resourcePoolKey === 'undefined' ? '' : scope.config.resourcePoolKey; - initialize(dataContext.getCurrentUser(), userName, resourcePoolKey); - } - function decreaseElementCellNumericValue(cell) { - resourcePoolFactory.updateElementCellDecimalValue(cell, 'decrease'); - $rootScope.$broadcast('resourcePoolEditor_elementCellNumericValueDecreased', cell); - saveChanges(); - } - function decreaseElementMultiplier(element) { - resourcePoolFactory.updateElementMultiplier(element, 'decrease'); - $rootScope.$broadcast('resourcePoolEditor_elementMultiplierDecreased', element); - saveChanges(); - } - function decreaseIndexRating(field) { - resourcePoolFactory.updateElementFieldIndexRating(field, 'decrease'); - saveChanges(); - } - function decreaseResourcePoolRate() { - resourcePoolFactory.updateResourcePoolRate(scope.resourcePool, 'decrease'); - saveChanges(); - } - function editResourcePool() { - $location.url(scope.resourcePool.urlEdit()); - } - function increaseElementCellNumericValue(cell) { - resourcePoolFactory.updateElementCellDecimalValue(cell, 'increase'); - $rootScope.$broadcast('resourcePoolEditor_elementCellNumericValueIncreased', cell); - saveChanges(); - } - function increaseElementMultiplier(element) { - resourcePoolFactory.updateElementMultiplier(element, 'increase'); - $rootScope.$broadcast('resourcePoolEditor_elementMultiplierIncreased', element); - saveChanges(); - } - function increaseIndexRating(field) { - resourcePoolFactory.updateElementFieldIndexRating(field, 'increase'); - saveChanges(); - } - function increaseResourcePoolRate() { - resourcePoolFactory.updateResourcePoolRate(scope.resourcePool, 'increase'); - saveChanges(); - } - function initialize(user, userName, resourcePoolKey) { - if (scope.currentUser !== user || scope.userName !== userName || scope.resourcePoolKey !== resourcePoolKey) { - scope.currentUser = user; - scope.userName = userName; - scope.resourcePoolKey = resourcePoolKey; - scope.errorMessage = ''; - scope.chartConfig = { - credits: { - enabled: false - }, - loading: true, - options: { - plotOptions: { - column: { - allowPointSelect: true, - pointWidth: 15 - }, - pie: { - allowPointSelect: true, - cursor: 'pointer', - dataLabels: { - enabled: false - }, - showInLegend: true - } - }, - tooltip: { - headerFormat: '' - }, - xAxis: { categories: [''] }, - yAxis: { - allowDecimals: false, - min: 0 - } - }, - size: {}, - title: { text: '' } - }; - if (scope.userName === '' || scope.resourcePoolKey === '') { - scope.errorMessage = 'CMRP Id cannot be null'; - scope.chartConfig.loading = false; - return; - } - var resourcePoolUniqueKey = { userName: scope.userName, resourcePoolKey: scope.resourcePoolKey }; - resourcePoolFactory.getResourcePoolExpanded(resourcePoolUniqueKey) - .then(function (resourcePool) { - if (typeof resourcePool === 'undefined' || resourcePool === null) { - scope.errorMessage = 'Invalid CMRP'; - return; - } - scope.resourcePool = resourcePool; - if (scope.resourcePool.selectedElement() !== null) { - loadChartData(); - } - }) - .catch(function () { - }) - .finally(function () { - scope.chartConfig.loading = false; - }); - } - } - function loadChartData() { - var element = scope.resourcePool.selectedElement(); - var chartData = null; - if (element === null) { - return; - } - if (element.ElementItemSet.length > 20) { - return; - } - scope.chartConfig.title = { text: element.Name }; - scope.chartConfig.series = []; - if (scope.displayIndexDetails) { - scope.chartConfig.title = { text: 'Indexes' }; - scope.chartConfig.options.chart = { type: 'pie' }; - scope.chartConfig.options.yAxis.title = { text: '' }; - chartData = []; - element.elementFieldIndexSet().forEach(function (elementFieldIndex) { - var chartItem = new ElementFieldIndexChartItem(elementFieldIndex); - chartData.push(chartItem); - }); - scope.chartConfig.series = [{ data: chartData }]; - } - else { - scope.chartConfig.title = { text: element.Name }; - if (element === element.ResourcePool.mainElement() && (element.totalIncome() > 0 || element.directIncomeField() !== null)) { - scope.chartConfig.options.chart = { type: 'column' }; - scope.chartConfig.options.yAxis.title = { text: 'Total Income' }; - element.ElementItemSet.forEach(function (elementItem) { - var chartItem = new ColumnChartItem(elementItem); - scope.chartConfig.series.push(chartItem); - }); - } - else { - scope.chartConfig.options.chart = { type: 'pie' }; - scope.chartConfig.options.yAxis.title = { text: '' }; - chartData = []; - element.ElementItemSet.forEach(function (elementItem) { - elementItem.ElementCellSet.forEach(function (elementCell) { - if (elementCell.ElementField.IndexEnabled) { - var chartItem = new PieChartItem(elementCell); - chartData.push(chartItem); - } - }); - }); - scope.chartConfig.series = [{ data: chartData }]; - } - } - } - function resetElementCellNumericValue(cell) { - resourcePoolFactory.updateElementCellDecimalValue(cell, 'reset'); - $rootScope.$broadcast('resourcePoolEditor_elementCellNumericValueReset', cell); - saveChanges(); - } - function resetElementMultiplier(element) { - resourcePoolFactory.updateElementMultiplier(element, 'reset'); - $rootScope.$broadcast('resourcePoolEditor_elementMultiplierReset', element); - saveChanges(); - } - function resetIndexRating(field) { - resourcePoolFactory.updateElementFieldIndexRating(field, 'reset'); - saveChanges(); - } - function resetResourcePoolRate() { - resourcePoolFactory.updateResourcePoolRate(scope.resourcePool, 'reset'); - saveChanges(); - } - function saveChanges() { - dataContext.saveChanges(1500); - } - function saveChangesStart() { - scope.isSaving = true; - } - function saveChangesCompleted() { - scope.isSaving = false; - } - function toggleDescription() { - scope.displayDescription = !scope.displayDescription; - } - function toggleIndexDetails() { - scope.displayIndexDetails = !scope.displayIndexDetails; - loadChartData(); - } - function currentUserChanged(event, newUser) { - initialize(newUser, scope.userName, scope.resourcePoolKey); - } - function ColumnChartItem(elementItem) { - var self = this; - Object.defineProperty(self, "name", { - enumerable: true, - configurable: true, - get: function () { - return elementItem.Name; - } - }); - Object.defineProperty(self, "data", { - enumerable: true, - configurable: true, - get: function () { - return [elementItem.totalIncome()]; - } - }); - } - function ElementFieldIndexChartItem(elementFieldIndex) { - var self = this; - Object.defineProperty(self, "name", { - enumerable: true, - configurable: true, - get: function () { return elementFieldIndex.Name; } - }); - Object.defineProperty(self, "y", { - enumerable: true, - configurable: true, - get: function () { - var indexRating = elementFieldIndex.indexRating(); - return Number(indexRating.toFixed(2)); - } - }); - } - function PieChartItem(elementCell) { - var self = this; - Object.defineProperty(self, "name", { - enumerable: true, - configurable: true, - get: function () { - return elementCell.ElementItem.Name; - } - }); - Object.defineProperty(self, "y", { - enumerable: true, - configurable: true, - get: function () { - var numericValue = elementCell.numericValue(); - return Number(numericValue.toFixed(2)); - } - }); - } - } - return { - restrict: 'E', - templateUrl: '/_system/js/app/directives/resourcePoolEditor/resourcePoolEditor.html?v=0.62.0', - scope: { - config: '=' - }, - link: link - }; - } -})(M30 || (M30 = {})); -var Main; -(function (Main) { - var Controller; - (function (Controller) { - 'use strict'; - var controllerId = 'ClosingNotesController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', '$location', '$rootScope', '$scope', ClosingNotesController]); - function ClosingNotesController(dataContext, logger, $location, $rootScope, $scope) { - logger = logger.forSource(controllerId); - var vm = this; - vm.currentUser = { isAuthenticated: function () { return false; } }; - $scope.$on('dataContext_currentUserChanged', currentUserChanged); - _init(); - function _init() { - vm.currentUser = dataContext.getCurrentUser(); - } - function currentUserChanged(event, newUser) { - vm.currentUser = newUser; - } - } - })(Controller = Main.Controller || (Main.Controller = {})); -})(Main || (Main = {})); -var Main; -(function (Main) { - var Controller; - (function (Controller) { - 'use strict'; - var controllerId = 'FairShareIndexSampleController'; - angular.module('main') - .controller(controllerId, ['logger', FairShareIndexSampleController]); - function FairShareIndexSampleController(logger) { - logger = logger.forSource(controllerId); - var vm = this; - } - })(Controller = Main.Controller || (Main.Controller = {})); -})(Main || (Main = {})); -var Main; -(function (Main) { - var Controller; - (function (Controller) { - 'use strict'; - var controllerId = 'ResourcePoolRateSampleController'; - angular.module('main') - .controller(controllerId, ['logger', ResourcePoolRateSampleController]); - function ResourcePoolRateSampleController(logger) { - logger = logger.forSource(controllerId); - var vm = this; - vm.resourcePoolRate_SampleResourcePoolId = 12; - } - })(Controller = Main.Controller || (Main.Controller = {})); -})(Main || (Main = {})); diff --git a/ngClient/_system/ts/app/app.js.map b/ngClient/_system/ts/app/app.js.map deleted file mode 100644 index 1a7d997a4..000000000 --- a/ngClient/_system/ts/app/app.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"app.js","sourceRoot":"","sources":["main.ts","filters/ngEnum.ts","filters/numberSymbol.ts","filters/percentage.ts","factories/applicationFactory.ts","factories/dataContext.ts","factories/entityManagerFactory.ts","factories/locationHistory.ts","factories/logger.ts","factories/resourcePoolFactory.ts","entities/Element.ts","entities/ElementCell.ts","entities/ElementField.ts","entities/ElementItem.ts","entities/Enums.ts","entities/ResourcePool.ts","entities/User.ts","entities/UserElementCell.ts","entities/UserElementField.ts","entities/UserResourcePool.ts","directives/resourcePoolEditor/resourcePoolEditor.ts","controllers/resourcePool/ResourcePoolManageController.ts","controllers/resourcePool/ResourcePoolSearchController.ts","controllers/resourcePool/ResourcePoolViewController.ts","controllers/content/AllInOneController.ts","controllers/content/BasicsController.ts","controllers/content/ContributorsController.ts","controllers/content/DefaultController.ts","controllers/content/IntroductionController.ts","controllers/content/KnowledgeIndexController.ts","controllers/content/NotFoundController.ts","controllers/content/PriorityIndexController.ts","controllers/content/TotalCostIndexController.ts","controllers/content/obsolete/ClosingNotesController.ts","controllers/content/obsolete/FairShareIndexSampleController.ts","controllers/content/obsolete/ResourcePoolRateSampleController.ts","controllers/account/AccountController.ts","controllers/account/AccountEditController.ts","controllers/account/AddPasswordController.ts","controllers/account/ChangeEmailController.ts","controllers/account/ChangePasswordController.ts","controllers/account/ChangeUserNameController.ts","controllers/account/ConfirmEmailController.ts","controllers/account/LoginController.ts","controllers/account/ProfileController.ts","controllers/account/RegisterController.ts","controllers/account/ResetPasswordController.ts","controllers/account/SocialLoginsController.ts","config/authorization.ts","config/breeze.ts","config/exceptionHandlerExtension.ts","config/googleAnalytics.ts","config/route.ts"],"names":[],"mappings":"AAYA,IAAO,IAAI,CAgBV;AAhBD,WAAO,IAAI,EAAC,CAAC;IACT,YAAY,CAAC;IAEb,OAAO,CAAC,GAAG,CAAC,gBAAgB,GAAG,IAAI,IAAI,EAAE,CAAC,CAAC;IAE3C,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE;QACnB,eAAe;QACf,mCAAmC;QACnC,0BAA0B;QAC1B,gBAAgB;QAChB,mBAAmB;QACnB,eAAe;QACf,SAAS;QACT,YAAY;QACZ,cAAc;KACjB,CAAC,CAAC;AACP,CAAC,EAhBM,IAAI,KAAJ,IAAI,QAgBV;ACtBD,IAAO,GAAG,CAkBT;AAlBD,WAAO,GAAG,EAAC,CAAC;IACR,YAAY,CAAC;IAEb,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;SACjB,MAAM,CAAC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,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACvB,CAAC;YAAC,IAAI,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,KAAK,uBAAuB,CAAC,CAAC,CAAC;gBACzD,SAAS,CAAC,GAAG,CAAC,yEAAyE,CAAC,CAAC;YAC7F,CAAC;QACL,CAAC;QAGD,4BAA4B,KAAK,EAAE,OAAO,EAAE,QAAQ;YAGhD,UAAU,CAAC,SAAS,GAAG,OAAO,OAAO,CAAC,KAAK,KAAK,WAAW,GAAG,OAAO,CAAC,KAAK,GAAG,EAAE,CAAC;QACrF,CAAC;IACL,CAAC;AACL,CAAC,EAzIO,EAAE,KAAF,EAAE,QAyIT"} \ No newline at end of file diff --git a/ngClient/_system/ts/app/controllers/account/AddPasswordController.ts b/ngClient/_system/ts/app/controllers/account/AddPasswordController.ts deleted file mode 100644 index cba38a557..000000000 --- a/ngClient/_system/ts/app/controllers/account/AddPasswordController.ts +++ /dev/null @@ -1,60 +0,0 @@ -module Main.Controller { - 'use strict'; - - var controllerId = 'AddPasswordController'; - - class AddPasswordViewModel { - addPassword: Function; - bindingModel:any = { - Password: String, - ConfirmPassword: String - }; - cancel: Function; - isSaving = false; - isSaveDisabled: Function; - } - - interface IAddPasswordController extends ng.IScope { - vm: AddPasswordViewModel - } - - export class AddPasswordController { - - static $inject = ['dataContext', 'logger', '$location', '$scope']; - - constructor(dataContext: any, logger: any, $location: any, $scope: IAddPasswordController) { - - // Logger - logger = logger.forSource(controllerId); - - $scope.vm = new AddPasswordViewModel(); - $scope.vm.addPassword = addPassword; - $scope.vm.cancel = cancel; - $scope.vm.isSaveDisabled = isSaveDisabled; - - function addPassword() { - - $scope.vm.isSaving = true; - - dataContext.addPassword($scope.vm.bindingModel) - .success(() => { - logger.logSuccess('Your password has been set!', null, true); - $location.url('/_system/account'); - }) - .finally(() => { - $scope.vm.isSaving = false; - }); - } - - function cancel() { - $location.url('/_system/account'); - } - - function isSaveDisabled(): boolean { - return $scope.vm.isSaving; - } - } - } - - angular.module('main').controller(controllerId, AddPasswordController); -} \ No newline at end of file diff --git a/ngClient/_system/ts/app/controllers/account/ChangeEmailController.ts b/ngClient/_system/ts/app/controllers/account/ChangeEmailController.ts deleted file mode 100644 index e1da20086..000000000 --- a/ngClient/_system/ts/app/controllers/account/ChangeEmailController.ts +++ /dev/null @@ -1,72 +0,0 @@ -module Main.Controller { - 'use strict'; - - var controllerId = 'ChangeEmailController'; - - class ChangeEmailViewModel { - bindingModel: any = { - Email: String - }; - cancel: Function; - changeEmail: Function; - isSaving: boolean; - isSaveDisabled: Function; - } - - interface IChangeEmailController { - vm: ChangeEmailViewModel - } - - export class ChangeEmailController { - - static $inject = ['dataContext', 'logger', '$location', '$scope']; - - constructor(dataContext, logger, $location, $scope) { - - // Logger - logger = logger.forSource(controllerId); - - $scope.vm = new ChangeEmailViewModel(); - $scope.vm.bindingModel = { - Email: '' - }; - $scope.vm.cancel = cancel; - $scope.vm.changeEmail = changeEmail; - $scope.vm.isSaving = false; - $scope.vm.isSaveDisabled = isSaveDisabled; - - _init(); - - function _init() { - - // Generate test data if localhost - if ($location.host() === 'localhost') { - $scope.vm.bindingModel.Email = dataContext.getUniqueEmail(); - } - } - - function cancel() { - $location.url('/_system/account'); - } - - function changeEmail() { - - $scope.vm.isSaving = true; - - dataContext.changeEmail($scope.vm.bindingModel) - .success(() => { - $location.url('/_system/account/confirmEmail'); - }) - .finally(() => { - $scope.vm.isSaving = false; - }); - } - - function isSaveDisabled() { - return $scope.vm.isSaving; - } - } - } - - angular.module('main').controller(controllerId, ChangeEmailController); -} \ No newline at end of file diff --git a/ngClient/_system/ts/app/controllers/account/ChangePasswordController.ts b/ngClient/_system/ts/app/controllers/account/ChangePasswordController.ts deleted file mode 100644 index f00491b83..000000000 --- a/ngClient/_system/ts/app/controllers/account/ChangePasswordController.ts +++ /dev/null @@ -1,45 +0,0 @@ -module Main.Controller { - 'use strict'; - - var controllerId = 'ChangePasswordController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', '$location', ChangePasswordController]); - - function ChangePasswordController(dataContext: any, logger: any, $location: any); - function ChangePasswordController(dataContext, logger, $location) { - logger = logger.forSource(controllerId); - - var vm = this; - vm.bindingModel = { - CurrentPassword: '', - NewPassword: '', - ConfirmPassword: '' - }; - vm.cancel = cancel; - vm.changePassword = changePassword; - vm.isSaving = false; - vm.isSaveDisabled = isSaveDisabled; - - function cancel() { - $location.url('/_system/account'); - } - - function changePassword() { - - vm.isSaving = true; - - dataContext.changePassword(vm.bindingModel) - .success(() => { - logger.logSuccess('Your password has been changed!', null, true); - $location.url('/_system/account'); - }) - .finally(() => { - vm.isSaving = false; - }); - } - - function isSaveDisabled() { - return vm.isSaving; - } - } -} \ No newline at end of file diff --git a/ngClient/_system/ts/app/controllers/account/ChangeUserNameController.ts b/ngClient/_system/ts/app/controllers/account/ChangeUserNameController.ts deleted file mode 100644 index 80e99f75d..000000000 --- a/ngClient/_system/ts/app/controllers/account/ChangeUserNameController.ts +++ /dev/null @@ -1,67 +0,0 @@ -module Main.Controller { - 'use strict'; - - var controllerId = 'ChangeUserNameController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', '$location', ChangeUserNameController]); - - function ChangeUserNameController(dataContext: any, logger: any, $location: any); - function ChangeUserNameController(dataContext, logger, $location) { - - // Logger - logger = logger.forSource(controllerId); - - var vm = this; - vm.bindingModel = { - UserName: '' - }; - vm.cancel = cancel; - vm.changeUserName = changeUserName; - vm.currentUser = { UserName: '' }; - vm.externalLoginInit = $location.search().init; // For external login's - vm.isSaving = false; - vm.isSaveDisabled = isSaveDisabled; - - _init(); - - function _init() { - - vm.currentUser = dataContext.getCurrentUser(); - vm.bindingModel.UserName = vm.currentUser.UserName; - - // Generate test data if localhost - if ($location.host() === 'localhost') { - vm.bindingModel.UserName = dataContext.getUniqueUserName(); - } - } - - function cancel() { - $location.url(getReturnUrl()); - } - - function changeUserName() { - - vm.isSaving = true; - - dataContext.changeUserName(vm.bindingModel) - .success(() => { - logger.logSuccess('Your username has been changed!', null, true); - $location.url(getReturnUrl()); - }) - .finally(() => { - vm.isSaving = false; - }); - } - - function getReturnUrl() { - var clientReturnUrl = $location.search().clientReturnUrl; - return typeof clientReturnUrl !== 'undefined' ? - clientReturnUrl : - '/_system/account'; - } - - function isSaveDisabled() { - return vm.bindingModel.UserName === vm.currentUser.UserName || vm.isSaving; - } - } -} \ No newline at end of file diff --git a/ngClient/_system/ts/app/controllers/account/ConfirmEmailController.ts b/ngClient/_system/ts/app/controllers/account/ConfirmEmailController.ts deleted file mode 100644 index c1b1b5050..000000000 --- a/ngClient/_system/ts/app/controllers/account/ConfirmEmailController.ts +++ /dev/null @@ -1,57 +0,0 @@ -module Main.Controller { - 'use strict'; - - var controllerId = 'ConfirmEmailController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', '$location', '$rootScope', ConfirmEmailController]); - - function ConfirmEmailController(dataContext: any, logger: any, $location: any, $rootScope: any); - function ConfirmEmailController(dataContext, logger, $location, $rootScope) { - - // Logger - logger = logger.forSource(controllerId); - - var vm = this; - vm.currentUser = { EmailConfirmed: false, isAuthenticated() { return false; } }; - vm.isResendDisabled = false; - vm.resendConfirmationEmail = resendConfirmationEmail; - - _init(); - - /*** Implementations ***/ - - function _init() { - - vm.currentUser = dataContext.getCurrentUser(); - - if (!vm.currentUser.isAuthenticated()) { - return; - } - - // If there is no token, no need to continue - var token = $location.search().token; - if (typeof token === 'undefined') { - return; - } - - dataContext.confirmEmail({ Token: token }) - .then(() => { - logger.logSuccess('Your email address has been confirmed!', null, true); - $location.url('/_system/account'); - }); - } - - function resendConfirmationEmail() { - - vm.isResendDisabled = true; - - dataContext.resendConfirmationEmail() - .then(() => { - logger.logSuccess('Confirmation email has been resent to your email address!', null, true); - }) - .finally(() => { - vm.isResendDisabled = false; - }); - } - } -} \ No newline at end of file diff --git a/ngClient/_system/ts/app/controllers/account/LoginController.ts b/ngClient/_system/ts/app/controllers/account/LoginController.ts deleted file mode 100644 index 86639ce16..000000000 --- a/ngClient/_system/ts/app/controllers/account/LoginController.ts +++ /dev/null @@ -1,95 +0,0 @@ -module Main.Controller { - 'use strict'; - - var controllerId = 'LoginController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'locationHistory', 'logger', 'serviceAppUrl', '$location', '$rootScope', '$scope', LoginController]); - - function LoginController(dataContext: any, - locationHistory: any, - logger: any, - serviceAppUrl: any, - $location: any, - $rootScope: any, - $scope: any); - function LoginController(dataContext, locationHistory, logger, serviceAppUrl, $location, $rootScope, $scope) { - logger = logger.forSource(controllerId); - - var vm = this; - vm.isSaving = false; - vm.isSaveDisabled = isSaveDisabled; - vm.login = login; - vm.password = ''; - vm.rememberMe = true; - vm.showHeader = typeof $scope.showHeader !== 'undefined' ? $scope.showHeader : true; - vm.userName = ''; - - _init(); - - function _init() { - - // Error - var error = $location.search().error; - if (typeof error !== 'undefined') { - logger.logError(error, null, true); - return; - } - - login(); - } - - function getReturnUrl() { - // If login pages called after a result from server, it will have "clientReturnUrl" param, which will have a higher priority than locationHistory - var clientReturnUrl = $location.search().clientReturnUrl; - return typeof clientReturnUrl !== 'undefined' ? clientReturnUrl : locationHistory.previousItem().url(); - } - - function isSaveDisabled() { - return vm.isSaving; - } - - function login() { - - // External (single use token) login - var singleUseToken = $location.search().token; - var init = $location.search().init; - if (typeof singleUseToken !== 'undefined') { - vm.isSaving = true; - dataContext.login('', '', vm.rememberMe, singleUseToken).then(successExternal).catch(failedExternal).finally(() => { - vm.isSaving = false; - }); - } else { // Internal login - if (vm.userName !== '' && vm.password !== '') { - vm.isSaving = true; - dataContext.login(vm.userName, vm.password, vm.rememberMe).then(successInternal).finally(() => { - vm.isSaving = false; - }); - } - } - - function failedExternal() { - logger.logError('Invalid token', null, true); - } - - function successExternal() { - logger.logSuccess('You have been logged in!', null, true); - - // First time - if (typeof init !== 'undefined' && init) { - var url = '/_system/account/changeUserName?init=true&clientReturnUrl=' + getReturnUrl(); - $location.url(url); - } else { - $location.url(getReturnUrl()); - } - } - - function successInternal() { - logger.logSuccess('You have been logged in!', null, true); - - if ($location.path() === '/_system/account/login') { - $location.url(getReturnUrl()); - } - } - } - } -} \ No newline at end of file diff --git a/ngClient/_system/ts/app/controllers/account/ProfileController.ts b/ngClient/_system/ts/app/controllers/account/ProfileController.ts deleted file mode 100644 index 538fb9e9c..000000000 --- a/ngClient/_system/ts/app/controllers/account/ProfileController.ts +++ /dev/null @@ -1,53 +0,0 @@ -module Main.Controller { - 'use strict'; - - var controllerId = 'ProfileController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', '$location', '$routeParams', '$scope', ProfileController]); - - function ProfileController(dataContext: any, logger: any, $location: any, $routeParams: any, $scope: any); - function ProfileController(dataContext, logger, $location, $routeParams, $scope) { - - // Logger - logger = logger.forSource(controllerId); - - var userName = $routeParams.userName; - var vm = this; - vm.currentUser = { Id: 0 }; - vm.user = { Id: 0, UserName: '', Email: '' }; - - // Events - $scope.$on('dataContext_currentUserChanged', currentUserChanged); - - _init(); - - function _init() { - - vm.currentUser = dataContext.getCurrentUser(); - - // If userName equals to current user - if (userName === vm.currentUser.UserName) { - vm.user = vm.currentUser; - } else { - - // If not, then check it against remote - dataContext.getUser(userName) - .then(user => { - - // Not found, navigate to 404 - if (user === null) { - $location.url('/_system/content/notFound?url=' + $location.url()); - return; - } - - vm.user = user; - }); - } - } - - function currentUserChanged(event: any, newUser: any); - function currentUserChanged(event, newUser) { - vm.currentUser = newUser; - } - } -} \ No newline at end of file diff --git a/ngClient/_system/ts/app/controllers/account/RegisterController.ts b/ngClient/_system/ts/app/controllers/account/RegisterController.ts deleted file mode 100644 index 89c953c53..000000000 --- a/ngClient/_system/ts/app/controllers/account/RegisterController.ts +++ /dev/null @@ -1,59 +0,0 @@ -module Main.Controller { - 'use strict'; - - var controllerId = 'RegisterController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'locationHistory', 'logger', 'serviceAppUrl', '$location', '$rootScope', '$scope', RegisterController]); - - function RegisterController(dataContext: any, - locationHistory: any, - logger: any, - serviceAppUrl: any, - $location: any, - $rootScope: any, - $scope: any); - function RegisterController(dataContext, locationHistory, logger, serviceAppUrl, $location, $rootScope, $scope) { - - // Logger - logger = logger.forSource(controllerId); - - var vm = this; - vm.bindingModel = { - UserName: '', - Email: '', - Password: '', - ConfirmPassword: '' - }; - vm.isSaving = false; - vm.isSaveDisabled = isSaveDisabled; - vm.register = register; - vm.rememberMe = true; - vm.showHeader = typeof $scope.showHeader !== 'undefined' ? $scope.showHeader : true; - - function isSaveDisabled() { - return vm.isSaving; - } - - function register() { - - vm.isSaving = true; - - dataContext.register(vm.bindingModel, vm.rememberMe) - .then(() => { - logger.logSuccess('You have been registered!', null, true); - $location.url('/_system/account/confirmEmail'); - }) - .catch(failed) - .finally(() => { - vm.isSaving = false; - }); - - function failed(response: any); - function failed(response) { - if (typeof response.error_description !== 'undefined') { - logger.logError(response.error_description, null, true); - } - } - } - } -} \ No newline at end of file diff --git a/ngClient/_system/ts/app/controllers/account/ResetPasswordController.ts b/ngClient/_system/ts/app/controllers/account/ResetPasswordController.ts deleted file mode 100644 index fc856bd20..000000000 --- a/ngClient/_system/ts/app/controllers/account/ResetPasswordController.ts +++ /dev/null @@ -1,63 +0,0 @@ -module Main.Controller { - 'use strict'; - - var controllerId = 'ResetPasswordController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', '$location', ResetPasswordController]); - - function ResetPasswordController(dataContext: any, logger: any, $location: any); - function ResetPasswordController(dataContext, logger, $location) { - logger = logger.forSource(controllerId); - - var vm = this; - vm.bindingModel = { - Email: $location.search().email, - Token: $location.search().token, - NewPassword: '', - ConfirmPassword: '' - }; - vm.isSaving = false; - vm.isSaveDisabled = isSaveDisabled; - vm.requestBindingModel = { - Email: '' - }; - vm.resetPassword = resetPassword; - vm.resetPasswordRequest = resetPasswordRequest; - vm.viewMode = typeof $location.search().email === 'undefined' || typeof $location.search().token === 'undefined' ? - 'initial' : - 'received'; // initial | sent | received - - /*** Implementations ***/ - - function isSaveDisabled() { - return vm.isSaving; - } - - function resetPassword() { - - vm.isSaving = true; - - dataContext.resetPassword(vm.bindingModel) - .success(() => { - logger.logSuccess('Your password has been reset!', null, true); - $location.url('/_system/account/login'); - }) - .finally(() => { - vm.isSaving = false; - }); - } - - function resetPasswordRequest() { - - vm.isSaving = true; - - dataContext.resetPasswordRequest(vm.requestBindingModel) - .success(() => { - vm.viewMode = 'sent'; - }) - .finally(() => { - vm.isSaving = false; - }); - } - } -} \ No newline at end of file diff --git a/ngClient/_system/ts/app/controllers/account/SocialLoginsController.ts b/ngClient/_system/ts/app/controllers/account/SocialLoginsController.ts deleted file mode 100644 index 8a1001134..000000000 --- a/ngClient/_system/ts/app/controllers/account/SocialLoginsController.ts +++ /dev/null @@ -1,28 +0,0 @@ -module Main.Controller { - 'use strict'; - - var controllerId = 'SocialLoginsController'; - angular.module('main') - .controller(controllerId, ['locationHistory', 'logger', 'serviceAppUrl', '$location', SocialLoginsController]); - - function SocialLoginsController(locationHistory: any, logger: any, serviceAppUrl: any, $location: any); - function SocialLoginsController(locationHistory, logger, serviceAppUrl, $location) { - - // Logger - logger = logger.forSource(controllerId); - - var vm = this; - vm.getExternalLoginUrl = getExternalLoginUrl; - - function getExternalLoginUrl(provider: any); - function getExternalLoginUrl(provider) { - return serviceAppUrl + '/api/Account/ExternalLogin?provider=' + provider + '&clientReturnUrl=' + getReturnUrl(); - } - - function getReturnUrl() { - // If login pages called after a result from server, it will have "clientReturnUrl" param, which will have a higher priority than locationHistory - var clientReturnUrl = $location.search().clientReturnUrl; - return typeof clientReturnUrl !== 'undefined' ? clientReturnUrl : locationHistory.previousItem().url(); - } - } -} \ No newline at end of file diff --git a/ngClient/_system/ts/app/controllers/content/AllInOneController.ts b/ngClient/_system/ts/app/controllers/content/AllInOneController.ts deleted file mode 100644 index f4d1e29a6..000000000 --- a/ngClient/_system/ts/app/controllers/content/AllInOneController.ts +++ /dev/null @@ -1,62 +0,0 @@ -module Main.Controller { - 'use strict'; - - var controllerId = 'AllInOneController'; - angular.module('main') - .controller(controllerId, ['logger', 'resourcePoolFactory', '$scope', AllInOneController]); - - function AllInOneController(logger: any, resourcePoolFactory: any, $scope: any); - function AllInOneController(logger, resourcePoolFactory, $scope) { - - logger = logger.forSource(controllerId); - - var vm = this; - vm.allInOneConfig = { userName: 'sample', resourcePoolKey: 'All-in-One' }; - - // Event listeners - $scope.$on('resourcePoolEditor_elementCellNumericValueIncreased', processNewInteraction); - $scope.$on('resourcePoolEditor_elementCellNumericValueDecreased', processNewInteraction); - $scope.$on('resourcePoolEditor_elementCellNumericValueReset', processNewInteraction); - - _init(); - - function _init() { - processExistingInteraction(); - } - - // Processes whether the current user had already interacted with this example - function processExistingInteraction() { - // Priority & Knowledge Index examples copy their ratings to this one - // However if the user starts directly playing .. - resourcePoolFactory.getResourcePoolExpanded(vm.allInOneConfig) - .then(resourcePool => { - // Elements - for (var elementIndex = 0; elementIndex < resourcePool.ElementSet.length; elementIndex++) { - var element = resourcePool.ElementSet[elementIndex]; - // Element fields - for (var elementFieldIndex = 0; elementFieldIndex < element.ElementFieldSet.length; elementFieldIndex++) { - var elementField = element.ElementFieldSet[elementFieldIndex]; - // Element cells - for (var elementCellIndex = 0; elementCellIndex < elementField.ElementCellSet.length; elementCellIndex++) { - var elementCell = elementField.ElementCellSet[elementCellIndex]; - - if (elementCell.currentUserCell()) { - resourcePool.userInteracted = true; - return; - } - } - } - } - }); - } - - // Processes whether the user is currently interacting with this example - function processNewInteraction(event: any, cell: any); - function processNewInteraction(event, cell) { - if (cell.ElementField.Element.ResourcePool.User.UserName === vm.allInOneConfig.userName && cell.ElementField.Element.ResourcePool.Key === vm.allInOneConfig.resourcePoolKey) { - cell.ElementField.Element.ResourcePool.userInteracted = true; - return; - } - } - } -} \ No newline at end of file diff --git a/ngClient/_system/ts/app/controllers/content/BasicsController.ts b/ngClient/_system/ts/app/controllers/content/BasicsController.ts deleted file mode 100644 index 5df12d0bd..000000000 --- a/ngClient/_system/ts/app/controllers/content/BasicsController.ts +++ /dev/null @@ -1,61 +0,0 @@ -module Main.Controller { - 'use strict'; - - var controllerId = 'BasicsController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', 'resourcePoolFactory', '$scope', BasicsController]); - - function BasicsController(dataContext: any, logger: any, resourcePoolFactory: any, $scope: any); - function BasicsController(dataContext, logger, resourcePoolFactory, $scope) { - - // Logger - logger = logger.forSource(controllerId); - - var vm = this; - vm.existingModelConfig = { userName: 'sample', resourcePoolKey: 'Basics-Existing-Model' }; - vm.newModelConfig = { userName: 'sample', resourcePoolKey: 'Basics-New-Model' }; - - // Listen resource pool updated event - $scope.$on('resourcePoolEditor_elementMultiplierIncreased', updateOppositeResourcePool); - $scope.$on('resourcePoolEditor_elementMultiplierDecreased', updateOppositeResourcePool); - $scope.$on('resourcePoolEditor_elementMultiplierReset', updateOppositeResourcePool); - - /*** Implementations ***/ - - function updateOppositeResourcePool(event: any, element: any); - function updateOppositeResourcePool(event, element) { - - var oppositeKey = null; - - if (element.ResourcePool.User.UserName === vm.existingModelConfig.userName && element.ResourcePool.Key === vm.existingModelConfig.resourcePoolKey) { - oppositeKey = vm.newModelConfig; - } else if (element.ResourcePool.User.UserName === vm.newModelConfig.userName && element.ResourcePool.Key === vm.newModelConfig.resourcePoolKey) { - oppositeKey = vm.existingModelConfig; - } - - // Call the service to increase the multiplier - if (oppositeKey !== null) { - resourcePoolFactory.getResourcePoolExpanded(oppositeKey) - .then(resourcePool => { - - switch (event.name) { - case 'resourcePoolEditor_elementMultiplierIncreased': { - resourcePoolFactory.updateElementMultiplier(resourcePool.mainElement(), 'increase'); - break; - } - case 'resourcePoolEditor_elementMultiplierDecreased': { - resourcePoolFactory.updateElementMultiplier(resourcePool.mainElement(), 'decrease'); - break; - } - case 'resourcePoolEditor_elementMultiplierReset': { - resourcePoolFactory.updateElementMultiplier(resourcePool.mainElement(), 'reset'); - break; - } - } - - dataContext.saveChanges(1500); - }); - } - } - } -} \ No newline at end of file diff --git a/ngClient/_system/ts/app/controllers/content/ContributorsController.ts b/ngClient/_system/ts/app/controllers/content/ContributorsController.ts deleted file mode 100644 index ebe56cf02..000000000 --- a/ngClient/_system/ts/app/controllers/content/ContributorsController.ts +++ /dev/null @@ -1,22 +0,0 @@ -module Main.Controller { - 'use strict'; - - var controllerId = 'ContributorsController'; - angular.module('main') - .controller(controllerId, ['logger', ContributorsController]); - - function ContributorsController(logger: any); - function ContributorsController(logger) { - - // Logger - logger = logger.forSource(controllerId); - - var vm = this; - vm.getDate = getDate; - - function getDate(day: any, month: any, year: any); - function getDate(day, month, year) { - return new Date(year, month - 1, day); - } - } -} \ No newline at end of file diff --git a/ngClient/_system/ts/app/controllers/content/DefaultController.ts b/ngClient/_system/ts/app/controllers/content/DefaultController.ts deleted file mode 100644 index 8d70787c5..000000000 --- a/ngClient/_system/ts/app/controllers/content/DefaultController.ts +++ /dev/null @@ -1,172 +0,0 @@ -module Main.Controller { - 'use strict'; - - var controllerId = 'DefaultController'; - angular.module('main') - .controller(controllerId, ['applicationFactory', 'dataContext', 'disqusShortname', 'logger', '$location', '$rootScope', '$scope', '$uibModal', DefaultController]); - - function DefaultController(applicationFactory: any, - dataContext: any, - disqusShortname: any, - logger: any, - $location: any, - $rootScope: any, - $scope: any, - $uibModal: any); - function DefaultController(applicationFactory, dataContext, disqusShortname, logger, $location, $rootScope, $scope, $uibModal) { - - // Logger - logger = logger.forSource(controllerId); - - // View model - var vm = this; - vm.applicationInfo = null; - vm.currentUser = { Email: '', isAuthenticated() { return false; }, HasPassword: false }; - vm.currentDate = new Date(); - vm.currentUserText = currentUserText; - vm.displayBankTransfer = false; - vm.displayFooterIcons = false; - vm.disqusConfig = { - disqus_shortname: disqusShortname, - disqus_identifier: '', - disqus_url: '' - }; - vm.guestAccountInfoVisible = false; - vm.logout = logout; - vm.openGuestAccountInfo = openGuestAccountInfo; - vm.toggleBankTransfer = toggleBankTransfer; - - // Events - $scope.$on('dataContext_currentUserChanged', currentUserChanged); - $scope.$on('dataContext_currentUserEmailAddressChanged', currentUserEmailAddressChanged); - $scope.$on('guestAccountCreated', guestAccountCreated); - $scope.$on('$locationChangeStart', locationChangeStart); - $scope.$on('$routeChangeSuccess', routeChangeSuccess); - - _init(); - - /*** Implementations ***/ - - function _init() { - getApplicationInfo(); - } - - function currentUserChanged(event: any, newUser: any); - function currentUserChanged(event, newUser) { - vm.currentUser = newUser; - vm.guestAccountInfoVisible = newUser.isAuthenticated() && newUser.IsAnonymous; - } - - function currentUserText() { - var userText = vm.currentUser.UserName; - - if (vm.currentUser.IsAnonymous) { - userText += ' (Guest)'; - } - - return userText; - } - - function currentUserEmailAddressChanged() { - vm.guestAccountInfoVisible = false; - } - - function getApplicationInfo() { - applicationFactory.getApplicationInfo() - .then(applicationInfo => { - vm.applicationInfo = applicationInfo; - vm.applicationInfo.CurrentVersionText = vm.applicationInfo.CurrentVersion + ' - Alpha ~ Beta'; - }); - } - - function guestAccountCreated() { - vm.guestAccountInfoVisible = true; - } - - function logout() { - dataContext.logout() - .then(() => { - $location.url('/'); - }); - } - - function locationChangeStart(event: any, newUrl: any, oldUrl: any); - function locationChangeStart(event, newUrl, oldUrl) { - - if (dataContext.hasChanges()) { - - var modalInstance = $uibModal.open({ - controller: ['$scope', '$uibModalInstance', function ($scope, $uibModalInstance) { - - var vm = this; - vm.cancel = cancel; - vm.leave = leave; - - function cancel() { - $uibModalInstance.dismiss('cancel'); - } - - function leave() { - $uibModalInstance.close(); - } - }], - controllerAs: 'vm', - templateUrl: '/_system/views/account/confirmNavigateAway.html?v=0.53.0' - }); - - modalInstance.result.then(() => { - - // User choose to cancel the changes & navigate away - dataContext.rejectChanges(); - $location.path(newUrl.substring($location.absUrl().length - $location.url().length)); - - }, () => { }); - - // Always cancel route changes - event.preventDefault(); - return; - } - } - - function openGuestAccountInfo() { - - var modalInstance = $uibModal.open({ - controller: ['$scope', '$uibModalInstance', function ($scope, $uibModalInstance) { - - var vm = this; - vm.close = closeModal; - - $scope.$on('dataContext_currentUserChanged', closeModal); - - function closeModal() { - $uibModalInstance.close(); - } - }], - controllerAs: 'vm', - templateUrl: '/_system/views/account/guestAccountInfo.html?v=0.58.0' - }); - - modalInstance.result.then(() => { }, - () => { }); - } - - function routeChangeSuccess(event: any, current: any, previous: any); - function routeChangeSuccess(event, current, previous) { - - // Footer icons - vm.displayFooterIcons = $location.path() === '/'; - - // Load related disqus - if (typeof current.enableDisqus !== 'undefined' && current.enableDisqus && vm.disqusConfig.disqus_shortname !== '') { - vm.disqusConfig.disqus_identifier = vm.disqusConfig.disqus_shortname + $location.path().replace(/\//g, '_'); - vm.disqusConfig.disqus_url = $location.absUrl().substring(0, $location.absUrl().length - $location.url().length + $location.path().length); - } else { - vm.disqusConfig.disqus_identifier = ''; - } - } - - function toggleBankTransfer() { - vm.displayBankTransfer = !vm.displayBankTransfer; - } - } -} \ No newline at end of file diff --git a/ngClient/_system/ts/app/controllers/content/IntroductionController.ts b/ngClient/_system/ts/app/controllers/content/IntroductionController.ts deleted file mode 100644 index f1dc61f0b..000000000 --- a/ngClient/_system/ts/app/controllers/content/IntroductionController.ts +++ /dev/null @@ -1,55 +0,0 @@ -module Main.Controller { - 'use strict'; - - var controllerId = 'IntroductionController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', 'resourcePoolFactory', '$scope', '$timeout', IntroductionController]); - - function IntroductionController(dataContext: any, - logger: any, - resourcePoolFactory: any, - $scope: any, - $timeout: - any); - function IntroductionController(dataContext, logger, resourcePoolFactory, $scope, $timeout) { - - // Logger - logger = logger.forSource(controllerId); - - var vm = this; - vm.upoConfig = { userName: 'sample', resourcePoolKey: 'Unidentified-Profiting-Object' }; - - // TODO Disabled for the moment, since it automatically triggers 'anonymous user interacted' / coni2k - 07 Jun. '16 - //_init(); - - /*** Implementations ***/ - - function _init() { - - resourcePoolFactory.getResourcePoolExpanded(vm.upoConfig) - .then(resourcePool => { - - var increaseMultiplierTimeout = $timeout(increaseMultiplier, 500); - - function increaseMultiplier() { - - // Increase the multiplier - resourcePool.ElementSet.forEach(element => { - resourcePoolFactory.updateElementMultiplier(element, 'increase'); - }); - - // Then increase recursively - increaseMultiplierTimeout = $timeout(increaseMultiplier, 2500); - } - - // When the DOM element is removed from the page, - // AngularJS will trigger the $destroy event on - // the scope. This gives us a chance to cancel any - // pending timer that we may have. - $scope.$on("$destroy", event => { - $timeout.cancel(increaseMultiplierTimeout); - }); - }); - } - } -} \ No newline at end of file diff --git a/ngClient/_system/ts/app/controllers/content/KnowledgeIndexController.ts b/ngClient/_system/ts/app/controllers/content/KnowledgeIndexController.ts deleted file mode 100644 index bdaecc143..000000000 --- a/ngClient/_system/ts/app/controllers/content/KnowledgeIndexController.ts +++ /dev/null @@ -1,166 +0,0 @@ -module Main.Controller { - 'use strict'; - - var controllerId = 'KnowledgeIndexController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', 'resourcePoolFactory', '$scope', '$timeout', KnowledgeIndexController]); - - function KnowledgeIndexController(dataContext: any, - logger: any, - resourcePoolFactory: any, - $scope: any, - $timeout: any); - function KnowledgeIndexController(dataContext, logger, resourcePoolFactory, $scope, $timeout) { - - logger = logger.forSource(controllerId); - - var vm = this; - vm.oldModelChartConfig = { - title: { - text: '' - }, - options: { - chart: { - type: 'column', - height: 358 - }, - plotOptions: { - column: { - allowPointSelect: true, - pointWidth: 15 - } - }, - xAxis: { categories: ['Knowledge'] }, - yAxis: { - title: { - text: 'Development process' - }, - allowDecimals: false, - min: 0 - } - }, - size: {}, - series: [ - { name: "My Precious Jewelry", data: [0] }, - { name: 'Death Star Architecture', data: [0] }, - { name: "Christina's Secret", data: [0] }, - { name: 'Nuka Cola Company', data: [0] } - ] - }; - vm.newModelChartConfig = { - title: { - text: '' - }, - options: { - chart: { - type: 'column', - height: 300 - }, - plotOptions: { - column: { - allowPointSelect: true, - pointWidth: 15 - } - }, - xAxis: { categories: ['Knowledge'] }, - yAxis: { - title: { - text: 'Development process' - }, - allowDecimals: false, - min: 0 - } - }, - size: {}, - series: [ - { name: 'Global Knowledge Database', data: [0] } - ] - }; - vm.knowledgeIndexConfig = { userName: 'sample', resourcePoolKey: 'Knowledge-Index-Sample' }; - vm.popularSoftwareLicensesConfig = { userName: 'sample', resourcePoolKey: 'Knowledge-Index-Popular-Software-Licenses' }; - - // Event listeners - $scope.$on('resourcePoolEditor_elementCellNumericValueIncreased', updateAllInOne); - $scope.$on('resourcePoolEditor_elementCellNumericValueDecreased', updateAllInOne); - $scope.$on('resourcePoolEditor_elementCellNumericValueReset', updateAllInOne); - - _init(); - - function _init() { - var timeout = $timeout(refreshPage, 10000); - - function refreshPage() { - var organizationIndex = Math.floor(Math.random() * 4); - vm.oldModelChartConfig.series[organizationIndex].data[0] += 1; - vm.newModelChartConfig.series[0].data[0] += 1; - - timeout = $timeout(refreshPage, 1000); - } - - // When the DOM element is removed from the page, - // AngularJS will trigger the $destroy event on - // the scope. This gives us a chance to cancel any - // pending timer that we may have. - $scope.$on("$destroy", event => { - $timeout.cancel(timeout); - }); - } - - // Sync this example's values with 'All in One' - function updateAllInOne(event: any, cell: any); - function updateAllInOne(event, cell) { - - if (cell.ElementField.Element.ResourcePool.User.UserName !== vm.knowledgeIndexConfig.userName && - cell.ElementField.Element.ResourcePool.Key !== vm.knowledgeIndexConfig.resourcePoolKey) { - return; - } - - var allInOneUniqueKey = { userName: 'sample', resourcePoolKey: 'All-in-One' }; - resourcePoolFactory.getResourcePoolExpanded(allInOneUniqueKey) - .then(resourcePool => { - - // If the current user already interacted with 'All in One', stop copying ratings - if (typeof resourcePool.userInteracted !== 'undefined' && resourcePool.userInteracted) { - return; - } - - // Elements - for (var elementIndex = 0; elementIndex < resourcePool.ElementSet.length; elementIndex++) { - var element = resourcePool.ElementSet[elementIndex]; - if (element.Name === cell.ElementField.Element.Name) { - // Element fields - for (var elementFieldIndex = 0; elementFieldIndex < element.ElementFieldSet.length; elementFieldIndex++) { - var elementField = element.ElementFieldSet[elementFieldIndex]; - if (elementField.Name === cell.ElementField.Name) { - // Element cells - for (var elementCellIndex = 0; elementCellIndex < elementField.ElementCellSet.length; elementCellIndex++) { - var elementCell = elementField.ElementCellSet[elementCellIndex]; - if (elementCell.ElementItem.Name === cell.ElementItem.Name) { - switch (event.name) { - case 'resourcePoolEditor_elementCellNumericValueIncreased': { - resourcePoolFactory.updateElementCellDecimalValue(elementCell, 'increase'); - break; - } - case 'resourcePoolEditor_elementCellNumericValueDecreased': { - resourcePoolFactory.updateElementCellDecimalValue(elementCell, 'decrease'); - break; - } - case 'resourcePoolEditor_elementCellNumericValueReset': { - resourcePoolFactory.updateElementCellDecimalValue(elementCell, 'reset'); - break; - } - } - - // Save changes - dataContext.saveChanges(1500); - break; - } - } - } - } - } - } - }); - } - } -} \ No newline at end of file diff --git a/ngClient/_system/ts/app/controllers/content/NotFoundController.ts b/ngClient/_system/ts/app/controllers/content/NotFoundController.ts deleted file mode 100644 index 3dff0279e..000000000 --- a/ngClient/_system/ts/app/controllers/content/NotFoundController.ts +++ /dev/null @@ -1,25 +0,0 @@ -module Main.Controller { - 'use strict'; - - var controllerId = 'NotFoundController'; - angular.module('main') - .controller(controllerId, ['logger', '$location', NotFoundController]); - - function NotFoundController(logger: any, $location: any); - function NotFoundController(logger, $location) { - - // Logger - logger = logger.forSource(controllerId); - - _init(); - - /*** Implementations ***/ - - function _init() { - var url = $location.search().url; - if (typeof url !== 'undefined') { - throw new Error('Not found: ' + url); - } - } - } -} \ No newline at end of file diff --git a/ngClient/_system/ts/app/controllers/content/PriorityIndexController.ts b/ngClient/_system/ts/app/controllers/content/PriorityIndexController.ts deleted file mode 100644 index 5cfecd81f..000000000 --- a/ngClient/_system/ts/app/controllers/content/PriorityIndexController.ts +++ /dev/null @@ -1,78 +0,0 @@ -module Main.Controller { - 'use strict'; - - var controllerId = 'PriorityIndexController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', 'resourcePoolFactory', '$scope', PriorityIndexController]); - - function PriorityIndexController(dataContext: any, logger: any, resourcePoolFactory: any, $scope: any); - function PriorityIndexController(dataContext, logger, resourcePoolFactory, $scope) { - - logger = logger.forSource(controllerId); - - var vm = this; - vm.priorityIndexConfig = { userName: 'sample', resourcePoolKey: 'Priority-Index-Sample' }; - - // Event listeners - $scope.$on('resourcePoolEditor_elementCellNumericValueIncreased', updateAllInOne); - $scope.$on('resourcePoolEditor_elementCellNumericValueDecreased', updateAllInOne); - $scope.$on('resourcePoolEditor_elementCellNumericValueReset', updateAllInOne); - - // Sync this example's values with 'All in One' - function updateAllInOne(event: any, cell: any); - function updateAllInOne(event, cell) { - - if (cell.ElementField.Element.ResourcePool.User.UserName !== vm.priorityIndexConfig.userName && - cell.ElementField.Element.ResourcePool.Key !== vm.priorityIndexConfig.resourcePoolKey) { - return; - } - - var allInOneUniqueKey = { userName: 'sample', resourcePoolKey: 'All-in-One' }; - resourcePoolFactory.getResourcePoolExpanded(allInOneUniqueKey) - .then(resourcePool => { - - // If the current user already interacted with 'All in One', stop copying ratings - if (typeof resourcePool.userInteracted !== 'undefined' && resourcePool.userInteracted) { - return; - } - - // Elements - for (var elementIndex = 0; elementIndex < resourcePool.ElementSet.length; elementIndex++) { - var element = resourcePool.ElementSet[elementIndex]; - if (element.Name === cell.ElementField.Element.Name) { - // Element fields - for (var elementFieldIndex = 0; elementFieldIndex < element.ElementFieldSet.length; elementFieldIndex++) { - var elementField = element.ElementFieldSet[elementFieldIndex]; - if (elementField.Name === cell.ElementField.Name) { - // Element cells - for (var elementCellIndex = 0; elementCellIndex < elementField.ElementCellSet.length; elementCellIndex++) { - var elementCell = elementField.ElementCellSet[elementCellIndex]; - if (elementCell.ElementItem.Name === cell.ElementItem.Name) { - switch (event.name) { - case 'resourcePoolEditor_elementCellNumericValueIncreased': { - resourcePoolFactory.updateElementCellDecimalValue(elementCell, 'increase'); - break; - } - case 'resourcePoolEditor_elementCellNumericValueDecreased': { - resourcePoolFactory.updateElementCellDecimalValue(elementCell, 'decrease'); - break; - } - case 'resourcePoolEditor_elementCellNumericValueReset': { - resourcePoolFactory.updateElementCellDecimalValue(elementCell, 'reset'); - break; - } - } - - // Save changes - dataContext.saveChanges(1500); - break; - } - } - } - } - } - } - }); - } - } -} \ No newline at end of file diff --git a/ngClient/_system/ts/app/controllers/content/TotalCostIndexController.ts b/ngClient/_system/ts/app/controllers/content/TotalCostIndexController.ts deleted file mode 100644 index 41111dc7f..000000000 --- a/ngClient/_system/ts/app/controllers/content/TotalCostIndexController.ts +++ /dev/null @@ -1,58 +0,0 @@ -module Main.Controller { - 'use strict'; - - var controllerId = 'TotalCostIndexController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', 'resourcePoolFactory', '$scope', TotalCostIndexController]); - - function TotalCostIndexController(dataContext: any, logger: any, resourcePoolFactory: any, $scope: any); - function TotalCostIndexController(dataContext, logger, resourcePoolFactory, $scope) { - - logger = logger.forSource(controllerId); - - var vm = this; - vm.existingModelConfig = { userName: 'sample', resourcePoolKey: 'Total-Cost-Index-Existing-Model' }; - vm.newModelConfig = { userName: 'sample', resourcePoolKey: 'Total-Cost-Index-New-Model' }; - - // Listen resource pool updated event - $scope.$on('resourcePoolEditor_elementMultiplierIncreased', updateOppositeResourcePool); - $scope.$on('resourcePoolEditor_elementMultiplierDecreased', updateOppositeResourcePool); - $scope.$on('resourcePoolEditor_elementMultiplierReset', updateOppositeResourcePool); - - function updateOppositeResourcePool(event: any, element: any); - function updateOppositeResourcePool(event, element) { - - var oppositeKey = null; - - if (element.ResourcePool.User.UserName === vm.existingModelConfig.userName && element.ResourcePool.Key === vm.existingModelConfig.resourcePoolKey) { - oppositeKey = vm.newModelConfig; - } else if (element.ResourcePool.User.UserName === vm.newModelConfig.userName && element.ResourcePool.Key === vm.newModelConfig.resourcePoolKey) { - oppositeKey = vm.existingModelConfig; - } - - // Call the service to increase the multiplier - if (oppositeKey !== null) { - resourcePoolFactory.getResourcePoolExpanded(oppositeKey) - .then(resourcePool => { - - switch (event.name) { - case 'resourcePoolEditor_elementMultiplierIncreased': { - resourcePoolFactory.updateElementMultiplier(resourcePool.mainElement(), 'increase'); - break; - } - case 'resourcePoolEditor_elementMultiplierDecreased': { - resourcePoolFactory.updateElementMultiplier(resourcePool.mainElement(), 'decrease'); - break; - } - case 'resourcePoolEditor_elementMultiplierReset': { - resourcePoolFactory.updateElementMultiplier(resourcePool.mainElement(), 'reset'); - break; - } - } - - dataContext.saveChanges(1500); - }); - } - } - } -} \ No newline at end of file diff --git a/ngClient/_system/ts/app/controllers/content/obsolete/ClosingNotesController.ts b/ngClient/_system/ts/app/controllers/content/obsolete/ClosingNotesController.ts deleted file mode 100644 index 84725e3fb..000000000 --- a/ngClient/_system/ts/app/controllers/content/obsolete/ClosingNotesController.ts +++ /dev/null @@ -1,33 +0,0 @@ -module Main.Controller { - 'use strict'; - - var controllerId = 'ClosingNotesController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', '$location', '$rootScope', '$scope', ClosingNotesController]); - - function ClosingNotesController(dataContext: any, logger: any, $location: any, $rootScope: any, $scope: any); - function ClosingNotesController(dataContext, logger, $location, $rootScope, $scope) { - - // Logger - logger = logger.forSource(controllerId); - - // View model - var vm = this; - vm.currentUser = { isAuthenticated() { return false; } }; - - $scope.$on('dataContext_currentUserChanged', currentUserChanged); - - _init(); - - /*** Implementations ***/ - - function _init() { - vm.currentUser = dataContext.getCurrentUser(); - } - - function currentUserChanged(event: any, newUser: any); - function currentUserChanged(event, newUser) { - vm.currentUser = newUser; - } - } -} \ No newline at end of file diff --git a/ngClient/_system/ts/app/controllers/content/obsolete/FairShareIndexSampleController.ts b/ngClient/_system/ts/app/controllers/content/obsolete/FairShareIndexSampleController.ts deleted file mode 100644 index 243d3649b..000000000 --- a/ngClient/_system/ts/app/controllers/content/obsolete/FairShareIndexSampleController.ts +++ /dev/null @@ -1,15 +0,0 @@ -module Main.Controller { - 'use strict'; - - var controllerId = 'FairShareIndexSampleController'; - angular.module('main') - .controller(controllerId, ['logger', FairShareIndexSampleController]); - - function FairShareIndexSampleController(logger: any); - function FairShareIndexSampleController(logger) { - - logger = logger.forSource(controllerId); - - var vm = this; - } -} \ No newline at end of file diff --git a/ngClient/_system/ts/app/controllers/content/obsolete/ResourcePoolRateSampleController.ts b/ngClient/_system/ts/app/controllers/content/obsolete/ResourcePoolRateSampleController.ts deleted file mode 100644 index 38d3659b0..000000000 --- a/ngClient/_system/ts/app/controllers/content/obsolete/ResourcePoolRateSampleController.ts +++ /dev/null @@ -1,16 +0,0 @@ -module Main.Controller { - 'use strict'; - - var controllerId = 'ResourcePoolRateSampleController'; - angular.module('main') - .controller(controllerId, ['logger', ResourcePoolRateSampleController]); - - function ResourcePoolRateSampleController(logger: any); - function ResourcePoolRateSampleController(logger) { - - logger = logger.forSource(controllerId); - - var vm = this; - vm.resourcePoolRate_SampleResourcePoolId = 12; - } -} \ No newline at end of file diff --git a/ngClient/_system/ts/app/controllers/resourcePool/ResourcePoolManageController.ts b/ngClient/_system/ts/app/controllers/resourcePool/ResourcePoolManageController.ts deleted file mode 100644 index fb6d6eeac..000000000 --- a/ngClient/_system/ts/app/controllers/resourcePool/ResourcePoolManageController.ts +++ /dev/null @@ -1,461 +0,0 @@ -module Main.Controller { - 'use strict'; - - var controllerId = 'ResourcePoolManageController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'Enums', 'logger', 'resourcePoolFactory', '$location', '$rootScope', '$routeParams', '$uibModal', ResourcePoolManageController]); - - function ResourcePoolManageController(dataContext: any, - Enums: any, - logger: any, - resourcePoolFactory: any, - $location: any, - $rootScope: any, - $routeParams: any, - $uibModal: any); - function ResourcePoolManageController(dataContext, Enums, logger, resourcePoolFactory, $location, $rootScope, $routeParams, $uibModal) { - - // Logger - logger = logger.forSource(controllerId); - - var vm = this; - vm.addElement = addElement; - vm.addElementField = addElementField; - vm.addElementItem = addElementItem; - vm.cancelElement = cancelElement; - vm.cancelElementCell = cancelElementCell; - vm.cancelElementField = cancelElementField; - vm.cancelElementItem = cancelElementItem; - vm.cancelResourcePool = cancelResourcePool; - vm.editElement = editElement; - vm.editElementCell = editElementCell; - vm.editElementField = editElementField; - vm.editElementItem = editElementItem; - vm.element = null; - vm.elementMaster = null; - vm.elementCell = null; - vm.elementCellMaster = null; - vm.elementCellSet = elementCellSet; - vm.elementField = null; - vm.elementFieldMaster = null; - vm.elementFieldSet = elementFieldSet; - vm.elementFieldDataTypeFiltered = elementFieldDataTypeFiltered; - vm.elementItem = null; - vm.elementItemMaster = null; - vm.elementItemSet = elementItemSet; - vm.isElementEdit = false; - vm.isElementNew = true; - vm.isElementFieldEdit = false; - vm.isElementFieldNew = true; - vm.isElementItemEdit = false; - vm.isElementItemNew = true; - vm.isNew = $location.path().substring($location.path().lastIndexOf('/') + 1) === 'new'; - vm.isSaveEnabled = isSaveEnabled; - vm.isSaving = false; - vm.openRemoveResourcePoolModal = openRemoveResourcePoolModal; - vm.removeElement = removeElement; - vm.removeElementField = removeElementField; - vm.removeElementItem = removeElementItem; - vm.removeResourcePool = removeResourcePool; - vm.resourcePool = { ElementSet: [] }; - vm.resourcePoolKey = $routeParams.resourcePoolKey; - vm.saveResourcePool = saveResourcePool; - vm.saveElement = saveElement; - vm.saveElementCell = saveElementCell; - vm.saveElementField = saveElementField; - vm.saveElementItem = saveElementItem; - vm.userName = $routeParams.userName; - - // Enums - vm.ElementFieldDataType = Enums.ElementFieldDataType; - vm.ElementFieldIndexCalculationType = Enums.ElementFieldIndexCalculationType; - vm.ElementFieldIndexSortType = Enums.ElementFieldIndexSortType; - - _init(); - - /*** Implementations ***/ - - function _init() { - - if (vm.isNew) { - - var currentUser = dataContext.getCurrentUser(); - - // If userName equals to current user - if (vm.userName === currentUser.UserName) { - vm.user = currentUser; - - vm.resourcePool = resourcePoolFactory.createResourcePoolBasic(); - - // Title - // TODO viewTitle was also set in route.js? - $rootScope.viewTitle = vm.resourcePool.Name; - - } else { - $location.url('/_system/content/notFound?url=' + $location.url()); - return; - } - - } else { - - var resourcePoolUniqueKey = { userName: vm.userName, resourcePoolKey: vm.resourcePoolKey }; - - resourcePoolFactory.getResourcePoolExpanded(resourcePoolUniqueKey) - .then(resourcePool => { - - // Not found, navigate to 404 - if (resourcePool === null) { - $location.url('/_system/content/notFound?url=' + $location.url()); - return; - } - - vm.resourcePool = resourcePool; - - // Title - // TODO viewTitle was also set in route.js? - $rootScope.viewTitle = vm.resourcePool.Name; - }); - } - } - - function addElement() { - vm.element = resourcePoolFactory.createElement({ - ResourcePool: vm.resourcePool, - Name: 'New element', - IsMainElement: false - }); - - vm.isElementEdit = true; - vm.isElementNew = true; - } - - function addElementField() { - - var element = vm.resourcePool.ElementSet[0]; - - // A temp fix for default value of 'SortOrder' - // Later handle 'SortOrder' by UI, not by asking - var sortOrder = element.ElementFieldSet.length + 1; - - vm.elementField = resourcePoolFactory.createElementField({ - Element: element, - Name: 'New field', - DataType: 1, - SortOrder: sortOrder - }); - - vm.isElementFieldEdit = true; - vm.isElementFieldNew = true; - } - - function addElementItem() { - vm.elementItem = resourcePoolFactory.createElementItem({ - Element: vm.resourcePool.ElementSet[0], - Name: 'New item' - }); - vm.isElementItemEdit = true; - vm.isElementItemNew = true; - } - - function cancelElement() { - - // TODO Find a better way? - // Can't use reject changes because in 'New CMRP' case, these are newly added entities and reject changes removes them / coni2k - 23 Nov. '15 - if (vm.isElementNew) { - resourcePoolFactory.removeElement(vm.element); - } else { - vm.element.Name = vm.elementMaster.Name; - } - - vm.isElementEdit = false; - vm.element = null; - vm.elementMaster = null; - } - - function cancelElementCell() { - - // TODO Find a better way? - // Can't use reject changes because in 'New CMRP' case, these are newly added entities and reject changes removes them / coni2k - 23 Nov. '15 - vm.elementCell.SelectedElementItemId = vm.elementCellMaster.SelectedElementItemId; - vm.elementCell.UserElementCellSet[0].StringValue = vm.elementCellMaster.UserElementCellSet[0].StringValue; - vm.elementCell.UserElementCellSet[0].BooleanValue = vm.elementCellMaster.UserElementCellSet[0].BooleanValue; - vm.elementCell.UserElementCellSet[0].IntegerValue = vm.elementCellMaster.UserElementCellSet[0].IntegerValue; - vm.elementCell.UserElementCellSet[0].DecimalValue = vm.elementCellMaster.UserElementCellSet[0].DecimalValue; - vm.elementCell.UserElementCellSet[0].DateTimeValue = vm.elementCellMaster.UserElementCellSet[0].DateTimeValue; - - vm.isElementCellEdit = false; - vm.elementCell = null; - vm.elementCellMaster = null; - } - - function cancelElementField() { - - // TODO Find a better way? - // Can't use reject changes because in 'New CMRP' case, these are newly added entities and reject changes removes them / coni2k - 23 Nov. '15 - if (vm.isElementFieldNew) { - resourcePoolFactory.removeElementField(vm.elementField); - } else { - vm.elementField.Name = vm.elementFieldMaster.Name; - vm.elementField.DataType = vm.elementFieldMaster.DataType; - vm.elementField.SelectedElementId = vm.elementFieldMaster.SelectedElementId; - vm.elementField.UseFixedValue = vm.elementFieldMaster.UseFixedValue; - vm.elementField.IndexEnabled = vm.elementFieldMaster.IndexEnabled; - vm.elementField.IndexCalculationType = vm.elementFieldMaster.IndexCalculationType; - vm.elementField.IndexSortType = vm.elementFieldMaster.IndexSortType; - vm.elementField.SortOrder = vm.elementFieldMaster.SortOrder; - } - - vm.isElementFieldEdit = false; - vm.elementField = null; - vm.elementFieldMaster = null; - } - - function cancelElementItem() { - - // TODO Find a better way? - // Can't use reject changes because in 'New CMRP' case, these are newly added entities and reject changes removes them / coni2k - 23 Nov. '15 - if (!vm.isElementItemNew) { - vm.elementItem.Name = vm.elementItemMaster.Name; - } - - vm.isElementItemEdit = false; - vm.elementItem = null; - vm.elementItemMaster = null; - } - - function cancelResourcePool() { - - dataContext.rejectChanges(); - - var locationPath = vm.isNew ? - '/' + dataContext.getCurrentUser().UserName : - vm.resourcePool.urlView(); - - $location.url(locationPath); - } - - function editElement(element: any); - function editElement(element) { - vm.elementMaster = angular.copy(element); - vm.element = element; - vm.isElementEdit = true; - vm.isElementNew = false; - } - - function editElementCell(elementCell: any); - function editElementCell(elementCell) { - vm.elementCellMaster = angular.copy(elementCell); - vm.elementCell = elementCell; - vm.isElementCellEdit = true; - } - - function editElementField(elementField: any); - function editElementField(elementField) { - vm.elementFieldMaster = angular.copy(elementField); - vm.elementField = elementField; - vm.isElementFieldEdit = true; - vm.isElementFieldNew = false; - } - - function editElementItem(elementItem: any); - function editElementItem(elementItem) { - vm.elementItemMaster = angular.copy(elementItem); - vm.elementItem = elementItem; - vm.isElementItemEdit = true; - vm.isElementItemNew = false; - } - - function elementCellSet() { - - var elementItems = elementItemSet(); - - var list = []; - elementItems.forEach(elementItem => { - elementItem.ElementCellSet.forEach(elementCell => { - list.push(elementCell); - }); - }); - return list; - } - - function elementFieldSet() { - var list = []; - vm.resourcePool.ElementSet.forEach(element => { - element.ElementFieldSet.forEach(elementField => { - list.push(elementField); - }); - }); - return list; - } - - function elementFieldDataTypeFiltered() { - - var filtered = {}; - for (var key in vm.ElementFieldDataType) { - - // These types can be added only once at the moment - if (key === 'DirectIncome' || key === 'Multiplier') { - var exists = vm.elementField.Element.ElementFieldSet.some(fieldExists); - - if (!exists) { - filtered[key] = vm.ElementFieldDataType[key]; - } - } else if (key === 'Element') { // Element type can only be added if there are more than one element in the pool - if (vm.elementField.Element.ResourcePool.ElementSet.length > 1) { - filtered[key] = vm.ElementFieldDataType[key]; - } - } else { - filtered[key] = vm.ElementFieldDataType[key]; - } - } - - function fieldExists(field: any); - function fieldExists(field) { - return vm.ElementFieldDataType[key] === field.ElementFieldDataType; - } - - return filtered; - } - - function elementItemSet() { - var list = []; - vm.resourcePool.ElementSet.forEach(element => { - element.ElementItemSet.forEach(elementItem => { - list.push(elementItem); - }); - }); - return list; - } - - function isSaveEnabled() { - var value = !vm.isSaving && - typeof vm.resourcePoolForm !== 'undefined' && - vm.resourcePoolForm.$valid; - - return value; - } - - function openRemoveResourcePoolModal() { - var modalInstance = $uibModal.open({ - controller: ['$scope', '$uibModalInstance', ResourcePoolRemoveController], - controllerAs: 'vm', - keyboard: false, - templateUrl: '/_system/views/resourcePool/resourcePoolRemove.html?v=0.53.0' - }); - - modalInstance.result.then(() => { - removeResourcePool(); - }, () => { }); - } - - function removeElement(element: any); - function removeElement(element) { - resourcePoolFactory.removeElement(element); - } - - function removeElementField(elementField: any); - function removeElementField(elementField) { - resourcePoolFactory.removeElementField(elementField); - } - - function removeElementItem(elementItem: any); - function removeElementItem(elementItem) { - resourcePoolFactory.removeElementItem(elementItem); - } - - function removeResourcePool() { - - vm.isSaving = true; - - resourcePoolFactory.removeResourcePool(vm.resourcePool); - - dataContext.saveChanges() - .then(() => { - $location.url('/' + dataContext.getCurrentUser().UserName); - }) - .finally(() => { - vm.isSaving = false; - }); - } - - function saveElement() { - vm.isElementEdit = false; - vm.element = null; - vm.elementMaster = null; - } - - function saveElementCell() { - vm.isElementCellEdit = false; - vm.elementCell = null; - vm.elementCellMaster = null; - } - - function saveElementField() { - - // Fixes - // a. UseFixedValue must be null for String & Element types - if (vm.elementField.DataType === vm.ElementFieldDataType.String || - vm.elementField.DataType === vm.ElementFieldDataType.Element) { - vm.elementField.UseFixedValue = null; - } - - // b. UseFixedValue must be 'false' for Multiplier type - if (vm.elementField.DataType === vm.ElementFieldDataType.Multiplier) { - vm.elementField.UseFixedValue = false; - } - - // c. DirectIncome cannot be Use Fixed Value false at the moment - if (vm.elementField.DataType === vm.ElementFieldDataType.DirectIncome) { - vm.elementField.UseFixedValue = true; - } - - vm.isElementFieldEdit = false; - vm.elementField = null; - vm.elementFieldMaster = null; - } - - function saveElementItem() { - - if (vm.isElementItemNew) { - vm.elementItem = resourcePoolFactory.createElementItem(vm.elementItem); - } - - vm.isElementItemEdit = false; - vm.elementItem = null; - vm.elementItemMaster = null; - } - - function saveResourcePool() { - - vm.isSaving = true; - - // TODO Try to move this to a better place? - vm.resourcePool.updateCache(); - - dataContext.saveChanges() - .then(() => { - $location.url(vm.resourcePool.urlView()); - }) - .finally(() => { - vm.isSaving = false; - }); - } - } - - function ResourcePoolRemoveController($scope: any, $uibModalInstance: any); - function ResourcePoolRemoveController($scope, $uibModalInstance) { - - var vm = this; - vm.cancel = cancel; - vm.remove = remove; - - function cancel() { - $uibModalInstance.dismiss('cancel'); - } - - function remove() { - $uibModalInstance.close(); - } - } - -} \ No newline at end of file diff --git a/ngClient/_system/ts/app/controllers/resourcePool/ResourcePoolSearchController.ts b/ngClient/_system/ts/app/controllers/resourcePool/ResourcePoolSearchController.ts deleted file mode 100644 index f70ce75ea..000000000 --- a/ngClient/_system/ts/app/controllers/resourcePool/ResourcePoolSearchController.ts +++ /dev/null @@ -1,44 +0,0 @@ -module Main.Controller { - 'use strict'; - - var controllerId = 'ResourcePoolSearchController'; - angular.module('main') - .controller(controllerId, ['dataContext', 'logger', 'resourcePoolFactory', '$location', '$rootScope', '$scope', ResourcePoolSearchController]); - - function ResourcePoolSearchController(dataContext: any, - logger: any, - resourcePoolFactory: any, - $location: any, - $rootScope: any, - $scope: any); - function ResourcePoolSearchController(dataContext, logger, resourcePoolFactory, $location, $rootScope, $scope) { - - // Logger - logger = logger.forSource(controllerId); - - var vm = this; - vm.resourcePoolSet = []; - vm.searchKey = ''; - vm.searchKeyChanged = searchKeyChanged; - vm.showResults = false; - - _init(); - - function _init() { - } - - function searchKeyChanged() { - - if (vm.searchKey.length <= 2) { - vm.showResults = false; - return; - } - - resourcePoolFactory.getResourcePoolSet(vm.searchKey) - .then(data => { - vm.resourcePoolSet = data; - vm.showResults = true; - }); - } - } -} \ No newline at end of file diff --git a/ngClient/_system/ts/app/controllers/resourcePool/ResourcePoolViewController.ts b/ngClient/_system/ts/app/controllers/resourcePool/ResourcePoolViewController.ts deleted file mode 100644 index 4b1749b99..000000000 --- a/ngClient/_system/ts/app/controllers/resourcePool/ResourcePoolViewController.ts +++ /dev/null @@ -1,43 +0,0 @@ -module Main.Controller { - 'use strict'; - - var controllerId = 'ResourcePoolViewController'; - angular.module('main') - .controller(controllerId, ['logger', 'resourcePoolFactory', '$location', '$rootScope', '$routeParams', ResourcePoolViewController]); - - function ResourcePoolViewController(logger: any, - resourcePoolFactory: any, - $location: any, - $rootScope: any, - $routeParams: any); - function ResourcePoolViewController(logger, resourcePoolFactory, $location, $rootScope, $routeParams) { - - // Logger - logger = logger.forSource(controllerId); - - var vm = this; - vm.editorConfig = { - resourcePoolKey: $routeParams.resourcePoolKey, - userName: $routeParams.userName - }; - - _init(); - - function _init() { - - // Title - resourcePoolFactory.getResourcePoolExpanded(vm.editorConfig) - .then(resourcePool => { - - // Not found, navigate to 404 - if (resourcePool === null) { - $location.url('/_system/content/notFound?url=' + $location.url()); - return; - } - - // TODO viewTitle was also set in route.js? - $rootScope.viewTitle = resourcePool.Name; - }); - } - } -} \ No newline at end of file diff --git a/ngClient/_system/ts/app/directives/resourcePoolEditor/resourcePoolEditor.css b/ngClient/_system/ts/app/directives/resourcePoolEditor/resourcePoolEditor.css deleted file mode 100644 index fb3ed82b1..000000000 --- a/ngClient/_system/ts/app/directives/resourcePoolEditor/resourcePoolEditor.css +++ /dev/null @@ -1,92 +0,0 @@ -.resourcePoolEditor { - font-family: Tahoma; - /*font-family: Verdana, Geneva, Tahoma, sans-serif;*/ - font-size: 11px; - padding: 1.5em 0; -} - - .resourcePoolEditor .heading { - padding: 15px; - } - - .resourcePoolEditor .title { - font-size: 18px; - line-height: 2em; - } - - .resourcePoolEditor hr { - margin: 10px 0 20px 0; - border-color: #ddd; - } - - .resourcePoolEditor .description { - padding: 30px 15px; - font-size: 14px; - line-height: 1.5em; - border-bottom: 1px solid #ddd; - } - - .resourcePoolEditor .settings, - .resourcePoolEditor .details { - min-height: 3em; - } - - .resourcePoolEditor .details label, .resourcePoolEditor .details span { - border-bottom: 1px solid #ddd; - display: inline-block; - line-height: 2em; - margin-bottom: 0; - min-width: 125px; - padding: 5px; - } - -.resourcePoolTable { -} - - .resourcePoolTable > thead > tr > th { - vertical-align: top; - } - - .resourcePoolTable > thead > tr > th, - .resourcePoolTable > thead > tr > td, - .resourcePoolTable > tbody > tr > td, - .resourcePoolTable > tfoot > tr > td { - line-height: 2em; - min-width: 85px; - overflow: hidden; /* Hide text outside the cell */ - padding: 3px; - } - - .resourcePoolTable .infoText { - margin-left: 2px; - } - - .resourcePoolTable .incomeStatusLow { - color: #a94442; - } - - .resourcePoolTable .incomeStatusAverage { - /* color: ? */ - } - - .resourcePoolTable .incomeStatusHigh { - color: #3c763d; - } - - .resourcePoolTable .noborder { - border: 0; - } - -.label-as-on-badge { - border-radius: 1em; - background-color: #3c763d; - cursor: pointer; - margin-left: 5px; -} - -.label-as-off-badge { - border-radius: 1em; - background-color: #a94442; - cursor: pointer; - margin-left: 5px; -} diff --git a/ngClient/_system/ts/app/directives/resourcePoolEditor/resourcePoolEditor.html b/ngClient/_system/ts/app/directives/resourcePoolEditor/resourcePoolEditor.html deleted file mode 100644 index efaf4048c..000000000 --- a/ngClient/_system/ts/app/directives/resourcePoolEditor/resourcePoolEditor.html +++ /dev/null @@ -1,251 +0,0 @@ -
-
-
-
-
-

- -

- - - - -
-
-
-
-
-
-
-
-
-
- - -
-
- -
-
-
-
-
-
-
- - -
-
-
-
-
-
- -
-
- -
-
-
-
-
- - -
- - - -
-
-
-
-
-
-
- - -
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- (I) -
- - - -
- - - - - - CMRP Income - - - - Total Income -
- - - -
- - - -
- - - -
-
-
- -
-
- -
-
- -
-
- - - - - - - -
-   - - - - - - - - - - - - - - - -
-   - -
-   -
-
-
- - - -
-
-
-   - -
- - - -
-
-   - -   -
-
-
-
-
-
-
diff --git a/ngClient/_system/ts/app/entities/User.ts b/ngClient/_system/ts/app/entities/User.ts deleted file mode 100644 index b1848139f..000000000 --- a/ngClient/_system/ts/app/entities/User.ts +++ /dev/null @@ -1,57 +0,0 @@ -module M37 { - 'use strict'; - - var factoryId = 'User'; - angular.module('main') - .factory(factoryId, ['logger', userFactory]); - - function userFactory(logger: any); - function userFactory(logger) { - - // Logger - logger = logger.forSource(factoryId); - - // Return - return User; - - function User() { - - var self = this; - - // Server-side - self.Id = 0; - self.Email = ''; - self.EmailConfirmed = false; - self.IsAnonymous = false; - self.UserName = ''; - self.SingleUseToken = null; - self.HasPassword = false; - self.FirstName = ''; - self.MiddleName = ''; - self.LastName = ''; - self.PhoneNumber = ''; - self.PhoneNumberConfirmed = false; - self.TwoFactorEnabled = false; - self.AccessFailedCount = 0; - self.LockoutEnabled = false; - self.LockoutEndDateUtc = null; - self.Notes = ''; - self.CreatedOn = new Date(); - self.ModifiedOn = new Date(); - self.DeletedOn = null; - // TODO breezejs - Cannot assign a navigation property in an entity ctor - //self.Claims = null; - //self.Logins = []; - //self.Roles = []; - - // Functions - self.isAuthenticated = isAuthenticated; - - /*** Implementations ***/ - - function isAuthenticated() { - return self.Id > 0; - } - } - } -} \ No newline at end of file diff --git a/ngClient/_system/ts/app/entities/UserElementCell.ts b/ngClient/_system/ts/app/entities/UserElementCell.ts deleted file mode 100644 index 9b9cbdd08..000000000 --- a/ngClient/_system/ts/app/entities/UserElementCell.ts +++ /dev/null @@ -1,48 +0,0 @@ -module M38 { - 'use strict'; - - var factoryId = 'UserElementCell'; - angular.module('main') - .factory(factoryId, ['logger', userElementCellFactory]); - - function userElementCellFactory(logger: any); - function userElementCellFactory(logger) { - - // Logger - logger = logger.forSource(factoryId); - - // Properties - Object.defineProperty(UserElementCell.prototype, 'DecimalValue', { - enumerable: true, - configurable: true, - get() { return this.backingFields._DecimalValue; }, - set(value) { - if (this.backingFields._DecimalValue !== value) { - this.backingFields._DecimalValue = value; - } - } - }); - - // Return - return UserElementCell; - - function UserElementCell() { - - var self = this; - - // Server-side - self.UserId = 0; - self.ElementCellId = 0; - self.StringValue = null; - self.BooleanValue = null; - self.IntegerValue = null; - // - self.DateTimeValue = null; - - // Local variables - self.backingFields = { - _DecimalValue: null - }; - } - } -} \ No newline at end of file diff --git a/ngClient/_system/ts/app/entities/UserElementField.ts b/ngClient/_system/ts/app/entities/UserElementField.ts deleted file mode 100644 index a2bcc4407..000000000 --- a/ngClient/_system/ts/app/entities/UserElementField.ts +++ /dev/null @@ -1,27 +0,0 @@ -module M39 { - 'use strict'; - - var factoryId = 'UserElementField'; - angular.module('main') - .factory(factoryId, ['logger', userElementFieldFactory]); - - function userElementFieldFactory(logger: any); - function userElementFieldFactory(logger) { - - // Logger - logger = logger.forSource(factoryId); - - // Return - return UserElementField; - - function UserElementField() { - - var self = this; - - // Server-side - self.UserId = 0; - self.ElementFieldId = 0; - self.Rating = 0; - } - } -} \ No newline at end of file diff --git a/ngClient/_system/ts/app/entities/UserResourcePool.ts b/ngClient/_system/ts/app/entities/UserResourcePool.ts deleted file mode 100644 index 3e6da8e92..000000000 --- a/ngClient/_system/ts/app/entities/UserResourcePool.ts +++ /dev/null @@ -1,27 +0,0 @@ -module M40 { - 'use strict'; - - var factoryId = 'UserResourcePool'; - angular.module('main') - .factory(factoryId, ['logger', userResourcePoolFactory]); - - function userResourcePoolFactory(logger: any); - function userResourcePoolFactory(logger) { - - // Logger - logger = logger.forSource(factoryId); - - // Return - return UserResourcePool; - - function UserResourcePool() { - - var self = this; - - // Server-side - self.UserId = 0; - self.ResourcePoolId = 0; - self.ResourcePoolRate = 0; - } - } -} \ No newline at end of file diff --git a/ngClient/_system/ts/app/factories/entityManagerFactory.ts b/ngClient/_system/ts/app/factories/entityManagerFactory.ts deleted file mode 100644 index 494495edb..000000000 --- a/ngClient/_system/ts/app/factories/entityManagerFactory.ts +++ /dev/null @@ -1,85 +0,0 @@ -/*** - * Service: entityManagerFactory - * - * Configures BreezeJS and creates new instance(s) of the - * BreezeJS EntityManager for use in a 'dataContext' service - * - ***/ -module M43 { - 'use strict'; - - var factoryId = 'entityManagerFactory'; - angular.module('main') - .factory(factoryId, ['breeze', - 'Element', - 'ElementCell', - 'ElementField', - 'ElementItem', - 'logger', - 'ResourcePool', - 'serviceAppUrl', - 'User', - 'UserElementCell', - 'UserElementField', - 'UserResourcePool', - '$rootScope', - entityManagerFactory]); - - function entityManagerFactory(breeze: any, - Element: any, - ElementCell: any, - ElementField: any, - ElementItem: any, - logger: any, - ResourcePool: any, - serviceAppUrl: any, - User: any, - UserElementCell: any, - UserElementField: any, - UserResourcePool: any, - $rootScope: any); - function entityManagerFactory(breeze, - Element, - ElementCell, - ElementField, - ElementItem, - logger, - ResourcePool, - serviceAppUrl, - User, - UserElementCell, - UserElementField, - UserResourcePool, - $rootScope) { - - // Logger - logger = logger.forSource(factoryId); - - // var serviceRoot = window.location.protocol + '//localhost:15001/'; - var serviceRoot = serviceAppUrl; - var serviceName = serviceRoot + '/odata'; - var factory = { - newManager: newManager, - serviceName: serviceName - }; - - return factory; - - function newManager() { - var manager = new breeze.EntityManager(serviceName); - var store = manager.metadataStore; - - store.registerEntityTypeCtor('Element', Element); - store.registerEntityTypeCtor('ElementCell', ElementCell); - store.registerEntityTypeCtor('ElementField', ElementField); - store.registerEntityTypeCtor('ElementItem', ElementItem); - store.registerEntityTypeCtor('ResourcePool', ResourcePool); - store.registerEntityTypeCtor('User', User); - store.registerEntityTypeCtor('UserElementCell', UserElementCell); - store.registerEntityTypeCtor('UserElementField', UserElementField); - store.registerEntityTypeCtor('UserResourcePool', UserResourcePool); - - return manager; - } - } -} \ No newline at end of file diff --git a/ngClient/_system/ts/app/factories/locationHistory.ts b/ngClient/_system/ts/app/factories/locationHistory.ts deleted file mode 100644 index c5de37a7e..000000000 --- a/ngClient/_system/ts/app/factories/locationHistory.ts +++ /dev/null @@ -1,68 +0,0 @@ -module M44 { - 'use strict'; - - var factoryId = 'locationHistory'; - angular.module('main') - .factory(factoryId, ['logger', locationHistory]); - - function locationHistory(logger: any); - function locationHistory(logger) { - - // Logger - logger = logger.forSource(factoryId); - - var self = { - history: [new LocationItem('/')], - historyLimit: 10 - }; - - var factory = { - createItem: createItem, - getHistory: getHistory, - previousItem: previousItem - }; - - // Return - return factory; - - /*** Implementations ***/ - - function createItem($location: any, $routeCurrent: any); - function createItem($location, $routeCurrent) { - - var itemUrl = $location.url(); - var accessType = $routeCurrent.accessType; - var item = new LocationItem(itemUrl, accessType); - self.history.push(item); - - // Only keep limited number of items - if (self.history.length > self.historyLimit) { - self.history.splice(0, self.history.length - self.historyLimit); - } - } - - function getHistory() { - return self.history.slice(); - } - - function previousItem() { - for (var i = self.history.length - 2; i >= 0; i--) { - return self.history[i]; - } - } - - function LocationItem(itemUrl, accessType?) { - itemUrl = typeof itemUrl !== 'undefined' ? itemUrl : ''; - accessType = typeof accessType !== 'undefined' ? accessType : 'undefined'; - - var self = this; - self.itemUrl = itemUrl; - self.accessType = accessType; - self.url = url; - - function url() { - return self.itemUrl; - } - } - } -} \ No newline at end of file diff --git a/ngClient/_system/ts/appSettings/Setup/0 Readme.txt b/ngClient/_system/ts/appSettings/Setup/0 Readme.txt deleted file mode 100644 index e57f785f2..000000000 --- a/ngClient/_system/ts/appSettings/Setup/0 Readme.txt +++ /dev/null @@ -1,3 +0,0 @@ -"appSettings.js" under this folder is the initial configuration file. -During the first build of the application, it will be copied to the parent folder to let you enter your own settings. -Please note that the copy under the parent folder will be not be stored in the source control. diff --git a/ngClient/_system/ts/appSettings/Setup/appSettings.js b/ngClient/_system/ts/appSettings/Setup/appSettings.js deleted file mode 100644 index 7871958e8..000000000 --- a/ngClient/_system/ts/appSettings/Setup/appSettings.js +++ /dev/null @@ -1,13 +0,0 @@ -(function () { - 'use strict'; - - var main = angular.module('main'); - - main.constant('serviceAppUrl', 'http://localhost:15001') // Service application (WebApi) url - - .constant('analyticsTrackingCode', '') // Google analytics tracking code - .constant('analyticsDomainName', '') // Google analytics domain name - - .constant('disqusShortname', ''); // Disqus shortname - -})(); diff --git a/ngClient/_system/ts/appSettings/appSettings.js b/ngClient/_system/ts/appSettings/appSettings.js deleted file mode 100644 index f2c897df8..000000000 --- a/ngClient/_system/ts/appSettings/appSettings.js +++ /dev/null @@ -1,13 +0,0 @@ -(function () { - 'use strict'; - - var main = angular.module('main'); - - main.constant('serviceAppUrl', 'http://localhost:15001') // Service application (WebApi) url - - .constant('analyticsTrackingCode', '') // Google analytics tracking code - .constant('analyticsDomainName', '') // Google analytics domain name - - .constant('disqusShortname', ''); // Disqus shortname - -})(); diff --git a/ngClient/_system/views/account/account.html b/ngClient/_system/views/account/account.html index 3cff98d7e..d5a04de20 100644 --- a/ngClient/_system/views/account/account.html +++ b/ngClient/_system/views/account/account.html @@ -1,4 +1,4 @@ -
+

Account

User

diff --git a/ngClient/_system/views/account/accountEdit.html b/ngClient/_system/views/account/accountEdit.html index 73b769a17..b6415824f 100644 --- a/ngClient/_system/views/account/accountEdit.html +++ b/ngClient/_system/views/account/accountEdit.html @@ -1,4 +1,4 @@ -
+

Edit

diff --git a/ngClient/_system/views/account/addPassword.html b/ngClient/_system/views/account/addPassword.html index 43f0ea160..ee7aeb35c 100644 --- a/ngClient/_system/views/account/addPassword.html +++ b/ngClient/_system/views/account/addPassword.html @@ -1,4 +1,4 @@ -
+

Add Password

diff --git a/ngClient/_system/views/resourcePool/resourcePoolManage.html b/ngClient/_system/views/resourcePool/resourcePoolManage.html index a4aae2edf..396be3af0 100644 --- a/ngClient/_system/views/resourcePool/resourcePoolManage.html +++ b/ngClient/_system/views/resourcePool/resourcePoolManage.html @@ -282,7 +282,7 @@

- + diff --git a/ngClient/default.aspx b/ngClient/default.aspx index 2e77b688d..6a5bdef18 100644 --- a/ngClient/default.aspx +++ b/ngClient/default.aspx @@ -129,10 +129,10 @@ - + - + diff --git a/ngClient/gulpfile.js b/ngClient/gulpfile.js index 3db04f66a..34b70a76c 100644 --- a/ngClient/gulpfile.js +++ b/ngClient/gulpfile.js @@ -2,39 +2,37 @@ 'use strict'; var gulp = require('gulp'), - clean = require('gulp-clean'), concat = require('gulp-concat'), cssmin = require('gulp-cssmin'), fs = require('fs'), - jshint = require('gulp-jshint'), + jshint = require('gulp-jshint'), // Obsolete? rename = require('gulp-rename'), sourcemaps = require('gulp-sourcemaps'), - tap = require('gulp-tap'), ts = require("gulp-typescript"), uglify = require('gulp-uglify'); +// Common +var jsRoot = "./_system/js"; + // app.js variables -var appMinJs = 'app.min.js', +var appJsConfig = jsRoot + "/tsconfig.json", + appMinJs = 'app.min.js', appJs = appMinJs.replace('.min', ''), - appJsRoot = './_system/ts/app', + appJsRoot = jsRoot + '/app', appJsSourceMapRoot = appJsRoot.substring(1), - appJsSrc = [appJsRoot + '/**/*.js', - '!' + appJsRoot + '/' + appJs, - '!' + appJsRoot + '/' + appMinJs]; + appJsSrc = [appJsRoot + '/**/*.ts']; // app.css variables var appMinCss = 'app.min.css', appCss = appMinCss.replace('.min', ''), appCssRoot = './_system/css', appCssSrc = [appCssRoot + '/*.css', - appJsRoot + '/directives/**/*.css', + appJsRoot + '/directives/**/*.css', // Angular directives '!' + appCssRoot + '/' + appCss, '!' + appCssRoot + '/' + appMinCss]; -// app.ts variables -var appTsSrc = ['./_system/ts/**/*.ts']; - // appSettings.js variables +var appSettingsRoot = jsRoot + '/appSettings'; var appSettingsJs = 'appSettings.js'; // lib variables @@ -69,7 +67,7 @@ var libMinJs = 'lib.min.js', libJsSrcRoot + '/toastr/toastr.js', // toastr libJsSrcRoot + '/source-map/dist/source-map.js' // sourceMap ], - libJsDest = './_system/js/lib'; + libJsDest = jsRoot + "/lib"; // lib.css variables var libMinCss = 'lib.min.css', @@ -92,25 +90,14 @@ var fontsSrc = [ // default gulp.task('default', [appJs, appCss, appSettingsJs, libJs, libCss, 'watch']); -gulp.task('ts', function () { - - var tsProject = ts.createProject("./_system/ts/tsconfig.json"); - - return tsProject.src() - .pipe(ts(tsProject)) - .js - .pipe(gulp.dest("./_system/ts")); - -}); - // app.js: jshhint + concat all into app.js + minify all into app.min.js gulp.task(appJs, function () { - return gulp.src(appJsSrc) - .pipe(jshint()) - .pipe(jshint.reporter('jshint-stylish')) + var tsProject = ts.createProject(appJsConfig, { outFile: appJs }); + + return tsProject.src() .pipe(sourcemaps.init()) - .pipe(concat(appJs, { newLine: '\r\n' })) + .pipe(ts(tsProject)).js .pipe(gulp.dest(appJsRoot)) .pipe(rename(appMinJs)) .pipe(uglify()) @@ -119,6 +106,22 @@ gulp.task(appJs, function () { .pipe(gulp.dest(appJsRoot)); }); +// Old app.js, before typescript - Obsolete +//// app.js: jshhint + concat all into app.js + minify all into app.min.js +//gulp.task(appJs, function () { +// return gulp.src(appJsSrc) +// .pipe(jshint()) +// .pipe(jshint.reporter('jshint-stylish')) +// .pipe(sourcemaps.init()) +// .pipe(concat(appJs, { newLine: '\r\n' })) +// .pipe(gulp.dest(appJsRoot)) +// .pipe(rename(appMinJs)) +// .pipe(uglify()) +// .on('error', errorHandler) +// .pipe(sourcemaps.write('./', { sourceRoot: appJsSourceMapRoot })) +// .pipe(gulp.dest(appJsRoot)); +//}); + // app.css: concat all into app.css + minify all into app.min.css gulp.task(appCss, function () { @@ -133,13 +136,11 @@ gulp.task(appCss, function () { // appSettings.js: if it doesn't exist, copy '/appSettings/Setup/appSettings.js' file to '/appSettings' folder gulp.task(appSettingsJs, function () { - var appSettingsRoot = './_system/js/appSettings'; - fs.stat(appSettingsRoot + '/' + appSettingsJs, function (err, stat) { // If there is no error, it means file is already there. No need to copy from setup, move along! if (err === null) { - return; + return null; } return gulp.src(appSettingsRoot + '/Setup/' + appSettingsJs) @@ -184,9 +185,6 @@ gulp.task('watch', function () { gulp.watch(libJsSrc, [libJs]); gulp.watch(libCssSrc, [libCss]); - // ts - gulp.watch(appTsSrc, ['ts']); - }); function errorHandler(error) { diff --git a/ngClient/ngClient.csproj b/ngClient/ngClient.csproj index b25a1da73..441d18508 100644 --- a/ngClient/ngClient.csproj +++ b/ngClient/ngClient.csproj @@ -57,122 +57,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -195,7 +137,7 @@ - + @@ -222,10 +164,10 @@ Web.config - - - - + + + +