Skip to content

Commit

Permalink
Merge pull request #50 from LutherCS/issue-13
Browse files Browse the repository at this point in the history
Filter courses by proposal type.
  • Loading branch information
jackjo06 authored Apr 21, 2018
2 parents 3cdf0b8 + b42196c commit 7774b9b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/main/webapp/js/dashboardModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ app.constant("filterList",
{ idx : 1, name : "Title/Name"},
{ idx : 2, name : "Department"},
{ idx : 3, name : "Division"},
{ idx : 4, name : "Owner"}
{ idx : 4, name : "Owner"},
{ idx : 5, name : "Status"}
]
);

Expand All @@ -31,7 +32,8 @@ app.controller("courseListCtrl", ["$scope", "$rootScope", "$log", "$filter", "fi
{ idx : 1, name : "Department"},
{ idx : 2, name : "Division"},
{ idx : 3, name : "Date"},
{ idx : 4, name : "Owner"}
{ idx : 4, name : "Owner"},
{ idx : 5, name : "Status"}
];

$scope.queries = { "filter" : null,
Expand Down Expand Up @@ -82,7 +84,7 @@ app.controller("courseListCtrl", ["$scope", "$rootScope", "$log", "$filter", "fi
var filter = $scope.queries.filter;
switch ($scope.currFilter.idx) {
case 0:
return $filter('searchProposal')(elems, filter, ["owner"], ["title","name","dept","division"]);
return $filter('searchProposal')(elems, filter, ["owner", "action"], ["title","name","dept","division"]);
case 1:
return $filter('searchProposal')(elems, filter, [], ["title", "name"]);
case 2:
Expand All @@ -91,6 +93,8 @@ app.controller("courseListCtrl", ["$scope", "$rootScope", "$log", "$filter", "fi
return $filter('searchProposal')(elems, filter, [], ["division"]);
case 4:
return $filter('searchProposal')(elems, filter, ["owner"], []);
case 5:
return $filter('searchProposal')(elems, filter, ["action"], []);
default:
return elems;
}
Expand All @@ -108,7 +112,9 @@ app.controller("courseListCtrl", ["$scope", "$rootScope", "$log", "$filter", "fi
return elem.date;
case 4:
return elem.owner;
default:
case 5:
return elem.action;
default:
if (elem.newCourse)
return elem.newCourse.name;
else return elem.name;
Expand Down
2 changes: 2 additions & 0 deletions src/main/webapp/js/proposal.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ function proposalCtrl($rootScope, $scope, $log, $location, $routeParams, $filter

if (!courseName) {
$scope.proposal["newCourse"] = newCourse;
$scope.proposal.action = "NEW";
} else {
//load data
var course = userSrv.addToRecentlyViewed(courseName, courseTitle, $scope.courses, $scope.allProposals);
Expand All @@ -103,6 +104,7 @@ function proposalCtrl($rootScope, $scope, $log, $location, $routeParams, $filter
"desc": course.desc,

};
$scope.proposal.action = "MOD";
// ISSUE 21 (Gen eds do not properly populate the edit form):
// Though the gen_ed property of newCourse contains its gen eds,
// the course object holds its gen eds in the gen_eds property. This is a
Expand Down

0 comments on commit 7774b9b

Please sign in to comment.