diff --git a/backend/report.js b/backend/report.js index 1b058679..b125d734 100644 --- a/backend/report.js +++ b/backend/report.js @@ -174,14 +174,18 @@ exports.restGetFilterValues = function(req, res, next) { var filterValues = []; fillUserValues(companyId, filterValues, next, - function() { + function () { fillProjectValues(companyId, filterValues, next, - function() { - fillRoleValues(companyId, filterValues, - function() { - res.json(filterValues); - log.debug('-REST result: Report filters returned. Company id: %s', - companyId.toHexString()); + function () { + fillLogValues(filterValues, next, + function () { + fillRoleValues(companyId, filterValues, + function () { + res.json(filterValues); + log.debug('-REST result: Report filters returned. Company id: %s', + companyId.toHexString()); + } + ); } ); } @@ -440,6 +444,19 @@ function fillProjectValues(companyId, filterValues, next, callback) { }); } +function fillLogValues(filterValues, next, callback) { + var logs = db.timelogCollection(); + logs.find({}) + .toArray(function (err, dblogs) { + if(!err) { + filterValues.push({field:'timelogs', value: dblogs}); + callback(); + } else { + next(err); + } + }); +} + function fillRoleValues(companyId, filterValues, callback) { filterValues.push({field:'role', value: company.defaultPositions}); callback(); diff --git a/frontend/components/dropdownFilter/dropdownFilter.js b/frontend/components/dropdownFilter/dropdownFilter.js index 44dcabfd..21502d47 100644 --- a/frontend/components/dropdownFilter/dropdownFilter.js +++ b/frontend/components/dropdownFilter/dropdownFilter.js @@ -65,7 +65,7 @@ angular.module('mifortTimesheet') scope.projectFilterContainsSubstring = function (object, filter) { var re = new RegExp(filter, 'ig'); - return re.test(object.name.role || object.name.displayName || object.name); + return re.test(object.name.comment || object.name.role || object.name.displayName || object.name); }; }, diff --git a/frontend/report/report.css b/frontend/report/report.css index 404a3883..a9ed9250 100644 --- a/frontend/report/report.css +++ b/frontend/report/report.css @@ -18,7 +18,7 @@ padding: 25px 27px 30px 27px; font-size: 1.6rem; } .report-wrapper .popover { - width: auto; + width: 300px; border-color: #a0a0a0; box-shadow: none; display: inline-block; @@ -109,6 +109,15 @@ .ui-grid-canvas > div:last-child { border-bottom: 0; } +/*.ui-grid-filter-container input[type="text"].ui-grid-filter-input-0 {*/ + /*height: 23px;*/ + /*margin-left: 60%;*/ + /*margin-top: -10px;*/ +/*}*/ + +/*.ui-grid-filter-container .ui-grid-icon-cancel {*/ + /*margin-right: -139px;*/ +/*}*/ .date-range-picker { display: inline-block; } diff --git a/frontend/report/reportController.js b/frontend/report/reportController.js index 0dd87dc5..562e9c4e 100644 --- a/frontend/report/reportController.js +++ b/frontend/report/reportController.js @@ -302,13 +302,16 @@ angular.module('mifortTimesheet.report', ['ngRoute', 'constants']) case 'users': filterToPush.field = 'userId'; break; + case 'timelogs': + filterToPush.field = 'comment'; + break; } var checkedFilters = _.where(filter.value, {isChecked: true}), usedFilterIndex = _.findIndex(usedFilters, {field: filterToPush.field}); filterToPush.value = checkedFilters.map(function (checkedFilter) { - return checkedFilter.name._id || checkedFilter.name; + return checkedFilter.name.comment || checkedFilter.name._id || checkedFilter.name; }); if (filterToPush.value.length && usedFilterIndex == -1) { diff --git a/frontend/report/reportService.js b/frontend/report/reportService.js index d2722494..705f1e74 100644 --- a/frontend/report/reportService.js +++ b/frontend/report/reportService.js @@ -128,10 +128,7 @@ angular.module('mifortTimesheet.report').factory('reportService', field: 'comment', enableColumnResizing: true, enableColumnMenu: false, - enableSorting: false, - enableFiltering: false, - filterHeaderTemplate: '
', - cellTemplate: '' + headerCellTemplate: self.getHeaderTemplate('') }, comments: { field: 'comments', diff --git a/frontend/report/reportView.html b/frontend/report/reportView.html index 022c1f98..a22bff85 100644 --- a/frontend/report/reportView.html +++ b/frontend/report/reportView.html @@ -101,7 +101,7 @@ @@ -135,6 +135,22 @@
Archived Project
+
+
Comments
+ +
+ + +
+
+ +
Archived Project