Skip to content

Commit

Permalink
Merge 10f0103 into 8f42e5c
Browse files Browse the repository at this point in the history
  • Loading branch information
wwelling committed Aug 15, 2018
2 parents 8f42e5c + 10f0103 commit 224df8f
Show file tree
Hide file tree
Showing 90 changed files with 1,849 additions and 855 deletions.
Empty file modified app/.htaccess
100755 → 100644
Empty file.
Empty file modified app/app.js
100755 → 100644
Empty file.
79 changes: 66 additions & 13 deletions app/config/apiMapping.js
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -55,59 +55,112 @@ var apiMapping = {
'method': 'update'
}
},
VersionManagementSoftware: {
RemoteProjectManager: {
validations: true,
lazy: true,
channel: '/channel/version-management-software',
channel: '/channel/remote-project-manager',
all: {
'endpoint': '/private/queue',
'controller': 'version-management-software',
'controller': 'remote-project-manager',
'method': '',
'httpMethod': 'GET'
},
create: {
'endpoint': '/private/queue',
'controller': 'version-management-software',
'controller': 'remote-project-manager',
'method': '',
'httpMethod': 'POST'
},
update: {
'endpoint': '/private/queue',
'controller': 'version-management-software',
'controller': 'remote-project-manager',
'method': '',
'httpMethod': 'PUT'
},
remove: {
'endpoint': '/private/queue',
'controller': 'version-management-software',
'controller': 'remote-project-manager',
'method': '',
'httpMethod': 'DELETE'
},
listen: {
'endpoint': '/channel',
'controller': 'version-management-software'
'controller': 'remote-project-manager'
},
types: {
'endpoint': '/channel',
'controller': 'version-management-software',
'controller': 'remote-project-manager',
'method': 'types/',
'httpMethod': 'GET'
},
scaffolding: {
'endpoint': '/channel',
'controller': 'version-management-software',
'controller': 'remote-project-manager',
'method': 'scaffolding/:type/',
'httpMethod': 'GET'
}
},
VersionProject: {
Status: {
validations: true,
lazy: true,
channel: '/channel/status',
all: {
'endpoint': '/private/queue',
'controller': 'projects'
'controller': 'status',
'method': '',
'httpMethod': 'GET'
},
getByScopeId: {
create: {
'endpoint': '/private/queue',
'controller': 'projects'
'controller': 'status',
'method': '',
'httpMethod': 'POST'
},
update: {
'endpoint': '/private/queue',
'controller': 'status',
'method': '',
'httpMethod': 'PUT'
},
remove: {
'endpoint': '/private/queue',
'controller': 'status',
'method': '',
'httpMethod': 'DELETE'
},
listen: {
'endpoint': '/channel',
'controller': 'status'
}
},
RemoteProjects: {
all: {
'endpoint': '/private/queue',
'controller': 'projects/remote'
},
listen: {
'endpoint': '/channel',
'controller': 'projects/remote'
}
},
ProjectsStats: {
all: {
'endpoint': '/private/queue',
'controller': 'projects/stats'
},
listen: {
'endpoint': '/channel',
'controller': 'projects/stats'
}
},
ActiveSprints: {
all: {
'endpoint': '/private/queue',
'controller': 'sprints/active'
},
listen: {
'endpoint': '/channel',
'controller': 'sprints/active'
}
}
};
53 changes: 27 additions & 26 deletions app/config/appConfig.js
Original file line number Diff line number Diff line change
@@ -1,38 +1,39 @@
var appConfig = {

'version': '1.0.0',
'version': '1.0.0',

'allowAnonymous': true,
'allowAnonymous': true,

'anonymousRole': 'ROLE_ANONYMOUS',
'anonymousRole': 'ROLE_ANONYMOUS',

// Set this to the webService if mocking AuthService
// Set this to the webService if mocking AuthService

'authService': 'https://labs.library.tamu.edu/auth3',
'webService': 'http://localhost:9000',
'authService': 'https://labs.library.tamu.edu/auth3',
'webService': 'http://localhost:9001',

'storageType': 'session',
'storageType': 'session',

'logging': {
'log': true,
'info': true,
'warn': true,
'error': true,
'debug': true
},
'logging': {
'log': true,
'info': true,
'warn': true,
'error': true,
'debug': true
},

'stompDebug': false,
'stompDebug': false,

/*
Determines the type of connection stomp will attempt to make with the service.
TYPES: websocket, xhr-streaming, xdr-streaming, eventsource, iframe-eventsource,
htmlfile, iframe-htmlfile, xhr-polling, xdr-polling, iframe-xhr-polling,
jsonp-polling
*/
'sockJsConnectionType': ['websocket', 'xhr-streaming', 'xhr-polling', 'xdr-streaming', 'xdr-polling', 'iframe-eventsource', 'iframe-htmlfile', 'jsonp-polling'],
/*
Determines the type of connection stomp will attempt to make with the service.
TYPES: websocket, xhr-streaming, xdr-streaming, eventsource, iframe-eventsource,
htmlfile, iframe-htmlfile, xhr-polling, xdr-polling, iframe-xhr-polling,
jsonp-polling
*/
'sockJsConnectionType': ['websocket', 'xhr-streaming', 'xhr-polling', 'xdr-streaming', 'xdr-polling', 'iframe-eventsource', 'iframe-htmlfile', 'jsonp-polling'],

// Set this to 'admin' or 'user' if using mock AuthService
// otherwise set to null or false
// Set this to 'admin' or 'user' if using mock AuthService
// otherwise set to null or false

'mockRole': null
};
'mockRole': null

};
7 changes: 1 addition & 6 deletions app/config/routes.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
app.config(function ($routeProvider) {
$routeProvider.
when('/management', {
redirectTo: '/management/projects',
access: ["ROLE_ADMIN", "ROLE_MANGER"]
redirectTo: '/management/projects'
}).
when('/management/:tab', {
templateUrl: 'views/management.html',
access: ["ROLE_ADMIN", "ROLE_MANGER"]
}).
when('/projects', {
templateUrl: '/views/management/projects.html',
access: ["ROLE_ADMIN", "ROLE_MANGER"]
}).
when('/home', {
redirectTo: '/'
}).
Expand Down
Empty file modified app/config/runTime.js
100755 → 100644
Empty file.
69 changes: 69 additions & 0 deletions app/controllers/activeSprintsController.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
app.controller('ActiveSprintsController', function ($controller, $sce, $scope, ActiveSprintsService, StatusRepo) {

angular.extend(this, $controller('AbstractController', {
$scope: $scope
}));

if (sessionStorage.selected === undefined) {
sessionStorage.selected = 0;
}

var trusted = {};

$scope.statuses = StatusRepo.getAll();

$scope.activeSprints = ActiveSprintsService.getActiveSprints();

$scope.select = function (index) {
sessionStorage.selected = index;
};

$scope.kanbanHeader = function () {
return $scope.getSelectedSprint() ? $scope.getSelectedSprint().project + ": " + $scope.getSelectedSprint().name : "Select Sprint Above";
};

$scope.getSprintEstimateTotal = function (sprint) {
var total = 0;
for (var i in sprint.cards) {
var card = sprint.cards[i];
if (card.estimate) {
total += card.estimate;
}
}
return total;
};

$scope.getStatusEstimateTotal = function (status) {
var total = 0;
var sprint = $scope.getSelectedSprint();
for (var i in sprint.cards) {
var card = sprint.cards[i];
if (card.status === status.identifier && card.estimate) {
total += card.estimate;
}
}
return total;
};

$scope.getAvatarUrl = function (assignee) {
return appConfig.webService + "/images/" + assignee.avatar;
};

$scope.getHtmlContent = function (content) {
return trusted[content] || (trusted[content] = $sce.trustAsHtml(content));
};

$scope.getSelectedSprint = function () {
return $scope.activeSprints.length > 0 ? $scope.activeSprints[sessionStorage.selected] : undefined;
};

ActiveSprintsService.updated.then(null, null, function () {
if ($scope.activeSprints.length > 0) {
while (sessionStorage.selected >= $scope.activeSprints.length) {
sessionStorage.selected--;
}
$scope.select(sessionStorage.selected);
}
});

});
78 changes: 21 additions & 57 deletions app/controllers/projectController.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
app.controller('ProjectController', function ($controller, $scope, $rootScope, NgTableParams, ApiResponseActions, Project, ProjectRepo, VersionManagementSoftwareRepo, VersionProjectService) {
app.controller('ProjectController', function ($controller, $scope, ApiResponseActions, ProjectRepo, RemoteProjectManagerRepo, RemoteProjectsService) {

angular.extend(this, $controller('AbstractController', {
$scope: $scope
}));

$scope.vmses = VersionManagementSoftwareRepo.getAll();

$scope.projects = ProjectRepo.getAll();

$scope.projectToCreate = ProjectRepo.getScaffold();
Expand All @@ -32,12 +30,12 @@ app.controller('ProjectController', function ($controller, $scope, $rootScope, N
$scope.createProject = function () {
ProjectRepo.create($scope.projectToCreate).then(function (res) {
if (angular.fromJson(res.body).meta.status === 'SUCCESS') {
$scope.cancelCreateProject();
$scope.resetCreateProject();
}
});
};

$scope.cancelCreateProject = function () {
$scope.resetCreateProject = function () {
angular.extend($scope.projectToCreate, ProjectRepo.getScaffold());
$scope.resetProjectForms();
};
Expand Down Expand Up @@ -78,64 +76,30 @@ app.controller('ProjectController', function ($controller, $scope, $rootScope, N
});
};

var buildTable = function () {
var allProjects = ProjectRepo.getAll();
$scope.tableParams = new NgTableParams({
count: allProjects.length,
sorting: {
name: 'asc'
}
}, {
counts: [],
total: 0,
getData: function (params) {
return $scope.projects;
}
});
};
if ($scope.isManager() || $scope.isAdmin()) {
$scope.remoteProjectManagers = RemoteProjectManagerRepo.getAll();

$scope.vmsVersionProjects = {};
$scope.remoteProjects = RemoteProjectsService.getRemoteProjects();

var getVmsById = function (id) {
VersionProjectService.getAll(id).then(function (versionProjects) {
$scope.vmsVersionProjects[id] = versionProjects;
});
};
$scope.getRemoteProjectManagerRemoteProjects = function (remoteProjectManagerId) {
return $scope.remoteProjects[remoteProjectManagerId];
};

VersionManagementSoftwareRepo.ready().then(function () {
for (var i in $scope.vmses) {
if (i !== 'visibleColumnCount') {
getVmsById($scope.vmses[i].id);
RemoteProjectManagerRepo.listen([ApiResponseActions.CREATE, ApiResponseActions.DELETE, ApiResponseActions.UPDATE], function () {
$scope.remoteProjectManagers.length = 0;
var remoteProjectManagers = RemoteProjectManagerRepo.getAll();
for (var i in remoteProjectManagers) {
$scope.remoteProjectManagers.push(remoteProjectManagers[i]);
}
}
});

$scope.getVmsVersionProjects = function (vmsId) {
return $scope.vmsVersionProjects[vmsId];
};

$scope.getVmsVersionProjects = function (vmsId) {
return $scope.vmsVersionProjects[vmsId];
};
});
}

$scope.getVersionProject = function (project) {
if (project.scopeId && project.versionManagementSoftware && !project.versionProject) {
project.versionProject = {};
VersionProjectService.getByScopeId(project.versionManagementSoftware.id, project.scopeId).then(function (versionProject) {
angular.extend(project, {
versionProject: versionProject
});
});
ProjectRepo.listen([ApiResponseActions.CREATE, ApiResponseActions.DELETE, ApiResponseActions.UPDATE], function () {
$scope.projects.length = 0;
var projects = ProjectRepo.getAll();
for (var i in projects) {
$scope.projects.push(projects[i]);
}
return project.versionProject;
};

ProjectRepo.ready().then(function () {
buildTable();
});

ProjectRepo.listen([ApiResponseActions.CREATE, ApiResponseActions.DELETE, ApiResponseActions.UPDATE], function (arg) {
buildTable();
});

});

0 comments on commit 224df8f

Please sign in to comment.