From f8030186578fe5e9082803606297b20a35d67e9e Mon Sep 17 00:00:00 2001 From: Gabriel Muscalu Date: Wed, 23 Nov 2016 15:21:36 +0200 Subject: [PATCH 01/28] documentation - account module --- .../account/activate/activate.controller.js | 8 ++ client/app/account/fpw/fpw.controller.js | 23 ++++++ client/app/account/login/login.controller.js | 40 +++++++++- .../account/password/password.controller.js | 25 ++++++ .../app/account/profile/profile.controller.js | 79 +++++++++++++++++++ .../app/account/signup/signup.controller.js | 38 +++++++++ client/app/account/signup/signup.directive.js | 7 ++ 7 files changed, 219 insertions(+), 1 deletion(-) diff --git a/client/app/account/activate/activate.controller.js b/client/app/account/activate/activate.controller.js index a89cef9..e388fac 100644 --- a/client/app/account/activate/activate.controller.js +++ b/client/app/account/activate/activate.controller.js @@ -1,6 +1,14 @@ 'use strict'; angular.module('ldrWebApp') + /** + * @ngdoc controller + * @name ActivateCtrl + * @description activate account controller + * @requires activate + * @requires $scope + * @property {Boolean} activate - user has active account + */ .controller('ActivateCtrl', ['activate', '$scope', function (activate, $scope) { $scope.activate = activate; }]); diff --git a/client/app/account/fpw/fpw.controller.js b/client/app/account/fpw/fpw.controller.js index db657ce..e472233 100644 --- a/client/app/account/fpw/fpw.controller.js +++ b/client/app/account/fpw/fpw.controller.js @@ -1,12 +1,35 @@ 'use strict'; angular.module('ldrWebApp') + /** + * @ngdoc controller + * @name FpwCtrl + * @description reset password controller + * @requires $scope + * @requires User + * @requires LxNotificationService + * @requires responseHandler + * @requires $translate + * @property {Object} errors - errors object + * @property {Object} user - user object + * @property {Boolean} success - reset password email sent with success + */ .controller('FpwCtrl', ['$scope', 'User', 'LxNotificationService', 'responseHandler', '$translate', function ($scope, User, LxNotificationService, responseHandler, $translate) { $scope.errors = {}; $scope.user = {}; $scope.success = false; + /** + * @ngdoc + * @name FpwCtrl#reset + * @methodOf FpwCtrl + * @param {Object} form - reset password form object + * @example + *
+ * @description + * sends reset password email + */ $scope.reset = function (form) { $scope.submitted = true; diff --git a/client/app/account/login/login.controller.js b/client/app/account/login/login.controller.js index e0abe28..92fcf0e 100644 --- a/client/app/account/login/login.controller.js +++ b/client/app/account/login/login.controller.js @@ -1,6 +1,25 @@ 'use strict'; angular.module('ldrWebApp') + /** + * @ngdoc controller + * @name LoginCtrl + * @description login controller + * @requires $scope + * @requires Auth + * @requires $location + * @requires $window + * @requires LxNotificationService + * @requires $state + * @requires $stateParams + * @requires User + * @requires $translate + * @requires responseHandler + * @requires AUTH_URL + * @property {Object} errors - errors object + * @property {Object} user - user object + * @property {Object} fail - error response flag + */ .controller('LoginCtrl', ['$scope', 'Auth', '$location', '$window', 'LxNotificationService', '$state', '$stateParams', 'User', '$translate', 'responseHandler', 'AUTH_URL', function ($scope, Auth, $location, $window, LxNotificationService, $state, @@ -16,6 +35,15 @@ angular.module('ldrWebApp') $stateParams.error = null; } + /** + * @ngdoc + * @name LoginCtrl#resend + * @methodOf LoginCtrl + * @example + *
+ * @description + * resends confirmation email + */ $scope.resend = function () { LxNotificationService.confirm($translate.instant('views.login.resendConfirmTitle'), @@ -37,6 +65,17 @@ angular.module('ldrWebApp') }; + /** + * @ngdoc + * @name LoginCtrl#login + * @methodOf LoginCtrl + * @example + *
+ * @description + * login and redirect to dashboard + */ $scope.login = function (user, form) { $scope.submitted = true; $scope.fail.flag = false; @@ -47,7 +86,6 @@ angular.module('ldrWebApp') password: user.password }) .then(function () { - // Logged in, redirect to dashboard $state.go(Auth.getDefaultScreen()); }) .catch(function (err) { diff --git a/client/app/account/password/password.controller.js b/client/app/account/password/password.controller.js index 09b7f9d..3430afc 100644 --- a/client/app/account/password/password.controller.js +++ b/client/app/account/password/password.controller.js @@ -1,6 +1,19 @@ 'use strict'; angular.module('ldrWebApp') + /** + * @ngdoc controller + * @name PasswordCtrl + * @description change password controller + * @requires $scope + * @requires $state + * @requires User + * @requires LxNotificationService + * @requires $translate + * @property {Object} errors - errors object + * @property {Object} user - user object + * @property {Object} success - success response flag + */ .controller('PasswordCtrl', [ '$scope', '$state', @@ -12,6 +25,18 @@ angular.module('ldrWebApp') $scope.success = false; $scope.user = {}; + + /** + * @ngdoc + * @name PasswordCtrl#changePassword + * @methodOf PasswordCtrl + * @param {Object} form - change password form object + * @example + *

+             * @description
+             * changes user password
+             */
             $scope.changePassword = function (form) {
 
                 $scope.submitted = true;
diff --git a/client/app/account/profile/profile.controller.js b/client/app/account/profile/profile.controller.js
index dd86f6e..246a0b4 100644
--- a/client/app/account/profile/profile.controller.js
+++ b/client/app/account/profile/profile.controller.js
@@ -1,6 +1,32 @@
 'use strict';
 
 angular.module('ldrWebApp')
+    /**
+     * @ngdoc controller
+     * @name ProfileCtrl
+     * @description profile controller
+     * @requires CountyService
+     * @requires LxNotificationService
+     * @requires LxDialogService
+     * @requires Auth
+     * @requires $filter
+     * @requires ImageUpload
+     * @requires $rootScope
+     * @requires $timeout
+     * @requires LxProgressService
+     * @requires $state
+     * @requires CountryService
+     * @requires $translate
+     * @requires HelperService
+     * @requires responseHandler
+     * @property {Object} user - current user object
+     * @property {Object} selectedLanguage - selected language object
+     * @property {Object} country - current user country object
+     * @property {Array} countries - all countries array
+     * @property {Array} counties - all counties array
+     * @property {Object} availableLanguages - available languages object
+     * @property {Object} errors - error response object
+     */
     .controller('ProfileCtrl', ['$scope',
         'CountyService',
         'LxNotificationService',
@@ -53,6 +79,16 @@ angular.module('ldrWebApp')
                 $scope.errors = {};
             };
 
+            /**
+             * @ngdoc
+             * @name ProfileCtrl#resetCounties
+             * @methodOf ProfileCtrl
+             * @param {Object} selectedCountry - selected country
+             * @example
+             * 
+ * @description + * gets counties depending on selected country + */ $scope.resetCounties = function (selectedCountry) { var params = { id: selectedCountry._id @@ -68,6 +104,15 @@ angular.module('ldrWebApp') ); }; + /** + * @ngdoc + * @name ProfileCtrl#openPasswordDialog + * @methodOf ProfileCtrl + * @example + *
+ * @description + * opens change password dialog + */ $scope.openPasswordDialog = function () { $scope.submitted = false; $scope.pass = { @@ -79,6 +124,17 @@ angular.module('ldrWebApp') LxDialogService.open('password'); }; + /** + * @ngdoc + * @name ProfileCtrl#closePasswordDialog + * @methodOf ProfileCtrl + * @param {Object} form - change password form object + * @param {Object} user - user form object + * @example + *

+             * @description
+             * saves new password on dialog close
+             */
             $scope.closePasswordDialog = function (form, user) {
 
                 $scope.submitted = true;
@@ -106,6 +162,17 @@ angular.module('ldrWebApp')
                 }
             };
 
+            /**
+             * @ngdoc
+             * @name ProfileCtrl#update
+             * @methodOf ProfileCtrl
+             * @param {Object} form - user profile form object
+             * @example
+             * 
+ * @description + * updates user profile + */ $scope.update = function (form) { $scope.submitted = true; @@ -134,6 +201,18 @@ angular.module('ldrWebApp') } }; + + /** + * @ngdoc + * @name ProfileCtrl#changeProfilePic + * @methodOf ProfileCtrl + * @param {Array} $files - array containing new profile image + * @example + *
+ * @description + * uploads new profile image, then updates the user profile + */ $scope.changeProfilePic = function ($files) { if ($files && $files[0]) { var file = $files[0]; diff --git a/client/app/account/signup/signup.controller.js b/client/app/account/signup/signup.controller.js index 59757fa..8879ee2 100644 --- a/client/app/account/signup/signup.controller.js +++ b/client/app/account/signup/signup.controller.js @@ -1,6 +1,22 @@ 'use strict'; angular.module('ldrWebApp') + /** + * @ngdoc controller + * @name SignupCtrl + * @description user sign in controller + * @requires $scope + * @requires Auth + * @requires User + * @requires $location + * @requires LxNotificationService + * @requires $translate + * @requires responseHandler + * @requires AUTH_URL + * @property {Object} errors - errors object + * @property {Object} user - user object + * @property {Object} success - success response flag + */ .controller('SignupCtrl', ['$scope', 'Auth', 'User', '$location', '$window', 'LxNotificationService', '$translate', 'responseHandler', 'AUTH_URL', function ($scope, Auth, User, $location, $window, LxNotificationService, $translate, @@ -12,6 +28,18 @@ angular.module('ldrWebApp') var email_created; + /** + * @ngdoc + * @name SignupCtrl#register + * @methodOf SignupCtrl + * @param {Object} user - user object + * @param {Object} form - new user form object + * @example + *

+             
+ * @description + * resends confirmation email + */ $scope.register = function (user, form) { $scope.submitted = true; var mailLanguage = $translate.use(); @@ -43,6 +71,16 @@ angular.module('ldrWebApp') } }; + /** + * @ngdoc + * @name SignupCtrl#resend + * @methodOf SignupCtrl + * @example + *
+ * @description + * resends confirmation email + */ $scope.resend = function () { User.resendActivation({email: email_created}).$promise .then(function () { diff --git a/client/app/account/signup/signup.directive.js b/client/app/account/signup/signup.directive.js index 0363dd9..800f8cd 100644 --- a/client/app/account/signup/signup.directive.js +++ b/client/app/account/signup/signup.directive.js @@ -1,6 +1,13 @@ 'use strict'; angular.module('ldrWebApp') + /** + * @ngdoc directive + * @name checkRequired + * @description returns true if model value is true + * @example + *
+ */ .directive('checkRequired', [function () { return { require: 'ngModel', From 211c32569eccb9e4a697e8f8d320989398d902f7 Mon Sep 17 00:00:00 2001 From: Gabriel Muscalu Date: Wed, 23 Nov 2016 15:35:34 +0200 Subject: [PATCH 02/28] documentation - activity module --- .../app/activity/controllers/activityCtrl.js | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/client/app/activity/controllers/activityCtrl.js b/client/app/activity/controllers/activityCtrl.js index 36157d4..3b4045e 100644 --- a/client/app/activity/controllers/activityCtrl.js +++ b/client/app/activity/controllers/activityCtrl.js @@ -1,5 +1,20 @@ 'use strict'; +/** + * @ngdoc controller + * @name ActivityCtrl + * @description notifications page controller + * @requires $scope + * @requires Activity + * @requires $rootScope + * @requires $state + * @requires responseHandler + * @requires PILE_IMAGE_CONFIG + * @property {String} defaultPileImageSrc - default image path + * @property {Boolean} busyLoading - currently loading notifications flag + * @property {Boolean} finishedLoading - finished loading all notifications flag + * @property {Array} activities - notifications array + */ angular.module('ldrWebApp').controller('ActivityCtrl', [ '$scope', 'Activity', @@ -15,6 +30,16 @@ angular.module('ldrWebApp').controller('ActivityCtrl', [ $scope.activities = []; var currentPage = 1; var pageLimit = 5; + + /** + * @ngdoc + * @name ActivityCtrl#nextPage + * @methodOf ActivityCtrl + * @example + *
+ * @description + * gets notifications next page + */ $scope.nextPage = function () { if ($scope.busyLoading || $scope.finishedLoading) { @@ -32,6 +57,16 @@ angular.module('ldrWebApp').controller('ActivityCtrl', [ }); }; + /** + * @ngdoc + * @name ActivityCtrl#markAsRead + * @methodOf ActivityCtrl + * @param {Object} activity - activity to mark as read + * @example + *
+ * @description + * marks given notification as read + */ $scope.markAsRead = function (activity) { if (!activity.viewed) { Activity.viewed({id: activity._id}, {}).$promise.then(function (data) { @@ -43,6 +78,18 @@ angular.module('ldrWebApp').controller('ActivityCtrl', [ }); } }; + + /** + * @ngdoc + * @name ActivityCtrl#visitNotification + * @methodOf ActivityCtrl + * @param {Object} activity - activity to mark as read + * @example + *

+         * @description
+         * marks given notification as read and redirects to pile view
+         */
         $scope.visitNotification = function (activity) {
             $scope.markAsRead(activity);
             $state.go('app.map.pile.view', {id: activity.pile._id});

From ffd1f69c049f6e8db3835119aca271cf9d42a5f0 Mon Sep 17 00:00:00 2001
From: Gabriel Muscalu 
Date: Thu, 24 Nov 2016 11:20:07 +0200
Subject: [PATCH 03/28] documentation - admin module

---
 .../app/admin/controllers/admin.controller.js |  66 ++++++++--
 .../admin/controllers/adminStatisticsCtrl.js  |  85 +++++++++++-
 client/app/admin/controllers/adminUserCtrl.js |  12 +-
 .../app/admin/controllers/adminUsersCtrl.js   | 122 +++++++++++++-----
 client/app/admin/controllers/editUserCtrl.js  |  39 +++++-
 5 files changed, 273 insertions(+), 51 deletions(-)

diff --git a/client/app/admin/controllers/admin.controller.js b/client/app/admin/controllers/admin.controller.js
index 3f642cc..e634057 100644
--- a/client/app/admin/controllers/admin.controller.js
+++ b/client/app/admin/controllers/admin.controller.js
@@ -1,6 +1,26 @@
 'use strict';
 
 angular.module('ldrWebApp')
+    /**
+     * @ngdoc controller
+     * @name AdminCtrl
+     * @description admin's view main controller
+     * @requires $state
+     * @requires $scope
+     * @requires LxDialogService
+     * @requires LxNotificationService
+     * @requires Pile
+     * @requires HelperService
+     * @requires $filter
+     * @requires $q
+     * @requires User
+     * @requires $translate
+     * @requires responseHandler
+     * @property {Object} state - current state object
+     * @property {Object} datepicker - datepicker's information
+     * @property {Boolean} clickable1 - calendar opened flag
+     * @property {Boolean} clickable2 - calendar opened flag
+     */
     .controller('AdminCtrl', ['$state', '$scope', 'LxDialogService', 'LxNotificationService', 'Pile', 'HelperService',
         '$filter', '$q', 'User', '$translate', 'responseHandler',
         function ($state, $scope, LxDialogService, LxNotificationService, Pile, HelperService,
@@ -15,13 +35,22 @@ angular.module('ldrWebApp')
                 LxDialogService.open(dialogId);
             };
 
+            /**
+             * @ngdoc
+             * @name AdminCtrl#getUsersCSV
+             * @methodOf AdminCtrl
+             * @example
+             * 
+ * @description + * formats stats, inserts header and all data + * @returns {Promise} Resolves to an empty response/error + */ $scope.getUsersCSV = function () { var deferred = $q.defer(); User.getUsersStatistics().$promise.then(function (resp) { var stats = responseHandler.getData(resp); - //format stats var formatted = []; - //first, insert the header formatted.push({ email: 'Email', county: 'County', @@ -30,7 +59,6 @@ angular.module('ldrWebApp') role: 'Role', created_at: 'Created at' }); - //then insert all data for (var i = 0; i < stats.length; i++) { formatted.push({ email: stats[i].email, @@ -46,6 +74,17 @@ angular.module('ldrWebApp') return deferred.promise; }; + /** + * @ngdoc + * @name AdminCtrl#getCountry + * @methodOf AdminCtrl + * @example + + * @description + * prepares country stats array to generate CSV from + * @returns {Array} countryArray - country stats array to generate CSV from + */ $scope.getCountry = function (countryArray) { if (!angular.isArray(countryArray)) { countryArray = [countryArray]; @@ -57,12 +96,6 @@ angular.module('ldrWebApp') return $scope.countryArray; }; - /* - *Country report creation based on datepicker validation - *see moment.js library function details - *watcher to check validations - *generate report - */ $scope.createCountryReport = function (dialogId) { LxDialogService.close(dialogId); @@ -71,6 +104,13 @@ angular.module('ldrWebApp') }; + /** + * @ngdoc + * @name AdminCtrl#$watchCollection + * @methodOf AdminCtrl + * @description + * watcher to check validations and then generate country report + */ $scope.$watchCollection('datepicker', function () { @@ -127,7 +167,13 @@ angular.module('ldrWebApp') LxDialogService.close(dialogId); }; - // evaluate calendar is open or not + /** + * @ngdoc + * @name AdminCtrl#switchBoolean + * @methodOf AdminCtrl + * @description + * check if calendar is open + */ $scope.switchBoolean = function (bool) { var calendar = document.getElementsByClassName('lx-date-picker--is-shown'); diff --git a/client/app/admin/controllers/adminStatisticsCtrl.js b/client/app/admin/controllers/adminStatisticsCtrl.js index 5fd68c5..977c7c2 100644 --- a/client/app/admin/controllers/adminStatisticsCtrl.js +++ b/client/app/admin/controllers/adminStatisticsCtrl.js @@ -1,6 +1,23 @@ 'use strict'; angular.module('ldrWebApp') + /** + * @ngdoc controller + * @name StatisticsCtrl + * @description admin statistics controller + * @requires $scope + * @requires leafletData + * @requires $timeout + * @requires Pile + * @requires LxDialogService + * @requires LxNotificationService + * @requires LxProgressService + * @requires $filter + * @requires HelperService + * @requires responseHandler + * @property {Boolean} openInfo - open info modal flag + * @property {Object} defaultStyle - layer style config object + */ .controller('StatisticsCtrl', ['$scope', 'leafletData', '$timeout', @@ -32,6 +49,13 @@ angular.module('ldrWebApp') style: $scope.defaultStyle }); + /** + * @ngdoc + * @name StatisticsCtrl#calculateMapWidth + * @methodOf StatisticsCtrl + * @description + * calculates map with + */ $scope.calculateMapWidth = function () { if (window.innerWidth) { var leftMenuWidth = (window.innerWidth / 12) * 3; @@ -51,12 +75,31 @@ angular.module('ldrWebApp') } }; + /** + * @ngdoc + * @name StatisticsCtrl#getArray + * @methodOf StatisticsCtrl + * @example + + * @description + * prepares county stats array to generate CSV from + * @returns {Array} county - country stats array to generate CSV from + */ $scope.getArray = function (countyArray) { $scope.data = [countyArray]; $scope.data.unshift(HelperService.headerOnCsv('County')); return $scope.data; }; + /** + * @ngdoc + * @name StatisticsCtrl#onMapClick + * @methodOf StatisticsCtrl + * @description + * gets statistics for clicked county, sets show info flag to true + */ function onMapClick(e) { $scope.featureSiruta = leafletPip.pointInLayer([e.latlng.lng, e.latlng.lat], gjLayer, true)[0].feature.properties.SIRUTA; $scope.featureName = leafletPip.pointInLayer([e.latlng.lng, e.latlng.lat], gjLayer, true)[0].feature.properties.NAME; @@ -72,6 +115,13 @@ angular.module('ldrWebApp') } } + /** + * @ngdoc + * @name StatisticsCtrl#highlightFeature + * @methodOf StatisticsCtrl + * @description + * sets style for highlighted county + */ function highlightFeature(e) { var layer = e.target; layer.setStyle({ @@ -87,6 +137,13 @@ angular.module('ldrWebApp') gjLayer.resetStyle(e.target); } + /** + * @ngdoc + * @name StatisticsCtrl#onEachFeature + * @methodOf StatisticsCtrl + * @description + * sets options for each layer + */ function onEachFeature(polygon, layer) { layer.on({ click: onMapClick, @@ -96,6 +153,14 @@ angular.module('ldrWebApp') }); } + /** + * @ngdoc + * @name StatisticsCtrl#calculateMapStatisticsResolution + * @methodOf StatisticsCtrl + * @description + * calculates statistics map height + * @returns {Integer} statisticsMap - statistics map height + */ $scope.calculateMapStatisticsResolution = function () { if (window.innerWidth > 1023) { $scope.statisticsMap = window.innerHeight - 150 - 40; @@ -105,8 +170,13 @@ angular.module('ldrWebApp') return $scope.statisticsMap; }; - //CREATE leaflet map for statistics - + /** + * @ngdoc + * @name StatisticsCtrl#createMap + * @methodOf StatisticsCtrl + * @description + * creates leaflet map object for statistics, mapbox token is required + */ self.createMap = function () { return { defaults: { @@ -127,7 +197,7 @@ angular.module('ldrWebApp') baselayers: { xyz: { name: 'OpenStreetMap (XYZ)', - url: 'https://api.mapbox.com/v4/mapbox.streets-basic/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoicXVhbGl0YW5jZSIsImEiOiJkYTY0ODQzMGM1MDFlOGVhM2FiZjc3M2ZkYmQ2MjA0NSJ9.3bxLXwcDaG_V0H3reJzLBg', + url: 'https://api.mapbox.com/v4/mapbox.streets-basic/{z}/{x}/{y}.png?access_token=*********', type: 'xyz' } }, @@ -136,11 +206,18 @@ angular.module('ldrWebApp') }; }; + /** + * @ngdoc + * @name StatisticsCtrl#centerMap + * @methodOf StatisticsCtrl + * @description + * map is repositioned on Roumania's center + */ $scope.centerMap = function () { angular.extend($scope.map, { center: { zoom: 7, - lat: 45.834402, //middle of romania + lat: 45.834402, lng: 24.996989 } }); diff --git a/client/app/admin/controllers/adminUserCtrl.js b/client/app/admin/controllers/adminUserCtrl.js index 859dabe..043a98d 100644 --- a/client/app/admin/controllers/adminUserCtrl.js +++ b/client/app/admin/controllers/adminUserCtrl.js @@ -1,5 +1,15 @@ 'use strict'; - +/** + * @ngdoc controller + * @name AdminUserCtrl + * @description admin user controller + * @requires $scope + * @requires User + * @requires $state + * @requires Auth + * @requires responseHandler + * @property {Boolean} user - selected user object + */ angular.module('ldrWebApp') .controller('AdminUserCtrl', ['$scope', 'User', diff --git a/client/app/admin/controllers/adminUsersCtrl.js b/client/app/admin/controllers/adminUsersCtrl.js index f9479a6..d34840a 100644 --- a/client/app/admin/controllers/adminUsersCtrl.js +++ b/client/app/admin/controllers/adminUsersCtrl.js @@ -1,6 +1,32 @@ 'use strict'; angular.module('ldrWebApp') + /** + * @ngdoc controller + * @name AdminUsersCtrl + * @description admin statistics controller + * @requires $scope + * @requires User + * @requires CountyService + * @requires CountryService + * @requires LxDialogService + * @requires LxNotificationService + * @requires HelperService + * @requires Auth + * @requires $state + * @requires $translate + * @requires responseHandler + * @property {Object} currentUser - current user object + * @property {Object} supervisor - supervisor to create object + * @property {Object} data - data to show + * @property {Boolean} disableBtn - filter button flag + * @property {Object} user - user to search object + * @property {Object} all_counties - all counties object + * @property {Object} all_countries - all countries object + * @property {Object} state - current state object + * @property {Object} allUserRoles - all roles object + * @property {Object} config_obj - params object + */ .controller('AdminUsersCtrl', [ '$scope', 'User', @@ -89,15 +115,23 @@ angular.module('ldrWebApp') }; /** + * @ngdoc + * @name AdminUsersCtrl#$watch + * @methodOf AdminUsersCtrl * @description watch for changes on the config page that may be triggered when press on - * the page skipper select and then get the according page data - * @return {Undefined} + * the page skipper select and then gets the according page data */ $scope.$watch('config_obj.page', function () { $scope.getUsers(); }); - //get users and pagination info + /** + * @ngdoc + * @name AdminUsersCtrl#getUsers + * @methodOf AdminUsersCtrl + * @description + * gets users and pagination info + */ $scope.getUsers = function () { User.all($scope.config_obj, function (data, headers) { $scope.data.users = responseHandler.getData(data); @@ -106,16 +140,27 @@ angular.module('ldrWebApp') }); }; - //function to reset filters + /** + * @ngdoc + * @name AdminUsersCtrl#resetFilter + * @methodOf AdminUsersCtrl + * @description + * resets filters + */ $scope.resetFilter = function (property, fetchResults) { $scope.config_obj[property] = null; if (fetchResults) $scope.filter(null, null, true); }; - // updates config object & fetches piles if required - // fetchresults get users and reset the page counter - // gets property to filter by and the value, and modify the config object and do the query + /** + * @ngdoc + * @name AdminUsersCtrl#filter + * @methodOf AdminUsersCtrl + * @description + * updates config object & fetches piles if required, fetch results get users and reset the page counter, + * gets property to filter by and the value, and modify the config object and do the query + */ $scope.filter = function (property, value, fetchResults) { if (property) { $scope.config_obj[property] = (value) ? value : @@ -134,9 +179,10 @@ angular.module('ldrWebApp') }; /** - * Enable/disable filter and reset filter buttons - * @name enableFilterBtn - * @return {undefined} + * @ngdoc + * @name AdminUsersCtrl#enableFilterBtn + * @methodOf AdminUsersCtrl + * @description enable/disable filter and reset filter buttons */ $scope.enableFilterBtn = function () { $scope.clearFilterEmptyVals(); @@ -150,9 +196,10 @@ angular.module('ldrWebApp') }; /** - * Clear the filters with empty values - * @name clearFilterEmptyVals - * @return {undefined} + * @ngdoc + * @name AdminUsersCtrl#clearFilterEmptyVals + * @methodOf AdminUsersCtrl + * @description clear the filters with empty values */ $scope.clearFilterEmptyVals = function () { angular.forEach($scope.user, function (value, key) { @@ -164,9 +211,10 @@ angular.module('ldrWebApp') }; /** - * generate filters from the user selections - * @name filterUsers - * @return {undefined} + * @ngdoc + * @name AdminUsersCtrl#filterUsers + * @methodOf AdminUsersCtrl + * @description generate filters from the user selections */ $scope.filterUsers = function () { var index = 0; @@ -182,19 +230,10 @@ angular.module('ldrWebApp') }); }; - /** - * - * @name setFetchResults - * @param index - * @returns {boolean} - */ $scope.setFetchResults = function (index) { return (Object.keys($scope.user).length === index); }; - /** - * - */ $scope.resetUserFilters = function () { $scope.disableBtn = true; angular.forEach($scope.user, function (value, key) { @@ -212,7 +251,6 @@ angular.module('ldrWebApp') } }; - //reset page on pagination $scope.resetPage = function () { $scope.config_obj.page = 1; }; @@ -227,9 +265,6 @@ angular.module('ldrWebApp') $scope.getUsers(); }; - /* - Modal functions start from here - */ $scope.alertAdmin = function (dialogId, user) { $scope.temp_user = user; LxDialogService.open(dialogId); @@ -251,7 +286,18 @@ angular.module('ldrWebApp') LxNotificationService.info($translate.instant('views.usersList.noChanges')); }; - //creates a supervisor after validation and sync it on the list until refresh + /** + * @ngdoc + * @name AdminUsersCtrl#createSupervisor + * @methodOf AdminUsersCtrl + * @param {Object} dialogId - new supervisor dialog id + * @param {Object} form - new supervisor form object + * @example + *

+             * @description
+             * creates new supervisor, updates the supervisors list
+             */
             $scope.createSupervisor = function (dialogId, form) {
                 $scope.submitted = true;
                 if (form.$valid) {
@@ -268,6 +314,19 @@ angular.module('ldrWebApp')
                 }
             };
 
+            /**
+             * @ngdoc
+             * @name AdminUsersCtrl#makeUserInactive
+             * @methodOf AdminUsersCtrl
+             * @param {Object} user - user to make inactive object
+             * @param {Object} dialogId - dialog id
+             * @example
+             * 
+ * @description + * makes user inactive + */ $scope.makeUserInactive = function (user, dialogId) { user.role = 'inactive'; User.updateUser({id: user._id}, {status: user.role}).$promise.then(function (data) { @@ -280,8 +339,5 @@ angular.module('ldrWebApp') LxNotificationService.info($translate.instant('generic.errorSaving')); }); }; - /* - Modal functions end here - */ $scope.init(); }]); diff --git a/client/app/admin/controllers/editUserCtrl.js b/client/app/admin/controllers/editUserCtrl.js index 2070ac5..59542b1 100644 --- a/client/app/admin/controllers/editUserCtrl.js +++ b/client/app/admin/controllers/editUserCtrl.js @@ -1,6 +1,25 @@ 'use strict'; angular.module('ldrWebApp') + /** + * @ngdoc controller + * @name AdminEditUserCtrl + * @description admin edit user controller + * @requires $scope + * @requires User + * @requires $state + * @requires HelperService + * @requires LxNotificationService + * @requires Auth + * @requires $translate + * @requires responseHandler + * @property {Object} currentUser - current user object + * @property {Object} roles - user's all roles object + * @property {Object} statuses - user's all statuses object + * @property {Object} user - user to edit object + * @property {Object} selectedStatus - selected status object + * @property {Object} selectedRole - selected role object + */ .controller('AdminEditUserCtrl', ['$scope', 'User', '$state', @@ -33,6 +52,12 @@ angular.module('ldrWebApp') } }); + /** + * @ngdoc + * @name AdminEditUserCtrl#resend + * @methodOf AdminEditUserCtrl + * @description resends activation email to specified user + */ $scope.resend = function () { LxNotificationService.confirm($translate.instant('views.editSingleUser.resend'), @@ -51,6 +76,13 @@ angular.module('ldrWebApp') }; + /** + * @ngdoc + * @name AdminEditUserCtrl#updateUser + * @methodOf AdminEditUserCtrl + * @param {Object} form - user to update form object + * @description updates specified user + */ $scope.updateUser = function (form) { $scope.submitted = true; @@ -66,10 +98,11 @@ angular.module('ldrWebApp') }; /** - * @name refreshUser + * @ngdoc + * @name AdminEditUserCtrl#refreshUser + * @methodOf AdminEditUserCtrl * @description - * Changes the user's status/role, depending on the entity param - * + * changes the user's status/role, depending on the entity param * @param {Object} item - the selected item from dropdown * @param {string} entity - the type of the selected item (can be 'status' or 'role') */ From 090fcc661ed6ccec4062d039b435a41fc74c9205 Mon Sep 17 00:00:00 2001 From: Gabriel Muscalu Date: Thu, 24 Nov 2016 11:30:25 +0200 Subject: [PATCH 04/28] documentation - contact module --- client/app/contact/contact.controller.js | 79 +++++++++++++++--------- 1 file changed, 51 insertions(+), 28 deletions(-) diff --git a/client/app/contact/contact.controller.js b/client/app/contact/contact.controller.js index 7d298b7..43ad74c 100644 --- a/client/app/contact/contact.controller.js +++ b/client/app/contact/contact.controller.js @@ -1,37 +1,60 @@ 'use strict'; angular.module('ldrWebApp') + /** + * @ngdoc controller + * @name ContactCtrl + * @description contact page controller + * @requires $scope + * @requires Auth + * @requires ContactService + * @requires LxNotificationService + * @requires $translate + * @requires responseHandler + * @property {Object} contact - contact info object + * @property {Boolean} messageSending - sending message in progress flag + */ .controller('ContactCtrl', ['$scope', 'Auth', 'ContactService', 'LxNotificationService', '$translate', 'responseHandler', function ($scope, Auth, ContactService, LxNotificationService, $translate, responseHandler) { - $scope.init = function () { - Auth.getCurrentUser().$promise.then(function success(data) { - $scope.contact = _.pick(responseHandler.getData(data), ['first_name', 'last_name', 'email']); - }); - }; - - $scope.init(); - $scope.messageSending = false; - $scope.sendMessage = function (form) { - if (form.$valid) { - $scope.messageSending = true; - ContactService.create({ - first_name: form.first_name.$viewValue, - last_name: form.last_name.$viewValue, - email: form.email.$viewValue, - subject: form.subject.$viewValue, - message: form.message.$viewValue - }).$promise.then(function (resp) { - $scope.messageSending = false; - if (resp.success) { - LxNotificationService.alert($translate.instant('generic.notificationTitle'), - $translate.instant('generic.notificationMessage'), - $translate.instant('generic.notificationOKButton'), - function () {}); - } + $scope.init = function () { + Auth.getCurrentUser().$promise.then(function success(data) { + $scope.contact = _.pick(responseHandler.getData(data), ['first_name', 'last_name', 'email']); }); - } - }; + }; + + $scope.init(); + $scope.messageSending = false; + + /** + * @ngdoc + * @name ContactCtrl#sendMessage + * @methodOf ContactCtrl + * @description + * sends email to contact person with given message + * @param {Object} form - send message form object + */ + $scope.sendMessage = function (form) { + if (form.$valid) { + $scope.messageSending = true; + ContactService.create({ + first_name: form.first_name.$viewValue, + last_name: form.last_name.$viewValue, + email: form.email.$viewValue, + subject: form.subject.$viewValue, + message: form.message.$viewValue + }).$promise.then(function (resp) { + $scope.messageSending = false; + if (resp.success) { + LxNotificationService.alert($translate.instant('generic.notificationTitle'), + $translate.instant('generic.notificationMessage'), + $translate.instant('generic.notificationOKButton'), + function () { + }); + } + }); + } + }; - }]); + }]); From 17385c4f61fabe44a07366d4c2fd74d6d01b0466 Mon Sep 17 00:00:00 2001 From: Gabriel Muscalu Date: Thu, 24 Nov 2016 14:29:13 +0200 Subject: [PATCH 05/28] documentation - dashboard module --- client/app/dashboard/dashboard.controller.js | 118 ++++++++++++++++--- client/app/dashboard/dashboard.directive.js | 7 ++ 2 files changed, 110 insertions(+), 15 deletions(-) diff --git a/client/app/dashboard/dashboard.controller.js b/client/app/dashboard/dashboard.controller.js index b6b8f9d..6508484 100644 --- a/client/app/dashboard/dashboard.controller.js +++ b/client/app/dashboard/dashboard.controller.js @@ -1,6 +1,27 @@ 'use strict'; angular.module('ldrWebApp') + /** + * @ngdoc controller + * @name DashboardCtrl + * @description dashboard controller + * @requires $scope + * @requires Pile + * @requires Auth + * @requires HelperService + * @requires CountyService + * @requires $state + * @requires $translate + * @requires responseHandler + * @requires CityService + * @property {Object} counties - all counties object + * @property {Object} all_cities - all cities object + * @property {Object} statuses - pile statuses object + * @property {Object} data - data to show object + * @property {Object} config_obj - query config object + * @property {Function} isAdmin - auth function to determine is user has admin role + * @property {Function} hasRole - auth function to compare with given role + */ .controller('DashboardCtrl', [ '$scope', 'Pile', @@ -45,7 +66,6 @@ angular.module('ldrWebApp') $scope.data = {}; - //query config object $scope.config_obj = { page: 1, skip: 15, @@ -67,12 +87,24 @@ angular.module('ldrWebApp') $scope.isAdmin = Auth.isAdmin; $scope.hasRole = Auth.hasRole; + /** + * @ngdoc + * @name DashboardCtrl#goToPile + * @methodOf DashboardCtrl + * @param {object} obj - pile object + * @description redirects to pile view + */ $scope.goToPile = function (obj) { var url = $state.href($scope.hasRole('supervisor') ? 'app.map.pile.edit' : 'app.map.pile.view', obj); window.open(url, '_blank'); }; - // use case function to display county by user role + /** + * @ngdoc + * @name DashboardCtrl#displayDefaultCounty + * @methodOf DashboardCtrl + * @description displays user county or all acounties for admin + */ $scope.displayDefaultCounty = function () { if ($scope.user.role === 'admin') { return $scope.counties[0]; @@ -86,9 +118,11 @@ angular.module('ldrWebApp') }; /** + * @ngdoc + * @name DashboardCtrl#$watch + * @methodOf DashboardCtrl * @description watch for changes on the config page that may be triggered when press on - * the page skipper select and then get the according page data - * @return {Undefined} + * the page skipper select and then gets the according page data */ $scope.$watch('config_obj.page', function () { $scope.getPiles(); @@ -99,6 +133,14 @@ angular.module('ldrWebApp') var filter = {}; var sort = {}; + /** + * @ngdoc + * @name DashboardCtrl#applySort + * @methodOf DashboardCtrl + * @description + * calls refresh filter function after setting sort object + * @param {String} sort_by - user property to sort by + */ $scope.applySort = function (sort_by) { if (sort_by) { if (sort.by === sort_by) { @@ -114,6 +156,17 @@ angular.module('ldrWebApp') } }; + /** + * @ngdoc + * @name DashboardCtrl#addFilter + * @methodOf DashboardCtrl + * @example
+ * @description + * adds filter from select values + * @param {String} filter_name - filter name + * @param {String} filter_value - filter value + */ $scope.addFilter = function (filter_name, filter_value) { if (filter_name && filter_name !== 'city') { if (filter_name === 'county') { @@ -127,6 +180,14 @@ angular.module('ldrWebApp') } }; + /** + * @ngdoc + * @name DashboardCtrl#removeFilter + * @methodOf DashboardCtrl + * @description + * removes specifie filter from filters array + * @param {String} filter_name - filter name + */ $scope.removeFilter = function (filter_name) { if (filter_name) { filter[filter_name] = null; @@ -135,9 +196,11 @@ angular.module('ldrWebApp') }; /** - * - * @param filter_value - * @return {undefined} + * @ngdoc + * @name DashboardCtrl#applyCityFilter + * @methodOf DashboardCtrl + * @param {String} filter_value - filter value + * @description redirects to pile view */ $scope.applyCityFilter = function (filter_value) { if (filter_value._id === 0) { @@ -148,6 +211,13 @@ angular.module('ldrWebApp') refreshFilters(); }; + /** + * @ngdoc + * @name DashboardCtrl#displayFilterValue + * @methodOf DashboardCtrl + * @param {String} filter_name - filter name + * @description gets translation of filter name + */ $scope.displayFilterValue = function (filter_name) { if (filter_name === 'status') { for (var i = 0; i < $scope.statuses.length; i++) { @@ -158,21 +228,28 @@ angular.module('ldrWebApp') return ''; }; + /** + * @ngdoc + * @name DashboardCtrl#refreshFilters + * @methodOf DashboardCtrl + * @description updates config object & fetches piles if required + */ function refreshFilters() { $scope.config_obj.sort = sort; $scope.config_obj.filter = filter; $scope.getPiles(); } - // updates config object & fetches piles if required - // fetchresults get piles and reset the page counter - // gets property to filter by and the value, and modify the config object and do the query - //same as adminUsers ctrl - $scope.resetPage = function () { $scope.config_obj.page = 1; }; + /** + * @ngdoc + * @name DashboardCtrl#getPiles + * @methodOf DashboardCtrl + * @description gets required piles + */ $scope.getPiles = function () { Pile.query($scope.config_obj, function (data, headers) { $scope.data.piles = responseHandler.getData(data); @@ -191,15 +268,27 @@ angular.module('ldrWebApp') $scope.getPiles(); }; + /** + * @ngdoc + * @name DashboardCtrl#goToContributions + * @methodOf DashboardCtrl + * @description gets contribute piles + */ $scope.goToContributions = function () { - if (!$scope.config_obj.contributions) { //to not make a call if same button is pressed + if (!$scope.config_obj.contributions) { $scope.config_obj.contributions = true; $scope.getPiles(); } }; + /** + * @ngdoc + * @name DashboardCtrl#goToPiles + * @methodOf DashboardCtrl + * @description gets reported piles + */ $scope.goToPiles = function () { - if ($scope.config_obj.contributions) { //to not make a call if same button is pressed + if ($scope.config_obj.contributions) { $scope.config_obj.contributions = false; $scope.getPiles(); } @@ -209,7 +298,6 @@ angular.module('ldrWebApp') * @ngdoc method * @name DashboardCtrl#populateCity * @methodOf DashboardCtrl - * @return {undefined} * @description * populate city select */ diff --git a/client/app/dashboard/dashboard.directive.js b/client/app/dashboard/dashboard.directive.js index 71562e2..78ca02a 100644 --- a/client/app/dashboard/dashboard.directive.js +++ b/client/app/dashboard/dashboard.directive.js @@ -1,4 +1,11 @@ 'use strict'; +/** + * @ngdoc directive + * @name adStopEvent + * @description disables propagation for click event on div + * @example + *
div ad-stop-event>
+ */ angular.module('ldrWebApp').directive('adStopEvent', function () { return { restrict: 'A', From e172686bfcfe6b05e0b22eb6e1a588247f36ddc4 Mon Sep 17 00:00:00 2001 From: Gabriel Muscalu Date: Thu, 24 Nov 2016 14:37:04 +0200 Subject: [PATCH 06/28] documentation - help module --- client/app/help/help.controller.js | 10 ++++++++++ client/app/help/help.directive.js | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/client/app/help/help.controller.js b/client/app/help/help.controller.js index 8e68a8b..fb33591 100644 --- a/client/app/help/help.controller.js +++ b/client/app/help/help.controller.js @@ -1,6 +1,16 @@ 'use strict'; angular.module('ldrWebApp') + /** + * @ngdoc controller + * @name HelpCtrl + * @description help page controller + * @requires $scope + * @requires Auth + * @property {String} message - hello message + * @property {String} helperLanguage - current user language + + */ .controller('HelpCtrl', function ($scope, Auth) { $scope.message = 'Hello'; $scope.helperLanguage = Auth.getCurrentUser().language; diff --git a/client/app/help/help.directive.js b/client/app/help/help.directive.js index 1228eea..d2cf594 100644 --- a/client/app/help/help.directive.js +++ b/client/app/help/help.directive.js @@ -1,3 +1,11 @@ +/** + * @ngdoc directive + * @name bindHelpScreen + * @description binds help screen popup to specified element + * @example + *
+ */ angular.module('ldrWebApp').directive('bindHelpScreen', ['Help', 'LxNotificationService', '$translate', function (Help, LxNotificationService, $translate) { return { From c265c207ddfdc11d1e7ea73243026c1a3bcee894 Mon Sep 17 00:00:00 2001 From: Gabriel Muscalu Date: Thu, 24 Nov 2016 15:58:58 +0200 Subject: [PATCH 07/28] documentation - issues module --- client/app/help/help.controller.js | 1 - .../IssuesListCtrl.controller.js | 33 ++++++++++++++++--- client/app/improve/improve.controller.js | 28 ++++++++++++++++ 3 files changed, 56 insertions(+), 6 deletions(-) diff --git a/client/app/help/help.controller.js b/client/app/help/help.controller.js index fb33591..b820af3 100644 --- a/client/app/help/help.controller.js +++ b/client/app/help/help.controller.js @@ -9,7 +9,6 @@ angular.module('ldrWebApp') * @requires Auth * @property {String} message - hello message * @property {String} helperLanguage - current user language - */ .controller('HelpCtrl', function ($scope, Auth) { $scope.message = 'Hello'; diff --git a/client/app/improve/IssuesListCtrl/IssuesListCtrl.controller.js b/client/app/improve/IssuesListCtrl/IssuesListCtrl.controller.js index f1fa894..07127e4 100644 --- a/client/app/improve/IssuesListCtrl/IssuesListCtrl.controller.js +++ b/client/app/improve/IssuesListCtrl/IssuesListCtrl.controller.js @@ -1,6 +1,20 @@ 'use strict'; angular.module('ldrWebApp') + /** + * @ngdoc controller + * @name IssuesListCtrl + * @description issues page controller + * @requires $scope + * @requires Issues + * @requires LxNotificationService + * @requires LxDialogService + * @requires $translate + * @requires responseHandler + * @property {Object} range - query start/end date objects + * @property {Object} endDateLimit - end date moment object + * @property {Object} pagination - query pagination object + */ .controller('IssuesListCtrl', [ '$scope', 'Issues', @@ -33,6 +47,12 @@ angular.module('ldrWebApp') $scope.pagination.page++; }; + /** + * @ngdoc + * @name IssuesListCtrl#$watchGroup + * @methodOf IssuesListCtrl + * @description watch for changes on pagination and selected start/end date and gets requested issues + */ $scope.$watchGroup(['pagination.page', 'range.date_start', 'range.date_end'], function () { Issues.query({ page: $scope.pagination.page, @@ -67,6 +87,14 @@ angular.module('ldrWebApp') LxDialogService.open(dialogId); }; + /** + * @ngdoc + * @name IssuesListCtrl#sendErrors + * @methodOf IssuesListCtrl + * @param {Object} form - issue form object + * @param {Object} dialogId - dialog ids + * @description sends issues in range to specified email + */ $scope.sendErrors = function (form, dialogId) { if (form.$valid) { @@ -83,9 +111,4 @@ angular.module('ldrWebApp') } }; - - $scope.filterByRange = function () { - - }; - }]); diff --git a/client/app/improve/improve.controller.js b/client/app/improve/improve.controller.js index 8462ddb..359aa2f 100644 --- a/client/app/improve/improve.controller.js +++ b/client/app/improve/improve.controller.js @@ -1,6 +1,18 @@ 'use strict'; angular.module('ldrWebApp') + /** + * @ngdoc controller + * @name ImproveCtrl + * @description improve page controller + * @requires $scope + * @requires Issues + * @requires LxNotificationService + * @requires LxDialogService + * @requires $translate + * @property {Object} issue - issue to report objects + * @property {String} currentLang - current language + */ .controller('ImproveCtrl', [ '$scope', 'Issues', @@ -14,6 +26,14 @@ angular.module('ldrWebApp') }; var originalIssue = angular.copy($scope.issue); $scope.currentLang = $translate.use(); + + /** + * @ngdoc method + * @name ImproveCtrl#sendIssue + * @methodOf ImproveCtrl + * @description + * creates entered issue + */ $scope.sendIssue = function (form, dialogId) { if (form.$valid) { Issues.create($scope.issue).$promise.then(function success() { @@ -23,6 +43,14 @@ angular.module('ldrWebApp') LxNotificationService.success($translate.instant('views.report.success')); } }; + + /** + * @ngdoc method + * @name ImproveCtrl#resetForm + * @methodOf ImproveCtrl + * @description + * clears form + */ $scope.resetForm = function (form) { $scope.issue = null; $scope.issue = angular.copy(originalIssue); From 3f858119d01132b247f851a9d684e73f3b17e733 Mon Sep 17 00:00:00 2001 From: Gabriel Muscalu Date: Thu, 24 Nov 2016 16:09:55 +0200 Subject: [PATCH 08/28] documentation - main module --- client/app/main/main.controller.js | 55 ++++++++++++++++++++---------- client/app/main/main.directive.js | 14 ++++++++ 2 files changed, 51 insertions(+), 18 deletions(-) diff --git a/client/app/main/main.controller.js b/client/app/main/main.controller.js index d822034..777dac8 100644 --- a/client/app/main/main.controller.js +++ b/client/app/main/main.controller.js @@ -1,24 +1,43 @@ 'use strict'; angular.module('ldrWebApp') + /** + * @ngdoc controller + * @name MainCtrl + * @description main controller + * @requires Auth + * @requires $state + * @requires LxNotificationService + * @requires $scope + * @requires ContactService + * @requires $translate + */ .controller('MainCtrl', ['Auth', '$state', 'LxNotificationService', '$scope', 'ContactService', '$translate', function (Auth, $state, LxNotificationService, $scope, ContactService, $translate) { - $scope.contact = function (form) { - if (form.$valid) { - ContactService.create({ - first_name: form.first_name.$viewValue, - last_name: form.last_name.$viewValue, - email: form.email.$viewValue, - message: form.message.$viewValue - }).$promise.then(function (resp) { - if (resp.success) { - LxNotificationService.alert($translate.instant('generic.notificationTitle'), - $translate.instant('generic.notificationMessage'), - $translate.instant('generic.notificationOKButton'), - function () {}); - } - }); - } - }; - }]); + /** + * @ngdoc + * @name MainCtrl#contact + * @methodOf MainCtrl + * @param {Object} form - contact us form object + * @description creates contact us note + */ + $scope.contact = function (form) { + if (form.$valid) { + ContactService.create({ + first_name: form.first_name.$viewValue, + last_name: form.last_name.$viewValue, + email: form.email.$viewValue, + message: form.message.$viewValue + }).$promise.then(function (resp) { + if (resp.success) { + LxNotificationService.alert($translate.instant('generic.notificationTitle'), + $translate.instant('generic.notificationMessage'), + $translate.instant('generic.notificationOKButton'), + function () { + }); + } + }); + } + }; + }]); diff --git a/client/app/main/main.directive.js b/client/app/main/main.directive.js index a23e3ee..d483bb0 100644 --- a/client/app/main/main.directive.js +++ b/client/app/main/main.directive.js @@ -1,6 +1,13 @@ 'use strict'; angular.module('ldrWebApp') + /** + * @ngdoc directive + * @name emailMatch + * @description sets entered email validity + * @example + *
+ */ .directive('emailMatch', [function () { return { require: 'ngModel', @@ -13,6 +20,13 @@ angular.module('ldrWebApp') } }; }]) + /** + * @ngdoc directive + * @name ldrOnePage + * @description adds scroll animation on main page + * @example + *
+ */ .directive('ldrOnePage', [function () { return { restrict: 'A', From c16202aea8bb5958678c0de122d8b1a3cc0eb516 Mon Sep 17 00:00:00 2001 From: Gabriel Muscalu Date: Thu, 24 Nov 2016 19:21:56 +0200 Subject: [PATCH 09/28] documentation - map controllers --- .../app/admin/controllers/adminUsersCtrl.js | 4 +- .../IssuesListCtrl.controller.js | 2 +- client/app/map/controllers/CreatePileCtrl.js | 97 +++++++++++++++++ client/app/map/controllers/EditPileCtrl.js | 103 ++++++++++++++++++ client/app/map/controllers/MapCtrl.js | 67 +++++++++++- .../map/controllers/ViewPileDetailsCtrl.js | 59 ++++++++-- .../app/map/controllers/ViewPileOnMapCtrl.js | 50 ++++++++- 7 files changed, 369 insertions(+), 13 deletions(-) diff --git a/client/app/admin/controllers/adminUsersCtrl.js b/client/app/admin/controllers/adminUsersCtrl.js index d34840a..34d150d 100644 --- a/client/app/admin/controllers/adminUsersCtrl.js +++ b/client/app/admin/controllers/adminUsersCtrl.js @@ -290,7 +290,7 @@ angular.module('ldrWebApp') * @ngdoc * @name AdminUsersCtrl#createSupervisor * @methodOf AdminUsersCtrl - * @param {Object} dialogId - new supervisor dialog id + * @param {String} dialogId - new supervisor dialog id * @param {Object} form - new supervisor form object * @example *