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 @@
function main($rootScope, $scope, $mdSidenav, gitlab, auth) {
$scope.$watch('project', function () {
$scope.labels = null;
$scope.milestone = null;
$scope.state = null;
localStorage.removeItem('labels');
localStorage.removeItem('milestone');
localStorage.removeItem('state');
$scope.resetFilter();
if ($scope.project) {
$scope.loadProjectLabels();
$scope.loadProjectMilestones();
......@@ -89,9 +83,22 @@
$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_spent = true;
$rootScope.show_show_logo_print = true;
$rootScope.show_hyperlinks = true;
$rootScope.table_columns = [
'srno',
'iid',
......@@ -103,6 +110,7 @@
'total_time_spent',
'state'
];
$scope.loadProjects();
}
......
......@@ -4,8 +4,7 @@
function main($rootScope, $scope, gitlab, auth) {
$rootScope.$on('local-storage-updated', function () {
$scope.comulative_time_spent = 0;
$scope.comulative_time_estimate = 0;
$scope.filter_milestone = localStorage.getItem('milestone');
$scope.loadIssues();
});
......@@ -33,6 +32,7 @@
$scope.issues = gitlab.projects_issues.query(
params,
function () {
$scope.recalculateTimeStats();
},
function () {
auth.redirectToOauth();
......@@ -40,27 +40,17 @@
);
};
$scope.getIssuesTimeStats = function (issue_project_id, issue_iid) {
var stats = gitlab.issues_time_stats.get(
{
access_token: localStorage.getItem('access_token'),
id: issue_project_id,
issue_iid: issue_iid
},
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;
$scope.recalculateTimeStats = function () {
$scope.comulative_time_spent = 0;
$scope.comulative_time_estimate = 0;
angular.forEach($scope.issues, function (issue) {
$scope.comulative_time_estimate += issue.time_stats.time_estimate;
$scope.comulative_time_spent += issue.time_stats.total_time_spent;
});
};
}
angular.module('GitLabReportApp').controller('TableController', main);
})();
......
(function () {
'use strict';
angular.module('GitLabReportApp', ['ngMaterial', 'ngResource']);
angular.module('GitLabReportApp', ['ngSanitize', 'ngMaterial', 'ngResource', 'ng-showdown']);
})();
......
......@@ -5,5 +5,8 @@ $(document).ready(function(){
});
$(".filterbtn").click(function(){
$(".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