Skip to content

Commit

Permalink
Merge pull request #142 from TAMULib/sprint6-staging
Browse files Browse the repository at this point in the history
sprint 6
  • Loading branch information
jcreel authored Aug 27, 2018
2 parents 6e7ece8 + abc1aff commit 180e39c
Show file tree
Hide file tree
Showing 125 changed files with 6,580 additions and 1,931 deletions.
17 changes: 16 additions & 1 deletion app/config/apiMapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,16 @@ var apiMapping = {
'controller': 'ideas',
'method': 'update'
},
reject: {
'endpoint': '/private/queue',
'controller': 'ideas',
'method': 'reject'
},
sendToHelpdesk: {
'endpoint': '/private/queue',
'controller': 'ideas',
'method': 'helpdesk'
},
remove: {
'endpoint': '/private/queue',
'controller': 'ideas',
Expand Down Expand Up @@ -133,6 +143,11 @@ var apiMapping = {
'controller': 'feature-proposals',
'method': 'update'
},
reject: {
'endpoint': '/private/queue',
'controller': 'feature-proposals',
'method': 'reject'
},
remove: {
'endpoint': '/private/queue',
'controller': 'feature-proposals',
Expand Down Expand Up @@ -316,4 +331,4 @@ var apiMapping = {
'method': 'feature'
}
}
};
};
4 changes: 2 additions & 2 deletions app/config/appConfig.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var appConfig = {

'version': 'Library Webservices Status',
'version': '1.0.0',

'allowAnonymous': true,

Expand Down Expand Up @@ -35,4 +35,4 @@ var appConfig = {
// otherwise set to null or false

'mockRole': null
};
};
6 changes: 6 additions & 0 deletions app/config/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ app.config(function ($routeProvider) {
templateUrl: 'views/detail/note.html',
controller: 'NoteDetailController'
}).
when('/request/:service/:type', {
templateUrl: 'views/request/request.html',
}).
when('/request/:service', {
templateUrl: 'views/request/request.html',
}).
when('/request', {
templateUrl: 'views/request/request.html',
}).
Expand Down
27 changes: 27 additions & 0 deletions app/constants/featureProposalState.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
app.constant("FeatureProposalState", {
IN_PROGRESS: {
gloss: "In Progress",
value: "IN_PROGRESS",
summary: "Still being drafted, hidden from others, no voting."
},
ACTIVE: {
gloss: "Active",
value: "ACTIVE",
summary: "Open for voting by those logged in, displayed to all users."
},
SUBMITTED: {
gloss: "Submitted",
value: "SUBMITTED",
summary: "Sent off to project management API."
},
ON_HOLD: {
gloss: "On Hold",
value: "ON_HOLD",
summary: "Closed for voting, but not sent to project management API. \"There may be hope\"."
},
REJECTED: {
gloss: "Rejected",
value: "REJECTED",
summary: "Closed for voting, terminal state."
}
});
18 changes: 18 additions & 0 deletions app/constants/ideaState.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
app.constant('IdeaState', {
WAITING_ON_REVIEW: {
gloss: 'Waiting on Review',
value: 'WAITING_ON_REVIEW'
},
ELEVATED: {
gloss: 'Elevated',
value: 'ELEVATED'
},
SENT_TO_HELPDESK: {
gloss: 'Sent to Helpdesk',
value: 'SENT_TO_HELPDESK'
},
REJECTED: {
gloss: 'Rejected',
value: 'REJECTED'
}
});
4 changes: 2 additions & 2 deletions app/controllers/abstractIdeaController.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ app.controller('AbstractIdeaController', function ($controller, $scope, FeatureP

$scope.clearOverallCheckbox = function () {
var overallCheckbox = angular.element('#overallCheckbox')[0];
if(overallCheckbox) {
if (overallCheckbox) {
overallCheckbox.indeterminate = false;
overallCheckbox.checked = false;
overallCheckbox.checked = false;
}
};

Expand Down
29 changes: 26 additions & 3 deletions app/controllers/appAbstractController.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ app.controller("AppAbstractController", function ($controller, $scope) {
};

// Admins have management access
$scope.hasManagementAccess= function () {
$scope.hasManagementAccess = function () {
return ($scope.hasAdminAccess() || $scope.isWebManager() || $scope.isServiceManager() || $scope.isNoticeManager());
};

Expand All @@ -34,8 +34,31 @@ app.controller("AppAbstractController", function ($controller, $scope) {
};

$scope.isFullServiceConsumer = function () {
return $scope.isStaff() ||
$scope.hasManagementAccess();
return $scope.isStaff() || $scope.hasManagementAccess();
};

$scope.canManageServices = function () {
return ($scope.hasAdminAccess() || $scope.isServiceManager());
};

$scope.canManageNotes = function () {
return ($scope.hasManagementAccess() && !$scope.isNoticeManager());
};

$scope.canManageIdeas = function () {
return ($scope.hasAdminAccess() || $scope.isServiceManager());
};

$scope.canManageFeatureProposals = function () {
return ($scope.hasAdminAccess() || $scope.isServiceManager());
};

$scope.canManageNotifications = function () {
return ($scope.hasAdminAccess() || $scope.isWebManager() || $scope.isNoticeManager());
};

$scope.canManageUsers = function () {
return $scope.isAdmin();
};

});
8 changes: 5 additions & 3 deletions app/controllers/dashboardController.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ app.controller("DashboardController", function ($controller, $scope, UserService
$scope: $scope
}));

// Clear out any cached pages and get full list of services.
ServiceRepo.reset();

$scope.overallStatus = $scope.isFullServiceConsumer() ? new OverallStatusFull() : new OverallStatusPublic();

$scope.services = ServiceRepo.getAll();
Expand All @@ -30,6 +33,7 @@ app.controller("DashboardController", function ($controller, $scope, UserService
NoteRepo.getPageSettings().filters = {
active: [true]
};

NoteRepo.getPageSettings().sort = [{
property: 'service.name',
direction: 'ASC'
Expand All @@ -38,6 +42,4 @@ app.controller("DashboardController", function ($controller, $scope, UserService
direction: 'DESC'
}];

NoteRepo.page();

});
});
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
app.controller('ServiceDetailFeatureProposalListController', function ($controller, $scope, $timeout, $anchorScroll, FeatureProposalState, FeatureProposalRepo, ServiceRepo, UserRepo) {

angular.extend(
this,
$controller(
'ServiceDetailController', {
$scope: $scope
}
),
$controller(
'FeatureProposalController', {
$scope: $scope
}
),
$controller(
'AuthenticationController', {
$scope: $scope
}
)
);

ServiceRepo.ready().then(function () {
ServiceRepo.reset();
$scope.featureProposalsTableParams = $scope.service.getListFeatureProposalsTableParams();

$scope.hasFeatureProposals = function () {
return $scope.featureProposalsTableParams.data.length > 0;
};

$timeout(function () {
$anchorScroll();
}, 500);
});

if (!$scope.isAnonymous()) {
UserRepo.getUser().then(function (res) {
var apiRes = angular.fromJson(res.body);
if (apiRes.meta.status === 'SUCCESS') {
$scope.user = apiRes.payload.User;
$scope.hasVoted = function (fp) {
return fp.voters.indexOf($scope.user.id) >= 0;
};
}
});
}

$scope.isVotingOpen = function (featureProposal) {
return !$scope.isAnonymous() && featureProposal.state === FeatureProposalState.ACTIVE.value;
};

$scope.vote = function (fp) {
FeatureProposalRepo.vote(fp).then(function (res) {
var apiRes = angular.fromJson(res.body);
if (apiRes.meta.status === 'SUCCESS') {
$scope.service.getListFeatureProposalsTableParams().reload();
$scope.service.getManagedFeatureProposalsTableParams().reload();
}
});
};

});
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
app.controller('ServiceDetailFeatureProposalManagementController', function ($controller, $scope, ServiceRepo) {

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

ServiceRepo.ready().then(function () {
$scope.weaverTable = {
pageSettings: $scope.service.getManagedFeatureProposalsPageSettings(),
tableParams: $scope.service.getManagedFeatureProposalsTableParams(),
columns: [{
gloss: 'Title',
property: 'title',
filterable: false,
sortable: true
},
{
gloss: 'Description',
property: 'description',
filterable: false,
sortable: false
},
{
gloss: 'Votes',
property: 'votes',
filterable: false,
sortable: false,
isConstant: true
},
{
gloss: 'Status',
property: 'state',
filterable: false,
sortable: true,
isConstant: true
},
{
gloss: 'Last Modified',
property: 'lastModified',
filterable: false,
sortable: true
},
{
gloss: 'Private',
property: 'isPrivate',
filterable: false,
sortable: true,
isConstant: true
},
{
gloss: 'Actions',
filterable: false,
sortable: false
}
],
activeSort: []
};
});

});
Loading

0 comments on commit 180e39c

Please sign in to comment.