Commit a1fcd40a authored by Sam Man's avatar Sam Man

repository synced with latest changes made to http://gitlabreports.cosango.com/

parent 19757b98
Pipeline #35685732 failed with stages
in 1 minute and 16 seconds
...@@ -4,13 +4,7 @@ ...@@ -4,13 +4,7 @@
function main($rootScope, $scope, $mdSidenav, gitlab, auth) { function main($rootScope, $scope, $mdSidenav, gitlab, auth) {
$scope.$watch('project', function () { $scope.$watch('project', function () {
$scope.labels = null; $scope.resetFilter();
$scope.milestone = null;
$scope.state = null;
localStorage.removeItem('labels');
localStorage.removeItem('milestone');
localStorage.removeItem('state');
if ($scope.project) { if ($scope.project) {
$scope.loadProjectLabels(); $scope.loadProjectLabels();
$scope.loadProjectMilestones(); $scope.loadProjectMilestones();
...@@ -89,9 +83,22 @@ ...@@ -89,9 +83,22 @@
$rootScope.$broadcast('local-storage-updated'); $rootScope.$broadcast('local-storage-updated');
}; };
$scope.resetFilter = function () {
$scope.labels = null;
$scope.project_labels = null;
$scope.milestone = null;
$scope.project_milestone = null;
$scope.state = 'all';
localStorage.removeItem('labels');
localStorage.removeItem('milestone');
localStorage.removeItem('state');
};
$rootScope.show_detailed_report = false;
$rootScope.show_comulative_time_estimate = true; $rootScope.show_comulative_time_estimate = true;
$rootScope.show_comulative_time_spent = true; $rootScope.show_comulative_time_spent = true;
$rootScope.show_show_logo_print = true; $rootScope.show_show_logo_print = true;
$rootScope.show_hyperlinks = true;
$rootScope.table_columns = [ $rootScope.table_columns = [
'srno', 'srno',
'iid', 'iid',
...@@ -103,6 +110,7 @@ ...@@ -103,6 +110,7 @@
'total_time_spent', 'total_time_spent',
'state' 'state'
]; ];
$scope.loadProjects(); $scope.loadProjects();
} }
......
...@@ -4,8 +4,7 @@ ...@@ -4,8 +4,7 @@
function main($rootScope, $scope, gitlab, auth) { function main($rootScope, $scope, gitlab, auth) {
$rootScope.$on('local-storage-updated', function () { $rootScope.$on('local-storage-updated', function () {
$scope.comulative_time_spent = 0; $scope.filter_milestone = localStorage.getItem('milestone');
$scope.comulative_time_estimate = 0;
$scope.loadIssues(); $scope.loadIssues();
}); });
...@@ -33,6 +32,7 @@ ...@@ -33,6 +32,7 @@
$scope.issues = gitlab.projects_issues.query( $scope.issues = gitlab.projects_issues.query(
params, params,
function () { function () {
$scope.recalculateTimeStats();
}, },
function () { function () {
auth.redirectToOauth(); auth.redirectToOauth();
...@@ -40,27 +40,17 @@ ...@@ -40,27 +40,17 @@
); );
}; };
$scope.getIssuesTimeStats = function (issue_project_id, issue_iid) { $scope.recalculateTimeStats = function () {
var stats = gitlab.issues_time_stats.get( $scope.comulative_time_spent = 0;
{ $scope.comulative_time_estimate = 0;
access_token: localStorage.getItem('access_token'), angular.forEach($scope.issues, function (issue) {
id: issue_project_id, $scope.comulative_time_estimate += issue.time_stats.time_estimate;
issue_iid: issue_iid $scope.comulative_time_spent += issue.time_stats.total_time_spent;
}, });
function () {
$scope.comulative_time_estimate += stats.time_estimate;
$scope.comulative_time_spent += stats.total_time_spent;
console.log($scope.comulative_time_estimate, $scope.comulative_time_spent);
}
);
return stats;
}; };
} }
angular.module('GitLabReportApp').controller('TableController', main); angular.module('GitLabReportApp').controller('TableController', main);
})(); })();
......
(function () { (function () {
'use strict'; 'use strict';
angular.module('GitLabReportApp', ['ngMaterial', 'ngResource']); angular.module('GitLabReportApp', ['ngSanitize', 'ngMaterial', 'ngResource', 'ng-showdown']);
})(); })();
......
...@@ -5,5 +5,8 @@ $(document).ready(function(){ ...@@ -5,5 +5,8 @@ $(document).ready(function(){
}); });
$(".filterbtn").click(function(){ $(".filterbtn").click(function(){
$(".sidenavfilter").toggleClass("togglefiltershow"); $(".sidenavfilter").toggleClass("togglefiltershow");
});
$(".overlaytour").click(function(){
$(".darkbg.overlaytour").remove();
}); });
}); });
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment